Commit 74beaae0 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.47

parent ab114917
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 46
SUBLEVEL = 47
ARCH = i386
......
......@@ -223,10 +223,6 @@ static void floppy_off(unsigned int nr);
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
#else
#error "unknown blk device"
#endif
#if (MAJOR_NR != SCSI_TAPE_MAJOR)
......
......@@ -231,7 +231,7 @@ static struct {
{{3, 250, 16, 16, 3000, 100, 300, 0, 2, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0,
0, { 4,22,21,30, 3, 0, 0, 0}, 150, 4 }, "720k" }, /*3 1/2 DD*/
{{4, 500, 16, 16, 3000, 40, 300, 10, 2, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0,
{{4, 500, 16, 16, 4000, 40, 300, 10, 2, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0,
0, { 7, 4,25,22,31,21,29,11}, 150, 7 }, "1.44M" }, /*3 1/2 HD*/
{{5, 1000, 15, 8, 3000, 40, 300, 10, 2, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0,
......
......@@ -866,6 +866,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
if (err)
return err;
memcpy_tofs((char *)arg, (char *) hd_ident_info[dev], sizeof(struct hd_driveid));
return 0;
RO_IOCTLS(inode->i_rdev,arg);
default:
......
......@@ -1457,13 +1457,13 @@ void poke_blanked_console(void)
}
}
void * memsetw(void * s,unsigned short c,int count)
void * memsetw(void * s, unsigned short c, unsigned int count)
{
__asm__("cld\n\t"
"rep\n\t"
"stosw"
: /* no output */
:"a" (c),"D" (s),"c" (count)
:"a" (c),"D" (s),"c" (count/2)
:"cx","di");
return s;
}
......
......@@ -16,13 +16,17 @@
* Note: lockstate is used as index in the array key_map.
*/
struct kbd_struct {
unsigned char ledstate; /* 3 bits */
unsigned char ledstate; /* 3 bits */
unsigned char default_ledstate;
unsigned char lockstate; /* 3 bits */
#define VC_SCROLLOCK 0 /* scroll-lock mode */
#define VC_NUMLOCK 1 /* numeric lock mode */
#define VC_CAPSLOCK 2 /* capslock mode */
unsigned char lockstate; /* 4 bits - must be in 0..15 */
#define VC_SHIFTLOCK KG_SHIFT /* shift lock mode */
#define VC_ALTGRLOCK KG_ALTGR /* altgr lock mode */
#define VC_CTRLLOCK KG_CTRL /* control lock mode */
#define VC_ALTLOCK KG_ALT /* alt lock mode */
unsigned char modeflags;
#define VC_APPLIC 0 /* application key mode */
......
......@@ -344,15 +344,15 @@ static void keyboard_interrupt(int int_pt_regs)
u_char type;
/* the XOR below used to be an OR */
int shift_final = shift_state ^ vc_kbd_lock(kbd,VC_CAPSLOCK);
int shift_final = shift_state ^ kbd->lockstate;
key_code = key_map[shift_final][scancode];
type = KTYP(key_code);
if (type == KT_LETTER) {
type = KT_LATIN;
if (vc_kbd_lock(kbd,VC_CAPSLOCK))
key_code = key_map[shift_final][scancode];
if (vc_kbd_led(kbd,VC_CAPSLOCK))
key_code = key_map[shift_final ^ (1<<KG_SHIFT)][scancode];
}
(*key_handler[type])(key_code & 0xff, up_flag);
}
......@@ -404,7 +404,6 @@ static void caps_toggle(void)
if (rep)
return;
chg_vc_kbd_led(kbd,VC_CAPSLOCK);
chg_vc_kbd_lock(kbd,VC_CAPSLOCK);
}
static void caps_on(void)
......@@ -412,7 +411,6 @@ static void caps_on(void)
if (rep)
return;
set_vc_kbd_led(kbd,VC_CAPSLOCK);
set_vc_kbd_lock(kbd,VC_CAPSLOCK);
}
static void show_ptregs(void)
......@@ -463,10 +461,8 @@ static void num(void)
applkey('P', 1);
return;
}
if (!rep) { /* no autorepeat for numlock, ChN */
if (!rep) /* no autorepeat for numlock, ChN */
chg_vc_kbd_led(kbd,VC_NUMLOCK);
chg_vc_kbd_lock(kbd,VC_NUMLOCK);
}
}
static void lastcons(void)
......@@ -647,7 +643,8 @@ static void do_pad(unsigned char value, char up_flag)
applkey(app_map[value], 1);
return;
}
if (!vc_kbd_lock(kbd,VC_NUMLOCK))
if (!vc_kbd_led(kbd,VC_NUMLOCK))
switch (value) {
case KVAL(K_PCOMMA):
case KVAL(K_PDOT):
......@@ -709,10 +706,8 @@ static void do_shift(unsigned char value, char up_flag)
/* kludge... */
if (value == KVAL(K_CAPSSHIFT)) {
value = KVAL(K_SHIFT);
if (!up_flag) {
if (!up_flag)
clr_vc_kbd_led(kbd, VC_CAPSLOCK);
clr_vc_kbd_lock(kbd, VC_CAPSLOCK);
}
}
if (up_flag) {
......
......@@ -931,9 +931,9 @@ static int write_chan(struct tty_struct * tty, struct file * file,
if (opost(c, tty) < 0)
break;
b++; nr--;
if (tty->driver.flush_chars)
tty->driver.flush_chars(tty);
}
if (tty->driver.flush_chars)
tty->driver.flush_chars(tty);
} else {
c = tty->driver.write(tty, 1, b, nr);
b += c;
......
......@@ -1535,8 +1535,10 @@ int tty_register_driver(struct tty_driver *driver)
return 0;
error = register_chrdev(driver->major, driver->name, &tty_fops);
if (error)
if (error < 0)
return error;
else if(driver->major == 0)
driver->major = error;
if (!driver->put_char)
driver->put_char = tty_default_put_char;
......@@ -1545,7 +1547,7 @@ int tty_register_driver(struct tty_driver *driver)
driver->next = tty_drivers;
tty_drivers->prev = driver;
tty_drivers = driver;
return 0;
return error;
}
/*
......@@ -1589,7 +1591,7 @@ long tty_init(long kmem_start)
panic("size of tty structure > PAGE_SIZE!");
if (register_chrdev(TTY_MAJOR,"tty",&tty_fops))
panic("unable to get major %d for tty device", TTY_MAJOR);
if (register_chrdev(TTYAUX_MAJOR,"tty",&tty_fops))
if (register_chrdev(TTYAUX_MAJOR,"cua",&tty_fops))
panic("unable to get major %d for tty device", TTYAUX_MAJOR);
kmem_start = kbd_init(kmem_start);
......
......@@ -193,6 +193,11 @@
* DIFFERENTIAL - if defined, NCR53c81 chips will use external differential
* transceivers.
*
* LIMIT_TRANSFERSIZE - if defined, limit the pseudo-dma transfers to 512
* bytes at a time. Since interrupts are disabled by default during
* these transfers, we might need this to give reasonable interrupt
* service time if the transfer size gets too large.
*
* LINKED - if defined, linked commands are supported.
*
* PSEUDO_DMA - if defined, PSEUDO DMA is used during the data transfer phases.
......@@ -1980,10 +1985,16 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) {
if (!cmd->device->borken &&
(transfersize = NCR5380_dma_xfer_len(instance, cmd)) != 0) {
#else
if (!cmd->device->borken &&
(transfersize = cmd->transfersize) &&
cmd->SCp.this_residual && !(cmd->SCp.this_residual %
transfersize)) {
transfersize = cmd->transfersize;
#ifdef LIMIT_TRANSFERSIZE /* If we have problems with interrupt service */
if( transfersize > 512 )
transfersize = 512;
#endif /* LIMIT_TRANSFERSIZE */
if (!cmd->device->borken && transfersize &&
cmd->SCp.this_residual && !(cmd->SCp.this_residual %
transfersize)) {
#endif
len = transfersize;
if (NCR5380_transfer_dma(instance, &phase,
......
......@@ -4,4 +4,5 @@ extern void print_command(unsigned char *);
extern int print_msg(unsigned char *);
extern void print_sense(char *, Scsi_Cmnd *);
extern void print_status(int);
extern void print_Scsi_Cmnd (Scsi_Cmnd *);
#endif /* def _CONSTANTS_H */
#define AUTOSENSE
#define PSEUDO_DMA
#define FOO
#define UNSAFE /* Not unsafe for PAS16 -- use it */
/*
* This driver adapted from Drew Eckhardt's Trantor T128 driver
......@@ -40,6 +42,11 @@
* AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
* for commands that return with a CHECK CONDITION status.
*
* LIMIT_TRANSFERSIZE - if defined, limit the pseudo-dma transfers to 512
* bytes at a time. Since interrupts are disabled by default during
* these transfers, we might need this to give reasonable interrupt
* service time if the transfer size gets too large.
*
* PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance
* increase compared to polled I/O.
*
......@@ -47,11 +54,13 @@
*
* SCSI2 - enable support for SCSI-II tagged queueing. Untested.
*
*
* UNSAFE - leave interrupts enabled during pseudo-DMA transfers. You
* only really want to use this if you're having a problem with
* dropped characters during high speed communications, and even
* then, you're going to be better off twiddling with transfersize.
* UNSAFE - leave interrupts enabled during pseudo-DMA transfers. This
* parameter comes from the NCR5380 code. It is NOT unsafe with
* the PAS16 and you should use it. If you don't you will have
* a problem with dropped characters during high speed
* communications during SCSI transfers. If you really don't
* want to use UNSAFE you can try defining LIMIT_TRANSFERSIZE or
* twiddle with the transfer size in the high level code.
*
* USLEEP - enable support for devices that don't disconnect. Untested.
*
......@@ -242,7 +251,7 @@ void init_board( unsigned short io_port, int irq, int force_irq )
int pas16_hw_detect( unsigned short board_num )
{
unsigned char board_rev, tmp;
unsigned short port = bases[ board_num ].io_port;
unsigned short io_port = bases[ board_num ].io_port;
/* See if we can find a PAS16 board at the address associated
* with this logical board number.
......@@ -251,26 +260,39 @@ int pas16_hw_detect( unsigned short board_num )
/* First, attempt to take a newer model board out of reset and
* give it a base address. This shouldn't affect older boards.
*/
enable_board( board_num, port );
enable_board( board_num, io_port );
/* Now see if it looks like a PAS16 board */
board_rev = inb( port + PCB_CONFIG );
board_rev = inb( io_port + PCB_CONFIG );
if( board_rev == 0xff )
return 0;
tmp = board_rev ^ 0xe0;
outb( tmp, port + PCB_CONFIG );
tmp = inb( port + PCB_CONFIG );
outb( board_rev, port + PCB_CONFIG );
outb( tmp, io_port + PCB_CONFIG );
tmp = inb( io_port + PCB_CONFIG );
outb( board_rev, io_port + PCB_CONFIG );
if( board_rev != tmp ) /* Not a PAS-16 */
return 0;
if( ( inb( port + OPERATION_MODE_1 ) & 0x03 ) != 0x03 )
if( ( inb( io_port + OPERATION_MODE_1 ) & 0x03 ) != 0x03 )
return 0; /* return if no SCSI interface found */
/* Mediavision has some new model boards that return ID bits
* that indicate a SCSI interface, but they're not (LMS). We'll
* put in an additional test to try and weed them out.
*/
outb( 0x01, io_port + WAIT_STATE ); /* 1 Wait state */
NCR5380_write( MODE_REG, 0x20 ); /* Is it really SCSI? */
if( NCR5380_read( MODE_REG ) != 0x20 ) /* Write to a reg. */
return 0; /* and try to read */
NCR5380_write( MODE_REG, 0x00 ); /* it back. */
if( NCR5380_read( MODE_REG ) != 0x00 )
return 0;
return 1;
}
......@@ -426,7 +448,15 @@ int pas16_biosparam(Disk * disk, int dev, int * ip)
int size = disk->capacity;
ip[0] = 64;
ip[1] = 32;
ip[2] = size >> 11;
ip[2] = size >> 11; /* I think I have it as /(32*64) */
if( ip[2] > 1024 ) { /* yes, >, not >= */
ip[0]=255;
ip[1]=63;
ip[2]=size/(63*255);
if( ip[2] > 1023 ) /* yes >1023... */
ip[2] = 1023;
}
return 0;
}
......
......@@ -627,7 +627,20 @@ are any multiple of 512 bytes long. */
printk("\n");
};
#endif
/* Some dumb host adapters can speed transfers by knowing the
* minimum tranfersize in advance.
*
* We shouldn't disconnect in the middle of a sector, but the cdrom
* sector size can be larger than the size of a buffer and the
* transfer may be split to the size of a buffer. So it's safe to
* assume that we can at least transfer the minimum of the buffer
* size (1024) and the sector size between each connect / disconnect.
*/
SCpnt->transfersize = (scsi_CDs[dev].sector_size > 1024) ?
1024 : scsi_CDs[dev].sector_size;
SCpnt->this_count = this_count;
scsi_do_cmd (SCpnt, (void *) cmd, buffer,
realcount * scsi_CDs[dev].sector_size,
......
......@@ -316,10 +316,7 @@ int ext2_new_block (struct super_block * sb, unsigned long goal,
else
lmap |= 0xffffffff << (31 - (j & 31));
if (lmap != 0xffffffffl) {
__asm__ ("bsfl %1,%0"
: "=r" (k)
: "r" (~lmap));
k++;
k = ffz(lmap) + 1;
if ((j + k) < EXT2_BLOCKS_PER_GROUP(sb)) {
j += k;
goto got_block;
......
......@@ -121,4 +121,16 @@ extern inline int find_next_zero_bit (unsigned long * addr, int size,
return (offset + set + res);
}
/*
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
extern inline unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
:"r" (~word));
return word;
}
#endif /* _I386_BITOPS_H */
#ifndef _LINUX_NCP_H_
#define _LINUX_NCP_H_
#define NCP_OPEN 0x1111
#define NCP_CLOSE 0x5555
#define NCP_REQUEST 0x2222
#define NCP_REPLY 0x3333
struct ncp_request
{
unsigned short p_type __attribute__ ((packed));
unsigned char seq __attribute__ ((packed));
unsigned char c_low __attribute__ ((packed));
unsigned char task __attribute__ ((packed));
unsigned char c_high __attribute__ ((packed));
unsigned char func __attribute__ ((packed));
};
struct ncp_request_sf
{
unsigned short p_type __attribute__ ((packed));
unsigned char seq __attribute__ ((packed));
unsigned char c_low __attribute__ ((packed));
unsigned char task __attribute__ ((packed));
unsigned char c_high __attribute__ ((packed));
unsigned char func __attribute__ ((packed));
unsigned short s_len __attribute__ ((packed));
unsigned char s_func __attribute__ ((packed));
};
struct ncp_reply
{
unsigned short p_type __attribute__ ((packed));
unsigned char seq __attribute__ ((packed));
unsigned char c_low __attribute__ ((packed));
unsigned char task __attribute__ ((packed));
unsigned char c_high __attribute__ ((packed));
unsigned char f_stat __attribute__ ((packed));
unsigned char c_stat __attribute__ ((packed));
};
#define OTYPE_USER 0x0001
#define OTYPE_GROUP 0x0002
#define OTYPE_PQUEUE 0x0003
#define OTYPE_FSERVER 0x0004
#define OTYPE_JSERVER 0x0005
#define OTYPE_PSERVER 0x0007
#define OTYPE_UNKNOWN_1 0x002E
#define OTYPE_ADV_PSERVER 0x0047
#define OTYPE_AFSERVER 0x0107
#define OTYPE_UNKNOWN_2 0x0143
#define OTYPE_UNKNOWN_3 0x01F5
#define OTYPE_UNKNOWN_4 0x023F
#define LIMIT_OBJNAME 47
struct bind_obj
{
unsigned long id __attribute__ ((packed));
unsigned short type __attribute__ ((packed));
char name[LIMIT_OBJNAME+1] __attribute__ ((packed));
};
struct get_bind_obj
{
unsigned short type __attribute__ ((packed));
unsigned char n_len __attribute__ ((packed));
char name[0] __attribute__ ((packed));
};
struct scan_bind_obj
{
unsigned long id __attribute__ ((packed));
unsigned short type __attribute__ ((packed));
unsigned char n_len __attribute__ ((packed));
char name[0] __attribute__ ((packed));
};
struct login_req
{
unsigned char password[8] __attribute__ ((packed));
unsigned short type __attribute__ ((packed));
unsigned char n_len __attribute__ ((packed));
char name[0] __attribute__ ((packed));
};
struct ncp_time
{
unsigned char year __attribute__ ((packed));
unsigned char month __attribute__ ((packed));
unsigned char day __attribute__ ((packed));
unsigned char hours __attribute__ ((packed));
unsigned char mins __attribute__ ((packed));
unsigned char secs __attribute__ ((packed));
unsigned char c_secs __attribute__ ((packed));
};
struct login_info
{
unsigned long id __attribute__ ((packed));
unsigned short un1 __attribute__ ((packed));
char name[LIMIT_OBJNAME+1] __attribute__ ((packed));
struct ncp_time time __attribute__ ((packed));
};
#endif
......@@ -20,6 +20,7 @@ struct linger {
#define SOCK_RAW 3 /* raw socket */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequential packet socket */
#define SOCK_NCP 6 /* Novell NCP socket */
#define SOCK_PACKET 10 /* linux specific way of */
/* getting packets at the dev */
/* level. For writing rarp and */
......
......@@ -177,7 +177,8 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait)
switch(sel_type)
{
case SEL_IN:
if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE)
if ((sk->type==SOCK_SEQPACKET || sk->type==SOCK_NCP)
&& sk->state==TCP_CLOSE)
{
/* Connection closed: Wake up */
return(1);
......
This diff is collapsed.
/*
*
* Kernel support for NCP
*
* Mark Evans 1994
*
*/
#ifndef _NCP_H
#define _NCP_H
#include <linux/ncp.h>
struct ncp_info
{
unsigned short conn; /* connection number */
unsigned char seq; /* sequence number */
ipx_socket *ncp; /* ncp socket */
ipx_socket *watchdog; /* watchdog socket */
ipx_socket *mail; /* mail socket */
};
#define NCP_TIMEOUT (3*HZ)
#define MAX_TIMEOUT 15
#endif /* _NCP_H */
......@@ -41,6 +41,7 @@
#endif
#ifdef CONFIG_IPX
#include "ipx.h"
#include "ncp.h"
#endif
#define SOCK_ARRAY_SIZE 64
......@@ -137,6 +138,7 @@ struct sock {
#ifdef CONFIG_IPX
ipx_address ipx_source_addr,ipx_dest_addr;
unsigned short ipx_type;
struct ncp_info ncp;
#endif
#ifdef CONFIG_AX25
/* Really we want to add a per protocol private area */
......
......@@ -592,7 +592,8 @@ static int sock_socket(int family, int type, int protocol)
if ((type != SOCK_STREAM && type != SOCK_DGRAM &&
type != SOCK_SEQPACKET && type != SOCK_RAW &&
type != SOCK_PACKET) || protocol < 0)
type != SOCK_PACKET && type != SOCK_NCP)
|| protocol < 0)
return(-EINVAL);
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment