Commit 1ae1c847 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.13

parent cac3e1c7
...@@ -15,6 +15,14 @@ N: Werner Almesberger ...@@ -15,6 +15,14 @@ N: Werner Almesberger
E: almesber@bernina.ethz.ch E: almesber@bernina.ethz.ch
D: dosfs, LILO, some fd features, various other hacks here and there D: dosfs, LILO, some fd features, various other hacks here and there
N: H. Peter Anvin
E: Peter.Anvin@linux.org
D: Author of the SYSLINUX boot loader, maintainer of the linux.* news
D: hierarchy, responsible for various console and other hacks
S: 4390 Albany Dr. #46
S: San Jose CA 95129
S: USA
N: Derek Atkins N: Derek Atkins
E: warlord@MIT.EDU E: warlord@MIT.EDU
D: Linux-AFS Port, random kernel hacker, D: Linux-AFS Port, random kernel hacker,
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 12 SUBLEVEL = 13
ARCH = i386 ARCH = i386
......
...@@ -160,7 +160,7 @@ asmlinkage unsigned long osf_mmap(unsigned long addr, unsigned long len, ...@@ -160,7 +160,7 @@ asmlinkage unsigned long osf_mmap(unsigned long addr, unsigned long len,
struct file * file = NULL; struct file * file = NULL;
if (flags & (MAP_HASSEMAPHORE | MAP_INHERIT | MAP_UNALIGNED)) if (flags & (MAP_HASSEMAPHORE | MAP_INHERIT | MAP_UNALIGNED))
printk("%s: unimplemented OSF mmap flags %04lx\n", current->comm, osf_flags); printk("%s: unimplemented OSF mmap flags %04lx\n", current->comm, flags);
if (!(flags & MAP_ANONYMOUS)) { if (!(flags & MAP_ANONYMOUS)) {
if (fd >= NR_OPEN || !(file = current->files->fd[fd])) if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
return -EBADF; return -EBADF;
......
...@@ -142,7 +142,7 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg, ...@@ -142,7 +142,7 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
/* /*
* Handle user-level unaligned fault. For now, simply send a * Handle user-level unaligned fault. For now, simply send a
* SIGSEGV---there should be little reason for users not wanting to * SIGBUS---there should be little reason for users not wanting to
* fix their code instead. Notice that we have the regular kernel * fix their code instead. Notice that we have the regular kernel
* stack layout here, so finding the appropriate registers is a little * stack layout here, so finding the appropriate registers is a little
* more difficult than in the kernel case. Also, we'd need to do * more difficult than in the kernel case. Also, we'd need to do
...@@ -153,7 +153,7 @@ asmlinkage void do_entUnaUser(void *va, unsigned long opcode, unsigned long reg, ...@@ -153,7 +153,7 @@ asmlinkage void do_entUnaUser(void *va, unsigned long opcode, unsigned long reg,
struct pt_regs regs) struct pt_regs regs)
{ {
regs.pc -= 4; /* make pc point to faulting insn */ regs.pc -= 4; /* make pc point to faulting insn */
send_sig(SIGSEGV, current, 1); send_sig(SIGBUS, current, 1);
} }
/* /*
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
* Changed to prevent keyboard lockups on AST Power Exec. * Changed to prevent keyboard lockups on AST Power Exec.
* 28Jul93 Brad Bosch - brad@lachman.com * 28Jul93 Brad Bosch - brad@lachman.com
* *
* Modified by Johan Myreen (jem@cs.hut.fi) 04Aug93 * Modified by Johan Myreen (jempandora.pp.fi) 04Aug93
* to include support for QuickPort mouse. * to include support for QuickPort mouse.
* *
* Changed references to "QuickPort" with "82C710" since "QuickPort" * Changed references to "QuickPort" with "82C710" since "QuickPort"
* is not what this driver is all about -- QuickPort is just a * is not what this driver is all about -- QuickPort is just a
* connector type, and this driver is for the mouse port on the Chips * connector type, and this driver is for the mouse port on the Chips
* & Technologies 82C710 interface chip. 15Nov93 jem@cs.hut.fi * & Technologies 82C710 interface chip. 15Nov93 jem@pandora.pp.fi
*/ */
/* Uncomment the following line if your mouse needs initialization. */ /* Uncomment the following line if your mouse needs initialization. */
...@@ -103,6 +103,7 @@ static int aux_ready = 0; ...@@ -103,6 +103,7 @@ static int aux_ready = 0;
static int aux_busy = 0; static int aux_busy = 0;
static int aux_present = 0; static int aux_present = 0;
static int poll_aux_status(void); static int poll_aux_status(void);
static int poll_aux_status_nosleep(void);
#ifdef CONFIG_82C710_MOUSE #ifdef CONFIG_82C710_MOUSE
static int qp_present = 0; static int qp_present = 0;
...@@ -121,9 +122,9 @@ static int probe_qp(void); ...@@ -121,9 +122,9 @@ static int probe_qp(void);
static void aux_write_dev(int val) static void aux_write_dev(int val)
{ {
poll_aux_status(); poll_aux_status_nosleep();
outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); /* write magic cookie */ outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); /* write magic cookie */
poll_aux_status(); poll_aux_status_nosleep();
outb_p(val,AUX_OUTPUT_PORT); /* write data */ outb_p(val,AUX_OUTPUT_PORT); /* write data */
} }
...@@ -137,13 +138,7 @@ static int aux_write_ack(int val) ...@@ -137,13 +138,7 @@ static int aux_write_ack(int val)
int retries = 0; int retries = 0;
aux_write_dev(val); /* write the value to the device */ aux_write_dev(val); /* write the value to the device */
while ((inb(AUX_STATUS) & AUX_OBUF_FULL) != AUX_OBUF_FULL poll_aux_status_nosleep();
&& retries < MAX_RETRIES) { /* wait for ack */
current->state = TASK_INTERRUPTIBLE;
current->timeout = jiffies + (5*HZ + 99) / 100;
schedule();
retries++;
}
if ((inb(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) if ((inb(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL)
{ {
...@@ -451,14 +446,12 @@ unsigned long psaux_init(unsigned long kmem_start) ...@@ -451,14 +446,12 @@ unsigned long psaux_init(unsigned long kmem_start)
psaux_fops.write = write_qp; psaux_fops.write = write_qp;
psaux_fops.open = open_qp; psaux_fops.open = open_qp;
psaux_fops.release = release_qp; psaux_fops.release = release_qp;
poll_qp_status();
} else } else
#endif #endif
if (aux_device_present == 0xaa) { if (aux_device_present == 0xaa) {
printk("PS/2 auxiliary pointing device detected -- driver installed.\n"); printk("PS/2 auxiliary pointing device detected -- driver installed.\n");
aux_present = 1; aux_present = 1;
kbd_read_mask = AUX_OBUF_FULL; kbd_read_mask = AUX_OBUF_FULL;
poll_aux_status();
} else { } else {
return kmem_start; /* No mouse at all */ return kmem_start; /* No mouse at all */
} }
...@@ -474,11 +467,10 @@ unsigned long psaux_init(unsigned long kmem_start) ...@@ -474,11 +467,10 @@ unsigned long psaux_init(unsigned long kmem_start)
aux_write_ack(AUX_SET_RES); aux_write_ack(AUX_SET_RES);
aux_write_ack(3); /* 8 counts per mm */ aux_write_ack(3); /* 8 counts per mm */
aux_write_ack(AUX_SET_SCALE21); /* 2:1 scaling */ aux_write_ack(AUX_SET_SCALE21); /* 2:1 scaling */
poll_aux_status(); poll_aux_status_nosleep();
#endif /* INITIALIZE_DEVICE */ #endif /* INITIALIZE_DEVICE */
outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */ outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */
aux_write_cmd(AUX_INTS_OFF); /* disable controller ints */ aux_write_cmd(AUX_INTS_OFF); /* disable controller ints */
poll_aux_status();
} }
return kmem_start; return kmem_start;
} }
...@@ -498,6 +490,18 @@ static int poll_aux_status(void) ...@@ -498,6 +490,18 @@ static int poll_aux_status(void)
return !(retries==MAX_RETRIES); return !(retries==MAX_RETRIES);
} }
static int poll_aux_status_nosleep(void)
{
int retries = 0;
while ((inb(AUX_STATUS)&0x03) && retries < 1000000) {
if ((inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL)
inb_p(AUX_INPUT_PORT);
retries++;
}
return !(retries == 1000000);
}
#ifdef CONFIG_82C710_MOUSE #ifdef CONFIG_82C710_MOUSE
/* /*
* Wait for device to send output char and flush any input char. * Wait for device to send output char and flush any input char.
......
...@@ -1268,6 +1268,12 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned ...@@ -1268,6 +1268,12 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned
} else goto wait; } else goto wait;
} }
i = verify_area (VERIFY_WRITE,buf,nr);
if (i != 0) {
ppp->us_rbuff_lock = 0;
return i;
}
/* reset the time of the last read operation */ /* reset the time of the last read operation */
ppp->ddinfo.nip_rjiffies = jiffies; ppp->ddinfo.nip_rjiffies = jiffies;
...@@ -1309,6 +1315,12 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned ...@@ -1309,6 +1315,12 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned
current->timeout = 0; current->timeout = 0;
PRINTKN (3,(KERN_DEBUG "ppp_read: sleeping\n")); PRINTKN (3,(KERN_DEBUG "ppp_read: sleeping\n"));
interruptible_sleep_on (&ppp->read_wait); interruptible_sleep_on (&ppp->read_wait);
/* Ensure that the ppp device is still attached. */
ppp = ppp_find(tty);
if (!ppp || ppp->magic != PPP_MAGIC || !ppp->inuse)
return 0;
if (current->signal & ~current->blocked) if (current->signal & ~current->blocked)
return -EINTR; return -EINTR;
} while (1); } while (1);
...@@ -1360,6 +1372,10 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne ...@@ -1360,6 +1372,10 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne
nr = ppp->mtu; nr = ppp->mtu;
} }
i = verify_area (VERIFY_READ,buf,nr);
if (i != 0)
return i;
if (ppp_debug >= 3) if (ppp_debug >= 3)
ppp_print_buffer ("write frame", buf, nr, USER_DS); ppp_print_buffer ("write frame", buf, nr, USER_DS);
...@@ -1369,6 +1385,12 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne ...@@ -1369,6 +1385,12 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne
current->timeout = 0; current->timeout = 0;
PRINTKN (3,(KERN_DEBUG "ppp_write: sleeping\n")); PRINTKN (3,(KERN_DEBUG "ppp_write: sleeping\n"));
interruptible_sleep_on(&ppp->write_wait); interruptible_sleep_on(&ppp->write_wait);
/* Ensure that the ppp device is still attached. */
ppp = ppp_find(tty);
if (!ppp || ppp->magic != PPP_MAGIC || !ppp->inuse)
return 0;
if (current->signal & ~current->blocked) if (current->signal & ~current->blocked)
return -EINTR; return -EINTR;
} }
......
Wed Jul 19 10:43:15 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* scsi.c (scsi_proc_info): /proc/scsi/scsi now also lists all
attached devices.
* scsi_proc.c (proc_print_scsidevice): Added. Used by scsi.c and
eata_dma_proc.c to produce some device info for /proc/scsi.
* eata_dma.c (eata_queue)(eata_int_handler)(eata_scsi_done):
Changed handling of internal SCSI commands send to the HBA.
Wed Jul 19 10:09:17 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.11 released.
* eata_dma.c (eata_queue)(eata_int_handler): Added code to do
command latency measurements if requested by root through
/proc/scsi interface.
Throughout Use HZ constant for time references.
* eata_pio.c: Use HZ constant for time references.
* aic7xxx.c, aic7xxx.h, aic7xxx_asm.c: Changed copyright from BSD
to GNU style.
* scsi.h: Added READ_12 command opcode constant
Wed Jul 19 09:25:30 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.10 released.
* scsi_proc.c (dispatch_scsi_info): Removed unused variable.
Wed Jul 19 09:25:30 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.9 released.
* scsi.c Blacklist concept expanded to 'support' more device
deficiencies. blacklist[] renamed to device_list[]
(scan_scsis): Code cleanup.
* scsi_debug.c (scsi_debug_proc_info): Added support to control
device lockup simulation via /proc/scsi interface.
Wed Jul 19 09:22:34 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.7 released.
* scsi_proc.c: Fixed a number of bugs in directory handling
Wed Jul 19 09:18:28 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.5 released.
* Native wide, multichannel and /proc/scsi support now in official
kernel distibution.
* scsi.c/h, hosts.c/h et al reindended to increase readability
(especially on 80 column wide terminals).
* scsi.c, scsi_proc.c, ../../fs/proc/inode.c: Added
/proc/scsi/scsi which allows root to scan for hotplugged devices.
* scsi.c (scsi_proc_info): Added, to support /proc/scsi/scsi.
(scan_scsis): Added some 'spagetti' code to allow scanning for
single devices.
Thu Jun 20 15:20:27 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* proc.c: Renamed to scsi_proc.c
Mon Jun 12 20:32:45 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* Linux 1.3.0 released.
Mon May 15 19:33:14 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de> Mon May 15 19:33:14 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* scsi.c: Added native multichannel and wide scsi support. * scsi.c: Added native multichannel and wide scsi support.
* proc.c (dispatch_scsi_info) (build_proc_dir_hba_entries): * proc.c (dispatch_scsi_info) (build_proc_dir_hba_entries):
...@@ -6,13 +85,13 @@ Mon May 15 19:33:14 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de> ...@@ -6,13 +85,13 @@ Mon May 15 19:33:14 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
Thu May 4 17:58:48 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de> Thu May 4 17:58:48 1995 Michael Neuffer <neuffer@goofy.zdv.uni-mainz.de>
* sd.c (requeue_sd_request): zero out the scatterlist only if * sd.c (requeue_sd_request): Zero out the scatterlist only if
scsi_malloc returned memory for it. scsi_malloc returned memory for it.
* eata_dma.c (register_HBA) (eata_queue): add support for * eata_dma.c (register_HBA) (eata_queue): Add support for
large scatter/gatter tables and set use_clustering accordingly large scatter/gatter tables and set use_clustering accordingly
* hosts.c: make use_clustering changable in the Scsi_Host structure. * hosts.c: Make use_clustering changable in the Scsi_Host structure.
Wed Apr 12 15:25:52 1995 Eric Youngdale (eric@andante) Wed Apr 12 15:25:52 1995 Eric Youngdale (eric@andante)
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Header file for eata_dma.c Linux EATA-DMA SCSI driver * * Header file for eata_dma.c Linux EATA-DMA SCSI driver *
* (c) 1993,94,95 Michael Neuffer * * (c) 1993,94,95 Michael Neuffer *
********************************************************* *********************************************************
* last change: 95/06/20 * * last change: 95/07/18 *
********************************************************/ ********************************************************/
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define VER_MAJOR 2 #define VER_MAJOR 2
#define VER_MINOR 5 #define VER_MINOR 5
#define VER_SUB "7a" #define VER_SUB "7b"
/************************************************************************ /************************************************************************
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
************************************************************************/ ************************************************************************/
#define CHECKPAL 0 /* EISA pal checking on/off */ #define CHECKPAL 0 /* EISA pal checking on/off */
#define NEWSTUFF 1 /* Some changes for ISA/EISA boards */
/************************************************************************ /************************************************************************
* Debug options. * * Debug options. *
...@@ -77,7 +78,7 @@ int eata_release(struct Scsi_Host *); ...@@ -77,7 +78,7 @@ int eata_release(struct Scsi_Host *);
eata_proc_info,/* procinfo */ \ eata_proc_info,/* procinfo */ \
"eata_dma", /* proc dir entry */ \ "eata_dma", /* proc dir entry */ \
PROC_SCSI_EATA,/* proc dir inode */ \ PROC_SCSI_EATA,/* proc dir inode */ \
"EATA (Extended Attachment) driver", \ "EATA (Extended Attachment) HBA driver", \
eata_detect, \ eata_detect, \
eata_release, \ eata_release, \
NULL, NULL, \ NULL, NULL, \
......
extern void proc_print_scsidevice(Scsi_Device *scd, char *buffer,
#define MAX_SCSI_DEVICE_CODE 10 int *size, int len);
const char *const scsi_dev_types[MAX_SCSI_DEVICE_CODE] =
{
"Direct-Access ",
"Sequential-Access",
"Printer ",
"Processor ",
"WORM ",
"CD-ROM ",
"Scanner ",
"Optical Device ",
"Medium Changer ",
"Communications "
};
void swap_statistics(u8 *p) void swap_statistics(u8 *p)
...@@ -47,22 +34,24 @@ void swap_statistics(u8 *p) ...@@ -47,22 +34,24 @@ void swap_statistics(u8 *p)
*/ */
int eata_set_info(char *buffer, int length, struct Scsi_Host *HBA_ptr) int eata_set_info(char *buffer, int length, struct Scsi_Host *HBA_ptr)
{ {
int orig_length = length;
if (length >= 8 && strncmp(buffer, "eata_dma", 8) == 0) { if (length >= 8 && strncmp(buffer, "eata_dma", 8) == 0) {
buffer += 9; buffer += 9;
length -= 9; length -= 9;
if(length >= 8 && strncmp(buffer, "latency", 7) == 0) { if(length >= 8 && strncmp(buffer, "latency", 7) == 0) {
SD(HBA_ptr)->do_latency = TRUE; SD(HBA_ptr)->do_latency = TRUE;
return(length+9); return(orig_length);
} }
if(length >=10 && strncmp(buffer, "nolatency", 9) == 0) { if(length >=10 && strncmp(buffer, "nolatency", 9) == 0) {
SD(HBA_ptr)->do_latency = FALSE; SD(HBA_ptr)->do_latency = FALSE;
return(length+9); return(orig_length);
} }
printk("Unknown command:%s length: %d\n", buffer, length); printk("Unknown command:%s length: %d\n", buffer, length);
} else } else
printk("Wrong Signature:%10s\n", (char *) ((ulong)buffer-9)); printk("Wrong Signature:%10s\n", buffer);
return(-EINVAL); return(-EINVAL);
} }
...@@ -82,9 +71,10 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -82,9 +71,10 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
int hostno, int inout) int hostno, int inout)
{ {
Scsi_Device *scd; Scsi_Device *scd, SDev;
struct Scsi_Host *HBA_ptr; struct Scsi_Host *HBA_ptr;
Scsi_Cmnd scmd; Scsi_Cmnd scmd;
char cmnd[10];
static u8 buff[512]; static u8 buff[512];
static u8 buff2[512]; static u8 buff2[512];
hst_cmd_stat *rhcs, *whcs; hst_cmd_stat *rhcs, *whcs;
...@@ -162,33 +152,58 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -162,33 +152,58 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
size = sprintf(buffer + len, "Host Bus: EISA\n"); size = sprintf(buffer + len, "Host Bus: EISA\n");
len += size; len += size;
pos = begin + len; pos = begin + len;
} else { } else {
memset(&SDev, 0, sizeof(Scsi_Device));
memset(&scmd, 0, sizeof(Scsi_Cmnd));
SDev.host = HBA_ptr;
SDev.id = HBA_ptr->this_id;
SDev.lun = 0;
SDev.channel = 0;
cmnd[0] = LOG_SENSE;
cmnd[1] = 0;
cmnd[2] = 0x33 + (3<<6);
cmnd[3] = 0;
cmnd[4] = 0;
cmnd[5] = 0;
cmnd[6] = 0;
cmnd[7] = 0x00;
cmnd[8] = 0x66;
cmnd[9] = 0;
scmd.cmnd[0] = LOG_SENSE;
scmd.cmnd[1] = 0;
scmd.cmnd[2] = 0x33 + (3<<6);
scmd.cmnd[3] = 0;
scmd.cmnd[4] = 0;
scmd.cmnd[5] = 0;
scmd.cmnd[6] = 0;
scmd.cmnd[7] = 0x00;
scmd.cmnd[8] = 0x66;
scmd.cmnd[9] = 0;
scmd.cmd_len = 10; scmd.cmd_len = 10;
scmd.host = HBA_ptr; scmd.host = HBA_ptr;
scmd.device = &SDev;
scmd.target = HBA_ptr->this_id; scmd.target = HBA_ptr->this_id;
scmd.lun = 0; scmd.lun = 0;
scmd.channel = 0; scmd.channel = 0;
scmd.use_sg = 0; scmd.use_sg = 0;
scmd.request_bufflen = 0x66;
scmd.request_buffer = buff + 0x144;
HBA_interpret = TRUE;
eata_queue(&scmd, (void *) eata_scsi_done); /* Used for mutex if loading devices after boot */
while (internal_command_finished == FALSE) scmd.request.sem = NULL;
scmd.request.dev = 0xffff; /* Mark busy */
scsi_do_cmd (&scmd, cmnd, buff + 0x144, 0x66,
eata_scsi_done, 1 * HZ, 1);
/*
* Wait for command to finish. Use simple wait if we are
* booting, else do it right and use a mutex
*/
if (current->pid == 0) {
while (scmd.request.dev != 0xfffe)
barrier(); barrier();
} else if (scmd.request.dev != 0xfffe) {
struct semaphore sem = MUTEX_LOCKED;
scmd.request.sem = &sem;
down(&sem);
/* Hmm.. Have to ask about this one */
while (scmd.request.dev != 0xfffe) schedule();
}
size = sprintf(buffer + len, "IRQ: %2d, %s triggered\n", cc->interrupt, size = sprintf(buffer + len, "IRQ: %2d, %s triggered\n", cc->interrupt,
(cc->intt == TRUE)?"level":"edge"); (cc->intt == TRUE)?"level":"edge");
...@@ -220,7 +235,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -220,7 +235,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
(sb->ext == TRUE)?"With external cable detection":""); (sb->ext == TRUE)?"With external cable detection":"");
len += size; len += size;
pos = begin + len; pos = begin + len;
size = sprintf(buffer + len, "SCSI channel expansion Module: %s installed\n", size = sprintf(buffer + len, "SCSI channel expansion Module: %s present\n",
(bt->sx1 == TRUE)?"SX1 (one channel)": (bt->sx1 == TRUE)?"SX1 (one channel)":
((bt->sx2 == TRUE)?"SX2 (two channels)":"not")); ((bt->sx2 == TRUE)?"SX2 (two channels)":"not"));
len += size; len += size;
...@@ -250,7 +265,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -250,7 +265,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
(al->code == 0x0e)?al->raid35_drv:7); (al->code == 0x0e)?al->raid35_drv:7);
len += size; len += size;
pos = begin + len; pos = begin + len;
size = sprintf(buffer + len, "Cache Module: %sinstalled.\n", size = sprintf(buffer + len, "Cache Module: %spresent.\n",
(cc->csh)?"":"not "); (cc->csh)?"":"not ");
len += size; len += size;
pos = begin + len; pos = begin + len;
...@@ -269,20 +284,20 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -269,20 +284,20 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
len += size; len += size;
pos = begin + len; pos = begin + len;
} }
size = sprintf(buffer + len, "Timer Modification: %sinstalled\n", size = sprintf(buffer + len, "Timer Mod.: %spresent\n",
(cc->tmr == TRUE)?"":"not "); (cc->tmr == TRUE)?"":"not ");
len += size; len += size;
pos = begin + len; pos = begin + len;
size = sprintf(buffer + len, "NVRAM: %spresent\n", size = sprintf(buffer + len, "NVRAM : %spresent\n",
(cc->nvr == TRUE)?"":"not "); (cc->nvr == TRUE)?"":"not ");
len += size; len += size;
pos = begin + len; pos = begin + len;
size = sprintf(buffer + len, "SmartROM: %senabled\n", size = sprintf(buffer + len, "SmartROM : %sabled\n",
(bt->srom == TRUE)?"not ":""); (bt->srom == TRUE)?"dis":"en");
len += size; len += size;
pos = begin + len; pos = begin + len;
size = sprintf(buffer + len, "HBA indicates %salarm.\n", size = sprintf(buffer + len, "Alarm : %s\n",
(bt->alrm == TRUE)?"":"no "); (bt->alrm == TRUE)?"on":"off");
len += size; len += size;
pos = begin + len; pos = begin + len;
...@@ -293,29 +308,41 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -293,29 +308,41 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
if (pos > offset + length) if (pos > offset + length)
goto stop_output; goto stop_output;
scmd.cmnd[0] = LOG_SENSE; cmnd[0] = LOG_SENSE;
scmd.cmnd[1] = 0; cmnd[1] = 0;
scmd.cmnd[2] = 0x32 + (3<<6); cmnd[2] = 0x32 + (3<<6);
scmd.cmnd[3] = 0; cmnd[3] = 0;
scmd.cmnd[4] = 0; cmnd[4] = 0;
scmd.cmnd[5] = 0; cmnd[5] = 0;
scmd.cmnd[6] = 0; cmnd[6] = 0;
scmd.cmnd[7] = 0x01; cmnd[7] = 0x01;
scmd.cmnd[8] = 0x44; cmnd[8] = 0x44;
scmd.cmnd[9] = 0; cmnd[9] = 0;
scmd.cmd_len = 10; scmd.cmd_len = 10;
scmd.host = HBA_ptr;
scmd.target = HBA_ptr->this_id;
scmd.lun = 0;
scmd.channel = 0;
scmd.use_sg = 0;
scmd.request_bufflen = 0x144;
scmd.request_buffer = buff2;
HBA_interpret = TRUE;
eata_queue(&scmd, (void *) eata_scsi_done); /* Used for mutex if loading devices after boot */
while (internal_command_finished == FALSE) scmd.request.sem = NULL;
scmd.request.dev = 0xffff; /* Mark busy */
scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
eata_scsi_done, 1 * HZ, 1);
/*
* Wait for command to finish. Use simple wait if we are
* booting, else do it right and use a mutex
*/
if (current->pid == 0)
while (scmd.request.dev != 0xfffe)
barrier(); barrier();
else if (scmd.request.dev != 0xfffe) {
struct semaphore sem = MUTEX_LOCKED;
scmd.request.sem = &sem;
down(&sem);
/* Hmm.. Have to ask about this one */
while (scmd.request.dev != 0xfffe) schedule();
}
swap_statistics(buff2); swap_statistics(buff2);
rhcs = (hst_cmd_stat *)(buff2 + 0x2c); rhcs = (hst_cmd_stat *)(buff2 + 0x2c);
...@@ -327,7 +354,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -327,7 +354,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
SD(HBA_ptr)->reads[12] += rhcs->sizes[x]; SD(HBA_ptr)->reads[12] += rhcs->sizes[x];
SD(HBA_ptr)->writes[12] += whcs->sizes[x]; SD(HBA_ptr)->writes[12] += whcs->sizes[x];
} }
size = sprintf(buffer + len, "Host Disk Command Statistics:\n" size = sprintf(buffer + len, "Host<->Disk command statistics:\n"
" Reads: Writes:\n"); " Reads: Writes:\n");
len += size; len += size;
pos = begin + len; pos = begin + len;
...@@ -438,41 +465,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -438,41 +465,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
while (scd) { while (scd) {
if (scd->host == HBA_ptr) { if (scd->host == HBA_ptr) {
proc_print_scsidevice(scd, buffer, &size, len);
size = sprintf(buffer + len,
"Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
scd->channel, scd->id, scd->lun);
for (x = 0; x < 8; x++) {
if (scd->vendor[x] >= 0x20)
size += sprintf(buffer + len + size, "%c", scd->vendor[x]);
else
size += sprintf(buffer + len + size," ");
}
size += sprintf(buffer + len + size, " Model: ");
for (x = 0; x < 16; x++) {
if (scd->model[x] >= 0x20)
size += sprintf(buffer + len + size, "%c", scd->model[x]);
else
size += sprintf(buffer + len + size, " ");
}
size += sprintf(buffer + len + size, " Rev: ");
for (x = 0; x < 4; x++) {
if (scd->rev[x] >= 0x20)
size += sprintf(buffer + len + size, "%c", scd->rev[x]);
else
size += sprintf(buffer + len + size, " ");
}
size += sprintf(buffer + len + size, "\n");
size += sprintf(buffer + len + size, " Type: %s ",
scd->type < MAX_SCSI_DEVICE_CODE ?
scsi_dev_types[(int)scd->type] : "Unknown " );
size += sprintf(buffer + len + size, " ANSI"
" SCSI revision: %02x", (scd->scsi_level < 3)?1:2);
if (scd->scsi_level == 2)
size += sprintf(buffer + len + size, " CCS\n");
else
size += sprintf(buffer + len + size, "\n");
len += size; len += size;
pos = begin + len; pos = begin + len;
...@@ -511,7 +504,6 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -511,7 +504,6 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
* c-label-offset: -4 * c-label-offset: -4
* c-continued-statement-offset: 4 * c-continued-statement-offset: 4
* c-continued-brace-offset: 0 * c-continued-brace-offset: 0
* indent-tabs-mode: nil
* tab-width: 8 * tab-width: 8
* End: * End:
*/ */
...@@ -106,8 +106,13 @@ Scsi_Cmnd * last_cmnd = NULL; ...@@ -106,8 +106,13 @@ Scsi_Cmnd * last_cmnd = NULL;
/* This is the pointer to the /proc/scsi code. /* This is the pointer to the /proc/scsi code.
* It is only initialized to !=0 if the scsi code is present * It is only initialized to !=0 if the scsi code is present
*/ */
extern int (* dispatch_scsi_info_ptr)(int ino, char *buffer, char **start, off_t offset, int length, int inout); extern int (* dispatch_scsi_info_ptr)(int ino, char *buffer, char **start,
extern int dispatch_scsi_info(int ino, char *buffer, char **start, off_t offset, int length, int inout); off_t offset, int length, int inout);
extern int dispatch_scsi_info(int ino, char *buffer, char **start,
off_t offset, int length, int inout);
extern void proc_print_scsidevice(Scsi_Device *scd, char *buffer,
int *size, int len);
/* /*
* As the scsi do command functions are intelligent, and may need to * As the scsi do command functions are intelligent, and may need to
...@@ -977,6 +982,7 @@ Scsi_Cmnd * allocate_device (struct request ** reqp, Scsi_Device * device, ...@@ -977,6 +982,7 @@ Scsi_Cmnd * allocate_device (struct request ** reqp, Scsi_Device * device,
while(SCpnt){ while(SCpnt){
if(SCpnt->target == device->id && if(SCpnt->target == device->id &&
SCpnt->lun == device->lun) { SCpnt->lun == device->lun) {
SCwait = SCpnt;
if(SCpnt->request.dev < 0) break; if(SCpnt->request.dev < 0) break;
} }
SCpnt = SCpnt->next; SCpnt = SCpnt->next;
...@@ -985,6 +991,7 @@ Scsi_Cmnd * allocate_device (struct request ** reqp, Scsi_Device * device, ...@@ -985,6 +991,7 @@ Scsi_Cmnd * allocate_device (struct request ** reqp, Scsi_Device * device,
while(SCpnt){ while(SCpnt){
if(SCpnt->target == device->id) { if(SCpnt->target == device->id) {
if (SCpnt->lun == device->lun) { if (SCpnt->lun == device->lun) {
SCwait = SCpnt;
if(found == NULL if(found == NULL
&& SCpnt->request.dev < 0) && SCpnt->request.dev < 0)
{ {
...@@ -2427,12 +2434,49 @@ int scsi_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -2427,12 +2434,49 @@ int scsi_proc_info(char *buffer, char **start, off_t offset, int length,
struct Scsi_Host *HBA_ptr; struct Scsi_Host *HBA_ptr;
int parameter[4]; int parameter[4];
char *p; char *p;
int size, len = 0;
off_t begin = 0;
off_t pos = 0;
scd = scsi_devices; scd = scsi_devices;
HBA_ptr = scsi_hostlist; HBA_ptr = scsi_hostlist;
if(inout == 0) /* We can only write to this file right now */ if(inout == 0) {
return(-ENOSYS); /* This is still a no-op */ size = sprintf(buffer+len,"Attached devices: %s\n", (scd)?"":"none");
len += size;
pos = begin + len;
while (HBA_ptr) {
#if 0
size += sprintf(buffer+len,"scsi%2d: %s\n", (int) HBA_ptr->host_no, HBA_ptr->hostt->procname);
len += size;
pos = begin + len;
#endif
scd = scsi_devices;
while (scd) {
if (scd->host == HBA_ptr) {
proc_print_scsidevice(scd, buffer, &size, len);
len += size;
pos = begin + len;
if (pos < offset) {
len = 0;
begin = pos;
}
if (pos > offset + length)
goto stop_output;
}
scd = scd->next;
}
HBA_ptr = HBA_ptr->next;
}
stop_output:
*start=buffer+(offset-begin); /* Start of wanted data */
len-=(offset-begin); /* Start slop */
if(len>length)
len = length; /* Ending slop */
return (len);
}
if(!buffer || length < 25 || strncmp("scsi", buffer, 4)) if(!buffer || length < 25 || strncmp("scsi", buffer, 4))
return(-EINVAL); return(-EINVAL);
......
...@@ -552,6 +552,8 @@ extern int scsi_reset (Scsi_Cmnd *); ...@@ -552,6 +552,8 @@ extern int scsi_reset (Scsi_Cmnd *);
extern int max_scsi_hosts; extern int max_scsi_hosts;
extern void build_proc_dir_entries(void); extern void build_proc_dir_entries(void);
extern void proc_print_scsidevice(Scsi_Device *, char *, int *, int);
extern int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg); extern int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
extern int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg); extern int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* information directly to the lowlevel driver. * information directly to the lowlevel driver.
* *
* (c) 1995 Michael Neuffer neuffer@goofy.zdv.uni-mainz.de * (c) 1995 Michael Neuffer neuffer@goofy.zdv.uni-mainz.de
* Version: 0.99.6 last change: 95/07/04 * Version: 0.99.7 last change: 95/07/18
* *
* generic command parser provided by: * generic command parser provided by:
* Andreas Heilwagen <crashcar@informatik.uni-koblenz.de> * Andreas Heilwagen <crashcar@informatik.uni-koblenz.de>
...@@ -330,6 +330,63 @@ int parseOpt(parseHandle *handle, char **param) ...@@ -330,6 +330,63 @@ int parseOpt(parseHandle *handle, char **param)
return(cmdIndex); return(cmdIndex);
} }
#define MAX_SCSI_DEVICE_CODE 10
const char *const scsi_dev_types[MAX_SCSI_DEVICE_CODE] =
{
"Direct-Access ",
"Sequential-Access",
"Printer ",
"Processor ",
"WORM ",
"CD-ROM ",
"Scanner ",
"Optical Device ",
"Medium Changer ",
"Communications "
};
void proc_print_scsidevice(Scsi_Device *scd, char *buffer, int *size, int len)
{
int x, y = *size;
y = sprintf(buffer + len,
"Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
scd->channel, scd->id, scd->lun);
for (x = 0; x < 8; x++) {
if (scd->vendor[x] >= 0x20)
y += sprintf(buffer + len + y, "%c", scd->vendor[x]);
else
y += sprintf(buffer + len + y," ");
}
y += sprintf(buffer + len + y, " Model: ");
for (x = 0; x < 16; x++) {
if (scd->model[x] >= 0x20)
y += sprintf(buffer + len + y, "%c", scd->model[x]);
else
y += sprintf(buffer + len + y, " ");
}
y += sprintf(buffer + len + y, " Rev: ");
for (x = 0; x < 4; x++) {
if (scd->rev[x] >= 0x20)
y += sprintf(buffer + len + y, "%c", scd->rev[x]);
else
y += sprintf(buffer + len + y, " ");
}
y += sprintf(buffer + len + y, "\n");
y += sprintf(buffer + len + y, " Type: %s ",
scd->type < MAX_SCSI_DEVICE_CODE ?
scsi_dev_types[(int)scd->type] : "Unknown " );
y += sprintf(buffer + len + y, " ANSI"
" SCSI revision: %02x", (scd->scsi_level < 3)?1:2);
if (scd->scsi_level == 2)
y += sprintf(buffer + len + y, " CCS\n");
else
y += sprintf(buffer + len + y, "\n");
*size = y;
return;
}
/* /*
* Overrides for Emacs so that we get a uniform tabbing style. * Overrides for Emacs so that we get a uniform tabbing style.
......
...@@ -68,6 +68,9 @@ struct symbol_table scsi_symbol_table = { ...@@ -68,6 +68,9 @@ struct symbol_table scsi_symbol_table = {
X(kernel_scsi_ioctl), X(kernel_scsi_ioctl),
X(need_isa_buffer), X(need_isa_buffer),
X(request_queueable), X(request_queueable),
#if defined(CONFIG_PROC_FS)
X(proc_print_scsidevice),
#endif
/* /*
* These are here only while I debug the rest of the scsi stuff. * These are here only while I debug the rest of the scsi stuff.
*/ */
......
...@@ -1293,7 +1293,7 @@ static struct hpfs_dirent *map_dirent(struct inode *inode, dnode_secno dno, ...@@ -1293,7 +1293,7 @@ static struct hpfs_dirent *map_dirent(struct inode *inode, dnode_secno dno,
/* /*
* name not found. * name not found.
*/ */
brelse4(qbh);
return 0; return 0;
} }
......
...@@ -166,7 +166,7 @@ void proc_read_inode(struct inode * inode) ...@@ -166,7 +166,7 @@ void proc_read_inode(struct inode * inode)
} }
if (ino == PROC_SCSI_SCSI) { if (ino == PROC_SCSI_SCSI) {
inode->i_mode = S_IFREG | S_IWUSR; inode->i_mode = S_IFREG | S_IRUGO | S_IWUSR;
inode->i_op = &proc_scsi_inode_operations; inode->i_op = &proc_scsi_inode_operations;
return; return;
} }
......
...@@ -29,14 +29,20 @@ static void jiffiestotv(unsigned long jiffies, struct timeval *value) ...@@ -29,14 +29,20 @@ static void jiffiestotv(unsigned long jiffies, struct timeval *value)
return; return;
} }
int _getitimer(int which, struct itimerval *value) static int _getitimer(int which, struct itimerval *value)
{ {
register unsigned long val, interval; register long val, interval;
switch (which) { switch (which) {
case ITIMER_REAL: case ITIMER_REAL:
val = current->it_real_value;
interval = current->it_real_incr; interval = current->it_real_incr;
val = 0;
if (del_timer(&current->real_timer)) {
val = current->real_timer.expires;
add_timer(&current->real_timer);
if (val <= 0)
val = interval;
}
break; break;
case ITIMER_VIRTUAL: case ITIMER_VIRTUAL:
val = current->it_virt_value; val = current->it_virt_value;
...@@ -51,7 +57,7 @@ int _getitimer(int which, struct itimerval *value) ...@@ -51,7 +57,7 @@ int _getitimer(int which, struct itimerval *value)
} }
jiffiestotv(val, &value->it_value); jiffiestotv(val, &value->it_value);
jiffiestotv(interval, &value->it_interval); jiffiestotv(interval, &value->it_interval);
return(0); return 0;
} }
asmlinkage int sys_getitimer(int which, struct itimerval *value) asmlinkage int sys_getitimer(int which, struct itimerval *value)
......
...@@ -388,6 +388,9 @@ struct symbol_table symbol_table = { ...@@ -388,6 +388,9 @@ struct symbol_table symbol_table = {
X(scsi_devices), X(scsi_devices),
X(gendisk_head), /* Needed for sd.c */ X(gendisk_head), /* Needed for sd.c */
X(resetup_one_dev), /* Needed for sd.c */ X(resetup_one_dev), /* Needed for sd.c */
#if defined(CONFIG_PROC_FS)
X(proc_print_scsidevice),
#endif
#else #else
/* /*
* With no scsi configured, we still need to export a few * With no scsi configured, we still need to export a few
......
...@@ -120,7 +120,11 @@ static inline void del_from_runqueue(struct task_struct * p) ...@@ -120,7 +120,11 @@ static inline void del_from_runqueue(struct task_struct * p)
} }
#endif #endif
if (p == &init_task) { if (p == &init_task) {
static int nr = 0;
if (nr < 5) {
nr++;
printk("idle task may not sleep\n"); printk("idle task may not sleep\n");
}
return; return;
} }
nr_running--; nr_running--;
......
...@@ -101,9 +101,9 @@ int strncmp(const char * cs,const char * ct,size_t count) ...@@ -101,9 +101,9 @@ int strncmp(const char * cs,const char * ct,size_t count)
#endif #endif
#ifndef __HAVE_ARCH_STRCHR #ifndef __HAVE_ARCH_STRCHR
char * strchr(const char * s,char c) char * strchr(const char * s, int c)
{ {
for(; *s != c; ++s) for(; *s != (char) c; ++s)
if (*s == '\0') if (*s == '\0')
return NULL; return NULL;
return (char *) s; return (char *) s;
...@@ -265,7 +265,7 @@ int memcmp(const void * cs,const void * ct,size_t count) ...@@ -265,7 +265,7 @@ int memcmp(const void * cs,const void * ct,size_t count)
* find the first occurrence of byte 'c', or 1 past the area if none * find the first occurrence of byte 'c', or 1 past the area if none
*/ */
#ifndef __HAVE_ARCH_MEMSCAN #ifndef __HAVE_ARCH_MEMSCAN
void * memscan(void * addr, unsigned char c, size_t size) void * memscan(void * addr, int c, size_t size)
{ {
unsigned char * p = (unsigned char *) addr; unsigned char * p = (unsigned char *) addr;
......
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