From: Linus Torvalds Date: Fri, 23 Nov 2007 20:09:38 +0000 (-0500) Subject: Import 1.1.43 X-Git-Tag: 1.1.43 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=bc1cbadfdbb0178bfdcfd64a8969f3041eb22d33;p=history.git Import 1.1.43 --- diff --git a/CREDITS b/CREDITS index 2f00332cb8c4..d0f696d93407 100644 --- a/CREDITS +++ b/CREDITS @@ -455,6 +455,13 @@ S: Gaildorfer Str. 27 S: 7000 Stuttgart 50 S: Germany +N: Stephen Rothwell +E: sfr@pdact.pd.necisa.oz.au +D: Boot/setup/build work for setup > 2K +S: 59 Bugden Ave +S: Gowrie ACT 2904 +S: Australia + N: Robert Sanders E: gt8134b@prism.gatech.edu D: Dosemu diff --git a/Makefile b/Makefile index a28f2688fd38..e7943d4edbeb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 1 -SUBLEVEL = 42 +SUBLEVEL = 43 all: Version zImage diff --git a/boot/bootsect.S b/boot/bootsect.S index 3d319b7dd7d0..f6a0d315881e 100644 --- a/boot/bootsect.S +++ b/boot/bootsect.S @@ -68,8 +68,9 @@ _main: movsw jmpi go,INITSEG -go: mov ax,cs - mov di,#0x4000-12 ! 0x4000 is arbitrary value >= length of +! ax and es already contain INITSEG + +go: mov di,#0x4000-12 ! 0x4000 is arbitrary value >= length of ! bootsect + length of setup + room for stack ! 12 is disk parm size @@ -80,7 +81,6 @@ go: mov ax,cs ! drive table. mov ds,ax - mov es,ax mov ss,ax ! put stack at INITSEG:0x4000-12. mov sp,di /* @@ -100,14 +100,15 @@ go: mov ax,cs * fs = 0, gs is unused. */ - push #0 - pop fs +! cx contains 0 from rep movsw above + + mov fs,cx mov bx,#0x78 ! fs:bx is parameter table address push ds seg fs lds si,(bx) ! ds:si is source - mov cx,#6 ! copy 12 bytes + mov cl,#6 ! copy 12 bytes cld push di @@ -124,19 +125,20 @@ go: mov ax,cs seg fs mov 2(bx),es - xor ah,ah ! reset FDC - xor dl,dl - int 0x13 - ! load the setup-sectors directly after the bootblock. ! Note that 'es' is already set up. +! Also cx is 0 from rep movsw above. load_setup: + xor ah,ah ! reset FDC + xor dl,dl + int 0x13 + xor dx, dx ! drive 0, head 0 - mov cx,#0x0002 ! sector 2, track 0 + mov cl,#0x02 ! sector 2, track 0 mov bx,#0x0200 ! address = 512, in INITSEG - mov ax,#0x0200+SETUPSECS ! service 2, nr of sectors - ! (assume all on head 0, track 0) + mov ah,#0x02 ! service 2, nr of sectors + mov al,setup_sects ! (assume all on head 0, track 0) int 0x13 ! read it jnc ok_load_setup ! ok - continue @@ -146,9 +148,6 @@ load_setup: call print_hex pop ax - xor dl, dl ! reset FDC - xor ah, ah - int 0x13 jmp load_setup ok_load_setup: @@ -176,13 +175,15 @@ ok_load_setup: probe_loop: lodsb cbw ! extend to word - seg cs mov sectors, ax cmp si,#disksizes+4 jae got_sectors ! if all else fails, try 9 xchg ax, cx ! cx = track and sector xor dx, dx ! drive 0, head 0 - mov bx,#0x0200+SETUPSECS*0x200 ! address after setup (es = cs) + xor bl, bl + mov bh,setup_sects + inc bh + shl bh,#1 ! address after setup (es = cs) mov ax,#0x0201 ! service 2, 1 sector int 0x13 jc probe_loop ! try next value @@ -254,11 +255,14 @@ root_defined: ! ! in: es - starting address segment (normally 0x1000) ! -sread: .word 1+SETUPSECS ! sectors read of current track +sread: .word 0 ! sectors read of current track head: .word 0 ! current head track: .word 0 ! current track read_it: + mov al,setup_sects + inc al + mov sread,al mov ax,es test ax,#0x0fff die: jne die ! es must be at 64kB boundary @@ -270,7 +274,6 @@ rp_read: jbe ok1_read ret ok1_read: - seg cs mov ax,sectors sub ax,sread mov cx,ax @@ -285,7 +288,6 @@ ok2_read: call read_track mov cx,ax add ax,sread - seg cs cmp ax,sectors jne ok3_read mov ax,#1 @@ -439,7 +441,9 @@ msg1: .byte 13,10 .ascii "Loading" -.org 498 +.org 497 +setup_sects: + .byte SETUPSECS root_flags: .word CONFIG_ROOT_RDONLY syssize: diff --git a/boot/setup.S b/boot/setup.S index e584bc2ae15b..02bf897989d3 100644 --- a/boot/setup.S +++ b/boot/setup.S @@ -26,6 +26,10 @@ #define SVGA_MODE ASK_VGA #endif +! Signature words to ensure LILO loaded us right +#define SIG1 0xAA55 +#define SIG2 0x5A5A + INITSEG = DEF_INITSEG ! we move boot here - out of the way SYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536). SETUPSEG = DEF_SETUPSEG ! this is the current segment @@ -41,11 +45,86 @@ begbss: entry start start: +! Check signature at end of setup + mov ax,#SETUPSEG + mov ds,ax + cmp setup_sig1,#SIG1 + jne bad_sig + cmp setup_sig2,#SIG2 + jne bad_sig + jmp good_sig1 + +! Routine to print asciiz-string at DS:SI + +prtstr: lodsb + and al,al + jz fin + call prnt1 + jmp prtstr +fin: ret + +! Part of above routine, this one just prints ascii al + +prnt1: push ax + push cx + xor bh,bh + mov cx,#0x01 + mov ah,#0x0e + int 0x10 + pop cx + pop ax + ret -! ok, the read went well so we get current cursor position and save it for -! posterity. +beep: mov al,#0x07 + jmp prnt1 + +no_sig_mess: .ascii "No setup signature found ..." + db 0x00 +start_sys_seg: .word SYSSEG + +good_sig1: + jmp good_sig - mov ax,#INITSEG ! this is done in bootsect already, but... +! We now have to find the rest of the setup code/data +bad_sig: + mov ax,#INITSEG + mov ds,ax + xor bh,bh + mov bl,[497] ! get setup sects from boot sector + sub bx,#4 ! LILO loads 4 sectors of setup + shl bx,#8 ! convert to words + mov cx,bx + shr bx,#3 ! convert to segment + add bx,#SYSSEG + seg cs + mov start_sys_seg,bx + +! Move rest of setup code/data to here + mov di,#2048 ! four sectors loaded by LILO + sub si,si + mov ax,#SETUPSEG + mov es,ax + mov ax,#SYSSEG + mov ds,ax + rep + movsw + + mov ax,#SETUPSEG + mov ds,ax + cmp setup_sig1,#SIG1 + jne no_sig + cmp setup_sig2,#SIG2 + jne no_sig + jmp good_sig + +no_sig: + lea si,no_sig_mess + call prtstr +no_sig_loop: + jmp no_sig_loop + +good_sig: + mov ax,#INITSEG mov ds,ax ! Get memory size (extended mem, kB) @@ -155,7 +234,8 @@ no_psmouse: ! first we move the system to its rightful place mov ax,#0x100 ! start of destination segment - mov bx,#0x1000 ! start of source segment + seg cs + mov bx,start_sys_seg ! start of source segment cld ! 'direction'=0, movs moves forward do_move: mov es,ax ! destination segment @@ -790,15 +870,6 @@ inidx: out dx,al dec dx ret -! Routine to print asciiz-string at DS:SI - -prtstr: lodsb - and al,al - jz fin - call prnt1 - jmp prtstr -fin: ret - ! Routine to print a decimal value on screen, the value to be ! printed is put in al (i.e 0-255). @@ -840,21 +911,6 @@ digit: add al,#0x30 pop ax ret -! Part of above routine, this one just prints ascii al - -prnt1: push ax - push cx - xor bh,bh - mov cx,#0x01 - mov ah,#0x0e - int 0x10 - pop cx - pop ax - ret - -beep: mov al,#0x07 - jmp prnt1 - gdt: .word 0,0,0,0 ! dummy @@ -937,7 +993,10 @@ dsc_S3: .word 0x5032, 0x501c, 0x842b, 0x8419 dsunknown: .word 0x5032, 0x501c modesave: .word SVGA_MODE - +! This must be last +setup_sig1: .word SIG1 +setup_sig2: .word SIG2 + .text endtext: .data diff --git a/config.in b/config.in index 8106bbcaf5e0..440c57713598 100644 --- a/config.in +++ b/config.in @@ -151,7 +151,9 @@ bool 'Extended fs support' CONFIG_EXT_FS n bool 'Second extended fs support' CONFIG_EXT2_FS y bool 'xiafs filesystem support' CONFIG_XIA_FS n bool 'msdos fs support' CONFIG_MSDOS_FS y +if [ "$CONFIG_MSDOS_FS" = "y" ]; then bool 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS n +fi bool '/proc filesystem support' CONFIG_PROC_FS y if [ "$CONFIG_INET" = "y" ]; then bool 'NFS filesystem support' CONFIG_NFS_FS y diff --git a/drivers/block/cdu31a.c b/drivers/block/cdu31a.c index 3c75973af51f..6f844289fd24 100644 --- a/drivers/block/cdu31a.c +++ b/drivers/block/cdu31a.c @@ -11,7 +11,7 @@ * include/linux/cdrom.h). With this interface, CDROMs can be * accessed and standard audio CDs can be played back normally. * - * This interface is (unfortunatly) a polled interface. This is + * This interface is (unfortunately) a polled interface. This is * because most Sony interfaces are set up with DMA and interrupts * disables. Some (like mine) do not even have the capability to * handle interrupts or DMA. For this reason you will see a lot of @@ -32,7 +32,7 @@ * * This ugly hack waits for something to happen, sleeping a little * between every try. it also handles attentions, which are - * asyncronous events from the drive informing the driver that a disk + * asynchronous events from the drive informing the driver that a disk * has been inserted, removed, etc. * * NEWS FLASH - The driver now supports interrupts and DMA, but they are @@ -578,7 +578,7 @@ get_result(unsigned char *result_buffer, /* * 0x20 means an error occured. Byte 2 will have the error code. - * Otherwise, the command succeded, byte 2 will have the count of + * Otherwise, the command succeeded, byte 2 will have the count of * how many more status bytes are coming. * * The result register can be read 10 bytes at a time, a wait for @@ -875,7 +875,7 @@ retry_data_operation: size_to_buf(1, ¶ms[3]); num_retries++; - /* Issue a reset on an error (the second time), othersize just delay */ + /* Issue a reset on an error (the second time), otherwise just delay */ if (num_retries == 2) { restart_on_error(); @@ -1278,7 +1278,7 @@ try_read_again: break; default: - panic("Unkown SONY CD cmd"); + panic("Unknown SONY CD cmd"); } } @@ -1952,13 +1952,6 @@ get_drive_configuration(unsigned short base_io, } -static struct sigaction cdu31a_sigaction = { - cdu31a_interrupt, - 0, - SA_INTERRUPT, - NULL -}; - static int cdu31a_block_size; /* @@ -2032,7 +2025,7 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end) if (irq_used > 0) { - if (irqaction(irq_used,&cdu31a_sigaction)) + if (request_irq(irq_used, cdu31a_interrupt, SA_INTERRUPT, "cdu31a")) { irq_used = 0; printk("Unable to grab IRQ%d for the CDU31A driver\n", irq_used); diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 8c36fdb85a7f..adadc829ccb3 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -655,7 +655,7 @@ static void setup_DMA(void) (current_addr < floppy_track_buffer || current_addr + raw_cmd.length > floppy_track_buffer + 1024 * MAX_BUFFER_SECTORS)){ - printk("bad adrress. start=%p lg=%lx tb=%p\n", + printk("bad address. start=%p lg=%lx tb=%p\n", current_addr, raw_cmd.length, floppy_track_buffer); if ( CURRENT ){ printk("buffer=%p nr=%lx cnr=%lx\n", @@ -943,7 +943,7 @@ static int interpret_errors(void) char bad; if (inr!=7) { - printk(DEVICE_NAME ": -- FDC reply errror"); + printk(DEVICE_NAME ": -- FDC reply error"); FDCS->reset = 1; return 1; } @@ -2395,7 +2395,8 @@ static int invalidate_drive(int rdev) static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long param) { -#define IOCTL_ALLOWED (filp && (filp->f_mode & 8 )) +#define IOCTL_MODE_BIT 8 +#define IOCTL_ALLOWED (filp && (filp->f_mode & IOCTL_MODE_BIT)) struct floppy_struct newparams; struct format_descr tmp_format_req; @@ -2669,7 +2670,8 @@ static int floppy_open(struct inode * inode, struct file * filp) if (exclusive) return -EBUSY; - if ( !filp ){ + + if (!filp) { printk(DEVICE_NAME ": Weird, open called with filp=0\n"); return -EIO; } @@ -2678,15 +2680,15 @@ static int floppy_open(struct inode * inode, struct file * filp) if ( drive >= N_DRIVE ) return -ENXIO; - if (command_status == FD_COMMAND_DETECT && drive >= current_drive){ + if (command_status == FD_COMMAND_DETECT && drive >= current_drive) { lock_fdc(-1); unlock_fdc(); } - if ( TYPE(inode->i_rdev) >= NUMBER(floppy_type)) - return -ENXIO; + if (TYPE(inode->i_rdev) >= NUMBER(floppy_type)) + return -ENXIO; - if (filp->f_mode & 3){ + if (filp->f_mode & 3) { if ( !(UDRS->flags & FD_DRIVE_PRESENT)) return -ENXIO; } @@ -2694,67 +2696,49 @@ static int floppy_open(struct inode * inode, struct file * filp) old_dev = UDRS->fd_device; if (UDRS->fd_ref && old_dev != inode->i_rdev) return -EBUSY; - if (floppy_grab_irq_and_dma()) - return -EBUSY; - if (filp->f_flags & O_EXCL ){ - if (usage_count>1){ - floppy_release_irq_and_dma(); + if (filp->f_flags & O_EXCL) { + if (usage_count) return -EBUSY; - }else - exclusive=1; + else + exclusive = 1; } - /* filp->f_op is NULL if the disk is mounted, and non-NULL if opened */ - if (filp->f_op){ - if (UDRS->fd_ref == -1) - return -EBUSY; - UDRS->fd_ref++; - UDRS->fd_device = inode->i_rdev; - } else { - if (UDRS->fd_ref ){ - floppy_release_irq_and_dma(); - return -EBUSY; - } - UDRS->fd_ref=-1; - } + if (floppy_grab_irq_and_dma()) + return -EBUSY; - if (old_dev && old_dev != inode->i_rdev){ - if ( buffer_drive == drive ) + UDRS->fd_ref++; + UDRS->fd_device = inode->i_rdev; + + if (old_dev && old_dev != inode->i_rdev) { + if (buffer_drive == drive) buffer_track = -1; invalidate_buffers(old_dev); } - if (filp->f_mode & 2 || permission(inode,2)) - filp->f_mode |= 8; /* keep mtools working */ + /* Allow ioctls if we have write-permissions even if read-only open */ + if ((filp->f_mode & 2) || permission(inode,2)) + filp->f_mode |= IOCTL_MODE_BIT; if (UFDCS->rawcmd == 1) UFDCS->rawcmd = 2; if (filp->f_flags & O_NDELAY) return 0; + if (filp->f_mode && !(UDRS->flags & FD_DRIVE_PRESENT)) RETERR(ENXIO); - if(user_reset_fdc(drive, FD_RESET_IF_NEEDED)) + + if (user_reset_fdc(drive, FD_RESET_IF_NEEDED)) RETERR(EIO); - if (filp->f_mode & 3){ + if (filp->f_mode & 3) { check_disk_change(inode->i_rdev); - if ( changed_floppies & ( 1 << drive )){ - if ( suser() && filp->f_op) - /* prevent dosemu from crashing */ - filp->f_mode &= ~3; - else - RETERR(ENXIO); - } - } - if ((filp->f_mode & 2) && UDRS->flags < FD_DISK_WRITABLE){ - if ( suser() && filp->f_op) - /* prevent dosemu from crashing */ - filp->f_mode &= ~2; - else - RETERR(EROFS); + if (changed_floppies & ( 1 << drive )) + RETERR(ENXIO); } + if ((filp->f_mode & 2) && !(UDRS->flags & FD_DISK_WRITABLE)) + RETERR(EROFS); return 0; #undef RETERR } @@ -2914,17 +2898,6 @@ static struct cont_t detect_cont={ empty, (done_f) empty }; -/* - * This is the floppy IRQ description. The SA_INTERRUPT in sa_flags - * means we run the IRQ-handler with interrupts disabled. - */ -static struct sigaction floppy_sigaction = { - floppy_interrupt, - 0, - SA_INTERRUPT, - NULL -}; - void floppy_init(void) { int i; @@ -2999,7 +2972,7 @@ int floppy_grab_irq_and_dma(void) { if (usage_count++) return 0; - if (irqaction(FLOPPY_IRQ,&floppy_sigaction)) { + if (request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, "floppy")) { printk(DEVICE_NAME ": Unable to grab IRQ%d for the floppy driver\n", FLOPPY_IRQ); diff --git a/drivers/block/hd.c b/drivers/block/hd.c index 7f62c591b9c4..4064c32369af 100644 --- a/drivers/block/hd.c +++ b/drivers/block/hd.c @@ -932,13 +932,6 @@ static void hd_interrupt(int unused) * We enable interrupts in some of the routines after making sure it's * safe. */ -static struct sigaction hd_sigaction = { - hd_interrupt, - 0, - SA_INTERRUPT, - NULL -}; - static void hd_geninit(void) { int drive, i; @@ -962,13 +955,13 @@ static void hd_geninit(void) } /* - We querry CMOS about hard disks : it could be that + We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc controller that is BIOS - compatable with ST-506, and thus showing up in our - BIOS table, but not register compatable, and therefore + compatible with ST-506, and thus showing up in our + BIOS table, but not register compatible, and therefore not present in CMOS. - Furthurmore, we will assume that our ST-506 drives + Furthermore, we will assume that our ST-506 drives are the primary drives in the system, and the ones reflected as drive 1 or 2. @@ -1013,7 +1006,7 @@ static void hd_geninit(void) special_op[i] = 1; } if (NR_HD) { - if (irqaction(HD_IRQ,&hd_sigaction)) { + if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd")) { printk("hd.c: unable to get IRQ%d for the harddisk driver\n",HD_IRQ); NR_HD = 0; } diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 2e2c262ba4b4..d255f7ec60c3 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -373,7 +373,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bh[]) correct_size = i; } - /* Verify requested block sizees. */ + /* Verify requested block sizes. */ for (i = 0; i < nr; i++) { if (bh[i] && bh[i]->b_size != correct_size) { printk( diff --git a/drivers/block/mcd.c b/drivers/block/mcd.c index d544eeab7ea9..b661dfed6748 100644 --- a/drivers/block/mcd.c +++ b/drivers/block/mcd.c @@ -26,7 +26,7 @@ 0.3 Audio support added 0.3.1 Changes for mitsumi CRMC LU005S march version (stud11@cc4.kuleuven.ac.be) - 0.3.2 bug fixes to the ioclts and merged with ALPHA0.99-pl12 + 0.3.2 bug fixes to the ioctls and merged with ALPHA0.99-pl12 (Jon Tombs ) 0.3.3 Added more #defines and mcd_setup() (Jon Tombs ) @@ -530,7 +530,7 @@ printk("VOL %d %d\n", volctrl.channel0 & 0xFF, volctrl.channel1 & 0xFF); return 0; case CDROMEJECT: - /* all drives can atleast stop! */ + /* all drives can at least stop! */ if (audioStatus == CDROM_AUDIO_PLAY) { outb(MCMD_STOP, MCDPORT(0)); i = getMcdStatus(MCD_STATUS_DELAY); @@ -695,7 +695,7 @@ mcd_poll(void) - immediatly: + immediately: switch (mcd_state) { @@ -733,14 +733,14 @@ mcd_poll(void) mcd_invalidate_buffers(); } - set_mode_immediatly: + set_mode_immediately: if ((st & MST_DOOR_OPEN) || !(st & MST_READY)) { mcdDiskChanged = 1; tocUpToDate = 0; if (mcd_transfer_is_active) { mcd_state = MCD_S_START; - goto immediatly; + goto immediately; } printk((st & MST_DOOR_OPEN) ? "mcd: door open\n" : "mcd: disk removed\n"); mcd_state = MCD_S_IDLE; @@ -773,14 +773,14 @@ mcd_poll(void) mcd_invalidate_buffers(); } - read_immediatly: + read_immediately: if ((st & MST_DOOR_OPEN) || !(st & MST_READY)) { mcdDiskChanged = 1; tocUpToDate = 0; if (mcd_transfer_is_active) { mcd_state = MCD_S_START; - goto immediatly; + goto immediately; } printk((st & MST_DOOR_OPEN) ? "mcd: door open\n" : "mcd: disk removed\n"); mcd_state = MCD_S_IDLE; @@ -801,7 +801,7 @@ mcd_poll(void) McdTimeout = READ_TIMEOUT; } else { mcd_state = MCD_S_STOP; - goto immediatly; + goto immediately; } } @@ -814,7 +814,7 @@ mcd_poll(void) #endif st = inb(MCDPORT(1)) & (MFL_STATUSorDATA); - data_immediatly: + data_immediately: #ifdef TEST5 printk("Status %02x\n",st); #endif @@ -837,7 +837,7 @@ mcd_poll(void) } mcd_state = MCD_S_START; McdTimeout = READ_TIMEOUT; - goto immediatly; + goto immediately; case MFL_STATUSorDATA: break; @@ -846,7 +846,7 @@ mcd_poll(void) McdTries = 5; if (!CURRENT_VALID && mcd_buf_in == mcd_buf_out) { mcd_state = MCD_S_STOP; - goto immediatly; + goto immediately; } mcd_buf_bn[mcd_buf_in] = -1; READ_DATA(MCDPORT(0), mcd_buf + 2048 * mcd_buf_in, 2048); @@ -868,7 +868,7 @@ mcd_poll(void) && (CURRENT -> sector / 4 < mcd_next_bn || CURRENT -> sector / 4 > mcd_next_bn + 16)) { mcd_state = MCD_S_STOP; - goto immediatly; + goto immediately; } McdTimeout = READ_TIMEOUT; #ifdef DOUBLE_QUICK_ONLY @@ -883,7 +883,7 @@ mcd_poll(void) /* printk("Quickloop success at %d\n",QUICK_LOOP_COUNT-count); */ printk(" %d ",QUICK_LOOP_COUNT-count); # endif - goto data_immediatly; + goto data_immediately; } } # ifdef TEST4 @@ -979,9 +979,9 @@ mcd_poll(void) if (CURRENT_VALID) { if (st != -1) { if (mcd_mode == 1) - goto read_immediatly; + goto read_immediately; else - goto set_mode_immediatly; + goto set_mode_immediately; } else { mcd_state = MCD_S_START; McdTimeout = 1; @@ -1089,18 +1089,6 @@ static struct file_operations mcd_fops = { }; -/* - * MCD interrupt descriptor - */ - -static struct sigaction mcd_sigaction = { - mcd_interrupt, - 0, - SA_INTERRUPT, - NULL -}; - - /* * Test for presence of drive and initialize it. Called at boot time. */ @@ -1175,7 +1163,7 @@ mcd_init(unsigned long mem_start, unsigned long mem_end) /* don't get the IRQ until we know for sure the drive is there */ - if (irqaction(mcd_irq, &mcd_sigaction)) + if (request_irq(mcd_irq, mcd_interrupt, SA_INTERRUPT, "Mitsumi CD")) { printk("Unable to get IRQ%d for Mitsumi CD-ROM\n", mcd_irq); return mem_start; @@ -1395,7 +1383,7 @@ GetQChannelInfo(struct mcd_Toc *qp) /* - * Read the table of contents (TOC) and TOC header if neccessary + * Read the table of contents (TOC) and TOC header if necessary */ static int diff --git a/drivers/block/ramdisk.c b/drivers/block/ramdisk.c index a3ac8f2483a0..236727b272f5 100644 --- a/drivers/block/ramdisk.c +++ b/drivers/block/ramdisk.c @@ -107,7 +107,7 @@ static void do_load(void) * Check for a super block on the diskette. * The old-style boot/root diskettes had their RAM image * starting at block 512 of the boot diskette. LINUX/Pro - * uses the enire diskette as a file system, so in that + * uses the entire diskette as a file system, so in that * case, we have to look at block 0. Be intelligent about * this, and check both... - FvK */ diff --git a/drivers/block/sbpcd.c b/drivers/block/sbpcd.c index 30a57befe15f..1741d4cbd242 100644 --- a/drivers/block/sbpcd.c +++ b/drivers/block/sbpcd.c @@ -73,7 +73,7 @@ * return only zeroes. Is there no UPC/EAN code written? * * 1.5 Laborate with UPC/EAN code (not better yet). - * Adapt to kernel 1.1.8 change (have to explicitely include + * Adapt to kernel 1.1.8 change (have to explicitly include * now). * * 1.6 Trying to read audio frames as data. Impossible with the current @@ -82,7 +82,7 @@ * Changed CDROMSTOP routine (stop somewhat "softer" so that Workman * won't get confused). * Added a third interface type: Sequoia S-1000, as used with the SPEA - * Media FX sound card. This interface (useable for Sony and Mitsumi + * Media FX sound card. This interface (usable for Sony and Mitsumi * drives, too) needs a special configuration setup and behaves like a * LaserMate type after that. Still experimental - I do not have such * an interface. @@ -2646,7 +2646,7 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd, DriveStruct[d].mode=READ_M1; return (0); - case CDROMREADMODE2: /* not useable at the moment */ + case CDROMREADMODE2: /* not usable at the moment */ DPRINTF((DBG_IOC,"SBPCD: ioctl: CDROMREADMODE2 requested.\n")); xx_ModeSelect(CD_FRAMESIZE_XA); xx_ModeSense(); diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 973a902641ad..313afe3506f9 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c @@ -166,7 +166,7 @@ static void xd_geninit (void) for (i = 0; i < xd_drives; i++) printk("xd_geninit: drive %d geometry - heads = %d, cylinders = %d, sectors = %d\n",i,xd_info[i].heads,xd_info[i].cylinders,xd_info[i].sectors); - if (!request_irq(xd_irq,xd_interrupt_handler)) { + if (!request_irq(xd_irq,xd_interrupt_handler, 0, "XT harddisk")) { if (request_dma(xd_dma)) { printk("xd_geninit: unable to get DMA%d\n",xd_dma); free_irq(xd_irq); diff --git a/drivers/char/atixlmouse.c b/drivers/char/atixlmouse.c index c9952fcbeb32..649ce6d38e0c 100644 --- a/drivers/char/atixlmouse.c +++ b/drivers/char/atixlmouse.c @@ -104,7 +104,7 @@ static int open_mouse(struct inode * inode, struct file * file) mouse.dx = 0; mouse.dy = 0; mouse.buttons = mouse.latch_buttons = 0; - if (request_irq(ATIXL_MOUSE_IRQ, mouse_interrupt)) { + if (request_irq(ATIXL_MOUSE_IRQ, mouse_interrupt, 0, "ATIXL mouse")) { mouse.active = 0; return -EBUSY; } diff --git a/drivers/char/busmouse.c b/drivers/char/busmouse.c index 0d7a3be9e735..0c6373ab8935 100644 --- a/drivers/char/busmouse.c +++ b/drivers/char/busmouse.c @@ -112,7 +112,7 @@ static int open_mouse(struct inode * inode, struct file * file) mouse.dx = 0; mouse.dy = 0; mouse.buttons = 0x87; - if (request_irq(mouse_irq, mouse_interrupt)) + if (request_irq(mouse_irq, mouse_interrupt, 0, "Busmouse")) return -EBUSY; mouse.active = 1; MSE_INT_ON(); diff --git a/drivers/char/console.c b/drivers/char/console.c index 0d0c464d23cb..abe9af4ad74e 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -9,7 +9,7 @@ * * This module exports the console io functions: * - * 'long console_init(long, long)' + * 'long con_init(long)' * 'int con_open(struct tty_struct *tty, struct file * filp)' * 'void update_screen(int new_console)' * 'void blank_screen(void)' @@ -1521,16 +1521,16 @@ static void con_unthrottle(struct tty_struct *tty) } /* - * long console_init(long, long); + * long con_init(long); * - * This routine initalizes console interrupts, and does nothing + * This routine initializes console interrupts, and does nothing * else. If you want the screen to clear, call tty_write with - * the appropriate escape-sequece. + * the appropriate escape-sequence. * * Reads the information preserved by setup.s to determine the current display * type and sets everything accordingly. */ -long console_init(long kmem_start, long kmem_end) +long con_init(long kmem_start) { char *display_desc = "????"; int currcons = 0; @@ -1867,7 +1867,7 @@ static inline int inword(const char c) { return ( inwordLut[(c>>5)&3] >> (c&0x1F) ) & 1; } -/* set inwordLut conntents. Invoked by ioctl(). */ +/* set inwordLut contents. Invoked by ioctl(). */ int sel_loadlut(const int arg) { memcpy_fromfs(inwordLut,(unsigned long *)(arg+4),16); @@ -2155,7 +2155,7 @@ static int set_get_font(char * arg, int set) put_fs_byte(*(charmap+i), arg+i); cli(); - outb_p( 0x00, seq_port_reg ); /* Frist, the sequencer */ + outb_p( 0x00, seq_port_reg ); /* First, the sequencer */ outb_p( 0x01, seq_port_val ); /* Synchronous reset */ outb_p( 0x02, seq_port_reg ); outb_p( 0x03, seq_port_val ); /* CPU writes to maps 0 and 1 */ diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index f021eef82543..698ed92cd9f8 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -437,7 +437,7 @@ static void hold(void) return; /* - * Note: SCROLLOCK wil be set (cleared) by stop_tty (start_tty); + * Note: SCROLLOCK will be set (cleared) by stop_tty (start_tty); * these routines are also activated by ^S/^Q. * (And SCROLLOCK can also be set by the ioctl KDSETLED.) */ @@ -893,7 +893,7 @@ unsigned long kbd_init(unsigned long kmem_start) ttytab = console_driver.table; bh_base[KEYBOARD_BH].routine = kbd_bh; - request_irq(KEYBOARD_IRQ,keyboard_interrupt); + request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard"); mark_bh(KEYBOARD_BH); return kmem_start; } diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 7d420a83a11e..518487279fab 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -282,7 +282,6 @@ static int lp_open(struct inode * inode, struct file * file) unsigned int minor = MINOR(inode->i_rdev); int ret; unsigned int irq; - struct sigaction sa; if (minor >= LP_NO) return -ENODEV; @@ -296,11 +295,7 @@ static int lp_open(struct inode * inode, struct file * file) if (!lp_table[minor].lp_buffer) return -ENOMEM; - sa.sa_handler = lp_interrupt; - sa.sa_flags = SA_INTERRUPT; - sa.sa_mask = 0; - sa.sa_restorer = NULL; - ret = irqaction(irq, &sa); + ret = request_irq(irq, lp_interrupt, SA_INTERRUPT, "printer"); if (ret) { kfree_s(lp_table[minor].lp_buffer, LP_BUFFER_SIZE); lp_table[minor].lp_buffer = NULL; @@ -362,7 +357,6 @@ static int lp_ioctl(struct inode *inode, struct file *file, int oldirq; int newirq = arg; struct lp_struct *lp = &lp_table[minor]; - struct sigaction sa; if (!suser()) return -EPERM; @@ -381,14 +375,10 @@ static int lp_ioctl(struct inode *inode, struct file *file, } if (newirq) { /* Install new irq */ - sa.sa_handler = lp_interrupt; - sa.sa_flags = SA_INTERRUPT; - sa.sa_mask = 0; - sa.sa_restorer = NULL; - if ((retval = irqaction(newirq, &sa))) { + if ((retval = request_irq(newirq, lp_interrupt, SA_INTERRUPT, "printer"))) { if (oldirq) { /* restore old irq */ - irqaction(oldirq, &sa); + request_irq(oldirq, lp_interrupt, SA_INTERRUPT, "printer"); } else { /* We don't need the buffer */ kfree_s(lp->lp_buffer, LP_BUFFER_SIZE); diff --git a/drivers/char/msbusmouse.c b/drivers/char/msbusmouse.c index 6db02c089ed6..c5be7f03453f 100644 --- a/drivers/char/msbusmouse.c +++ b/drivers/char/msbusmouse.c @@ -22,7 +22,7 @@ * Modified by Christoph Niemann (niemann@rubdv15.etdv.ruhr-uni-bochum.de) * Changes: Better interrupt-handler (like in busmouse.c). * Some changes to reduce code-size. - * Changed dectection code to use inb_p() instead of doing empty + * Changed detection code to use inb_p() instead of doing empty * loops to delay i/o. * * version 0.3a @@ -86,7 +86,7 @@ static int open_mouse(struct inode * inode, struct file * file) mouse.active = 1; mouse.ready = mouse.dx = mouse.dy = 0; mouse.buttons = 0x80; - if (request_irq(MOUSE_IRQ, ms_mouse_interrupt)) { + if (request_irq(MOUSE_IRQ, ms_mouse_interrupt, 0, "MS Busmouse")) { mouse.active = 0; return -EBUSY; } diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 5f52da43e806..b0313fd96b83 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -1,5 +1,5 @@ /* - * n_tty.c --- implements the N_TTY line discpline. + * n_tty.c --- implements the N_TTY line discipline. * * This code used to be in tty_io.c, but things are getting hairy * enough that it made sense to split things off. (The N_TTY @@ -8,7 +8,7 @@ * * Note that the open routine for N_TTY is guaranteed never to return * an error. This is because Linux will fall back to setting a line - * to N_TTY if it can not switch to any other line discpline. + * to N_TTY if it can not switch to any other line discipline. * * Written by Theodore Ts'o, Copyright 1994. * @@ -85,7 +85,7 @@ void n_tty_flush_buffer(struct tty_struct * tty) } /* - * Return number of characters buffered to be delievered to user + * Return number of characters buffered to be delivered to user */ int n_tty_chars_in_buffer(struct tty_struct *tty) { diff --git a/drivers/char/psaux.c b/drivers/char/psaux.c index 57d1005b9cbc..9f43a1a83ec4 100644 --- a/drivers/char/psaux.c +++ b/drivers/char/psaux.c @@ -272,7 +272,7 @@ static int open_aux(struct inode * inode, struct file * file) return -EBUSY; aux_busy = 1; queue->head = queue->tail = 0; /* Flush input queue */ - if (request_irq(AUX_IRQ, aux_interrupt)) { + if (request_irq(AUX_IRQ, aux_interrupt, 0, "PS/2 Mouse")) { aux_busy = 0; return -EBUSY; } @@ -302,7 +302,7 @@ static int open_qp(struct inode * inode, struct file * file) if (qp_busy) return -EBUSY; - if (request_irq(QP_IRQ, qp_interrupt)) + if (request_irq(QP_IRQ, qp_interrupt, 0, "PS/2 Mouse")) return -EBUSY; qp_busy = 1; diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 2cea733b63cc..f091af3d78a0 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -88,7 +88,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp) /* * The unthrottle routine is called by the line discipline to signal * that it can receive more characters. For PTY's, the TTY_THROTTLED - * flag is always set, to force the line discpline to always call the + * flag is always set, to force the line discipline to always call the * unthrottle routine when there are fewer than TTY_THRESHOLD_UNTHROTTLE * characters in the queue. This is necessary since each time this * happens, we need to wake up any sleeping processes that could be diff --git a/drivers/char/serial.c b/drivers/char/serial.c index 958dd8a5d607..4aaa21d40dfd 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -115,7 +115,7 @@ static void change_speed(struct async_struct *info); * While the access port and interrupt is configurable, the default * port locations are 0x302 for the port control register, and 0x303 * for the data read/write register. Normally, the interrupt is at irq3 - * but can be anything from 3 to 7 inclusive. Note tht using 3 will + * but can be anything from 3 to 7 inclusive. Note that using 3 will * require disabling com2. */ @@ -221,7 +221,7 @@ static inline int serial_paranoia_check(struct async_struct *info, } /* - * This is used to figure out the divsor speeds and the timeouts + * This is used to figure out the divisor speeds and the timeouts */ static int baud_table[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, @@ -720,7 +720,7 @@ static void do_softint(void *private) /* * This subroutine is called when the RS_TIMER goes off. It is used * by the serial driver to handle ports that do not have an interrupt - * (irq=0). This doesn't work very well for 16450's, but gives bearly + * (irq=0). This doesn't work very well for 16450's, but gives barely * passable results for a 16550A. (Although at the expense of much * CPU overhead). */ @@ -781,15 +781,9 @@ static int grab_all_interrupts(int dontgrab) { int irq_lines = 0; int i, mask; - struct sigaction sa; - - sa.sa_handler = rs_probe; - sa.sa_flags = (SA_INTERRUPT); - sa.sa_mask = 0; - sa.sa_restorer = NULL; for (i = 0, mask = 1; i < 16; i++, mask <<= 1) { - if (!(mask & dontgrab) && !irqaction(i, &sa)) { + if (!(mask & dontgrab) && !request_irq(i, rs_probe, SA_INTERRUPT, "serial probe")) { irq_lines |= mask; } } @@ -838,8 +832,8 @@ static int startup(struct async_struct * info) { unsigned short ICP; unsigned long flags; - int retval; - struct sigaction sa; + int retval; + void (*handler)(int); if (info->flags & ASYNC_INITIALIZED) return 0; @@ -895,14 +889,11 @@ static int startup(struct async_struct * info) !IRQ_ports[info->irq]->next_port)) { if (IRQ_ports[info->irq]) { free_irq(info->irq); - sa.sa_handler = rs_interrupt; + handler = rs_interrupt; } else - sa.sa_handler = rs_interrupt_single; + handler = rs_interrupt_single; - sa.sa_flags = (SA_INTERRUPT); - sa.sa_mask = 0; - sa.sa_restorer = NULL; - retval = irqaction(info->irq,&sa); + retval = request_irq(info->irq, handler, SA_INTERRUPT, "serial"); if (retval) { restore_flags(flags); if (suser()) { @@ -995,7 +986,6 @@ static int startup(struct async_struct * info) */ static void shutdown(struct async_struct * info) { - struct sigaction sa; unsigned long flags; unsigned long timeout; int retval; @@ -1028,14 +1018,10 @@ static void shutdown(struct async_struct * info) !IRQ_ports[info->irq]->next_port)) { if (IRQ_ports[info->irq]) { free_irq(info->irq); - sa.sa_flags = (SA_INTERRUPT); - sa.sa_mask = 0; - sa.sa_restorer = NULL; - sa.sa_handler = rs_interrupt_single; - retval = irqaction(info->irq, &sa); + retval = request_irq(info->irq, rs_interrupt_single, 0, "serial"); if (retval) - printk("serial shutdown: irqaction: error %d" + printk("serial shutdown: request_irq: error %d" " Couldn't reacquire IRQ.\n", retval); } else free_irq(info->irq); @@ -1054,7 +1040,7 @@ static void shutdown(struct async_struct * info) } /* - * Bebore we drop DTR, make sure the UART transmitter has + * Before we drop DTR, make sure the UART transmitter has * completely drained; this is especially important if there * is a transmit FIFO! * @@ -1975,8 +1961,8 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, /* * This routine is called whenever a serial port is opened. It * enables interrupts for a serial port, linking in its async structure into - * the IRQ chain. It also performs the serial-speicific - * initalization for the tty structure. + * the IRQ chain. It also performs the serial-specific + * initialization for the tty structure. */ int rs_open(struct tty_struct *tty, struct file * filp) { @@ -2200,7 +2186,7 @@ static void autoconfig(struct async_struct * info) * test, because they apparently don't implement the loopback * test mode. So this test is skipped on the COM 1 through * COM 4 ports. This *should* be safe, since no board - * manufactucturer would be stupid enough to design a board + * manufacturer would be stupid enough to design a board * that conflicts with COM 1-4 --- we hope! */ if (!(info->flags & ASYNC_SKIP_TEST)) { diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c index 01ca1fd1d79c..0b0120004e00 100644 --- a/drivers/char/tpqic02.c +++ b/drivers/char/tpqic02.c @@ -2796,20 +2796,6 @@ static struct file_operations qic02_tape_fops = { NULL /* fsync */ }; - -/* Attribute `SA_INTERRUPT' makes the interrupt atomic with - * interrupts disabled. We could do without the atomic stuff, but - * then dma_transfer() would have to disable interrupts explicitly. - * System load is high enough as it is :-( - */ -static struct sigaction qic02_tape_sigaction = { - qic02_tape_interrupt, - 0, - SA_INTERRUPT, - NULL -}; - - /* align `a' at `size' bytes. `size' must be a power of 2 */ static inline unsigned long const align_buffer(unsigned long a, unsigned size) { @@ -2846,7 +2832,7 @@ static int qic02_get_resources(void) */ /* get IRQ */ - if (irqaction(QIC02_TAPE_IRQ, &qic02_tape_sigaction)) { + if (request_irq(QIC02_TAPE_IRQ, qic02_tape_interrupt, SA_INTERRUP, "QIC-02")) { printk(TPQIC02_NAME ": can't allocate IRQ%d for QIC-02 tape\n", QIC02_TAPE_IRQ); status_zombie = YES; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 3ab306a69c68..6c670c376607 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -25,7 +25,7 @@ * which can be dynamically activated and de-activated by the line * discipline handling modules (like SLIP). * - * NOTE: pay no attention to the line discpline code (yet); its + * NOTE: pay no attention to the line discipline code (yet); its * interface is still subject to change in this version... * -- TYT, 1/31/92 * @@ -390,7 +390,7 @@ int tty_hung_up_p(struct file * filp) /* * This function is typically called only by the session leader, when - * it wants to dissassociate itself from its controlling tty. + * it wants to disassociate itself from its controlling tty. * * It performs the following functions: * (1) Sends a SIGHUP and SIGCONT to the foreground process group @@ -1464,7 +1464,7 @@ void do_SAK( struct tty_struct *tty) /* * This routine is called out of the software interrupt to flush data - * from the flip buffer to the line discpline. + * from the flip buffer to the line discipline. */ static void flush_to_ldisc(void *private) { @@ -1548,15 +1548,14 @@ int tty_register_driver(struct tty_driver *driver) return 0; } -long tty_init(long kmem_start) +/* + * Initialize the console device. This is called *early*, so + * we can't necessarily depend on lots of kernel help here. + * Jus do some early initializations, and do the complex setup + * later. + */ +long console_init(long kmem_start, long kmem_end) { - if (sizeof(struct tty_struct) > PAGE_SIZE) - 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)) - panic("unable to get major %d for tty device", TTYAUX_MAJOR); - /* Setup the default TTY line discipline. */ memset(ldiscs, 0, sizeof(ldiscs)); (void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY); @@ -1572,7 +1571,27 @@ long tty_init(long kmem_start) tty_std_termios.c_cflag = B38400 | CS8 | CREAD; tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN; - + + /* + * set up the console device so that later boot sequences can + * inform about problems etc.. + */ + return con_init(kmem_start); +} + +/* + * Ok, now we can initialize the rest of the tty devices and can count + * on memory allocations, interrupts etc.. + */ +long tty_init(long kmem_start) +{ + if (sizeof(struct tty_struct) > PAGE_SIZE) + 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)) + panic("unable to get major %d for tty device", TTYAUX_MAJOR); + kmem_start = kbd_init(kmem_start); kmem_start = rs_init(kmem_start); kmem_start = pty_init(kmem_start); diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index 77a9c8442add..eeacb2dd4f64 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c @@ -214,7 +214,7 @@ el_open(struct device *dev) if (el_debug > 2) printk("%s: Doing el_open()...", dev->name); - if (request_irq(dev->irq, &el_interrupt)) { + if (request_irq(dev->irq, &el_interrupt, 0, "3c501")) { if (el_debug > 2) printk("interrupt busy, exiting el_open().\n"); return -EAGAIN; diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 1feabaf864b4..79e5aedc534c 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c @@ -111,7 +111,7 @@ el2_pio_autoprobe(struct device *dev) } /* Probe for the Etherlink II card at I/O port base IOADDR, - returning non-zero on sucess. If found, set the station + returning non-zero on success. If found, set the station address and memory parameters in DEVICE. */ int el2probe1(int ioaddr, struct device *dev) @@ -247,13 +247,13 @@ el2_open(struct device *dev) outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */ do { - if (request_irq (*irqp, NULL) != -EBUSY) { + if (request_irq (*irqp, NULL, 0, "bogus") != -EBUSY) { /* Twinkle the interrupt, and check if it's seen. */ autoirq_setup(0); outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); outb_p(0x00, E33G_IDCFR); if (*irqp == autoirq_report(0) /* It's a good IRQ line! */ - && request_irq (dev->irq = *irqp, &ei_interrupt) == 0) + && request_irq (dev->irq = *irqp, &ei_interrupt, 0, "3c503") == 0) break; } } while (*++irqp); @@ -262,7 +262,7 @@ el2_open(struct device *dev) return -EAGAIN; } } else { - if (request_irq(dev->irq, &ei_interrupt)) { + if (request_irq(dev->irq, &ei_interrupt, 0, "3c503")) { return -EAGAIN; } } diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index 34022ff585ca..657e2ac047af 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c @@ -20,7 +20,7 @@ * Donald Becker, * Crynwr packet driver by * Krishnan Gopalan and Gregg Stefancik, - * Clemson Univesity Engineering Computer Operations. + * Clemson University Engineering Computer Operations. * Portions of the code have been adapted from the 3c505 * driver for NCSA Telnet by Bruce Orchard and later * modified by Warren Van Houten and krus@diku.dk. @@ -888,7 +888,7 @@ static int elp_open (struct device *dev) /* * install our interrupt service routine */ - if (request_irq(dev->irq, &elp_interrupt)) + if (request_irq(dev->irq, &elp_interrupt, 0, "3c505")) return -EAGAIN; /* @@ -902,7 +902,7 @@ static int elp_open (struct device *dev) OUTB(CONTROL_CMDE, adapter->io_addr+PORT_CONTROL); /* - * device is now offically open! + * device is now officially open! */ dev->start = 1; diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index 7b0fa9299147..d923f452b1ca 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c @@ -4,7 +4,7 @@ Copyright 1993 United States Government as represented by the Director, National Security Agency. This software may only be used and distributed according to the terms of the GNU Public License as modified by SRC, - incorported herein by reference. + incorporated herein by reference. The author may be reached as becker@super.org or C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 @@ -29,7 +29,7 @@ static char *version = Sources: This driver wouldn't have been written with the availability of the Crynwr driver source code. It provided a known-working implementation - that filled in the gaping holes of the Intel documention. Three cheers + that filled in the gaping holes of the Intel documentation. Three cheers for Russ Nelson. Intel Microcommunications Databook, Vol. 1, 1990. It provides just enough @@ -66,10 +66,10 @@ static unsigned int net_debug = NET_DEBUG; Details of the i82586. You'll really need the databook to understand the details of this part, - but the outline is that the i82586 has two seperate processing units. + but the outline is that the i82586 has two separate processing units. Both are started from a list of three configuration tables, of which only the last, the System Control Block (SCB), is used after reset-time. The SCB - has the following fileds: + has the following fields: Status word Command word Tx/Command block addr. @@ -142,7 +142,7 @@ struct net_local { /* Since the 3c507 maps the shared memory window so that the last byte is at 82586 address FFFF, the first byte is at 82586 address 0, 16K, 32K, or - 48K cooresponding to window sizes of 64K, 48K, 32K and 16K respectively. + 48K corresponding to window sizes of 64K, 48K, 32K and 16K respectively. We can account for this be setting the 'SBC Base' entry in the ISCP table below for all the 16 bit offset addresses, and also adding the 'SCB Base' value to all 24 bit physical addresses (in the SCP table and the TX and RX @@ -282,7 +282,7 @@ void init_82586_mem(struct device *dev); /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. If dev->base_addr == 1, always return failure. - If dev->base_addr == 2, (detachable devices only) alloate space for the + If dev->base_addr == 2, (detachable devices only) allocate space for the device and return success. */ int @@ -340,11 +340,11 @@ int el16_probe1(struct device *dev, short ioaddr) printk("%s: 3c507 at %#x,", dev->name, ioaddr); /* We should make a few more checks here, like the first three octets of - the S.A. for the manufactor's code. */ + the S.A. for the manufacturer's code. */ irq = inb(ioaddr + IRQ_CONFIG) & 0x0f; - irqval = request_irq(irq, &el16_interrupt); + irqval = request_irq(irq, &el16_interrupt, 0, "3c507"); if (irqval) { printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval); return EAGAIN; diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index e21b3e54add6..752c99893d84 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -153,7 +153,7 @@ int el3_probe(struct device *dev) /* Next check for all ISA bus boards by sending the ID sequence to the ID_PORT. We find cards past the first by setting the 'current_tag' on cards as they are found. Cards with their tag set will not - respond to subseqent ID seqences. */ + respond to subsequent ID sequences. */ outb(0x00, ID_PORT); outb(0x00, ID_PORT); for(i = 0; i < 255; i++) { @@ -283,7 +283,7 @@ el3_open(struct device *dev) int ioaddr = dev->base_addr; int i; - if (request_irq(dev->irq, &el3_interrupt)) { + if (request_irq(dev->irq, &el3_interrupt, 0, "3c509")) { return -EAGAIN; } @@ -367,7 +367,7 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev) return 0; if (el3_debug > 4) { - printk("%s: el3_start_xmit(lenght = %ld) called, status %4.4x.\n", + printk("%s: el3_start_xmit(length = %ld) called, status %4.4x.\n", dev->name, skb->len, inw(ioaddr + EL3_STATUS)); } #ifndef final_version diff --git a/drivers/net/8390.c b/drivers/net/8390.c index 57029c81a5c9..aae2bdd32035 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c @@ -53,6 +53,11 @@ static char *version = #include "8390.h" +#ifdef MODULE +#include +#include "../../tools/version.h" +#endif + /* These are the operational function interfaces to board-specific routines. void reset_8390(struct device *dev) @@ -96,7 +101,6 @@ static void NS8390_trigger_send(struct device *dev, unsigned int length, static void set_multicast_list(struct device *dev, int num_addrs, void *addrs); #endif -struct sigaction ei_sigaction = { ei_interrupt, 0, 0, NULL, }; /* Open/initialize the board. This routine goes all-out, setting everything up anew at each open, even though many of these registers should only @@ -130,12 +134,15 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev) the board has died and kick it. */ if (dev->tbusy) { /* Do timeouts, just like the 8003 driver. */ - int txsr = inb(e8390_base+EN0_TSR), isr; + int txsr = inb(e8390_base+EN0_TSR), isr, cmd; int tickssofar = jiffies - dev->trans_start; if (tickssofar < 10 || (tickssofar < 15 && ! (txsr & ENTSR_PTX))) { return 1; } isr = inb(e8390_base+EN0_ISR); + cmd = inb(e8390_base+E8390_CMD) & (E8390_STOP|E8390_START); + if ((cmd == 0) || (cmd == (E8390_STOP|E8390_START))) + return 1; printk(KERN_DEBUG "%s: transmit timed out, TX status %#2x, ISR %#2x.\n", dev->name, txsr, isr); /* Does the 8390 thinks it has posted an interrupt? */ @@ -238,7 +245,7 @@ void ei_interrupt(int reg_ptr) int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2); struct device *dev = (struct device *)(irq2dev_map[irq]); int e8390_base; - int interrupts, boguscount = 0; + int interrupts, cmd, boguscount = 0; struct ei_device *ei_local; if (dev == NULL) { @@ -270,6 +277,12 @@ void ei_interrupt(int reg_ptr) /* !!Assumption!! -- we stay in page 0. Don't break this. */ while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0 && ++boguscount < 9) { + cmd = inb(e8390_base+E8390_CMD) & (E8390_STOP|E8390_START); + if ((cmd == 0) || (cmd == (E8390_STOP|E8390_START))) { + printk("%s: card not present\n", dev->name); + interrupts = 0; + break; + } if (interrupts & ENISR_RDC) { /* Ack meaningless DMA complete. */ outb_p(ENISR_RDC, e8390_base + EN0_ISR); @@ -669,6 +682,19 @@ static void NS8390_trigger_send(struct device *dev, unsigned int length, return; } +#ifdef MODULE +char kernel_version[] = UTS_RELEASE; + +int init_module(void) +{ + return 0; +} + +void +cleanup_module(void) +{ +} +#endif /* MODULE */ /* * Local variables: diff --git a/drivers/net/8390.h b/drivers/net/8390.h index 08e763eb66a8..d5c71968a511 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h @@ -154,6 +154,6 @@ struct ei_device { struct e8390_pkt_hdr { unsigned char status; /* status */ unsigned char next; /* pointer to next packet. */ - unsigned short count; /* header + packet lenght in bytes */ + unsigned short count; /* header + packet length in bytes */ }; #endif /* _8390_h */ diff --git a/drivers/net/CONFIG b/drivers/net/CONFIG index 01ab266f58fd..eaa1bdd297ab 100644 --- a/drivers/net/CONFIG +++ b/drivers/net/CONFIG @@ -47,7 +47,7 @@ # Most drivers also have a *_DEBUG setting that may be adjusted. -# The 8390 drivers share the EI_DEBUG settting. +# The 8390 drivers share the EI_DEBUG setting. # General options for Space.c OPTS = # -DETH0_ADDR=0x300 -DETH0_IRQ=11 diff --git a/drivers/net/MODULES b/drivers/net/MODULES index 8bb7d9560fb4..d9c8ca454ca8 100644 --- a/drivers/net/MODULES +++ b/drivers/net/MODULES @@ -3,6 +3,5 @@ MODULES = \ de600.o \ de620.o \ 3c501.o \ - plip.o - - + plip.o \ + 8390.o diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 783b0ce564a6..eeaa058d2d00 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -12,11 +12,15 @@ NETDRV_OBJS := Space.o auto_irq.o net_init.o loopback.o CFLAGS := $(CFLAGS) -I../../net/inet CPP := $(CPP) -I../../net/inet +.c.o: + $(CC) $(CFLAGS) -c $< + + # The point of the makefile... all: net.a modules Space.o: Space.c ../../include/linux/autoconf.h - $(CC) $(CFLAGS) $(OPTS) -c $< -o $@ + $(CC) $(CFLAGS) $(OPTS) -c $< net_init.o: ../../include/linux/autoconf.h diff --git a/drivers/net/README.DLINK b/drivers/net/README.DLINK index 7810a6dce04b..dba5dbcc5f23 100644 --- a/drivers/net/README.DLINK +++ b/drivers/net/README.DLINK @@ -131,7 +131,7 @@ Released 1994-06-13 DE-600: - The adapter is not recognized at boot, i.e. an Ethernet - adress of 00:80:c8:... is not shown, try to add another + address of 00:80:c8:... is not shown, try to add another "; SLOW_DOWN_IO" at DE600_SLOW_DOWN in the "tuning" section. As a last resort, uncomment: "#define REALLY_SLOW_IO" (see for hints). diff --git a/drivers/net/README1.PLIP b/drivers/net/README1.PLIP index d68745b4a8d5..9d33f79a48ea 100644 --- a/drivers/net/README1.PLIP +++ b/drivers/net/README1.PLIP @@ -61,7 +61,7 @@ nibbles into bytes. This cable should not be used on unidirectional isn't configured for PLIP, as it will result in output driver conflicts and the (unlikely) possibility of damage. -The cable for this tranfer mode should be constructed as follows: +The cable for this transfer mode should be constructed as follows: STROBE->BUSY 1 - 11 D0->D0 2 - 2 @@ -83,7 +83,7 @@ The cable for this tranfer mode should be constructed as follows: Once again, if the cable you are using has a metallic shield it should be connected to the metallic DB-25 shell at one end only. -\section{PLIP Mode 0 tranfer protocol} +\section{PLIP Mode 0 transfer protocol} The PLIP driver is compatible with the "Crynwr" parallel port transfer standard in Mode 0. That standard specifies the following protocol: diff --git a/drivers/net/README2.PLIP b/drivers/net/README2.PLIP index 63b4754bf070..c1d2a82efecc 100644 --- a/drivers/net/README2.PLIP +++ b/drivers/net/README2.PLIP @@ -4,7 +4,7 @@ Hi again About my previous mail: I've looked into parallel.asm, and I'm rather confused. Looks like the code agrees with you, but not -the protocol description preceeding it?? I got to look more +the protocol description preceding it?? I got to look more careful, but it wont be for a while (approx a week). >From plip.c (v0.04): @@ -17,13 +17,13 @@ careful, but it wont be for a while (approx a week). I saw you removed 1 and 14 from the cable description, but not 16 and 17. Why is that? -Have been succesful in getting parallel.com working (the Messy-Loss +Have been successful in getting parallel.com working (the Messy-Loss software). Using the pksend on the sender and pkall/pkwatch/whatnot gives me a hung receiver. (The cable works, I've tried unet11, a DOS cheap-net prog.) Using PLIP v0.03 and trying to ping the other end gives - 88 timeout 88 timeout....(more) 2386 bogous packet size, dropped + 88 timeout 88 timeout....(more) 2386 bogus packet size, dropped on the receiver, and on the sender lots of timeout, but of course I don't know how much is supposed to work. @@ -32,7 +32,7 @@ long time ago. Use it for whatever you like, or dump it in the bin. ;^) /Tommy ----- -Becker [& Co] provdly presents PLIP +Becker [& Co] proudly presents PLIP What is PLIP? ============= @@ -47,7 +47,7 @@ initiated by Crynwr.] Advantages of PLIP ================== -It's cheap, it's availble everywhere, and it's easy. +It's cheap, it's available everywhere, and it's easy. The PLIP cable is all that's needed to connect two Linux boxes, and it can be build for very bucks. @@ -55,7 +55,7 @@ can be build for very bucks. Connecting two Linux boxes takes only a seconds decision and a few minutes work, no need to search for a [supported] netcard. This might even be especially important in the case of notebooks, where netcard -are not easily availble. +are not easily available. Not requiring a netcard also means that apart from connecting the cables, everything else is software configuration [which in principle @@ -69,7 +69,7 @@ Can only be used to connect three (?) Linux boxes. Doesn't connect to an exiting ethernet. Isn't standard (not even de facto standard, like SLIP). -Performens +Performance ========== PLIP easily outperforms ethernet cards....(ups, I was dreaming, but diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 4a48e5167331..0d2251e22b0a 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -33,7 +33,7 @@ #define NEXT_DEV NULL -/* A unifed ethernet device probe. This is the easiest way to have every +/* A unified ethernet device probe. This is the easiest way to have every ethernet adaptor have the name "eth[0123...]". */ diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c index 5b2a24d4c15c..27f9a8022b35 100644 --- a/drivers/net/ac3200.c +++ b/drivers/net/ac3200.c @@ -139,7 +139,7 @@ static int ac_probe1(int ioaddr, struct device *dev) else if (dev->irq == 2) dev->irq = 9; - if (irqaction (dev->irq, &ei_sigaction)) { + if (request_irq(dev->irq, ei_interrupt, 0, "ac3200")) { printk (" unable to get IRQ %d.\n", dev->irq); return 0; } @@ -194,7 +194,7 @@ static int ac_open(struct device *dev) /* Someday we may enable the IRQ and shared memory here. */ int ioaddr = dev->base_addr; - if (irqaction(dev->irq, &ei_sigaction)) + if (request_irq(dev->irq, ei_interrupt, 0, "ac3200")) return -EAGAIN; #endif diff --git a/drivers/net/apricot.c b/drivers/net/apricot.c index 96609b525d5c..15609dc42354 100644 --- a/drivers/net/apricot.c +++ b/drivers/net/apricot.c @@ -63,7 +63,7 @@ int i596_debug = 1; #define CMD_SUSP 0x4000 /* Suspend after doing cmd. */ #define CMD_INTR 0x2000 /* Interrupt after doing cmd. */ -#define CMD_FLEX 0x0008 /* Enable flexable memory model */ +#define CMD_FLEX 0x0008 /* Enable flexible memory model */ enum commands { CmdNOp = 0, CmdSASetup = 1, CmdConfigure = 2, CmdMulticastList = 3, @@ -488,7 +488,7 @@ static void i596_cleanup_cmd(struct i596_private *lp) static int i596_open(struct device *dev) { - if (request_irq(dev->irq, &i596_interrupt)) { + if (request_irq(dev->irq, &i596_interrupt, 0, "apricot")) { return -EAGAIN; } @@ -819,7 +819,7 @@ i596_interrupt(int reg_ptr) if (dev->start) ack_cmd |= RX_START; } - /* acknowlage the interrupt */ + /* acknowledge the interrupt */ /* if ((lp->scb.cmd != (struct i596_cmd *) -1) && (dev->start)) ack_cmd |= CUC_START; diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index 39fd07aa3500..91d13840b667 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c @@ -8,7 +8,7 @@ C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 This is a device driver for the Allied Telesis AT1700, which is a - straight-foward Fujitsu MB86965 implementation. + straightforward Fujitsu MB86965 implementation. */ static char *version = @@ -121,7 +121,7 @@ static void set_multicast_list(struct device *dev, int num_addrs, void *addrs); /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. If dev->base_addr == 1, always return failure. - If dev->base_addr == 2, alloate space for the device and return success + If dev->base_addr == 2, allocate space for the device and return success (detachable devices only). */ int @@ -184,7 +184,7 @@ int at1700_probe1(struct device *dev, short ioaddr) | (read_eeprom(ioaddr, 0)>>14)]; /* Snarf the interrupt vector now. */ - if (request_irq(irq, &net_interrupt)) { + if (request_irq(irq, &net_interrupt, 0, "at1700")) { printk ("AT1700 found at %#3x, but it's unusable due to a conflict on" "IRQ %d.\n", ioaddr, irq); return EAGAIN; @@ -204,7 +204,7 @@ int at1700_probe1(struct device *dev, short ioaddr) } /* The EEPROM word 12 bit 0x0400 means use regular 100 ohm 10baseT signals, - rather than 150 ohm shielded twisted pair compansation. + rather than 150 ohm shielded twisted pair compensation. 0x0000 == auto-sense the interface 0x0800 == use TP interface 0x1800 == use coax interface diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 49154d8d1b21..94e345ecc47a 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -4,7 +4,7 @@ Copyright 1993 United States Government as represented by the Director, National Security Agency. This software may only be used and distributed according to the terms of the GNU Public License as modified by SRC, - incorported herein by reference. + incorporated herein by reference. The author may be reached as becker@super.org or C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 @@ -65,7 +65,7 @@ static char *version = it to stabilize. This delay seems to be needed on most machines. The data transfer mode is stored in the 'dev->if_port' field. Its default - value is '4'. It may be overriden at boot-time using the third parameter + value is '4'. It may be overridden at boot-time using the third parameter to the "ether=..." initialization. The header file provides inline functions that encapsulate the @@ -149,7 +149,7 @@ static void set_multicast_list(struct device *dev, int num_addrs, void *addrs); /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. If dev->base_addr == 1, always return failure. - If dev->base_addr == 2, alloate space for the device and return success + If dev->base_addr == 2, allocate space for the device and return success (detachable devices only). */ int @@ -208,7 +208,7 @@ static int atp_probe1(struct device *dev, short ioaddr) dev->irq = 7; else dev->irq = 5; - write_reg_high(ioaddr, CMR1, CMR1h_TxRxOFF); /* Diable Tx and Rx units. */ + write_reg_high(ioaddr, CMR1, CMR1h_TxRxOFF); /* Disable Tx and Rx units. */ write_reg(ioaddr, CMR2, CMR2_NULL); dev->base_addr = ioaddr; @@ -323,7 +323,7 @@ static int net_open(struct device *dev) port or interrupt may be shared. */ if (irq2dev_map[dev->irq] != 0 || (irq2dev_map[dev->irq] = dev) == 0 - || request_irq(dev->irq, &net_interrupt)) { + || request_irq(dev->irq, &net_interrupt, 0, "atp")) { return -EAGAIN; } @@ -333,7 +333,7 @@ static int net_open(struct device *dev) } /* This routine resets the hardware. We initialize everything, assuming that - the hardware may have been temporarily detacted. */ + the hardware may have been temporarily detached. */ static void hardware_init(struct device *dev) { struct net_local *lp = (struct net_local *)dev->priv; @@ -459,7 +459,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev) lp->pac_cnt_in_tx_buf++; if (lp->tx_unit_busy == 0) { trigger_send(ioaddr, length); - lp->saved_tx_size = 0; /* Redundent */ + lp->saved_tx_size = 0; /* Redundant */ lp->re_tx = 0; lp->tx_unit_busy = 1; } else diff --git a/drivers/net/atp.h b/drivers/net/atp.h index 6988eae9dc9c..e58f8c100c2f 100644 --- a/drivers/net/atp.h +++ b/drivers/net/atp.h @@ -89,7 +89,7 @@ extern inline unsigned char inbyte(unsigned short port) } /* Read register OFFSET. - This command should aways be terminated with read_end(). */ + This command should always be terminated with read_end(). */ extern inline unsigned char read_nibble(short port, unsigned char offset) { unsigned char retval; diff --git a/drivers/net/auto_irq.c b/drivers/net/auto_irq.c index ba5918734279..1efa2d069223 100644 --- a/drivers/net/auto_irq.c +++ b/drivers/net/auto_irq.c @@ -55,7 +55,6 @@ static void autoirq_probe(int irq) set_bit(irq, (void *)&irq_bitmap); /* irq_bitmap |= 1 << irq; */ return; } -struct sigaction autoirq_sigaction = { autoirq_probe, 0, SA_INTERRUPT, NULL}; int autoirq_setup(int waittime) { @@ -64,7 +63,7 @@ int autoirq_setup(int waittime) irq_handled = 0; for (i = 0; i < 16; i++) { - if (!irqaction(i, &autoirq_sigaction)) + if (!request_irq(i, autoirq_probe, SA_INTERRUPT, "irq probe")) set_bit(i, (void *)&irq_handled); /* irq_handled |= 1 << i;*/ } /* Update our USED lists. */ diff --git a/drivers/net/de600.c b/drivers/net/de600.c index f03b711bd2a5..b34af4a4a38b 100644 --- a/drivers/net/de600.c +++ b/drivers/net/de600.c @@ -194,9 +194,9 @@ typedef unsigned char byte; /* * command register, accessed through DATA_PORT with low bits = COMMAND */ -#define RX_ALL 0x01 /* PROMISCIOUS */ -#define RX_BP 0x02 /* default: BROADCAST & PHYSICAL ADRESS */ -#define RX_MBP 0x03 /* MULTICAST, BROADCAST & PHYSICAL ADRESS */ +#define RX_ALL 0x01 /* PROMISCUOUS */ +#define RX_BP 0x02 /* default: BROADCAST & PHYSICAL ADDRESS */ +#define RX_MBP 0x03 /* MULTICAST, BROADCAST & PHYSICAL ADDRESS */ #define TX_ENABLE 0x04 /* bit 2 */ #define RX_ENABLE 0x08 /* bit 3 */ @@ -340,7 +340,7 @@ de600_read_byte(unsigned char type, struct device *dev) { /* dev used by macros static int de600_open(struct device *dev) { - if (request_irq(DE600_IRQ, de600_interrupt)) { + if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600")) { printk ("%s: unable to get IRQ %d\n", dev->name, DE600_IRQ); return 1; } @@ -795,7 +795,7 @@ adapter_init(struct device *dev) * Note that the returned window info will never be smaller than * DE600_MIN_WINDOW, i.e. 1024 * This differs from the standard function, that can return an - * arbitraily small window! + * arbitrarily small window! */ #define min(a,b) ((a)<(b)?(a):(b)) static unsigned long diff --git a/drivers/net/de620.c b/drivers/net/de620.c index 15cac65846a5..9f1d2b8cd7d6 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c @@ -401,7 +401,7 @@ de620_get_register(byte reg) static int de620_open(struct device *dev) { - if (request_irq(DE620_IRQ, de620_interrupt)) { + if (request_irq(DE620_IRQ, de620_interrupt, 0, "de620")) { printk ("%s: unable to get IRQ %d\n", dev->name, DE620_IRQ); return 1; } @@ -917,7 +917,7 @@ read_eeprom(void) { unsigned short wrd; - /* D-Link Ethernet adresses are in the series 00:80:c8:7X:XX:XX:XX */ + /* D-Link Ethernet addresses are in the series 00:80:c8:7X:XX:XX:XX */ wrd = ReadAWord(0x1aa); /* bytes 0 + 1 of NodeID */ if (wrd != htons(0x0080)) /* Valid D-Link ether sequence? */ return -1; /* Nope, not a DE-620 */ diff --git a/drivers/net/de620.h b/drivers/net/de620.h index 22cf5f4db194..e8d9a88f4cb5 100644 --- a/drivers/net/de620.h +++ b/drivers/net/de620.h @@ -28,7 +28,7 @@ /* DE-620 DIC Command */ #define W_DUMMY 0x00 /* DIC reserved command */ #define W_CR 0x20 /* DIC write command register */ -#define W_NPR 0x40 /* DIC write Nect Page Register */ +#define W_NPR 0x40 /* DIC write Next Page Register */ #define W_TBR 0x60 /* DIC write Tx Byte Count 1 reg */ #define W_RSA 0x80 /* DIC write Remote Start Addr 1 */ @@ -50,12 +50,12 @@ #define W_SCR 0xa7 /* write system configuration register */ #define W_TCR 0xa8 /* write Transceiver Configuration reg */ #define W_EIP 0xa9 /* write EEPM Interface port */ -#define W_PAR0 0xaa /* write physical address registr 0 */ -#define W_PAR1 0xab /* write physical address registr 1 */ -#define W_PAR2 0xac /* write physical address registr 2 */ -#define W_PAR3 0xad /* write physical address registr 3 */ -#define W_PAR4 0xae /* write physical address registr 4 */ -#define W_PAR5 0xaf /* write physical address registr 5 */ +#define W_PAR0 0xaa /* write physical address register 0 */ +#define W_PAR1 0xab /* write physical address register 1 */ +#define W_PAR2 0xac /* write physical address register 2 */ +#define W_PAR3 0xad /* write physical address register 3 */ +#define W_PAR4 0xae /* write physical address register 4 */ +#define W_PAR5 0xaf /* write physical address register 5 */ /* IDC 2 Command */ #define R_STS 0xc0 /* read status register */ @@ -102,7 +102,7 @@ #define AUTOFFSET 0x02 /* auto shift address to TPR+12 */ #define AUTOTX 0x01 /* auto tx when leave RW mode */ -/* Tranceiver Configuration Register */ +/* Transceiver Configuration Register */ #define JABBER 0x80 /* generate jabber condition */ #define TXSUCINT 0x40 /* enable tx success interrupt */ #define T16INT 0x20 /* enable T16 interrupt */ diff --git a/drivers/net/depca.c b/drivers/net/depca.c index f19c69cf3b58..917a22afdca0 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c @@ -394,7 +394,7 @@ depca_probe1(struct device *dev, short ioaddr) struct depca_private *lp; int i,j, status=0; unsigned long mem_start, mem_base[] = DEPCA_RAM_BASE_ADDRESSES; - char *name=(char *)NULL; + char *name = NULL; unsigned int nicsr, offset, netRAM; @@ -420,7 +420,7 @@ depca_probe1(struct device *dev, short ioaddr) if (((mem_chkd >> i) & 0x01) == 0) { /* has the memory been checked? */ name = DepcaSignature(mem_base[i]);/* check for a DEPCA here */ mem_chkd |= (0x01 << i); /* mark location checked */ - if (*name != (char)NULL) { /* one found? */ + if (*name != '\0') { /* one found? */ j = 1; /* set exit flag */ } else { i++; /* increment search index */ @@ -428,7 +428,7 @@ depca_probe1(struct device *dev, short ioaddr) } } - if (*name != (char)NULL) { /* found a DEPCA device */ + if (*name != '\0') { /* found a DEPCA device */ mem_start = mem_base[i]; dev->base_addr = ioaddr; @@ -448,7 +448,7 @@ depca_probe1(struct device *dev, short ioaddr) read the ROM info. */ - if (strstr(name,"DE100")!=(char *)NULL) { + if (strstr(name,"DE100") != NULL) { j = 1; } else { j = 0; @@ -471,7 +471,7 @@ depca_probe1(struct device *dev, short ioaddr) /* ** Set up the maximum amount of network RAM(kB) */ - if (strstr(name,"DEPCA")==(char *)NULL) { + if (strstr(name,"DEPCA") == NULL) { netRAM=64; } else { netRAM=48; @@ -500,7 +500,7 @@ depca_probe1(struct device *dev, short ioaddr) /* ** Enable the shadow RAM. */ - if (strstr(name,"DEPCA")==(char *)NULL) { + if (strstr(name,"DEPCA") == NULL) { nicsr |= SHE; outb(nicsr, DEPCA_NICSR); } @@ -662,7 +662,7 @@ depca_open(struct device *dev) struct depca_private *lp = (struct depca_private *)dev->priv; int i,nicsr,ioaddr = dev->base_addr; - if (request_irq(dev->irq, &depca_interrupt)) { + if (request_irq(dev->irq, &depca_interrupt, 0, "depca")) { printk("depca_open(): Requested IRQ%d is busy\n",dev->irq); return -EAGAIN; } @@ -1289,8 +1289,7 @@ static void SetMulticastFilter(int num_addrs, char *addrs, char *multicast_table /* ** ISA bus I/O device probe */ -static struct device *isa_probe(dev) -struct device *dev; +static struct device *isa_probe(struct device *dev) { int *port, ports[] = DEPCA_IO_PORTS; int status; @@ -1317,8 +1316,7 @@ struct device *dev; ** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually ** the motherboard. */ -static struct device *eisa_probe(dev) -struct device *dev; +static struct device *eisa_probe(struct device *dev) { int i, ioaddr = DEPCA_EISA_IO_PORTS; int status; @@ -1344,14 +1342,12 @@ struct device *dev; ** Allocate the device by pointing to the next available space in the ** device structure. Should one not be available, it is created. */ -static struct device *alloc_device(dev, ioaddr) -struct device *dev; -int ioaddr; +static struct device *alloc_device(struct device *dev, int ioaddr) { /* ** Check the device structures for an end of list or unused device */ - while (dev->next != (struct device *)NULL) { + while (dev->next != NULL) { if (dev->next->base_addr == 0xffe0) break; dev = dev->next; /* walk through eth device list */ num_eth++; /* increment eth device number */ @@ -1361,10 +1357,10 @@ int ioaddr; ** If no more device structures, malloc one up. If memory could ** not be allocated, print an error message. */ - if (dev->next == (struct device *)NULL) { + if (dev->next == NULL) { dev->next = (struct device *)kmalloc(sizeof(struct device) + 8, GFP_KERNEL); - if (dev->next == (struct device *)NULL) { + if (dev->next == NULL) { printk("eth%d: Device not initialised, insufficient memory\n", num_eth); } @@ -1375,14 +1371,14 @@ int ioaddr; ** and initialize it (name, I/O address, next device (NULL) and ** initialisation probe routine). */ - if ((dev->next != (struct device *)NULL) && + if ((dev->next != NULL) && (num_eth > 0) && (num_eth < 9999)) { - dev = dev->next; /* point to the new device */ - dev->name = (char *)(dev + sizeof(struct device)); + dev = dev->next; /* point to the new device */ + dev->name = (char *)(dev + 1); sprintf(dev->name,"eth%d", num_eth);/* New device name */ - dev->base_addr = ioaddr; /* assign the io address */ - dev->next = (struct device *)NULL; /* mark the end of list */ - dev->init = &depca_probe; /* initialisation routine */ + dev->base_addr = ioaddr; /* assign the io address */ + dev->next = NULL; /* mark the end of list */ + dev->init = &depca_probe; /* initialisation routine */ num_depcas++; } @@ -1405,10 +1401,10 @@ static char *DepcaSignature(unsigned long mem_addr) for (i=0;i<16;i++) { /* copy the first 16 bytes of ROM to */ tmpstr[i] = *(unsigned char *)(mem_addr+0xc000+i); /* a temporary string */ } - tmpstr[i]=(char)NULL; + tmpstr[i] = '\0'; strcpy(thisName,""); - for (i=0;*signatures[i]!=(char)NULL && *thisName==(char)NULL;i++) { + for (i = 0 ; *signatures[i] != '\0' && *thisName == '\0' ; i++) { for (j=0,k=0;j<16 && k=0) { devSig[i]<<=4; if((devSig[i+1]=asc2hex(devSig[i+1]))>=0){ diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index fc143a794fe3..42df4d1ed284 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c @@ -18,7 +18,7 @@ registers are set: first you do an inb() in what is normally the station address region, and the low three bits of next outb() *address* is used as the write value for that register. Either someone wasn't - too used to dem bit en bites, or they were trying to obfusicate the + too used to dem bit en bites, or they were trying to obfuscate the programming interface. There is an additional complication when setting the window on the packet @@ -50,7 +50,7 @@ static int e21_probe_list[] = {0x300, 0x280, 0x380, 0x220, 0}; /* Offsets from the base_addr. Read from the ASIC register, and the low three bits of the next outb() - address is used to set the cooresponding register. */ + address is used to set the corresponding register. */ #define E21_NIC_OFFSET 0 /* Offset to the 8390 NIC. */ #define E21_ASIC 0x10 #define E21_MEM_ENABLE 0x10 @@ -164,7 +164,7 @@ int e21_probe1(struct device *dev, int ioaddr) if (dev->irq < 2) { int irqlist[] = {15,11,10,12,5,9,3,4}, i; for (i = 0; i < 8; i++) - if (request_irq (irqlist[i], NULL) != -EBUSY) { + if (request_irq (irqlist[i], NULL, 0, "bogus") != -EBUSY) { dev->irq = irqlist[i]; break; } @@ -235,7 +235,7 @@ e21_open(struct device *dev) { short ioaddr = dev->base_addr; - if (irqaction (dev->irq, &ei_sigaction)) { + if (request_irq(dev->irq, ei_interrupt, 0, "e2100")) { return EBUSY; } irq2dev_map[dev->irq] = dev; @@ -299,7 +299,7 @@ e21_block_output(struct device *dev, int count, const unsigned char *buf, volatile char *shared_mem = (char *)dev->mem_start; /* Set the shared memory window start by doing a read, with the low address - bits specifing the starting page. */ + bits specifying the starting page. */ *(shared_mem + start_page); mem_on(ioaddr, shared_mem, start_page); diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index ca9f664d5e08..dde116f113c1 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c @@ -5,7 +5,7 @@ Copyright 1993 United States Government as represented by the Director, National Security Agency. This software may only be used and distributed according to the terms of the GNU Public License as modified by SRC, - incorported herein by reference. + incorporated herein by reference. The author may be reached as becker@super.org or C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 @@ -28,7 +28,7 @@ static char *version = Sources: This driver wouldn't have been written with the availability of the Crynwr driver source code. It provided a known-working implementation - that filled in the gaping holes of the Intel documention. Three cheers + that filled in the gaping holes of the Intel documentation. Three cheers for Russ Nelson. Intel Microcommunications Databook, Vol. 1, 1990. It provides just enough @@ -66,7 +66,7 @@ static unsigned int net_debug = NET_DEBUG; Details of the i82586. You'll really need the databook to understand the details of this part, - but the outline is that the i82586 has two seperate processing units. + but the outline is that the i82586 has two separate processing units. The Rx unit uses a list of frame descriptors and a list of data buffer descriptors. We use full-sized (1518 byte) data buffers, so there is @@ -298,7 +298,7 @@ static void init_rx_bufs(struct device *dev); /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. If dev->base_addr == 1, always return failure. - If dev->base_addr == 2, (detachable devices only) alloate space for the + If dev->base_addr == 2, (detachable devices only) allocate space for the device and return success. */ int @@ -348,7 +348,7 @@ int eexp_probe1(struct device *dev, short ioaddr) station_addr[1] = read_eeprom(ioaddr, 3); station_addr[2] = read_eeprom(ioaddr, 4); - /* Check the first three octets of the S.A. for the manufactor's code. */ + /* Check the first three octets of the S.A. for the manufacturer's code. */ if (station_addr[2] != 0x00aa || (station_addr[1] & 0xff00) != 0x0000) { printk(" rejected (invalid address %04x%04x%04x).\n", station_addr[2], station_addr[1], station_addr[0]); @@ -422,7 +422,7 @@ eexp_open(struct device *dev) if (irq2dev_map[dev->irq] != 0 /* This is always true, but avoid the false IRQ. */ || (irq2dev_map[dev->irq] = dev) == 0 - || request_irq(dev->irq, &eexp_interrupt)) { + || request_irq(dev->irq, &eexp_interrupt, 0, "EExpress")) { return -EAGAIN; } diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index d60b6b1b122d..d1c0077d0d71 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c @@ -42,7 +42,7 @@ static char *version = /* The HP EtherTwist chip implementation is a fairly routine DP8390 implementation. It allows both shared memory and programmed-I/O buffer - access, using a custom interface for both. The programed-I/O mode is + access, using a custom interface for both. The programmed-I/O mode is entirely implemented in the HP EtherTwist chip, bypassing the problem ridden built-in 8390 facilities used on NE2000 designs. The shared memory mode is likewise special, with an offset register used to make @@ -235,7 +235,7 @@ hpp_open(struct device *dev) int ioaddr = dev->base_addr - NIC_OFFSET; int option_reg; - if (request_irq(dev->irq, &ei_interrupt)) { + if (request_irq(dev->irq, &ei_interrupt, 0, "hp-plus")) { return -EAGAIN; } diff --git a/drivers/net/hp.c b/drivers/net/hp.c index 1aee030f270f..315a4f1c31c9 100644 --- a/drivers/net/hp.c +++ b/drivers/net/hp.c @@ -124,13 +124,13 @@ int hpprobe1(struct device *dev, int ioaddr) int *irqp = wordmode ? irq_16list : irq_8list; do { int irq = *irqp; - if (request_irq (irq, NULL) != -EBUSY) { + if (request_irq (irq, NULL, 0, "bogus") != -EBUSY) { autoirq_setup(0); /* Twinkle the interrupt, and check if it's seen. */ outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE); outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE); if (irq == autoirq_report(0) /* It's a good IRQ line! */ - && request_irq (irq, &ei_interrupt) == 0) { + && request_irq (irq, &ei_interrupt, 0, "hp") == 0) { printk(" selecting IRQ %d.\n", irq); dev->irq = *irqp; break; @@ -144,7 +144,7 @@ int hpprobe1(struct device *dev, int ioaddr) } else { if (dev->irq == 2) dev->irq = 9; - if (irqaction(dev->irq, &ei_sigaction)) { + if (request_irq(dev->irq, ei_interrupt, 0, "hp")) { printk (" unable to get IRQ %d.\n", dev->irq); return EBUSY; } diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 798dcc703a7d..4c036c233d39 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c @@ -106,7 +106,7 @@ the buffers are only used when needed as low-memory bounce buffers. IIIB. 16M memory limitations. For the ISA bus master mode all structures used directly by the LANCE, the initialization block, Rx and Tx rings, and data buffers, must be -accessable from the ISA bus, i.e. in the lower 16M of real memory. +accessible from the ISA bus, i.e. in the lower 16M of real memory. This is a problem for current Linux kernels on >16M machines. The network devices are initialized after memory initialization, and the kernel doles out memory from the top of memory downward. The current solution is to have a @@ -367,7 +367,7 @@ lance_open(struct device *dev) int ioaddr = dev->base_addr; int i; - if (request_irq(dev->irq, &lance_interrupt)) { + if (request_irq(dev->irq, &lance_interrupt, 0, "lance")) { return -EAGAIN; } diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 442b7815ebe1..c86d82ebc2a5 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c @@ -57,7 +57,7 @@ static void ne_block_output(struct device *dev, const int count, SA prefix. Reading the SAPROM from a word-wide card with the 8390 set in byte-wide - mode results in doubled values, which can be detected and compansated for. + mode results in doubled values, which can be detected and compensated for. The probe is also responsible for initializing the card and filling in the 'dev' and 'ei_status' structures. @@ -218,7 +218,7 @@ static int neprobe1(int ioaddr, struct device *dev, int verbose) /* Snarf the interrupt now. There's no point in waiting since we cannot share and the board will usually be enabled. */ { - int irqval = irqaction (dev->irq, &ei_sigaction); + int irqval = request_irq (dev->irq, ei_interrupt, 0, "ne"); if (irqval) { printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); return 0; @@ -311,7 +311,7 @@ ne_block_input(struct device *dev, int count, char *buf, int ring_offset) /* This was for the ALPHA version only, but enough people have encountering problems that it is still here. If you see - this message you either 1) have an slightly imcompatible clone + this message you either 1) have a slightly incompatible clone or 2) have noise/speed problems with your bus. */ if (ei_debug > 1) { /* DMA termination address check... */ int addr, tries = 20; @@ -360,7 +360,7 @@ ne_block_output(struct device *dev, int count, #if defined(rw_bugfix) /* Handle the read-before-write bug the same way as the Crynwr packet driver -- the NatSemi method doesn't work. - Actually this doesn't aways work either, but if you have + Actually this doesn't always work either, but if you have problems with your NEx000 this is better than nothing! */ outb_p(0x42, nic_base + EN0_RCNTLO); outb_p(0x00, nic_base + EN0_RCNTHI); diff --git a/drivers/net/net_init.c b/drivers/net/net_init.c index c2237f4f4b99..72c7cbd2f6e9 100644 --- a/drivers/net/net_init.c +++ b/drivers/net/net_init.c @@ -4,7 +4,7 @@ Copyright 1993 United States Government as represented by the Director, National Security Agency. This software may only be used and distributed according to the terms of the GNU Public License as modified by SRC, - incorported herein by reference. + incorporated herein by reference. The author may be reached as becker@super.org or C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 0bea83c59ab0..7b3d10550a95 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -360,7 +360,7 @@ plip_open(struct device *dev) rcv->skb->len = dev->mtu; rcv->skb->dev = dev; cli(); - if (request_irq(dev->irq , plip_interrupt) != 0) { + if (request_irq(dev->irq , plip_interrupt, 0, "plip") != 0) { sti(); printk("%s: couldn't get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; @@ -433,7 +433,7 @@ plip_rebuild_header(void *buff, struct device *dev, unsigned long dst, int i; if (eth->h_proto != htons(ETH_P_IP)) { - printk("plip_rebuild_header: Don't know how to resolve type %d addreses?\n",(int)eth->h_proto); + printk("plip_rebuild_header: Don't know how to resolve type %d addresses?\n",(int)eth->h_proto); memcpy(eth->h_source, dev->dev_addr, dev->addr_len); return 0; } diff --git a/drivers/net/ppp.c b/drivers/net/ppp.c index a73e192c7441..0bfdd719c113 100644 --- a/drivers/net/ppp.c +++ b/drivers/net/ppp.c @@ -16,7 +16,7 @@ Flags for this module (any combination is acceptable for testing.): - NET02D - Define if using Net-2-Debugged in kernels earler + NET02D - Define if using Net-2-Debugged in kernels earlier than v1.1.4. NEW_TTY_DRIVERS - Define if using new Ted Ts'o's alpha TTY drivers @@ -88,7 +88,7 @@ int ppp_debug = 2; int ppp_debug_netpackets = 0; -/* Define this string only once for all macro envocations */ +/* Define this string only once for all macro invocations */ static char ppp_warning[] = KERN_WARNING "PPP: ALERT! not INUSE! %d\n"; int ppp_init(struct device *); @@ -1218,7 +1218,7 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned int len, i; if (!ppp || ppp->magic != PPP_MAGIC) { - PRINTKN (1,(KERN_ERR "ppp_read: cannnot find ppp channel\n")); + PRINTKN (1,(KERN_ERR "ppp_read: cannot find ppp channel\n")); return -EIO; } diff --git a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c index e63c48602b81..550b2c0a8b1f 100644 --- a/drivers/net/sk_g16.c +++ b/drivers/net/sk_g16.c @@ -171,7 +171,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; */ /* - * Scheider & Koch manufactorer code (00:00:a5). + * Scheider & Koch manufacturer code (00:00:a5). * This must be checked, that we are sure it is a SK card. */ @@ -227,7 +227,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; /* * Register transfer: 0 = no transfer - * 1 = transfering data between LANCE and I/O reg + * 1 = transferring data between LANCE and I/O reg */ #define SK_IORUN 0x20 @@ -260,7 +260,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; #define SK_DOIO 0x80 /* Do Transfer */ /* - * LANCE RAP (Register Adress Port). + * LANCE RAP (Register Address Port). * --------------------------------- */ @@ -271,7 +271,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; * CSR0 - Status and Control flags * CSR1 - Low order bits of initialize block (bits 15:00) * CSR2 - High order bits of initialize block (bits 07:00, 15:08 are reserved) - * CSR3 - Allows redifinition of the Bus Master Interface. + * CSR3 - Allows redefinition of the Bus Master Interface. * This register must be set to 0x0002, which means BSWAP = 0, * ACON = 1, BCON = 0; * @@ -356,7 +356,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; * Normal way of live is: * * For the whole thing get going let both symbolic constants - * undefined. If you face any problems and you know whats going + * undefined. If you face any problems and you know what's going * on (you know something about the card and you can interpret some * hex LANCE register output) then define SK_DEBUG * @@ -388,7 +388,7 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $"; * * dual ported RAM: This is the only memory region which the LANCE chip * has access to. From the Lance it is addressed from 0x0000 to - * 0x3fbf. The host accesses it normaly. + * 0x3fbf. The host accesses it normally. * * PROM: The PROM obtains the ETHERNET-MAC-Address. It is realised as a * 8-Bit PROM, this means only the 16 even addresses are used of the @@ -514,8 +514,8 @@ int SK_rread_reg(void); void SK_write_reg(int reg_number, int value); /* - * Debuging functions - * ------------------ + * Debugging functions + * ------------------- */ void SK_print_pos(struct device *dev, char *text); @@ -546,7 +546,7 @@ void SK_print_ram(struct device *dev); * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. - * If dev->base_addr == 2, alloate space for the device and return success + * If dev->base_addr == 2, allocate space for the device and return success * (detachable devices only). */ @@ -624,7 +624,7 @@ int SK_init(struct device *dev) * * Parameters : I : struct device *dev - SK_G16 device structure * I : short ioaddr - I/O Port address where POS is. - * Return Value : 0 = Initilization done + * Return Value : 0 = Initialization done * Errors : ENODEV - No SK_G16 found * -1 - Configuration problem * Globals : irq2dev_map - Which device uses which IRQ @@ -761,7 +761,7 @@ int SK_probe(struct device *dev, short ioaddr) dev->dev_addr[i] = board->rom[j]; } - /* Check for manufactorer code */ + /* Check for manufacturer code */ if (!(dev->dev_addr[0] == SK_MAC0 && dev->dev_addr[1] == SK_MAC1 && dev->dev_addr[2] == SK_MAC2) ) @@ -782,7 +782,7 @@ int SK_probe(struct device *dev, short ioaddr) dev->dev_addr[4], dev->dev_addr[5]); - /* Grap the I/O Port region */ + /* Grab the I/O Port region */ snarf_region(ioaddr, ETHERCARD_TOTAL_SIZE); /* Initialize device structure */ @@ -841,11 +841,11 @@ int SK_probe(struct device *dev, short ioaddr) * Date Created : 94/05/26 * * Description : This function is called sometimes after booting - * when ifconfig programm is run. + * when ifconfig program is run. * * This function requests an IRQ, sets the correct * IRQ in the card. Then calls SK_lance_init() to - * init and start the LANCE chip. Then if everthing is + * init and start the LANCE chip. Then if everything is * ok returns with 0 (OK), which means SK_G16 is now * opened and operational. * @@ -888,7 +888,7 @@ static int SK_open(struct device *dev) do { - irqval = request_irq(irqtab[i], &SK_interrupt); + irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16"); i++; } while (irqval && irqtab[i]); @@ -905,7 +905,7 @@ static int SK_open(struct device *dev) } else if (dev->irq == 2) /* IRQ2 is always IRQ9 */ { - if (request_irq(9, &SK_interrupt)) + if (request_irq(9, &SK_interrupt, 0, "sk_g16")) { printk("%s: unable to get IRQ 9\n", dev->name); return -EAGAIN; @@ -926,7 +926,7 @@ static int SK_open(struct device *dev) /* check if IRQ free and valid. Then install Interrupt handler */ - if (request_irq(dev->irq, &SK_interrupt)) + if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16")) { printk("%s: unable to get selected IRQ\n", dev->name); return -EAGAIN; @@ -1071,7 +1071,7 @@ static int SK_lance_init(struct device *dev, unsigned short mode) rmdp->u.s.status = RX_OWN; - rmdp->blen = -PKT_BUF_SZ; /* Buffer Size in a two's comliment */ + rmdp->blen = -PKT_BUF_SZ; /* Buffer Size in a two's complement */ rmdp->mlen = 0; /* init message length */ @@ -1086,7 +1086,7 @@ static int SK_lance_init(struct device *dev, unsigned short mode) (p->ram)->ib.paddr[i] = dev->dev_addr[i]; } - for (i = 0; i < 8; i++) /* Set multicast, logical adress */ + for (i = 0; i < 8; i++) /* Set multicast, logical address */ { (p->ram)->ib.laddr[i] = 0; /* We do not use logical addressing */ } @@ -1096,7 +1096,7 @@ static int SK_lance_init(struct device *dev, unsigned short mode) (p->ram)->ib.rdrp = (int) p->rmdhead | RMDNUMMASK; (p->ram)->ib.tdrp = (int) p->tmdhead | TMDNUMMASK; - /* Prepare LANCE Controll and Status Registers */ + /* Prepare LANCE Control and Status Registers */ cli(); @@ -1107,7 +1107,7 @@ static int SK_lance_init(struct device *dev, unsigned short mode) * PC Memory locations. * * In structure SK_ram is defined that the first thing in ram - * is the initalization block. So his address is for LANCE always + * is the initialization block. So his address is for LANCE always * 0x0000 * * CSR1 contains low order bits 15:0 of initialization block address @@ -1127,7 +1127,7 @@ static int SK_lance_init(struct device *dev, unsigned short mode) /* Initialize LANCE */ /* - * INIT = Initialize, when set, cuases the LANCE to begin the + * INIT = Initialize, when set, causes the LANCE to begin the * initialization procedure and access the Init Block. */ @@ -1429,7 +1429,7 @@ static void SK_txintr(struct device *dev) p->stats.tx_fifo_errors++; /* - * If UFLO error occurs it will turn tranmitter of. + * If UFLO error occurs it will turn transmitter of. * So we must reinit LANCE */ @@ -1582,7 +1582,7 @@ static void SK_rxintr(struct device *dev) * to Lance, update statistics and go ahead. */ - rmdp->u.s.status = RX_OWN; /* Reliquish ownershipt to LANCE */ + rmdp->u.s.status = RX_OWN; /* Relinquish ownership to LANCE */ printk("%s: Couldn't allocate sk_buff, deferring packet.\n", dev->name); p->stats.rx_dropped++; @@ -1662,7 +1662,7 @@ static int SK_close(struct device *dev) dev->tbusy = 1; /* Transmitter busy */ dev->start = 0; /* Card down */ - printk("%s: Shuting %s down CSR0 %#06x\n", dev->name, SK_NAME, + printk("%s: Shutting %s down CSR0 %#06x\n", dev->name, SK_NAME, (int) SK_read_reg(CSR0)); SK_write_reg(CSR0, CSR0_STOP); /* STOP the LANCE */ @@ -1670,7 +1670,7 @@ static int SK_close(struct device *dev) free_irq(dev->irq); /* Free IRQ */ irq2dev_map[dev->irq] = 0; /* Mark IRQ as unused */ - return 0; /* always succed */ + return 0; /* always succeed */ } /* End of SK_close() */ @@ -1710,14 +1710,14 @@ static struct enet_statistics *SK_get_stats(struct device *dev) * Author : Patrick J.D. Weichmann * Date Created : 94/05/26 * - * Description : This function gets called when a programm performs + * Description : This function gets called when a program performs * a SIOCSIFFLAGS call. Ifconfig does this if you call - * 'ifconfig [-]allmultie' which enables or disables the - * Promiscous mode. - * Promiscous mode is when the Network card accepts all + * 'ifconfig [-]allmulti' which enables or disables the + * Promiscuous mode. + * Promiscuous mode is when the Network card accepts all * packets, not only the packets which match our MAC * Address. It is useful for writing a network monitor, - * but it is also a security problem. You have to remeber + * but it is also a security problem. You have to remember * that all information on the net is not encrypted. * * Parameters : I : struct device *dev - SK_G16 device Structure @@ -1733,7 +1733,7 @@ static struct enet_statistics *SK_get_stats(struct device *dev) /* Set or clear the multicast filter for SK_G16. * - * num_addrs == -1 Promiscous mode, receive all packets + * num_addrs == -1 Promiscuous mode, receive all packets * num_addrs == 0 Normal mode, clear multicast list * num_addrs > 0 Multicast mode, receive normal and MC packets */ @@ -1853,7 +1853,7 @@ void SK_reset_board(void) { int i; - SK_PORT = 0x00; /* Reset aktiv */ + SK_PORT = 0x00; /* Reset active */ for (i = 0; i < 10 ; i++) /* Delay min 5ms */ ; SK_PORT = SK_RESET; /* Set back to normal operation */ @@ -1867,7 +1867,7 @@ void SK_reset_board(void) * Date Created : 94/05/25 * * Description : Set LANCE Register Address Port to register - * for later data trasfer. + * for later data transfer. * * Parameters : I : reg_number - which CSR to read/write from/to * Return Value : None @@ -2067,7 +2067,7 @@ void SK_print_dev(struct device *dev, char *text) * * Description : This function is used to check how are things set up * in the 16KB RAM. Also the pointers to the receive and - * transmit descriptor rings and rx und tx buffers locations. + * transmit descriptor rings and rx and tx buffers locations. * It contains a minor bug in printing, but has no effect to the values * only newlines are not correct. * diff --git a/drivers/net/sk_g16.h b/drivers/net/sk_g16.h index 96b70f987d36..d71ecb290f7e 100644 --- a/drivers/net/sk_g16.h +++ b/drivers/net/sk_g16.h @@ -35,7 +35,7 @@ #define CSR0_CERR 0x2000 /* Collision Error (RC) */ #define CSR0_MISS 0x1000 /* Missed packet (RC) */ #define CSR0_MERR 0x0800 /* Memory Error (RC) */ -#define CSR0_RINT 0x0400 /* Reciever Interrupt (RC) */ +#define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */ #define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */ #define CSR0_IDON 0x0100 /* Initialization Done (RC) */ #define CSR0_INTR 0x0080 /* Interrupt Flag (R) */ @@ -69,7 +69,7 @@ #define MODE_DTCR 0x0008 /* Disable Transmit CRC) */ #define MODE_LOOP 0x0004 /* Loopback */ #define MODE_DTX 0x0002 /* Disable the Transmitter */ -#define MODE_DRX 0x0001 /* Disable the Reciever */ +#define MODE_DRX 0x0001 /* Disable the Receiver */ #define MODE_NORMAL 0x0000 /* Normal operation mode */ diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index 45dd2f00f3ca..fd3ae9d1a203 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -116,7 +116,7 @@ extern void chipset_init(struct device *dev, int startp); /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. If dev->base_addr == 1, always return failure. - If dev->base_addr == 2, alloate space for the device and return success + If dev->base_addr == 2, allocate space for the device and return success (detachable devices only). */ int @@ -154,7 +154,7 @@ int netcard_probe1(struct device *dev, short ioaddr) for (i = 0; i < 6; i++) { station_addr[i] = inb(ioaddr + i); } - /* Check the first three octets of the S.A. for the manufactor's code. */ + /* Check the first three octets of the S.A. for the manufacturer's code. */ if (station_addr[0] != SA_ADDR0 || station_addr[1] != SA_ADDR1 || station_addr[2] != SA_ADDR2) { return ENODEV; @@ -166,7 +166,7 @@ int netcard_probe1(struct device *dev, short ioaddr) #ifdef jumpered_interrupts /* If this board has jumpered interrupts, snarf the interrupt vector now. There is no point in waiting since no other device can use - the interrupt, and this marks the 'irqaction' as busy. */ + the interrupt, and this marks the irq as busy. */ if (dev->irq == -1) ; /* Do nothing: a user-level program will set it. */ @@ -182,7 +182,7 @@ int netcard_probe1(struct device *dev, short ioaddr) or don't know which one to set. */ dev->irq = 9; - { int irqval = request_irq(dev->irq, &net_interrupt); + { int irqval = request_irq(dev->irq, &net_interrupt, 0, "skeleton"); if (irqval) { printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval); @@ -230,7 +230,7 @@ net_open(struct device *dev) /* This is used if the interrupt line can turned off (shared). See 3c503.c for an example of selecting the IRQ at config-time. */ - if (request_irq(dev->irq, &net_interrupt)) { + if (request_irq(dev->irq, &net_interrupt, 0, "skeleton")) { return -EAGAIN; } diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 373502828cba..9063a97dfef9 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -15,7 +15,7 @@ * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. diff --git a/drivers/net/slhc.h b/drivers/net/slhc.h index 0044b0283175..387b848d84eb 100644 --- a/drivers/net/slhc.h +++ b/drivers/net/slhc.h @@ -18,7 +18,7 @@ * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. @@ -52,7 +52,7 @@ * * There are 5 numbers which can change (they are always inserted * in the following order): TCP urgent pointer, window, - * acknowlegement, sequence number and IP ID. (The urgent pointer + * acknowledgment, sequence number and IP ID. (The urgent pointer * is different from the others in that its value is sent, not the * change in value.) Since typical use of SLIP links is biased * toward small packets (see comments on MTU/MSS below), changes diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index 8b2b7a79e75e..3296f4a5fe78 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c @@ -178,7 +178,7 @@ ultra_open(struct device *dev) { int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */ - if (irqaction(dev->irq, &ei_sigaction)) + if (request_irq(dev->irq, ei_interrupt, 0, "SMC Ultra")) return -EAGAIN; outb(ULTRA_MEMENB, ioaddr); /* Enable memory, 16 bit mode. */ diff --git a/drivers/net/wd.c b/drivers/net/wd.c index 0faff32597fb..6a11be410697 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c @@ -216,7 +216,7 @@ int wdprobe1(int ioaddr, struct device *dev) /* Snarf the interrupt now. There's no point in waiting since we cannot share and the board will usually be enabled. */ - if (irqaction (dev->irq, &ei_sigaction)) { + if (request_irq(dev->irq, ei_interrupt, 0, "wd")) { printk (" unable to get IRQ %d.\n", dev->irq); return 0; } diff --git a/drivers/net/znet.c b/drivers/net/znet.c index ca79a94204c4..95317e1b0b5f 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c @@ -28,8 +28,8 @@ static char *version = "znet.c:v1.01 7/1/94 becker@cesdis.gsfc.nasa.gov\n"; DMA channels, one interrupt, and one 8-bit I/O port. While there several ways to configure '593 DMA system, I chose the one - that seemed commesurate with the highest system performance in the face - of moderate interrupt latency: Both DMA channels are configued as + that seemed commensurate with the highest system performance in the face + of moderate interrupt latency: Both DMA channels are configured as recirculating ring buffers, with one channel (#0) dedicated to Rx and the other channel (#1) to Tx and configuration. (Note that this is different than the Crynwr driver, where the Tx DMA channel is initialized @@ -126,7 +126,7 @@ struct znet_private { /* The starting, current, and end pointers for the packet buffers. */ ushort *rx_start, *rx_cur, *rx_end; ushort *tx_start, *tx_cur, *tx_end; - ushort tx_buf_len; /* Tx buffer lenght, in words. */ + ushort tx_buf_len; /* Tx buffer length, in words. */ }; /* Only one can be built-in;-> */ @@ -136,14 +136,14 @@ static ushort dma_buffer2[DMA_BUF_SIZE/2]; static ushort dma_buffer3[DMA_BUF_SIZE/2 + 8]; /* The configuration block. What an undocumented nightmare. The first - set of values are those suggested (without explaination) for ethernet + set of values are those suggested (without explanation) for ethernet in the Intel 82586 databook. The rest appear to be completely undocumented, except for cryptic notes in the Crynwr packet driver. This driver uses the Crynwr values verbatim. */ static unsigned char i593_init[] = { 0xAA, /* 0: 16-byte input & 80-byte output FIFO. */ - /* threshhold, 96-byte FIFO, 82593 mode. */ + /* threshold, 96-byte FIFO, 82593 mode. */ 0x88, /* 1: Continuous w/interrupts, 128-clock DMA.*/ 0x2E, /* 2: 8-byte preamble, NO address insertion, */ /* 6-byte Ethernet address, loopback off.*/ @@ -247,7 +247,7 @@ int znet_probe(struct device *dev) zn.tx_dma = netinfo->dma2; /* These should never fail. You can't add devices to a sealed box! */ - if (request_irq(dev->irq, &znet_interrupt) + if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet") || request_dma(zn.rx_dma) || request_dma(zn.tx_dma)) { printk(KERN_WARNING "%s: Not opened -- resource busy?!?\n", dev->name); diff --git a/drivers/scsi/53c7,8xx.c b/drivers/scsi/53c7,8xx.c index dece0faef7ab..03aba1d9fc18 100644 --- a/drivers/scsi/53c7,8xx.c +++ b/drivers/scsi/53c7,8xx.c @@ -70,7 +70,7 @@ /* * Design issues : - * The cumulative latency needed to propogate a read/write request + * The cumulative latency needed to propagate a read/write request * through the filesystem, buffer cache, driver stacks, SCSI host, and * SCSI device is ultimately the limiting factor in throughput once we * have a sufficiently fast host adapter. @@ -78,7 +78,7 @@ * So, to maximize performance we want to keep the ratio of latency to data * transfer time to a minimum by * 1. Minimizing the total number of commands sent (typical command latency - * including drive and busmatering host overhead is as high as 4.5ms) + * including drive and busmastering host overhead is as high as 4.5ms) * to transfer a given amount of data. * * This is accomplished by placing no arbitrary limit on the number @@ -107,7 +107,7 @@ * means that we must service an interrupt for each * disconnect/reconnect. * - * 3. Eliminating latency by piplining operations at the different levels. + * 3. Eliminating latency by pipelining operations at the different levels. * * This driver allows a configurable number of commands to be enqueued * for each target/lun combination (experimentally, I have discovered @@ -116,7 +116,7 @@ * * * Architecture : - * This driver is built arround two queues of commands waiting to + * This driver is built around two queues of commands waiting to * be executed - the Linux issue queue, and the shared Linux/NCR * queue which are manipulated by the NCR53c7xx_queue_command and * NCR53c7x0_intr routines. @@ -192,7 +192,7 @@ static void NCR53c8x0_soft_reset (struct Scsi_Host *host); static struct Scsi_Host *first_host = NULL; /* Head of list of NCR boards */ static Scsi_Host_Template *the_template = NULL; -/* Alocate storage space for constant messages, etc. */ +/* Allocate storage space for constant messages, etc. */ static long NCR53c7xx_zero = 0; static long NCR53c7xx_sink; @@ -231,14 +231,14 @@ static char scan_scsis_buf[512]; * programmed on selection, so we need to add more code. * * NCR53c700/700-66 - need to add code to refix addresses on - * every nexus change, elimate all table indirect code. + * every nexus change, eliminate all table indirect code. * * 3. The NCR53c7x0 series is very popular on other platforms that * could be running Linux - ie, some high performance AMIGA SCSI * boards use it. * * So, I should include #ifdef'd code so that it is - * compatable with these systems. + * compatible with these systems. * * Specifically, the little Endian assumptions I made in my * bit fields need to change, and if the NCR doesn't see memory @@ -257,7 +257,7 @@ static char scan_scsis_buf[512]; * different defines. * * - * Allow for simultaneous existance of mutliple SCSI scripts so we + * Allow for simultaneous existence of multiple SCSI scripts so we * can have a single driver binary for all of the family. * * - one for NCR53c700 and NCR53c700-66 chips (not yet supported) @@ -327,7 +327,7 @@ static int no_overrides = 0; * Purpose : LILO command line initialization of the overrides array, * * Inputs : board - currently, unsupported. chip - 700, 70066, 710, 720 - * 810, 815, 820, 825, allthough currently only the NCR53c810 is + * 810, 815, 820, 825, although currently only the NCR53c810 is * supported. * */ @@ -390,9 +390,6 @@ setup_wrapper(815) setup_wrapper(820) setup_wrapper(825) -static struct sigaction NCR53c7x0_sigaction = { NCR53c7x0_intr, 0, - SA_INTERRUPT , NULL }; - /* * Function : static int NCR53c7x0_init (struct Scsi_Host *host) * @@ -433,7 +430,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { } /* - * Set up an interrupt handler if we aren't allready sharing an IRQ + * Set up an interrupt handler if we aren't already sharing an IRQ * with another board. */ @@ -441,7 +438,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { (search->irq != host->irq); search=search->next); if (!search) { - if (irqaction (host->irq, &NCR53c7x0_sigaction)) { + if (request_irq(host->irq, NCR53c7x0_intr, SA_INTERRUPT, "53c7,8xx")) { printk("scsi%d : IRQ%d not free, detaching\n", host->host_no, host->irq); scsi_unregister (host); @@ -463,7 +460,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { /* * XXX - the NCR53c700 uses bitfielded registers for SCID, SDID, etc, - * as does the 710 with one bit per SCSI ID. Conversly, the NCR + * as does the 710 with one bit per SCSI ID. Conversely, the NCR * uses a normal, 3 bit binary representation of these values. * * Get the rest of the NCR documentation, and FIND OUT where the change @@ -499,7 +496,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { } /* - * On NCR53c700 series chips, DCNTL controls the SCSI clock dvisior, + * On NCR53c700 series chips, DCNTL controls the SCSI clock divisor, * on 800 series chips, it allows for a totem-pole IRQ driver. */ hostdata->saved_dcntl = NCR53c7x0_read8(DCNTL_REG); @@ -578,7 +575,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { hostdata->busy[i][j] = 0; /* * NCR53c700 and NCR53c700-66 chips lack the DSA and use a - * different architecture. For chips using the DSA architecutre, + * different architecture. For chips using the DSA architecture, * initialize the per-target synchronous parameters. */ if (hostdata->chip != 700 && hostdata->chip != 70066) { @@ -652,7 +649,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) { * Purpose : initializes a NCR53c7,8x0 based on base addresses, * IRQ, and DMA channel. * - * Useful where a new NCR chip is backwards compatable with + * Useful where a new NCR chip is backwards compatible with * a supported chip, but the DEVICE ID has changed so it * doesn't show up when the autoprobe does a pcibios_find_device. * @@ -724,11 +721,11 @@ static int normal_init (Scsi_Host_Template *tpnt, int board, int chip, } /* - * Being memory mapped is more desireable, since + * Being memory mapped is more desirable, since * * - Memory accesses may be faster. * - * - The destination and source addresse spaces are the same for + * - The destination and source address spaces are the same for * all instructions, meaning we don't have to twiddle dmode or * any other registers. * @@ -780,7 +777,7 @@ static int normal_init (Scsi_Host_Template *tpnt, int board, int chip, * reprogramming of latency timer and determining addresses * and weather bus mastering, etc. are OK. * - * Useful where a new NCR chip is backwards compatable with + * Useful where a new NCR chip is backwards compatible with * a supported chip, but the DEVICE ID has changed so it * doesn't show up when the autoprobe does a pcibios_find_device. * @@ -825,7 +822,7 @@ static int pci_init (Scsi_Host_Template *tpnt, int board, int chip, (error = pcibios_read_config_byte (bus, device_fn, PCI_INTERRUPT_LINE, &irq))) { printk ("scsi-ncr53c7,8xx : error %s not initializing due to error reading configuration space\n" - " perhaps you specied an incorrect PCI bus, device, or function.\n" + " perhaps you specified an incorrect PCI bus, device, or function.\n" , pcibios_strerror(error)); return -1; } @@ -904,7 +901,7 @@ static int pci_init (Scsi_Host_Template *tpnt, int board, int chip, * Function : int NCR53c7xx_detect(Scsi_Host_Template *tpnt) * * Purpose : detects and initializes NCR53c7,8x0 SCSI chips - * that were autoprobed, overriden on the LILO command line, + * that were autoprobed, overridden on the LILO command line, * or specified at compile time. * * Inputs : tpnt - template for this SCSI adapter @@ -1028,9 +1025,9 @@ static void NCR53c8x0_init_fixup (struct Scsi_Host *host) { patch_abs_32 (hostdata->script, 0, addr_temp, base + TEMP_REG); /* - * I needed some variables in the script to be accessable to + * I needed some variables in the script to be accessible to * both the NCR chip and the host processor. For these variables, - * I made the arbitrary decession to store them directly in the + * I made the arbitrary decision to store them directly in the * hostdata structure rather than in the RELATIVE area of the * SCRIPTS. */ @@ -1111,7 +1108,7 @@ static void NCR53c8x0_init_fixup (struct Scsi_Host *host) { * Function : static int NCR53c8xx_run_tests (struct Scsi_Host *host) * * Purpose : run various verification tests on the NCR chip, - * including interrupt generation, and propper bus mastering + * including interrupt generation, and proper bus mastering * operation. * * Inputs : host - a properly initialized Scsi_Host structure @@ -1393,7 +1390,7 @@ static void abnormal_finished (struct NCR53c7x0_cmd *cmd, int result) { * Function : static void intr_break (struct Scsi_Host *host, * struct NCR53c7x0_cmd *cmd) * - * Purpose : Handler for breakpoint interrutps from a SCSI script + * Purpose : Handler for breakpoint interrupts from a SCSI script * * Inputs : host - pointer to this host adapter's structure, * cmd - pointer to the command (if any) dsa was pointing @@ -1516,11 +1513,11 @@ static const struct { * Purpose : reprogram transfers between the selected SCSI initiator and * target for synchronous SCSI transfers such that the synchronous * offset is less than that requested and period at least as long - * as that requestion. Also modify *msg such that it contains + * as that requested. Also modify *msg such that it contains * an appropriate response. * * Inputs : host - NCR53c7,8xx SCSI host, target - number SCSI target id, - * msg - synchronous tranfer request. + * msg - synchronous transfer request. */ @@ -1531,7 +1528,7 @@ static void synchronous (struct Scsi_Host *host, int target, char *msg) { unsigned long *script; unsigned char scntl3, sxfer; -/* Scale divisor by 10 to accomodate fractions */ +/* Scale divisor by 10 to accommodate fractions */ desire = 1000000000L / (msg[3] * 4); divisor = desire / (hostdata->scsi_clock / 10); @@ -1625,7 +1622,7 @@ static int NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct hostdata->dsp_changed = 1; break; case INITIATE_RECOVERY: - printk ("scsi%d : extended contingent allegience not supported yet, rejecting\n", + printk ("scsi%d : extended contingent allegiance not supported yet, rejecting\n", host->host_no); hostdata->dsp = hostdata->script + hostdata->E_reject_message / sizeof(long); @@ -1709,7 +1706,7 @@ static int NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct hostdata->dsp_changed = 1; return SPECIFIC_INT_NOTHING; /* - * Since contingent allegience conditions are cleared by the next + * Since contingent allegiance conditions are cleared by the next * command issued to a target, we must issue a REQUEST SENSE * command after receiving a CHECK CONDITION status, before * another command is issued. @@ -1729,7 +1726,7 @@ static int NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct } /* - * When a contingent allegience condition is created, the target + * When a contingent allegiance condition is created, the target * reverts to asynchronous transfers. */ @@ -1737,12 +1734,12 @@ static int NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct /* * Use normal one-byte selection message, with no attempts to - * restablish synchronous or wide messages since this may + * reestablish synchronous or wide messages since this may * be the crux of our problem. * - * XXX - once SCSI-II tagged queing is implemented, we'll + * XXX - once SCSI-II tagged queuing is implemented, we'll * have to set this up so that the rest of the DSA - * aggrees with this being an untagged queue'd command. + * agrees with this being an untagged queue'd command. */ patch_dsa_32 (cmd->dsa, dsa_msgout, 0, 1); @@ -1781,7 +1778,7 @@ static int NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct * Currently, this command is flagged as completed, ie * it has valid status and message data. Reflag it as * incomplete. Q - need to do something so that original - * status, etc are uesed. + * status, etc are used. */ cmd->cmd->result = 0xffff; @@ -2388,7 +2385,7 @@ static struct NCR53c7x0_cmd *create_cmd (Scsi_Cmnd *cmd) { tmp->prev = NULL; /* - * Calculate addresses of dynamnic code to fill in DSA + * Calculate addresses of dynamic code to fill in DSA */ tmp->data_transfer_start = tmp->dsa + (hostdata->dsa_end - @@ -2475,7 +2472,7 @@ static struct NCR53c7x0_cmd *create_cmd (Scsi_Cmnd *cmd) { * In any case, this is how it _must_ be done for 53c700/700-66 chips, * so this stays even when we come up with something better. * - * When we're limited to 1 simultaenous command, no overlapping processing, + * When we're limited to 1 simultaneous command, no overlapping processing, * we're seeing 630K/sec, with 7% CPU usage on a slow Syquest 45M * drive. * @@ -2623,7 +2620,7 @@ int NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) { } cmd->scsi_done = done; - cmd->result = 0xffff; /* The NCR will overwite message + cmd->result = 0xffff; /* The NCR will overwrite message and status with valid data */ cmd->host_scribble = (unsigned char *) tmp = create_cmd (cmd); @@ -2648,8 +2645,8 @@ int NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) { /* * REQUEST sense commands need to be executed before all other - * commands since any command will clear the contingent allegience - * condition that exists and the sense data is only guranteed to be + * commands since any command will clear the contingent allegiance + * condition that exists and the sense data is only guaranteed to be * valid while the condition exists. */ @@ -3002,12 +2999,12 @@ restart: Scsi_Cmnd *tmp; if (!cmd) { - printk("scsi%d : very wierd.\n", host->host_no); + printk("scsi%d : very weird.\n", host->host_no); break; } if (!(tmp = cmd->cmd)) { - printk("scsi%d : wierd. NCR53c7x0_cmd has no Scsi_Cmnd\n", + printk("scsi%d : weird. NCR53c7x0_cmd has no Scsi_Cmnd\n", host->host_no); continue; } @@ -3023,7 +3020,7 @@ restart: search_found = 1; /* Important - remove from list _before_ done is called */ - /* XXX - SLL. Seems like DLL is unecessary */ + /* XXX - SLL. Seems like DLL is unnecessary */ if (cmd->prev) cmd->prev->next = cmd->next; if (cmd_prev_ptr) @@ -3341,7 +3338,7 @@ static void intr_phase_mismatch (struct Scsi_Host *host, struct NCR53c7x0_cmd /* * MSGOUT phase - shouldn't happen, because we haven't * asserted ATN. - * CMDOUT phase - shouldn't happen, since we've allready + * CMDOUT phase - shouldn't happen, since we've already * sent a valid command. * DATAIN/DATAOUT - other one shouldn't happen, since * SCSI commands can ONLY have one or the other. @@ -3408,7 +3405,7 @@ static void intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) { dsa = (unsigned long *) NCR53c7x0_read32(DSA_REG); /* - * DSTAT_ABRT is the aborted interrupt. This is set whenver the + * DSTAT_ABRT is the aborted interrupt. This is set whenever the * SCSI chip is aborted. * * With NCR53c700 and NCR53c700-66 style chips, we should only @@ -3623,7 +3620,7 @@ static int print_insn (struct Scsi_Host *host, unsigned long *insn, /* * Function : int NCR53c7xx_abort (Scsi_Cmnd *cmd) * - * Purpose : Abort an erratant SCSI command, doing all necessary + * Purpose : Abort an errant SCSI command, doing all necessary * cleanup of the issue_queue, running_list, shared Linux/NCR * dsa issue and reconnect queues. * @@ -3676,7 +3673,7 @@ int NCR53c7xx_abort (Scsi_Cmnd *cmd) { } /* - * That failing, the command could be in our list of allready executing + * That failing, the command could be in our list of already executing * commands. If this is the case, drastic measures are called for. */ diff --git a/drivers/scsi/53c7,8xx.h b/drivers/scsi/53c7,8xx.h index 273da7eee470..7793f99ac228 100644 --- a/drivers/scsi/53c7,8xx.h +++ b/drivers/scsi/53c7,8xx.h @@ -137,7 +137,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define SIEN_REG_700 0x03 #define SIEN0_REG_800 0x40 #define SIEN_MA 0x80 /* Phase mismatch (ini) or ATN (tgt) */ -#define SIEN_FC 0x40 /* Functin complete */ +#define SIEN_FC 0x40 /* Function complete */ #define SIEN_700_STO 0x20 /* Selection or reselection timeout */ #define SIEN_800_SEL 0x20 /* Selected */ #define SIEN_700_SEL 0x10 /* Selected or reselected */ @@ -224,7 +224,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define SBCL_PHASE_MASK (SBCL_CD|SBCL_IO|SBCL_MSG) /* - * SCSI first byte recieved latch ro + * SCSI first byte received latch ro * This register contains the first byte received during a block MOVE * SCSI SCRIPTS instruction, including * @@ -252,7 +252,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); /* * SCSI bus data lines ro - * This register reflects the instantenous status of the SCSI data + * This register reflects the instantaneous status of the SCSI data * lines. Note that SCNTL0 must be set to disable parity checking, * otherwise reading this register will latch new parity. */ @@ -278,7 +278,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define SOCL_CD 0x02 /* C/D ro */ #define SOCL_IO 0x01 /* I/O ro */ /* - * Syncronous SCSI Clock Control bits + * Synchronous SCSI Clock Control bits * 0 - set by DCNTL * 1 - SCLK / 1.0 * 2 - SCLK / 1.5 @@ -333,7 +333,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define SSTAT1_SDP 0x01 /* Instant readout of SDP/ */ #define SSTAT2_REG 0x0f /* SCSI status 2 ro */ -#define SSTAT2_FF3 0x80 /* number of bytes in syncronous */ +#define SSTAT2_FF3 0x80 /* number of bytes in synchronous */ #define SSTAT2_FF2 0x40 /* data FIFO */ #define SSTAT2_FF1 0x20 #define SSTAT2_FF0 0x10 @@ -386,7 +386,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); /* 0x80 - 0x40 are reserved on 700 series chips */ #define CTEST2_700_SOFF 0x20 /* SCSI Offset Compare, - * As an initator, this bit is + * As an initiator, this bit is * one when the synchronous offset * is zero, as a target this bit * is one when the synchronous @@ -474,11 +474,11 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); */ #define CTEST5_BBCK 0x40 /* - * Reset SCSI Offset. Setting this bit to 1 cleares the current offset + * Reset SCSI Offset. Setting this bit to 1 clears the current offset * pointer in the SCSI synchronous offset counter (SSTAT). This bit * is set to 1 if a SCSI Gross Error Condition occurs. The offset should * be cleared when a synchronous transfer fails. When written, it is - * automatically cleared after the SCSI syncrnous offset counter is + * automatically cleared after the SCSI synchronous offset counter is * reset. */ /* Bit 5 is reserved on 800 series chips */ @@ -562,7 +562,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define ISTAT_700_PRE 0x04 /* Pointer register empty. * Set to 1 when DSPS and DSP * registers are empty in pipeline - * mode, allways set otherwise. + * mode, always set otherwise. */ #define ISTAT_SIP 0x02 /* SCSI interrupt pending from * SCSI portion of SIOP see @@ -618,14 +618,14 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); /* - * The CTEST9 register may be used to diffentiate between a + * The CTEST9 register may be used to differentiate between a * NCR53c700 and a NCR53c710. * * Write 0xff to this register. * Read it. * If the contents are 0xff, it is a NCR53c700 * If the contents are 0x00, it is a NCR53c700-66 first revision - * If the contents are zome other value, it is some other NCR53c700-66 + * If the contents are some other value, it is some other NCR53c700-66 */ #define CTEST9_REG_00 0x23 /* Chip test 9 ro */ #define LCRC_REG_10 0x23 @@ -635,7 +635,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); * write their high 8 bits into the DCMD register, the low 24 bits into * the DBC register. * - * Function is dependant on the command type being executed. + * Function is dependent on the command type being executed. */ @@ -643,7 +643,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); /* * For Block Move Instructions, DBC is a 24 bit quantity representing * the number of bytes to transfer. - * For Transfer Control Intructions, DBC is bit fielded as follows : + * For Transfer Control Instructions, DBC is bit fielded as follows : */ /* Bits 20 - 23 should be clear */ #define DBC_TCI_TRUE (1 << 19) /* Jump when true */ @@ -694,7 +694,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define DCMD_RWRI_OPC_MASK 0x38 /* Opcode mask */ #define DCMD_RWRI_OPC_WRITE 0x28 /* Write SFBR to register */ #define DCMD_RWRI_OPC_READ 0x30 /* Read register to SFBR */ -#define DCMD_RWRI_OPC_MODIFY 0x38 /* Modify inplace */ +#define DCMD_RWRI_OPC_MODIFY 0x38 /* Modify in place */ #define DCMD_RWRI_OP_MASK 0x07 #define DCMD_RWRI_OP_MOVE 0x00 @@ -795,7 +795,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); * but 286 mode bit in DMODE. On the * NCR53c710, this bit moved to CTEST8 */ -#define DCNTL_10_COM 0x01 /* 700 software compatability mode */ +#define DCNTL_10_COM 0x01 /* 700 software compatibility mode */ #define DCNTL_700_SAVE ( DCNTL_CF_MASK | DCNTL_S16) @@ -854,7 +854,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define STEST2_REG_800 0x4e #define STEST2_800_SCE 0x80 /* Enable SOCL/SODL */ #define STEST2_800_ROF 0x40 /* Reset SCSI sync offset */ -#define STEST2_800_SLB 0x10 /* Enable SCSI looback mode */ +#define STEST2_800_SLB 0x10 /* Enable SCSI loopback mode */ #define STEST2_800_SZM 0x08 /* SCSI high impedance mode */ #define STEST2_800_EXT 0x02 /* Extend REQ/ACK filter 30 to 60ns */ #define STEST2_800_LOW 0x01 /* SCSI low level mode */ @@ -874,7 +874,7 @@ extern int NCR53c7xx_reset(Scsi_Cmnd *); #define OPTION_PARITY 0x1 /* Enable parity checking */ #define OPTION_TAGGED_QUEUE 0x2 /* Enable SCSI-II tagged queuing */ -#define OPTION_700 0x8 /* Allways run NCR53c700 scripts */ +#define OPTION_700 0x8 /* Always run NCR53c700 scripts */ #define OPTION_INTFLY 0x10 /* Use INTFLY interrupts */ #define OPTION_DEBUG_INTR 0x20 /* Debug interrupts */ #define OPTION_DEBUG_INIT_ONLY 0x40 /* Run initialization code and @@ -922,7 +922,7 @@ struct NCR53c7x0_synchronous { #define CMD_FLAG_SDTR 1 /* Initiating synchronous transfer negotiation */ -#define CMD_FLAG_WDTR 2 /* Initiating wide tranfer +#define CMD_FLAG_WDTR 2 /* Initiating wide transfer negotiation */ #define CMD_FLAG_DID_SDTR 4 /* did SDTR */ @@ -980,7 +980,7 @@ struct NCR53c7x0_break { #define STATE_HALTED 0 /* * Indicates that the NCR is executing the wait for select / reselect - * script. Only used when running NCR53c700 compatable scripts, only + * script. Only used when running NCR53c700 compatible scripts, only * state during which an ABORT is _not_ considered an error condition. */ #define STATE_WAITING 1 @@ -988,7 +988,7 @@ struct NCR53c7x0_break { #define STATE_RUNNING 2 /* * Indicates that the NCR was being aborted. Only used when running - * NCR53c700 compatable scripts. + * NCR53c700 compatible scripts. */ #define STATE_ABORTING 3 @@ -1208,7 +1208,7 @@ struct NCR53c7x0_hostdata { executing on each target */ /* - * Eventually, I'll switch to a corroutine for calling + * Eventually, I'll switch to a coroutine for calling * cmd->done(cmd), etc. so that we can overlap interrupt * processing with this code for maximum performance. */ diff --git a/drivers/scsi/53c7,8xx.scr b/drivers/scsi/53c7,8xx.scr index eb6aa413b2cb..0174526f5e9e 100644 --- a/drivers/scsi/53c7,8xx.scr +++ b/drivers/scsi/53c7,8xx.scr @@ -52,7 +52,7 @@ ; ; While the NCR53c700 and NCR53c700-66 lacked the facilities to fully ; automate SCSI transfers without host processor intervention, this -; isnt the case with the NCR53c710 and newer chips which allow +; isn't the case with the NCR53c710 and newer chips which allow ; ; - reads and writes to the internal registers from within the SCSI ; scripts, allowing the SCSI SCRIPTS(tm) code to save processor @@ -67,10 +67,10 @@ ; where the same piece of code is run to handle I/O for multiple threads ; at once minimizing our need to relocate code. Since the NCR53c700/ ; NCR53c800 series have a unique combination of features, making a -; a standard ingoing/outgoing mailbox system, costly, Ive modified it. +; a standard ingoing/outgoing mailbox system, costly, I've modified it. ; ; - Commands are stored in a linked list, rather than placed in -; arbitrary mailboxes. This simiplifies the amount of processing +; arbitrary mailboxes. This simplifies the amount of processing ; that must be done by the NCR53c810. ; ; - Mailboxes are a mixture of code and data. This lets us greatly @@ -189,7 +189,7 @@ ABSOLUTE addr_temp = 0x0 ; 4 testing interrupt ; Next byte indicates specific error -; XXX not yet implemented, Im not sure if I want to - +; XXX not yet implemented, I'm not sure if I want to - ; Next byte indicates the routine the error occurred in ; The LSB indicates the specific place the error occurred @@ -234,14 +234,14 @@ ABSOLUTE reselected_identify = 0 ABSOLUTE reselected_tag = 0 ; Request sense command pointer, its a 6 byte command, should -; be constant for all commands since we allways want 16 bytes of -; sense and we dont need to change any fields as we did under +; be constant for all commands since we always want 16 bytes of +; sense and we don't need to change any fields as we did under ; SCSI-I when we actually cared about the LUN field. ;EXTERNAL NCR53c7xx_sense ; Request sense command #if (CHIP != 700) && (CHIP != 70066) ; dsa_schedule -; PURPOSE : after a DISCONNECT message has been recieved, and pointers +; PURPOSE : after a DISCONNECT message has been received, and pointers ; saved, insert the current DSA structure at the head of the ; disconnected queue and fall through to the scheduler. ; @@ -252,7 +252,7 @@ ABSOLUTE reselected_tag = 0 ; ; MODIFIES : SCRATCH, reconnect_dsa_head ; -; EXITS : allways passes control to schedule +; EXITS : always passes control to schedule ENTRY dsa_schedule dsa_schedule: @@ -263,7 +263,7 @@ dsa_schedule: ; CALL dsa_to_scratch ; XXX - we need to deal with the NCR53c710, which lacks an add with -; carry instruction, by moving arround the DSA alignment to avoid +; carry instruction, by moving around the DSA alignment to avoid ; carry in situations like this. MOVE SCRATCH0 + dsa_next TO SCRATCH0 MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY @@ -332,7 +332,7 @@ schedule: ; PURPOSE : establish a nexus for the SCSI command referenced by DSA. ; On success, the current DSA structure is removed from the issue ; queue. Usually, this is entered as a fall-through from schedule, -; although the contingent allegience handling code will write +; although the contingent allegiance handling code will write ; the select entry address to the DSP to restart a command as a ; REQUEST SENSE. A message is sent (usually IDENTIFY, although ; additional SDTR or WDTR messages may be sent). COMMAND OUT @@ -365,7 +365,7 @@ select: ; ; So, for more performance, we could overlap the code which removes ; the command from the NCRs issue queue with the selection, but -; at this point I dont want to deal with the error recovery. +; at this point I don't want to deal with the error recovery. ; #if (CHIP != 700) && (CHIP != 70066) @@ -468,7 +468,7 @@ cmdout_cmdout: ; MODIFIES : SCRATCH ; ; EXITS : if STATUS IN is detected, signifying command completion, -; the NCR jumpst to command_complete. If MSG IN occurs, a +; the NCR jumps to command_complete. If MSG IN occurs, a ; CALL is made to msg_in. Otherwise, other_transfer runs in ; an infinite loop. ; @@ -542,7 +542,7 @@ other_transfer: ; munge_msg ; ; PURPOSE : process messages from a target. msg_in is called when the -; caller hasnt read the first byte of the message. munge_message +; caller hasn't read the first byte of the message. munge_message ; is called when the caller has read the first byte of the message, ; and left it in SFBR. ; @@ -551,7 +551,7 @@ other_transfer: ; INITIATE RECOVERY messages. ; ; When the host system handles one of these interrupts, -; it can respond by rentering at reject_message, +; it can respond by reentering at reject_message, ; which rejects the message and returns control to ; the caller of msg_in or munge_msg, accept_message ; which clears ACK and returns control, or reply_message @@ -567,7 +567,7 @@ other_transfer: ; INPUTS : DSA - SCSI COMMAND, SFBR - first byte of message (munge_msg ; only) ; -; CALLS : NO. The TEMP register isnt backed up to allow nested calls. +; CALLS : NO. The TEMP register isn't backed up to allow nested calls. ; ; MODIFIES : SCRATCH, DSA on DISCONNECT ; @@ -584,12 +584,12 @@ munge_msg: JUMP munge_extended, IF 0x01 ; EXTENDED MESSAGE JUMP munge_2, IF 0x20, AND MASK 0xdf ; two byte message ; -; Ive seen a handful of broken SCSI devices which fail to issue +; I've seen a handful of broken SCSI devices which fail to issue ; a SAVE POINTERS message before disconnecting in the middle of ; a transfer, assuming that the DATA POINTER will be implicitly ; restored. So, we treat the SAVE DATA POINTER message as a NOP. ; -; Ive also seen SCSI devices which dont issue a RESTORE DATA +; I've also seen SCSI devices which don't issue a RESTORE DATA ; POINTER message and assume that thats implicit. ; JUMP accept_message, IF 0x02 ; SAVE DATA POINTER @@ -690,7 +690,7 @@ msg_respond: ; Abnormal (CHECK_CONDITION) termination results in an ; int_err_check_condition interrupt so that a REQUEST SENSE ; command can be issued out-of-order so that no other command -; clears the contingent allegience condition. +; clears the contingent allegiance condition. ; ; ; INPUTS : DSA - command @@ -728,7 +728,7 @@ command_complete_msgin: ; interrupt the host processor to get them changed, or change them ourselves. ; ; Once SCSI-II tagged queueing is implemented, things will be even more -; hairy, since contingent allegience conditions exist on a per-target/lun +; hairy, since contingent allegiance conditions exist on a per-target/lun ; basis, and issuing a new command with a different tag would clear it. ; In these cases, we must interrupt the host processor to get a request ; added to the HEAD of the queue with the request sense command, or we @@ -757,7 +757,7 @@ command_failed: ; waits for reselection, selection, and new commands. ; ; When a successful reselection occurs, with the aid -; of fixedup code in each DSA, wait_reselect walks the +; of fixed up code in each DSA, wait_reselect walks the ; reconnect_dsa_queue, asking each dsa if the target ID ; and LUN match its. ; @@ -774,7 +774,7 @@ command_failed: ; ; EXITS : On successful reselection, control is returned to the ; DSA which called reselected_ok. If the WAIT RESELECT -; was interrupted by a new commands arival signalled by +; was interrupted by a new commands arrival signaled by ; SIG_P, control is passed to schedule. If the NCR is ; selected, the host system is interrupted with an ; int_err_selected which is usually responded to by @@ -787,11 +787,11 @@ wait_reselect: WAIT RESELECT wait_reselect_failed reselected: - ; Read all data needed to restablish the nexus - + ; Read all data needed to reestablish the nexus - MOVE 1, reselected_identify, WHEN MSG_IN #if (CHIP != 700) && (CHIP != 70066) ; Well add a jump to here after some how determining that - ; tagged queueing isnt in use on this device. + ; tagged queueing isn't in use on this device. reselected_notag: MOVE MEMORY 1, NCR53c7xx_zero, reselected_tag @@ -830,11 +830,11 @@ reselected_not_end: ; XXX the ALU is only eight bits wide, and the assembler ; wont do the dirt work for us. As long as dsa_check_reselect ; is negative, we need to sign extend with 1 bits to the full - ; 32 bit width oof the address. + ; 32 bit width os the address. ; - ; A potential work arround would be to have a known alignment + ; A potential work around would be to have a known alignment ; of the DSA structure such that the base address plus - ; dsa_check_reselect doesnt require carryin from bytes + ; dsa_check_reselect doesn't require carrying from bytes ; higher than the LSB. ; @@ -903,7 +903,7 @@ select_failed: ; DSA on entry, and is useful for miscellaneous experimentation. ; -; Verify that interrupts are working correctly and that we dont +; Verify that interrupts are working correctly and that we don't ; have a cache invalidation problem. ABSOLUTE test_src = 0, test_dest = 0 @@ -992,8 +992,8 @@ no_source_data: ; as the source or destination. So, we provide a couple of subroutines ; that let us switch between the DSA register and scratch register. ; -; Memory moves to/from the DSPS register also dont work, but we -; dont use them. +; Memory moves to/from the DSPS register also don't work, but we +; don't use them. ; ; diff --git a/drivers/scsi/53c8xx_d.h b/drivers/scsi/53c8xx_d.h index 7ff3e1a7a738..9a9c5c2db033 100644 --- a/drivers/scsi/53c8xx_d.h +++ b/drivers/scsi/53c8xx_d.h @@ -54,7 +54,7 @@ unsigned long SCRIPT[] = { ; ; While the NCR53c700 and NCR53c700-66 lacked the facilities to fully ; automate SCSI transfers without host processor intervention, this -; isnt the case with the NCR53c710 and newer chips which allow +; isn't the case with the NCR53c710 and newer chips which allow ; ; - reads and writes to the internal registers from within the SCSI ; scripts, allowing the SCSI SCRIPTS(tm) code to save processor @@ -69,10 +69,10 @@ unsigned long SCRIPT[] = { ; where the same piece of code is run to handle I/O for multiple threads ; at once minimizing our need to relocate code. Since the NCR53c700/ ; NCR53c800 series have a unique combination of features, making a -; a standard ingoing/outgoing mailbox system, costly, Ive modified it. +; a standard ingoing/outgoing mailbox system, costly, I've modified it. ; ; - Commands are stored in a linked list, rather than placed in -; arbitrary mailboxes. This simiplifies the amount of processing +; arbitrary mailboxes. This simplifies the amount of processing ; that must be done by the NCR53c810. ; ; - Mailboxes are a mixture of code and data. This lets us greatly @@ -251,7 +251,7 @@ ABSOLUTE addr_temp = 0x0 ; 4 testing interrupt ; Next byte indicates specific error -; XXX not yet implemented, Im not sure if I want to - +; XXX not yet implemented, I'm not sure if I want to - ; Next byte indicates the routine the error occurred in ; The LSB indicates the specific place the error occurred @@ -296,14 +296,14 @@ ABSOLUTE reselected_identify = 0 ABSOLUTE reselected_tag = 0 ; Request sense command pointer, its a 6 byte command, should -; be constant for all commands since we allways want 16 bytes of -; sense and we dont need to change any fields as we did under +; be constant for all commands since we allays want 16 bytes of +; sense and we don't need to change any fields as we did under ; SCSI-I when we actually cared about the LUN field. ;EXTERNAL NCR53c7xx_sense ; Request sense command ; dsa_schedule -; PURPOSE : after a DISCONNECT message has been recieved, and pointers +; PURPOSE : after a DISCONNECT message has been received, and pointers ; saved, insert the current DSA structure at the head of the ; disconnected queue and fall through to the scheduler. ; @@ -314,7 +314,7 @@ ABSOLUTE reselected_tag = 0 ; ; MODIFIES : SCRATCH, reconnect_dsa_head ; -; EXITS : allways passes control to schedule +; EXITS : allays passes control to schedule ENTRY dsa_schedule dsa_schedule: @@ -328,7 +328,7 @@ dsa_schedule: at 0x0000002d : */ 0x88080000,0x000007b8, /* ; XXX - we need to deal with the NCR53c710, which lacks an add with -; carry instruction, by moving arround the DSA alignment to avoid +; carry instruction, by moving around the DSA alignment to avoid ; carry in situations like this. MOVE SCRATCH0 + dsa_next TO SCRATCH0 @@ -472,7 +472,7 @@ at 0x00000063 : */ 0x800c0000,0x00000560, ; PURPOSE : establish a nexus for the SCSI command referenced by DSA. ; On success, the current DSA structure is removed from the issue ; queue. Usually, this is entered as a fall-through from schedule, -; although the contingent allegience handling code will write +; although the contingent allegiance handling code will write ; the select entry address to the DSP to restart a command as a ; REQUEST SENSE. A message is sent (usually IDENTIFY, although ; additional SDTR or WDTR messages may be sent). COMMAND OUT @@ -508,7 +508,7 @@ at 0x00000065 : */ 0x60000200,0x00000000, ; ; So, for more performance, we could overlap the code which removes ; the command from the NCRs issue queue with the selection, but -; at this point I dont want to deal with the error recovery. +; at this point I don't want to deal with the error recovery. ; @@ -665,7 +665,7 @@ at 0x0000008b : */ 0x1a000000,0x00000048, ; MODIFIES : SCRATCH ; ; EXITS : if STATUS IN is detected, signifying command completion, -; the NCR jumpst to command_complete. If MSG IN occurs, a +; the NCR jumps to command_complete. If MSG IN occurs, a ; CALL is made to msg_in. Otherwise, other_transfer runs in ; an infinite loop. ; @@ -841,7 +841,7 @@ at 0x000000d3 : */ 0x80080000,0x0000031c, ; munge_msg ; ; PURPOSE : process messages from a target. msg_in is called when the -; caller hasnt read the first byte of the message. munge_message +; caller hasn't read the first byte of the message. munge_message ; is called when the caller has read the first byte of the message, ; and left it in SFBR. ; @@ -850,7 +850,7 @@ at 0x000000d3 : */ 0x80080000,0x0000031c, ; INITIATE RECOVERY messages. ; ; When the host system handles one of these interrupts, -; it can respond by rentering at reject_message, +; it can respond by reentering at reject_message, ; which rejects the message and returns control to ; the caller of msg_in or munge_msg, accept_message ; which clears ACK and returns control, or reply_message @@ -866,7 +866,7 @@ at 0x000000d3 : */ 0x80080000,0x0000031c, ; INPUTS : DSA - SCSI COMMAND, SFBR - first byte of message (munge_msg ; only) ; -; CALLS : NO. The TEMP register isnt backed up to allow nested calls. +; CALLS : NO. The TEMP register isn't backed up to allow nested calls. ; ; MODIFIES : SCRATCH, DSA on DISCONNECT ; @@ -892,12 +892,12 @@ at 0x000000d7 : */ 0x800c0001,0x00000428, at 0x000000d9 : */ 0x800cdf20,0x0000039c, /* ; -; Ive seen a handful of broken SCSI devices which fail to issue +; I've seen a handful of broken SCSI devices which fail to issue ; a SAVE POINTERS message before disconnecting in the middle of ; a transfer, assuming that the DATA POINTER will be implicitly ; restored. So, we treat the SAVE DATA POINTER message as a NOP. ; -; Ive also seen SCSI devices which dont issue a RESTORE DATA +; I've also seen SCSI devices which don't issue a RESTORE DATA ; POINTER message and assume that thats implicit. ; JUMP accept_message, IF 0x02 ; SAVE DATA POINTER @@ -1151,7 +1151,7 @@ at 0x00000140 : */ 0x90080000,0x00000000, ; Abnormal (CHECK_CONDITION) termination results in an ; int_err_check_condition interrupt so that a REQUEST SENSE ; command can be issued out-of-order so that no other command -; clears the contingent allegience condition. +; clears the contingent allegiance condition. ; ; ; INPUTS : DSA - command @@ -1207,7 +1207,7 @@ at 0x0000014c : */ 0x72340000,0x00000000, ; interrupt the host processor to get them changed, or change them ourselves. ; ; Once SCSI-II tagged queueing is implemented, things will be even more -; hairy, since contingent allegience conditions exist on a per-target/lun +; hairy, since contingent allegiance conditions exist on a per-target/lun ; basis, and issuing a new command with a different tag would clear it. ; In these cases, we must interrupt the host processor to get a request ; added to the HEAD of the queue with the request sense command, or we @@ -1251,7 +1251,7 @@ at 0x00000156 : */ 0x98080000,0x00030000, ; waits for reselection, selection, and new commands. ; ; When a successful reselection occurs, with the aid -; of fixedup code in each DSA, wait_reselect walks the +; of fixed up code in each DSA, wait_reselect walks the ; reconnect_dsa_queue, asking each dsa if the target ID ; and LUN match its. ; @@ -1268,7 +1268,7 @@ at 0x00000156 : */ 0x98080000,0x00030000, ; ; EXITS : On successful reselection, control is returned to the ; DSA which called reselected_ok. If the WAIT RESELECT -; was interrupted by a new commands arival signalled by +; was interrupted by a new commands arrival signaled by ; SIG_P, control is passed to schedule. If the NCR is ; selected, the host system is interrupted with an ; int_err_selected which is usually responded to by @@ -1284,14 +1284,14 @@ at 0x00000158 : */ 0x50000000,0x0000067c, /* reselected: - ; Read all data needed to restablish the nexus - + ; Read all data needed to reestablish the nexus - MOVE 1, reselected_identify, WHEN MSG_IN at 0x0000015a : */ 0x0f000001,0x00000000, /* ; Well add a jump to here after some how determining that - ; tagged queueing isnt in use on this device. + ; tagged queueing isn't in use on this device. reselected_notag: MOVE MEMORY 1, NCR53c7xx_zero, reselected_tag @@ -1378,11 +1378,11 @@ at 0x0000017d : */ 0x72100000,0x00000000, ; XXX the ALU is only eight bits wide, and the assembler ; wont do the dirt work for us. As long as dsa_check_reselect ; is negative, we need to sign extend with 1 bits to the full - ; 32 bit width oof the address. + ; 32 bit width of the address. ; - ; A potential work arround would be to have a known alignment + ; A potential work around would be to have a known alignment ; of the DSA structure such that the base address plus - ; dsa_check_reselect doesnt require carryin from bytes + ; dsa_check_reselect doesn't require carrying from bytes ; higher than the LSB. ; @@ -1517,7 +1517,7 @@ at 0x000001ab : */ 0x80080000,0x00000130, ; DSA on entry, and is useful for miscellaneous experimentation. ; -; Verify that interrupts are working correctly and that we dont +; Verify that interrupts are working correctly and that we don't ; have a cache invalidation problem. ABSOLUTE test_src = 0, test_dest = 0 @@ -1702,8 +1702,8 @@ at 0x000001ec : */ 0x98080000,0x02040000, ; as the source or destination. So, we provide a couple of subroutines ; that let us switch between the DSA register and scratch register. ; -; Memory moves to/from the DSPS register also dont work, but we -; dont use them. +; Memory moves to/from the DSPS register also don't work, but we +; don't use them. ; ; diff --git a/drivers/scsi/ChangeLog b/drivers/scsi/ChangeLog index 67326123d1cf..8e87692c4f58 100644 --- a/drivers/scsi/ChangeLog +++ b/drivers/scsi/ChangeLog @@ -258,7 +258,7 @@ Mon Mar 21 16:36:20 1994 * Linux 1.0, patchlevel3 released. * sd.c, st.c, sr.c, sg.c: Return -ENXIO, not -ENODEV if we attempt - to open a non-existant device. + to open a non-existent device. * scsi.c: Add Chinon cdrom to blacklist. diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 4abd0b72e54c..462760bb63de 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -598,8 +598,6 @@ static int probe_irq; static void probe_intr (int sig) { probe_irq = sig; }; -static struct sigaction probe_sigaction = { probe_intr, 0, SA_INTERRUPT, - NULL}; static int NCR5380_probe_irq (struct Scsi_Host *instance, int possible) { NCR5380_local_declare(); @@ -610,7 +608,7 @@ static int NCR5380_probe_irq (struct Scsi_Host *instance, int possible) { NCR5380_setup(instance); for (trying_irqs = i = 0, mask = 1; i < 16; ++i, mask <<= 1) - if ((mask & possible) && (irqaction (i, &probe_sigaction) + if ((mask & possible) && (request_irq(i, &probe_intr, SA_INTERRUPT, "NCR-probe") == 0)) trying_irqs |= mask; diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 48d2ba2f0c52..d73c76136d3a 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -507,7 +507,6 @@ int aha152x_detect(Scsi_Host_Template * tpnt) { int i, j, ok; aha152x_config conf; - struct sigaction sa; int interrupt_level; if(setup_called) @@ -625,12 +624,7 @@ int aha152x_detect(Scsi_Host_Template * tpnt) printk("detection complete\n"); - sa.sa_handler = aha152x_intr; - sa.sa_flags = SA_INTERRUPT; - sa.sa_mask = 0; - sa.sa_restorer = NULL; - - ok = irqaction( interrupt_level, &sa); + ok = request_irq(interrupt_level, aha152x_intr, SA_INTERRUPT, "aha152x"); if(ok<0) { diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 695b460340d5..c93e36948ff7 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -328,11 +328,11 @@ static void aha1542_intr_handle(int foo) irqno = *irqp; shost = aha_host[irqno - 9]; + if(!shost) panic("Splunge!"); + mb = HOSTDATA(shost)->mb; ccb = HOSTDATA(shost)->ccb; - if(!shost) panic("Splunge!"); - #ifdef DEBUG { flag = inb(INTRFLAGS(shost->io_port)); @@ -608,7 +608,7 @@ int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; ccb[mbo].commlinkid = 0; -#ifdef DEBUGd +#ifdef DEBUG { int i; printk("aha1542_command: sending.. "); for (i = 0; i < sizeof(ccb[mbo])-10; i++) @@ -870,7 +870,7 @@ int aha1542_detect(Scsi_Host_Template * tpnt) DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level)); cli(); - if (request_irq(irq_level,aha1542_intr_handle)) { + if (request_irq(irq_level,aha1542_intr_handle, 0, "aha1542")) { printk("Unable to allocate IRQ for adaptec controller.\n"); goto unregister; } diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index a60280bf204b..69751a63628d 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c @@ -457,7 +457,7 @@ int aha1740_detect(Scsi_Host_Template * tpnt) DEB(printk("aha1740_detect: enable interrupt channel %d\n", irq_level)); - if (request_irq(irq_level,aha1740_intr_handle)) + if (request_irq(irq_level,aha1740_intr_handle, 0, "aha1740")) { printk("Unable to allocate IRQ for adaptec controller.\n"); return 0; diff --git a/drivers/scsi/buslogic.c b/drivers/scsi/buslogic.c index c65b82c1c614..fefc131f36c1 100644 --- a/drivers/scsi/buslogic.c +++ b/drivers/scsi/buslogic.c @@ -1,5 +1,5 @@ /* - * buslogic.c (C) 1993 David B. Gentzel + * buslogic.c (C) 1993, 1994 David B. Gentzel * Low-level scsi driver for BusLogic adapters * by David B. Gentzel, Whitfield Software Services, Carnegie, PA * (gentzel@nova.enet.dec.com) @@ -18,6 +18,7 @@ * 4. See if we can make good use of having more than one command per lun. * 5. Test/improve/fix abort & reset functions. * 6. Look at command linking. + * 7. Allow multiple boards to share an IRQ if the bus allows (e.g. EISA). */ /* @@ -65,6 +66,7 @@ #include #include #include +#include #include #include @@ -73,7 +75,7 @@ #include "../block/blk.h" #include "scsi.h" #include "hosts.h" -# include "sd.h" +#include "sd.h" #define BUSLOGIC_PRIVATE_H /* Get the "private" stuff */ #include "buslogic.h" @@ -83,15 +85,6 @@ #define BUSLOGIC_VERSION "1.00" -/* ??? This *MAY* work to properly report the geometry of disks > 1G when the - alternate geometry is enabled on the host adapter. It is completely - untested as I have no such disk to experiment with. I rarely refuse gifts, - however... */ -/* Check out the stuff in aha1542.c - is this the same as how buslogic does - it? - ERY */ -/* ??? Not Yet Implemented */ -/*#ifdef BUSLOGIC_ALTERNATE_MAPPING*/ - /* Not a random value - if this is too large, the system hangs for a long time waiting for something to happen if a board is not installed. */ #define WAITNEXTTIMEOUT 3000000 @@ -118,7 +111,7 @@ /* BusLogic boards can be configured for quite a number of port addresses (six to be exact), but I generally do not want the driver poking around at random. We allow two port addresses - this allows people to use a BusLogic - with a MIDI card, which frequently also used 0x330. If different port + with a MIDI card, which frequently also uses 0x330. If different port addresses are needed (e.g. to install more than two cards), you must define BUSLOGIC_PORT_OVERRIDE to be a list of the addresses which will be checked. This can also be used to resolve a conflict if the port-probing at a @@ -131,15 +124,15 @@ static const unsigned int bases[] = { #endif }; -#define BIOS_TRANSLATION_6432 1 /* Default case */ -#define BIOS_TRANSLATION_25563 2 /* Big disk case */ +#define BIOS_TRANSLATION_6432 0 /* Default case */ +#define BIOS_TRANSLATION_25563 1 /* Big disk case */ struct hostdata { unsigned char bus_type; int bios_translation; /* Mapping bios uses - for compatibility */ size_t last_mbi_used; size_t last_mbo_used; - Scsi_Cmnd *SCint[BUSLOGIC_MAILBOXES]; + Scsi_Cmnd *sc[BUSLOGIC_MAILBOXES]; struct mailbox mb[2 * BUSLOGIC_MAILBOXES]; struct ccb ccbs[BUSLOGIC_MAILBOXES]; }; @@ -149,7 +142,8 @@ struct hostdata { /* One for each IRQ level (9-15), although 13 will never be used. */ static struct Scsi_Host *host[7] = { NULL, }; -static int setup_mailboxes(unsigned int base, struct Scsi_Host *SHpnt); +static int setup_mailboxes(unsigned int base, struct Scsi_Host *shpnt); +static int restart(struct Scsi_Host *shpnt); #define INTR_RESET(base) outb(RINT, CONTROL(base)) @@ -157,24 +151,32 @@ static int setup_mailboxes(unsigned int base, struct Scsi_Host *SHpnt); #define CHECK(cond) if (cond) ; else goto fail -#define WAIT(port, mask, allof, noneof) CHECK(wait(port, mask, allof, noneof)) +#define WAIT(port, mask, allof, noneof) \ + CHECK(wait(port, mask, allof, noneof, WAITNEXTTIMEOUT, FALSE)) #define WAIT_WHILE(port, mask) WAIT(port, mask, 0, mask) #define WAIT_UNTIL(port, mask) WAIT(port, mask, mask, 0) +#define WAIT_FAST(port, mask, allof, noneof) \ + CHECK(wait(port, mask, allof, noneof, 100, TRUE)) +#define WAIT_WHILE_FAST(port, mask) WAIT_FAST(port, mask, 0, mask) +#define WAIT_UNTIL_FAST(port, mask) WAIT_FAST(port, mask, mask, 0) +/* If delay != 0, we use the udelay call to regulate the amount of time we + wait. */ static __inline__ int wait(unsigned short port, unsigned char mask, - unsigned char allof, unsigned char noneof) + unsigned char allof, unsigned char noneof, + unsigned int timeout, int delay) { int bits; - unsigned int timeout = WAITNEXTTIMEOUT; for (;;) { bits = inb(port) & mask; if ((bits & allof) == allof && (bits & noneof) == 0) - break; + return TRUE; + if (delay) + udelay(1000); if (--timeout == 0) return FALSE; } - return TRUE; } static void buslogic_prefix(void) @@ -182,7 +184,7 @@ static void buslogic_prefix(void) printk("BusLogic SCSI: "); } -#if 0 +#if BUSLOGIC_DEBUG static void buslogic_stat(unsigned int base) { int s = inb(STATUS(base)), i = inb(INTERRUPT(base)); @@ -197,7 +199,8 @@ static void buslogic_stat(unsigned int base) routine does not send something out while we are in the middle of this. Fortunately, it is only at boot time that multi-byte messages are ever sent. */ -static int buslogic_out(unsigned int base, const unsigned char *cmdp, size_t len) +static int buslogic_out(unsigned int base, const unsigned char *cmdp, + size_t len) { if (len == 1) { for (;;) { @@ -226,6 +229,8 @@ static int buslogic_out(unsigned int base, const unsigned char *cmdp, size_t len return TRUE; } +/* Only used at boot time, so we do not need to worry about latency as much + here. */ static int buslogic_in(unsigned int base, unsigned char *cmdp, size_t len) { cli(); @@ -242,6 +247,25 @@ static int buslogic_in(unsigned int base, unsigned char *cmdp, size_t len) return TRUE; } +#if 0 +/* Similar to buslogic_in, except that we wait a very short period of time. + We use this if we know the board is alive and awake, but we are not sure + whether the board will respond the the command we are about to send. */ +static int buslogic_in_fast(unsigned int base, unsigned char *cmdp, size_t len) +{ + cli(); + while (len--) { + WAIT_UNTIL_FAST(STATUS(base), DIRRDY); + *cmdp++ = inb(DATA_IN(base)); + } + sti(); + return FALSE; + fail: + sti(); + return TRUE; +} +#endif + static unsigned int makecode(unsigned int hosterr, unsigned int scsierr) { switch (hosterr) { @@ -264,7 +288,7 @@ static unsigned int makecode(unsigned int hosterr, unsigned int scsierr) target. The host adapter will generate a SCSI Reset Condition, notifying the host with a RSTS interrupt. */ - hosterr = DID_RESET; /* ??? Is this right? */ + hosterr = DID_RESET; break; case 0x12: /* Data overrun/underrun: the target attempted to @@ -315,7 +339,7 @@ static unsigned int makecode(unsigned int hosterr, unsigned int scsierr) return (hosterr << 16) | scsierr; } -static int test_port(unsigned int base, struct Scsi_Host *SHpnt) +static int test_port(unsigned int base, struct Scsi_Host *shpnt) { unsigned int i; unsigned char inquiry_cmd[] = { CMD_INQUIRY }; @@ -335,6 +359,9 @@ static int test_port(unsigned int base, struct Scsi_Host *SHpnt) buslogic_printk("test_port called\n"); #endif + /* In case some other card was probing here, reset interrupts. */ + INTR_RESET(base); /* reset interrupts, so they don't block */ + outb(RSOFT | RINT/* | RSBUS*/, CONTROL(base)); /* Wait a little bit for things to settle down. */ @@ -396,50 +423,67 @@ static void buslogic_interrupt(int junk) void (*my_done)(Scsi_Cmnd *) = NULL; int errstatus, mbistatus = 0, number_serviced, found; size_t mbi, mbo = 0; - struct Scsi_Host *SHpnt; - Scsi_Cmnd *SCtmp; - int irqno, base; + struct Scsi_Host *shpnt; + Scsi_Cmnd *sctmp; + int irqno, base, flag; + int needs_restart; struct mailbox *mb; struct ccb *ccb; /* Magic - this -2 is only required for slow interrupt handlers */ irqno = ((int *)junk)[-2]; - SHpnt = host[irqno - 9]; - if (!SHpnt) + shpnt = host[irqno - 9]; + if (!shpnt) panic("buslogic.c: NULL SCSI host entry"); - mb = HOSTDATA(SHpnt)->mb; - ccb = HOSTDATA(SHpnt)->ccbs; - base = SHpnt->io_port; + mb = HOSTDATA(shpnt)->mb; + ccb = HOSTDATA(shpnt)->ccbs; + base = shpnt->io_port; #if BUSLOGIC_DEBUG - { - int flag = inb(INTERRUPT(base)); - - buslogic_printk("buslogic_interrupt: "); - if (!(flag & INTV)) - printk("no interrupt? "); - if (flag & IMBL) - printk("IMBL "); - if (flag & MBOR) - printk("MBOR "); - if (flag & CMDC) - printk("CMDC "); - if (flag & RSTS) - printk("RSTS "); - printk("status %02X\n", inb(STATUS(base))); - } + flag = inb(INTERRUPT(base)); + + buslogic_printk("buslogic_interrupt: "); + if (!(flag & INTV)) + printk("no interrupt? "); + if (flag & IMBL) + printk("IMBL "); + if (flag & MBOR) + printk("MBOR "); + if (flag & CMDC) + printk("CMDC "); + if (flag & RSTS) + printk("RSTS "); + printk("status %02X\n", inb(STATUS(base))); #endif number_serviced = 0; + needs_restart = 0; for (;;) { + flag = inb(INTERRUPT(base)); + + /* Check for unusual interrupts. If any of these happen, we should + probably do something special, but for now just printing a message + is sufficient. A SCSI reset detected is something that we really + need to deal with in some way. */ + if (flag & ~IMBL) { + if (flag & MBOR) + printk("MBOR "); + if (flag & CMDC) + printk("CMDC "); + if (flag & RSTS) { + needs_restart = 1; + printk("RSTS "); + } + } + INTR_RESET(base); cli(); - mbi = HOSTDATA(SHpnt)->last_mbi_used + 1; + mbi = HOSTDATA(shpnt)->last_mbi_used + 1; if (mbi >= 2 * BUSLOGIC_MAILBOXES) mbi = BUSLOGIC_MAILBOXES; @@ -455,22 +499,25 @@ static void buslogic_interrupt(int junk) mbi++; if (mbi >= 2 * BUSLOGIC_MAILBOXES) mbi = BUSLOGIC_MAILBOXES; - } while (mbi != HOSTDATA(SHpnt)->last_mbi_used); + } while (mbi != HOSTDATA(shpnt)->last_mbi_used); if (found) { mbo = (struct ccb *)mb[mbi].ccbptr - ccb; mbistatus = mb[mbi].status; mb[mbi].status = MBX_NOT_IN_USE; - HOSTDATA(SHpnt)->last_mbi_used = mbi; + HOSTDATA(shpnt)->last_mbi_used = mbi; } sti(); if (!found) { /* Hmm, no mail. Must have read it the last time around. */ - if (number_serviced) - return; - buslogic_printk("interrupt received, but no mail\n"); + if (!number_serviced && !needs_restart) + buslogic_printk("interrupt received, but no mail.\n"); + /* We detected a reset. Restart all pending commands for devices + that use the hard reset option. */ + if (needs_restart) + restart(shpnt); return; } @@ -488,16 +535,28 @@ static void buslogic_interrupt(int junk) buslogic_printk("...done %u %u\n", mbo, mbi); #endif - SCtmp = HOSTDATA(SHpnt)->SCint[mbo]; + sctmp = HOSTDATA(shpnt)->sc[mbo]; - if (!SCtmp || !SCtmp->scsi_done) { + if (!sctmp || !sctmp->scsi_done) { buslogic_printk("buslogic_interrupt: Unexpected interrupt\n"); + buslogic_printk("tarstat=%02X, hastat=%02X id=%d lun=%d ccb#=%d\n", + ccb[mbo].tarstat, ccb[mbo].hastat, + ccb[mbo].id, ccb[mbo].lun, mbo); return; } - my_done = SCtmp->scsi_done; - if (SCtmp->host_scribble) - scsi_free(SCtmp->host_scribble, BUSLOGIC_SG_MALLOC); + my_done = sctmp->scsi_done; + if (sctmp->host_scribble) + scsi_free(sctmp->host_scribble, BUSLOGIC_SG_MALLOC); + +#if 0 /* ??? */ + /* Fetch the sense data, and tuck it away, in the required slot. The + BusLogic automatically fetches it, and there is no guarantee that we + will still have it in the cdb when we come back. */ + if (ccb[mbo].tarstat == 2) /* ??? */ + memcpy(sctmp->sense_buffer, &ccb[mbo].cdb[ccb[mbo].cdblen], + sizeof sctmp->sense_buffer); +#endif /* ??? more error checking left out here */ if (mbistatus != 1) @@ -514,9 +573,9 @@ static void buslogic_interrupt(int junk) if (status_byte(ccb[mbo].tarstat) == CHECK_CONDITION) { size_t i; - buslogic_printk("buslogic_interrupt: sense: "); - for (i = 0; i < sizeof SCtmp->sense_buffer; i++) - printk(" %02X", SCtmp->sense_buffer[i]); + buslogic_printk("buslogic_interrupt: sense:"); + for (i = 0; i < sizeof sctmp->sense_buffer; i++) + printk(" %02X", sctmp->sense_buffer[i]); printk("\n"); } @@ -524,45 +583,47 @@ static void buslogic_interrupt(int junk) buslogic_printk("buslogic_interrupt: returning %08X\n", errstatus); #endif - SCtmp->result = errstatus; - HOSTDATA(SHpnt)->SCint[mbo] = NULL; /* This effectively frees up + sctmp->result = errstatus; + HOSTDATA(shpnt)->sc[mbo] = NULL; /* This effectively frees up the mailbox slot, as far as - queuecommand is concerned. */ - my_done(SCtmp); + queuecommand is + concerned. */ + my_done(sctmp); number_serviced++; } } -int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +int buslogic_queuecommand(Scsi_Cmnd *scpnt, void (*done)(Scsi_Cmnd *)) { static const unsigned char buscmd[] = { CMD_START_SCSI }; unsigned char direction; - unsigned char *cmd = (unsigned char *)SCpnt->cmnd; - unsigned char target = SCpnt->target; - unsigned char lun = SCpnt->lun; - void *buff = SCpnt->request_buffer; - int bufflen = SCpnt->request_bufflen; + unsigned char *cmd = (unsigned char *)scpnt->cmnd; + unsigned char target = scpnt->target; + unsigned char lun = scpnt->lun; + void *buff = scpnt->request_buffer; + int bufflen = scpnt->request_bufflen; int mbo; struct mailbox *mb; struct ccb *ccb; #if BUSLOGIC_DEBUG if (target > 1) { - SCpnt->result = DID_TIME_OUT << 16; - done(SCpnt); + scpnt->result = DID_TIME_OUT << 16; + done(scpnt); return 0; } #endif if (*cmd == REQUEST_SENSE) { #ifndef DEBUG - if (bufflen != sizeof SCpnt->sense_buffer) { - buslogic_printk("Wrong buffer length supplied for request sense (%d)\n", + if (bufflen != sizeof scpnt->sense_buffer) { + buslogic_printk("Wrong buffer length supplied for request sense" + " (%d)\n", bufflen); } #endif - SCpnt->result = 0; - done(SCpnt); + scpnt->result = 0; + done(scpnt); return 0; } @@ -570,16 +631,16 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) { int i; - if (*cmd == READ_10 || *cmd == WRITE_10) - i = xscsi2int(cmd + 2); - else if (*cmd == READ_6 || *cmd == WRITE_6) - i = scsi2int(cmd + 2); + if (*cmd == READ_10 || *cmd == WRITE_10 + || *cmd == READ_6 || *cmd == WRITE_6) + i = *(int *)(cmd + 2); else i = -1; - buslogic_printk("buslogic_queuecommand: dev %d cmd %02X pos %d len %d ", + buslogic_printk("buslogic_queuecommand:" + " dev %d cmd %02X pos %d len %d ", target, *cmd, i, bufflen); - buslogic_stat(SCpnt->host->io_port); - buslogic_printk("buslogic_queuecommand: dumping scsi cmd: "); + buslogic_stat(scpnt->host->io_port); + buslogic_printk("buslogic_queuecommand: dumping scsi cmd:"); for (i = 0; i < (COMMAND_SIZE(*cmd)); i++) printk(" %02X", cmd[i]); printk("\n"); @@ -588,38 +649,39 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) } #endif - mb = HOSTDATA(SCpnt->host)->mb; - ccb = HOSTDATA(SCpnt->host)->ccbs; + mb = HOSTDATA(scpnt->host)->mb; + ccb = HOSTDATA(scpnt->host)->ccbs; /* Use the outgoing mailboxes in a round-robin fashion, because this is how the host adapter will scan for them. */ cli(); - mbo = HOSTDATA(SCpnt->host)->last_mbo_used + 1; + mbo = HOSTDATA(scpnt->host)->last_mbo_used + 1; if (mbo >= BUSLOGIC_MAILBOXES) mbo = 0; do { if (mb[mbo].status == MBX_NOT_IN_USE - && HOSTDATA(SCpnt->host)->SCint[mbo] == NULL) + && HOSTDATA(scpnt->host)->sc[mbo] == NULL) break; mbo++; if (mbo >= BUSLOGIC_MAILBOXES) mbo = 0; - } while (mbo != HOSTDATA(SCpnt->host)->last_mbo_used); + } while (mbo != HOSTDATA(scpnt->host)->last_mbo_used); - if (mb[mbo].status != MBX_NOT_IN_USE || HOSTDATA(SCpnt->host)->SCint[mbo]) { - /* ??? Instead of panicing, we should enable OMBR interrupts and - sleep until we get one. */ + if (mb[mbo].status != MBX_NOT_IN_USE + || HOSTDATA(scpnt->host)->sc[mbo]) { + /* ??? Instead of panicing, should we enable OMBR interrupts and + sleep until we get one? */ panic("buslogic.c: unable to find empty mailbox"); } - HOSTDATA(SCpnt->host)->SCint[mbo] = SCpnt; /* This will effectively + HOSTDATA(scpnt->host)->sc[mbo] = scpnt; /* This will effectively prevent someone else from screwing with this cdb. */ - HOSTDATA(SCpnt->host)->last_mbo_used = mbo; + HOSTDATA(scpnt->host)->last_mbo_used = mbo; sti(); @@ -643,33 +705,36 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) memcpy(ccb[mbo].cdb, cmd, ccb[mbo].cdblen); - if (SCpnt->use_sg) { + if (scpnt->use_sg) { struct scatterlist *sgpnt; struct chain *cptr; size_t i; - ccb[mbo].op = CCB_OP_INIT_SG; /* SCSI Initiator Command w/scatter-gather */ - SCpnt->host_scribble = (unsigned char *)scsi_malloc(BUSLOGIC_SG_MALLOC); - if (SCpnt->host_scribble == NULL) + ccb[mbo].op = CCB_OP_INIT_SG; /* SCSI Initiator Command + w/scatter-gather */ + scpnt->host_scribble + = (unsigned char *)scsi_malloc(BUSLOGIC_SG_MALLOC); + if (scpnt->host_scribble == NULL) panic("buslogic.c: unable to allocate DMA memory"); - sgpnt = (struct scatterlist *)SCpnt->request_buffer; - cptr = (struct chain *)SCpnt->host_scribble; - if (SCpnt->use_sg > SCpnt->host->sg_tablesize) { - buslogic_printk("buslogic_queuecommand bad segment list, %d > %d\n", - SCpnt->use_sg, SCpnt->host->sg_tablesize); + sgpnt = (struct scatterlist *)scpnt->request_buffer; + cptr = (struct chain *)scpnt->host_scribble; + if (scpnt->use_sg > scpnt->host->sg_tablesize) { + buslogic_printk("buslogic_queuecommand: bad segment list," + " %d > %d\n", + scpnt->use_sg, scpnt->host->sg_tablesize); panic("buslogic.c: bad segment list"); } - for (i = 0; i < SCpnt->use_sg; i++) { + for (i = 0; i < scpnt->use_sg; i++) { cptr[i].dataptr = sgpnt[i].address; cptr[i].datalen = sgpnt[i].length; } - ccb[mbo].datalen = SCpnt->use_sg * sizeof (struct chain); + ccb[mbo].datalen = scpnt->use_sg * sizeof (struct chain); ccb[mbo].dataptr = cptr; #if BUSLOGIC_DEBUG { unsigned char *ptr; - buslogic_printk("cptr %08X: ", cptr); + buslogic_printk("cptr %08X:", cptr); ptr = (unsigned char *)cptr; for (i = 0; i < 18; i++) printk(" %02X", ptr[i]); @@ -678,15 +743,15 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) #endif } else { ccb[mbo].op = CCB_OP_INIT; /* SCSI Initiator Command */ - SCpnt->host_scribble = NULL; + scpnt->host_scribble = NULL; ccb[mbo].datalen = bufflen; ccb[mbo].dataptr = buff; } ccb[mbo].id = target; ccb[mbo].lun = lun; ccb[mbo].dir = direction; - ccb[mbo].rsalen = sizeof SCpnt->sense_buffer; - ccb[mbo].senseptr = SCpnt->sense_buffer; + ccb[mbo].rsalen = sizeof scpnt->sense_buffer; + ccb[mbo].senseptr = scpnt->sense_buffer; ccb[mbo].linkptr = NULL; ccb[mbo].commlinkid = 0; @@ -695,7 +760,7 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) size_t i; buslogic_printk("buslogic_queuecommand: sending..."); - for (i = 0; i < sizeof ccb[mbo]; i++) + for (i = 0; i < sizeof ccb[mbo] - 10; i++) printk(" %02X", ((unsigned char *)&ccb[mbo])[i]); printk("\n"); } @@ -704,15 +769,14 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) if (done) { #if BUSLOGIC_DEBUG buslogic_printk("buslogic_queuecommand: now waiting for interrupt: "); - buslogic_stat(SCpnt->host->io_port); + buslogic_stat(scpnt->host->io_port); #endif - SCpnt->scsi_done = done; + scpnt->scsi_done = done; mb[mbo].status = MBX_ACTION_START; /* start scsi command */ - buslogic_out(SCpnt->host->io_port, buscmd, sizeof buscmd); + buslogic_out(scpnt->host->io_port, buscmd, sizeof buscmd); #if BUSLOGIC_DEBUG - buslogic_printk("buslogic_queuecommand: status: "); - buslogic_stat(SCpnt->host->io_port); + buslogic_stat(scpnt->host->io_port); #endif } else buslogic_printk("buslogic_queuecommand: done can't be NULL\n"); @@ -721,34 +785,33 @@ int buslogic_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) } #if 0 -static void internal_done(Scsi_Cmnd *SCpnt) +static void internal_done(Scsi_Cmnd *scpnt) { - SCpnt->SCp.Status++; + scpnt->SCp.Status++; } -int buslogic_command(Scsi_Cmnd *SCpnt) +int buslogic_command(Scsi_Cmnd *scpnt) { #if BUSLOGIC_DEBUG buslogic_printk("buslogic_command: ..calling buslogic_queuecommand\n"); #endif - buslogic_queuecommand(SCpnt, internal_done); + buslogic_queuecommand(scpnt, internal_done); - SCpnt->SCp.Status = 0; - while (!SCpnt->SCp.Status) + scpnt->SCp.Status = 0; + while (!scpnt->SCp.Status) continue; - return SCpnt->result; - return internal_done_errcode; + return scpnt->result; } #endif /* Initialize mailboxes. */ -static int setup_mailboxes(unsigned int base, struct Scsi_Host *SHpnt) +static int setup_mailboxes(unsigned int base, struct Scsi_Host *shpnt) { size_t i; int ok = FALSE; /* Innocent until proven guilty... */ - struct mailbox *mb = HOSTDATA(SHpnt)->mb; - struct ccb *ccb = HOSTDATA(SHpnt)->ccbs; + struct mailbox *mb = HOSTDATA(shpnt)->mb; + struct ccb *ccb = HOSTDATA(shpnt)->ccbs; struct { unsigned char cmd, count; void *base PACKED; @@ -777,10 +840,11 @@ static int setup_mailboxes(unsigned int base, struct Scsi_Host *SHpnt) buslogic_printk("buslogic_detect: failed setting up mailboxes\n"); } ok = TRUE; - return ok; must_be_adaptec: INTR_RESET(base); - printk("- must be Adaptec\n"); /* So that the adaptec detect looks clean */ + if (!ok) + printk("- must be Adaptec\n"); /* So that the adaptec detect looks + clean */ return ok; } @@ -822,7 +886,8 @@ static int getconfig(unsigned int base, unsigned char *irq, *irq = 15; break; default: - buslogic_printk("Unable to determine BusLogic IRQ level. Disabling board.\n"); + buslogic_printk("Unable to determine BusLogic IRQ level." + " Disabling board.\n"); return TRUE; } *id = inquiry_result[2] & 0x7; @@ -854,7 +919,7 @@ static int getconfig(unsigned int base, unsigned char *irq, DMA channel). We ignore this. */ if (*bus_type == 'A') switch (*dma) { - case 0: /* This indicates a that no DMA channel is used. */ + case 0: /* This indicates that no DMA channel is used. */ *dma = 0; break; case 0x20: @@ -867,7 +932,8 @@ static int getconfig(unsigned int base, unsigned char *irq, *dma = 7; break; default: - buslogic_printk("Unable to determine BusLogic DMA channel. Disabling board.\n"); + buslogic_printk("Unable to determine BusLogic DMA channel." + " Disabling board.\n"); return TRUE; } else @@ -882,10 +948,18 @@ static int getconfig(unsigned int base, unsigned char *irq, return FALSE; } +static int get_translation(unsigned int base) +{ + /* ??? This is wrong if disk is configured for > 1G mapping. + Unfortunately, unlike UltraStor, I see know way of determining whether + > 1G mapping has been enabled. */ + return BIOS_TRANSLATION_6432; +} + /* Query the board to find out the model. */ static int buslogic_query(unsigned int base, int *trans) { - unsigned const char inquiry_cmd[] = { CMD_INQUIRY }; + static const unsigned char inquiry_cmd[] = { CMD_INQUIRY }; unsigned char inquiry_result[4]; int i; @@ -897,22 +971,25 @@ static int buslogic_query(unsigned int base, int *trans) WAIT_UNTIL(INTERRUPT(base), CMDC); INTR_RESET(base); - buslogic_printk("Inquiry Bytes: %X %X %X %X\n", - inquiry_result[0],inquiry_result[1], - inquiry_result[2],inquiry_result[3]); +#if 1 /* ??? Temporary */ + buslogic_printk("Inquiry Bytes: %02X %02X %02X %02X\n", + inquiry_result[0], inquiry_result[1], + inquiry_result[2], inquiry_result[3]); +#endif + while (0) { fail: buslogic_printk("buslogic_query: query board settings\n"); return TRUE; } - *trans = BIOS_TRANSLATION_6432; /* Default case */ + *trans = get_translation(base); return FALSE; } /* return non-zero on detection */ -int buslogic_detect(Scsi_Host_Template * tpnt) +int buslogic_detect(Scsi_Host_Template *tpnt) { unsigned char dma; unsigned char irq; @@ -921,10 +998,9 @@ int buslogic_detect(Scsi_Host_Template * tpnt) unsigned char bus_type; unsigned short max_sg; int trans; - struct Scsi_Host *SHpnt = NULL; + struct Scsi_Host *shpnt = NULL; int count = 0; int indx; - int val; #if BUSLOGIC_DEBUG buslogic_printk("buslogic_detect:\n"); @@ -932,11 +1008,11 @@ int buslogic_detect(Scsi_Host_Template * tpnt) for (indx = 0; indx < ARRAY_SIZE(bases); indx++) if (!check_region(bases[indx], 3)) { - SHpnt = scsi_register(tpnt, sizeof (struct hostdata)); + shpnt = scsi_register(tpnt, sizeof (struct hostdata)); base = bases[indx]; - if (test_port(base, SHpnt)) + if (test_port(base, shpnt)) goto unregister; /* Set the Bus on/off-times as not to ruin floppy performance. */ @@ -956,7 +1032,8 @@ int buslogic_detect(Scsi_Host_Template * tpnt) WAIT_UNTIL(INTERRUPT(base), CMDC); while (0) { fail: - buslogic_printk("buslogic_detect: setting bus on/off-time failed\n"); + buslogic_printk("buslogic_detect:" + " setting bus on/off-time failed\n"); } INTR_RESET(base); } @@ -972,7 +1049,7 @@ int buslogic_detect(Scsi_Host_Template * tpnt) #endif /* Here is where we tell the men from the boys (i.e. an Adaptec will fail in setup_mailboxes, the men will not :-) */ - if (!setup_mailboxes(base, SHpnt)) + if (!setup_mailboxes(base, shpnt)) goto unregister; printk("Configuring BusLogic %s HA at port 0x%03X, IRQ %u", @@ -993,8 +1070,7 @@ int buslogic_detect(Scsi_Host_Template * tpnt) #endif cli(); - val = request_irq(irq, buslogic_interrupt); - if (val) { + if (request_irq(irq, buslogic_interrupt, 0, "buslogic")) { buslogic_printk("Unable to allocate IRQ for " "BusLogic controller.\n"); sti(); @@ -1016,31 +1092,32 @@ int buslogic_detect(Scsi_Host_Template * tpnt) } } - host[irq - 9] = SHpnt; - SHpnt->this_id = id; + host[irq - 9] = shpnt; + shpnt->this_id = id; #ifdef CONFIG_NO_BUGGY_BUSLOGIC /* Only type 'A' (AT/ISA) bus adapters use unchecked DMA. */ - SHpnt->unchecked_isa_dma = (bus_type == 'A'); + shpnt->unchecked_isa_dma = (bus_type == 'A'); #else - /* bugs in the firmware with 16M+. Gaah */ - SHpnt->unchecked_isa_dma = 1; + /* Bugs in the firmware of the 445S with >16M. This does not seem + to affect Revision E boards with firmware 3.37. */ + shpnt->unchecked_isa_dma = 1; #endif - SHpnt->sg_tablesize = max_sg; - if (SHpnt->sg_tablesize > BUSLOGIC_MAX_SG) - SHpnt->sg_tablesize = BUSLOGIC_MAX_SG; + shpnt->sg_tablesize = max_sg; + if (shpnt->sg_tablesize > BUSLOGIC_MAX_SG) + shpnt->sg_tablesize = BUSLOGIC_MAX_SG; /* ??? If we can dynamically allocate the mailbox arrays, I'll probably bump up this number. */ - SHpnt->hostt->can_queue = BUSLOGIC_MAILBOXES; - /*SHpnt->base = ???;*/ - SHpnt->io_port = base; - SHpnt->dma_channel = dma; - SHpnt->irq = irq; - HOSTDATA(SHpnt)->bios_translation = trans; + shpnt->hostt->can_queue = BUSLOGIC_MAILBOXES; + /*shpnt->base = ???;*/ + shpnt->io_port = base; + shpnt->dma_channel = dma; + shpnt->irq = irq; + HOSTDATA(shpnt)->bios_translation = trans; if (trans == BIOS_TRANSLATION_25563) buslogic_printk("Using extended bios translation.\n"); - HOSTDATA(SHpnt)->last_mbi_used = 2 * BUSLOGIC_MAILBOXES - 1; - HOSTDATA(SHpnt)->last_mbo_used = BUSLOGIC_MAILBOXES - 1; - memset(HOSTDATA(SHpnt)->SCint, 0, sizeof HOSTDATA(SHpnt)->SCint); + HOSTDATA(shpnt)->last_mbi_used = 2 * BUSLOGIC_MAILBOXES - 1; + HOSTDATA(shpnt)->last_mbo_used = BUSLOGIC_MAILBOXES - 1; + memset(HOSTDATA(shpnt)->sc, 0, sizeof HOSTDATA(shpnt)->sc); sti(); #if 0 @@ -1057,9 +1134,9 @@ int buslogic_detect(Scsi_Host_Template * tpnt) buf[i] = 0x87; for (i = 0; i < 2; i++) if (!buslogic_command(i, cmd, buf, sizeof buf)) { - buslogic_printk("bus_detect: LU %u sector_size %d " - "device_size %d\n", - i, xscsi2int(buf + 4), xscsi2int(buf)); + buslogic_printk("buslogic_detect: LU %u " + "sector_size %d device_size %d\n", + i, *(int *)(buf + 4), *(int *)buf); } #if BUSLOGIC_DEBUG @@ -1085,28 +1162,57 @@ int buslogic_detect(Scsi_Host_Template * tpnt) count++; continue; unregister: - scsi_unregister(SHpnt); + scsi_unregister(shpnt); } return count; } +static int restart(struct Scsi_Host *shpnt) +{ + unsigned int i; + unsigned int count = 0; +#if 0 + static const unsigned char buscmd[] = { CMD_START_SCSI }; +#endif + + for (i = 0; i < BUSLOGIC_MAILBOXES; i++) + if (HOSTDATA(shpnt)->sc[i] + && !HOSTDATA(shpnt)->sc[i]->device->soft_reset) { +#if 0 + HOSTDATA(shpnt)->mb[i].status = 1; /* Indicate ready to + restart... */ +#endif + count++; + } + + buslogic_printk("Potential to restart %d stalled commands...\n", count); +#if 0 + /* start scsi command */ + if (count) + buslogic_out(shpnt->host->io_port, buscmd, sizeof buscmd); +#endif + return 0; +} + /* ??? The abort command for the aha1542 does not leave the device in a clean state where it is available to be used again. As it is not clear whether the same problem exists with BusLogic boards, we will enable this and see if it works. */ -int buslogic_abort(Scsi_Cmnd *SCpnt) +int buslogic_abort(Scsi_Cmnd *scpnt) { +#if 1 static const unsigned char buscmd[] = { CMD_START_SCSI }; struct mailbox *mb; - int mbi, mbo, i; + size_t mbi, mbo; + unsigned int i; buslogic_printk("buslogic_abort: %X %X\n", - inb(STATUS(SCpnt->host->io_port)), - inb(INTERRUPT(SCpnt->host->io_port))); + inb(STATUS(scpnt->host->io_port)), + inb(INTERRUPT(scpnt->host->io_port))); cli(); - mb = HOSTDATA(SCpnt->host)->mb; - mbi = HOSTDATA(SCpnt->host)->last_mbi_used + 1; + mb = HOSTDATA(scpnt->host)->mb; + mbi = HOSTDATA(scpnt->host)->last_mbi_used + 1; if (mbi >= 2 * BUSLOGIC_MAILBOXES) mbi = BUSLOGIC_MAILBOXES; @@ -1116,16 +1222,17 @@ int buslogic_abort(Scsi_Cmnd *SCpnt) mbi++; if (mbi >= 2 * BUSLOGIC_MAILBOXES) mbi = BUSLOGIC_MAILBOXES; - } while (mbi != HOSTDATA(SCpnt->host)->last_mbi_used); + } while (mbi != HOSTDATA(scpnt->host)->last_mbi_used); sti(); if (mb[mbi].status != MBX_NOT_IN_USE) { - buslogic_printk("Lost interrupt discovered on irq %d - attempting to recover\n", - SCpnt->host->irq); + buslogic_printk("Lost interrupt discovered on irq %d" + " - attempting to recover\n", + scpnt->host->irq); { int intval[3]; - intval[0] = SCpnt->host->irq; + intval[0] = scpnt->host->irq; buslogic_interrupt((int)&intval[2]); return SCSI_ABORT_SUCCESS; } @@ -1134,18 +1241,19 @@ int buslogic_abort(Scsi_Cmnd *SCpnt) /* OK, no lost interrupt. Try looking to see how many pending commands we think we have. */ for (i = 0; i < BUSLOGIC_MAILBOXES; i++) - if (HOSTDATA(SCpnt->host)->SCint[i]) { - if (HOSTDATA(SCpnt->host)->SCint[i] == SCpnt) { + if (HOSTDATA(scpnt->host)->sc[i]) { + if (HOSTDATA(scpnt->host)->sc[i] == scpnt) { buslogic_printk("Timed out command pending for %4.4X\n", - SCpnt->request.dev); - if (HOSTDATA(SCpnt->host)->mb[i].status != MBX_NOT_IN_USE) { + scpnt->request.dev); + if (HOSTDATA(scpnt->host)->mb[i].status != MBX_NOT_IN_USE) { buslogic_printk("OGMB still full - restarting\n"); - buslogic_out(SCpnt->host->io_port, buscmd, sizeof buscmd); + buslogic_out(scpnt->host->io_port, buscmd, sizeof buscmd); } } else buslogic_printk("Other pending command %4.4X\n", - SCpnt->request.dev); + scpnt->request.dev); } +#endif #if (BUSLOGIC_DEBUG & BD_ABORT) buslogic_printk("buslogic_abort\n"); @@ -1156,37 +1264,86 @@ int buslogic_abort(Scsi_Cmnd *SCpnt) abort a command, and this merely makes it worse. */ cli(); for (mbo = 0; mbo < BUSLOGIC_MAILBOXES; mbo++) - if (SCpnt == HOSTDATA(SCpnt->host)->SCint[mbo]) { - HOSTDATA(SCpnt->host)->mb[mbo].status = MBX_ACTION_ABORT; - buslogic_out(SCpnt->host->io_port, buscmd, sizeof buscmd); + if (scpnt == HOSTDATA(scpnt->host)->sc[mbo]) { + mb[mbo].status = MBX_ACTION_ABORT; + buslogic_out(scpnt->host->io_port, buscmd, sizeof buscmd); break; } sti(); #endif - return SCSI_ABORT_PENDING; + return SCSI_ABORT_SNOOZE; } /* We do not implement a reset function here, but the upper level code assumes - that it will get some kind of response for the command in SCpnt. We must - oblige, or the command will hang the SCSI system. */ -int buslogic_reset(Scsi_Cmnd *SCpnt) + that it will get some kind of response for the command in scpnt. We must + oblige, or the command will hang the SCSI system. For a first go, we assume + that the BusLogic notifies us with all of the pending commands (it does + implement soft reset, after all). */ +int buslogic_reset(Scsi_Cmnd *scpnt) { + static const unsigned char buscmd[] = { CMD_START_SCSI }; + unsigned int i; + #if BUSLOGIC_DEBUG buslogic_printk("buslogic_reset\n"); #endif +#if 0 + /* This does a scsi reset for all devices on the bus. */ + outb(RSBUS, CONTROL(scpnt->host->io_port)); +#else + /* This does a selective reset of just the one device. */ + /* First locate the ccb for this command. */ + for (i = 0; i < BUSLOGIC_MAILBOXES; i++) + if (HOSTDATA(scpnt->host)->sc[i] == scpnt) { + HOSTDATA(scpnt->host)->ccbs[i].op = 0x81; /* ??? BUS DEVICE + RESET */ + + /* Now tell the BusLogic to flush all pending commands for this + target. */ + buslogic_out(scpnt->host->io_port, buscmd, sizeof buscmd); + + /* Here is the tricky part. What to do next. Do we get an + interrupt for the commands that we aborted with the specified + target, or do we generate this on our own? Try it without first + and see what happens. */ + buslogic_printk("Sent BUS DEVICE RESET to target %d\n", + scpnt->target); + + /* If the first does not work, then try the second. I think the + first option is more likely to be correct. Free the command + block for all commands running on this target... */ +#if 1 + for (i = 0; i < BUSLOGIC_MAILBOXES; i++) + if (HOSTDATA(scpnt->host)->sc[i] + && HOSTDATA(scpnt->host)->sc[i]->target == scpnt->target) { + Scsi_Cmnd *sctmp = HOSTDATA(scpnt->host)->sc[i]; + + sctmp->result = DID_RESET << 16; + if (sctmp->host_scribble) + scsi_free(sctmp->host_scribble, BUSLOGIC_SG_MALLOC); + printk("Sending DID_RESET for target %d\n", scpnt->target); + sctmp->scsi_done(scpnt); + + HOSTDATA(scpnt->host)->sc[i] = NULL; + HOSTDATA(scpnt->host)->mb[i].status = MBX_NOT_IN_USE; + } + return SCSI_RESET_SUCCESS; +#else + return SCSI_RESET_PENDING; +#endif + } +#endif + /* No active command at this time, so this means that each time we got some + kind of response the last time through. Tell the mid-level code to + request sense information in order to decide what to do next. */ return SCSI_RESET_PUNT; } -int buslogic_biosparam(Disk * disk, int dev, int *ip) +int buslogic_biosparam(Disk *disk, int dev, int *ip) { - int size = disk->capacity; - int translation_algorithm; - - /* ??? This is wrong if disk is configured for > 1G mapping. - Unfortunately, unlike UltraStor, I see know way of determining whether - > 1G mapping has been enabled. */ - + int size = disk->capacity; + int translation_algorithm; translation_algorithm = HOSTDATA(disk->device->host)->bios_translation; /* ??? Should this be > 1024, or >= 1024? Enquiring minds want to know. */ diff --git a/drivers/scsi/buslogic.h b/drivers/scsi/buslogic.h index c745c19f7c90..af509c3bdb27 100644 --- a/drivers/scsi/buslogic.h +++ b/drivers/scsi/buslogic.h @@ -19,7 +19,7 @@ const char *buslogic_info(void); int buslogic_reset(Scsi_Cmnd *); int buslogic_biosparam(Disk *, int, int *); -#define BUSLOGIC_CMDLUN 1 /* ??? */ +#define BUSLOGIC_CMDLUN 4 /* ??? */ #define BUSLOGIC { NULL, \ "BusLogic", \ diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 8ca2af382934..be882679a858 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -488,7 +488,6 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) { int i, j; int flag = 0; - struct sigaction sa; int retcode; #if DO_DETECT const int buflen = 255; @@ -651,12 +650,7 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) } else { /* Register the IRQ with the kernel */ - sa.sa_handler = fdomain_16x0_intr; - sa.sa_flags = SA_INTERRUPT; - sa.sa_mask = 0; - sa.sa_restorer = NULL; - - retcode = irqaction( interrupt_level, &sa ); + retcode = request_irq( interrupt_level, fdomain_16x0_intr, SA_INTERRUPT, "FDomain"); if (retcode < 0) { if (retcode == -EINVAL) { diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 11e3fd7b6a9a..eea7bbb2c939 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -104,9 +104,6 @@ void generic_NCR5380_setup(char *str, int *ints) { } } -static struct sigaction sa = { generic_NCR5380_intr, 0, - SA_INTERRUPT , NULL }; - /* * Function : int generic_NCR5380_detect(Scsi_Host_Templace * tpnt) * @@ -139,7 +136,7 @@ int generic_NCR5380_detect(Scsi_Host_Template * tpnt) { instance->irq = NCR5380_probe_irq(instance, 0xffff); if (instance->irq != IRQ_NONE) - if (irqaction (instance->irq, &sa)) { + if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380")) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = IRQ_NONE; diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c index b5153e4cd838..a6c63f73a0f4 100644 --- a/drivers/scsi/pas16.c +++ b/drivers/scsi/pas16.c @@ -303,8 +303,6 @@ void pas16_setup(char *str, int *ints) { } } -static struct sigaction pas16_sigaction = { pas16_intr, 0, SA_INTERRUPT , NULL }; - /* * Function : int pas16_detect(Scsi_Host_Template * tpnt) * @@ -368,7 +366,7 @@ int pas16_detect(Scsi_Host_Template * tpnt) { instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS); if (instance->irq != IRQ_NONE) - if (irqaction (instance->irq, &pas16_sigaction)) { + if (request_irq(instance->irq, pas16_intr, SA_INTERRUPT, "pas16")) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = IRQ_NONE; diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 77a5353b2ffe..1ca8746933fd 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -328,7 +328,7 @@ static void scan_scsis (struct Scsi_Host * shpnt) if (!the_result) printk("scsi: INQUIRY successful\n"); else - printk("scsi: INQUIRY failed with code %08x\n"); + printk("scsi: INQUIRY failed with code %08x\n", the_result); #endif if(the_result) break; diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index 043aa2ae323b..a8c67385319f 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c @@ -276,12 +276,6 @@ int seagate_st0x_detect (Scsi_Host_Template * tpnt) #ifndef OVERRIDE int i,j; #endif -static struct sigaction seagate_sigaction = { - &seagate_reconnect_intr, - 0, - SA_INTERRUPT, - NULL -}; /* * First, we try for the manual override. @@ -350,7 +344,7 @@ static struct sigaction seagate_sigaction = { */ instance = scsi_register(tpnt, 0); hostno = instance->host_no; - if (irqaction((int) irq, &seagate_sigaction)) { + if (request_irq((int) irq, seagate_reconnect_intr, SA_INTERRUPT, "seagate")) { printk("scsi%d : unable to allocate IRQ%d\n", hostno, (int) irq); return 0; @@ -1589,7 +1583,7 @@ int seagate_st0x_reset (Scsi_Cmnd * SCpnt) #ifdef DEBUG printk("SCSI bus reset.\n"); #endif - return SCSI_RESET_PENDING; + return SCSI_RESET_WAKEUP; } #include diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c index 4d8eedc1b067..5ad3679f51e1 100644 --- a/drivers/scsi/t128.c +++ b/drivers/scsi/t128.c @@ -178,8 +178,6 @@ void t128_setup(char *str, int *ints) { } } -static struct sigaction t128_sigaction = { t128_intr, 0, SA_INTERRUPT , NULL }; - /* * Function : int t128_detect(Scsi_Host_Template * tpnt) * @@ -239,7 +237,7 @@ int t128_detect(Scsi_Host_Template * tpnt) { instance->irq = NCR5380_probe_irq(instance, T128_IRQS); if (instance->irq != IRQ_NONE) - if (irqaction (instance->irq, &t128_sigaction)) { + if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128")) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = IRQ_NONE; diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 4cd54da61ba5..bb25ba616c57 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -493,7 +493,7 @@ static int ultrastor_14f_detect(Scsi_Host_Template * tpnt) config.mscp_free = ~0; #endif - if (request_irq(config.interrupt, ultrastor_interrupt)) { + if (request_irq(config.interrupt, ultrastor_interrupt, 0, "Ultrastor")) { printk("Unable to allocate IRQ%u for UltraStor controller.\n", config.interrupt); return FALSE; @@ -563,7 +563,7 @@ static int ultrastor_24f_detect(Scsi_Host_Template * tpnt) printk("U24F: invalid IRQ\n"); return FALSE; } - if (request_irq(config.interrupt, ultrastor_interrupt)) + if (request_irq(config.interrupt, ultrastor_interrupt, 0, "Ultrastor")) { printk("Unable to allocate IRQ%u for UltraStor controller.\n", config.interrupt); diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index 7c98636d52e9..1ccaa8b61f19 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c @@ -172,9 +172,8 @@ typedef struct adapter { /* * The following is set up by wd7000_detect, and used thereafter by * wd7000_intr_handle to map the irq level to the corresponding Adapter. - * Note that if request_irq instead of irqaction to allocate the IRQ, - * or if SA_INTERRUPT is not used, wd7000_intr_handle must be changed - * to pick up the IRQ level correctly. + * Note that if SA_INTERRUPT is not used, wd7000_intr_handle must be + * changed to pick up the IRQ level correctly. */ Adapter *irq2host[16] = {NULL}; /* Possible IRQs are 0-15 */ @@ -802,8 +801,8 @@ void wd7000_intr_handle(int irq) { #ifdef 0 /* - * Use irqp as the parm, and the following declaration, if request_irq - * is used or if SA_INTERRUPT is not used. + * Use irqp as the parm, and the following declaration, if + * SA_INTERRUPT is not used. */ register int irq = *(((int *)irqp)-2); #endif @@ -993,7 +992,6 @@ int wd7000_init( Adapter *host ) InitCmd init_cmd = { INITIALIZATION, 7, BUS_ON, BUS_OFF, 0, 0,0,0, OGMB_CNT, ICMB_CNT }; - struct sigaction sa = {wd7000_intr_handle, 0, SA_INTERRUPT, NULL}; int diag; /* @@ -1045,7 +1043,7 @@ int wd7000_init( Adapter *host ) } WAIT(host->iobase+ASC_STAT, ASC_STATMASK, ASC_INIT, 0); - if (irqaction(host->irq, &sa)) { + if (request_irq(host->irq, wd7000_intr_handle, SA_INTERRUPT, "wd7000")) { printk("wd7000_init: can't get IRQ %d.\n", host->irq); return 0; } diff --git a/drivers/sound/soundcard.c b/drivers/sound/soundcard.c index bdacb5235e7e..15eeca8ce56f 100644 --- a/drivers/sound/soundcard.c +++ b/drivers/sound/soundcard.c @@ -219,20 +219,13 @@ snd_set_irq_handler (int interrupt_level, void (*hndlr) (int)) { int retcode; - struct sigaction sa; - - sa.sa_handler = hndlr; - + retcode = request_irq(interrupt_level, &hndlr, #ifdef SND_SA_INTERRUPT - sa.sa_flags = SA_INTERRUPT; + SA_INTERRUPT, #else - sa.sa_flags = 0; + 0, #endif - - sa.sa_mask = 0; - sa.sa_restorer = NULL; - - retcode = irqaction (interrupt_level, &sa); + "sound"); if (retcode < 0) { diff --git a/fs/dcache.c b/fs/dcache.c index 00be726661f9..a40bdf316065 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -194,6 +194,7 @@ void dcache_add(struct inode * dir, const char * name, int len, unsigned long in return; hash = hash_table + hash_fn(dir->i_dev, dir->i_ino, namehash(name,len)); if ((de = find_entry(dir, name, len, hash)) != NULL) { + de->ino = ino; update_lru(de); return; } diff --git a/fs/devices.c b/fs/devices.c index ef24b3bb7a0d..e79ea07d5c9c 100644 --- a/fs/devices.c +++ b/fs/devices.c @@ -64,6 +64,20 @@ struct file_operations * get_chrfops(unsigned int major) int register_chrdev(unsigned int major, const char * name, struct file_operations *fops) { + if (major == 0) { + for (major = MAX_CHRDEV-1; major > 0; major--) { + if (chrdevs[major].fops == fops) + return major; + } + for (major = MAX_CHRDEV-1; major > 0; major--) { + if (chrdevs[major].fops == NULL) { + chrdevs[major].name = name; + chrdevs[major].fops = fops; + return major; + } + } + return -EBUSY; + } if (major >= MAX_CHRDEV) return -EINVAL; if (chrdevs[major].fops && chrdevs[major].fops != fops) @@ -75,6 +89,20 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation int register_blkdev(unsigned int major, const char * name, struct file_operations *fops) { + if (major == 0) { + for (major = MAX_BLKDEV-1; major > 0; major--) { + if (blkdevs[major].fops == fops) + return major; + } + for (major = MAX_BLKDEV-1; major > 0; major--) { + if (blkdevs[major].fops == NULL) { + blkdevs[major].name = name; + blkdevs[major].fops = fops; + return major; + } + } + return -EBUSY; + } if (major >= MAX_BLKDEV) return -EINVAL; if (blkdevs[major].fops && blkdevs[major].fops != fops) diff --git a/fs/ext2/CHANGES b/fs/ext2/CHANGES index 433655ef6a3b..2c37a2f948d6 100644 --- a/fs/ext2/CHANGES +++ b/fs/ext2/CHANGES @@ -26,7 +26,7 @@ Changes from version 0.4a to version 0.4b `grpid', `bsdgroups' `nocheck' `nogrpid', `sysvgroups' - - truncate() now tries to deallocate contigous blocks in a single call + - truncate() now tries to deallocate contiguous blocks in a single call to ext2_free_blocks(). - lots of cosmetic changes. @@ -80,7 +80,7 @@ Changes from version 0.3 to version 0.4 incremented each time the file system is mounted read/write. When this counter becomes bigger than a maximal mount counts (also stored in the super block), e2fsck checks the file system, even if it had - been unmounted cleany, and resets this counter to 0. + been unmounted cleanly, and resets this counter to 0. - File attributes are now supported. One can associate a set of attributes to a file. Three attributes are defined: `c': the file is marked for automatic compression, diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 156cb734d11f..67b10c4b95c2 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -418,7 +418,7 @@ repeat: * the bitmap and then for any free bit. * * Search first in the remainder of the current group; then, - * cyclicly search throught the rest of the groups. + * cyclicly search through the rest of the groups. */ p = ((char *) bh->b_data) + (j >> 3); r = find_first_zero_byte (p, diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 78fc27bc5c64..a2f35d2f4930 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -1014,13 +1014,13 @@ start_up: * ok, that's it */ new_de->inode = old_inode->i_ino; + new_dir->i_version = ++event; dcache_add(new_dir, new_de->name, new_de->name_len, new_de->inode); retval = ext2_delete_entry (old_de, old_bh); if (retval == -ENOENT) goto try_again; if (retval) goto end_rename; - new_dir->i_version = ++event; old_dir->i_version = ++event; if (new_inode) { new_inode->i_nlink--; @@ -1031,6 +1031,7 @@ start_up: old_dir->i_dirt = 1; if (dir_bh) { PARENT_INO(dir_bh->b_data) = new_dir->i_ino; + dcache_add(old_inode, "..", 2, new_dir->i_ino); mark_buffer_dirty(dir_bh, 1); old_dir->i_nlink--; old_dir->i_dirt = 1; diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 9bd3790e1ad6..f5607c4a51fa 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -316,7 +316,7 @@ static int ext2_check_descriptors (struct super_block * sb) if (gdp->bg_block_bitmap < block || gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { - ext2_error (sb, "ext2_check_desciptors", + ext2_error (sb, "ext2_check_descriptors", "Block bitmap for group %d" " not in group (block %lu)!", i, gdp->bg_block_bitmap); @@ -325,7 +325,7 @@ static int ext2_check_descriptors (struct super_block * sb) if (gdp->bg_inode_bitmap < block || gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { - ext2_error (sb, "ext2_check_desciptors", + ext2_error (sb, "ext2_check_descriptors", "Inode bitmap for group %d" " not in group (block %lu)!", i, gdp->bg_inode_bitmap); @@ -335,7 +335,7 @@ static int ext2_check_descriptors (struct super_block * sb) gdp->bg_inode_table + sb->u.ext2_sb.s_itb_per_group >= block + EXT2_BLOCKS_PER_GROUP(sb)) { - ext2_error (sb, "ext2_check_desciptors", + ext2_error (sb, "ext2_check_descriptors", "Inode table for group %d" " not in group (block %lu)!", i, gdp->bg_inode_table); diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h index cfd5ef6cde4f..19c9849a7234 100644 --- a/fs/hpfs/hpfs.h +++ b/fs/hpfs/hpfs.h @@ -119,7 +119,7 @@ struct hpfs_spare_block secno from[n_spares]; secno to[n_spares]; - The to[] list is initalized to point to n_spares preallocated empty + The to[] list is initialized to point to n_spares preallocated empty sectors. The from[] list contains the sector numbers of bad blocks which have been remapped to corresponding sectors in the to[] list. n_spares_used gives the length of the from[] list. */ diff --git a/fs/hpfs/hpfs_fs.c b/fs/hpfs/hpfs_fs.c index d967932078d7..0e33711c642c 100644 --- a/fs/hpfs/hpfs_fs.c +++ b/fs/hpfs/hpfs_fs.c @@ -720,7 +720,7 @@ static void hpfs_put_super(struct super_block *s) /* * statfs. For free inode counts we report the count of dnodes in the - * directory band -- not exactly right but pretty analagous. + * directory band -- not exactly right but pretty analogous. */ static void hpfs_statfs(struct super_block *s, struct statfs *buf) diff --git a/fs/isofs/file.c b/fs/isofs/file.c index 05c680477f33..fe7d6b835309 100644 --- a/fs/isofs/file.c +++ b/fs/isofs/file.c @@ -68,7 +68,7 @@ struct inode_operations isofs_file_inode_operations = { /* This is a heuristic to determine if a file is text of binary. If it * is text, then we translate all 0x0d characters to spaces. If the 0x0d - * character is not preceeded or followed by a 0x0a, then we turn it into + * character is not preceded or followed by a 0x0a, then we turn it into * a 0x0a. A control-Z is also turned into a linefeed. */ diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index dc38d22856e2..8ec650c3367b 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -510,7 +510,7 @@ void isofs_read_inode(struct inode * inode) inode->i_size = 0; inode->i_nlink = 1; inode->i_uid = inode->i_gid = 0; - inode->i_mode = S_IFREG; /*Regular file, noone gets to read*/ + inode->i_mode = S_IFREG; /*Regular file, no one gets to read*/ inode->i_op = NULL; return; } @@ -519,7 +519,7 @@ void isofs_read_inode(struct inode * inode) a particular directory. When control passes through a routine that has access to the parent information, it fills it into the inode structure, but sometimes the inode gets flushed out of the queue, and someone - remmembers the number. When they try to open up again, we have lost + remembers the number. When they try to open up again, we have lost the information. The '..' entry on the disc points to the data area for a particular inode, so we can follow these links back up, but since we do not know the inode number, we do not actually know how large the diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index f1459511db9b..b77ab908dcc7 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -32,7 +32,7 @@ if(rr->u.SP.magic[1] != 0xef) FAIL; /* We define a series of macros because each function must do exactly the - same thing in certain places. We use the macros to ensure that everyting + same thing in certain places. We use the macros to ensure that everything is done correctly */ #define CONTINUE_DECLS \ diff --git a/fs/isofs/rock.h b/fs/isofs/rock.h index 5f1d28e982f5..36057b8fab93 100644 --- a/fs/isofs/rock.h +++ b/fs/isofs/rock.h @@ -1,5 +1,5 @@ /* These structs are used by the system-use-sharing protocol, in which the - Rock Ridge extensions are imbedded. It is quite possible that other + Rock Ridge extensions are embedded. It is quite possible that other extensions are present on the disk, and this is fine as long as they all use SUSP */ diff --git a/fs/msdos/mmap.c b/fs/msdos/mmap.c index 17b97151612b..0e85584e9c91 100644 --- a/fs/msdos/mmap.c +++ b/fs/msdos/mmap.c @@ -39,7 +39,7 @@ static unsigned long msdos_file_mmap_nopage( clear = 0; gap = inode->i_size - pos; if (gap <= 0){ - /* mmaping beyong end of file */ + /* mmaping beyond end of file */ clear = PAGE_SIZE; }else{ int cur_read; diff --git a/fs/nfs/sock.c b/fs/nfs/sock.c index 9f97f62e3a2b..d47635e6fd4a 100644 --- a/fs/nfs/sock.c +++ b/fs/nfs/sock.c @@ -203,7 +203,7 @@ static int do_nfs_rpc_call(struct nfs_server *server, int *start, int *end) * same. * * If they are not the same then a reply to a write request will be - * a small acknowledgement, so even if wsize < rsize we should never + * a small acknowledgment, so even if wsize < rsize we should never * cause data to be written past the end of the buffer (unless some * brain damaged implementation sends out a large write acknowledge). * @@ -218,7 +218,7 @@ static int do_nfs_rpc_call(struct nfs_server *server, int *start, int *end) } /* - * For now we lock out other simulaneous nfs calls for the same filesytem + * For now we lock out other simultaneous nfs calls for the same filesystem * because we are single-threaded and don't want to get mismatched * RPC replies. */ diff --git a/fs/proc/array.c b/fs/proc/array.c index 0b50f6ee3d3a..8d3a222beb53 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -10,7 +10,7 @@ * * Pauline Middelink : Made cmdline,envline only break at '\0's, to * make sure SET_PROCTITLE works. Also removed - * bad '!' which forced addres recalculation for + * bad '!' which forced address recalculation for * EVERY character on the current page. * */ @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -81,6 +82,15 @@ static int read_core(struct inode * inode, struct file * file,char * buf, int co return read; } +static struct file_operations proc_kcore_operations = { + NULL, /* lseek */ + read_core, +}; + +struct inode_operations proc_kcore_inode_operations = { + &proc_kcore_operations, +}; + static int get_loadavg(char * buffer) { int a, b, c; @@ -224,7 +234,7 @@ static int get_array(struct task_struct ** p, unsigned long start, unsigned long } while (addr & ~PAGE_MASK); } ready: - /* remove the trailing blanks, used to fillout argv,envp space */ + /* remove the trailing blanks, used to fill out argv,envp space */ while (result>0 && buffer[result-1]==' ') result--; return result; @@ -452,85 +462,102 @@ extern int get_module_list(char *); extern int get_device_list(char *); extern int get_filesystem_list(char *); extern int get_ksyms_list(char *); +extern int get_irq_list(char *); + +static int get_root_array(char * page, int type) +{ + switch (type) { + case PROC_LOADAVG: + return get_loadavg(page); + + case PROC_UPTIME: + return get_uptime(page); + + case PROC_MEMINFO: + return get_meminfo(page); + + case PROC_VERSION: + return get_version(page); + +#ifdef CONFIG_DEBUG_MALLOC + case PROC_MALLOC: + return get_malloc(page); +#endif + + case PROC_MODULES: + return get_module_list(page); + + case PROC_STAT: + return get_kstat(page); + + case PROC_DEVICES: + return get_device_list(page); + + case PROC_INTERRUPTS: + return get_irq_list(page); + + case PROC_FILESYSTEMS: + return get_filesystem_list(page); + + case PROC_KSYMS: + return get_ksyms_list(page); + } + return -EBADF; +} + +static int get_process_array(char * page, int pid, int type) +{ + switch (type) { + case PROC_PID_ENVIRON: + return get_env(pid, page); + case PROC_PID_CMDLINE: + return get_arg(pid, page); + case PROC_PID_STAT: + return get_stat(pid, page); + case PROC_PID_STATM: + return get_statm(pid, page); + case PROC_PID_MAPS: + return get_maps(pid, page); + } + return -EBADF; +} + + +static inline int fill_array(char * page, int pid, int type) +{ + if (pid) + return get_process_array(page, pid, type); + return get_root_array(page, type); +} static int array_read(struct inode * inode, struct file * file,char * buf, int count) { - char * page; + unsigned long page; int length; int end; unsigned int type, pid; if (count < 0) return -EINVAL; - if (!(page = (char*) __get_free_page(GFP_KERNEL))) + if (!(page = __get_free_page(GFP_KERNEL))) return -ENOMEM; type = inode->i_ino; pid = type >> 16; type &= 0x0000ffff; - switch (type) { - case 2: - length = get_loadavg(page); - break; - case 3: - length = get_uptime(page); - break; - case 4: - length = get_meminfo(page); - break; - case 6: - length = get_version(page); - break; - case 9: - length = get_env(pid, page); - break; - case 10: - length = get_arg(pid, page); - break; - case 11: - length = get_stat(pid, page); - break; - case 12: - length = get_statm(pid, page); - break; -#ifdef CONFIG_DEBUG_MALLOC - case 13: - length = get_malloc(page); - break; -#endif - case 14: - free_page((unsigned long) page); - return read_core(inode, file, buf, count); - case 15: - length = get_maps(pid, page); - break; - case 16: - length = get_module_list(page); - break; - case 17: - length = get_kstat(page); - break; - case 18: - length = get_device_list(page); - break; - case 19: - length = get_filesystem_list(page); - break; - case 20: - length = get_ksyms_list(page); - break; - default: - free_page((unsigned long) page); - return -EBADF; + length = fill_array((char *) page, pid, type); + if (length < 0) { + free_page(page); + return length; } if (file->f_pos >= length) { - free_page((unsigned long) page); + free_page(page); return 0; } if (count + file->f_pos > length) count = length - file->f_pos; end = count + file->f_pos; - memcpy_tofs(buf, page + file->f_pos, count); - free_page((unsigned long) page); + memcpy_tofs(buf, (char *) page + file->f_pos, count); + free_page(page); file->f_pos = end; return count; } diff --git a/fs/proc/base.c b/fs/proc/base.c index 80e010964918..2ca380a254b5 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -51,18 +51,18 @@ struct inode_operations proc_base_inode_operations = { }; static struct proc_dir_entry base_dir[] = { - { 1,2,".." }, - { 2,1,"." }, - { 3,3,"mem" }, - { 4,3,"cwd" }, - { 5,4,"root" }, - { 6,3,"exe" }, - { 7,2,"fd" }, - { 9,7,"environ" }, - { 10,7,"cmdline" }, - { 11,4,"stat" }, - { 12,5,"statm" }, - { 15,4,"maps" } + { PROC_PID_INO, 1, "." }, + { PROC_ROOT_INO, 2, ".." }, + { PROC_PID_MEM, 3, "mem" }, + { PROC_PID_CWD, 3, "cwd" }, + { PROC_PID_ROOT, 4, "root" }, + { PROC_PID_EXE, 3, "exe" }, + { PROC_PID_FD, 2, "fd" }, + { PROC_PID_ENVIRON, 7, "environ" }, + { PROC_PID_CMDLINE, 7, "cmdline" }, + { PROC_PID_STAT, 4, "stat" }, + { PROC_PID_STATM, 5, "statm" }, + { PROC_PID_MAPS, 4, "maps" } }; #define NR_BASE_DIRENTRY ((sizeof (base_dir))/(sizeof (base_dir[0]))) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 60c9db962c12..1e7536537f3d 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -103,25 +103,28 @@ void proc_read_inode(struct inode * inode) inode->i_op = &proc_root_inode_operations; return; } - if ((ino >= 128) && (ino <= 160)) { /* files within /proc/net */ + + /* files within /proc/net */ + if ((ino >= PROC_NET_UNIX) && (ino < PROC_NET_LAST)) { inode->i_mode = S_IFREG | S_IRUGO; inode->i_op = &proc_net_inode_operations; return; } + if (!pid) { switch (ino) { - case 5: + case PROC_KMSG: inode->i_mode = S_IFREG | S_IRUGO; inode->i_op = &proc_kmsg_inode_operations; break; - case 8: /* for the net directory */ + case PROC_NET: inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; inode->i_nlink = 2; inode->i_op = &proc_net_inode_operations; break; - case 14: + case PROC_KCORE: inode->i_mode = S_IFREG | S_IRUSR; - inode->i_op = &proc_array_inode_operations; + inode->i_op = &proc_kcore_inode_operations; inode->i_size = high_memory + PAGE_SIZE; break; default: @@ -135,38 +138,38 @@ void proc_read_inode(struct inode * inode) inode->i_uid = p->euid; inode->i_gid = p->egid; switch (ino) { - case 2: + case PROC_PID_INO: inode->i_nlink = 4; inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; inode->i_op = &proc_base_inode_operations; return; - case 3: + case PROC_PID_MEM: inode->i_op = &proc_mem_inode_operations; inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR; return; - case 4: - case 5: - case 6: + case PROC_PID_CWD: + case PROC_PID_ROOT: + case PROC_PID_EXE: inode->i_op = &proc_link_inode_operations; inode->i_size = 64; inode->i_mode = S_IFLNK | S_IRWXU; return; - case 7: + case PROC_PID_FD: inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR; inode->i_op = &proc_fd_inode_operations; inode->i_nlink = 2; return; - case 9: - case 10: - case 11: - case 12: - case 15: + case PROC_PID_ENVIRON: + case PROC_PID_CMDLINE: + case PROC_PID_STAT: + case PROC_PID_STATM: + case PROC_PID_MAPS: inode->i_mode = S_IFREG | S_IRUGO; inode->i_op = &proc_array_inode_operations; return; } switch (ino >> 8) { - case 1: + case PROC_PID_FD_DIR: ino &= 0xff; if (ino >= NR_OPEN || !p->files->fd[ino]) return; @@ -174,21 +177,6 @@ void proc_read_inode(struct inode * inode) inode->i_size = 64; inode->i_mode = S_IFLNK | S_IRWXU; return; - case 2: - ino &= 0xff; - { - int j = 0; - struct vm_area_struct * mpnt; - for (mpnt = p->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) - if(mpnt->vm_inode) - j++; - if (ino >= j) - return; - } - inode->i_op = &proc_link_inode_operations; - inode->i_size = 64; - inode->i_mode = S_IFLNK | S_IRWXU; - return; } return; } diff --git a/fs/proc/link.c b/fs/proc/link.c index b1eb8e8db040..d173cb075f57 100644 --- a/fs/proc/link.c +++ b/fs/proc/link.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include static int proc_readlink(struct inode *, char *, int); @@ -65,13 +65,13 @@ static int proc_follow_link(struct inode * dir, struct inode * inode, return -ENOENT; inode = NULL; switch (ino) { - case 4: + case PROC_PID_CWD: inode = p->fs->pwd; break; - case 5: + case PROC_PID_ROOT: inode = p->fs->root; break; - case 6: { + case PROC_PID_EXE: { struct vm_area_struct * vma = p->mm->mmap; while (vma) { if (vma->vm_flags & VM_EXECUTABLE) { @@ -84,26 +84,11 @@ static int proc_follow_link(struct inode * dir, struct inode * inode, } default: switch (ino >> 8) { - case 1: + case PROC_PID_FD_DIR: ino &= 0xff; if (ino < NR_OPEN && p->files->fd[ino]) inode = p->files->fd[ino]->f_inode; break; - case 2: - ino &= 0xff; - { int j = ino; - struct vm_area_struct * mpnt; - for(mpnt = p->mm->mmap; mpnt && j >= 0; - mpnt = mpnt->vm_next){ - if(mpnt->vm_inode) { - if(j == 0) { - inode = mpnt->vm_inode; - break; - }; - j--; - } - } - }; } } if (!inode) diff --git a/fs/proc/mem.c b/fs/proc/mem.c index 28fd4be8cbf9..f386ee78e288 100644 --- a/fs/proc/mem.c +++ b/fs/proc/mem.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include @@ -138,6 +140,94 @@ static int mem_lseek(struct inode * inode, struct file * file, off_t offset, int } } +int +mem_mmap(struct inode * inode, struct file * file, + struct vm_area_struct * vma) +{ + unsigned long *src_table, *dest_table, stmp, dtmp, cr3; + struct vm_area_struct *src_vma = 0; + int i; + + /* Get the source's task information */ + + cr3 = 0; + for (i = 1 ; i < NR_TASKS ; i++) + if (task[i] && task[i]->pid == (inode->i_ino >> 16)) { + cr3 = task[i]->tss.cr3; + src_vma = task[i]->mm->mmap; + break; + } + + if (!cr3) + return -EACCES; + +/* Ensure that we have a valid source area. (Has to be mmap'ed and + have valid page information.) We can't map shared memory at the + moment because working out the vm_area_struct & nattach stuff isn't + worth it. */ + + stmp = vma->vm_offset; + while (stmp < vma->vm_offset + (vma->vm_end - vma->vm_start)) { + while (src_vma && stmp > src_vma->vm_end) + src_vma = src_vma->vm_next; + if (!src_vma || (src_vma->vm_flags & VM_SHM)) + return -EINVAL; + + src_table = PAGE_DIR_OFFSET(cr3, stmp); + if (!*src_table) + return -EINVAL; + src_table = (unsigned long *)((*src_table & PAGE_MASK) + PAGE_PTR(stmp)); + if (!*src_table) + return -EINVAL; + + if (stmp < src_vma->vm_start) { + if (!(src_vma->vm_flags & VM_GROWSDOWN)) + return -EINVAL; + if (src_vma->vm_end - stmp > current->rlim[RLIMIT_STACK].rlim_cur) + return -EINVAL; + } + stmp += PAGE_SIZE; + } + + src_vma = task[i]->mm->mmap; + stmp = vma->vm_offset; + dtmp = vma->vm_start; + + while (dtmp < vma->vm_end) { + while (src_vma && stmp > src_vma->vm_end) + src_vma = src_vma->vm_next; + + src_table = PAGE_DIR_OFFSET(cr3, stmp); + src_table = (unsigned long *)((*src_table & PAGE_MASK) + PAGE_PTR(stmp)); + + dest_table = PAGE_DIR_OFFSET(current->tss.cr3, dtmp); + + if (!*dest_table) { + *dest_table = get_free_page(GFP_KERNEL); + if (!*dest_table) { oom(current); *dest_table=BAD_PAGE; } + else *dest_table |= PAGE_TABLE; + } + + dest_table = (unsigned long *)((*dest_table & PAGE_MASK) + PAGE_PTR(dtmp)); + + if (!(*src_table & PAGE_PRESENT)) + do_no_page(src_vma, stmp, PAGE_PRESENT); + + if ((vma->vm_flags & VM_WRITE) && !(*src_table & PAGE_RW)) + do_wp_page(src_vma, stmp, PAGE_RW | PAGE_PRESENT); + + *src_table |= PAGE_DIRTY; + *dest_table = *src_table; + mem_map[MAP_NR(*src_table)]++; + + stmp += PAGE_SIZE; + dtmp += PAGE_SIZE; + } + + invalidate(); + return 0; +} + static struct file_operations proc_mem_operations = { mem_lseek, mem_read, @@ -145,7 +235,7 @@ static struct file_operations proc_mem_operations = { NULL, /* mem_readdir */ NULL, /* mem_select */ NULL, /* mem_ioctl */ - NULL, /* mmap */ + mem_mmap, /* mmap */ NULL, /* no special open code */ NULL, /* no special release code */ NULL /* can't fsync */ diff --git a/fs/proc/net.c b/fs/proc/net.c index 4d6bfea03b01..601f590d3e32 100644 --- a/fs/proc/net.c +++ b/fs/proc/net.c @@ -101,44 +101,43 @@ struct inode_operations proc_net_inode_operations = { }; static struct proc_dir_entry net_dir[] = { - { 1,2,".." }, - { 8,1,"." }, - { 128,4,"unix" } + { PROC_NET, 1, "." }, + { PROC_ROOT_INO, 2, ".." }, + { PROC_NET_UNIX, 4, "unix" }, #ifdef CONFIG_INET - ,{ 129,3,"arp" }, - { 130,5,"route" }, - { 131,3,"dev" }, - { 132,3,"raw" }, - { 133,3,"tcp" }, - { 134,3,"udp" }, - { 135,4,"snmp" } + { PROC_NET_ARP, 3, "arp" }, + { PROC_NET_ROUTE, 5, "route" }, + { PROC_NET_DEV, 3, "dev" }, + { PROC_NET_RAW, 3, "raw" }, + { PROC_NET_TCP, 3, "tcp" }, + { PROC_NET_UDP, 3, "udp" }, + { PROC_NET_SNMP, 4, "snmp" }, #ifdef CONFIG_INET_RARP - ,{ 136,4,"rarp"} + { PROC_NET_RARP, 4, "rarp"}, #endif #endif /* CONFIG_INET */ #ifdef CONFIG_IPX - ,{ 137,9,"ipx_route" }, - { 138,3,"ipx" } + { PROC_NET_IPX_ROUTE, 9, "ipx_route" }, + { PROC_NET_IPX, 3, "ipx" }, #endif /* CONFIG_IPX */ #ifdef CONFIG_AX25 - ,{ 139,10,"ax25_route" }, - { 140,4,"ax25" } + { PROC_NET_AX25_ROUTE, 10, "ax25_route" }, + { PROC_NET_AX25, 4, "ax25" }, #ifdef CONFIG_NETROM - ,{ 141,8,"nr_nodes" }, - { 142,8,"nr_neigh" }, - { 143,2,"nr" } + { PROC_NET_NR_NODES, 8, "nr_nodes" }, + { PROC_NET_NR_NEIGH, 8, "nr_neigh" }, + { PROC_NET_NR, 2, "nr" }, #endif /* CONFIG_NETROM */ #endif /* CONFIG_AX25 */ + { 0, 0, NULL } }; -#define NR_NET_DIRENTRY ((sizeof (net_dir))/(sizeof (net_dir[0]))) - +#define NR_NET_DIRENTRY ((sizeof (net_dir))/(sizeof (net_dir[0])) - 1) static int proc_lookupnet(struct inode * dir,const char * name, int len, struct inode ** result) { - unsigned int ino; - int i; + struct proc_dir_entry *de; *result = NULL; if (!dir) @@ -147,20 +146,16 @@ static int proc_lookupnet(struct inode * dir,const char * name, int len, iput(dir); return -ENOENT; } - i = NR_NET_DIRENTRY; - while (i-- > 0 && !proc_match(len,name,net_dir+i)) - /* nothing */; - if (i < 0) { + for (de = net_dir ; de->name ; de++) { + if (!proc_match(len, name, de)) + continue; + *result = iget(dir->i_sb, de->low_ino); iput(dir); - return -ENOENT; + if (!*result) + return -ENOENT; + return 0; } - ino = net_dir[i].low_ino; - if (!(*result = iget(dir->i_sb,ino))) { - iput(dir); - return -ENOENT; - } - iput(dir); - return 0; + return -ENOENT; } static int proc_readnetdir(struct inode * inode, struct file * filp, @@ -217,60 +212,60 @@ static int proc_readnet(struct inode * inode, struct file * file, switch (ino) { - case 128: + case PROC_NET_UNIX: length = unix_get_info(page,&start,file->f_pos,thistime); break; #ifdef CONFIG_INET - case 129: + case PROC_NET_ARP: length = arp_get_info(page,&start,file->f_pos,thistime); break; - case 130: + case PROC_NET_ROUTE: length = rt_get_info(page,&start,file->f_pos,thistime); break; - case 131: + case PROC_NET_DEV: length = dev_get_info(page,&start,file->f_pos,thistime); break; - case 132: + case PROC_NET_RAW: length = raw_get_info(page,&start,file->f_pos,thistime); break; - case 133: + case PROC_NET_TCP: length = tcp_get_info(page,&start,file->f_pos,thistime); break; - case 134: + case PROC_NET_UDP: length = udp_get_info(page,&start,file->f_pos,thistime); break; - case 135: + case PROC_NET_SNMP: length = snmp_get_info(page, &start, file->f_pos,thistime); break; #ifdef CONFIG_INET_RARP - case 136: + case PROC_NET_RARP: length = rarp_get_info(page,&start,file->f_pos,thistime); break; #endif /* CONFIG_INET_RARP */ #endif /* CONFIG_INET */ #ifdef CONFIG_IPX - case 137: + case PROC_NET_IPX_ROUTE: length = ipx_rt_get_info(page,&start,file->f_pos,thistime); break; - case 138: + case PROC_NET_IPX: length = ipx_get_info(page,&start,file->f_pos,thistime); break; #endif /* CONFIG_IPX */ #ifdef CONFIG_AX25 - case 139: + case PROC_NET_AX25_ROUTE: length = ax25_rt_get_info(page,&start,file->f_pos,thistime); break; - case 140: + case PROC_NET_AX25: length = ax25_get_info(page,&start,file->f_pos,thistime); break; #ifdef CONFIG_NETROM - case 141: + case PROC_NET_NR_NODES: length = nr_nodes_get_info(page,&start,file->f_pos,thistime); break; - case 142: + case PROC_NET_NR_NEIGH: length = nr_neigh_get_info(page,&start,file->f_pos,thistime); break; - case 143: + case PROC_NET_NR: length = nr_get_info(page,&start,file->f_pos,thistime); break; #endif /* CONFIG_NETROM */ diff --git a/fs/proc/root.c b/fs/proc/root.c index 7da96da93bb2..69156c034e76 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -52,24 +52,25 @@ struct inode_operations proc_root_inode_operations = { }; static struct proc_dir_entry root_dir[] = { - { 1,1,"." }, - { 1,2,".." }, - { 2,7,"loadavg" }, - { 3,6,"uptime" }, - { 4,7,"meminfo" }, - { 5,4,"kmsg" }, - { 6,7,"version" }, - { 7,4,"self" }, /* will change inode # */ - { 8,3,"net" }, + { PROC_ROOT_INO, 1, "." }, + { PROC_ROOT_INO, 2, ".." }, + { PROC_LOADAVG, 7, "loadavg" }, + { PROC_UPTIME, 6, "uptime" }, + { PROC_MEMINFO, 7, "meminfo" }, + { PROC_KMSG, 4, "kmsg" }, + { PROC_VERSION, 7, "version" }, + { PROC_SELF, 4, "self" }, /* will change inode # */ + { PROC_NET, 3, "net" }, #ifdef CONFIG_DEBUG_MALLOC - {13,6,"malloc" }, + { PROC_MALLOC, 6, "malloc" }, #endif - {14,5,"kcore" }, - {16,7,"modules" }, - {17,4,"stat" }, - {18,7,"devices" }, - {19,11,"filesystems" }, - {20,5,"ksyms" }, + { PROC_KCORE, 5, "kcore" }, + { PROC_MODULES, 7, "modules" }, + { PROC_STAT, 4, "stat" }, + { PROC_DEVICES, 7, "devices" }, + { PROC_INTERRUPTS, 10,"interrupts" }, + { PROC_FILESYSTEMS, 11,"filesystems" }, + { PROC_KSYMS, 5, "ksyms" }, }; #define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0]))) diff --git a/fs/sysv/truncate.c b/fs/sysv/truncate.c index b8f802af8277..10cac967a19b 100644 --- a/fs/sysv/truncate.c +++ b/fs/sysv/truncate.c @@ -18,7 +18,7 @@ /* There are two different implementations of truncate() here. - * One (by Bruno) needs to do locking to ensure that noone is writing + * One (by Bruno) needs to do locking to ensure that no one is writing * to a block being truncated away and incorporated into the free list. * The better one (by Linus) doesn't need locking because it can tell from * looking at bh->b_count whether a given block is in use elsewhere. diff --git a/fs/umsdos/README b/fs/umsdos/README index 20d690976ae0..4ce8b414822a 100644 --- a/fs/umsdos/README +++ b/fs/umsdos/README @@ -9,7 +9,7 @@ one into a useful one. It gives you: long file name - Permisssions and owner + Permissions and owner Links Special files (devices, pipe...) All is need to be a linux root fs. @@ -37,7 +37,7 @@ happen. This is why all mount options are passed to the Msdos fs driver. Umsdos use a special DOS file --linux-.--- to store the information which can't be handle by the normal MsDOS file system. This is the trick. ---linux-.--- is optionnal. There is one per directory. +--linux-.--- is optional. There is one per directory. **** If --linux-.--- is missing, then Umsdos process the directory the same way the msdos driver do. Short file name, no goodies, default diff --git a/fs/umsdos/dir.c b/fs/umsdos/dir.c index 8bd2e0e82b38..a1b4d2bfd09c 100644 --- a/fs/umsdos/dir.c +++ b/fs/umsdos/dir.c @@ -47,7 +47,7 @@ static int umsdos_readdir_x( struct dirent *dirent, /* Will hold count directory entry */ int dirent_in_fs, /* dirent point in user's space ? */ int count, - struct umsdos_dirent *u_entry, /* Optionnal umsdos entry */ + struct umsdos_dirent *u_entry, /* Optional umsdos entry */ int follow_hlink, off_t *pt_f_pos) /* will hold the offset of the entry in EMD */ { @@ -272,7 +272,7 @@ void umsdos_lookup_patch ( /* A lookup of a mount point directory yield the inode into the other fs, so we don't care about initialising it. iget() - does this automaticly. + does this automatically. */ if (inode->i_sb == dir->i_sb && !umsdos_isinit(inode)){ if (S_ISDIR(inode->i_mode)) umsdos_lockcreate(inode); @@ -583,7 +583,7 @@ static int umsdos_lookup_x ( */ /* This has to be allowed for resolving hard link - which are recorded independantly of the pseudo-root + which are recorded independently of the pseudo-root mode. */ iput (pseudo_root); diff --git a/fs/umsdos/emd.c b/fs/umsdos/emd.c index c0e98031c7f4..2c5652e44206 100644 --- a/fs/umsdos/emd.c +++ b/fs/umsdos/emd.c @@ -82,7 +82,7 @@ int umsdos_emd_dir_write ( /* Read a block of bytes from one EMD file. The block of data is NOT in user space. - Retourne 0 if ok, -EIO if any error. + Return 0 if ok, -EIO if any error. */ int umsdos_emd_dir_read ( struct inode *emd_dir, @@ -102,7 +102,7 @@ int umsdos_emd_dir_read ( } /* - Locate the EMD file in a directory and optionnally, creates it. + Locate the EMD file in a directory and optionally, creates it. Return NULL if error. If ok, dir->u.umsdos_i.emd_inode */ @@ -180,7 +180,7 @@ int umsdos_writeentry ( /* #Specification: EMD file / empty entries Unused entry in the EMD file are identify by the name_len field equal to 0. However to - help future extension (or bug corretion :-( ), + help future extension (or bug correction :-( ), empty entries are filled with 0. */ memset (&entry0,0,sizeof(entry0)); @@ -219,7 +219,7 @@ struct find_buffer{ Fill the read buffer and take care of the byte remaining inside. Unread bytes are simply move to the beginning. - Return -ENOENT if EOF, 0 if ok, a negativ error code if any problem. + Return -ENOENT if EOF, 0 if ok, a negative error code if any problem. */ static int umsdos_fillbuf ( struct inode *inode, diff --git a/fs/umsdos/file.c b/fs/umsdos/file.c index 3836c43ff424..8d97bd6884db 100644 --- a/fs/umsdos/file.c +++ b/fs/umsdos/file.c @@ -2,7 +2,7 @@ * linux/fs/umsdos/file.c * * Written 1993 by Jacques Gelinas - * inpired from linux/fs/msdos/file.c Werner Almesberger + * inspired from linux/fs/msdos/file.c Werner Almesberger * * Extended MS-DOS regular file handling primitives */ @@ -61,10 +61,10 @@ static void UMSDOS_truncate(struct inode *inode) /* See inode.c - Some entry point are filled dynamicly with function pointers + Some entry point are filled dynamically with function pointers from the msdos file_operations and file_inode_operations. - The idea is to have the code as independant as possible from + The idea is to have the code as independent as possible from the msdos file system. */ diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c index 566539e73dc2..c813d4107c19 100644 --- a/fs/umsdos/inode.c +++ b/fs/umsdos/inode.c @@ -59,7 +59,7 @@ void UMSDOS_statfs(struct super_block *sb,struct statfs *buf) /* Call msdos_lookup, but set back the original msdos function table. - Retourne 0 if ok, or a negative error code if not. + Return 0 if ok, or a negative error code if not. */ int umsdos_real_lookup ( struct inode *dir, @@ -106,7 +106,7 @@ void umsdos_set_dirinfo( } /* Tells if an Umsdos inode has been "patched" once. - Returne != 0 if so. + Return != 0 if so. */ int umsdos_isinit (struct inode *inode) { @@ -134,7 +134,7 @@ void umsdos_patch_inode ( will be done when dir != NULL only. UMSDOS do run piggy back on top of msdos fs. It looks like something - is missing in the VFS to accomodate stacked fs. Still unclear what + is missing in the VFS to accommodate stacked fs. Still unclear what (quite honestly). Well, maybe one! A new entry "may_unmount" which would allow @@ -149,7 +149,7 @@ void umsdos_patch_inode ( if (!is_init){ /* I don't want to change the msdos file system code - so I get the adress of some subroutine dynamicly + so I get the address of some subroutine dynamically once. */ umsdos_file_inode_operations.bmap = inode->i_op->bmap; @@ -237,7 +237,7 @@ void UMSDOS_read_inode(struct inode *inode) ,inode->u.umsdos_i.u.dir_info.p)); } /* #Specification: Inode / post initialisation - To completly initialise an inode, we need access to the owner + To completely initialise an inode, we need access to the owner directory, so we can locate more info in the EMD file. This is not available the first time the inode is access, we use a value in the inode to tell if it has been finally initialised. @@ -381,7 +381,7 @@ struct super_block *UMSDOS_read_super( Umsdos run on top of msdos. Currently, it supports no mount option, but happily pass all option received to the msdos driver. I am not sure if all msdos mount option - make sens with Umsdos. Here are at least those who + make sense with Umsdos. Here are at least those who are useful. uid= gid= diff --git a/fs/umsdos/ioctl.c b/fs/umsdos/ioctl.c index 2bf5eb1c2108..972571796444 100644 --- a/fs/umsdos/ioctl.c +++ b/fs/umsdos/ioctl.c @@ -50,8 +50,8 @@ int UMSDOS_ioctl_dir ( all this. These ioctl generally allow one to work on the EMD or the - DOS directory independantly. These are essential to implement - the synchroniser. + DOS directory independently. These are essential to implement + the synchronise. */ PRINTK (("ioctl %d ",cmd)); if (cmd == UMSDOS_GETVERSION){ @@ -237,7 +237,7 @@ int UMSDOS_ioctl_dir ( Be aware that this apply ONLY to MsDOS directory (those without EMD --linux-.---). Umsdos directory - have independant (standard) permission for each + have independent (standard) permission for each and every file. The field umsdos_dirent provide the information needed. diff --git a/fs/umsdos/mangle.c b/fs/umsdos/mangle.c index 7b7dba7dba14..1f59447e94b1 100644 --- a/fs/umsdos/mangle.c +++ b/fs/umsdos/mangle.c @@ -54,7 +54,7 @@ void umsdos_manglename (struct umsdos_info *info) -The mangling is deterministic. Just by the extension, we are able to locate the entry in the EMD file. - -By keeping to beginning of the file name almost unchange, + -By keeping to beginning of the file name almost unchanged, we are helping the MSDOS user. -The mangling produces names not too ugly, so an msdos user @@ -146,7 +146,7 @@ int umsdos_parse ( const char *firstpt=NULL; /* First place we saw a . in fname */ /* #Specification: file name / non MSDOS conforming / base length 0 file name beginning with a period '.' are invalid for MsDOS. - It needs absolutly a base name. So the file name is mangled + It needs absolutely a base name. So the file name is mangled */ int ivldchar = fname[0] == '.';/* At least one invalid character */ int msdos_len = len; @@ -183,7 +183,7 @@ int umsdos_parse ( while (*spc != '\0') lkp[(unsigned char)(*spc++)] = '#'; } /* GLU - file name wich are longer than 8+'.'+3 are invalid for MsDOS. + file name which are longer than 8+'.'+3 are invalid for MsDOS. So the file name is to be mangled no more test needed. This Speed Up for long and very long name. The position of the last point is no more necessary anyway. @@ -280,7 +280,7 @@ int umsdos_parse ( base_len = msdos_len = (msdos_len>8) ? 8 : msdos_len; /* There is no '.' any more so we know for a fact that - the base lenght is the lenght. + the base length is the length. */ memcpy (info->fake.fname,fname,msdos_len); for (i=0; i