diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 08:16:23 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 08:16:23 +0000 |
commit | c86f0c7a71e7ade3e38b325c186a9cf374e0411e (patch) | |
tree | 176f04f674860c7cfae9ac5d2ff4d4e1d73cb2b7 | |
parent | 423ba8f9bc23d93bfc244aca9b12563b1c9de90d (diff) | |
download | FreeBSD-src-c86f0c7a71e7ade3e38b325c186a9cf374e0411e.zip FreeBSD-src-c86f0c7a71e7ade3e38b325c186a9cf374e0411e.tar.gz |
Remove trailing whitespace.
706 files changed, 9196 insertions, 9177 deletions
diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h index 4f6ecca..870c5de 100644 --- a/sys/alpha/include/console.h +++ b/sys/alpha/include/console.h @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: console.h,v 1.15 1995/01/20 08:35:18 sos Exp $ + * $Id: console.h,v 1.18 1995/01/28 22:15:30 sos Exp $ */ #ifndef _CONSOLE_H_ @@ -47,7 +47,7 @@ #define KIOCSOUND _IO('K', 63) #define KDGKBTYPE _IOR('K', 64, int) #define KDGETLED _IOR('K', 65, int) -#define KDSETLED _IO('K', 66) +#define KDSETLED _IO('K', 66) #define KDSETRAD _IO('K', 67) #define GETFKEY _IOWR('k', 0, fkeyarg_t) @@ -79,14 +79,14 @@ #define CONS_GETVERS _IOR('c', 74, int) #define VT_OPENQRY _IOR('v', 1, int) -#define VT_SETMODE _IOW('v', 2, vtmode_t) +#define VT_SETMODE _IOW('v', 2, vtmode_t) #define VT_GETMODE _IOR('v', 3, vtmode_t) #define VT_RELDISP _IO('v', 4) #define VT_ACTIVATE _IO('v', 5) #define VT_WAITACTIVE _IO('v', 6) #define VT_GETACTIVE _IOR('v', 7, int) -#define VT_FALSE 0 +#define VT_FALSE 0 #define VT_TRUE 1 #define VT_ACKACQ 2 @@ -135,7 +135,7 @@ struct mouse_info { #define NLKED 2 /* Num locked */ #define SLKED 4 /* Scroll locked */ #define ALKED 8 /* AltGr locked */ -#define LED_CAP 1 /* Caps lock LED */ +#define LED_CAP 1 /* Caps lock LED */ #define LED_NUM 2 /* Num lock LED */ #define LED_SCR 4 /* Scroll lock LED */ diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index e110eff..f0648c9 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,13 +34,13 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.31 1995/05/14 02:59:51 davidg Exp $ + * $Id: autoconf.c,v 1.32 1995/05/29 04:08:13 davidg Exp $ */ /* * Setup the system to run on the current machine. * - * Configure() is called at boot time and initializes the vba + * Configure() is called at boot time and initializes the vba * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. @@ -237,7 +237,7 @@ setdumpdev(dev) dumpdev = dev; dumplo = newdumplo; return (0); -} +} u_long bootdev = 0; /* not a dev_t - encoding is different */ diff --git a/sys/amd64/amd64/db_disasm.c b/sys/amd64/amd64/db_disasm.c index 4e6a42c..8ce7365 100644 --- a/sys/amd64/amd64/db_disasm.c +++ b/sys/amd64/amd64/db_disasm.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_disasm.c,v 1.7 1994/10/08 22:19:47 phk Exp $ + * $Id: db_disasm.c,v 1.8 1995/01/29 02:38:15 bde Exp $ */ /* diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c index 29007d2..8daa0a2 100644 --- a/sys/amd64/amd64/db_interface.c +++ b/sys/amd64/amd64/db_interface.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.12 1995/03/16 18:11:25 bde Exp $ + * $Id: db_interface.c,v 1.13 1995/04/08 21:31:53 joerg Exp $ */ /* diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 28c152f..dcbf194 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_trace.c,v 1.9 1995/03/01 21:37:44 davidg Exp $ + * $Id: db_trace.c,v 1.10 1995/03/16 18:11:26 bde Exp $ */ #include <sys/param.h> @@ -127,13 +127,13 @@ db_numargs(fp) return (args); } -/* - * Figure out the next frame up in the call stack. - * For trap(), we print the address of the faulting instruction and +/* + * Figure out the next frame up in the call stack. + * For trap(), we print the address of the faulting instruction and * proceed with the calling frame. We return the ip that faulted. * If the trap was caused by jumping through a bogus pointer, then - * the next line in the backtrace will list some random function as - * being called. It should get the argument list correct, though. + * the next line in the backtrace will list some random function as + * being called. It should get the argument list correct, though. * It might be possible to dig out from the next frame up the name * of the function that faulted, but that could get hairy. */ diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index aacff0d..0a53279 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.21 1995/03/05 04:06:44 wpaul Exp $ + * $Id: npx.c,v 1.22 1995/04/12 20:48:01 wollman Exp $ */ #include "npx.h" @@ -280,7 +280,7 @@ npxprobe1(dvp) /* * Good, now check for a proper control word. */ - control = 0x5a5a; + control = 0x5a5a; fnstcw(&control); if ((control & 0x1f3f) == 0x033f) { hw_float = npx_exists = 1; @@ -344,7 +344,7 @@ npxattach(dvp) printf("npx%d: INT 16 interface\n", dvp->id_unit); else if (npx_irq13) ; /* higher level has printed "irq 13" */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) else if (npx_exists) { printf("npx%d: error reporting broken; using 387 emulator\n", dvp->id_unit); diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index dbfb2a0..a526184 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 - * $Id: genassym.c,v 1.25 1995/02/14 18:01:24 phk Exp $ + * $Id: genassym.c,v 1.26 1995/05/25 07:41:18 davidg Exp $ */ #include <stdio.h> @@ -43,10 +43,10 @@ #include <sys/proc.h> /* XXX This is just real ugly to have to do, but it is what you have to do! */ #ifndef NFS -#define NFS +#define NFS #include <sys/mount.h> #undef NFS -#else +#else #include <sys/mount.h> #endif #include <sys/mbuf.h> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 2f299b1..4a2d41d 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.126 1995/05/12 19:17:14 wollman Exp $ + * $Id: machdep.c,v 1.127 1995/05/25 07:41:20 davidg Exp $ */ #include "npx.h" @@ -389,7 +389,7 @@ again: printf(" %x:%08x", i, j); printf(" %d cyl, %d heads, %d sects\n", j >> 16, (j >> 8) & 0xff, j & 0xff); - + } printf(" %d accounted for\n", bootinfo.bi_n_bios_used); } @@ -421,7 +421,7 @@ static void identifycpu() { printf("CPU: "); - if (cpu >= 0 + if (cpu >= 0 && cpu < (sizeof i386_cpus/sizeof(struct cpu_nameclass))) { cpu_class = i386_cpus[cpu].cpu_class; strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof cpu_model); @@ -442,8 +442,8 @@ identifycpu() cpu_model[0] = '\0'; switch (cpu_id & 0x3000) { - case 0x1000: - strcpy(cpu_model, "Overdrive "); + case 0x1000: + strcpy(cpu_model, "Overdrive "); break; case 0x2000: strcpy(cpu_model, "Dual "); @@ -478,7 +478,7 @@ identifycpu() case 0x480: strcat(cpu_model, "DX4"); break; #if defined(I586_CPU) - case 0x510: + case 0x510: if (pentium_mhz == 60) { strcat(cpu_model, "510\\60"); } else if (pentium_mhz == 66) { @@ -630,7 +630,7 @@ sendsig(catcher, sig, mask, code) return; } - /* + /* * Build the argument list for the signal handler. */ if (p->p_sysent->sv_sigtbl) { @@ -868,7 +868,7 @@ boot(arghowto) if (howto & RB_DUMP) { savectx(&dumppcb, 0); dumppcb.pcb_ptd = rcr3(); - dumpsys(); + dumpsys(); if (PANIC_REBOOT_WAIT_TIME != 0) { if (PANIC_REBOOT_WAIT_TIME != -1) { @@ -1321,7 +1321,7 @@ init386(first) #ifdef COMPAT_LINUX setidt(0x80, &IDTVEC(linux_syscall), SDT_SYS386TGT, SEL_UPL); #endif - + #include "isa.h" #if NISA >0 isa_defaultirq(); @@ -1507,7 +1507,7 @@ init386(first) proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = + ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = (sizeof(tss))<<16; ltr(gsel_tss); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index bb4858f..9971603 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.56 1995/04/09 05:40:38 davidg Exp $ + * $Id: pmap.c,v 1.57 1995/05/11 19:26:11 rgrimes Exp $ */ /* @@ -167,7 +167,7 @@ struct msgbuf *msgbufp; #endif -void +void init_pv_entries(int); /* @@ -178,7 +178,7 @@ init_pv_entries(int); * [ what about induced faults -wfj] */ -inline pt_entry_t * const +inline pt_entry_t * const pmap_pte(pmap, va) register pmap_t pmap; vm_offset_t va; diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 7e33003..3c4f1cc 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.7 1995/03/04 02:25:36 davidg Exp $ + * $Id: sys_machdep.c,v 1.8 1995/03/10 08:13:07 davidg Exp $ * */ @@ -64,11 +64,11 @@ sysarch(p, uap, retval) switch(uap->op) { #ifdef USER_LDT - case I386_GET_LDT: + case I386_GET_LDT: error = i386_get_ldt(p, uap->parms, retval); break; - case I386_SET_LDT: + case I386_SET_LDT: error = i386_set_ldt(p, uap->parms, retval); break; #endif diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 6ca87c2..5e1489a 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.50 1995/03/21 07:02:51 davidg Exp $ + * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ */ /* @@ -174,7 +174,7 @@ trap(frame) type = frame.tf_trapno; code = frame.tf_err; - + if (ISPL(frame.tf_cs) == SEL_UPL) { /* user trap */ @@ -262,7 +262,7 @@ trap(frame) return; #endif /* NNPX > 0 */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) i = math_emulate(&frame); if (i == 0) { if (!(frame.tf_eflags & PSL_T)) @@ -352,7 +352,7 @@ trap(frame) frame.tf_eflags &= ~PSL_T; return; #endif - + #if NISA > 0 case T_NMI: #ifdef DDB @@ -376,7 +376,7 @@ trap(frame) #ifdef DEBUG eva = rcr2(); if (type <= MAX_TRAP_MSG) { - uprintf("fatal process exception: %s", + uprintf("fatal process exception: %s", trap_msg[type]); if ((type == T_PAGEFLT) || (type == T_PROTFLT)) uprintf(", fault VA = 0x%x", eva); @@ -464,7 +464,7 @@ trap_pfault(frame, usermode) v = (vm_offset_t) vtopte(va); /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -580,7 +580,7 @@ trap_pfault(frame, usermode) */ /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -804,7 +804,7 @@ syscall(frame) if (p->p_sysent->sv_mask) code = code & p->p_sysent->sv_mask; - + if (code >= p->p_sysent->sv_size) callp = &p->p_sysent->sv_table[0]; else @@ -852,7 +852,7 @@ syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = error; frame.tf_eflags |= PSL_C; /* carry bit */ @@ -966,7 +966,7 @@ linux_syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = -error; frame.tf_eflags |= PSL_C; /* carry bit */ diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index 196d34c..e1bc372 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.32 1995/03/16 18:11:58 bde Exp $ + * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ */ /* @@ -193,7 +193,7 @@ int acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) { if (timer0_state || TIMER_DIV(rate) < TIMER0_MIN_MAX_COUNT || - !function) + !function) return -1; new_function = function; new_rate = rate; @@ -204,7 +204,7 @@ acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) int acquire_timer2(int mode) { - if (timer2_state) + if (timer2_state) return -1; timer2_state = 1; outb(TIMER_MODE, TIMER_SEL2 | (mode &0x3f)); @@ -265,7 +265,7 @@ printrtc(void) #endif static int -getit() +getit() { int high, low; @@ -307,7 +307,7 @@ calibrate_cyclecounter(void) /* * Wait "n" microseconds. - * Relies on timer 1 counting down from (TIMER_FREQ / hz) + * Relies on timer 1 counting down from (TIMER_FREQ / hz) * Note: timer had better have been programmed before this is first used! */ void @@ -339,7 +339,7 @@ DELAY(int n) prev_tick = getit(0, 0); n -= 20; /* - * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point + * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point * and without any avoidable overflows. */ sec = n / 1000000; @@ -375,11 +375,11 @@ sysbeepstop(void *chan) beeping = 0; } -int +int sysbeep(int pitch, int period) { - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) return -1; disable_intr(); outb(TIMER_CNTR2, pitch); @@ -426,7 +426,7 @@ readrtc(int port) * XXX initialization of other timers is unintentionally left blank. */ void -startrtclock() +startrtclock() { timer0_max_count = hardclock_max_count = TIMER_DIV(hz); timer0_overflow_threshold = timer0_max_count - TIMER0_LATCH_COUNT; diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index f012a6a..2ff3602 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.37 1995/05/01 23:32:30 dyson Exp $ + * $Id: vm_machdep.c,v 1.38 1995/05/18 09:17:07 davidg Exp $ */ #include "npx.h" @@ -232,7 +232,7 @@ more: * same as vm_bounce_kva -- but really allocate (but takes pages as arg) */ vm_offset_t -vm_bounce_kva_alloc(count) +vm_bounce_kva_alloc(count) int count; { int i; @@ -308,7 +308,7 @@ vm_bounce_alloc(bp) * printf("size: %d, count: %d\n", bp->b_bufsize, bp->b_bcount); * } */ - + vastart = (vm_offset_t) bp->b_data; vaend = (vm_offset_t) bp->b_data + bp->b_bufsize; @@ -332,7 +332,7 @@ vm_bounce_alloc(bp) if (dobounceflag == 0) return; - if (bouncepages < dobounceflag) + if (bouncepages < dobounceflag) panic("Not enough bounce buffers!!!"); /* @@ -445,7 +445,7 @@ vm_bounce_free(bp) /* * free the bounce allocation */ - + /* printf("(kva: %x, pa: %x)", bouncekva, mybouncepa); */ @@ -463,7 +463,7 @@ vm_bounce_free(bp) /* * add the old kva into the "to free" list */ - + bouncekva= i386_trunc_page((vm_offset_t) bp->b_data); bouncekvaend= i386_round_page((vm_offset_t)bp->b_data + bp->b_bufsize); @@ -491,7 +491,7 @@ vm_bounce_init() if (bouncepages == 0) return; - + bounceallocarraysize = (bouncepages + BITS_IN_UNSIGNED - 1) / BITS_IN_UNSIGNED; bounceallocarray = malloc(bounceallocarraysize * sizeof(unsigned), M_TEMP, M_NOWAIT); @@ -552,7 +552,7 @@ cpu_fork(p1, p2) int offset; /* - * Copy pcb and stack from proc p1 to p2. + * Copy pcb and stack from proc p1 to p2. * We do this as cheaply as possible, copying only the active * part of the stack. The stack and pcb need to agree; * this is tricky, as the final pcb is constructed by savectx, @@ -571,7 +571,7 @@ cpu_fork(p1, p2) pmap_activate(&p2->p_vmspace->vm_pmap, &up->u_pcb); /* - * + * * Arrange for a non-local goto when the new process * is started, to resume here, returning nonzero from setjmp. */ @@ -588,7 +588,7 @@ void cpu_exit(p) register struct proc *p; { - + #if NNPX > 0 npxexit(p); #endif /* NNPX */ @@ -765,7 +765,7 @@ vunmapbuf(bp) addr < bp->b_data + bp->b_bufsize; addr += NBPG) pmap_kremove((vm_offset_t) addr); - + bp->b_data = bp->b_saveaddr; bp->b_saveaddr = NULL; @@ -806,7 +806,7 @@ cpu_reset() { bzero((caddr_t) PTD, NBPG); /* "good night, sweet prince .... <THUNK!>" */ - pmap_update(); + pmap_update(); /* NOTREACHED */ while(1); } diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index a57dc9d..576ba23 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.35 1995/05/11 07:24:35 bde Exp $ + * $Id: cpufunc.h,v 1.36 1995/05/14 22:25:11 davidg Exp $ */ /* @@ -279,7 +279,7 @@ read_eflags(void) { u_long ef; - __asm __volatile("pushfl; popl %0" : "=r" (ef)); + __asm __volatile("pushfl; popl %0" : "=r" (ef)); return (ef); } diff --git a/sys/amd64/include/db_machdep.h b/sys/amd64/include/db_machdep.h index a59b632..cae2a45 100644 --- a/sys/amd64/include/db_machdep.h +++ b/sys/amd64/include/db_machdep.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * - * $Id: db_machdep.h,v 1.6 1994/10/19 21:13:51 bde Exp $ + * $Id: db_machdep.h,v 1.7 1995/01/14 10:34:52 bde Exp $ */ #ifndef _MACHINE_DB_MACHDEP_H_ diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 6bc5808..34854b0 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: md_var.h,v 1.1 1995/03/16 18:11:43 bde Exp $ + * $Id: md_var.h,v 1.2 1995/03/28 07:55:08 bde Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -41,7 +41,7 @@ extern u_long cpu_feature; extern u_long cpu_high; extern u_long cpu_id; extern char cpu_vendor[]; -extern char etext[]; +extern char etext[]; extern vm_offset_t isaphysmem; extern char kstack[]; extern void (*netisrs[32]) __P((void)); diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 3ebe003..6a35c05 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.24 1995/03/16 18:11:44 bde Exp $ + * $Id: pmap.h,v 1.25 1995/03/26 23:42:55 davidg Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -108,12 +108,12 @@ extern int IdlePTD; /* physical address of "Idle" state directory */ */ #define vtopte(va) (PTmap + i386_btop(va)) #define kvtopte(va) vtopte(va) -#define ptetov(pt) (i386_ptob(pt - PTmap)) +#define ptetov(pt) (i386_ptob(pt - PTmap)) #define vtophys(va) (((int) (*vtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) #define ispt(va) ((va) >= UPT_MIN_ADDRESS && (va) <= KPT_MAX_ADDRESS) #define avtopte(va) (APTmap + i386_btop(va)) -#define ptetoav(pt) (i386_ptob(pt - APTmap)) +#define ptetoav(pt) (i386_ptob(pt - APTmap)) #define avtophys(va) (((int) (*avtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) #ifdef KERNEL diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h index 0c236f5..dcac309 100644 --- a/sys/amd64/include/segments.h +++ b/sys/amd64/include/segments.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 - * $Id: segments.h,v 1.7 1994/11/15 14:12:40 bde Exp $ + * $Id: segments.h,v 1.8 1995/02/14 19:21:15 sos Exp $ */ #ifndef _MACHINE_SEGMENTS_H_ @@ -51,10 +51,10 @@ */ #define ISPL(s) ((s)&3) /* what is the priority level of a selector */ -#define SEL_KPL 0 /* kernel priority level */ -#define SEL_UPL 3 /* user priority level */ +#define SEL_KPL 0 /* kernel priority level */ +#define SEL_UPL 3 /* user priority level */ #define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ -#define SEL_LDT 4 /* local descriptor table */ +#define SEL_LDT 4 /* local descriptor table */ #define IDXSEL(s) (((s)>>3) & 0x1fff) /* index of selector */ #define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */ #define GSEL(s,r) (((s)<<3) | r) /* a global selector */ diff --git a/sys/amd64/include/specialreg.h b/sys/amd64/include/specialreg.h index aa87bec..75cc79d 100644 --- a/sys/amd64/include/specialreg.h +++ b/sys/amd64/include/specialreg.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $Id: specialreg.h,v 1.5 1994/09/04 23:10:27 davidg Exp $ + * $Id: specialreg.h,v 1.6 1995/01/14 10:44:55 bde Exp $ */ #ifndef _MACHINE_SPECIALREG_H_ @@ -84,7 +84,7 @@ * NCRx+0: A31-A24 of starting address * NCRx+1: A23-A16 of starting address * NCRx+2: A15-A12 of starting address | NCR_SIZE_xx. - * + * * The non-cacheable region's starting address must be aligned to the * size indicated by the NCR_SIZE_xx field. */ diff --git a/sys/amd64/include/tss.h b/sys/amd64/include/tss.h index 1fada6e..fd07e35 100644 --- a/sys/amd64/include/tss.h +++ b/sys/amd64/include/tss.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)tss.h 5.4 (Berkeley) 1/18/91 - * $Id: tss.h,v 1.3 1993/11/07 17:43:16 wollman Exp $ + * $Id: tss.h,v 1.4 1993/11/17 23:25:04 wollman Exp $ */ #ifndef _MACHINE_TSS_H_ @@ -59,16 +59,16 @@ struct i386tss { #define tss_pc tss_eip int tss_eflags; /* program status longword */ #define tss_psl tss_eflags - int tss_eax; - int tss_ecx; - int tss_edx; - int tss_ebx; + int tss_eax; + int tss_ecx; + int tss_edx; + int tss_ebx; int tss_esp; /* user stack pointer */ #define tss_usp tss_esp int tss_ebp; /* user frame pointer */ #define tss_fp tss_ebp - int tss_esi; - int tss_edi; + int tss_esi; + int tss_edi; int tss_es; /* actually 16 bits: top 16 bits must be zero */ int tss_cs; /* actually 16 bits: top 16 bits must be zero */ int tss_ss; /* actually 16 bits: top 16 bits must be zero */ diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 196d34c..e1bc372 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.32 1995/03/16 18:11:58 bde Exp $ + * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ */ /* @@ -193,7 +193,7 @@ int acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) { if (timer0_state || TIMER_DIV(rate) < TIMER0_MIN_MAX_COUNT || - !function) + !function) return -1; new_function = function; new_rate = rate; @@ -204,7 +204,7 @@ acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) int acquire_timer2(int mode) { - if (timer2_state) + if (timer2_state) return -1; timer2_state = 1; outb(TIMER_MODE, TIMER_SEL2 | (mode &0x3f)); @@ -265,7 +265,7 @@ printrtc(void) #endif static int -getit() +getit() { int high, low; @@ -307,7 +307,7 @@ calibrate_cyclecounter(void) /* * Wait "n" microseconds. - * Relies on timer 1 counting down from (TIMER_FREQ / hz) + * Relies on timer 1 counting down from (TIMER_FREQ / hz) * Note: timer had better have been programmed before this is first used! */ void @@ -339,7 +339,7 @@ DELAY(int n) prev_tick = getit(0, 0); n -= 20; /* - * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point + * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point * and without any avoidable overflows. */ sec = n / 1000000; @@ -375,11 +375,11 @@ sysbeepstop(void *chan) beeping = 0; } -int +int sysbeep(int pitch, int period) { - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) return -1; disable_intr(); outb(TIMER_CNTR2, pitch); @@ -426,7 +426,7 @@ readrtc(int port) * XXX initialization of other timers is unintentionally left blank. */ void -startrtclock() +startrtclock() { timer0_max_count = hardclock_max_count = TIMER_DIV(hz); timer0_overflow_threshold = timer0_max_count - TIMER0_LATCH_COUNT; diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index c4a2455..1dd0fb9 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.48 1995/05/11 05:20:43 jkh Exp $ + * $Id: isa.c,v 1.49 1995/05/13 00:09:38 jkh Exp $ */ /* @@ -334,7 +334,7 @@ isa_configure() { * SLIPDISC. No need to block out ALL ttys during a splimp when only one * of them is running slip. * - * XXX actually, blocking all ttys during a splimp doesn't matter so much + * XXX actually, blocking all ttys during a splimp doesn't matter so much * with sio because the serial interrupt layer doesn't use tty_imask. Only * non-serial ttys suffer. It's more stupid that ALL 'net's are blocked * during spltty. @@ -372,8 +372,8 @@ isa_configure() { /* * Configure an ISA device. */ - - + + static void config_isadev(isdp, mp) struct isa_device *isdp; @@ -381,7 +381,7 @@ config_isadev(isdp, mp) { config_isadev_c(isdp, mp, 0); } - + void reconfig_isadev(isdp, mp) struct isa_device *isdp; @@ -400,7 +400,7 @@ config_isadev_c(isdp, mp, reconfig) int id_alive; int last_alive; struct isa_driver *dp = isdp->id_driver; - + checkbits = 0; checkbits |= CC_DRQ; checkbits |= CC_IOADDR; @@ -464,11 +464,11 @@ config_isadev_c(isdp, mp, reconfig) } printf("\n"); /* - * Check for conflicts again. The driver may have - * changed *dvp. We should weaken the early check - * since the driver may have been able to change - * *dvp to avoid conflicts if given a chance. We - * already skip the early check for IRQs and force + * Check for conflicts again. The driver may have + * changed *dvp. We should weaken the early check + * since the driver may have been able to change + * *dvp to avoid conflicts if given a chance. We + * already skip the early check for IRQs and force * a check for IRQs in the next group of checks. */ checkbits |= CC_IRQ; @@ -497,12 +497,12 @@ config_isadev_c(isdp, mp, reconfig) } printf("\n"); } - } + } else { /* This code has not been tested.... */ if (isdp->id_irq) { INTRDIS(isdp->id_irq); - unregister_intr(ffs(isdp->id_irq) - 1, + unregister_intr(ffs(isdp->id_irq) - 1, isdp->id_intr); if (mp) INTRUNMASK(*mp, isdp->id_irq); @@ -593,7 +593,7 @@ eisa_generic_externalize(struct proc *p, struct kern_devconf *kdc, * during configuration of kernel, setup interrupt control unit */ void -isa_defaultirq() +isa_defaultirq() { int i; @@ -643,7 +643,7 @@ static short dmapageport[8] = void isa_dmacascade(unsigned chan) { if (chan > 7) - panic("isa_dmacascade: impossible request"); + panic("isa_dmacascade: impossible request"); /* set dma channel mode, and set dma channel mode */ if ((chan & 4) == 0) { @@ -670,7 +670,7 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan) if ( chan > 7 || (chan < 4 && nbytes > (1<<16)) || (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1))) - panic("isa_dmastart: impossible request"); + panic("isa_dmastart: impossible request"); if (isa_dmarangecheck(addr, nbytes, chan)) { if (dma_bounce[chan] == 0) @@ -818,7 +818,7 @@ static void (*isaphysmemunblock)(); /* needs to be a list */ */ caddr_t isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) { - + isaphysmemunblock = func; while (isaphysmemflag & B_BUSY) { isaphysmemflag |= B_WANTED; @@ -844,7 +844,7 @@ isa_freephysmem(caddr_t va, unsigned length) { (*isaphysmemunblock)(); } } - + #define NMI_PARITY (1 << 7) #define NMI_IOCHAN (1 << 6) #define ENMI_WATCHDOG (1 << 7) @@ -856,7 +856,7 @@ isa_freephysmem(caddr_t va, unsigned length) { * return true to panic system, false to ignore. */ int -isa_nmi(cd) +isa_nmi(cd) int cd; { int isa_port = inb(0x61); @@ -930,7 +930,7 @@ struct isa_device *find_isadev(table, driverp, unit) while ((table->id_driver != driverp) || (table->id_unit != unit)) { if (table->id_driver == 0) return NULL; - + table++; } diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index aacff0d..0a53279 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.21 1995/03/05 04:06:44 wpaul Exp $ + * $Id: npx.c,v 1.22 1995/04/12 20:48:01 wollman Exp $ */ #include "npx.h" @@ -280,7 +280,7 @@ npxprobe1(dvp) /* * Good, now check for a proper control word. */ - control = 0x5a5a; + control = 0x5a5a; fnstcw(&control); if ((control & 0x1f3f) == 0x033f) { hw_float = npx_exists = 1; @@ -344,7 +344,7 @@ npxattach(dvp) printf("npx%d: INT 16 interface\n", dvp->id_unit); else if (npx_irq13) ; /* higher level has printed "irq 13" */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) else if (npx_exists) { printf("npx%d: error reporting broken; using 387 emulator\n", dvp->id_unit); diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index e81caf3..aef5755 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -1,6 +1,6 @@ # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.62 1995/04/05 04:10:58 nate Exp $ +# $Id: Makefile.i386,v 1.63 1995/05/11 19:48:45 wollman Exp $ # # Makefile for FreeBSD # @@ -14,7 +14,7 @@ # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # -CC?= cc +CC?= cc CPP?= cpp LD?= /usr/bin/ld @@ -61,7 +61,7 @@ SFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s SYSTEM_CFILES= ioconf.c param.c vnode_if.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} libkern.a SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a @@ -145,7 +145,7 @@ trap.o cons.o: Makefile assym.s: genassym ./genassym >assym.s -# Some of the defines that genassym outputs may well depend on the +# Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index e81caf3..aef5755 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -1,6 +1,6 @@ # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.62 1995/04/05 04:10:58 nate Exp $ +# $Id: Makefile.i386,v 1.63 1995/05/11 19:48:45 wollman Exp $ # # Makefile for FreeBSD # @@ -14,7 +14,7 @@ # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # -CC?= cc +CC?= cc CPP?= cpp LD?= /usr/bin/ld @@ -61,7 +61,7 @@ SFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s SYSTEM_CFILES= ioconf.c param.c vnode_if.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} libkern.a SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a @@ -145,7 +145,7 @@ trap.o cons.o: Makefile assym.s: genassym ./genassym >assym.s -# Some of the defines that genassym outputs may well depend on the +# Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c diff --git a/sys/ddb/db_access.c b/sys/ddb/db_access.c index 7178bbe..fb53d27 100644 --- a/sys/ddb/db_access.c +++ b/sys/ddb/db_access.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_access.c,v 1.5 1994/08/13 03:49:13 wollman Exp $ + * $Id: db_access.c,v 1.6 1994/08/18 22:34:18 wollman Exp $ */ /* @@ -68,7 +68,7 @@ db_get_value(addr, size, is_signed) { value = (value << 8) + (data[i] & 0xFF); } - + if (size < 4) { if (is_signed && (value & db_extend[size]) != 0) value |= db_extend[size]; diff --git a/sys/ddb/db_access.h b/sys/ddb/db_access.h index a62edba..dbf3d21 100644 --- a/sys/ddb/db_access.h +++ b/sys/ddb/db_access.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_access.h,v 1.2 1993/10/16 16:47:05 rgrimes Exp $ + * $Id: db_access.h,v 1.3 1993/11/07 17:39:20 wollman Exp $ */ #ifndef _DDB_DB_ACCESS_H_ diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index 91c67ce..62cbba9 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_aout.c,v 1.9 1994/09/27 03:34:52 phk Exp $ + * $Id: db_aout.c,v 1.10 1995/01/25 21:37:04 bde Exp $ */ /* @@ -243,7 +243,7 @@ X_db_line_at_pc(symtab, cursym, filename, linenum, off) if (sp->n_value <= off && (off - sp->n_value) <= sodiff && NEWSRC(sp->n_un.n_name)) { #endif - if ((sp->n_type & N_TYPE) == N_FN || NEWSRC(sp->n_un.n_name)) { + if ((sp->n_type & N_TYPE) == N_FN || NEWSRC(sp->n_un.n_name)) { sodiff = lndiff = -1UL; ln = 0; fname = NULL; @@ -392,7 +392,7 @@ read_symtab_from_file(fp, symtab_name) X_db_sym_init((int *)symtab, (char *)(symtab + table_size), symtab_name); - + } #endif diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index cb9c55e..05a4cc1 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_break.c,v 1.4 1994/08/13 03:49:15 wollman Exp $ + * $Id: db_break.c,v 1.5 1994/08/18 22:34:19 wollman Exp $ */ /* diff --git a/sys/ddb/db_break.h b/sys/ddb/db_break.h index dc66dca..efe62c7 100644 --- a/sys/ddb/db_break.h +++ b/sys/ddb/db_break.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id$ + * $Id: db_break.h,v 1.2 1993/10/16 16:47:09 rgrimes Exp $ */ /* diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 1613ab9..c52238a 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_command.c,v 1.11 1995/03/16 18:10:59 bde Exp $ + * $Id: db_command.c,v 1.12 1995/03/19 14:28:28 davidg Exp $ */ /* diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index 9000cd0..3b6d77a 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_command.h,v 1.4 1994/08/13 03:49:16 wollman Exp $ + * $Id: db_command.h,v 1.5 1994/08/18 22:34:21 wollman Exp $ */ #ifndef _DDB_DB_COMMAND_H_ diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index 48334ba..8f321b9 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_examine.c,v 1.6 1994/08/18 22:34:22 wollman Exp $ + * $Id: db_examine.c,v 1.7 1995/05/22 13:07:11 davidg Exp $ */ /* diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c index 1c7eea1..8f4b78f 100644 --- a/sys/ddb/db_expr.c +++ b/sys/ddb/db_expr.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_expr.c,v 1.3 1993/11/25 01:30:06 wollman Exp $ + * $Id: db_expr.c,v 1.4 1994/08/13 03:49:18 wollman Exp $ */ /* diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c index 4697a8c..c309774 100644 --- a/sys/ddb/db_input.c +++ b/sys/ddb/db_input.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_input.c,v 1.5 1994/08/13 03:49:19 wollman Exp $ + * $Id: db_input.c,v 1.6 1994/08/18 22:34:23 wollman Exp $ */ /* @@ -253,4 +253,4 @@ void cnpollc (flag) int flag; { -} +} diff --git a/sys/ddb/db_lex.c b/sys/ddb/db_lex.c index 8f5f4b0..3985c4f 100644 --- a/sys/ddb/db_lex.c +++ b/sys/ddb/db_lex.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_lex.c,v 1.4 1994/08/13 03:49:20 wollman Exp $ + * $Id: db_lex.c,v 1.5 1994/08/18 22:34:23 wollman Exp $ */ /* @@ -76,7 +76,7 @@ db_read_char() } else if (db_lp >= db_endlp) c = -1; - else + else c = *db_lp++; return (c); } diff --git a/sys/ddb/db_lex.h b/sys/ddb/db_lex.h index db1d2b9..0be7d4a 100644 --- a/sys/ddb/db_lex.h +++ b/sys/ddb/db_lex.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_lex.h,v 1.3 1993/11/07 17:39:23 wollman Exp $ + * $Id: db_lex.h,v 1.4 1994/08/18 22:34:24 wollman Exp $ */ #ifndef _DDB_DB_LEX_H_ @@ -45,7 +45,7 @@ extern void db_unread_token(/* int t */); extern void db_flush_lex(); extern int db_tok_number; -#define TOK_STRING_SIZE 120 +#define TOK_STRING_SIZE 120 extern char db_tok_string[TOK_STRING_SIZE]; #define tEOF (-1) diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index cc70b63..ca92bfc 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_output.c,v 1.9 1994/09/27 03:34:54 phk Exp $ + * $Id: db_output.c,v 1.10 1994/10/30 20:55:44 bde Exp $ */ /* diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h index 3bfd710..3a2f5fd 100644 --- a/sys/ddb/db_output.h +++ b/sys/ddb/db_output.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_output.h,v 1.5 1994/09/27 03:34:55 phk Exp $ + * $Id: db_output.h,v 1.6 1994/09/27 12:15:53 davidg Exp $ */ #ifndef _DDB_DB_OUTPUT_H_ diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index e9a9fd3..7f0557b 100644 --- a/sys/ddb/db_print.c +++ b/sys/ddb/db_print.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_print.c,v 1.5 1994/08/18 22:34:25 wollman Exp $ + * $Id: db_print.c,v 1.6 1994/09/27 03:34:56 phk Exp $ */ /* diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index 1843527..09af7f0 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_ps.c,v 1.4 1995/03/28 23:29:52 davidg Exp $ + * $Id: db_ps.c,v 1.5 1995/04/04 01:35:33 davidg Exp $ */ #include <sys/param.h> #include <sys/systm.h> @@ -62,7 +62,7 @@ db_ps() { pp = p; if (p->p_stat) { db_printf("%5d %06x %06x %4d %5d %5d %06x %d", - p->p_pid, ap, p->p_addr, p->p_cred->p_ruid, pp->p_pid, + p->p_pid, ap, p->p_addr, p->p_cred->p_ruid, pp->p_pid, p->p_pgrp->pg_id, p->p_flag, p->p_stat); if (p->p_wchan) { db_printf(" %6s %08x %s\n", p->p_wmesg, p->p_wchan, p->p_comm); diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c index 4b1bd15..e161a73 100644 --- a/sys/ddb/db_run.c +++ b/sys/ddb/db_run.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_run.c,v 1.3 1993/11/25 01:30:10 wollman Exp $ + * $Id: db_run.c,v 1.4 1994/08/13 03:49:22 wollman Exp $ */ /* @@ -103,7 +103,7 @@ db_stop_at_pc(is_breakpoint) } else if (*is_breakpoint) { ddb_regs.tf_eip += 1; } - + *is_breakpoint = FALSE; if (db_run_mode == STEP_INVISIBLE) { @@ -236,7 +236,7 @@ db_single_step(regs) * db_getreg_val(); return the value of a user register, * as indicated in the hardware instruction * encoding, e.g. 8 for r8 - * + * * next_instr_address(pc,bd) returns the address of the first * instruction following the one at "pc", * which is either in the taken path of @@ -248,7 +248,7 @@ db_single_step(regs) * If one of these addresses does not already have a breakpoint, * we allocate a breakpoint and save it here. * These breakpoints are deleted on return. - */ + */ db_breakpoint_t db_not_taken_bkpt = 0; db_breakpoint_t db_taken_bkpt = 0; diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 57329d6..81c7b4d 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_sym.c,v 1.7 1994/09/27 03:34:57 phk Exp $ + * $Id: db_sym.c,v 1.8 1995/05/22 13:07:12 davidg Exp $ */ /* diff --git a/sys/ddb/db_sym.h b/sys/ddb/db_sym.h index 88cd689..319279d 100644 --- a/sys/ddb/db_sym.h +++ b/sys/ddb/db_sym.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_sym.h,v 1.6 1994/09/27 03:34:57 phk Exp $ + * $Id: db_sym.h,v 1.7 1995/03/16 18:11:00 bde Exp $ */ #ifndef _DDB_DB_SYM_H_ diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c index bc65ed9..83419b8 100644 --- a/sys/ddb/db_trap.c +++ b/sys/ddb/db_trap.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_trap.c,v 1.5 1994/08/18 22:34:27 wollman Exp $ + * $Id: db_trap.c,v 1.6 1994/10/02 19:36:21 phk Exp $ */ /* @@ -65,7 +65,7 @@ db_trap(type, code) db_printf("Watchpoint at\t"); else db_printf("Stopped at\t"); - + db_print_loc_and_inst(db_dot); } diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c index b803e5b..25485f5 100644 --- a/sys/ddb/db_variables.c +++ b/sys/ddb/db_variables.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_variables.c,v 1.5 1994/08/18 22:34:27 wollman Exp $ + * $Id: db_variables.c,v 1.6 1994/09/27 03:34:58 phk Exp $ */ /* diff --git a/sys/ddb/db_variables.h b/sys/ddb/db_variables.h index 35e5a00..76aeede 100644 --- a/sys/ddb/db_variables.h +++ b/sys/ddb/db_variables.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_variables.h,v 1.2 1993/10/16 16:47:31 rgrimes Exp $ + * $Id: db_variables.h,v 1.3 1993/11/25 01:30:14 wollman Exp $ */ /* diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index fb6680f..b74fab9 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_watch.c,v 1.4 1994/08/13 03:49:25 wollman Exp $ + * $Id: db_watch.c,v 1.5 1994/08/18 22:34:28 wollman Exp $ */ /* diff --git a/sys/ddb/db_watch.h b/sys/ddb/db_watch.h index d564ad2..61cb7c1 100644 --- a/sys/ddb/db_watch.h +++ b/sys/ddb/db_watch.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_watch.h,v 1.2 1993/10/16 16:47:33 rgrimes Exp $ + * $Id: db_watch.h,v 1.3 1994/08/18 22:34:29 wollman Exp $ */ /* diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c index e2625ca..1b2a99e 100644 --- a/sys/ddb/db_write_cmd.c +++ b/sys/ddb/db_write_cmd.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_write_cmd.c,v 1.3 1993/11/25 01:30:16 wollman Exp $ + * $Id: db_write_cmd.c,v 1.4 1994/08/13 03:49:26 wollman Exp $ */ /* diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 23cfc60..23702b2 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ddb.h,v 1.4 1994/09/27 12:15:56 davidg Exp $ + * $Id: ddb.h,v 1.5 1995/03/16 18:11:01 bde Exp $ */ /* @@ -55,8 +55,8 @@ extern int db_tab_stop_width; /* * Functions... */ -extern void -db_read_bytes(vm_offset_t addr, register int size, register char *data); +extern void +db_read_bytes(vm_offset_t addr, register int size, register char *data); /* machine-dependent */ extern void diff --git a/sys/dev/aic7xxx/aic7xxx_asm.c b/sys/dev/aic7xxx/aic7xxx_asm.c index 5f910d4..e2745f0 100644 --- a/sys/dev/aic7xxx/aic7xxx_asm.c +++ b/sys/dev/aic7xxx/aic7xxx_asm.c @@ -43,7 +43,7 @@ * are token separators. * *-M*************************************************************************/ -static char id[] = "$Id$"; +static char id[] = "$Id: aic7xxx_asm.c,v 1.8 1995/04/15 21:45:56 gibbs Exp $"; #include <ctype.h> #include <stdio.h> #include <string.h> @@ -70,7 +70,7 @@ char *filename; FILE *ifp, *ofp; unsigned char M[MEMORY][4]; -void +void error(char *s) { fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno); @@ -107,7 +107,7 @@ typedef struct sym_t { struct sym_t *next; /* MUST BE FIRST */ char *name; int value; - int npatch; + int npatch; int *patch; } sym_t; @@ -151,7 +151,7 @@ lookup(char *name) return(NULL); } -void +void patch(sym_t *p, int location) { p->npatch += 1; @@ -244,7 +244,7 @@ rescan: else error("too many tokens"); if (quote) { - quote++; + quote++; p = strchr(quote, '\"'); if (!p) error("unterminated string constant"); @@ -256,7 +256,7 @@ rescan: else error("too many tokens"); goto rescan; - } + } if (i) { *n = i; return(a); @@ -336,7 +336,7 @@ struct { { 0, 0, 0, 0, 0, 0, 0, 0 } }; -int +int eval_operand(char **a, int spec) { int i; @@ -604,7 +604,7 @@ main(int argc, char **argv) } break; case 'h': - printf("usage: %s [-d] [-Dname] [-ooutput] input\n", + printf("usage: %s [-d] [-Dname] [-ooutput] input\n", *argv); exit(EXIT_SUCCESS); break; diff --git a/sys/dev/aic7xxx/aicasm.c b/sys/dev/aic7xxx/aicasm.c index 5f910d4..e2745f0 100644 --- a/sys/dev/aic7xxx/aicasm.c +++ b/sys/dev/aic7xxx/aicasm.c @@ -43,7 +43,7 @@ * are token separators. * *-M*************************************************************************/ -static char id[] = "$Id$"; +static char id[] = "$Id: aic7xxx_asm.c,v 1.8 1995/04/15 21:45:56 gibbs Exp $"; #include <ctype.h> #include <stdio.h> #include <string.h> @@ -70,7 +70,7 @@ char *filename; FILE *ifp, *ofp; unsigned char M[MEMORY][4]; -void +void error(char *s) { fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno); @@ -107,7 +107,7 @@ typedef struct sym_t { struct sym_t *next; /* MUST BE FIRST */ char *name; int value; - int npatch; + int npatch; int *patch; } sym_t; @@ -151,7 +151,7 @@ lookup(char *name) return(NULL); } -void +void patch(sym_t *p, int location) { p->npatch += 1; @@ -244,7 +244,7 @@ rescan: else error("too many tokens"); if (quote) { - quote++; + quote++; p = strchr(quote, '\"'); if (!p) error("unterminated string constant"); @@ -256,7 +256,7 @@ rescan: else error("too many tokens"); goto rescan; - } + } if (i) { *n = i; return(a); @@ -336,7 +336,7 @@ struct { { 0, 0, 0, 0, 0, 0, 0, 0 } }; -int +int eval_operand(char **a, int spec) { int i; @@ -604,7 +604,7 @@ main(int argc, char **argv) } break; case 'h': - printf("usage: %s [-d] [-Dname] [-ooutput] input\n", + printf("usage: %s [-d] [-Dname] [-ooutput] input\n", *argv); exit(EXIT_SUCCESS); break; diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 5f910d4..e2745f0 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -43,7 +43,7 @@ * are token separators. * *-M*************************************************************************/ -static char id[] = "$Id$"; +static char id[] = "$Id: aic7xxx_asm.c,v 1.8 1995/04/15 21:45:56 gibbs Exp $"; #include <ctype.h> #include <stdio.h> #include <string.h> @@ -70,7 +70,7 @@ char *filename; FILE *ifp, *ofp; unsigned char M[MEMORY][4]; -void +void error(char *s) { fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno); @@ -107,7 +107,7 @@ typedef struct sym_t { struct sym_t *next; /* MUST BE FIRST */ char *name; int value; - int npatch; + int npatch; int *patch; } sym_t; @@ -151,7 +151,7 @@ lookup(char *name) return(NULL); } -void +void patch(sym_t *p, int location) { p->npatch += 1; @@ -244,7 +244,7 @@ rescan: else error("too many tokens"); if (quote) { - quote++; + quote++; p = strchr(quote, '\"'); if (!p) error("unterminated string constant"); @@ -256,7 +256,7 @@ rescan: else error("too many tokens"); goto rescan; - } + } if (i) { *n = i; return(a); @@ -336,7 +336,7 @@ struct { { 0, 0, 0, 0, 0, 0, 0, 0 } }; -int +int eval_operand(char **a, int spec) { int i; @@ -604,7 +604,7 @@ main(int argc, char **argv) } break; case 'h': - printf("usage: %s [-d] [-Dname] [-ooutput] input\n", + printf("usage: %s [-d] [-Dname] [-ooutput] input\n", *argv); exit(EXIT_SUCCESS); break; diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index a37292e..fd898f2 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.5 1995/03/28 07:55:25 bde Exp $ + * $Id: cy.c,v 1.6 1995/03/28 12:29:11 bde Exp $ */ /* @@ -99,7 +99,7 @@ #define PollMode /* use polling-based irq service routine, not the * hardware svcack lines. Must be defined for * cyclom-16y boards. - * + * * XXX cyclom-8y doesn't work without this defined * either (!) */ @@ -172,7 +172,7 @@ void delay(int delay); /* Better get rid of this until the core people agree on kernel interfaces. At least it will then compile on both WhichBSDs. - */ + */ #if 0 extern unsigned int delaycount; /* calibrated 1 ms cpu-spin delay */ #endif @@ -546,7 +546,7 @@ service_upper_rx(int unit) #ifdef FastRawInput /* try to avoid calling the line discipline stuff if we can */ if ((tp->t_line == 0) && - !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && + !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG | PENDIN)) && !(tp->t_state & (TS_CNTTB | TS_LNCH))) { @@ -1321,11 +1321,11 @@ cyparam(struct tty *tp, struct termios *t) if (iflag & IXOFF) opt |= 1 << 6; /* auto XOFF output flow-control */ #endif -#ifndef ALWAYS_RTS_CTS +#ifndef ALWAYS_RTS_CTS if (cflag & CCTS_OFLOW) #endif opt |= 1 << 1; /* auto CTS flow-control */ - + if (opt != infop->cor[1]) { cor_change |= 1 << 2; *(base + CD1400_COR2) = opt; @@ -1560,7 +1560,7 @@ cyspeed(int speed, int *prescaler_io) static void cd1400_channel_cmd(cy_addr base, u_char cmd) { - /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, + /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, as the card is probed every round? Replaced delaycount with 8k. Either delaycount has to be implemented in FreeBSD or more sensible way of doing these should be implemented. DELAY isn't enough here. @@ -1570,7 +1570,7 @@ cd1400_channel_cmd(cy_addr base, u_char cmd) /* wait for processing of previous command to complete */ while (*(base + CD1400_CCR) && maxwait--) ; - + if (!maxwait) log(LOG_ERR, "cy: channel command timeout (%d loops) - arrgh\n", 5 * 8 * 1024); diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index a37292e..fd898f2 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.5 1995/03/28 07:55:25 bde Exp $ + * $Id: cy.c,v 1.6 1995/03/28 12:29:11 bde Exp $ */ /* @@ -99,7 +99,7 @@ #define PollMode /* use polling-based irq service routine, not the * hardware svcack lines. Must be defined for * cyclom-16y boards. - * + * * XXX cyclom-8y doesn't work without this defined * either (!) */ @@ -172,7 +172,7 @@ void delay(int delay); /* Better get rid of this until the core people agree on kernel interfaces. At least it will then compile on both WhichBSDs. - */ + */ #if 0 extern unsigned int delaycount; /* calibrated 1 ms cpu-spin delay */ #endif @@ -546,7 +546,7 @@ service_upper_rx(int unit) #ifdef FastRawInput /* try to avoid calling the line discipline stuff if we can */ if ((tp->t_line == 0) && - !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && + !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG | PENDIN)) && !(tp->t_state & (TS_CNTTB | TS_LNCH))) { @@ -1321,11 +1321,11 @@ cyparam(struct tty *tp, struct termios *t) if (iflag & IXOFF) opt |= 1 << 6; /* auto XOFF output flow-control */ #endif -#ifndef ALWAYS_RTS_CTS +#ifndef ALWAYS_RTS_CTS if (cflag & CCTS_OFLOW) #endif opt |= 1 << 1; /* auto CTS flow-control */ - + if (opt != infop->cor[1]) { cor_change |= 1 << 2; *(base + CD1400_COR2) = opt; @@ -1560,7 +1560,7 @@ cyspeed(int speed, int *prescaler_io) static void cd1400_channel_cmd(cy_addr base, u_char cmd) { - /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, + /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, as the card is probed every round? Replaced delaycount with 8k. Either delaycount has to be implemented in FreeBSD or more sensible way of doing these should be implemented. DELAY isn't enough here. @@ -1570,7 +1570,7 @@ cd1400_channel_cmd(cy_addr base, u_char cmd) /* wait for processing of previous command to complete */ while (*(base + CD1400_CCR) && maxwait--) ; - + if (!maxwait) log(LOG_ERR, "cy: channel command timeout (%d loops) - arrgh\n", 5 * 8 * 1024); diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 2767cce..7a0eee7 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.26 1995/05/22 13:32:24 davidg Exp $ + * $Id: if_de.c,v 1.27 1995/05/26 02:02:44 davidg Exp $ * */ @@ -187,7 +187,7 @@ typedef struct { * And the number of receive descriptors multiplied by the size * of the receive buffers must equal the recevive space. This * is so that we can manipulate the page tables so that even if a - * packet wraps around the end of the receive space, we can + * packet wraps around the end of the receive space, we can * treat it as virtually contiguous. * * The above used to be true (the stupid restriction is still true) @@ -257,7 +257,7 @@ struct _tulip_softc_t { #ifndef IFF_ALTPHYS #define IFF_ALTPHYS IFF_LINK0 /* In case it isn't defined */ #endif -static const char *tulip_chipdescs[] = { +static const char *tulip_chipdescs[] = { "DC21040 [10Mb/s]", "DC21140 [10-100Mb/s]", "DC21041 [10Mb/s]" @@ -500,7 +500,7 @@ tulip_reset( tulip_desc_t *di; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ @@ -532,7 +532,7 @@ tulip_reset( di->d_status = 0; /* - * We need to collect all the mbufs were on the + * We need to collect all the mbufs were on the * receive ring before we reinit it either to put * them back on or to know if we have to allocate * more. @@ -648,7 +648,7 @@ tulip_rx_intr( if (((volatile tulip_desc_t *) eop)->d_status & TULIP_DSTS_OWNER) break; - + total_len = ((eop->d_status >> 16) & 0x7FF) - 4; IF_DEQUEUE(&sc->tulip_rxq, m); if ((eop->d_status & TULIP_DSTS_ERRSUM) == 0) { @@ -1056,8 +1056,8 @@ tulip_idle_srom( tulip_softc_t * const sc) { unsigned bit, csr; - - csr = SROMSEL | SROMRD; EMIT; + + csr = SROMSEL | SROMRD; EMIT; csr ^= SROMCS; EMIT; csr ^= SROMCLKON; EMIT; @@ -1073,12 +1073,12 @@ tulip_idle_srom( csr = 0; EMIT; } - + static void tulip_read_srom( tulip_softc_t * const sc) -{ - int idx; +{ + int idx; const unsigned bitwidth = SROM_BITWIDTH; const unsigned cmdmask = (SROMCMD_RD << bitwidth); const unsigned msb = 1 << (bitwidth + 3 - 1); @@ -1091,7 +1091,7 @@ tulip_read_srom( csr = SROMSEL | SROMRD; EMIT; csr ^= SROMCSON; EMIT; csr ^= SROMCLKON; EMIT; - + lastbit = 0; for (bits = idx|cmdmask, bit = bitwidth + 3; bit > 0; bit--, bits <<= 1) { const unsigned thisbit = bits & msb; @@ -1106,7 +1106,7 @@ tulip_read_srom( for (data = 0, bits = 0; bits < 16; bits++) { data <<= 1; - csr ^= SROMCLKON; EMIT; /* clock high; data valid */ + csr ^= SROMCLKON; EMIT; /* clock high; data valid */ data |= TULIP_READ_CSR(sc, csr_srom_mii) & SROMDIN ? 1 : 0; csr ^= SROMCLKOFF; EMIT; /* clock low; data not valid */ } @@ -1227,7 +1227,7 @@ tulip_read_macaddr( if (cksum >= 65535) cksum -= 65535; rom_cksum = *(u_short *) &sc->tulip_rombuf[6]; - + if (cksum != rom_cksum) return -1; @@ -1274,8 +1274,8 @@ tulip_addr_filter( ETHER_NEXT_MULTI(step, enm); } sc->tulip_flags |= TULIP_WANTHASH; - sp[39] = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; - sp[40] = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; + sp[39] = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; + sp[40] = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; sp[41] = ((u_short *) sc->tulip_ac.ac_enaddr)[2]; } else { /* @@ -1284,8 +1284,8 @@ tulip_addr_filter( i = 0; ETHER_FIRST_MULTI(step, &sc->tulip_ac, enm); for (; enm != NULL; i++) { - *sp++ = ((u_short *) enm->enm_addrlo)[0]; - *sp++ = ((u_short *) enm->enm_addrlo)[1]; + *sp++ = ((u_short *) enm->enm_addrlo)[0]; + *sp++ = ((u_short *) enm->enm_addrlo)[1]; *sp++ = ((u_short *) enm->enm_addrlo)[2]; ETHER_NEXT_MULTI(step, enm); } @@ -1302,8 +1302,8 @@ tulip_addr_filter( * Pad the rest with our hardware address */ for (; i < 16; i++) { - *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; - *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; + *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; + *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[2]; } } @@ -1441,11 +1441,11 @@ tulip_attach( ifp->if_ioctl = tulip_ioctl; ifp->if_output = ether_output; ifp->if_start = tulip_start; - + #ifdef __FreeBSD__ printf("%s%d", sc->tulip_name, sc->tulip_unit); #endif - printf(": %s%s pass %d.%d Ethernet address %s\n", + printf(": %s%s pass %d.%d Ethernet address %s\n", sc->tulip_boardsw->bd_description, tulip_chipdescs[sc->tulip_chipid], (sc->tulip_revinfo & 0xF0) >> 4, @@ -1550,7 +1550,7 @@ tulip_pci_shutdown( if (kdc->kdc_unit < NDE) { tulip_softc_t * const sc = TULIP_UNIT_TO_SOFTC(kdc->kdc_unit); TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } @@ -1595,7 +1595,7 @@ tulip_pci_shutdown( { tulip_softc_t * const sc = (tulip_softc_t *) arg; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } @@ -1684,7 +1684,7 @@ tulip_pci_shutdown( { tulip_softc_t * const sc = (tulip_softc_t *) arg; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index d4d29f8..100d8f7 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -13,7 +13,7 @@ * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * and a variety of similar clones. * - * $Id: if_ed.c,v 1.71 1995/05/12 22:39:40 davidg Exp $ + * $Id: if_ed.c,v 1.72 1995/05/14 11:01:20 davidg Exp $ */ #include "ed.h" @@ -363,11 +363,11 @@ ed_probe_WD80x3(isa_dev) isa16bit = 1; memsize = 16384; sc->type_str = "WD8013EP"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: WD 8013EP"; } else { sc->type_str = "WD8003EP"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: WD 8003EP"; } break; @@ -407,7 +407,7 @@ ed_probe_WD80x3(isa_dev) break; case ED_TYPE_SMC8216T: sc->type_str = "SMC8216T"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: SMC 8216T"; outb(sc->asic_addr + ED_WD790_HWR, @@ -1376,7 +1376,7 @@ ed_init(unit) /* * Enable the following interrupts: receive/transmit complete, * receive/transmit error, and Receiver OverWrite. - * + * * Counter overflow and Remote DMA complete are *not* enabled. */ outb(sc->nic_addr + ED_P0_IMR, @@ -2060,8 +2060,8 @@ ed_ioctl(ifp, command, data) ed_init(ifp->if_unit); } /* UP controls BUSY/IDLE */ - sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) - ? DC_BUSY + sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) + ? DC_BUSY : DC_IDLE); #if NBPFILTER > 0 @@ -2327,7 +2327,7 @@ ed_pio_write_mbufs(sc, m, dst) outb(sc->nic_addr + ED_P0_CR, ED_CR_RD1 | ED_CR_STA); /* - * Transfer the mbuf chain to the NIC memory. + * Transfer the mbuf chain to the NIC memory. * 16-bit cards require that data be transferred as words, and only words. * So that case requires some extra code to patch over odd-length mbufs. */ @@ -2336,7 +2336,7 @@ ed_pio_write_mbufs(sc, m, dst) /* NE1000s are easy */ while (m) { if (m->m_len) { - outsb(sc->asic_addr + ED_NOVELL_DATA, + outsb(sc->asic_addr + ED_NOVELL_DATA, m->m_data, m->m_len); } m = m->m_next; @@ -2346,7 +2346,7 @@ ed_pio_write_mbufs(sc, m, dst) unsigned char *data; int len, wantbyte; unsigned char savebyte[2]; - + wantbyte = 0; while (m) { @@ -2363,7 +2363,7 @@ ed_pio_write_mbufs(sc, m, dst) } /* output contiguous words */ if (len > 1) { - outsw(sc->asic_addr + ED_NOVELL_DATA, + outsw(sc->asic_addr + ED_NOVELL_DATA, data, len >> 1); data += len & ~1; len &= 1; diff --git a/sys/dev/ed/if_edreg.h b/sys/dev/ed/if_edreg.h index 31f7879..430fa93 100644 --- a/sys/dev/ed/if_edreg.h +++ b/sys/dev/ed/if_edreg.h @@ -6,10 +6,10 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: if_edreg.h,v 1.16 1994/08/04 17:42:35 davidg Exp $ + * $Id: if_edreg.h,v 1.17 1995/01/23 19:06:08 davidg Exp $ */ /* - * National Semiconductor DS8390 NIC register definitions + * National Semiconductor DS8390 NIC register definitions * * * Modification history @@ -26,10 +26,10 @@ * changed double buffering flag to multi buffering * made changes/additions for 3c503 multi-buffering * ...companion to Rev. 2.0 of 'ed' driver. - * + * * Revision 1.1 93/06/23 03:01:07 davidg * Initial revision - * + * */ /* @@ -378,7 +378,7 @@ * algorithm to allow prioritization of nodes. */ #define ED_TCR_OFST 0x10 - + /* * bits 5, 6, and 7 are unused/reserved */ diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index 2aad5d2..ca6baf3 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -13,7 +13,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: eisaconf.c,v 1.1 1995/03/13 09:10:17 root Exp root $ + * $Id: eisaconf.c,v 1.1 1995/04/23 08:55:41 julian Exp $ */ /* @@ -61,7 +61,7 @@ eisa_configure() if (productID & 0x80) { printf("Warning: running EISA kernel on non-EISA system board\n"); return; - } + } printf("Probing for devices on EISA bus\n"); productID = (productID<<8) | inb(eisaBase+1); productRevision = inb(eisaBase+2); diff --git a/sys/dev/eisa/eisaconf.h b/sys/dev/eisa/eisaconf.h index b0a0cbb..9b16c23 100644 --- a/sys/dev/eisa/eisaconf.h +++ b/sys/dev/eisa/eisaconf.h @@ -13,14 +13,14 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: eisaconf.h,v 1.1 1995/03/13 09:10:17 root Exp root $ + * $Id: eisaconf.h,v 1.1 1995/04/23 08:55:42 julian Exp $ */ /* * Ported to run under FreeBSD by Julian Elischer (julian@tfs.com) Sept 1992 */ -#define EISA_SLOTS 10 /* PCI clashes with higher ones.. fix later */ +#define EISA_SLOTS 10 /* PCI clashes with higher ones.. fix later */ struct eisa_dev { char productID[4]; unsigned short productType; diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index de75d41..3b677d6 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -32,13 +32,13 @@ /* * Modified from the FreeBSD 1.1.5.1 version by: - * Andres Vega Garcia + * Andres Vega Garcia * INRIA - Sophia Antipolis, France * avega@sophia.inria.fr */ /* - * $Id: if_ep.c,v 1.26 1995/04/12 20:47:49 wollman Exp $ + * $Id: if_ep.c,v 1.27 1995/05/27 04:40:57 davidg Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -183,7 +183,7 @@ ep_look_for_board_at(is) if (ep_current_tag == (EP_LAST_TAG + 1)) { /* Come here just one time */ - + /* Look for the EISA boards, leave them activated */ for(j = 1; j < 16; j++) { io_base = (j * EP_EISA_START) | EP_EISA_W0; @@ -191,7 +191,7 @@ ep_look_for_board_at(is) continue; /* we must found 0x1f if the board is EISA configurated */ - if ((inw(io_base + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f) + if ((inw(io_base + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f) continue; /* Reset and Enable the card */ @@ -270,7 +270,7 @@ ep_look_for_board_at(is) } else { for (i=0; ep_board[i].epb_addr && ep_board[i].epb_addr != IS_BASE; i++); - if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE) + if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE) return 0; if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE) @@ -455,10 +455,10 @@ epattach(is) sc->rx_avg_pkt = 128; /* - * NOTE: In all this I multiply everything by 64. - * W_s = the speed the CPU is able to write to the TX FIFO. + * NOTE: In all this I multiply everything by 64. + * W_s = the speed the CPU is able to write to the TX FIFO. * T_s = the speed the board sends the info to the Ether. - * W_s/T_s = 16 (represents 16/64) => W_s = 25 % of T_s. + * W_s/T_s = 16 (represents 16/64) => W_s = 25 % of T_s. * This will give us for a packet of 1500 bytes * tx_start_thresh=1125 and for a pkt of 64 bytes tx_start_threshold=48. * We prefer to start thinking the CPU is much slower than the Ethernet @@ -814,7 +814,7 @@ rescan: sc->rx_no_first, sc->rx_no_mbuf, sc->rx_bpf_disc, sc->rx_overrunf, sc->rx_overrunl, sc->tx_underrun); #else - printf("ep%d: Status: %x\n", unit, status); + printf("ep%d: Status: %x\n", unit, status); #endif epinit(unit); splx(x); @@ -865,7 +865,7 @@ rescan: outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */ - if ((status = inw(BASE + EP_STATUS)) & S_5_INTS) + if ((status = inw(BASE + EP_STATUS)) & S_5_INTS) goto rescan; /* re-enable Ints */ @@ -1195,17 +1195,17 @@ epioctl(ifp, cmd, data) sizeof(sc->sc_addr)); break; #endif - case SIOCSIFMTU: + case SIOCSIFMTU: /* * Set the interface MTU. */ - if (ifr->ifr_mtu > ETHERMTU) { - error = EINVAL; + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; } else { - ifp->if_mtu = ifr->ifr_mtu; + ifp->if_mtu = ifr->ifr_mtu; } - break; + break; default: error = EINVAL; diff --git a/sys/dev/ep/if_epreg.h b/sys/dev/ep/if_epreg.h index a905caa..e0b7d09 100644 --- a/sys/dev/ep/if_epreg.h +++ b/sys/dev/ep/if_epreg.h @@ -1,13 +1,13 @@ /* * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. 2. The name * of the author may not be used to endorse or promote products derived from * this software withough specific prior written permission - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -18,20 +18,20 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp Modified by: - * + * October 2, 1994 - - Modified by: Andres Vega Garcia - INRIA - Sophia Antipolis, France - e-mail: avega@sophia.inria.fr + Modified by: Andres Vega Garcia + + INRIA - Sophia Antipolis, France + e-mail: avega@sophia.inria.fr finger: avega@pax.inria.fr */ /* - * $Id: if_epreg.h,v 1.8 1995/04/10 07:48:03 root Exp root $ + * $Id: if_epreg.h,v 1.7 1995/04/10 21:25:06 jkh Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -349,7 +349,7 @@ struct ep_softc { #define SET_IRQ(i) (((i)<<12) | 0xF00) /* set IRQ i */ /* - * FIFO Registers. + * FIFO Registers. * RX Status. Window 1/Port 08 * * 15: Incomplete or FIFO empty. @@ -375,7 +375,7 @@ struct ep_softc { #define ERR_RX_DRIBBLE (u_short) (0x2<<11) /* - * FIFO Registers. + * FIFO Registers. * TX Status. Window 1/Port 0B * * Reports the transmit status of a completed transmission. Writing this @@ -400,7 +400,7 @@ struct ep_softc { #define TXS_STATUS_OVERFLOW 0x4 /* - * Configuration control register. + * Configuration control register. * Window 0/Port 04 */ /* Read */ @@ -411,7 +411,7 @@ struct ep_softc { #define ENABLE_DRQ_IRQ 0x0001 #define W0_P4_CMD_RESET_ADAPTER 0x4 #define W0_P4_CMD_ENABLE_ADAPTER 0x1 -/* +/* * Media type and status. * Window 4/Port 0A */ diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 49d7fdc..be36035 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.59 1995/05/06 19:34:25 joerg Exp $ + * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ * */ @@ -370,7 +370,7 @@ fdc_err(fdcu_t fdcu, const char *s) else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX) printf("fdc%d: too many errors, not logging any more\n", fdcu); - + return FD_FAILED; } @@ -378,7 +378,7 @@ fdc_err(fdcu_t fdcu, const char *s) * fd_cmd: Send a command to the chip. Takes a varargs with this structure: * Unit number, * # of output bytes, output bytes as ints ..., - * # of input bytes, input bytes as ints ... + * # of input bytes, input bytes as ints ... */ int @@ -604,7 +604,7 @@ fdattach(struct isa_device *dev) unithasfd = 1; if (ftattach(dev, fdup, unithasfd)) continue; - if (fdsu < DRVS_PER_CTLR) + if (fdsu < DRVS_PER_CTLR) fd->type = NO_TYPE; #endif continue; @@ -683,9 +683,9 @@ fdattach(struct isa_device *dev) break; /* already probed succesfully */ } } - + set_motor(fdcu, fdsu, TURNOFF); - + if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */ continue; @@ -694,13 +694,13 @@ fdattach(struct isa_device *dev) fd->fdsu = fdsu; fd->options = 0; printf("fd%d: ", fdu); - + fd_registerdev(fdcu, fdu); switch (fdt) { case RTCFDT_12M: printf("1.2MB 5.25in\n"); fd->type = FD_1200; - kdc_fd[fdu].kdc_description = + kdc_fd[fdu].kdc_description = "1.2MB (1200K) 5.25in floppy disk drive"; #ifdef DEVFS sprintf(name,"fd%d.1200",fdu); @@ -787,9 +787,9 @@ set_motor(fdcu_t fdcu, int fdsu, int turnon) { int fdout = fdc_data[fdcu].fdout; int needspecify = 0; - + if(turnon) { - fdout &= ~FDO_FDSEL; + fdout &= ~FDO_FDSEL; fdout |= (FDO_MOEN0 << fdsu) + fdsu; } else fdout &= ~(FDO_MOEN0 << fdsu); @@ -856,7 +856,7 @@ fd_motor_on(void *arg1) } static void -fd_turnon(fdu_t fdu) +fd_turnon(fdu_t fdu) { fd_p fd = fd_data + fdu; if(!(fd->flags & FD_MOTOR)) @@ -871,7 +871,7 @@ static void fdc_reset(fdc_p fdc) { fdcu_t fdcu = fdc->fdcu; - + /* Try a reset, keep motor on */ outb(fdc->baseport + FDOUT, fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); TRACE1("[0x%x->FDOUT]", fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); @@ -978,7 +978,7 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p) return(ftopen(dev, flags)); #endif /* check bounds */ - if (fdu >= NFD) + if (fdu >= NFD) return(ENXIO); fdc = fd_data[fdu].fdc; if ((fdc == NULL) || (fd_data[fdu].type == NO_TYPE)) @@ -1093,7 +1093,7 @@ fdstrategy(struct buf *bp) if (fdc->flags & FDC_TAPE_BUSY) { bp->b_error = EBUSY; bp->b_flags |= B_ERROR; - goto bad; + goto bad; } #endif if (!(bp->b_flags & B_FORMAT)) { @@ -1111,7 +1111,7 @@ fdstrategy(struct buf *bp) goto bad; } } - + /* * Set up block calculations. */ @@ -1262,7 +1262,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) dp = &(fdc->head); bp = dp->b_actf; - if(!bp) + if(!bp) { /***********************************************\ * nothing left for this controller to do * @@ -1469,7 +1469,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) if(format) { /* formatting */ - if(fd_cmd(fdcu, 6, + if(fd_cmd(fdcu, 6, NE7CMD_FORMAT, head << 2 | fdu, finfo->fd_formb_secshift, @@ -1482,7 +1482,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) fdc->retry = 6; return(retrier(fdcu)); } - } + } else { if (fd_cmd(fdcu, 9, @@ -1761,7 +1761,7 @@ fdformat(dev, finfo, p) bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; bp->b_un.b_addr = (caddr_t)finfo; - + /* now do the format */ fdstrategy(bp); @@ -1774,7 +1774,7 @@ fdformat(dev, finfo, p) break; } splx(s); - + if(rv == EWOULDBLOCK) { /* timed out */ rv = EIO; @@ -1890,7 +1890,7 @@ fdioctl(dev, cmd, addr, flag, p) case FD_GOPTS: /* get drive options */ *(int *)addr = fd_data[FDUNIT(minor(dev))].options; break; - + case FD_SOPTS: /* set drive options */ fd_data[FDUNIT(minor(dev))].options = *(int *)addr; break; diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index ab09ce5..80aba82 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -806,7 +806,7 @@ fe_probe_ati ( struct isa_device * isa_dev, struct fe_softc * sc ) /* * Determine the card type. - * There may be a way to identify various models. FIXME. + * There may be a way to identify various models. FIXME. */ sc->type = FE_TYPE_AT1700; sc->typestr = "AT1700/RE2000"; @@ -1552,7 +1552,7 @@ fe_start ( struct ifnet *ifp ) * We *could* do better job by peeking the send queue to * know the length of the next packet. Current version just * tests against the worst case (i.e., longest packet). FIXME. - * + * * When adding the packet-peek feature, don't forget adding a * test on txb_count against QUEUEING_MAX. * There is a little chance the packet count exceeds @@ -1755,7 +1755,7 @@ fe_tint ( struct fe_softc * sc, u_char tstat ) /* * The transmitter is no more active. - * Reset output active flag and watchdog timer. + * Reset output active flag and watchdog timer. */ sc->sc_if.if_flags &= ~IFF_OACTIVE; sc->sc_if.if_timer = 0; @@ -1879,7 +1879,7 @@ fe_rint ( struct fe_softc * sc, u_char rstat ) "fe%d: received a short packet? (%u bytes)\n", sc->sc_unit, len ); } -#endif +#endif /* * Go get a packet. @@ -1920,7 +1920,7 @@ feintr ( int unit ) * Loop until there are no more new interrupt conditions. */ for (;;) { - + #if FE_DEBUG >= 4 fe_dump( LOG_INFO, sc, "intr()" ); #endif @@ -2312,7 +2312,7 @@ fe_get_packet ( struct fe_softc * sc, u_short len ) * * If an mbuf chain is too long for an Ethernet frame, it is not sent. * Packets shorter than Ethernet minimum are legal, and we pad them - * before sending out. An exception is "partial" packets which are + * before sending out. An exception is "partial" packets which are * shorter than mandatory Ethernet header. * * I wrote a code for an experimental "delayed padding" technique. @@ -2403,7 +2403,7 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m ) #endif /* - * Transfer the data from mbuf chain to the transmission buffer. + * Transfer the data from mbuf chain to the transmission buffer. * MB86960 seems to require that data be transferred as words, and * only words. So that we require some extra code to patch * over odd-length mbufs. @@ -2503,7 +2503,7 @@ fe_mcaf ( struct fe_softc *sc ) log( LOG_INFO, "fe%d: hash(%s) == %d\n", sc->sc_unit, ether_sprintf( enm->enm_addrlo ), index ); #endif - + filter.data[index >> 3] |= 1 << (index & 7); ETHER_NEXT_MULTI(step, enm); } @@ -2669,7 +2669,7 @@ fe_setlinkaddr ( struct fe_softc * sc ) { struct ifaddr *ifa; struct sockaddr_dl * sdl; - + /* * Search down the ifa address list looking for the AF_LINK type entry. */ diff --git a/sys/dev/ic/i8237.h b/sys/dev/ic/i8237.h index 722194c..5493ca8 100644 --- a/sys/dev/ic/i8237.h +++ b/sys/dev/ic/i8237.h @@ -1,7 +1,7 @@ /* * Intel 8237 DMA Controller * - * $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $ + * $Id: i8237.h,v 1.3 1994/11/01 17:26:47 ache Exp $ */ #define DMA37MD_SINGLE 0x40 /* single pass mode */ @@ -9,4 +9,4 @@ #define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */ #define DMA37MD_WRITE 0x04 /* read the device, write memory operation */ #define DMA37MD_READ 0x08 /* write the device, read memory operation */ - + diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index 5e85521..8f4b47a 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -43,7 +43,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_ie.c,v 1.22 1995/03/28 07:55:31 bde Exp $ + * $Id: if_ie.c,v 1.23 1995/04/12 20:47:50 wollman Exp $ */ /* @@ -60,7 +60,7 @@ /* * The i82586 is a very versatile chip, found in many implementations. * Programming this chip is mostly the same, but certain details differ - * from card to card. This driver is written so that different cards + * from card to card. This driver is written so that different cards * can be automatically detected at run-time. Currently, only the * AT&T EN100/StarLAN 10 series are supported. */ @@ -231,7 +231,7 @@ const char *ie_hardware_names[] = { "Unknown" }; -/* +/* sizeof(iscp) == 1+1+2+4 == 8 sizeof(scb) == 2+2+2+2+2+2+2+2 == 16 NFRAMES * sizeof(rfd) == NFRAMES*(2+2+2+2+6+6+2+2) == NFRAMES*24 == 384 @@ -274,7 +274,7 @@ struct ie_softc { caddr_t iomembot; unsigned iosize; int bus_use; /* 0 means 16bit, 1 means 8 bit adapter */ - + int want_mcsetup; int promisc; volatile struct ie_int_sys_conf_ptr *iscp; @@ -400,7 +400,7 @@ static int sl_probe(dvp) break; default: - printf("ie%d: unknown AT&T board type code %d\n", unit, + printf("ie%d: unknown AT&T board type code %d\n", unit, ie_softc[unit].hard_type); return 0; } @@ -417,22 +417,22 @@ static int el_probe(dvp) int i; u_char signature[] = "*3COM*"; int unit = dvp->id_unit; - + sc->port = dvp->id_iobase; sc->iomembot = dvp->id_maddr; sc->bus_use = 0; - + /* Need this for part of the probe. */ sc->ie_reset_586 = el_reset_586; sc->ie_chan_attn = el_chan_attn; - + /* Reset and put card in CONFIG state without changing address. */ elink_reset(); outb(ELINK_ID_PORT, 0x00); elink_idseq(ELINK_507_POLY); elink_idseq(ELINK_507_POLY); outb(ELINK_ID_PORT, 0xff); - + c = inb(PORT + IE507_MADDR); if(c & 0x20) { #ifdef DEBUG @@ -440,50 +440,50 @@ static int el_probe(dvp) #endif return 0; } - + /* go to RUN state */ outb(ELINK_ID_PORT, 0x00); elink_idseq(ELINK_507_POLY); outb(ELINK_ID_PORT, 0x00); - + outb(PORT + IE507_CTRL, EL_CTRL_NRST); - + for (i = 0; i < 6; i++) if (inb(PORT + i) != signature[i]) return 0; - + c = inb(PORT + IE507_IRQ) & 0x0f; - + if (dvp->id_irq != (1 << c)) { printf("ie%d: kernel configured irq %d doesn't match board configured irq %d\n", unit, ffs(dvp->id_irq) - 1, c); return 0; } - + c = (inb(PORT + IE507_MADDR) & 0x1c) + 0xc0; - + if (kvtop(dvp->id_maddr) != ((int)c << 12)) { printf("ie%d: kernel configured maddr %lx doesn't match board configured maddr %x\n", unit, kvtop(dvp->id_maddr),(int)c << 12); return 0; } - + outb(PORT + IE507_CTRL, EL_CTRL_NORMAL); - + sc->hard_type = IE_3C507; sc->hard_vers = 0; /* 3C507 has no version number. */ - + /* * Divine memory size on-board the card. */ find_ie_mem_size(unit); - + if (!sc->iosize) { printf("ie%d: can't find shared memory\n", unit); outb(PORT + IE507_CTRL, EL_CTRL_NRST); return 0; } - + if(!dvp->id_msize) dvp->id_msize = sc->iosize; else if (dvp->id_msize != sc->iosize) { @@ -492,12 +492,12 @@ static int el_probe(dvp) outb(PORT + IE507_CTRL, EL_CTRL_NRST); return 0; } - + sl_read_ether(unit, ie_softc[unit].arpcom.ac_enaddr); - + /* Clear the interrupt latch just in case. */ outb(PORT + IE507_ICTRL, 1); - + return 16; } @@ -538,7 +538,7 @@ static int ni_probe(dvp) find_ie_mem_size(unit); if(!ie_softc[unit].iosize) { - return 0; + return 0; } if(!dvp->id_msize) @@ -570,7 +570,7 @@ ieattach(dvp) ifp->if_unit = unit; ifp->if_name = iedriver.name; ifp->if_mtu = ETHERMTU; - printf(" <%s R%d> ethernet address %s\n", + printf(" <%s R%d> ethernet address %s\n", ie_hardware_names[ie_softc[unit].hard_type], ie_softc[unit].hard_vers + 1, ether_sprintf(ie->arpcom.ac_enaddr)); @@ -586,7 +586,7 @@ ieattach(dvp) ifp->if_type = IFT_ETHER; ifp->if_addrlen = 6; ifp->if_hdrlen = 14; - + #if NBPFILTER > 0 bpfattach(&ie_softc[unit].ie_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); @@ -840,7 +840,7 @@ static inline int ether_equal(u_char *one, u_char *two) { * only client which will fiddle with IFF_PROMISC is BPF. This is * probably a good assumption, but we do not make it here. (Yet.) */ -static inline int check_eh(struct ie_softc *ie, +static inline int check_eh(struct ie_softc *ie, struct ether_header *eh, int *to_bpf) { int i; @@ -902,7 +902,7 @@ static inline int check_eh(struct ie_softc *ie, #endif /* We want to see multicasts. */ if(eh->ether_dhost[0] & 1) return 1; - + /* We want to see our own packets */ if(ether_equal(eh->ether_dhost, ie->arpcom.ac_enaddr)) return 1; @@ -1032,7 +1032,7 @@ static inline int ieget(unit, ie, mp, ehp, to_bpf) */ do { /* while(resid > 0) */ /* - * Try to allocate an mbuf to hold the data that we have. If we + * Try to allocate an mbuf to hold the data that we have. If we * already allocated one, just get another one and stick it on the * end (eventually). If we don't already have one, try to allocate * an mbuf cluster big enough to hold the whole packet, if we think it's @@ -1317,12 +1317,12 @@ iestart(ifp) ie->xmit_buffs[ie->xmit_count]->ie_xmit_flags = IE_XMIT_LAST | len; ie->xmit_buffs[ie->xmit_count]->ie_xmit_next = 0xffff; - ie->xmit_buffs[ie->xmit_count]->ie_xmit_buf = + ie->xmit_buffs[ie->xmit_count]->ie_xmit_buf = MK_24(ie->iomem, ie->xmit_cbuffs[ie->xmit_count]); ie->xmit_cmds[ie->xmit_count]->com.ie_cmd_cmd = IE_CMD_XMIT; ie->xmit_cmds[ie->xmit_count]->ie_xmit_status = 0; - ie->xmit_cmds[ie->xmit_count]->ie_xmit_desc = + ie->xmit_cmds[ie->xmit_count]->ie_xmit_desc = MK_16(ie->iomem, ie->xmit_buffs[ie->xmit_count]); *bptr = MK_16(ie->iomem, ie->xmit_cmds[ie->xmit_count]); @@ -1334,7 +1334,7 @@ iestart(ifp) * If we queued up anything for transmission, send it. */ if(ie->xmit_count) { - ie->xmit_cmds[ie->xmit_count - 1]->com.ie_cmd_cmd |= + ie->xmit_cmds[ie->xmit_count - 1]->com.ie_cmd_cmd |= IE_CMD_LAST | IE_CMD_INTR; /* @@ -1369,7 +1369,7 @@ int check_ie_present(unit, where, size) scp = (volatile struct ie_sys_conf_ptr *)(realbase + IE_SCP_ADDR); bzero((char *)scp, sizeof *scp); /* ignore cast-qual */ - + /* * First we put the ISCP at the bottom of memory; this tests to make * sure that our idea of the size of memory is the same as the controller's. @@ -1402,7 +1402,7 @@ int check_ie_present(unit, where, size) * Now relocate the ISCP to its real home, and reset the controller * again. */ - iscp = (void *)Align((caddr_t)(realbase + IE_SCP_ADDR - + iscp = (void *)Align((caddr_t)(realbase + IE_SCP_ADDR - sizeof(struct ie_int_sys_conf_ptr))); bzero((char *)iscp, sizeof *iscp); /* ignore cast-qual */ @@ -1526,7 +1526,7 @@ iereset(unit) ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP; ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0); - + splx(s); return; } @@ -1561,7 +1561,7 @@ static int command_and_wait(unit, cmd, pcmd, mask) extern int hz; ie_softc[unit].scb->ie_command = (u_short)cmd; - + if(IE_ACTION_COMMAND(cmd) && pcmd) { (*ie_softc[unit].ie_chan_attn)(unit); @@ -1589,7 +1589,7 @@ static int command_and_wait(unit, cmd, pcmd, mask) return timedout; } else { - + /* * Otherwise, just wait for the command to be accepted. */ @@ -1624,7 +1624,7 @@ static void run_tdr(unit, cmd) else result = cmd->ie_tdr_time; - ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, + ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, ie_softc[unit].ie_chan_attn); if(result & IE_TDR_SUCCESS) @@ -1633,7 +1633,7 @@ static void run_tdr(unit, cmd) if(result & IE_TDR_XCVR) { printf("ie%d: transceiver problem\n", unit); } else if(result & IE_TDR_OPEN) { - printf("ie%d: TDR detected an open %d clocks away\n", unit, + printf("ie%d: TDR detected an open %d clocks away\n", unit, result & IE_TDR_TIME); } else if(result & IE_TDR_SHORT) { printf("ie%d: TDR detected a short %d clocks away\n", unit, @@ -1674,13 +1674,13 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { } ptr = (caddr_t)Align((caddr_t)rfd); /* ignore cast-qual */ - + /* Now link them together */ for(i = 0; i < NFRAMES; i++) { ie->rframes[i]->ie_fd_next = MK_16(MEM, ie->rframes[(i + 1) % NFRAMES]); } - + /* Finally, set the EOL bit on the last one. */ ie->rframes[NFRAMES - 1]->ie_fd_last |= IE_FD_LAST; @@ -1701,12 +1701,12 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { ptr += IE_RBUF_SIZE; rbd = (void *)ptr; } - + /* Now link them together */ for(i = 0; i < NBUFFS; i++) { ie->rbuffs[i]->ie_rbd_next = MK_16(MEM, ie->rbuffs[(i + 1) % NBUFFS]); } - + /* Tag EOF on the last one */ ie->rbuffs[NBUFFS - 1]->ie_rbd_length |= IE_RBD_LAST; @@ -1728,21 +1728,21 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { * Run the multicast setup command. * Call at splimp(). */ -static int mc_setup(int unit, caddr_t ptr, +static int mc_setup(int unit, caddr_t ptr, volatile struct ie_sys_ctl_block *scb) { struct ie_softc *ie = &ie_softc[unit]; volatile struct ie_mcast_cmd *cmd = (void *)ptr; - + cmd->com.ie_cmd_status = 0; cmd->com.ie_cmd_cmd = IE_CMD_MCAST | IE_CMD_LAST; cmd->com.ie_cmd_link = 0xffff; - + /* ignore cast-qual */ bcopy((caddr_t)ie->mcast_addrs, (caddr_t)cmd->ie_mcast_addrs, ie->mcast_count * sizeof *ie->mcast_addrs); cmd->ie_mcast_bytes = ie->mcast_count * 6; /* grrr... */ - + scb->ie_command_list = MK_16(MEM, cmd); if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { @@ -1934,7 +1934,7 @@ ieioctl(ifp, command, data) ie_stop(ifp->if_unit); } else if((ifp->if_flags & IFF_UP) && (ifp->if_flags & IFF_RUNNING) == 0) { - ie_softc[ifp->if_unit].promisc = + ie_softc[ifp->if_unit].promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); ieinit(ifp->if_unit); } else if(ie_softc[ifp->if_unit].promisc ^ diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c index 942b45a..97225a8 100644 --- a/sys/dev/joy/joy.c +++ b/sys/dev/joy/joy.c @@ -41,7 +41,7 @@ #include <i386/isa/isa_device.h> #include <i386/isa/timerreg.h> -/* The game port can manage 4 buttons and 4 variable resistors (usually 2 +/* The game port can manage 4 buttons and 4 variable resistors (usually 2 * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. * Getting the state of the buttons is done by reading the game port: * buttons 1-4 correspond to bits 4-7 and resistors 1-4 (X1, Y1, X2, Y2) @@ -52,7 +52,7 @@ */ -/* the formulae below only work if u is ``not too large''. See also +/* the formulae below only work if u is ``not too large''. See also * the discussion in microtime.s */ #define usec2ticks(u) (((u) * 19549)>>14) #define ticks2usec(u) (((u) * 3433)>>12) @@ -114,7 +114,7 @@ joyopen (dev_t dev, int flag) joy[unit].timeout[i] = JOY_TIMEOUT; return 0; } -int +int joyclose (dev_t dev, int flag) { int unit = UNIT (dev); @@ -132,7 +132,7 @@ joyread (dev_t dev, struct uio *uio, int flag) int i, t0, t1; int state = 0, x = 0, y = 0; struct joystick c; - + disable_intr (); outb (port, 0xff); t0 = get_tick (); @@ -140,7 +140,7 @@ joyread (dev_t dev, struct uio *uio, int flag) i = usec2ticks(joy[unit].timeout[joypart(dev)]); while (t0-t1 < i) { state = inb (port); - if (joypart(dev) == 1) + if (joypart(dev) == 1) state >>= 2; t1 = get_tick (); if (t1 > t0) @@ -149,7 +149,7 @@ joyread (dev_t dev, struct uio *uio, int flag) x = t1; if (!y && !(state & 0x02)) y = t1; - if (x && y) + if (x && y) break; } enable_intr (); diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index 8477f58..1366236 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -35,28 +35,28 @@ /* #define DIAGNOSTIC #define DEBUG - * + * * TODO ---- * * This driver will need bounce buffer support when dma'ing to mbufs above the * 16Mb mark. - * + * * Check all the XXX comments -- some of them are just things I've left * unfinished rather than "difficult" problems that were hacked around. - * + * * Check log settings. - * + * * Check how all the arpcom flags get set and used. - * + * * Re-inline and re-static all routines after debugging. - * + * * Remember to assign iobase in SHMEM probe routines. - * + * * Replace all occurences of LANCE-controller-card etc in prints by the name * strings of the appropriate type -- nifty window dressing - * - * Add DEPCA support -- mostly done. - * + * + * Add DEPCA support -- mostly done. + * */ #include "lnc.h" @@ -175,7 +175,7 @@ lnc_registerdev(struct isa_device *isa_dev) struct kern_devconf *kdc = &sc->kdc; *kdc = kdc_lnc; kdc->kdc_unit = isa_dev->id_unit; - kdc->kdc_parentdata = isa_dev; + kdc->kdc_parentdata = isa_dev; switch(sc->nic.ic) { case LANCE: @@ -209,7 +209,7 @@ lnc_registerdev(struct isa_device *isa_dev) default: break; } - + dev_attach(kdc); } @@ -270,7 +270,7 @@ alloc_mbuf_cluster(struct lnc_softc *sc, struct host_ring_entry *desc) /* XXX m->m_data = m->m_ext.ext_buf;*/ } else { MGET(m, M_DONTWAIT, MT_DATA); - if (!m) + if (!m) return(1); MCLGET(m, M_DONTWAIT); if (!m->m_ext.ext_buf) { @@ -320,7 +320,7 @@ chain_mbufs(struct lnc_softc *sc, int start_of_packet, int pkt_len) m->m_next = 0; return(head); -} +} inline struct mbuf * mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len) @@ -415,7 +415,7 @@ lnc_rint(int unit) * Therefore, it can be assumed that a complete packet can be found * before hitting buffers that are still owned by the LANCE, if not * then there is a bug in the driver that is causing the descriptors - * to get out of sync. + * to get out of sync. */ #ifdef DIAGNOSTIC @@ -443,8 +443,8 @@ lnc_rint(int unit) * jabber packets can overrun into a second descriptor. * If there is no error, then the ENP flag is set in the last * descriptor of the packet. If there is an error then the ERR - * flag will be set in the descriptor where the error occured. - * Therefore, to find the last buffer of a packet we search for + * flag will be set in the descriptor where the error occured. + * Therefore, to find the last buffer of a packet we search for * either ERR or ENP. */ @@ -533,7 +533,7 @@ lnc_rint(int unit) if (head) { /* - * First mbuf in packet holds the + * First mbuf in packet holds the * ethernet and packet headers */ head->m_pkthdr.rcvif = &sc->arpcom.ac_if; @@ -627,7 +627,7 @@ lnc_tint(int unit) * status will be written into the descriptor that was being accessed * when the error occured and all subsequent descriptors in that * packet will have been relinquished by the LANCE. - * + * * At this point we know that sc->trans_next points to the start * of a packet that the LANCE has just finished trying to transmit. * We now search for a buffer with either ENP or ERR set. @@ -648,7 +648,7 @@ lnc_tint(int unit) #endif /* - * Find end of packet. + * Find end of packet. */ if (!(next->md->md1 & (ENP | MDERR))) { @@ -717,7 +717,7 @@ lnc_tint(int unit) * set then TBUFF will have been cleared above. A * UFLO error will turn off the transmitter so we * have to reset. - * + * */ if (next->md->md3 & UFLO) { @@ -759,7 +759,7 @@ lnc_tint(int unit) * ERR would have also been set and we would have * returned from lnc_tint above. Therefore we can * assume if we arrive here that ONE is valid. - * + * */ if (next->md->md1 & ONE) { @@ -810,7 +810,7 @@ lnc_tint(int unit) } while (sc->pending_transmits && !(next->md->md1 & OWN)); /* - * Clear TINT since we've dealt with all + * Clear TINT since we've dealt with all * the completed transmissions. */ @@ -887,7 +887,7 @@ int i; * There isn't any way to determine if a NIC is a BICC. Basically, if * the lance probe succeeds using the i/o addresses of the BICC then * we assume it's a BICC. - * + * */ sc->rap = isa_dev->id_iobase + BICC_RAP; @@ -1035,14 +1035,14 @@ lnc_attach(struct isa_device * isa_dev) /* * Allocate memory for use by the controller. - * + * * XXX -- the Am7990 and Am79C960 only have 24 address lines and so can * only access the lower 16Mb of physical memory. For the moment we * assume that malloc will allocate memory within the lower 16Mb * range. This is not a very valid assumption but there's nothing * that can be done about it yet. For shared memory NICs this isn't * relevant. - * + * */ lnc_mem_size = ((NDESC(sc->nrdre) + NDESC(sc->ntdre)) * @@ -1139,7 +1139,7 @@ lnc_init(int unit) * on a word boundary),the transmit and receive ring structures (each * entry is 4 words long and must start on a quadword boundary) and * the data buffers. - * + * * The alignment tests are particularly paranoid. */ @@ -1248,7 +1248,7 @@ lnc_init(int unit) * For the Am7990 it controls DMA operations, for the Am79C960 it * controls interrupt masks and transmitter algorithms. In either * case, none of the flags are set. - * + * */ write_csr(unit, CSR3, 0); @@ -1286,13 +1286,13 @@ lnc_init(int unit) * The interrupt flag (INTR) will be set and provided that the interrupt enable * flag (INEA) is also set, the interrupt pin will be driven low when any of * the following occur: - * + * * 1) Completion of the initialisation routine (IDON). 2) The reception of a * packet (RINT). 3) The transmission of a packet (TINT). 4) A transmitter * timeout error (BABL). 5) A missed packet (MISS). 6) A memory error (MERR). - * + * * The interrupt flag is cleared when all of the above conditions are cleared. - * + * * If the driver is reset from this routine then it first checks to see if any * interrupts have ocurred since the reset and handles them before returning. * This is because the NIC may signify a pending interrupt in CSR0 using the @@ -1300,7 +1300,7 @@ lnc_init(int unit) * think it does from reading the data sheets). We may as well deal with * these pending interrupts now rather than get the overhead of another * hardware interrupt immediately upon returning from the interrupt handler. - * + * */ void @@ -1440,7 +1440,7 @@ lnc_start(struct ifnet *ifp) no_entries_needed++; /* - * We try and avoid bcopy as much as possible + * We try and avoid bcopy as much as possible * but there are two cases when we use it. * * 1) If there are not enough free entries in the ring @@ -1452,7 +1452,7 @@ lnc_start(struct ifnet *ifp) * packet so it's necessary to shuffle the mbuf * contents to ensure this. */ - + if (no_entries_needed > (NDESC(sc->ntdre) - sc->pending_transmits)) if (!(head = chain_to_cluster(head))) { @@ -1465,9 +1465,9 @@ lnc_start(struct ifnet *ifp) len = 100 - head->m_len; if (M_TRAILINGSPACE(head) < len) { /* - * Move data to start of data - * area. We assume the first - * mbuf has a packet header + * Move data to start of data + * area. We assume the first + * mbuf has a packet header * and is not a cluster. */ bcopy((caddr_t)head->m_data, (caddr_t)head->m_pktdat, head->m_len); @@ -1564,7 +1564,7 @@ lnc_start(struct ifnet *ifp) } while (sc->pending_transmits < NDESC(sc->ntdre)); /* - * Transmit ring is full so set IFF_OACTIVE + * Transmit ring is full so set IFF_OACTIVE * since we can't buffer any more packets. */ @@ -1633,7 +1633,7 @@ lnc_ioctl(struct ifnet * ifp, int command, caddr_t data) */ lnc_init(ifp->if_unit); } - sc->kdc.kdc_state = + sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) ? DC_BUSY : DC_IDLE); break; #ifdef notyet diff --git a/sys/dev/lnc/if_lncreg.h b/sys/dev/lnc/if_lncreg.h index bbc6c63..fe146ee 100644 --- a/sys/dev/lnc/if_lncreg.h +++ b/sys/dev/lnc/if_lncreg.h @@ -1,6 +1,6 @@ /* * Am7990, Local Area Network Controller for Ethernet (LANCE) - * + * * Copyright (c) 1994, Paul Richards. This software may be used, * modified, copied, distributed, and sold, in both source and binary * form provided that the above copyright and these terms are retained. @@ -35,18 +35,18 @@ #define MISS 0x1000 #define MERR 0x0800 #define RINT 0x0400 -#define TINT 0x0200 -#define IDON 0x0100 +#define TINT 0x0200 +#define IDON 0x0100 #define INTR 0x0080 #define INEA 0x0040 #define RXON 0x0020 #define TXON 0x0010 #define TDMD 0x0008 -#define STOP 0x0004 +#define STOP 0x0004 #define STRT 0x0002 -#define INIT 0x0001 +#define INIT 0x0001 -/* +/* * CSR3 * * Bits 3-15 are reserved. @@ -54,12 +54,12 @@ */ #define BSWP 0x0004 -#define ACON 0x0002 +#define ACON 0x0002 #define BCON 0x0001 /* Initialisation block */ -struct init_block { +struct init_block { u_short mode; /* Mode register */ u_char padr[6]; /* Ethernet address */ u_char ladrf[8]; /* Logical address filter (multicast) */ @@ -88,7 +88,7 @@ struct init_block { #define DTX 0x0002 /* Disable the transmitter */ #define DRX 0x0001 /* Disable the receiver */ -/* +/* * Message Descriptor Structure * * Each transmit or receive descriptor ring entry (RDRE's and TDRE's) @@ -100,14 +100,14 @@ struct init_block { * 3. The status information for that particular buffer. The eight most * significant bits of md1 are collectively termed the STATUS of the * descriptor. - * + * * Descriptor md0 contains LADR 0-15, the low order 16 bits of the 24-bit - * address of the actual data buffer. Bits 0-7 of descriptor md1 contain + * address of the actual data buffer. Bits 0-7 of descriptor md1 contain * HADR, the high order 8-bits of the 24-bit data buffer address. Bits 8-15 * of md1 contain the status flags of the buffer. Descriptor md2 contains the - * buffer byte count in bits 0-11 as a two's complement number and must have + * buffer byte count in bits 0-11 as a two's complement number and must have * 1's written to bits 12-15. For the receive entry md3 has the Message Byte - * Count in bits 0-11, this is the length of the received message and is valid + * Count in bits 0-11, this is the length of the received message and is valid * only when ERR is cleared and ENP is set. For the transmit entry it contains * more status information. * @@ -116,8 +116,8 @@ struct init_block { struct mds { u_short md0; u_short md1; - short md2; - u_short md3; + short md2; + u_short md3; }; /* Receive STATUS flags for md1 */ @@ -147,8 +147,8 @@ struct mds { #define ONE 0x0800 /* Exactly one retry was needed */ #define DEF 0x0400 /* Packet transmit deferred -- channel busy */ -/* - * Transmit status flags for md2 +/* + * Transmit status flags for md2 * * Same as for receive descriptor. * diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index fbe6b13..d976194 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.42 1995/05/09 11:39:40 rgrimes Exp $ + * $Id: mcd.c,v 1.43 1995/05/11 19:26:18 rgrimes Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -249,7 +249,7 @@ int mcd_attach(struct isa_device *dev) { struct mcd_data *cd = mcd_data + dev->id_unit; int i; - + cd->iobase = dev->id_iobase; cd->flags |= MCDINIT; mcd_soft_reset(dev->id_unit); @@ -269,7 +269,7 @@ int mcdopen(dev_t dev) { int unit,part,phys,r,retry; struct mcd_data *cd; - + unit = mcd_unit(dev); if (unit >= NMCD) return ENXIO; @@ -277,7 +277,7 @@ int mcdopen(dev_t dev) cd = mcd_data + unit; part = mcd_part(dev); phys = mcd_phys(dev); - + /* not initialized*/ if (!(cd->flags & MCDINIT)) return ENXIO; @@ -337,7 +337,7 @@ MCD_TRACE("open: partition=%d, disksize = %ld, blksize=%d\n", return ENXIO; return 0; } - + return ENXIO; } @@ -345,7 +345,7 @@ int mcdclose(dev_t dev) { int unit,part,phys; struct mcd_data *cd; - + unit = mcd_unit(dev); if (unit >= NMCD) return ENXIO; @@ -353,7 +353,7 @@ int mcdclose(dev_t dev) cd = mcd_data + unit; part = mcd_part(dev); phys = mcd_phys(dev); - + if (!(cd->flags & MCDINIT)) return ENXIO; @@ -377,7 +377,7 @@ mcdstrategy(struct buf *bp) struct mcd_data *cd; struct buf *qp; int s; - + int unit = mcd_unit(bp->b_dev); cd = mcd_data + unit; @@ -406,11 +406,11 @@ MCD_TRACE("strategy: drive not valid\n"); bp->b_error = EROFS; goto bad; } - + /* no data to read */ if (bp->b_bcount == 0) goto done; - + /* for non raw access, check partition limits */ if (mcd_part(bp->b_dev) != RAW_PART) { if (!(cd->flags & MCDLABEL)) { @@ -425,13 +425,13 @@ MCD_TRACE("strategy: drive not valid\n"); bp->b_pblkno = bp->b_blkno; bp->b_resid = 0; } - + /* queue it */ qp = &cd->head; s = splbio(); disksort(qp,bp); splx(s); - + /* now check whether we can perform processing */ mcd_start(unit); return; @@ -451,7 +451,7 @@ static void mcd_start(int unit) struct partition *p; int part; register s = splbio(); - + if (cd->flags & MCDMBXBSY) { splx(s); return; @@ -495,7 +495,7 @@ int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags) { struct mcd_data *cd; int unit,part; - + unit = mcd_unit(dev); part = mcd_part(dev); cd = mcd_data + unit; @@ -523,7 +523,7 @@ MCD_TRACE("ioctl called 0x%x\n", cmd); return 0; /* - * a bit silly, but someone might want to test something on a + * a bit silly, but someone might want to test something on a * section of cdrom. */ case DIOCWDINFO: @@ -614,10 +614,10 @@ MCD_TRACE("ioctl called 0x%x\n", cmd); static int mcd_getdisklabel(int unit) { struct mcd_data *cd = mcd_data + unit; - + if (cd->flags & MCDLABEL) return -1; - + bzero(&cd->dlabel,sizeof(struct disklabel)); /* filled with spaces first */ strncpy(cd->dlabel.d_typename," ", @@ -642,7 +642,7 @@ static int mcd_getdisklabel(int unit) cd->dlabel.d_magic = DISKMAGIC; cd->dlabel.d_magic2 = DISKMAGIC; cd->dlabel.d_checksum = dkcksum(&cd->dlabel); - + cd->flags |= MCDLABEL; return 0; } @@ -704,7 +704,7 @@ twiddle_thumbs(int port, int unit, int count, char *whine) int mcd_probe(struct isa_device *dev) { - int port = dev->id_iobase; + int port = dev->id_iobase; int unit = dev->id_unit; int i, j; int status; @@ -856,7 +856,7 @@ mcd_get(int unit, char *buf, int nmax) { int port = mcd_data[unit].iobase; int i,k; - + for (i=0; i<nmax; i++) { /* wait for data */ if ((k = mcd_getreply(unit,DELAY_GETREPLY)) < 0) { @@ -873,7 +873,7 @@ mcd_send(int unit, int cmd,int nretrys) { int i,k=0; int port = mcd_data[unit].iobase; - + /*MCD_TRACE("mcd_send: command = 0x%02x\n",cmd,0,0,0);*/ for (i=0; i<nretrys; i++) { outb(port+mcd_command, cmd); @@ -1406,7 +1406,7 @@ mcd_toc_entrys(int unit, struct ioc_read_toc_entry *te) i = te->starting_track; if (i == MCD_LASTPLUS1) i = bcd2bin(cd->volinfo.trk_high) + 1; - + /* verify starting track */ if (i < bcd2bin(cd->volinfo.trk_low) || i > bcd2bin(cd->volinfo.trk_high)+1) { diff --git a/sys/dev/mcd/mcdreg.h b/sys/dev/mcd/mcdreg.h index f8d8598..d5ece62 100644 --- a/sys/dev/mcd/mcdreg.h +++ b/sys/dev/mcd/mcdreg.h @@ -1,7 +1,7 @@ /* * Copyright 1993 by Holger Veit (data part) * Copyright 1993 by Brian Moore (audio part) - * Changes Copyright 1993 by Gary Clark II + * Changes Copyright 1993 by Gary Clark II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ * the manufacturer or anyone else might provide better documentation, * so this file (and the driver) will then have a better quality. * - * $Id: mcdreg.h,v 1.6 1994/12/24 13:24:02 ache Exp $ + * $Id: mcdreg.h,v 1.7 1995/01/30 06:44:40 ache Exp $ */ #ifndef MCD_H diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c index a2c5ef3..4dedadd 100644 --- a/sys/dev/mse/mse.c +++ b/sys/dev/mse/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.10 1995/03/28 07:55:44 bde Exp $ + * $Id: mse.c,v 1.11 1995/04/12 20:47:59 wollman Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -114,9 +114,9 @@ struct mse_softc { #define MSE_SETUP 0x91 /* What does this mean? */ /* The definition for the control port */ /* is as follows: */ - + /* D7 = Mode set flag (1 = active) */ - /* D6,D5 = Mode selection (port A) */ + /* D6,D5 = Mode selection (port A) */ /* 00 = Mode 0 = Basic I/O */ /* 01 = Mode 1 = Strobed I/O */ /* 10 = Mode 2 = Bi-dir bus */ @@ -129,7 +129,7 @@ struct mse_softc { /* D1 = Port B direction (1 = input)*/ /* D0 = Port C (lower 4 bits) */ /* direction. (1 = input) */ - + /* So 91 means Basic I/O on all 3 ports,*/ /* Port A is an input port, B is an */ /* output port, C is split with upper */ @@ -288,7 +288,7 @@ mseclose(dev, flag) return(0); } -/* +/* * mseread: return mouse info using the MSC serial protocol, but without * using bytes 4 and 5. * (Yes this is cheesy, but it makes the X386 server happy, so...) @@ -404,10 +404,10 @@ mseintr(unit) */ if (sc->sc_deltax != 0 || sc->sc_deltay != 0 || (sc->sc_obuttons ^ sc->sc_buttons) != 0) { - if (sc->sc_flags & MSESC_WANT) { - sc->sc_flags &= ~MSESC_WANT; - wakeup((caddr_t)sc); - } + if (sc->sc_flags & MSESC_WANT) { + sc->sc_flags &= ~MSESC_WANT; + wakeup((caddr_t)sc); + } selwakeup(&sc->sc_selp); } } @@ -437,7 +437,7 @@ mse_probelogi(idp) outb(idp->id_iobase + MSE_PORTC, MSE_DISINTR); return(1); } else { - printf("mse%d: wrong signature %x\n",idp->id_unit,sig); + printf("mse%d: wrong signature %x\n",idp->id_unit,sig); return(0); } } diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index e124740..0d0c2f8 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pci.c,v 1.21 1995/03/23 06:14:44 davidg Exp $ +** $Id: pci.c,v 1.22 1995/05/04 06:57:11 davidg Exp $ ** ** General subroutines for the PCI bus. ** pci_configure () @@ -113,7 +113,7 @@ struct pcicb { static int pci_externalize (struct proc *, struct kern_devconf *, void *, size_t); - + static int pci_internalize (struct proc *, struct kern_devconf *, void *, size_t); @@ -234,7 +234,7 @@ pci_register_io (struct pcicb * cb, u_int base, u_int limit) cb->pcicb_pupto = limit; /* - ** XXX should set bridge io mapping here + ** XXX should set bridge io mapping here ** but it can be mapped in 4k blocks only, ** leading to conflicts with isa/eisa .. */ @@ -1097,8 +1097,8 @@ pci_externalize (struct proc *p, struct kern_devconf *kdcp, void *u, size_t l) return copyout(&buffer, u, sizeof buffer); } - - + + static int pci_internalize (struct proc *p, struct kern_devconf *kdcp, void *u, size_t s) { @@ -1476,7 +1476,7 @@ static struct vt VendorTable[] = { static const char *const majclasses[] = { "old", "storage", "network", "display", - "multimedia", "memory", "bridge" + "multimedia", "memory", "bridge" }; void not_supported (pcici_t tag, u_long type) diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index 712c670..207a743 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcivar.h,v 1.4 1995/03/21 23:01:06 se Exp $ +** $Id: pcivar.h,v 1.5 1995/03/25 21:10:38 bde Exp $ ** ** Declarations for pci device drivers. ** @@ -159,8 +159,8 @@ extern unsigned pci_maxdevice; struct pci_info { u_short pi_bus; u_short pi_device; -}; - +}; + #define PCI_EXT_CONF_LEN (16) #define PCI_EXTERNAL_LEN (sizeof(struct pci_externalize_buffer)) diff --git a/sys/dev/ppbus/lptio.h b/sys/dev/ppbus/lptio.h index 7e3df42..a203c7d 100644 --- a/sys/dev/ppbus/lptio.h +++ b/sys/dev/ppbus/lptio.h @@ -1,17 +1,17 @@ /* * Copyright (C) 1994 Geoffrey M. Rehmet * - * This program is free software; you may redistribute it and/or - * modify it, provided that it retain the above copyright notice + * This program is free software; you may redistribute it and/or + * modify it, provided that it retain the above copyright notice * and the following disclaimer. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Geoff Rehmet, Rhodes University, South Africa <csgr@cs.ru.ac.za> * - * $Id$ + * $Id: lpt.h,v 1.2 1994/08/02 07:38:52 davidg Exp $ */ #ifndef _LPT_PRINTER_H_ diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index 8b68956..9f50105 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -41,7 +41,7 @@ */ -/* $Id: scd.c,v 1.3 1995/04/12 20:48:02 wollman Exp $ */ +/* $Id: scd.c,v 1.4 1995/05/09 12:25:58 rgrimes Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -135,7 +135,7 @@ struct scd_data { short first_track; short last_track; struct ioc_play_msf last_play; - + short audio_status; struct buf head; /* head of buf queue */ struct scd_mbx mbx; @@ -213,7 +213,7 @@ int scd_attach(struct isa_device *dev) { struct scd_data *cd = scd_data + dev->id_unit; int i; - + cd->iobase = dev->id_iobase; /* Already set by probe, but ... */ kdc_scd[dev->id_unit].kdc_state = DC_IDLE; @@ -235,7 +235,7 @@ scdopen(dev_t dev) int unit,part,phys; int rc; struct scd_data *cd; - + unit = scd_unit(dev); if (unit >= NSCD) return ENXIO; @@ -243,7 +243,7 @@ scdopen(dev_t dev) cd = scd_data + unit; part = scd_part(dev); phys = scd_phys(dev); - + /* not initialized*/ if (!(cd->flags & SCDINIT)) return ENXIO; @@ -289,7 +289,7 @@ scdclose(dev_t dev) struct scd_data *cd; int rlen; char rdata[10]; - + unit = scd_unit(dev); if (unit >= NSCD) return ENXIO; @@ -297,8 +297,8 @@ scdclose(dev_t dev) cd = scd_data + unit; part = scd_part(dev); phys = scd_phys(dev); - - if (!(cd->flags & SCDINIT) || !cd->openflag) + + if (!(cd->flags & SCDINIT) || !cd->openflag) return ENXIO; if (cd->audio_status != CD_AS_PLAY_IN_PROGRESS) { @@ -346,11 +346,11 @@ scdstrategy(struct buf *bp) bp->b_error = EROFS; goto bad; } - + /* no data to read */ if (bp->b_bcount == 0) goto done; - + if (!(cd->flags & SCDTOC)) { bp->b_error = EIO; goto bad; @@ -361,13 +361,13 @@ scdstrategy(struct buf *bp) bp->b_pblkno = bp->b_blkno; bp->b_resid = 0; - + /* queue it */ qp = &cd->head; s = splbio(); disksort(qp,bp); splx(s); - + /* now check whether we can perform processing */ scd_start(unit); return; @@ -388,7 +388,7 @@ scd_start(int unit) struct partition *p; int part; register s = splbio(); - + if (cd->flags & SCDMBXBSY) { splx(s); return; @@ -423,7 +423,7 @@ scdioctl(dev_t dev, int cmd, caddr_t addr, int flags) { struct scd_data *cd; int unit,part; - + unit = scd_unit(dev); part = scd_part(dev); cd = scd_data + unit; @@ -618,7 +618,7 @@ scd_pause(int unit) if (send_cmd(unit, CMD_STOP_AUDIO, 0) != 0) return EIO; - + cd->last_play.start_m = subpos.abs_msf[0]; cd->last_play.start_s = subpos.abs_msf[1]; cd->last_play.start_f = subpos.abs_msf[2]; @@ -831,7 +831,7 @@ trystat: (caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */ return; } - + process_attention(unit); /* reject, if audio active */ @@ -1184,19 +1184,19 @@ get_tl(struct sony_toc *toc, int size) if (tl->track != 0xb0) return tl; (char *)tl += 9; - if (tl->track != 0xb1) + if (tl->track != 0xb1) return tl; (char *)tl += 9; - if (tl->track != 0xb2) + if (tl->track != 0xb2) return tl; (char *)tl += 9; - if (tl->track != 0xb3) + if (tl->track != 0xb3) return tl; (char *)tl += 9; - if (tl->track != 0xb4) + if (tl->track != 0xb4) return tl; (char *)tl += 9; - if (tl->track != 0xc0) + if (tl->track != 0xc0) return tl; (char *)tl += 9; return tl; @@ -1368,7 +1368,7 @@ send_cmd(u_int unit, u_char cmd, u_int nargs, ...) XDEBUG(1, ("\nscd%d: wparam timeout\n", unit)); return -EIO; } - + va_start(ap, nargs); reg = port + OREG_WPARAMS; for (i = 0; i < nargs; i++) { @@ -1512,7 +1512,7 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te) i = te->starting_track; if (i == SCD_LASTPLUS1) i = cd->last_track + 1; - + /* verify starting track */ if (i < cd->first_track || i > cd->last_track+1) return EINVAL; diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 9764ef6..4ae58cd 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.97 1995/05/07 23:00:02 ache Exp $ + * $Id: sio.c,v 1.98 1995/05/11 19:26:19 rgrimes Exp $ */ #include "sio.h" @@ -630,7 +630,7 @@ sioattach(isdp) #ifdef DSI_SOFT_MODEM if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) { printf(" Digicom Systems, Inc. SoftModem"); - kdc_sio[unit].kdc_description = + kdc_sio[unit].kdc_description = "Serial port: Digicom Systems SoftModem"; goto determined_type; } @@ -1326,15 +1326,15 @@ sioioctl(dev, cmd, data, flag, p) pi = (u_char*)(*(caddr_t*)data); error = copyin(pi,&l,sizeof l); - if(error) + if(error) {return error;}; pi += sizeof l; p = malloc(l,M_TEMP,M_NOWAIT); - if(!p) + if(!p) {return ENOBUFS;} error = copyin(pi,p,l); - if(error) + if(error) {free(p,M_TEMP); return error;}; if(error = LoadSoftModem( MINOR_TO_UNIT(mynor),iobase,l,p)) @@ -2229,7 +2229,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) int int_c,int_k; int data_0188, data_0187; - /* + /* * First see if it is a DSI SoftModem */ if(!((inb(base_io+7) ^ inb(base_io+7) & 0x80))) @@ -2248,8 +2248,8 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) DSI_ERROR("dsp bus not granted"); if(0x01 != (inb(base_io+7) & 0x01)) { - outb(base_io+7,0x18); - outb(base_io+7,0x19); + outb(base_io+7,0x18); + outb(base_io+7,0x19); if(0x01 != (inb(base_io+7) & 0x01)) DSI_ERROR("program mem not granted"); } @@ -2275,14 +2275,14 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+7,0x19); if(0x00 != (inb(base_io+7) & 0x01)) DSI_ERROR("program data not granted"); - + for(int_k = 0 ; int_k < 0x800; int_k++) { outb(base_io+1,*ptr++); outb(base_io+2,0); outb(base_io+1,*ptr++); outb(base_io+2,*ptr++); } - + size -= 0x1800; while(size > 0x1800) { @@ -2299,7 +2299,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - + } else if (size > 0) { if(int_c == 7) { outb(base_io+7,0x18); @@ -2319,7 +2319,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - } + } outb(base_io+7,0x11); outb(base_io+7,3); diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index e36af00..503836b 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -63,7 +63,7 @@ snpwrite(dev, uio, flag) int unit = minor(dev), len, i, error; struct snoop *snp = &snoopsw[unit]; struct tty *tp; - char c[SNP_INPUT_BUF]; + char c[SNP_INPUT_BUF]; if (snp->snp_tty == NULL) return (EIO); @@ -71,16 +71,16 @@ snpwrite(dev, uio, flag) tp = snp->snp_tty; if ((tp->t_sc == snp) && (tp->t_state & TS_SNOOP) && - (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) + (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) goto tty_input; printf("Snoop: attempt to write to bad tty.\n"); return (EIO); tty_input: - if (!(tp->t_state & TS_ISOPEN)) + if (!(tp->t_state & TS_ISOPEN)) return (EIO); - + while (uio->uio_resid > 0) { len = MIN(uio->uio_resid,SNP_INPUT_BUF); if ((error = uiomove(c, len, uio)) != 0) @@ -91,7 +91,7 @@ tty_input: } } return 0; - + } @@ -443,7 +443,7 @@ snpioctl(dev, cmd, data, flag) s = spltty(); if (snp->snp_tty != NULL) *(int *) data = snp->snp_len; - else + else if (snp->snp_flags & SNOOP_DOWN) { if (snp->snp_flags & SNOOP_OFLOW) *(int *) data = SNP_OFLOW; @@ -473,7 +473,7 @@ snpselect(dev, rw, p) if (rw != FREAD) return 1; - + if (snp->snp_len > 0) return 1; diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index 170abb8..4c1f128 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -4,7 +4,7 @@ * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> * - * $Id: spkr.c,v 1.12 1995/03/16 18:12:05 bde Exp $ + * $Id: spkr.c,v 1.13 1995/05/05 06:15:11 davidg Exp $ */ #include "speaker.h" @@ -48,14 +48,14 @@ * | SC1 SC0 | RW1 RW0 | M2 M1 M0 | BCD | * +----------+----------+---------------+-----+ * Counter Write Mode 3 Binary - * Channel 2 LSB first, (Square Wave) Encoding + * Channel 2 LSB first, (Square Wave) Encoding * MSB second */ #define PPI_SPKR 0x03 /* turn these PPI bits on to pass sound */ #define PIT_MODE 0xB6 /* set timer mode for sound generation */ /* - * Magic numbers for timer control. + * Magic numbers for timer control. */ #define TIMER_CLK 1193180L /* corresponds to 18.2 MHz tick rate */ diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 123e2a9..19c572a 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.115 1995/04/28 09:10:56 sos Exp $ + * $Id: syscons.c,v 1.116 1995/05/21 18:30:05 sos Exp $ */ #include "sc.h" @@ -65,7 +65,7 @@ #endif /* this may break on older VGA's but is usefull on real 32 bit systems */ -#define bcopyw bcopy +#define bcopyw bcopy static default_attr user_default = { (FG_LIGHTGREY | BG_BLACK) << 8, @@ -81,7 +81,7 @@ static scr_stat main_console; static scr_stat *console[MAXCONS]; scr_stat *cur_console; static scr_stat *new_scp, *old_scp; -static term_stat kernel_console; +static term_stat kernel_console; static default_attr *current_default; static char init_done = FALSE; static int configuration = 0; @@ -107,7 +107,7 @@ static char *video_mode_ptr = NULL; static u_char kbd_reply = 0; #endif -static u_short mouse_and_mask[16] = { +static u_short mouse_and_mask[16] = { 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 }; @@ -168,7 +168,7 @@ scprobe(struct isa_device *dev) DELAY(10); val = inb(KB_DATA); if (val == KB_ACK || val == KB_ECHO) - goto gotres; + goto gotres; if (val == KB_RESEND) break; } @@ -184,7 +184,7 @@ gotack: val = inb(KB_DATA); if (val == KB_ACK) goto gotack; - if (val != KB_RESET_DONE) + if (val != KB_RESET_DONE) printf("scprobe: keyboard RESET failed %02x\n", val); } #ifdef XT_KEYBOARD @@ -218,8 +218,8 @@ sc_registerdev(struct isa_device *id) dev_attach(&kdc_sc[id->id_unit]); } -#if NAPM > 0 -static int +#if NAPM > 0 +static int scresume(void *dummy) { shfts = 0; @@ -265,7 +265,7 @@ scattach(struct isa_device *dev) bzero(scp->history_head, scp->history_size*sizeof(u_short)); /* initialize cursor stuff */ - draw_cursor(scp, TRUE); + draw_cursor(scp, TRUE); if (crtc_vga && (configuration & CHAR_CURSOR)) set_destructive_cursor(scp, TRUE); @@ -279,12 +279,12 @@ scattach(struct isa_device *dev) if (crtc_vga) if (crtc_addr == MONO_BASE) printf("VGA mono"); - else + else printf("VGA color"); else if (crtc_addr == MONO_BASE) printf("MDA/hercules"); - else + else printf("CGA/EGA"); printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, configuration); @@ -298,7 +298,7 @@ scattach(struct isa_device *dev) return 0; } -struct tty +struct tty *scdevtotty(dev_t dev) { int unit = minor(dev); @@ -310,7 +310,7 @@ struct tty return VIRTUAL_TTY(unit); } -static scr_stat +static scr_stat *get_scr_stat(dev_t dev) { int unit = minor(dev); @@ -332,7 +332,7 @@ get_scr_num() return i < MAXCONS ? i : 0; } -int +int scopen(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -352,8 +352,8 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; scparam(tp, &tp->t_termios); ttsetwater(tp); - } - else + } + else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) return(EBUSY); tp->t_state |= TS_CARR_ON; @@ -363,7 +363,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) return((*linesw[tp->t_line].l_open)(dev, tp)); } -int +int scclose(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -382,8 +382,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) scp->smode.mode = VT_AUTO; } else { - free(scp->scr_buf, M_DEVBUF); - free(scp->history, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); + free(scp->history, M_DEVBUF); free(scp, M_DEVBUF); console[minor(dev)] = NULL; } @@ -394,11 +394,11 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) #endif } (*linesw[tp->t_line].l_close)(tp, flag); - ttyclose(tp); + ttyclose(tp); return(0); } -int +int scread(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -408,7 +408,7 @@ scread(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_read)(tp, uio, flag)); } -int +int scwrite(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -418,7 +418,7 @@ scwrite(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_write)(tp, uio, flag)); } -void +void scintr(int unit) { static struct tty *cur_tty; @@ -461,10 +461,10 @@ scintr(int unit) (*linesw[cur_tty->t_line].l_rint)('[', cur_tty); (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty); break; - } + } } -int +int scparam(struct tty *tp, struct termios *t) { tp->t_ispeed = t->c_ispeed; @@ -473,13 +473,13 @@ scparam(struct tty *tp, struct termios *t) return 0; } -int +int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { int i, error; struct tty *tp; struct trapframe *fp; - scr_stat *scp; + scr_stat *scp; tp = scdevtotty(dev); if (!tp) @@ -498,14 +498,14 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) else *(int*)data = 0; return 0; - + case CONS_CURRENT: /* get current adapter type */ if (crtc_vga) *(int*)data = KD_VGA; else if (crtc_addr == MONO_BASE) *(int*)data = KD_MONO; - else + else *(int*)data = KD_CGA; return 0; @@ -538,7 +538,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case CONS_HISTORY: /* set history size */ if (*data) { - free(scp->history, M_DEVBUF); + free(scp->history, M_DEVBUF); scp->history_size = *(int*)data; if (scp->history_size < scp->ysize) scp->history = NULL; @@ -604,7 +604,7 @@ set_mouse_pos: scp->mouse_xpos = (scp->xsize*8)-1; if (scp->mouse_ypos >= scp->ysize*fontsize) scp->mouse_ypos = (scp->ysize*fontsize)-1; - scp->mouse_pos = scp->scr_buf + + scp->mouse_pos = scp->scr_buf + (scp->mouse_ypos/fontsize)*scp->xsize + scp->mouse_xpos/8; if (scp->status & MOUSE_ENABLED) scp->status |= UPDATE_MOUSE; @@ -664,7 +664,7 @@ set_mouse_pos: case SW_VGA_C80x60: case SW_VGA_M80x60: case SW_B40x25: case SW_C40x25: case SW_B80x25: case SW_C80x25: - case SW_ENH_B40x25: case SW_ENH_C40x25: + case SW_ENH_B40x25: case SW_ENH_C40x25: case SW_ENH_B80x25: case SW_ENH_C80x25: case SW_ENH_B80x43: case SW_ENH_C80x43: @@ -696,26 +696,26 @@ set_mouse_pos: default: if ((cmd & 0xff) > M_VGA_CG320) return EINVAL; - else + else scp->xsize = *(video_mode_ptr+((cmd&0xff)*64)); scp->ysize = *(video_mode_ptr+((cmd&0xff)*64)+1)+1; break; } scp->mode = cmd & 0xff; scp->status &= ~UNKNOWN_MODE; /* text mode */ - free(scp->scr_buf, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short), M_DEVBUF, M_NOWAIT); if (scp == cur_console) set_mode(scp); clear_screen(scp); - if (tp->t_winsize.ws_col != scp->xsize + if (tp->t_winsize.ws_col != scp->xsize || tp->t_winsize.ws_row != scp->ysize) { tp->t_winsize.ws_col = scp->xsize; tp->t_winsize.ws_row = scp->ysize; pgsignal(tp->t_pgrp, SIGWINCH, 1); } - return 0; + return 0; /* GRAPHICS MODES */ case SW_BG320: case SW_BG640: @@ -733,7 +733,7 @@ set_mouse_pos: set_mode(scp); /* clear_graphics();*/ - if (tp->t_winsize.ws_xpixel != scp->xsize + if (tp->t_winsize.ws_xpixel != scp->xsize || tp->t_winsize.ws_ypixel != scp->ysize) { tp->t_winsize.ws_xpixel = scp->xsize; tp->t_winsize.ws_ypixel = scp->ysize; @@ -748,11 +748,11 @@ set_mouse_pos: scp->pid = scp->proc->p_pid; } return 0; - + case VT_GETMODE: /* get screen switcher mode */ bcopy(&scp->smode, data, sizeof(struct vt_mode)); return 0; - + case VT_RELDISP: /* screen switcher ioctl */ switch(*data) { case VT_FALSE: /* user refuses to release screen, abort */ @@ -771,7 +771,7 @@ set_mouse_pos: new_scp->status |= SWITCH_WAIT_ACQ; psignal(new_scp->proc, new_scp->smode.acqsig); } - else + else switch_in_progress = FALSE; return 0; } @@ -797,24 +797,24 @@ set_mouse_pos: *data = i + 1; return 0; } - } + } return EINVAL; case VT_ACTIVATE: /* switch to screen *data */ return switch_scr(scp, (*data) - 1); case VT_WAITACTIVE: /* wait for switch to occur */ - if (*data > MAXCONS || *data < 0) + if (*data > MAXCONS || *data < 0) return EINVAL; - if (minor(dev) == (*data) - 1) + if (minor(dev) == (*data) - 1) return 0; if (*data == 0) { if (scp == cur_console) return 0; } - else + else scp = console[(*data) - 1]; - while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, + while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, "waitvt", 0)) == ERESTART) ; return error; @@ -825,7 +825,7 @@ set_mouse_pos: case KDENABIO: /* allow io operations */ fp = (struct trapframe *)p->p_md.md_regs; fp->tf_eflags |= PSL_IOPL; - return 0; + return 0; case KDDISABIO: /* disallow io operations (default) */ fp = (struct trapframe *)p->p_md.md_regs; @@ -873,7 +873,7 @@ set_mouse_pos: if (!crtc_vga) return ENXIO; scp->border = *data; - if (scp == cur_console) + if (scp == cur_console) set_border(scp->border); return 0; @@ -881,7 +881,7 @@ set_mouse_pos: if (*data >= 0 && *data <= LOCK_KEY_MASK) { scp->status &= ~LOCK_KEY_MASK; scp->status |= *data; - if (scp == cur_console) + if (scp == cur_console) update_leds(scp->status); return 0; } @@ -984,7 +984,7 @@ set_mouse_pos: case SETFKEY: /* set functionkey string */ if (*(u_short*)data < n_fkey_tab) { fkeyarg_t *ptr = (fkeyarg_t*)data; - bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, + bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, min(ptr->flen, MAXFK)); fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK); return 0; @@ -1069,8 +1069,8 @@ set_mouse_pos: return ENXIO; default: break; - } - + } + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); if (error >= 0) return(error); @@ -1080,7 +1080,7 @@ set_mouse_pos: return(ENOTTY); } -void +void scxint(dev_t dev) { struct tty *tp = scdevtotty(dev); @@ -1094,7 +1094,7 @@ scxint(dev_t dev) scstart(tp); } -void +void scstart(struct tty *tp) { struct clist *rbp; @@ -1126,7 +1126,7 @@ scstart(struct tty *tp) splx(s); } -void +void pccnprobe(struct consdev *cp) { int maj; @@ -1141,13 +1141,13 @@ pccnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; } -void +void pccninit(struct consdev *cp) { scinit(); } -void +void pccnputc(dev_t dev, int c) { u_char buf[1]; @@ -1169,7 +1169,7 @@ pccnputc(dev_t dev, int c) scp->term = save; if (scp == cur_console /* && scrn_timer not running */) { if (scp->scr_buf != Crtat && (scp->start <= scp->end)) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->start = scp->xsize * scp->ysize; scp->end = 0; @@ -1179,7 +1179,7 @@ pccnputc(dev_t dev, int c) } } -int +int pccngetc(dev_t dev) { int s = spltty(); /* block scintr while we poll */ @@ -1188,13 +1188,13 @@ pccngetc(dev_t dev) return(c); } -int +int pccncheckc(dev_t dev) { return (scgetc(1) & 0xff); } -static void +static void scrn_timer() { static int cursor_blinkrate; @@ -1205,11 +1205,11 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/10); return; } - + if (!scrn_blanked) { /* update screen image */ if (scp->start <= scp->end) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->status &= ~CURSOR_SHOWN; scp->start = scp->xsize * scp->ysize; @@ -1229,7 +1229,7 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/25); } -static void +static void clear_screen(scr_stat *scp) { move_crsr(scp, 0, 0); @@ -1238,14 +1238,14 @@ clear_screen(scr_stat *scp) mark_all(scp); } -static int +static int switch_scr(scr_stat *scp, u_int next_scr) { if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid))) switch_in_progress = FALSE; - if (next_scr >= MAXCONS || switch_in_progress || - (cur_console->smode.mode == VT_AUTO + if (next_scr >= MAXCONS || switch_in_progress || + (cur_console->smode.mode == VT_AUTO && cur_console->status & UNKNOWN_MODE)) { do_bell(scp, BELL_PITCH, BELL_DURATION); return EINVAL; @@ -1273,7 +1273,7 @@ switch_scr(scr_stat *scp, u_int next_scr) delayed_next_scr = FALSE; return 0; } - + /* has controlling process died? */ if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid))) old_scp->smode.mode = VT_AUTO; @@ -1297,8 +1297,8 @@ switch_scr(scr_stat *scp, u_int next_scr) return 0; } -static void -exchange_scr(void) +static void +exchange_scr(void) { move_crsr(old_scp, old_scp->xpos, old_scp->ypos); cur_console = new_scp; @@ -1327,7 +1327,7 @@ exchange_scr(void) new_scp->status &= ~CURSOR_SHOWN; } -static inline void +static inline void move_crsr(scr_stat *scp, int x, int y) { if (x < 0 || y < 0 || x >= scp->xsize || y >= scp->ysize) @@ -1339,10 +1339,10 @@ move_crsr(scr_stat *scp, int x, int y) mark_for_update(scp, scp->cursor_pos - scp->scr_buf); } -static void +static void scan_esc(scr_stat *scp, u_char c) { - static u_char ansi_col[16] = + static u_char ansi_col[16] = {0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15}; int i, n; u_short *src, *dst, count; @@ -1364,7 +1364,7 @@ scan_esc(scr_stat *scp, u_char c) else { bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize, (scp->ysize - 1) * scp->xsize * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize); mark_all(scp); } @@ -1440,7 +1440,7 @@ scan_esc(scr_stat *scp, u_char c) case 'f': /* Cursor move */ case 'H': - if (scp->term.num_param == 0) + if (scp->term.num_param == 0) move_crsr(scp, 0, 0); else if (scp->term.num_param == 2) move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1); @@ -1454,14 +1454,14 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of display */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->xsize * scp->ysize); break; case 1: /* clear from beginning of display to cursor */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf, + scp->scr_buf, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, 0); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); @@ -1480,21 +1480,21 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of line */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->xsize - scp->xpos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + scp->xsize - scp->xpos); break; case 1: /* clear from beginning of line to cursor */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), (scp->xsize - scp->xpos) + 1); mark_for_update(scp, scp->ypos * scp->xsize); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); break; case 2: /* clear entire line */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), scp->xsize); mark_for_update(scp, scp->ypos * scp->xsize); @@ -1563,11 +1563,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf + (scp->xsize * n), - scp->scr_buf, + bcopyw(scp->scr_buf + (scp->xsize * n), + scp->scr_buf, scp->xsize * (scp->ysize - n) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - n), + scp->scr_buf + scp->xsize * (scp->ysize - n), scp->xsize * n); mark_all(scp); break; @@ -1576,11 +1576,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf, + bcopyw(scp->scr_buf, scp->scr_buf + (scp->xsize * n), - scp->xsize * (scp->ysize - n) * + scp->xsize * (scp->ysize - n) * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize * n); mark_all(scp); break; @@ -1589,8 +1589,8 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->xsize - scp->xpos) n = scp->xsize - scp->xpos; - fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xpos + + fillw(scp->term.cur_attr | scr_map[0x20], + scp->scr_buf + scp->xpos + ((scp->xsize*scp->ypos) * sizeof(u_short)), n); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n); @@ -1600,9 +1600,9 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if ((i = scp->xpos & 0xf8) == scp->xpos) i -= 8*n; - else - i -= 8*(n-1); - if (i < 0) + else + i -= 8*(n-1); + if (i < 0) i = 0; move_crsr(scp, i, scp->ypos); break; @@ -1653,15 +1653,15 @@ scan_esc(scr_stat *scp, u_char c) scp->term.cur_attr = scp->term.rev_attr; break; case 30: case 31: /* set fg color */ - case 32: case 33: case 34: + case 32: case 33: case 34: case 35: case 36: case 37: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0xF8FF) | (ansi_col[(n-30)&7]<<8); break; case 40: case 41: /* set bg color */ - case 42: case 43: case 44: + case 42: case 43: case 44: case 45: case 46: case 47: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0x8FFF) | (ansi_col[(n-40)&7]<<12); break; } @@ -1680,12 +1680,12 @@ scan_esc(scr_stat *scp, u_char c) scp->term.rev_attr = current_default->rev_attr; break; case 1: /* set ansi background */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 2: /* set ansi foreground */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1694,12 +1694,12 @@ scan_esc(scr_stat *scp, u_char c) (scp->term.param[1]&0xFF)<<8; break; case 5: /* set ansi reverse video background */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 6: /* set ansi reverse video foreground */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1764,38 +1764,38 @@ scan_esc(scr_stat *scp, u_char c) configuration &= ~CHAR_CURSOR; } else if (scp->term.num_param == 2) { - scp->cursor_start = scp->term.param[0] & 0x1F; - scp->cursor_end = scp->term.param[1] & 0x1F; + scp->cursor_start = scp->term.param[0] & 0x1F; + scp->cursor_end = scp->term.param[1] & 0x1F; if (configuration & CHAR_CURSOR) set_destructive_cursor(scp, TRUE); } break; case 'F': /* set ansi foreground */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'G': /* set ansi background */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; case 'H': /* set ansi reverse video foreground */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'I': /* set ansi reverse video background */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; } @@ -1803,7 +1803,7 @@ scan_esc(scr_stat *scp, u_char c) scp->term.esc = 0; } -static inline void +static inline void draw_cursor(scr_stat *scp, int show) { if (show && !(scp->status & CURSOR_SHOWN)) { @@ -1836,12 +1836,12 @@ draw_cursor(scr_stat *scp, int show) } } -static void +static void ansi_put(scr_stat *scp, u_char *buf, int len) { u_char *ptr = buf; - if (scp->status & UNKNOWN_MODE) + if (scp->status & UNKNOWN_MODE) return; /* make screensaver happy */ @@ -1945,7 +1945,7 @@ outloop: bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf, scp->xsize * (scp->ysize - 1) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - 1), + scp->scr_buf + scp->xsize * (scp->ysize - 1), scp->xsize); scp->cursor_pos -= scp->xsize; scp->ypos--; @@ -1958,14 +1958,14 @@ outloop: switch_scr(scp, delayed_next_scr - 1); } -static void +static void scinit(void) { u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/sizeof(u_short), was; unsigned hw_cursor; int i; - if (init_done) + if (init_done) return; init_done = TRUE; /* @@ -2033,7 +2033,7 @@ scinit(void) scr_map[i] = i; } -static scr_stat +static scr_stat *alloc_scp() { scr_stat *scp; @@ -2081,7 +2081,7 @@ init_scp(scr_stat *scp) scp->history_size = HISTORY_SIZE; } -static u_char +static u_char *get_fstr(u_int c, u_int *len) { u_int i; @@ -2095,7 +2095,7 @@ static u_char return(fkey_tab[i].str); } -static void +static void update_leds(int which) { int s; @@ -2113,14 +2113,14 @@ update_leds(int which) kbd_cmd(xlate_leds[which & LED_MASK]); splx(s); } - + static void history_to_screen(scr_stat *scp) { int i; for (i=0; i<scp->ysize; i++) - bcopyw(scp->history + (((scp->history_pos - scp->history) + + bcopyw(scp->history + (((scp->history_pos - scp->history) + scp->history_size-((i+1)*scp->xsize))%scp->history_size), scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)), scp->xsize * sizeof(u_short)); @@ -2153,11 +2153,11 @@ history_down_line(scr_stat *scp) } /* - * scgetc(noblock) - get character from keyboard. + * scgetc(noblock) - get character from keyboard. * If noblock = 0 wait until a key is pressed. * Else return NOKEY. */ -u_int +u_int scgetc(int noblock) { u_char scancode, keycode; @@ -2192,9 +2192,9 @@ next_code: switch(scancode) { case 0xB8: /* left alt (compose key) */ if (compose) { - compose = 0; + compose = 0; if (chr > 255) { - do_bell(cur_console, + do_bell(cur_console, BELL_PITCH, BELL_DURATION); chr = 0; } @@ -2209,7 +2209,7 @@ next_code: case 0xE0: case 0xE1: esc_flag = scancode; - goto next_code; + goto next_code; } break; case 0xE0: /* 0xE0 prefix */ @@ -2276,13 +2276,13 @@ next_code: } break; case 0xE1: /* 0xE1 prefix */ - esc_flag = 0; + esc_flag = 0; if (keycode == 0x1D) esc_flag = 0x1D; goto next_code; /* NOT REACHED */ case 0x1D: /* pause / break */ - esc_flag = 0; + esc_flag = 0; if (keycode != 0x45) goto next_code; keycode = 0x68; @@ -2300,7 +2300,7 @@ next_code: /* copy screen into top of history buffer */ for (i=0; i<cur_console->ysize; i++) { - bcopyw(cur_console->scr_buf + (cur_console->xsize * i), + bcopyw(cur_console->scr_buf + (cur_console->xsize * i), cur_console->history_head, cur_console->xsize * sizeof(u_short)); cur_console->history_head += cur_console->xsize; @@ -2319,7 +2319,7 @@ next_code: case 0x4F: /* end key */ cur_console->history_pos = - WRAPHIST(cur_console, cur_console->history_head, + WRAPHIST(cur_console, cur_console->history_head, cur_console->xsize*cur_console->ysize); history_to_screen(cur_console); goto next_code; @@ -2358,10 +2358,10 @@ next_code: case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */ chr = (scancode - 0x40) + chr*10; goto next_code; - case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ + case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ chr = (scancode - 0x47) + chr*10; goto next_code; - case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ + case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ chr = (scancode - 0x4E) + chr*10; goto next_code; case 0x52: /* keypad 0 */ @@ -2370,8 +2370,8 @@ next_code: /* key release, no interest here */ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */ - case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ - case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ + case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ + case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ case 0xD2: /* keypad 0 */ goto next_code; @@ -2381,12 +2381,12 @@ next_code: if (chr) { compose = chr = 0; do_bell(cur_console, BELL_PITCH, BELL_DURATION); - goto next_code; + goto next_code; } break; } } - + state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0)); if ((!agrs && (cur_console->status & ALKED)) || (agrs && !(cur_console->status & ALKED))) @@ -2420,7 +2420,7 @@ next_code: alts &= ~2; break; case NLK: - nlkcnt = 0; + nlkcnt = 0; break; case CLK: clkcnt = 0; @@ -2452,7 +2452,7 @@ next_code: case NLK: if (!nlkcnt) { nlkcnt++; - if (cur_console->status & NLKED) + if (cur_console->status & NLKED) cur_console->status &= ~NLKED; else cur_console->status |= NLKED; @@ -2479,7 +2479,7 @@ next_code: u_short *ptr = cur_console->history_save; for (i=0; i<cur_console->ysize; i++) { - bcopyw(ptr, + bcopyw(ptr, cur_console->scr_buf + (cur_console->xsize*i), cur_console->xsize * sizeof(u_short)); @@ -2495,8 +2495,8 @@ next_code: mark_all(cur_console); } scstart(VIRTUAL_TTY(get_scr_num())); - } - else + } + else cur_console->status |= SLKED; update_leds(cur_console->status); } @@ -2517,9 +2517,9 @@ next_code: break; case RBT: shutdown_nice(); - break; + break; case SUSP: -#if NAPM > 0 +#if NAPM > 0 apm_suspend(); #endif break; @@ -2528,7 +2528,7 @@ next_code: #ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0]->smode.mode == VT_AUTO) - switch_scr(cur_console, 0); + switch_scr(cur_console, 0); Debugger("manual escape to debugger"); return(NOKEY); #else @@ -2569,7 +2569,7 @@ next_code: switch_scr(cur_console, action - F_SCR); break; } - if (action >= F_FN && action <= L_FN) + if (action >= F_FN && action <= L_FN) action |= FKEY; return(action); } @@ -2583,7 +2583,7 @@ next_code: goto next_code; } -int +int scmmap(dev_t dev, int offset, int nprot) { if (offset > 0x20000 - PAGE_SIZE) @@ -2591,19 +2591,19 @@ scmmap(dev_t dev, int offset, int nprot) return i386_btop((VIDEOMEM + offset)); } -static void +static void kbd_wait(void) { int i = 1000; while (i--) { - if ((inb(KB_STAT) & KB_READY) == 0) + if ((inb(KB_STAT) & KB_READY) == 0) break; DELAY (10); } } -static void +static void kbd_cmd(u_char command) { int retry = 5; @@ -2637,7 +2637,7 @@ kbd_cmd(u_char command) } while (retry--); } -static void +static void set_mode(scr_stat *scp) { char *modetable; @@ -2649,11 +2649,11 @@ set_mode(scr_stat *scp) /* setup video hardware for the given mode */ switch (scp->mode) { - case M_VGA_M80x60: + case M_VGA_M80x60: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x60; - case M_VGA_C80x60: + case M_VGA_C80x60: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); special_80x60: special_modetable[2] = 0x08; @@ -2673,7 +2673,7 @@ special_480l: special_modetable[16] = 0x08; special_modetable[17] = 0x3e; special_modetable[26] = 0xea; - special_modetable[28] = 0xdf; + special_modetable[28] = 0xdf; special_modetable[31] = 0xe7; special_modetable[32] = 0x04; modetable = special_modetable; @@ -2685,17 +2685,17 @@ special_480l: case M_ENH_C80x43: bcopyw(video_mode_ptr+(64*M_ENH_C80x25),&special_modetable, 64); -special_80x43: +special_80x43: special_modetable[28] = 87; goto special_80x50; - case M_VGA_M80x50: + case M_VGA_M80x50: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x50; case M_VGA_C80x50: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); -special_80x50: +special_80x50: special_modetable[2] = 8; special_modetable[19] = 7; modetable = special_modetable; @@ -2737,7 +2737,7 @@ setup_mode: case M_CG320_D: case M_CG640_E: case M_CG640x350: case M_ENH_CG640: case M_BG640x480: case M_CG640x480: case M_VGA_CG320: - + set_vgaregs(video_mode_ptr + (scp->mode * 64)); break; @@ -2751,11 +2751,11 @@ setup_mode: return; } -void +void set_border(int color) { inb(crtc_addr+6); /* reset flip-flop */ - outb(ATC, 0x11); outb(ATC, color); + outb(ATC, 0x11); outb(ATC, color); inb(crtc_addr+6); /* reset flip-flop */ outb(ATC, 0x20); /* enable Palette */ } @@ -2768,7 +2768,7 @@ set_vgaregs(char *modetable) outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ outb(TSIDX, 0x07); outb(TSREG, 0x00); /* unlock registers */ for (i=0; i<4; i++) { /* program sequencer */ - outb(TSIDX, i+1); + outb(TSIDX, i+1); outb(TSREG, modetable[i+5]); } outb(MISC, modetable[9]); /* set dot-clock */ @@ -2776,7 +2776,7 @@ set_vgaregs(char *modetable) outb(crtc_addr, 0x11); outb(crtc_addr+1, inb(crtc_addr+1) & 0x7F); for (i=0; i<25; i++) { /* program crtc */ - outb(crtc_addr, i); + outb(crtc_addr, i); if (i == 14 || i == 15) /* no hardware cursor */ outb(crtc_addr+1, 0xff); else @@ -2784,11 +2784,11 @@ set_vgaregs(char *modetable) } inb(crtc_addr+6); /* reset flip-flop */ for (i=0; i<20; i++) { /* program attribute ctrl */ - outb(ATC, i); + outb(ATC, i); outb(ATC, modetable[i+35]); } for (i=0; i<9; i++) { /* program graph data ctrl */ - outb(GDCIDX, i); + outb(GDCIDX, i); outb(GDCREG, modetable[i+55]); } inb(crtc_addr+6); /* reset flip-flop */ @@ -2807,7 +2807,7 @@ set_font_mode() outb(TSIDX, 0x04); outb(TSREG, 0x06); outb(GDCIDX, 0x04); outb(GDCREG, 0x02); outb(GDCIDX, 0x05); outb(GDCREG, 0x00); - outb(GDCIDX, 0x06); outb(GDCREG, 0x05); + outb(GDCIDX, 0x06); outb(GDCREG, 0x05); #else outw(TSIDX, 0x0402); outw(TSIDX, 0x0604); @@ -2849,7 +2849,7 @@ set_normal_mode() splx(s); } -static void +static void copy_font(int operation, int font_type, char* font_image) { int ch, line, segment, fontsize; @@ -2873,11 +2873,11 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */ outb(TSIDX, 0x01); outb(TSREG, val | 0x20); set_font_mode(); - for (ch=0; ch < 256; ch++) - for (line=0; line < fontsize; line++) + for (ch=0; ch < 256; ch++) + for (line=0; line < fontsize; line++) if (operation) *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line) = - font_image[(ch*fontsize)+line]; + font_image[(ch*fontsize)+line]; else font_image[(ch*fontsize)+line] = *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line); @@ -2885,7 +2885,7 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); /* enable screen */ } -static void +static void set_destructive_cursor(scr_stat *scp, int force) { u_char cursor[32]; @@ -2918,7 +2918,7 @@ set_destructive_cursor(scr_stat *scp, int force) bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * font_size), cursor, font_size); for (i=0; i<32; i++) - if ((i >= scp->cursor_start && i <= scp->cursor_end) || + if ((i >= scp->cursor_start && i <= scp->cursor_end) || (scp->cursor_start >= font_size && i == font_size - 1)) cursor[i] |= 0xff; while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ; @@ -3018,25 +3018,25 @@ draw_mouse_image(scr_stat *scp) set_normal_mode(); } -static void +static void save_palette(void) { int i; - outb(PALRADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALRADR, 0x00); + for (i=0x00; i<0x300; i++) palette[i] = inb(PALDATA); inb(crtc_addr+6); /* reset flip/flop */ } -void +void load_palette(void) { int i; outb(PIXMASK, 0xFF); /* no pixelmask */ - outb(PALWADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALWADR, 0x00); + for (i=0x00; i<0x300; i++) outb(PALDATA, palette[i]); inb(crtc_addr+6); /* reset flip/flop */ outb(ATC, 0x20); /* enable palette */ @@ -3052,7 +3052,7 @@ do_bell(scr_stat *scp, int pitch, int duration) blink_in_progress = 4; blink_screen(scp); timeout((timeout_func_t)blink_screen, scp, hz/10); - } + } else sysbeep(pitch, duration); } diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 649b653..4b22de6 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $ + * $Id: syscons.h,v 1.8 1995/04/23 10:15:38 bde Exp $ */ #ifndef SYSCONS_H diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index 310b8e5..d5d2687 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -156,7 +156,7 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p) if (unit >= NVN) { if (vn_options & VN_FOLLOW) - printf("vnopen(0x%lx, 0x%x, 0x%x, %p)\n", + printf("vnopen(0x%lx, 0x%x, 0x%x, %p)\n", dev, flags, mode, p); return(ENOENT); } @@ -184,14 +184,14 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p) label.d_ntracks = 64; label.d_ncylinders = vn->sc_size / (32 * 64); label.d_secpercyl = 32 * 64; - label.d_secperunit = + label.d_secperunit = label.d_partitions[RAW_PART].p_size = vn->sc_size; return (dsopen("vn", dev, mode, &vn->sc_slices, &label, vnstrategy, (ds_setgeom_t *)NULL)); } - if (dkslice(dev) != WHOLE_DISK_SLICE || + if (dkslice(dev) != WHOLE_DISK_SLICE || dkpart(dev) != RAW_PART || mode != S_IFCHR) return (ENXIO); @@ -277,9 +277,9 @@ vnstrategy(struct buf *bp) daddr_t bsize; int flags, resid; caddr_t addr; - + struct buf *nbp; - + nbp = getvnbuf(); bn = dbtob(bn); @@ -359,7 +359,7 @@ vnstrategy(struct buf *bp) putvnbuf(nbp); return; } - + bn += sz; addr += sz; resid -= sz; @@ -409,7 +409,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) if (error != -1) return (error); } - if (dkslice(dev) != WHOLE_DISK_SLICE || + if (dkslice(dev) != WHOLE_DISK_SLICE || dkpart(dev) != RAW_PART) return (ENOTTY); } @@ -456,8 +456,8 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) IFOPT(vn, VN_LABELS) { /* * Reopen so that `ds' knows which devices are open. - * If this is the first VNIOCSET, then we've - * guaranteed that the device is the cdev and that + * If this is the first VNIOCSET, then we've + * guaranteed that the device is the cdev and that * no other slices or labels are open. Otherwise, * we rely on VNIOCCLR not being abused. */ @@ -485,7 +485,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) IFOPT(vn, VN_FOLLOW) printf("vnioctl: CLRed\n"); break; - + case VNIOCGSET: vn_options |= *f; *f = vn_options; @@ -518,7 +518,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) * to this "disk" is essentially as root. Note that credentials may change * if some other uid can write directly to the mapped file (NFS). */ -int +int vnsetcred(struct vn_softc *vn, struct ucred *cred) { struct uio auio; diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c index 9ae15f6..e035ce0 100644 --- a/sys/fs/cd9660/cd9660_lookup.c +++ b/sys/fs/cd9660/cd9660_lookup.c @@ -38,7 +38,7 @@ * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 * * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_lookup.c,v 1.5 1994/09/26 00:32:54 gpalmer Exp $ + * $Id: cd9660_lookup.c,v 1.6 1995/01/16 17:03:23 joerg Exp $ */ #include <sys/param.h> @@ -126,7 +126,7 @@ cd9660_lookup(ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - + bp = NULL; *vpp = NULL; vdp = ap->a_dvp; @@ -134,7 +134,7 @@ cd9660_lookup(ap) imp = dp->i_mnt; lockparent = flags & LOCKPARENT; wantparent = flags & (LOCKPARENT|WANTPARENT); - + /* * Check accessiblity of directory. */ @@ -142,7 +142,7 @@ cd9660_lookup(ap) return (ENOTDIR); if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc))) return (error); - + /* * We now have a segment name to search for, and a directory to search. * @@ -197,7 +197,7 @@ cd9660_lookup(ap) vdp = ITOV(dp); *vpp = NULL; } - + len = cnp->cn_namelen; name = cnp->cn_nameptr; /* @@ -208,7 +208,7 @@ cd9660_lookup(ap) len--; name++; } - + /* * If there is cached information on a previous search of * this directory, pick up where we last left off. @@ -236,7 +236,7 @@ cd9660_lookup(ap) iso_nchstats.ncs_2passes++; } endsearch = roundup(dp->i_size, imp->logical_block_size); - + searchloop: while (dp->i_offset < endsearch) { /* @@ -256,7 +256,7 @@ searchloop: */ ep = (struct iso_directory_record *) (bp->b_un.b_addr + entryoffsetinblock); - + reclen = isonum_711 (ep->length); if (reclen == 0) { /* skip to next block, if any */ @@ -264,26 +264,26 @@ searchloop: roundup(dp->i_offset, imp->logical_block_size); continue; } - + if (reclen < ISO_DIRECTORY_RECORD_SIZE) /* illegal entry, stop */ break; - + if (entryoffsetinblock + reclen > imp->logical_block_size) /* entries are not allowed to cross boundaries */ break; - + /* * Check for a name match. */ namelen = isonum_711(ep->name_len); isoflags = isonum_711(imp->iso_ftype == ISO_FTYPE_HIGH_SIERRA? &ep->date[6]: ep->flags); - + if (reclen < ISO_DIRECTORY_RECORD_SIZE + namelen) /* illegal entry, stop */ break; - + switch (imp->iso_ftype) { default: if (!(isoflags & 4) == !assoc) { @@ -375,13 +375,13 @@ notfound: if (nameiop == CREATE || nameiop == RENAME) return (EJUSTRETURN); return (ENOENT); - + found: if (numdirpasses == 2) iso_nchstats.ncs_pass2++; if (bp != NULL) brelse(bp); - + /* * Found component in pathname. * If the final component of path name, save information @@ -389,7 +389,7 @@ found: */ if ((flags & ISLASTCN) && nameiop == LOOKUP) dp->i_diroff = dp->i_offset; - + /* * Step through the translation in the name. We do not `iput' the * directory because we may need it again if a symbolic link @@ -435,7 +435,7 @@ found: ISO_IUNLOCK(pdp); *vpp = ITOV(tdp); } - + /* * Insert name into cache if appropriate. */ @@ -461,13 +461,13 @@ iso_blkatoff(ip, offset, bpp) int bsize = iso_blksize(imp,ip,lbn); struct buf *bp; int error; - + if ((error = bread(ITOV(ip),lbn,bsize,NOCRED,&bp))) { brelse(bp); *bpp = 0; return (error); } *bpp = bp; - + return (0); } diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c index a6292f3..7b321a7 100644 --- a/sys/fs/cd9660/cd9660_node.c +++ b/sys/fs/cd9660/cd9660_node.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_node.c,v 1.9 1995/02/21 18:41:30 bde Exp $ + * $Id: cd9660_node.c,v 1.10 1995/03/16 18:12:15 bde Exp $ */ #include <sys/param.h> @@ -117,7 +117,7 @@ iso_dmap(dev,ino,create) { struct iso_dnode *dp; union iso_dhead *dh; - + dh = &iso_dhead[DNOHASH(dev, ino)]; for (dp = dh->dh_chain[0]; dp != (struct iso_dnode *)dh; @@ -132,7 +132,7 @@ iso_dmap(dev,ino,create) dp->i_dev = dev; dp->i_number = ino; insque(dp,dh); - + return dp; } @@ -142,7 +142,7 @@ iso_dunmap(dev) { struct iso_dnode *dp, *dq; union iso_dhead *dh; - + for (dh = iso_dhead; dh < iso_dhead + DNOHSZ; dh++) { for (dp = dh->dh_chain[0]; dp != (struct iso_dnode *)dh; @@ -184,7 +184,7 @@ iso_iget(xp, ino, relocated, ipp, isodir) union iso_ihead *ih; int error, result; struct iso_mnt *imp; - + ih = &iso_ihead[INOHASH(dev, ino)]; loop: for (ip = ih->ih_chain[0]; @@ -218,7 +218,7 @@ loop: ip->i_devvp = 0; ip->i_diroff = 0; ip->i_lockf = 0; - + /* * Put it onto its hash chain and lock it so that other requests for * this inode will block if they arrive while we are sleeping waiting @@ -234,7 +234,7 @@ loop: ip->i_mnt = imp; ip->i_devvp = imp->im_devvp; VREF(ip->i_devvp); - + if (relocated) { /* * On relocated directories we must @@ -252,13 +252,13 @@ loop: } isodir = (struct iso_directory_record *)bp->b_un.b_addr; } - + ip->iso_extent = isonum_733(isodir->extent); ip->i_size = isonum_733(isodir->size); ip->iso_start = isonum_711(isodir->ext_attr_length) + ip->iso_extent; - + vp = ITOV(ip); - + /* * Setup time stamp, attribute */ @@ -280,12 +280,12 @@ loop: brelse(bp2); if (bp) brelse(bp); - + /* * Initialize the associated vnode */ vp->v_type = IFTOVT(ip->inode.iso_mode); - + if ( vp->v_type == VFIFO ) { vp->v_op = cd9660_fifoop_p; } else if ( vp->v_type == VCHR || vp->v_type == VBLK ) { @@ -321,10 +321,10 @@ loop: ip = iq; } } - + if (ip->iso_extent == imp->root_extent) vp->v_flag |= VROOT; - + *ipp = ip; return 0; } @@ -336,7 +336,7 @@ int iso_iput(ip) register struct iso_node *ip; { - + if ((ip->i_flag & ILOCKED) == 0) panic("iso_iput"); ISO_IUNLOCK(ip); @@ -357,10 +357,10 @@ cd9660_inactive(ap) struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); int error = 0; - + if (prtactive && vp->v_usecount != 0) vprint("cd9660_inactive: pushing active", vp); - + ip->i_flag = 0; /* * If we are done with the inode, reclaim it @@ -382,7 +382,7 @@ cd9660_reclaim(ap) { register struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); - + if (prtactive && vp->v_usecount != 0) vprint("cd9660_reclaim: pushing active", vp); /* @@ -411,7 +411,7 @@ int iso_ilock(ip) register struct iso_node *ip; { - + while (ip->i_flag & ILOCKED) { ip->i_flag |= IWANT; if (ip->i_spare0 == curproc->p_pid) @@ -458,7 +458,7 @@ cd9660_defattr(isodir,inop,bp,ftype) struct iso_mnt *imp; struct iso_extended_attributes *ap = NULL; int off; - + /* high sierra does not have timezone data, flag is one byte ahead */ if (isonum_711(ftype == ISO_FTYPE_HIGH_SIERRA? &isodir->date[6]: isodir->flags)&2) { @@ -480,7 +480,7 @@ cd9660_defattr(isodir,inop,bp,ftype) } if (bp) { ap = (struct iso_extended_attributes *)bp->b_un.b_addr; - + if (isonum_711(ap->version) == 1) { if (!(ap->perm[0]&0x40)) inop->inode.iso_mode |= VEXEC >> 6; @@ -522,7 +522,7 @@ cd9660_deftstamp(isodir,inop,bp,ftype) struct iso_mnt *imp; struct iso_extended_attributes *ap = NULL; int off; - + if (!bp && ((imp = inop->i_mnt)->im_flags&ISOFSMNT_EXTATT) && (off = isonum_711(isodir->ext_attr_length))) { @@ -531,7 +531,7 @@ cd9660_deftstamp(isodir,inop,bp,ftype) } if (bp) { ap = (struct iso_extended_attributes *)bp->b_un.b_addr; - + if (ftype != ISO_FTYPE_HIGH_SIERRA && isonum_711(ap->version) == 1) { if (!cd9660_tstamp_conv17(ap->ftime,&inop->inode.iso_atime)) @@ -560,7 +560,7 @@ enum ISO_FTYPE ftype; { int crtime, days; int y, m, d, hour, minute, second, tz; - + y = pi[0] + 1900; m = pi[1]; d = pi[2]; @@ -572,7 +572,7 @@ enum ISO_FTYPE ftype; else /* original high sierra misses timezone data */ tz = 0; - + if (y < 1970) { pu->ts_sec = 0; pu->ts_nsec = 0; @@ -590,7 +590,7 @@ enum ISO_FTYPE ftype; days = 367*(y-1960)-7*(y+(m+9)/12)/4-3*((y+(m+9)/12-1)/100+1)/4+275*m/9+d-239; #endif crtime = ((((days * 24) + hour) * 60 + minute) * 60) + second; - + /* timezone offset is unreliable on some disks */ if (-48 <= tz && tz <= 52) crtime -= tz * 15 * 60; @@ -606,7 +606,7 @@ cd9660_chars2ui(begin,len) int len; { unsigned rc; - + for (rc = 0; --len >= 0;) { rc *= 10; rc += *begin++ - '0'; @@ -620,28 +620,28 @@ cd9660_tstamp_conv17(pi,pu) struct timespec *pu; { unsigned char buf[7]; - + /* year:"0001"-"9999" -> -1900 */ buf[0] = cd9660_chars2ui(pi,4) - 1900; - + /* month: " 1"-"12" -> 1 - 12 */ buf[1] = cd9660_chars2ui(pi + 4,2); - + /* day: " 1"-"31" -> 1 - 31 */ buf[2] = cd9660_chars2ui(pi + 6,2); - + /* hour: " 0"-"23" -> 0 - 23 */ buf[3] = cd9660_chars2ui(pi + 8,2); - + /* minute:" 0"-"59" -> 0 - 59 */ buf[4] = cd9660_chars2ui(pi + 10,2); - + /* second:" 0"-"59" -> 0 - 59 */ buf[5] = cd9660_chars2ui(pi + 12,2); - + /* difference of GMT */ buf[6] = pi[16]; - + return cd9660_tstamp_conv7(buf, pu, ISO_FTYPE_DEFAULT); } diff --git a/sys/fs/cd9660/cd9660_rrip.c b/sys/fs/cd9660/cd9660_rrip.c index 87767ea..dca8983 100644 --- a/sys/fs/cd9660/cd9660_rrip.c +++ b/sys/fs/cd9660/cd9660_rrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_rrip.c,v 1.5 1994/09/26 00:32:57 gpalmer Exp $ + * $Id: cd9660_rrip.c,v 1.6 1995/01/16 17:03:26 joerg Exp $ */ #include <sys/param.h> @@ -95,13 +95,13 @@ cd9660_rrip_slink(p,ana) register ISO_RRIP_SLINK_COMPONENT *pcompe; int len, wlen, cont; char *outbuf, *inbuf; - + pcomp = (ISO_RRIP_SLINK_COMPONENT *)p->component; pcompe = (ISO_RRIP_SLINK_COMPONENT *)((char *)p + isonum_711(p->h.length)); len = *ana->outlen; outbuf = ana->outbuf; cont = ana->cont; - + /* * Gathering a Symbolic name from each component with path */ @@ -109,7 +109,7 @@ cd9660_rrip_slink(p,ana) pcomp < pcompe; pcomp = (ISO_RRIP_SLINK_COMPONENT *)((char *)pcomp + ISO_RRIP_SLSIZ + isonum_711(pcomp->clen))) { - + if (!cont) { if (len < ana->maxlen) { len++; @@ -117,29 +117,29 @@ cd9660_rrip_slink(p,ana) } } cont = 0; - + inbuf = ".."; wlen = 0; - + switch (*pcomp->cflag) { - + case ISO_SUSP_CFLAG_CURRENT: /* Inserting Current */ wlen = 1; break; - + case ISO_SUSP_CFLAG_PARENT: /* Inserting Parent */ wlen = 2; break; - + case ISO_SUSP_CFLAG_ROOT: /* Inserting slash for ROOT */ /* start over from beginning(?) */ outbuf -= len; len = 0; break; - + case ISO_SUSP_CFLAG_VOLROOT: /* Inserting a mount point i.e. "/cdrom" */ /* same as above */ @@ -148,13 +148,13 @@ cd9660_rrip_slink(p,ana) inbuf = ana->imp->im_mountp->mnt_stat.f_mntonname; wlen = strlen(inbuf); break; - + case ISO_SUSP_CFLAG_HOST: /* Inserting hostname i.e. "kurt.tools.de" */ inbuf = hostname; wlen = hostnamelen; break; - + case ISO_SUSP_CFLAG_CONTINUE: cont = 1; /* fall thru */ @@ -168,7 +168,7 @@ cd9660_rrip_slink(p,ana) wlen = ana->maxlen + 1; break; } - + if (len + wlen > ana->maxlen) { /* indicate error to caller */ ana->cont = 1; @@ -177,16 +177,16 @@ cd9660_rrip_slink(p,ana) *ana->outlen = 0; return 0; } - + bcopy(inbuf,outbuf,wlen); outbuf += wlen; len += wlen; - + } ana->outbuf = outbuf; *ana->outlen = len; ana->cont = cont; - + if (!isonum_711(p->flags)) { ana->fields &= ~ISO_SUSP_SLINK; return ISO_SUSP_SLINK; @@ -205,28 +205,28 @@ cd9660_rrip_altname(p,ana) char *inbuf; int wlen; int cont; - + inbuf = ".."; wlen = 0; cont = 0; - + switch (*p->flags) { case ISO_SUSP_CFLAG_CURRENT: /* Inserting Current */ wlen = 1; break; - + case ISO_SUSP_CFLAG_PARENT: /* Inserting Parent */ wlen = 2; break; - + case ISO_SUSP_CFLAG_HOST: /* Inserting hostname i.e. "kurt.tools.de" */ inbuf = hostname; wlen = hostnamelen; break; - + case ISO_SUSP_CFLAG_CONTINUE: cont = 1; /* fall thru */ @@ -235,13 +235,13 @@ cd9660_rrip_altname(p,ana) wlen = isonum_711(p->h.length) - 5; inbuf = (char *)p + 5; break; - + default: printf("RRIP with incorrect NM flags?\n"); wlen = ana->maxlen + 1; break; } - + if ((*ana->outlen += wlen) > ana->maxlen) { /* treat as no name field */ ana->fields &= ~ISO_SUSP_ALTNAME; @@ -249,10 +249,10 @@ cd9660_rrip_altname(p,ana) *ana->outlen = 0; return 0; } - + bcopy(inbuf,ana->outbuf,wlen); ana->outbuf += wlen; - + if (!cont) { ana->fields &= ~ISO_SUSP_ALTNAME; return ISO_SUSP_ALTNAME; @@ -314,55 +314,55 @@ cd9660_rrip_tstamp(p,ana) ISO_RRIP_ANALYZE *ana; { unsigned char *ptime; - + ptime = p->time; - + /* Check a format of time stamp (7bytes/17bytes) */ if (!(*p->flags&ISO_SUSP_TSTAMP_FORM17)) { if (*p->flags&ISO_SUSP_TSTAMP_CREAT) ptime += 7; - + if (*p->flags&ISO_SUSP_TSTAMP_MODIFY) { cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_mtime, ISO_FTYPE_RRIP); ptime += 7; } else bzero(&ana->inop->inode.iso_mtime,sizeof(struct timespec)); - + if (*p->flags&ISO_SUSP_TSTAMP_ACCESS) { cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_atime, ISO_FTYPE_RRIP); ptime += 7; } else ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime; - + if (*p->flags&ISO_SUSP_TSTAMP_ATTR) cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_ctime, ISO_FTYPE_RRIP); else ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime; - + } else { if (*p->flags&ISO_SUSP_TSTAMP_CREAT) ptime += 17; - + if (*p->flags&ISO_SUSP_TSTAMP_MODIFY) { cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_mtime); ptime += 17; } else bzero(&ana->inop->inode.iso_mtime,sizeof(struct timespec)); - + if (*p->flags&ISO_SUSP_TSTAMP_ACCESS) { cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_atime); ptime += 17; } else ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime; - + if (*p->flags&ISO_SUSP_TSTAMP_ATTR) cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_ctime); else ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime; - + } ana->fields &= ~ISO_SUSP_TSTAMP; return ISO_SUSP_TSTAMP; @@ -385,10 +385,10 @@ cd9660_rrip_device(p,ana) ISO_RRIP_ANALYZE *ana; { unsigned high, low; - + high = isonum_733(p->dev_t_high_l); low = isonum_733(p->dev_t_low_l); - + if ( high == 0 ) { ana->inop->inode.iso_rdev = makedev( major(low), minor(low) ); } else { @@ -410,7 +410,7 @@ cd9660_rrip_idflag(p,ana) /* special handling of RE field */ if (ana->fields&ISO_SUSP_RELDIR) return cd9660_rrip_reldir(p,ana); - + return ISO_SUSP_IDFLAG; } @@ -476,7 +476,7 @@ cd9660_rrip_loop(isodir,ana,table) struct buf *bp = NULL; char *pwhead; int result; - + /* * Note: If name length is odd, * it will be padding 1 byte after the name @@ -484,23 +484,23 @@ cd9660_rrip_loop(isodir,ana,table) pwhead = isodir->name + isonum_711(isodir->name_len); if (!(isonum_711(isodir->name_len)&1)) pwhead++; - + /* If it's not the '.' entry of the root dir obey SP field */ if (*isodir->name != 0 || isonum_733(isodir->extent) != ana->imp->root_extent) pwhead += ana->imp->rr_skip; else pwhead += ana->imp->rr_skip0; - + phead = (ISO_SUSP_HEADER *)pwhead; pend = (ISO_SUSP_HEADER *)((char *)isodir + isonum_711(isodir->length)); - + result = 0; while (1) { ana->iso_ce_len = 0; /* * Note: "pend" should be more than one SUSP header - */ + */ while (pend >= phead + 1) { if (isonum_711(phead->version) == 1) { for (ptable = table; ptable->func; ptable++) { @@ -519,7 +519,7 @@ cd9660_rrip_loop(isodir,ana,table) */ phead = (ISO_SUSP_HEADER *)((char *)phead + isonum_711(phead->length)); } - + if ( ana->fields && ana->iso_ce_len ) { if (ana->iso_ce_blk >= ana->imp->volume_space_size || ana->iso_ce_off + ana->iso_ce_len > ana->imp->logical_block_size @@ -542,7 +542,7 @@ cd9660_rrip_loop(isodir,ana,table) for (ptable = table; ptable->func2; ptable++) if (!(ptable->result&result)) ptable->func2(isodir,ana); - + return result; } @@ -563,17 +563,17 @@ cd9660_rrip_analyze(isodir,inop,imp) struct iso_mnt *imp; { ISO_RRIP_ANALYZE analyze; - + analyze.inop = inop; analyze.imp = imp; analyze.fields = ISO_SUSP_ATTR|ISO_SUSP_TSTAMP|ISO_SUSP_DEVICE; - + return cd9660_rrip_loop(isodir,&analyze,rrip_table_analyze); } -/* - * Get Alternate Name from 'AL' record - * If either no AL record or 0 length, +/* + * Get Alternate Name from 'AL' record + * If either no AL record or 0 length, * it will be return the translated ISO9660 name, */ static RRIP_TABLE rrip_table_getname[] = { @@ -597,7 +597,7 @@ cd9660_rrip_getname(isodir,outbuf,outlen,inump,imp) { ISO_RRIP_ANALYZE analyze; RRIP_TABLE *tab; - + analyze.outbuf = outbuf; analyze.outlen = outlen; analyze.maxlen = NAME_MAX; @@ -605,21 +605,21 @@ cd9660_rrip_getname(isodir,outbuf,outlen,inump,imp) analyze.imp = imp; analyze.fields = ISO_SUSP_ALTNAME|ISO_SUSP_RELDIR|ISO_SUSP_CLINK|ISO_SUSP_PLINK; *outlen = 0; - + tab = rrip_table_getname; if (*isodir->name == 0 || *isodir->name == 1) { cd9660_rrip_defname(isodir,&analyze); - + analyze.fields &= ~ISO_SUSP_ALTNAME; tab++; } - + return cd9660_rrip_loop(isodir,&analyze,tab); } -/* - * Get Symbolic Name from 'SL' record +/* + * Get Symbolic Name from 'SL' record * * Note: isodir should contains SL record! */ @@ -639,7 +639,7 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) struct iso_mnt *imp; { ISO_RRIP_ANALYZE analyze; - + analyze.outbuf = outbuf; analyze.outlen = outlen; *outlen = 0; @@ -647,7 +647,7 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) analyze.cont = 1; /* don't start with a slash */ analyze.imp = imp; analyze.fields = ISO_SUSP_SLINK; - + return (cd9660_rrip_loop(isodir,&analyze,rrip_table_getsymname)&ISO_SUSP_SLINK); } @@ -669,7 +669,7 @@ cd9660_rrip_offset(isodir,imp) { ISO_RRIP_OFFSET *p; ISO_RRIP_ANALYZE analyze; - + imp->rr_skip0 = 0; p = (ISO_RRIP_OFFSET *)(isodir->name + 1); if (bcmp(p,"SP\7\1\276\357",6)) { @@ -679,11 +679,11 @@ cd9660_rrip_offset(isodir,imp) if (bcmp(p,"SP\7\1\276\357",6)) return -1; } - + analyze.imp = imp; analyze.fields = ISO_SUSP_EXTREF; if (!(cd9660_rrip_loop(isodir,&analyze,rrip_table_extref)&ISO_SUSP_EXTREF)) return -1; - + return isonum_711(p->skip); } diff --git a/sys/fs/cd9660/cd9660_util.c b/sys/fs/cd9660/cd9660_util.c index 52a80d7..3d58e4e 100644 --- a/sys/fs/cd9660/cd9660_util.c +++ b/sys/fs/cd9660/cd9660_util.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_util.c 8.1 (Berkeley) 1/21/94 - * $Id$ + * $Id: cd9660_util.c,v 1.3 1994/08/02 07:41:31 davidg Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ isofncmp(unsigned char *fn,int fnlen,unsigned char *isofn,int isolen) { int i, j; unsigned char c; - + while (--fnlen >= 0) { if (--isolen < 0) return *fn; @@ -216,14 +216,14 @@ isofntrans(unsigned char *infn,int infnlen, int original,int assoc) { int fnidx = 0; - + if (assoc) { *outfn++ = ASSOCCHAR; fnidx++; } for (; fnidx < infnlen; fnidx++) { char c = *infn++; - + if (!original && c >= 'A' && c <= 'Z') *outfn++ = c + ('a' - 'A'); else if (!original && c == '.' && *infn == ';') diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 8fc30a8..afa08f4 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.3 (Berkeley) 1/31/94 - * $Id: cd9660_vfsops.c,v 1.11 1995/03/16 20:23:24 wollman Exp $ + * $Id: cd9660_vfsops.c,v 1.12 1995/05/19 03:25:35 davidg Exp $ */ #include <sys/param.h> @@ -92,7 +92,7 @@ cd9660_mountroot() u_int size; int error; struct iso_args args; - + /* * Get vnode for rootdev. */ @@ -152,13 +152,13 @@ cd9660_mount(mp, path, data, ndp, p) u_int size; int error; struct iso_mnt *imp = 0; - + if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)))) return (error); - + if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EROFS); - + /* * If updating, check whether changing from read-only to * read/write; if there is no device name, that's all we do. @@ -233,10 +233,10 @@ iso_mountfs(devvp, mp, p, argp) struct iso_sierra_primary_descriptor *pri_sierra; struct iso_directory_record *rootp; int logical_block_size; - + if (!ronly) return EROFS; - + /* * Disallow multiple mounts of the same device. * Disallow mounting of a device that is currently in use @@ -253,18 +253,18 @@ iso_mountfs(devvp, mp, p, argp) if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p))) return error; needclose = 1; - + /* This is the "logical sector size". The standard says this * should be 2048 or the physical sector size on the device, * whichever is greater. For now, we'll just use a constant. */ iso_bsize = ISO_DEFAULT_BLOCK_SIZE; - + for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) { if ((error = bread (devvp, btodb(iso_blknum * iso_bsize), iso_bsize, NOCRED, &bp))) goto out; - + vdp = (struct iso_volume_descriptor *)bp->b_un.b_addr; if (bcmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) != 0) { if (bcmp (vdp->id_sierra, ISO_SIERRA_ID, @@ -274,41 +274,41 @@ iso_mountfs(devvp, mp, p, argp) } else high_sierra = 1; } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) { error = EINVAL; goto out; } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY) break; brelse(bp); } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) { error = EINVAL; goto out; } - + pri = (struct iso_primary_descriptor *)vdp; pri_sierra = (struct iso_sierra_primary_descriptor *)vdp; - + logical_block_size = isonum_723 (high_sierra? pri_sierra->logical_block_size: pri->logical_block_size); - + if (logical_block_size < DEV_BSIZE || logical_block_size > MAXBSIZE || (logical_block_size & (logical_block_size - 1)) != 0) { error = EINVAL; goto out; } - + rootp = (struct iso_directory_record *) (high_sierra? pri_sierra->root_directory_record: pri->root_directory_record); - + isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK); bzero((caddr_t)isomp, sizeof *isomp); isomp->logical_block_size = logical_block_size; @@ -319,16 +319,16 @@ iso_mountfs(devvp, mp, p, argp) bcopy (rootp, isomp->root, sizeof isomp->root); isomp->root_extent = isonum_733 (rootp->extent); isomp->root_size = isonum_733 (rootp->size); - + isomp->im_bmask = logical_block_size - 1; isomp->im_bshift = 0; while ((1 << isomp->im_bshift) < isomp->logical_block_size) isomp->im_bshift++; - + bp->b_flags |= B_AGE; brelse(bp); bp = NULL; - + mp->mnt_data = (qaddr_t)isomp; mp->mnt_stat.f_fsid.val[0] = (long)dev; mp->mnt_stat.f_fsid.val[1] = MOUNT_CD9660; @@ -337,9 +337,9 @@ iso_mountfs(devvp, mp, p, argp) isomp->im_mountp = mp; isomp->im_dev = dev; isomp->im_devvp = devvp; - + devvp->v_specflags |= SI_MOUNTEDON; - + /* Check the Rock Ridge Extention support */ if (!(argp->flags & ISOFSMNT_NORRIP)) { if ((error = bread (isomp->im_devvp, @@ -347,15 +347,15 @@ iso_mountfs(devvp, mp, p, argp) * isomp->logical_block_size / DEV_BSIZE, isomp->logical_block_size,NOCRED,&bp))) goto out; - + rootp = (struct iso_directory_record *)bp->b_un.b_addr; - + if ((isomp->rr_skip = cd9660_rrip_offset(rootp,isomp)) < 0) { argp->flags |= ISOFSMNT_NORRIP; } else { argp->flags &= ~ISOFSMNT_GENS; } - + /* * The contents are valid, * but they will get reread as part of another vnode, so... @@ -381,7 +381,7 @@ iso_mountfs(devvp, mp, p, argp) isomp->iso_ftype = ISO_FTYPE_RRIP; break; } - + return 0; out: if (bp) @@ -420,7 +420,7 @@ cd9660_unmount(mp, mntflags, p) { register struct iso_mnt *isomp; int error, flags = 0; - + if (mntflags & MNT_FORCE) { if (!iso_doforce) return (EINVAL); @@ -440,7 +440,7 @@ cd9660_unmount(mp, mntflags, p) if (isomp->iso_ftype == ISO_FTYPE_RRIP) iso_dunmap(isomp->im_dev); #endif - + isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON; error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p); vrele(isomp->im_devvp); @@ -464,7 +464,7 @@ cd9660_root(mp, vpp) int error; struct iso_mnt *imp = VFSTOISOFS (mp); struct iso_directory_record *dp; - + tvp.v_mount = mp; tvp.v_data = &tip; ip = VTOI(&tvp); @@ -473,7 +473,7 @@ cd9660_root(mp, vpp) ip->i_diroff = 0; dp = (struct iso_directory_record *)imp->root; isodirino(&ip->i_number,dp,imp); - + /* * With RRIP we must use the `.' entry of the root directory. * Simply tell iget, that it's a relocated directory. @@ -513,9 +513,9 @@ cd9660_statfs(mp, sbp, p) struct proc *p; { register struct iso_mnt *isomp; - + isomp = VFSTOISOFS(mp); - + sbp->f_type = MOUNT_CD9660; sbp->f_bsize = isomp->logical_block_size; sbp->f_iosize = sbp->f_bsize; /* XXX */ @@ -597,15 +597,15 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) struct iso_directory_record *dirp; struct iso_node tip, *ip, *nip; struct netcred *np; - + imp = VFSTOISOFS (mp); ifhp = (struct ifid *)fhp; - + #ifdef ISOFS_DBG printf("fhtovp: ino %d, start %ld\n", ifhp->ifid_ino, ifhp->ifid_start); #endif - + np = vfs_export_lookup(mp, &imp->im_export, nam); if (np == NULL) return (EACCES); @@ -615,14 +615,14 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) printf("fhtovp: lbn exceed volume space %d\n", lbn); return (ESTALE); } - + off = iso_blkoff(imp, ifhp->ifid_ino); if (off + ISO_DIRECTORY_RECORD_SIZE > imp->logical_block_size) { printf("fhtovp: crosses block boundary %d\n", off + ISO_DIRECTORY_RECORD_SIZE); return (ESTALE); } - + error = bread(imp->im_devvp, btodb(lbn * imp->logical_block_size), imp->logical_block_size, NOCRED, &bp); if (error) { @@ -630,7 +630,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) brelse(bp); return (error); } - + dirp = (struct iso_directory_record *)(bp->b_un.b_addr + off); if (off + isonum_711(dirp->length) > imp->logical_block_size) { brelse(bp); @@ -639,7 +639,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) isonum_711(dirp->length)); return (ESTALE); } - + if (isonum_733(dirp->extent) + isonum_711(dirp->ext_attr_length) != ifhp->ifid_start) { brelse(bp); @@ -649,7 +649,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) return (ESTALE); } brelse(bp); - + ip = &tip; tvp.v_mount = mp; tvp.v_data = ip; @@ -687,13 +687,13 @@ cd9660_vptofh(vp, fhp) { register struct iso_node *ip = VTOI(vp); register struct ifid *ifhp; - + ifhp = (struct ifid *)fhp; ifhp->ifid_len = sizeof(struct ifid); - + ifhp->ifid_ino = ip->i_number; ifhp->ifid_start = ip->iso_start; - + #ifdef ISOFS_DBG printf("vptofh: ino %d, start %ld\n", ifhp->ifid_ino,ifhp->ifid_start); diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 5e403e3..3b538a8 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.12 1995/02/13 06:12:32 phk Exp $ + * $Id: cd9660_vnops.c,v 1.13 1995/03/28 07:46:38 phk Exp $ */ #include <sys/param.h> @@ -81,10 +81,10 @@ cd9660_mknod(ndp, vap, cred, p) struct iso_node *ip; struct iso_dnode *dp; int error; - + vp = ndp->ni_vp; ip = VTOI(vp); - + if (ip->i_mnt->iso_ftype != ISO_FTYPE_RRIP || vap->va_type != vp->v_type || (vap->va_type != VCHR && vap->va_type != VBLK)) { @@ -93,7 +93,7 @@ cd9660_mknod(ndp, vap, cred, p) vput(ndp->ni_vp); return EINVAL; } - + dp = iso_dmap(ip->i_dev,ip->i_number,1); if (ip->inode.iso_rdev == vap->va_rdev || vap->va_rdev == VNOVAL) { /* same as the unmapped one, delete the mapping */ @@ -102,7 +102,7 @@ cd9660_mknod(ndp, vap, cred, p) } else /* enter new mapping */ dp->d_dev = vap->va_rdev; - + /* * Remove inode so that it will be reloaded by iget and * checked to see if it is an alias of an existing entry @@ -237,7 +237,7 @@ cd9660_read(ap) off_t diff; int rasize, error = 0; long size, n, on; - + if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) @@ -260,7 +260,7 @@ cd9660_read(ap) if (iso_lblktosize(imp, rablock) <= ip->i_size) error = cluster_read(vp, (off_t)ip->i_size, lbn, size, NOCRED, &bp); - else + else error = bread(vp, lbn, size, NOCRED, &bp); } else { if (vp->v_lastr + 1 == lbn && @@ -380,25 +380,25 @@ iso_uiodir(idp,dp,off) off_t off; { int error; - + dp->d_name[dp->d_namlen] = 0; dp->d_reclen = DIRSIZ(dp); - + if (idp->uio->uio_resid < dp->d_reclen) { idp->eof = 0; return -1; } - + if (idp->cookiep) { if (idp->ncookies <= 0) { idp->eof = 0; return -1; } - + *idp->cookiep++ = off; --idp->ncookies; } - + if ((error = uiomove((caddr_t)dp,dp->d_reclen,idp->uio))) return error; idp->uio_off = off; @@ -413,7 +413,7 @@ iso_shipdir(idp) int cl, sl, assoc; int error; char *cname, *sname; - + cl = idp->current.d_namlen; cname = idp->current.d_name; assoc = (cl > 1) && (*cname == ASSOCCHAR); @@ -421,7 +421,7 @@ assoc = (cl > 1) && (*cname == ASSOCCHAR); cl--; cname++; } - + dp = &idp->saveent; sname = dp->d_name; if (!(sl = dp->d_namlen)) { @@ -483,10 +483,10 @@ cd9660_readdir(ap) u_short tmplen; int ncookies = 0; u_int *cookies = NULL; - + ip = VTOI(ap->a_vp); imp = ip->i_mnt; - + MALLOC(idp,struct isoreaddir *,sizeof(*idp),M_TEMP,M_WAITOK); idp->saveent.d_namlen = 0; idp->assocent.d_namlen = 0; @@ -503,7 +503,7 @@ cd9660_readdir(ap) idp->cookiep = 0; idp->eof = 0; idp->curroff = uio->uio_offset; - + entryoffsetinblock = iso_blkoff(imp, idp->curroff); if (entryoffsetinblock != 0) { if ((error = iso_blkatoff(ip, idp->curroff, &bp))) { @@ -511,16 +511,16 @@ cd9660_readdir(ap) return (error); } } - + endsearch = ip->i_size; - + while (idp->curroff < endsearch) { /* * If offset is on a block boundary, * read the next directory block. * Release previous if it exists. */ - + if (iso_blkoff(imp, idp->curroff) == 0) { if (bp != NULL) brelse(bp); @@ -531,10 +531,10 @@ cd9660_readdir(ap) /* * Get pointer to next entry. */ - + ep = (struct iso_directory_record *) (bp->b_un.b_addr + entryoffsetinblock); - + reclen = isonum_711 (ep->length); isoflags = isonum_711(imp->iso_ftype == ISO_FTYPE_HIGH_SIERRA? &ep->date[6]: ep->flags); @@ -544,19 +544,19 @@ cd9660_readdir(ap) imp->logical_block_size); continue; } - + if (reclen < ISO_DIRECTORY_RECORD_SIZE) { error = EINVAL; /* illegal entry, stop */ break; } - + if (entryoffsetinblock + reclen > imp->logical_block_size) { error = EINVAL; /* illegal directory, so stop looking */ break; } - + /* XXX: be more intelligent if we can */ idp->current.d_type = DT_UNKNOWN; @@ -566,13 +566,13 @@ cd9660_readdir(ap) else idp->current.d_fileno = dbtob(bp->b_blkno) + idp->curroff; - + if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) { error = EINVAL; /* illegal entry, stop */ break; } - + idp->curroff += reclen; /* * @@ -612,10 +612,10 @@ cd9660_readdir(ap) } if (error) break; - + entryoffsetinblock += reclen; } - + if (!error && imp->iso_ftype == ISO_FTYPE_DEFAULT) { idp->current.d_namlen = 0; error = iso_shipdir(idp); @@ -634,16 +634,16 @@ cd9660_readdir(ap) *ap->a_cookies = cookies; } } - + if (bp) brelse (bp); uio->uio_offset = idp->uio_off; if (ap->a_eofflag) *ap->a_eofflag = idp->eof; - + FREE(idp,M_TEMP); - + return (error); } @@ -665,19 +665,19 @@ cd9660_readlink(ap) } */ *ap; { ISONODE *ip; - ISODIR *dirp; + ISODIR *dirp; ISOMNT *imp; struct buf *bp; u_short symlen; int error; char *symname; - + ip = VTOI(ap->a_vp); imp = ip->i_mnt; - + if (imp->iso_ftype != ISO_FTYPE_RRIP) return EINVAL; - + /* * Get parents directory record block that this inode included. */ @@ -706,7 +706,7 @@ cd9660_readlink(ap) ip->i_number, ip->i_number & imp->im_bmask ); #endif - + /* * Just make sure, we have a right one.... * 1: Check not cross boundary on block @@ -716,13 +716,13 @@ cd9660_readlink(ap) brelse(bp); return EINVAL; } - + /* * Now get a buffer * Abuse a namei buffer for now. */ MALLOC(symname,char *,MAXPATHLEN,M_NAMEI,M_WAITOK); - + /* * Ok, we just gathering a symbolic name in SL record. */ @@ -735,14 +735,14 @@ cd9660_readlink(ap) * Don't forget before you leave from home ;-) */ brelse(bp); - + /* * return with the symbolic name to caller's. */ error = uiomove(symname,symlen,ap->a_uio); - + FREE(symname,M_NAMEI); - + return error; } diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index 858dbb3..406572e 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)iso.h 8.2 (Berkeley) 1/23/94 - * $Id: iso.h,v 1.3 1994/09/09 11:11:01 dfr Exp $ + * $Id: iso.h,v 1.4 1995/01/16 17:03:29 joerg Exp $ */ #define ISODCL(from, to) (to - from + 1) @@ -189,16 +189,16 @@ struct iso_mnt { int logical_block_size; int im_bshift; int im_bmask; - + int volume_space_size; char im_fsmnt[50]; struct netexport im_export; - + char root[ISODCL (157, 190)]; int root_extent; int root_size; enum ISO_FTYPE iso_ftype; - + int rr_skip; int rr_skip0; }; @@ -228,13 +228,13 @@ int cd9660_vptofh __P((struct vnode *, struct fid *)); int cd9660_init __P(()); struct iso_node; -int iso_blkatoff __P((struct iso_node *ip, long offset, struct buf **bpp)); +int iso_blkatoff __P((struct iso_node *ip, long offset, struct buf **bpp)); int iso_iget __P((struct iso_node *xp, ino_t ino, int relocated, struct iso_node **ipp, struct iso_directory_record *isodir)); -int iso_iput __P((struct iso_node *ip)); -int iso_ilock __P((struct iso_node *ip)); -int iso_iunlock __P((struct iso_node *ip)); -int cd9660_mountroot __P((void)); +int iso_iput __P((struct iso_node *ip)); +int iso_ilock __P((struct iso_node *ip)); +int iso_iunlock __P((struct iso_node *ip)); +int cd9660_mountroot __P((void)); extern int (**cd9660_vnodeop_p)(); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 6c20b26..420320a 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.7 1994/10/06 21:06:42 davidg Exp $ + * $Id: fdesc_vnops.c,v 1.8 1995/03/28 07:56:44 bde Exp $ */ /* @@ -138,7 +138,7 @@ loop: /* * otherwise lock the array while we call getnewvnode * since that can block. - */ + */ if (fdcache_lock & FDL_LOCKED) { fdcache_lock |= FDL_WANT; (void) tsleep((caddr_t) &fdcache_lock, PINOD, "fdalvp", 0); @@ -195,7 +195,7 @@ fdesc_lookup(ap) pname = ap->a_cnp->cn_nameptr; if (ap->a_cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; - VREF(dvp); + VREF(dvp); VOP_LOCK(dvp); return (0); } @@ -325,7 +325,7 @@ fdesc_open(ap) case Fdesc: /* * XXX Kludge: set p->p_dupfd to contain the value of the - * the file descriptor being sought for duplication. The error + * the file descriptor being sought for duplication. The error * return ensures that the vnode for this device will be * released by vn_open. Open will detect this special error and * take the actions in dupfdopen. Other callers of vn_open or @@ -467,7 +467,7 @@ fdesc_getattr(ap) default: panic("fdesc_getattr"); - break; + break; } if (error == 0) @@ -586,7 +586,7 @@ fdesc_readdir(ap) break; } i++; - + switch (dt->d_fileno) { case FD_CTTY: if (cttyvp(uio->uio_procp) == NULL) @@ -690,7 +690,7 @@ fdesc_read(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -714,7 +714,7 @@ fdesc_write(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -741,7 +741,7 @@ fdesc_ioctl(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -766,7 +766,7 @@ fdesc_select(ap) error = EOPNOTSUPP; break; } - + return (error); } diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index bf1ec82..106ac89 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 - * $Id: fifo_vnops.c,v 1.7 1995/02/03 06:46:13 davidg Exp $ + * $Id: fifo_vnops.c,v 1.8 1995/03/16 18:13:13 bde Exp $ */ #include <sys/param.h> @@ -124,7 +124,7 @@ fifo_lookup(ap) struct componentname * a_cnp; } */ *ap; { - + *ap->a_vpp = NULL; return (ENOTDIR); } @@ -169,7 +169,7 @@ fifo_open(ap) return (error); } fip->fi_writesock = wso; - error = unp_connect2(wso, rso); + error = unp_connect2(wso, rso); if (error) { (void)soclose(wso); (void)soclose(rso); @@ -251,7 +251,7 @@ fifo_read(ap) rso->so_state |= SS_NBIO; startresid = uio->uio_resid; VOP_UNLOCK(ap->a_vp); - error = soreceive(rso, (struct mbuf **)0, uio, + error = soreceive(rso, (struct mbuf **)0, uio, (struct mbuf **)0, (struct mbuf **)0, (int*)0); VOP_LOCK(ap->a_vp); /* diff --git a/sys/fs/msdosfs/bootsect.h b/sys/fs/msdosfs/bootsect.h index 099b15f..f83b9ec 100644 --- a/sys/fs/msdosfs/bootsect.h +++ b/sys/fs/msdosfs/bootsect.h @@ -1,19 +1,19 @@ -/* $Id$ */ +/* $Id: bootsect.h,v 1.1 1994/09/19 15:41:36 dfr Exp $ */ /* $NetBSD: bootsect.h,v 1.4 1994/06/29 06:35:28 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/bpb.h b/sys/fs/msdosfs/bpb.h index 70e4de2..7618126 100644 --- a/sys/fs/msdosfs/bpb.h +++ b/sys/fs/msdosfs/bpb.h @@ -1,19 +1,19 @@ -/* $Id$ */ +/* $Id: bpb.h,v 1.1 1994/09/19 15:41:37 dfr Exp $ */ /* $NetBSD: bpb.h,v 1.3 1994/06/29 06:35:29 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index b47196a..a7f2928 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $Id: denode.h,v 1.3 1994/12/27 12:37:33 bde Exp $ */ +/* $Id: denode.h,v 1.4 1995/03/16 18:14:17 bde Exp $ */ /* $NetBSD: denode.h,v 1.8 1994/08/21 18:43:49 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/direntry.h b/sys/fs/msdosfs/direntry.h index d2ec019..f4eecac 100644 --- a/sys/fs/msdosfs/direntry.h +++ b/sys/fs/msdosfs/direntry.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: direntry.h,v 1.1 1994/09/19 15:41:39 dfr Exp $ */ /* $NetBSD: direntry.h,v 1.7 1994/08/21 18:43:54 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/fat.h b/sys/fs/msdosfs/fat.h index b5f223f..3b043c1 100644 --- a/sys/fs/msdosfs/fat.h +++ b/sys/fs/msdosfs/fat.h @@ -1,4 +1,4 @@ -/* $Id: fat.h,v 1.1 1994/09/19 15:41:40 dfr Exp $ */ +/* $Id: fat.h,v 1.2 1994/09/27 20:42:41 phk Exp $ */ /* $NetBSD: fat.h,v 1.4 1994/08/21 18:43:57 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index d351a48..8899982 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -1,19 +1,19 @@ -/* $Id: msdosfs_conv.c,v 1.3 1994/12/12 12:35:42 bde Exp $ */ +/* $Id: msdosfs_conv.c,v 1.4 1995/03/29 18:48:06 ache Exp $ */ /* $NetBSD: msdosfs_conv.c,v 1.6.2.1 1994/08/30 02:27:57 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index c0e8823..60a6811 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_denode.c,v 1.10 1995/03/19 12:11:13 davidg Exp $ */ +/* $Id: msdosfs_denode.c,v 1.11 1995/04/11 17:13:17 bde Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -83,7 +83,7 @@ msdosfs_hashget(dev, dirclust, diroff) u_long diroff; { struct denode *dep; - + for (;;) for (dep = dehashtbl[DEHASH(dev, dirclust + diroff)];; dep = dep->de_next) { @@ -111,7 +111,7 @@ msdosfs_hashins(dep) struct denode *dep; { struct denode **depp, *deq; - + depp = &dehashtbl[DEHASH(dep->de_dev, dep->de_dirclust + dep->de_diroffset)]; deq = *depp; if (deq) @@ -137,17 +137,17 @@ msdosfs_hashrem(dep) } /* - * If deget() succeeds it returns with the gotten denode locked(). + * If deget() succeeds it returns with the gotten denode locked(). * * pmp - address of msdosfsmount structure of the filesystem containing * the denode of interest. The pm_dev field and the address of - * the msdosfsmount structure are used. + * the msdosfsmount structure are used. * dirclust - which cluster bp contains, if dirclust is 0 (root directory) * diroffset is relative to the beginning of the root directory, - * otherwise it is cluster relative. - * diroffset - offset past begin of cluster of denode we want + * otherwise it is cluster relative. + * diroffset - offset past begin of cluster of denode we want * direntptr - address of the direntry structure of interest. If direntptr is - * NULL, the block is read if necessary. + * NULL, the block is read if necessary. * depp - returns the address of the gotten denode. */ int @@ -187,7 +187,7 @@ deget(pmp, dirclust, diroffset, direntptr, depp) * the directory entry to compute the hash value. For subdir use * address of "." entry. for root dir use cluster MSDOSFSROOT, * offset MSDOSFSROOT_OFS - * + * * NOTE: The check for de_refcnt > 0 below insures the denode being * examined does not represent an unlinked but still open file. * These files are not to be accessible even when the directory @@ -337,7 +337,7 @@ deupdat(dep, tp, waitfor) * update. */ error = readde(dep, &bp, &dirp); - if (error) + if (error) return error; /* @@ -535,7 +535,7 @@ deextend(dep, length, cred) u_long count; int error; struct timespec ts; - + /* * The root of a DOS filesystem cannot be extended. */ @@ -554,7 +554,7 @@ deextend(dep, length, cred) if (length <= dep->de_FileSize) panic("deextend: file too large"); - + /* * Compute the number of clusters to allocate. */ @@ -569,7 +569,7 @@ deextend(dep, length, cred) return error; } } - + dep->de_flag |= DE_UPDATE; dep->de_FileSize = length; TIMEVAL_TO_TIMESPEC(&time, &ts); @@ -606,7 +606,7 @@ msdosfs_reclaim(ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); - + #ifdef MSDOSFS_DEBUG printf("msdosfs_reclaim(): dep %p, file %s, refcnt %ld\n", dep, dep->de_Name, dep->de_refcnt); @@ -630,10 +630,10 @@ msdosfs_reclaim(ap) } dep->de_flag = 0; - + FREE(dep, M_MSDOSFSNODE); vp->v_data = NULL; - + return 0; } @@ -647,7 +647,7 @@ msdosfs_inactive(ap) struct denode *dep = VTODE(vp); int error = 0; struct timespec ts; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]); #endif diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 06b30e4..b43f959 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_fat.c,v 1.5 1995/02/10 18:39:45 bde Exp $ */ +/* $Id: msdosfs_fat.c,v 1.6 1995/04/11 16:43:20 bde Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.12 1994/08/21 18:44:04 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -251,7 +251,7 @@ hiteof:; * Find the closest entry in the fat cache to the cluster we are looking * for. */ -void +void fc_lookup(dep, findcn, frcnp, fsrcnp) struct denode *dep; u_long findcn; @@ -344,22 +344,22 @@ updatefats(pmp, bp, fatbn) /* * Updating entries in 12 bit fats is a pain in the butt. - * + * * The following picture shows where nibbles go when moving from a 12 bit * cluster number into the appropriate bytes in the FAT. - * + * * byte m byte m+1 byte m+2 * +----+----+ +----+----+ +----+----+ * | 0 1 | | 2 3 | | 4 5 | FAT bytes * +----+----+ +----+----+ +----+----+ - * + * * +----+----+----+ +----+----+----+ * | 3 0 1 | | 4 5 2 | * +----+----+----+ +----+----+----+ * cluster n cluster n+1 - * + * * Where n is even. m = n + (n >> 2) - * + * */ static inline void usemap_alloc(pmp, cn) @@ -414,10 +414,10 @@ clusterfree(pmp, cluster, oldcnp) * cluster'th entry if this is a get function * newcontents - the new value to be written into the cluster'th element of * the fat if this is a set function. - * + * * This function can also be used to free a cluster by setting the fat entry * for a cluster to 0. - * + * * All copies of the fat are updated if this is a set function. NOTE: If * fatentry() marks a cluster as free it does not update the inusemap in * the msdosfsmount structure. This is left to the caller. @@ -470,7 +470,7 @@ fatentry(function, pmp, cn, oldcontents, newcontents) error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) return error; - + if (function & FAT_GET) { readcn = getushort(&bp->b_data[bo]); if (FAT12(pmp)) { @@ -523,7 +523,7 @@ fatchain(pmp, start, count, fillwith) int error; u_long bn, bo, bsize, byteoffset, readcn, newc; struct buf *bp; - + #ifdef MSDOSFS_DEBUG printf("fatchain(pmp %p, start %ld, count %ld, fillwith %ld)\n", pmp, start, count, fillwith); @@ -533,7 +533,7 @@ fatchain(pmp, start, count, fillwith) */ if (start < CLUST_FIRST || start + count - 1 > pmp->pm_maxcluster) return EINVAL; - + while (count > 0) { byteoffset = FATOFS(pmp, start); fatblock(pmp, byteoffset, &bn, &bsize, &bo); @@ -585,7 +585,7 @@ chainlength(pmp, start, count) u_long idx, max_idx; u_int map; u_long len; - + max_idx = pmp->pm_maxcluster / N_INUSEBITS; idx = start / N_INUSEBITS; start %= N_INUSEBITS; @@ -632,7 +632,7 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) u_long *got; { int error; - + error = fatchain(pmp, start, count, fillwith); if (error == 0) { #ifdef MSDOSFS_DEBUG @@ -672,7 +672,7 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) u_long idx; u_long len, newst, foundcn, foundl, cn, l; u_int map; - + #ifdef MSDOSFS_DEBUG printf("clusteralloc(): find %d clusters\n",count); #endif @@ -684,19 +684,19 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) * This is a new file, initialize start */ struct timeval tv; - + microtime(&tv); start = (tv.tv_usec >> 10)|tv.tv_usec; len = 0; } - + /* * Start at a (pseudo) random place to maximize cluster runs * under multiple writers. */ foundcn = newst = (start * 1103515245 + 12345) % (pmp->pm_maxcluster + 1); foundl = 0; - + for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; @@ -759,7 +759,7 @@ freeclusterchain(pmp, cluster) struct buf *bp = NULL; u_long bn, bo, bsize, byteoffset; u_long readcn, lbn = -1; - + while (cluster >= CLUST_FIRST && cluster <= pmp->pm_maxcluster) { byteoffset = FATOFS(pmp, cluster); fatblock(pmp, byteoffset, &bn, &bsize, &bo); @@ -878,7 +878,7 @@ extendfile(dep, count, bpp, ncp, flags) u_long cn, got; struct msdosfsmount *pmp = dep->de_pmp; struct buf *bp; - + /* * Don't try to extend the root directory */ @@ -901,7 +901,7 @@ extendfile(dep, count, bpp, ncp, flags) return error; error = 0; } - + while (count > 0) { /* * Allocate a new cluster chain and cat onto the end of the file. @@ -918,9 +918,9 @@ extendfile(dep, count, bpp, ncp, flags) error = clusteralloc(pmp, cn, count, CLUST_EOFE, &cn, &got); if (error) return error; - + count -= got; - + /* * Give them the filesystem relative cluster number if they want * it. @@ -929,7 +929,7 @@ extendfile(dep, count, bpp, ncp, flags) *ncp = cn; ncp = NULL; } - + if (dep->de_StartCluster == 0) { dep->de_StartCluster = cn; frcn = 0; @@ -940,16 +940,16 @@ extendfile(dep, count, bpp, ncp, flags) clusterfree(pmp, cn, NULL); return error; } - + frcn = dep->de_fc[FC_LASTFC].fc_frcn + 1; } - + /* * Update the "last cluster of the file" entry in the denode's fat * cache. */ fc_setcache(dep, FC_LASTFC, frcn + got - 1, cn + got - 1); - + if (flags & DE_CLEAR) { while (got-- > 0) { /* @@ -979,6 +979,6 @@ extendfile(dep, count, bpp, ncp, flags) } } } - + return 0; } diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 5e9cbca..a80e5ae 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_lookup.c,v 1.2 1994/09/27 20:42:51 phk Exp $ */ +/* $Id: msdosfs_lookup.c,v 1.3 1995/05/09 16:30:44 bde Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.14 1994/08/21 18:44:07 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 4a765b9..bbb4fc6 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.5 1994/10/02 17:48:21 phk Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.6 1994/12/12 12:35:47 bde Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -70,9 +70,9 @@ int msdosfsdoforce = 1; /* 1 = force unmount */ /* - * mp - path - addr in user space of mount point (ie /usr or whatever) + * mp - path - addr in user space of mount point (ie /usr or whatever) * data - addr in user space of mount params including the name of the block - * special file to treat as a filesystem. + * special file to treat as a filesystem. */ int msdosfs_mount(mp, path, data, ndp, p) @@ -169,7 +169,7 @@ msdosfs_mount(mp, path, data, ndp, p) crfree(cred); /* XXX */ if (error != 0) return error; - + /* * Be sure they've given us a block device to treat as a * filesystem. And, that its major number is within the bdevsw diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 0993c9d..047eea0 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.14 1995/04/11 18:32:17 ache Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.15 1995/05/09 16:30:45 bde Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -73,7 +73,7 @@ #include <msdosfs/fat.h> /* * Some general notes: - * + * * In the ufs filesystem the inodes, superblocks, and indirect blocks are * read/written using the vnode for the filesystem. Blocks that represent * the contents of a file are read/written using the vnode for the file @@ -156,7 +156,7 @@ msdosfs_mknod(ap) } */ *ap; { int error; - + switch (ap->a_vap->va_type) { case VDIR: error = msdosfs_mkdir((struct vop_mkdir_args *)ap); @@ -222,13 +222,13 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mode_t mask; int i; register gid_t *gp; - + /* User id 0 always gets access. */ if (cred->cr_uid == 0) return 0; - + mask = 0; - + /* Otherwise, check the owner. */ if (cred->cr_uid == uid) { if (acc_mode & VEXEC) @@ -239,7 +239,7 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mask |= S_IWUSR; return (file_mode & mask) == mask ? 0 : EACCES; } - + /* Otherwise, check the groups. */ for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++) if (gid == *gp) { @@ -251,7 +251,7 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mask |= S_IWGRP; return (file_mode & mask) == mask ? 0 : EACCES; } - + /* Otherwise, check everyone else. */ if (acc_mode & VEXEC) mask |= S_IXOTH; @@ -274,11 +274,11 @@ msdosfs_access(ap) mode_t dosmode; struct denode *dep = VTODE(ap->a_vp); struct msdosfsmount *pmp = dep->de_pmp; - + dosmode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) | ((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH)); dosmode &= pmp->pm_mask; - + return vaccess(dosmode, pmp->pm_uid, pmp->pm_gid, ap->a_mode, ap->a_cred); } @@ -352,7 +352,7 @@ msdosfs_setattr(ap) struct denode *dep = VTODE(ap->a_vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_setattr(): vp %08x, vap %08x, cred %08x, p %08x\n", ap->a_vp, vap, cred, ap->a_p); @@ -396,7 +396,7 @@ msdosfs_setattr(ap) if (vap->va_mtime.ts_sec != VNOVAL) { if (cred->cr_uid != dep->de_pmp->pm_uid && (error = suser(cred, &ap->a_p->p_acflag)) && - ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || + ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, &ap->a_p)))) return error; dep->de_flag |= DE_UPDATE; @@ -574,7 +574,7 @@ msdosfs_write(ap) struct msdosfsmount *pmp = dep->de_pmp; struct ucred *cred = ap->a_cred; struct timespec ts; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_write(vp %08x, uio %08x, ioflag %08x, cred %08x\n", vp, uio, ioflag, cred); @@ -658,7 +658,7 @@ msdosfs_write(ap) lastcn = dep->de_fc[FC_LASTFC].fc_frcn; } else lastcn = de_clcount(pmp, osize) - 1; - + do { bn = de_blk(pmp, uio->uio_offset); if (isadir) { @@ -669,7 +669,7 @@ msdosfs_write(ap) error = ENOSPC; break; } - + if ((uio->uio_offset & pmp->pm_crbomask) == 0 && (de_blk(pmp, uio->uio_offset + uio->uio_resid) > de_blk(pmp, uio->uio_offset) || uio->uio_offset + uio->uio_resid >= dep->de_FileSize)) { @@ -687,7 +687,7 @@ msdosfs_write(ap) if (!isadir) { if (bp->b_blkno == bp->b_lblkno) { error = pcbmap(dep, bp->b_lblkno, - &bp->b_blkno, 0); + &bp->b_blkno, 0); if (error) bp->b_blkno = -1; } @@ -802,7 +802,7 @@ msdosfs_mmap(ap) /* * Flush the blocks of a file to disk. - * + * * This function is worthless for vnodes that represent directories. Maybe we * could just do a sync if they try an fsync on a directory file. */ @@ -917,9 +917,9 @@ msdosfs_link(ap) * Renames on files require moving the denode to a new hash queue since the * denode's location is used to compute which hash queue to put the file * in. Unless it is a rename in place. For example "mv a b". - * + * * What follows is the basic algorithm: - * + * * if (file move) { * if (dest file exists) { * remove dest file @@ -951,13 +951,13 @@ msdosfs_link(ap) * clear old directory entry for moved directory * } * } - * + * * On entry: * source's parent directory is unlocked * source file or directory is unlocked * destination's parent directory is locked * destination file or directory is locked if it exists - * + * * On exit: * all denodes should be released * @@ -1646,7 +1646,7 @@ msdosfs_readdir(ap) ncookies++; } dentp++; - + crnt = (struct dirent *) ((char *) crnt + sizeof(struct direntry)); pushout = 1; @@ -1722,7 +1722,7 @@ out: ; *ap->a_eofflag = 1; else *ap->a_eofflag = 0; - + return error; } diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 270b5b4..5309acb 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $Id: msdosfsmount.h,v 1.1 1994/09/19 15:41:48 dfr Exp $ */ +/* $Id: msdosfsmount.h,v 1.2 1994/09/27 20:42:59 phk Exp $ */ /* $NetBSD: msdosfsmount.h,v 1.7 1994/08/21 18:44:17 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -88,19 +88,19 @@ struct msdosfsmount { /* * How to compute pm_cnshift and pm_crbomask. - * - * pm_crbomask = (pm_SectPerClust * pm_BytesPerSect) - 1 - * if (bytesperclust == * 0) - * return EBADBLKSZ; - * bit = 1; - * for (i = 0; i < 32; i++) { - * if (bit & bytesperclust) { - * if (bit ^ bytesperclust) - * return EBADBLKSZ; - * pm_cnshift = * i; - * break; - * } - * bit <<= 1; + * + * pm_crbomask = (pm_SectPerClust * pm_BytesPerSect) - 1 + * if (bytesperclust == * 0) + * return EBADBLKSZ; + * bit = 1; + * for (i = 0; i < 32; i++) { + * if (bit & bytesperclust) { + * if (bit ^ bytesperclust) + * return EBADBLKSZ; + * pm_cnshift = * i; + * break; + * } + * bit <<= 1; * } */ diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 9b7e9da..eb1a192 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -36,7 +36,7 @@ * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vfsops.c,v 1.5 1995/03/16 18:13:31 bde Exp $ + * $Id: null_vfsops.c,v 1.6 1995/03/16 20:23:39 wollman Exp $ */ /* @@ -149,7 +149,7 @@ nullfs_mount(mp, path, data, ndp, p) (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); - (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); #ifdef NULLFS_DIAGNOSTIC @@ -204,7 +204,7 @@ nullfs_unmount(mp, mntflags, p) * moment, but who knows... */ #if 0 - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif @@ -216,7 +216,7 @@ nullfs_unmount(mp, mntflags, p) #ifdef NULLFS_DIAGNOSTIC vprint("alias root of lower", nullm_rootvp); -#endif +#endif /* * Release reference on underlying root vnode */ @@ -327,7 +327,7 @@ nullfs_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, vpp); } diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 9136baf..464d15a 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -35,7 +35,7 @@ * * @(#)null_vnops.c 8.1 (Berkeley) 6/10/93 * - * $Id: null_vnops.c,v 1.6 1994/10/10 07:55:29 phk Exp $ + * $Id: null_vnops.c,v 1.7 1995/03/19 14:28:54 davidg Exp $ */ /* @@ -88,7 +88,7 @@ * in the arguments and, if a vnode is return by the operation, * stacks a null-node on top of the returned vnode. * - * Although bypass handles most operations, + * Although bypass handles most operations, * vop_getattr, _inactive, _reclaim, and _print are not bypassed. * Vop_getattr must change the fsid being returned. * Vop_inactive and vop_reclaim are not bypassed so that @@ -109,7 +109,7 @@ * this or other null vnode stacks. * * New vnode stacks come into existance as a result of - * an operation which returns a vnode. + * an operation which returns a vnode. * The bypass routine stacks a null-node above the new * vnode before returning it to the caller. * @@ -119,7 +119,7 @@ * the root null-node (which was created when the null layer was mounted). * Now consider opening "sys". A vop_lookup would be * done on the root null-node. This operation would bypass through - * to the lower layer which would return a vnode representing + * to the lower layer which would return a vnode representing * the UFS "sys". Null_bypass then builds a null-node * aliasing the UFS "sys" and returns this to the caller. * Later operations on the null-node "sys" will repeat this @@ -133,13 +133,13 @@ * then begin modifing the copy. Sed can be used to easily rename * all variables. * - * The umap layer is an example of a layer descended from the + * The umap layer is an example of a layer descended from the * null layer. * * * INVOKING OPERATIONS ON LOWER LAYERS * - * There are two techniques to invoke operations on a lower layer + * There are two techniques to invoke operations on a lower layer * when the operation cannot be completely bypassed. Each method * is appropriate in different situations. In both cases, * it is the responsibility of the aliasing layer to make @@ -200,7 +200,7 @@ int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ * to determine what implementation of the op should be invoked * - all mapped vnodes are of our vnode-type (NEEDSWORK: * problems on rmdir'ing mount points and renaming?) - */ + */ int null_bypass(ap) struct vop_generic_args /* { @@ -237,7 +237,7 @@ null_bypass(ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - vps_p[i] = this_vp_p = + vps_p[i] = this_vp_p = VOPARG_OFFSETTO(struct vnode**,descp->vdesc_vp_offsets[i],ap); /* * We're not guaranteed that any but the first vnode @@ -257,7 +257,7 @@ null_bypass(ap) if (reles & 1) VREF(*this_vp_p); } - + } /* diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index 130f991..52c7bcf 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94 * - * $Id: portal_vfsops.c,v 1.6 1995/03/16 18:13:38 bde Exp $ + * $Id: portal_vfsops.c,v 1.7 1995/03/16 20:23:41 wollman Exp $ */ /* @@ -172,7 +172,7 @@ portal_unmount(mp, mntflags, p) * moment, but who knows... */ #ifdef notyet - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c index 56f52fb..41fd2de 100644 --- a/sys/fs/portalfs/portal_vnops.c +++ b/sys/fs/portalfs/portal_vnops.c @@ -35,7 +35,7 @@ * * @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94 * - * $Id: portal_vnops.c,v 1.4 1994/09/21 03:47:05 wollman Exp $ + * $Id: portal_vnops.c,v 1.5 1995/03/28 07:57:02 bde Exp $ */ /* @@ -272,7 +272,7 @@ portal_open(ap) error = so->so_error; goto bad; } - + /* * Set miscellaneous flags */ @@ -377,7 +377,7 @@ portal_open(ap) } /* - * Check that the mode the file is being opened for is a subset + * Check that the mode the file is being opened for is a subset * of the mode of the existing descriptor. */ fp = p->p_fd->fd_ofiles[fd]; @@ -399,7 +399,7 @@ bad:; /* * And discard the control message. */ - if (cm) { + if (cm) { m_freem(cm); } diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index f55e5e3..0f1b3b0 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.4 (Berkeley) 1/21/94 * - * $Id: procfs_mem.c,v 1.5 1994/10/18 04:40:41 davidg Exp $ + * $Id: procfs_mem.c,v 1.6 1995/01/05 03:59:38 davidg Exp $ */ /* @@ -108,7 +108,7 @@ procfs_rwmem(p, uio) * The map we want... */ map = &p->p_vmspace->vm_map; - + /* * Check the permissions for the area we're interested * in. @@ -148,7 +148,7 @@ procfs_rwmem(p, uio) */ if (!error) vm_map_lookup_done(tmap, out_entry); - + /* * Fault the page in... */ diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c index c74cde9..f129022 100644 --- a/sys/fs/procfs/procfs_status.c +++ b/sys/fs/procfs/procfs_status.c @@ -36,7 +36,7 @@ * * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * - * $Id: procfs_status.c,v 1.2 1994/08/02 07:45:20 davidg Exp $ + * $Id: procfs_status.c,v 1.3 1994/10/10 07:55:38 phk Exp $ */ #include <sys/param.h> @@ -109,7 +109,7 @@ procfs_dostatus(curp, p, pfs, uio) p->p_stats->p_start.tv_usec); else ps += sprintf(ps, " -1,-1"); - + { struct timeval ut, st; diff --git a/sys/fs/procfs/procfs_subr.c b/sys/fs/procfs/procfs_subr.c index e1cfdf3..6c464c1 100644 --- a/sys/fs/procfs/procfs_subr.c +++ b/sys/fs/procfs/procfs_subr.c @@ -36,7 +36,7 @@ * * @(#)procfs_subr.c 8.4 (Berkeley) 1/27/94 * - * $Id: procfs_subr.c,v 1.3 1994/10/06 21:06:44 davidg Exp $ + * $Id: procfs_subr.c,v 1.4 1995/04/15 02:30:12 davidg Exp $ */ #include <sys/param.h> @@ -103,7 +103,7 @@ loop: /* * otherwise lock the vp list while we call getnewvnode * since that can block. - */ + */ if (pfsvplock & PROCFS_LOCKED) { pfsvplock |= PROCFS_WANT; (void) tsleep((caddr_t) &pfsvplock, PINOD, "pfsavp", 0); diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 8decad4..738df27 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.12 1995/05/11 19:26:33 rgrimes Exp $ + * $Id: procfs_vnops.c,v 1.13 1995/05/25 01:35:24 davidg Exp $ */ /* @@ -666,7 +666,7 @@ procfs_readdir(ap) break; dt = &procent[i]; - + dp->d_reclen = UIO_MX; dp->d_fileno = PROCFS_FILENO(pfs->pfs_pid, dt->d_pfstype); dp->d_type = DT_REG; diff --git a/sys/fs/umapfs/umap.h b/sys/fs/umapfs/umap.h index 5903d30..5be2e5e 100644 --- a/sys/fs/umapfs/umap.h +++ b/sys/fs/umapfs/umap.h @@ -35,7 +35,7 @@ * * @(#)umap.h 8.3 (Berkeley) 1/21/94 * - * $Id$ + * $Id: umap.h,v 1.2 1994/08/02 07:45:33 davidg Exp $ */ #define MAPFILEENTRIES 64 @@ -56,9 +56,9 @@ struct umap_mount { struct vnode *umapm_rootvp; /* Reference to root umap_node */ int info_nentries; /* number of uid mappings */ int info_gnentries; /* number of gid mappings */ - u_long info_mapdata[MAPFILEENTRIES][2]; /* mapping data for + u_long info_mapdata[MAPFILEENTRIES][2]; /* mapping data for user mapping in ficus */ - u_long info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for + u_long info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for group mapping in ficus */ }; diff --git a/sys/fs/umapfs/umap_subr.c b/sys/fs/umapfs/umap_subr.c index 4b2aad4b..792f4a8 100644 --- a/sys/fs/umapfs/umap_subr.c +++ b/sys/fs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.6 (Berkeley) 1/26/94 * - * $Id: umap_subr.c,v 1.2 1994/05/25 09:09:07 rgrimes Exp $ + * $Id: umap_subr.c,v 1.3 1994/10/10 07:55:43 phk Exp $ */ #include <sys/param.h> @@ -387,7 +387,7 @@ umap_mapids(v_mount, credp) credp->cr_gid = NULLGROUP; #endif - /* Now we must map each of the set of groups in the cr_groups + /* Now we must map each of the set of groups in the cr_groups structure. */ i = 0; diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index a98ae18..64f05bb 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94 * - * $Id: umap_vfsops.c,v 1.6 1995/03/16 18:13:55 bde Exp $ + * $Id: umap_vfsops.c,v 1.7 1995/03/16 20:23:43 wollman Exp $ */ /* @@ -127,12 +127,12 @@ umapfs_mount(mp, path, data, ndp, p) */ amp->umapm_vfs = lowerrootvp->v_mount; - /* + /* * Now copy in the number of entries and maps for umap mapping. */ amp->info_nentries = args.nentries; amp->info_gnentries = args.gnentries; - error = copyin(args.mapdata, (caddr_t)amp->info_mapdata, + error = copyin(args.mapdata, (caddr_t)amp->info_mapdata, 2*sizeof(u_long)*args.nentries); if (error) return (error); @@ -144,7 +144,7 @@ umapfs_mount(mp, path, data, ndp, p) amp->info_mapdata[i][1]); #endif - error = copyin(args.gmapdata, (caddr_t)amp->info_gmapdata, + error = copyin(args.gmapdata, (caddr_t)amp->info_gmapdata, 2*sizeof(u_long)*args.nentries); if (error) return (error); @@ -152,7 +152,7 @@ umapfs_mount(mp, path, data, ndp, p) #ifdef UMAP_DIAGNOSTIC printf("umap_mount:gnentries %d\n",args.gnentries); for (i = 0; i < args.gnentries; i++) - printf(" group %d maps to %d\n", + printf(" group %d maps to %d\n", amp->info_gmapdata[i][0], amp->info_gmapdata[i][1]); #endif @@ -190,7 +190,7 @@ umapfs_mount(mp, path, data, ndp, p) (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); - (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); #ifdef UMAPFS_DIAGNOSTIC @@ -245,7 +245,7 @@ umapfs_unmount(mp, mntflags, p) * moment, but who knows... */ #ifdef notyet - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif @@ -257,7 +257,7 @@ umapfs_unmount(mp, mntflags, p) #ifdef UMAPFS_DIAGNOSTIC vprint("alias root of lower", umapm_rootvp); -#endif +#endif /* * Release reference on underlying root vnode */ @@ -368,7 +368,7 @@ umapfs_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp)); } diff --git a/sys/fs/umapfs/umap_vnops.c b/sys/fs/umapfs/umap_vnops.c index 14d3fcc..a82d1c6 100644 --- a/sys/fs/umapfs/umap_vnops.c +++ b/sys/fs/umapfs/umap_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94 - * $Id: umap_vnops.c,v 1.7 1994/10/10 07:55:44 phk Exp $ + * $Id: umap_vnops.c,v 1.8 1995/03/19 14:28:55 davidg Exp $ */ /* @@ -59,7 +59,7 @@ int umap_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ /* * This is the 10-Apr-92 bypass routine. * See null_vnops.c:null_bypass for more details. - */ + */ int umap_bypass(ap) struct vop_generic_args /* { @@ -101,7 +101,7 @@ umap_bypass(ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - vps_p[i] = this_vp_p = + vps_p[i] = this_vp_p = VOPARG_OFFSETTO(struct vnode**, descp->vdesc_vp_offsets[i], ap); if (i == 0) { @@ -122,7 +122,7 @@ umap_bypass(ap) if (reles & 1) VREF(*this_vp_p); } - + } /* @@ -131,7 +131,7 @@ umap_bypass(ap) if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) { - credpp = VOPARG_OFFSETTO(struct ucred**, + credpp = VOPARG_OFFSETTO(struct ucred**, descp->vdesc_cred_offset, ap); /* Save old values */ @@ -141,7 +141,7 @@ umap_bypass(ap) credp = *credpp; if (umap_bug_bypass && credp->cr_uid != 0) - printf("umap_bypass: user was %ld, group %ld\n", + printf("umap_bypass: user was %ld, group %ld\n", credp->cr_uid, credp->cr_gid); /* Map all ids in the credential structure. */ @@ -149,17 +149,17 @@ umap_bypass(ap) umap_mapids(vp1->v_mount, credp); if (umap_bug_bypass && credp->cr_uid != 0) - printf("umap_bypass: user now %ld, group %ld\n", + printf("umap_bypass: user now %ld, group %ld\n", credp->cr_uid, credp->cr_gid); } /* BSD often keeps a credential in the componentname structure - * for speed. If there is one, it better get mapped, too. + * for speed. If there is one, it better get mapped, too. */ if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) { - compnamepp = VOPARG_OFFSETTO(struct componentname**, + compnamepp = VOPARG_OFFSETTO(struct componentname**, descp->vdesc_componentname_offset, ap); compcredp = (*compnamepp)->cn_cred; @@ -167,7 +167,7 @@ umap_bypass(ap) compcredp = (*compnamepp)->cn_cred = crdup(savecompcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_bypass: component credit user was %ld, group %ld\n", + printf("umap_bypass: component credit user was %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); /* Map all ids in the credential structure. */ @@ -175,7 +175,7 @@ umap_bypass(ap) umap_mapids(vp1->v_mount, compcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_bypass: component credit user now %ld, group %ld\n", + printf("umap_bypass: component credit user now %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); } @@ -217,7 +217,7 @@ umap_bypass(ap) }; out: - /* + /* * Free duplicate cred structure and restore old one. */ if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) { @@ -228,19 +228,19 @@ umap_bypass(ap) crfree(credp); (*credpp) = savecredp; if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0) - printf("umap_bypass: returning-user now %ld\n\n", + printf("umap_bypass: returning-user now %ld\n\n", (*credpp)->cr_uid); } if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) { if (umap_bug_bypass && compcredp && compcredp->cr_uid != 0) - printf("umap_bypass: returning-component-user was %ld\n", + printf("umap_bypass: returning-component-user was %ld\n", compcredp->cr_uid); crfree(compcredp); (*compnamepp)->cn_cred = savecompcredp; if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0) - printf("umap_bypass: returning-component-user now %ld\n", + printf("umap_bypass: returning-component-user now %ld\n", compcredp->cr_uid); } @@ -288,7 +288,7 @@ umap_getattr(ap) uid = ap->a_vap->va_uid; gid = ap->a_vap->va_gid; if (umap_bug_bypass) - printf("umap_getattr: mapped uid = %d, mapped gid = %d\n", uid, + printf("umap_getattr: mapped uid = %d, mapped gid = %d\n", uid, gid); vp1p = VOPARG_OFFSETTO(struct vnode**, descp->vdesc_vp_offsets[0], ap); @@ -307,7 +307,7 @@ umap_getattr(ap) ap->a_vap->va_uid = (uid_t) tmpid; if (umap_bug_bypass) printf("umap_getattr: original uid = %d\n", uid); - } else + } else ap->a_vap->va_uid = (uid_t) NOBODY; /* Reverse map the gid for the vnode. */ @@ -321,7 +321,7 @@ umap_getattr(ap) printf("umap_getattr: original gid = %d\n", gid); } else ap->a_vap->va_gid = (gid_t) NULLGROUP; - + return (0); } @@ -350,7 +350,7 @@ umap_reclaim(ap) struct vnode *vp = ap->a_vp; struct umap_node *xp = VTOUMAP(vp); struct vnode *lowervp = xp->umap_lowervp; - + /* After this assignment, this node will not be re-used. */ xp->umap_lowervp = NULL; remque(xp); @@ -442,7 +442,7 @@ umap_rename(ap) compcredp = compnamep->cn_cred = crdup(savecompcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_rename: rename component credit user was %ld, group %ld\n", + printf("umap_rename: rename component credit user was %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); /* Map all ids in the credential structure. */ @@ -450,11 +450,11 @@ umap_rename(ap) umap_mapids(vp->v_mount, compcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_rename: rename component credit user now %ld, group %ld\n", + printf("umap_rename: rename component credit user now %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); error = umap_bypass(ap); - + /* Restore the additional mapped componentname cred structure. */ crfree(compcredp); diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 02f7a10..cbbd171 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.4 (Berkeley) 2/17/94 - * $Id: union_subr.c,v 1.4 1994/10/06 21:06:48 davidg Exp $ + * $Id: union_subr.c,v 1.5 1994/10/10 07:55:46 phk Exp $ */ #include <sys/param.h> @@ -130,7 +130,7 @@ union_updatevp(un, uppervp, lowervp) LIST_REMOVE(un, un_cache); union_list_unlock(ohash); - } else { + } else { while (union_list_lock(nhash)) continue; } @@ -372,7 +372,7 @@ loop: /* * otherwise lock the vp list while we call getnewvnode * since that can block. - */ + */ hash = UNION_HASH(uppervp, lowervp); if (union_list_lock(hash)) diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index c9e2c60..670c7ce 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94 - * $Id: union_vfsops.c,v 1.8 1995/03/16 18:14:02 bde Exp $ + * $Id: union_vfsops.c,v 1.9 1995/03/16 20:23:44 wollman Exp $ */ /* @@ -118,7 +118,7 @@ union_mount(mp, path, data, ndp, p) error = VOP_GETATTR(mp->mnt_vnodecovered, &va, cred, p); if (error) goto bad; - if ((va.va_uid != cred->cr_uid) && + if ((va.va_uid != cred->cr_uid) && (cred->cr_uid != 0)) { error = EACCES; goto bad; @@ -163,7 +163,7 @@ union_mount(mp, path, data, ndp, p) error = EINVAL; goto bad; } - + um = (struct union_mount *) malloc(sizeof(struct union_mount), M_UFSMNT, M_WAITOK); /* XXX */ @@ -338,7 +338,7 @@ union_unmount(mp, mntflags, p) #ifdef UNION_DIAGNOSTIC vprint("alias root of lower", um_rootvp); -#endif +#endif /* * Discard references to upper and lower target vnodes. */ @@ -517,7 +517,7 @@ union_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return (EOPNOTSUPP); } diff --git a/sys/gnu/ext2fs/ext2_bmap.c b/sys/gnu/ext2fs/ext2_bmap.c index 1bc8455..900d2c2 100644 --- a/sys/gnu/ext2fs/ext2_bmap.c +++ b/sys/gnu/ext2fs/ext2_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_bmap.c 8.6 (Berkeley) 1/21/94 - * $Id: ufs_bmap.c,v 1.6 1995/03/04 03:24:45 davidg Exp $ + * $Id: ufs_bmap.c,v 1.7 1995/03/28 07:58:16 bde Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) devvp = VFSTOUFS(vp->v_mount)->um_devvp; for (bp = NULL, ++xap; --num; ++xap) { - /* + /* * Exit the loop if there is no disk address assigned yet and * the indirect block isn't in the cache, or if we were * looking for an indirect block and we've found it. @@ -242,7 +242,7 @@ ufs_getlbns(vp, bn, ap, nump) if (bn < NDADDR) return (0); - /* + /* * Determine the number of levels of indirection. After this loop * is done, blockcnt indicates the number of data blocks possible * at the given level of indirection, and NIADDR - i is the number @@ -262,7 +262,7 @@ ufs_getlbns(vp, bn, ap, nump) else metalbn = -(-realbn - bn + NIADDR - i); - /* + /* * At each iteration, off is the offset into the bap array which is * an array of disk addresses at the current level of indirection. * The logical block number and the offset in that block are stored diff --git a/sys/gnu/ext2fs/inode.h b/sys/gnu/ext2fs/inode.h index f0c7297..00105ea 100644 --- a/sys/gnu/ext2fs/inode.h +++ b/sys/gnu/ext2fs/inode.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.4 (Berkeley) 1/21/94 - * $Id: inode.h,v 1.4 1994/12/27 13:59:14 bde Exp $ + * $Id: inode.h,v 1.5 1995/04/24 05:13:11 dyson Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -57,7 +57,7 @@ * file in the UFS filesystem. It is composed of two types of * information. The first part is the information that is needed * only while the file is active (such as the identity of the file - * and linkage to speed its lookup). The second part is the + * and linkage to speed its lookup). The second part is the * permannent meta-data associated with the file which is read * in from the permanent dinode from long term storage when the * file becomes active, and is put back when the file is no longer diff --git a/sys/gnu/fs/ext2fs/ext2_bmap.c b/sys/gnu/fs/ext2fs/ext2_bmap.c index 1bc8455..900d2c2 100644 --- a/sys/gnu/fs/ext2fs/ext2_bmap.c +++ b/sys/gnu/fs/ext2fs/ext2_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_bmap.c 8.6 (Berkeley) 1/21/94 - * $Id: ufs_bmap.c,v 1.6 1995/03/04 03:24:45 davidg Exp $ + * $Id: ufs_bmap.c,v 1.7 1995/03/28 07:58:16 bde Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) devvp = VFSTOUFS(vp->v_mount)->um_devvp; for (bp = NULL, ++xap; --num; ++xap) { - /* + /* * Exit the loop if there is no disk address assigned yet and * the indirect block isn't in the cache, or if we were * looking for an indirect block and we've found it. @@ -242,7 +242,7 @@ ufs_getlbns(vp, bn, ap, nump) if (bn < NDADDR) return (0); - /* + /* * Determine the number of levels of indirection. After this loop * is done, blockcnt indicates the number of data blocks possible * at the given level of indirection, and NIADDR - i is the number @@ -262,7 +262,7 @@ ufs_getlbns(vp, bn, ap, nump) else metalbn = -(-realbn - bn + NIADDR - i); - /* + /* * At each iteration, off is the offset into the bap array which is * an array of disk addresses at the current level of indirection. * The logical block number and the offset in that block are stored diff --git a/sys/gnu/fs/ext2fs/inode.h b/sys/gnu/fs/ext2fs/inode.h index f0c7297..00105ea 100644 --- a/sys/gnu/fs/ext2fs/inode.h +++ b/sys/gnu/fs/ext2fs/inode.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.4 (Berkeley) 1/21/94 - * $Id: inode.h,v 1.4 1994/12/27 13:59:14 bde Exp $ + * $Id: inode.h,v 1.5 1995/04/24 05:13:11 dyson Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -57,7 +57,7 @@ * file in the UFS filesystem. It is composed of two types of * information. The first part is the information that is needed * only while the file is active (such as the identity of the file - * and linkage to speed its lookup). The second part is the + * and linkage to speed its lookup). The second part is the * permannent meta-data associated with the file which is read * in from the permanent dinode from long term storage when the * file becomes active, and is put back when the file is no longer diff --git a/sys/gnu/i386/fpemul/control_w.h b/sys/gnu/i386/fpemul/control_w.h index d7ede07..0e799c5 100644 --- a/sys/gnu/i386/fpemul/control_w.h +++ b/sys/gnu/i386/fpemul/control_w.h @@ -54,7 +54,7 @@ * W. Metzenthen June 1994. * * - * $Id: control_w.h,v 1.2 1994/04/29 21:02:30 gclarkii Exp $ + * $Id: control_w.h,v 1.3 1994/06/10 07:44:07 rich Exp $ * */ diff --git a/sys/gnu/i386/fpemul/fpu_arith.c b/sys/gnu/i386/fpemul/fpu_arith.c index a1da514..5745e1b 100644 --- a/sys/gnu/i386/fpemul/fpu_arith.c +++ b/sys/gnu/i386/fpemul/fpu_arith.c @@ -56,8 +56,8 @@ * W. Metzenthen June 1994. * * - * $Id: fpu_arith.c,v 1.2 1994/04/29 21:07:14 gclarkii Exp $ - * + * $Id: fpu_arith.c,v 1.3 1994/06/10 07:44:14 rich Exp $ + * */ diff --git a/sys/gnu/i386/fpemul/fpu_entry.c b/sys/gnu/i386/fpemul/fpu_entry.c index 09e32c0..edbe94d 100644 --- a/sys/gnu/i386/fpemul/fpu_entry.c +++ b/sys/gnu/i386/fpemul/fpu_entry.c @@ -55,8 +55,8 @@ * * W. Metzenthen June 1994. * - * $Id: fpu_entry.c,v 1.4 1994/06/22 05:52:14 jkh Exp $ - * + * $Id: fpu_entry.c,v 1.5 1994/08/30 20:18:52 davidg Exp $ + * */ /*---------------------------------------------------------------------------+ diff --git a/sys/gnu/i386/fpemul/fpu_system.h b/sys/gnu/i386/fpemul/fpu_system.h index 8bcc14c..bb9e5d0 100644 --- a/sys/gnu/i386/fpemul/fpu_system.h +++ b/sys/gnu/i386/fpemul/fpu_system.h @@ -54,8 +54,8 @@ * W. Metzenthen June 1994. * * - * $Id: fpu_system.h,v 1.2 1994/04/29 21:16:24 gclarkii Exp $ - * + * $Id: fpu_system.h,v 1.3 1994/06/10 07:44:25 rich Exp $ + * */ diff --git a/sys/gnu/i386/fpemul/poly_tan.c b/sys/gnu/i386/fpemul/poly_tan.c index 7f70388..6098c81 100644 --- a/sys/gnu/i386/fpemul/poly_tan.c +++ b/sys/gnu/i386/fpemul/poly_tan.c @@ -56,8 +56,8 @@ * W. Metzenthen June 1994. * * - * $Id: poly_tan.c,v 1.3 1994/04/29 21:23:31 gclarkii Exp $ - * + * $Id: poly_tan.c,v 1.4 1994/06/10 07:44:42 rich Exp $ + * */ #include "exception.h" diff --git a/sys/gnu/i386/fpemul/reg_compare.c b/sys/gnu/i386/fpemul/reg_compare.c index b1c987a..52623f7 100644 --- a/sys/gnu/i386/fpemul/reg_compare.c +++ b/sys/gnu/i386/fpemul/reg_compare.c @@ -56,8 +56,8 @@ * W. Metzenthen June 1994. * * - * $Id: reg_compare.c,v 1.3 1994/06/10 07:44:47 rich Exp $ - * + * $Id: reg_compare.c,v 1.4 1994/08/31 04:45:23 davidg Exp $ + * */ /*---------------------------------------------------------------------------+ diff --git a/sys/gnu/i386/isa/nic3008.c b/sys/gnu/i386/isa/nic3008.c index ce14be8..03f8b58 100644 --- a/sys/gnu/i386/isa/nic3008.c +++ b/sys/gnu/i386/isa/nic3008.c @@ -1,6 +1,6 @@ -static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.4 1995/03/28 07:54:31 bde Exp $"; +static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.5 1995/05/11 19:25:55 rgrimes Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.4 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.5 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.4 1995/03/28 07:54:31 bde E * ******************************************************************************* * $Log: nic3008.c,v $ + * Revision 1.5 1995/05/11 19:25:55 rgrimes + * Fix -Wformat warnings from LINT kernel. + * * Revision 1.4 1995/03/28 07:54:31 bde * Add and move declarations to fix all of the warnings from `gcc -Wimplicit' * (except in netccitt, netiso and netns) that I didn't notice when I fixed @@ -86,7 +89,7 @@ int nic_connect(), nic_listen(), nic_disconnect(), nic_accept(); int nic_output(); extern void isdn_start_out(); -static void s_intr(), reset_req(), reset_card(); +static void s_intr(), reset_req(), reset_card(); static int cstrcmp(), discon_req(), reset_plci(), sel_b2_prot_req(); static short bsintr; diff --git a/sys/gnu/isdn/if_ii.c b/sys/gnu/isdn/if_ii.c index bdb3ebd..280023d 100644 --- a/sys/gnu/isdn/if_ii.c +++ b/sys/gnu/isdn/if_ii.c @@ -1,6 +1,6 @@ -static char _if_iiid[] = "@(#)$Id: if_ii.c,v 1.1 1995/02/14 15:00:27 jkh Exp $"; +static char _if_iiid[] = "@(#)$Id: if_ii.c,v 1.2 1995/02/15 06:28:26 jkh Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.1 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.2 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char _if_iiid[] = "@(#)$Id: if_ii.c,v 1.1 1995/02/14 15:00:27 jkh Exp * ******************************************************************************* * $Log: if_ii.c,v $ + * Revision 1.2 1995/02/15 06:28:26 jkh + * Fix up include paths, nuke some warnings. + * * Revision 1.1 1995/02/14 15:00:27 jkh * An ISDN driver that supports the EDSS1 and the 1TR6 ISDN interfaces. * EDSS1 is the "Euro-ISDN", 1TR6 is the soon obsolete german ISDN Interface. @@ -25,9 +28,9 @@ static char _if_iiid[] = "@(#)$Id: if_ii.c,v 1.1 1995/02/14 15:00:27 jkh Exp /* * Copyright (c) 1994 Dietmar Friede (dietmar@friede.de) All rights reserved. * FSF/FSAG GNU Copyright applies - * + * * A high level ip isdn driver. - * + * * Uses loop driver as template. Small - and simple - is beautiful. */ diff --git a/sys/gnu/isdn/isdn.c b/sys/gnu/isdn/isdn.c index 035c4fb..e1e4fd1 100644 --- a/sys/gnu/isdn/isdn.c +++ b/sys/gnu/isdn/isdn.c @@ -1,6 +1,6 @@ -static char _isdnid[] = "@(#)$Id: isdn.c,v 1.2 1995/02/15 06:28:29 jkh Exp $"; +static char _isdnid[] = "@(#)$Id: isdn.c,v 1.3 1995/03/28 07:54:44 bde Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.2 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.3 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,11 @@ static char _isdnid[] = "@(#)$Id: isdn.c,v 1.2 1995/02/15 06:28:29 jkh Exp $ * ******************************************************************************* * $Log: isdn.c,v $ + * Revision 1.3 1995/03/28 07:54:44 bde + * Add and move declarations to fix all of the warnings from `gcc -Wimplicit' + * (except in netccitt, netiso and netns) that I didn't notice when I fixed + * "all" such warnings before. + * * Revision 1.2 1995/02/15 06:28:29 jkh * Fix up include paths, nuke some warnings. * @@ -28,9 +33,9 @@ static char _isdnid[] = "@(#)$Id: isdn.c,v 1.2 1995/02/15 06:28:29 jkh Exp $ /* * Copyright (c) 1994 Dietmar Friede (dietmar@friede.de) All rights reserved. * FSF/FSAG GNU Copyright applies - * + * * An intermediate level for ISDN Drivers. - * + * */ #include "isdn.h" @@ -187,7 +192,7 @@ isdn_ctrl_attach(int n) /* * isdnopen() New open on device. - * + * * I forbid all but one open per application. The only programs opening the * isdn device are the ISDN-daemon */ @@ -560,7 +565,7 @@ isdn_check() timeout(isdn_check,0,hz/2); } } - + void isdn_conn_ind(int an, int cn, int dial) { diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 38f5d8f..1ba1472 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -6,14 +6,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.10 1994/12/16 07:31:47 phk Exp $ + * $Id: apm.c,v 1.11 1995/02/17 02:22:21 phk Exp $ */ #include "apm.h" @@ -72,7 +72,7 @@ struct apm_softc { int idle_cpu, disabled, disengaged; struct apmhook sc_suspend; struct apmhook sc_resume; -}; +}; static struct apm_softc apm_softc[NAPM]; static struct apm_softc *master_softc = NULL; /* XXX */ @@ -102,8 +102,8 @@ static void apm_timeout(void *); #endif /* MACH_KERNEL */ /* setup APM GDT discriptors */ -static void -setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code_limit, u_int data_limit) +static void +setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code_limit, u_int data_limit) { #ifdef __FreeBSD__ /* setup 32bit code segment */ @@ -170,20 +170,20 @@ apm_int(u_long *eax, u_long *ebx, u_long *ecx) lcall _apm_addr jnc 1f incl %3 - 1: + 1: popl %%esi popl %%edx popl %%ebp" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=D" (cf) : "0" (*eax), "1" (*ebx), "2" (*ecx) - ); + ); apm_errno = ((*eax) >> 8) & 0xff; return cf; } /* enable/disable power management */ -static int +static int apm_enable_disable_pm(struct apm_softc *sc, int enable) { u_long eax, ebx, ecx; @@ -217,7 +217,7 @@ apm_driver_version(void) eax = (APM_BIOS << 8) | APM_DRVVERSION; ebx = 0x0; ecx = 0x0101; - if(!apm_int(&eax, &ebx, &ecx)) + if(!apm_int(&eax, &ebx, &ecx)) apm_version = eax & 0xffff; #ifdef APM_DEBUG @@ -231,7 +231,7 @@ apm_driver_version(void) } /* engage/disengage power management (APM 1.1 or later) */ -static int +static int apm_engage_disengage_pm(struct apm_softc *sc, int engage) { u_long eax, ebx, ecx, i; @@ -244,13 +244,13 @@ apm_engage_disengage_pm(struct apm_softc *sc, int engage) } /* get PM event */ -static u_int +static u_int apm_getevent(struct apm_softc *sc) { u_long eax, ebx, ecx; eax = (APM_BIOS << 8) | APM_GETPMEVENT; - + ebx = 0; ecx = 0; if (apm_int(&eax, &ebx, &ecx)) @@ -260,11 +260,11 @@ apm_getevent(struct apm_softc *sc) } /* suspend entire system */ -static int +static int apm_suspend_system(struct apm_softc *sc) { u_long eax, ebx, ecx; - + eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; ecx = PMST_SUSPEND; @@ -272,7 +272,7 @@ apm_suspend_system(struct apm_softc *sc) __asm("cli"); if (apm_int(&eax, &ebx, &ecx)) { __asm("sti"); - printf("Entire system suspend failure: errcode = %ld\n", + printf("Entire system suspend failure: errcode = %ld\n", 0xff & (eax >> 8)); return 1; } @@ -290,12 +290,12 @@ int apm_display_off(void) { u_long eax, ebx, ecx; - + eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_2NDSTORAGE0; ecx = PMST_STANDBY; if (apm_int(&eax, &ebx, &ecx)) { - printf("Display off failure: errcode = %ld\n", + printf("Display off failure: errcode = %ld\n", 0xff & (eax >> 8)); return 1; } @@ -304,7 +304,7 @@ apm_display_off(void) } /* APM Battery low handler */ -static void +static void apm_battery_low(struct apm_softc *sc) { printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); @@ -343,7 +343,7 @@ apm_add_hook(struct apmhook **list, struct apmhook *ah) return ah; } -static void +static void apm_del_hook(struct apmhook **list, struct apmhook *ah) { int s; @@ -370,7 +370,7 @@ nosuchnode: /* APM driver calls some functions automatically */ -static void +static void apm_execute_hook(struct apmhook *list) { struct apmhook *p; @@ -381,8 +381,8 @@ apm_execute_hook(struct apmhook *list) #endif if ((*(p->ah_fun))(p->ah_arg)) { printf("Warning: APM hook \"%s\" failed", p->ah_name); - } - } + } + } } @@ -410,7 +410,7 @@ apm_hook_disestablish(int apmh, struct apmhook *ah) static struct timeval suspend_time; static struct timeval diff_time; -static int +static int apm_default_resume(struct apm_softc *sc) { #ifdef __FreeBSD__ @@ -437,7 +437,7 @@ apm_default_resume(struct apm_softc *sc) return 0; } -static int +static int apm_default_suspend(void) { #ifdef __FreeBSD__ @@ -465,7 +465,7 @@ static void apm_processevent(struct apm_softc *); * */ -void +void apm_suspend(void) { struct apm_softc *sc; @@ -519,7 +519,7 @@ apm_get_info(struct apm_softc *sc, apm_info_t aip) /* inform APM BIOS that CPU is idle */ -void +void apm_cpu_idle(void) { struct apm_softc *sc = master_softc; /* XXX */ @@ -530,7 +530,7 @@ apm_cpu_idle(void) } } /* - * Some APM implementation halts CPU in BIOS, whenever + * Some APM implementation halts CPU in BIOS, whenever * "CPU-idle" function are invoked, but swtch() of * FreeBSD halts CPU, therefore, CPU is halted twice * in the sched loop. It makes the interrupt latency @@ -551,7 +551,7 @@ apm_cpu_idle(void) } /* inform APM BIOS that CPU is busy */ -void +void apm_cpu_busy(void) { struct apm_softc *sc = master_softc; /* XXX */ @@ -568,7 +568,7 @@ apm_cpu_busy(void) * This routine is automatically called by timer once per second. */ -static void +static void apm_timeout(void *arg) { struct apm_softc *sc = arg; @@ -578,7 +578,7 @@ apm_timeout(void *arg) } /* enable APM BIOS */ -static void +static void apm_event_enable(struct apm_softc *sc) { #ifdef APM_DEBUG @@ -591,7 +591,7 @@ apm_event_enable(struct apm_softc *sc) } /* disable APM BIOS */ -static void +static void apm_event_disable(struct apm_softc *sc) { #ifdef APM_DEBUG @@ -604,7 +604,7 @@ apm_event_disable(struct apm_softc *sc) } /* halt CPU in scheduling loop */ -static void +static void apm_halt_cpu(struct apm_softc *sc) { if (sc->initialized) { @@ -616,7 +616,7 @@ apm_halt_cpu(struct apm_softc *sc) } /* don't halt CPU in scheduling loop */ -static void +static void apm_not_halt_cpu(struct apm_softc *sc) { if (sc->initialized) { @@ -654,7 +654,7 @@ struct bus_driver apmdriver = { * to use V86 mode in APM initialization. */ -int +int #ifdef __FreeBSD__ apmprobe(struct isa_device *dvp) #endif /* __FreeBSD__ */ @@ -700,7 +700,7 @@ apm_processevent(struct apm_softc *sc) #endif while (1) { apm_event = apm_getevent(sc); - if (apm_event == PMEV_NOEVENT) + if (apm_event == PMEV_NOEVENT) break; switch (apm_event) { OPMEV_DEBUGMESSAGE(PMEV_STANDBYREQ); @@ -749,7 +749,7 @@ apm_processevent(struct apm_softc *sc) * Initialize APM driver (APM BIOS itself has been initialized in locore.s) * * Now, unless I'm mad, (not quite ruled out yet), the APM-1.1 spec is bogus: - * + * * Appendix C says under the header "APM 1.0/APM 1.1 Modal BIOS Behavior" * that "When an APM Driver connects with an APM 1.1 BIOS, the APM 1.1 BIOS * will default to an APM 1.0 connection. After an APM Driver calls the APM @@ -761,21 +761,21 @@ apm_processevent(struct apm_softc *sc) * OK so I can establish a 1.0 connection, and then tell that I'm a 1.1 * and maybe then the BIOS will tell that it too is a 1.1. * Fine. - * Now how will I ever get the segment-limits for instance ? There is no - * way I can see that I can get a 1.1 response back from an "APM Protected + * Now how will I ever get the segment-limits for instance ? There is no + * way I can see that I can get a 1.1 response back from an "APM Protected * Mode 32-bit Interface Connect" function ??? - * + * * Who made this, Intel and Microsoft ? -- How did you guess ! * * /phk */ #ifdef __FreeBSD__ -int +int apmattach(struct isa_device *dvp) #endif /* __FreeBSD__ */ #ifdef MACH_KERNEL -void +void apmattach(struct bus_device *dvp) #endif /* MACH_KERNEL */ { @@ -811,7 +811,7 @@ apmattach(struct bus_device *dvp) if (sc->idle_cpu) { apm_slowstart = apm_slowstart_p = 1; } -#endif +#endif /* print bootstrap messages */ #ifdef APM_DEBUG @@ -819,7 +819,7 @@ apmattach(struct bus_device *dvp) printf("apm%d: Code32 0x%08x, Code16 0x%08x, Data 0x%08x\n", unit, sc->cs32_base, sc->cs16_base, sc->ds_base); printf("apm%d: Code entry 0x%08x, Idling CPU %s, Management %s\n", - unit, sc->cs_entry, is_enabled(sc->idle_cpu), + unit, sc->cs_entry, is_enabled(sc->idle_cpu), is_enabled(!sc->disabled)); printf("apm%d: CS_limit=%x, DS_limit=%x\n", unit, sc->cs_limit, sc->ds_limit); @@ -829,7 +829,7 @@ apmattach(struct bus_device *dvp) sc->ds_limit = 0xffff; /* setup GDT */ - setup_apm_gdt(sc->cs32_base, sc->cs16_base, sc->ds_base, + setup_apm_gdt(sc->cs32_base, sc->cs16_base, sc->ds_base, sc->cs_limit, sc->ds_limit); /* setup entry point 48bit pointer */ @@ -845,7 +845,7 @@ apmattach(struct bus_device *dvp) apm_driver_version(); sc->minorversion = ((apm_version & 0x00f0) >> 4) * 10 + ((apm_version & 0x000f) >> 0); - sc->majorversion = ((apm_version & 0xf000) >> 12) * 10 + + sc->majorversion = ((apm_version & 0xf000) >> 12) * 10 + ((apm_version & 0x0f00) >> 8); sc->intversion = INTVERSION(sc->majorversion, sc->minorversion); @@ -855,14 +855,14 @@ apmattach(struct bus_device *dvp) unit, is_enabled(!sc->disengaged)); } - printf(" found APM BIOS version %d.%d\n", + printf(" found APM BIOS version %d.%d\n", sc->majorversion, sc->minorversion); printf("apm%d: Idling CPU %s\n", unit, is_enabled(sc->idle_cpu)); /* enable power management */ if (sc->disabled) { if (apm_enable_disable_pm(sc, 1)) { - printf("Warning: APM enable function failed! [%x]\n", + printf("Warning: APM enable function failed! [%x]\n", apm_errno); } } @@ -870,7 +870,7 @@ apmattach(struct bus_device *dvp) /* engage power managment (APM 1.1 or later) */ if (sc->intversion >= INTVERSION(1, 1) && sc->disengaged) { if (apm_engage_disengage_pm(sc, 1)) { - printf("Warning: APM engage function failed [%x]\n", + printf("Warning: APM engage function failed [%x]\n", apm_errno); } } @@ -900,8 +900,8 @@ apmattach(struct bus_device *dvp) } #ifdef __FreeBSD__ -int -apmopen(dev_t dev, int flag, int fmt, struct proc *p) +int +apmopen(dev_t dev, int flag, int fmt, struct proc *p) { struct apm_softc *sc = &apm_softc[minor(dev)]; @@ -914,13 +914,13 @@ apmopen(dev_t dev, int flag, int fmt, struct proc *p) return 0; } -int +int apmclose(dev_t dev, int flag, int fmt, struct proc *p) { return 0; } -int +int apmioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p) { struct apm_softc *sc = &apm_softc[minor(dev)]; diff --git a/sys/i386/apm/apm_init/Makefile b/sys/i386/apm/apm_init/Makefile index 1d9c5c3..3cc1f9d 100644 --- a/sys/i386/apm/apm_init/Makefile +++ b/sys/i386/apm/apm_init/Makefile @@ -5,14 +5,14 @@ # # This software may be used, modified, copied, and distributed, in # both source and binary form provided that the above copyright and -# these terms are retained. Under no circumstances is the author -# responsible for the proper functioning of this software, nor does -# the author assume any responsibility for damages incurred with its +# these terms are retained. Under no circumstances is the author +# responsible for the proper functioning of this software, nor does +# the author assume any responsibility for damages incurred with its # use. # # Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) # -# $Id: Makefile,v 1.2 1994/10/01 05:12:29 davidg Exp $ +# $Id: Makefile,v 1.3 1995/02/17 02:22:30 phk Exp $ # OBJS = apm_init.o real_prot.o table.o @@ -47,6 +47,6 @@ bin2asm: bin2asm.c allclean: clean @rm -f apm_init.inc clean: - @rm -f *.o apm_init apm_init.sym bin2asm + @rm -f *.o apm_init apm_init.sym bin2asm .include <bsd.prog.mk> diff --git a/sys/i386/apm/apm_init/bin2asm.c b/sys/i386/apm/apm_init/bin2asm.c index 791798a..09c98f4 100644 --- a/sys/i386/apm/apm_init/bin2asm.c +++ b/sys/i386/apm/apm_init/bin2asm.c @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: bin2asm.c,v 1.2 1994/10/01 05:12:30 davidg Exp $ + * $Id: bin2asm.c,v 1.3 1995/02/17 02:22:33 phk Exp $ */ #include <stdio.h> @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Usage: %s infile outfile\n", argv[0]); exit(1); } - + if ((infile = fopen(argv[1], "rb")) == NULL) { fprintf(stderr, "Can't open %s.\n", argv[1]); exit(1); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) } while ((col++) % NCOLS < NCOLS - 2); fprintf(outfile, "0x00\n"); } - + fprintf(outfile, "\n/* Total size = 0x%04x */\n", col); fclose(infile); diff --git a/sys/i386/apm/apm_init/real_prot.h b/sys/i386/apm/apm_init/real_prot.h index 692ebfe..93b3f28 100644 --- a/sys/i386/apm/apm_init/real_prot.h +++ b/sys/i386/apm/apm_init/real_prot.h @@ -1,30 +1,30 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.7 92/02/29 15:33:41 rpd - * $Id: real_prot.h,v 1.1 1994/10/01 02:55:52 davidg Exp $ + * $Id: real_prot.h,v 1.2 1995/02/17 02:22:33 phk Exp $ */ /* @@ -34,9 +34,9 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) diff --git a/sys/i386/apm/apm_init/table.c b/sys/i386/apm/apm_init/table.c index 607fcc6..b50d60f 100644 --- a/sys/i386/apm/apm_init/table.c +++ b/sys/i386/apm/apm_init/table.c @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: table.c,v 1.2 1994/10/01 05:12:31 davidg Exp $ + * $Id: table.c,v 1.3 1995/02/17 02:22:34 phk Exp $ */ #include <apm_bios.h> diff --git a/sys/i386/apm/apm_setup.h b/sys/i386/apm/apm_setup.h index 55f126d..f5e67ef 100644 --- a/sys/i386/apm/apm_setup.h +++ b/sys/i386/apm/apm_setup.h @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, distributed, and sold, * in both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm_setup.h,v 1.2 1994/10/01 05:12:23 davidg Exp $ + * $Id: apm_setup.h,v 1.3 1995/02/17 02:22:22 phk Exp $ */ extern u_long apm_version; diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 38f5d8f..1ba1472 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -6,14 +6,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.10 1994/12/16 07:31:47 phk Exp $ + * $Id: apm.c,v 1.11 1995/02/17 02:22:21 phk Exp $ */ #include "apm.h" @@ -72,7 +72,7 @@ struct apm_softc { int idle_cpu, disabled, disengaged; struct apmhook sc_suspend; struct apmhook sc_resume; -}; +}; static struct apm_softc apm_softc[NAPM]; static struct apm_softc *master_softc = NULL; /* XXX */ @@ -102,8 +102,8 @@ static void apm_timeout(void *); #endif /* MACH_KERNEL */ /* setup APM GDT discriptors */ -static void -setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code_limit, u_int data_limit) +static void +setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code_limit, u_int data_limit) { #ifdef __FreeBSD__ /* setup 32bit code segment */ @@ -170,20 +170,20 @@ apm_int(u_long *eax, u_long *ebx, u_long *ecx) lcall _apm_addr jnc 1f incl %3 - 1: + 1: popl %%esi popl %%edx popl %%ebp" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=D" (cf) : "0" (*eax), "1" (*ebx), "2" (*ecx) - ); + ); apm_errno = ((*eax) >> 8) & 0xff; return cf; } /* enable/disable power management */ -static int +static int apm_enable_disable_pm(struct apm_softc *sc, int enable) { u_long eax, ebx, ecx; @@ -217,7 +217,7 @@ apm_driver_version(void) eax = (APM_BIOS << 8) | APM_DRVVERSION; ebx = 0x0; ecx = 0x0101; - if(!apm_int(&eax, &ebx, &ecx)) + if(!apm_int(&eax, &ebx, &ecx)) apm_version = eax & 0xffff; #ifdef APM_DEBUG @@ -231,7 +231,7 @@ apm_driver_version(void) } /* engage/disengage power management (APM 1.1 or later) */ -static int +static int apm_engage_disengage_pm(struct apm_softc *sc, int engage) { u_long eax, ebx, ecx, i; @@ -244,13 +244,13 @@ apm_engage_disengage_pm(struct apm_softc *sc, int engage) } /* get PM event */ -static u_int +static u_int apm_getevent(struct apm_softc *sc) { u_long eax, ebx, ecx; eax = (APM_BIOS << 8) | APM_GETPMEVENT; - + ebx = 0; ecx = 0; if (apm_int(&eax, &ebx, &ecx)) @@ -260,11 +260,11 @@ apm_getevent(struct apm_softc *sc) } /* suspend entire system */ -static int +static int apm_suspend_system(struct apm_softc *sc) { u_long eax, ebx, ecx; - + eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; ecx = PMST_SUSPEND; @@ -272,7 +272,7 @@ apm_suspend_system(struct apm_softc *sc) __asm("cli"); if (apm_int(&eax, &ebx, &ecx)) { __asm("sti"); - printf("Entire system suspend failure: errcode = %ld\n", + printf("Entire system suspend failure: errcode = %ld\n", 0xff & (eax >> 8)); return 1; } @@ -290,12 +290,12 @@ int apm_display_off(void) { u_long eax, ebx, ecx; - + eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_2NDSTORAGE0; ecx = PMST_STANDBY; if (apm_int(&eax, &ebx, &ecx)) { - printf("Display off failure: errcode = %ld\n", + printf("Display off failure: errcode = %ld\n", 0xff & (eax >> 8)); return 1; } @@ -304,7 +304,7 @@ apm_display_off(void) } /* APM Battery low handler */ -static void +static void apm_battery_low(struct apm_softc *sc) { printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); @@ -343,7 +343,7 @@ apm_add_hook(struct apmhook **list, struct apmhook *ah) return ah; } -static void +static void apm_del_hook(struct apmhook **list, struct apmhook *ah) { int s; @@ -370,7 +370,7 @@ nosuchnode: /* APM driver calls some functions automatically */ -static void +static void apm_execute_hook(struct apmhook *list) { struct apmhook *p; @@ -381,8 +381,8 @@ apm_execute_hook(struct apmhook *list) #endif if ((*(p->ah_fun))(p->ah_arg)) { printf("Warning: APM hook \"%s\" failed", p->ah_name); - } - } + } + } } @@ -410,7 +410,7 @@ apm_hook_disestablish(int apmh, struct apmhook *ah) static struct timeval suspend_time; static struct timeval diff_time; -static int +static int apm_default_resume(struct apm_softc *sc) { #ifdef __FreeBSD__ @@ -437,7 +437,7 @@ apm_default_resume(struct apm_softc *sc) return 0; } -static int +static int apm_default_suspend(void) { #ifdef __FreeBSD__ @@ -465,7 +465,7 @@ static void apm_processevent(struct apm_softc *); * */ -void +void apm_suspend(void) { struct apm_softc *sc; @@ -519,7 +519,7 @@ apm_get_info(struct apm_softc *sc, apm_info_t aip) /* inform APM BIOS that CPU is idle */ -void +void apm_cpu_idle(void) { struct apm_softc *sc = master_softc; /* XXX */ @@ -530,7 +530,7 @@ apm_cpu_idle(void) } } /* - * Some APM implementation halts CPU in BIOS, whenever + * Some APM implementation halts CPU in BIOS, whenever * "CPU-idle" function are invoked, but swtch() of * FreeBSD halts CPU, therefore, CPU is halted twice * in the sched loop. It makes the interrupt latency @@ -551,7 +551,7 @@ apm_cpu_idle(void) } /* inform APM BIOS that CPU is busy */ -void +void apm_cpu_busy(void) { struct apm_softc *sc = master_softc; /* XXX */ @@ -568,7 +568,7 @@ apm_cpu_busy(void) * This routine is automatically called by timer once per second. */ -static void +static void apm_timeout(void *arg) { struct apm_softc *sc = arg; @@ -578,7 +578,7 @@ apm_timeout(void *arg) } /* enable APM BIOS */ -static void +static void apm_event_enable(struct apm_softc *sc) { #ifdef APM_DEBUG @@ -591,7 +591,7 @@ apm_event_enable(struct apm_softc *sc) } /* disable APM BIOS */ -static void +static void apm_event_disable(struct apm_softc *sc) { #ifdef APM_DEBUG @@ -604,7 +604,7 @@ apm_event_disable(struct apm_softc *sc) } /* halt CPU in scheduling loop */ -static void +static void apm_halt_cpu(struct apm_softc *sc) { if (sc->initialized) { @@ -616,7 +616,7 @@ apm_halt_cpu(struct apm_softc *sc) } /* don't halt CPU in scheduling loop */ -static void +static void apm_not_halt_cpu(struct apm_softc *sc) { if (sc->initialized) { @@ -654,7 +654,7 @@ struct bus_driver apmdriver = { * to use V86 mode in APM initialization. */ -int +int #ifdef __FreeBSD__ apmprobe(struct isa_device *dvp) #endif /* __FreeBSD__ */ @@ -700,7 +700,7 @@ apm_processevent(struct apm_softc *sc) #endif while (1) { apm_event = apm_getevent(sc); - if (apm_event == PMEV_NOEVENT) + if (apm_event == PMEV_NOEVENT) break; switch (apm_event) { OPMEV_DEBUGMESSAGE(PMEV_STANDBYREQ); @@ -749,7 +749,7 @@ apm_processevent(struct apm_softc *sc) * Initialize APM driver (APM BIOS itself has been initialized in locore.s) * * Now, unless I'm mad, (not quite ruled out yet), the APM-1.1 spec is bogus: - * + * * Appendix C says under the header "APM 1.0/APM 1.1 Modal BIOS Behavior" * that "When an APM Driver connects with an APM 1.1 BIOS, the APM 1.1 BIOS * will default to an APM 1.0 connection. After an APM Driver calls the APM @@ -761,21 +761,21 @@ apm_processevent(struct apm_softc *sc) * OK so I can establish a 1.0 connection, and then tell that I'm a 1.1 * and maybe then the BIOS will tell that it too is a 1.1. * Fine. - * Now how will I ever get the segment-limits for instance ? There is no - * way I can see that I can get a 1.1 response back from an "APM Protected + * Now how will I ever get the segment-limits for instance ? There is no + * way I can see that I can get a 1.1 response back from an "APM Protected * Mode 32-bit Interface Connect" function ??? - * + * * Who made this, Intel and Microsoft ? -- How did you guess ! * * /phk */ #ifdef __FreeBSD__ -int +int apmattach(struct isa_device *dvp) #endif /* __FreeBSD__ */ #ifdef MACH_KERNEL -void +void apmattach(struct bus_device *dvp) #endif /* MACH_KERNEL */ { @@ -811,7 +811,7 @@ apmattach(struct bus_device *dvp) if (sc->idle_cpu) { apm_slowstart = apm_slowstart_p = 1; } -#endif +#endif /* print bootstrap messages */ #ifdef APM_DEBUG @@ -819,7 +819,7 @@ apmattach(struct bus_device *dvp) printf("apm%d: Code32 0x%08x, Code16 0x%08x, Data 0x%08x\n", unit, sc->cs32_base, sc->cs16_base, sc->ds_base); printf("apm%d: Code entry 0x%08x, Idling CPU %s, Management %s\n", - unit, sc->cs_entry, is_enabled(sc->idle_cpu), + unit, sc->cs_entry, is_enabled(sc->idle_cpu), is_enabled(!sc->disabled)); printf("apm%d: CS_limit=%x, DS_limit=%x\n", unit, sc->cs_limit, sc->ds_limit); @@ -829,7 +829,7 @@ apmattach(struct bus_device *dvp) sc->ds_limit = 0xffff; /* setup GDT */ - setup_apm_gdt(sc->cs32_base, sc->cs16_base, sc->ds_base, + setup_apm_gdt(sc->cs32_base, sc->cs16_base, sc->ds_base, sc->cs_limit, sc->ds_limit); /* setup entry point 48bit pointer */ @@ -845,7 +845,7 @@ apmattach(struct bus_device *dvp) apm_driver_version(); sc->minorversion = ((apm_version & 0x00f0) >> 4) * 10 + ((apm_version & 0x000f) >> 0); - sc->majorversion = ((apm_version & 0xf000) >> 12) * 10 + + sc->majorversion = ((apm_version & 0xf000) >> 12) * 10 + ((apm_version & 0x0f00) >> 8); sc->intversion = INTVERSION(sc->majorversion, sc->minorversion); @@ -855,14 +855,14 @@ apmattach(struct bus_device *dvp) unit, is_enabled(!sc->disengaged)); } - printf(" found APM BIOS version %d.%d\n", + printf(" found APM BIOS version %d.%d\n", sc->majorversion, sc->minorversion); printf("apm%d: Idling CPU %s\n", unit, is_enabled(sc->idle_cpu)); /* enable power management */ if (sc->disabled) { if (apm_enable_disable_pm(sc, 1)) { - printf("Warning: APM enable function failed! [%x]\n", + printf("Warning: APM enable function failed! [%x]\n", apm_errno); } } @@ -870,7 +870,7 @@ apmattach(struct bus_device *dvp) /* engage power managment (APM 1.1 or later) */ if (sc->intversion >= INTVERSION(1, 1) && sc->disengaged) { if (apm_engage_disengage_pm(sc, 1)) { - printf("Warning: APM engage function failed [%x]\n", + printf("Warning: APM engage function failed [%x]\n", apm_errno); } } @@ -900,8 +900,8 @@ apmattach(struct bus_device *dvp) } #ifdef __FreeBSD__ -int -apmopen(dev_t dev, int flag, int fmt, struct proc *p) +int +apmopen(dev_t dev, int flag, int fmt, struct proc *p) { struct apm_softc *sc = &apm_softc[minor(dev)]; @@ -914,13 +914,13 @@ apmopen(dev_t dev, int flag, int fmt, struct proc *p) return 0; } -int +int apmclose(dev_t dev, int flag, int fmt, struct proc *p) { return 0; } -int +int apmioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p) { struct apm_softc *sc = &apm_softc[minor(dev)]; diff --git a/sys/i386/bios/apm_init/Makefile b/sys/i386/bios/apm_init/Makefile index 1d9c5c3..3cc1f9d 100644 --- a/sys/i386/bios/apm_init/Makefile +++ b/sys/i386/bios/apm_init/Makefile @@ -5,14 +5,14 @@ # # This software may be used, modified, copied, and distributed, in # both source and binary form provided that the above copyright and -# these terms are retained. Under no circumstances is the author -# responsible for the proper functioning of this software, nor does -# the author assume any responsibility for damages incurred with its +# these terms are retained. Under no circumstances is the author +# responsible for the proper functioning of this software, nor does +# the author assume any responsibility for damages incurred with its # use. # # Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) # -# $Id: Makefile,v 1.2 1994/10/01 05:12:29 davidg Exp $ +# $Id: Makefile,v 1.3 1995/02/17 02:22:30 phk Exp $ # OBJS = apm_init.o real_prot.o table.o @@ -47,6 +47,6 @@ bin2asm: bin2asm.c allclean: clean @rm -f apm_init.inc clean: - @rm -f *.o apm_init apm_init.sym bin2asm + @rm -f *.o apm_init apm_init.sym bin2asm .include <bsd.prog.mk> diff --git a/sys/i386/bios/apm_init/bin2asm.c b/sys/i386/bios/apm_init/bin2asm.c index 791798a..09c98f4 100644 --- a/sys/i386/bios/apm_init/bin2asm.c +++ b/sys/i386/bios/apm_init/bin2asm.c @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: bin2asm.c,v 1.2 1994/10/01 05:12:30 davidg Exp $ + * $Id: bin2asm.c,v 1.3 1995/02/17 02:22:33 phk Exp $ */ #include <stdio.h> @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Usage: %s infile outfile\n", argv[0]); exit(1); } - + if ((infile = fopen(argv[1], "rb")) == NULL) { fprintf(stderr, "Can't open %s.\n", argv[1]); exit(1); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) } while ((col++) % NCOLS < NCOLS - 2); fprintf(outfile, "0x00\n"); } - + fprintf(outfile, "\n/* Total size = 0x%04x */\n", col); fclose(infile); diff --git a/sys/i386/bios/apm_init/real_prot.h b/sys/i386/bios/apm_init/real_prot.h index 692ebfe..93b3f28 100644 --- a/sys/i386/bios/apm_init/real_prot.h +++ b/sys/i386/bios/apm_init/real_prot.h @@ -1,30 +1,30 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.7 92/02/29 15:33:41 rpd - * $Id: real_prot.h,v 1.1 1994/10/01 02:55:52 davidg Exp $ + * $Id: real_prot.h,v 1.2 1995/02/17 02:22:33 phk Exp $ */ /* @@ -34,9 +34,9 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) diff --git a/sys/i386/bios/apm_init/table.c b/sys/i386/bios/apm_init/table.c index 607fcc6..b50d60f 100644 --- a/sys/i386/bios/apm_init/table.c +++ b/sys/i386/bios/apm_init/table.c @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: table.c,v 1.2 1994/10/01 05:12:31 davidg Exp $ + * $Id: table.c,v 1.3 1995/02/17 02:22:34 phk Exp $ */ #include <apm_bios.h> diff --git a/sys/i386/bios/apm_setup.h b/sys/i386/bios/apm_setup.h index 55f126d..f5e67ef 100644 --- a/sys/i386/bios/apm_setup.h +++ b/sys/i386/bios/apm_setup.h @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, distributed, and sold, * in both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm_setup.h,v 1.2 1994/10/01 05:12:23 davidg Exp $ + * $Id: apm_setup.h,v 1.3 1995/02/17 02:22:22 phk Exp $ */ extern u_long apm_version; diff --git a/sys/i386/boot/biosboot/asm.h b/sys/i386/boot/biosboot/asm.h index 43242bd..5d2c380 100644 --- a/sys/i386/boot/biosboot/asm.h +++ b/sys/i386/boot/biosboot/asm.h @@ -1,30 +1,30 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.7 92/02/29 15:33:41 rpd - * $Id$ + * $Id: asm.h,v 1.3 1993/10/16 19:11:29 rgrimes Exp $ */ #define S_ARG0 4(%esp) @@ -64,7 +64,7 @@ #define OUTL outl (%dx) #else wheeze -#define ALIGN +#define ALIGN #define LCL(x) x #define LB(x,n) n diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c index bb80505..8ff7d8e 100644 --- a/sys/i386/boot/biosboot/boot.c +++ b/sys/i386/boot/biosboot/boot.c @@ -2,34 +2,34 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, [92/04/03 16:51:14 rvb] - * $Id: boot.c,v 1.41 1995/04/21 16:50:31 bde Exp $ + * $Id: boot.c,v 1.42 1995/04/21 22:20:34 julian Exp $ */ /* - Copyright 1988, 1989, 1990, 1991, 1992 + Copyright 1988, 1989, 1990, 1991, 1992 by Intel Corporation, Santa Clara, California. All Rights Reserved diff --git a/sys/i386/boot/biosboot/boot.h b/sys/i386/boot/biosboot/boot.h index 92334bf..11dd6d9 100644 --- a/sys/i386/boot/biosboot/boot.h +++ b/sys/i386/boot/biosboot/boot.h @@ -2,29 +2,29 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:03 rpd - * $Id: boot.h,v 1.8 1995/04/21 16:07:12 bde Exp $ + * $Id: boot.h,v 1.9 1995/04/21 16:50:32 bde Exp $ */ #include <sys/types.h> diff --git a/sys/i386/boot/biosboot/disk.c b/sys/i386/boot/biosboot/disk.c index 5e858e2..7a605f4 100644 --- a/sys/i386/boot/biosboot/disk.c +++ b/sys/i386/boot/biosboot/disk.c @@ -2,29 +2,29 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:49 rpd - * $Id: disk.c,v 1.11 1995/05/11 16:19:50 phk Exp $ + * $Id: disk.c,v 1.12 1995/05/21 03:27:13 phk Exp $ */ /* @@ -87,7 +87,7 @@ devopen(void) int dosdev = inode.i_dev; int i, sector = 0, di; u_long bend; - + di = get_diskinfo(dosdev); spc = (spt = SPT(di)) * HEADS(di); if (dosdev == 2) diff --git a/sys/i386/boot/biosboot/io.c b/sys/i386/boot/biosboot/io.c index ff6de60..394c271 100644 --- a/sys/i386/boot/biosboot/io.c +++ b/sys/i386/boot/biosboot/io.c @@ -2,29 +2,29 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:57 rpd - * $Id: io.c,v 1.12 1995/01/25 21:37:45 bde Exp $ + * $Id: io.c,v 1.13 1995/04/14 21:26:51 joerg Exp $ */ #include "boot.h" diff --git a/sys/i386/boot/biosboot/sys.c b/sys/i386/boot/biosboot/sys.c index 49109f2..c88fb3d 100644 --- a/sys/i386/boot/biosboot/sys.c +++ b/sys/i386/boot/biosboot/sys.c @@ -2,29 +2,29 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:34 rpd - * $Id: sys.c,v 1.7 1994/12/30 07:48:07 bde Exp $ + * $Id: sys.c,v 1.8 1995/04/14 21:26:53 joerg Exp $ */ #include "boot.h" @@ -40,7 +40,7 @@ char buf[BUFSIZE], fsbuf[SBSIZE], iobuf[MAXBSIZE]; #define BUFSIZE 8192 #define MAPBUFSIZE BUFSIZE -char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE]; +char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE]; char mapbuf[MAPBUFSIZE]; int mapblock; diff --git a/sys/i386/boot/biosboot/table.c b/sys/i386/boot/biosboot/table.c index 5374c31..e9774f4 100644 --- a/sys/i386/boot/biosboot/table.c +++ b/sys/i386/boot/biosboot/table.c @@ -2,33 +2,33 @@ * Mach Operating System * Copyright (c) 1992, 1991 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:43 rpd - * $Id: table.c,v 1.5 1995/01/25 21:37:48 bde Exp $ + * $Id: table.c,v 1.6 1995/04/14 21:26:53 joerg Exp $ */ /* - Copyright 1988, 1989, 1990, 1991, 1992 + Copyright 1988, 1989, 1990, 1991, 1992 by Intel Corporation, Santa Clara, California. All Rights Reserved diff --git a/sys/i386/boot/dosboot/Makefile b/sys/i386/boot/dosboot/Makefile index e97d034..4646bbb 100644 --- a/sys/i386/boot/dosboot/Makefile +++ b/sys/i386/boot/dosboot/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/03/28 19:22:43 phk Exp $ # MPROG= fbsdboot.exe @@ -8,7 +8,7 @@ BINMODE= 444 NOMAN= STRIP= -all: ${MPROG} +all: ${MPROG} install: ${MPROG} ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ diff --git a/sys/i386/boot/kzipboot/boot.c b/sys/i386/boot/kzipboot/boot.c index 7a15e4e..6dbd219 100644 --- a/sys/i386/boot/kzipboot/boot.c +++ b/sys/i386/boot/kzipboot/boot.c @@ -1,4 +1,4 @@ -/* +/* * FreeBSD kernel unpacker. * 1993 by Serge Vakulenko * modified for FreeBSD 2.1 by Gary Jennejohn - 12FEB95 diff --git a/sys/i386/boot/kzipboot/malloc.c b/sys/i386/boot/kzipboot/malloc.c index b540ec1..7890097 100644 --- a/sys/i386/boot/kzipboot/malloc.c +++ b/sys/i386/boot/kzipboot/malloc.c @@ -54,5 +54,5 @@ void free(cp, junk) /* junk not used */ void *cp; int junk; -{ +{ } diff --git a/sys/i386/boot/kzipboot/misc.c b/sys/i386/boot/kzipboot/misc.c index adf0e0d..a971aee 100644 --- a/sys/i386/boot/kzipboot/misc.c +++ b/sys/i386/boot/kzipboot/misc.c @@ -1,7 +1,7 @@ /* * misc.c - * - * This is a collection of several routines from gzip-1.0.3 + * + * This is a collection of several routines from gzip-1.0.3 * adapted for Linux. * * Ported to 386bsd by Serge Vakulenko @@ -95,7 +95,7 @@ void flush_window() } /* - * Code to compute the CRC-32 table. Borrowed from + * Code to compute the CRC-32 table. Borrowed from * gzip-1.0.3/makecrc.c. * Not copyrighted 1990 Mark Adler */ @@ -192,7 +192,7 @@ static void get_method() error("Corrupted input"); } -void +void decompress_kernel (void *dest) { output_data = dest; diff --git a/sys/i386/boot/kzipboot/unzip.c b/sys/i386/boot/kzipboot/unzip.c index 5883bc0..93a2c8b 100644 --- a/sys/i386/boot/kzipboot/unzip.c +++ b/sys/i386/boot/kzipboot/unzip.c @@ -110,7 +110,7 @@ void unzip() orig_len = LG(inbuf + LOCLEN); } - if (method != DEFLATED) + if (method != DEFLATED) error("internal error, invalid method"); infl.gz_input = NextByte; infl.gz_output = Flush; diff --git a/sys/i386/boot/netboot/3c509.c b/sys/i386/boot/netboot/3c509.c index b729a46..9ebfe5d 100644 --- a/sys/i386/boot/netboot/3c509.c +++ b/sys/i386/boot/netboot/3c509.c @@ -8,7 +8,7 @@ Author: Martin Renters. Andres Vega Garcia's if_ep.c driver. Copyright (C) 1993-1994, David Greenman, Martin Renters. - Copyright (C) 1993-1995, Andres Vega Garcia. + Copyright (C) 1993-1995, Andres Vega Garcia. Copyright (C) 1995, Serge Babkin. This software may be used, modified, copied, distributed, and sold, in both source and binary form provided that the above copyright and these @@ -18,7 +18,7 @@ Author: Martin Renters. 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su) -$Id: 3c509.c,v 1.1 1995/04/11 05:37:59 root Exp root $ +$Id: 3c509.c,v 1.1 1995/04/12 20:14:56 martin Exp $ ***************************************************************************/ @@ -158,7 +158,7 @@ eth_probe() eth_vendor=VENDOR_NONE; goto no3c509; } - + break; case 1: if(i & IS_AUI) @@ -168,7 +168,7 @@ eth_probe() eth_vendor=VENDOR_NONE; goto no3c509; } - + break; case 3: if(i & IS_BNC) { @@ -180,7 +180,7 @@ eth_probe() eth_vendor=VENDOR_NONE; goto no3c509; } - + break; default: printf("unknown connector\r\n"); @@ -240,8 +240,8 @@ eth_reset() outw(BASE + EP_COMMAND, SET_INTR_MASK); outw(BASE + EP_COMMAND, SET_RX_FILTER); - /* - /* initialize card + /* + /* initialize card */ while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS); diff --git a/sys/i386/boot/netboot/3c509.h b/sys/i386/boot/netboot/3c509.h index 049f235..8bfa368 100644 --- a/sys/i386/boot/netboot/3c509.h +++ b/sys/i386/boot/netboot/3c509.h @@ -1,13 +1,13 @@ /* * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. 2. The name * of the author may not be used to endorse or promote products derived from * this software withough specific prior written permission - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -18,15 +18,15 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp Modified by: - * + * October 2, 1994 - - Modified by: Andres Vega Garcia - INRIA - Sophia Antipolis, France - e-mail: avega@sophia.inria.fr + Modified by: Andres Vega Garcia + + INRIA - Sophia Antipolis, France + e-mail: avega@sophia.inria.fr finger: avega@pax.inria.fr */ @@ -284,7 +284,7 @@ #define S_COMMAND_IN_PROGRESS (u_short) (0x1000) /* - * FIFO Registers. + * FIFO Registers. * RX Status. Window 1/Port 08 * * 15: Incomplete or FIFO empty. @@ -310,7 +310,7 @@ #define ERR_RX_DRIBBLE (u_short) (0x2<<11) /* - * FIFO Registers. + * FIFO Registers. * TX Status. Window 1/Port 0B * * Reports the transmit status of a completed transmission. Writing this @@ -335,7 +335,7 @@ #define TXS_STATUS_OVERFLOW 0x4 /* - * Configuration control register. + * Configuration control register. * Window 0/Port 04 */ /* Read */ @@ -346,7 +346,7 @@ #define ENABLE_DRQ_IRQ 0x0001 #define W0_P4_CMD_RESET_ADAPTER 0x4 #define W0_P4_CMD_ENABLE_ADAPTER 0x1 -/* +/* * Media type and status. * Window 4/Port 0A */ @@ -360,7 +360,7 @@ #define SET_IRQ(i) ( ((i)<<12) | 0xF00) /* set IRQ i */ /* - * Receive status register + * Receive status register */ #define RX_BYTES_MASK (u_short) (0x07ff) diff --git a/sys/i386/boot/netboot/bootmenu.c b/sys/i386/boot/netboot/bootmenu.c index 32b266c..77a12ed 100644 --- a/sys/i386/boot/netboot/bootmenu.c +++ b/sys/i386/boot/netboot/bootmenu.c @@ -181,7 +181,7 @@ CMD_HOSTNAME - Set my hostname cmd_hostname(p) char *p; { - if (*p) + if (*p) hostnamelen = ((sprintf(&nfsdiskless.my_hostnam,"%s",p) - (char*)&nfsdiskless.my_hostnam) + 3) & ~3; else printf("Hostname is: %s\r\n",nfsdiskless.my_hostnam); diff --git a/sys/i386/boot/netboot/main.c b/sys/i386/boot/netboot/main.c index 5cadf8f..8ee6cf4 100644 --- a/sys/i386/boot/netboot/main.c +++ b/sys/i386/boot/netboot/main.c @@ -197,7 +197,7 @@ load() nfsdiskless.swap_saddr.sin_len = sizeof(struct sockaddr_in); nfsdiskless.swap_saddr.sin_family = AF_INET; nfsdiskless.swap_saddr.sin_port = htons(swap_nfs_port); - nfsdiskless.swap_saddr.sin_addr.s_addr = + nfsdiskless.swap_saddr.sin_addr.s_addr = htonl(arptable[ARP_SWAPSERVER].ipaddr); nfsdiskless.swap_args.timeo = 10; nfsdiskless.swap_args.retrans = 100; @@ -219,7 +219,7 @@ load() nfsdiskless.root_saddr.sin_len = sizeof(struct sockaddr_in); nfsdiskless.root_saddr.sin_family = AF_INET; nfsdiskless.root_saddr.sin_port = htons(root_nfs_port); - nfsdiskless.root_saddr.sin_addr.s_addr = + nfsdiskless.root_saddr.sin_addr.s_addr = htonl(arptable[ARP_ROOTSERVER].ipaddr); nfsdiskless.root_args.timeo = 10; nfsdiskless.root_args.retrans = 100; @@ -356,7 +356,7 @@ udp_transmit(destip, srcsock, destsock, len, buf) } else { long h_netmask = ntohl(netmask); /* Check to see if we need gateway */ - if (((destip & h_netmask) != + if (((destip & h_netmask) != (arptable[ARP_CLIENT].ipaddr & h_netmask)) && arptable[ARP_GATEWAY].ipaddr) destip = arptable[ARP_GATEWAY].ipaddr; @@ -507,7 +507,7 @@ await_reply(type, ival, ptr) if ((packetlen < protohdrlen) || (((packet[12] << 8) | packet[13]) != IP)) continue; ip = (struct iphdr *)&packet[ETHER_HDR_SIZE]; - if ((ip->verhdrlen != 0x45) || + if ((ip->verhdrlen != 0x45) || ipchksum(ip, sizeof(struct iphdr)) || (ip->protocol != IP_UDP)) continue; udp = (struct udphdr *)&packet[ETHER_HDR_SIZE + diff --git a/sys/i386/boot/netboot/ns8390.c b/sys/i386/boot/netboot/ns8390.c index 10e8862..14cca17 100644 --- a/sys/i386/boot/netboot/ns8390.c +++ b/sys/i386/boot/netboot/ns8390.c @@ -134,7 +134,7 @@ eth_probe() } } printf("\r\n"); - + } #endif #ifdef INCLUDE_3COM @@ -244,7 +244,7 @@ eth_probe() /* * Clear memory and verify that it worked (we use only 8K) */ - bzero(eth_bmem, 0x2000); + bzero(eth_bmem, 0x2000); for(i = 0; i < 0x2000; ++i) if (*((eth_bmem)+i)) { printf ("Failed to clear 3c503 shared mem.\r\n"); diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index e81caf3..aef5755 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -1,6 +1,6 @@ # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.62 1995/04/05 04:10:58 nate Exp $ +# $Id: Makefile.i386,v 1.63 1995/05/11 19:48:45 wollman Exp $ # # Makefile for FreeBSD # @@ -14,7 +14,7 @@ # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # -CC?= cc +CC?= cc CPP?= cpp LD?= /usr/bin/ld @@ -61,7 +61,7 @@ SFILES= ${I386}/i386/exception.s ${I386}/i386/microtime.s \ ${I386}/i386/support.s ${I386}/i386/swtch.s ${I386}/apm/apm_setup.s SYSTEM_CFILES= ioconf.c param.c vnode_if.c SYSTEM_SFILES= ${I386}/i386/locore.s -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o +SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} libkern.a SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o libkern.a @@ -145,7 +145,7 @@ trap.o cons.o: Makefile assym.s: genassym ./genassym >assym.s -# Some of the defines that genassym outputs may well depend on the +# Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c diff --git a/sys/i386/eisa/aha1742.c b/sys/i386/eisa/aha1742.c index 0d31e01..727b9a4 100644 --- a/sys/i386/eisa/aha1742.c +++ b/sys/i386/eisa/aha1742.c @@ -14,7 +14,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aha1742.c,v 1.32 1995/05/09 12:25:50 rgrimes Exp $ + * $Id: aha1742.c,v 1.33 1995/05/11 19:26:15 rgrimes Exp $ */ #include <sys/types.h> @@ -561,7 +561,7 @@ ahb_attach(dev) * Return some information to the caller about * the adapter and it's capabilities */ -u_int32 +u_int32 ahb_adapter_info(unit) int unit; { @@ -590,7 +590,7 @@ ahbintr(unit) while (inb(port + G2STAT) & G2STAT_INT_PEND) { /* - * First get all the information and then + * First get all the information and then * acknowlege the interrupt */ ahbstat = inb(port + G2INTST); @@ -712,7 +712,7 @@ ahb_done(unit, ecb, state) printf("unexpected ha_status: %x\n", stat->ha_status); } -#endif /*AHBDEBUG */ +#endif /*AHBDEBUG */ } } else { switch (stat->targ_status) { @@ -741,7 +741,7 @@ done: xs->flags |= ITSDONE; } /* - * A ecb (and hence a mbx-out is put onto the + * A ecb (and hence a mbx-out is put onto the * free list. */ void @@ -770,7 +770,7 @@ ahb_free_ecb(unit, ecb, flags) } /* - * Get a free ecb + * Get a free ecb * If there are none, see if we can allocate a * new one. If so, put it in the hash table too * otherwise either return an error or sleep @@ -863,7 +863,7 @@ ahb_init(unit) #define NO_NO 1 #ifdef NO_NO /* - * reset board, If it doesn't respond, assume + * reset board, If it doesn't respond, assume * that it's not there.. good for the probe */ outb(port + EBCTRL, CDEN); /* enable full card */ @@ -944,7 +944,7 @@ ahb_init(unit) #ifndef min #define min(x,y) (x < y ? x : y) -#endif /* min */ +#endif /* min */ void ahbminphys(bp) @@ -960,7 +960,7 @@ ahbminphys(bp) * the data address. Also needs the unit, target * and lu */ -int32 +int32 ahb_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -1001,7 +1001,7 @@ ahb_scsi_cmd(xs) /* * If it's a reset, we need to do an 'immediate' * command, and store it's ecb for later - * if there is already an immediate waiting, + * if there is already an immediate waiting, * then WE must wait */ if (flags & SCSI_RESET) { @@ -1091,8 +1091,8 @@ ahb_scsi_cmd(xs) nextphys = thisphys; while ((datalen) && (thisphys == nextphys)) { /* - * This page is contiguous (physically) with - * the the last, just extend the length + * This page is contiguous (physically) with + * the the last, just extend the length */ /* how far to the end of the page */ nextphys = (thisphys & (~(PAGESIZ - 1))) @@ -1111,7 +1111,7 @@ ahb_scsi_cmd(xs) thisphys = KVTOPHYS(thiskv); } /* - * next page isn't contiguous, finish the seg + * next page isn't contiguous, finish the seg */ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("(0x%x)", bytes_this_seg)); @@ -1194,7 +1194,7 @@ ahb_timeout(void *arg1) #endif /*AHBDEBUG */ /* - * If it's immediate, don't try abort it + * If it's immediate, don't try abort it */ if (ecb->flags & ECB_IMMED) { ecb->xs->retries = 0; /* I MEAN IT ! */ diff --git a/sys/i386/eisa/aic7770.c b/sys/i386/eisa/aic7770.c index 2cfb904..ce4f948 100644 --- a/sys/i386/eisa/aic7770.c +++ b/sys/i386/eisa/aic7770.c @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7770.c,v 1.12 1995/03/31 13:36:57 gibbs Exp $ + * $Id: aic7770.c,v 1.13 1995/04/12 20:47:36 wollman Exp $ */ #include <sys/param.h> @@ -32,16 +32,16 @@ #include <machine/cpufunc.h> #include <i386/scsi/aic7xxx.h> -int aic7770probe __P((struct isa_device *dev)); +int aic7770probe __P((struct isa_device *dev)); int aic7770_attach __P((struct isa_device *dev)); -/* +/* * Standard EISA Host ID regs (Offset from slot base) */ #define HID0 0xC80 /* 0,1: msb of ID2, 2-7: ID1 */ -#define HID1 0xC81 /* 0-4: ID3, 5-7: LSB ID2 */ -#define HID2 0xC82 /* product */ +#define HID1 0xC81 /* 0-4: ID3, 5-7: LSB ID2 */ +#define HID2 0xC82 /* product */ #define HID3 0xC83 /* firmware revision */ #define CHAR1(B1,B2) (((B1>>2) & 0x1F) | '@') @@ -78,11 +78,11 @@ aic7770_registerdev(struct isa_device *id) kdc_aic7770[id->id_unit].kdc_unit = id->id_unit; kdc_aic7770[id->id_unit].kdc_parentdata = id; dev_attach(&kdc_aic7770[id->id_unit]); -} +} int aic7770probe(struct isa_device *dev) -{ +{ u_long port; int i; u_char sig_id[4]; @@ -101,7 +101,7 @@ aic7770probe(struct isa_device *dev) port = 0x1000 * ahc_slot; for( i = 0; i < sizeof(sig_id); i++ ) { - /* + /* * An outb is required to prime these registers on * VL cards */ @@ -124,13 +124,13 @@ aic7770probe(struct isa_device *dev) #ifndef DEV_LKM aic7770_registerdev(dev); #endif /* DEV_LKM */ - if(ahcprobe(unit, port, - valid_ids[i].type)){ + if(ahcprobe(unit, port, + valid_ids[i].type)){ /* - * If it's there, put in it's + * If it's there, put in it's * interrupt vectors */ - dev->id_irq = (1 << + dev->id_irq = (1 << ahcdata[unit]->vect); dev->id_drq = -1; /* EISA dma */ ahc_unit++; diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c index 2aad5d2..ca6baf3 100644 --- a/sys/i386/eisa/eisaconf.c +++ b/sys/i386/eisa/eisaconf.c @@ -13,7 +13,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: eisaconf.c,v 1.1 1995/03/13 09:10:17 root Exp root $ + * $Id: eisaconf.c,v 1.1 1995/04/23 08:55:41 julian Exp $ */ /* @@ -61,7 +61,7 @@ eisa_configure() if (productID & 0x80) { printf("Warning: running EISA kernel on non-EISA system board\n"); return; - } + } printf("Probing for devices on EISA bus\n"); productID = (productID<<8) | inb(eisaBase+1); productRevision = inb(eisaBase+2); diff --git a/sys/i386/eisa/eisaconf.h b/sys/i386/eisa/eisaconf.h index b0a0cbb..9b16c23 100644 --- a/sys/i386/eisa/eisaconf.h +++ b/sys/i386/eisa/eisaconf.h @@ -13,14 +13,14 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: eisaconf.h,v 1.1 1995/03/13 09:10:17 root Exp root $ + * $Id: eisaconf.h,v 1.1 1995/04/23 08:55:42 julian Exp $ */ /* * Ported to run under FreeBSD by Julian Elischer (julian@tfs.com) Sept 1992 */ -#define EISA_SLOTS 10 /* PCI clashes with higher ones.. fix later */ +#define EISA_SLOTS 10 /* PCI clashes with higher ones.. fix later */ struct eisa_dev { char productID[4]; unsigned short productType; diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index e110eff..f0648c9 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,13 +34,13 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.31 1995/05/14 02:59:51 davidg Exp $ + * $Id: autoconf.c,v 1.32 1995/05/29 04:08:13 davidg Exp $ */ /* * Setup the system to run on the current machine. * - * Configure() is called at boot time and initializes the vba + * Configure() is called at boot time and initializes the vba * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. @@ -237,7 +237,7 @@ setdumpdev(dev) dumpdev = dev; dumplo = newdumplo; return (0); -} +} u_long bootdev = 0; /* not a dev_t - encoding is different */ diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c index 60acb7d..1b00786 100644 --- a/sys/i386/i386/conf.c +++ b/sys/i386/i386/conf.c @@ -42,7 +42,7 @@ * SUCH DAMAGE. * * from: @(#)conf.c 5.8 (Berkeley) 5/12/91 - * $Id: conf.c,v 1.83 1995/04/14 15:13:26 dufault Exp $ + * $Id: conf.c,v 1.84 1995/04/28 00:51:30 dufault Exp $ */ #include <sys/param.h> @@ -522,15 +522,15 @@ d_select_t logselect; d_open_t bquopen; d_close_t bquclose; d_rdwr_t bquread, bquwrite; -d_select_t bquselect; +d_select_t bquselect; d_ioctl_t bquioctl; -#else -#define bquopen nxopen +#else +#define bquopen nxopen #define bquclose nxclose #define bquread nxread #define bquwrite nxwrite #define bquselect nxselect -#define bquioctl nxioctl +#define bquioctl nxioctl #endif #include "lpt.h" @@ -805,8 +805,8 @@ d_ttycv_t cxdevtotty; d_open_t gpopen; d_close_t gpclose; d_rdwr_t gpwrite; -d_ioctl_t gpioctl; -#else +d_ioctl_t gpioctl; +#else #define gpopen nxopen #define gpclose nxclose #define gpwrite nxwrite @@ -818,8 +818,8 @@ d_ioctl_t gpioctl; d_open_t gscopen; d_close_t gscclose; d_rdwr_t gscread; -d_ioctl_t gscioctl; -#else +d_ioctl_t gscioctl; +#else #define gscopen nxopen #define gscclose nxclose #define gscread nxread @@ -855,8 +855,8 @@ d_select_t tunselect; #define tunselect nxselect #endif -#include "spigot.h" -#if NSPIGOT > 0 +#include "spigot.h" +#if NSPIGOT > 0 d_open_t spigot_open; d_close_t spigot_close; d_ioctl_t spigot_ioctl; @@ -864,12 +864,12 @@ d_rdwr_t spigot_read, spigot_write; d_select_t spigot_select; d_mmap_t spigot_mmap; #else -#define spigot_open nxopen -#define spigot_close nxclose -#define spigot_ioctl nxioctl -#define spigot_read nxread -#define spigot_write nxwrite -#define spigot_select seltrue +#define spigot_open nxopen +#define spigot_close nxclose +#define spigot_ioctl nxioctl +#define spigot_read nxread +#define spigot_write nxwrite +#define spigot_select seltrue #define spigot_mmap nommap #endif @@ -1162,7 +1162,7 @@ struct cdevsw cdevsw[] = seltrue, nommap, vnstrategy }, { gpopen, gpclose, noread, gpwrite, /*44*/ gpioctl, nostop, nullreset, nodevtotty,/* GPIB */ - seltrue, nommap, NULL }, + seltrue, nommap, NULL }, { scdopen, scdclose, rawread, nowrite, /*45*/ scdioctl, nostop, nullreset, nodevtotty,/* sony cd */ seltrue, nommap, scdstrategy }, diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c index 3076fab..1500ff2 100644 --- a/sys/i386/i386/cons.c +++ b/sys/i386/i386/cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.26 1995/04/23 12:55:54 bde Exp $ + * $Id: cons.c,v 1.27 1995/04/24 16:42:59 bde Exp $ */ #include <sys/param.h> @@ -135,7 +135,7 @@ cnopen(dev, flag, mode, p) } return (retval); } - + int cnclose(dev, flag, mode, p) dev_t dev; @@ -168,7 +168,7 @@ cnclose(dev, flag, mode, p) } return ((*cn_phys_close)(dev, flag, mode, p)); } - + int cnread(dev, uio, flag) dev_t dev; @@ -180,7 +180,7 @@ cnread(dev, uio, flag) dev = cn_tab->cn_dev; return ((*cdevsw[major(dev)].d_read)(dev, uio, flag)); } - + int cnwrite(dev, uio, flag) dev_t dev; @@ -195,7 +195,7 @@ cnwrite(dev, uio, flag) dev = cn_tab->cn_dev; return ((*cdevsw[major(dev)].d_write)(dev, uio, flag)); } - + int cnioctl(dev, cmd, data, flag, p) dev_t dev; diff --git a/sys/i386/i386/db_disasm.c b/sys/i386/i386/db_disasm.c index 4e6a42c..8ce7365 100644 --- a/sys/i386/i386/db_disasm.c +++ b/sys/i386/i386/db_disasm.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_disasm.c,v 1.7 1994/10/08 22:19:47 phk Exp $ + * $Id: db_disasm.c,v 1.8 1995/01/29 02:38:15 bde Exp $ */ /* diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c index 29007d2..8daa0a2 100644 --- a/sys/i386/i386/db_interface.c +++ b/sys/i386/i386/db_interface.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_interface.c,v 1.12 1995/03/16 18:11:25 bde Exp $ + * $Id: db_interface.c,v 1.13 1995/04/08 21:31:53 joerg Exp $ */ /* diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index 28c152f..dcbf194 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_trace.c,v 1.9 1995/03/01 21:37:44 davidg Exp $ + * $Id: db_trace.c,v 1.10 1995/03/16 18:11:26 bde Exp $ */ #include <sys/param.h> @@ -127,13 +127,13 @@ db_numargs(fp) return (args); } -/* - * Figure out the next frame up in the call stack. - * For trap(), we print the address of the faulting instruction and +/* + * Figure out the next frame up in the call stack. + * For trap(), we print the address of the faulting instruction and * proceed with the calling frame. We return the ip that faulted. * If the trap was caused by jumping through a bogus pointer, then - * the next line in the backtrace will list some random function as - * being called. It should get the argument list correct, though. + * the next line in the backtrace will list some random function as + * being called. It should get the argument list correct, though. * It might be possible to dig out from the next frame up the name * of the function that faulted, but that could get hairy. */ diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c index dbfb2a0..a526184 100644 --- a/sys/i386/i386/genassym.c +++ b/sys/i386/i386/genassym.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 - * $Id: genassym.c,v 1.25 1995/02/14 18:01:24 phk Exp $ + * $Id: genassym.c,v 1.26 1995/05/25 07:41:18 davidg Exp $ */ #include <stdio.h> @@ -43,10 +43,10 @@ #include <sys/proc.h> /* XXX This is just real ugly to have to do, but it is what you have to do! */ #ifndef NFS -#define NFS +#define NFS #include <sys/mount.h> #undef NFS -#else +#else #include <sys/mount.h> #endif #include <sys/mbuf.h> diff --git a/sys/i386/i386/in_cksum.c b/sys/i386/i386/in_cksum.c index 2d6d77a..1764a58 100644 --- a/sys/i386/i386/in_cksum.c +++ b/sys/i386/i386/in_cksum.c @@ -32,7 +32,7 @@ * * from tahoe: in_cksum.c 1.2 86/01/05 * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 - * $Id: in_cksum.c,v 1.5 1994/03/07 11:47:30 davidg Exp $ + * $Id: in_cksum.c,v 1.6 1994/08/13 03:49:39 wollman Exp $ */ #include <sys/param.h> @@ -44,7 +44,7 @@ * * This routine is very heavily used in the network * code and should be modified for each CPU to be as fast as possible. - * + * * This implementation is 386 version. */ @@ -83,7 +83,7 @@ in_cksum(m, len) * last mbuf. */ - /* su.c[0] is already saved when scanning previous + /* su.c[0] is already saved when scanning previous * mbuf. sum was REDUCEd when we found mlen == -1 */ su.c[1] = *(u_char *)w; @@ -149,7 +149,7 @@ in_cksum(m, len) * memory takes to load the first word(s) addressed. * These penalties are unavoidable. Subsequent * accesses to a cache line being loaded (and to - * other external memory?) are delayed until the + * other external memory?) are delayed until the * whole load finishes. These penalties are mostly * avoided by not accessing external memory for * 8 cycles after the ADD(16) and 12 cycles after diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 2f299b1..4a2d41d 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.126 1995/05/12 19:17:14 wollman Exp $ + * $Id: machdep.c,v 1.127 1995/05/25 07:41:20 davidg Exp $ */ #include "npx.h" @@ -389,7 +389,7 @@ again: printf(" %x:%08x", i, j); printf(" %d cyl, %d heads, %d sects\n", j >> 16, (j >> 8) & 0xff, j & 0xff); - + } printf(" %d accounted for\n", bootinfo.bi_n_bios_used); } @@ -421,7 +421,7 @@ static void identifycpu() { printf("CPU: "); - if (cpu >= 0 + if (cpu >= 0 && cpu < (sizeof i386_cpus/sizeof(struct cpu_nameclass))) { cpu_class = i386_cpus[cpu].cpu_class; strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof cpu_model); @@ -442,8 +442,8 @@ identifycpu() cpu_model[0] = '\0'; switch (cpu_id & 0x3000) { - case 0x1000: - strcpy(cpu_model, "Overdrive "); + case 0x1000: + strcpy(cpu_model, "Overdrive "); break; case 0x2000: strcpy(cpu_model, "Dual "); @@ -478,7 +478,7 @@ identifycpu() case 0x480: strcat(cpu_model, "DX4"); break; #if defined(I586_CPU) - case 0x510: + case 0x510: if (pentium_mhz == 60) { strcat(cpu_model, "510\\60"); } else if (pentium_mhz == 66) { @@ -630,7 +630,7 @@ sendsig(catcher, sig, mask, code) return; } - /* + /* * Build the argument list for the signal handler. */ if (p->p_sysent->sv_sigtbl) { @@ -868,7 +868,7 @@ boot(arghowto) if (howto & RB_DUMP) { savectx(&dumppcb, 0); dumppcb.pcb_ptd = rcr3(); - dumpsys(); + dumpsys(); if (PANIC_REBOOT_WAIT_TIME != 0) { if (PANIC_REBOOT_WAIT_TIME != -1) { @@ -1321,7 +1321,7 @@ init386(first) #ifdef COMPAT_LINUX setidt(0x80, &IDTVEC(linux_syscall), SDT_SYS386TGT, SEL_UPL); #endif - + #include "isa.h" #if NISA >0 isa_defaultirq(); @@ -1507,7 +1507,7 @@ init386(first) proc0.p_addr->u_pcb.pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = + ((struct i386tss *)gdt_segs[GPROC0_SEL].ssd_base)->tss_ioopt = (sizeof(tss))<<16; ltr(gsel_tss); diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c index 6c10020..d2ae7eb 100644 --- a/sys/i386/i386/math_emulate.c +++ b/sys/i386/i386/math_emulate.c @@ -6,7 +6,7 @@ * [expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj] * * from: 386BSD 0.1 - * $Id: math_emulate.c,v 1.10 1994/09/15 10:58:35 davidg Exp $ + * $Id: math_emulate.c,v 1.11 1995/05/11 19:26:09 rgrimes Exp $ */ /* @@ -270,7 +270,7 @@ for fcom , ??? ATS */ case 0x9b: /* same as above , ATS */ fcom(PST(code & 7),PST(0)); fpop(); - return(0); + return(0); case 0x9c: /* fsubr */ ST(code & 7).exponent ^= 0x8000; fadd(PST(0),PST(code & 7),&tmp); @@ -1396,7 +1396,7 @@ void frndint(const temp_real * a, temp_real * b) b->exponent = 0; } -void Fscale(const temp_real *a, const temp_real *b, temp_real *c) +void Fscale(const temp_real *a, const temp_real *b, temp_real *c) { temp_int ti; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index bb4858f..9971603 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.56 1995/04/09 05:40:38 davidg Exp $ + * $Id: pmap.c,v 1.57 1995/05/11 19:26:11 rgrimes Exp $ */ /* @@ -167,7 +167,7 @@ struct msgbuf *msgbufp; #endif -void +void init_pv_entries(int); /* @@ -178,7 +178,7 @@ init_pv_entries(int); * [ what about induced faults -wfj] */ -inline pt_entry_t * const +inline pt_entry_t * const pmap_pte(pmap, va) register pmap_t pmap; vm_offset_t va; diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 7e33003..3c4f1cc 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.7 1995/03/04 02:25:36 davidg Exp $ + * $Id: sys_machdep.c,v 1.8 1995/03/10 08:13:07 davidg Exp $ * */ @@ -64,11 +64,11 @@ sysarch(p, uap, retval) switch(uap->op) { #ifdef USER_LDT - case I386_GET_LDT: + case I386_GET_LDT: error = i386_get_ldt(p, uap->parms, retval); break; - case I386_SET_LDT: + case I386_SET_LDT: error = i386_set_ldt(p, uap->parms, retval); break; #endif diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 6ca87c2..5e1489a 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.50 1995/03/21 07:02:51 davidg Exp $ + * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ */ /* @@ -174,7 +174,7 @@ trap(frame) type = frame.tf_trapno; code = frame.tf_err; - + if (ISPL(frame.tf_cs) == SEL_UPL) { /* user trap */ @@ -262,7 +262,7 @@ trap(frame) return; #endif /* NNPX > 0 */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) i = math_emulate(&frame); if (i == 0) { if (!(frame.tf_eflags & PSL_T)) @@ -352,7 +352,7 @@ trap(frame) frame.tf_eflags &= ~PSL_T; return; #endif - + #if NISA > 0 case T_NMI: #ifdef DDB @@ -376,7 +376,7 @@ trap(frame) #ifdef DEBUG eva = rcr2(); if (type <= MAX_TRAP_MSG) { - uprintf("fatal process exception: %s", + uprintf("fatal process exception: %s", trap_msg[type]); if ((type == T_PAGEFLT) || (type == T_PROTFLT)) uprintf(", fault VA = 0x%x", eva); @@ -464,7 +464,7 @@ trap_pfault(frame, usermode) v = (vm_offset_t) vtopte(va); /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -580,7 +580,7 @@ trap_pfault(frame, usermode) */ /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -804,7 +804,7 @@ syscall(frame) if (p->p_sysent->sv_mask) code = code & p->p_sysent->sv_mask; - + if (code >= p->p_sysent->sv_size) callp = &p->p_sysent->sv_table[0]; else @@ -852,7 +852,7 @@ syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = error; frame.tf_eflags |= PSL_C; /* carry bit */ @@ -966,7 +966,7 @@ linux_syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = -error; frame.tf_eflags |= PSL_C; /* carry bit */ diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index 196d34c..e1bc372 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.32 1995/03/16 18:11:58 bde Exp $ + * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ */ /* @@ -193,7 +193,7 @@ int acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) { if (timer0_state || TIMER_DIV(rate) < TIMER0_MIN_MAX_COUNT || - !function) + !function) return -1; new_function = function; new_rate = rate; @@ -204,7 +204,7 @@ acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) int acquire_timer2(int mode) { - if (timer2_state) + if (timer2_state) return -1; timer2_state = 1; outb(TIMER_MODE, TIMER_SEL2 | (mode &0x3f)); @@ -265,7 +265,7 @@ printrtc(void) #endif static int -getit() +getit() { int high, low; @@ -307,7 +307,7 @@ calibrate_cyclecounter(void) /* * Wait "n" microseconds. - * Relies on timer 1 counting down from (TIMER_FREQ / hz) + * Relies on timer 1 counting down from (TIMER_FREQ / hz) * Note: timer had better have been programmed before this is first used! */ void @@ -339,7 +339,7 @@ DELAY(int n) prev_tick = getit(0, 0); n -= 20; /* - * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point + * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point * and without any avoidable overflows. */ sec = n / 1000000; @@ -375,11 +375,11 @@ sysbeepstop(void *chan) beeping = 0; } -int +int sysbeep(int pitch, int period) { - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) return -1; disable_intr(); outb(TIMER_CNTR2, pitch); @@ -426,7 +426,7 @@ readrtc(int port) * XXX initialization of other timers is unintentionally left blank. */ void -startrtclock() +startrtclock() { timer0_max_count = hardclock_max_count = TIMER_DIV(hz); timer0_overflow_threshold = timer0_max_count - TIMER0_LATCH_COUNT; diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 2f207bc..0d16016 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -8,7 +8,7 @@ * * Many additional changes by Bruce Evans * - * This code is derived from software contributed by the + * This code is derived from software contributed by the * University of California Berkeley, Jordan K. Hubbard, * David Greenman and Bruce Evans. * @@ -40,7 +40,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.26 1995/05/07 19:45:49 jkh Exp $ + * $Id: userconfig.c,v 1.27 1995/05/08 06:14:16 jkh Exp $ */ #include <sys/param.h> @@ -675,7 +675,7 @@ save_dev(idev) struct isa_device *idev; { struct isa_device *id_p,*id_pn; - + for (id_p=isa_devlist; id_p; id_p=id_p->id_next) { diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index f012a6a..2ff3602 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.37 1995/05/01 23:32:30 dyson Exp $ + * $Id: vm_machdep.c,v 1.38 1995/05/18 09:17:07 davidg Exp $ */ #include "npx.h" @@ -232,7 +232,7 @@ more: * same as vm_bounce_kva -- but really allocate (but takes pages as arg) */ vm_offset_t -vm_bounce_kva_alloc(count) +vm_bounce_kva_alloc(count) int count; { int i; @@ -308,7 +308,7 @@ vm_bounce_alloc(bp) * printf("size: %d, count: %d\n", bp->b_bufsize, bp->b_bcount); * } */ - + vastart = (vm_offset_t) bp->b_data; vaend = (vm_offset_t) bp->b_data + bp->b_bufsize; @@ -332,7 +332,7 @@ vm_bounce_alloc(bp) if (dobounceflag == 0) return; - if (bouncepages < dobounceflag) + if (bouncepages < dobounceflag) panic("Not enough bounce buffers!!!"); /* @@ -445,7 +445,7 @@ vm_bounce_free(bp) /* * free the bounce allocation */ - + /* printf("(kva: %x, pa: %x)", bouncekva, mybouncepa); */ @@ -463,7 +463,7 @@ vm_bounce_free(bp) /* * add the old kva into the "to free" list */ - + bouncekva= i386_trunc_page((vm_offset_t) bp->b_data); bouncekvaend= i386_round_page((vm_offset_t)bp->b_data + bp->b_bufsize); @@ -491,7 +491,7 @@ vm_bounce_init() if (bouncepages == 0) return; - + bounceallocarraysize = (bouncepages + BITS_IN_UNSIGNED - 1) / BITS_IN_UNSIGNED; bounceallocarray = malloc(bounceallocarraysize * sizeof(unsigned), M_TEMP, M_NOWAIT); @@ -552,7 +552,7 @@ cpu_fork(p1, p2) int offset; /* - * Copy pcb and stack from proc p1 to p2. + * Copy pcb and stack from proc p1 to p2. * We do this as cheaply as possible, copying only the active * part of the stack. The stack and pcb need to agree; * this is tricky, as the final pcb is constructed by savectx, @@ -571,7 +571,7 @@ cpu_fork(p1, p2) pmap_activate(&p2->p_vmspace->vm_pmap, &up->u_pcb); /* - * + * * Arrange for a non-local goto when the new process * is started, to resume here, returning nonzero from setjmp. */ @@ -588,7 +588,7 @@ void cpu_exit(p) register struct proc *p; { - + #if NNPX > 0 npxexit(p); #endif /* NNPX */ @@ -765,7 +765,7 @@ vunmapbuf(bp) addr < bp->b_data + bp->b_bufsize; addr += NBPG) pmap_kremove((vm_offset_t) addr); - + bp->b_data = bp->b_saveaddr; bp->b_saveaddr = NULL; @@ -806,7 +806,7 @@ cpu_reset() { bzero((caddr_t) PTD, NBPG); /* "good night, sweet prince .... <THUNK!>" */ - pmap_update(); + pmap_update(); /* NOTREACHED */ while(1); } diff --git a/sys/i386/ibcs2/ibcs2.h b/sys/i386/ibcs2/ibcs2.h index 6d6f392..8063c7b 100644 --- a/sys/i386/ibcs2/ibcs2.h +++ b/sys/i386/ibcs2/ibcs2.h @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2.h,v 1.2 1994/10/14 08:53:16 sos Exp $ + * $Id: ibcs2.h,v 1.3 1994/10/17 22:13:06 sos Exp $ */ /* trace all iBCS2 system calls */ @@ -153,7 +153,7 @@ typedef void (*ibcs2_sig_t) (int); #define IBCS2_POLLHUP 0x0010 #define IBCS2_POLLNVAL 0x0020 #define IBCS2_POLLRDNORM 0x0040 -#define IBCS2_POLLWRNORM 0x0004 +#define IBCS2_POLLWRNORM 0x0004 #define IBCS2_POLLRDBAND 0x0080 #define IBCS2_POLLWRBAND 0x0100 #define IBCS2_READPOLL (IBCS2_POLLIN|IBCS2_POLLRDNORM|IBCS2_POLLRDBAND) @@ -244,7 +244,7 @@ typedef void (*ibcs2_sig_t) (int); #define IBCS2_VKILL 3 #define IBCS2_VEOF 4 /* ICANON */ #define IBCS2_VEOL 5 /* ICANON */ -#define IBCS2_VEOL2 6 +#define IBCS2_VEOL2 6 #define IBCS2_VSWTCH 7 #define IBCS2_VMIN 4 /* !ICANON */ #define IBCS2_VTIME 5 /* !ICANON */ diff --git a/sys/i386/ibcs2/ibcs2_dummy.c b/sys/i386/ibcs2/ibcs2_dummy.c index f267e4c..7a7c102 100644 --- a/sys/i386/ibcs2/ibcs2_dummy.c +++ b/sys/i386/ibcs2/ibcs2_dummy.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_dummy.c,v 1.14 1994/10/13 23:10:58 sos Exp $ + * $Id: ibcs2_dummy.c,v 1.1 1994/10/14 08:52:59 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -124,7 +124,7 @@ ibcs2_putmsg(struct proc *p, void *args, int *retval) /* * The following are RFS system calls - * We don't have RFS. + * We don't have RFS. */ int ibcs2_rfdebug(struct proc *p, void *args, int *retval) diff --git a/sys/i386/ibcs2/ibcs2_file.c b/sys/i386/ibcs2/ibcs2_file.c index 0a0c41d..c621758 100644 --- a/sys/i386/ibcs2/ibcs2_file.c +++ b/sys/i386/ibcs2/ibcs2_file.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ibcs2_file.c,v 1.1 1994/10/14 08:53:01 sos Exp $ + * $Id: ibcs2_file.c,v 1.2 1994/12/14 22:03:48 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -61,7 +61,7 @@ struct ibcs2_close_args { int ibcs2_close(struct proc *p, struct ibcs2_close_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'close' fd=%d\n", args->fd); return close(p, args, retval); } @@ -80,8 +80,8 @@ ibcs2_creat(struct proc *p, struct ibcs2_creat_args *args, int *retval) int crtmode; } bsd_open_args; - if (ibcs2_trace & IBCS2_TRACE_FILE) - printf("IBCS2: 'creat' name=%s, mode=%x\n", + if (ibcs2_trace & IBCS2_TRACE_FILE) + printf("IBCS2: 'creat' name=%s, mode=%x\n", args->fname, args->fmode); bsd_open_args.fname = args->fname; bsd_open_args.crtmode = args->fmode; @@ -92,7 +92,7 @@ ibcs2_creat(struct proc *p, struct ibcs2_creat_args *args, int *retval) int ibcs2_dup(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'dup'\n"); return dup(p, args, retval); } @@ -161,11 +161,11 @@ ibcs2_fcntl(struct proc *p, struct ibcs2_fcntl_args *args, int *retval) int fd; int cmd; int arg; - } fcntl_args; + } fcntl_args; struct ibcs2_flock ibcs2_flock; struct flock *bsd_flock = (struct flock *)UA_ALLOC(); - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'fcntl' fd=%d, cmd=%d arg=%d\n", args->fd, args->cmd, args->arg); @@ -203,10 +203,10 @@ ibcs2_fcntl(struct proc *p, struct ibcs2_fcntl_args *args, int *retval) if (args->arg & IBCS2_SYNC) fcntl_args.arg |= O_FSYNC; fcntl_args.cmd = F_SETFL; return fcntl(p, &fcntl_args, retval); - + case IBCS2_F_GETLK: if ((error = copyin((caddr_t)args->arg, (caddr_t)&ibcs2_flock, - sizeof(struct ibcs2_flock)))) + sizeof(struct ibcs2_flock)))) return error; ibcs2_to_bsd_flock(&ibcs2_flock, bsd_flock); fcntl_args.cmd = F_GETLK; @@ -219,7 +219,7 @@ ibcs2_fcntl(struct proc *p, struct ibcs2_fcntl_args *args, int *retval) case IBCS2_F_SETLK: if ((error = copyin((caddr_t)args->arg, (caddr_t)&ibcs2_flock, - sizeof(struct ibcs2_flock)))) + sizeof(struct ibcs2_flock)))) return error; ibcs2_to_bsd_flock(&ibcs2_flock, bsd_flock); fcntl_args.cmd = F_SETLK; @@ -228,7 +228,7 @@ ibcs2_fcntl(struct proc *p, struct ibcs2_fcntl_args *args, int *retval) case IBCS2_F_SETLKW: if ((error = copyin((caddr_t)args->arg, (caddr_t)&ibcs2_flock, - sizeof(struct ibcs2_flock)))) + sizeof(struct ibcs2_flock)))) return error; ibcs2_to_bsd_flock(&ibcs2_flock, bsd_flock); fcntl_args.cmd = F_SETLKW; @@ -317,7 +317,7 @@ again: dir.d_ino = BSD_DIRENT(inp)->d_ino; dir.d_off = (ibcs2_off_t)off; dir.d_reclen = IBCS2_RECLEN(inp); - bcopy(BSD_DIRENT(inp)->d_name, &dir.d_name, + bcopy(BSD_DIRENT(inp)->d_name, &dir.d_name, BSD_DIRENT(inp)->d_namlen); if (error = copyout(&dir, outp, dir.d_reclen)) goto out; @@ -349,7 +349,7 @@ ibcs2_open(struct proc *p, struct ibcs2_open_args *args, int *retval) int bsd_mode = 0; int noctty = args->fmode & 0x8000; int error; - + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'open' name=%s, flags=%x, mode=%x\n", args->fname, args->fmode, args->crtmode); @@ -399,7 +399,7 @@ ibcs2_read(struct proc *p, struct ibcs2_read_args *args, int *retval) int buflen, error, eofflag; int len, reclen, resid; - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'read' fd=%d, count=%d\n", args->fd, args->count); @@ -453,7 +453,7 @@ again: outp++; break; } - /* + /* * TODO: break up name if > 14 chars * put 14 chars in each dir entry wtih d_ino = 0xffff * and set the last dir entry's d_ino = inode @@ -498,7 +498,7 @@ ibcs2_seek(struct proc *p, struct ibcs2_seek_args *args, int *retval) off_t tmp_retval; int error; - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'seek' fd=%d, offset=%d, how=%d\n", args->fdes, args->off, args->whence); tmp_args.fdes = args->fdes; @@ -518,7 +518,7 @@ struct ibcs2_write_args { int ibcs2_write(struct proc *p, struct ibcs2_write_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_FILE) + if (ibcs2_trace & IBCS2_TRACE_FILE) printf("IBCS2: 'write' fd=%d, count=%d\n", args->fd, args->count); return write(p, args, retval); diff --git a/sys/i386/ibcs2/ibcs2_ioctl.c b/sys/i386/ibcs2/ibcs2_ioctl.c index 4e3b991..2f2a6cb 100644 --- a/sys/i386/ibcs2/ibcs2_ioctl.c +++ b/sys/i386/ibcs2/ibcs2_ioctl.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_ioctl.c,v 1.2 1994/10/17 22:13:07 sos Exp $ + * $Id: ibcs2_ioctl.c,v 1.3 1994/10/23 19:19:42 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -71,7 +71,7 @@ static struct speedtab sptab[] = { { 134, 4 }, { 135, 4 }, { 150, 5 }, { 200, 6 }, { 300, 7 }, { 600, 8 }, { 1200, 9 }, { 1800, 10 }, { 2400, 11 }, { 4800, 12 }, { 9600, 13 }, - { 19200, 14 }, { 38400, 15 }, + { 19200, 14 }, { 38400, 15 }, { 57600, 15 }, { 115200, 15 }, {-1, -1 } }; @@ -94,7 +94,7 @@ bsd_to_ibcs2_speed(int speed, struct speedtab *table) } static void -bsd_termios_to_ibcs2_termio(struct termios *bsd_termios, +bsd_termios_to_ibcs2_termio(struct termios *bsd_termios, struct ibcs2_termio *ibcs2_termio) { int speed; @@ -107,12 +107,12 @@ bsd_termios_to_ibcs2_termio(struct termios *bsd_termios, bsd_termios->c_cflag, bsd_termios->c_lflag, bsd_termios->c_ispeed, bsd_termios->c_ospeed); printf("c_cc "); - for (i=0; i<NCCS; i++) + for (i=0; i<NCCS; i++) printf("%02x ", bsd_termios->c_cc[i]); printf("\n"); } - ibcs2_termio->c_iflag = bsd_termios->c_iflag & + ibcs2_termio->c_iflag = bsd_termios->c_iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK |ISTRIP|INLCR|IGNCR|ICRNL|IXANY); if (bsd_termios->c_iflag & IXON) @@ -219,7 +219,7 @@ ibcs2_termio_to_bsd_termios(struct ibcs2_termio *ibcs2_termio, printf("\n"); } - bsd_termios->c_iflag = ibcs2_termio->c_iflag & + bsd_termios->c_iflag = ibcs2_termio->c_iflag & (IBCS2_IGNBRK|IBCS2_BRKINT|IBCS2_IGNPAR|IBCS2_PARMRK|IBCS2_INPCK |IBCS2_ISTRIP|IBCS2_INLCR|IBCS2_IGNCR|IBCS2_ICRNL|IBCS2_IXANY); if (ibcs2_termio->c_iflag & IBCS2_IXON) @@ -303,7 +303,7 @@ ibcs2_termio_to_bsd_termios(struct ibcs2_termio *ibcs2_termio, } static void -bsd_to_ibcs2_termios(struct termios *bsd_termios, +bsd_to_ibcs2_termios(struct termios *bsd_termios, struct ibcs2_termios *ibcs2_termios) { int speed; @@ -321,7 +321,7 @@ bsd_to_ibcs2_termios(struct termios *bsd_termios, printf("\n"); } - ibcs2_termios->c_iflag = bsd_termios->c_iflag & + ibcs2_termios->c_iflag = bsd_termios->c_iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK |ISTRIP|INLCR|IGNCR|ICRNL|IXANY); if (bsd_termios->c_iflag & IXON) @@ -401,15 +401,15 @@ bsd_to_ibcs2_termios(struct termios *bsd_termios, if (ibcs2_trace & IBCS2_TRACE_IOCTLCNV) { int i; printf("IBCS2: IBCS2 termios structure (output):\n"); - printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d " + printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d " "line=%d\n", ibcs2_termios->c_iflag, ibcs2_termios->c_oflag, ibcs2_termios->c_cflag, ibcs2_termios->c_lflag, - ibcs2_to_bsd_speed(ibcs2_termios->c_ispeed, sptab), + ibcs2_to_bsd_speed(ibcs2_termios->c_ispeed, sptab), ibcs2_to_bsd_speed(ibcs2_termios->c_ospeed, sptab), ibcs2_termios->c_line); printf("c_cc "); - for (i=0; i<IBCS2_NCCS; i++) + for (i=0; i<IBCS2_NCCS; i++) printf("%02x ", ibcs2_termios->c_cc[i]); printf("\n"); } @@ -428,16 +428,16 @@ ibcs2_to_bsd_termios(struct ibcs2_termios *ibcs2_termios, "line=%d\n", ibcs2_termios->c_iflag, ibcs2_termios->c_oflag, ibcs2_termios->c_cflag, ibcs2_termios->c_lflag, - ibcs2_to_bsd_speed(ibcs2_termios->c_ispeed, sptab), + ibcs2_to_bsd_speed(ibcs2_termios->c_ispeed, sptab), ibcs2_to_bsd_speed(ibcs2_termios->c_ospeed, sptab), ibcs2_termios->c_line); printf("c_cc "); - for (i=0; i<IBCS2_NCCS; i++) + for (i=0; i<IBCS2_NCCS; i++) printf("%02x ", ibcs2_termios->c_cc[i]); printf("\n"); } - bsd_termios->c_iflag = ibcs2_termios->c_iflag & + bsd_termios->c_iflag = ibcs2_termios->c_iflag & (IBCS2_IGNBRK|IBCS2_BRKINT|IBCS2_IGNPAR|IBCS2_PARMRK|IBCS2_INPCK |IBCS2_ISTRIP|IBCS2_INLCR|IBCS2_IGNCR|IBCS2_ICRNL|IBCS2_IXANY); if (ibcs2_termios->c_iflag & IBCS2_IXON) @@ -521,7 +521,7 @@ ibcs2_to_bsd_termios(struct ibcs2_termios *ibcs2_termios, bsd_termios->c_cflag, bsd_termios->c_lflag, bsd_termios->c_ispeed, bsd_termios->c_ospeed); printf("c_cc "); - for (i=0; i<NCCS; i++) + for (i=0; i<NCCS; i++) printf("%02x ", bsd_termios->c_cc[i]); printf("\n"); } @@ -545,15 +545,15 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) struct filedesc *fdp = p->p_fd; struct file *fp; int (*func)(); - int type = (args->cmd&0xffff00)>>8; + int type = (args->cmd&0xffff00)>>8; int num = args->cmd&0xff; int error; if (ibcs2_trace & IBCS2_TRACE_IOCTL) - printf("IBCS2: 'ioctl' fd=%d, typ=%d(%c), num=%d\n", + printf("IBCS2: 'ioctl' fd=%d, typ=%d(%c), num=%d\n", args->fd, type, type, num); - if ((unsigned)args->fd >= fdp->fd_nfiles + if ((unsigned)args->fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[args->fd]) == 0) return EBADF; @@ -572,7 +572,7 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) case 2: args->cmd = FIONCLEX; return ioctl(p, args, retval); - case 3: + case 3: args->cmd = FIONREAD; return ioctl(p, args, retval); } @@ -585,11 +585,11 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) /* p->p_session->s_ttyp->t_winsize.ws_col; XXX */ ibcs2_winsize.bytey = 25; /* p->p_session->s_ttyp->t_winsize.ws_row; XXX */ - ibcs2_winsize.bitx = + ibcs2_winsize.bitx = p->p_session->s_ttyp->t_winsize.ws_xpixel; ibcs2_winsize.bity = p->p_session->s_ttyp->t_winsize.ws_ypixel; - return copyout((caddr_t)&ibcs2_winsize, + return copyout((caddr_t)&ibcs2_winsize, (caddr_t)args->arg, sizeof(ibcs2_winsize)); } @@ -635,11 +635,11 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) case 'T': switch (num) { case 1: /* TCGETA */ - if ((error = (*func)(fp, TIOCGETA, + if ((error = (*func)(fp, TIOCGETA, (caddr_t)&bsd_termios, p)) != 0) return error; bsd_termios_to_ibcs2_termio(&bsd_termios,&ibcs2_termio); - return copyout((caddr_t)&ibcs2_termio, + return copyout((caddr_t)&ibcs2_termio, (caddr_t)args->arg, sizeof(ibcs2_termio)); @@ -681,26 +681,26 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) return ioctl(p, args, retval); case 103: /* TIOCSWINSZ */ - bsd_winsize.ws_row = + bsd_winsize.ws_row = ((struct ibcs2_winsize *)(args->arg))->bytex; - bsd_winsize.ws_col = + bsd_winsize.ws_col = ((struct ibcs2_winsize *)(args->arg))->bytey; - bsd_winsize.ws_xpixel = + bsd_winsize.ws_xpixel = ((struct ibcs2_winsize *)(args->arg))->bitx; - bsd_winsize.ws_ypixel = + bsd_winsize.ws_ypixel = ((struct ibcs2_winsize *)(args->arg))->bity; - return (*func)(fp, TIOCSWINSZ, + return (*func)(fp, TIOCSWINSZ, (caddr_t)&bsd_winsize, p); case 104: /* TIOCGWINSZ */ - if ((error = (*func)(fp, TIOCGWINSZ, + if ((error = (*func)(fp, TIOCGWINSZ, (caddr_t)&bsd_winsize, p)) != 0) return error; ibcs2_winsize.bytex = bsd_winsize.ws_col; ibcs2_winsize.bytey = bsd_winsize.ws_row; ibcs2_winsize.bitx = bsd_winsize.ws_xpixel; ibcs2_winsize.bity = bsd_winsize.ws_ypixel; - return copyout((caddr_t)&ibcs2_winsize, + return copyout((caddr_t)&ibcs2_winsize, (caddr_t)args->arg, sizeof(ibcs2_winsize)); @@ -719,11 +719,11 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) case ('x'): switch (num) { case 1: - if ((error = (*func)(fp, TIOCGETA, + if ((error = (*func)(fp, TIOCGETA, (caddr_t)&bsd_termios, p)) != 0) return error; bsd_to_ibcs2_termios(&bsd_termios, &ibcs2_termios); - return copyout((caddr_t)&ibcs2_termios, + return copyout((caddr_t)&ibcs2_termios, (caddr_t)args->arg, sizeof(ibcs2_termios)); case 2: @@ -738,7 +738,7 @@ ibcs2_ioctl(struct proc *p, struct ibcs2_ioctl_args *args, int *retval) ibcs2_to_bsd_termios((struct ibcs2_termios *)args->arg, &bsd_termios); return (*func)(fp, TIOCSETAF, (caddr_t)&bsd_termios, p); - + } break; @@ -922,21 +922,21 @@ struct ioctl_args { int ibcs2_gtty(struct proc *p, struct ibcs2_sgtty_args *args, int *retval) { - struct ioctl_args ioctl_arg; + struct ioctl_args ioctl_arg; if (ibcs2_trace & IBCS2_TRACE_IOCTL) printf("IBCS2: 'gtty' fd=%d\n", args->fd); ioctl_arg.fd = args->fd; ioctl_arg.cmd = TIOCGETC; ioctl_arg.arg = (caddr_t)args->buf; - + return ioctl(p, &ioctl_arg, retval); } int ibcs2_stty(struct proc *p, struct ibcs2_sgtty_args *args, int *retval) { - struct ioctl_args ioctl_arg; + struct ioctl_args ioctl_arg; if (ibcs2_trace & IBCS2_TRACE_IOCTL) printf("IBCS2: 'stty' fd=%d\n", args->fd); diff --git a/sys/i386/ibcs2/ibcs2_ipc.c b/sys/i386/ibcs2/ibcs2_ipc.c index f760e2e..e2e5a5b 100644 --- a/sys/i386/ibcs2/ibcs2_ipc.c +++ b/sys/i386/ibcs2/ibcs2_ipc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_ipc.c,v 1.3 1994/10/12 19:38:03 sos Exp $ + * $Id: ibcs2_ipc.c,v 1.1 1994/10/14 08:53:04 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -37,7 +37,7 @@ int ibcs2_msgsys(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'msgsys'\n"); #ifdef SYSVMSG return msgsys(p, args, retval); @@ -50,7 +50,7 @@ ibcs2_msgsys(struct proc *p, void *args, int *retval) int ibcs2_semsys(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'semsys'\n"); #ifdef SYSVSEM return semsys(p, args, retval); @@ -63,7 +63,7 @@ ibcs2_semsys(struct proc *p, void *args, int *retval) int ibcs2_shmsys(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'shmsys'\n"); #ifdef SYSVSHM return shmsys(p, args, retval); diff --git a/sys/i386/ibcs2/ibcs2_isc.c b/sys/i386/ibcs2/ibcs2_isc.c index 344fc9d..a6c9dbd 100644 --- a/sys/i386/ibcs2/ibcs2_isc.c +++ b/sys/i386/ibcs2/ibcs2_isc.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_isc.c,v 1.2 1995/02/03 21:31:32 bde Exp $ + * $Id: ibcs2_isc.c,v 1.3 1995/04/30 11:30:12 ache Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -48,7 +48,7 @@ int ibcs2_cisc(struct proc *p, void *args, int *retval) { struct trapframe *tf = (struct trapframe *)p->p_md.md_regs; - + switch ((tf->tf_eax & 0xffffff00) >> 8) { case 0x00: @@ -87,8 +87,8 @@ ibcs2_cisc(struct proc *p, void *args, int *retval) case 0x08: /* pathconf */ case 0x09: /* fpathconf */ - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc (f)pathconf'"); + if (ibcs2_trace & IBCS2_TRACE_ISC) + printf("IBCS2: 'cisc (f)pathconf'"); return ibcs2_pathconf(p, args, retval); case 0x10: { /* sysconf */ @@ -96,14 +96,14 @@ ibcs2_cisc(struct proc *p, void *args, int *retval) int num; } *sysconf_args = args; - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sysconf'"); + if (ibcs2_trace & IBCS2_TRACE_ISC) + printf("IBCS2: 'cisc sysconf'"); switch (sysconf_args->num) { case 0: /* _SC_ARG_MAX */ *retval = (ARG_MAX); break; case 1: /* _SC_CHILD_MAX */ - *retval = (CHILD_MAX); + *retval = (CHILD_MAX); break; case 2: /* _SC_CLK_TCK */ *retval = (_BSD_CLK_TCK_); @@ -182,7 +182,7 @@ ibcs2_cisc(struct proc *p, void *args, int *retval) printf("IBCS2: 'cisc getmajor'"); break; default: - printf("IBCS2: 'cisc' function %d(0x%x)", + printf("IBCS2: 'cisc' function %d(0x%x)", tf->tf_eax>>8, tf->tf_eax>>8); break; } diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index a7d94f9..742f211 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ibcs2_misc.c,v 1.3 1995/03/03 15:44:44 nate Exp $ + * $Id: ibcs2_misc.c,v 1.4 1995/05/02 17:14:38 ache Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -74,7 +74,7 @@ ibcs2_traceemu(struct proc *p, struct ibcs2_traceemu_args *args, int *retval) int ibcs2_access(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'access'\n"); return access(p, args, retval); } @@ -90,7 +90,7 @@ ibcs2_alarm(struct proc *p, struct ibcs2_alarm_args *args, int *retval) struct itimerval it, oit; int s; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'alarm' secs=%d\n", args->secs); it.it_value.tv_sec = (long)args->secs; it.it_value.tv_usec = 0; @@ -132,7 +132,7 @@ ibcs2_break(struct proc *p, struct ibcs2_break_args *args, int *retval) int rv, diff; extern int swap_pager_full; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'break' dsend=%x\n", (unsigned int)args->dsend); @@ -169,7 +169,7 @@ ibcs2_break(struct proc *p, struct ibcs2_break_args *args, int *retval) int ibcs2_chdir(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'chdir'\n"); return chdir(p, args, retval); } @@ -177,7 +177,7 @@ ibcs2_chdir(struct proc *p, void *args, int *retval) int ibcs2_chmod(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'chmod'\n"); return chmod(p, args, retval); } @@ -185,7 +185,7 @@ ibcs2_chmod(struct proc *p, void *args, int *retval) int ibcs2_chown(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'chown'\n"); return chown(p, args, retval); } @@ -193,7 +193,7 @@ ibcs2_chown(struct proc *p, void *args, int *retval) int ibcs2_chroot(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'chroot'\n"); return chroot(p, args, retval); } @@ -212,7 +212,7 @@ ibcs2_exec(struct proc *p, struct exec_args *args, int *retval) char **envp; } execve_args; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'exec' name=%s\n", args->name); execve_args.name = args->name; execve_args.argv = args->argv; @@ -229,7 +229,7 @@ struct ibcs2_exece_args { int ibcs2_exece(struct proc *p, struct ibcs2_exece_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'exece' name=%s\n", args->name); return execve(p, args, retval); } @@ -237,7 +237,7 @@ ibcs2_exece(struct proc *p, struct ibcs2_exece_args *args, int *retval) int ibcs2_exit(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'exit'\n"); return exit(p, args, retval); } @@ -245,7 +245,7 @@ ibcs2_exit(struct proc *p, void *args, int *retval) int ibcs2_fork(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'fork'\n"); return fork(p, args, retval); } @@ -253,7 +253,7 @@ ibcs2_fork(struct proc *p, void *args, int *retval) int ibcs2_fsync(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'fsync'\n"); return fsync(p, args, retval); } @@ -261,7 +261,7 @@ ibcs2_fsync(struct proc *p, void *args, int *retval) int ibcs2_getgid(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'getgid'\n"); return getgid(p, args, retval); } @@ -281,7 +281,7 @@ ibcs2_getgroups(struct proc *p, struct ibcs2_getgroups_args *args, int *retval) ibcs2_gid_t *ibcs2_gidset; int i, error; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'getgroups'\n"); tmp.gidsetsize = args->gidsetsize; @@ -298,7 +298,7 @@ ibcs2_getgroups(struct proc *p, struct ibcs2_getgroups_args *args, int *retval) int ibcs2_getpid(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'getpid'\n"); return getpid(p, args, retval); } @@ -306,7 +306,7 @@ ibcs2_getpid(struct proc *p, void *args, int *retval) int ibcs2_getuid(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'getuid'\n"); return getuid(p, args, retval); } @@ -321,7 +321,7 @@ ibcs2_gtime(struct proc *p, struct gtime_args *args, int *retval) int error = 0; struct timeval tv; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'gtime'\n"); microtime(&tv); *retval = tv.tv_sec; @@ -333,7 +333,7 @@ ibcs2_gtime(struct proc *p, struct gtime_args *args, int *retval) int ibcs2_link(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'link'\n"); return link(p, args, retval); } @@ -341,7 +341,7 @@ ibcs2_link(struct proc *p, void *args, int *retval) int ibcs2_mkdir(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'mkdir'\n"); return mkdir(p, args, retval); } @@ -355,7 +355,7 @@ struct ibcs2_mknod_args { int ibcs2_mknod(struct proc *p, struct ibcs2_mknod_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'mknod'\n"); if (S_ISFIFO(args->fmode)) return mkfifo(p, args, retval); @@ -371,7 +371,7 @@ ibcs2_nice(struct proc *p, struct ibcs2_nice_args *args, int *retval) { int error; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'nice'\n"); error = donice(p, p, args->niceval); *retval = p->p_nice; @@ -385,8 +385,8 @@ struct ibcs2_pathconf_args { int ibcs2_pathconf(struct proc *p, struct ibcs2_pathconf_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) - printf("IBCS2: '(f)pathconf'\n"); + if (ibcs2_trace & IBCS2_TRACE_MISC) + printf("IBCS2: '(f)pathconf'\n"); switch (args->cmd) { case 0: /* _PC_LINK_MAX */ *retval = (LINK_MAX); @@ -435,7 +435,7 @@ ibcs2_pause(struct proc *p, void *args, int *retval) { int mask = 0; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'pause'\n"); return sigsuspend(p, &mask, retval); } @@ -443,7 +443,7 @@ ibcs2_pause(struct proc *p, void *args, int *retval) int ibcs2_pipe(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'pipe'\n"); return pipe(p, args, retval); } @@ -473,11 +473,11 @@ ibcs2_poll(struct proc *p, struct ibcs2_poll_args *args, int *retval) } tmp_select; int i, error; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'poll'\n"); if (args->nfds > FD_SETSIZE) return EINVAL; - readfds = (fd_set *)UA_ALLOC(); + readfds = (fd_set *)UA_ALLOC(); FD_ZERO(readfds); writefds = (fd_set *)UA_ALLOC() + sizeof(fd_set *); FD_ZERO(writefds); @@ -516,24 +516,24 @@ ibcs2_poll(struct proc *p, struct ibcs2_poll_args *args, int *retval) return 0; *retval = 0; for (*retval = 0, i = 0; i < args->nfds; i++) { - copyin(args->fds + i*sizeof(struct ibcs2_poll), + copyin(args->fds + i*sizeof(struct ibcs2_poll), &conv, sizeof(conv)); conv.revents = 0; - if (conv.fd < 0 || conv.fd > FD_SETSIZE) + if (conv.fd < 0 || conv.fd > FD_SETSIZE) /* should check for open as well */ - conv.revents |= IBCS2_POLLNVAL; + conv.revents |= IBCS2_POLLNVAL; else { if (FD_ISSET(conv.fd, readfds)) conv.revents |= IBCS2_POLLIN; if (FD_ISSET(conv.fd, writefds)) conv.revents |= IBCS2_POLLOUT; if (FD_ISSET(conv.fd, exceptfds)) - conv.revents |= IBCS2_POLLERR; + conv.revents |= IBCS2_POLLERR; if (conv.revents) ++*retval; } if (error = copyout(&conv, - args->fds + i*sizeof(struct ibcs2_poll), + args->fds + i*sizeof(struct ibcs2_poll), sizeof(conv))) return error; } @@ -548,7 +548,7 @@ struct ibcs2_procids_args { int ibcs2_procids(struct proc *p, struct ibcs2_procids_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'procids' request=%d, eax=%x\n", args->req, args->eax); switch (args->req) { @@ -556,8 +556,8 @@ ibcs2_procids(struct proc *p, struct ibcs2_procids_args *args, int *retval) return getpgrp(p, args, retval); case 1: /* setpgrp */ { - struct setpgid_args { - int pid; + struct setpgid_args { + int pid; int pgid; } tmp; tmp.pid = tmp.pgid = 0; @@ -575,7 +575,7 @@ ibcs2_procids(struct proc *p, struct ibcs2_procids_args *args, int *retval) int ibcs2_profil(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'profil'\n"); return profil(p, args, retval); } @@ -583,7 +583,7 @@ ibcs2_profil(struct proc *p, void *args, int *retval) int ibcs2_ptrace(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'ptrace'\n"); return ptrace(p, args, retval); } @@ -591,7 +591,7 @@ ibcs2_ptrace(struct proc *p, void *args, int *retval) int ibcs2_readlink(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'readlink'\n"); return readlink(p, args, retval); } @@ -599,7 +599,7 @@ ibcs2_readlink(struct proc *p, void *args, int *retval) int ibcs2_rename(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'rename'\n"); return rename(p, args, retval); } @@ -607,7 +607,7 @@ ibcs2_rename(struct proc *p, void *args, int *retval) int ibcs2_rmdir(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'rmdir'\n"); return rmdir(p, args, retval); } @@ -626,7 +626,7 @@ ibcs2_secure(struct proc *p, struct ibcs2_secure_args *args, int *retval) { struct trapframe *tf = (struct trapframe *)p->p_md.md_regs; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'secure'\n"); switch (args->cmd) { @@ -654,7 +654,7 @@ ibcs2_setgid(struct proc *p, struct ibcs2_setgid_args *args, int *retval) gid_t gid; } tmp; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'setgid'\n"); tmp.gid = (gid_t) args->gid; return setgid(p, &tmp, retval); @@ -675,12 +675,12 @@ ibcs2_setgroups(struct proc *p, struct ibcs2_setgroups_args *args, int *retval) ibcs2_gid_t *ibcs2_gidset; int i, error; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'setgroups'\n"); tmp.gidsetsize = args->gidsetsize; tmp.gidset = (gid_t *)UA_ALLOC(); ibcs2_gidset = (ibcs2_gid_t *)&tmp.gidset[NGROUPS_MAX]; - if (error = copyin((caddr_t)args->gidset, (caddr_t)ibcs2_gidset, + if (error = copyin((caddr_t)args->gidset, (caddr_t)ibcs2_gidset, sizeof(ibcs2_gid_t) * tmp.gidsetsize)) return error; for (i = 0; i < tmp.gidsetsize; i++) @@ -699,7 +699,7 @@ ibcs2_setuid(struct proc *p, struct ibcs2_setuid_args *args, int *retval) uid_t uid; } tmp; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'setuid'\n"); tmp.uid = (uid_t) args->uid; return setuid(p, &tmp, retval); @@ -708,7 +708,7 @@ ibcs2_setuid(struct proc *p, struct ibcs2_setuid_args *args, int *retval) int ibcs2_smount(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'smount'\n"); return mount(p, args, retval); } @@ -721,8 +721,8 @@ int ibcs2_stime(struct proc *p, struct ibcs2_stime_args *args, int *retval) { int error; - - if (ibcs2_trace & IBCS2_TRACE_MISC) + + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'stime'\n"); if (error = suser(p->p_ucred, &p->p_acflag)) return error; @@ -731,12 +731,12 @@ ibcs2_stime(struct proc *p, struct ibcs2_stime_args *args, int *retval) /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ boottime.tv_sec += (long)args->timeptr - time.tv_sec; s = splhigh(); - time.tv_sec = (long)args->timeptr; + time.tv_sec = (long)args->timeptr; time.tv_usec = 0; splx(s); resettodr(); #else - printf("IBCS2: trying to set system time %d\n", + printf("IBCS2: trying to set system time %d\n", (long)args->timeptr); #endif } @@ -746,7 +746,7 @@ ibcs2_stime(struct proc *p, struct ibcs2_stime_args *args, int *retval) int ibcs2_sumount(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'sumount'\n"); return unmount(p, args, retval); } @@ -754,7 +754,7 @@ ibcs2_sumount(struct proc *p, void *args, int *retval) int ibcs2_symlink(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'symlink'\n"); return symlink(p, args, retval); } @@ -762,7 +762,7 @@ ibcs2_symlink(struct proc *p, void *args, int *retval) int ibcs2_sync(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'sync'\n"); return sync(p, args, retval); } @@ -770,7 +770,7 @@ ibcs2_sync(struct proc *p, void *args, int *retval) int ibcs2_sysacct(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'sysacct'\n"); return acct(p, args, retval); } @@ -789,7 +789,7 @@ ibcs2_times(struct proc *p, struct ibcs2_tms *args, int *retval) struct timeval tv; struct ibcs2_tms tms; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'times'\n"); tms.tms_utime = p->p_uticks; tms.tms_stime = p->p_sticks; @@ -812,7 +812,7 @@ struct ibcs2_ulimit_args { int ibcs2_ulimit(struct proc *p, struct ibcs2_ulimit_args *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'ulimit'\n"); switch (args->cmd) { case IBCS2_GETFSIZE: @@ -835,7 +835,7 @@ ibcs2_ulimit(struct proc *p, struct ibcs2_ulimit_args *args, int *retval) int ibcs2_umask(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'umask'\n"); return umask(p, args, retval); } @@ -843,7 +843,7 @@ ibcs2_umask(struct proc *p, void *args, int *retval) int ibcs2_unlink(struct proc *p, void *args, int *retval) { - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'unlink'\n"); return unlink(p, args, retval); } @@ -862,7 +862,7 @@ ibcs2_utime(struct proc *p, struct ibcs2_utime_args *args, int *retval) } bsdutimes; struct timeval tv; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'utime'\n"); tv.tv_sec = (long)args->timeptr; tv.tv_usec = 0; @@ -889,7 +889,7 @@ ibcs2_utssys(struct proc *p, struct ibcs2_utssys_args *args, int *retval) } ibcs2_uname; extern char ostype[], hostname[], osrelease[], machine[]; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'utssys' cmd=%d\n", args->cmd); switch(args->cmd) { case 0: /* uname */ @@ -934,7 +934,7 @@ ibcs2_wait(struct proc *p, void *args, int *retval) tmp.compat = 1; tmp.rusage = 0; - if (ibcs2_trace & IBCS2_TRACE_MISC) + if (ibcs2_trace & IBCS2_TRACE_MISC) printf("IBCS2: 'wait'\n"); if ((tf->tf_eflags & (PSL_Z|PSL_PF|PSL_N|PSL_V)) diff --git a/sys/i386/ibcs2/ibcs2_signal.c b/sys/i386/ibcs2/ibcs2_signal.c index 7824a0b..3171c2c 100644 --- a/sys/i386/ibcs2/ibcs2_signal.c +++ b/sys/i386/ibcs2/ibcs2_signal.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ibcs2_signal.c,v 1.9 1994/10/12 19:38:03 sos Exp $ + * $Id: ibcs2_signal.c,v 1.1 1994/10/14 08:53:07 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -70,27 +70,27 @@ int bsd_to_ibcs2_signal[NSIG] = { 0, IBCS2_SIGHUP, IBCS2_SIGINT, IBCS2_SIGQUIT, IBCS2_SIGILL, IBCS2_SIGTRAP, IBCS2_SIGABRT, IBCS2_SIGEMT, - IBCS2_SIGFPE, IBCS2_SIGKILL, IBCS2_SIGBUS, IBCS2_SIGSEGV, + IBCS2_SIGFPE, IBCS2_SIGKILL, IBCS2_SIGBUS, IBCS2_SIGSEGV, IBCS2_SIGSYS, IBCS2_SIGPIPE, IBCS2_SIGALRM, IBCS2_SIGTERM, - IBCS2_SIGURG, IBCS2_SIGSTOP, IBCS2_SIGTSTP, IBCS2_SIGCONT, - IBCS2_SIGCHLD, IBCS2_SIGTTIN, IBCS2_SIGTTOU, IBCS2_SIGIO, - IBCS2_SIGGXCPU, IBCS2_SIGGXFSZ, IBCS2_SIGVTALRM, IBCS2_SIGPROF, + IBCS2_SIGURG, IBCS2_SIGSTOP, IBCS2_SIGTSTP, IBCS2_SIGCONT, + IBCS2_SIGCHLD, IBCS2_SIGTTIN, IBCS2_SIGTTOU, IBCS2_SIGIO, + IBCS2_SIGGXCPU, IBCS2_SIGGXFSZ, IBCS2_SIGVTALRM, IBCS2_SIGPROF, IBCS2_SIGWINCH, 0, IBCS2_SIGUSR1, IBCS2_SIGUSR2 }; int ibcs2_to_bsd_signal[IBCS2_NSIG] = { 0, SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGEMT, - SIGFPE, SIGKILL, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGALRM, SIGTERM, - SIGUSR1, SIGUSR2, SIGCHLD, 0, SIGWINCH, SIGURG, SIGIO, SIGSTOP, + SIGFPE, SIGKILL, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE, SIGALRM, SIGTERM, + SIGUSR1, SIGUSR2, SIGCHLD, 0, SIGWINCH, SIGURG, SIGIO, SIGSTOP, SIGTSTP, SIGCONT, SIGTTIN, SIGTTOU, SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ }; static char ibcs2_sig_name[IBCS2_NSIG][10] = { - "UNKNOWN", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", + "UNKNOWN", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGEMT", "SIGFPE", "SIGKILL", "SIGBUS", "SIGSEGV", "SIGSYS", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGUSR1", "SIGUSR2", - "SIGCHLD", "SIGPWR", "SIGWINCH", "SIGURG", "SIGIO", "SIGSTOP", - "SIGTSTP", "SIGCONT", "SIGTTIN", "SIGTTOU", "SIGVTALRM", + "SIGCHLD", "SIGPWR", "SIGWINCH", "SIGURG", "SIGIO", "SIGSTOP", + "SIGTSTP", "SIGCONT", "SIGTTIN", "SIGTTOU", "SIGVTALRM", "SIGPROF", "SIGXCPU", "SIGXFSZ" }; @@ -100,7 +100,7 @@ int LEGAL_SIG(int sig) { if ((sig & IBCS2_SIGMASK) > IBCS2_NSIG) { - printf("IBCS2: illegal ibcs2 signal %d(%08x)\n", + printf("IBCS2: illegal ibcs2 signal %d(%08x)\n", sig & IBCS2_SIGMASK, sig); return 0; } @@ -196,7 +196,7 @@ ibcs2_sigset(struct proc *p, struct ibcs2_signal_args *args, int *retval) setsigvec(p, sig_bsd, &tmp); } return 0; -} +} static int ibcs2_sighold(struct proc *p, struct ibcs2_signal_args *args, int *retval) @@ -208,7 +208,7 @@ ibcs2_sighold(struct proc *p, struct ibcs2_signal_args *args, int *retval) p->p_sigmask |= (sigmask(sig_bsd) & ~DONTMASK); (void) spl0(); return 0; -} +} static int ibcs2_sigrelse(struct proc *p, struct ibcs2_signal_args *args, int *retval) @@ -248,7 +248,7 @@ ibcs2_sigpause(struct proc *p, struct ibcs2_signal_args *args, int *retval) (void) tsleep((caddr_t) ps, PPAUSE|PCATCH, "i-pause", 0); *retval = -1; return EINTR; -} +} static int ibcs2_signal(struct proc *p, struct ibcs2_signal_args *args, int *retval) @@ -268,8 +268,8 @@ int ibcs2_sigsys(struct proc *p, struct ibcs2_signal_args *args, int *retval) { if (ibcs2_trace & IBCS2_TRACE_SIGNAL) - printf("IBCS2: 'sigsys' signo=%d(%s) ", - args->signo & IBCS2_SIGMASK, + printf("IBCS2: 'sigsys' signo=%d(%s) ", + args->signo & IBCS2_SIGMASK, ibcs2_sig_to_str(args->signo & IBCS2_SIGMASK)); switch (args->signo & ~IBCS2_SIGMASK ) { @@ -319,7 +319,7 @@ ibcs2_sigaction(struct proc *p, struct ibcs2_sigaction_args *args, int *retval) int bit, error; if (ibcs2_trace & IBCS2_TRACE_SIGNAL) - printf("IBCS2: 'sigaction' signo=%d(%s)\n", + printf("IBCS2: 'sigaction' signo=%d(%s)\n", args->signo, ibcs2_sig_to_str(args->signo)); sig = ibcs2_to_bsd_signal[LEGAL_SIG(args->signo)]; if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) { @@ -377,7 +377,7 @@ ibcs2_sigprocmask(struct proc *p, struct ibcs2_sigprocmask_args *args, int *retv return error; } umask = ibcs2_to_bsd_sigmask(umask); - if (args->omask) + if (args->omask) if (error = copyout(&omask, args->omask, sizeof(args->omask))) { *retval = -1; return error; @@ -387,7 +387,7 @@ ibcs2_sigprocmask(struct proc *p, struct ibcs2_sigprocmask_args *args, int *retv case 0: /* SIG_SETMASK */ p->p_sigmask = umask &~ DONTMASK; break; - + case 1: /* SIG_BLOCK */ p->p_sigmask |= (umask &~ DONTMASK); break; @@ -417,7 +417,7 @@ ibcs2_sigpending(struct proc *p, struct ibcs2_sigpending_args *args, int *retval { int error; sigset_t mask = bsd_to_ibcs2_sigmask(p->p_siglist); - + if (ibcs2_trace & IBCS2_TRACE_SIGNAL) printf("IBCS2: 'sigpending' which=%x\n", args->sigs); if (error = copyout(&mask, args->sigs, sizeof(unsigned long))) @@ -436,7 +436,7 @@ ibcs2_sigsuspend(struct proc *p, struct ibcs2_sigsuspend_args *args, int *retval { sigset_t mask = ibcs2_to_bsd_sigmask((sigset_t)args->mask); - if (ibcs2_trace & IBCS2_TRACE_SIGNAL) + if (ibcs2_trace & IBCS2_TRACE_SIGNAL) printf("IBCS2: 'sigsuspend'\n"); return sigsuspend(p, &mask, retval); } @@ -452,11 +452,11 @@ ibcs2_kill(struct proc *p, struct kill_args *args, int *retval) struct kill_args tmp; if (ibcs2_trace & IBCS2_TRACE_SIGNAL) - printf("IBCS2: 'kill' pid=%d, sig=%d(%s)\n", args->pid, + printf("IBCS2: 'kill' pid=%d, sig=%d(%s)\n", args->pid, args->signo, ibcs2_sig_to_str(args->signo)); tmp.pid = args->pid; - tmp.signo = (args->signo < IBCS2_NSIG) ? + tmp.signo = (args->signo < IBCS2_NSIG) ? ibcs2_to_bsd_signal[args->signo] : IBCS2_NSIG; - return kill(p, &tmp, retval); + return kill(p, &tmp, retval); } diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c index 08873a9..a1a52ad 100644 --- a/sys/i386/ibcs2/ibcs2_socksys.c +++ b/sys/i386/ibcs2/ibcs2_socksys.c @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_socksys.c,v 1.1 1994/10/14 08:53:08 sos Exp $ + * $Id: ibcs2_socksys.c,v 1.2 1994/10/17 22:13:08 sos Exp $ */ #include <sys/param.h> @@ -116,7 +116,7 @@ ss_syscall(arg, p) else { if(cmd == CMD_SO_SS_DEBUG) printf("%s ","ss_debug"); - else + else printf("%s ",ss_syscall_strings[cmd]); } printf("(%d) <0x%x,0x%x,0x%x,0x%x,0x%x,0x%x>\n", @@ -717,7 +717,7 @@ sockioctl(dev, cmd, arg, fflag, p) default: cmd_type = '?'; break; - + } ioctl_type = (0xe0000000 & cmd) >> 29; ioctl_len = (cmd >> 16) & SS_IOCPARM_MASK; @@ -1177,7 +1177,7 @@ ss_getsockopt(arg, ret, p) return (ENOPROTOOPT); } - + #define SS_CONVERT int system_type = SS_FREEBSD; /* FreeBSD */ diff --git a/sys/i386/ibcs2/ibcs2_socksys.h b/sys/i386/ibcs2/ibcs2_socksys.h index bfce605..fc5b2e2 100644 --- a/sys/i386/ibcs2/ibcs2_socksys.h +++ b/sys/i386/ibcs2/ibcs2_socksys.h @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_socksys.h,v 1.1 1994/10/14 08:53:16 sos Exp $ + * $Id: ibcs2_socksys.h,v 1.2 1994/10/17 22:13:10 sos Exp $ */ struct ss_call { @@ -46,10 +46,10 @@ struct alien_in_addr { }; #define __ALIEN_SOCK_SIZE__ 16 /* sizeof(struct alien_sockaddr)*/ -struct alien_sockaddr_in { +struct alien_sockaddr_in { short int sin_family; /* Address family */ unsigned short int sin_port; /* Port number */ - struct alien_in_addr sin_addr; /* Internet address */ + struct alien_in_addr sin_addr; /* Internet address */ unsigned char __filling[__ALIEN_SOCK_SIZE__ - sizeof(short int) - sizeof(unsigned short int) - sizeof(struct alien_in_addr)]; }; diff --git a/sys/i386/ibcs2/ibcs2_stats.c b/sys/i386/ibcs2/ibcs2_stats.c index 749c632..eee1ef4 100644 --- a/sys/i386/ibcs2/ibcs2_stats.c +++ b/sys/i386/ibcs2/ibcs2_stats.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ibcs2_stats.c,v 1.11 1994/10/13 23:10:58 sos Exp $ + * $Id: ibcs2_stats.c,v 1.1 1994/10/14 08:53:09 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -99,7 +99,7 @@ ibcs2_stat(struct proc *p, struct ibcs2_stat_args *args, int *retval) struct ibcs2_stat tbuf; struct nameidata nd; int error; - + if (ibcs2_trace & IBCS2_TRACE_STATS) printf("IBCS2: 'stat' path=%s\n", args->path); @@ -129,7 +129,7 @@ ibcs2_lstat(struct proc *p, struct ibcs2_stat_args *args, int *retval) struct ibcs2_stat tbuf; struct nameidata nd; int error; - + if (ibcs2_trace & IBCS2_TRACE_STATS) printf("IBCS2: 'lstat' path=%s\n", args->path); nd.ni_cnd.cn_nameiop = LOOKUP; @@ -147,7 +147,7 @@ ibcs2_lstat(struct proc *p, struct ibcs2_stat_args *args, int *retval) if (!error) error = stat_copyout(&buf, args->buf); - + return error; } @@ -164,10 +164,10 @@ ibcs2_fstat(struct proc *p, struct ibcs2_fstat_args *args, int *retval) struct file *fp; struct stat buf; int error; - + if (ibcs2_trace & IBCS2_TRACE_STATS) printf("IBCS2: 'fstat' fd=%d\n", args->fd); - if ((unsigned)args->fd >= fdp->fd_nfiles + if ((unsigned)args->fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[args->fd]) == NULL) return EBADF; @@ -175,11 +175,11 @@ ibcs2_fstat(struct proc *p, struct ibcs2_fstat_args *args, int *retval) case DTYPE_VNODE: error = vn_stat((struct vnode *)fp->f_data, &buf, p); break; - + case DTYPE_SOCKET: error = soo_stat((struct socket *)fp->f_data, &buf); break; - + default: panic("IBCS2 fstat"); /*NOTREACHED*/ @@ -280,6 +280,6 @@ ibcs2_fstatfs(struct proc *p, struct ibcs2_fstatfs_args *args, int *retval) tmp.f_files = sp->f_files; bcopy (sp->f_mntonname, tmp.f_fname, 6); bcopy (sp->f_mntfromname, tmp.f_fpack, 6); - return copyout((caddr_t)&tmp, (caddr_t)args->buf, + return copyout((caddr_t)&tmp, (caddr_t)args->buf, sizeof(struct statfs)); } diff --git a/sys/i386/ibcs2/ibcs2_sysent.c b/sys/i386/ibcs2/ibcs2_sysent.c index 1f1422d..23ce9ce 100644 --- a/sys/i386/ibcs2/ibcs2_sysent.c +++ b/sys/i386/ibcs2/ibcs2_sysent.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_sysent.c,v 1.14 1994/10/13 23:10:58 sos Exp $ + * $Id: ibcs2_sysent.c,v 1.1 1994/10/14 08:53:10 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -275,7 +275,7 @@ struct sysent svr3_sysent[] = struct sysentvec ibcs2_svr3_sysvec = { sizeof (svr3_sysent) / sizeof (svr3_sysent[0]), svr3_sysent, - 0x7F, + 0x7F, NSIG, bsd_to_ibcs2_signal, NERR, diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c index bca0fe9..611ad10 100644 --- a/sys/i386/ibcs2/ibcs2_sysi86.c +++ b/sys/i386/ibcs2/ibcs2_sysi86.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_sysi86.c,v 1.4 1994/10/12 19:38:38 sos Exp $ + * $Id: ibcs2_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -50,7 +50,7 @@ ibcs2_sysi86(struct proc *p, struct ibcs2_sysi86_args *args, int *retval) if (hw_float) val = IBCS2_FP_387; /* FPU hardware */ else val = IBCS2_FP_SW; /* FPU emulator */ - + if (error = copyout(&val, args->arg, sizeof(val))) return error; return 0; diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c index 656d033..3bbe7e7 100644 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ b/sys/i386/ibcs2/ibcs2_xenix.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_xenix.c,v 1.2 1995/02/03 21:31:35 bde Exp $ + * $Id: ibcs2_xenix.c,v 1.4 1995/05/02 13:14:59 ache Exp $ */ #include <i386/ibcs2/ibcs2.h> @@ -60,7 +60,7 @@ sco_chsize(struct proc *p, struct ibcs2_sco_chsize_args *args, int *retval) } tmp; if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix chsize'\n"); + printf("IBCS2: 'cxenix chsize'\n"); tmp.fd = args->fd; tmp.pad = 0; tmp.length = args->size; @@ -79,7 +79,7 @@ sco_ftime(struct proc *p, struct ibcs2_sco_ftime_args *args, int *retval) struct timeb tb; if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix ftime'\n"); + printf("IBCS2: 'cxenix ftime'\n"); microtime(&atv); tb.time = atv.tv_sec; tb.millitm = atv.tv_usec / 1000; @@ -100,10 +100,10 @@ sco_nap(struct proc *p, struct ibcs2_sco_nap_args *args, int *retval) extern int hz; if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix nap %d ms'\n", args->time); + printf("IBCS2: 'cxenix nap %d ms'\n", args->time); period = (long)args->time / (1000/hz); if (period) - while (tsleep(&period, PUSER, "nap", period) + while (tsleep(&period, PUSER, "nap", period) != EWOULDBLOCK) ; return 0; } @@ -155,8 +155,8 @@ sco_utsname(struct proc *p, struct ibcs2_sco_utsname_args *args, int *retval) } ibcs2_sco_uname; extern char ostype[], hostname[], osrelease[], version[], machine[]; - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sco_utsname'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sco_utsname'\n"); bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname)); strncpy(ibcs2_sco_uname.sysname, ostype, 8); strncpy(ibcs2_sco_uname.nodename, hostname, 8); @@ -177,7 +177,7 @@ int ibcs2_cxenix(struct proc *p, void *args, int *retval) { struct trapframe *tf = (struct trapframe *)p->p_md.md_regs; - + switch ((tf->tf_eax & 0xff00) >> 8) { case 0x07: /* rdchk */ @@ -197,43 +197,43 @@ ibcs2_cxenix(struct proc *p, void *args, int *retval) return 0; case 0x24: /* select */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix select'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix select'\n"); return select(p, args, retval); case 0x25: /* eaccess */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix eaccess'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix eaccess'\n"); return ibcs2_access(p, args, retval); case 0x27: /* sigaction */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sigaction'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sigaction'\n"); return ibcs2_sigaction (p, args, retval); case 0x28: /* sigprocmask */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sigprocmask'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sigprocmask'\n"); return ibcs2_sigprocmask (p, args, retval); case 0x29: /* sigpending */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sigpending'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sigpending'\n"); return ibcs2_sigpending (p, args, retval); case 0x2a: /* sigsuspend */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sigsuspend'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sigsuspend'\n"); return ibcs2_sigsuspend (p, args, retval); case 0x2b: /* getgroups */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix getgroups'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix getgroups'\n"); return ibcs2_getgroups(p, args, retval); case 0x2c: /* setgroups */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix setgroups'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix setgroups'\n"); return ibcs2_setgroups(p, args, retval); case 0x2d: { /* sysconf */ @@ -241,14 +241,14 @@ ibcs2_cxenix(struct proc *p, void *args, int *retval) int num; } *sysconf_args = args; - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix sysconf'"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix sysconf'"); switch (sysconf_args->num) { case 0: /* _SC_ARG_MAX */ *retval = (ARG_MAX); break; case 1: /* _SC_CHILD_MAX */ - *retval = (CHILD_MAX); + *retval = (CHILD_MAX); break; case 2: /* _SC_CLK_TCK */ *retval = (_BSD_CLK_TCK_); @@ -285,80 +285,80 @@ ibcs2_cxenix(struct proc *p, void *args, int *retval) case 0x2e: /* pathconf */ case 0x2f: /* fpathconf */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix (f)pathconf'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix (f)pathconf'\n"); return ibcs2_pathconf(p, args, retval); case 0x30: /* rename */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix rename'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix rename'\n"); return ibcs2_rename(p, args, retval); case 0x32: /* sco_utsname */ return sco_utsname(p, args, retval); case 0x37: /* getitimer */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix getitimer'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix getitimer'\n"); return getitimer(p, args, retval); - + case 0x38: /* setitimer */ - if (ibcs2_trace & IBCS2_TRACE_XENIX) - printf("IBCS2: 'cxenix setitimer'\n"); + if (ibcs2_trace & IBCS2_TRACE_XENIX) + printf("IBCS2: 'cxenix setitimer'\n"); return setitimer(p, args, retval); /* Not implemented yet SORRY */ case 0x01: /* xlocking */ - printf("IBCS2: 'cxenix xlocking'"); + printf("IBCS2: 'cxenix xlocking'"); break; case 0x02: /* creatsem */ - printf("IBCS2: 'cxenix creatsem'"); + printf("IBCS2: 'cxenix creatsem'"); break; case 0x03: /* opensem */ - printf("IBCS2: 'cxenix opensem'"); + printf("IBCS2: 'cxenix opensem'"); break; case 0x04: /* sigsem */ - printf("IBCS2: 'cxenix sigsem'"); + printf("IBCS2: 'cxenix sigsem'"); break; case 0x05: /* waitsem */ - printf("IBCS2: 'cxenix waitsem'"); + printf("IBCS2: 'cxenix waitsem'"); break; case 0x06: /* nbwaitsem */ - printf("IBCS2: 'cxenix nbwaitsem'"); + printf("IBCS2: 'cxenix nbwaitsem'"); break; case 0x0d: /* sdget */ - printf("IBCS2: 'cxenix sdget'"); + printf("IBCS2: 'cxenix sdget'"); break; case 0x0e: /* sdfree */ - printf("IBCS2: 'cxenix sdfree'"); + printf("IBCS2: 'cxenix sdfree'"); break; case 0x0f: /* sdenter */ - printf("IBCS2: 'cxenix sdenter'"); + printf("IBCS2: 'cxenix sdenter'"); break; case 0x10: /* sdleave */ - printf("IBCS2: 'cxenix sdleave'"); + printf("IBCS2: 'cxenix sdleave'"); break; case 0x11: /* sdgetv */ - printf("IBCS2: 'cxenix sdgetv'"); + printf("IBCS2: 'cxenix sdgetv'"); break; case 0x12: /* sdwaitv */ - printf("IBCS2: 'cxenix sdwaitv'"); + printf("IBCS2: 'cxenix sdwaitv'"); break; case 0x20: /* proctl */ - printf("IBCS2: 'cxenix proctl'"); + printf("IBCS2: 'cxenix proctl'"); break; case 0x21: /* execseg */ - printf("IBCS2: 'cxenix execseg'"); + printf("IBCS2: 'cxenix execseg'"); break; case 0x22: /* unexecseg */ - printf("IBCS2: 'cxenix unexecseg'"); + printf("IBCS2: 'cxenix unexecseg'"); break; case 0x26: /* paccess */ - printf("IBCS2: 'cxenix paccess'"); + printf("IBCS2: 'cxenix paccess'"); break; default: - printf("IBCS2: 'cxenix' function %d(0x%x)", + printf("IBCS2: 'cxenix' function %d(0x%x)", tf->tf_eax>>8, tf->tf_eax>>8); break; } diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c index 92e548a..f7e7670 100644 --- a/sys/i386/ibcs2/imgact_coff.c +++ b/sys/i386/ibcs2/imgact_coff.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: imgact_coff.c,v 1.2 1995/02/20 23:52:39 davidg Exp $ + * $Id: imgact_coff.c,v 1.3 1995/04/08 15:52:30 joerg Exp $ */ #include <sys/param.h> @@ -144,7 +144,7 @@ printf("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, 0x%x, FALSE)\n" return 0; } - + int coff_load_file(struct proc *p, char *name) { @@ -169,15 +169,15 @@ coff_load_file(struct proc *p, char *name) nd.ni_cnd.cn_cred = curproc->p_cred->pc_ucred; nd.ni_segflg = UIO_SYSSPACE; nd.ni_dirp = name; - + error = namei(&nd); if (error) return error; - + vnodep = nd.ni_vp; if (vnodep == NULL) return ENOEXEC; - + if (vnodep->v_writecount) { error = ETXTBSY; goto fail; @@ -241,7 +241,7 @@ coff_load_file(struct proc *p, char *name) text_address = scns[i].s_vaddr; text_size = scns[i].s_size; text_offset = scns[i].s_scnptr; - } + } else if (scns[i].s_flags & STYP_DATA) { data_address = scns[i].s_vaddr; data_size = scns[i].s_size; @@ -467,7 +467,7 @@ printf("imgact: error = %d\n", error); (vm_offset_t *) &hole, PAGE_SIZE, FALSE); if (ibcs2_trace & IBCS2_TRACE_COFF) { -printf("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n", +printf("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n", ctob(vmspace->vm_dsize), vmspace->vm_daddr, ctob(vmspace->vm_dsize) + vmspace->vm_daddr ); printf("%s(%d): returning successfully!\n", __FILE__, __LINE__); diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h index 18cc757..601b0df 100644 --- a/sys/i386/include/ansi.h +++ b/sys/i386/include/ansi.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ansi.h 8.2 (Berkeley) 1/4/94 - * $Id: ansi.h,v 1.5 1994/08/02 07:38:38 davidg Exp $ + * $Id: ansi.h,v 1.6 1995/02/03 21:23:46 bde Exp $ */ #ifndef _MACHINE_ANSI_H_ @@ -62,7 +62,7 @@ * chosen over a long is that the is*() and to*() routines take ints (says * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you * lose a bit of ANSI conformance, but your programs will still work. - * + * * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains * defined for ctype.h. diff --git a/sys/i386/include/apm_bios.h b/sys/i386/include/apm_bios.h index 67cdc38..868455b 100644 --- a/sys/i386/include/apm_bios.h +++ b/sys/i386/include/apm_bios.h @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm_bios.h,v 1.3 1994/10/02 17:31:27 phk Exp $ + * $Id: apm_bios.h,v 1.4 1995/02/17 02:22:45 phk Exp $ */ #ifndef _MACHINE_APM_BIOS_H_ diff --git a/sys/i386/include/apm_segments.h b/sys/i386/include/apm_segments.h index 8bee29e..c76df07 100644 --- a/sys/i386/include/apm_segments.h +++ b/sys/i386/include/apm_segments.h @@ -5,14 +5,14 @@ * * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its + * these terms are retained. Under no circumstances is the author + * responsible for the proper functioning of this software, nor does + * the author assume any responsibility for damages incurred with its * use. * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm_segments.h,v 1.2 1994/10/01 05:13:37 davidg Exp $ + * $Id: apm_segments.h,v 1.3 1995/02/17 02:22:46 phk Exp $ */ #ifndef _MACHINE_APM_SEGMENTS_H diff --git a/sys/i386/include/bootinfo.h b/sys/i386/include/bootinfo.h index 757e7e4..d0b471f 100644 --- a/sys/i386/include/bootinfo.h +++ b/sys/i386/include/bootinfo.h @@ -29,11 +29,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootinfo.h,v 1.3 1994/11/18 05:26:52 phk Exp $ + * $Id: bootinfo.h,v 1.4 1995/01/25 21:40:32 bde Exp $ */ #ifndef _MACHINE_BOOTINFO_H_ -#define _MACHINE_BOOTINFO_H_ +#define _MACHINE_BOOTINFO_H_ /* Only change the version number if you break compatibility. */ #define BOOTINFO_VERSION 1 diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h index 4f6ecca..870c5de 100644 --- a/sys/i386/include/console.h +++ b/sys/i386/include/console.h @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: console.h,v 1.15 1995/01/20 08:35:18 sos Exp $ + * $Id: console.h,v 1.18 1995/01/28 22:15:30 sos Exp $ */ #ifndef _CONSOLE_H_ @@ -47,7 +47,7 @@ #define KIOCSOUND _IO('K', 63) #define KDGKBTYPE _IOR('K', 64, int) #define KDGETLED _IOR('K', 65, int) -#define KDSETLED _IO('K', 66) +#define KDSETLED _IO('K', 66) #define KDSETRAD _IO('K', 67) #define GETFKEY _IOWR('k', 0, fkeyarg_t) @@ -79,14 +79,14 @@ #define CONS_GETVERS _IOR('c', 74, int) #define VT_OPENQRY _IOR('v', 1, int) -#define VT_SETMODE _IOW('v', 2, vtmode_t) +#define VT_SETMODE _IOW('v', 2, vtmode_t) #define VT_GETMODE _IOR('v', 3, vtmode_t) #define VT_RELDISP _IO('v', 4) #define VT_ACTIVATE _IO('v', 5) #define VT_WAITACTIVE _IO('v', 6) #define VT_GETACTIVE _IOR('v', 7, int) -#define VT_FALSE 0 +#define VT_FALSE 0 #define VT_TRUE 1 #define VT_ACKACQ 2 @@ -135,7 +135,7 @@ struct mouse_info { #define NLKED 2 /* Num locked */ #define SLKED 4 /* Scroll locked */ #define ALKED 8 /* AltGr locked */ -#define LED_CAP 1 /* Caps lock LED */ +#define LED_CAP 1 /* Caps lock LED */ #define LED_NUM 2 /* Num lock LED */ #define LED_SCR 4 /* Scroll lock LED */ diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index a57dc9d..576ba23 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.35 1995/05/11 07:24:35 bde Exp $ + * $Id: cpufunc.h,v 1.36 1995/05/14 22:25:11 davidg Exp $ */ /* @@ -279,7 +279,7 @@ read_eflags(void) { u_long ef; - __asm __volatile("pushfl; popl %0" : "=r" (ef)); + __asm __volatile("pushfl; popl %0" : "=r" (ef)); return (ef); } diff --git a/sys/i386/include/cronyx.h b/sys/i386/include/cronyx.h index db56cf9..9421cbc 100644 --- a/sys/i386/include/cronyx.h +++ b/sys/i386/include/cronyx.h @@ -82,7 +82,7 @@ typedef struct { /* async channel option register 6 */ unsigned icrnl : 1; /* translate CR to NL on input */ unsigned igncr : 1; /* discard CR on input */ } cx_cor6_async_t; - + typedef struct { /* async channel option register 7 */ unsigned ocrnl : 1; /* translate CR to NL on output */ unsigned onlcr : 1; /* translate NL to CR on output */ diff --git a/sys/i386/include/db_machdep.h b/sys/i386/include/db_machdep.h index a59b632..cae2a45 100644 --- a/sys/i386/include/db_machdep.h +++ b/sys/i386/include/db_machdep.h @@ -1,29 +1,29 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. * - * $Id: db_machdep.h,v 1.6 1994/10/19 21:13:51 bde Exp $ + * $Id: db_machdep.h,v 1.7 1995/01/14 10:34:52 bde Exp $ */ #ifndef _MACHINE_DB_MACHDEP_H_ diff --git a/sys/i386/include/devconf.h b/sys/i386/include/devconf.h index 9b270d7..f4fbe34 100644 --- a/sys/i386/include/devconf.h +++ b/sys/i386/include/devconf.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devconf.h,v 1.7 1995/02/02 05:42:47 jkh Exp $ + * $Id: devconf.h,v 1.8 1995/02/04 12:47:19 se Exp $ */ /* * devconf.h - machine-dependent device configuration table @@ -62,7 +62,7 @@ struct machdep_devconf { #define MACHDEP_COPYDEV(dc, kdc) ((dc)->dc_md = (kdc)->kdc_md) #define dc_devtype dc_md.mddc_devtype -#define dc_flags dc_md.mddc_flags +#define dc_flags dc_md.mddc_flags #define kdc_isa kdc_parentdata #define kdc_scsi kdc_parentdata diff --git a/sys/i386/include/ioctl_ctx.h b/sys/i386/include/ioctl_ctx.h index a7de049..a330664 100644 --- a/sys/i386/include/ioctl_ctx.h +++ b/sys/i386/include/ioctl_ctx.h @@ -1,13 +1,13 @@ /* * - * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, - * modified, copied, distributed, and sold, in both source and binary form - * provided that the above copyright and these terms are retained. Under + * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, + * modified, copied, distributed, and sold, in both source and binary form + * provided that the above copyright and these terms are retained. Under * no circumstances is the author responsible for the proper functioning * of this software, nor does the author assume any responsibility * for damages incurred with its use * - * $Id$ + * $Id: ioctl_ctx.h,v 1.1 1994/10/01 17:59:38 davidg Exp $ */ /* diff --git a/sys/i386/include/lpt.h b/sys/i386/include/lpt.h index 7e3df42..a203c7d 100644 --- a/sys/i386/include/lpt.h +++ b/sys/i386/include/lpt.h @@ -1,17 +1,17 @@ /* * Copyright (C) 1994 Geoffrey M. Rehmet * - * This program is free software; you may redistribute it and/or - * modify it, provided that it retain the above copyright notice + * This program is free software; you may redistribute it and/or + * modify it, provided that it retain the above copyright notice * and the following disclaimer. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Geoff Rehmet, Rhodes University, South Africa <csgr@cs.ru.ac.za> * - * $Id$ + * $Id: lpt.h,v 1.2 1994/08/02 07:38:52 davidg Exp $ */ #ifndef _LPT_PRINTER_H_ diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 6bc5808..34854b0 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: md_var.h,v 1.1 1995/03/16 18:11:43 bde Exp $ + * $Id: md_var.h,v 1.2 1995/03/28 07:55:08 bde Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -41,7 +41,7 @@ extern u_long cpu_feature; extern u_long cpu_high; extern u_long cpu_id; extern char cpu_vendor[]; -extern char etext[]; +extern char etext[]; extern vm_offset_t isaphysmem; extern char kstack[]; extern void (*netisrs[32]) __P((void)); diff --git a/sys/i386/include/pcaudioio.h b/sys/i386/include/pcaudioio.h index b347c96..d887334 100644 --- a/sys/i386/include/pcaudioio.h +++ b/sys/i386/include/pcaudioio.h @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcaudioio.h,v 1.2 1994/05/20 12:22:40 sos Exp $ + * $Id: pcaudioio.h,v 1.3 1994/09/29 08:31:39 sos Exp $ */ #ifndef _PCAUDIOIO_H_ @@ -54,7 +54,7 @@ typedef struct audio_prinfo { typedef struct audio_info { audio_prinfo_t play; - audio_prinfo_t record; + audio_prinfo_t record; unsigned monitor_gain; unsigned _fill[4]; } audio_info_t; diff --git a/sys/i386/include/pcvt_ioctl.h b/sys/i386/include/pcvt_ioctl.h index c4dbe44..b5f0842 100644 --- a/sys/i386/include/pcvt_ioctl.h +++ b/sys/i386/include/pcvt_ioctl.h @@ -159,7 +159,7 @@ struct kbd_ovlkey /* complete definition of a key */ /* Max value for keynum field */ #define KBDMAXKEYS 128 /* Max No. of Keys */ - + /* Values for type field */ #define KBD_NONE 0 /* no function, key is disabled */ @@ -185,11 +185,11 @@ struct kbd_ovlkey /* complete definition of a key */ #define KBD_OVERLOAD 0x8000 /* Key is overloaded, ignored in ioctl */ -#define KBD_MASK (~KBD_OVERLOAD) /* mask for type */ +#define KBD_MASK (~KBD_OVERLOAD) /* mask for type */ #define KBDGCKEY _IOWR('K',16, struct kbd_ovlkey) /* get current key values */ #define KBDSCKEY _IOW('K',17, struct kbd_ovlkey) /* set new key assignment values*/ -#define KBDGOKEY _IOWR('K',18, struct kbd_ovlkey) /* get original key assignment values*/ +#define KBDGOKEY _IOWR('K',18, struct kbd_ovlkey) /* get original key assignment values*/ #define KBDRMKEY _IOW('K',19, int) /* remove a key assignment */ #define KBDDEFAULT _IO('K',20) /* remove all key assignments */ @@ -496,7 +496,7 @@ struct pcvtinfo { /* compile time option values */ * which would be identical to KBDGLEDS above. Since this command is not * necessary for XFree86 2.0, we omit it. */ - + /* #define KDGKBMODE _IOR('K', 6, int) */ /* not yet implemented */ #define KDSKBMODE _IO('K', 7 /*, int */) @@ -517,7 +517,7 @@ struct pcvtinfo { /* compile time option values */ #define KDDISABIO _IO('K', 61) #define KDGETLED _IOR('K', 65, int) -#define KDSETLED _IO('K', 66 /*, int */) +#define KDSETLED _IO('K', 66 /*, int */) #define LED_CAP 1 #define LED_NUM 2 #define LED_SCR 4 @@ -534,7 +534,7 @@ struct pcvtinfo { /* compile time option values */ #define GIO_KEYMAP _IOR('k', 6, keymap_t) #define VT_OPENQRY _IOR('v', 1, int) -#define VT_SETMODE _IOW('v', 2, vtmode_t) +#define VT_SETMODE _IOW('v', 2, vtmode_t) #define VT_GETMODE _IOR('v', 3, vtmode_t) #define VT_RELDISP _IO('v', 4 /*, int */) diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 3ebe003..6a35c05 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.24 1995/03/16 18:11:44 bde Exp $ + * $Id: pmap.h,v 1.25 1995/03/26 23:42:55 davidg Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -108,12 +108,12 @@ extern int IdlePTD; /* physical address of "Idle" state directory */ */ #define vtopte(va) (PTmap + i386_btop(va)) #define kvtopte(va) vtopte(va) -#define ptetov(pt) (i386_ptob(pt - PTmap)) +#define ptetov(pt) (i386_ptob(pt - PTmap)) #define vtophys(va) (((int) (*vtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) #define ispt(va) ((va) >= UPT_MIN_ADDRESS && (va) <= KPT_MAX_ADDRESS) #define avtopte(va) (APTmap + i386_btop(va)) -#define ptetoav(pt) (i386_ptob(pt - APTmap)) +#define ptetoav(pt) (i386_ptob(pt - APTmap)) #define avtophys(va) (((int) (*avtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) #ifdef KERNEL diff --git a/sys/i386/include/pte.h b/sys/i386/include/pte.h index 5f473d8..b68f716 100644 --- a/sys/i386/include/pte.h +++ b/sys/i386/include/pte.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pte.h 5.5 (Berkeley) 5/9/91 - * $Id: pte.h,v 1.6 1994/05/25 08:56:34 rgrimes Exp $ + * $Id: pte.h,v 1.7 1994/09/04 23:10:25 davidg Exp $ */ #ifndef _MACHINE_PTE_H_ @@ -54,7 +54,7 @@ #ifndef LOCORE struct pde { -unsigned int +unsigned int pd_v:1, /* valid bit */ pd_prot:2, /* access control */ pd_ncpwt:1, /* page cache write through */ @@ -67,7 +67,7 @@ unsigned int }; struct pte { -unsigned int +unsigned int pg_v:1, /* valid bit */ pg_prot:2, /* access control */ pg_ncpwt:1, /* page cache write through */ @@ -83,7 +83,7 @@ unsigned int #define PD_MASK 0xffc00000 /* page directory address bits */ #define PD_SHIFT 22 /* page directory address bits */ #define PT_MASK 0x003ff000UL /* page table address bits */ -#define PG_SHIFT 12 /* page table address shift */ +#define PG_SHIFT 12 /* page table address shift */ #define PG_V 0x00000001 #define PG_RW 0x00000002 diff --git a/sys/i386/include/segments.h b/sys/i386/include/segments.h index 0c236f5..dcac309 100644 --- a/sys/i386/include/segments.h +++ b/sys/i386/include/segments.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)segments.h 7.1 (Berkeley) 5/9/91 - * $Id: segments.h,v 1.7 1994/11/15 14:12:40 bde Exp $ + * $Id: segments.h,v 1.8 1995/02/14 19:21:15 sos Exp $ */ #ifndef _MACHINE_SEGMENTS_H_ @@ -51,10 +51,10 @@ */ #define ISPL(s) ((s)&3) /* what is the priority level of a selector */ -#define SEL_KPL 0 /* kernel priority level */ -#define SEL_UPL 3 /* user priority level */ +#define SEL_KPL 0 /* kernel priority level */ +#define SEL_UPL 3 /* user priority level */ #define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */ -#define SEL_LDT 4 /* local descriptor table */ +#define SEL_LDT 4 /* local descriptor table */ #define IDXSEL(s) (((s)>>3) & 0x1fff) /* index of selector */ #define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */ #define GSEL(s,r) (((s)<<3) | r) /* a global selector */ diff --git a/sys/i386/include/soundcard.h b/sys/i386/include/soundcard.h index 8291c07..7bd55eb 100644 --- a/sys/i386/include/soundcard.h +++ b/sys/i386/include/soundcard.h @@ -25,12 +25,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: soundcard.h,v 1.11 1995/02/13 22:48:54 jkh Exp $ + * $Id: soundcard.h,v 1.12 1995/03/08 18:43:49 ugen Exp $ */ - /* + /* * If you make modifications to this file, please contact me before - * distributing the modified version. There is already enough + * distributing the modified version. There is already enough * divercity in the world. * * Regards, @@ -134,7 +134,7 @@ struct patch_info { long len; /* Size of the wave data in bytes */ long loop_start, loop_end; /* Byte offsets from the beginning */ -/* +/* * The base_freq and base_note fields are used when computing the * playback speed for a note. The base_note defines the tone frequency * which is heard if the sample is played using the base_freq as the @@ -163,7 +163,7 @@ struct patch_info { unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */ unsigned char env_offset[ 6 ]; /* 255 == 100% */ - /* + /* * The tremolo, vibrato and scale info are not supported yet. * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or * WAVE_SCALE @@ -172,14 +172,14 @@ struct patch_info { unsigned char tremolo_sweep; unsigned char tremolo_rate; unsigned char tremolo_depth; - + unsigned char vibrato_sweep; unsigned char vibrato_rate; unsigned char vibrato_depth; int scale_frequency; unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */ - + int volume; int spare[4]; char data[1]; /* The waveform data starts here */ @@ -216,7 +216,7 @@ struct sysex_info { * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows * a patch manager daemon to read and write device parameters. This * ioctl available through /dev/sequencer also. Avoid using it since it's - * extremely hardware dependent. In addition access trough /dev/sequencer + * extremely hardware dependent. In addition access trough /dev/sequencer * may confuse the patch manager daemon. */ @@ -230,8 +230,8 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ int device; int command; -/* - * Commands 0x000 to 0xfff reserved for patch manager programs +/* + * Commands 0x000 to 0xfff reserved for patch manager programs */ #define PM_GET_DEVTYPE 1 /* Returns type of the patch mgr interface of dev */ #define PMTYPE_FM2 1 /* 2 OP fm */ @@ -251,7 +251,7 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ */ #define _PM_LOAD_PATCH 0x100 -/* +/* * Commands above 0xffff reserved for device specific use */ @@ -282,7 +282,7 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ * /dev/sequencer input events. * * The data written to the /dev/sequencer is a stream of events. Events - * are records of 4 or 8 bytes. The first byte defines the size. + * are records of 4 or 8 bytes. The first byte defines the size. * Any number of events can be written with a write call. There * is a set of macros for sending these events. Use these macros if you * want to maximize portability of your program. @@ -421,13 +421,13 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ * of the associated synthesizer device. There is no limit to the size * of the extended events. These events are not queued but executed * immediately when the write() is called (execution can take several - * seconds of time). + * seconds of time). * * When a SEQ_FULLSIZE message is written to the device, it must * be written using exactly one write() call. Other events cannot * be mixed to the same write. - * - * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the + * + * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the * /dev/sequencer. Don't write other data together with the instrument structure * Set the key field of the structure to FM_PATCH. The device field is used to * route the patch to the corresponding device. @@ -471,7 +471,7 @@ struct synth_info { /* Read only */ int nr_voices; int nr_drums; /* Obsolete field */ int instr_bank_size; - unsigned long capabilities; + unsigned long capabilities; #define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */ #define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */ #define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */ @@ -572,12 +572,12 @@ struct pss_speaker { /********************************************* * IOCTL commands for /dev/mixer */ - -/* + +/* * Mixer devices * * There can be up to 20 different analog mixer channels. The - * SOUND_MIXER_NRDEVICES gives the currently supported maximum. + * SOUND_MIXER_NRDEVICES gives the currently supported maximum. * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells * the devices supported by the particular mixer. */ @@ -688,7 +688,7 @@ struct pss_speaker { /* * The 4 most significant bits of byte 0 specify the class of - * the event: + * the event: * * 0x8X = system level events, * 0x9X = device/port specific events, event[1] = device/port, @@ -742,7 +742,7 @@ struct pss_speaker { #define TMR_SPP 10 /* Song position pointer */ #define TMR_TIMESIG 11 /* Time signature */ -#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) +#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) /* * Some convenience macros to simplify programming of the * /dev/sequencer interface @@ -783,16 +783,16 @@ void seqbuf_dump(void); /* This function must be provided by programs */ /* * This variation of the sequencer macros is used just to format one event * using fixed buffer. - * + * * The program using the macro library must define the following macros before * using this library. * - * #define _seqbuf name of the buffer (unsigned char[]) + * #define _seqbuf name of the buffer (unsigned char[]) * #define _SEQ_ADVBUF(len) If the applic needs to know the exact * size of the event, this macro can be used. * Otherwise this must be defined as empty. * #define _seqbufptr Define the name of index variable or 0 if - * not required. + * not required. */ #define _SEQ_NEEDBUF(len) /* empty */ #endif @@ -914,7 +914,7 @@ void seqbuf_dump(void); /* This function must be provided by programs */ #define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig) /* - * Events for the level 1 interface only + * Events for the level 1 interface only */ #define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\ diff --git a/sys/i386/include/specialreg.h b/sys/i386/include/specialreg.h index aa87bec..75cc79d 100644 --- a/sys/i386/include/specialreg.h +++ b/sys/i386/include/specialreg.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $Id: specialreg.h,v 1.5 1994/09/04 23:10:27 davidg Exp $ + * $Id: specialreg.h,v 1.6 1995/01/14 10:44:55 bde Exp $ */ #ifndef _MACHINE_SPECIALREG_H_ @@ -84,7 +84,7 @@ * NCRx+0: A31-A24 of starting address * NCRx+1: A23-A16 of starting address * NCRx+2: A15-A12 of starting address | NCR_SIZE_xx. - * + * * The non-cacheable region's starting address must be aligned to the * size indicated by the NCR_SIZE_xx field. */ diff --git a/sys/i386/include/spigot.h b/sys/i386/include/spigot.h index 6d95033..4f29db8 100644 --- a/sys/i386/include/spigot.h +++ b/sys/i386/include/spigot.h @@ -61,7 +61,7 @@ unsigned char spigot_status(void); * spigot_open() returns a data address pointing to the spigot data. * Each read from this address returns the next word. The ``dev'' passed * is usually "/dev/spigot". Data is described in the phillips desktop - * video data handbook under the 7191 chip. Formats may be either + * video data handbook under the 7191 chip. Formats may be either * YUV 4:2:2 or YUV 4:1:1. A sample device driver for ``nv'' is included * with this code. * diff --git a/sys/i386/include/tss.h b/sys/i386/include/tss.h index 1fada6e..fd07e35 100644 --- a/sys/i386/include/tss.h +++ b/sys/i386/include/tss.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)tss.h 5.4 (Berkeley) 1/18/91 - * $Id: tss.h,v 1.3 1993/11/07 17:43:16 wollman Exp $ + * $Id: tss.h,v 1.4 1993/11/17 23:25:04 wollman Exp $ */ #ifndef _MACHINE_TSS_H_ @@ -59,16 +59,16 @@ struct i386tss { #define tss_pc tss_eip int tss_eflags; /* program status longword */ #define tss_psl tss_eflags - int tss_eax; - int tss_ecx; - int tss_edx; - int tss_ebx; + int tss_eax; + int tss_ecx; + int tss_edx; + int tss_ebx; int tss_esp; /* user stack pointer */ #define tss_usp tss_esp int tss_ebp; /* user frame pointer */ #define tss_fp tss_ebp - int tss_esi; - int tss_edi; + int tss_esi; + int tss_edi; int tss_es; /* actually 16 bits: top 16 bits must be zero */ int tss_cs; /* actually 16 bits: top 16 bits must be zero */ int tss_ss; /* actually 16 bits: top 16 bits must be zero */ diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c index 68948d1..d8a5bf0 100644 --- a/sys/i386/isa/aha1542.c +++ b/sys/i386/isa/aha1542.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1542.c,v 1.43 1995/04/12 20:47:32 wollman Exp $ + * $Id: aha1542.c,v 1.44 1995/04/14 15:13:46 dufault Exp $ */ /* @@ -118,7 +118,7 @@ struct aha_cmd_buf { #define AHA_MBIF 0x01 /* MBX in full */ /* - * Mail box defs + * Mail box defs */ #define AHA_MBX_SIZE 16 /* mail box size */ @@ -295,7 +295,7 @@ struct aha_data { short aha_base; /* base port for each board */ /* * xor this with a physaddr to get a kv addr and visa versa - * for items in THIS STRUCT only. + * for items in THIS STRUCT only. * Used to get the CCD's physical and kv addresses from each * other. */ @@ -335,7 +335,7 @@ struct scsi_adapter aha_switch = 0, aha_adapter_info, "aha", - { 0, 0 } + { 0, 0 } }; /* the below structure is so we have a default dev struct for out link struct */ @@ -596,7 +596,7 @@ ahaprobe(dev) * to change addresses within the structure * from physical to virtual easily, as long as * the structure is less than 1 page in size. - * This is used to recognise CCBs which are in + * This is used to recognise CCBs which are in * this struct and which are refered to by the * hardware using physical addresses. * (assumes malloc returns a chunk that doesn't @@ -646,7 +646,7 @@ ahaattach(dev) * Return some information to the caller about the adapter and its * capabilities. */ -u_int32 +u_int32 aha_adapter_info(unit) int unit; { @@ -669,7 +669,7 @@ ahaintr(unit) #endif /*AHADEBUG */ /* * First acknowledge the interrupt, Then if it's not telling about - * a completed operation just return. + * a completed operation just return. */ stat = inb(AHA_INTR_PORT); outb(AHA_CTRL_STAT_PORT, AHA_IRST); @@ -767,7 +767,7 @@ ahaintr(unit) } /* - * A ccb (and hence a mbx-out) is put onto the + * A ccb (and hence a mbx-out) is put onto the * free list. */ void @@ -991,7 +991,7 @@ aha_init(unit) aha->sg_opcode = AHA_INIT_SCAT_GATH_CCB; /* - * reset board, If it doesn't respond, assume + * reset board, If it doesn't respond, assume * that it's not there.. good for the probe */ @@ -1190,7 +1190,7 @@ aha_init(unit) #ifdef TUNE_1542 /* * Initialize memory transfer speed - * Not compiled in by default because it breaks some machines + * Not compiled in by default because it breaks some machines */ if (!(aha_set_bus_speed(unit))) { return (EIO); @@ -1199,7 +1199,7 @@ aha_init(unit) printf (" (bus speed defaulted)\n"); #endif /*TUNE_1542*/ /* - * Initialize mail box + * Initialize mail box */ scsi_uto3b(KVTOPHYS(&aha->aha_mbx), ad); @@ -1227,7 +1227,7 @@ aha_init(unit) return 0; } -void +void ahaminphys(bp) struct buf *bp; { @@ -1256,7 +1256,7 @@ int aha_escape(xs, ccb) case SCSI_OP_TARGET: s= splbio(); - aha_cmd(xs->sc_link->adapter_unit, 2, 0, 0, 0, AHA_TARGET_EN, + aha_cmd(xs->sc_link->adapter_unit, 2, 0, 0, 0, AHA_TARGET_EN, (int)xs->cmd->bytes[0], (int)1); splx(s); ret = COMPLETE; @@ -1328,7 +1328,7 @@ static int physcontig(int kv, int len) * the data address. Also needs the unit, target * and lu */ -int32 +int32 aha_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -1589,7 +1589,7 @@ aha_scsi_cmd(xs) /* * Poll a particular unit, looking for a particular xs */ -int +int aha_poll(unit, xs, ccb) int unit; struct scsi_xfer *xs; @@ -1619,7 +1619,7 @@ aha_poll(unit, xs, ccb) /* * We timed out, so call the timeout handler * manually, accout for the fact that the - * clock is not running yet by taking out the + * clock is not running yet by taking out the * clock queue entry it makes */ aha_timeout((caddr_t)ccb); @@ -1665,7 +1665,7 @@ aha_poll(unit, xs, ccb) * speed that fails, back off one notch from the last working * speed (unless there is no other notch). * Returns the nSEC value of the time used - * or 0 if it could get a working speed (or the NEXT speed + * or 0 if it could get a working speed (or the NEXT speed * failed) */ static struct bus_speed @@ -1684,7 +1684,7 @@ static struct bus_speed {0xff,450} }; -int +int aha_set_bus_speed(unit) int unit; { @@ -1734,7 +1734,7 @@ static char aha_test_string[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijk u_char aha_scratch_buf[256]; -int +int aha_bus_speed_check(unit, speed) int unit, speed; { @@ -1770,20 +1770,20 @@ aha_bus_speed_check(unit, speed) * board. */ bzero(aha_scratch_buf, 54); /* 54 bytes transfered by test */ - + aha_cmd(unit, 3, 0, 0, 0, AHA_READ_FIFO, ad[0], ad[1], ad[2]); - + /* * Compare the original data and the final data and * return the correct value depending upon the result */ - if (strcmp(aha_test_string, aha_scratch_buf)) + if (strcmp(aha_test_string, aha_scratch_buf)) return 0; /* failed test */ } /* copy succeded assume speed ok */ return (aha_bus_speeds[speed].nsecs); - + } #endif /*TUNE_1542*/ diff --git a/sys/i386/isa/aha1742.c b/sys/i386/isa/aha1742.c index 0d31e01..727b9a4 100644 --- a/sys/i386/isa/aha1742.c +++ b/sys/i386/isa/aha1742.c @@ -14,7 +14,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aha1742.c,v 1.32 1995/05/09 12:25:50 rgrimes Exp $ + * $Id: aha1742.c,v 1.33 1995/05/11 19:26:15 rgrimes Exp $ */ #include <sys/types.h> @@ -561,7 +561,7 @@ ahb_attach(dev) * Return some information to the caller about * the adapter and it's capabilities */ -u_int32 +u_int32 ahb_adapter_info(unit) int unit; { @@ -590,7 +590,7 @@ ahbintr(unit) while (inb(port + G2STAT) & G2STAT_INT_PEND) { /* - * First get all the information and then + * First get all the information and then * acknowlege the interrupt */ ahbstat = inb(port + G2INTST); @@ -712,7 +712,7 @@ ahb_done(unit, ecb, state) printf("unexpected ha_status: %x\n", stat->ha_status); } -#endif /*AHBDEBUG */ +#endif /*AHBDEBUG */ } } else { switch (stat->targ_status) { @@ -741,7 +741,7 @@ done: xs->flags |= ITSDONE; } /* - * A ecb (and hence a mbx-out is put onto the + * A ecb (and hence a mbx-out is put onto the * free list. */ void @@ -770,7 +770,7 @@ ahb_free_ecb(unit, ecb, flags) } /* - * Get a free ecb + * Get a free ecb * If there are none, see if we can allocate a * new one. If so, put it in the hash table too * otherwise either return an error or sleep @@ -863,7 +863,7 @@ ahb_init(unit) #define NO_NO 1 #ifdef NO_NO /* - * reset board, If it doesn't respond, assume + * reset board, If it doesn't respond, assume * that it's not there.. good for the probe */ outb(port + EBCTRL, CDEN); /* enable full card */ @@ -944,7 +944,7 @@ ahb_init(unit) #ifndef min #define min(x,y) (x < y ? x : y) -#endif /* min */ +#endif /* min */ void ahbminphys(bp) @@ -960,7 +960,7 @@ ahbminphys(bp) * the data address. Also needs the unit, target * and lu */ -int32 +int32 ahb_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -1001,7 +1001,7 @@ ahb_scsi_cmd(xs) /* * If it's a reset, we need to do an 'immediate' * command, and store it's ecb for later - * if there is already an immediate waiting, + * if there is already an immediate waiting, * then WE must wait */ if (flags & SCSI_RESET) { @@ -1091,8 +1091,8 @@ ahb_scsi_cmd(xs) nextphys = thisphys; while ((datalen) && (thisphys == nextphys)) { /* - * This page is contiguous (physically) with - * the the last, just extend the length + * This page is contiguous (physically) with + * the the last, just extend the length */ /* how far to the end of the page */ nextphys = (thisphys & (~(PAGESIZ - 1))) @@ -1111,7 +1111,7 @@ ahb_scsi_cmd(xs) thisphys = KVTOPHYS(thiskv); } /* - * next page isn't contiguous, finish the seg + * next page isn't contiguous, finish the seg */ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("(0x%x)", bytes_this_seg)); @@ -1194,7 +1194,7 @@ ahb_timeout(void *arg1) #endif /*AHBDEBUG */ /* - * If it's immediate, don't try abort it + * If it's immediate, don't try abort it */ if (ecb->flags & ECB_IMMED) { ecb->xs->retries = 0; /* I MEAN IT ! */ diff --git a/sys/i386/isa/aic6360.c b/sys/i386/isa/aic6360.c index daa9885..2e8912c 100644 --- a/sys/i386/isa/aic6360.c +++ b/sys/i386/isa/aic6360.c @@ -14,7 +14,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Jarle Greipsland - * 4. The name of the author may not be used to endorse or promote products + * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR @@ -31,7 +31,7 @@ */ /* - * $Id: aic6360.c,v 1.7 1995/03/28 07:55:24 bde Exp $ + * $Id: aic6360.c,v 1.8 1995/04/12 20:47:35 wollman Exp $ * * Acknowledgements: Many of the algorithms used in this driver are * inspired by the work of Julian Elischer (julian@tfs.com) and @@ -43,7 +43,7 @@ /* TODO list: * 1) Get the DMA stuff working. * 2) Get the iov/uio stuff working. Is this a good thing ??? - * 3) Get the synch stuff working. + * 3) Get the synch stuff working. * 4) Rewrite it to use malloc for the acb structs instead of static alloc.? */ @@ -56,7 +56,7 @@ #define AIC_SCSI_HOSTID 7 #endif -/* Use doubleword transfers to/from SCSI chip. Note: This requires +/* Use doubleword transfers to/from SCSI chip. Note: This requires * motherboard support. Basicly, some motherboard chipsets are able to * split a 32 bit I/O operation into two 16 bit I/O operations, * transparently to the processor. This speeds up some things, notably long @@ -94,9 +94,9 @@ #define AIC_MSGI_SPIN 1 /* Will spinwait upto ?ms for a new msg byte */ #define AIC_MSGO_SPIN 1 -/* Include debug functions? At the end of this file there are a bunch of - * functions that will print out various information regarding queued SCSI - * commands, driver state and chip contents. You can call them from the +/* Include debug functions? At the end of this file there are a bunch of + * functions that will print out various information regarding queued SCSI + * commands, driver state and chip contents. You can call them from the * kernel debugger. If you set AIC_DEBUG to 0 they are not included (the * kernel uses less memory) but you lose the debugging facilities. */ @@ -290,8 +290,8 @@ * mismatch and phase change interrupts. But more important: If there is a * phase mismatch the chip will not transfer any data! This is actually a nice * feature as it gives us a bit more control over what is happening when we are - * bursting data (in) through the FIFOs and the phase suddenly changes from - * DATA IN to STATUS or MESSAGE IN. The transfer will stop and wait for the + * bursting data (in) through the FIFOs and the phase suddenly changes from + * DATA IN to STATUS or MESSAGE IN. The transfer will stop and wait for the * proper phase to be set in this register instead of dumping the bits into the * FIFOs. */ @@ -521,7 +521,7 @@ extern int delaycount; #define AIC_NSEG 16 #define NUM_CONCURRENT 7 /* Only one per target for now */ -/* +/* * ACB. Holds additional information for each SCSI command Comments: We * need a separate scsi command block because we may need to overwrite it * with a request sense command. Basicly, we refrain from fiddling with @@ -546,9 +546,9 @@ struct acb { int stat; /* SCSI status byte */ }; -/* - * Some info about each (possible) target on the SCSI bus. This should - * probably have been a "per target+lunit" structure, but we'll leave it at +/* + * Some info about each (possible) target on the SCSI bus. This should + * probably have been a "per target+lunit" structure, but we'll leave it at * this for now. Is there a way to reliably hook it up to sc->fordriver?? */ struct aic_tinfo { @@ -655,7 +655,7 @@ struct aic_softc { /* One of these per adapter */ #define AIC_SHOWMISC 0x08 #define AIC_SHOWTRAC 0x10 #define AIC_SHOWSTART 0x20 -int aic_debug = 0; /* AIC_SHOWSTART|AIC_SHOWMISC|AIC_SHOWTRAC; */ +int aic_debug = 0; /* AIC_SHOWSTART|AIC_SHOWMISC|AIC_SHOWTRAC; */ #if AIC_DEBUG #define AIC_ACBS(str) do {if (aic_debug & AIC_SHOWACBS) printf str;} while (0) @@ -771,7 +771,7 @@ aic_registerdev(struct isa_device *id) dev_attach(&kdc_aic[id->id_unit]); } -/* +/* * INITIALIZATION ROUTINES (probe, attach ++) */ @@ -779,7 +779,7 @@ aic_registerdev(struct isa_device *id) * aicprobe: probe for AIC6360 SCSI-controller * returns non-zero value if a controller is found. */ -int +int #ifdef __FreeBSD__ aicprobe(dev) struct isa_device *dev; @@ -797,7 +797,7 @@ aicprobe(parent, self, aux) struct isa_attach_args *ia = aux; #endif int i, len, ic; - + #ifdef __FreeBSD__ if (unit >= NAIC) { printf("aic%d: unit number too high\n", unit); @@ -862,7 +862,7 @@ aicprobe(parent, self, aux) #endif } -/* Do the real search-for-device. +/* Do the real search-for-device. * Prerequisite: aic->iobase should be set to the proper value */ int @@ -872,23 +872,23 @@ aic_find(aic) #else struct aic_softc *aic; #endif -{ +{ u_short iobase = aic->iobase; char chip_id[sizeof(IDSTRING)]; /* For chips that support it */ char *start; int i; - + /* Remove aic6360 from possible powerdown mode */ outb(DMACNTRL0, 0); - /* Thanks to mark@aggregate.com for the new method for detecting - * whether the chip is present or not. Bonus: may also work for + /* Thanks to mark@aggregate.com for the new method for detecting + * whether the chip is present or not. Bonus: may also work for * the AIC-6260! */ AIC_TRACE(("aic: probing for aic-chip at port 0x%x\n",(int)iobase)); - /* + /* * Linux also init's the stack to 1-16 and then clears it, - * 6260's don't appear to have an ID reg - mpg + * 6260's don't appear to have an ID reg - mpg */ /* Push the sequence 0,1,..,15 on the stack */ #define STSIZE 16 @@ -927,7 +927,7 @@ aicprint() * Attach the AIC6360, fill out some high and low level data structures */ #ifdef __FreeBSD__ -int +int aicattach(dev) struct isa_device *dev; #else @@ -990,7 +990,7 @@ aicattach(parent, self, aux) * aicprobe should have succeeded, i.e. the iobase address in aic_data must * be valid. */ -static void +static void aic6360_reset(aic) #ifdef __FreeBSD__ struct aic_data *aic; @@ -1005,7 +1005,7 @@ aic6360_reset(aic) /* Reset SCSI-FIFO and abort any transfers */ outb(SXFRCTL0, CHEN|CLRCH|CLRSTCNT); - + /* Reset DMA-FIFO */ outb(DMACNTRL0, RSTFIFO); outb(DMACNTRL1, 0); @@ -1018,11 +1018,11 @@ aic6360_reset(aic) outb(SIMODE1, 0x00); /* Disable some more interrupts */ outb(CLRSINT1, 0xef); /* Clear another slew of interrupts */ - + outb(SCSIRATE, 0); /* Disable synchronous transfers */ outb(CLRSERR, 0x07); /* Haven't seen ant errors (yet) */ - + outb(SCSIID, AIC_SCSI_HOSTID << OID_S); /* Set our SCSI-ID */ outb(BRSTCNTRL, EISA_BRST_TIM); } @@ -1067,7 +1067,7 @@ aic_init(aic) u_short iobase = aic->iobase; struct acb *acb; int r; - + /* Reset the SCSI-bus itself */ aic_scsi_reset(aic); @@ -1102,7 +1102,7 @@ aic_init(aic) aic_done(acb); } } - + aic->phase = aic->prevphase = PH_INVALID; aic->hp = 0; for (r = 0; r < 7; r++) { @@ -1145,7 +1145,7 @@ aic_init(aic) * SCSI-commands. */ #ifdef __FreeBSD__ -int32 +int32 #else int #endif @@ -1163,10 +1163,10 @@ aic_scsi_cmd(xs) int s = 0; int flags; u_short iobase = aic->iobase; - + SC_DEBUG(sc, SDEV_DB2, ("aic_scsi_cmd\n")); AIC_TRACE(("aic_scsi_cmd\n")); - AIC_MISC(("[0x%x, %d]->%d ", (int)xs->cmd->opcode, xs->cmdlen, + AIC_MISC(("[0x%x, %d]->%d ", (int)xs->cmd->opcode, xs->cmdlen, sc->target)); flags = xs->flags; @@ -1186,7 +1186,7 @@ aic_scsi_cmd(xs) TAILQ_REMOVE(&aic->free_list, acb, chain); } } - + if (acb == NULL) { xs->error = XS_DRIVER_STUFFUP; AIC_MISC(("TRY_AGAIN_LATER")); @@ -1201,7 +1201,7 @@ aic_scsi_cmd(xs) acb->daddr = xs->data; acb->dleft = xs->datalen; acb->stat = 0; - + if (!(flags & SCSI_NOMASK)) s = splbio(); @@ -1228,7 +1228,7 @@ aic_scsi_cmd(xs) /* * Adjust transfer size in buffer structure */ -void +void aic_minphys(bp) struct buf *bp; { @@ -1240,7 +1240,7 @@ aic_minphys(bp) #ifdef __FreeBSD__ -u_int32 +u_int32 aic_adapter_info(unit) int unit; #else @@ -1310,7 +1310,7 @@ aic_poll(aic, acb) * Also peek at SSTAT0[SELDO|SELDI] to detect a passing BUSFREE condition. * No longer detect SCSI RESET or PERR here. They are tested for separately * in the interrupt handler. - * Note: If an exception occur at some critical time during the phase + * Note: If an exception occur at some critical time during the phase * determination we'll most likely return something wildly erronous.... */ static inline u_short @@ -1323,11 +1323,11 @@ aicphase(aic) { register u_short iobase = aic->iobase; register u_char sstat0, sstat1, scsisig; - + sstat1 = inb(SSTAT1); /* Look for REQINIT (REQ asserted) */ scsisig = inb(SCSISIGI); /* Get the SCSI bus signals */ sstat0 = inb(SSTAT0); /* Get the selection valid status bits */ - + if (!(inb(SSTAT0) & (SELDO|SELDI))) /* Selection became invalid? */ return PH_BUSFREE; @@ -1359,7 +1359,7 @@ aic_sched(aic) u_short iobase = aic->iobase; int t, l; u_char simode0, simode1, scsiseq; - + AIC_TRACE(("aic_sched\n")); simode0 = ENSELDI; simode1 = ENSCSIRST|ENSCSIPERR|ENREQINIT; @@ -1376,7 +1376,7 @@ aic_sched(aic) TAILQ_REMOVE(&aic->ready_list, acb, chain); aic->nexus = acb; aic->state = AIC_SELECTING; - /* + /* * Start selection process. Always enable * reselections. Note: we don't have a nexus yet, so * cannot set aic->state = AIC_HASNEXUS. @@ -1423,10 +1423,10 @@ aic_done(acb) AIC_TRACE(("aic_done ")); /* - * Now, if we've come here with no error code, i.e. we've kept the + * Now, if we've come here with no error code, i.e. we've kept the * initial XS_NOERROR, and the status code signals that we should - * check sense, we'll need to set up a request sense cmd block and - * push the command back into the ready queue *before* any other + * check sense, we'll need to set up a request sense cmd block and + * push the command back into the ready queue *before* any other * commands for this target/lunit, else we lose the sense info. * We don't support chk sense conditions for the request sense cmd. */ @@ -1457,7 +1457,7 @@ aic_done(acb) return; } } - + if (xs->flags & SCSI_ERR_OK) { xs->resid = 0; xs->error = XS_NOERROR; @@ -1467,7 +1467,7 @@ aic_done(acb) xs->resid = acb->dleft; } xs->flags |= ITSDONE; - + #if AIC_DEBUG if (aic_debug & AIC_SHOWMISC) { printf("err=0x%02x ",xs->error); @@ -1581,19 +1581,19 @@ aic_msgin(aic) register u_short iobase = aic->iobase; int spincount, extlen; u_char sstat1; - + AIC_TRACE(("aic_msgin ")); outb(SCSISIGO, PH_MSGI); /* Prepare for a new message. A message should (according to the SCSI - * standard) be transmitted in one single message_in phase. + * standard) be transmitted in one single message_in phase. * If we have been in some other phase, then this is a new message. */ if (aic->prevphase != PH_MSGI) { aic->flags &= ~AIC_DROP_MSGI; aic->imlen = 0; } - /* - * Read a whole message but the last byte. If we shall reject the + /* + * Read a whole message but the last byte. If we shall reject the * message, we shall have to do it, by asserting ATNO, during the * message transfer phase itself. */ @@ -1613,7 +1613,7 @@ aic_msgin(aic) if (!(aic->flags & AIC_DROP_MSGI)) { /* Get next message byte */ aic->imess[aic->imlen] = inb(SCSIDAT); - /* + /* * This testing is suboptimal, but most messages will * be of the one byte variety, so it should not effect * performance significantly. @@ -1642,7 +1642,7 @@ aic_msgin(aic) aic->imlen++; /* - * We expect the bytes in a multibyte message to arrive + * We expect the bytes in a multibyte message to arrive * relatively close in time, a few microseconds apart. * Therefore we will spinwait for some small amount of time * waiting for the next byte. @@ -1659,7 +1659,7 @@ aic_msgin(aic) return; } /* Now we should have a complete message (1 byte, 2 byte and moderately - * long extended messages). We only handle extended messages which + * long extended messages). We only handle extended messages which * total length is shorter than AIC_MAX_MSG_LEN. Longer messages will * be amputated. (Return XS_BOBBITT ?) */ @@ -1774,7 +1774,7 @@ aic_msgin(aic) /* Search wait queue for disconnected cmd * The list should be short, so I haven't bothered with * any more sophisticated structures than a simple - * singly linked list. + * singly linked list. */ lunit = aic->imess[0] & 0x07; for (acb = aic->nexus_list.tqh_first; acb; @@ -1821,11 +1821,11 @@ aic_msgin(aic) /* The message out (and in) stuff is a bit complicated: - * If the target requests another message (sequence) without - * having changed phase in between it really asks for a + * If the target requests another message (sequence) without + * having changed phase in between it really asks for a * retransmit, probably due to parity error(s). * The following messages can be sent: - * IDENTIFY @ These 3 stems from scsi command activity + * IDENTIFY @ These 3 stems from scsi command activity * BUS_DEV_RESET @ * IDENTIFY + SDTR @ * MESSAGE_REJECT if MSGI doesn't make sense @@ -1845,7 +1845,7 @@ aic_msgout(aic) struct acb *acb; u_char dmastat, scsisig; - /* First determine what to send. If we haven't seen a + /* First determine what to send. If we haven't seen a * phasechange this is a retransmission request. */ outb(SCSISIGO, PH_MSGO); @@ -1896,7 +1896,7 @@ aic_msgout(aic) } aic->omp = aic->omess; } else if (aic->omp == &aic->omess[aic->omlen]) { - /* Have sent the message at least once, this is a retransmit. + /* Have sent the message at least once, this is a retransmit. */ AIC_MISC(("retransmitting ")); if (aic->omlen > 1) @@ -1925,7 +1925,7 @@ aic_msgout(aic) ; } while (aic->omp != &aic->omess[aic->omlen]); aic->progress = aic->omp != aic->omess; - /* We get here in two ways: + /* We get here in two ways: * a) phase != MSGO. Target is probably going to reject our message * b) aic->omp == &aic->omess[aic->omlen], i.e. the message has been * transmitted correctly and accepted by the target. @@ -1976,7 +1976,7 @@ aic_dataout(aic) outb(SIMODE1, ENPHASEMIS|ENSCSIRST|ENBUSFREE|ENPHASECHG); /* I have tried to make the main loop as tight as possible. This - * means that some of the code following the loop is a bit more + * means that some of the code following the loop is a bit more * complex than otherwise. */ while (aic->dleft) { @@ -2045,7 +2045,7 @@ phasechange: aic->dp -= amount; AIC_MISC(("+%d ", amount)); } - + outb(DMACNTRL0, RSTFIFO|INTEN); LOGLINE(aic); while (inb(SXFRCTL0) & SCSIEN) @@ -2062,7 +2062,7 @@ phasechange: * Precondition: The SCSI bus should be in the DIN phase, with REQ asserted * and ACK deasserted (i.e. at least one byte is ready). * For now, uses a pretty dumb algorithm, hangs around until all data has been - * transferred. This, is OK for fast targets, but not so smart for slow + * transferred. This, is OK for fast targets, but not so smart for slow * targets which don't disconnect or for huge transfers. */ void @@ -2078,7 +2078,7 @@ aic_datain(aic) struct acb *acb = aic->nexus; int amount, olddleft = aic->dleft; #define DINAMOUNT 128 /* Default amount of data to transfer */ - + /* Enable DATA IN transfers */ outb(SCSISIGO, PH_DIN); outb(CLRSINT1, CLRPHASECHG); @@ -2154,7 +2154,7 @@ aic_datain(aic) aic->progress = olddleft != aic->dleft; /* Some SCSI-devices are rude enough to transfer more data than what - * was requested, e.g. 2048 bytes from a CD-ROM instead of the + * was requested, e.g. 2048 bytes from a CD-ROM instead of the * requested 512. Test for progress, i.e. real transfers. If no real * transfers have been performed (acb->dleft is probably already zero) * and the FIFO is not empty, waste some bytes.... @@ -2193,7 +2193,7 @@ aic_datain(aic) * 2) doesn't support synchronous transfers properly (yet) */ -int +int #ifdef __FreeBSD__ aicintr(int unit) #else @@ -2216,14 +2216,14 @@ aicintr(aic) LOGLINE(aic); - /* Clear INTEN. This is important if we're running with edge + /* Clear INTEN. This is important if we're running with edge * triggered interrupts as we don't guarantee that all interrupts will * be served during one single invocation of this routine, i.e. we may * need another edge. */ outb(DMACNTRL0, 0); AIC_TRACE(("aicintr\n")); - + /* * 1st check for abnormal conditions, such as reset or parity errors */ @@ -2241,18 +2241,18 @@ aicintr(aic) outb(CLRSINT1, CLRSCSIPERR); if (aic->prevphase == PH_MSGI) aic_sched_msgout(SEND_PARITY_ERROR); - else + else aic_sched_msgout(SEND_INIT_DET_ERR); } } - /* + /* * If we're not already busy doing something test for the following * conditions: * 1) We have been reselected by something * 2) We have selected something successfully * 3) Our selection process has timed out - * 4) This is really a bus free interrupt just to get a new command + * 4) This is really a bus free interrupt just to get a new command * going? * 5) Spurious interrupt? */ @@ -2270,7 +2270,7 @@ aicintr(aic) * queue. */ AIC_MISC(("reselect ")); - /* If we're trying to select a target ourselves, + /* If we're trying to select a target ourselves, * push our command back into the rdy list. */ if (aic->state == AIC_SELECTING) { @@ -2351,7 +2351,7 @@ aicintr(aic) sstat0 = inb(SSTAT0); if (sstat0 & SELDO) { /* Still selected!? */ outb(SIMODE0, 0); - outb(SIMODE1, ENSCSIRST|ENSCSIPERR| + outb(SIMODE1, ENSCSIRST|ENSCSIPERR| ENBUSFREE|ENREQINIT); aic->state = AIC_HASNEXUS; aic->flags = 0; @@ -2378,7 +2378,7 @@ aicintr(aic) return 1; } else if (sstat1 & SELTO) { /* Selection timed out. What to do: - * Disable selections out and fail the command with + * Disable selections out and fail the command with * code XS_TIMEOUT. */ acb = aic->nexus; @@ -2413,7 +2413,7 @@ aicintr(aic) } } /* Driver is now in state AIC_HASNEXUS, i.e. we have a current command - * working the SCSI bus. + * working the SCSI bus. */ acb = aic->nexus; if (aic->state != AIC_HASNEXUS || acb == NULL) { @@ -2421,7 +2421,7 @@ aicintr(aic) Debugger("aic6360"); fatal_if_no_DDB(); } - + /* What sort of transfer does the bus signal? */ aic->phase = aicphase(aic); if (!(aic->phase & PH_PSBIT)) /* not a pseudo phase */ @@ -2659,7 +2659,7 @@ aic_dump6360() printf(" SIMODE0=%x SIMODE1=%x DMACNTRL0=%x DMACNTRL1=%x DMASTAT=%x\n", inb(SIMODE0), inb(SIMODE1), inb(DMACNTRL0), inb(DMACNTRL1), inb(DMASTAT)); - printf(" FIFOSTAT=%d SCSIBUS=0x%x\n", + printf(" FIFOSTAT=%d SCSIBUS=0x%x\n", inb(FIFOSTAT), inb(SCSIBUS)); } @@ -2673,7 +2673,7 @@ aic_dump_driver() #endif struct aic_tinfo *ti; int i; - + printf("nexus=%x phase=%x prevphase=%x\n", aic->nexus, aic->phase, aic->prevphase); printf("state=%x msgin=%x msgpriq=%x msgout=%x imlen=%d omlen=%d\n", diff --git a/sys/i386/isa/aic7770.c b/sys/i386/isa/aic7770.c index 2cfb904..ce4f948 100644 --- a/sys/i386/isa/aic7770.c +++ b/sys/i386/isa/aic7770.c @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7770.c,v 1.12 1995/03/31 13:36:57 gibbs Exp $ + * $Id: aic7770.c,v 1.13 1995/04/12 20:47:36 wollman Exp $ */ #include <sys/param.h> @@ -32,16 +32,16 @@ #include <machine/cpufunc.h> #include <i386/scsi/aic7xxx.h> -int aic7770probe __P((struct isa_device *dev)); +int aic7770probe __P((struct isa_device *dev)); int aic7770_attach __P((struct isa_device *dev)); -/* +/* * Standard EISA Host ID regs (Offset from slot base) */ #define HID0 0xC80 /* 0,1: msb of ID2, 2-7: ID1 */ -#define HID1 0xC81 /* 0-4: ID3, 5-7: LSB ID2 */ -#define HID2 0xC82 /* product */ +#define HID1 0xC81 /* 0-4: ID3, 5-7: LSB ID2 */ +#define HID2 0xC82 /* product */ #define HID3 0xC83 /* firmware revision */ #define CHAR1(B1,B2) (((B1>>2) & 0x1F) | '@') @@ -78,11 +78,11 @@ aic7770_registerdev(struct isa_device *id) kdc_aic7770[id->id_unit].kdc_unit = id->id_unit; kdc_aic7770[id->id_unit].kdc_parentdata = id; dev_attach(&kdc_aic7770[id->id_unit]); -} +} int aic7770probe(struct isa_device *dev) -{ +{ u_long port; int i; u_char sig_id[4]; @@ -101,7 +101,7 @@ aic7770probe(struct isa_device *dev) port = 0x1000 * ahc_slot; for( i = 0; i < sizeof(sig_id); i++ ) { - /* + /* * An outb is required to prime these registers on * VL cards */ @@ -124,13 +124,13 @@ aic7770probe(struct isa_device *dev) #ifndef DEV_LKM aic7770_registerdev(dev); #endif /* DEV_LKM */ - if(ahcprobe(unit, port, - valid_ids[i].type)){ + if(ahcprobe(unit, port, + valid_ids[i].type)){ /* - * If it's there, put in it's + * If it's there, put in it's * interrupt vectors */ - dev->id_irq = (1 << + dev->id_irq = (1 << ahcdata[unit]->vect); dev->id_drq = -1; /* EISA dma */ ahc_unit++; diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c index 654d04d..92757f3 100644 --- a/sys/i386/isa/b004.c +++ b/sys/i386/isa/b004.c @@ -50,7 +50,7 @@ #include <sys/param.h> #include <sys/systm.h> /* for min(), SELWAIT */ -/* #include "proc.h" /* for pid_t */ +/* #include "proc.h" /* for pid_t */ /* #include "user.h" */ /* #include "buf.h" */ /* #include "kernel.h" */ @@ -76,7 +76,7 @@ static struct kern_devconf kdc_bqu[NBQU] = { { DC_CLS_MISC } }; -#define IOCTL_OUT(arg, ret) *(int*)arg = ret +#define IOCTL_OUT(arg, ret) *(int*)arg = ret #define B004PRI (PZERO+8) @@ -85,7 +85,7 @@ static struct kern_devconf kdc_bqu[NBQU] = { { /* * Define these symbols if you want to debug the code. */ -#undef B004_DEBUG +#undef B004_DEBUG #undef B004_DEBUG_2 #ifdef B004_DEBUG @@ -231,7 +231,7 @@ bquanalyse( const int dev_min ) * If the interface is still not ready, repeats as above incrementing NO. * Once almost one byte is read N0 is set to 1. * If B004_TIMEOUT != 0 and the link-interface is not ready for more than - * B004_TIMEOUT ticks read aborts returnig with the number of bytes read + * B004_TIMEOUT ticks read aborts returnig with the number of bytes read * or with an error if no byte was read. * * By default, B004_TIMEOUT is = 0 (read is blocking) @@ -277,7 +277,7 @@ bquread(dev_t dev, struct uio *uio, int flag) "push %%es\n\t" "movw %%ss, %%ax\n\t" /** prepare ES, DF for transfer */ "movw %%ax, %%es\n\t" - "cld\n\t" + "cld\n\t" "movb $1, %%ah\n\t" "1:\tinb %%dx, %%al\n\t" @@ -298,7 +298,7 @@ bquread(dev_t dev, struct uio *uio, int flag) if (inb(isr)&B004_READBYTE) *p++ =(char) inb(idr); #endif if (last!=p) { - sleep_ticks = 0; + sleep_ticks = 0; } else { /*** no new data read, must sleep ***/ sleep_ticks= (sleep_ticks<20 ? sleep_ticks+1 : sleep_ticks); @@ -371,7 +371,7 @@ bquwrite(dev_t dev, struct uio *uio, int flag) "push %%ds\n\t" "movw %%ss, %%ax\n\t" /** prepare DS, DF for transfer */ "movw %%ax, %%ds\n\t" - "cld\n\t" + "cld\n\t" "movb $1, %%ah\n\t" "movw $100, %%di\n\t" @@ -487,7 +487,7 @@ bquselect(dev_t dev, int rw, struct proc *p) * - set timeout */ -int +int bquioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p) { unsigned int dev_min = minor(dev) & 7; @@ -509,10 +509,10 @@ bquioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p) DEB(printf("B004 ioctl B004RESET, done\n" );) break; case B004WRITEABLE: /* can we write a byte to the C012 ? */ - IOCTL_OUT (addr, ((in(B004_OSR(dev_min))&B004_WRITEBYTE) != 0 )); + IOCTL_OUT (addr, ((in(B004_OSR(dev_min))&B004_WRITEBYTE) != 0 )); break; case B004READABLE: /* can we read a byte from C012 ? */ - IOCTL_OUT (addr, ((in(B004_ISR(dev_min)) & B004_READBYTE) != 0 )); + IOCTL_OUT (addr, ((in(B004_ISR(dev_min)) & B004_READBYTE) != 0 )); break; case B004ANALYSE: /* switch transputer to analyse mode */ bquanalyse(dev_min); diff --git a/sys/i386/isa/b004.h b/sys/i386/isa/b004.h index 8c82eda..ee80d46 100644 --- a/sys/i386/isa/b004.h +++ b/sys/i386/isa/b004.h @@ -46,22 +46,22 @@ /* * device status FLAGS */ -#define B004_EXIST 0x0001 /* Is a B004-Board with at least one +#define B004_EXIST 0x0001 /* Is a B004-Board with at least one Transputer present ? */ #define B004_BUSY 0x0002 /* Is the B004-board in use ? */ /* * IOCTL numbers */ -#define B004RESET _IO ('Q', 0) +#define B004RESET _IO ('Q', 0) /* Reset transputer(s) */ -#define B004WRITEABLE _IOR ('Q', 1, int) +#define B004WRITEABLE _IOR ('Q', 1, int) /* Return C012 Output Ready */ -#define B004READABLE _IOR ('Q', 2, int) +#define B004READABLE _IOR ('Q', 2, int) /* Return C012 Data Present */ -#define B004ANALYSE _IO ('Q', 3) +#define B004ANALYSE _IO ('Q', 3) /* Switch transputer(s) to ANALYSE mode */ -#define B004ERROR _IOR ('Q', 4, int) +#define B004ERROR _IOR ('Q', 4, int) /* Return 1 on ERROR set */ #define B004TIMEOUT _IOW ('Q', 5, int) /* Set TIMEOUT for subsequent writing or diff --git a/sys/i386/isa/bt742a.c b/sys/i386/isa/bt742a.c index b2fed05..cda418b 100644 --- a/sys/i386/isa/bt742a.c +++ b/sys/i386/isa/bt742a.c @@ -12,13 +12,13 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: bt742a.c,v 1.34 1995/04/23 21:58:35 gibbs Exp $ + * $Id: bt742a.c,v 1.35 1995/05/11 19:26:16 rgrimes Exp $ */ /* * Bulogic/Bustek 32 bit Addressing Mode SCSI driver. * - * NOTE: 1. Some bt5xx card can NOT handle 32 bit addressing mode. + * NOTE: 1. Some bt5xx card can NOT handle 32 bit addressing mode. * 2. OLD bt445s Revision A,B,C,D(nowired) + any firmware version * has broken busmaster for handling 32 bit addressing on H/W bus * side. @@ -599,7 +599,7 @@ bt_cmd(unit, icnt, ocnt, wait, retval, opcode, args) } if (i == 0) { if(!btprobing) - printf("bt%d: bt_cmd, host not finished(0x%x)\n", + printf("bt%d: bt_cmd, host not finished(0x%x)\n", unit, sts); return (ENXIO); } @@ -693,7 +693,7 @@ btattach(dev) { int unit = dev->id_unit; struct bt_data *bt = btdata[unit]; - + btprobing = 0; /* * fill in the prototype scsi_link. @@ -717,7 +717,7 @@ btattach(dev) * Return some information to the caller about the adapter and its * capabilities. */ -u_int32 +u_int32 bt_adapter_info(unit) int unit; { @@ -745,7 +745,7 @@ btintr(unit) /* * First acknowlege the interrupt, Then if it's * not telling about a completed operation - * just return. + * just return. */ stat = inb(BT_INTR_PORT); @@ -824,7 +824,7 @@ btintr(unit) ,wmbi->stat, wmbi); printf("addr = 0x%x\n", ccb); } -#endif +#endif } wmbi->stat = BT_MBI_FREE; if (ccb) { @@ -885,7 +885,7 @@ bt_free_ccb(unit, ccb, flags) } /* - * Get a free ccb + * Get a free ccb * * If there are none, see if we can allocate a new one. If so, put it in * the hash table too otherwise either return an error or sleep. @@ -968,7 +968,7 @@ bt_ccb_phys_kv(bt, ccb_phys) } /* - * Get a MBO and then Send it + * Get a MBO and then Send it */ BT_MBO * bt_send_mbo(int unit, int flags, int cmd, struct bt_ccb *ccb) @@ -988,7 +988,7 @@ bt_send_mbo(int unit, int flags, int cmd, struct bt_ccb *ccb) wmbx->tmbo = (wmbo == &(wmbx->mbo[BT_MBX_SIZE - 1]) ? &(wmbx->mbo[0]) : wmbo + 1); - /* + /* * Check the outmail box is free or not. * Note: Under the normal operation, it shuld NOT happen to wait. */ @@ -1102,7 +1102,7 @@ bt_init(unit) struct bt_board_info binfo; /* - * reset board, If it doesn't respond, assume + * reset board, If it doesn't respond, assume * that it's not there.. good for the probe */ @@ -1131,7 +1131,7 @@ bt_init(unit) */ i = bt_cmd(unit, 1, sizeof(binfo),0, &binfo,BT_GET_BOARD_INFO,sizeof(binfo)); - if(i) + if(i) return i; printf("bt%d: Bt%c%c%c%c/%c%d-", unit, binfo.id[0], @@ -1152,10 +1152,10 @@ bt_init(unit) switch (info.bus_type) { case BT_BUS_TYPE_24bit: /* PC/AT 24 bit address bus */ printf("ISA(24bit) bus\n"); - break; + break; case BT_BUS_TYPE_32bit: /* EISA/VLB/PCI 32 bit bus */ printf("PCI/EISA/VLB(32bit) bus\n"); - break; + break; case BT_BUS_TYPE_MCA: /* forget it right now */ printf("MCA bus architecture..."); printf("giving up\n"); @@ -1170,7 +1170,7 @@ bt_init(unit) if ( binfo.id[0] == '5' ) { printf("bt%d: This driver is designed for using 32 bit addressing\n",unit); printf("bt%d: mode firmware and EISA/PCI/VLB bus architectures\n",unit); - printf("bt%d: Bounce-buffering will be used (and is necessary)\n", unit); + printf("bt%d: Bounce-buffering will be used (and is necessary)\n", unit); printf("bt%d: if you have more than 16MBytes memory.\n",unit); } else if ( info.bus_type == BT_BUS_TYPE_24bit ) { printf("bt%d: Your board should report a 32bit bus architecture type..\n",unit); @@ -1247,7 +1247,7 @@ bt_init(unit) /* who are we on the scsi bus */ bt->bt_scsi_dev = conf.scsi_dev; /* - * Initialize mail box + * Initialize mail box */ *((physaddr *) ad) = KVTOPHYS(&bt->bt_mbx); bt_cmd(unit, 5, 0, 0, 0, BT_MBX_INIT_EXTENDED @@ -1307,7 +1307,7 @@ bt_inquire_setup_information( * Get a SCSI Synchronous value */ if ( info->s.sync ) { - bt_cmd(unit, 1, sizeof(sync), 100, + bt_cmd(unit, 1, sizeof(sync), 100, &sync,BT_GET_SYNC_VALUE,sizeof(sync)); } @@ -1359,7 +1359,7 @@ bt_inquire_setup_information( /* * Displayi SCSI negotiation value by each target. - * amurai@spec.co.jp + * amurai@spec.co.jp */ for (i = 0; i < 8; i++) { if (!setup.sync[i].valid ) @@ -1377,9 +1377,9 @@ bt_inquire_setup_information( } } - /* + /* * Enable round-robin scheme - appeared at firmware rev. 3.31 - * Below rev 3.XX firmware has a problem for issuing + * Below rev 3.XX firmware has a problem for issuing * BT_ROUND_ROBIN command amurai@spec.co.jp */ if ( bID.firm_revision >= '3' ) { @@ -1395,7 +1395,7 @@ bt_inquire_setup_information( #define min(x,y) (x < y ? x : y) #endif /* min */ -void +void btminphys(bp) struct buf *bp; { @@ -1408,7 +1408,7 @@ btminphys(bp) * start a scsi operation given the command and the data address. Also needs * the unit, target and lu. */ -int32 +int32 bt_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -1512,8 +1512,8 @@ bt_scsi_cmd(xs) nextphys = thisphys; while ((datalen) && (thisphys == nextphys)) /* - * This page is contiguous (physically) with - * the the last, just extend the length + * This page is contiguous (physically) with + * the the last, just extend the length */ { /* how far to the end of the page */ @@ -1589,7 +1589,7 @@ bt_scsi_cmd(xs) /* * Poll a particular unit, looking for a particular xs */ -int +int bt_poll(unit, xs, ccb) int unit; struct scsi_xfer *xs; @@ -1700,7 +1700,7 @@ bt_timeout(void *arg1) ccb->xfer->retries = 0; /* I MEAN IT ! */ ccb->host_stat = BT_ABORTED; bt_done(unit, ccb); - } else { + } else { /* abort the operation that has timed out */ printf("bt%d: Try to abort\n", unit); bt_send_mbo(unit, ~SCSI_NOMASK, diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 196d34c..e1bc372 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.32 1995/03/16 18:11:58 bde Exp $ + * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ */ /* @@ -193,7 +193,7 @@ int acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) { if (timer0_state || TIMER_DIV(rate) < TIMER0_MIN_MAX_COUNT || - !function) + !function) return -1; new_function = function; new_rate = rate; @@ -204,7 +204,7 @@ acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) int acquire_timer2(int mode) { - if (timer2_state) + if (timer2_state) return -1; timer2_state = 1; outb(TIMER_MODE, TIMER_SEL2 | (mode &0x3f)); @@ -265,7 +265,7 @@ printrtc(void) #endif static int -getit() +getit() { int high, low; @@ -307,7 +307,7 @@ calibrate_cyclecounter(void) /* * Wait "n" microseconds. - * Relies on timer 1 counting down from (TIMER_FREQ / hz) + * Relies on timer 1 counting down from (TIMER_FREQ / hz) * Note: timer had better have been programmed before this is first used! */ void @@ -339,7 +339,7 @@ DELAY(int n) prev_tick = getit(0, 0); n -= 20; /* - * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point + * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point * and without any avoidable overflows. */ sec = n / 1000000; @@ -375,11 +375,11 @@ sysbeepstop(void *chan) beeping = 0; } -int +int sysbeep(int pitch, int period) { - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) return -1; disable_intr(); outb(TIMER_CNTR2, pitch); @@ -426,7 +426,7 @@ readrtc(int port) * XXX initialization of other timers is unintentionally left blank. */ void -startrtclock() +startrtclock() { timer0_max_count = hardclock_max_count = TIMER_DIV(hz); timer0_overflow_threshold = timer0_max_count - TIMER0_LATCH_COUNT; diff --git a/sys/i386/isa/cronyx.c b/sys/i386/isa/cronyx.c index 941daf9..391376e 100644 --- a/sys/i386/isa/cronyx.c +++ b/sys/i386/isa/cronyx.c @@ -223,7 +223,7 @@ static int cx_probe_chip (int base) newrev = inb (GFRCR(base)); if (newrev != rev) return (0); /* revision changed */ - + /* Yes, we really have CD2400 chip here. */ return (1); } @@ -872,7 +872,7 @@ void cx_clock (long hz, long ba, int *clk, int *div) } } /* Incorrect baud rate. Return some meaningful values. */ - *clk = 0; + *clk = 0; *div = 255; } @@ -889,7 +889,7 @@ cx_chan_opt_t chan_opt_dflt = { /* mode-independent options */ 0, /* don't detect 1 to 0 on CTS */ 1, /* detect 1 to 0 on CD */ 0, /* detect 1 to 0 on DSR */ - }, + }, { /* cor5 */ 0, /* receive flow control FIFO threshold */ 0, @@ -920,7 +920,7 @@ cx_opt_async_t opt_async_dflt = { /* default async options */ 0, /* don't ignore parity */ PARM_NOPAR, /* no parity */ PAR_EVEN, /* even parity */ - }, + }, { /* cor2 */ 0, /* disable automatic DSR */ 1, /* enable automatic CTS */ @@ -930,7 +930,7 @@ cx_opt_async_t opt_async_dflt = { /* default async options */ 0, /* disable embedded cmds */ 0, /* disable XON/XOFF */ 0, /* disable XANY */ - }, + }, { /* cor3 */ STOPB_1, /* 1 stop bit */ 0, @@ -992,7 +992,7 @@ cx_opt_bisync_t opt_bisync_dflt = { /* default bisync options */ 0, /* don't ignore parity */ PARM_NOPAR, /* no parity */ PAR_EVEN, /* even parity */ - }, + }, { /* cor2 */ 3-2, /* send three SYN chars */ CRC_DONT_INVERT,/* don't invert CRC (CRC-16) */ @@ -1020,7 +1020,7 @@ cx_opt_x21_t opt_x21_dflt = { /* default x21 options */ 0, /* don't ignore parity */ PARM_NOPAR, /* no parity */ PAR_EVEN, /* even parity */ - }, + }, { /* cor2 */ 0, 0, /* disable embedded transmitter cmds */ diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c index 3c7f1f3..1124471 100644 --- a/sys/i386/isa/ctx.c +++ b/sys/i386/isa/ctx.c @@ -8,7 +8,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: ctx.c,v 1.4 1994/10/23 21:27:11 wollman Exp $ + * $Id: ctx.c,v 1.5 1995/04/12 20:47:40 wollman Exp $ */ /* @@ -59,7 +59,7 @@ * the benefits to me are great (I need more than one board * in my machine, and 0xE0000 is the only address choice that * doesn't conflict with anything) so I adopt this strategy here. - * + * * XXX-Note... this driver has only been tested for the * XXX base = 0xE0000 case! * @@ -175,7 +175,7 @@ ctx_registerdev(struct isa_device *id) dev_attach(&kdc_ctx[id->id_unit]); } -int +int ctxprobe(struct isa_device * devp) { int status; @@ -189,7 +189,7 @@ ctxprobe(struct isa_device * devp) return (status); } -int +int ctxattach(struct isa_device * devp) { struct ctx_soft_registers *sr; @@ -205,7 +205,7 @@ ctxattach(struct isa_device * devp) return (1); } -int +int ctxopen(dev_t dev, int flag) { struct ctx_soft_registers *sr; @@ -261,7 +261,7 @@ ctxopen(dev_t dev, int flag) return (0); /* successful open. All ready to go. */ } -int +int ctxclose(dev_t dev, int flag) { int unit; @@ -274,7 +274,7 @@ ctxclose(dev_t dev, int flag) return (0); } -int +int ctxwrite(dev_t dev, struct uio * uio) { int unit, status = 0; @@ -319,7 +319,7 @@ ctxwrite(dev_t dev, struct uio * uio) return (status); } -int +int ctxread(dev_t dev, struct uio * uio) { int unit, status = 0; @@ -362,7 +362,7 @@ ctxread(dev_t dev, struct uio * uio) return (status); } -int +int ctxioctl(dev_t dev, int cmd, caddr_t data, int flag) { int error; @@ -425,7 +425,7 @@ ctxioctl(dev_t dev, int cmd, caddr_t data, int flag) return (error); } -int +int waitvb(short port) { /* wait for a vertical blank, */ if (inb(port) == 0xff) /* 0xff means no board present */ diff --git a/sys/i386/isa/ctxreg.h b/sys/i386/isa/ctxreg.h index 28b644a..043bb15 100644 --- a/sys/i386/isa/ctxreg.h +++ b/sys/i386/isa/ctxreg.h @@ -1,13 +1,13 @@ /* * - * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, - * modified, copied, distributed, and sold, in both source and binary form - * provided that the above copyright and these terms are retained. Under + * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, + * modified, copied, distributed, and sold, in both source and binary form + * provided that the above copyright and these terms are retained. Under * no circumstances is the author responsible for the proper functioning * of this software, nor does the author assume any responsibility * for damages incurred with its use * - * $Id$ + * $Id: ctxreg.h,v 1.1 1994/10/01 17:59:42 davidg Exp $ */ /* diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c index c075baa..c66f645 100644 --- a/sys/i386/isa/cx.c +++ b/sys/i386/isa/cx.c @@ -93,7 +93,7 @@ int cxopen (dev_t dev, int flag, int mode, struct proc *p) unsigned short port; struct tty *tp; int error = 0; - + if (unit == UNIT_CTL) { print (("cx: cxopen /dev/cronyx\n")); return (0); @@ -226,7 +226,7 @@ int cxclose (dev_t dev, int flag, int mode, struct proc *p) cx_chan_t *c = cxchan[unit]; struct tty *tp; int s; - + if (unit == UNIT_CTL) return (0); tp = c->ttyp; @@ -260,18 +260,18 @@ int cxread (dev_t dev, struct uio *uio, int flag) { int unit = UNIT (dev); struct tty *tp; - + if (unit == UNIT_CTL) return (EIO); tp = cxchan[unit]->ttyp; return ((*linesw[tp->t_line].l_read) (tp, uio, flag)); } - + int cxwrite (dev_t dev, struct uio *uio, int flag) { int unit = UNIT (dev); struct tty *tp; - + if (unit == UNIT_CTL) return (EIO); tp = cxchan[unit]->ttyp; @@ -569,7 +569,7 @@ int cxparam (struct tty *tp, struct termios *t) unsigned short port = c->chip->port; int clock, period, s; cx_cor1_async_t cor1; - + if (t->c_ospeed == 0) { /* Clear DTR and RTS. */ s = spltty (); @@ -684,7 +684,7 @@ struct tty *cxdevtotty (dev_t dev) return (cxchan[unit]->ttyp); } - + int cxselect (dev_t dev, int flag, struct proc *p) { int unit = UNIT (dev); diff --git a/sys/i386/isa/cxreg.h b/sys/i386/isa/cxreg.h index 491c7fb..df1f743 100644 --- a/sys/i386/isa/cxreg.h +++ b/sys/i386/isa/cxreg.h @@ -29,7 +29,7 @@ #define BCR1(p) ((p) | 0x2000) /* board command register 1, write only */ /* - * Chip register address, B is chip base port, R is chip register number. + * Chip register address, B is chip base port, R is chip register number. */ #define R(b,r) ((b) | (((r)<<6 & 0x3c00) | ((r) & 0xf))) diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index a37292e..fd898f2 100644 --- a/sys/i386/isa/cy.c +++ b/sys/i386/isa/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.5 1995/03/28 07:55:25 bde Exp $ + * $Id: cy.c,v 1.6 1995/03/28 12:29:11 bde Exp $ */ /* @@ -99,7 +99,7 @@ #define PollMode /* use polling-based irq service routine, not the * hardware svcack lines. Must be defined for * cyclom-16y boards. - * + * * XXX cyclom-8y doesn't work without this defined * either (!) */ @@ -172,7 +172,7 @@ void delay(int delay); /* Better get rid of this until the core people agree on kernel interfaces. At least it will then compile on both WhichBSDs. - */ + */ #if 0 extern unsigned int delaycount; /* calibrated 1 ms cpu-spin delay */ #endif @@ -546,7 +546,7 @@ service_upper_rx(int unit) #ifdef FastRawInput /* try to avoid calling the line discipline stuff if we can */ if ((tp->t_line == 0) && - !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && + !(tp->t_iflag & (ICRNL | IMAXBEL | INLCR)) && !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG | PENDIN)) && !(tp->t_state & (TS_CNTTB | TS_LNCH))) { @@ -1321,11 +1321,11 @@ cyparam(struct tty *tp, struct termios *t) if (iflag & IXOFF) opt |= 1 << 6; /* auto XOFF output flow-control */ #endif -#ifndef ALWAYS_RTS_CTS +#ifndef ALWAYS_RTS_CTS if (cflag & CCTS_OFLOW) #endif opt |= 1 << 1; /* auto CTS flow-control */ - + if (opt != infop->cor[1]) { cor_change |= 1 << 2; *(base + CD1400_COR2) = opt; @@ -1560,7 +1560,7 @@ cyspeed(int speed, int *prescaler_io) static void cd1400_channel_cmd(cy_addr base, u_char cmd) { - /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, + /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed, as the card is probed every round? Replaced delaycount with 8k. Either delaycount has to be implemented in FreeBSD or more sensible way of doing these should be implemented. DELAY isn't enough here. @@ -1570,7 +1570,7 @@ cd1400_channel_cmd(cy_addr base, u_char cmd) /* wait for processing of previous command to complete */ while (*(base + CD1400_CCR) && maxwait--) ; - + if (!maxwait) log(LOG_ERR, "cy: channel command timeout (%d loops) - arrgh\n", 5 * 8 * 1024); diff --git a/sys/i386/isa/elink.c b/sys/i386/isa/elink.c index 4bf0016..07b2516 100644 --- a/sys/i386/isa/elink.c +++ b/sys/i386/isa/elink.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: elink.c,v 1.3 1994/09/17 16:51:47 se Exp $ + * $Id: elink.c,v 1.4 1995/02/26 05:14:46 bde Exp $ */ /* @@ -47,7 +47,7 @@ */ void elink_reset() -{ +{ static int x = 0; if (x == 0) { diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index 49d7fdc..be36035 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.59 1995/05/06 19:34:25 joerg Exp $ + * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ * */ @@ -370,7 +370,7 @@ fdc_err(fdcu_t fdcu, const char *s) else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX) printf("fdc%d: too many errors, not logging any more\n", fdcu); - + return FD_FAILED; } @@ -378,7 +378,7 @@ fdc_err(fdcu_t fdcu, const char *s) * fd_cmd: Send a command to the chip. Takes a varargs with this structure: * Unit number, * # of output bytes, output bytes as ints ..., - * # of input bytes, input bytes as ints ... + * # of input bytes, input bytes as ints ... */ int @@ -604,7 +604,7 @@ fdattach(struct isa_device *dev) unithasfd = 1; if (ftattach(dev, fdup, unithasfd)) continue; - if (fdsu < DRVS_PER_CTLR) + if (fdsu < DRVS_PER_CTLR) fd->type = NO_TYPE; #endif continue; @@ -683,9 +683,9 @@ fdattach(struct isa_device *dev) break; /* already probed succesfully */ } } - + set_motor(fdcu, fdsu, TURNOFF); - + if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */ continue; @@ -694,13 +694,13 @@ fdattach(struct isa_device *dev) fd->fdsu = fdsu; fd->options = 0; printf("fd%d: ", fdu); - + fd_registerdev(fdcu, fdu); switch (fdt) { case RTCFDT_12M: printf("1.2MB 5.25in\n"); fd->type = FD_1200; - kdc_fd[fdu].kdc_description = + kdc_fd[fdu].kdc_description = "1.2MB (1200K) 5.25in floppy disk drive"; #ifdef DEVFS sprintf(name,"fd%d.1200",fdu); @@ -787,9 +787,9 @@ set_motor(fdcu_t fdcu, int fdsu, int turnon) { int fdout = fdc_data[fdcu].fdout; int needspecify = 0; - + if(turnon) { - fdout &= ~FDO_FDSEL; + fdout &= ~FDO_FDSEL; fdout |= (FDO_MOEN0 << fdsu) + fdsu; } else fdout &= ~(FDO_MOEN0 << fdsu); @@ -856,7 +856,7 @@ fd_motor_on(void *arg1) } static void -fd_turnon(fdu_t fdu) +fd_turnon(fdu_t fdu) { fd_p fd = fd_data + fdu; if(!(fd->flags & FD_MOTOR)) @@ -871,7 +871,7 @@ static void fdc_reset(fdc_p fdc) { fdcu_t fdcu = fdc->fdcu; - + /* Try a reset, keep motor on */ outb(fdc->baseport + FDOUT, fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); TRACE1("[0x%x->FDOUT]", fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); @@ -978,7 +978,7 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p) return(ftopen(dev, flags)); #endif /* check bounds */ - if (fdu >= NFD) + if (fdu >= NFD) return(ENXIO); fdc = fd_data[fdu].fdc; if ((fdc == NULL) || (fd_data[fdu].type == NO_TYPE)) @@ -1093,7 +1093,7 @@ fdstrategy(struct buf *bp) if (fdc->flags & FDC_TAPE_BUSY) { bp->b_error = EBUSY; bp->b_flags |= B_ERROR; - goto bad; + goto bad; } #endif if (!(bp->b_flags & B_FORMAT)) { @@ -1111,7 +1111,7 @@ fdstrategy(struct buf *bp) goto bad; } } - + /* * Set up block calculations. */ @@ -1262,7 +1262,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) dp = &(fdc->head); bp = dp->b_actf; - if(!bp) + if(!bp) { /***********************************************\ * nothing left for this controller to do * @@ -1469,7 +1469,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) if(format) { /* formatting */ - if(fd_cmd(fdcu, 6, + if(fd_cmd(fdcu, 6, NE7CMD_FORMAT, head << 2 | fdu, finfo->fd_formb_secshift, @@ -1482,7 +1482,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) fdc->retry = 6; return(retrier(fdcu)); } - } + } else { if (fd_cmd(fdcu, 9, @@ -1761,7 +1761,7 @@ fdformat(dev, finfo, p) bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; bp->b_un.b_addr = (caddr_t)finfo; - + /* now do the format */ fdstrategy(bp); @@ -1774,7 +1774,7 @@ fdformat(dev, finfo, p) break; } splx(s); - + if(rv == EWOULDBLOCK) { /* timed out */ rv = EIO; @@ -1890,7 +1890,7 @@ fdioctl(dev, cmd, addr, flag, p) case FD_GOPTS: /* get drive options */ *(int *)addr = fd_data[FDUNIT(minor(dev))].options; break; - + case FD_SOPTS: /* set drive options */ fd_data[FDUNIT(minor(dev))].options = *(int *)addr; break; diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c index f1dd370..a56a84f 100644 --- a/sys/i386/isa/ft.c +++ b/sys/i386/isa/ft.c @@ -17,7 +17,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * ft.c - QIC-40/80 floppy tape driver - * $Id: ft.c,v 1.20 1995/04/12 20:47:43 wollman Exp $ + * $Id: ft.c,v 1.21 1995/05/06 19:34:28 joerg Exp $ * * 01/19/95 ++sg * Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x. @@ -34,9 +34,9 @@ * Got rid of the hard coded device selection. Moved (some of) the * static variables into a structure for support of multiple devices. * ( still has a way to go for 2 controllers - but closer ) - * Changed the interface with fd.c so we no longer 'steal' it's + * Changed the interface with fd.c so we no longer 'steal' it's * driver routine vectors. - * + * * 10/30/93 v0.3 * Fixed a couple more bugs. Reading was sometimes looping when an * an error such as address-mark-missing was encountered. Both @@ -92,7 +92,7 @@ /* Enable or disable debugging messages. */ #define FTDBGALL 0 /* 1 if you want everything */ /*#define DPRT(a) printf a */ -#define DPRT(a) +#define DPRT(a) /* Constants private to the driver */ #define FTPRI (PRIBIO) /* sleep priority */ @@ -401,7 +401,7 @@ segio_free(ft_p ft, SegReq *sp) DPRT(("segio_free: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq)); } -static int ft_externalize(struct proc *, struct kern_devconf *, void *, +static int ft_externalize(struct proc *, struct kern_devconf *, void *, size_t); extern struct kern_devconf kdc_fdc[]; @@ -503,7 +503,7 @@ ftattach(isadev, fdup, unithasfd) * enabled and therefore risks attached floppy disk drives to jam. * Probe only if explicitly requested by a flag 0x1 from config */ - + /* * FT_INSIGHT - insight style * @@ -519,7 +519,7 @@ ftattach(isadev, fdup, unithasfd) goto out; } } - + out: tape_end(ftu); if (ft->type != NO_TYPE) { @@ -697,7 +697,7 @@ restate: } else { DPRT(("ft%d: async_status failed: retval=$%04x nbits=%d\n", ftu, retval,nbits)); - async_ret = -2; + async_ret = -2; } goto complete; } @@ -1335,7 +1335,7 @@ restate: /* * Retries failed. Note the unrecoverable error. * Marking the block as bad is useless right now. - */ + */ printf("ft%d: unrecoverable write error on block %d\n", ftu, ft->xblk); ft->segh->reqcrc |= (1 << ft->xcnt); @@ -1756,7 +1756,7 @@ tape_end(ftu_t ftu) /* set transfer speed */ outb(fdc->baseport+FDCTL, FDC_500KBPS); DELAY(10); - fdc->flags &= ~FDC_TAPE_BUSY; + fdc->flags &= ~FDC_TAPE_BUSY; DPRT(("tape_end end\n")); } @@ -1905,7 +1905,7 @@ set_fdcmode(dev_t dev, int newmode) /* Wake up the tape drive */ switch (ft->type) { case NO_TYPE: - fdc->flags &= ~FDC_TAPE_BUSY; + fdc->flags &= ~FDC_TAPE_BUSY; return(ENXIO); case FT_NONE: tape_start(ftu, 0); @@ -2089,19 +2089,19 @@ ftopen(dev_t dev, int arg2) { fdc_p fdc; /* check bounds */ - if (ftu >= NFT) + if (ftu >= NFT) return(ENXIO); fdc = ft_data[ftu].fdc; if ((fdc == NULL) || (ft_data[ftu].type == NO_TYPE)) return(ENXIO); /* check for controller already busy with tape */ if (fdc->flags & FDC_TAPE_BUSY) - return(EBUSY); + return(EBUSY); /* make sure we found a tape when probed */ if (!(fdc->flags & FDC_HASFTAPE)) return(ENODEV); fdc->fdu = ftu; - fdc->flags |= FDC_TAPE_BUSY; + fdc->flags |= FDC_TAPE_BUSY; kdc_ft[ftu].kdc_state = DC_BUSY; return(set_fdcmode(dev, FDC_TAPE_MODE)); /* try to switch to tape */ } @@ -2541,7 +2541,7 @@ ftreq_hdr(ftu_t ftu, int cmd, QIC_Segment *sp) if (h->qh_sig != QCV_HDRMAGIC) return(EIO); copyout(ft->hdr->buff, sp->sg_data, QCV_SEGSIZE); } - return(0); + return(0); } /* diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c index 34e83bb..5d1d1a2 100644 --- a/sys/i386/isa/gpib.c +++ b/sys/i386/isa/gpib.c @@ -2,10 +2,10 @@ /* * GPIB driver for FreeBSD. * Version 0.1 (No interrupts, no DMA) - * Supports National Instruments AT-GPIB and AT-GPIB/TNT boards. + * Supports National Instruments AT-GPIB and AT-GPIB/TNT boards. * (AT-GPIB not tested, but it should work) - * - * Written by Fred Cawthorne (fcawth@delphi.umd.edu) + * + * Written by Fred Cawthorne (fcawth@delphi.umd.edu) * Some sections were based partly on the lpt driver. * (some remnants may remain) * @@ -22,7 +22,7 @@ #include "gp.h" -#if NGP > 0 +#if NGP > 0 #include "param.h" #include "buf.h" @@ -44,9 +44,9 @@ #define MIN(a,b) ((a < b) ? a : b) -#define GPIBPRI (PZERO+8)|PCATCH +#define GPIBPRI (PZERO+8)|PCATCH #define SLEEP_MAX 1000 -#define SLEEP_MIN 4 +#define SLEEP_MIN 4 int initgpib(void); void closegpib(void); @@ -73,7 +73,7 @@ struct isa_driver gpdriver = {gpprobe, gpattach, "gp"}; #define BUFSIZE 1024 #define ATTACHED 0x08 #define OPEN 0x04 -#define INIT 0x02 +#define INIT 0x02 static struct gpib_softc { @@ -81,7 +81,7 @@ static struct gpib_softc { int sc_count; /* bytes queued in sc_inbuf */ int sc_type; /* Type of gpib controller */ u_char sc_flags; /* flags (open and internal) */ - char sc_unit; /* gpib device number */ + char sc_unit; /* gpib device number */ char *sc_inbuf; /* buffer for data */ } gpib_sc; static int oldcount; @@ -112,7 +112,7 @@ else if ((inb(KSR)&0xF7)==0x14) sc->sc_type=1; /* * gpattach() - * Attach device and print the type of card to the screen. + * Attach device and print the type of card to the screen. */ int gpattach(isdp) @@ -121,13 +121,13 @@ gpattach(isdp) struct gpib_softc *sc = &gpib_sc; sc->sc_unit = isdp->id_unit; - if (sc->sc_type==3) - printf ("gp%d: type AT-GPIB/TNT\n",sc->sc_unit); + if (sc->sc_type==3) + printf ("gp%d: type AT-GPIB/TNT\n",sc->sc_unit); if (sc->sc_type==2) - printf ("gp%d: type AT-GPIB chip NAT4882B\n",sc->sc_unit); + printf ("gp%d: type AT-GPIB chip NAT4882B\n",sc->sc_unit); if (sc->sc_type==1) - printf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit); - sc->sc_flags |=ATTACHED; + printf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit); + sc->sc_flags |=ATTACHED; return (1); } @@ -149,7 +149,7 @@ gpopen(dev, flag) u_char sta, unit; int status; int counter; - + unit= minor(dev); /* minor number out of limits ? */ @@ -170,8 +170,8 @@ gpopen(dev, flag) sc->sc_inbuf = malloc(BUFSIZE, M_DEVBUF, M_WAITOK); if (sc->sc_inbuf == 0) return(ENOMEM); - - if (initgpib()) return(EBUSY); + + if (initgpib()) return(EBUSY); sc->sc_flags |= OPEN; sc->sc_count = 0; oldcount=0; @@ -215,13 +215,13 @@ enableremote(unit); /* * gpclose() - * Close gpib device. + * Close gpib device. */ int gpclose(dev, flag) dev_t dev; int flag; - + { struct gpib_softc *sc = &gpib_sc; unsigned char unit; @@ -241,7 +241,7 @@ if (unit!=0) { /*Here we need to send the last character with EOS*/ while ((inb(ISR3)&0x04)&&status==EWOULDBLOCK); /*Fifo is not empty*/ outb(CMDR,0x08); /*Issue STOP to TURBO488*/ - + /*Wait for DONE and STOP*/ if (status==EWOULDBLOCK) do { status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); @@ -256,7 +256,7 @@ if (unit!=0) { /*Here we need to send the last character with EOS*/ /*Send last byte with EOI set*/ /*Send second to last byte if there are 2 bytes left*/ -if (status==EWOULDBLOCK) { +if (status==EWOULDBLOCK) { do if (!(inb(ISR1)&2)) status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); @@ -265,19 +265,19 @@ if (oldcount==2){ outb(CDOR,oldbytes[0]); /*Send second to last byte*/ while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); - } + } outb(AUXMR,seoi); /*Set EOI for the last byte*/ outb(AUXMR,0x5E); /*Clear SYNC*/ if (oldcount==1) outb(CDOR,oldbytes[0]); - else + else if (oldcount==2) outb(CDOR,oldbytes[1]); else { outb (CDOR,13); /*Send a CR.. we've got trouble*/ printf("gpib: Warning: gpclose called with nothing left in buffer\n"); - } + } } do @@ -330,8 +330,8 @@ gpwrite(dev, uio) while ((gpib_sc.sc_count = MIN(BUFSIZE-1, uio->uio_resid)) > 0) { /* If there were >1 bytes left over, send them */ if (oldcount==2) - sendrawgpibfifo(minor(dev),oldbytes,2); - + sendrawgpibfifo(minor(dev),oldbytes,2); + /*If there was 1 character left, put it at the beginning of the new buffer*/ if (oldcount==1){ @@ -339,7 +339,7 @@ gpwrite(dev, uio) gpib_sc.sc_cp = gpib_sc.sc_inbuf; /* get from user-space */ uiomove(gpib_sc.sc_inbuf+1, gpib_sc.sc_count, uio); - gpib_sc.sc_count++; + gpib_sc.sc_count++; } else { gpib_sc.sc_cp = gpib_sc.sc_inbuf; @@ -348,7 +348,7 @@ gpwrite(dev, uio) } /*NOTE we always leave one byte in case this is the last write - so close can send EOI with the last byte There may be 2 bytes + so close can send EOI with the last byte There may be 2 bytes since we are doing 16 bit transfers.(note the -1 in the count below)*/ /*If count<=2 we'll either pick it up on the next write or on close*/ if (gpib_sc.sc_count>2) { @@ -357,12 +357,12 @@ gpwrite(dev, uio) if (err) return(1); oldcount=gpib_sc.sc_count-count; /*Set # of remaining bytes*/ - gpib_sc.sc_count-=count; + gpib_sc.sc_count-=count; gpib_sc.sc_cp+=count; /*point char pointer to remaining bytes*/ } else oldcount=gpib_sc.sc_count; oldbytes[0]=gpib_sc.sc_cp[0]; - if (oldcount==2) + if (oldcount==2) oldbytes[1]=gpib_sc.sc_cp[1]; } return(0); @@ -384,7 +384,7 @@ gpioctl(dev_t dev, int cmd, struct gpibdata *gd) break; case GPIBREAD: result=readgpibfifo(gd->address,gd->data,*(gd->count)); - *(gd->count)=result; + *(gd->count)=result; error=0; break; case GPIBINIT: @@ -490,11 +490,11 @@ int initgpib() { outb(EOSR,10); /*set EOS message to newline*/ /*should I make the default to interpret END as EOS?*/ - /*It isn't now. The following changes this*/ + /*It isn't now. The following changes this*/ outb(AUXMR,0x80); /*No special EOS handling*/ /*outb(AUXMR,0x88) */ /* Transmit END with EOS*/ /*outb(AUXMR,0x84) */ /* Set END on EOS received*/ - /*outb(AUXMR,0x8C) */ /* Do both of the above*/ + /*outb(AUXMR,0x8C) */ /* Do both of the above*/ /* outb(AUXMR,hldi); */ /*Perform RFD Holdoff for all data in*/ @@ -502,7 +502,7 @@ int initgpib() { outb(AUXMR,pon); outb(AUXMR,sic_rsc); - tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); + tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); outb(AUXMR,sic_rsc_off); @@ -519,12 +519,12 @@ void closegpib() { /*GPIB ROUTINES: These will also make little sense unless you have a data sheet. - Note that the routines with an "m" in the beginning are for + Note that the routines with an "m" in the beginning are for accessing multiple devices in one call*/ /*This is one thing I could not figure out how to do correctly. - I tried to use the auxilary command to enable remote, but it + I tried to use the auxilary command to enable remote, but it never worked. Here, I bypass everything and write to the BSR to enable the remote line. NOTE that these lines are effectively "OR'ed" with the actual lines, so writing a 1 to the bit in the BSR @@ -559,9 +559,9 @@ status=EWOULDBLOCK; while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ } -/*This does not release the REM line on the gpib port, because if it did, - all the remote devices would go to local mode. This only sends the - gotolocal message to one device. Currently, REM is always held true +/*This does not release the REM line on the gpib port, because if it did, + all the remote devices would go to local mode. This only sends the + gotolocal message to one device. Currently, REM is always held true after enableremote is called, and is reset only on a close of the gpib device */ @@ -573,7 +573,7 @@ void gotolocal(unsigned char device) status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); } while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - + outb(CDOR,(device&31)+32); if (status==EWOULDBLOCK) do { @@ -852,7 +852,7 @@ do{ if (!(status&2)&&!counter2) done=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); } while (!(status&2)&&(done==EWOULDBLOCK)); - if (done!=EWOULDBLOCK) return(done); + if (done!=EWOULDBLOCK) return(done); if ((data[counter+1]==0)||(count+1)==0){ @@ -873,7 +873,7 @@ return(counter-1); } /*Send data through the TURBO488 FIFOS to a device that is already - addressed to listen. This is used by the write call when someone is + addressed to listen. This is used by the write call when someone is writing to a printer or plotter, etc... */ /*The last byte of each write is held off until either the next write or close, so it can be sent with EOI set*/ @@ -901,7 +901,7 @@ status=EWOULDBLOCK; if (sleeptime<SLEEP_MAX) sleeptime=sleeptime*2; } while (!(inb(ISR3)&0x08)&&(status==EWOULDBLOCK)); /*Fifo is full*/ - + if((count>1)&&(inb(ISR3)&0x08)){ outw(FIFOB,*(unsigned*)(data+counter)); /* printf ("gpib: sent:%c,%c\n",data[counter],data[counter+1]);*/ @@ -911,7 +911,7 @@ status=EWOULDBLOCK; } } while ((count>1)&&(status==EWOULDBLOCK)); -/*The write routine and close routine must check if there is 1 +/*The write routine and close routine must check if there is 1 byte left and handle it accordingly*/ @@ -933,7 +933,7 @@ int sendgpibfifo(unsigned char device,char *data,int count) int counter; int fifopos; int sleeptime; - + outb(IMR2,0x30); /*we have to enable DMA (0x30) for turbo488 to work*/ outb(CNT0,0); outb(CNT1,0); @@ -950,7 +950,7 @@ status=EWOULDBLOCK; status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); outb (CDOR,64); /*Address controller (me) to talk*/ - + if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); @@ -978,7 +978,7 @@ status=EWOULDBLOCK; if (sleeptime<SLEEP_MAX) sleeptime=sleeptime*2; } while (!(inb(ISR3)&0x08)&&(status==EWOULDBLOCK)); /*Fifo is full*/ - + if((count>1)&&(inb(ISR3)&0x08)){ /*if(count==2) outb(CFG,15+0x40); *//*send eoi when done*/ outw(FIFOB,*(unsigned*)(data+counter)); @@ -1011,7 +1011,7 @@ status=EWOULDBLOCK; while ((inb(ISR3)&0x04)&&status==EWOULDBLOCK); /*Fifo is not empty*/ outb(CMDR,0x08); /*Issue STOP to TURBO488*/ - + /*Wait for DONE and STOP*/ if (status==EWOULDBLOCK) do { status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); @@ -1061,7 +1061,7 @@ while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - + outb(AUXMR,0x5E); /*Clear SYNC*/ outb (CDOR,95);/*untalk*/ @@ -1097,7 +1097,7 @@ int readgpibfifo(unsigned char device,char *data,int count) -status=EWOULDBLOCK; +status=EWOULDBLOCK; do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); @@ -1129,7 +1129,7 @@ do status2=inb(STS2); inword=inw(FIFOB); *(unsigned*)(data+counter)=inword; - /* printf ("Read:%c,%c\n",data[counter],data[counter+1]);*/ + /* printf ("Read:%c,%c\n",data[counter],data[counter+1]);*/ counter+=2; } else { @@ -1149,7 +1149,7 @@ do } while(!(inb(ISR3)&0x11)&&status==EWOULDBLOCK); /*wait for DONE and STOP*/ outb(AUXMR,0x55); - + outb(IMR2,0x00); /*we have to enable DMA (0x30) for turbo488 to work*/ outb(CMDR,0x20); /*soft reset turbo488*/ outb(CMDR,0x10); /*reset fifos*/ @@ -1168,7 +1168,7 @@ do do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - + outb(AUXMR,0x5E); /*Clear SYNC*/ outb (CDOR,95);/*untalk*/ do @@ -1209,7 +1209,7 @@ char spoll(unsigned char device) if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - + /*wait for bus to be synced*/ if (!(inb(ISR0)&1)&&status==EWOULDBLOCK) do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); @@ -1239,7 +1239,7 @@ char spoll(unsigned char device) if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - + outb(CDOR,95); /*untalk*/ if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do diff --git a/sys/i386/isa/gpib.h b/sys/i386/isa/gpib.h index d479e78..557880a 100644 --- a/sys/i386/isa/gpib.h +++ b/sys/i386/isa/gpib.h @@ -1,19 +1,19 @@ /* gpib data structures */ struct gpibdata { char *data; /* data string for ins and outs */ - unsigned char address; /* gpib address */ - int *count; - } ; + unsigned char address; /* gpib address */ + int *count; + } ; /* IOCTL commands */ -#define GPIBWRITE _IOW('g',1,struct gpibdata) -#define GPIBREAD _IOW('g',2,struct gpibdata) -#define GPIBINIT _IOW('g',3,struct gpibdata) -#define GPIBTRIGGER _IOW('g',4,struct gpibdata) -#define GPIBREMOTE _IOW('g',5,struct gpibdata) -#define GPIBLOCAL _IOW('g',6,struct gpibdata) -#define GPIBMTRIGGER _IOW('g',7,struct gpibdata) -#define GPIBMREMOTE _IOW('g',8,struct gpibdata) -#define GPIBMLOCAL _IOW('g',9,struct gpibdata) -#define GPIBSPOLL _IOW('g',10,struct gpibdata) +#define GPIBWRITE _IOW('g',1,struct gpibdata) +#define GPIBREAD _IOW('g',2,struct gpibdata) +#define GPIBINIT _IOW('g',3,struct gpibdata) +#define GPIBTRIGGER _IOW('g',4,struct gpibdata) +#define GPIBREMOTE _IOW('g',5,struct gpibdata) +#define GPIBLOCAL _IOW('g',6,struct gpibdata) +#define GPIBMTRIGGER _IOW('g',7,struct gpibdata) +#define GPIBMREMOTE _IOW('g',8,struct gpibdata) +#define GPIBMLOCAL _IOW('g',9,struct gpibdata) +#define GPIBSPOLL _IOW('g',10,struct gpibdata) diff --git a/sys/i386/isa/gpibreg.h b/sys/i386/isa/gpibreg.h index d517e0a..2ab2acc 100644 --- a/sys/i386/isa/gpibreg.h +++ b/sys/i386/isa/gpibreg.h @@ -1,5 +1,5 @@ static short gpib_port=0x2c0; -#define IEEE gpib_port +#define IEEE gpib_port /*NAT4882 Registers*/ diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index 221571a..9cb8f0d 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -152,14 +152,14 @@ struct gsc_unit { int height; /* height, for pnm modes */ size_t bcount; /* bytes to read, for pnm modes */ struct _sbuf hbuf; /* buffer for pnm header data */ -} unittab[NGSC]; +} unittab[NGSC]; /* I could not find a reasonable buffer size limit other than by * experiments. MAXPHYS is obviously too much, while DEV_BSIZE and * PAGE_SIZE are really too small. There must be something wrong * with isa_dmastart/isa_dmarangecheck HELP!!! */ -#define MAX_BUFSIZE 0x3000 +#define MAX_BUFSIZE 0x3000 #define DEFAULT_BLEN 59 /*********************************************************************** @@ -197,7 +197,7 @@ lookup_geometry(struct gsc_geom geom, const struct gsc_unit *scu) for(i=0; i<GEOMTAB_SIZE; i++) { tab = geomtab[i]; - + if ( ( ( geom.dpi != INVALID ) && ( tab.dpi == geom.dpi ) ) || ( ( geom.dpl != INVALID ) && ( tab.dpl == geom.dpl ) ) || ( ( geom.g_res != INVALID ) && ( tab.g_res == geom.g_res ) ) || @@ -213,7 +213,7 @@ lookup_geometry(struct gsc_geom geom, const struct gsc_unit *scu) lprintf("gsc.lookup_geometry: " "geometry lookup failed on {%d, %d, 0x%02x, 0x%02x}\n", geom.dpi, geom.dpl, geom.g_res, geom.s_res); - + return INVALID; } @@ -229,12 +229,12 @@ static int get_geometry(const struct gsc_unit *scu) { struct gsc_geom geom = NEW_GEOM; - + lprintf("gsc.get_geometry: get geometry at 0x%03x\n", scu->stat); if ( ( geom.g_res = inb(scu->stat) ) == FAIL ) - return INVALID; - + return INVALID; + geom.g_res &= GSC_RES_MASK; return lookup_geometry(geom, scu); @@ -306,7 +306,7 @@ buffer_read(struct gsc_unit *scu) int delay; lprintf("gsc.buffer_read: begin\n"); - + if (scu->ctrl_byte == INVALID) { lprintf("gsc.buffer_read: invalid ctrl_byte\n"); @@ -318,9 +318,9 @@ buffer_read(struct gsc_unit *scu) outb( scu->ctrl, scu->ctrl_byte | GSC_POWER_ON ); outb( scu->clrp, 0 ); stb = inb( scu->stat ); - + isa_dmastart(B_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); - + chan_bit = 0x01 << scu->channel; for(delay=0; !(inb(DMA1_READY) & 0x01 << scu->channel); delay += LONG) @@ -331,7 +331,7 @@ buffer_read(struct gsc_unit *scu) lprintf("gsc.buffer_read: timeout\n"); res = EWOULDBLOCK; break; - } + } res = tsleep((caddr_t)scu, GSCPRI | PCATCH, "gscread", LONG); if ( ( res == 0 ) || ( res == EWOULDBLOCK ) ) res = SUCCESS; @@ -390,7 +390,7 @@ gscprobe (struct isa_device *isdp) isdp->id_drq, isdp->id_maddr, isdp->id_msize); - + if ( isdp->id_iobase < 0 ) { lprintf("gsc%d.probe: no iobase given\n", unit); @@ -451,7 +451,7 @@ gscprobe (struct isa_device *isdp) lprintf("gsc%d.probe: status 0x%02x, %ddpi\n", unit, stb, geomtab[scu->geometry].dpi); - outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON); + outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON); } lprintf("gsc%d.probe: ok\n", unit); @@ -485,7 +485,7 @@ gscattach(struct isa_device *isdp) isdp->id_drq, isdp->id_maddr, isdp->id_msize); - + printf("gsc%d: GeniScan GS-4500 at %ddpi\n", unit, geomtab[scu->geometry].dpi); @@ -516,7 +516,7 @@ int gscopen (dev_t dev, int flag) { int unit = UNIT(minor(dev)) & UNIT_MASK; struct gsc_unit *scu = unittab + unit; - + if ( minor(dev) & DBUG_MASK ) scu->flags |= DEBUG; else @@ -535,7 +535,7 @@ int gscopen (dev_t dev, int flag) lprintf("gsc%d.open: gray maps are not yet supported", unit); return ENXIO; } - + lprintf("gsc%d.open: minor %d\n", unit, minor(dev)); @@ -545,15 +545,15 @@ int gscopen (dev_t dev, int flag) unit, scu->flags); return ENXIO; } - + if ( scu->flags & OPEN ) { lprintf("gsc%d.open: already open", unit); return EBUSY; } - scu->flags |= OPEN; - + scu->flags |= OPEN; + return SUCCESS; } @@ -579,7 +579,7 @@ int gscclose (dev_t dev, int flag) unit, scu->flags); return ENXIO; } - + outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON); if ( scu->sbuf.base != NULL ) free( scu->sbuf.base, M_DEVBUF ); @@ -589,7 +589,7 @@ int gscclose (dev_t dev, int flag) scu->sbuf.poi = INVALID; scu->flags &= ~(DEBUG | OPEN | READING); - + return SUCCESS; } @@ -604,7 +604,7 @@ int gscread (dev_t dev, struct uio *uio) struct gsc_unit *scu = unittab + unit; size_t nbytes; int res; - + lprintf("gsc%d.read: minor %d\n", unit, minor(dev)); if ( unit >= NGSC || !( scu->flags & ATTACHED ) ) @@ -645,7 +645,7 @@ int gscread (dev_t dev, struct uio *uio) } } } - + lprintf("gsc%d.read(before buffer_read): " "size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount); @@ -653,7 +653,7 @@ int gscread (dev_t dev, struct uio *uio) if ( scu->sbuf.poi == scu->sbuf.size ) if ( (res = buffer_read(scu)) != SUCCESS ) return res; - + lprintf("gsc%d.read(after buffer_read): " "size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount); @@ -662,22 +662,22 @@ int gscread (dev_t dev, struct uio *uio) if ( (scu->flags & PBM_MODE) ) nbytes = MIN( nbytes, scu->bcount ); - + lprintf("gsc%d.read: transferring 0x%x bytes", nbytes); - + res = uiomove(scu->sbuf.base + scu->sbuf.poi, nbytes, uio); if ( res != SUCCESS ) { lprintf("gsc%d.read: uiomove failed %d", unit, res); return res; } - + scu->sbuf.poi += nbytes; if ( scu->flags & PBM_MODE ) scu->bcount -= nbytes; - + lprintf("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount); - + return SUCCESS; } @@ -701,12 +701,12 @@ int gscioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) unit, scu->flags); return ENXIO; } - + switch(cmd) { case GSC_SRESSW: lprintf("gsc%d.ioctl:GSC_SRESSW\n", unit); if ( scu->flags & READING ) - { + { lprintf("gsc%d:ioctl on already reading unit\n", unit); return EBUSY; } @@ -715,11 +715,11 @@ int gscioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case GSC_GRES: *(int *)data=geomtab[scu->geometry].dpi; lprintf("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data); - return SUCCESS; + return SUCCESS; case GSC_GWIDTH: *(int *)data=geomtab[scu->geometry].dpl; lprintf("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data); - return SUCCESS; + return SUCCESS; case GSC_SRES: case GSC_SWIDTH: lprintf("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n", @@ -742,7 +742,7 @@ int gscioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case GSC_SHEIGHT: lprintf("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data); if ( scu->flags & READING ) - { + { lprintf("gsc%d:ioctl on already reading unit\n", unit); return EBUSY; } diff --git a/sys/i386/isa/gscreg.h b/sys/i386/isa/gscreg.h index f8cafcd..9a7960c 100644 --- a/sys/i386/isa/gscreg.h +++ b/sys/i386/isa/gscreg.h @@ -1,4 +1,4 @@ -/* gscreg.h - port and bit definitions for the Genius GS-4500 interface +/* gscreg.h - port and bit definitions for the Genius GS-4500 interface * * * Copyright (c) 1995 Gunther Schadow. All rights reserved. diff --git a/sys/i386/isa/ic/Am7990.h b/sys/i386/isa/ic/Am7990.h index bbc6c63..fe146ee 100644 --- a/sys/i386/isa/ic/Am7990.h +++ b/sys/i386/isa/ic/Am7990.h @@ -1,6 +1,6 @@ /* * Am7990, Local Area Network Controller for Ethernet (LANCE) - * + * * Copyright (c) 1994, Paul Richards. This software may be used, * modified, copied, distributed, and sold, in both source and binary * form provided that the above copyright and these terms are retained. @@ -35,18 +35,18 @@ #define MISS 0x1000 #define MERR 0x0800 #define RINT 0x0400 -#define TINT 0x0200 -#define IDON 0x0100 +#define TINT 0x0200 +#define IDON 0x0100 #define INTR 0x0080 #define INEA 0x0040 #define RXON 0x0020 #define TXON 0x0010 #define TDMD 0x0008 -#define STOP 0x0004 +#define STOP 0x0004 #define STRT 0x0002 -#define INIT 0x0001 +#define INIT 0x0001 -/* +/* * CSR3 * * Bits 3-15 are reserved. @@ -54,12 +54,12 @@ */ #define BSWP 0x0004 -#define ACON 0x0002 +#define ACON 0x0002 #define BCON 0x0001 /* Initialisation block */ -struct init_block { +struct init_block { u_short mode; /* Mode register */ u_char padr[6]; /* Ethernet address */ u_char ladrf[8]; /* Logical address filter (multicast) */ @@ -88,7 +88,7 @@ struct init_block { #define DTX 0x0002 /* Disable the transmitter */ #define DRX 0x0001 /* Disable the receiver */ -/* +/* * Message Descriptor Structure * * Each transmit or receive descriptor ring entry (RDRE's and TDRE's) @@ -100,14 +100,14 @@ struct init_block { * 3. The status information for that particular buffer. The eight most * significant bits of md1 are collectively termed the STATUS of the * descriptor. - * + * * Descriptor md0 contains LADR 0-15, the low order 16 bits of the 24-bit - * address of the actual data buffer. Bits 0-7 of descriptor md1 contain + * address of the actual data buffer. Bits 0-7 of descriptor md1 contain * HADR, the high order 8-bits of the 24-bit data buffer address. Bits 8-15 * of md1 contain the status flags of the buffer. Descriptor md2 contains the - * buffer byte count in bits 0-11 as a two's complement number and must have + * buffer byte count in bits 0-11 as a two's complement number and must have * 1's written to bits 12-15. For the receive entry md3 has the Message Byte - * Count in bits 0-11, this is the length of the received message and is valid + * Count in bits 0-11, this is the length of the received message and is valid * only when ERR is cleared and ENP is set. For the transmit entry it contains * more status information. * @@ -116,8 +116,8 @@ struct init_block { struct mds { u_short md0; u_short md1; - short md2; - u_short md3; + short md2; + u_short md3; }; /* Receive STATUS flags for md1 */ @@ -147,8 +147,8 @@ struct mds { #define ONE 0x0800 /* Exactly one retry was needed */ #define DEF 0x0400 /* Packet transmit deferred -- channel busy */ -/* - * Transmit status flags for md2 +/* + * Transmit status flags for md2 * * Same as for receive descriptor. * diff --git a/sys/i386/isa/ic/am7990.h b/sys/i386/isa/ic/am7990.h index ea8a0e6..ce007a1 100644 --- a/sys/i386/isa/ic/am7990.h +++ b/sys/i386/isa/ic/am7990.h @@ -62,7 +62,7 @@ typedef struct { unsigned short d_status; #define LN_DSTS_RxLENMASK 0x0FFF /* (R ) Recieve Length */ #define LN_DSTS_TxTDRMASK 0x03FF /* (R ) Transmit - Time Domain Reflectometer */ -#define LN_DSTS_TxEXCCOLL 0x0400 /* (R ) Transmit - Excessive Collisions */ +#define LN_DSTS_TxEXCCOLL 0x0400 /* (R ) Transmit - Excessive Collisions */ #define LN_DSTS_TxCARRLOSS 0x0800 /* (R ) Transmit - Carrier Loss */ #define LN_DSTS_TxLATECOLL 0x1000 /* (R ) Transmit - Late Collision */ #define LN_DSTS_TxUNDERFLOW 0x4000 /* (R ) Transmit - Underflow */ diff --git a/sys/i386/isa/ic/i82365.h b/sys/i386/isa/ic/i82365.h index ab38125..b86812e 100644 --- a/sys/i386/isa/ic/i82365.h +++ b/sys/i386/isa/ic/i82365.h @@ -16,7 +16,7 @@ * PCIC Registers * Each register is given a name, and most of the bits are named too. * I should really name them all. - * + * * Finally, since the banks can be addressed with a regular syntax, * some macros are provided for that purpose. */ diff --git a/sys/i386/isa/ic/i8237.h b/sys/i386/isa/ic/i8237.h index 722194c..5493ca8 100644 --- a/sys/i386/isa/ic/i8237.h +++ b/sys/i386/isa/ic/i8237.h @@ -1,7 +1,7 @@ /* * Intel 8237 DMA Controller * - * $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $ + * $Id: i8237.h,v 1.3 1994/11/01 17:26:47 ache Exp $ */ #define DMA37MD_SINGLE 0x40 /* single pass mode */ @@ -9,4 +9,4 @@ #define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */ #define DMA37MD_WRITE 0x04 /* read the device, write memory operation */ #define DMA37MD_READ 0x08 /* write the device, read memory operation */ - + diff --git a/sys/i386/isa/ic/lemac.h b/sys/i386/isa/ic/lemac.h index 2c919d8..4eee86f 100644 --- a/sys/i386/isa/ic/lemac.h +++ b/sys/i386/isa/ic/lemac.h @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: lemac.h,v 1.1 1994/08/01 16:03:42 thomas Exp $ + * $Id: lemac.h,v 1.1 1994/08/12 06:51:12 davidg Exp $ */ #ifndef _LEMAC_H_ #define _LEMAC_H_ @@ -128,7 +128,7 @@ /* Transmit Done Queue Status Definitions */ -#define LEMAC_TDQ_COL 0x03 /* Collision Mask */ +#define LEMAC_TDQ_COL 0x03 /* Collision Mask */ #define LEMAC_TDQ_NOCOL 0x00 /* No Collisions */ #define LEMAC_TDQ_ONECOL 0x01 /* One Collision */ #define LEMAC_TDQ_MULCOL 0x02 /* Multiple Collisions */ diff --git a/sys/i386/isa/ic/ncr5380.h b/sys/i386/isa/ic/ncr5380.h index f4eec05..ce14fec 100644 --- a/sys/i386/isa/ic/ncr5380.h +++ b/sys/i386/isa/ic/ncr5380.h @@ -14,8 +14,8 @@ * Derived from "NCR 53C80 Family SCSI Protocol Controller Data Manual" */ -#ifndef _IC_NCR_5380_H_ -#define _IC_NCR_5380_H_ +#ifndef _IC_NCR_5380_H_ +#define _IC_NCR_5380_H_ #define C80_CSDR 0 /* ro - Current SCSI Data Reg. */ #define C80_ODR 0 /* wo - Output Data Reg. */ @@ -33,7 +33,7 @@ #define ICR_ASSERT_DATA_BUS 0x01 #define ICR_BITS "\20\1dbus\2atn\3sel\4bsy\5ack\6arblost\7arb\10rst" -/* +/* * The mask to use when doing read_modify_write on ICR. */ #define ICR_MASK (~(ICR_DIFF_ENABLE | ICR_TRI_STATE_MODE)) diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c index 113578b..f4adf10 100644 --- a/sys/i386/isa/if_cx.c +++ b/sys/i386/isa/if_cx.c @@ -771,7 +771,7 @@ void cxinput (cx_chan_t *c, void *buf, unsigned len) #if NBPFILTER > 0 /* * Check if there's a BPF listener on this interface. - * If so, hand off the raw packet to bpf. + * If so, hand off the raw packet to bpf. */ if (c->bpf) bpf_tap (c->bpf, buf, len); diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c index d4d29f8..100d8f7 100644 --- a/sys/i386/isa/if_ed.c +++ b/sys/i386/isa/if_ed.c @@ -13,7 +13,7 @@ * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * and a variety of similar clones. * - * $Id: if_ed.c,v 1.71 1995/05/12 22:39:40 davidg Exp $ + * $Id: if_ed.c,v 1.72 1995/05/14 11:01:20 davidg Exp $ */ #include "ed.h" @@ -363,11 +363,11 @@ ed_probe_WD80x3(isa_dev) isa16bit = 1; memsize = 16384; sc->type_str = "WD8013EP"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: WD 8013EP"; } else { sc->type_str = "WD8003EP"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: WD 8003EP"; } break; @@ -407,7 +407,7 @@ ed_probe_WD80x3(isa_dev) break; case ED_TYPE_SMC8216T: sc->type_str = "SMC8216T"; - sc->kdc.kdc_description = + sc->kdc.kdc_description = "Ethernet adapter: SMC 8216T"; outb(sc->asic_addr + ED_WD790_HWR, @@ -1376,7 +1376,7 @@ ed_init(unit) /* * Enable the following interrupts: receive/transmit complete, * receive/transmit error, and Receiver OverWrite. - * + * * Counter overflow and Remote DMA complete are *not* enabled. */ outb(sc->nic_addr + ED_P0_IMR, @@ -2060,8 +2060,8 @@ ed_ioctl(ifp, command, data) ed_init(ifp->if_unit); } /* UP controls BUSY/IDLE */ - sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) - ? DC_BUSY + sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) + ? DC_BUSY : DC_IDLE); #if NBPFILTER > 0 @@ -2327,7 +2327,7 @@ ed_pio_write_mbufs(sc, m, dst) outb(sc->nic_addr + ED_P0_CR, ED_CR_RD1 | ED_CR_STA); /* - * Transfer the mbuf chain to the NIC memory. + * Transfer the mbuf chain to the NIC memory. * 16-bit cards require that data be transferred as words, and only words. * So that case requires some extra code to patch over odd-length mbufs. */ @@ -2336,7 +2336,7 @@ ed_pio_write_mbufs(sc, m, dst) /* NE1000s are easy */ while (m) { if (m->m_len) { - outsb(sc->asic_addr + ED_NOVELL_DATA, + outsb(sc->asic_addr + ED_NOVELL_DATA, m->m_data, m->m_len); } m = m->m_next; @@ -2346,7 +2346,7 @@ ed_pio_write_mbufs(sc, m, dst) unsigned char *data; int len, wantbyte; unsigned char savebyte[2]; - + wantbyte = 0; while (m) { @@ -2363,7 +2363,7 @@ ed_pio_write_mbufs(sc, m, dst) } /* output contiguous words */ if (len > 1) { - outsw(sc->asic_addr + ED_NOVELL_DATA, + outsw(sc->asic_addr + ED_NOVELL_DATA, data, len >> 1); data += len & ~1; len &= 1; diff --git a/sys/i386/isa/if_edreg.h b/sys/i386/isa/if_edreg.h index 31f7879..430fa93 100644 --- a/sys/i386/isa/if_edreg.h +++ b/sys/i386/isa/if_edreg.h @@ -6,10 +6,10 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: if_edreg.h,v 1.16 1994/08/04 17:42:35 davidg Exp $ + * $Id: if_edreg.h,v 1.17 1995/01/23 19:06:08 davidg Exp $ */ /* - * National Semiconductor DS8390 NIC register definitions + * National Semiconductor DS8390 NIC register definitions * * * Modification history @@ -26,10 +26,10 @@ * changed double buffering flag to multi buffering * made changes/additions for 3c503 multi-buffering * ...companion to Rev. 2.0 of 'ed' driver. - * + * * Revision 1.1 93/06/23 03:01:07 davidg * Initial revision - * + * */ /* @@ -378,7 +378,7 @@ * algorithm to allow prioritization of nodes. */ #define ED_TCR_OFST 0x10 - + /* * bits 5, 6, and 7 are unused/reserved */ diff --git a/sys/i386/isa/if_eg.c b/sys/i386/isa/if_eg.c index 00b5038..ec02037 100644 --- a/sys/i386/isa/if_eg.c +++ b/sys/i386/isa/if_eg.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_eg.c,v 1.2 1995/04/12 07:50:44 phk Exp $ + * $Id: if_eg.c,v 1.3 1995/04/12 20:47:47 wollman Exp $ */ /* To do: @@ -101,8 +101,8 @@ struct eg_softc { int eg_ctl; /* Control register R/W (EG_CTL_*) */ int eg_stat; /* Status register R/O (EG_STAT_*) */ int eg_data; /* Data register R/W (16 bits) */ - u_char eg_rom_major; /* Cards ROM version (major number) */ - u_char eg_rom_minor; /* Cards ROM version (minor number) */ + u_char eg_rom_major; /* Cards ROM version (major number) */ + u_char eg_rom_minor; /* Cards ROM version (minor number) */ short eg_ram; /* Amount of RAM on the card */ u_char eg_pcb[64]; /* Primary Command Block buffer */ u_char eg_incount; /* Number of buffers currently used */ @@ -152,13 +152,13 @@ static void egstop __P((struct eg_softc *)); /* * Support stuff */ - + static inline void egprintpcb(sc) struct eg_softc *sc; { int i; - + for (i = 0; i < sc->eg_pcb[1] + 2; i++) dprintf(("eg#: pcb[%2d] = %x\n", i, sc->eg_pcb[i])); } @@ -168,7 +168,7 @@ static inline void egprintstat(b) u_char b; { - dprintf(("eg#: %s %s %s %s %s %s %s\n", + dprintf(("eg#: %s %s %s %s %s %s %s\n", (b & EG_STAT_HCRE)?"HCRE":"", (b & EG_STAT_ACRF)?"ACRF":"", (b & EG_STAT_DIR )?"DIR ":"", @@ -195,7 +195,7 @@ egoutPCB(sc, b) dprintf(("eg#: egoutPCB failed\n")); return 1; } - + static int egreadPCBstat(sc, statb) struct eg_softc *sc; @@ -204,7 +204,7 @@ egreadPCBstat(sc, statb) int i; for (i=0; i < 5000; i++) { - if (EG_PCB_STAT(inb(sc->eg_stat))) + if (EG_PCB_STAT(inb(sc->eg_stat))) break; DELAY(10); } @@ -227,7 +227,7 @@ egreadPCBready(sc) dprintf(("eg#: PCB read not ready\n")); return 1; } - + static int egwritePCB(sc) struct eg_softc *sc; @@ -240,7 +240,7 @@ egwritePCB(sc) len = sc->eg_pcb[1] + 2; for (i = 0; i < len; i++) egoutPCB(sc, sc->eg_pcb[i]); - + for (i=0; i < 4000; i++) { if (inb(sc->eg_stat) & EG_STAT_HCRE) break; @@ -252,15 +252,15 @@ egwritePCB(sc) if (egreadPCBstat(sc, EG_PCB_ACCEPT)) return 1; return 0; -} - +} + static int egreadPCB(sc) struct eg_softc *sc; { int i; u_char b; - + outb(sc->eg_ctl, EG_PCB_MASK(inb(sc->eg_ctl))); bzero(sc->eg_pcb, sizeof(sc->eg_pcb)); @@ -269,7 +269,7 @@ egreadPCB(sc) return 1; sc->eg_pcb[0] = inb(sc->eg_cmd); - + if (egreadPCBready(sc)) return 1; @@ -279,7 +279,7 @@ egreadPCB(sc) dprintf(("eg#: len %d too large\n", sc->eg_pcb[1])); return 1; } - + for (i = 0; i < sc->eg_pcb[1]; i++) { if (egreadPCBready(sc)) return 1; @@ -315,14 +315,14 @@ egprobe(struct isa_device * id) dprintf(("eg#: Weird iobase %x\n", id->id_iobase)); return 0; } - + sc->eg_cmd = id->id_iobase + EG_COMMAND; sc->eg_ctl = id->id_iobase + EG_CONTROL; sc->eg_stat = id->id_iobase + EG_STATUS; sc->eg_data = id->id_iobase + EG_DATA; /* hard reset card */ - outb(sc->eg_ctl, EG_CTL_RESET); + outb(sc->eg_ctl, EG_CTL_RESET); if (inb(sc->eg_ctl) != 0xc0) return 0; DELAY(5000); @@ -342,7 +342,7 @@ egprobe(struct isa_device * id) sc->eg_pcb[1] = 0; if (egwritePCB(sc) != 0) return 0; - + if (egreadPCB(sc) != 0) { egprintpcb(sc); return 0; @@ -356,7 +356,7 @@ egprobe(struct isa_device * id) sc->eg_rom_major = sc->eg_pcb[3]; sc->eg_rom_minor = sc->eg_pcb[2]; sc->eg_ram = sc->eg_pcb[6] | (sc->eg_pcb[7] << 8); - + return 8; } @@ -365,7 +365,7 @@ egattach (struct isa_device *id) { struct eg_softc *sc = &eg_softc[id->id_unit]; struct ifnet *ifp = &sc->sc_arpcom.ac_if; - + egstop(sc); sc->eg_pcb[0] = EG_CMD_GETEADDR; /* Get Station address */ @@ -373,7 +373,7 @@ egattach (struct isa_device *id) if (egwritePCB(sc) != 0) { dprintf(("eg#: write error\n")); return 0; - } + } if (egreadPCB(sc) != 0) { dprintf(("eg#: read error\n")); egprintpcb(sc); @@ -381,7 +381,7 @@ egattach (struct isa_device *id) } /* check Get station address response */ - if (sc->eg_pcb[0] != EG_RSP_GETEADDR || sc->eg_pcb[1] != 0x06) { + if (sc->eg_pcb[0] != EG_RSP_GETEADDR || sc->eg_pcb[1] != 0x06) { dprintf(("eg#: parse error\n")); egprintpcb(sc); return 0; @@ -420,18 +420,18 @@ egattach (struct isa_device *id) ifp->if_ioctl = egioctl; ifp->if_reset = egreset; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS; - + /* Now we can attach the interface. */ if_attach(ifp); /* device attach does transition from UNCONFIGURED to IDLE state */ sc->kdc.kdc_state = DC_IDLE; - + #if NBPFILTER > 0 bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); #endif - + return 1; } @@ -474,7 +474,7 @@ eginit(sc) if (sc->eg_outbuf == NULL) sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT); - + ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; @@ -523,7 +523,7 @@ egstart(ifp) IF_DEQUEUE(&sc->sc_arpcom.ac_if.if_snd, m0); if (m0 == NULL) return; - + sc->sc_arpcom.ac_if.if_flags |= IFF_OACTIVE; /* Copy the datagram to the buffer. */ @@ -546,13 +546,13 @@ egstart(ifp) bpf_mtap(sc->sc_arpcom.ac_if.if_bpf, m0); #endif m_freem(m0); - + /* length must be a minimum of ETHER_MIN_LEN bytes */ len = max(len, ETHER_MIN_LEN); /* set direction bit: host -> adapter */ - outb(sc->eg_ctl, inb(sc->eg_ctl) & ~EG_CTL_DIR); - + outb(sc->eg_ctl, inb(sc->eg_ctl) & ~EG_CTL_DIR); + sc->eg_pcb[0] = EG_CMD_SENDPACKET; sc->eg_pcb[1] = 0x06; sc->eg_pcb[2] = 0; /* address not used, we send zero */ @@ -572,9 +572,9 @@ egstart(ifp) sc->sc_arpcom.ac_if.if_oerrors++; sc->sc_arpcom.ac_if.if_flags &= ~IFF_OACTIVE; } - + /* Set direction bit : Adapter -> host */ - outb(sc->eg_ctl, inb(sc->eg_ctl) | EG_CTL_DIR); + outb(sc->eg_ctl, inb(sc->eg_ctl) | EG_CTL_DIR); return; } @@ -625,7 +625,7 @@ egintr(int unit) dprintf(("\tno resources errors %d\n", *(short*) &sc->eg_pcb[14])); dprintf(("\toverrun errors %d\n", *(short*) &sc->eg_pcb[16])); break; - + default: dprintf(("eg#: egintr: Unknown response %x??\n", sc->eg_pcb[0])); @@ -649,7 +649,7 @@ egread(sc, buf, len) struct ifnet *ifp; struct mbuf *m; struct ether_header *eh; - + if (len <= sizeof(struct ether_header) || len > ETHER_MAX_LEN) { dprintf(("eg#: Unacceptable packet size %d\n", len)); @@ -729,7 +729,7 @@ egioctl(ifp, command, data) case AF_NS: { register struct ns_addr *ina = &IA_SNS(ifa)->sns_addr; - + if (ns_nullhost(*ina)) ina->x_host = *(union ns_host *)(sc->sc_arpcom.ac_enaddr); @@ -806,6 +806,6 @@ static void egstop(sc) register struct eg_softc *sc; { - + outb(sc->eg_ctl, 0); } diff --git a/sys/i386/isa/if_egreg.h b/sys/i386/isa/if_egreg.h index 81a1a87..c4647a0 100644 --- a/sys/i386/isa/if_egreg.h +++ b/sys/i386/isa/if_egreg.h @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ + * $Id: if_egreg.h,v 1.1 1995/04/08 09:39:36 phk Exp $ */ /* @@ -63,7 +63,7 @@ /* * Host Status Register bits - * EG_STAT_HRDY - Data Register ready + * EG_STAT_HRDY - Data Register ready * EG_STAT_HCRE - Host Command Register empty * EG_STAT_ACRF - Adapter Command register full * EG_STAT_DIR - Direction flag, 0 = host -> adapter, 1 = adapter -> host @@ -82,7 +82,7 @@ #define EG_STAT_ASF2 0x02 #define EG_STAT_ASF1 0x01 -#define EG_PCB_ACCEPT 1 +#define EG_PCB_ACCEPT 1 #define EG_PCB_REJECT 2 #define EG_PCB_DONE 3 #define EG_PCB_STAT(x) ((x)&3) diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c index baaa3ba..2232a70 100644 --- a/sys/i386/isa/if_el.c +++ b/sys/i386/isa/if_el.c @@ -5,8 +5,8 @@ * portions thereof. * * Questions, comments, bug reports and fixes to kimmel@cs.umass.edu. - * - * $Id: if_el.c,v 1.11 1995/03/28 07:55:29 bde Exp $ + * + * $Id: if_el.c,v 1.12 1995/04/12 20:47:48 wollman Exp $ */ /* Except of course for the portions of code lifted from other FreeBSD * drivers (mainly elread, elget and el_ioctl) @@ -223,7 +223,7 @@ int el_attach(struct isa_device *idev) * entry, if any. */ ifa = ifp->if_addrlist; - while ((ifa != NULL) && (ifa->ifa_addr != NULL) && + while ((ifa != NULL) && (ifa->ifa_addr != NULL) && (ifa->ifa_addr->sa_family != AF_LINK)) ifa = ifa->ifa_next; if((ifa != NULL) && (ifa->ifa_addr != NULL)) { @@ -427,7 +427,7 @@ void el_start(struct ifnet *ifp) } else done = 1; - } + } else { sc->arpcom.ac_if.if_opackets++; done = 1; @@ -558,7 +558,7 @@ void elintr(int unit) stat = inb(base+EL_AS); /* If so, do it all again (i.e. don't set done to 1) */ - if(!(stat & EL_AS_RXBUSY)) + if(!(stat & EL_AS_RXBUSY)) dprintf(("<rescan> ")); else done = 1; @@ -723,8 +723,8 @@ el_ioctl(ifp, command, data) ina->x_host = *(union ns_host *)(sc->arpcom.ac_enaddr); else { - /* - * + /* + * */ bcopy((caddr_t)ina->x_host.c_host, (caddr_t)sc->arpcom.ac_enaddr, diff --git a/sys/i386/isa/if_ep.c b/sys/i386/isa/if_ep.c index de75d41..3b677d6 100644 --- a/sys/i386/isa/if_ep.c +++ b/sys/i386/isa/if_ep.c @@ -32,13 +32,13 @@ /* * Modified from the FreeBSD 1.1.5.1 version by: - * Andres Vega Garcia + * Andres Vega Garcia * INRIA - Sophia Antipolis, France * avega@sophia.inria.fr */ /* - * $Id: if_ep.c,v 1.26 1995/04/12 20:47:49 wollman Exp $ + * $Id: if_ep.c,v 1.27 1995/05/27 04:40:57 davidg Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -183,7 +183,7 @@ ep_look_for_board_at(is) if (ep_current_tag == (EP_LAST_TAG + 1)) { /* Come here just one time */ - + /* Look for the EISA boards, leave them activated */ for(j = 1; j < 16; j++) { io_base = (j * EP_EISA_START) | EP_EISA_W0; @@ -191,7 +191,7 @@ ep_look_for_board_at(is) continue; /* we must found 0x1f if the board is EISA configurated */ - if ((inw(io_base + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f) + if ((inw(io_base + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f) continue; /* Reset and Enable the card */ @@ -270,7 +270,7 @@ ep_look_for_board_at(is) } else { for (i=0; ep_board[i].epb_addr && ep_board[i].epb_addr != IS_BASE; i++); - if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE) + if( ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE) return 0; if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE) @@ -455,10 +455,10 @@ epattach(is) sc->rx_avg_pkt = 128; /* - * NOTE: In all this I multiply everything by 64. - * W_s = the speed the CPU is able to write to the TX FIFO. + * NOTE: In all this I multiply everything by 64. + * W_s = the speed the CPU is able to write to the TX FIFO. * T_s = the speed the board sends the info to the Ether. - * W_s/T_s = 16 (represents 16/64) => W_s = 25 % of T_s. + * W_s/T_s = 16 (represents 16/64) => W_s = 25 % of T_s. * This will give us for a packet of 1500 bytes * tx_start_thresh=1125 and for a pkt of 64 bytes tx_start_threshold=48. * We prefer to start thinking the CPU is much slower than the Ethernet @@ -814,7 +814,7 @@ rescan: sc->rx_no_first, sc->rx_no_mbuf, sc->rx_bpf_disc, sc->rx_overrunf, sc->rx_overrunl, sc->tx_underrun); #else - printf("ep%d: Status: %x\n", unit, status); + printf("ep%d: Status: %x\n", unit, status); #endif epinit(unit); splx(x); @@ -865,7 +865,7 @@ rescan: outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */ - if ((status = inw(BASE + EP_STATUS)) & S_5_INTS) + if ((status = inw(BASE + EP_STATUS)) & S_5_INTS) goto rescan; /* re-enable Ints */ @@ -1195,17 +1195,17 @@ epioctl(ifp, cmd, data) sizeof(sc->sc_addr)); break; #endif - case SIOCSIFMTU: + case SIOCSIFMTU: /* * Set the interface MTU. */ - if (ifr->ifr_mtu > ETHERMTU) { - error = EINVAL; + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; } else { - ifp->if_mtu = ifr->ifr_mtu; + ifp->if_mtu = ifr->ifr_mtu; } - break; + break; default: error = EINVAL; diff --git a/sys/i386/isa/if_epreg.h b/sys/i386/isa/if_epreg.h index a905caa..e0b7d09 100644 --- a/sys/i386/isa/if_epreg.h +++ b/sys/i386/isa/if_epreg.h @@ -1,13 +1,13 @@ /* * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. 2. The name * of the author may not be used to endorse or promote products derived from * this software withough specific prior written permission - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -18,20 +18,20 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp Modified by: - * + * October 2, 1994 - - Modified by: Andres Vega Garcia - INRIA - Sophia Antipolis, France - e-mail: avega@sophia.inria.fr + Modified by: Andres Vega Garcia + + INRIA - Sophia Antipolis, France + e-mail: avega@sophia.inria.fr finger: avega@pax.inria.fr */ /* - * $Id: if_epreg.h,v 1.8 1995/04/10 07:48:03 root Exp root $ + * $Id: if_epreg.h,v 1.7 1995/04/10 21:25:06 jkh Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -349,7 +349,7 @@ struct ep_softc { #define SET_IRQ(i) (((i)<<12) | 0xF00) /* set IRQ i */ /* - * FIFO Registers. + * FIFO Registers. * RX Status. Window 1/Port 08 * * 15: Incomplete or FIFO empty. @@ -375,7 +375,7 @@ struct ep_softc { #define ERR_RX_DRIBBLE (u_short) (0x2<<11) /* - * FIFO Registers. + * FIFO Registers. * TX Status. Window 1/Port 0B * * Reports the transmit status of a completed transmission. Writing this @@ -400,7 +400,7 @@ struct ep_softc { #define TXS_STATUS_OVERFLOW 0x4 /* - * Configuration control register. + * Configuration control register. * Window 0/Port 04 */ /* Read */ @@ -411,7 +411,7 @@ struct ep_softc { #define ENABLE_DRQ_IRQ 0x0001 #define W0_P4_CMD_RESET_ADAPTER 0x4 #define W0_P4_CMD_ENABLE_ADAPTER 0x1 -/* +/* * Media type and status. * Window 4/Port 0A */ diff --git a/sys/i386/isa/if_fe.c b/sys/i386/isa/if_fe.c index ab09ce5..80aba82 100644 --- a/sys/i386/isa/if_fe.c +++ b/sys/i386/isa/if_fe.c @@ -806,7 +806,7 @@ fe_probe_ati ( struct isa_device * isa_dev, struct fe_softc * sc ) /* * Determine the card type. - * There may be a way to identify various models. FIXME. + * There may be a way to identify various models. FIXME. */ sc->type = FE_TYPE_AT1700; sc->typestr = "AT1700/RE2000"; @@ -1552,7 +1552,7 @@ fe_start ( struct ifnet *ifp ) * We *could* do better job by peeking the send queue to * know the length of the next packet. Current version just * tests against the worst case (i.e., longest packet). FIXME. - * + * * When adding the packet-peek feature, don't forget adding a * test on txb_count against QUEUEING_MAX. * There is a little chance the packet count exceeds @@ -1755,7 +1755,7 @@ fe_tint ( struct fe_softc * sc, u_char tstat ) /* * The transmitter is no more active. - * Reset output active flag and watchdog timer. + * Reset output active flag and watchdog timer. */ sc->sc_if.if_flags &= ~IFF_OACTIVE; sc->sc_if.if_timer = 0; @@ -1879,7 +1879,7 @@ fe_rint ( struct fe_softc * sc, u_char rstat ) "fe%d: received a short packet? (%u bytes)\n", sc->sc_unit, len ); } -#endif +#endif /* * Go get a packet. @@ -1920,7 +1920,7 @@ feintr ( int unit ) * Loop until there are no more new interrupt conditions. */ for (;;) { - + #if FE_DEBUG >= 4 fe_dump( LOG_INFO, sc, "intr()" ); #endif @@ -2312,7 +2312,7 @@ fe_get_packet ( struct fe_softc * sc, u_short len ) * * If an mbuf chain is too long for an Ethernet frame, it is not sent. * Packets shorter than Ethernet minimum are legal, and we pad them - * before sending out. An exception is "partial" packets which are + * before sending out. An exception is "partial" packets which are * shorter than mandatory Ethernet header. * * I wrote a code for an experimental "delayed padding" technique. @@ -2403,7 +2403,7 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m ) #endif /* - * Transfer the data from mbuf chain to the transmission buffer. + * Transfer the data from mbuf chain to the transmission buffer. * MB86960 seems to require that data be transferred as words, and * only words. So that we require some extra code to patch * over odd-length mbufs. @@ -2503,7 +2503,7 @@ fe_mcaf ( struct fe_softc *sc ) log( LOG_INFO, "fe%d: hash(%s) == %d\n", sc->sc_unit, ether_sprintf( enm->enm_addrlo ), index ); #endif - + filter.data[index >> 3] |= 1 << (index & 7); ETHER_NEXT_MULTI(step, enm); } @@ -2669,7 +2669,7 @@ fe_setlinkaddr ( struct fe_softc * sc ) { struct ifaddr *ifa; struct sockaddr_dl * sdl; - + /* * Search down the ifa address list looking for the AF_LINK type entry. */ diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c index 5e85521..8f4b47a 100644 --- a/sys/i386/isa/if_ie.c +++ b/sys/i386/isa/if_ie.c @@ -43,7 +43,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_ie.c,v 1.22 1995/03/28 07:55:31 bde Exp $ + * $Id: if_ie.c,v 1.23 1995/04/12 20:47:50 wollman Exp $ */ /* @@ -60,7 +60,7 @@ /* * The i82586 is a very versatile chip, found in many implementations. * Programming this chip is mostly the same, but certain details differ - * from card to card. This driver is written so that different cards + * from card to card. This driver is written so that different cards * can be automatically detected at run-time. Currently, only the * AT&T EN100/StarLAN 10 series are supported. */ @@ -231,7 +231,7 @@ const char *ie_hardware_names[] = { "Unknown" }; -/* +/* sizeof(iscp) == 1+1+2+4 == 8 sizeof(scb) == 2+2+2+2+2+2+2+2 == 16 NFRAMES * sizeof(rfd) == NFRAMES*(2+2+2+2+6+6+2+2) == NFRAMES*24 == 384 @@ -274,7 +274,7 @@ struct ie_softc { caddr_t iomembot; unsigned iosize; int bus_use; /* 0 means 16bit, 1 means 8 bit adapter */ - + int want_mcsetup; int promisc; volatile struct ie_int_sys_conf_ptr *iscp; @@ -400,7 +400,7 @@ static int sl_probe(dvp) break; default: - printf("ie%d: unknown AT&T board type code %d\n", unit, + printf("ie%d: unknown AT&T board type code %d\n", unit, ie_softc[unit].hard_type); return 0; } @@ -417,22 +417,22 @@ static int el_probe(dvp) int i; u_char signature[] = "*3COM*"; int unit = dvp->id_unit; - + sc->port = dvp->id_iobase; sc->iomembot = dvp->id_maddr; sc->bus_use = 0; - + /* Need this for part of the probe. */ sc->ie_reset_586 = el_reset_586; sc->ie_chan_attn = el_chan_attn; - + /* Reset and put card in CONFIG state without changing address. */ elink_reset(); outb(ELINK_ID_PORT, 0x00); elink_idseq(ELINK_507_POLY); elink_idseq(ELINK_507_POLY); outb(ELINK_ID_PORT, 0xff); - + c = inb(PORT + IE507_MADDR); if(c & 0x20) { #ifdef DEBUG @@ -440,50 +440,50 @@ static int el_probe(dvp) #endif return 0; } - + /* go to RUN state */ outb(ELINK_ID_PORT, 0x00); elink_idseq(ELINK_507_POLY); outb(ELINK_ID_PORT, 0x00); - + outb(PORT + IE507_CTRL, EL_CTRL_NRST); - + for (i = 0; i < 6; i++) if (inb(PORT + i) != signature[i]) return 0; - + c = inb(PORT + IE507_IRQ) & 0x0f; - + if (dvp->id_irq != (1 << c)) { printf("ie%d: kernel configured irq %d doesn't match board configured irq %d\n", unit, ffs(dvp->id_irq) - 1, c); return 0; } - + c = (inb(PORT + IE507_MADDR) & 0x1c) + 0xc0; - + if (kvtop(dvp->id_maddr) != ((int)c << 12)) { printf("ie%d: kernel configured maddr %lx doesn't match board configured maddr %x\n", unit, kvtop(dvp->id_maddr),(int)c << 12); return 0; } - + outb(PORT + IE507_CTRL, EL_CTRL_NORMAL); - + sc->hard_type = IE_3C507; sc->hard_vers = 0; /* 3C507 has no version number. */ - + /* * Divine memory size on-board the card. */ find_ie_mem_size(unit); - + if (!sc->iosize) { printf("ie%d: can't find shared memory\n", unit); outb(PORT + IE507_CTRL, EL_CTRL_NRST); return 0; } - + if(!dvp->id_msize) dvp->id_msize = sc->iosize; else if (dvp->id_msize != sc->iosize) { @@ -492,12 +492,12 @@ static int el_probe(dvp) outb(PORT + IE507_CTRL, EL_CTRL_NRST); return 0; } - + sl_read_ether(unit, ie_softc[unit].arpcom.ac_enaddr); - + /* Clear the interrupt latch just in case. */ outb(PORT + IE507_ICTRL, 1); - + return 16; } @@ -538,7 +538,7 @@ static int ni_probe(dvp) find_ie_mem_size(unit); if(!ie_softc[unit].iosize) { - return 0; + return 0; } if(!dvp->id_msize) @@ -570,7 +570,7 @@ ieattach(dvp) ifp->if_unit = unit; ifp->if_name = iedriver.name; ifp->if_mtu = ETHERMTU; - printf(" <%s R%d> ethernet address %s\n", + printf(" <%s R%d> ethernet address %s\n", ie_hardware_names[ie_softc[unit].hard_type], ie_softc[unit].hard_vers + 1, ether_sprintf(ie->arpcom.ac_enaddr)); @@ -586,7 +586,7 @@ ieattach(dvp) ifp->if_type = IFT_ETHER; ifp->if_addrlen = 6; ifp->if_hdrlen = 14; - + #if NBPFILTER > 0 bpfattach(&ie_softc[unit].ie_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); @@ -840,7 +840,7 @@ static inline int ether_equal(u_char *one, u_char *two) { * only client which will fiddle with IFF_PROMISC is BPF. This is * probably a good assumption, but we do not make it here. (Yet.) */ -static inline int check_eh(struct ie_softc *ie, +static inline int check_eh(struct ie_softc *ie, struct ether_header *eh, int *to_bpf) { int i; @@ -902,7 +902,7 @@ static inline int check_eh(struct ie_softc *ie, #endif /* We want to see multicasts. */ if(eh->ether_dhost[0] & 1) return 1; - + /* We want to see our own packets */ if(ether_equal(eh->ether_dhost, ie->arpcom.ac_enaddr)) return 1; @@ -1032,7 +1032,7 @@ static inline int ieget(unit, ie, mp, ehp, to_bpf) */ do { /* while(resid > 0) */ /* - * Try to allocate an mbuf to hold the data that we have. If we + * Try to allocate an mbuf to hold the data that we have. If we * already allocated one, just get another one and stick it on the * end (eventually). If we don't already have one, try to allocate * an mbuf cluster big enough to hold the whole packet, if we think it's @@ -1317,12 +1317,12 @@ iestart(ifp) ie->xmit_buffs[ie->xmit_count]->ie_xmit_flags = IE_XMIT_LAST | len; ie->xmit_buffs[ie->xmit_count]->ie_xmit_next = 0xffff; - ie->xmit_buffs[ie->xmit_count]->ie_xmit_buf = + ie->xmit_buffs[ie->xmit_count]->ie_xmit_buf = MK_24(ie->iomem, ie->xmit_cbuffs[ie->xmit_count]); ie->xmit_cmds[ie->xmit_count]->com.ie_cmd_cmd = IE_CMD_XMIT; ie->xmit_cmds[ie->xmit_count]->ie_xmit_status = 0; - ie->xmit_cmds[ie->xmit_count]->ie_xmit_desc = + ie->xmit_cmds[ie->xmit_count]->ie_xmit_desc = MK_16(ie->iomem, ie->xmit_buffs[ie->xmit_count]); *bptr = MK_16(ie->iomem, ie->xmit_cmds[ie->xmit_count]); @@ -1334,7 +1334,7 @@ iestart(ifp) * If we queued up anything for transmission, send it. */ if(ie->xmit_count) { - ie->xmit_cmds[ie->xmit_count - 1]->com.ie_cmd_cmd |= + ie->xmit_cmds[ie->xmit_count - 1]->com.ie_cmd_cmd |= IE_CMD_LAST | IE_CMD_INTR; /* @@ -1369,7 +1369,7 @@ int check_ie_present(unit, where, size) scp = (volatile struct ie_sys_conf_ptr *)(realbase + IE_SCP_ADDR); bzero((char *)scp, sizeof *scp); /* ignore cast-qual */ - + /* * First we put the ISCP at the bottom of memory; this tests to make * sure that our idea of the size of memory is the same as the controller's. @@ -1402,7 +1402,7 @@ int check_ie_present(unit, where, size) * Now relocate the ISCP to its real home, and reset the controller * again. */ - iscp = (void *)Align((caddr_t)(realbase + IE_SCP_ADDR - + iscp = (void *)Align((caddr_t)(realbase + IE_SCP_ADDR - sizeof(struct ie_int_sys_conf_ptr))); bzero((char *)iscp, sizeof *iscp); /* ignore cast-qual */ @@ -1526,7 +1526,7 @@ iereset(unit) ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP; ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0); - + splx(s); return; } @@ -1561,7 +1561,7 @@ static int command_and_wait(unit, cmd, pcmd, mask) extern int hz; ie_softc[unit].scb->ie_command = (u_short)cmd; - + if(IE_ACTION_COMMAND(cmd) && pcmd) { (*ie_softc[unit].ie_chan_attn)(unit); @@ -1589,7 +1589,7 @@ static int command_and_wait(unit, cmd, pcmd, mask) return timedout; } else { - + /* * Otherwise, just wait for the command to be accepted. */ @@ -1624,7 +1624,7 @@ static void run_tdr(unit, cmd) else result = cmd->ie_tdr_time; - ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, + ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, ie_softc[unit].ie_chan_attn); if(result & IE_TDR_SUCCESS) @@ -1633,7 +1633,7 @@ static void run_tdr(unit, cmd) if(result & IE_TDR_XCVR) { printf("ie%d: transceiver problem\n", unit); } else if(result & IE_TDR_OPEN) { - printf("ie%d: TDR detected an open %d clocks away\n", unit, + printf("ie%d: TDR detected an open %d clocks away\n", unit, result & IE_TDR_TIME); } else if(result & IE_TDR_SHORT) { printf("ie%d: TDR detected a short %d clocks away\n", unit, @@ -1674,13 +1674,13 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { } ptr = (caddr_t)Align((caddr_t)rfd); /* ignore cast-qual */ - + /* Now link them together */ for(i = 0; i < NFRAMES; i++) { ie->rframes[i]->ie_fd_next = MK_16(MEM, ie->rframes[(i + 1) % NFRAMES]); } - + /* Finally, set the EOL bit on the last one. */ ie->rframes[NFRAMES - 1]->ie_fd_last |= IE_FD_LAST; @@ -1701,12 +1701,12 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { ptr += IE_RBUF_SIZE; rbd = (void *)ptr; } - + /* Now link them together */ for(i = 0; i < NBUFFS; i++) { ie->rbuffs[i]->ie_rbd_next = MK_16(MEM, ie->rbuffs[(i + 1) % NBUFFS]); } - + /* Tag EOF on the last one */ ie->rbuffs[NBUFFS - 1]->ie_rbd_length |= IE_RBD_LAST; @@ -1728,21 +1728,21 @@ static caddr_t setup_rfa(caddr_t ptr, struct ie_softc *ie) { * Run the multicast setup command. * Call at splimp(). */ -static int mc_setup(int unit, caddr_t ptr, +static int mc_setup(int unit, caddr_t ptr, volatile struct ie_sys_ctl_block *scb) { struct ie_softc *ie = &ie_softc[unit]; volatile struct ie_mcast_cmd *cmd = (void *)ptr; - + cmd->com.ie_cmd_status = 0; cmd->com.ie_cmd_cmd = IE_CMD_MCAST | IE_CMD_LAST; cmd->com.ie_cmd_link = 0xffff; - + /* ignore cast-qual */ bcopy((caddr_t)ie->mcast_addrs, (caddr_t)cmd->ie_mcast_addrs, ie->mcast_count * sizeof *ie->mcast_addrs); cmd->ie_mcast_bytes = ie->mcast_count * 6; /* grrr... */ - + scb->ie_command_list = MK_16(MEM, cmd); if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { @@ -1934,7 +1934,7 @@ ieioctl(ifp, command, data) ie_stop(ifp->if_unit); } else if((ifp->if_flags & IFF_UP) && (ifp->if_flags & IFF_RUNNING) == 0) { - ie_softc[ifp->if_unit].promisc = + ie_softc[ifp->if_unit].promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); ieinit(ifp->if_unit); } else if(ie_softc[ifp->if_unit].promisc ^ diff --git a/sys/i386/isa/if_ix.c b/sys/i386/isa/if_ix.c index 87dfe7f..cf6158f 100644 --- a/sys/i386/isa/if_ix.c +++ b/sys/i386/isa/if_ix.c @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_ix.c,v 1.5 1995/03/02 08:17:14 rgrimes Exp $ + * $Id: if_ix.c,v 1.6 1995/05/10 15:19:25 rgrimes Exp $ */ #include "ix.h" @@ -431,7 +431,7 @@ ixprobe(struct isa_device *dvp) { goto ixprobe_exit; } } - + if ((kvtop(dvp->id_maddr) < 0xC0000) || (kvtop(dvp->id_maddr) + dvp->id_msize > 0xF0000)) { printf("ixprobe mapped memory address out of range\n"); @@ -573,7 +573,7 @@ ixattach(struct isa_device *dvp) { ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_NOTRAILERS | IFF_BROADCAST; /* - * This is commented out to save memory and cpu time + * This is commented out to save memory and cpu time * ifp->if_timer = 0; * ifp->if_metric = 0; * ifp->if_addrlist = 0; @@ -592,7 +592,7 @@ ixattach(struct isa_device *dvp) { ifp->if_reset = ixreset; ifp->if_watchdog = ixwatchdog; /* - * This is commented out to save memory and cpu time + * This is commented out to save memory and cpu time * ifp->if_ipackets = 0; * ifp->if_ierrors = 0; * ifp->if_opackets = 0; @@ -605,7 +605,7 @@ ixattach(struct isa_device *dvp) { ifp->if_addrlen = ETHER_ADDRESS_LENGTH; ifp->if_hdrlen = ETHER_HEADER_LENGTH; /* - * This is commented out to save memory and cpu time + * This is commented out to save memory and cpu time * ifp->if_index = 0; * ifp->if_lastchange.tv_sec = 0; * ifp->if_lastchange.tv_usec = 0; @@ -770,7 +770,7 @@ ixinit(int unit) { collision detect source external */ cb_conf->byte[10] = 60; /* minimum number of bytes is a frame */ cb_conf->byte[11] = 0; /* unused */ - + scb->command = SCB_CUC_START; ixchannel_attention(unit); status |= ix_cb_wait((cb_t *)cb_conf, "Configure"); @@ -859,7 +859,7 @@ ixinit_rfa(int unit) { rbd = (rbd_t *)(sc->maddr + RFA_START + (how_many_frames * sizeof(rfd_t))); - rb = sc->maddr + RFA_START + + rb = sc->maddr + RFA_START + (how_many_frames * (sizeof(rfd_t) + sizeof(rbd_t))); sc->rfd_head = rfd; sc->rbd_head = rbd; @@ -906,7 +906,7 @@ ixinit_rfa(int unit) { rbd = (rbd_t *)(sc->maddr + RFA_START + (how_many_frames * sizeof(rfd_t))); - rb = sc->maddr + RFA_START + + rb = sc->maddr + RFA_START + (how_many_frames * (sizeof(rfd_t) + sizeof(rbd_t))); printf(" complete_frame_size = %d\n", complete_frame_size); printf(" how_many_frames = %d\n", how_many_frames); @@ -976,7 +976,7 @@ ixinit_tfa(int unit) { tbd = (tbd_t *)(sc->maddr + TFA_START + (TB_COUNT * sizeof(cb_transmit_t))); - tb = sc->maddr + TFA_START + + tb = sc->maddr + TFA_START + (TB_COUNT * (sizeof(cb_transmit_t) + sizeof(tbd_t))); sc->cb_head = (cb_t *)cb; sc->tbd_head = tbd; @@ -1013,7 +1013,7 @@ ixinit_tfa(int unit) { tbd = (tbd_t *)(sc->maddr + TFA_START + (TB_COUNT * sizeof(cb_transmit_t))); - tb = sc->maddr + TFA_START + + tb = sc->maddr + TFA_START + (TB_COUNT * (sizeof(cb_transmit_t) + sizeof(tbd_t))); printf(" TB_COUNT = %d\n", TB_COUNT); printf(" cb_head = %lx\t\tcb_tail = %lx\n", @@ -1109,7 +1109,7 @@ ixintr(int unit) { if (check_queue && ifp->if_snd.ifq_head != 0) { ixstart(ifp); /* we have stuff on the queue */ } - + ixintr_exit: DEBUGBEGIN(DEBUGINTR) DEBUGDO(printf(" ixintr exited\n");) @@ -1415,7 +1415,7 @@ ixstart(struct ifnet *ifp) { IF_DEQUEUE(&ifp->if_snd, m); length = 0; for (m_temp = m; m_temp != 0; m_temp = m_temp->m_next) { - bcopy(mtod(m_temp, caddr_t), tb, m_temp->m_len); + bcopy(mtod(m_temp, caddr_t), tb, m_temp->m_len); tb += m_temp->m_len; length += m_temp->m_len; } @@ -1427,7 +1427,7 @@ ixstart(struct ifnet *ifp) { * This should never ever happen, if it does * we probable screwed up all sorts of board data * in the above bcopy's and should probably shut - * down, but for now just issue a warning that + * down, but for now just issue a warning that * something is real wrong */ printf("ix%d: ixstart: Packet length=%d > MTU=%d\n", diff --git a/sys/i386/isa/if_ixreg.h b/sys/i386/isa/if_ixreg.h index 722e104..3dd4903 100644 --- a/sys/i386/isa/if_ixreg.h +++ b/sys/i386/isa/if_ixreg.h @@ -28,7 +28,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_ixreg.h,v 1.4 1995/03/02 07:40:27 rgrimes Exp $ + * $Id: if_ixreg.h,v 1.5 1995/05/10 15:19:29 rgrimes Exp $ */ /* @@ -126,7 +126,7 @@ * Receive Frame Descriptors * Receive Frames * SCB_ADDR System Control Block - * ISCP_ADDR Intermediate System Configuration Pointer + * ISCP_ADDR Intermediate System Configuration Pointer * High: SCP_ADDR System Configuration Pointer */ #define SCP_ADDR (sc->msize - sizeof(scp_t)) @@ -275,7 +275,7 @@ typedef struct /* command block - transmit command */ u_char byte[16]; /* XXX stupid fill tell I fix the ixinit * code for the special cb's */ } cb_transmit_t; - + typedef struct /* command block - tdr command */ { cb_t common; /* common part of all command blocks */ diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c index 9fb21f3..0f93c75 100644 --- a/sys/i386/isa/if_le.c +++ b/sys/i386/isa/if_le.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_le.c,v 1.15 1995/04/17 05:52:17 bde Exp $ + * $Id: if_le.c,v 1.16 1995/05/09 12:25:55 rgrimes Exp $ */ /* @@ -204,7 +204,7 @@ struct le_lance_info { /* * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of Common Code + * Start of Common Code * */ @@ -258,7 +258,7 @@ struct le_board { int (*bd_probe)(le_softc_t *sc, const le_board_t *bd, int *msize); }; - + le_softc_t le_softc[NLE]; const le_board_t le_boards[] = { @@ -374,7 +374,7 @@ le_probe( return iospace; } } - printf("%s%d: no board found at 0x%x\n", + printf("%s%d: no board found at 0x%x\n", sc->le_if.if_name, sc->le_if.if_unit, dvp->id_iobase); return 0; } @@ -388,7 +388,7 @@ le_attach( struct ifaddr *ifa = ifp->if_addrlist; ifp->if_mtu = ETHERMTU; - printf("%s%d: %s ethernet address %s\n", + printf("%s%d: %s ethernet address %s\n", ifp->if_name, ifp->if_unit, sc->le_prodname, ether_sprintf(sc->le_ac.ac_enaddr)); @@ -400,7 +400,7 @@ le_attach( ifp->if_type = IFT_ETHER; ifp->if_addrlen = 6; ifp->if_hdrlen = 14; - + #if NBPFILTER > 0 bpfattach(&sc->le_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); #endif @@ -630,7 +630,7 @@ le_ioctl( } splx(s); - kdc_le[ifp->if_unit].kdc_state = (ifp->if_flags & IFF_UP) + kdc_le[ifp->if_unit].kdc_state = (ifp->if_flags & IFF_UP) ? DC_BUSY : DC_IDLE; return error; } @@ -646,15 +646,15 @@ le_read_macaddr( int skippat) { int cksum, rom_cksum; - + if (!skippat) { int idx, idx2, found, octet; static u_char testpat[] = { 0xFF, 0, 0x55, 0xAA, 0xFF, 0, 0x55, 0xAA }; idx2 = found = 0; - + for (idx = 0; idx < 32; idx++) { octet = LE_INB(sc, ioreg); - + if (octet == testpat[idx2]) { if (++idx2 == sizeof testpat) { ++found; @@ -664,7 +664,7 @@ le_read_macaddr( idx2 = 0; } } - + if (!found) return -1; } @@ -691,7 +691,7 @@ le_read_macaddr( rom_cksum = LE_INB(sc, ioreg); rom_cksum |= LE_INB(sc, ioreg) << 8; - + if (cksum != rom_cksum) return -1; return 0; @@ -746,7 +746,7 @@ le_multi_op( u_int idx, bit, data, crc = 0xFFFFFFFFUL; #ifdef __alpha - for (data = *(__unaligned u_long *) mca, bit = 0; bit < 48; bit++, data >>= + for (data = *(__unaligned u_long *) mca, bit = 0; bit < 48; bit++, data >>= 1) crc = (crc >> 1) ^ (((crc ^ data) & 1) ? LE_CRC32_POLY : 0); #else @@ -756,7 +756,7 @@ le_multi_op( #endif /* * The following two line convert the N bit index into a longword index - * and a longword mask. + * and a longword mask. */ crc &= sc->le_mcmask; bit = 1 << (crc & (LE_MC_NBPW -1)); @@ -776,7 +776,7 @@ le_multi_op( /* * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of DEC EtherWORKS III (LEMAC) dependent code + * Start of DEC EtherWORKS III (LEMAC) dependent code * */ @@ -894,7 +894,7 @@ lemac_probe( return LEMAC_IOSPACE; } -/* +/* * Do a hard reset of the board; */ static void @@ -923,7 +923,7 @@ lemac_reset( * is important because functions hereafter may rely on information * read from the EEPROM. */ - if ((cksum = lemac_read_eeprom(sc)) != LEMAC_EEP_CKSUM) { + if ((cksum = lemac_read_eeprom(sc)) != LEMAC_EEP_CKSUM) { printf("%s%d: reset: EEPROM checksum failed (0x%x)\n", sc->le_if.if_name, sc->le_if.if_unit, cksum); return; @@ -1068,7 +1068,7 @@ lemac_rne_intr( while (rxcount--) { rxpg = LE_INB(sc, LEMAC_REG_RQ); LE_OUTB(sc, LEMAC_REG_MPN, rxpg); - + rxptr = sc->le_membase; sc->le_if.if_ipackets++; if (*rxptr & LEMAC_RX_OK) { @@ -1085,7 +1085,7 @@ lemac_rne_intr( next: LE_OUTB(sc, LEMAC_REG_FMQ, rxpg); /* Return this page to Free Memory Queue */ } /* end while (recv_count--) */ - + return; } @@ -1140,7 +1140,7 @@ lemac_rxd_intr( return; } -static void +static void lemac_start( struct ifnet *ifp) { @@ -1381,7 +1381,7 @@ struct { #define LN_WRCSR(sc, val) (LE_OUTW(sc, sc->lance_rdp, val)) #define LN_RDCSR(sc) (LE_INW(sc, sc->lance_rdp)) - + #define LN_ZERO(sc, vaddr, len) bzero(vaddr, len) #define LN_COPYTO(sc, from, to, len) bcopy(from, to, len) @@ -1441,7 +1441,7 @@ typedef enum { DEPCA_UNKNOWN } depca_t; -static const char *depca_signatures[] = { +static const char *depca_signatures[] = { "DEPCA", "DE100", "DE101", "EE100", @@ -1465,7 +1465,7 @@ depca_probe( */ nicsr = DEPCA_RDNICSR(sc); nicsr &= ~(DEPCA_NICSR_SHE|DEPCA_NICSR_LED|DEPCA_NICSR_ENABINTR); - + if (nicsr & DEPCA_NICSR_32KRAM) { /* * Make we are going to read the upper @@ -1558,7 +1558,7 @@ depca_intr( } /* - * Here's as good a place to describe our paritioning of the + * Here's as good a place to describe our paritioning of the * LANCE shared RAM space. (NOTE: this driver does not yet support * the concept of a LANCE being able to DMA). * @@ -1946,7 +1946,7 @@ lance_rx_intr( } else { /* * If the packet is bad, increment the - * counters. + * counters. */ sc->le_if.if_ierrors++; if (desc.d_flag & LN_DFLAG_RxBADCRC) @@ -1991,7 +1991,7 @@ lance_start( IF_DEQUEUE(ifq, m); if (m == NULL) break; - + /* * Make the packet meets the minimum size for Ethernet. * The slop is so that we also use an even number of longwards. @@ -2020,7 +2020,7 @@ lance_start( LN_STAT(tx_nospc[0]++); break; } - + if (len + slop > ri->ri_heapend - ri->ri_outptr) { /* * Since the packet won't fit in the end of the transmit @@ -2039,7 +2039,7 @@ lance_start( ri->ri_outptr = ri->ri_heap; LN_STAT(tx_adoptions++); } - + /* * Initialize the descriptor (saving the buffer address, * buffer length, and mbuf) and write the packet out @@ -2106,7 +2106,7 @@ lance_tx_intr( ln_desc_t desc; LN_GETDESC(sc, &desc, ri->ri_nextin->di_addr); - if (desc.d_flag & LN_DFLAG_OWNER) + if (desc.d_flag & LN_DFLAG_OWNER) break; if (desc.d_flag & (LN_DFLAG_TxONECOLL|LN_DFLAG_TxMULTCOLL)) diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c index 8477f58..1366236 100644 --- a/sys/i386/isa/if_lnc.c +++ b/sys/i386/isa/if_lnc.c @@ -6,8 +6,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -35,28 +35,28 @@ /* #define DIAGNOSTIC #define DEBUG - * + * * TODO ---- * * This driver will need bounce buffer support when dma'ing to mbufs above the * 16Mb mark. - * + * * Check all the XXX comments -- some of them are just things I've left * unfinished rather than "difficult" problems that were hacked around. - * + * * Check log settings. - * + * * Check how all the arpcom flags get set and used. - * + * * Re-inline and re-static all routines after debugging. - * + * * Remember to assign iobase in SHMEM probe routines. - * + * * Replace all occurences of LANCE-controller-card etc in prints by the name * strings of the appropriate type -- nifty window dressing - * - * Add DEPCA support -- mostly done. - * + * + * Add DEPCA support -- mostly done. + * */ #include "lnc.h" @@ -175,7 +175,7 @@ lnc_registerdev(struct isa_device *isa_dev) struct kern_devconf *kdc = &sc->kdc; *kdc = kdc_lnc; kdc->kdc_unit = isa_dev->id_unit; - kdc->kdc_parentdata = isa_dev; + kdc->kdc_parentdata = isa_dev; switch(sc->nic.ic) { case LANCE: @@ -209,7 +209,7 @@ lnc_registerdev(struct isa_device *isa_dev) default: break; } - + dev_attach(kdc); } @@ -270,7 +270,7 @@ alloc_mbuf_cluster(struct lnc_softc *sc, struct host_ring_entry *desc) /* XXX m->m_data = m->m_ext.ext_buf;*/ } else { MGET(m, M_DONTWAIT, MT_DATA); - if (!m) + if (!m) return(1); MCLGET(m, M_DONTWAIT); if (!m->m_ext.ext_buf) { @@ -320,7 +320,7 @@ chain_mbufs(struct lnc_softc *sc, int start_of_packet, int pkt_len) m->m_next = 0; return(head); -} +} inline struct mbuf * mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len) @@ -415,7 +415,7 @@ lnc_rint(int unit) * Therefore, it can be assumed that a complete packet can be found * before hitting buffers that are still owned by the LANCE, if not * then there is a bug in the driver that is causing the descriptors - * to get out of sync. + * to get out of sync. */ #ifdef DIAGNOSTIC @@ -443,8 +443,8 @@ lnc_rint(int unit) * jabber packets can overrun into a second descriptor. * If there is no error, then the ENP flag is set in the last * descriptor of the packet. If there is an error then the ERR - * flag will be set in the descriptor where the error occured. - * Therefore, to find the last buffer of a packet we search for + * flag will be set in the descriptor where the error occured. + * Therefore, to find the last buffer of a packet we search for * either ERR or ENP. */ @@ -533,7 +533,7 @@ lnc_rint(int unit) if (head) { /* - * First mbuf in packet holds the + * First mbuf in packet holds the * ethernet and packet headers */ head->m_pkthdr.rcvif = &sc->arpcom.ac_if; @@ -627,7 +627,7 @@ lnc_tint(int unit) * status will be written into the descriptor that was being accessed * when the error occured and all subsequent descriptors in that * packet will have been relinquished by the LANCE. - * + * * At this point we know that sc->trans_next points to the start * of a packet that the LANCE has just finished trying to transmit. * We now search for a buffer with either ENP or ERR set. @@ -648,7 +648,7 @@ lnc_tint(int unit) #endif /* - * Find end of packet. + * Find end of packet. */ if (!(next->md->md1 & (ENP | MDERR))) { @@ -717,7 +717,7 @@ lnc_tint(int unit) * set then TBUFF will have been cleared above. A * UFLO error will turn off the transmitter so we * have to reset. - * + * */ if (next->md->md3 & UFLO) { @@ -759,7 +759,7 @@ lnc_tint(int unit) * ERR would have also been set and we would have * returned from lnc_tint above. Therefore we can * assume if we arrive here that ONE is valid. - * + * */ if (next->md->md1 & ONE) { @@ -810,7 +810,7 @@ lnc_tint(int unit) } while (sc->pending_transmits && !(next->md->md1 & OWN)); /* - * Clear TINT since we've dealt with all + * Clear TINT since we've dealt with all * the completed transmissions. */ @@ -887,7 +887,7 @@ int i; * There isn't any way to determine if a NIC is a BICC. Basically, if * the lance probe succeeds using the i/o addresses of the BICC then * we assume it's a BICC. - * + * */ sc->rap = isa_dev->id_iobase + BICC_RAP; @@ -1035,14 +1035,14 @@ lnc_attach(struct isa_device * isa_dev) /* * Allocate memory for use by the controller. - * + * * XXX -- the Am7990 and Am79C960 only have 24 address lines and so can * only access the lower 16Mb of physical memory. For the moment we * assume that malloc will allocate memory within the lower 16Mb * range. This is not a very valid assumption but there's nothing * that can be done about it yet. For shared memory NICs this isn't * relevant. - * + * */ lnc_mem_size = ((NDESC(sc->nrdre) + NDESC(sc->ntdre)) * @@ -1139,7 +1139,7 @@ lnc_init(int unit) * on a word boundary),the transmit and receive ring structures (each * entry is 4 words long and must start on a quadword boundary) and * the data buffers. - * + * * The alignment tests are particularly paranoid. */ @@ -1248,7 +1248,7 @@ lnc_init(int unit) * For the Am7990 it controls DMA operations, for the Am79C960 it * controls interrupt masks and transmitter algorithms. In either * case, none of the flags are set. - * + * */ write_csr(unit, CSR3, 0); @@ -1286,13 +1286,13 @@ lnc_init(int unit) * The interrupt flag (INTR) will be set and provided that the interrupt enable * flag (INEA) is also set, the interrupt pin will be driven low when any of * the following occur: - * + * * 1) Completion of the initialisation routine (IDON). 2) The reception of a * packet (RINT). 3) The transmission of a packet (TINT). 4) A transmitter * timeout error (BABL). 5) A missed packet (MISS). 6) A memory error (MERR). - * + * * The interrupt flag is cleared when all of the above conditions are cleared. - * + * * If the driver is reset from this routine then it first checks to see if any * interrupts have ocurred since the reset and handles them before returning. * This is because the NIC may signify a pending interrupt in CSR0 using the @@ -1300,7 +1300,7 @@ lnc_init(int unit) * think it does from reading the data sheets). We may as well deal with * these pending interrupts now rather than get the overhead of another * hardware interrupt immediately upon returning from the interrupt handler. - * + * */ void @@ -1440,7 +1440,7 @@ lnc_start(struct ifnet *ifp) no_entries_needed++; /* - * We try and avoid bcopy as much as possible + * We try and avoid bcopy as much as possible * but there are two cases when we use it. * * 1) If there are not enough free entries in the ring @@ -1452,7 +1452,7 @@ lnc_start(struct ifnet *ifp) * packet so it's necessary to shuffle the mbuf * contents to ensure this. */ - + if (no_entries_needed > (NDESC(sc->ntdre) - sc->pending_transmits)) if (!(head = chain_to_cluster(head))) { @@ -1465,9 +1465,9 @@ lnc_start(struct ifnet *ifp) len = 100 - head->m_len; if (M_TRAILINGSPACE(head) < len) { /* - * Move data to start of data - * area. We assume the first - * mbuf has a packet header + * Move data to start of data + * area. We assume the first + * mbuf has a packet header * and is not a cluster. */ bcopy((caddr_t)head->m_data, (caddr_t)head->m_pktdat, head->m_len); @@ -1564,7 +1564,7 @@ lnc_start(struct ifnet *ifp) } while (sc->pending_transmits < NDESC(sc->ntdre)); /* - * Transmit ring is full so set IFF_OACTIVE + * Transmit ring is full so set IFF_OACTIVE * since we can't buffer any more packets. */ @@ -1633,7 +1633,7 @@ lnc_ioctl(struct ifnet * ifp, int command, caddr_t data) */ lnc_init(ifp->if_unit); } - sc->kdc.kdc_state = + sc->kdc.kdc_state = ((ifp->if_flags & IFF_UP) ? DC_BUSY : DC_IDLE); break; #ifdef notyet diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c index 9315a60..b1de9e6 100644 --- a/sys/i386/isa/if_ze.c +++ b/sys/i386/isa/if_ze.c @@ -4,7 +4,7 @@ * [2] parse tuples to find out where to map the shared memory buffer, * and what to write into the configuration register * [3] move pcic-specific code into a separate module. - * + * * Device driver for IBM PCMCIA Credit Card Adapter for Ethernet, * if_ze.c * @@ -38,16 +38,16 @@ */ /* * I doubled delay loops in this file because it is not enough for some - * laptop machines' PCIC (especially, on my Chaplet ILFA 350 ^^;). + * laptop machines' PCIC (especially, on my Chaplet ILFA 350 ^^;). * HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> - */ + */ /* * Very small patch for IBM Ethernet PCMCIA Card II and IBM ThinkPad230Cs. * ETO, Toshihisa <eto@osl.fujitsu.co.jp> */ /* - * $Id: if_ze.c,v 1.15 1995/05/03 22:58:07 phk Exp $ + * $Id: if_ze.c,v 1.16 1995/05/24 20:33:42 davidg Exp $ */ #include "ze.h" @@ -97,7 +97,7 @@ #if NAPM > 0 #include <machine/apm_bios.h> #endif /* NAPM > 0 */ - + /***************************************************************************** * Driver for Ethernet Adapter * @@ -109,7 +109,7 @@ struct ze_softc { caddr_t maddr; u_long iobase, irq; - + struct arpcom arpcom; /* ethernet common */ char *type_str; /* pointer to type string */ @@ -165,7 +165,7 @@ struct isa_driver zedriver = { static unsigned char enet_addr[6]; static unsigned char card_info[256]; - + #define CARD_INFO "IBM Corp.~Ethernet~0933495" /* @@ -228,7 +228,7 @@ ze_check_cis (unsigned char *scratch) * Probe each slot looking for an IBM Credit Card Adapter for Ethernet * For each card that we find, map its card information structure * into system memory at 'scratch' and see whether it's one of ours. - * Return the slot number if we find a card, or -1 otherwise. + * Return the slot number if we find a card, or -1 otherwise. * * Side effects: * + On success, leaves CIS mapped into memory at 'scratch'; @@ -277,13 +277,13 @@ ze_find_adapter (unsigned char *scratch, int reconfig) pcic_power_on (slot); pcic_reset (slot); /* - * map the card's attribute memory and examine its + * map the card's attribute memory and examine its * card information structure tuples for something * we recognize. */ pcic_map_memory (slot, 0, kvtop (scratch), 0L, 0xFFFL, ATTRIBUTE, 1); - + if ((ze_check_cis (scratch)) > 0) { /* found it */ if (!reconfig) { @@ -384,7 +384,7 @@ ze_probe(isa_dev) */ sc->nic_addr = sc->iobase; sc->smem_start = (caddr_t)sc->maddr; - + ze_setup(sc); tmp = inb (sc->iobase + ZE_RESET); @@ -407,7 +407,7 @@ ze_probe(isa_dev) /* get station address */ for (i = 0; i < ETHER_ADDR_LEN; ++i) sc->arpcom.ac_enaddr[i] = enet_addr[i]; - + isa_dev->id_msize = memsize; @@ -498,7 +498,7 @@ re_init: pcic_putb (slot, PCIC_GLO_CTRL, pcic_getb (slot, PCIC_GLO_CTRL) | PCIC_LVL_MODE); #endif - + #if 0 pcic_print_regs (slot); #endif @@ -519,8 +519,8 @@ re_init: tmp = inb (sc->iobase + ZE_MISC); /* - * Some Intel-compatible PCICs of Cirrus Logic fails in - * initializing them. This is a quick hack to fix this + * Some Intel-compatible PCICs of Cirrus Logic fails in + * initializing them. This is a quick hack to fix this * problem. * HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> */ @@ -553,7 +553,7 @@ ze_resume(isa_dev) return 0; } #endif /* NAPM > 0 */ - + /* * Install interface into kernel networking data structures */ @@ -591,7 +591,7 @@ ze_attach(isa_dev) else { sc->last_alive = 1; } - + /* * Set interface to stopped condition (reset) */ @@ -680,7 +680,7 @@ ze_attach(isa_dev) return 1; } - + /* * Reset interface. */ @@ -700,7 +700,7 @@ ze_reset(unit) (void) splx(s); } - + /* * Take interface offline. */ @@ -710,7 +710,7 @@ ze_stop(unit) { struct ze_softc *sc = &ze_softc[unit]; int n = 5000; - + /* * Stop everything on the interface, and select page 0 registers. */ @@ -742,15 +742,15 @@ ze_watchdog(unit) if(!(sc->arpcom.ac_if.if_flags & IFF_UP)) return; /* select page zero */ - outb (sc->nic_addr + ZE_P0_CR, + outb (sc->nic_addr + ZE_P0_CR, (inb (sc->nic_addr + ZE_P0_CR) & 0x3f) | ZE_CR_PAGE_0); /* read interrupt status register */ isr = inb (sc->nic_addr + ZE_P0_ISR) & 0xff; /* select page two */ - outb (sc->nic_addr + ZE_P0_CR, - (inb (sc->nic_addr + ZE_P0_CR) & 0x3f) | ZE_CR_PAGE_2); + outb (sc->nic_addr + ZE_P0_CR, + (inb (sc->nic_addr + ZE_P0_CR) & 0x3f) | ZE_CR_PAGE_2); /* read interrupt mask register */ imr = inb (sc->nic_addr + ZE_P2_IMR) & 0xff; @@ -767,7 +767,7 @@ ze_watchdog(unit) } /* - * Initialize device. + * Initialize device. */ void ze_init(unit) @@ -914,7 +914,7 @@ ze_init(unit) (void) splx(s); } - + /* * This routine actually starts the transmission on the interface */ @@ -949,11 +949,11 @@ ze_xmit(ifp) sc->xmit_busy = 1; sc->data_buffered = 0; - + /* * Switch buffers if we are doing double-buffered transmits */ - if ((sc->txb_next == 0) && (sc->txb_cnt > 1)) + if ((sc->txb_next == 0) && (sc->txb_cnt > 1)) sc->txb_next = 1; else sc->txb_next = 0; @@ -1067,7 +1067,7 @@ outloop: return; } } - + /* * Ethernet interface receiver interrupt. */ @@ -1222,8 +1222,8 @@ zeintr(unit) */ sc->arpcom.ac_if.if_timer = 0; } - - + + /* * Receiver Error. One or more of: CRC error, frame alignment error * FIFO overrun, or missed packet. @@ -1285,7 +1285,7 @@ zeintr(unit) } /* - * Receive Completion. Go and get the packet. + * Receive Completion. Go and get the packet. * XXX - Doing this on an error is dubious because there * shouldn't be any data to get (we've configured the * interface to not accept packets with errors). @@ -1326,7 +1326,7 @@ zeintr(unit) } } } - + /* * Process an ioctl request. This code needs some work - it looks * pretty ugly. @@ -1368,8 +1368,8 @@ ze_ioctl(ifp, command, data) ina->x_host = *(union ns_host *)(sc->arpcom.ac_enaddr); else { - /* - * + /* + * */ bcopy((caddr_t)ina->x_host.c_host, (caddr_t)sc->arpcom.ac_enaddr, @@ -1443,7 +1443,7 @@ ze_ioctl(ifp, command, data) (void) splx(s); return (error); } - + /* * Macro to calculate a new address within shared memory when given an offset * from an address, taking into account ring-wrap. @@ -1509,7 +1509,7 @@ ze_get_packet(sc, buf, len) #if NBPFILTER > 0 /* * Check if there's a BPF listener on this interface. - * If so, hand off the raw packet to bpf. + * If so, hand off the raw packet to bpf. */ if (sc->bpf) { bpf_mtap(sc->bpf, head); @@ -1610,7 +1610,7 @@ ze_ring_to_mbuf(sc,src,dst,total_len) * the cluster to. The mbuf that has a cluster * extension can not be used to contain data - only * the cluster can contain data. - */ + */ dst = m; MGET(m, M_DONTWAIT, MT_DATA); if (m == NULL) diff --git a/sys/i386/isa/if_zereg.h b/sys/i386/isa/if_zereg.h index 3cd501f..7eefd61 100644 --- a/sys/i386/isa/if_zereg.h +++ b/sys/i386/isa/if_zereg.h @@ -1,5 +1,5 @@ /* - * National Semiconductor DS8390 NIC register definitions + * National Semiconductor DS8390 NIC register definitions * * if_edreg.h,v * Revision 1.1.2.1 1993/07/21 13:50:04 cgd @@ -17,10 +17,10 @@ * Revision 1.2 93/06/23 03:03:05 davidg * added some additional definitions for the 83C584 bus interface * chip (SMC/WD boards) - * + * * Revision 1.1 93/06/23 03:01:07 davidg * Initial revision - * + * */ /* @@ -369,7 +369,7 @@ * algorithm to allow prioritization of nodes. */ #define ZE_TCR_OFST 0x10 - + /* * bits 5, 6, and 7 are unused/reserved */ diff --git a/sys/i386/isa/if_zp.c b/sys/i386/isa/if_zp.c index e9bbf50..5ac6b08 100644 --- a/sys/i386/isa/if_zp.c +++ b/sys/i386/isa/if_zp.c @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $ - * $Id: if_zp.c,v 1.4 1995/03/31 06:10:22 jkh Exp $ + * $Id: if_zp.c,v 1.5 1995/04/20 07:22:04 phk Exp $ */ /*- * TODO: @@ -443,7 +443,7 @@ zp_find_adapter(unsigned char *scratch, int reconfig) * or # of i/o addresses used (if found) */ #ifdef MACH_KERNEL -int +int zpprobe(port, dev) struct bus_device *dev; #else /* MACH_KERNEL */ @@ -521,7 +521,7 @@ re_init: * space by 0x20000. normally we could get this offset from the card * information structure, but I'm too lazy and am not quite sure if I * understand the CIS anyway. - * + * * XXX IF YOU'RE TRYING TO PORT THIS DRIVER FOR A DIFFERENT PCMCIA CARD, the * most likely thing to change is the constant 0x20000 in the next * statement. Oh yes, also change the card id string that we probe for. @@ -542,7 +542,7 @@ re_init: * respond to any i/o signals until we do this; it uses the Memory Only * interface (whatever that is; it's not documented). Also turn on * "level" (not pulse) interrupts. - * + * * XXX probably should init the socket and copy register also, so that we * can deal with multiple instances of the same card. */ @@ -567,10 +567,10 @@ re_init: /* * (4) map i/o ports. - * + * * XXX is it possible that the config file leaves this unspecified, in which * case we have to pick one? - * + * * At least one PCMCIA device driver I'v seen maps a block of 32 consecutive * i/o ports as two windows of 16 ports each. Maybe some other pcic chips * are restricted to 16-port windows; the 82365SL doesn't seem to have @@ -589,7 +589,7 @@ re_init: /* * (5) configure the card for the desired interrupt - * + * * XXX is it possible that the config file leaves this unspecified? */ pcic_map_irq(slot, ffs(isa_dev->id_irq) - 1); @@ -743,7 +743,7 @@ zp_resume(isa_dev) */ #ifdef MACH_KERNEL -void +void zpattach(dev) struct bus_device *dev; #else /* MACH_KERNEL */ @@ -1414,7 +1414,7 @@ readcheck: } #ifdef MACH_KERNEL -int +int zpopen(dev, flag) dev_t dev; int flag; @@ -1433,7 +1433,7 @@ zpopen(dev, flag) return (0); } -int +int zpoutput(dev, ior) dev_t dev; io_req_t ior; @@ -1455,7 +1455,7 @@ zpoutput(dev, ior) return (result); } -int +int zpsetinput(dev, receive_port, priority, filter, filter_count) dev_t dev; mach_port_t receive_port; @@ -1858,7 +1858,7 @@ out:outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK); #ifdef MACH_KERNEL -int +int zpgetstat(dev, flavor, status, count) dev_t dev; int flavor; @@ -1877,7 +1877,7 @@ zpgetstat(dev, flavor, status, count) return (net_getstat(&zp_softc[unit].ds_if, flavor, status, count)); } -int +int zpsetstat(dev, flavor, status, count) dev_t dev; int flavor; diff --git a/sys/i386/isa/if_zpreg.h b/sys/i386/isa/if_zpreg.h index f8f184a..a1eb1f5 100644 --- a/sys/i386/isa/if_zpreg.h +++ b/sys/i386/isa/if_zpreg.h @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_epreg.h,v 1.2 1994/01/10 19:13:50 ats Exp $ + * $Id: if_zpreg.h,v 1.1 1995/02/17 02:22:53 phk Exp $ */ /************************************************************************** * * @@ -91,7 +91,7 @@ #define EP_W2_ADDR_1 0x01 #define EP_W2_ADDR_0 0x00 -/* +/* * Window 3 registers. FIFO Management. */ /* Read */ diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index c4a2455..1dd0fb9 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.48 1995/05/11 05:20:43 jkh Exp $ + * $Id: isa.c,v 1.49 1995/05/13 00:09:38 jkh Exp $ */ /* @@ -334,7 +334,7 @@ isa_configure() { * SLIPDISC. No need to block out ALL ttys during a splimp when only one * of them is running slip. * - * XXX actually, blocking all ttys during a splimp doesn't matter so much + * XXX actually, blocking all ttys during a splimp doesn't matter so much * with sio because the serial interrupt layer doesn't use tty_imask. Only * non-serial ttys suffer. It's more stupid that ALL 'net's are blocked * during spltty. @@ -372,8 +372,8 @@ isa_configure() { /* * Configure an ISA device. */ - - + + static void config_isadev(isdp, mp) struct isa_device *isdp; @@ -381,7 +381,7 @@ config_isadev(isdp, mp) { config_isadev_c(isdp, mp, 0); } - + void reconfig_isadev(isdp, mp) struct isa_device *isdp; @@ -400,7 +400,7 @@ config_isadev_c(isdp, mp, reconfig) int id_alive; int last_alive; struct isa_driver *dp = isdp->id_driver; - + checkbits = 0; checkbits |= CC_DRQ; checkbits |= CC_IOADDR; @@ -464,11 +464,11 @@ config_isadev_c(isdp, mp, reconfig) } printf("\n"); /* - * Check for conflicts again. The driver may have - * changed *dvp. We should weaken the early check - * since the driver may have been able to change - * *dvp to avoid conflicts if given a chance. We - * already skip the early check for IRQs and force + * Check for conflicts again. The driver may have + * changed *dvp. We should weaken the early check + * since the driver may have been able to change + * *dvp to avoid conflicts if given a chance. We + * already skip the early check for IRQs and force * a check for IRQs in the next group of checks. */ checkbits |= CC_IRQ; @@ -497,12 +497,12 @@ config_isadev_c(isdp, mp, reconfig) } printf("\n"); } - } + } else { /* This code has not been tested.... */ if (isdp->id_irq) { INTRDIS(isdp->id_irq); - unregister_intr(ffs(isdp->id_irq) - 1, + unregister_intr(ffs(isdp->id_irq) - 1, isdp->id_intr); if (mp) INTRUNMASK(*mp, isdp->id_irq); @@ -593,7 +593,7 @@ eisa_generic_externalize(struct proc *p, struct kern_devconf *kdc, * during configuration of kernel, setup interrupt control unit */ void -isa_defaultirq() +isa_defaultirq() { int i; @@ -643,7 +643,7 @@ static short dmapageport[8] = void isa_dmacascade(unsigned chan) { if (chan > 7) - panic("isa_dmacascade: impossible request"); + panic("isa_dmacascade: impossible request"); /* set dma channel mode, and set dma channel mode */ if ((chan & 4) == 0) { @@ -670,7 +670,7 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan) if ( chan > 7 || (chan < 4 && nbytes > (1<<16)) || (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1))) - panic("isa_dmastart: impossible request"); + panic("isa_dmastart: impossible request"); if (isa_dmarangecheck(addr, nbytes, chan)) { if (dma_bounce[chan] == 0) @@ -818,7 +818,7 @@ static void (*isaphysmemunblock)(); /* needs to be a list */ */ caddr_t isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) { - + isaphysmemunblock = func; while (isaphysmemflag & B_BUSY) { isaphysmemflag |= B_WANTED; @@ -844,7 +844,7 @@ isa_freephysmem(caddr_t va, unsigned length) { (*isaphysmemunblock)(); } } - + #define NMI_PARITY (1 << 7) #define NMI_IOCHAN (1 << 6) #define ENMI_WATCHDOG (1 << 7) @@ -856,7 +856,7 @@ isa_freephysmem(caddr_t va, unsigned length) { * return true to panic system, false to ignore. */ int -isa_nmi(cd) +isa_nmi(cd) int cd; { int isa_port = inb(0x61); @@ -930,7 +930,7 @@ struct isa_device *find_isadev(table, driverp, unit) while ((table->id_driver != driverp) || (table->id_unit != unit)) { if (table->id_driver == 0) return NULL; - + table++; } diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c index 942b45a..97225a8 100644 --- a/sys/i386/isa/joy.c +++ b/sys/i386/isa/joy.c @@ -41,7 +41,7 @@ #include <i386/isa/isa_device.h> #include <i386/isa/timerreg.h> -/* The game port can manage 4 buttons and 4 variable resistors (usually 2 +/* The game port can manage 4 buttons and 4 variable resistors (usually 2 * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. * Getting the state of the buttons is done by reading the game port: * buttons 1-4 correspond to bits 4-7 and resistors 1-4 (X1, Y1, X2, Y2) @@ -52,7 +52,7 @@ */ -/* the formulae below only work if u is ``not too large''. See also +/* the formulae below only work if u is ``not too large''. See also * the discussion in microtime.s */ #define usec2ticks(u) (((u) * 19549)>>14) #define ticks2usec(u) (((u) * 3433)>>12) @@ -114,7 +114,7 @@ joyopen (dev_t dev, int flag) joy[unit].timeout[i] = JOY_TIMEOUT; return 0; } -int +int joyclose (dev_t dev, int flag) { int unit = UNIT (dev); @@ -132,7 +132,7 @@ joyread (dev_t dev, struct uio *uio, int flag) int i, t0, t1; int state = 0, x = 0, y = 0; struct joystick c; - + disable_intr (); outb (port, 0xff); t0 = get_tick (); @@ -140,7 +140,7 @@ joyread (dev_t dev, struct uio *uio, int flag) i = usec2ticks(joy[unit].timeout[joypart(dev)]); while (t0-t1 < i) { state = inb (port); - if (joypart(dev) == 1) + if (joypart(dev) == 1) state >>= 2; t1 = get_tick (); if (t1 > t0) @@ -149,7 +149,7 @@ joyread (dev_t dev, struct uio *uio, int flag) x = t1; if (!y && !(state & 0x02)) y = t1; - if (x && y) + if (x && y) break; } enable_intr (); diff --git a/sys/i386/isa/kbd.h b/sys/i386/isa/kbd.h index b7b6009..d34b634 100644 --- a/sys/i386/isa/kbd.h +++ b/sys/i386/isa/kbd.h @@ -1,14 +1,14 @@ /* * Keyboard definitions * from: unknown origin, 386BSD 0.1 - * $Id: kbd.h,v 1.2 1993/10/16 13:46:04 rgrimes Exp $ + * $Id: kbd.h,v 1.3 1993/11/07 17:44:33 wollman Exp $ */ #ifndef _I386_ISA_KBD_H_ #define _I386_ISA_KBD_H_ 1 -/* Reference: IBM AT Technical Reference Manual, - * pp. 1-38 to 1-43, 4-3 to 4-22 +/* Reference: IBM AT Technical Reference Manual, + * pp. 1-38 to 1-43, 4-3 to 4-22 */ /* commands sent to KBCMDP */ diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c index d771501..5917995 100644 --- a/sys/i386/isa/labpc.c +++ b/sys/i386/isa/labpc.c @@ -346,16 +346,16 @@ reset(struct ctlr *ctlr) ad_clear(ctlr); } -static int -labpc_goaway(struct kern_devconf *kdc, int force) +static int +labpc_goaway(struct kern_devconf *kdc, int force) { if(force) { dev_detach(kdc); return 0; - } else { + } else { return EBUSY; /* XXX fix */ } -} +} static struct kern_devconf kdc_template = { 0, 0, 0, /* filled in by dev_attach */ @@ -626,7 +626,7 @@ tmo_stop(void *p) } printf("\n"); - + done_and_start_next(ctlr, bp, ETIMEDOUT); splx(s); @@ -681,7 +681,7 @@ static void ad_intr(struct ctlr *ctlr) else /* FIFO interrupt */ { struct buf *bp = ctlr->start_queue.b_actf; - + if (ctlr->data) { *ctlr->data++ = inb(ADFIFO(ctlr)); @@ -761,7 +761,7 @@ labpcopen(dev_t dev, int flags, int fmt, struct proc *p) return 0; } -int +int labpcclose(dev_t dev, int flags, int fmt, struct proc *p) { struct ctlr *ctlr = labpcs[UNIT(dev)]; @@ -1034,7 +1034,7 @@ labpcstrategy(struct buf *bp) } } -int +int labpcioctl(dev_t dev, int cmd, caddr_t arg, int mode, struct proc *p) { struct ctlr *ctlr = labpcs[UNIT(dev)]; diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c index 2f12ccd..b5db1a5 100644 --- a/sys/i386/isa/lpt.c +++ b/sys/i386/isa/lpt.c @@ -12,25 +12,25 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This software is a component of "386BSD" developed by + * This software is a component of "386BSD" developed by * William F. Jolitz, TeleMuse. * 4. Neither the name of the developer nor the name "386BSD" * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ - * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS - * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. - * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT + * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ + * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS + * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. + * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT * NOT MAKE USE OF THIS WORK. * * FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED - * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN - * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES - * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING - * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND - * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE - * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS + * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN + * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES + * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING + * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND + * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE + * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS * OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: lpt.c,v 1.28 1995/04/12 20:47:56 wollman Exp $ + * $Id: lpt.c,v 1.29 1995/05/09 01:33:16 phk Exp $ */ /* @@ -93,7 +93,7 @@ * Expect transfer-rates up to 75 kbyte/sec. * * If GCC could correctly grok - * register int port asm("edx") + * register int port asm("edx") * the code would be cleaner * * Poul-Henning Kamp <phk@login.dkuug.dk> @@ -370,9 +370,9 @@ lptprobe(struct isa_device *dvp) (*(BIOS_PORTS+next_bios_lpt) != 0) ) { dvp->id_iobase = *(BIOS_PORTS+next_bios_lpt++); goto end_probe; - } else + } else return (0); - } + } /* Port was explicitly specified */ /* This allows probing of ports unknown to the BIOS */ @@ -380,11 +380,11 @@ lptprobe(struct isa_device *dvp) port = dvp->id_iobase + lpt_data; mask = 0xff; data = 0x55; /* Alternating zeros */ - if (!lpt_port_test(port, data, mask)) + if (!lpt_port_test(port, data, mask)) { status = 0 ; goto end_probe ; } data = 0xaa; /* Alternating ones */ - if (!lpt_port_test(port, data, mask)) + if (!lpt_port_test(port, data, mask)) { status = 0 ; goto end_probe ; } for (i = 0; i < 8; i++) { /* Walking zero */ @@ -395,7 +395,7 @@ lptprobe(struct isa_device *dvp) for (i = 0; i < 8; i++) { /* Walking one */ data = (1 << i); - if (!lpt_port_test(port, data, mask)) + if (!lpt_port_test(port, data, mask)) { status = 0 ; goto end_probe ; } } @@ -455,7 +455,7 @@ lptopen (dev_t dev, int flag) return (ENXIO); #ifdef INET - if (sc->sc_if.if_flags & IFF_UP) + if (sc->sc_if.if_flags & IFF_UP) return(EBUSY); #endif @@ -512,7 +512,7 @@ lptopen (dev_t dev, int flag) splx(s); return (EBUSY); } - + /* is printer online and ready for output */ } while ((inb(port+lpt_status) & (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) != (LPS_SEL|LPS_NBSY|LPS_NERR)); @@ -582,7 +582,7 @@ lptclose(dev_t dev, int flag) struct lpt_softc *sc = lpt_sc + LPTUNIT(minor(dev)); int port = sc->sc_port; - if(sc->sc_flags & LP_BYPASS) + if(sc->sc_flags & LP_BYPASS) goto end_close; sc->sc_state &= ~OPEN; @@ -593,7 +593,7 @@ lptclose(dev_t dev, int flag) while ((inb(port+lpt_status) & (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) != (LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt) /* wait 1/4 second, give up if we get a signal */ - if (tsleep ((caddr_t)sc, LPPRI|PCATCH, + if (tsleep ((caddr_t)sc, LPPRI|PCATCH, "lpclose", hz) != EWOULDBLOCK) break; @@ -615,8 +615,8 @@ end_close: * * This code is only used when we are polling the port */ -static int -pushbytes(struct lpt_softc * sc) +static int +pushbytes(struct lpt_softc * sc) { int spin, err, tic; char ch; @@ -668,8 +668,8 @@ pushbytes(struct lpt_softc * sc) return(0); } -/* - * lptwrite --copy a line from user space to a local buffer, then call +/* + * lptwrite --copy a line from user space to a local buffer, then call * putc to get the chars moved to the output queue. * * Flagging of interrupted write added. @@ -704,14 +704,14 @@ lptwrite(dev_t dev, struct uio * uio) } lprintf("W "); if (sc->sc_state & OBUSY) - if ((err = tsleep ((caddr_t)sc, + if ((err = tsleep ((caddr_t)sc, LPPRI|PCATCH, "lpwrite", 0))) { sc->sc_state |= INTERRUPTED; return(err); } } /* check to see if we must do a polled write */ - if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) { + if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) { lprintf("p"); if((err = pushbytes(sc))) return(err); @@ -747,7 +747,7 @@ lptintr(int unit) if (sc->sc_xfercnt) { /* send char */ /*lprintf("%x ", *sc->sc_cp); */ - outb(port+lpt_data, *sc->sc_cp++) ; + outb(port+lpt_data, *sc->sc_cp++) ; outb(port+lpt_control, sc->sc_control|LPC_STB); /* DELAY(X) */ outb(port+lpt_control, sc->sc_control); @@ -786,12 +786,12 @@ lptioctl(dev_t dev, int cmd, caddr_t data, int flag) switch (cmd) { case LPT_IRQ : if(sc->sc_irq & LP_HAS_IRQ) { - /* - * NOTE: + /* + * NOTE: * If the IRQ status is changed, * this will only be visible on the * next open. - * + * * If interrupt status changes, * this gets syslog'd. */ @@ -800,14 +800,14 @@ lptioctl(dev_t dev, int cmd, caddr_t data, int flag) sc->sc_irq &= (~LP_ENABLE_IRQ); else sc->sc_irq |= LP_ENABLE_IRQ; - if (old_sc_irq != sc->sc_irq ) + if (old_sc_irq != sc->sc_irq ) log(LOG_NOTICE, "lpt%c switched to %s mode\n", - (char)unit+'0', + (char)unit+'0', (sc->sc_irq & LP_ENABLE_IRQ)? "interrupt-driven":"polled"); } else /* polled port */ error = EOPNOTSUPP; - break; + break; default: error = ENODEV; } @@ -837,7 +837,7 @@ lpattach (struct lpt_softc *sc, int unit) } /* * Build the translation tables for the LPIP (BSD unix) protocol. - * We don't want to calculate these nasties in our tight loop, so we + * We don't want to calculate these nasties in our tight loop, so we * precalculate them when we initialize. */ static int @@ -871,7 +871,7 @@ lpioctl (struct ifnet *ifp, int cmd, caddr_t data) { struct lpt_softc *sc = lpt_sc + ifp->if_unit; struct ifaddr *ifa = (struct ifaddr *)data; - struct ifreq *ifr = (struct ifreq *)data; + struct ifreq *ifr = (struct ifreq *)data; u_char *ptr; switch (cmd) { @@ -908,10 +908,10 @@ lpioctl (struct ifnet *ifp, int cmd, caddr_t data) if (!sc->sc_ifbuf) { sc->sc_ifbuf = ptr; return ENOBUFS; - } + } if (ptr) free(ptr,M_DEVBUF); - sc->sc_if.if_mtu = ifr->ifr_metric; + sc->sc_if.if_mtu = ifr->ifr_metric; break; case SIOCGIFMTU: @@ -1026,8 +1026,8 @@ lpoutbyte (u_char byte, int spin, int data_port, int status_port) return 0; } -static int -lpoutput (struct ifnet *ifp, struct mbuf *m, +static int +lpoutput (struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt) { register int lpt_data_port = lpt_sc[ifp->if_unit].sc_port + lpt_data; @@ -1038,7 +1038,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m, struct mbuf *mm; u_char *cp = "\0\0"; - /* We need a sensible value if we abort */ + /* We need a sensible value if we abort */ cp++; ifp->if_flags |= IFF_RUNNING; diff --git a/sys/i386/isa/matcd/audio.c b/sys/i386/isa/matcd/audio.c index 837689a..e9c70f4 100644 --- a/sys/i386/isa/matcd/audio.c +++ b/sys/i386/isa/matcd/audio.c @@ -41,18 +41,18 @@ conditions even if it is unsupported, not a complete system and/or does not contain compiled code. 8. These conditions will be in force for the full life of the - copyright. + copyright. 9. If all the above conditions are met, modifications to other parts of this file may be freely made, although any person or persons making changes do not receive the right to add their name or names to the copyright strings and notices in this software. Persons making changes are encouraged to insert edit history in matcd.c and to put your name and details of the - change there. + change there. 10. You must have prior written permission from the author to deviate from these terms. - Vendors who produce product(s) containing this code are encouraged + Vendors who produce product(s) containing this code are encouraged (but not required) to provide copies of the finished product(s) to the author and to correspond with the author about development activity relating to this code. Donations of development hardware @@ -481,7 +481,7 @@ static int matcd_pitch(int ldrive, int cdrive, int controller, "play slower", 0x0000 flat and 1 to 32767 being "play faster" within the scale allowed by the device. The value is scaled to fit the allowed by the device and any excess is treated as being - the positive or negative limit. No ioctl input value is considered + the positive or negative limit. No ioctl input value is considered invalid. This device has a +/- 13% playback pitch specified by a range diff --git a/sys/i386/isa/matcd/creative.h b/sys/i386/isa/matcd/creative.h index 152128c..b918e48 100644 --- a/sys/i386/isa/matcd/creative.h +++ b/sys/i386/isa/matcd/creative.h @@ -41,18 +41,18 @@ conditions even if it is unsupported, not a complete system and/or does not contain compiled code. 8. These conditions will be in force for the full life of the - copyright. + copyright. 9. If all the above conditions are met, modifications to other parts of this file may be freely made, although any person or persons making changes do not receive the right to add their name or names to the copyright strings and notices in this software. Persons making changes are encouraged to insert edit history in matcd.c and to put your name and details of the - change there. + change there. 10. You must have prior written permission from the author to deviate from these terms. - Vendors who produce product(s) containing this code are encouraged + Vendors who produce product(s) containing this code are encouraged (but not required) to provide copies of the finished product(s) to the author and to correspond with the author about development activity relating to this code. Donations of development hardware @@ -89,7 +89,7 @@ See matcd.c for Edit History See matcd.h for defines related to the Matsushita drive itself. */ - + /* Creative Labs (and compatible) I/O port mapping offsets */ diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index e2d642c..1809ec9 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -41,18 +41,18 @@ conditions even if it is unsupported, not a complete system and/or does not contain compiled code. 8. These conditions will be in force for the full life of the - copyright. + copyright. 9. If all the above conditions are met, modifications to other parts of this file may be freely made, although any person or persons making changes do not receive the right to add their name or names to the copyright strings and notices in this software. Persons making changes are encouraged to insert edit history in matcd.c and to put your name and details of the - change there. + change there. 10. You must have prior written permission from the author to deviate from these terms. - Vendors who produce product(s) containing this code are encouraged + Vendors who produce product(s) containing this code are encouraged (but not required) to provide copies of the finished product(s) to the author and to correspond with the author about development activity relating to this code. Donations of development hardware @@ -157,7 +157,7 @@ Edit number code marking begins here - earlier edits were during development. 24-Feb-95 Frank Durda IV bsdmail@nemesis.lonestar.org <9> Added some additional disk-related ioctl functions that didn't - make it into earlier versions. + make it into earlier versions. 26-Feb-95 Frank Durda IV bsdmail@nemesis.lonestar.org <10> Updated some conditionals so the code will compile under @@ -391,7 +391,7 @@ static struct kern_devconf kdc_matcd[TOTALDRIVES] = { { /*<12>*/ } }; /*<12>*/ #endif /*FREE2*/ - + /*--------------------------------------------------------------------------- These macros take apart the minor number and yield the partition, drive on controller, and controller. @@ -443,7 +443,7 @@ struct isa_driver matcddriver={matcd_probe, matcd_attach, /*<16>*/ static void matcd_start(struct buf *dp); static void zero_cmd(char *); -static void matcd_pread(int port, int count, unsigned char * data); +static void matcd_pread(int port, int count, unsigned char * data); static int matcd_fastcmd(int port,int ldrive,int cdrive, unsigned char * cp); static void matcd_slowcmd(int port,int ldrive,int cdrive, @@ -501,7 +501,7 @@ static int docmd(char * cmd, int ldrive, int cdrive, /*<14>*/ This routine actually gets called every time anybody opens any partition on a drive. But the first call is the one that - does all the work. + does all the work. <15> If LOCKDRIVE is enabled, additional minor number devices allow <15> the drive to be locked while being accessed. @@ -520,7 +520,7 @@ int matcdopen(dev_t dev) #ifdef DIAGPORT DIAGOUT(DIAGPORT,0x10); /*Show where we are*/ #endif /*DIAGPORT*/ - ldrive=matcd_ldrive(dev); + ldrive=matcd_ldrive(dev); cdrive=matcd_cdrive(dev); partition=matcd_partition(dev); controller=matcd_controller(dev); @@ -537,7 +537,7 @@ int matcdopen(dev_t dev) #endif /*DEBUGOPEN*/ if (!(cd->flags & MATCDINIT)) { /*Did probe find this drive*/ - return(ENXIO); + return(ENXIO); } if (!(cd->flags & MATCDLABEL) && @@ -558,7 +558,7 @@ int matcdopen(dev_t dev) #ifdef DEBUGOPEN printf("matcd%d Result of NOP is %x %x\n",ldrive,i,z); /*<16>*/ #endif /*DEBUGOPEN*/ - if ((z & MATCD_ST_DSKIN)==0) { /*Is there a disc in the drive?*/ + if ((z & MATCD_ST_DSKIN)==0) { /*Is there a disc in the drive?*/ #ifdef DEBUGOPEN printf("matcd%d: No Disc in open\n",ldrive); #endif /*DEBUGOPEN*/ @@ -592,7 +592,7 @@ int matcdopen(dev_t dev) } } unlockbus(controller, ldrive); /*Release bus lock*/ - + /* Here we fill in the disklabel structure although most is hardcoded. */ @@ -652,7 +652,7 @@ int matcdopen(dev_t dev) cd->flags |= MATCDLABEL; /*Mark drive as having TOC*/ } - + #ifdef DEBUGOPEN printf("matcd%d open2: partition=%d disksize=%d blksize=%x flags=%x\n", ldrive,partition,(int)cd->disksize,cd->blksize,cd->flags); @@ -669,7 +669,7 @@ int matcdopen(dev_t dev) #endif /*LOCKDRIVE*/ cd->openflags |= (1<<partition);/*Mark partition open*/ - if (partition==RAW_PART || + if (partition==RAW_PART || (partition < cd->dlabel.d_npartitions && cd->dlabel.d_partitions[partition].p_fstype != FS_UNUSED)) { cd->partflags[partition] |= MATCDOPEN; @@ -715,7 +715,7 @@ int matcdclose(dev_t dev) #ifdef DIAGPORT DIAGOUT(DIAGPORT,0x20); /*Show where we are*/ #endif /*DIAGPORT*/ - if (ldrive >= TOTALDRIVES) + if (ldrive >= TOTALDRIVES) return(ENXIO); partition = matcd_partition(dev); @@ -816,7 +816,7 @@ void matcdstrategy(struct buf *bp) printf("Block %d\n",(int)bp->b_pblkno); #ifdef FREE2 bp=bp->b_actf; -#else /*FREE2*/ +#else /*FREE2*/ bp=bp->av_forw; #endif /*FREE2*/ } @@ -1054,9 +1054,9 @@ int matcdsize(dev_t dev) ldrive=matcd_ldrive(dev); part=matcd_partition(dev); - if (part==RAW_PART) + if (part==RAW_PART) blksize=MATCDRBLK; /*2352*/ - else + else blksize=MATCDBLK; /*2048*/ cd = &matcd_data[ldrive]; @@ -1084,10 +1084,10 @@ int matcdsize(dev_t dev) The probe routine can be compiled two ways. In AUTOHUNT mode, the kernel config file can say "port?" and we will check all ports - listed in the port_hint array (see above). + listed in the port_hint array (see above). Without AUTOHUNT set, the config file must list a specific port - address to check. + address to check. Note that specifying the explicit addresses makes boot-up a lot faster. @@ -1106,7 +1106,7 @@ int matcdsize(dev_t dev) software, there are probably 8 different board models called Sound Blaster 16. These include "Vibra", "Value", etc. - Please report additional part numbers and board descriptions + Please report additional part numbers and board descriptions and new port numbers that work to the author. ---------------------------------------------------------------------------*/ @@ -1195,7 +1195,7 @@ int matcd_probe(struct isa_device *dev) } /*--------------------------------------------------------------------------- - doprobe - Common probe code that actually checks the ports we + doprobe - Common probe code that actually checks the ports we have decided to test. ---------------------------------------------------------------------------*/ @@ -1497,7 +1497,7 @@ void draincmd(int port,int cdrive,int ldrive) i=inb(port+STATUS); if (i==0xff) return; - + printf("matcd%d: in draincmd: bus not idle %x - trying to fix\n", ldrive,inb(port+STATUS)); if ((i & (DTEN|STEN)) == STEN) { @@ -1563,7 +1563,7 @@ void selectdrive(int port,int drive) matcd_pread - Read small blocks of control data from a drive ---------------------------------------------------------------------------*/ -void matcd_pread(int port, int count, unsigned char * data) +void matcd_pread(int port, int count, unsigned char * data) { int i; @@ -1683,14 +1683,14 @@ static int matcd_volinfo(int ldrive) data[0],data[1],data[2], data[3],data[4],data[5]); printf("status byte %x\n",z); #endif /*DEBUGOPEN*/ - if ((z & MATCD_ST_ERROR)==0) + if ((z & MATCD_ST_ERROR)==0) break; /*No Error*/ /* If media change or other error, you have to read error data or the drive will reject subsequent commands. */ - if (chk_error(get_error(port, ldrive, cdrive))==ERR_FATAL) { + if (chk_error(get_error(port, ldrive, cdrive))==ERR_FATAL) { #ifdef DEBUGOPEN printf("matcd%d: command failed, status %x\n", ldrive,z); @@ -1724,7 +1724,7 @@ static int matcd_volinfo(int ldrive) /*--------------------------------------------------------------------------- - blk_to_msf - Convert block numbers into CD disk block ids + blk_to_msf - Convert block numbers into CD disk block ids ---------------------------------------------------------------------------*/ static void blk_to_msf(int blk, unsigned char *msf) @@ -1749,7 +1749,7 @@ static int msf_to_blk(unsigned char * cd) +cd[1])*75 /*Blocks minus 2*/ +cd[2]-150); /*seconds*/ } - + /*--------------------------------------------------------------------------- matcd_blockread - Performs actual background disc I/O operations @@ -1839,10 +1839,10 @@ nextblock: #endif /*DEBUGIO*/ blknum=(bp->b_blkno / (mbx->sz/DEV_BSIZE)) - + mbx->p_offset + mbx->skip/mbx->sz; + + mbx->p_offset + mbx->skip/mbx->sz; blk_to_msf(blknum,rbuf.start_msf); - + zero_cmd(cmd); cmd[0]=READ; /*Get drive ID*/ cmd[1]=rbuf.start_msf[0]; @@ -1922,11 +1922,11 @@ nextblock: } bp->b_resid=0; biodone(bp); /*Signal transfer complete*/ - + unlockbus(ldrive>>2, ldrive); /*Release bus lock*/ matcd_start(dp);/*See if other drives have work*/ return; - + /* Here we skipped the data phase and went directly to status. This indicates a hard error. */ @@ -2065,7 +2065,7 @@ int chk_error(int errnum) case DISC_OUT: case HARD_RESET: return (ERR_INIT); - + /* These errors indicate the system is confused about the drive or media, and point to bugs in the driver or OS. These errors cannot be retried since you will always get the same error. @@ -2096,7 +2096,7 @@ int chk_error(int errnum) the drives on a given controller, plus it leaves the other drives unaffected. ---------------------------------------------------------------------------*/ - + int get_stat(int port,int ldrive) { int status,busstat; /*<16>*/ @@ -2439,7 +2439,7 @@ static int matcd_read_subq(int ldrive, int cdrive, int controller, /* We only support the ioctl functions we could get information on, so test for the things we can do */ - + if (sqp->data_format!=CD_CURRENT_POSITION || sqp->address_format!=CD_MSF_FORMAT) { return(EINVAL); @@ -2546,7 +2546,7 @@ static int matcd_igot(struct ioc_capability * sqp) CDREADHEADER); /*Can read TOC*/ return(0); } - + #ifdef FULLDRIVER #include "i386/isa/matcd/audio.c" /*<15>ioctls related to diff --git a/sys/i386/isa/matcd/matcd.h b/sys/i386/isa/matcd/matcd.h index be261a2..8802149 100644 --- a/sys/i386/isa/matcd/matcd.h +++ b/sys/i386/isa/matcd/matcd.h @@ -41,18 +41,18 @@ conditions even if it is unsupported, not a complete system and/or does not contain compiled code. 8. These conditions will be in force for the full life of the - copyright. + copyright. 9. If all the above conditions are met, modifications to other parts of this file may be freely made, although any person or persons making changes do not receive the right to add their name or names to the copyright strings and notices in this software. Persons making changes are encouraged to insert edit history in matcd.c and to put your name and details of the - change there. + change there. 10. You must have prior written permission from the author to deviate from these terms. - Vendors who produce product(s) containing this code are encouraged + Vendors who produce product(s) containing this code are encouraged (but not required) to provide copies of the finished product(s) to the author and to correspond with the author about development activity relating to this code. Donations of development hardware diff --git a/sys/i386/isa/matcd/options.h b/sys/i386/isa/matcd/options.h index 67ff531..c60d83f 100644 --- a/sys/i386/isa/matcd/options.h +++ b/sys/i386/isa/matcd/options.h @@ -41,18 +41,18 @@ conditions even if it is unsupported, not a complete system and/or does not contain compiled code. 8. These conditions will be in force for the full life of the - copyright. + copyright. 9. If all the above conditions are met, modifications to other parts of this file may be freely made, although any person or persons making changes do not receive the right to add their name or names to the copyright strings and notices in this software. Persons making changes are encouraged to insert edit history in matcd.c and to put your name and details of the - change there. + change there. 10. You must have prior written permission from the author to deviate from these terms. - Vendors who produce product(s) containing this code are encouraged + Vendors who produce product(s) containing this code are encouraged (but not required) to provide copies of the finished product(s) to the author and to correspond with the author about development activity relating to this code. Donations of development hardware @@ -79,7 +79,7 @@ /* AUTOHUNT Adds extra code that allows the driver to search for interface cards rather than having to hard-code - the locations in the kernel conf file. + the locations in the kernel conf file. Leaving AUTOHUNT enabled is the recommended setting. */ @@ -113,7 +113,7 @@ Leaving RESETONBOOT enabled is the recommended setting. */ -#define RESETONBOOT +#define RESETONBOOT /*<15> LOCKDRIVE If enabled, when a drive is opened using a @@ -131,7 +131,7 @@ /*<5> FREE2 If enabled, the changes are inserted so this <5> module will compile in the world of FreeBSD 2.x. -<5> Without this, it is known to work in +<5> Without this, it is known to work in <14> FreeBSD 1.1.5.1. FREE2 should be set automatically <14> by using the system version compile symbol below. <5>*/ @@ -172,7 +172,7 @@ the -1 end-of-table marker. The values already present are the ones found on standard SoundBlaster 16 and standalone cards. ---------------------------------------------------------------------------*/ - + #ifdef AUTOHUNT int port_hints[]={ 0x230,0x240, /*Ports SB audio boards can use*/ @@ -205,7 +205,7 @@ int port_hints[]={ loop endlessly if queues are not null terminated as they should be. */ - + /*#define DEBUGQUEUE*/ @@ -261,7 +261,7 @@ int port_hints[]={ <10> (0x300) is reset in our probe and open routines. <10> DO NOT use DIAGPORT 0x302 if an adapter is present <10> at that address. It could ruin the EEPROM settings -<10> on the device. +<10> on the device. */ /*#define DIAGPORT 0x80*/ diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index fbe6b13..d976194 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.42 1995/05/09 11:39:40 rgrimes Exp $ + * $Id: mcd.c,v 1.43 1995/05/11 19:26:18 rgrimes Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -249,7 +249,7 @@ int mcd_attach(struct isa_device *dev) { struct mcd_data *cd = mcd_data + dev->id_unit; int i; - + cd->iobase = dev->id_iobase; cd->flags |= MCDINIT; mcd_soft_reset(dev->id_unit); @@ -269,7 +269,7 @@ int mcdopen(dev_t dev) { int unit,part,phys,r,retry; struct mcd_data *cd; - + unit = mcd_unit(dev); if (unit >= NMCD) return ENXIO; @@ -277,7 +277,7 @@ int mcdopen(dev_t dev) cd = mcd_data + unit; part = mcd_part(dev); phys = mcd_phys(dev); - + /* not initialized*/ if (!(cd->flags & MCDINIT)) return ENXIO; @@ -337,7 +337,7 @@ MCD_TRACE("open: partition=%d, disksize = %ld, blksize=%d\n", return ENXIO; return 0; } - + return ENXIO; } @@ -345,7 +345,7 @@ int mcdclose(dev_t dev) { int unit,part,phys; struct mcd_data *cd; - + unit = mcd_unit(dev); if (unit >= NMCD) return ENXIO; @@ -353,7 +353,7 @@ int mcdclose(dev_t dev) cd = mcd_data + unit; part = mcd_part(dev); phys = mcd_phys(dev); - + if (!(cd->flags & MCDINIT)) return ENXIO; @@ -377,7 +377,7 @@ mcdstrategy(struct buf *bp) struct mcd_data *cd; struct buf *qp; int s; - + int unit = mcd_unit(bp->b_dev); cd = mcd_data + unit; @@ -406,11 +406,11 @@ MCD_TRACE("strategy: drive not valid\n"); bp->b_error = EROFS; goto bad; } - + /* no data to read */ if (bp->b_bcount == 0) goto done; - + /* for non raw access, check partition limits */ if (mcd_part(bp->b_dev) != RAW_PART) { if (!(cd->flags & MCDLABEL)) { @@ -425,13 +425,13 @@ MCD_TRACE("strategy: drive not valid\n"); bp->b_pblkno = bp->b_blkno; bp->b_resid = 0; } - + /* queue it */ qp = &cd->head; s = splbio(); disksort(qp,bp); splx(s); - + /* now check whether we can perform processing */ mcd_start(unit); return; @@ -451,7 +451,7 @@ static void mcd_start(int unit) struct partition *p; int part; register s = splbio(); - + if (cd->flags & MCDMBXBSY) { splx(s); return; @@ -495,7 +495,7 @@ int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags) { struct mcd_data *cd; int unit,part; - + unit = mcd_unit(dev); part = mcd_part(dev); cd = mcd_data + unit; @@ -523,7 +523,7 @@ MCD_TRACE("ioctl called 0x%x\n", cmd); return 0; /* - * a bit silly, but someone might want to test something on a + * a bit silly, but someone might want to test something on a * section of cdrom. */ case DIOCWDINFO: @@ -614,10 +614,10 @@ MCD_TRACE("ioctl called 0x%x\n", cmd); static int mcd_getdisklabel(int unit) { struct mcd_data *cd = mcd_data + unit; - + if (cd->flags & MCDLABEL) return -1; - + bzero(&cd->dlabel,sizeof(struct disklabel)); /* filled with spaces first */ strncpy(cd->dlabel.d_typename," ", @@ -642,7 +642,7 @@ static int mcd_getdisklabel(int unit) cd->dlabel.d_magic = DISKMAGIC; cd->dlabel.d_magic2 = DISKMAGIC; cd->dlabel.d_checksum = dkcksum(&cd->dlabel); - + cd->flags |= MCDLABEL; return 0; } @@ -704,7 +704,7 @@ twiddle_thumbs(int port, int unit, int count, char *whine) int mcd_probe(struct isa_device *dev) { - int port = dev->id_iobase; + int port = dev->id_iobase; int unit = dev->id_unit; int i, j; int status; @@ -856,7 +856,7 @@ mcd_get(int unit, char *buf, int nmax) { int port = mcd_data[unit].iobase; int i,k; - + for (i=0; i<nmax; i++) { /* wait for data */ if ((k = mcd_getreply(unit,DELAY_GETREPLY)) < 0) { @@ -873,7 +873,7 @@ mcd_send(int unit, int cmd,int nretrys) { int i,k=0; int port = mcd_data[unit].iobase; - + /*MCD_TRACE("mcd_send: command = 0x%02x\n",cmd,0,0,0);*/ for (i=0; i<nretrys; i++) { outb(port+mcd_command, cmd); @@ -1406,7 +1406,7 @@ mcd_toc_entrys(int unit, struct ioc_read_toc_entry *te) i = te->starting_track; if (i == MCD_LASTPLUS1) i = bcd2bin(cd->volinfo.trk_high) + 1; - + /* verify starting track */ if (i < bcd2bin(cd->volinfo.trk_low) || i > bcd2bin(cd->volinfo.trk_high)+1) { diff --git a/sys/i386/isa/mcdreg.h b/sys/i386/isa/mcdreg.h index f8d8598..d5ece62 100644 --- a/sys/i386/isa/mcdreg.h +++ b/sys/i386/isa/mcdreg.h @@ -1,7 +1,7 @@ /* * Copyright 1993 by Holger Veit (data part) * Copyright 1993 by Brian Moore (audio part) - * Changes Copyright 1993 by Gary Clark II + * Changes Copyright 1993 by Gary Clark II * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ * the manufacturer or anyone else might provide better documentation, * so this file (and the driver) will then have a better quality. * - * $Id: mcdreg.h,v 1.6 1994/12/24 13:24:02 ache Exp $ + * $Id: mcdreg.h,v 1.7 1995/01/30 06:44:40 ache Exp $ */ #ifndef MCD_H diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index a2c5ef3..4dedadd 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.10 1995/03/28 07:55:44 bde Exp $ + * $Id: mse.c,v 1.11 1995/04/12 20:47:59 wollman Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -114,9 +114,9 @@ struct mse_softc { #define MSE_SETUP 0x91 /* What does this mean? */ /* The definition for the control port */ /* is as follows: */ - + /* D7 = Mode set flag (1 = active) */ - /* D6,D5 = Mode selection (port A) */ + /* D6,D5 = Mode selection (port A) */ /* 00 = Mode 0 = Basic I/O */ /* 01 = Mode 1 = Strobed I/O */ /* 10 = Mode 2 = Bi-dir bus */ @@ -129,7 +129,7 @@ struct mse_softc { /* D1 = Port B direction (1 = input)*/ /* D0 = Port C (lower 4 bits) */ /* direction. (1 = input) */ - + /* So 91 means Basic I/O on all 3 ports,*/ /* Port A is an input port, B is an */ /* output port, C is split with upper */ @@ -288,7 +288,7 @@ mseclose(dev, flag) return(0); } -/* +/* * mseread: return mouse info using the MSC serial protocol, but without * using bytes 4 and 5. * (Yes this is cheesy, but it makes the X386 server happy, so...) @@ -404,10 +404,10 @@ mseintr(unit) */ if (sc->sc_deltax != 0 || sc->sc_deltay != 0 || (sc->sc_obuttons ^ sc->sc_buttons) != 0) { - if (sc->sc_flags & MSESC_WANT) { - sc->sc_flags &= ~MSESC_WANT; - wakeup((caddr_t)sc); - } + if (sc->sc_flags & MSESC_WANT) { + sc->sc_flags &= ~MSESC_WANT; + wakeup((caddr_t)sc); + } selwakeup(&sc->sc_selp); } } @@ -437,7 +437,7 @@ mse_probelogi(idp) outb(idp->id_iobase + MSE_PORTC, MSE_DISINTR); return(1); } else { - printf("mse%d: wrong signature %x\n",idp->id_unit,sig); + printf("mse%d: wrong signature %x\n",idp->id_unit,sig); return(0); } } diff --git a/sys/i386/isa/ncr5380.c b/sys/i386/isa/ncr5380.c index 631b2ec..cdc0c1b 100644 --- a/sys/i386/isa/ncr5380.c +++ b/sys/i386/isa/ncr5380.c @@ -80,7 +80,7 @@ #define PAS16_STAT_DREQ 0x80 /* Pseudo-DMA ready bit */ #define PAS16_REG(r) (((r) & 0xc) << 11 | ((r) & 3)) -static u_char pas16_irq_magic[] = +static u_char pas16_irq_magic[] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 }; /* diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index aacff0d..0a53279 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.21 1995/03/05 04:06:44 wpaul Exp $ + * $Id: npx.c,v 1.22 1995/04/12 20:48:01 wollman Exp $ */ #include "npx.h" @@ -280,7 +280,7 @@ npxprobe1(dvp) /* * Good, now check for a proper control word. */ - control = 0x5a5a; + control = 0x5a5a; fnstcw(&control); if ((control & 0x1f3f) == 0x033f) { hw_float = npx_exists = 1; @@ -344,7 +344,7 @@ npxattach(dvp) printf("npx%d: INT 16 interface\n", dvp->id_unit); else if (npx_irq13) ; /* higher level has printed "irq 13" */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) else if (npx_exists) { printf("npx%d: error reporting broken; using 387 emulator\n", dvp->id_unit); diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c index c8a6237..f53b925 100644 --- a/sys/i386/isa/pcaudio.c +++ b/sys/i386/isa/pcaudio.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcaudio.c,v 1.11 1994/11/06 00:46:21 bde Exp $ + * $Id: pcaudio.c,v 1.12 1995/03/30 14:33:03 sos Exp $ */ #include "pca.h" @@ -106,7 +106,7 @@ inline void conv(const void *table, void *buff, unsigned long n) } -static void +static void pca_volume(int volume) { int i, j; @@ -142,7 +142,7 @@ pca_init() } -static int +static int pca_start(void) { /* use the first buffer */ @@ -164,7 +164,7 @@ pca_start(void) } -static void +static void pca_stop(void) { /* release the timers */ @@ -172,24 +172,24 @@ pca_stop(void) release_timer2(); /* reset the buffer */ pca_status.in_use[0] = pca_status.in_use[1] = 0; - pca_status.index = 0; - pca_status.counter = 0; + pca_status.index = 0; + pca_status.counter = 0; pca_status.current = 0; pca_status.buffer = pca_status.buf[pca_status.current]; pca_status.timer_on = 0; } -static void +static void pca_pause() { release_timer0(); - release_timer2(); + release_timer2(); pca_status.timer_on = 0; } -static void +static void pca_continue() { pca_status.oldval = inb(IO_PPI) | 0x03; @@ -294,7 +294,7 @@ pcaclose(dev_t dev, int flag) return ENXIO; /* audio device close drains all output and restores timers */ pca_wait(); - pca_stop(); + pca_stop(); pca_status.open = 0; return 0; } @@ -336,10 +336,10 @@ pcawrite(dev_t dev, struct uio *uio, int flag) } pca_status.in_use[which] = count; if (!pca_status.timer_on) - if (pca_start()) + if (pca_start()) return EBUSY; } - } + } return 0; } @@ -375,7 +375,7 @@ pcaioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) auptr = (audio_info_t *)data; if (auptr->play.sample_rate != (unsigned int)~0) { pca_status.sample_rate = auptr->play.sample_rate; - pca_status.scale = + pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE; } if (auptr->play.encoding != (unsigned int)~0) { @@ -406,7 +406,7 @@ pcaioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) } -void +void pcaintr(struct clockframe *frame) { if (pca_status.index < pca_status.in_use[pca_status.current]) { @@ -463,7 +463,7 @@ pcaselect(dev_t dev, int rw, struct proc *p) return 0; default: splx(s); - return(0); + return(0); } } #endif diff --git a/sys/i386/isa/pcic.c b/sys/i386/isa/pcic.c index 01f9f02..f5b31c9 100644 --- a/sys/i386/isa/pcic.c +++ b/sys/i386/isa/pcic.c @@ -4,7 +4,7 @@ * [2] parse tuples to find out where to map the shared memory buffer, * and what to write into the configuration register * [3] move pcic-specific code into a separate module. - * + * * Device driver for IBM PCMCIA Credit Card Adapter for Ethernet, * if_ze.c * diff --git a/sys/i386/isa/pcic.h b/sys/i386/isa/pcic.h index 852f332..6b99d72 100644 --- a/sys/i386/isa/pcic.h +++ b/sys/i386/isa/pcic.h @@ -4,7 +4,7 @@ * [2] parse tuples to find out where to map the shared memory buffer, * and what to write into the configuration register * [3] move pcic-specific code into a separate module. - * + * * Device driver for IBM PCMCIA Credit Card Adapter for Ethernet, * if_ze.c * @@ -49,7 +49,7 @@ /* * Each PCIC chip (82365SL or clone) can handle two card slots, and there * can be up to four PCICs in a system. (On some machines, not all of the - * address lines are decoded, so a card may appear to be in more than one + * address lines are decoded, so a card may appear to be in more than one * slot.) */ #define MAXSLOT 8 @@ -61,8 +61,8 @@ * the value from or to the DATA register for that controller. * * The first pair of chips shares I/O addresss for DATA and INDEX, - * as does the second pair. (To the programmer, it looks like each - * pair is a single chip.) The i/o port addresses are hard-wired + * as does the second pair. (To the programmer, it looks like each + * pair is a single chip.) The i/o port addresses are hard-wired * into the PCIC; so the following addresses should be valid for * any machine that uses this chip. */ @@ -167,7 +167,7 @@ void pcic_map_memory (int slot, int window, unsigned long sys_addr, unsigned long card_addr, unsigned long length, enum memtype type, int width); void pcic_unmap_memory (int slot, int window); -void pcic_map_io (int slot, int window, unsigned short base, +void pcic_map_io (int slot, int window, unsigned short base, unsigned short length, unsigned short width); #ifdef TEST void pcic_unmap_io (int slot, int window); diff --git a/sys/i386/isa/pcvt/pcvt_conf.h b/sys/i386/isa/pcvt/pcvt_conf.h index 3ddc3a2..c5739c5 100644 --- a/sys/i386/isa/pcvt/pcvt_conf.h +++ b/sys/i386/isa/pcvt/pcvt_conf.h @@ -53,7 +53,7 @@ * * Here's an idea how to automatically detect the version of NetBSD pcvt is * being compiled on: - * + * * NetBSD 0.8 : NetBSD0_8 defined in <sys/param.h> * NetBSD 0.9 : NetBSD0_9 defined in <sys/param.h> * NetBSD 1.0 : NetBSD1_0 defined as 1 in <sys/param.h> @@ -64,7 +64,7 @@ * This leads to something like this in pcvt_hdr.h (#elif is possible too): * *---------------------------------------------------------------------------*/ - + #ifdef NetBSD0_8 #define PCVT_NETBSD 8 #endif @@ -80,7 +80,7 @@ #define PCVT_NETBSD 100 #endif #endif - + /*--------------------------------------------------------------------------- * Note that each of the options below should rather be overriden by the * kernel config file instead of this .h file - this allows for different @@ -128,7 +128,7 @@ *======================================================================* * F r e e B S D * *======================================================================* - * + * * options "PCVT_FREEBSD=xxx" enables support for FreeBSD * * select: @@ -139,7 +139,7 @@ * PCVT_FREEBSD = 210 for FreeBSD 2.1-Release * */ - + /* -------------------------------------------------------------------- */ /* ---------------- USER PREFERENCE DRIVER OPTIONS -------------------- */ /* -------------------------------------------------------------------- */ @@ -160,9 +160,9 @@ #if !defined PCVT_VT220KEYB /* ---------- DEFAULT: OFF ------------ */ # define PCVT_VT220KEYB 0 /* this compiles a more vt220-like */ -#elif PCVT_VT220KEYB != 0 /* keyboardlayout as described in the */ +#elif PCVT_VT220KEYB != 0 /* keyboardlayout as described in the */ # undef PCVT_VT220KEYB /* file Keyboard.VT220. */ -# define PCVT_VT220KEYB 1 /* if undefined, a more HP-like */ +# define PCVT_VT220KEYB 1 /* if undefined, a more HP-like */ #endif /* keyboardlayout is compiled */ /* try to find out what YOU like ! */ @@ -263,7 +263,7 @@ #endif /* keyboard controller chip. */ /* this is just for some hardcore */ /* keyboarders .... */ - + /* -------------------------------------------------------------------- */ /* -------------------- DRIVER OPTIONS -------------------------------- */ /* -------------------------------------------------------------------- */ @@ -283,7 +283,7 @@ # define PCVT_PORTIO_DELAY 1 /* accessing the keyboard controller, */ #endif /* otherwise the system delay functions */ /* are used. */ - + #if !defined PCVT_PCBURST /* ---------- DEFAULT: 256 ------------ */ # define PCVT_PCBURST 256 /* NETBSD and FreeBSD >= 2.0 only: this */ #endif /* is the number of output characters */ @@ -300,7 +300,7 @@ #if !defined PCVT_KEYBDID /* ---------- DEFAULT: ON ------------- */ # define PCVT_KEYBDID 1 /* check type of keyboard connected. at */ #elif PCVT_KEYBDID != 0 /* least HP-keyboards send an id other */ -# undef PCVT_KEYBDID /* than the industry standard, so it */ +# undef PCVT_KEYBDID /* than the industry standard, so it */ # define PCVT_KEYBDID 1 /* CAN lead to problems. if you have */ #endif /* problems with this, TELL ME PLEASE ! */ @@ -312,7 +312,7 @@ #endif /* i'm not sure, whether this feature */ /* has to be in the driver or has to */ /* move as an ioctl call to scon .... */ - + #if !defined PCVT_NULLCHARS /* ---------- DEFAULT: ON ------------- */ # define PCVT_NULLCHARS 1 /* allow the keyboard to send null */ #elif PCVT_NULLCHARS != 0 /* (0x00) characters to the calling */ @@ -379,7 +379,7 @@ /* but introduced another flicker, so */ /* this is for you to experiment ..... */ /* - see also PCVT_WAITRETRACE below -- */ - + #if !defined PCVT_WAITRETRACE /* ---------- DEFAULT: OFF ------------ */ # define PCVT_WAITRETRACE 0 /* this option waits for being in a */ #elif PCVT_WAITRETRACE != 0 /* retrace window prior to accessing */ @@ -439,7 +439,7 @@ # undef PCVT_SLOW_INTERRUPT /* disabling the processor irq's, if on */ # define PCVT_SLOW_INTERRUPT 1 /* this is done by spl()/splx() calls. */ #endif - + #ifdef XSERVER #if !defined PCVT_USL_VT_COMPAT /* ---------- DEFAULT: ON ------------- */ @@ -452,7 +452,7 @@ /* to run multiple X servers and/or */ /* character terminal sessions. */ -#endif /* XSERVER */ +#endif /* XSERVER */ /*---------------------------------------------------------------------------* * Kernel messages attribute definitions diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index 7a7a5e3..fb2168f 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -119,7 +119,7 @@ pcprobe(struct isa_device *dev) #endif /* PCVT_NETBSD > 100 */ { kbd_code_init(); - + #if PCVT_NETBSD > 9 ((struct isa_attach_args *)aux)->ia_iosize = 16; return 1; @@ -148,7 +148,7 @@ pcattach(struct isa_device *dev) int i; vt_coldmalloc(); /* allocate memory for screens */ - + #if PCVT_NETBSD || PCVT_FREEBSD #if PCVT_NETBSD > 9 @@ -197,11 +197,11 @@ pcattach(struct isa_device *dev) case KB_AT: printf("at-"); break; - + case KB_MFII: printf("mf2-"); break; - + default: printf("unknown "); break; @@ -215,7 +215,7 @@ pcattach(struct isa_device *dev) { #if PCVT_NETBSD - pc_tty[i] = ttymalloc(); + pc_tty[i] = ttymalloc(); vs[i].vs_tty = pc_tty[i]; #else /* !PCVT_NETBSD */ pccons[i] = ttymalloc(pccons[i]); @@ -240,7 +240,7 @@ pcattach(struct isa_device *dev) #endif /* PCVT_NETBSD */ #endif /* #if PCVT_NETBSD || (PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) */ - + #else /* !PCVT_NETBSD && !PCVT_FREEBSD*/ switch(adaptor_type) @@ -277,17 +277,17 @@ pcattach(struct isa_device *dev) printf(",color"); printf(",%d scr,", totalscreens); - + switch(keyboard_type) { case KB_AT: printf("at-"); break; - + case KB_MFII: printf("mf2-"); break; - + default: printf("unknown "); break; @@ -310,7 +310,7 @@ pcattach(struct isa_device *dev) pcvt_is_console? DC_IDLE: DC_BUSY; vt_registerdev(dev, (char *)vga_string(vga_type)); #endif /* PCVT_FREEBSD > 205 */ - + #if PCVT_NETBSD > 9 vthand.ih_fun = pcrint; @@ -388,7 +388,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) int s, retval; int winsz = 0; int i = minor(dev); - + #if PCVT_EMU_MOUSE if(i == totalscreens) vsx = 0; @@ -413,7 +413,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) #endif /* PCVT_EMU_MOUSE */ vsx->openf++; - + tp->t_oproc = pcstart; tp->t_param = pcparam; tp->t_dev = dev; @@ -441,7 +441,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) tp->t_cflag |= CLOCAL; /* cannot be a modem (:-) */ if ((tp->t_state & TS_ISOPEN) == 0) /* is this a "cold" open ? */ - winsz = 1; /* yes, set winsize later */ + winsz = 1; /* yes, set winsize later */ #if PCVT_NETBSD || (PCVT_FREEBSD >= 200) retval = ((*linesw[tp->t_line].l_open)(dev, tp)); @@ -450,7 +450,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */ if(winsz == 1) - { + { /* * The line discipline has clobbered t_winsize if TS_ISOPEN @@ -465,7 +465,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) tp->t_winsize.ws_row = vsx->screen_rows; tp->t_winsize.ws_xpixel = (vsx->maxcol == 80)? 720: 1056; tp->t_winsize.ws_ypixel = 400; - + splx(s); } @@ -476,7 +476,7 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p) kdc_vt[0].kdc_state = DC_BUSY; } #endif - + return(retval); } @@ -486,7 +486,7 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) register struct tty *tp; register struct video_state *vsx; int i = minor(dev); - + #if PCVT_EMU_MOUSE if(i == totalscreens) vsx = 0; @@ -494,7 +494,7 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) #endif /* PCVT_EMU_MOUSE */ vsx = &vs[i]; - + if((tp = get_pccons(dev)) == NULL) return ENXIO; @@ -508,7 +508,7 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) #endif /* PCVT_EMU_MOUSE */ vsx->openf = 0; - + #if PCVT_USL_VT_COMPAT #if PCVT_EMU_MOUSE @@ -520,7 +520,7 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) reset_usl_modes(vsx); #endif /* PCVT_USL_VT_COMPAT */ - + #if PCVT_FREEBSD > 205 if(!pcvt_is_console) { @@ -539,7 +539,7 @@ pcread(Dev_t dev, struct uio *uio, int flag) if((tp = get_pccons(dev)) == NULL) return ENXIO; - + return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); } @@ -618,10 +618,10 @@ pcioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) int i; (void)usl_vt_ioctl(dev, KDDISABIO, 0, flag, p); - + i = KD_TEXT; (void)usl_vt_ioctl(dev, KDSETMODE, (caddr_t)&i, flag, p); - + i = K_XLATE; (void)usl_vt_ioctl(dev, KDSKBMODE, (caddr_t)&i, flag, p); return 0; @@ -678,7 +678,7 @@ pcioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) if (data) { -#if PCVT_NETBSD +#if PCVT_NETBSD sysbeep(((int *)data)[0], ((int *)data)[1] * hz / 1000); #else /* PCVT_NETBSD */ @@ -877,7 +877,7 @@ pcrint(void) { log (LOG_WARNING, "pcvt: keyboard buffer overflow\n"); } - else + else { pcvt_kbd_fifo[pcvt_kbd_wptr++] = dt; /* data -> fifo */ @@ -912,7 +912,7 @@ pcrint(void) if(!(vs[current_video_screen].openf)) /* XXX was vs[minor(dev)] */ return 1; - + #if PCVT_NULLCHARS if(*cp == '\0') { @@ -999,14 +999,14 @@ pcstart(struct tty *tp) { int s; unsigned char c; - + s = spltty(); if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) { goto out; } - + for(;;) { @@ -1042,7 +1042,7 @@ pcstart(struct tty *tp) ttwwakeup(tp); } #endif /* !PCVT_FREEBSD > 114 */ - + #if !(PCVT_FREEBSD > 111) if (RB_LEN(&tp->t_out) == 0) #else @@ -1091,7 +1091,7 @@ pccnprobe(struct consdev *cp) int maj; /* locate the major number */ - + for (maj = 0; maj < nchrdev; maj++) { if ((u_int)cdevsw[maj].d_open == (u_int)pcopen) @@ -1103,7 +1103,7 @@ pccnprobe(struct consdev *cp) /* we are not in cdevsw[], give up */ panic("pcvt is not in cdevsw[]"); } - + /* initialize required fields */ cp->cn_dev = makedev(maj, 0); @@ -1165,7 +1165,7 @@ pccnputc(Dev_t dev, U_char c) sput((char *) &c, 1, 1, 0); - async_update(UPDATE_KERN); + async_update(UPDATE_KERN); #if PCVT_FREEBSD <= 205 return 0; @@ -1250,10 +1250,10 @@ pcparam(struct tty *tp, struct termios *t) /* special characters */ #define bs 8 -#define lf 10 -#define cr 13 -#define cntlc 3 -#define del 0177 +#define lf 10 +#define cr 13 +#define cntlc 3 +#define del 0177 #define cntld 4 int @@ -1318,7 +1318,7 @@ dprintf(unsigned flgs, const char *fmt, ...) va_end(ap); if (flgs & DPAUSE || nrow%24 == 23) - { + { int x; x = splhigh(); if(nrow%24 == 23) @@ -1362,7 +1362,7 @@ static int pcvt_xmode_set(int on, struct proc *p) { static unsigned char *saved_fonts[NVGAFONTS]; - + #if PCVT_SCREENSAVER static unsigned saved_scrnsv_tmo = 0; #endif /* PCVT_SCREENSAVER */ @@ -1442,7 +1442,7 @@ pcvt_xmode_set(int on, struct proc *p) #if PCVT_SCANSET == 2 /* put keyboard to return ancient PC scan codes */ - kbc_8042cmd(CONTR_WRITE); + kbc_8042cmd(CONTR_WRITE); #if PCVT_USEKBDSEC /* security enabled */ outb(CONTROLLER_DATA, (COMMAND_SYSFLG|COMMAND_IRQEN|COMMAND_PCSCAN)); @@ -1463,7 +1463,7 @@ pcvt_xmode_set(int on, struct proc *p) { if(!pcvt_xmode) /* verify if in X */ return 0; - + pcvt_xmode = pcvt_kbd_raw = 0; for(i = 0; i < totalfonts; i++) @@ -1488,7 +1488,7 @@ pcvt_xmode_set(int on, struct proc *p) #endif /* PCVT_SCREENSAVER */ #if PCVT_SCANSET == 2 - kbc_8042cmd(CONTR_WRITE); + kbc_8042cmd(CONTR_WRITE); #if PCVT_USEKBDSEC /* security enabled */ outb(CONTROLLER_DATA, (COMMAND_SYSFLG|COMMAND_IRQEN)); @@ -1535,7 +1535,7 @@ pcvt_xmode_set(int on, struct proc *p) outb(addr_6845+1, (vsp->Crtat - Crtat) >> 8); outb(addr_6845, CRTC_STARTADRL); outb(addr_6845+1, (vsp->Crtat - Crtat)); - + async_update(UPDATE_START); } return 0; diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c index 7088caf..f0b96c3 100644 --- a/sys/i386/isa/pcvt/pcvt_ext.c +++ b/sys/i386/isa/pcvt/pcvt_ext.c @@ -87,7 +87,7 @@ static union { u_char wd90c11[12]; u_char tri9000[13]; u_char v7_1024i[17]; - u_char s3_928[32]; + u_char s3_928[32]; u_char cirrus[13]; } savearea; @@ -125,19 +125,19 @@ vga_chipset(void) /*---------------------------------------------------------------------------* * check for Western Digital / Paradise chipsets *---------------------------------------------------------------------------*/ - + ptr = (u_char *)Crtat; if(color) ptr += (0xc007d - 0xb8000); else - ptr += (0xc007d - 0xb0000); + ptr += (0xc007d - 0xb0000); if((*ptr++ == 'V') && (*ptr++ == 'G') && (*ptr++ == 'A') && (*ptr++ == '=')) { int wd90c10; - + vga_family = VGA_F_WD; outb(addr_6845, 0x2b); @@ -154,7 +154,7 @@ vga_chipset(void) newbyte = inb(TS_DATA) & 0x40; if(newbyte != 0) return(VGA_WD90C00); /* WD90C00 chip */ - + outb(TS_DATA, oldbyte | 0x40); newbyte = inb(TS_DATA) & 0x40; if(newbyte == 0) @@ -200,7 +200,7 @@ vga_chipset(void) byte = inb(TS_DATA); /* chipset type */ - + outb(TS_INDEX, 0x0e); old1byte = inb(TS_DATA); @@ -254,7 +254,7 @@ vga_chipset(void) return(VGA_TRUNKNOWN); } } - + /*---------------------------------------------------------------------------* * check for Tseng Labs ET3000/4000 chipsets *---------------------------------------------------------------------------*/ @@ -265,7 +265,7 @@ vga_chipset(void) else outb(GN_DMCNTLM, 0xa0); - /* read old value */ + /* read old value */ if(color) inb(GN_INPSTAT1C); @@ -281,7 +281,7 @@ vga_chipset(void) else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MISC); - newbyte = oldbyte ^ 0x10; + newbyte = oldbyte ^ 0x10; outb(ATC_DATAW, newbyte); /* read back new value */ @@ -298,22 +298,22 @@ vga_chipset(void) else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MISC); - outb(ATC_DATAW, oldbyte); + outb(ATC_DATAW, oldbyte); if(byte == newbyte) /* ET3000 or ET4000 */ { vga_family = VGA_F_TSENG; - + outb(addr_6845, CRTC_EXTSTART); oldbyte = inb(addr_6845+1); newbyte = oldbyte ^ 0x0f; outb(addr_6845+1, newbyte); byte = inb(addr_6845+1); - outb(addr_6845+1, oldbyte); + outb(addr_6845+1, oldbyte); if(byte == newbyte) { - can_do_132col = 1; + can_do_132col = 1; return(VGA_ET4000); } else @@ -327,22 +327,22 @@ vga_chipset(void) *---------------------------------------------------------------------------*/ outb(TS_INDEX, TS_EXTCNTL); /* enable extensions */ - outb(TS_DATA, 0xea); + outb(TS_DATA, 0xea); outb(addr_6845, CRTC_STARTADRH); oldbyte = inb(addr_6845+1); outb(addr_6845+1, 0x55); - newbyte = inb(addr_6845+1); + newbyte = inb(addr_6845+1); outb(addr_6845, CRTC_V7ID); /* id register */ byte = inb(addr_6845+1); /* read id */ - + outb(addr_6845, CRTC_STARTADRH); outb(addr_6845+1, oldbyte); - + outb(TS_INDEX, TS_EXTCNTL); /* disable extensions */ - outb(TS_DATA, 0xae); + outb(TS_DATA, 0xae); if(byte == (0x55 ^ 0xea)) { /* is Video 7 */ @@ -350,7 +350,7 @@ vga_chipset(void) vga_family = VGA_F_V7; outb(TS_INDEX, TS_EXTCNTL); /* enable extensions */ - outb(TS_DATA, 0xea); + outb(TS_DATA, 0xea); outb(TS_INDEX, TS_V7CHIPREV); byte = inb(TS_DATA); @@ -434,7 +434,7 @@ vga_chipset(void) return VGA_S3_UNKNOWN; } } - } + } /*---------------------------------------------------------------------------* * check for Cirrus chipsets @@ -561,10 +561,10 @@ int vga_col(struct video_state *svsp, int cols) { int ret = 0; - + if(adaptor_type != VGA_ADAPTOR) return(0); - + switch(vga_type) { case VGA_ET4000: @@ -581,15 +581,15 @@ vga_col(struct video_state *svsp, int cols) case VGA_TR9000: ret = tri9000_col(cols); break; - + case VGA_V71024I: ret = v7_1024i_col(cols); break; - + case VGA_S3_928: ret = s3_928_col(cols); break; - + case VGA_CL_GD5402: case VGA_CL_GD5402r1: case VGA_CL_GD5420: @@ -606,7 +606,7 @@ vga_col(struct video_state *svsp, int cols) #if PCVT_132GENERIC ret = generic_col(cols); #endif /* PCVT_132GENERIC */ - + break; } @@ -661,7 +661,7 @@ generic_col(int cols) static volatile u_short blankstart = 1072; static volatile u_short syncstart = 1112; static volatile u_short syncend = 1280; - + #else /* PCVT_EXP_132COL */ /* reduced sync-pulse width and sync delays */ @@ -670,28 +670,28 @@ generic_col(int cols) static volatile u_short blankstart = 1056; static volatile u_short syncstart = 1104; static volatile u_short syncend = 1168; - + #endif /* PCVT_EXP_132COL */ vga_screen_off(); - + /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); - + if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; sp = savearea.generic; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -704,27 +704,27 @@ generic_col(int cols) *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); *sp++ = inb(GN_MISCOUTR); /* Misc output register */ @@ -747,20 +747,20 @@ generic_col(int cols) outb(addr_6845+1, (((syncend / 8) & 0x20) * 4) | ((syncend / 8) & 0x1f)); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else @@ -782,54 +782,54 @@ generic_col(int cols) vga_screen_on(); return(0); } - + sp = savearea.generic; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x03); /* Horizontal Blank End */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); outb(GN_MISCOUTW, *sp++); /* Misc output register */ - } - + } + /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); vga_screen_on(); - + return(1); } #endif /* PCVT_132GENERIC */ @@ -844,94 +844,94 @@ et4000_col(int cols) u_char byte; vga_screen_off(); - + /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); - + if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; sp = savearea.et4000; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x02); /* Horizontal Blank Start */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x04); /* Horizontal Retrace Start */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x34); /* 6845 Compatibility */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); *sp++ = inb(GN_MISCOUTR); /* Misc output register */ } /* setup chipset for 132 column operation */ - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, 0x9f); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, 0x83); outb(addr_6845, 0x02); /* Horizontal Blank Start */ outb(addr_6845+1, 0x84); - + outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, 0x8b); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, 0x80); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); - + outb(addr_6845, 0x34); /* 6845 Compatibility */ outb(addr_6845+1, 0x0a); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else @@ -953,58 +953,58 @@ et4000_col(int cols) vga_screen_on(); return(0); } - + sp = savearea.et4000; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); + - outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x34); /* 6845 Compatibility */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); outb(GN_MISCOUTW, *sp++); /* Misc output register */ - } - + } + /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); vga_screen_on(); - + return(1); } @@ -1029,10 +1029,10 @@ wd90c11_col(int cols) int i; vga_screen_off(); - + /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); @@ -1040,22 +1040,22 @@ wd90c11_col(int cols) /* enable access to WD/Paradise "control extensions" */ outb(GDC_INDEX, GDC_PR5GPLOCK); - outb(GDC_INDEX, 0x05); + outb(GDC_INDEX, 0x05); outb(addr_6845, CRTC_PR10); - outb(addr_6845, 0x85); + outb(addr_6845, 0x85); outb(TS_INDEX, TS_UNLOCKSEQ); outb(TS_DATA, 0x48); if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; /* save current fonts */ - + #if !PCVT_BACKUP_FONTS for(i = 0; i < totalfonts; i++) { @@ -1081,7 +1081,7 @@ wd90c11_col(int cols) #endif /* !PCVT_BACKUP_FONTS */ sp = savearea.wd90c11; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1094,15 +1094,15 @@ wd90c11_col(int cols) *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x2e); /* misc 1 */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x2f); /* misc 2 */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, 0x10);/* Timing Sequencer */ *sp++ = inb(TS_DATA); outb(TS_INDEX, 0x12);/* Timing Sequencer */ @@ -1125,7 +1125,7 @@ wd90c11_col(int cols) outb(addr_6845+1, 0x8a); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, 0x1c); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); @@ -1138,7 +1138,7 @@ wd90c11_col(int cols) outb(TS_DATA, 0x21); outb(TS_INDEX, 0x12);/* Timing Sequencer */ outb(TS_DATA, 0x14); - + outb(GN_MISCOUTW, (inb(GN_MISCOUTR) | 0x08)); /* Misc output register */ vsp->wd132col = 1; @@ -1153,11 +1153,11 @@ wd90c11_col(int cols) outb(addr_6845+1, byte); /* disable access to WD/Paradise "control extensions" */ - + outb(GDC_INDEX, GDC_PR5GPLOCK); - outb(GDC_INDEX, 0x00); + outb(GDC_INDEX, 0x00); outb(addr_6845, CRTC_PR10); - outb(addr_6845, 0x00); + outb(addr_6845, 0x00); outb(TS_INDEX, TS_UNLOCKSEQ); outb(TS_DATA, 0x00); @@ -1165,9 +1165,9 @@ wd90c11_col(int cols) return(0); } - + sp = savearea.wd90c11; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1180,15 +1180,15 @@ wd90c11_col(int cols) outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x2e); /* misc 1 */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x2f); /* misc 2 */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, 0x10);/* Timing Sequencer */ outb(addr_6845+1, *sp++); outb(TS_INDEX, 0x12);/* Timing Sequencer */ @@ -1197,7 +1197,7 @@ wd90c11_col(int cols) outb(GN_MISCOUTW, *sp++); /* Misc output register */ vsp->wd132col = 0; - } + } /* restore fonts */ @@ -1212,25 +1212,25 @@ wd90c11_col(int cols) if(saved_charsets[i]) vga_move_charset(i, 0, 0); #endif /* !PCVT_BACKUP_FONTS */ - + select_vga_charset(vsp->vga_charset); /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); /* disable access to WD/Paradise "control extensions" */ outb(GDC_INDEX, GDC_PR5GPLOCK); - outb(GDC_INDEX, 0x00); + outb(GDC_INDEX, 0x00); outb(addr_6845, CRTC_PR10); - outb(addr_6845, 0x00); + outb(addr_6845, 0x00); outb(TS_INDEX, TS_UNLOCKSEQ); outb(TS_DATA, 0x00); - + vga_screen_on(); - + return(1); } @@ -1242,32 +1242,32 @@ tri9000_col(int cols) { u_char *sp; u_char byte; - + vga_screen_off(); /* sync reset is necessary to preserve memory contents ... */ - + outb(TS_INDEX, TS_SYNCRESET); outb(TS_DATA, 0x01); /* synchronous reset */ /* disable protection of misc out and other regs */ - outb(addr_6845, CRTC_MTEST); + outb(addr_6845, CRTC_MTEST); byte = inb(addr_6845+1); outb(addr_6845, CRTC_MTEST); outb(addr_6845+1, byte & ~0x50); /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); - + if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; @@ -1289,7 +1289,7 @@ tri9000_col(int cols) outb(addr_6845, 0x13); *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); @@ -1302,28 +1302,28 @@ tri9000_col(int cols) inb(TS_DATA); /* read switches to NEW */ outb(TS_INDEX, TS_MODEC2); *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); *sp++ = inb(GN_MISCOUTR); /* Misc output register */ } /* setup chipset for 132 column operation */ - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, 0x9b); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1339,10 +1339,10 @@ tri9000_col(int cols) outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ - + outb(TS_INDEX, TS_HWVERS);/* Hardware Version register */ outb(TS_DATA, 0x00); /* write ANYTHING switches to OLD */ outb(TS_INDEX, TS_MODEC2); @@ -1352,21 +1352,21 @@ tri9000_col(int cols) inb(TS_DATA); /* read switches to NEW */ outb(TS_INDEX, TS_MODEC2); outb(TS_DATA, 0x01); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); /* ATC Horizontal Pixel Panning */ outb(ATC_DATAW, 0x00); - + outb(GN_MISCOUTW, (inb(GN_MISCOUTR) | 0x0c)); /* Misc output register */ } else /* switch 132 -> 80 */ @@ -1384,7 +1384,7 @@ tri9000_col(int cols) return(0); } - + sp = savearea.tri9000; outb(addr_6845, 0x00); /* Horizontal Total */ @@ -1392,9 +1392,9 @@ tri9000_col(int cols) outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x03); /* Horizontal Blank End */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ @@ -1402,7 +1402,7 @@ tri9000_col(int cols) outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); @@ -1415,28 +1415,28 @@ tri9000_col(int cols) inb(TS_DATA); /* read switches to NEW */ outb(TS_INDEX, TS_MODEC2);/* Timing Sequencer */ outb(TS_DATA, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); outb(GN_MISCOUTW, *sp++); /* Misc output register */ - } - + } + /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); @@ -1457,7 +1457,7 @@ v7_1024i_col(int cols) u_char *sp; u_char byte; u_char save__byte; - + vga_screen_off(); /* enable access to first 7 CRTC registers */ @@ -1469,27 +1469,27 @@ v7_1024i_col(int cols) outb(addr_6845+1, (byte | 0x80)); /* second, enable access to protected registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); save__byte = byte = inb(addr_6845+1); byte |= 0x20; /* no irq 2 */ byte &= 0x6f; /* wr enable, clr irq flag */ outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); - + outb(TS_INDEX, TS_EXTCNTL); /* enable extensions */ - outb(TS_DATA, 0xea); + outb(TS_DATA, 0xea); if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; sp = savearea.v7_1024i; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1502,52 +1502,52 @@ v7_1024i_col(int cols) *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); outb(TS_INDEX, 0x83); *sp++ = inb(TS_DATA); - + outb(TS_INDEX, 0xa4); *sp++ = inb(TS_DATA); - + outb(TS_INDEX, 0xe0); *sp++ = inb(TS_DATA); - + outb(TS_INDEX, 0xe4); *sp++ = inb(TS_DATA); - + outb(TS_INDEX, 0xf8); *sp++ = inb(TS_DATA); - + outb(TS_INDEX, 0xfd); *sp++ = inb(TS_DATA); - + *sp++ = inb(GN_MISCOUTR); /* Misc output register */ } /* setup chipset for 132 column operation */ - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, 0x9c); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1560,10 +1560,10 @@ v7_1024i_col(int cols) outb(addr_6845+1, 0x89); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, 0x1c); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ @@ -1573,7 +1573,7 @@ v7_1024i_col(int cols) inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else @@ -1614,7 +1614,7 @@ v7_1024i_col(int cols) if(!regsaved) /* failsafe */ { outb(TS_INDEX, TS_EXTCNTL); /* disable extensions */ - outb(TS_DATA, 0xae); + outb(TS_DATA, 0xae); /* disable access to first 7 CRTC registers */ outb(addr_6845, CRTC_VSYNCE); @@ -1622,42 +1622,42 @@ v7_1024i_col(int cols) vga_screen_on(); return(0); } - + sp = savearea.v7_1024i; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x03); /* Horizontal Blank End */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); outb(TS_INDEX, TS_SYNCRESET); @@ -1685,18 +1685,18 @@ v7_1024i_col(int cols) outb(TS_INDEX, TS_SYNCRESET); outb(TS_DATA, 0x03); /* clear synchronous reset */ - } - + } + outb(TS_INDEX, TS_EXTCNTL); /* disable extensions */ - outb(TS_DATA, 0xae); + outb(TS_DATA, 0xae); /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, save__byte); vga_screen_on(); - + return(1); } @@ -1710,7 +1710,7 @@ s3_928_col(int cols) u_char byte; vga_screen_off(); - + outb(addr_6845, 0x38); outb(addr_6845+1, 0x48); /* unlock registers */ outb(addr_6845, 0x39); @@ -1718,21 +1718,21 @@ s3_928_col(int cols) /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); - + if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; sp = savearea.s3_928; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1745,7 +1745,7 @@ s3_928_col(int cols) *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); @@ -1756,31 +1756,31 @@ s3_928_col(int cols) outb(addr_6845, 0x42); /* (Clock) Mode Control */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); *sp++ = inb(GN_MISCOUTR); /* Misc output register */ } /* setup chipset for 132 column operation */ - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, 0x9a); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1793,28 +1793,28 @@ s3_928_col(int cols) outb(addr_6845+1, 0x87); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, 0x1b); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); - outb(addr_6845, 0x34); + outb(addr_6845, 0x34); outb(addr_6845+1, 0x10);/* enable data xfer pos control */ outb(addr_6845, 0x3b); outb(addr_6845+1, 0x90);/* set data xfer pos value */ - + outb(addr_6845, 0x42); /* (Clock) Mode Control */ outb(addr_6845+1, 0x02);/* Select 40MHz Clock */ - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else @@ -1842,22 +1842,22 @@ s3_928_col(int cols) vga_screen_on(); return(0); } - + sp = savearea.s3_928; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x03); /* Horizontal Blank End */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); @@ -1868,31 +1868,31 @@ s3_928_col(int cols) outb(addr_6845, 0x42); /* Mode control */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); outb(GN_MISCOUTW, *sp++); /* Misc output register */ - } - + } + /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); @@ -1902,7 +1902,7 @@ s3_928_col(int cols) outb(addr_6845+1, 0x00); /* lock registers */ vga_screen_on(); - + return(1); } @@ -1916,10 +1916,10 @@ cl_gd542x_col(int cols) u_char byte; vga_screen_off(); - + /* enable access to first 7 CRTC registers */ - outb(addr_6845, CRTC_VSYNCE); + outb(addr_6845, CRTC_VSYNCE); byte = inb(addr_6845+1); outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte & 0x7f); @@ -1927,17 +1927,17 @@ cl_gd542x_col(int cols) /* enable access to cirrus extension registers */ outb(TS_INDEX, 6); outb(TS_DATA, 0x12); - + if(cols == SCR_COL132) /* switch 80 -> 132 */ { /* save state of board for 80 columns */ - + if(!regsaved) { regsaved = 1; sp = savearea.cirrus; - + outb(addr_6845, 0x00); /* Horizontal Total */ *sp++ = inb(addr_6845+1); outb(addr_6845, 0x01); /* Horizontal Display End */ @@ -1950,28 +1950,28 @@ cl_gd542x_col(int cols) *sp++ = inb(addr_6845+1); outb(addr_6845, 0x05); /* Horizontal Retrace End */ *sp++ = inb(addr_6845+1); - + outb(addr_6845, 0x13); /* Row Offset Register */ *sp++ = inb(addr_6845+1); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ *sp++ = inb(TS_DATA); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); *sp++ = inb(ATC_DATAR); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); *sp++ = inb(ATC_DATAR); /* VCLK2 Numerator Register */ @@ -2000,7 +2000,7 @@ cl_gd542x_col(int cols) outb(addr_6845+1, 0x8a); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, 0x9e); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, 0x42); @@ -2016,14 +2016,14 @@ cl_gd542x_col(int cols) outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, 0x01); /* 8 dot char clock */ - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); /* ATC Mode control */ outb(ATC_DATAW, 0x08); /* Line graphics disable */ - + if(color) inb(GN_INPSTAT1C); else @@ -2046,25 +2046,25 @@ cl_gd542x_col(int cols) vga_screen_on(); return(0); } - + sp = savearea.cirrus; - + outb(addr_6845, 0x00); /* Horizontal Total */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x01); /* Horizontal Display End */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x02); /* Horizontal Blank Start */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x03); /* Horizontal Blank End */ - outb(addr_6845+1, *sp++); + outb(addr_6845+1, *sp++); outb(addr_6845, 0x04); /* Horizontal Retrace Start */ outb(addr_6845+1, *sp++); outb(addr_6845, 0x05); /* Horizontal Retrace End */ outb(addr_6845+1, *sp++); - + outb(addr_6845, 0x13); /* Row Offset Register */ outb(addr_6845+1, *sp++); - + outb(TS_INDEX, TS_MODE);/* Timing Sequencer */ outb(TS_DATA, *sp++); @@ -2073,15 +2073,15 @@ cl_gd542x_col(int cols) else inb(GN_INPSTAT1M); /* ATC Mode control */ - outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); + outb(ATC_INDEX, ATC_MODE | ATC_ACCESS); outb(ATC_DATAW, *sp++); - + if(color) inb(GN_INPSTAT1C); else inb(GN_INPSTAT1M); /* ATC Horizontal Pixel Panning */ - outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); + outb(ATC_INDEX, ATC_HORPIXPAN | ATC_ACCESS); outb(ATC_DATAW, *sp++); /* VCLK2 Numerator Register */ @@ -2094,13 +2094,13 @@ cl_gd542x_col(int cols) outb(GN_MISCOUTW, *sp++); /* Misc output register */ } - + /* disable access to cirrus extension registers */ outb(TS_INDEX, 6); outb(TS_DATA, 0); - + /* disable access to first 7 CRTC registers */ - + outb(addr_6845, CRTC_VSYNCE); outb(addr_6845+1, byte); @@ -2126,7 +2126,7 @@ switch_screen(int n, int oldgrafx, int newgrafx) #endif /* !PCVT_KBD_FIFO */ int cols = vsp->maxcol; /* get current col val */ - + if(n < 0 || n >= totalscreens) return; @@ -2145,7 +2145,7 @@ switch_screen(int n, int oldgrafx, int newgrafx) async_update(UPDATE_STOP); /* status display off */ } - + if(!oldgrafx) { /* switch from text mode */ @@ -2156,7 +2156,7 @@ switch_screen(int n, int oldgrafx, int newgrafx) vsp->Crtat = vsp->Memory; /* operate in memory now */ } - + /* update global screen pointers/variables */ current_video_screen = n; /* current screen no */ @@ -2174,12 +2174,12 @@ switch_screen(int n, int oldgrafx, int newgrafx) { /* switch from graphics to text mode */ unsigned i; - + /* restore fonts */ for(i = 0; i < totalfonts; i++) if(saved_charsets[i]) vga_move_charset(i, 0, 0); - + #if PCVT_SCREENSAVER /* activate screen saver */ if(saved_scrnsv_tmo) @@ -2217,7 +2217,7 @@ switch_screen(int n, int oldgrafx, int newgrafx) if(!newgrafx) { /* to text mode */ - + /* kernel memory -> video board memory */ bcopy(vsp->Crtat, Crtat, vsp->screen_rows * vsp->maxcol * CHR); @@ -2229,16 +2229,16 @@ switch_screen(int n, int oldgrafx, int newgrafx) outb(addr_6845, CRTC_STARTADRL); outb(addr_6845+1, 0); } - + #if !PCVT_KBD_FIFO splx(x); #endif /* !PCVT_KBD_FIFO */ - + select_vga_charset(vsp->vga_charset); if(vsp->maxcol != cols) vga_col(vsp, vsp->maxcol); /* select 80/132 columns */ - + outb(addr_6845, CRTC_CURSORH); /* select high register */ outb(addr_6845+1, vsp->cur_offset >> 8); outb(addr_6845, CRTC_CURSORL); /* select low register */ @@ -2273,7 +2273,7 @@ switch_screen(int n, int oldgrafx, int newgrafx) /* if we switch to a vt with force 24 lines mode and */ /* pure VT emulation and 25 rows charset, then we have */ /* to clear the last line on display ... */ - + if(vsp->force24 && (vsp->vt_pure_mode == M_PUREVT) && (vgacs[vsp->vga_charset].screen_size == SIZ_25ROWS)) { @@ -2361,10 +2361,10 @@ int vgapage(int new_screen) { int x; - + if(new_screen < 0 || new_screen >= totalscreens) return EINVAL; - + /* fallback to VT_AUTO if controlling processes died */ if(vsp->proc && vsp->proc != pfind(vsp->pid)) set_auto_mode(vsp); @@ -2405,7 +2405,7 @@ vgapage(int new_screen) switch_screen(new_screen, vsp->vt_status & VT_GRAFX, vs[new_screen].vt_status & VT_GRAFX); - + x = spltty(); if(old_vsp->vt_status & VT_WAIT_ACT) { @@ -2427,7 +2427,7 @@ vgapage(int new_screen) psignal(vsp->proc, vsp->smode.acqsig); } else - { + { /* we are committed */ vt_switch_pending = 0; #if PCVT_FREEBSD > 206 @@ -2452,13 +2452,13 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { int i, j, error, opri; struct vt_mode newmode; - + switch(cmd) { case VT_SETMODE: newmode = *(struct vt_mode *)data; - + opri = spltty(); if (newmode.mode != VT_PROCESS) { @@ -2542,7 +2542,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) return 0; } break; - + case VT_TRUE: /* process releases its VT */ if(vt_switch_pending @@ -2556,7 +2556,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) vsp->vt_status & VT_GRAFX, vs[new_screen].vt_status & VT_GRAFX); - + opri = spltty(); if(old_vsp->vt_status & VT_WAIT_ACT) { @@ -2596,7 +2596,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) } } break; - + case VT_ACKACQ: /* new vts controlling process acknowledged */ if(vsp->vt_status & VT_WAIT_ACK) { @@ -2626,18 +2626,18 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case VT_GETACTIVE: *(int *)data = current_video_screen + 1; return 0; - + case VT_ACTIVATE: return vgapage(*(int *)data - 1); case VT_WAITACTIVE: /* sleep until vt switch happened */ i = *(int *)data - 1; - + if(i != -1 && (i < 0 || i >= PCVT_NSCREENS)) return EINVAL; - + if(i != -1 && current_video_screen == i) return 0; @@ -2669,7 +2669,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) splx(x); } return error; - + case KDENABIO: /* grant the process IO access; only allowed if euid == 0 */ { @@ -2681,7 +2681,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) #else struct syscframe *fp = (struct syscframe *)p->p_regs; #endif - + if(suser(p->p_ucred, &p->p_acflag) != 0) return (EPERM); @@ -2690,10 +2690,10 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) #else fp->sf_eflags |= PSL_IOPL; #endif - + return 0; } - + case KDDISABIO: /* abandon IO access permission */ { @@ -2716,7 +2716,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { struct video_state *vsx = &vs[minor(dev)]; int haschanged = 0; - + if(adaptor_type != VGA_ADAPTOR && adaptor_type != MDA_ADAPTOR) /* X will only run on those adaptors */ @@ -2731,7 +2731,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) if(haschanged && vsx == vsp) switch_screen(current_video_screen, 1, 0); return 0; - + case KD_GRAPHICS: /* xxx It might be a good idea to require that the vt be in process controlled mode here, @@ -2741,11 +2741,11 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) if(haschanged && vsx == vsp) switch_screen(current_video_screen, 0, 1); return 0; - + } return EINVAL; /* end case KDSETMODE */ } - + case KDSETRAD: /* set keyboard repeat and delay */ return kbdioctl(dev, KBDSTPMAT, data, flag); @@ -2774,7 +2774,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) return 0; } return EINVAL; /* end KDSKBMODE */ - + case KDMKTONE: /* ring the speaker */ if(data) @@ -2782,7 +2782,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) int duration = *(int *)data >> 16; int pitch = *(int *)data & 0xffff; -#if PCVT_NETBSD +#if PCVT_NETBSD if(pitch != 0) { sysbeep(PCVT_SYSBEEPF / pitch, @@ -2798,7 +2798,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) sysbeep(PCVT_SYSBEEPF / 1493, hz / 4); } return 0; - + case KDSETLED: /* set kbd LED status */ /* unfortunately, the LED definitions between pcvt and */ @@ -2808,7 +2808,7 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) + (i & LED_NUM? KBD_NUMLOCK: 0) + (i & LED_SCR? KBD_SCROLLLOCK: 0); return kbdioctl(dev, KBDSLOCK, (caddr_t)&j, flag); - + case KDGETLED: /* get kbd LED status */ if((error = kbdioctl(dev, KBDGLOCK, (caddr_t)&j, flag))) diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h index 0419d71..93add9a 100644 --- a/sys/i386/isa/pcvt/pcvt_hdr.h +++ b/sys/i386/isa/pcvt/pcvt_hdr.h @@ -111,7 +111,7 @@ #include "i386/cpufunc.h" #elif PCVT_FREEBSD >= 200 #include <i386/isa/isa_device.h> -#else +#else #include "i386/isa/isa_device.h" #endif @@ -225,7 +225,7 @@ in the config file" #endif #else /* XSERVER */ - + #if PCVT_USL_VT_COMPAT #warning "Option PCVT_USL_VT_COMPAT meaningless without XSERVER" #undef PCVT_USL_VT_COMPAT @@ -563,11 +563,11 @@ in the config file" /*---------------------------------------------------------------------------* * VGA palette handling (output DAC palette) *---------------------------------------------------------------------------*/ - + #define VGA_DAC 0x3C6 /* vga dac address */ #define VGA_PMSK 0x3F /* palette mask, 64 distinct values */ #define NVGAPEL 256 /* number of palette entries */ - + /*---------------------------------------------------------------------------* * function key labels *---------------------------------------------------------------------------*/ @@ -815,7 +815,7 @@ typedef struct video_state { u_char sc_row; /* saved row */ u_char sc_col; /* saved col */ u_short sc_cur_offset; /* saved cursor addr offset */ - u_short sc_attr; /* saved attributes */ + u_short sc_attr; /* saved attributes */ u_char sc_vtsgr; /* saved sgr configuration */ u_char sc_awm; /* saved auto wrap mode */ u_char sc_om; /* saved origin mode */ @@ -824,7 +824,7 @@ typedef struct video_state { u_short *sc_G2; /* save G2 ptr */ u_short *sc_G3; /* save G3 ptr */ u_short *sc_GL; /* save GL ptr */ - u_short *sc_GR; /* save GR ptr */ + u_short *sc_GR; /* save GR ptr */ u_char sc_sel; /* selective erase state */ u_char ufkl[8][17]; /* user fkey-labels */ u_char sfkl[8][17]; /* system fkey-labels */ @@ -837,7 +837,7 @@ typedef struct video_state { u_char attribute; /* attribute normal, tx only, local */ u_char key; /* fkey label no */ u_char l_len; /* buffer length's */ - u_char s_len; + u_char s_len; u_char m_len; u_char i; /* help (got short of names ...) */ u_char l_buf[MAX_LABEL+1]; /* buffers */ @@ -1411,7 +1411,7 @@ static __inline void vt_selattr(struct video_state *svsp) { u_char x = inb(0x84); } \ { u_char x = inb(0x84); } \ { u_char x = inb(0x84); } \ - { u_char x = inb(0x84); } + { u_char x = inb(0x84); } #else /* PCVT_PORTIO_DELAY */ /* use system supplied delay function for */ diff --git a/sys/i386/isa/pcvt/pcvt_kbd.c b/sys/i386/isa/pcvt/pcvt_kbd.c index 6fc53c4..cf6c316 100644 --- a/sys/i386/isa/pcvt/pcvt_kbd.c +++ b/sys/i386/isa/pcvt/pcvt_kbd.c @@ -100,7 +100,7 @@ static u_char altkpflag = 0; static u_short altkpval = 0; #if PCVT_SHOWKEYS -u_char rawkeybuf[80]; +u_char rawkeybuf[80]; #endif #include "pcvt_kbd.h" /* tables etc */ @@ -112,7 +112,7 @@ u_char rawkeybuf[80]; static void showkey (char delim, u_char val) { int rki; - + for(rki = 3; rki < 80; rki++) /* shift left buffer */ rawkeybuf[rki-3] = rawkeybuf[rki]; @@ -126,7 +126,7 @@ static void showkey (char delim, u_char val) rki = rki - 10 + 'A'; rawkeybuf[78] = rki; - + rki = val & 0x0f; /* ls nibble */ if(rki <= 9) @@ -202,7 +202,7 @@ check_for_lost_intr (void *arg) #endif /* PCVT_UPDLED_LOSES_INTR */ /*---------------------------------------------------------------------------* - * update keyboard led's + * update keyboard led's *---------------------------------------------------------------------------*/ void update_led(void) @@ -253,9 +253,9 @@ settpmrate(int rate) if(kbd_cmd(KEYB_C_TYPEM) != 0) printf("Keyboard TYPEMATIC command timeout\n"); else if(kbd_cmd(tpmrate) != 0) - printf("Keyboard TYPEMATIC data timeout\n"); + printf("Keyboard TYPEMATIC data timeout\n"); } - + /*---------------------------------------------------------------------------* * Pass command to keyboard controller (8042) *---------------------------------------------------------------------------*/ @@ -326,7 +326,7 @@ void kbd_emulate_pc(int do_emulation) { int cmd, timeo = 10000; - + cmd = COMMAND_SYSFLG|COMMAND_IRQEN; /* common base cmd */ #if !PCVT_USEKBDSEC @@ -359,7 +359,7 @@ void doreset(void) int again = 0; int once = 0; int response, opri; - + /* Enable interrupts and keyboard, etc. */ if (kbc_8042cmd(CONTR_WRITE) != 0) printf("pcvt: doreset() - timeout controller write command\n"); @@ -385,7 +385,7 @@ void doreset(void) if (kbd_cmd(KBDINITCMD) != 0) printf("pcvt: doreset() - timeout writing keyboard init command\n"); - + /* * Discard any stale keyboard activity. The 0.1 boot code isn't * very careful and sometimes leaves a KEYB_R_RESEND. @@ -421,7 +421,7 @@ void doreset(void) splx(opri); return; } - + if((kbd_cmd(KEYB_C_RESET) != 0) && (once == 0)) { once++; /* print message only once ! */ @@ -471,22 +471,22 @@ r_entry: else if(response == KEYB_R_MF2ID2HP) { keyboard_type = KB_MFII; - } + } else { printf("\npcvt: doreset() - kbdid, response 2 = [%d]\n", response); keyboard_type = KB_UNKNOWN; } - } + } else if (response == KEYB_R_ACK) { goto r_entry; } - else if (response == -1) + else if (response == -1) { keyboard_type = KB_AT; - } + } else { printf("\npcvt: doreset() - kbdid, response 1 = [%d]\n", response); @@ -527,13 +527,13 @@ kbd_code_init1(void) } /*---------------------------------------------------------------------------* - * init keyboard overlay table + * init keyboard overlay table *---------------------------------------------------------------------------*/ static -void ovlinit(int force) +void ovlinit(int force) { register i; - + if(force || ovlinitflag==0) { if(ovlinitflag == 0 && @@ -543,10 +543,10 @@ void ovlinit(int force) for(i=0; i<OVLTBL_SIZE; i++) { - ovltbl[i].keynum = + ovltbl[i].keynum = ovltbl[i].type = 0; ovltbl[i].unshift[0] = - ovltbl[i].shift[0] = + ovltbl[i].shift[0] = ovltbl[i].ctrl[0] = ovltbl[i].altgr[0] = 0; ovltbl[i].subu = @@ -568,7 +568,7 @@ getokeydef(unsigned key, Ovl_tbl *thisdef) { if(key == 0 || key > MAXKEYNUM) return EINVAL; - + thisdef->keynum = key; thisdef->type = key2ascii[key].type; @@ -594,8 +594,8 @@ getokeydef(unsigned key, Ovl_tbl *thisdef) { bcopy("",thisdef->shift,CODE_SIZE); thisdef->subs = KBD_SUBT_FNC; - } - + } + if(key2ascii[key].ctrl.subtype == STR) { bcopy((u_char *)(key2ascii[key].ctrl.what.string), @@ -604,11 +604,11 @@ getokeydef(unsigned key, Ovl_tbl *thisdef) } else { - bcopy("",thisdef->ctrl,CODE_SIZE); + bcopy("",thisdef->ctrl,CODE_SIZE); thisdef->subc = KBD_SUBT_FNC; } - - /* deliver at least anything for ALTGR settings ... */ + + /* deliver at least anything for ALTGR settings ... */ if(key2ascii[key].unshift.subtype == STR) { @@ -628,11 +628,11 @@ getokeydef(unsigned key, Ovl_tbl *thisdef) * get current key definition *---------------------------------------------------------------------------*/ static int -getckeydef(unsigned key, Ovl_tbl *thisdef) +getckeydef(unsigned key, Ovl_tbl *thisdef) { u_short type = key2ascii[key].type; - if(key>MAXKEYNUM) + if(key>MAXKEYNUM) return EINVAL; if(type & KBD_OVERLOAD) @@ -659,10 +659,10 @@ xlatkey2ascii(U_short key) static Ovl_tbl thisdef; int n; void (*fnc)(); - + if(key==0) /* ignore the NON-KEY */ return 0; - + getckeydef(key&0x7F, &thisdef); /* get the current ASCII value */ thisdef.type &= KBD_MASK; @@ -690,7 +690,7 @@ xlatkey2ascii(U_short key) case KBD_FUNC: fnc = NULL; more_chars = NULL; - + if(altgr_down) { more_chars = (u_char *)thisdef.altgr; @@ -702,7 +702,7 @@ xlatkey2ascii(U_short key) else fnc = key2ascii[key].shift.what.func; } - + else if(ctrl_down) { if(key2ascii[key].ctrl.subtype == STR) @@ -710,7 +710,7 @@ xlatkey2ascii(U_short key) else fnc = key2ascii[key].ctrl.what.func; } - + else { if(key2ascii[key].unshift.subtype == STR) @@ -718,10 +718,10 @@ xlatkey2ascii(U_short key) else fnc = key2ascii[key].unshift.what.func; } - + if(fnc) (*fnc)(); /* execute function */ - + if((more_chars != NULL) && (more_chars[1] == 0)) { if(vsp->caps_lock && more_chars[0] >= 'a' @@ -745,7 +745,7 @@ xlatkey2ascii(U_short key) case KBD_KP: fnc = NULL; more_chars = NULL; - + if(meta_down) { switch(key) @@ -755,13 +755,13 @@ xlatkey2ascii(U_short key) more_chars = (u_char *)"\033OQ"; return(more_chars); - + case 100: /* * */ altkpflag = 0; more_chars = (u_char *)"\033OR"; return(more_chars); - + case 105: /* - */ altkpflag = 0; more_chars = @@ -770,7 +770,7 @@ xlatkey2ascii(U_short key) } } - if(meta_down || altgr_down) + if(meta_down || altgr_down) { if((n = keypad2num[key-91]) >= 0) { @@ -786,8 +786,8 @@ xlatkey2ascii(U_short key) else altkpflag = 0; return 0; - } - + } + if(!(vsp->num_lock)) { if(key2ascii[key].shift.subtype == STR) @@ -802,15 +802,15 @@ xlatkey2ascii(U_short key) else fnc = key2ascii[key].unshift.what.func; } - + if(fnc) (*fnc)(); /* execute function */ return(more_chars); - + case KBD_CURSOR: fnc = NULL; more_chars = NULL; - + if(vsp->ckm) { if(key2ascii[key].shift.subtype == STR) @@ -825,14 +825,14 @@ xlatkey2ascii(U_short key) else fnc = key2ascii[key].unshift.what.func; } - + if(fnc) (*fnc)(); /* execute function */ return(more_chars); case KBD_NUM: /* special kp-num handling */ more_chars = NULL; - + if(meta_down) { more_chars = (u_char *)"\033OP"; /* PF1 */ @@ -869,7 +869,7 @@ xlatkey2ascii(U_short key) more_chars = metachar; } return(more_chars); - + case KBD_META: /* these keys are */ case KBD_ALTGR: /* handled directly */ case KBD_SCROLL: /* by the keyboard */ @@ -905,7 +905,7 @@ sgetc(int noblock) #if PCVT_KBD_FIFO && PCVT_SLOW_INTERRUPT int s; #endif - + static u_char kbd_lastkey = 0; /* last keystroke */ static struct @@ -923,7 +923,7 @@ sgetc(int noblock) #endif /* XSERVER */ loop: - + #ifdef XSERVER #if PCVT_KBD_FIFO @@ -952,7 +952,7 @@ loop: #else /* !PCVT_KB_FIFO */ /* see if there is data from the keyboard available from the 8042 */ - + if (inb(CONTROLLER_CTRL) & STATUS_OUTPBF) { PCVT_KBD_DELAY(); /* 7 us delay */ @@ -1088,7 +1088,7 @@ loop: {0x87, 4, -4, 0, 0} /* SE */ } }; - + if(dt == 0xe0) { /* ignore extended scan codes */ @@ -1211,7 +1211,7 @@ loop: && now.tv_usec < mousedef.acceltime); break; - + default: /* not a mouse-emulating key */ goto no_mouse_event; } @@ -1261,7 +1261,7 @@ no_mouse_event: #else /* !PCVT_KBD_FIFO */ /* see if there is data from the keyboard available from the 8042 */ - + if(inb(CONTROLLER_CTRL) & STATUS_OUTPBF) { PCVT_KBD_DELAY(); /* 7 us delay */ @@ -1305,12 +1305,12 @@ no_mouse_event: kbd_status.ext1 = 1; /* FALLTHROUGH */ case KEYB_R_EXT0: /* keyboard extended scancode pfx 1 */ - kbd_status.extended = 1; + kbd_status.extended = 1; break; #if PCVT_SCANSET == 2 case KEYB_R_BREAKPFX: /* break code prefix for set 2 and 3 */ - kbd_status.breakseen = 1; + kbd_status.breakseen = 1; break; #endif /* PCVT_SCANSET == 2 */ @@ -1347,7 +1347,7 @@ regular: if((key == 76) && ctrl_down && (meta_down||altgr_down)) cpu_reset(); #endif /* PCVT_CTRL_ALT_DEL */ - + #if !(PCVT_NETBSD || PCVT_FREEBSD >= 200) #include "ddb.h" #endif /* !(PCVT_NETBSD || PCVT_FREEBSD >= 200) */ @@ -1357,7 +1357,7 @@ regular: if((key == 110) && ctrl_down && (meta_down || altgr_down)) { static u_char in_Debugger; - + if(!in_Debugger) { in_Debugger = 1; @@ -1441,7 +1441,7 @@ regular: else goto loop; } - + type = key2ascii[key].type; if(type & KBD_OVERLOAD) @@ -1457,7 +1457,7 @@ regular: vsp->shift_lock ^= 1; } break; - + case KBD_CAPS: if(!kbd_status.breakseen && key != kbd_lastkey) { @@ -1465,7 +1465,7 @@ regular: update_led(); } break; - + case KBD_SCROLL: if(!kbd_status.breakseen && key != kbd_lastkey) { @@ -1479,7 +1479,7 @@ regular: } } break; - + case KBD_SHIFT: shift_down = kbd_status.breakseen ? 0 : 1; break; @@ -1509,7 +1509,7 @@ regular: } /* N-Key-Rollover, but I ignore that */ else /* because avoidance is too complicated */ kbd_lastkey = key; - + cp = xlatkey2ascii(key); /* have a key */ if(cp == NULL && !noblock) @@ -1537,13 +1537,13 @@ static int rmkeydef(int key) { register Ovl_tbl *ref; - + if(key==0 || key > MAXKEYNUM) return EINVAL; if(key2ascii[key].type & KBD_OVERLOAD) { - ref = &ovltbl[key2ascii[key].ovlindex]; + ref = &ovltbl[key2ascii[key].ovlindex]; ref->keynum = 0; ref->type = 0; ref->unshift[0] = @@ -1553,7 +1553,7 @@ rmkeydef(int key) key2ascii[key].type &= KBD_MASK; } return 0; -} +} /*---------------------------------------------------------------------------* * overlay a key @@ -1577,7 +1577,7 @@ setkeydef(Ovl_tbl *data) data->subs = data->subc = data->suba = KBD_SUBT_STR; /* just strings .. */ - + data->type |= KBD_OVERLOAD; /* mark overloaded */ /* if key already overloaded, use that slot else find free slot */ @@ -1592,7 +1592,7 @@ setkeydef(Ovl_tbl *data) if(ovltbl[i].keynum==0) break; - if(i==OVLTBL_SIZE) + if(i==OVLTBL_SIZE) return ENOSPC; /* no space, abuse of ENOSPC(!) */ } @@ -1600,7 +1600,7 @@ setkeydef(Ovl_tbl *data) key2ascii[data->keynum].type |= KBD_OVERLOAD; /* mark key */ key2ascii[data->keynum].ovlindex = i; - + return 0; } @@ -1657,7 +1657,7 @@ kbdioctl(Dev_t dev, int cmd, caddr_t data, int flag) case KBDGCKEY: key = ((Ovl_tbl *)data)->keynum; - return getckeydef(key,(Ovl_tbl *)data); + return getckeydef(key,(Ovl_tbl *)data); case KBDSCKEY: key = ((Ovl_tbl *)data)->keynum; @@ -1673,7 +1673,7 @@ kbdioctl(Dev_t dev, int cmd, caddr_t data, int flag) case KBDDEFAULT: ovlinit(1); - break; + break; default: /* proceed with vga ioctls */ @@ -1690,17 +1690,17 @@ int mouse_ioctl(Dev_t dev, int cmd, caddr_t data) { struct mousedefs *def = (struct mousedefs *)data; - + switch(cmd) { case KBDMOUSEGET: *def = mousedef; break; - + case KBDMOUSESET: mousedef = *def; break; - + default: return -1; } @@ -1731,14 +1731,14 @@ get_usl_keymap(keymap_t *map) bzero((caddr_t)map, sizeof(keymap_t)); map->n_keys = 0x59; /* that many keys we know about */ - + for(i = 1; i < N_KEYNUMS; i++) { Ovl_tbl kdef; u_char c; int j; int idx = key2scan1[i]; - + if(idx == 0 || idx >= map->n_keys) continue; @@ -1765,7 +1765,7 @@ get_usl_keymap(keymap_t *map) if((c & 0x7f) >= 0x40) map->key[idx].map[5] = iso2ibm(c ^ 0x20); break; - + case KBD_FUNC: /* we are only interested in F1 thru F12 here */ if(i >= 112 && i <= 123) { @@ -1796,12 +1796,12 @@ get_usl_keymap(keymap_t *map) map->key[idx].map[j] = c; map->key[idx].spcl = 0xff; break; - + default: break; } } -} +} #endif /* PCVT_USL_VT_COMPAT */ @@ -1932,7 +1932,7 @@ fkey5(void) if(!meta_down) { if((vsp->vt_pure_mode == M_HPVT) - && (vsp->which_fkl == SYS_FKL)) + && (vsp->which_fkl == SYS_FKL)) toggl_bell(vsp); else more_chars = (u_char *)"\033[21~"; /* F10 */ @@ -1954,7 +1954,7 @@ fkey6(void) if(!meta_down) { if((vsp->vt_pure_mode == M_HPVT) - && (vsp->which_fkl == SYS_FKL)) + && (vsp->which_fkl == SYS_FKL)) toggl_sevenbit(vsp); else more_chars = (u_char *)"\033[23~"; /* F11 */ @@ -1998,7 +1998,7 @@ fkey8(void) if(!meta_down) { if((vsp->vt_pure_mode == M_HPVT) - && (vsp->which_fkl == SYS_FKL)) + && (vsp->which_fkl == SYS_FKL)) toggl_awm(vsp); else more_chars = (u_char *)"\033[25~"; /* F13 */ @@ -2021,7 +2021,7 @@ fkey9(void) { if(vsp->vt_pure_mode == M_PUREVT) return; - + if(vsp->labels_on) /* toggle label display on/off */ fkl_off(vsp); else @@ -2477,7 +2477,7 @@ fkey5(void) static void fkey6(void) { - if(meta_down) + if(meta_down) more_chars = (u_char *)"\033[29~"; /* DO */ else more_chars = (u_char *)"\033[17~"; /* F6 */ @@ -2855,7 +2855,7 @@ cfkey5(void) static void cfkey6(void) { - if(vsp->which_fkl == SYS_FKL) + if(vsp->which_fkl == SYS_FKL) toggl_sevenbit(vsp); } @@ -2875,7 +2875,7 @@ cfkey7(void) static void cfkey8(void) { - if(vsp->which_fkl == SYS_FKL) + if(vsp->which_fkl == SYS_FKL) toggl_awm(vsp); } diff --git a/sys/i386/isa/pcvt/pcvt_kbd.h b/sys/i386/isa/pcvt/pcvt_kbd.h index f488d53..000a709 100644 --- a/sys/i386/isa/pcvt/pcvt_kbd.h +++ b/sys/i386/isa/pcvt/pcvt_kbd.h @@ -60,7 +60,7 @@ typedef struct u_char subtype; /* subtype, string or function */ #ifdef PCVT_ALT_ENH u_short str_leng; /* if string, stringlength */ -#endif +#endif union what { u_char *string; /* ptr to string, null terminated */ @@ -69,7 +69,7 @@ typedef struct } entry; /*---------------------------------------------------------------------------* - * this is the "outer" table + * this is the "outer" table *---------------------------------------------------------------------------*/ typedef struct { @@ -209,138 +209,138 @@ static Keycap_def key2ascii[] = /* type index unshift shift ctrl alt alt_shift alt_ctrl alt_ctrl_shift */ /* -------------------------------------------------------------------------------------------------------------------------------------------------- */ -/* 0*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 1*/ KBD_ASCII, I, {S,1,C "`"}, {S,1,C "~"}, {S,1,C "`"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 2*/ KBD_ASCII, I, {S,1,C "1"}, {S,1,C "!"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 3*/ KBD_ASCII, I, {S,1,C "2"}, {S,1,C "@"}, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 4*/ KBD_ASCII, I, {S,1,C "3"}, {S,1,C "#"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 5*/ KBD_ASCII, I, {S,1,C "4"}, {S,1,C "$"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 6*/ KBD_ASCII, I, {S,1,C "5"}, {S,1,C "%"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 7*/ KBD_ASCII, I, {S,1,C "6"}, {S,1,C "^"}, {S,1,C "\036"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 8*/ KBD_ASCII, I, {S,1,C "7"}, {S,1,C "&"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 9*/ KBD_ASCII, I, {S,1,C "8"}, {S,1,C "*"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 10*/ KBD_ASCII, I, {S,1,C "9"}, {S,1,C "("}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 11*/ KBD_ASCII, I, {S,1,C "0"}, {S,1,C ")"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 12*/ KBD_ASCII, I, {S,1,C "-"}, {S,1,C "_"}, {S,1,C "\037"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 13*/ KBD_ASCII, I, {S,1,C "="}, {S,1,C "+"}, {S,1,C "="}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 14*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 15*/ KBD_ASCII, I, {S,1,C "\177"}, {S,1,C "\010"}, {S,1,C "\177"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 16*/ KBD_ASCII, I, {S,1,C "\t"}, {S,1,C "\t"}, {S,1,C "\t"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 17*/ KBD_ASCII, I, {S,1,C "q"}, {S,1,C "Q"}, {S,1,C "\021"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 18*/ KBD_ASCII, I, {S,1,C "w"}, {S,1,C "W"}, {S,1,C "\027"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 19*/ KBD_ASCII, I, {S,1,C "e"}, {S,1,C "E"}, {S,1,C "\005"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 20*/ KBD_ASCII, I, {S,1,C "r"}, {S,1,C "R"}, {S,1,C "\022"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 21*/ KBD_ASCII, I, {S,1,C "t"}, {S,1,C "T"}, {S,1,C "\024"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 22*/ KBD_ASCII, I, {S,1,C "y"}, {S,1,C "Y"}, {S,1,C "\031"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 23*/ KBD_ASCII, I, {S,1,C "u"}, {S,1,C "U"}, {S,1,C "\025"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 24*/ KBD_ASCII, I, {S,1,C "i"}, {S,1,C "I"}, {S,1,C "\011"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 25*/ KBD_ASCII, I, {S,1,C "o"}, {S,1,C "O"}, {S,1,C "\017"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 26*/ KBD_ASCII, I, {S,1,C "p"}, {S,1,C "P"}, {S,1,C "\020"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 27*/ KBD_ASCII, I, {S,1,C "["}, {S,1,C "{"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 28*/ KBD_ASCII, I, {S,1,C "]"}, {S,1,C "}"}, {S,1,C "\035"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 29*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 30*/ KBD_CAPS, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 31*/ KBD_ASCII, I, {S,1,C "a"}, {S,1,C "A"}, {S,1,C "\001"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 32*/ KBD_ASCII, I, {S,1,C "s"}, {S,1,C "S"}, {S,1,C "\023"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 33*/ KBD_ASCII, I, {S,1,C "d"}, {S,1,C "D"}, {S,1,C "\004"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 34*/ KBD_ASCII, I, {S,1,C "f"}, {S,1,C "F"}, {S,1,C "\006"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 35*/ KBD_ASCII, I, {S,1,C "g"}, {S,1,C "G"}, {S,1,C "\007"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 36*/ KBD_ASCII, I, {S,1,C "h"}, {S,1,C "H"}, {S,1,C "\010"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 37*/ KBD_ASCII, I, {S,1,C "j"}, {S,1,C "J"}, {S,1,C "\n"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 38*/ KBD_ASCII, I, {S,1,C "k"}, {S,1,C "K"}, {S,1,C "\013"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 39*/ KBD_ASCII, I, {S,1,C "l"}, {S,1,C "L"}, {S,1,C "\014"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 40*/ KBD_ASCII, I, {S,1,C ";"}, {S,1,C ":"}, {S,1,C ";"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 41*/ KBD_ASCII, I, {S,1,C "'"}, {S,1,C "\""}, {S,1,C "'"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 42*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 43*/ KBD_RETURN,I, {S,1,C "\r"}, {S,1,C "\r"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 44*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 45*/ KBD_ASCII, I, {S,1,C "<"}, {S,1,C ">"}, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 46*/ KBD_ASCII, I, {S,1,C "z"}, {S,1,C "Z"}, {S,1,C "\032"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 47*/ KBD_ASCII, I, {S,1,C "x"}, {S,1,C "X"}, {S,1,C "\030"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 48*/ KBD_ASCII, I, {S,1,C "c"}, {S,1,C "C"}, {S,1,C "\003"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 49*/ KBD_ASCII, I, {S,1,C "v"}, {S,1,C "V"}, {S,1,C "\026"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 50*/ KBD_ASCII, I, {S,1,C "b"}, {S,1,C "B"}, {S,1,C "\002"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 51*/ KBD_ASCII, I, {S,1,C "n"}, {S,1,C "N"}, {S,1,C "\016"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 52*/ KBD_ASCII, I, {S,1,C "m"}, {S,1,C "M"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 53*/ KBD_ASCII, I, {S,1,C ","}, {S,1,C "<"}, {S,1,C ","}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 54*/ KBD_ASCII, I, {S,1,C "."}, {S,1,C ">"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 55*/ KBD_ASCII, I, {S,1,C "/"}, {S,1,C "?"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 56*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 57*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 58*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 59*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 60*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 0*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 1*/ KBD_ASCII, I, {S,1,C "`"}, {S,1,C "~"}, {S,1,C "`"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 2*/ KBD_ASCII, I, {S,1,C "1"}, {S,1,C "!"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 3*/ KBD_ASCII, I, {S,1,C "2"}, {S,1,C "@"}, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 4*/ KBD_ASCII, I, {S,1,C "3"}, {S,1,C "#"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 5*/ KBD_ASCII, I, {S,1,C "4"}, {S,1,C "$"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 6*/ KBD_ASCII, I, {S,1,C "5"}, {S,1,C "%"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 7*/ KBD_ASCII, I, {S,1,C "6"}, {S,1,C "^"}, {S,1,C "\036"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 8*/ KBD_ASCII, I, {S,1,C "7"}, {S,1,C "&"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 9*/ KBD_ASCII, I, {S,1,C "8"}, {S,1,C "*"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 10*/ KBD_ASCII, I, {S,1,C "9"}, {S,1,C "("}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 11*/ KBD_ASCII, I, {S,1,C "0"}, {S,1,C ")"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 12*/ KBD_ASCII, I, {S,1,C "-"}, {S,1,C "_"}, {S,1,C "\037"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 13*/ KBD_ASCII, I, {S,1,C "="}, {S,1,C "+"}, {S,1,C "="}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 14*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 15*/ KBD_ASCII, I, {S,1,C "\177"}, {S,1,C "\010"}, {S,1,C "\177"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 16*/ KBD_ASCII, I, {S,1,C "\t"}, {S,1,C "\t"}, {S,1,C "\t"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 17*/ KBD_ASCII, I, {S,1,C "q"}, {S,1,C "Q"}, {S,1,C "\021"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 18*/ KBD_ASCII, I, {S,1,C "w"}, {S,1,C "W"}, {S,1,C "\027"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 19*/ KBD_ASCII, I, {S,1,C "e"}, {S,1,C "E"}, {S,1,C "\005"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 20*/ KBD_ASCII, I, {S,1,C "r"}, {S,1,C "R"}, {S,1,C "\022"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 21*/ KBD_ASCII, I, {S,1,C "t"}, {S,1,C "T"}, {S,1,C "\024"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 22*/ KBD_ASCII, I, {S,1,C "y"}, {S,1,C "Y"}, {S,1,C "\031"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 23*/ KBD_ASCII, I, {S,1,C "u"}, {S,1,C "U"}, {S,1,C "\025"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 24*/ KBD_ASCII, I, {S,1,C "i"}, {S,1,C "I"}, {S,1,C "\011"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 25*/ KBD_ASCII, I, {S,1,C "o"}, {S,1,C "O"}, {S,1,C "\017"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 26*/ KBD_ASCII, I, {S,1,C "p"}, {S,1,C "P"}, {S,1,C "\020"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 27*/ KBD_ASCII, I, {S,1,C "["}, {S,1,C "{"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 28*/ KBD_ASCII, I, {S,1,C "]"}, {S,1,C "}"}, {S,1,C "\035"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 29*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 30*/ KBD_CAPS, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 31*/ KBD_ASCII, I, {S,1,C "a"}, {S,1,C "A"}, {S,1,C "\001"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 32*/ KBD_ASCII, I, {S,1,C "s"}, {S,1,C "S"}, {S,1,C "\023"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 33*/ KBD_ASCII, I, {S,1,C "d"}, {S,1,C "D"}, {S,1,C "\004"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 34*/ KBD_ASCII, I, {S,1,C "f"}, {S,1,C "F"}, {S,1,C "\006"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 35*/ KBD_ASCII, I, {S,1,C "g"}, {S,1,C "G"}, {S,1,C "\007"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 36*/ KBD_ASCII, I, {S,1,C "h"}, {S,1,C "H"}, {S,1,C "\010"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 37*/ KBD_ASCII, I, {S,1,C "j"}, {S,1,C "J"}, {S,1,C "\n"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 38*/ KBD_ASCII, I, {S,1,C "k"}, {S,1,C "K"}, {S,1,C "\013"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 39*/ KBD_ASCII, I, {S,1,C "l"}, {S,1,C "L"}, {S,1,C "\014"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 40*/ KBD_ASCII, I, {S,1,C ";"}, {S,1,C ":"}, {S,1,C ";"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 41*/ KBD_ASCII, I, {S,1,C "'"}, {S,1,C "\""}, {S,1,C "'"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 42*/ KBD_ASCII, I, {S,1,C "\\"}, {S,1,C "|"}, {S,1,C "\034"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 43*/ KBD_RETURN,I, {S,1,C "\r"}, {S,1,C "\r"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 44*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 45*/ KBD_ASCII, I, {S,1,C "<"}, {S,1,C ">"}, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 46*/ KBD_ASCII, I, {S,1,C "z"}, {S,1,C "Z"}, {S,1,C "\032"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 47*/ KBD_ASCII, I, {S,1,C "x"}, {S,1,C "X"}, {S,1,C "\030"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 48*/ KBD_ASCII, I, {S,1,C "c"}, {S,1,C "C"}, {S,1,C "\003"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 49*/ KBD_ASCII, I, {S,1,C "v"}, {S,1,C "V"}, {S,1,C "\026"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 50*/ KBD_ASCII, I, {S,1,C "b"}, {S,1,C "B"}, {S,1,C "\002"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 51*/ KBD_ASCII, I, {S,1,C "n"}, {S,1,C "N"}, {S,1,C "\016"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 52*/ KBD_ASCII, I, {S,1,C "m"}, {S,1,C "M"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 53*/ KBD_ASCII, I, {S,1,C ","}, {S,1,C "<"}, {S,1,C ","}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 54*/ KBD_ASCII, I, {S,1,C "."}, {S,1,C ">"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 55*/ KBD_ASCII, I, {S,1,C "/"}, {S,1,C "?"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 56*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 57*/ KBD_SHIFT, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 58*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 59*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 60*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, #if !PCVT_NULLCHARS -/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, #else -/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 61*/ KBD_ASCII, I, DFAULT, DFAULT, {S,1,C "\000"}, DFAULT, DFAULT, DFAULT, DFAULT, #endif /* PCVT_NULLCHARS */ -/* 62*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 63*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 64*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 65*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 66*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 67*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 68*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 69*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 70*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 71*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 72*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 73*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 74*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 75*/ KBD_FUNC, I, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 76*/ KBD_FUNC, I, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 77*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 78*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 79*/ KBD_CURSOR,I, {S,4,C "\033[D"}, {S,4,C "\033OD"}, {S,4,C "\033[D"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 80*/ KBD_FUNC, I, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 81*/ KBD_FUNC, I, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 82*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 83*/ KBD_CURSOR,I, {S,4,C "\033[A"}, {S,4,C "\033OA"}, {S,4,C "\033[A"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 84*/ KBD_CURSOR,I, {S,4,C "\033[B"}, {S,4,C "\033OB"}, {S,4,C "\033[B"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 85*/ KBD_FUNC, I, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 86*/ KBD_FUNC, I, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 87*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 88*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 89*/ KBD_CURSOR,I, {S,3,C "\033[C"}, {S,3,C "\033OC"}, {S,3,C "\033[C"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 90*/ KBD_NUM, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 91*/ KBD_KP, I, {S,1,C "7"}, {S,2,C "\033Ow"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 92*/ KBD_KP, I, {S,1,C "4"}, {S,2,C "\033Ot"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 93*/ KBD_KP, I, {S,1,C "1"}, {S,2,C "\033Oq"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 94*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/* 95*/ KBD_KP, I, {S,1,C "/"}, {S,1,C "/"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 96*/ KBD_KP, I, {S,1,C "8"}, {S,2,C "\033Ox"}, {S,1,C "8"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 97*/ KBD_KP, I, {S,1,C "5"}, {S,2,C "\033Ou"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 98*/ KBD_KP, I, {S,1,C "2"}, {S,2,C "\033Or"}, {S,1,C "2"}, DFAULT, DFAULT, DFAULT, DFAULT, -/* 99*/ KBD_KP, I, {S,1,C "0"}, {S,2,C "\033Op"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*100*/ KBD_KP, I, {S,1,C "*"}, {S,1,C "*"}, {S,1,C "*"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*101*/ KBD_KP, I, {S,1,C "9"}, {S,2,C "\033Oy"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*102*/ KBD_KP, I, {S,1,C "6"}, {S,2,C "\033Ov"}, {S,1,C "6"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*103*/ KBD_KP, I, {S,1,C "3"}, {S,2,C "\033Os"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*104*/ KBD_KP, I, {S,1,C "."}, {S,2,C "\033On"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT, -/*105*/ KBD_KP, I, {S,1,C "-"}, {S,2,C "\033Om"}, {S,1,C "-"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*106*/ KBD_KP, I, {S,1,C "+"}, {S,1,C "+"}, {S,1,C "+"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*107*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*108*/ KBD_RETURN,I, {S,1,C "\r"}, {S,2,C "\033OM"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*109*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*110*/ KBD_ASCII, I, {S,1,C "\033"}, {S,2,C "\033"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT, -/*111*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*112*/ KBD_FUNC, I, {F,0,V fkey1}, {F,0,V sfkey1}, {F,0,V cfkey1}, DFAULT, DFAULT, DFAULT, DFAULT, -/*113*/ KBD_FUNC, I, {F,0,V fkey2}, {F,0,V sfkey2}, {F,0,V cfkey2}, DFAULT, DFAULT, DFAULT, DFAULT, -/*114*/ KBD_FUNC, I, {F,0,V fkey3}, {F,0,V sfkey3}, {F,0,V cfkey3}, DFAULT, DFAULT, DFAULT, DFAULT, -/*115*/ KBD_FUNC, I, {F,0,V fkey4}, {F,0,V sfkey4}, {F,0,V cfkey4}, DFAULT, DFAULT, DFAULT, DFAULT, -/*116*/ KBD_FUNC, I, {F,0,V fkey5}, {F,0,V sfkey5}, {F,0,V cfkey5}, DFAULT, DFAULT, DFAULT, DFAULT, -/*117*/ KBD_FUNC, I, {F,0,V fkey6}, {F,0,V sfkey6}, {F,0,V cfkey6}, DFAULT, DFAULT, DFAULT, DFAULT, -/*118*/ KBD_FUNC, I, {F,0,V fkey7}, {F,0,V sfkey7}, {F,0,V cfkey7}, DFAULT, DFAULT, DFAULT, DFAULT, -/*119*/ KBD_FUNC, I, {F,0,V fkey8}, {F,0,V sfkey8}, {F,0,V cfkey8}, DFAULT, DFAULT, DFAULT, DFAULT, -/*120*/ KBD_FUNC, I, {F,0,V fkey9}, {F,0,V sfkey9}, {F,0,V cfkey9}, DFAULT, DFAULT, DFAULT, DFAULT, -/*121*/ KBD_FUNC, I, {F,0,V fkey10}, {F,0,V sfkey10}, {F,0,V cfkey10}, DFAULT, DFAULT, DFAULT, DFAULT, -/*122*/ KBD_FUNC, I, {F,0,V fkey11}, {F,0,V sfkey11}, {F,0,V cfkey11}, DFAULT, DFAULT, DFAULT, DFAULT, -/*123*/ KBD_FUNC, I, {F,0,V fkey12}, {F,0,V sfkey12}, {F,0,V cfkey12}, DFAULT, DFAULT, DFAULT, DFAULT, -/*124*/ KBD_KP, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*125*/ KBD_SCROLL,I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*126*/ KBD_BREAK, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, -/*127*/ KBD_FUNC, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 62*/ KBD_META, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 63*/ KBD_ASCII, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 64*/ KBD_CTL, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 65*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 66*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 67*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 68*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 69*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 70*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 71*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 72*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 73*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 74*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 75*/ KBD_FUNC, I, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, {S,4,C "\033[2~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 76*/ KBD_FUNC, I, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, {S,4,C "\033[3~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 77*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 78*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 79*/ KBD_CURSOR,I, {S,4,C "\033[D"}, {S,4,C "\033OD"}, {S,4,C "\033[D"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 80*/ KBD_FUNC, I, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, {S,4,C "\033[1~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 81*/ KBD_FUNC, I, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, {S,4,C "\033[4~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 82*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 83*/ KBD_CURSOR,I, {S,4,C "\033[A"}, {S,4,C "\033OA"}, {S,4,C "\033[A"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 84*/ KBD_CURSOR,I, {S,4,C "\033[B"}, {S,4,C "\033OB"}, {S,4,C "\033[B"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 85*/ KBD_FUNC, I, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, {S,4,C "\033[5~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 86*/ KBD_FUNC, I, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, {S,4,C "\033[6~"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 87*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 88*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 89*/ KBD_CURSOR,I, {S,3,C "\033[C"}, {S,3,C "\033OC"}, {S,3,C "\033[C"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 90*/ KBD_NUM, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 91*/ KBD_KP, I, {S,1,C "7"}, {S,2,C "\033Ow"}, {S,1,C "7"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 92*/ KBD_KP, I, {S,1,C "4"}, {S,2,C "\033Ot"}, {S,1,C "4"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 93*/ KBD_KP, I, {S,1,C "1"}, {S,2,C "\033Oq"}, {S,1,C "1"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 94*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/* 95*/ KBD_KP, I, {S,1,C "/"}, {S,1,C "/"}, {S,1,C "/"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 96*/ KBD_KP, I, {S,1,C "8"}, {S,2,C "\033Ox"}, {S,1,C "8"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 97*/ KBD_KP, I, {S,1,C "5"}, {S,2,C "\033Ou"}, {S,1,C "5"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 98*/ KBD_KP, I, {S,1,C "2"}, {S,2,C "\033Or"}, {S,1,C "2"}, DFAULT, DFAULT, DFAULT, DFAULT, +/* 99*/ KBD_KP, I, {S,1,C "0"}, {S,2,C "\033Op"}, {S,1,C "0"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*100*/ KBD_KP, I, {S,1,C "*"}, {S,1,C "*"}, {S,1,C "*"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*101*/ KBD_KP, I, {S,1,C "9"}, {S,2,C "\033Oy"}, {S,1,C "9"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*102*/ KBD_KP, I, {S,1,C "6"}, {S,2,C "\033Ov"}, {S,1,C "6"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*103*/ KBD_KP, I, {S,1,C "3"}, {S,2,C "\033Os"}, {S,1,C "3"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*104*/ KBD_KP, I, {S,1,C "."}, {S,2,C "\033On"}, {S,1,C "."}, DFAULT, DFAULT, DFAULT, DFAULT, +/*105*/ KBD_KP, I, {S,1,C "-"}, {S,2,C "\033Om"}, {S,1,C "-"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*106*/ KBD_KP, I, {S,1,C "+"}, {S,1,C "+"}, {S,1,C "+"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*107*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*108*/ KBD_RETURN,I, {S,1,C "\r"}, {S,2,C "\033OM"}, {S,1,C "\r"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*109*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*110*/ KBD_ASCII, I, {S,1,C "\033"}, {S,2,C "\033"}, {S,1,C "\033"}, DFAULT, DFAULT, DFAULT, DFAULT, +/*111*/ KBD_NONE, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*112*/ KBD_FUNC, I, {F,0,V fkey1}, {F,0,V sfkey1}, {F,0,V cfkey1}, DFAULT, DFAULT, DFAULT, DFAULT, +/*113*/ KBD_FUNC, I, {F,0,V fkey2}, {F,0,V sfkey2}, {F,0,V cfkey2}, DFAULT, DFAULT, DFAULT, DFAULT, +/*114*/ KBD_FUNC, I, {F,0,V fkey3}, {F,0,V sfkey3}, {F,0,V cfkey3}, DFAULT, DFAULT, DFAULT, DFAULT, +/*115*/ KBD_FUNC, I, {F,0,V fkey4}, {F,0,V sfkey4}, {F,0,V cfkey4}, DFAULT, DFAULT, DFAULT, DFAULT, +/*116*/ KBD_FUNC, I, {F,0,V fkey5}, {F,0,V sfkey5}, {F,0,V cfkey5}, DFAULT, DFAULT, DFAULT, DFAULT, +/*117*/ KBD_FUNC, I, {F,0,V fkey6}, {F,0,V sfkey6}, {F,0,V cfkey6}, DFAULT, DFAULT, DFAULT, DFAULT, +/*118*/ KBD_FUNC, I, {F,0,V fkey7}, {F,0,V sfkey7}, {F,0,V cfkey7}, DFAULT, DFAULT, DFAULT, DFAULT, +/*119*/ KBD_FUNC, I, {F,0,V fkey8}, {F,0,V sfkey8}, {F,0,V cfkey8}, DFAULT, DFAULT, DFAULT, DFAULT, +/*120*/ KBD_FUNC, I, {F,0,V fkey9}, {F,0,V sfkey9}, {F,0,V cfkey9}, DFAULT, DFAULT, DFAULT, DFAULT, +/*121*/ KBD_FUNC, I, {F,0,V fkey10}, {F,0,V sfkey10}, {F,0,V cfkey10}, DFAULT, DFAULT, DFAULT, DFAULT, +/*122*/ KBD_FUNC, I, {F,0,V fkey11}, {F,0,V sfkey11}, {F,0,V cfkey11}, DFAULT, DFAULT, DFAULT, DFAULT, +/*123*/ KBD_FUNC, I, {F,0,V fkey12}, {F,0,V sfkey12}, {F,0,V cfkey12}, DFAULT, DFAULT, DFAULT, DFAULT, +/*124*/ KBD_KP, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*125*/ KBD_SCROLL,I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*126*/ KBD_BREAK, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, +/*127*/ KBD_FUNC, I, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, DFAULT, #undef C #undef U @@ -367,8 +367,8 @@ static Keycap_def key2ascii[] = /* 0*/ KBD_NONE, I, {S,C "df"}, {S,C ""}, {S,C ""}, /* 1*/ KBD_ASCII, I, {S,C "`"}, {S,C "~"}, {S,C "`"}, /* 2*/ KBD_ASCII, I, {S,C "1"}, {S,C "!"}, {S,C "1"}, -/* 3*/ KBD_ASCII, I, {S,C "2"}, {S,C "@"}, {S,C "\000"}, -/* 4*/ KBD_ASCII, I, {S,C "3"}, {S,C "#"}, {S,C "3"}, +/* 3*/ KBD_ASCII, I, {S,C "2"}, {S,C "@"}, {S,C "\000"}, +/* 4*/ KBD_ASCII, I, {S,C "3"}, {S,C "#"}, {S,C "3"}, /* 5*/ KBD_ASCII, I, {S,C "4"}, {S,C "$"}, {S,C "4"}, /* 6*/ KBD_ASCII, I, {S,C "5"}, {S,C "%"}, {S,C "5"}, /* 7*/ KBD_ASCII, I, {S,C "6"}, {S,C "^"}, {S,C "\036"}, @@ -423,9 +423,9 @@ static Keycap_def key2ascii[] = /* 56*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""}, /* 57*/ KBD_SHIFT, I, {S,C ""}, {S,C ""}, {S,C ""}, /* SHIFT right */ /* 58*/ KBD_CTL, I, {S,C ""}, {S,C ""}, {S,C ""}, /* CTL left */ -/* 59*/ KBD_ASCII, I, {S,C ""}, {S,C ""}, {S,C ""}, +/* 59*/ KBD_ASCII, I, {S,C ""}, {S,C ""}, {S,C ""}, /* 60*/ KBD_META, I, {S,C ""}, {S,C ""}, {S,C ""}, /* ALT left */ -#if !PCVT_NULLCHARS +#if !PCVT_NULLCHARS /* 61*/ KBD_ASCII, I, {S,C " "}, {S,C " "}, {S,C " "}, /* SPACE */ #else /* 61*/ KBD_ASCII, I, {S,C " "}, {S,C " "}, {S,C "\000"}, /* SPACE */ @@ -477,7 +477,7 @@ static Keycap_def key2ascii[] = /*106*/ KBD_KP, I, {S,C "+"}, {S,C "+"}, {S,C "+"}, /*107*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""}, /*108*/ KBD_RETURN,I, {S,C "\r"}, {S,C "\033OM"},{S,C "\r"}, /* KP ENTER */ -/*109*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""}, +/*109*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""}, /*110*/ KBD_ASCII, I, {S,C "\033"}, {S,C "\033"}, {S,C "\033"}, /*111*/ KBD_NONE, I, {S,C ""}, {S,C ""}, {S,C ""}, /*112*/ KBD_FUNC, I, {F,V fkey1}, {F,V sfkey1}, {F,V cfkey1}, /* F1 */ diff --git a/sys/i386/isa/pcvt/pcvt_out.c b/sys/i386/isa/pcvt/pcvt_out.c index d11fd0f..cce878b 100644 --- a/sys/i386/isa/pcvt/pcvt_out.c +++ b/sys/i386/isa/pcvt/pcvt_out.c @@ -86,50 +86,50 @@ u_short attrib, ch; if ((ch >= 0x20) && (ch <= 0x7f)) /* use GL if ch >= 0x20 */ { if(!svsp->ss) /* single shift G2/G3 -> GL ? */ - { - *video = attrib | svsp->GL[ch-0x20]; - } - else - { - *video = attrib | svsp->Gs[ch-0x20]; - svsp->ss = 0; - } - } - else - { - svsp->ss = 0; - + { + *video = attrib | svsp->GL[ch-0x20]; + } + else + { + *video = attrib | svsp->Gs[ch-0x20]; + svsp->ss = 0; + } + } + else + { + svsp->ss = 0; + if(ch >= 0x80) /* display controls C1 */ - { + { if(ch >= 0xA0) /* use GR if ch >= 0xA0 */ - { - *video = attrib | svsp->GR[ch-0xA0]; - } - else - { + { + *video = attrib | svsp->GR[ch-0xA0]; + } + else + { if(vgacs[svsp->vga_charset].secondloaded) - { + { *video = attrib | ((ch-0x60) | CSH); - } - else /* use normal ibm charset for + } + else /* use normal ibm charset for control display */ - { - *video = attrib | ch; - } - } - } + { + *video = attrib | ch; + } + } + } else /* display controls C0 */ - { - if(vgacs[svsp->vga_charset].secondloaded) - { - *video = attrib | (ch | CSH); - } + { + if(vgacs[svsp->vga_charset].secondloaded) + { + *video = attrib | (ch | CSH); + } else /* use normal ibm charset for control display*/ - { - *video = attrib | ch; - } - } - } + { + *video = attrib | ch; + } + } + } } /*---------------------------------------------------------------------------* @@ -144,7 +144,7 @@ sput (u_char *s, U_char kernel, int len, int page) if(page >= PCVT_NSCREENS) /* failsafe */ page = 0; - + svsp = &vs[page]; /* pointer to current screen state */ if(do_initialization) /* first time called ? */ @@ -173,7 +173,7 @@ sput (u_char *s, U_char kernel, int len, int page) if((ch <= 0x1f) && (svsp->transparent == 0)) { - + /* always process control-chars in the range 0x00..0x1f !!! */ if(svsp->dis_fnc) @@ -191,7 +191,7 @@ sput (u_char *s, U_char kernel, int len, int page) bcopy((svsp->Crtat + svsp->cur_offset), (svsp->Crtat + svsp->cur_offset) + 1, (((svsp->maxcol)-1) - svsp->col)*CHR); - + write_char(svsp, attrib, ch); vt_selattr(svsp); @@ -216,10 +216,10 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->col++; svsp->lastchar = 0; } - } + } else { - switch(ch) + switch(ch) { case 0x00: /* NUL */ case 0x01: /* SOH */ @@ -229,12 +229,12 @@ sput (u_char *s, U_char kernel, int len, int page) case 0x05: /* ENQ */ case 0x06: /* ACK */ break; - + case 0x07: /* BEL */ if(svsp->bell_on) sysbeep(PCVT_SYSBEEPF/1500, hz/4); break; - + case 0x08: /* BS */ if(svsp->col > 0) { @@ -242,7 +242,7 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->col--; } break; - + case 0x09: /* TAB */ while(svsp->col < ((svsp->maxcol)-1)) { @@ -252,7 +252,7 @@ sput (u_char *s, U_char kernel, int len, int page) break; } break; - + case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ @@ -270,20 +270,20 @@ sput (u_char *s, U_char kernel, int len, int page) } check_scroll(svsp); break; - + case 0x0d: /* CR */ svsp->cur_offset -= svsp->col; svsp->col = 0; break; - + case 0x0e: /* SO */ svsp->GL = svsp->G1; break; - + case 0x0f: /* SI */ svsp->GL = svsp->G0; break; - + case 0x10: /* DLE */ case 0x11: /* DC1/XON */ case 0x12: /* DC2 */ @@ -291,27 +291,27 @@ sput (u_char *s, U_char kernel, int len, int page) case 0x14: /* DC4 */ case 0x15: /* NAK */ case 0x16: /* SYN */ - case 0x17: /* ETB */ + case 0x17: /* ETB */ break; - + case 0x18: /* CAN */ svsp->state = STATE_INIT; clr_parms(svsp); break; - + case 0x19: /* EM */ break; - + case 0x1a: /* SUB */ svsp->state = STATE_INIT; clr_parms(svsp); break; - + case 0x1b: /* ESC */ svsp->state = STATE_ESC; clr_parms(svsp); break; - + case 0x1c: /* FS */ case 0x1d: /* GS */ case 0x1e: /* RS */ @@ -322,9 +322,9 @@ sput (u_char *s, U_char kernel, int len, int page) } else { - + /* char range 0x20...0xff processing depends on current state */ - + switch(svsp->state) { case STATE_INIT: @@ -340,11 +340,11 @@ sput (u_char *s, U_char kernel, int len, int page) if(svsp->irm) bcopy ((svsp->Crtat + svsp->cur_offset), - (svsp->Crtat + (svsp->Crtat + svsp->cur_offset) + 1, (((svsp->maxcol)-1) - svsp->col) * CHR); - + write_char(svsp, attrib, ch); vt_selattr(svsp); @@ -368,11 +368,11 @@ sput (u_char *s, U_char kernel, int len, int page) case ' ': /* ESC sp family */ svsp->state = STATE_BLANK; break; - + case '#': /* ESC # family */ svsp->state = STATE_HASH; break; - + case '&': /* ESC & family (HP) */ if(svsp->vt_pure_mode == M_HPVT) @@ -386,87 +386,87 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->state = STATE_INIT; break; - + case '(': /* ESC ( family */ svsp->state = STATE_BROPN; break; - + case ')': /* ESC ) family */ svsp->state = STATE_BRCLO; break; - + case '*': /* ESC * family */ svsp->state = STATE_STAR; break; - + case '+': /* ESC + family */ svsp->state = STATE_PLUS; break; - + case '-': /* ESC - family */ svsp->state = STATE_MINUS; break; - + case '.': /* ESC . family */ svsp->state = STATE_DOT; break; - + case '/': /* ESC / family */ svsp->state = STATE_SLASH; break; - + case '7': /* SAVE CURSOR */ vt_sc(svsp); svsp->state = STATE_INIT; break; - + case '8': /* RESTORE CURSOR */ vt_rc(svsp); if (!kernel) attrib = svsp->c_attr; svsp->state = STATE_INIT; break; - + case '=': /* keypad application mode */ #if !PCVT_INHIBIT_NUMLOCK vt_keyappl(svsp); #endif svsp->state = STATE_INIT; break; - + case '>': /* keypad numeric mode */ #if !PCVT_INHIBIT_NUMLOCK vt_keynum(svsp); #endif svsp->state = STATE_INIT; break; - + case 'D': /* INDEX */ vt_ind(svsp); svsp->state = STATE_INIT; break; - + case 'E': /* NEXT LINE */ vt_nel(svsp); svsp->state = STATE_INIT; break; - + case 'H': /* set TAB at current col */ svsp->tab_stops[svsp->col] = 1; svsp->state = STATE_INIT; break; - + case 'M': /* REVERSE INDEX */ vt_ri(svsp); svsp->state = STATE_INIT; break; - + case 'N': /* SINGLE SHIFT G2 */ svsp->Gs = svsp->G2; svsp->ss = 1; svsp->state = STATE_INIT; break; - + case 'O': /* SINGLE SHIFT G3 */ svsp->Gs = svsp->G3; svsp->ss = 1; @@ -482,23 +482,23 @@ sput (u_char *s, U_char kernel, int len, int page) vt_da(svsp); svsp->state = STATE_INIT; break; - + case '[': /* CSI detected */ clr_parms(svsp); svsp->state = STATE_CSI; break; - + case '\\': /* String Terminator */ svsp->state = STATE_INIT; break; - + case 'c': /* hard reset */ vt_ris(svsp); if (!kernel) attrib = svsp->c_attr; svsp->state = STATE_INIT; break; - + #if PCVT_SETCOLOR case 'd': /* set color sgr */ if(color) @@ -520,33 +520,33 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->GL = svsp->G2; svsp->state = STATE_INIT; break; - + case 'o': /* Lock Shift G3 -> GL */ svsp->GL = svsp->G3; svsp->state = STATE_INIT; break; - + case '}': /* Lock Shift G2 -> GR */ svsp->GR = svsp->G2; svsp->state = STATE_INIT; break; - + case '|': /* Lock Shift G3 -> GR */ svsp->GR = svsp->G3; svsp->state = STATE_INIT; break; - + case '~': /* Lock Shift G1 -> GR */ svsp->GR = svsp->G1; svsp->state = STATE_INIT; break; - + default: svsp->state = STATE_INIT; break; } break; - + case STATE_BLANK: /* ESC space [FG], which are */ svsp->state = STATE_INIT; /* currently ignored*/ break; @@ -560,18 +560,18 @@ sput (u_char *s, U_char kernel, int len, int page) case '6': /*double width sngle height*/ svsp->state = STATE_INIT; break; - + case '8': /* fill sceen with 'E's */ vt_aln(svsp); svsp->state = STATE_INIT; break; - + default: /* anything else */ svsp->state = STATE_INIT; break; } break; - + case STATE_BROPN: /* designate G0 */ case STATE_BRCLO: /* designate G1 */ case STATE_STAR: /* designate G2 */ @@ -609,18 +609,18 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->parms[svsp->parmi] += (ch -'0'); break; - + case ';': /* next parameter */ - svsp->parmi = + svsp->parmi = (svsp->parmi+1 < MAXPARMS) ? svsp->parmi+1 : svsp->parmi; break; - + case 'h': /* set mode */ vt_set_dec_priv_qm(svsp); svsp->state = STATE_INIT; break; - + case 'l': /* reset mode */ vt_reset_dec_priv_qm(svsp); svsp->state = STATE_INIT; @@ -647,7 +647,7 @@ sput (u_char *s, U_char kernel, int len, int page) } break; - + case STATE_CSI: switch(ch) { @@ -665,156 +665,156 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->parms[svsp->parmi] += (ch -'0'); break; - + case ';': /* next parameter */ - svsp->parmi = + svsp->parmi = (svsp->parmi+1 < MAXPARMS) ? svsp->parmi+1 : svsp->parmi; break; - + case '?': /* ESC [ ? family */ svsp->state = STATE_CSIQM; break; - + case '@': /* insert char */ vt_ic(svsp); svsp->state = STATE_INIT; break; - + case '"': /* select char attribute */ svsp->state = STATE_SCA; break; - + case '\'': /* for DECELR/DECSLE */ /* XXX */ /* another state needed -hm */ break; - + case '!': /* soft terminal reset */ svsp->state = STATE_STR; break; - + case 'A': /* cursor up */ vt_cuu(svsp); svsp->state = STATE_INIT; break; - + case 'B': /* cursor down */ vt_cud(svsp); svsp->state = STATE_INIT; break; - + case 'C': /* cursor forward */ vt_cuf(svsp); svsp->state = STATE_INIT; break; - + case 'D': /* cursor backward */ vt_cub(svsp); svsp->state = STATE_INIT; break; - + case 'H': /* direct cursor addressing*/ vt_curadr(svsp); svsp->state = STATE_INIT; break; - + case 'J': /* erase screen */ vt_clreos(svsp); svsp->state = STATE_INIT; break; - + case 'K': /* erase line */ vt_clreol(svsp); svsp->state = STATE_INIT; break; - + case 'L': /* insert line */ vt_il(svsp); svsp->state = STATE_INIT; break; - + case 'M': /* delete line */ vt_dl(svsp); svsp->state = STATE_INIT; break; - + case 'P': /* delete character */ vt_dch(svsp); svsp->state = STATE_INIT; break; - + case 'S': /* scroll up */ vt_su(svsp); svsp->state = STATE_INIT; break; - + case 'T': /* scroll down */ vt_sd(svsp); svsp->state = STATE_INIT; break; - + case 'X': /* erase character */ vt_ech(svsp); svsp->state = STATE_INIT; break; case 'c': /* device attributes */ - vt_da(svsp); + vt_da(svsp); svsp->state = STATE_INIT; break; - + case 'f': /* direct cursor addressing*/ vt_curadr(svsp); svsp->state = STATE_INIT; break; - + case 'g': /* clear tabs */ vt_clrtab(svsp); svsp->state = STATE_INIT; break; - + case 'h': /* set mode(s) */ vt_set_ansi(svsp); svsp->state = STATE_INIT; break; - + case 'i': /* media copy */ vt_mc(svsp); svsp->state = STATE_INIT; break; - + case 'l': /* reset mode(s) */ vt_reset_ansi(svsp); svsp->state = STATE_INIT; break; - + case 'm': /* select graphic rendition*/ vt_sgr(svsp); if (!kernel) attrib = svsp->c_attr; svsp->state = STATE_INIT; break; - + case 'n': /* reports */ vt_dsr(svsp); svsp->state = STATE_INIT; break; - + case 'r': /* set scrolling region */ vt_stbm(svsp); svsp->state = STATE_INIT; break; - + case 'x': /*request/report parameters*/ vt_reqtparm(svsp); svsp->state = STATE_INIT; break; - + case 'y': /* invoke selftest(s) */ vt_tst(svsp); svsp->state = STATE_INIT; break; - + case 'z': /* DECELR, ignored */ case '{': /* DECSLE, ignored */ svsp->state = STATE_INIT; @@ -841,7 +841,7 @@ sput (u_char *s, U_char kernel, int len, int page) vt_sca(svsp); svsp->state = STATE_INIT; break; - + default: svsp->state = STATE_INIT; break; @@ -874,11 +874,11 @@ sput (u_char *s, U_char kernel, int len, int page) svsp->row = svsp->cur_offset / svsp->maxcol; /* current row update */ /* take care of last character on line behaviour */ - + if(svsp->lastchar && (svsp->col < ((svsp->maxcol)-1))) svsp->lastchar = 0; } - + if(svsp == vsp) /* on current displayed page ? */ cursor_pos_valid = 1; /* position is valid now */ } @@ -891,7 +891,7 @@ vt_coldinit(void) { extern u_short csd_ascii[]; /* pcvt_tbl.h */ extern u_short csd_supplemental[]; - + u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/CHR; u_short was; int nscr, charset; @@ -902,19 +902,19 @@ vt_coldinit(void) do_initialization = 0; /* reset init necessary flag */ /* get the equipment byte from the RTC chip */ - + equipment = ((rtcin(RTC_EQUIPMENT)) >> 4) & 0x03; - + switch(equipment) { case EQ_EGAVGA: /* set memory start to CGA == B8000 */ - + Crtat = Crtat + (CGA_BUF-MONO_BUF)/CHR; - + /* find out, what monitor is connected */ - + was = *cp; *cp = (u_short) 0xA55A; if (*cp != 0xA55A) @@ -952,9 +952,9 @@ vt_coldinit(void) { mda2egaorvga(); Crtat = SaveCrtat; /* mono start */ - } + } } - + /* decouple ega/vga charsets and intensity */ set_2ndcharset(); @@ -972,13 +972,13 @@ vt_coldinit(void) case EQ_80MONO: addr_6845 = MONO_BASE; adaptor_type = MDA_ADAPTOR; - color = 0; - totalfonts = 0; + color = 0; + totalfonts = 0; break; } /* establish default colors */ - + if(color) { kern_attr = (COLOR_KERNEL_FG | COLOR_KERNEL_BG) << 8; @@ -990,11 +990,11 @@ vt_coldinit(void) if(adaptor_type == MDA_ADAPTOR) user_attr = sgr_tab_imono[0] << 8; else - user_attr = sgr_tab_mono[0] << 8; + user_attr = sgr_tab_mono[0] << 8; } totalscreens = 1; /* for now until malloced */ - + for(nscr = 0, svsp = vs; nscr < PCVT_NSCREENS; nscr++, svsp++) { svsp->Crtat = Crtat; /* all same until malloc'ed */ @@ -1179,13 +1179,13 @@ vt_coldinit(void) * values. This avoid problems with * LCD displays that apparently happen * to use font matrices up to 19 - * scan lines and 475 scan lines + * scan lines and 475 scan lines * total in order to make use of the * whole screen area */ outb(addr_6845, CRTC_VDE); - vgacs[charset].scr_scanlines = + vgacs[charset].scr_scanlines = inb(addr_6845 + 1); outb(addr_6845, CRTC_MAXROW); vgacs[charset].char_scanlines = @@ -1213,19 +1213,19 @@ vt_coldinit(void) vgacs[0].loaded = 1; /* The BIOS loaded this at boot */ /* set cursor for first screen */ - + outb(addr_6845,CRTC_CURSTART); /* cursor start reg */ - outb(addr_6845+1,vs[0].cursor_start); + outb(addr_6845+1,vs[0].cursor_start); outb(addr_6845,CRTC_CUREND); /* cursor end reg */ outb(addr_6845+1,vs[0].cursor_end); /* this is to satisfy ddb */ - + if(!keyboard_is_initialized) kbd_code_init1(); /* update keyboard led's */ - + update_led(); } @@ -1267,7 +1267,7 @@ vt_coldmalloc(void) screen_max_size = MAXROW_VGA * MAXCOL_VGA * CHR; } - + for(nscr = 0; nscr < PCVT_NSCREENS; nscr++) { if((vs[nscr].Memory = @@ -1299,32 +1299,32 @@ check_scroll(struct video_state *svsp) if(!svsp->abs_write) { /* we write within scroll region */ - - if(svsp->cur_offset >= ((svsp->scrr_end + 1) * svsp->maxcol)) + + if(svsp->cur_offset >= ((svsp->scrr_end + 1) * svsp->maxcol)) { /* the following piece of code has to be protected */ /* from trying to switch to another virtual screen */ /* while being in there ... */ - + critical_scroll = 1; /* flag protect ON */ - + roll_up(svsp, 1); /* rolling up .. */ - + svsp->cur_offset -= svsp->maxcol;/* update position */ - + if(switch_page != -1) /* someone wanted to switch ? */ { vgapage(switch_page); /* yes, then switch ! */ switch_page = -1; /* reset switch flag */ } - + critical_scroll = 0; /* flag protect OFF */ } } else { /* clip, if outside of screen */ - + if (svsp->cur_offset >= svsp->screen_rows * svsp->maxcol) svsp->cur_offset -= svsp->maxcol; } @@ -1338,7 +1338,7 @@ writefkl(int num, u_char *string, struct video_state *svsp) { if((num < 0) || (num > 7)) /* range ok ? */ return; - + strncpy(svsp->ufkl[num], string, 16); /* save string in static array */ if(svsp->which_fkl == USR_FKL) @@ -1353,7 +1353,7 @@ swritefkl(int num, u_char *string, struct video_state *svsp) { if((num < 0) || (num > 7)) /* range ok ? */ return; - + strncpy(svsp->sfkl[num], string, 16); /* save string in static array */ if(svsp->which_fkl == SYS_FKL) @@ -1367,9 +1367,9 @@ static void wrfkl(int num, u_char *string, struct video_state *svsp) { register u_short *p; - register u_short *p1; + register u_short *p1; register int cnt = 0; - + if(!svsp->labels_on || (svsp->vt_pure_mode == M_PUREVT)) return; @@ -1390,9 +1390,9 @@ wrfkl(int num, u_char *string, struct video_state *svsp) else /* labels 5 .. 8 */ p += ((num * (LABEL_LEN + 6)) + LABEL_MID + 11); - } + } p1 = p + svsp->maxcol; /* second label line */ - + while((*string != '\0') && (cnt < 8)) { *p = ((0x70 << 8) + (*string & 0xff)); @@ -1430,15 +1430,15 @@ fkl_off(struct video_state *svsp) { register u_short *p; register int num; - register int size; - + register int size; + svsp->labels_on = 0; if((vgacs[svsp->vga_charset].screen_size==SIZ_28ROWS) && svsp->force24) size = 4; else size = 3; - + p = (svsp->Crtat + (svsp->screen_rows * svsp->maxcol)); for(num = 0; num < (size * svsp->maxcol); num++) @@ -1467,7 +1467,7 @@ set_emulation_mode(struct video_state *svsp, int mode) { if(svsp->vt_pure_mode == mode) return; - + clr_parms(svsp); /* escape parameter init */ svsp->state = STATE_INIT; /* initial state */ svsp->scrr_beg = 0; /* start of scrolling region */ @@ -1518,12 +1518,12 @@ set_emulation_mode(struct video_state *svsp, int mode) svsp->scrr_len = svsp->screen_rows; svsp->scrr_end = svsp->scrr_len - 1; - } + } #if PCVT_SIGWINCH if (svsp->vs_tty && svsp->vs_tty->t_pgrp) pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1); -#endif /* PCVT_SIGWINCH */ +#endif /* PCVT_SIGWINCH */ } @@ -1554,7 +1554,7 @@ init_sfkl(struct video_state *svsp) /* 1234567812345678 */ swritefkl(0,(u_char *)"132 COLUMNS ",svsp); else - swritefkl(0,(u_char *)" ",svsp); + swritefkl(0,(u_char *)" ",svsp); /* 1234567812345678 */ swritefkl(1,(u_char *)"SOFT-RSTTERMINAL",svsp); @@ -1562,7 +1562,7 @@ init_sfkl(struct video_state *svsp) if(svsp->force24) swritefkl(2,(u_char *)"FORCE24 ENABLE *",svsp); else - swritefkl(2,(u_char *)"FORCE24 ENABLE ",svsp); + swritefkl(2,(u_char *)"FORCE24 ENABLE ",svsp); #if PCVT_SHOWKEYS /* 1234567812345678 */ if(svsp == &vs[0]) @@ -1577,7 +1577,7 @@ init_sfkl(struct video_state *svsp) if(svsp->bell_on) swritefkl(4,(u_char *)"BELL ENABLE *",svsp); else - swritefkl(4,(u_char *)"BELL ENABLE ",svsp); + swritefkl(4,(u_char *)"BELL ENABLE ",svsp); if(svsp->sevenbit) swritefkl(5,(u_char *)"8-BIT ENABLE ",svsp); @@ -1585,11 +1585,11 @@ init_sfkl(struct video_state *svsp) swritefkl(5,(u_char *)"8-BIT ENABLE *",svsp); swritefkl(6,(u_char *)"DISPLAY FUNCTNS ",svsp); - + swritefkl(7,(u_char *)"AUTOWRAPENABLE *",svsp); - /* 1234567812345678 */ + /* 1234567812345678 */ } - + /*---------------------------------------------------------------------------* * switch display to user function key labels *---------------------------------------------------------------------------*/ @@ -1625,11 +1625,11 @@ toggl_24l(struct video_state *svsp) if(svsp->force24) { svsp->force24 = 0; - swritefkl(2,(u_char *)"FORCE24 ENABLE ",svsp); + swritefkl(2,(u_char *)"FORCE24 ENABLE ",svsp); } else { - svsp->force24 = 1; + svsp->force24 = 1; swritefkl(2,(u_char *)"FORCE24 ENABLE *",svsp); } set_screen_size(svsp, vgacs[(svsp->vga_charset)].screen_size); @@ -1772,7 +1772,7 @@ vt_col(struct video_state *svsp, int cols) { if(vga_col(svsp, cols) == 0) return(0); - + if(cols == SCR_COL80) swritefkl(0,(u_char *)"132 COLUMNS ",svsp); else @@ -1781,7 +1781,7 @@ vt_col(struct video_state *svsp, int cols) fillw(user_attr | ' ', svsp->Crtat, svsp->maxcol * svsp->screen_rowsize); - + clr_parms(svsp); /* escape parameter init */ svsp->state = STATE_INIT; /* initial state */ svsp->col = 0; /* init row */ @@ -1815,7 +1815,7 @@ vt_col(struct video_state *svsp, int cols) } return(1); -} +} /*---------------------------------------------------------------------------* * update HP stuff on screen @@ -1917,7 +1917,7 @@ hp_entry(U_char ch, struct video_state *svsp) break; } break; - + case SHP_AND_F: if((ch >= '0') && (ch <= '8')) { @@ -1959,7 +1959,7 @@ hp_entry(U_char ch, struct video_state *svsp) } break; - case SHP_AND_Fak1: + case SHP_AND_Fak1: if(ch == 'k') svsp->hp_state = SHP_AND_Fakd; else @@ -1968,7 +1968,7 @@ hp_entry(U_char ch, struct video_state *svsp) svsp->state = STATE_INIT; } break; - + case SHP_AND_Fakd: if(svsp->l_len > 16) { @@ -2033,7 +2033,7 @@ hp_entry(U_char ch, struct video_state *svsp) else svsp->i++; break; - + case SHP_AND_FakdLls: svsp->s_buf[svsp->i] = ch; if(svsp->i >= svsp->s_len-1) @@ -2108,7 +2108,7 @@ hp_entry(U_char ch, struct video_state *svsp) svsp->m_len *= 10; svsp->m_len += (ch -'0'); break; - + case 'L': svsp->hp_state = SHP_AND_JL; svsp->i = 0; @@ -2136,7 +2136,7 @@ hp_entry(U_char ch, struct video_state *svsp) /* display status line */ /* needs to be implemented */ /* see 2392 man, 3-14 */ - + } else svsp->i++; @@ -2150,7 +2150,7 @@ hp_entry(U_char ch, struct video_state *svsp) svsp->transparent = 0; } break; - + default: svsp->hp_state = SHP_INIT; svsp->state = STATE_INIT; diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c index 6f64570..d3e94be 100644 --- a/sys/i386/isa/pcvt/pcvt_sup.c +++ b/sys/i386/isa/pcvt/pcvt_sup.c @@ -214,11 +214,11 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag) case VGAPCVTID: vgapcvtid((struct pcvtid *)data); break; - + case VGAPCVTINFO: vgapcvtinfo((struct pcvtinfo *)data); break; - + case VGASETCOLMS: if(is_dev_grafx) return EAGAIN; @@ -280,7 +280,7 @@ vgapcvtinfo(struct pcvtinfo *data) data->updateslow= PCVT_UPDATESLOW; data->sysbeepf = PCVT_SYSBEEPF; -#if PCVT_NETBSD || PCVT_FREEBSD >= 200 +#if PCVT_NETBSD || PCVT_FREEBSD >= 200 data->pcburst = PCVT_PCBURST; #else data->pcburst = 1; @@ -291,7 +291,7 @@ vgapcvtinfo(struct pcvtinfo *data) #else data->kbd_fifo_sz = 0; #endif - + data->compile_opts = (0 #if PCVT_VT220KEYB @@ -399,7 +399,7 @@ vid_cursor(struct cursorshape *data) if(adaptor_type == VGA_ADAPTOR || adaptor_type == EGA_ADAPTOR) { - character_set = vs[screen].vga_charset; + character_set = vs[screen].vga_charset; character_set = (character_set < 0) ? 0 : ((character_set < totalfonts) ? character_set : @@ -421,7 +421,7 @@ vid_cursor(struct cursorshape *data) if((vga_family == VGA_F_TRI) && (start == 0)) start = 1; - + end = (data->end < 0) ? 0 : ((data->end > line_height) ? line_height : data->end); @@ -431,7 +431,7 @@ vid_cursor(struct cursorshape *data) if(screen == current_video_screen) { outb(addr_6845,CRTC_CURSTART); /* cursor start reg */ - outb(addr_6845+1, start); + outb(addr_6845+1, start); outb(addr_6845,CRTC_CUREND); /* cursor end reg */ outb(addr_6845+1, end); } @@ -448,14 +448,14 @@ vgasetfontattr(struct vgafontattr *data) int lines_per_character; int totscanlines; int size; - + vga_character_set = data->character_set; vga_character_set = (vga_character_set < 0) ? 0 : ((vga_character_set < totalfonts) ? vga_character_set : totalfonts-1); vgacs[vga_character_set].loaded = data->font_loaded; - + /* Limit Characters to 32 scanlines doubled */ vgacs[vga_character_set].char_scanlines = (data->character_scanlines & 0x1F) @@ -463,12 +463,12 @@ vgasetfontattr(struct vgafontattr *data) if(adaptor_type == EGA_ADAPTOR) /* ...and screen height to scan 350 lines */ - vgacs[vga_character_set].scr_scanlines = + vgacs[vga_character_set].scr_scanlines = (data->screen_scanlines > 0x5d) ? 0x5d : data->screen_scanlines; else /* ...and screen height to scan 480 lines */ - vgacs[vga_character_set].scr_scanlines = + vgacs[vga_character_set].scr_scanlines = (data->screen_scanlines > 0xdF) ? 0xdF : data->screen_scanlines; @@ -517,7 +517,7 @@ vgasetfontattr(struct vgafontattr *data) else size = SIZ_25ROWS; break; - + case SIZ_40ROWS: if(totscanlines/lines_per_character >= 40) size = SIZ_40ROWS; @@ -540,9 +540,9 @@ vgasetfontattr(struct vgafontattr *data) break; } } - + vgacs[vga_character_set].screen_size = size; - + for (i = 0;i < PCVT_NSCREENS;i++) { if(vga_character_set == vs[i].vga_charset) @@ -564,7 +564,7 @@ static void vgagetfontattr(struct vgafontattr *data) { int vga_character_set; - + vga_character_set = data->character_set; vga_character_set = (vga_character_set < 0) ? 0 : ((vga_character_set < (int)totalfonts) ? @@ -593,7 +593,7 @@ vgaloadchar(struct vgaloadchar *data) int vga_character_set; int character; int lines_per_character; - + vga_character_set = data->character_set; vga_character_set = (vga_character_set < 0) ? 0 : ((vga_character_set < (int)totalfonts) ? @@ -630,7 +630,7 @@ vid_getscreen(struct screeninfo *data, Dev_t dev) data->vga_family = vga_family; /* manufacturer, family */ data->vga_type = vga_type; /* detected chipset type */ data->vga_132 = can_do_132col; /* 132 column support */ - data->force_24lines = vs[device].force24; /* force 24 lines */ + data->force_24lines = vs[device].force24; /* force 24 lines */ } /*---------------------------------------------------------------------------* @@ -640,7 +640,7 @@ static void vid_setscreen(struct screeninfo *data, Dev_t dev) { int screen; - + if(data->current_screen == -1) { screen = minor(dev); @@ -673,7 +673,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev) if(data->screen_size == -1) data->screen_size = vgacs[(vs[screen].vga_charset)].screen_size; - + if(data->force_24lines != -1) { vs[screen].force24 = data->force_24lines; @@ -689,7 +689,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev) &vs[screen]); } } - + if((data->screen_size == SIZ_25ROWS) || (data->screen_size == SIZ_28ROWS) || (data->screen_size == SIZ_35ROWS) || @@ -697,7 +697,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev) (data->screen_size == SIZ_43ROWS) || (data->screen_size == SIZ_50ROWS)) { - if(data->screen_no == -1) + if(data->screen_no == -1) set_screen_size(vsp, data->screen_size); else set_screen_size(&vs[minor(dev)], @@ -710,7 +710,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev) if((data->pure_vt_mode == M_HPVT) || (data->pure_vt_mode == M_PUREVT)) { - if(data->screen_no == -1) + if(data->screen_no == -1) set_emulation_mode(vsp, data->pure_vt_mode); else set_emulation_mode(&vs[minor(dev)], @@ -718,7 +718,7 @@ vid_setscreen(struct screeninfo *data, Dev_t dev) } } } - + /*---------------------------------------------------------------------------* * set screen size/resolution for a virtual screen *---------------------------------------------------------------------------*/ @@ -760,14 +760,14 @@ set_screen_size(struct video_state *svsp, int size) sw_ufkl(svsp); } - + svsp->scrr_len = svsp->screen_rows; svsp->scrr_end = svsp->scrr_len - 1; #if PCVT_SIGWINCH if (svsp->vs_tty && svsp->vs_tty->t_pgrp) pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1); -#endif /* PCVT_SIGWINCH */ +#endif /* PCVT_SIGWINCH */ break; } @@ -870,7 +870,7 @@ vgapaletteio(unsigned idx, struct rgb *val, int writeit) val->b = inb(VGA_DAC + 3) & VGA_PMSK; } -#if PCVT_PALFLICKER +#if PCVT_PALFLICKER vga_screen_on(); #endif /* PCVT_PALFLICKER */ @@ -914,7 +914,7 @@ async_update(int arg) { goto async_update_exit; /* do not update anything */ } - + #if PCVT_SCREENSAVER if(reset_screen_saver && (counter == PCVT_UPDATESLOW)) { @@ -947,7 +947,7 @@ async_update(int arg) if(--counter) /* below is possible update */ goto async_update_exit; /* just now and then ..... */ counter = PCVT_UPDATESLOW; /* caution, see screensaver above !! */ - + /*-------------------------------------------------------------------*/ /* this takes place ONLY on screen 0 if in HP mode, labels on, !X */ /*-------------------------------------------------------------------*/ @@ -963,7 +963,7 @@ async_update(int arg) extern u_char rawkeybuf[80]; if(keyboard_show) - { + { for(i = 0; i < 80; i++) { *((vs[0].Crtat+((vs[0].screen_rows+2) @@ -980,9 +980,9 @@ async_update(int arg) #ifdef NEW_AVERUNNABLE tmp = (averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT; -#else +#else tmp = (averunnable[0] * 100 + FSCALE / 2) >> FSHIFT; -#endif +#endif buffer[i++] = ((((tmp/100)/10) == 0) ? @@ -996,9 +996,9 @@ async_update(int arg) #ifdef NEW_AVERUNNABLE tmp = (averunnable.ldavg[1] * 100 + FSCALE / 2) >> FSHIFT; -#else +#else tmp = (averunnable[1] * 100 + FSCALE / 2) >> FSHIFT; -#endif +#endif buffer[i++] = ((((tmp/100)/10) == 0) ? ' ' : ((tmp/100)/10) + '0'); @@ -1010,9 +1010,9 @@ async_update(int arg) #ifdef NEW_AVERUNNABLE tmp = (averunnable.ldavg[2] * 100 + FSCALE / 2) >> FSHIFT; -#else +#else tmp = (averunnable[2] * 100 + FSCALE / 2) >> FSHIFT; -#endif +#endif buffer[i++] = ((((tmp/100)/10) == 0) ? ' ' : ((tmp/100)/10) + '0'); @@ -1021,7 +1021,7 @@ async_update(int arg) buffer[i++] = ((tmp%100)/10) + '0'; buffer[i++] = ((tmp%100)%10) + '0'; buffer[i] = '\0'; - + for(i = 0; buffer[i]; i++) { *((vs[0].Crtat + @@ -1029,7 +1029,7 @@ async_update(int arg) ) + i ) = user_attr | buffer[i]; } - + #if PCVT_SHOWKEYS for(; i < 77; i++) { @@ -1038,7 +1038,7 @@ async_update(int arg) ) + i ) = user_attr | ' '; } - + } #endif /* PCVT_SHOWKEYS */ } @@ -1058,7 +1058,7 @@ async_update(int arg) if(vsp->maxcol == SCR_COL132) { p += (SCR_COL132 - SCR_COL80)/2; - + if(col >= 100) { *(p + LABEL_COLU) = user_attr | '1'; @@ -1068,12 +1068,12 @@ async_update(int arg) { *(p + LABEL_COLU) = user_attr | '0'; } - } + } *(p + LABEL_COLH) = user_attr | ((col/10) + '0'); *(p + LABEL_COLL) = user_attr | ((col%10) + '0'); /* update row display between labels */ - + *(p + LABEL_ROWH) = (user_attr | (((vsp->row+1)/10) + '0')); *(p + LABEL_ROWL) = (user_attr | (((vsp->row+1)%10) + '0')); } @@ -1085,7 +1085,7 @@ async_update_exit: timeout((TIMEOUT_FUNC_T)async_update, UPDATE_START, PCVT_UPDATEFAST); } } - + /*---------------------------------------------------------------------------* * set character set for virtual screen *---------------------------------------------------------------------------*/ @@ -1112,7 +1112,7 @@ set_charset(struct video_state *svsp, int curvgacs) newrows = 24; if (newrows < oldrows) { int nscroll = svsp->row + 1 - newrows; - + if (svsp->row >= oldrows) /* Sanity check */ nscroll = oldrows - newrows; if (nscroll > 0) { @@ -1140,7 +1140,7 @@ set_charset(struct video_state *svsp, int curvgacs) svsp->scrr_end = svsp->screen_rows - 1; svsp->scrr_len = svsp->scrr_end - svsp->scrr_beg + 1; - /* Clip cursor pos */ + /* Clip cursor pos */ if(svsp->cur_offset > (svsp->scrr_len * svsp->maxcol)) svsp->cur_offset = (svsp->scrr_len * svsp->maxcol) + svsp->col; @@ -1178,7 +1178,7 @@ select_vga_charset(int vga_charset) used for the upper 256 entries of a complete 512 entry ega/ vga charset. --------------------------------------------------------------*/ - + for(first = 0; first < totalfonts; first++) { if(!vgacs[first].loaded) @@ -1220,7 +1220,7 @@ select_vga_charset(int vga_charset) cmap |= cmaptabb[second]; vgacs[first].secondloaded = second; } - else + else { vgacs[first].secondloaded = 0; /*cs 0 can never become a 2nd!*/ } @@ -1230,7 +1230,7 @@ select_vga_charset(int vga_charset) cmap = (vga_charset & 0x07); cmap |= 0x10; } - + outb(TS_INDEX, TS_FONTSEL); /* character map select register */ outb(TS_DATA, cmap); /* new char map */ @@ -1349,7 +1349,7 @@ resetchargen(void) if(color) outb(GDC_DATA, 0x0e); /* map starts at 0xb800 */ else - outb(GDC_DATA, 0x0a); /* map starts at 0xb000 */ + outb(GDC_DATA, 0x0a); /* map starts at 0xb000 */ chargen_access = 0; /* flag we are NOT accessing the chargen ram */ } @@ -1385,12 +1385,12 @@ vga_screen_off(void) { unsigned char old; - outb(TS_INDEX, TS_SYNCRESET); + outb(TS_INDEX, TS_SYNCRESET); outb(TS_DATA, 0x01); /* synchronous reset */ outb(TS_INDEX, TS_MODE); /* clocking mode reg */ old = inb(TS_DATA); /* get current value */ - + outb(TS_INDEX, TS_MODE); /* clocking mode reg */ outb(TS_DATA, (old | 0x20)); /* screen off bit on */ @@ -1406,12 +1406,12 @@ vga_screen_on(void) { unsigned char old; - outb(TS_INDEX, TS_SYNCRESET); + outb(TS_INDEX, TS_SYNCRESET); outb(TS_DATA, 0x01); /* synchronous reset */ outb(TS_INDEX, TS_MODE); /* clocking mode reg */ old = inb(TS_DATA); /* get current value */ - + outb(TS_INDEX, TS_MODE); /* clocking mode reg */ outb(TS_DATA, (old & ~0x20)); /* screen off bit off */ @@ -1438,20 +1438,20 @@ compute_charset_base(unsigned fontset) case EGA_ADAPTOR: fontset = (fontset > 3) ? 3 : fontset; break; - + case VGA_ADAPTOR: fontset = (fontset > 7) ? 7 : fontset; break; - + default: return 0; } - + if(color) d -= (0xB8000 - 0xA0000); /* Point to 0xA0000 */ else d -= (0xB0000 - 0xA0000); /* Point to 0xA0000 */ - + if(vsp->wd132col) d += charsetw_offset[fontset]; /* Load into Character set n */ else @@ -1521,7 +1521,7 @@ loadchar(int fontset, int character, int char_scanlines, u_char *char_table) } /*---------------------------------------------------------------------------* - * save/restore character set n to addr b + * save/restore character set n to addr b *---------------------------------------------------------------------------*/ #if !PCVT_BACKUP_FONTS @@ -1616,9 +1616,9 @@ vgapage(int n) #if !PCVT_KBD_FIFO int x; #endif /* !PCVT_KBD_FIFO */ - + int cols = vsp->maxcol; /* get current col val */ - + if(n < 0 || n >= totalscreens) return; @@ -1660,12 +1660,12 @@ vgapage(int n) #if !PCVT_KBD_FIFO splx(x); #endif /* !PCVT_KBD_FIFO */ - + select_vga_charset(vsp->vga_charset); if(vsp->maxcol != cols) vga_col(vsp, vsp->maxcol); /* select 80/132 columns */ - + outb(addr_6845, CRTC_CURSORH); /* select high register */ outb(addr_6845+1, vsp->cur_offset >> 8); outb(addr_6845, CRTC_CURSORL); /* select low register */ @@ -1688,7 +1688,7 @@ vgapage(int n) unsigned i; /* switch VGA DAC palette entries */ - + for(i = 0; i < NVGAPEL; i++) vgapaletteio(i, &vsp->palette[i], 1); } @@ -1707,7 +1707,7 @@ int vga_test(void) { u_char old, new, check; - + outb(addr_6845,CRTC_CURSTART); /* cursor start reg */ old = inb(addr_6845+1); /* get current value */ @@ -1743,7 +1743,7 @@ vga_test(void) outb(addr_6845,CRTC_CURSTART); /* cursor start reg */ outb(addr_6845+1,old); /* failsafe */ - + return(1); /* vga */ } @@ -1756,9 +1756,9 @@ sixel_vga(struct sixels *sixelp, u_char *vgachar) register int i, j; register int shift; register u_char mask; - + for(j = 0; j < 16; j++) - vgachar[j] = 0; + vgachar[j] = 0; mask = 0x01; for(j = 0; j < 6; j++) @@ -1791,7 +1791,7 @@ vga10_vga16(u_char *invga, u_char *outvga) * Keep the top and bottom scanlines the same and double every scan * line in between. */ - + outvga[0] = invga[0]; outvga[1] = invga[1]; outvga[14] = invga[8]; @@ -1816,7 +1816,7 @@ vga10_vga14(u_char *invga, u_char *outvga) * Double the top two and bottom two scanlines and copy everything * in between. */ - + outvga[0] = invga[0]; outvga[1] = invga[0]; outvga[2] = invga[1]; @@ -1894,7 +1894,7 @@ set_2ndcharset(void) inb(GN_INPSTAT1M); /* select color plane enable reg, caution: set ATC access bit ! */ - + outb(ATC_INDEX, (ATC_COLPLEN | ATC_ACCESS)); outb(ATC_DATAW, 0x07); /* disable plane 3 */ } @@ -2046,7 +2046,7 @@ scrnsv_timedout(void *arg) /* second call, now blank the screen */ /* fill screen with blanks */ fillw(/* (BLACK<<8) + */ ' ', vsp->Crtat, scrnsv_size / 2); - + #if PCVT_PRETTYSCRNS scrnsv_current = vsp->Crtat; timeout((TIMEOUT_FUNC_T)scrnsv_blink, NULL, hz); @@ -2112,7 +2112,7 @@ pcvt_scrnsv_reset(void) } splx(x); } - + #endif /* PCVT_SCREENSAVER */ /*---------------------------------------------------------------------------* @@ -2132,15 +2132,15 @@ sw_cursor(int onoff) else { int cs = vs[current_video_screen].vga_charset; - + cs = (cs < 0) ? 0 : ((cs < totalfonts) ? cs : totalfonts-1); - + start = (vgacs[cs].char_scanlines & 0x1F) + 1; end = 0; } outb(addr_6845,CRTC_CURSTART); /* cursor start reg */ - outb(addr_6845+1, start); + outb(addr_6845+1, start); outb(addr_6845,CRTC_CUREND); /* cursor end reg */ outb(addr_6845+1, end); } diff --git a/sys/i386/isa/pcvt/pcvt_tbl.h b/sys/i386/isa/pcvt/pcvt_tbl.h index 193d379..4384afd 100644 --- a/sys/i386/isa/pcvt/pcvt_tbl.h +++ b/sys/i386/isa/pcvt/pcvt_tbl.h @@ -71,7 +71,7 @@ /*===========================================================================* * DEFAULT TABLES FOR MDA/HCG/CGA *===========================================================================*/ - + /*---------------------------------------------------------------------------* * ASCII Characterset *---------------------------------------------------------------------------*/ diff --git a/sys/i386/isa/pcvt/pcvt_vtf.c b/sys/i386/isa/pcvt/pcvt_vtf.c index 4f7317f..6dddd5d 100644 --- a/sys/i386/isa/pcvt/pcvt_vtf.c +++ b/sys/i386/isa/pcvt/pcvt_vtf.c @@ -81,7 +81,7 @@ void vt_stbm(struct video_state *svsp) { /* both 0 => scrolling region = entire screen */ - + if((svsp->parms[0] == 0) && (svsp->parms[1] == 0)) { svsp->cur_offset = 0; @@ -96,14 +96,14 @@ vt_stbm(struct video_state *svsp) return; /* range parm 1 */ - + if(svsp->parms[0] < 1) svsp->parms[0] = 1; else if(svsp->parms[0] > svsp->screen_rows-1) svsp->parms[0] = svsp->screen_rows-1; /* range parm 2 */ - + if(svsp->parms[1] < 2) svsp->parms[1] = 2; else if(svsp->parms[1] > svsp->screen_rows) @@ -115,10 +115,10 @@ vt_stbm(struct video_state *svsp) /* cursor to first pos */ if(svsp->m_om) - svsp->cur_offset = svsp->scrr_beg * svsp->maxcol; + svsp->cur_offset = svsp->scrr_beg * svsp->maxcol; else svsp->cur_offset = 0; - + svsp->col = 0; } @@ -131,7 +131,7 @@ vt_sgr(struct video_state *svsp) register int i = 0; u_short setcolor = 0; char colortouched = 0; - + do { switch(svsp->parms[i++]) @@ -143,15 +143,15 @@ vt_sgr(struct video_state *svsp) case 1: /* bold */ svsp->vtsgr |= VT_BOLD; break; - + case 4: /* underline */ svsp->vtsgr |= VT_UNDER; break; - + case 5: /* blinking */ svsp->vtsgr |= VT_BLINK; break; - + case 7: /* reverse */ svsp->vtsgr |= VT_INVERSE; break; @@ -159,19 +159,19 @@ vt_sgr(struct video_state *svsp) case 22: /* not bold */ svsp->vtsgr &= ~VT_BOLD; break; - + case 24: /* not underlined */ svsp->vtsgr &= ~VT_UNDER; break; - + case 25: /* not blinking */ svsp->vtsgr &= ~VT_BLINK; break; - + case 27: /* not reverse */ svsp->vtsgr &= ~VT_INVERSE; break; - + case 30: /* foreground colors */ case 31: case 32: @@ -186,7 +186,7 @@ vt_sgr(struct video_state *svsp) setcolor |= ((fgansitopc[(svsp->parms[i-1]-30) & 7]) << 8); } break; - + case 40: /* background colors */ case 41: case 42: @@ -246,7 +246,7 @@ void vt_cud(struct video_state *svsp) { register int p = svsp->parms[0]; - + if (p <= 0) p = 1; @@ -254,7 +254,7 @@ vt_cud(struct video_state *svsp) if (p <= 0) return; - + svsp->cur_offset += (svsp->maxcol * p); } @@ -264,19 +264,19 @@ vt_cud(struct video_state *svsp) void vt_cuf(struct video_state *svsp) { - register int p = svsp->parms[0]; + register int p = svsp->parms[0]; if(svsp->col == ((svsp->maxcol)-1)) /* already at right margin */ return; - + if(p <= 0) /* parameter min = 1 */ p = 1; else if(p > ((svsp->maxcol)-1)) /* parameter max = 79 */ p = ((svsp->maxcol)-1); - + if((svsp->col + p) > ((svsp->maxcol)-1))/* not more than right margin */ p = ((svsp->maxcol)-1) - svsp->col; - + svsp->cur_offset += p; svsp->col += p; } @@ -287,11 +287,11 @@ vt_cuf(struct video_state *svsp) void vt_cub(struct video_state *svsp) { - register int p = svsp->parms[0]; + register int p = svsp->parms[0]; if(svsp->col == 0) /* already at left margin ? */ return; - + if(p <= 0) /* parameter min = 1 */ p = 1; else if(p > ((svsp->maxcol)-1)) /* parameter max = 79 */ @@ -325,7 +325,7 @@ vt_clreos(struct video_state *svsp) svsp->Crtat + 1 ); break; - case 2: + case 2: fillw(user_attr | ' ', svsp->Crtat, svsp->maxcol * svsp->screen_rows); break; @@ -368,24 +368,24 @@ vt_curadr(struct video_state *svsp) { if(svsp->m_om) /* relative to scrolling region */ { - if((svsp->parms[0] == 0) && (svsp->parms[1] == 0)) + if((svsp->parms[0] == 0) && (svsp->parms[1] == 0)) { svsp->cur_offset = svsp->scrr_beg * svsp->maxcol; svsp->col = 0; svsp->abs_write = 0; return; } - + if(svsp->parms[0] <= 0) svsp->parms[0] = 1; else if(svsp->parms[0] > svsp->scrr_len) svsp->parms[0] = svsp->scrr_len; - + if(svsp->parms[1] <= 0 ) svsp->parms[1] = 1; if(svsp->parms[1] > svsp->maxcol) svsp->parms[1] = svsp->maxcol; - + svsp->cur_offset = (svsp->scrr_beg * svsp->maxcol) + ((svsp->parms[0] - 1) * svsp->maxcol) + svsp->parms[1] - 1; @@ -394,24 +394,24 @@ vt_curadr(struct video_state *svsp) } else /* relative to screen start */ { - if((svsp->parms[0] == 0) && (svsp->parms[1] == 0)) + if((svsp->parms[0] == 0) && (svsp->parms[1] == 0)) { svsp->cur_offset = 0; svsp->col = 0; svsp->abs_write = 0; return; } - + if(svsp->parms[0] <= 0) svsp->parms[0] = 1; else if(svsp->parms[0] > svsp->screen_rows) svsp->parms[0] = svsp->screen_rows; - + if(svsp->parms[1] <= 0 ) svsp->parms[1] = 1; if(svsp->parms[1] > svsp->maxcol) /* col */ svsp->parms[1] = svsp->maxcol; - + svsp->cur_offset = (((svsp->parms[0]-1)*svsp->maxcol) + (svsp->parms[1]-1)); svsp->col = svsp->parms[1]-1; @@ -434,7 +434,7 @@ vt_ris(struct video_state *svsp) fillw(user_attr | ' ', svsp->Crtat, svsp->maxcol * svsp->screen_rows); svsp->cur_offset = 0; /* cursor upper left corner */ svsp->col = 0; - svsp->row = 0; + svsp->row = 0; svsp->lnm = 0; /* CR only */ clear_dld(svsp); /* clear download charset */ vt_clearudk(svsp); /* clear user defined keys */ @@ -445,16 +445,16 @@ vt_ris(struct video_state *svsp) /*---------------------------------------------------------------------------* * DECSTR - soft terminal reset (SOFT emulator runtime reset) *---------------------------------------------------------------------------*/ -void +void vt_str(struct video_state *svsp) { int i; - + clr_parms(svsp); /* escape parameter init */ svsp->state = STATE_INIT; /* initial state */ svsp->dis_fnc = 0; /* display functions reset */ - + svsp->sc_flag = 0; /* save cursor position */ svsp->transparent = 0; /* enable control code processing */ @@ -477,7 +477,7 @@ vt_str(struct video_state *svsp) #endif svsp->scroll_lock = 0; /* reset keyboard modes */ - svsp->caps_lock = 0; + svsp->caps_lock = 0; svsp->ckm = 1; /* cursor key mode = "normal" ... */ svsp->scrr_beg = 0; /* start of scrolling region */ @@ -511,7 +511,7 @@ vt_str(struct video_state *svsp) vt_initsel(svsp); init_ufkl(svsp); /* init user fkey labels */ - init_sfkl(svsp); /* init system fkey labels */ + init_sfkl(svsp); /* init system fkey labels */ update_led(); /* update keyboard LED's */ } @@ -519,7 +519,7 @@ vt_str(struct video_state *svsp) /*---------------------------------------------------------------------------* * RI - reverse index, move cursor up *---------------------------------------------------------------------------*/ -void +void vt_ri(struct video_state *svsp) { if(svsp->cur_offset >= ((svsp->scrr_beg * svsp->maxcol) + svsp->maxcol)) @@ -545,7 +545,7 @@ vt_ind(struct video_state *svsp) *---------------------------------------------------------------------------*/ void vt_nel(struct video_state *svsp) -{ +{ if(svsp->cur_offset < (svsp->scrr_end * svsp->maxcol)) { svsp->cur_offset += (svsp->maxcol-svsp->col); @@ -574,15 +574,15 @@ vt_set_dec_priv_qm(struct video_state *svsp) case 2: /* ANM - ansi/vt52 mode */ break; - + case 3: /* COLM - column mode */ vt_col(svsp, SCR_COL132); break; - + case 4: /* SCLM - scrolling mode */ case 5: /* SCNM - screen mode */ break; - + case 6: /* OM - origin mode */ svsp->m_om = 1; break; @@ -595,7 +595,7 @@ vt_set_dec_priv_qm(struct video_state *svsp) case 8: /* ARM - auto repeat mode */ kbrepflag = 1; break; - + case 9: /* INLM - interlace mode */ case 10: /* EDM - edit mode */ case 11: /* LTM - line transmit mode */ @@ -611,7 +611,7 @@ vt_set_dec_priv_qm(struct video_state *svsp) sw_cursor(1); /* cursor on */ svsp->cursor_on = 1; break; - + case 42: /* NRCM - 7bit NRC characters */ break; } @@ -632,7 +632,7 @@ vt_reset_dec_priv_qm(struct video_state *svsp) case 2: /* ANM - ansi/vt52 mode */ break; - + case 3: /* COLM - column mode */ vt_col(svsp, SCR_COL80); break; @@ -640,7 +640,7 @@ vt_reset_dec_priv_qm(struct video_state *svsp) case 4: /* SCLM - scrolling mode */ case 5: /* SCNM - screen mode */ break; - + case 6: /* OM - origin mode */ svsp->m_om = 0; break; @@ -653,7 +653,7 @@ vt_reset_dec_priv_qm(struct video_state *svsp) case 8: /* ARM - auto repeat mode */ kbrepflag = 0; break; - + case 9: /* INLM - interlace mode */ case 10: /* EDM - edit mode */ case 11: /* LTM - line transmit mode */ @@ -669,7 +669,7 @@ vt_reset_dec_priv_qm(struct video_state *svsp) sw_cursor(0); /* cursor off */ svsp->cursor_on = 0; break; - + case 42: /* NRCM - 7bit NRC characters */ break; } @@ -688,7 +688,7 @@ vt_set_ansi(struct video_state *svsp) case 2: /* KAM - keyboard action mode */ case 3: /* CRM - Control Representation mode */ break; - + case 4: /* IRM - insert replacement mode */ svsp->irm = 1; /* Insert mode */ break; @@ -707,7 +707,7 @@ vt_set_ansi(struct video_state *svsp) case 18: /* TSM - tabulation stop mode */ case 19: /* EBM - editing boundary mode */ break; - + case 20: /* LNM - line feed / newline mode */ svsp->lnm = 1; break; @@ -727,11 +727,11 @@ vt_reset_ansi(struct video_state *svsp) case 2: /* KAM - keyboard action mode */ case 3: /* CRM - Control Representation mode */ break; - + case 4: /* IRM - insert replacement mode */ svsp->irm = 0; /* Replace mode */ break; - + case 5: /* SRTM - status report transfer mode */ case 6: /* ERM - erasue mode */ case 7: /* VEM - vertical editing mode */ @@ -746,7 +746,7 @@ vt_reset_ansi(struct video_state *svsp) case 18: /* TSM - tabulation stop mode */ case 19: /* EBM - editing boundary mode */ break; - + case 20: /* LNM - line feed / newline mode */ svsp->lnm = 0; break; @@ -756,7 +756,7 @@ vt_reset_ansi(struct video_state *svsp) /*---------------------------------------------------------------------------* * clear tab stop(s) *---------------------------------------------------------------------------*/ -void +void vt_clrtab(struct video_state *svsp) { int i; @@ -785,10 +785,10 @@ vt_sc(struct video_state *svsp) svsp->sc_om = svsp->m_om; svsp->sc_G0 = svsp->G0; svsp->sc_G1 = svsp->G1; - svsp->sc_G2 = svsp->G2; + svsp->sc_G2 = svsp->G2; svsp->sc_G3 = svsp->G3; svsp->sc_GL = svsp->GL; - svsp->sc_GR = svsp->GR; + svsp->sc_GR = svsp->GR; svsp->sc_sel = svsp->selchar; svsp->sc_vtsgr = svsp->vtsgr; } @@ -827,7 +827,7 @@ vt_designate(struct video_state *svsp) { u_short *ctp = NULL; u_char ch; - + if(svsp->whichi == 1) ch = svsp->which[0]; else @@ -836,7 +836,7 @@ vt_designate(struct video_state *svsp) if(svsp->dld_id[0] == '\0') return; - + if(!(((adaptor_type == EGA_ADAPTOR) || (adaptor_type == VGA_ADAPTOR)) && (vgacs[svsp->vga_charset].secondloaded))) @@ -852,10 +852,10 @@ vt_designate(struct video_state *svsp) #ifdef HAVECSE_DOWNLOADABLE ctp = cse_downloadable; swcsp(svsp, ctp); -#endif +#endif return; } - + if(((adaptor_type == EGA_ADAPTOR) || (adaptor_type == VGA_ADAPTOR)) && (vgacs[svsp->vga_charset].secondloaded)) { @@ -864,10 +864,10 @@ vt_designate(struct video_state *svsp) #ifdef HAVECSE_DOWNLOADABLE ctp = cse_downloadable; swcsp(svsp, ctp); -#endif +#endif return; } - + switch(ch) { case 'A': /* British or ISO-Latin-1 */ @@ -881,7 +881,7 @@ vt_designate(struct video_state *svsp) ctp = cse_british; #endif break; - + case STATE_MINUS: /* designate G1 (96)*/ case STATE_DOT: /* designate G2 (96)*/ case STATE_SLASH: /* designate G3 (96)*/ @@ -891,11 +891,11 @@ vt_designate(struct video_state *svsp) break; } break; - + case 'B': /* USASCII */ #ifdef HAVECSE_ASCII ctp = cse_ascii; -#endif +#endif break; case 'C': /* Finnish */ @@ -916,87 +916,87 @@ vt_designate(struct video_state *svsp) case '7': /* Swedish */ #ifdef HAVECSE_SWEDISH ctp = cse_swedish; -#endif +#endif break; - + case 'K': /* German */ #ifdef HAVECSE_GERMAN ctp = cse_german; -#endif +#endif break; - + case 'Q': /* French Canadien */ #ifdef HAVECSE_FRENCHCANADA ctp = cse_frenchcanada; -#endif +#endif break; case 'R': /* French */ #ifdef HAVECSE_FRENCH ctp = cse_french; -#endif +#endif break; case 'Y': /* Italian */ #ifdef HAVECSE_ITALIAN ctp = cse_italian; -#endif +#endif break; case 'Z': /* Spanish */ #ifdef HAVECSE_SPANISH ctp = cse_spanish; -#endif +#endif break; - + case '0': /* special graphics */ #ifdef HAVECSE_SPECIAL ctp = cse_special; -#endif +#endif break; case '1': /* alternate ROM */ #ifdef HAVECSE_ALTERNATEROM1 ctp = cse_alternaterom1; -#endif +#endif break; case '2': /* alt ROM, spec graphics */ #ifdef HAVECSE_ALTERNATEROM2 ctp = cse_alternaterom2; -#endif +#endif break; case '3': /* HP Roman 8, upper 128 chars*/ #ifdef HAVECSE_ROMAN8 ctp = cse_roman8; -#endif +#endif break; case '4': /* Dutch */ #ifdef HAVECSE_DUTCH ctp = cse_dutch; -#endif +#endif break; case '<': /* DEC Supplemental */ #ifdef HAVECSE_SUPPLEMENTAL ctp = cse_supplemental; -#endif +#endif break; case '=': /* Swiss */ #ifdef HAVECSE_SWISS ctp = cse_swiss; -#endif +#endif break; case '>': /* DEC Technical */ #ifdef HAVECSE_TECHNICAL ctp = cse_technical; -#endif +#endif break; - + default: break; } @@ -1016,7 +1016,7 @@ vt_designate(struct video_state *svsp) ctp = csd_british; #endif break; - + case STATE_MINUS: /* designate G1 (96)*/ case STATE_DOT: /* designate G2 (96)*/ case STATE_SLASH: /* designate G3 (96)*/ @@ -1026,11 +1026,11 @@ vt_designate(struct video_state *svsp) break; } break; - + case 'B': /* USASCII */ #ifdef HAVECSD_ASCII ctp = csd_ascii; -#endif +#endif break; case 'C': /* Finnish */ @@ -1051,94 +1051,94 @@ vt_designate(struct video_state *svsp) case '7': /* Swedish */ #ifdef HAVECSD_SWEDISH ctp = csd_swedish; -#endif +#endif break; - + case 'K': /* German */ #ifdef HAVECSD_GERMAN ctp = csd_german; -#endif +#endif break; - + case 'Q': /* French Canadien */ #ifdef HAVECSD_FRENCHCANADA ctp = csd_frenchcanada; -#endif +#endif break; case 'R': /* French */ #ifdef HAVECSD_FRENCH ctp = csd_french; -#endif +#endif break; case 'Y': /* Italian */ #ifdef HAVECSD_ITALIAN ctp = csd_italian; -#endif +#endif break; case 'Z': /* Spanish */ #ifdef HAVECSD_SPANISH ctp = csd_spanish; -#endif +#endif break; - + case '0': /* special graphics */ #ifdef HAVECSD_SPECIAL ctp = csd_special; -#endif +#endif break; case '1': /* alternate ROM */ #ifdef HAVECSD_ALTERNATEROM1 ctp = csd_alternaterom1; -#endif +#endif break; case '2': /* alt ROM, spec graphics */ #ifdef HAVECSD_ALTERNATEROM2 ctp = csd_alternaterom2; -#endif +#endif break; case '3': /* HP Roman 8, upper 128 chars*/ #ifdef HAVECSD_ROMAN8 ctp = csd_roman8; -#endif +#endif break; case '4': /* Dutch */ #ifdef HAVECSD_DUTCH ctp = csd_dutch; -#endif +#endif break; case '<': /* DEC Supplemental */ #ifdef HAVECSD_SUPPLEMENTAL ctp = csd_supplemental; -#endif +#endif break; case '=': /* Swiss */ #ifdef HAVECSD_SWISS ctp = csd_swiss; -#endif +#endif break; case '>': /* DEC Technical */ #ifdef HAVECSD_TECHNICAL ctp = csd_technical; -#endif +#endif break; - + default: break; } } swcsp(svsp, ctp); } - + /*---------------------------------------------------------------------------* * device attributes *---------------------------------------------------------------------------*/ @@ -1146,7 +1146,7 @@ void vt_da(struct video_state *svsp) { static u_char *response = (u_char *)DA_VT220; - + svsp->report_chars = response; svsp->report_count = 18; respond(svsp); @@ -1173,13 +1173,13 @@ vt_aln(struct video_state *svsp) svsp->cur_offset = 0; /* reset everything ! */ svsp->col = 0; - svsp->row = 0; + svsp->row = 0; } /*---------------------------------------------------------------------------* * request terminal parameters *---------------------------------------------------------------------------*/ -void +void vt_reqtparm(struct video_state *svsp) { static u_char *answr = (u_char *)"\033[3;1;1;120;120;1;0x"; @@ -1210,7 +1210,7 @@ vt_dsr(struct video_state *svsp) static u_char *langanswr = (u_char *)"\033[?27;1n"; /* North American*/ static u_char buffer[16]; int i = 0; - + switch(svsp->parms[0]) { case 5: /* return status */ @@ -1225,13 +1225,13 @@ vt_dsr(struct video_state *svsp) if((svsp->row+1) > 10) buffer[i++] = ((svsp->row+1) / 10) + '0'; buffer[i++] = ((svsp->row+1) % 10) + '0'; - buffer[i++] = ';'; + buffer[i++] = ';'; if((svsp->col+1) > 10) buffer[i++] = ((svsp->col+1) / 10) + '0'; buffer[i++] = ((svsp->col+1) % 10) + '0'; buffer[i++] = 'R'; buffer[i++] = '\0'; - + svsp->report_chars = buffer; svsp->report_count = i; respond(svsp); @@ -1261,13 +1261,13 @@ vt_dsr(struct video_state *svsp) } /*---------------------------------------------------------------------------* - * IL - insert line + * IL - insert line *---------------------------------------------------------------------------*/ -void +void vt_il(struct video_state *svsp) { register int p = svsp->parms[0]; - + if((svsp->row >= svsp->scrr_beg) && (svsp->row <= svsp->scrr_end)) { if(p <= 0) @@ -1304,7 +1304,7 @@ vt_ic(struct video_state *svsp) p = 1; else if(p > svsp->maxcol-svsp->col) p = svsp->maxcol-svsp->col; - + while(p--) { bcopy((svsp->Crtat + svsp->cur_offset), @@ -1323,7 +1323,7 @@ void vt_dl(struct video_state *svsp) { register int p = svsp->parms[0]; - + if((svsp->row >= svsp->scrr_beg) && (svsp->row <= svsp->scrr_end)) { if(p <= 0) @@ -1346,7 +1346,7 @@ vt_dl(struct video_state *svsp) svsp->Crtat + ((svsp->scrr_end-p+1) * svsp->maxcol), p * svsp->maxcol); } - } + } } /*---------------------------------------------------------------------------* @@ -1361,7 +1361,7 @@ vt_dch(struct video_state *svsp) p = 1; else if(p > svsp->maxcol-svsp->col) p = svsp->maxcol-svsp->col; - + while(p--) { bcopy((svsp->Crtat + svsp->cur_offset)+1, @@ -1380,12 +1380,12 @@ void vt_su(struct video_state *svsp) { register int p = svsp->parms[0]; - + if(p <= 0) p = 1; else if(p > svsp->screen_rows-1) p = svsp->screen_rows-1; - + roll_up(svsp, p); } @@ -1396,12 +1396,12 @@ void vt_sd(struct video_state *svsp) { register int p = svsp->parms[0]; - + if(p <= 0) p = 1; else if(p > svsp->screen_rows-1) p = svsp->screen_rows-1; - + roll_down(svsp, p); } @@ -1417,7 +1417,7 @@ vt_ech(struct video_state *svsp) p = 1; else if(p > svsp->maxcol-svsp->col) p = svsp->maxcol-svsp->col; - + fillw(user_attr | ' ', (svsp->Crtat + svsp->cur_offset), p); } @@ -1457,9 +1457,9 @@ vt_dcsentry(U_char ch, struct video_state *svsp) svsp->parms[svsp->parmi] *= 10; svsp->parms[svsp->parmi] += (ch -'0'); break; - + case ';': /* next parameter */ - svsp->parmi = + svsp->parmi = (svsp->parmi+1 < MAXPARMS) ? svsp->parmi+1 : svsp->parmi; break; @@ -1508,7 +1508,7 @@ vt_dcsentry(U_char ch, struct video_state *svsp) case 0x1b: /* ESC */ svsp->dcs_state = DCS_UDK_ESC; break; - + default: svsp->transparent = 0; svsp->state = STATE_INIT; @@ -1594,7 +1594,7 @@ vt_dcsentry(U_char ch, struct video_state *svsp) case 0x1b: /* ESC */ svsp->dcs_state = DCS_UDK_ESC; break; - + default: svsp->transparent = 0; svsp->state = STATE_INIT; @@ -1602,7 +1602,7 @@ vt_dcsentry(U_char ch, struct video_state *svsp) break; } break; - + case DCS_UDK_ESC: /* DCS ... | fkey/def ... ESC */ switch(ch) { @@ -1620,13 +1620,13 @@ vt_dcsentry(U_char ch, struct video_state *svsp) break; } break; - + case DCS_DLD_DSCS: /* got DCS ... { */ if(ch >= ' ' && ch <= '/') /* intermediates ... */ { svsp->dld_dscs[svsp->dld_dscsi] = ch; - svsp->dld_id[svsp->dld_dscsi] = ch; + svsp->dld_id[svsp->dld_dscsi] = ch; if(svsp->dld_dscsi >= DSCS_LENGTH) { svsp->transparent = 0; @@ -1661,16 +1661,16 @@ vt_dcsentry(U_char ch, struct video_state *svsp) case 0x1b: /* ESC */ svsp->dcs_state = DCS_DLD_ESC; break; - + case '/': /* sixel upper / lower divider */ svsp->dld_sixel_lower = 1; break; - + case ';': /* character divider */ vt_dld(svsp); svsp->parms[1]++; /* next char */ break; - + default: if (svsp->dld_sixel_lower) { @@ -1727,7 +1727,7 @@ vt_udk(struct video_state *svsp) { int key, start, max, i; int usedff = 0; - + if(svsp->parms[0] != 1) /* clear all ? */ { vt_clearudk(svsp); @@ -1741,7 +1741,7 @@ vt_udk(struct video_state *svsp) } key = svsp->udk_fnckey - 17; /* index into table */ - + if(svsp->ukt.length[key] == 0) /* never used ? */ { if(svsp->udkff < MAXUDKDEF-2) /* space available ? */ @@ -1770,7 +1770,7 @@ vt_udk(struct video_state *svsp) } max--; /* adjust for tailing '\0' */ - + for(i = 0; i < max && i < svsp->udk_defi; i++) svsp->udkbuf[start++] = svsp->udk_def[i]; @@ -1778,7 +1778,7 @@ vt_udk(struct video_state *svsp) svsp->ukt.length[key] = i+1; /* count for tailing '\0' */ if(usedff) svsp->udkff += (i+2); /* new start location */ - + init_udk(svsp); } @@ -1813,7 +1813,7 @@ vt_dld(struct video_state *svsp) else return; - svsp->parms[1] = (svsp->parms[1] < 1) ? 1 : + svsp->parms[1] = (svsp->parms[1] < 1) ? 1 : ((svsp->parms[1] > 0x7E) ? 0x7E : svsp->parms[1]); if(svsp->parms[2] != 1) /* Erase all characters ? */ @@ -1875,7 +1875,7 @@ void vt_initsel(struct video_state *svsp) { register int i; - + for(i = 0;i < MAXDECSCA;i++) svsp->decsca[i] = 0; } @@ -1924,7 +1924,7 @@ vt_sed(struct video_state *svsp) (svsp->Crtat + svsp->cur_offset) - svsp->Crtat + 1 ); break; - case 2: + case 2: selective_erase(svsp, svsp->Crtat, svsp->maxcol * svsp->screen_rows); break; @@ -1973,7 +1973,7 @@ roll_up(struct video_state *svsp, int n) if(vsp == svsp && !(vsp->vt_status & VT_GRAFX)) #else if(vsp == svsp) -#endif +#endif { outb(addr_6845, CRTC_STARTADRH); @@ -1989,7 +1989,7 @@ roll_up(struct video_state *svsp, int n) svsp->Crtat + (svsp->scrr_beg * svsp->maxcol), svsp->maxcol * (svsp->scrr_len - n) * CHR ); } - + fillw( user_attr | ' ', svsp->Crtat + ((svsp->scrr_end - n + 1) * svsp->maxcol), n * svsp->maxcol); @@ -2006,14 +2006,14 @@ roll_down(struct video_state *svsp, int n) { #if (PCVT_NOFASTSCROLL==0) - + if(svsp->scrr_beg == 0 && /* if scroll region is whole screen */ svsp->scrr_len == svsp->screen_rows && (svsp != vsp || /* and either running in memory */ (svsp->screen_rows == svsp->screen_rowsize && /* or no fkeys */ adaptor_type != MDA_ADAPTOR))) /* and not on MDA/Hercules */ { - u_short *Memory = + u_short *Memory = #if PCVT_USL_VT_COMPAT (vsp != svsp || (vsp->vt_status & VT_GRAFX)) ? @@ -2039,7 +2039,7 @@ roll_down(struct video_state *svsp, int n) if(vsp == svsp && !(vsp->vt_status & VT_GRAFX)) #else if(vsp == svsp) -#endif +#endif { outb(addr_6845, CRTC_STARTADRH); @@ -2055,7 +2055,7 @@ roll_down(struct video_state *svsp, int n) svsp->Crtat + ((svsp->scrr_beg + n) * svsp->maxcol), svsp->maxcol * (svsp->scrr_len - n) * CHR ); } - + fillw( user_attr | ' ', svsp->Crtat + (svsp->scrr_beg * svsp->maxcol), n * svsp->maxcol); @@ -2072,7 +2072,7 @@ swcsp(struct video_state *svsp, u_short *ctp) { if(ctp == NULL) return; - + switch(svsp->state) { case STATE_BROPN: /* designate G0 */ @@ -2138,7 +2138,7 @@ clear_dld(struct video_state *svsp) vgacharset = vgacs[svsp->vga_charset].secondloaded; else return; - + for(i=0;i < 16;i++) /* A zeroed character, vt220 has inverted '?' */ vgachar[i] = 0x00; @@ -2170,7 +2170,7 @@ static void selective_erase(struct video_state *svsp, u_short *pcrtat, int length) { register int i, j; - + for(j = pcrtat - svsp->Crtat, i = 0;i < length;i++,pcrtat++) { if(!(svsp->decsca[INT_INDEX(j+i)] & (1 << BIT_INDEX(j+i)))) diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c index 975e95f..2026a45 100644 --- a/sys/i386/isa/psm.c +++ b/sys/i386/isa/psm.c @@ -21,22 +21,22 @@ */ /* - * Ported to 386bsd Oct 17, 1992 + * Ported to 386bsd Oct 17, 1992 * Sandi Donno, Computer Science, University of Cape Town, South Africa * Please send bug reports to sandi@cs.uct.ac.za * * Thanks are also due to Rick Macklem, rick@snowhite.cis.uoguelph.ca - * although I was only partially successful in getting the alpha release - * of his "driver for the Logitech and ATI Inport Bus mice for use with - * 386bsd and the X386 port" to work with my Microsoft mouse, I nevertheless - * found his code to be an invaluable reference when porting this driver + * of his "driver for the Logitech and ATI Inport Bus mice for use with + * 386bsd and the X386 port" to work with my Microsoft mouse, I nevertheless + * found his code to be an invaluable reference when porting this driver * to 386bsd. * * Further modifications for latest 386BSD+patchkit and port to NetBSD, * Andrew Herbert <andrew@werple.apana.org.au> - 8 June 1993 * * Cloned from the Microsoft Bus Mouse driver, also by Erik Forsberg, by - * Andrew Herbert - 12 June 1993 + * Andrew Herbert - 12 June 1993 * * Modified for PS/2 mouse by Charles Hannum <mycroft@ai.mit.edu> * - 13 June 1993 @@ -261,7 +261,7 @@ void psm_poll_status(void) inb(AUX_PORT+DATA);} return; } - + int psmclose(dev_t dev, int flag, int fmt, struct proc *p) { @@ -328,14 +328,14 @@ int psmread(dev_t dev, struct uio *uio, int flag) /* Remove a small chunk from input queue */ if (sc->inq.first + length >= MSBSZ) { - bcopy(&sc->inq.queue[sc->inq.first], + bcopy(&sc->inq.queue[sc->inq.first], buffer, MSBSZ - sc->inq.first); - bcopy(sc->inq.queue, &buffer[MSBSZ-sc->inq.first], + bcopy(sc->inq.queue, &buffer[MSBSZ-sc->inq.first], length - (MSBSZ - sc->inq.first)); } else bcopy(&sc->inq.queue[sc->inq.first], buffer, length); - + sc->inq.first = (sc->inq.first + length) % MSBSZ; sc->inq.count -= length; diff --git a/sys/i386/isa/readMBR.c b/sys/i386/isa/readMBR.c index b6edfcf..7515723 100644 --- a/sys/i386/isa/readMBR.c +++ b/sys/i386/isa/readMBR.c @@ -15,7 +15,7 @@ * written by julian elischer (julian@tfs.com) * * @(#)readMBR.c 8.5 (tfs) 1/21/94 - * $Id: readMBR.c,v 1.3 1994/11/08 10:35:52 phk Exp $ + * $Id: readMBR.c,v 1.4 1994/11/14 13:22:41 bde Exp $ */ #include <sys/param.h> @@ -34,7 +34,7 @@ * to make sure it's reading absolute sectors. * On exit: * Leaves the disklabel set up with the various partitions - * in the last 4 entries, + * in the last 4 entries, * the A partition pointing to the BSD part * the C partition set as the BSD partition, (read the disklabel from there) and * the D partition set as the whole disk for beating up @@ -122,7 +122,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl) * partition. */ for (i = 0; i < NDOSPART; i++, dp++,pseudopart++) { - + if (!dp->dp_size) continue; /* @@ -132,7 +132,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl) dp->dp_size; lp->d_partitions[pseudopart].p_offset = dp->dp_start; - + /* * make sure the D part can hold it all */ @@ -141,7 +141,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl) lp->d_partitions[3].p_size = (dp->dp_start + dp->dp_size); } - + /* * If we haven't seen a *BSD partition then * check if this is a valid part.. @@ -171,7 +171,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl) seenBSD = 1; *cyl = DPCYL(dp->dp_scyl, dp->dp_ssect); - + /* * Note which part we are in (?) */ @@ -203,7 +203,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl) = FS_MSDOS; break; } - + /* * Try deduce the geometry, working * on the principle that this @@ -231,6 +231,6 @@ bad: bp->b_flags = B_INVAL | B_AGE; brelse(bp); return msg; -} +} diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c index 8b68956..9f50105 100644 --- a/sys/i386/isa/scd.c +++ b/sys/i386/isa/scd.c @@ -41,7 +41,7 @@ */ -/* $Id: scd.c,v 1.3 1995/04/12 20:48:02 wollman Exp $ */ +/* $Id: scd.c,v 1.4 1995/05/09 12:25:58 rgrimes Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -135,7 +135,7 @@ struct scd_data { short first_track; short last_track; struct ioc_play_msf last_play; - + short audio_status; struct buf head; /* head of buf queue */ struct scd_mbx mbx; @@ -213,7 +213,7 @@ int scd_attach(struct isa_device *dev) { struct scd_data *cd = scd_data + dev->id_unit; int i; - + cd->iobase = dev->id_iobase; /* Already set by probe, but ... */ kdc_scd[dev->id_unit].kdc_state = DC_IDLE; @@ -235,7 +235,7 @@ scdopen(dev_t dev) int unit,part,phys; int rc; struct scd_data *cd; - + unit = scd_unit(dev); if (unit >= NSCD) return ENXIO; @@ -243,7 +243,7 @@ scdopen(dev_t dev) cd = scd_data + unit; part = scd_part(dev); phys = scd_phys(dev); - + /* not initialized*/ if (!(cd->flags & SCDINIT)) return ENXIO; @@ -289,7 +289,7 @@ scdclose(dev_t dev) struct scd_data *cd; int rlen; char rdata[10]; - + unit = scd_unit(dev); if (unit >= NSCD) return ENXIO; @@ -297,8 +297,8 @@ scdclose(dev_t dev) cd = scd_data + unit; part = scd_part(dev); phys = scd_phys(dev); - - if (!(cd->flags & SCDINIT) || !cd->openflag) + + if (!(cd->flags & SCDINIT) || !cd->openflag) return ENXIO; if (cd->audio_status != CD_AS_PLAY_IN_PROGRESS) { @@ -346,11 +346,11 @@ scdstrategy(struct buf *bp) bp->b_error = EROFS; goto bad; } - + /* no data to read */ if (bp->b_bcount == 0) goto done; - + if (!(cd->flags & SCDTOC)) { bp->b_error = EIO; goto bad; @@ -361,13 +361,13 @@ scdstrategy(struct buf *bp) bp->b_pblkno = bp->b_blkno; bp->b_resid = 0; - + /* queue it */ qp = &cd->head; s = splbio(); disksort(qp,bp); splx(s); - + /* now check whether we can perform processing */ scd_start(unit); return; @@ -388,7 +388,7 @@ scd_start(int unit) struct partition *p; int part; register s = splbio(); - + if (cd->flags & SCDMBXBSY) { splx(s); return; @@ -423,7 +423,7 @@ scdioctl(dev_t dev, int cmd, caddr_t addr, int flags) { struct scd_data *cd; int unit,part; - + unit = scd_unit(dev); part = scd_part(dev); cd = scd_data + unit; @@ -618,7 +618,7 @@ scd_pause(int unit) if (send_cmd(unit, CMD_STOP_AUDIO, 0) != 0) return EIO; - + cd->last_play.start_m = subpos.abs_msf[0]; cd->last_play.start_s = subpos.abs_msf[1]; cd->last_play.start_f = subpos.abs_msf[2]; @@ -831,7 +831,7 @@ trystat: (caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */ return; } - + process_attention(unit); /* reject, if audio active */ @@ -1184,19 +1184,19 @@ get_tl(struct sony_toc *toc, int size) if (tl->track != 0xb0) return tl; (char *)tl += 9; - if (tl->track != 0xb1) + if (tl->track != 0xb1) return tl; (char *)tl += 9; - if (tl->track != 0xb2) + if (tl->track != 0xb2) return tl; (char *)tl += 9; - if (tl->track != 0xb3) + if (tl->track != 0xb3) return tl; (char *)tl += 9; - if (tl->track != 0xb4) + if (tl->track != 0xb4) return tl; (char *)tl += 9; - if (tl->track != 0xc0) + if (tl->track != 0xc0) return tl; (char *)tl += 9; return tl; @@ -1368,7 +1368,7 @@ send_cmd(u_int unit, u_char cmd, u_int nargs, ...) XDEBUG(1, ("\nscd%d: wparam timeout\n", unit)); return -EIO; } - + va_start(ap, nargs); reg = port + OREG_WPARAMS; for (i = 0; i < nargs; i++) { @@ -1512,7 +1512,7 @@ scd_toc_entrys (int unit, struct ioc_read_toc_entry *te) i = te->starting_track; if (i == SCD_LASTPLUS1) i = cd->last_track + 1; - + /* verify starting track */ if (i < cd->first_track || i > cd->last_track+1) return EINVAL; diff --git a/sys/i386/isa/seagate.c b/sys/i386/isa/seagate.c index cfd113b..de18f23 100644 --- a/sys/i386/isa/seagate.c +++ b/sys/i386/isa/seagate.c @@ -46,7 +46,7 @@ * delays, device flags, polling mode, generic cleanup * vak 950115 Added request-sense ops * - * $Id: seagate.c,v 1.6 1995/03/28 07:55:50 bde Exp $ + * $Id: seagate.c,v 1.7 1995/04/12 20:48:03 wollman Exp $ */ /* @@ -530,7 +530,7 @@ int sea_attach (struct isa_device *dev) z->sc_link.adapter_targ = z->scsi_addr; z->sc_link.adapter = &sea_switch; z->sc_link.device = &sea_dev; - + /* ask the adapter what subunits are present */ scsi_attachdevs (&(z->sc_link)); diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index 9764ef6..4ae58cd 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.97 1995/05/07 23:00:02 ache Exp $ + * $Id: sio.c,v 1.98 1995/05/11 19:26:19 rgrimes Exp $ */ #include "sio.h" @@ -630,7 +630,7 @@ sioattach(isdp) #ifdef DSI_SOFT_MODEM if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) { printf(" Digicom Systems, Inc. SoftModem"); - kdc_sio[unit].kdc_description = + kdc_sio[unit].kdc_description = "Serial port: Digicom Systems SoftModem"; goto determined_type; } @@ -1326,15 +1326,15 @@ sioioctl(dev, cmd, data, flag, p) pi = (u_char*)(*(caddr_t*)data); error = copyin(pi,&l,sizeof l); - if(error) + if(error) {return error;}; pi += sizeof l; p = malloc(l,M_TEMP,M_NOWAIT); - if(!p) + if(!p) {return ENOBUFS;} error = copyin(pi,p,l); - if(error) + if(error) {free(p,M_TEMP); return error;}; if(error = LoadSoftModem( MINOR_TO_UNIT(mynor),iobase,l,p)) @@ -2229,7 +2229,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) int int_c,int_k; int data_0188, data_0187; - /* + /* * First see if it is a DSI SoftModem */ if(!((inb(base_io+7) ^ inb(base_io+7) & 0x80))) @@ -2248,8 +2248,8 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) DSI_ERROR("dsp bus not granted"); if(0x01 != (inb(base_io+7) & 0x01)) { - outb(base_io+7,0x18); - outb(base_io+7,0x19); + outb(base_io+7,0x18); + outb(base_io+7,0x19); if(0x01 != (inb(base_io+7) & 0x01)) DSI_ERROR("program mem not granted"); } @@ -2275,14 +2275,14 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+7,0x19); if(0x00 != (inb(base_io+7) & 0x01)) DSI_ERROR("program data not granted"); - + for(int_k = 0 ; int_k < 0x800; int_k++) { outb(base_io+1,*ptr++); outb(base_io+2,0); outb(base_io+1,*ptr++); outb(base_io+2,*ptr++); } - + size -= 0x1800; while(size > 0x1800) { @@ -2299,7 +2299,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - + } else if (size > 0) { if(int_c == 7) { outb(base_io+7,0x18); @@ -2319,7 +2319,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - } + } outb(base_io+7,0x11); outb(base_io+7,3); diff --git a/sys/i386/isa/sound/dev_table.h b/sys/i386/isa/sound/dev_table.h index 91df56e..f278223 100644 --- a/sys/i386/isa/sound/dev_table.h +++ b/sys/i386/isa/sound/dev_table.h @@ -2,7 +2,7 @@ * dev_table.h * * Global definitions for device call tables - * + * * Copyright by Hannu Savolainen 1993 * * Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dev_table.h,v 1.12 1995/03/12 23:33:50 swallace Exp $ + * $Id: dev_table.h,v 1.13 1995/03/28 07:56:11 bde Exp $ */ #ifndef _DEV_TABLE_H_ @@ -117,9 +117,9 @@ struct audio_operations { void *devc; /* Driver specific info */ int (*open) (int dev, int mode); void (*close) (int dev); - void (*output_block) (int dev, unsigned long buf, + void (*output_block) (int dev, unsigned long buf, int count, int intrflag, int dma_restart); - void (*start_input) (int dev, unsigned long buf, + void (*start_input) (int dev, unsigned long buf, int count, int intrflag, int dma_restart); int (*ioctl) (int dev, unsigned int cmd, unsigned int arg, int local); int (*prepare_for_input) (int dev, int bufsize, int nbufs); @@ -197,7 +197,7 @@ struct sound_timer_operations { void (*arm_timer)(int dev, long time); }; -#ifdef _DEV_TABLE_C_ +#ifdef _DEV_TABLE_C_ struct audio_operations *audio_devs[MAX_AUDIO_DEV] = {NULL}; int num_audiodevs = 0; struct mixer_operations *mixer_devs[MAX_MIXER_DEV] = {NULL}; int num_mixers = 0; struct synth_operations *synth_devs[MAX_SYNTH_DEV+MAX_MIDI_DEV] = {NULL}; int num_synths = 0; @@ -205,12 +205,12 @@ struct sound_timer_operations { #ifndef EXCLUDE_SEQUENCER extern struct sound_timer_operations default_sound_timer; - struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = - {&default_sound_timer, NULL}; + struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = + {&default_sound_timer, NULL}; int num_sound_timers = 1; #else - struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = - {NULL}; + struct sound_timer_operations *sound_timer_devs[MAX_TIMER_DEV] = + {NULL}; int num_sound_timers = 0; #endif diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c index aaf57a6..e7d8216 100644 --- a/sys/i386/isa/sound/dmabuf.c +++ b/sys/i386/isa/sound/dmabuf.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dmabuf.c,v 1.14 1995/03/18 20:01:10 swallace Exp $ + * $Id: dmabuf.c,v 1.15 1995/05/07 06:38:47 pst Exp $ */ #include "sound_config.h" @@ -435,7 +435,7 @@ DMAbuf_ioctl (int dev, unsigned int cmd, unsigned int arg, int local) break; case SNDCTL_DSP_SETBLKSIZE: - { + { int size = IOCTL_IN (arg); if(!(dmap->flags & DMA_ALLOC_DONE) && size) @@ -921,7 +921,7 @@ DMAbuf_input_ready(int dev) { int h,i,r; struct dma_buffparms *dmap = audio_devs[dev]->dmap; - + r = 0; if(dmap->qlen) { @@ -931,13 +931,13 @@ DMAbuf_input_ready(int dev) { h = (dmap->qhead + i) % dmap->nbufs; r += dmap->fragment_size - dmap->counts[h]; - if(r >= dmap->fragment_size) + if(r >= dmap->fragment_size) break; - } + } if(r < dmap->fragment_size) r = 0; else - r = 1; + r = 1; } else r = 1; diff --git a/sys/i386/isa/sound/finetune.h b/sys/i386/isa/sound/finetune.h index 6c17d74..00085f9 100644 --- a/sys/i386/isa/sound/finetune.h +++ b/sys/i386/isa/sound/finetune.h @@ -28,21 +28,21 @@ unsigned short finetune_table[128] = { -/* 0 */ 9439, 9447, 9456, 9464, 9473, 9481, 9490, 9499, -/* 8 */ 9507, 9516, 9524, 9533, 9542, 9550, 9559, 9567, -/* 16 */ 9576, 9585, 9593, 9602, 9611, 9619, 9628, 9637, -/* 24 */ 9645, 9654, 9663, 9672, 9680, 9689, 9698, 9707, -/* 32 */ 9715, 9724, 9733, 9742, 9750, 9759, 9768, 9777, -/* 40 */ 9786, 9795, 9803, 9812, 9821, 9830, 9839, 9848, -/* 48 */ 9857, 9866, 9874, 9883, 9892, 9901, 9910, 9919, -/* 56 */ 9928, 9937, 9946, 9955, 9964, 9973, 9982, 9991, -/* 64 */ 10000, 10009, 10018, 10027, 10036, 10045, 10054, 10063, -/* 72 */ 10072, 10082, 10091, 10100, 10109, 10118, 10127, 10136, -/* 80 */ 10145, 10155, 10164, 10173, 10182, 10191, 10201, 10210, -/* 88 */ 10219, 10228, 10237, 10247, 10256, 10265, 10274, 10284, -/* 96 */ 10293, 10302, 10312, 10321, 10330, 10340, 10349, 10358, -/* 104 */ 10368, 10377, 10386, 10396, 10405, 10415, 10424, 10433, -/* 112 */ 10443, 10452, 10462, 10471, 10481, 10490, 10499, 10509, +/* 0 */ 9439, 9447, 9456, 9464, 9473, 9481, 9490, 9499, +/* 8 */ 9507, 9516, 9524, 9533, 9542, 9550, 9559, 9567, +/* 16 */ 9576, 9585, 9593, 9602, 9611, 9619, 9628, 9637, +/* 24 */ 9645, 9654, 9663, 9672, 9680, 9689, 9698, 9707, +/* 32 */ 9715, 9724, 9733, 9742, 9750, 9759, 9768, 9777, +/* 40 */ 9786, 9795, 9803, 9812, 9821, 9830, 9839, 9848, +/* 48 */ 9857, 9866, 9874, 9883, 9892, 9901, 9910, 9919, +/* 56 */ 9928, 9937, 9946, 9955, 9964, 9973, 9982, 9991, +/* 64 */ 10000, 10009, 10018, 10027, 10036, 10045, 10054, 10063, +/* 72 */ 10072, 10082, 10091, 10100, 10109, 10118, 10127, 10136, +/* 80 */ 10145, 10155, 10164, 10173, 10182, 10191, 10201, 10210, +/* 88 */ 10219, 10228, 10237, 10247, 10256, 10265, 10274, 10284, +/* 96 */ 10293, 10302, 10312, 10321, 10330, 10340, 10349, 10358, +/* 104 */ 10368, 10377, 10386, 10396, 10405, 10415, 10424, 10433, +/* 112 */ 10443, 10452, 10462, 10471, 10481, 10490, 10499, 10509, /* 120 */ 10518, 10528, 10537, 10547, 10556, 10566, 10576, 10585 }; #else diff --git a/sys/i386/isa/sound/midi_ctrl.h b/sys/i386/isa/sound/midi_ctrl.h index 75b6fd8..3aa0f17 100644 --- a/sys/i386/isa/sound/midi_ctrl.h +++ b/sys/i386/isa/sound/midi_ctrl.h @@ -12,7 +12,7 @@ static unsigned char ctrl_def_values[128] = 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 40 to 47 */ 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 48 to 55 */ 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 56 to 63 */ - + 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 64 to 71 */ 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 72 to 79 */ 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, /* 80 to 87 */ diff --git a/sys/i386/isa/sound/opl3.h b/sys/i386/isa/sound/opl3.h index 5fa6aa5..d5101cd 100644 --- a/sys/i386/isa/sound/opl3.h +++ b/sys/i386/isa/sound/opl3.h @@ -37,7 +37,7 @@ * The percussive mode is implemented in the left side only. * * With the above exceptions the both sides can be operated independently. - * + * * A 4 OP voice can be created by setting the corresponding * bit at offset 4 of the right side. * @@ -46,7 +46,7 @@ * voice is made inaccessible. * * If a voice is set to the 2 OP mode, it works like 2 OP modes - * of the original YM3812 (AdLib). In addition the voice can + * of the original YM3812 (AdLib). In addition the voice can * be connected the left, right or both stereo channels. It can * even be left unconnected. This works with 4 OP voices also. * @@ -179,13 +179,13 @@ * 0 0 >+-1-+--2--3--4--> * * - * + * * +---+ * | | * 0 1 >+-1-+--2-+ * |-> * >--3----4-+ - * + * * +---+ * | | * 1 0 >+-1-+-----+ diff --git a/sys/i386/isa/sound/os.h b/sys/i386/isa/sound/os.h index 2e888c0..6076065 100644 --- a/sys/i386/isa/sound/os.h +++ b/sys/i386/isa/sound/os.h @@ -35,7 +35,7 @@ * * If you have to make changes to other than these two files, please contact me * before making the changes. It's possible that I have already made the - * change. + * change. * * os.h,v 1.13 1994/10/01 02:16:53 swallace Exp */ @@ -64,7 +64,7 @@ */ #ifdef CONFIGURE_SOUNDCARD -/* +/* * select() is currently implemented in Linux specific way. Don't enable. * I don't remember what the SHORT_BANNERS means so forget it. */ @@ -79,18 +79,18 @@ * Here is the first portability problem. Every OS has it's own way to * pass a pointer to the buffer in read() and write() calls. In Linux it's * just a char*. In BSD it's struct uio. This parameter is passed to - * all functions called from read() or write(). Since nothing can be + * all functions called from read() or write(). Since nothing can be * assumed about this structure, the driver uses set of macros for - * accessing the user buffer. + * accessing the user buffer. * * The driver reads/writes bytes in the user buffer sequentially which * means that calls like uiomove() can be used. * * snd_rw_buf is the type which is passed to the device file specific * read() and write() calls. - * + * * The following macros are used to move date to and from the - * user buffer. These macros should be used only when the + * user buffer. These macros should be used only when the * target or source parameter has snd_rw_buf type. * The offs parameter is a offset relative to the beginning of * the user buffer. In Linux the offset is required but for example @@ -115,7 +115,7 @@ typedef struct uio snd_rw_buf; do { if (uiomove(source, count, (struct uio *)target)) { \ printf ("sb: Bad copyout()!\n"); \ } } while(0) -/* +/* * The following macros are like COPY_*_USER but work just with one byte (8bit), * short (16 bit) or long (32 bit) at a time. * The same restrictions apply than for COPY_*_USER @@ -194,7 +194,7 @@ struct snd_wait { * the process is resumed if it receives a signal. The following is propably * not the way how it should be done on 386bsd. * The on_what parameter is a wait_queue defined with DEFINE_WAIT_QUEUE(), - * and the second is a workarea parameter. The third is a timeout + * and the second is a workarea parameter. The third is a timeout * in ticks. Zero means no timeout. */ #define DO_SLEEP(q, f, time_limit) \ @@ -220,10 +220,10 @@ struct snd_wait { #define HZ hz #endif -/* +/* * GET_TIME() returns current value of the counter incremented at timer * ticks. This can overflow, so the timeout might be real big... - * + * */ extern unsigned long get_time(void); #define GET_TIME() get_time() @@ -250,7 +250,7 @@ extern unsigned long get_time(void); */ #define INB inb -/* +/* * The outb(0, 0x80) is just for slowdown. It's bit unsafe since * this address could be used for something usefull. */ @@ -267,9 +267,9 @@ extern unsigned long get_time(void); #define RET_ERROR(err) -(err) -/* - KERNEL_MALLOC() allocates requested number of memory and - KERNEL_FREE is used to free it. +/* + KERNEL_MALLOC() allocates requested number of memory and + KERNEL_FREE is used to free it. These macros are never called from interrupt, in addition the nbytes will never be more than 4096 bytes. Generally the driver will allocate memory in blocks of 4k. If the kernel has just a diff --git a/sys/i386/isa/sound/pas.h b/sys/i386/isa/sound/pas.h index bdb9c56..78e90bf 100644 --- a/sys/i386/isa/sound/pas.h +++ b/sys/i386/isa/sound/pas.h @@ -47,7 +47,7 @@ #define SYSTEM_CONFIGURATION_1 0x8388 /* R W Control */ #define S_C_1_PCS_ENABLE 0x01 /* R W PC speaker 1=enable, 0=disable PC speaker emulation */ - #define S_C_1_PCM_CLOCK_SELECT 0x02 /* R W PCM 1=14.31818Mhz/12, 0=28.224Mhz master clock */ + #define S_C_1_PCM_CLOCK_SELECT 0x02 /* R W PCM 1=14.31818Mhz/12, 0=28.224Mhz master clock */ #define S_C_1_FM_EMULATE_CLOCK 0x04 /* R W FM 1=use 28.224Mhz/2, 0=use 14.31818Mhz clock */ #define S_C_1_PCS_STEREO 0x10 /* R W PC speaker 1=enable PC speaker stereo effect, 0=disable */ #define S_C_1_PCS_REALSOUND 0x20 /* R W PC speaker 1=enable RealSound enhancement, 0=disable */ @@ -114,7 +114,7 @@ struct { /* R W Mixer Filter translation */ unsigned int freq:24; unsigned int value:8; - } F_F_FILTER_translate[] = + } F_F_FILTER_translate[] = { { 73500, 0x01 }, /* 73500Hz - divide by 16 */ { 65333, 0x02 }, /* 65333Hz - divide by 18 */ { 49000, 0x09 }, /* 49000Hz - divide by 24 */ @@ -142,7 +142,7 @@ unsigned char I_C_2_PCM_DMA_translate[] = /* R W PCM PCM DMA channel value translations */ { 4, 1, 2, 3, 0, 5, 6, 7 }; unsigned char I_C_3_PCM_IRQ_translate[] = /* R W PCM PCM IRQ level value translation */ - { 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 7, 8, 9, 0, 10, 11 }; + { 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 7, 8, 9, 0, 10, 11 }; unsigned char E_C_MPU401_IRQ_translate[] = /* R W MIDI MPU401 emulation IRQ value translation */ { 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x05, 0x06, 0x07 }; unsigned char E_C_SB_IRQ_translate[] = /* R W PCM SB emulation IRQ translate */ @@ -150,7 +150,7 @@ unsigned char E_C_SB_DMA_translate[] = /* R W PCM SB emulation DMA translate */ { 0x00, 0x40, 0x80, 0xC0, 0, 0, 0, 0 }; unsigned char O_M_1_to_card[] = /* R W Control Translate (OM1 & 0x0f) to card type */ - { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 2, 3 }; + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 2, 3 }; #else extern unsigned char I_C_2_PCM_DMA_translate[]; /* R W PCM PCM DMA channel value translations */ extern unsigned char I_C_3_PCM_IRQ_translate[]; /* R W PCM PCM IRQ level value translation */ @@ -251,4 +251,4 @@ #define MIDI_FIFO_STATUS 0x1B89 /* R W MIDI Midi fifo status */ #define MIDI_DATA 0x178A /* R W MIDI Midi data register */ -#define MIDI_INPUT_AVAILABLE 0x0f /* RW MIDI */ +#define MIDI_INPUT_AVAILABLE 0x0f /* RW MIDI */ diff --git a/sys/i386/isa/sound/pas2_card.c b/sys/i386/isa/sound/pas2_card.c index 204946e..13f2efc 100644 --- a/sys/i386/isa/sound/pas2_card.c +++ b/sys/i386/isa/sound/pas2_card.c @@ -380,7 +380,7 @@ attach_pas_card (long mem_start, struct address_info *hw_config) if (detect_pas_hw (hw_config)) { - board_rev_id = pas_read (BOARD_REV_ID); + board_rev_id = pas_read (BOARD_REV_ID); if (pas_model = pas_read (CHIP_REV)) { #ifdef __FreeBSD__ diff --git a/sys/i386/isa/sound/sb_mixer.h b/sys/i386/isa/sound/sb_mixer.h index 495b040..e605e79 100644 --- a/sys/i386/isa/sound/sb_mixer.h +++ b/sys/i386/isa/sound/sb_mixer.h @@ -1,10 +1,10 @@ /* * sound/sb_mixer.h - * + * * Definitions for the SB Pro and SB16 mixers - * + * * Copyright by Hannu Savolainen 1993 - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: 1. Redistributions of source code must retain the above copyright @@ -12,7 +12,7 @@ * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -28,7 +28,7 @@ * Modified: * Hunyue Yau Jan 6 1994 * Added defines for the Sound Galaxy NX Pro mixer. - * + * * sb_mixer.h,v 1.4 1994/10/01 02:17:08 swallace Exp */ @@ -57,11 +57,11 @@ /* * Mixer registers - * + * * NOTE! RECORD_SRC == IN_FILTER */ -/* +/* * Mixer registers of SB Pro */ #define VOC_VOL 0x04 @@ -80,7 +80,7 @@ #define OPSW 0x3c /* - * Additional registers on the SG NX Pro + * Additional registers on the SG NX Pro */ #define COVOX_VOL 0x42 #define TREBLE_LVL 0x44 diff --git a/sys/i386/isa/sound/sound_calls.h b/sys/i386/isa/sound/sound_calls.h index dea28e3..ed00975 100644 --- a/sys/i386/isa/sound/sound_calls.h +++ b/sys/i386/isa/sound/sound_calls.h @@ -1,7 +1,7 @@ /* * DMA buffer calls * - * $Id: sound_calls.h,v 1.11 1995/03/28 07:56:13 bde Exp $ + * $Id: sound_calls.h,v 1.12 1995/05/07 06:38:48 pst Exp $ */ #ifndef _MACHINE_ISA_SOUND_H_ @@ -87,7 +87,7 @@ long CMIDI_init (long mem_start); int CMIDI_open (int dev, struct fileinfo *file); int CMIDI_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); int CMIDI_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count); -int CMIDI_close (int dev, struct fileinfo *file); +int CMIDI_close (int dev, struct fileinfo *file); /* * diff --git a/sys/i386/isa/sound/sound_config.h b/sys/i386/isa/sound/sound_config.h index 470bc01..c3732d5 100644 --- a/sys/i386/isa/sound/sound_config.h +++ b/sys/i386/isa/sound/sound_config.h @@ -2,7 +2,7 @@ * * A driver for Soundcards, misc configuration parameters. * - * + * * Copyright by Hannu Savolainen 1993 * * Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sound_config.h,v 1.6 1994/10/01 02:17:11 swallace Exp $ + * $Id: sound_config.h,v 1.9 1995/03/12 23:34:07 swallace Exp $ */ #include "local.h" @@ -118,7 +118,7 @@ If your card has nonstandard I/O address or IRQ number, change defines #endif #ifndef GUS16_BASE -#define GUS16_BASE 0x530 +#define GUS16_BASE 0x530 #endif #ifndef GUS16_IRQ @@ -158,7 +158,7 @@ If your card has nonstandard I/O address or IRQ number, change defines #define MSS_BASE 0x530 #endif -#ifndef MSS_IRQ +#ifndef MSS_IRQ #define MSS_IRQ 10 #endif @@ -170,7 +170,7 @@ If your card has nonstandard I/O address or IRQ number, change defines #define U6850_BASE 0x330 #endif -#ifndef U6850_IRQ +#ifndef U6850_IRQ #define U6850_IRQ 5 #endif diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c index 254f49f..a396727 100644 --- a/sys/i386/isa/sound/soundcard.c +++ b/sys/i386/isa/sound/soundcard.c @@ -1,8 +1,8 @@ /* * sound/386bsd/soundcard.c - * + * * Soundcard driver for FreeBSD. - * + * * Copyright by Hannu Savolainen 1993 * * Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: soundcard.c,v 1.24 1995/03/12 23:34:10 swallace Exp $ + * $Id: soundcard.c,v 1.25 1995/05/11 19:26:24 rgrimes Exp $ */ #include "sound_config.h" @@ -91,7 +91,7 @@ int x; return timecopy.tv_usec/(1000000/HZ) + (unsigned long)timecopy.tv_sec*HZ; } - + int sndread (int dev, struct uio *buf) @@ -243,7 +243,7 @@ sndprobe (struct isa_device *dev) hw_config.io_base = dev->id_iobase; hw_config.irq = ipri_to_irq (dev->id_irq); hw_config.dma = dev->id_drq; - + if(unit) return sndtable_probe (unit, &hw_config); else @@ -256,7 +256,7 @@ sndattach (struct isa_device *dev) int i, unit; static int midi_initialized = 0; static int seq_initialized = 0; - static int generic_midi_initialized = 0; + static int generic_midi_initialized = 0; unsigned long mem_start = 0xefffffffUL; struct address_info hw_config; diff --git a/sys/i386/isa/sound/tuning.h b/sys/i386/isa/sound/tuning.h index 936ff6a..0d1d6bb 100644 --- a/sys/i386/isa/sound/tuning.h +++ b/sys/i386/isa/sound/tuning.h @@ -3,27 +3,27 @@ */ #ifdef SEQUENCER_C -unsigned short semitone_tuning[24] = +unsigned short semitone_tuning[24] = { -/* 0 */ 10000, 10595, 11225, 11892, 12599, 13348, 14142, 14983, -/* 8 */ 15874, 16818, 17818, 18877, 20000, 21189, 22449, 23784, +/* 0 */ 10000, 10595, 11225, 11892, 12599, 13348, 14142, 14983, +/* 8 */ 15874, 16818, 17818, 18877, 20000, 21189, 22449, 23784, /* 16 */ 25198, 26697, 28284, 29966, 31748, 33636, 35636, 37755 }; unsigned short cent_tuning[100] = { -/* 0 */ 10000, 10006, 10012, 10017, 10023, 10029, 10035, 10041, -/* 8 */ 10046, 10052, 10058, 10064, 10070, 10075, 10081, 10087, -/* 16 */ 10093, 10099, 10105, 10110, 10116, 10122, 10128, 10134, -/* 24 */ 10140, 10145, 10151, 10157, 10163, 10169, 10175, 10181, -/* 32 */ 10187, 10192, 10198, 10204, 10210, 10216, 10222, 10228, -/* 40 */ 10234, 10240, 10246, 10251, 10257, 10263, 10269, 10275, -/* 48 */ 10281, 10287, 10293, 10299, 10305, 10311, 10317, 10323, -/* 56 */ 10329, 10335, 10341, 10347, 10353, 10359, 10365, 10371, -/* 64 */ 10377, 10383, 10389, 10395, 10401, 10407, 10413, 10419, -/* 72 */ 10425, 10431, 10437, 10443, 10449, 10455, 10461, 10467, -/* 80 */ 10473, 10479, 10485, 10491, 10497, 10503, 10509, 10515, -/* 88 */ 10521, 10528, 10534, 10540, 10546, 10552, 10558, 10564, +/* 0 */ 10000, 10006, 10012, 10017, 10023, 10029, 10035, 10041, +/* 8 */ 10046, 10052, 10058, 10064, 10070, 10075, 10081, 10087, +/* 16 */ 10093, 10099, 10105, 10110, 10116, 10122, 10128, 10134, +/* 24 */ 10140, 10145, 10151, 10157, 10163, 10169, 10175, 10181, +/* 32 */ 10187, 10192, 10198, 10204, 10210, 10216, 10222, 10228, +/* 40 */ 10234, 10240, 10246, 10251, 10257, 10263, 10269, 10275, +/* 48 */ 10281, 10287, 10293, 10299, 10305, 10311, 10317, 10323, +/* 56 */ 10329, 10335, 10341, 10347, 10353, 10359, 10365, 10371, +/* 64 */ 10377, 10383, 10389, 10395, 10401, 10407, 10413, 10419, +/* 72 */ 10425, 10431, 10437, 10443, 10449, 10455, 10461, 10467, +/* 80 */ 10473, 10479, 10485, 10491, 10497, 10503, 10509, 10515, +/* 88 */ 10521, 10528, 10534, 10540, 10546, 10552, 10558, 10564, /* 96 */ 10570, 10576, 10582, 10589 }; #else diff --git a/sys/i386/isa/sound/ulaw.h b/sys/i386/isa/sound/ulaw.h index be9f92d..f60d5b6 100644 --- a/sys/i386/isa/sound/ulaw.h +++ b/sys/i386/isa/sound/ulaw.h @@ -1,69 +1,69 @@ static unsigned char ulaw_dsp[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, - 5, 9, 13, 17, 21, 25, 29, 33, - 37, 41, 45, 49, 53, 57, 61, 65, - 68, 70, 72, 74, 76, 78, 80, 82, - 84, 86, 88, 90, 92, 94, 96, 98, - 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, - 115, 116, 116, 117, 117, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, - 123, 123, 124, 124, 124, 124, 125, 125, - 125, 125, 126, 126, 126, 126, 127, 127, - 127, 127, 127, 127, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, - 252, 248, 244, 240, 236, 232, 228, 224, - 220, 216, 212, 208, 204, 200, 196, 192, - 189, 187, 185, 183, 181, 179, 177, 175, - 173, 171, 169, 167, 165, 163, 161, 159, - 157, 156, 155, 154, 153, 152, 151, 150, - 149, 148, 147, 146, 145, 144, 143, 142, - 142, 141, 141, 140, 140, 139, 139, 138, - 138, 137, 137, 136, 136, 135, 135, 134, - 134, 134, 133, 133, 133, 133, 132, 132, - 132, 132, 131, 131, 131, 131, 130, 130, - 130, 130, 130, 130, 129, 129, 129, 129, - 129, 129, 129, 129, 128, 128, 128, 128, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2, + 5, 9, 13, 17, 21, 25, 29, 33, + 37, 41, 45, 49, 53, 57, 61, 65, + 68, 70, 72, 74, 76, 78, 80, 82, + 84, 86, 88, 90, 92, 94, 96, 98, + 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, + 115, 116, 116, 117, 117, 118, 118, 119, + 119, 120, 120, 121, 121, 122, 122, 123, + 123, 123, 124, 124, 124, 124, 125, 125, + 125, 125, 126, 126, 126, 126, 127, 127, + 127, 127, 127, 127, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + 252, 248, 244, 240, 236, 232, 228, 224, + 220, 216, 212, 208, 204, 200, 196, 192, + 189, 187, 185, 183, 181, 179, 177, 175, + 173, 171, 169, 167, 165, 163, 161, 159, + 157, 156, 155, 154, 153, 152, 151, 150, + 149, 148, 147, 146, 145, 144, 143, 142, + 142, 141, 141, 140, 140, 139, 139, 138, + 138, 137, 137, 136, 136, 135, 135, 134, + 134, 134, 133, 133, 133, 133, 132, 132, + 132, 132, 131, 131, 131, 131, 130, 130, + 130, 130, 130, 130, 129, 129, 129, 129, + 129, 129, 129, 129, 128, 128, 128, 128, }; static unsigned char dsp_ulaw[] = { - 31, 31, 31, 32, 32, 32, 32, 33, - 33, 33, 33, 34, 34, 34, 34, 35, - 35, 35, 35, 36, 36, 36, 36, 37, - 37, 37, 37, 38, 38, 38, 38, 39, - 39, 39, 39, 40, 40, 40, 40, 41, - 41, 41, 41, 42, 42, 42, 42, 43, - 43, 43, 43, 44, 44, 44, 44, 45, - 45, 45, 45, 46, 46, 46, 46, 47, - 47, 47, 47, 48, 48, 49, 49, 50, - 50, 51, 51, 52, 52, 53, 53, 54, - 54, 55, 55, 56, 56, 57, 57, 58, - 58, 59, 59, 60, 60, 61, 61, 62, - 62, 63, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 81, 83, 85, 87, 89, - 91, 93, 95, 99, 103, 107, 111, 119, - 255, 247, 239, 235, 231, 227, 223, 221, - 219, 217, 215, 213, 211, 209, 207, 206, - 205, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 191, - 190, 190, 189, 189, 188, 188, 187, 187, - 186, 186, 185, 185, 184, 184, 183, 183, - 182, 182, 181, 181, 180, 180, 179, 179, - 178, 178, 177, 177, 176, 176, 175, 175, - 175, 175, 174, 174, 174, 174, 173, 173, - 173, 173, 172, 172, 172, 172, 171, 171, - 171, 171, 170, 170, 170, 170, 169, 169, - 169, 169, 168, 168, 168, 168, 167, 167, - 167, 167, 166, 166, 166, 166, 165, 165, - 165, 165, 164, 164, 164, 164, 163, 163, - 163, 163, 162, 162, 162, 162, 161, 161, - 161, 161, 160, 160, 160, 160, 159, 159, + 31, 31, 31, 32, 32, 32, 32, 33, + 33, 33, 33, 34, 34, 34, 34, 35, + 35, 35, 35, 36, 36, 36, 36, 37, + 37, 37, 37, 38, 38, 38, 38, 39, + 39, 39, 39, 40, 40, 40, 40, 41, + 41, 41, 41, 42, 42, 42, 42, 43, + 43, 43, 43, 44, 44, 44, 44, 45, + 45, 45, 45, 46, 46, 46, 46, 47, + 47, 47, 47, 48, 48, 49, 49, 50, + 50, 51, 51, 52, 52, 53, 53, 54, + 54, 55, 55, 56, 56, 57, 57, 58, + 58, 59, 59, 60, 60, 61, 61, 62, + 62, 63, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 81, 83, 85, 87, 89, + 91, 93, 95, 99, 103, 107, 111, 119, + 255, 247, 239, 235, 231, 227, 223, 221, + 219, 217, 215, 213, 211, 209, 207, 206, + 205, 204, 203, 202, 201, 200, 199, 198, + 197, 196, 195, 194, 193, 192, 191, 191, + 190, 190, 189, 189, 188, 188, 187, 187, + 186, 186, 185, 185, 184, 184, 183, 183, + 182, 182, 181, 181, 180, 180, 179, 179, + 178, 178, 177, 177, 176, 176, 175, 175, + 175, 175, 174, 174, 174, 174, 173, 173, + 173, 173, 172, 172, 172, 172, 171, 171, + 171, 171, 170, 170, 170, 170, 169, 169, + 169, 169, 168, 168, 168, 168, 167, 167, + 167, 167, 166, 166, 166, 166, 165, 165, + 165, 165, 164, 164, 164, 164, 163, 163, + 163, 163, 162, 162, 162, 162, 161, 161, + 161, 161, 160, 160, 160, 160, 159, 159, }; diff --git a/sys/i386/isa/sound/vat_audio.c b/sys/i386/isa/sound/vat_audio.c index 255ed2a..74f0bdd 100644 --- a/sys/i386/isa/sound/vat_audio.c +++ b/sys/i386/isa/sound/vat_audio.c @@ -47,9 +47,9 @@ #define splaudio splclock extern int sndopen (dev_t dev, int flags); -extern int sndclose (dev_t dev, int flags); +extern int sndclose (dev_t dev, int flags); extern int sndioctl (dev_t dev, int cmd, void *arg, int mode); -extern int sndread (int dev, struct uio *uio); +extern int sndread (int dev, struct uio *uio); extern int sndwrite (int dev, struct uio *uio); struct va_softc { @@ -195,7 +195,7 @@ vaopen(dev_t dev, int flags) if (flags & FREAD) /* start the read process */ DMAbuf_start_input(va->rdev>>4); - + return(0); } diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index aef738d..bd19edb 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This is the minimum driver code required to make a spigot work. + * This is the minimum driver code required to make a spigot work. * Unfortunatly, I can't include a real driver since the information * on the spigot is under non-disclosure. You can pick up a library * that will work with this driver from ftp://ftp.cs.uwm.edu/pub/FreeBSD. @@ -73,7 +73,7 @@ struct spigot_softc { } spigot_softc[NSPIGOT]; /* flags in softc */ -#define OPEN 0x01 +#define OPEN 0x01 #define UNIT(dev) minor(dev) @@ -115,7 +115,7 @@ spigot_registerdev(struct isa_device *id) } int -spigot_probe(struct isa_device *devp) +spigot_probe(struct isa_device *devp) { int status; diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c index 170abb8..4c1f128 100644 --- a/sys/i386/isa/spkr.c +++ b/sys/i386/isa/spkr.c @@ -4,7 +4,7 @@ * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> * - * $Id: spkr.c,v 1.12 1995/03/16 18:12:05 bde Exp $ + * $Id: spkr.c,v 1.13 1995/05/05 06:15:11 davidg Exp $ */ #include "speaker.h" @@ -48,14 +48,14 @@ * | SC1 SC0 | RW1 RW0 | M2 M1 M0 | BCD | * +----------+----------+---------------+-----+ * Counter Write Mode 3 Binary - * Channel 2 LSB first, (Square Wave) Encoding + * Channel 2 LSB first, (Square Wave) Encoding * MSB second */ #define PPI_SPKR 0x03 /* turn these PPI bits on to pass sound */ #define PIT_MODE 0xB6 /* set timer mode for sound generation */ /* - * Magic numbers for timer control. + * Magic numbers for timer control. */ #define TIMER_CLK 1193180L /* corresponds to 18.2 MHz tick rate */ diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index 123e2a9..19c572a 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.115 1995/04/28 09:10:56 sos Exp $ + * $Id: syscons.c,v 1.116 1995/05/21 18:30:05 sos Exp $ */ #include "sc.h" @@ -65,7 +65,7 @@ #endif /* this may break on older VGA's but is usefull on real 32 bit systems */ -#define bcopyw bcopy +#define bcopyw bcopy static default_attr user_default = { (FG_LIGHTGREY | BG_BLACK) << 8, @@ -81,7 +81,7 @@ static scr_stat main_console; static scr_stat *console[MAXCONS]; scr_stat *cur_console; static scr_stat *new_scp, *old_scp; -static term_stat kernel_console; +static term_stat kernel_console; static default_attr *current_default; static char init_done = FALSE; static int configuration = 0; @@ -107,7 +107,7 @@ static char *video_mode_ptr = NULL; static u_char kbd_reply = 0; #endif -static u_short mouse_and_mask[16] = { +static u_short mouse_and_mask[16] = { 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 }; @@ -168,7 +168,7 @@ scprobe(struct isa_device *dev) DELAY(10); val = inb(KB_DATA); if (val == KB_ACK || val == KB_ECHO) - goto gotres; + goto gotres; if (val == KB_RESEND) break; } @@ -184,7 +184,7 @@ gotack: val = inb(KB_DATA); if (val == KB_ACK) goto gotack; - if (val != KB_RESET_DONE) + if (val != KB_RESET_DONE) printf("scprobe: keyboard RESET failed %02x\n", val); } #ifdef XT_KEYBOARD @@ -218,8 +218,8 @@ sc_registerdev(struct isa_device *id) dev_attach(&kdc_sc[id->id_unit]); } -#if NAPM > 0 -static int +#if NAPM > 0 +static int scresume(void *dummy) { shfts = 0; @@ -265,7 +265,7 @@ scattach(struct isa_device *dev) bzero(scp->history_head, scp->history_size*sizeof(u_short)); /* initialize cursor stuff */ - draw_cursor(scp, TRUE); + draw_cursor(scp, TRUE); if (crtc_vga && (configuration & CHAR_CURSOR)) set_destructive_cursor(scp, TRUE); @@ -279,12 +279,12 @@ scattach(struct isa_device *dev) if (crtc_vga) if (crtc_addr == MONO_BASE) printf("VGA mono"); - else + else printf("VGA color"); else if (crtc_addr == MONO_BASE) printf("MDA/hercules"); - else + else printf("CGA/EGA"); printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, configuration); @@ -298,7 +298,7 @@ scattach(struct isa_device *dev) return 0; } -struct tty +struct tty *scdevtotty(dev_t dev) { int unit = minor(dev); @@ -310,7 +310,7 @@ struct tty return VIRTUAL_TTY(unit); } -static scr_stat +static scr_stat *get_scr_stat(dev_t dev) { int unit = minor(dev); @@ -332,7 +332,7 @@ get_scr_num() return i < MAXCONS ? i : 0; } -int +int scopen(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -352,8 +352,8 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; scparam(tp, &tp->t_termios); ttsetwater(tp); - } - else + } + else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) return(EBUSY); tp->t_state |= TS_CARR_ON; @@ -363,7 +363,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) return((*linesw[tp->t_line].l_open)(dev, tp)); } -int +int scclose(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -382,8 +382,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) scp->smode.mode = VT_AUTO; } else { - free(scp->scr_buf, M_DEVBUF); - free(scp->history, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); + free(scp->history, M_DEVBUF); free(scp, M_DEVBUF); console[minor(dev)] = NULL; } @@ -394,11 +394,11 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) #endif } (*linesw[tp->t_line].l_close)(tp, flag); - ttyclose(tp); + ttyclose(tp); return(0); } -int +int scread(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -408,7 +408,7 @@ scread(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_read)(tp, uio, flag)); } -int +int scwrite(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -418,7 +418,7 @@ scwrite(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_write)(tp, uio, flag)); } -void +void scintr(int unit) { static struct tty *cur_tty; @@ -461,10 +461,10 @@ scintr(int unit) (*linesw[cur_tty->t_line].l_rint)('[', cur_tty); (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty); break; - } + } } -int +int scparam(struct tty *tp, struct termios *t) { tp->t_ispeed = t->c_ispeed; @@ -473,13 +473,13 @@ scparam(struct tty *tp, struct termios *t) return 0; } -int +int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { int i, error; struct tty *tp; struct trapframe *fp; - scr_stat *scp; + scr_stat *scp; tp = scdevtotty(dev); if (!tp) @@ -498,14 +498,14 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) else *(int*)data = 0; return 0; - + case CONS_CURRENT: /* get current adapter type */ if (crtc_vga) *(int*)data = KD_VGA; else if (crtc_addr == MONO_BASE) *(int*)data = KD_MONO; - else + else *(int*)data = KD_CGA; return 0; @@ -538,7 +538,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case CONS_HISTORY: /* set history size */ if (*data) { - free(scp->history, M_DEVBUF); + free(scp->history, M_DEVBUF); scp->history_size = *(int*)data; if (scp->history_size < scp->ysize) scp->history = NULL; @@ -604,7 +604,7 @@ set_mouse_pos: scp->mouse_xpos = (scp->xsize*8)-1; if (scp->mouse_ypos >= scp->ysize*fontsize) scp->mouse_ypos = (scp->ysize*fontsize)-1; - scp->mouse_pos = scp->scr_buf + + scp->mouse_pos = scp->scr_buf + (scp->mouse_ypos/fontsize)*scp->xsize + scp->mouse_xpos/8; if (scp->status & MOUSE_ENABLED) scp->status |= UPDATE_MOUSE; @@ -664,7 +664,7 @@ set_mouse_pos: case SW_VGA_C80x60: case SW_VGA_M80x60: case SW_B40x25: case SW_C40x25: case SW_B80x25: case SW_C80x25: - case SW_ENH_B40x25: case SW_ENH_C40x25: + case SW_ENH_B40x25: case SW_ENH_C40x25: case SW_ENH_B80x25: case SW_ENH_C80x25: case SW_ENH_B80x43: case SW_ENH_C80x43: @@ -696,26 +696,26 @@ set_mouse_pos: default: if ((cmd & 0xff) > M_VGA_CG320) return EINVAL; - else + else scp->xsize = *(video_mode_ptr+((cmd&0xff)*64)); scp->ysize = *(video_mode_ptr+((cmd&0xff)*64)+1)+1; break; } scp->mode = cmd & 0xff; scp->status &= ~UNKNOWN_MODE; /* text mode */ - free(scp->scr_buf, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short), M_DEVBUF, M_NOWAIT); if (scp == cur_console) set_mode(scp); clear_screen(scp); - if (tp->t_winsize.ws_col != scp->xsize + if (tp->t_winsize.ws_col != scp->xsize || tp->t_winsize.ws_row != scp->ysize) { tp->t_winsize.ws_col = scp->xsize; tp->t_winsize.ws_row = scp->ysize; pgsignal(tp->t_pgrp, SIGWINCH, 1); } - return 0; + return 0; /* GRAPHICS MODES */ case SW_BG320: case SW_BG640: @@ -733,7 +733,7 @@ set_mouse_pos: set_mode(scp); /* clear_graphics();*/ - if (tp->t_winsize.ws_xpixel != scp->xsize + if (tp->t_winsize.ws_xpixel != scp->xsize || tp->t_winsize.ws_ypixel != scp->ysize) { tp->t_winsize.ws_xpixel = scp->xsize; tp->t_winsize.ws_ypixel = scp->ysize; @@ -748,11 +748,11 @@ set_mouse_pos: scp->pid = scp->proc->p_pid; } return 0; - + case VT_GETMODE: /* get screen switcher mode */ bcopy(&scp->smode, data, sizeof(struct vt_mode)); return 0; - + case VT_RELDISP: /* screen switcher ioctl */ switch(*data) { case VT_FALSE: /* user refuses to release screen, abort */ @@ -771,7 +771,7 @@ set_mouse_pos: new_scp->status |= SWITCH_WAIT_ACQ; psignal(new_scp->proc, new_scp->smode.acqsig); } - else + else switch_in_progress = FALSE; return 0; } @@ -797,24 +797,24 @@ set_mouse_pos: *data = i + 1; return 0; } - } + } return EINVAL; case VT_ACTIVATE: /* switch to screen *data */ return switch_scr(scp, (*data) - 1); case VT_WAITACTIVE: /* wait for switch to occur */ - if (*data > MAXCONS || *data < 0) + if (*data > MAXCONS || *data < 0) return EINVAL; - if (minor(dev) == (*data) - 1) + if (minor(dev) == (*data) - 1) return 0; if (*data == 0) { if (scp == cur_console) return 0; } - else + else scp = console[(*data) - 1]; - while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, + while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, "waitvt", 0)) == ERESTART) ; return error; @@ -825,7 +825,7 @@ set_mouse_pos: case KDENABIO: /* allow io operations */ fp = (struct trapframe *)p->p_md.md_regs; fp->tf_eflags |= PSL_IOPL; - return 0; + return 0; case KDDISABIO: /* disallow io operations (default) */ fp = (struct trapframe *)p->p_md.md_regs; @@ -873,7 +873,7 @@ set_mouse_pos: if (!crtc_vga) return ENXIO; scp->border = *data; - if (scp == cur_console) + if (scp == cur_console) set_border(scp->border); return 0; @@ -881,7 +881,7 @@ set_mouse_pos: if (*data >= 0 && *data <= LOCK_KEY_MASK) { scp->status &= ~LOCK_KEY_MASK; scp->status |= *data; - if (scp == cur_console) + if (scp == cur_console) update_leds(scp->status); return 0; } @@ -984,7 +984,7 @@ set_mouse_pos: case SETFKEY: /* set functionkey string */ if (*(u_short*)data < n_fkey_tab) { fkeyarg_t *ptr = (fkeyarg_t*)data; - bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, + bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, min(ptr->flen, MAXFK)); fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK); return 0; @@ -1069,8 +1069,8 @@ set_mouse_pos: return ENXIO; default: break; - } - + } + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); if (error >= 0) return(error); @@ -1080,7 +1080,7 @@ set_mouse_pos: return(ENOTTY); } -void +void scxint(dev_t dev) { struct tty *tp = scdevtotty(dev); @@ -1094,7 +1094,7 @@ scxint(dev_t dev) scstart(tp); } -void +void scstart(struct tty *tp) { struct clist *rbp; @@ -1126,7 +1126,7 @@ scstart(struct tty *tp) splx(s); } -void +void pccnprobe(struct consdev *cp) { int maj; @@ -1141,13 +1141,13 @@ pccnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; } -void +void pccninit(struct consdev *cp) { scinit(); } -void +void pccnputc(dev_t dev, int c) { u_char buf[1]; @@ -1169,7 +1169,7 @@ pccnputc(dev_t dev, int c) scp->term = save; if (scp == cur_console /* && scrn_timer not running */) { if (scp->scr_buf != Crtat && (scp->start <= scp->end)) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->start = scp->xsize * scp->ysize; scp->end = 0; @@ -1179,7 +1179,7 @@ pccnputc(dev_t dev, int c) } } -int +int pccngetc(dev_t dev) { int s = spltty(); /* block scintr while we poll */ @@ -1188,13 +1188,13 @@ pccngetc(dev_t dev) return(c); } -int +int pccncheckc(dev_t dev) { return (scgetc(1) & 0xff); } -static void +static void scrn_timer() { static int cursor_blinkrate; @@ -1205,11 +1205,11 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/10); return; } - + if (!scrn_blanked) { /* update screen image */ if (scp->start <= scp->end) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->status &= ~CURSOR_SHOWN; scp->start = scp->xsize * scp->ysize; @@ -1229,7 +1229,7 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/25); } -static void +static void clear_screen(scr_stat *scp) { move_crsr(scp, 0, 0); @@ -1238,14 +1238,14 @@ clear_screen(scr_stat *scp) mark_all(scp); } -static int +static int switch_scr(scr_stat *scp, u_int next_scr) { if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid))) switch_in_progress = FALSE; - if (next_scr >= MAXCONS || switch_in_progress || - (cur_console->smode.mode == VT_AUTO + if (next_scr >= MAXCONS || switch_in_progress || + (cur_console->smode.mode == VT_AUTO && cur_console->status & UNKNOWN_MODE)) { do_bell(scp, BELL_PITCH, BELL_DURATION); return EINVAL; @@ -1273,7 +1273,7 @@ switch_scr(scr_stat *scp, u_int next_scr) delayed_next_scr = FALSE; return 0; } - + /* has controlling process died? */ if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid))) old_scp->smode.mode = VT_AUTO; @@ -1297,8 +1297,8 @@ switch_scr(scr_stat *scp, u_int next_scr) return 0; } -static void -exchange_scr(void) +static void +exchange_scr(void) { move_crsr(old_scp, old_scp->xpos, old_scp->ypos); cur_console = new_scp; @@ -1327,7 +1327,7 @@ exchange_scr(void) new_scp->status &= ~CURSOR_SHOWN; } -static inline void +static inline void move_crsr(scr_stat *scp, int x, int y) { if (x < 0 || y < 0 || x >= scp->xsize || y >= scp->ysize) @@ -1339,10 +1339,10 @@ move_crsr(scr_stat *scp, int x, int y) mark_for_update(scp, scp->cursor_pos - scp->scr_buf); } -static void +static void scan_esc(scr_stat *scp, u_char c) { - static u_char ansi_col[16] = + static u_char ansi_col[16] = {0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15}; int i, n; u_short *src, *dst, count; @@ -1364,7 +1364,7 @@ scan_esc(scr_stat *scp, u_char c) else { bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize, (scp->ysize - 1) * scp->xsize * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize); mark_all(scp); } @@ -1440,7 +1440,7 @@ scan_esc(scr_stat *scp, u_char c) case 'f': /* Cursor move */ case 'H': - if (scp->term.num_param == 0) + if (scp->term.num_param == 0) move_crsr(scp, 0, 0); else if (scp->term.num_param == 2) move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1); @@ -1454,14 +1454,14 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of display */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->xsize * scp->ysize); break; case 1: /* clear from beginning of display to cursor */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf, + scp->scr_buf, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, 0); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); @@ -1480,21 +1480,21 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of line */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->xsize - scp->xpos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + scp->xsize - scp->xpos); break; case 1: /* clear from beginning of line to cursor */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), (scp->xsize - scp->xpos) + 1); mark_for_update(scp, scp->ypos * scp->xsize); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); break; case 2: /* clear entire line */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), scp->xsize); mark_for_update(scp, scp->ypos * scp->xsize); @@ -1563,11 +1563,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf + (scp->xsize * n), - scp->scr_buf, + bcopyw(scp->scr_buf + (scp->xsize * n), + scp->scr_buf, scp->xsize * (scp->ysize - n) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - n), + scp->scr_buf + scp->xsize * (scp->ysize - n), scp->xsize * n); mark_all(scp); break; @@ -1576,11 +1576,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf, + bcopyw(scp->scr_buf, scp->scr_buf + (scp->xsize * n), - scp->xsize * (scp->ysize - n) * + scp->xsize * (scp->ysize - n) * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize * n); mark_all(scp); break; @@ -1589,8 +1589,8 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->xsize - scp->xpos) n = scp->xsize - scp->xpos; - fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xpos + + fillw(scp->term.cur_attr | scr_map[0x20], + scp->scr_buf + scp->xpos + ((scp->xsize*scp->ypos) * sizeof(u_short)), n); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n); @@ -1600,9 +1600,9 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if ((i = scp->xpos & 0xf8) == scp->xpos) i -= 8*n; - else - i -= 8*(n-1); - if (i < 0) + else + i -= 8*(n-1); + if (i < 0) i = 0; move_crsr(scp, i, scp->ypos); break; @@ -1653,15 +1653,15 @@ scan_esc(scr_stat *scp, u_char c) scp->term.cur_attr = scp->term.rev_attr; break; case 30: case 31: /* set fg color */ - case 32: case 33: case 34: + case 32: case 33: case 34: case 35: case 36: case 37: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0xF8FF) | (ansi_col[(n-30)&7]<<8); break; case 40: case 41: /* set bg color */ - case 42: case 43: case 44: + case 42: case 43: case 44: case 45: case 46: case 47: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0x8FFF) | (ansi_col[(n-40)&7]<<12); break; } @@ -1680,12 +1680,12 @@ scan_esc(scr_stat *scp, u_char c) scp->term.rev_attr = current_default->rev_attr; break; case 1: /* set ansi background */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 2: /* set ansi foreground */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1694,12 +1694,12 @@ scan_esc(scr_stat *scp, u_char c) (scp->term.param[1]&0xFF)<<8; break; case 5: /* set ansi reverse video background */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 6: /* set ansi reverse video foreground */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1764,38 +1764,38 @@ scan_esc(scr_stat *scp, u_char c) configuration &= ~CHAR_CURSOR; } else if (scp->term.num_param == 2) { - scp->cursor_start = scp->term.param[0] & 0x1F; - scp->cursor_end = scp->term.param[1] & 0x1F; + scp->cursor_start = scp->term.param[0] & 0x1F; + scp->cursor_end = scp->term.param[1] & 0x1F; if (configuration & CHAR_CURSOR) set_destructive_cursor(scp, TRUE); } break; case 'F': /* set ansi foreground */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'G': /* set ansi background */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; case 'H': /* set ansi reverse video foreground */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'I': /* set ansi reverse video background */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; } @@ -1803,7 +1803,7 @@ scan_esc(scr_stat *scp, u_char c) scp->term.esc = 0; } -static inline void +static inline void draw_cursor(scr_stat *scp, int show) { if (show && !(scp->status & CURSOR_SHOWN)) { @@ -1836,12 +1836,12 @@ draw_cursor(scr_stat *scp, int show) } } -static void +static void ansi_put(scr_stat *scp, u_char *buf, int len) { u_char *ptr = buf; - if (scp->status & UNKNOWN_MODE) + if (scp->status & UNKNOWN_MODE) return; /* make screensaver happy */ @@ -1945,7 +1945,7 @@ outloop: bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf, scp->xsize * (scp->ysize - 1) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - 1), + scp->scr_buf + scp->xsize * (scp->ysize - 1), scp->xsize); scp->cursor_pos -= scp->xsize; scp->ypos--; @@ -1958,14 +1958,14 @@ outloop: switch_scr(scp, delayed_next_scr - 1); } -static void +static void scinit(void) { u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/sizeof(u_short), was; unsigned hw_cursor; int i; - if (init_done) + if (init_done) return; init_done = TRUE; /* @@ -2033,7 +2033,7 @@ scinit(void) scr_map[i] = i; } -static scr_stat +static scr_stat *alloc_scp() { scr_stat *scp; @@ -2081,7 +2081,7 @@ init_scp(scr_stat *scp) scp->history_size = HISTORY_SIZE; } -static u_char +static u_char *get_fstr(u_int c, u_int *len) { u_int i; @@ -2095,7 +2095,7 @@ static u_char return(fkey_tab[i].str); } -static void +static void update_leds(int which) { int s; @@ -2113,14 +2113,14 @@ update_leds(int which) kbd_cmd(xlate_leds[which & LED_MASK]); splx(s); } - + static void history_to_screen(scr_stat *scp) { int i; for (i=0; i<scp->ysize; i++) - bcopyw(scp->history + (((scp->history_pos - scp->history) + + bcopyw(scp->history + (((scp->history_pos - scp->history) + scp->history_size-((i+1)*scp->xsize))%scp->history_size), scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)), scp->xsize * sizeof(u_short)); @@ -2153,11 +2153,11 @@ history_down_line(scr_stat *scp) } /* - * scgetc(noblock) - get character from keyboard. + * scgetc(noblock) - get character from keyboard. * If noblock = 0 wait until a key is pressed. * Else return NOKEY. */ -u_int +u_int scgetc(int noblock) { u_char scancode, keycode; @@ -2192,9 +2192,9 @@ next_code: switch(scancode) { case 0xB8: /* left alt (compose key) */ if (compose) { - compose = 0; + compose = 0; if (chr > 255) { - do_bell(cur_console, + do_bell(cur_console, BELL_PITCH, BELL_DURATION); chr = 0; } @@ -2209,7 +2209,7 @@ next_code: case 0xE0: case 0xE1: esc_flag = scancode; - goto next_code; + goto next_code; } break; case 0xE0: /* 0xE0 prefix */ @@ -2276,13 +2276,13 @@ next_code: } break; case 0xE1: /* 0xE1 prefix */ - esc_flag = 0; + esc_flag = 0; if (keycode == 0x1D) esc_flag = 0x1D; goto next_code; /* NOT REACHED */ case 0x1D: /* pause / break */ - esc_flag = 0; + esc_flag = 0; if (keycode != 0x45) goto next_code; keycode = 0x68; @@ -2300,7 +2300,7 @@ next_code: /* copy screen into top of history buffer */ for (i=0; i<cur_console->ysize; i++) { - bcopyw(cur_console->scr_buf + (cur_console->xsize * i), + bcopyw(cur_console->scr_buf + (cur_console->xsize * i), cur_console->history_head, cur_console->xsize * sizeof(u_short)); cur_console->history_head += cur_console->xsize; @@ -2319,7 +2319,7 @@ next_code: case 0x4F: /* end key */ cur_console->history_pos = - WRAPHIST(cur_console, cur_console->history_head, + WRAPHIST(cur_console, cur_console->history_head, cur_console->xsize*cur_console->ysize); history_to_screen(cur_console); goto next_code; @@ -2358,10 +2358,10 @@ next_code: case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */ chr = (scancode - 0x40) + chr*10; goto next_code; - case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ + case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ chr = (scancode - 0x47) + chr*10; goto next_code; - case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ + case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ chr = (scancode - 0x4E) + chr*10; goto next_code; case 0x52: /* keypad 0 */ @@ -2370,8 +2370,8 @@ next_code: /* key release, no interest here */ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */ - case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ - case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ + case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ + case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ case 0xD2: /* keypad 0 */ goto next_code; @@ -2381,12 +2381,12 @@ next_code: if (chr) { compose = chr = 0; do_bell(cur_console, BELL_PITCH, BELL_DURATION); - goto next_code; + goto next_code; } break; } } - + state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0)); if ((!agrs && (cur_console->status & ALKED)) || (agrs && !(cur_console->status & ALKED))) @@ -2420,7 +2420,7 @@ next_code: alts &= ~2; break; case NLK: - nlkcnt = 0; + nlkcnt = 0; break; case CLK: clkcnt = 0; @@ -2452,7 +2452,7 @@ next_code: case NLK: if (!nlkcnt) { nlkcnt++; - if (cur_console->status & NLKED) + if (cur_console->status & NLKED) cur_console->status &= ~NLKED; else cur_console->status |= NLKED; @@ -2479,7 +2479,7 @@ next_code: u_short *ptr = cur_console->history_save; for (i=0; i<cur_console->ysize; i++) { - bcopyw(ptr, + bcopyw(ptr, cur_console->scr_buf + (cur_console->xsize*i), cur_console->xsize * sizeof(u_short)); @@ -2495,8 +2495,8 @@ next_code: mark_all(cur_console); } scstart(VIRTUAL_TTY(get_scr_num())); - } - else + } + else cur_console->status |= SLKED; update_leds(cur_console->status); } @@ -2517,9 +2517,9 @@ next_code: break; case RBT: shutdown_nice(); - break; + break; case SUSP: -#if NAPM > 0 +#if NAPM > 0 apm_suspend(); #endif break; @@ -2528,7 +2528,7 @@ next_code: #ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0]->smode.mode == VT_AUTO) - switch_scr(cur_console, 0); + switch_scr(cur_console, 0); Debugger("manual escape to debugger"); return(NOKEY); #else @@ -2569,7 +2569,7 @@ next_code: switch_scr(cur_console, action - F_SCR); break; } - if (action >= F_FN && action <= L_FN) + if (action >= F_FN && action <= L_FN) action |= FKEY; return(action); } @@ -2583,7 +2583,7 @@ next_code: goto next_code; } -int +int scmmap(dev_t dev, int offset, int nprot) { if (offset > 0x20000 - PAGE_SIZE) @@ -2591,19 +2591,19 @@ scmmap(dev_t dev, int offset, int nprot) return i386_btop((VIDEOMEM + offset)); } -static void +static void kbd_wait(void) { int i = 1000; while (i--) { - if ((inb(KB_STAT) & KB_READY) == 0) + if ((inb(KB_STAT) & KB_READY) == 0) break; DELAY (10); } } -static void +static void kbd_cmd(u_char command) { int retry = 5; @@ -2637,7 +2637,7 @@ kbd_cmd(u_char command) } while (retry--); } -static void +static void set_mode(scr_stat *scp) { char *modetable; @@ -2649,11 +2649,11 @@ set_mode(scr_stat *scp) /* setup video hardware for the given mode */ switch (scp->mode) { - case M_VGA_M80x60: + case M_VGA_M80x60: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x60; - case M_VGA_C80x60: + case M_VGA_C80x60: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); special_80x60: special_modetable[2] = 0x08; @@ -2673,7 +2673,7 @@ special_480l: special_modetable[16] = 0x08; special_modetable[17] = 0x3e; special_modetable[26] = 0xea; - special_modetable[28] = 0xdf; + special_modetable[28] = 0xdf; special_modetable[31] = 0xe7; special_modetable[32] = 0x04; modetable = special_modetable; @@ -2685,17 +2685,17 @@ special_480l: case M_ENH_C80x43: bcopyw(video_mode_ptr+(64*M_ENH_C80x25),&special_modetable, 64); -special_80x43: +special_80x43: special_modetable[28] = 87; goto special_80x50; - case M_VGA_M80x50: + case M_VGA_M80x50: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x50; case M_VGA_C80x50: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); -special_80x50: +special_80x50: special_modetable[2] = 8; special_modetable[19] = 7; modetable = special_modetable; @@ -2737,7 +2737,7 @@ setup_mode: case M_CG320_D: case M_CG640_E: case M_CG640x350: case M_ENH_CG640: case M_BG640x480: case M_CG640x480: case M_VGA_CG320: - + set_vgaregs(video_mode_ptr + (scp->mode * 64)); break; @@ -2751,11 +2751,11 @@ setup_mode: return; } -void +void set_border(int color) { inb(crtc_addr+6); /* reset flip-flop */ - outb(ATC, 0x11); outb(ATC, color); + outb(ATC, 0x11); outb(ATC, color); inb(crtc_addr+6); /* reset flip-flop */ outb(ATC, 0x20); /* enable Palette */ } @@ -2768,7 +2768,7 @@ set_vgaregs(char *modetable) outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ outb(TSIDX, 0x07); outb(TSREG, 0x00); /* unlock registers */ for (i=0; i<4; i++) { /* program sequencer */ - outb(TSIDX, i+1); + outb(TSIDX, i+1); outb(TSREG, modetable[i+5]); } outb(MISC, modetable[9]); /* set dot-clock */ @@ -2776,7 +2776,7 @@ set_vgaregs(char *modetable) outb(crtc_addr, 0x11); outb(crtc_addr+1, inb(crtc_addr+1) & 0x7F); for (i=0; i<25; i++) { /* program crtc */ - outb(crtc_addr, i); + outb(crtc_addr, i); if (i == 14 || i == 15) /* no hardware cursor */ outb(crtc_addr+1, 0xff); else @@ -2784,11 +2784,11 @@ set_vgaregs(char *modetable) } inb(crtc_addr+6); /* reset flip-flop */ for (i=0; i<20; i++) { /* program attribute ctrl */ - outb(ATC, i); + outb(ATC, i); outb(ATC, modetable[i+35]); } for (i=0; i<9; i++) { /* program graph data ctrl */ - outb(GDCIDX, i); + outb(GDCIDX, i); outb(GDCREG, modetable[i+55]); } inb(crtc_addr+6); /* reset flip-flop */ @@ -2807,7 +2807,7 @@ set_font_mode() outb(TSIDX, 0x04); outb(TSREG, 0x06); outb(GDCIDX, 0x04); outb(GDCREG, 0x02); outb(GDCIDX, 0x05); outb(GDCREG, 0x00); - outb(GDCIDX, 0x06); outb(GDCREG, 0x05); + outb(GDCIDX, 0x06); outb(GDCREG, 0x05); #else outw(TSIDX, 0x0402); outw(TSIDX, 0x0604); @@ -2849,7 +2849,7 @@ set_normal_mode() splx(s); } -static void +static void copy_font(int operation, int font_type, char* font_image) { int ch, line, segment, fontsize; @@ -2873,11 +2873,11 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */ outb(TSIDX, 0x01); outb(TSREG, val | 0x20); set_font_mode(); - for (ch=0; ch < 256; ch++) - for (line=0; line < fontsize; line++) + for (ch=0; ch < 256; ch++) + for (line=0; line < fontsize; line++) if (operation) *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line) = - font_image[(ch*fontsize)+line]; + font_image[(ch*fontsize)+line]; else font_image[(ch*fontsize)+line] = *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line); @@ -2885,7 +2885,7 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); /* enable screen */ } -static void +static void set_destructive_cursor(scr_stat *scp, int force) { u_char cursor[32]; @@ -2918,7 +2918,7 @@ set_destructive_cursor(scr_stat *scp, int force) bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * font_size), cursor, font_size); for (i=0; i<32; i++) - if ((i >= scp->cursor_start && i <= scp->cursor_end) || + if ((i >= scp->cursor_start && i <= scp->cursor_end) || (scp->cursor_start >= font_size && i == font_size - 1)) cursor[i] |= 0xff; while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ; @@ -3018,25 +3018,25 @@ draw_mouse_image(scr_stat *scp) set_normal_mode(); } -static void +static void save_palette(void) { int i; - outb(PALRADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALRADR, 0x00); + for (i=0x00; i<0x300; i++) palette[i] = inb(PALDATA); inb(crtc_addr+6); /* reset flip/flop */ } -void +void load_palette(void) { int i; outb(PIXMASK, 0xFF); /* no pixelmask */ - outb(PALWADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALWADR, 0x00); + for (i=0x00; i<0x300; i++) outb(PALDATA, palette[i]); inb(crtc_addr+6); /* reset flip/flop */ outb(ATC, 0x20); /* enable palette */ @@ -3052,7 +3052,7 @@ do_bell(scr_stat *scp, int pitch, int duration) blink_in_progress = 4; blink_screen(scp); timeout((timeout_func_t)blink_screen, scp, hz/10); - } + } else sysbeep(pitch, duration); } diff --git a/sys/i386/isa/syscons.h b/sys/i386/isa/syscons.h index 649b653..4b22de6 100644 --- a/sys/i386/isa/syscons.h +++ b/sys/i386/isa/syscons.h @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $ + * $Id: syscons.h,v 1.8 1995/04/23 10:15:38 bde Exp $ */ #ifndef SYSCONS_H diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c index 98dfb76..ef9f616 100644 --- a/sys/i386/isa/tw.c +++ b/sys/i386/isa/tw.c @@ -98,7 +98,7 @@ * the unit worked). I suggest saving money and buying the bare TW523 * rather than the TW523 development kit (what I bought), because if you * are running FreeBSD you don't really care about the DOS binaries. - * + * * The interface to the TW-523 consists of four wires on the RJ-11 connector, * which are jumpered to somewhat more wires on the DB-25 connector, which * in turn is intended to plug into the PC parallel printer port. I dismantled @@ -355,7 +355,7 @@ int twopen(dev, flag, mode, p) struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; int s; int port; - + s = spltty(); if(sc->sc_state == 0) { sc->sc_state = TWS_OPEN; @@ -663,7 +663,7 @@ int h, k, cnt; * which is more than the 11 cycles it takes to transmit a full * X-10 packet. */ - + static int wait_for_zero(sc) struct tw_sc *sc; { @@ -929,7 +929,7 @@ int unit; sc->sc_state &= ~TWS_RCVING; twputpkt(sc, pkt); untimeout((timeout_func_t)twabortrcv, (caddr_t)sc); - if(sc->sc_flags & TW_RCV_ERROR) + if(sc->sc_flags & TW_RCV_ERROR) log(LOG_ERR, "TWRCV: invalid packet: (%d, %x)\n", sc->sc_rcount, sc->sc_bits); wakeup((caddr_t)sc); diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c index 4024a05..f7184c1 100644 --- a/sys/i386/isa/ultra14f.c +++ b/sys/i386/isa/ultra14f.c @@ -22,7 +22,7 @@ * today: Fri Jun 2 17:21:03 EST 1994 * added 24F support ++sg * - * $Id: ultra14f.c,v 1.31 1995/05/07 06:54:01 bde Exp $ + * $Id: ultra14f.c,v 1.32 1995/05/11 19:26:21 rgrimes Exp $ */ #include <sys/types.h> @@ -173,7 +173,7 @@ struct uha_bits #define U24_ABORT_ACK 0x18 /* same */ #define U24_ICM_ACK 0x02 /* 24F acknowledge ICM and clear */ -/* +/* * UHA_CONF1 bits (read only) */ @@ -373,7 +373,7 @@ uha_send_mbox(int unit, struct mscp *mscp) printf("uha%d: uha_send_mbox, board not responding\n", unit); Debugger("ultra14f"); } - outl(ur->ogmptr, KVTOPHYS(mscp)); + outl(ur->ogmptr, KVTOPHYS(mscp)); if (uha->flags & UHA_24F) outb(ur->ogmcmd, 1); outb(ur->lint, ub->ogmint); splx(s); @@ -565,7 +565,7 @@ uha_attach(dev) * Return some information to the caller about * the adapter and it's capabilities */ -u_int32 +u_int32 uha_adapter_info(unit) int unit; { @@ -925,7 +925,7 @@ uha_init(unit) uha->flags |= UHA_INIT; return (0); } - + /* * Initialize an Ultrastor 24F @@ -975,7 +975,7 @@ int unit; ub->icm_ack = U24_ICM_ACK; /* - * Make sure an EISA card is installed in this slot, + * Make sure an EISA card is installed in this slot, * and if it is make sure that the card is enabled. */ outb(ur->id, 0xff); @@ -1060,7 +1060,7 @@ uhaminphys(bp) * start a scsi operation given the command and the data address. Also * needs the unit, target and lu. */ -int32 +int32 uha_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -1208,8 +1208,8 @@ uha_scsi_cmd(xs) nextphys = thisphys; while ((datalen) && (thisphys == nextphys)) /* - * This page is contiguous (physically) with - * the the last, just extend the length + * This page is contiguous (physically) with + * the the last, just extend the length */ { /* how far to the end of the page */ diff --git a/sys/i386/isa/wd7000.c b/sys/i386/isa/wd7000.c index c112539..0166120 100644 --- a/sys/i386/isa/wd7000.c +++ b/sys/i386/isa/wd7000.c @@ -92,7 +92,7 @@ struct scsi_device wds_dev = { 0, 0 } }; -/* +/* XXX THIS SHOULD BE FIXED! I haven't got the KERNBASE-version to work, but on my system the kernel is at virtual address 0xFxxxxxxx, responding to physical address @@ -235,7 +235,7 @@ int wds_init(struct isa_device *); int wds_cmd(int, u_char *, int); void wds_wait(int, int, int); -struct isa_driver wdsdriver = +struct isa_driver wdsdriver = { wdsprobe, wdsattach, @@ -291,13 +291,13 @@ wdsr_alloc(int unit) r = NULL; x = splbio(); for(i=0; i<MAXSIMUL; i++) - if(!wds[unit].wdsr[i].busy) + if(!wds[unit].wdsr[i].busy) { r = &wds[unit].wdsr[i]; r->busy = 1; break; } - if(!r) + if(!r) { splx(x); return NULL; @@ -305,13 +305,13 @@ wdsr_alloc(int unit) r->ombn = -1; for(i=0; i<WDS_NOMB; i++) - if(!wds[unit].ombs[i].stat) + if(!wds[unit].ombs[i].stat) { wds[unit].ombs[i].stat = 1; r->ombn = i; break; } - if(r->ombn == -1 ) + if(r->ombn == -1 ) { r->busy = 0; splx(x); @@ -332,14 +332,14 @@ wds_scsi_cmd(struct scsi_xfer *sxp) base = wds[unit].addr; - if( sxp->flags & SCSI_RESET) + if( sxp->flags & SCSI_RESET) { printf("reset!\n"); return COMPLETE; } r = wdsr_alloc(unit); - if(r==NULL) + if(r==NULL) { printf("no request slot available!\n"); sxp->error = XS_DRIVER_STUFFUP; @@ -348,7 +348,7 @@ wds_scsi_cmd(struct scsi_xfer *sxp) r->done = 0; r->sxp = sxp; - if(sxp->flags & SCSI_DATA_UIO) + if(sxp->flags & SCSI_DATA_UIO) { printf("UIO!\n"); sxp->error = XS_DRIVER_STUFFUP; @@ -388,7 +388,7 @@ wds_scsi_cmd(struct scsi_xfer *sxp) scsi_uto3b(sizeof(sxp->sense), r->sense.len); r->sense.write = 0x80; - if(sxp->flags & SCSI_NOMASK) + if(sxp->flags & SCSI_NOMASK) { outb(base+WDS_HCR, WDSH_DRQEN); r->polled = 1; @@ -400,25 +400,25 @@ wds_scsi_cmd(struct scsi_xfer *sxp) c = WDSC_MSTART(r->ombn); - if( wds_cmd(base, &c, sizeof c) != 0) + if( wds_cmd(base, &c, sizeof c) != 0) { printf("wds%d: unable to start outgoing mbox\n", unit); r->busy = 0; wds[unit].ombs[r->ombn].stat = 0; - + return TRY_AGAIN_LATER; } - if(sxp->flags & SCSI_NOMASK) + if(sxp->flags & SCSI_NOMASK) { repoll: i = 0; - while(!(inb(base+WDS_STAT) & WDS_IRQ)) + while(!(inb(base+WDS_STAT) & WDS_IRQ)) { DELAY(20000); - if(++i == 20) + if(++i == 20) { outb(base + WDS_IRQACK, 0); /*r->busy = 0;*/ @@ -427,7 +427,7 @@ wds_scsi_cmd(struct scsi_xfer *sxp) } } wdsintr(unit); - if(r->done) + if(r->done) { r->sxp->flags |= ITSDONE; r->busy = 0; @@ -460,7 +460,7 @@ wdsintr(int unit) } c = inb(wds[unit].addr + WDS_IRQSTAT); - if( (c&WDSI_MASK) == WDSI_MSVC) + if( (c&WDSI_MASK) == WDSI_MSVC) { c = c & ~WDSI_MASK; in = &wds[unit].imbs[c]; @@ -487,12 +487,12 @@ wds_done(int unit, struct wds_cmd *c, u_char stat) r = (struct wds_req *)NULL; for(i=0; i<MAXSIMUL; i++) - if( c == &wds[unit].wdsr[i].cmd && !wds[unit].wdsr[i].done) + if( c == &wds[unit].wdsr[i].cmd && !wds[unit].wdsr[i].done) { r = &wds[unit].wdsr[i]; break; } - if(r == (struct wds_req *)NULL) + if(r == (struct wds_req *)NULL) { /* failed to find request! */ return 1; @@ -501,7 +501,7 @@ wds_done(int unit, struct wds_cmd *c, u_char stat) r->done = 1; wds[unit].ombs[r->ombn].stat = 0; r->ret = HAD_ERROR; - switch(stat) + switch(stat) { case ICMB_OK: r->ret = COMPLETE; @@ -540,7 +540,7 @@ wds_done(int unit, struct wds_cmd *c, u_char stat) wds_data_in_use[unit] = 0; - if(!r->polled) + if(!r->polled) { r->sxp->flags |= ITSDONE; scsi_done(r->sxp); @@ -562,7 +562,7 @@ wds_getvers(int unit) base = wds[unit].addr; r = wdsr_alloc(unit); - if(!r) + if(!r) { printf("wds%d: no request slot available!\n", unit); return -1; @@ -580,7 +580,7 @@ wds_getvers(int unit) r->polled = 1; c = WDSC_MSTART(r->ombn); - if(wds_cmd(base, (u_char *)&c, sizeof c)) + if(wds_cmd(base, (u_char *)&c, sizeof c)) { printf("wds%d: version request failed\n", unit); r->busy = 0; @@ -588,17 +588,17 @@ wds_getvers(int unit) return -1; } - while(1) + while(1) { i = 0; - while( (inb(base+WDS_STAT) & WDS_IRQ) == 0) + while( (inb(base+WDS_STAT) & WDS_IRQ) == 0) { DELAY(9000); if(++i == 20) return -1; } wdsintr(unit); - if(r->done) + if(r->done) { printf("wds%d: firmware version %d.%02d\n", unit, r->cmd.targ, r->cmd.scb[0]); @@ -619,7 +619,7 @@ wdsattach(struct isa_device *dev) masunit = dev->id_unit; - if( !(versprobe & (1<<masunit))) + if( !(versprobe & (1<<masunit))) { versprobe |= (1<<masunit); if(wds_getvers(masunit)==-1) @@ -633,7 +633,7 @@ wdsattach(struct isa_device *dev) wds[unit].sc_link.adapter = &wds_switch; wds[unit].sc_link.device = &wds_dev; wds[unit].sc_link.flags = SDEV_BOUNCE; - + kdc_wds[unit].kdc_state = DC_BUSY; scsi_attachdevs(&wds[unit].sc_link); @@ -672,9 +672,9 @@ wds_init(struct isa_device *dev) isa_dmacascade(dev->id_drq); - if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY) + if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY) { - for(i=0; i<10; i++) + for(i=0; i<10; i++) { if( (inb(base+WDS_STAT) & (WDS_RDY)) == WDS_RDY) break; @@ -695,7 +695,7 @@ wds_init(struct isa_device *dev) init.nimb = WDS_NIMB; wds_wait(base+WDS_STAT, WDS_RDY, WDS_RDY); - if( wds_cmd(base, (u_char *)&init, sizeof init) != 0) + if( wds_cmd(base, (u_char *)&init, sizeof init) != 0) { printf("wds%d: wds_cmd failed\n", unit); return 1; @@ -707,7 +707,7 @@ wds_init(struct isa_device *dev) bzero(&wc,sizeof wc); wc.cmd = WDSC_DISUNSOL; - if( wds_cmd(base, (char *)&wc, sizeof wc) != 0) + if( wds_cmd(base, (char *)&wc, sizeof wc) != 0) { printf("wds%d: wds_cmd failed\n", unit); return 1; diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index 3b9718b..87f3ae7 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -19,7 +19,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id: wt.c,v 1.15 1995/03/28 07:55:56 bde Exp $ + * $Id: wt.c,v 1.16 1995/04/12 20:48:13 wollman Exp $ * */ @@ -28,17 +28,17 @@ * All rights reserved. * * Authors: Robert Baron - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -740,7 +740,7 @@ static int wtcmd (wtinfo_t *t, int cmd) splx(x); return (0); } - + outb (t->CMDPORT, cmd); /* output the command */ outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */ diff --git a/sys/i386/isa/wtreg.h b/sys/i386/isa/wtreg.h index e45e514..cbc19ca 100644 --- a/sys/i386/isa/wtreg.h +++ b/sys/i386/isa/wtreg.h @@ -19,7 +19,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id$ + * $Id: wtreg.h,v 1.4 1993/12/13 18:38:44 alm Exp $ * */ @@ -28,17 +28,17 @@ * All rights reserved. * * Authors: Robert Baron - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c index b4bbe96..8d8f213 100644 --- a/sys/i386/scsi/aic7xxx.c +++ b/sys/i386/scsi/aic7xxx.c @@ -1,13 +1,13 @@ /* * Generic driver for the aic7xxx based adaptec SCSI controllers - * Copyright (c) 1994, 1995 Justin T. Gibbs. + * Copyright (c) 1994, 1995 Justin T. Gibbs. * All rights reserved. * * Product specific probe and attach routines can be found in: * i386/isa/aic7770.c 27/284X and aic7770 motherboard controllers * /pci/aic7870.c 294x and aic7870 motherboard controllers * - * Portions of this driver are based on the FreeBSD 1742 Driver: + * Portions of this driver are based on the FreeBSD 1742 Driver: * * Written by Julian Elischer (julian@tfs.com) * for TRW Financial Systems for use under the MACH(2.5) operating system. @@ -24,7 +24,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aic7xxx.c,v 1.26 1995/05/11 19:26:26 rgrimes Exp $ + * $Id: aic7xxx.c,v 1.27 1995/05/17 07:06:00 davidg Exp $ */ /* * TODO: @@ -33,7 +33,7 @@ * * This driver is very stable, and seems to offer performance * comprable to the 1742 FreeBSD driver. I have not experienced - * any timeouts since the timeout code was written, so in that + * any timeouts since the timeout code was written, so in that * sense, it is untested. */ @@ -49,7 +49,7 @@ #include <machine/clock.h> #include <i386/scsi/aic7xxx.h> -#define PAGESIZ 4096 +#define PAGESIZ 4096 #define MAX_TAGS 4; @@ -61,7 +61,7 @@ struct ahc_data *ahcdata[NAHC]; int ahc_init __P((int unit)); -void ahc_loadseq __P((u_long iobase)); +void ahc_loadseq __P((u_long iobase)); int32 ahc_scsi_cmd(); timeout_t ahc_timeout; void ahc_done(); @@ -87,7 +87,7 @@ int ahc_debug = AHC_SHOWMISC; #define HWSCSIID 0x0f /* our SCSI ID if Wide Bus */ struct scsi_adapter ahc_switch = -{ +{ ahc_scsi_cmd, ahcminphys, 0, @@ -95,8 +95,8 @@ struct scsi_adapter ahc_switch = ahc_adapter_info, "ahc", { 0, 0 } -}; - +}; + /* the below structure is so we have a default dev struct for our link struct */ struct scsi_device ahc_dev = { @@ -105,24 +105,24 @@ struct scsi_device ahc_dev = NULL, /* have no async handler */ NULL, /* Use default 'done' routine */ "ahc", - 0, + 0, { 0, 0 } }; /* * All of these should be in a separate header file shared by the sequencer - * code and the kernel level driver. The only catch is that we would need to - * add an additional 0xc00 offset when using them in the kernel driver. The - * aic7770 assembler must be modified to allow include files as well. All - * page numbers refer to the Adaptec AIC-7770 Data Book availible from + * code and the kernel level driver. The only catch is that we would need to + * add an additional 0xc00 offset when using them in the kernel driver. The + * aic7770 assembler must be modified to allow include files as well. All + * page numbers refer to the Adaptec AIC-7770 Data Book availible from * Adaptec's Technical Documents Department 1-800-934-2766 */ /* -------------------- AIC-7770 offset definitions ----------------------- */ -/* - * SCSI Sequence Control (p. 3-11). +/* + * SCSI Sequence Control (p. 3-11). * Each bit, when set starts a specific SCSI sequence on the bus */ #define SCSISEQ 0xc00ul @@ -164,7 +164,7 @@ struct scsi_device ahc_dev = #define ENREQINIT 0x01 /* - * SCSI Control Signal Read Register (p. 3-15). + * SCSI Control Signal Read Register (p. 3-15). * Reads the actual state of the SCSI bus pins */ #define SCSISIGI 0xc03ul @@ -178,8 +178,8 @@ struct scsi_device ahc_dev = #define ACKI 0x01 /* - * SCSI Contol Signal Write Register (p. 3-16). - * Writing to this register modifies the control signals on the bus. Only + * SCSI Contol Signal Write Register (p. 3-16). + * Writing to this register modifies the control signals on the bus. Only * those signals that are allowed in the current mode (Initiator/Target) are * asserted. */ @@ -223,7 +223,7 @@ struct scsi_device ahc_dev = /* * Clear SCSI Interrupt 1 (p. 3-23) * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1. - */ + */ #define CLRSINT1 0xc0cul #define CLRSELTIMEO 0x80 #define CLRATNO 0x40 @@ -271,7 +271,7 @@ struct scsi_device ahc_dev = /* UNUSED 0x10 */ #define SELBUSB 0x08 /* UNUSED 0x04 */ -#define SELWIDE 0x02 +#define SELWIDE 0x02 /* UNUSED 0x01 */ /* @@ -298,7 +298,7 @@ struct scsi_device ahc_dev = #define SEQRAM 0xc61ul /* - * Sequencer Address Registers (p. 3-35) + * Sequencer Address Registers (p. 3-35) * Only the first bit of SEQADDR1 holds addressing information */ #define SEQADDR0 0xc62ul @@ -324,7 +324,7 @@ struct scsi_device ahc_dev = /* * Host Control (p. 3-47) R/W - * Overal host control of the device. + * Overal host control of the device. */ #define HCNTRL 0xc87ul /* UNUSED 0x80 */ @@ -367,7 +367,7 @@ struct scsi_device ahc_dev = /* * Hard Error (p. 3-53) - * Reporting of catastrophic errors. You usually cannot recover from + * Reporting of catastrophic errors. You usually cannot recover from * these without a full board reset. */ #define ERROR 0xc92ul @@ -388,7 +388,7 @@ struct scsi_device ahc_dev = /* * SCB Auto Increment (p. 3-59) - * Byte offset into the SCB Array and an optional bit to allow auto + * Byte offset into the SCB Array and an optional bit to allow auto * incrementing of the address during download and upload operations */ #define SCBCNT 0xc9aul @@ -424,7 +424,7 @@ struct scsi_device ahc_dev = /* ---------------- END AIC-7770 Register Definitions ----------------- */ /* --------------------- AIC-7870-only definitions -------------------- */ - + #define DSPCISTATUS 0xc86ul /* ---------------------- Scratch RAM Offsets ------------------------- */ @@ -462,7 +462,7 @@ struct scsi_device ahc_dev = /* * These are offsets into the card's scratch ram. Some of the values are - * specified in the AHA2742 technical reference manual and are initialized + * specified in the AHA2742 technical reference manual and are initialized * by the BIOS at boot time. */ #define HA_ARG_1 0xc4aul @@ -501,17 +501,17 @@ struct scsi_device ahc_dev = /* * Since the sequencer can disable pausing in a critical section, we - * must loop until it actually stops. + * must loop until it actually stops. * XXX Should add a timeout in here?? - */ + */ #define PAUSE_SEQUENCER(ahc) \ outb(HCNTRL + ahc->baseport, ahc->pause); \ \ while ((inb(HCNTRL + ahc->baseport) & PAUSE) == 0) \ - ; + ; #define UNPAUSE_SEQUENCER(ahc) \ - outb( HCNTRL + ahc->baseport, ahc->unpause ) + outb( HCNTRL + ahc->baseport, ahc->unpause ) /* * Restart the sequencer program from address zero @@ -522,7 +522,7 @@ struct scsi_device ahc_dev = } while (inb(SEQADDR0 + ahc->baseport) != 0 && \ inb(SEQADDR1 + ahc->baseport != 0)); \ \ - UNPAUSE_SEQUENCER(ahc); + UNPAUSE_SEQUENCER(ahc); #ifdef AHC_DEBUG void @@ -534,11 +534,11 @@ ahc_print_scb(scb) ,scb->control ,scb->target_channel_lun ,scb->cmdlen - ,scb->cmdpointer ); + ,scb->cmdpointer ); printf(" datlen:%d data:0x%x res:0x%x segs:0x%x segp:0x%x\n" ,scb->datalen[2] << 16 | scb->datalen[1] << 8 | scb->datalen[0] ,scb->data - ,scb->RESERVED[1] << 8 | scb->RESERVED[0] + ,scb->RESERVED[1] << 8 | scb->RESERVED[0] ,scb->SG_segment_count ,scb->SG_list_pointer); printf(" sg_addr:%x sg_len:%d\n" @@ -548,8 +548,8 @@ ahc_print_scb(scb) ,(int)&(scb->next) - (int)scb); } -void -ahc_print_active_scb(ahc) +void +ahc_print_active_scb(ahc) struct ahc_data *ahc; { int cur_scb_offset; @@ -568,14 +568,14 @@ ahc_print_active_scb(ahc) #define ILLHADDR 0x01 static struct { - u_char errno; + u_char errno; char *errmesg; } hard_error[] = { { ILLHADDR, "Illegal Host Access" }, { ILLSADDR, "Illegal Sequencer Address referrenced" }, { ILLOPCODE, "Illegal Opcode in sequencer program" }, { PARERR, "Sequencer Ram Parity Error" } -}; +}; /* @@ -670,11 +670,11 @@ void ahc_scsirate(scsirate, period, offset, unit, target ) int i; for (i = 0; i < ahc_num_syncrates; i++) { - + if ((ahc_syncrates[i].period - period) >= 0) { *scsirate = (ahc_syncrates[i].sxfr) | (offset & 0x0f); printf("ahc%d: target %d synchronous at %sMB/s, " - "offset = 0x%x\n", unit, target, + "offset = 0x%x\n", unit, target, ahc_syncrates[i].rate, offset ); #ifdef AHC_DEBUG #endif /* AHC_DEBUG */ @@ -693,12 +693,12 @@ void ahc_scsirate(scsirate, period, offset, unit, target ) /* * Attach all the sub-devices we can find - */ + */ int ahc_attach(unit) int unit; { - struct ahc_data *ahc = ahcdata[unit]; + struct ahc_data *ahc = ahcdata[unit]; /* * fill in the prototype scsi_link. @@ -713,66 +713,66 @@ ahc_attach(unit) /* * ask the adapter what subunits are present - */ + */ printf("ahc%d: Probing channel A\n", unit); - scsi_attachdevs(&(ahc->sc_link)); + scsi_attachdevs(&(ahc->sc_link)); if(ahc->type & AHC_TWIN) { /* Configure the second scsi bus */ ahc->sc_link_b = ahc->sc_link; ahc->sc_link_b.fordriver = (void *)0x0008; printf("ahc%d: Probing Channel B\n", unit); - scsi_attachdevs(&(ahc->sc_link_b)); - } + scsi_attachdevs(&(ahc->sc_link_b)); + } return 1; } -void +void ahc_send_scb( ahc, scb ) struct ahc_data *ahc; struct scb *scb; -{ +{ u_long iobase = ahc->baseport; - + PAUSE_SEQUENCER(ahc); outb(QINFIFO + iobase, scb->position); UNPAUSE_SEQUENCER(ahc); } -static +static void ahc_getscb(iobase, scb) u_long iobase; struct scb *scb; -{ +{ outb(SCBCNT + iobase, 0x80); /* SCBAUTO */ - + insb(SCBARRAY + iobase, scb, SCB_UP_SIZE); - + outb(SCBCNT + iobase, 0); } -/* +/* * Catch an interrupt from the adaptor - */ + */ int ahcintr(unit) int unit; { int intstat; u_char status; - struct ahc_data *ahc = ahcdata[unit]; + struct ahc_data *ahc = ahcdata[unit]; u_long iobase = ahc->baseport; struct scb *scb = NULL; - struct scsi_xfer *xs = NULL; + struct scsi_xfer *xs = NULL; intstat = inb(INTSTAT + iobase); - + /* * Is this interrupt for me? or for * someone who is sharing my interrupt */ if (!(intstat & INT_PEND)) return 0; - if (intstat & BRKADRINT) { + if (intstat & BRKADRINT) { /* We upset the sequencer :-( */ /* Lookup the error message */ @@ -781,30 +781,30 @@ ahcintr(unit) for(i = 0; error != 1 && i < num_errors; i++) error >>= 1; panic("ahc%d: brkadrint, %s at seqaddr = 0x%x\n", - unit, hard_error[i].errmesg, - (inb(SEQADDR1 + iobase) << 8) | + unit, hard_error[i].errmesg, + (inb(SEQADDR1 + iobase) << 8) | inb(SEQADDR0 + iobase)); } - if (intstat & SEQINT) { + if (intstat & SEQINT) { unsigned char transfer; switch (intstat & SEQINT_MASK) { case BAD_PHASE: panic("ahc%d: unknown scsi bus phase. " - "Attempting to continue\n", unit); - break; - case SEND_REJECT: - printf("ahc%d: Warning - " + "Attempting to continue\n", unit); + break; + case SEND_REJECT: + printf("ahc%d: Warning - " "message reject, message type: 0x%x\n", unit, inb(HA_REJBYTE + iobase)); - break; - case NO_IDENT: + break; + case NO_IDENT: panic("ahc%d: No IDENTIFY message from reconnecting " "target %d at seqaddr = 0x%lx " "SAVED_TCL == 0x%x\n", unit, (inb(SELID + iobase) >> 4) & 0xf, - (inb(SEQADDR1 + iobase) << 8) | - inb(SEQADDR0 + iobase), + (inb(SEQADDR1 + iobase) << 8) | + inb(SEQADDR0 + iobase), inb(SAVED_TCL + iobase)); break; case NO_MATCH: @@ -819,7 +819,7 @@ ahcintr(unit) printf("SAVED_TCL == 0x%x\n", inb(SAVED_TCL + iobase)); if( tcl & 0x88 ) { - /* Second channel stores its info + /* Second channel stores its info * in byte two of HA_ACTIVE */ active_port++; @@ -836,11 +836,11 @@ ahcintr(unit) { u_char scsi_id, offset, rate, targ_scratch; u_char maxoffset, mask; - /* - * Help the sequencer to translate the - * negotiated transfer rate. Transfer is - * 1/4 the period in ns as is returned by - * the sync negotiation message. So, we must + /* + * Help the sequencer to translate the + * negotiated transfer rate. Transfer is + * 1/4 the period in ns as is returned by + * the sync negotiation message. So, we must * multiply by four */ transfer = inb(HA_ARG_1 + iobase) << 2; @@ -851,24 +851,24 @@ ahcintr(unit) /* B channel */ scsi_id += 8; mask = (0x01 << scsi_id); - targ_scratch = inb(HA_TARG_SCRATCH + iobase + targ_scratch = inb(HA_TARG_SCRATCH + iobase + scsi_id); if(targ_scratch & 0x80) maxoffset = 0x08; else maxoffset = 0x0f; - ahc_scsirate(&rate, transfer, + ahc_scsirate(&rate, transfer, MIN(offset,maxoffset), unit, scsi_id); /* Preserve the WideXfer flag */ - rate |= targ_scratch & 0x80; + rate |= targ_scratch & 0x80; outb(HA_TARG_SCRATCH + iobase + scsi_id, rate); - outb(SCSIRATE + iobase, rate); - if( (rate & 0x0f) == 0 ) + outb(SCSIRATE + iobase, rate); + if( (rate & 0x0f) == 0 ) { /* * The requested rate was so low * that asyncronous transfers are - * faster (not to mention the + * faster (not to mention the * controller won't support them), * so we issue a message reject to * ensure we go to asyncronous @@ -895,7 +895,7 @@ ahcintr(unit) #endif outb(HA_RETURN_1 + iobase, SEND_SDTR); } - /* + /* * Negate the flags */ ahc->needsdtr &= ~mask; @@ -913,13 +913,13 @@ ahcintr(unit) /* B channel */ scsi_id += 8; - scratch = inb(HA_TARG_SCRATCH + iobase + scratch = inb(HA_TARG_SCRATCH + iobase + scsi_id); if(ahc->wdtrpending & (0x01 << scsi_id)) { - /* - * Don't send a WDTR back to the + /* + * Don't send a WDTR back to the * target, since we asked first. */ outb(HA_RETURN_1 + iobase, 0); @@ -933,7 +933,7 @@ ahcintr(unit) "%d using 16Bit " "transfers\n", unit, scsi_id); - scratch |= 0x80; + scratch |= 0x80; break; } } @@ -955,27 +955,27 @@ ahcintr(unit) "%d using 16Bit " "transfers\n", unit, scsi_id); - scratch |= 0x80; + scratch |= 0x80; break; } - outb(HA_RETURN_1 + iobase, + outb(HA_RETURN_1 + iobase, bus_width | SEND_WDTR); } ahc->needwdtr &= ~(0x01 << scsi_id); ahc->wdtrpending &= ~(0x01 << scsi_id); outb(HA_TARG_SCRATCH + iobase + scsi_id, scratch); - outb(SCSIRATE + iobase, scratch); + outb(SCSIRATE + iobase, scratch); break; } case MSG_REJECT: { - /* + /* * What we care about here is if we had an * outstanding SDTR or WDTR message for this * target. If we did, this is a signal that * the target is refusing negotiation. */ - + u_char targ_scratch; u_char scsi_id = inb(SCSIID + iobase) >> 0x4; u_short mask; @@ -1024,10 +1024,10 @@ ahcintr(unit) outb(SCSIRATE + iobase, targ_scratch); break; } - case BAD_STATUS: + case BAD_STATUS: { int scb_index; - + /* The sequencer will notify us when a command * has an error that would be of interest to * the kernel. This allows us to leave the sequencer @@ -1039,15 +1039,15 @@ ahcintr(unit) scb = ahc->scbarray[scb_index]; /* - * Set the default return value to 0 (don't + * Set the default return value to 0 (don't * send sense). The sense code with change - * this if needed and this reduces code + * this if needed and this reduces code * duplication. */ outb(HA_RETURN_1 + iobase, 0); if (!scb || !(scb->flags & SCB_ACTIVE)) { printf("ahc%d: ahcintr - referenced scb not " - "valid during seqint 0x%x scb(%d)\n", + "valid during seqint 0x%x scb(%d)\n", unit, intstat, scb_index); goto clear; } @@ -1076,7 +1076,7 @@ ahcintr(unit) ,xs->sc_link->dev_unit); #endif - if((xs->error == XS_NOERROR) && + if((xs->error == XS_NOERROR) && !(scb->flags & SCB_SENSE)) { u_char flags; u_char head; @@ -1123,7 +1123,7 @@ ahcintr(unit) tail = inb(WAITING_SCBT + iobase); if(head & SCB_LIST_NULL) { /* List was empty */ - head = scb->position; + head = scb->position; tail = SCB_LIST_NULL; } else if(tail & SCB_LIST_NULL) { @@ -1190,7 +1190,7 @@ ahcintr(unit) (inb(iobase+SCBARRAY+16) << 8) | inb(iobase+SCBARRAY+15); #ifdef AHC_DEBUG - printf("ahc: Handled Residual\n"); + printf("ahc: Handled Residual\n"); #endif break; } @@ -1200,10 +1200,10 @@ ahcintr(unit) scb_index = inb(SCBPTR + iobase); scb = ahc->scbarray[scb_index]; /* - * We didn't recieve a valid tag back from + * We didn't recieve a valid tag back from * the target on a reconnect. */ - printf("ahc%d: invalid tag recieved on channel %c " + printf("ahc%d: invalid tag recieved on channel %c " "target %d, lun %d -- sending ABORT_TAG\n", unit, ((u_long)xs->sc_link->fordriver & 0x08)? 'B':'A', @@ -1236,29 +1236,29 @@ ahcintr(unit) "does not have a waiting message"); break; } - default: + default: printf("ahc: seqint, " "intstat == 0x%x, scsisigi = 0x%x\n", intstat, inb(SCSISIGI + iobase)); break; - } -clear: - /* + } +clear: + /* * Clear the upper byte that holds SEQINT status * codes and clear the SEQINT bit. - */ + */ outb(CLRINT + iobase, CLRSEQINT); - /* + /* * The sequencer is paused immediately on * a SEQINT, so we should restart it when - * we leave this section. - */ + * we leave this section. + */ UNPAUSE_SEQUENCER(ahc); - } + } - if (intstat & SCSIINT) { + if (intstat & SCSIINT) { int scb_index = inb(SCBPTR + iobase); status = inb(SSTAT1 + iobase); @@ -1276,19 +1276,19 @@ clear: } xs = scb->xs; - if (status & SELTO) { + if (status & SELTO) { u_char active; u_char waiting; u_char flags; u_long active_port = HA_ACTIVE0 + iobase; outb(SCSISEQ + iobase, ENRSELI); xs->error = XS_TIMEOUT; - /* + /* * Clear any pending messages for the timed out * target, and mark the target as free */ flags = inb( HA_FLAGS + iobase ); - outb(HA_FLAGS + iobase, + outb(HA_FLAGS + iobase, flags & ~ACTIVE_MSG); if (scb->target_channel_lun & 0x88) @@ -1311,9 +1311,9 @@ clear: outb(WAITING_SCBH + iobase, waiting); RESTART_SEQUENCER(ahc); - } - - else if (status & SCSIPERR) { + } + + else if (status & SCSIPERR) { printf("ahc%d: parity error on channel %c " "target %d, lun %d\n", unit, @@ -1321,15 +1321,15 @@ clear: xs->sc_link->target, xs->sc_link->lun); xs->error = XS_DRIVER_STUFFUP; - + outb(CLRSINT1 + iobase, CLRSCSIPERR); UNPAUSE_SEQUENCER(ahc); - + outb(CLRINT + iobase, CLRSCSIINT); scb = NULL; - } + } else if (!(status & BUSFREE)) { - printf("ahc%d: Unknown SCSIINT. Status = 0x%x\n", + printf("ahc%d: Unknown SCSIINT. Status = 0x%x\n", unit, status); outb(CLRSINT1 + iobase, status); UNPAUSE_SEQUENCER(ahc); @@ -1342,11 +1342,11 @@ clear: ahc_done(unit, scb); } } -cmdcomplete: - if (intstat & CMDCMPLT) { +cmdcomplete: + if (intstat & CMDCMPLT) { int scb_index; - - do { + + do { scb_index = inb(QOUTFIFO + iobase); scb = ahc->scbarray[scb_index]; if (!scb || !(scb->flags & SCB_ACTIVE)) { @@ -1354,16 +1354,16 @@ cmdcomplete: "no command for scb %d (cmdcmplt)\n" "QOUTCNT == %d\n", unit, scb_index, inb(QOUTCNT + iobase)); - outb(CLRINT + iobase, CLRCMDINT); + outb(CLRINT + iobase, CLRCMDINT); continue; - } - - outb(CLRINT + iobase, CLRCMDINT); + } + + outb(CLRINT + iobase, CLRCMDINT); untimeout(ahc_timeout, (caddr_t)scb); ahc_done(unit, scb); - + } while (inb(QOUTCNT + iobase)); - } + } return 1; } @@ -1386,13 +1386,13 @@ ahc_done(unit, scb) */ if(scb->flags & SCB_SENSE) xs->error = XS_SENSE; - if ((xs->flags & SCSI_ERR_OK) && !(xs->error == XS_SENSE)) { + if ((xs->flags & SCSI_ERR_OK) && !(xs->error == XS_SENSE)) { /* All went correctly OR errors expected */ xs->error = XS_NOERROR; } xs->flags |= ITSDONE; #ifdef AHC_TAGENABLE - if(xs->cmd->opcode == 0x12 && xs->error == XS_NOERROR) + if(xs->cmd->opcode == 0x12 && xs->error == XS_NOERROR) { struct ahc_data *ahc = ahcdata[unit]; struct scsi_inquiry_data *inq_data; @@ -1404,7 +1404,7 @@ ahc_done(unit, scb) * should really be done by the higher level drivers. */ inq_data = (struct scsi_inquiry_data *)xs->data; - if(((inq_data->device & SID_TYPE) == 0) + if(((inq_data->device & SID_TYPE) == 0) && (inq_data->flags & SID_CmdQue) && !(ahc->tagenable & mask)) { @@ -1421,7 +1421,7 @@ ahc_done(unit, scb) } #endif ahc_free_scb(unit, scb, xs->flags); - scsi_done(xs); + scsi_done(xs); } /* @@ -1442,8 +1442,8 @@ ahc_init(unit) */ #ifdef AHC_DEBUG - printf("ahc%d: scb %d bytes; SCB_SIZE %d bytes, ahc_dma %d bytes\n", - unit, sizeof(struct scb), SCB_DOWN_SIZE, + printf("ahc%d: scb %d bytes; SCB_SIZE %d bytes, ahc_dma %d bytes\n", + unit, sizeof(struct scb), SCB_DOWN_SIZE, sizeof(struct ahc_dma_seg)); #endif /* AHC_DEBUG */ printf("ahc%d: reading board settings\n", unit); @@ -1486,7 +1486,7 @@ ahc_init(unit) ahc->maxscbs = 0x10; #define DFTHRESH 3 outb(DSPCISTATUS + iobase, DFTHRESH << 6); - /* + /* * XXX Hard coded SCSI ID until we can read it from the * SEEPROM or NVRAM. */ @@ -1526,16 +1526,16 @@ ahc_init(unit) * Take the bus led out of diagnostic mode */ outb(SBLKCTL + iobase, sblkctl); - /* + /* * Number of SCBs that will be used. Rev E aic7770s and * aic7870s have 16. The rest have 4. */ if(!(ahc->type & AHC_AIC7870)) { - /* + /* * See if we have a Rev E or higher - * aic7770. Anything below a Rev E will - * have a R/O autoflush disable configuration + * aic7770. Anything below a Rev E will + * have a R/O autoflush disable configuration * bit. */ u_char sblkctl_orig; @@ -1566,11 +1566,11 @@ ahc_init(unit) else printf("ahc%d: Using Edge Triggered Interrupts\n", unit); - } + } if(!(ahc->type & AHC_AIC7870)){ - /* + /* * The 294x cards are PCI, so we get their interrupt from the PCI - * BIOS. + * BIOS. */ intdef = inb(INTDEF + iobase); @@ -1602,7 +1602,7 @@ ahc_init(unit) /* Set the SCSI Id, SXFRCTL1, and SIMODE1, for both channels */ if( ahc->type & AHC_TWIN) { - /* + /* * The device is gated to channel B after a chip reset, * so set those values first */ @@ -1622,8 +1622,8 @@ ahc_init(unit) * Look at the information that board initialization or * the board bios has left us. In the lower four bits of each * target's scratch space any value other than 0 indicates - * that we should initiate syncronous transfers. If it's zero, - * the user or the BIOS has decided to disable syncronous + * that we should initiate syncronous transfers. If it's zero, + * the user or the BIOS has decided to disable syncronous * negotiation to that target so we don't activate the needsdr * flag. */ @@ -1651,7 +1651,7 @@ ahc_init(unit) } outb(HA_TARG_SCRATCH+i+iobase,target_settings); } - /* + /* * If we are not a WIDE device, forget WDTR. This * makes the driver work on some cards that don't * leave these fields cleared when the BIOS is not @@ -1665,15 +1665,15 @@ ahc_init(unit) ahc->wdtrpending = 0; ahc->tagenable = 0; - /* + /* * Clear the control byte for every SCB so that the sequencer * doesn't get confused and think that one of them is valid - */ + */ for(i = 0; i < ahc->maxscbs; i++) { outb(SCBPTR + iobase, i); outb(SCBARRAY + iobase, 0); } - + #ifdef AHC_DEBUG printf("NEEDSDTR == 0x%x\nNEEDWDTR == 0x%x\n", ahc->needsdtr, ahc->needwdtr); @@ -1695,17 +1695,17 @@ ahc_init(unit) * Place the aic7770 in fastmode which makes a big * difference when doing many small block transfers. */ - + printf("ahc%d: Downloading Sequencer Program...", unit); ahc_loadseq(iobase); printf("Done\n"); outb(SEQCTL + iobase, FASTMODE); if (!(ahc->type & AHC_AIC7870)) - outb(BCTL + iobase, ENABLE); + outb(BCTL + iobase, ENABLE); /* Reset the bus */ - outb(SCSISEQ + iobase, SCSIRSTO); + outb(SCSISEQ + iobase, SCSIRSTO); DELAY(1000); outb(SCSISEQ + iobase, 0); @@ -1720,9 +1720,9 @@ ahc_init(unit) void ahcminphys(bp) - struct buf *bp; + struct buf *bp; { -/* +/* * Even though the card can transfer up to 16megs per command * we are limited by the number of segments in the dma segment * list that we can hold. The worst case is that all pages are @@ -1731,40 +1731,40 @@ ahcminphys(bp) */ if (bp->b_bcount > ((AHC_NSEG - 1) * PAGESIZ)) { bp->b_bcount = ((AHC_NSEG - 1) * PAGESIZ); - } + } } /* * start a scsi operation given the command and - * the data address, target, and lun all of which + * the data address, target, and lun all of which * are stored in the scsi_xfer struct */ int32 ahc_scsi_cmd(xs) struct scsi_xfer *xs; { - struct scb *scb = NULL; + struct scb *scb = NULL; struct ahc_dma_seg *sg; int seg; /* scatter gather seg being worked on */ - int thiskv; + int thiskv; physaddr thisphys, nextphys; int unit = xs->sc_link->adapter_unit; - u_short mask = (0x01 << (xs->sc_link->target + u_short mask = (0x01 << (xs->sc_link->target | ((u_long)xs->sc_link->fordriver & 0x08))); int bytes_this_seg, bytes_this_page, datalen, flags; struct ahc_data *ahc = ahcdata[unit]; int s; SC_DEBUG(xs->sc_link, SDEV_DB2, ("ahc_scsi_cmd\n")); - /* + /* * get an scb to use. If the transfer * is from a buf (possibly from interrupt time) * then we can't allow it to sleep */ flags = xs->flags; if (flags & ITSDONE) { - printf("ahc%d: Already done?", unit); - xs->flags &= ~ITSDONE; + printf("ahc%d: Already done?", unit); + xs->flags &= ~ITSDONE; } if (!(flags & INUSE)) { printf("ahc%d: Not in use?", unit); @@ -1776,15 +1776,15 @@ ahc_scsi_cmd(xs) } SC_DEBUG(xs->sc_link, SDEV_DB3, ("start scb(%p)\n", scb)); scb->xs = xs; - if (flags & SCSI_RESET) + if (flags & SCSI_RESET) scb->flags |= SCB_DEVICE_RESET|SCB_IMMED; /* * Put all the arguments for the xfer in the scb - */ + */ if(ahc->tagenable & mask) scb->control |= SCB_TE; - if((ahc->needwdtr & mask) && !(ahc->wdtrpending & mask)) + if((ahc->needwdtr & mask) && !(ahc->wdtrpending & mask)) { scb->control |= SCB_NEEDWDTR; ahc->wdtrpending |= mask; @@ -1794,26 +1794,26 @@ ahc_scsi_cmd(xs) scb->control |= SCB_NEEDSDTR; ahc->sdtrpending |= mask; } - scb->target_channel_lun = ((xs->sc_link->target << 4) & 0xF0) | + scb->target_channel_lun = ((xs->sc_link->target << 4) & 0xF0) | ((u_long)xs->sc_link->fordriver & 0x08) | (xs->sc_link->lun & 0x07); scb->cmdlen = xs->cmdlen; scb->cmdpointer = KVTOPHYS(xs->cmd); xs->resid = 0; if (xs->datalen) { /* should use S/G only if not zero length */ - scb->SG_list_pointer = KVTOPHYS(scb->ahc_dma); + scb->SG_list_pointer = KVTOPHYS(scb->ahc_dma); sg = scb->ahc_dma; seg = 0; - { + { /* * Set up the scatter gather block - */ + */ SC_DEBUG(xs->sc_link, SDEV_DB4, ("%ld @%p:- ", xs->datalen, xs->data)); datalen = xs->datalen; thiskv = (int) xs->data; thisphys = KVTOPHYS(thiskv); - + while ((datalen) && (seg < AHC_NSEG)) { bytes_this_seg = 0; @@ -1821,14 +1821,14 @@ ahc_scsi_cmd(xs) sg->addr = thisphys; SC_DEBUGN(xs->sc_link, SDEV_DB4, ("0x%lx", - thisphys)); - + thisphys)); + /* do it at least once */ nextphys = thisphys; while ((datalen) && (thisphys == nextphys)) { /* - * This page is contiguous (physically) - * with the the last, just extend the + * This page is contiguous (physically) + * with the the last, just extend the * length */ /* how far to the end of the page */ @@ -1837,10 +1837,10 @@ ahc_scsi_cmd(xs) bytes_this_page = nextphys - thisphys; /**** or the data ****/ bytes_this_page = min(bytes_this_page - ,datalen); + ,datalen); bytes_this_seg += bytes_this_page; datalen -= bytes_this_page; - + /* get more ready for the next page */ thiskv = (thiskv & (~(PAGESIZ - 1))) + PAGESIZ; @@ -1851,76 +1851,76 @@ ahc_scsi_cmd(xs) * next page isn't contiguous, finish the seg */ SC_DEBUGN(xs->sc_link, SDEV_DB4, - ("(0x%x)", bytes_this_seg)); + ("(0x%x)", bytes_this_seg)); sg->len = bytes_this_seg; sg++; seg++; - } - } /*end of iov/kv decision */ + } + } /*end of iov/kv decision */ scb->SG_segment_count = seg; SC_DEBUGN(xs->sc_link, SDEV_DB4, ("\n")); - if (datalen) { /* there's still data, must have run out of segs! */ + if (datalen) { /* there's still data, must have run out of segs! */ printf("ahc_scsi_cmd%d: more than %d DMA segs\n", unit, AHC_NSEG); xs->error = XS_DRIVER_STUFFUP; ahc_free_scb(unit, scb, flags); return (HAD_ERROR); } - } + } else { /* - * No data xfer, use non S/G values + * No data xfer, use non S/G values */ scb->SG_segment_count = 0; scb->SG_list_pointer = 0; } - /* + /* * Usually return SUCCESSFULLY QUEUED */ #ifdef AHC_DEBUG if(xs->sc_link->target == DEBUGTARG) ahc_print_scb(scb); #endif - if (!(flags & SCSI_NOMASK)) { - s = splbio(); + if (!(flags & SCSI_NOMASK)) { + s = splbio(); ahc_send_scb(ahc, scb); timeout(ahc_timeout, (caddr_t)scb, (xs->timeout * hz) / 1000); - splx(s); + splx(s); SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n")); return (SUCCESSFULLY_QUEUED); - } - /* + } + /* * If we can't use interrupts, poll on completion - */ + */ ahc_send_scb(ahc, scb); SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_wait\n")); - do { + do { if (ahc_poll(unit, xs->timeout)) { if (!(xs->flags & SCSI_SILENT)) printf("cmd fail\n"); printf("cmd fail\n"); ahc_abort_scb(unit,ahc,scb); return (HAD_ERROR); - } - } while (!(xs->flags & ITSDONE)); /* a non command complete intr */ + } + } while (!(xs->flags & ITSDONE)); /* a non command complete intr */ if (xs->error) { return (HAD_ERROR); - } - return (COMPLETE); -} + } + return (COMPLETE); +} -/* +/* * Return some information to the caller about - * the adapter and it's capabilities. - */ + * the adapter and it's capabilities. + */ u_int32 ahc_adapter_info(unit) int unit; { - return (2); /* 2 outstanding requests at a time per device */ -} + return (2); /* 2 outstanding requests at a time per device */ +} /* * A scb (and hence an scb entry on the board is put onto the @@ -1940,7 +1940,7 @@ ahc_free_scb(unit, scb, flags) scb->next = ahc->free_scb; ahc->free_scb = scb; #ifdef AHC_DEBUG - ahc->activescbs--; + ahc->activescbs--; #endif /* * If there were none, wake abybody waiting for @@ -1951,7 +1951,7 @@ ahc_free_scb(unit, scb, flags) } splx(opri); } - + /* * Get a free scb * If there are none, see if we can allocate a @@ -1969,7 +1969,7 @@ ahc_get_scb(unit, flags) /* * If we can and have to, sleep waiting for one to come free * but only if we can't allocate a new one. - */ + */ while (!(scbp = ahc->free_scb)) { if (ahc->numscbs < ahc->maxscbs) { scbp = (struct scb *) malloc(sizeof(struct scb), @@ -2034,7 +2034,7 @@ ahc_get_scb(unit, flags) #ifdef AHC_DEBUG ahc->activescbs++; if( ahc->activescbs == ahc->maxscbs ) - printf("ahc%d: Max SCBs active\n", unit); + printf("ahc%d: Max SCBs active\n", unit); #endif } @@ -2050,7 +2050,7 @@ void ahc_loadseq(iobase) static unsigned char seqprog[] = { # include "aic7xxx_seq.h" }; - + outb(SEQCTL + iobase, PERRORDIS|SEQRESET|LOADRAM); outsb(SEQRAM + iobase, seqprog, sizeof(seqprog)); @@ -2058,20 +2058,20 @@ void ahc_loadseq(iobase) outb(SEQCTL + iobase, FASTMODE|SEQRESET); do { outb(SEQCTL + iobase, SEQRESET|FASTMODE); - + } while (inb(SEQADDR0 + iobase) != 0 && - inb(SEQADDR1 + iobase != 0)); + inb(SEQADDR1 + iobase != 0)); } -/* +/* * Function to poll for command completion when in poll mode - */ -int + */ +int ahc_poll(int unit, int wait) { /* in msec */ - struct ahc_data *ahc = ahcdata[unit]; + struct ahc_data *ahc = ahcdata[unit]; u_long iobase = ahc->baseport; - u_long stport = INTSTAT + iobase; + u_long stport = INTSTAT + iobase; while (--wait) { DELAY(1000); @@ -2116,7 +2116,7 @@ ahc_abort_scb( unit, ahc, scb ) /* Re-insert entries back into the queue */ for( queued = 0; queued < i; queued++ ) outb(QINFIFO + iobase, saved_queue[queued]); - + if( found ){ goto done; } @@ -2150,8 +2150,8 @@ ahc_abort_scb( unit, ahc, scb ) * Case 3: Currently active command */ if ( (flags = inb(HA_FLAGS + iobase)) & ACTIVE_MSG) { - /* - * If there's a message in progress, + /* + * If there's a message in progress, * reset the bus and have all devices renegotiate. */ if(scb->target_channel_lun & 0x08){ @@ -2174,20 +2174,20 @@ ahc_abort_scb( unit, ahc, scb ) } /* Reset the bus */ - outb(SCSISEQ + iobase, SCSIRSTO); + outb(SCSISEQ + iobase, SCSIRSTO); DELAY(1000); outb(SCSISEQ + iobase, 0); goto done; - } + } - /* + /* * Otherwise, set up an abort message and have the sequencer * clean up */ outb(HA_FLAGS + iobase, flags | ACTIVE_MSG); outb(HA_MSG_LEN + iobase, 1); outb(HA_MSG_START + iobase, MSG_ABORT); - + outb(SCSISIGO + iobase, inb(HA_SIGSTATE + iobase) | 0x10); done: @@ -2199,7 +2199,7 @@ done: void ahc_timeout(void *arg1) -{ +{ struct scb *scb = (struct scb *)arg1; int unit; struct ahc_data *ahc; @@ -2209,11 +2209,11 @@ ahc_timeout(void *arg1) ahc = ahcdata[unit]; printf("ahc%d: target %d, lun %d (%s%d) timed out\n", unit ,scb->xs->sc_link->target - ,scb->xs->sc_link->lun + ,scb->xs->sc_link->lun ,scb->xs->sc_link->device->name ,scb->xs->sc_link->dev_unit); #ifdef SCSIDEBUG - show_scsi_cmd(scb->xs); + show_scsi_cmd(scb->xs); #endif #ifdef AHC_DEBUG if (ahc_debug & AHC_SHOWSCBS) diff --git a/sys/i386/scsi/aic7xxx.h b/sys/i386/scsi/aic7xxx.h index 7fae490..7623be7 100644 --- a/sys/i386/scsi/aic7xxx.h +++ b/sys/i386/scsi/aic7xxx.h @@ -1,6 +1,6 @@ /* - * Interface to the generic driver for the aic7xxx based adaptec - * SCSI controllers. This is used to implement product specific + * Interface to the generic driver for the aic7xxx based adaptec + * SCSI controllers. This is used to implement product specific * probe and attach routines. * * Copyright (c) 1994, 1995 Justin T. Gibbs. @@ -20,7 +20,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7xxx.h,v 1.7 1995/04/27 17:47:17 gibbs Exp $ + * $Id: aic7xxx.h,v 1.8 1995/05/17 07:06:02 davidg Exp $ */ #ifndef _AIC7XXX_H_ @@ -44,7 +44,7 @@ struct ahc_dma_seg { physaddr addr; long len; }; - + typedef u_char ahc_type; #define AHC_NONE 0x00 #define AHC_WIDE 0x02 /* Wide Channel */ @@ -62,7 +62,7 @@ typedef u_char ahc_type; * boundaries since the first 26 bytes of this structure must have the correct * offsets for the hardware to find them. The driver is further optimized * so that we only have to download the first 19 bytes since as long - * as we always use S/G, the last fields should be zero anyway. + * as we always use S/G, the last fields should be zero anyway. */ struct scb { /* ------------ Begin hardware supported fields ---------------- */ @@ -86,18 +86,18 @@ struct scb { /*18*/ u_char residual_data_count[3]; /*19*/ u_char residual_SG_segment_count; #define SCB_DOWN_SIZE 19 /* amount to actually download */ -#define SCB_BZERO_SIZE 19 /* +#define SCB_BZERO_SIZE 19 /* * amount we need to clear between * commands */ /*23*/ physaddr data __attribute__ ((packed)); /*26*/ u_char datalen[3]; -#define SCB_UP_SIZE 26 /* +#define SCB_UP_SIZE 26 /* * amount we need to upload to perform * a request sense. */ /*30*/ physaddr host_scb __attribute__ ((packed)); -/*31*/ u_char next_waiting; /* Used to thread SCBs awaiting +/*31*/ u_char next_waiting; /* Used to thread SCBs awaiting * selection */ #define SCB_LIST_NULL 0x10 /* SCB list equivelent to NULL */ @@ -122,7 +122,7 @@ struct scb { struct ahc_dma_seg ahc_dma[AHC_NSEG] __attribute__ ((packed)); struct scsi_sense sense_cmd; /* SCSI command block */ }; - + struct ahc_data { ahc_type type; int flags; diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 196d34c..e1bc372 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.32 1995/03/16 18:11:58 bde Exp $ + * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ */ /* @@ -193,7 +193,7 @@ int acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) { if (timer0_state || TIMER_DIV(rate) < TIMER0_MIN_MAX_COUNT || - !function) + !function) return -1; new_function = function; new_rate = rate; @@ -204,7 +204,7 @@ acquire_timer0(int rate, void (*function) __P((struct clockframe *frame))) int acquire_timer2(int mode) { - if (timer2_state) + if (timer2_state) return -1; timer2_state = 1; outb(TIMER_MODE, TIMER_SEL2 | (mode &0x3f)); @@ -265,7 +265,7 @@ printrtc(void) #endif static int -getit() +getit() { int high, low; @@ -307,7 +307,7 @@ calibrate_cyclecounter(void) /* * Wait "n" microseconds. - * Relies on timer 1 counting down from (TIMER_FREQ / hz) + * Relies on timer 1 counting down from (TIMER_FREQ / hz) * Note: timer had better have been programmed before this is first used! */ void @@ -339,7 +339,7 @@ DELAY(int n) prev_tick = getit(0, 0); n -= 20; /* - * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point + * Calculate (n * (TIMER_FREQ / 1e6)) without using floating point * and without any avoidable overflows. */ sec = n / 1000000; @@ -375,11 +375,11 @@ sysbeepstop(void *chan) beeping = 0; } -int +int sysbeep(int pitch, int period) { - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) return -1; disable_intr(); outb(TIMER_CNTR2, pitch); @@ -426,7 +426,7 @@ readrtc(int port) * XXX initialization of other timers is unintentionally left blank. */ void -startrtclock() +startrtclock() { timer0_max_count = hardclock_max_count = TIMER_DIV(hz); timer0_overflow_threshold = timer0_max_count - TIMER0_LATCH_COUNT; diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 49d7fdc..be36035 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.59 1995/05/06 19:34:25 joerg Exp $ + * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ * */ @@ -370,7 +370,7 @@ fdc_err(fdcu_t fdcu, const char *s) else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX) printf("fdc%d: too many errors, not logging any more\n", fdcu); - + return FD_FAILED; } @@ -378,7 +378,7 @@ fdc_err(fdcu_t fdcu, const char *s) * fd_cmd: Send a command to the chip. Takes a varargs with this structure: * Unit number, * # of output bytes, output bytes as ints ..., - * # of input bytes, input bytes as ints ... + * # of input bytes, input bytes as ints ... */ int @@ -604,7 +604,7 @@ fdattach(struct isa_device *dev) unithasfd = 1; if (ftattach(dev, fdup, unithasfd)) continue; - if (fdsu < DRVS_PER_CTLR) + if (fdsu < DRVS_PER_CTLR) fd->type = NO_TYPE; #endif continue; @@ -683,9 +683,9 @@ fdattach(struct isa_device *dev) break; /* already probed succesfully */ } } - + set_motor(fdcu, fdsu, TURNOFF); - + if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */ continue; @@ -694,13 +694,13 @@ fdattach(struct isa_device *dev) fd->fdsu = fdsu; fd->options = 0; printf("fd%d: ", fdu); - + fd_registerdev(fdcu, fdu); switch (fdt) { case RTCFDT_12M: printf("1.2MB 5.25in\n"); fd->type = FD_1200; - kdc_fd[fdu].kdc_description = + kdc_fd[fdu].kdc_description = "1.2MB (1200K) 5.25in floppy disk drive"; #ifdef DEVFS sprintf(name,"fd%d.1200",fdu); @@ -787,9 +787,9 @@ set_motor(fdcu_t fdcu, int fdsu, int turnon) { int fdout = fdc_data[fdcu].fdout; int needspecify = 0; - + if(turnon) { - fdout &= ~FDO_FDSEL; + fdout &= ~FDO_FDSEL; fdout |= (FDO_MOEN0 << fdsu) + fdsu; } else fdout &= ~(FDO_MOEN0 << fdsu); @@ -856,7 +856,7 @@ fd_motor_on(void *arg1) } static void -fd_turnon(fdu_t fdu) +fd_turnon(fdu_t fdu) { fd_p fd = fd_data + fdu; if(!(fd->flags & FD_MOTOR)) @@ -871,7 +871,7 @@ static void fdc_reset(fdc_p fdc) { fdcu_t fdcu = fdc->fdcu; - + /* Try a reset, keep motor on */ outb(fdc->baseport + FDOUT, fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); TRACE1("[0x%x->FDOUT]", fdc->fdout & ~(FDO_FRST|FDO_FDMAEN)); @@ -978,7 +978,7 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p) return(ftopen(dev, flags)); #endif /* check bounds */ - if (fdu >= NFD) + if (fdu >= NFD) return(ENXIO); fdc = fd_data[fdu].fdc; if ((fdc == NULL) || (fd_data[fdu].type == NO_TYPE)) @@ -1093,7 +1093,7 @@ fdstrategy(struct buf *bp) if (fdc->flags & FDC_TAPE_BUSY) { bp->b_error = EBUSY; bp->b_flags |= B_ERROR; - goto bad; + goto bad; } #endif if (!(bp->b_flags & B_FORMAT)) { @@ -1111,7 +1111,7 @@ fdstrategy(struct buf *bp) goto bad; } } - + /* * Set up block calculations. */ @@ -1262,7 +1262,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) dp = &(fdc->head); bp = dp->b_actf; - if(!bp) + if(!bp) { /***********************************************\ * nothing left for this controller to do * @@ -1469,7 +1469,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) if(format) { /* formatting */ - if(fd_cmd(fdcu, 6, + if(fd_cmd(fdcu, 6, NE7CMD_FORMAT, head << 2 | fdu, finfo->fd_formb_secshift, @@ -1482,7 +1482,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) fdc->retry = 6; return(retrier(fdcu)); } - } + } else { if (fd_cmd(fdcu, 9, @@ -1761,7 +1761,7 @@ fdformat(dev, finfo, p) bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; bp->b_un.b_addr = (caddr_t)finfo; - + /* now do the format */ fdstrategy(bp); @@ -1774,7 +1774,7 @@ fdformat(dev, finfo, p) break; } splx(s); - + if(rv == EWOULDBLOCK) { /* timed out */ rv = EIO; @@ -1890,7 +1890,7 @@ fdioctl(dev, cmd, addr, flag, p) case FD_GOPTS: /* get drive options */ *(int *)addr = fd_data[FDUNIT(minor(dev))].options; break; - + case FD_SOPTS: /* set drive options */ fd_data[FDUNIT(minor(dev))].options = *(int *)addr; break; diff --git a/sys/isa/joy.c b/sys/isa/joy.c index 942b45a..97225a8 100644 --- a/sys/isa/joy.c +++ b/sys/isa/joy.c @@ -41,7 +41,7 @@ #include <i386/isa/isa_device.h> #include <i386/isa/timerreg.h> -/* The game port can manage 4 buttons and 4 variable resistors (usually 2 +/* The game port can manage 4 buttons and 4 variable resistors (usually 2 * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. * Getting the state of the buttons is done by reading the game port: * buttons 1-4 correspond to bits 4-7 and resistors 1-4 (X1, Y1, X2, Y2) @@ -52,7 +52,7 @@ */ -/* the formulae below only work if u is ``not too large''. See also +/* the formulae below only work if u is ``not too large''. See also * the discussion in microtime.s */ #define usec2ticks(u) (((u) * 19549)>>14) #define ticks2usec(u) (((u) * 3433)>>12) @@ -114,7 +114,7 @@ joyopen (dev_t dev, int flag) joy[unit].timeout[i] = JOY_TIMEOUT; return 0; } -int +int joyclose (dev_t dev, int flag) { int unit = UNIT (dev); @@ -132,7 +132,7 @@ joyread (dev_t dev, struct uio *uio, int flag) int i, t0, t1; int state = 0, x = 0, y = 0; struct joystick c; - + disable_intr (); outb (port, 0xff); t0 = get_tick (); @@ -140,7 +140,7 @@ joyread (dev_t dev, struct uio *uio, int flag) i = usec2ticks(joy[unit].timeout[joypart(dev)]); while (t0-t1 < i) { state = inb (port); - if (joypart(dev) == 1) + if (joypart(dev) == 1) state >>= 2; t1 = get_tick (); if (t1 > t0) @@ -149,7 +149,7 @@ joyread (dev_t dev, struct uio *uio, int flag) x = t1; if (!y && !(state & 0x02)) y = t1; - if (x && y) + if (x && y) break; } enable_intr (); diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 9764ef6..4ae58cd 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.97 1995/05/07 23:00:02 ache Exp $ + * $Id: sio.c,v 1.98 1995/05/11 19:26:19 rgrimes Exp $ */ #include "sio.h" @@ -630,7 +630,7 @@ sioattach(isdp) #ifdef DSI_SOFT_MODEM if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) { printf(" Digicom Systems, Inc. SoftModem"); - kdc_sio[unit].kdc_description = + kdc_sio[unit].kdc_description = "Serial port: Digicom Systems SoftModem"; goto determined_type; } @@ -1326,15 +1326,15 @@ sioioctl(dev, cmd, data, flag, p) pi = (u_char*)(*(caddr_t*)data); error = copyin(pi,&l,sizeof l); - if(error) + if(error) {return error;}; pi += sizeof l; p = malloc(l,M_TEMP,M_NOWAIT); - if(!p) + if(!p) {return ENOBUFS;} error = copyin(pi,p,l); - if(error) + if(error) {free(p,M_TEMP); return error;}; if(error = LoadSoftModem( MINOR_TO_UNIT(mynor),iobase,l,p)) @@ -2229,7 +2229,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) int int_c,int_k; int data_0188, data_0187; - /* + /* * First see if it is a DSI SoftModem */ if(!((inb(base_io+7) ^ inb(base_io+7) & 0x80))) @@ -2248,8 +2248,8 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) DSI_ERROR("dsp bus not granted"); if(0x01 != (inb(base_io+7) & 0x01)) { - outb(base_io+7,0x18); - outb(base_io+7,0x19); + outb(base_io+7,0x18); + outb(base_io+7,0x19); if(0x01 != (inb(base_io+7) & 0x01)) DSI_ERROR("program mem not granted"); } @@ -2275,14 +2275,14 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+7,0x19); if(0x00 != (inb(base_io+7) & 0x01)) DSI_ERROR("program data not granted"); - + for(int_k = 0 ; int_k < 0x800; int_k++) { outb(base_io+1,*ptr++); outb(base_io+2,0); outb(base_io+1,*ptr++); outb(base_io+2,*ptr++); } - + size -= 0x1800; while(size > 0x1800) { @@ -2299,7 +2299,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - + } else if (size > 0) { if(int_c == 7) { outb(base_io+7,0x18); @@ -2319,7 +2319,7 @@ LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr) outb(base_io+2,*ptr++); } } - } + } outb(base_io+7,0x11); outb(base_io+7,3); diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index 123e2a9..19c572a 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.115 1995/04/28 09:10:56 sos Exp $ + * $Id: syscons.c,v 1.116 1995/05/21 18:30:05 sos Exp $ */ #include "sc.h" @@ -65,7 +65,7 @@ #endif /* this may break on older VGA's but is usefull on real 32 bit systems */ -#define bcopyw bcopy +#define bcopyw bcopy static default_attr user_default = { (FG_LIGHTGREY | BG_BLACK) << 8, @@ -81,7 +81,7 @@ static scr_stat main_console; static scr_stat *console[MAXCONS]; scr_stat *cur_console; static scr_stat *new_scp, *old_scp; -static term_stat kernel_console; +static term_stat kernel_console; static default_attr *current_default; static char init_done = FALSE; static int configuration = 0; @@ -107,7 +107,7 @@ static char *video_mode_ptr = NULL; static u_char kbd_reply = 0; #endif -static u_short mouse_and_mask[16] = { +static u_short mouse_and_mask[16] = { 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xfe00, 0x1e00, 0x1f00, 0x0f00, 0x0f00, 0x0000, 0x0000, 0x0000 }; @@ -168,7 +168,7 @@ scprobe(struct isa_device *dev) DELAY(10); val = inb(KB_DATA); if (val == KB_ACK || val == KB_ECHO) - goto gotres; + goto gotres; if (val == KB_RESEND) break; } @@ -184,7 +184,7 @@ gotack: val = inb(KB_DATA); if (val == KB_ACK) goto gotack; - if (val != KB_RESET_DONE) + if (val != KB_RESET_DONE) printf("scprobe: keyboard RESET failed %02x\n", val); } #ifdef XT_KEYBOARD @@ -218,8 +218,8 @@ sc_registerdev(struct isa_device *id) dev_attach(&kdc_sc[id->id_unit]); } -#if NAPM > 0 -static int +#if NAPM > 0 +static int scresume(void *dummy) { shfts = 0; @@ -265,7 +265,7 @@ scattach(struct isa_device *dev) bzero(scp->history_head, scp->history_size*sizeof(u_short)); /* initialize cursor stuff */ - draw_cursor(scp, TRUE); + draw_cursor(scp, TRUE); if (crtc_vga && (configuration & CHAR_CURSOR)) set_destructive_cursor(scp, TRUE); @@ -279,12 +279,12 @@ scattach(struct isa_device *dev) if (crtc_vga) if (crtc_addr == MONO_BASE) printf("VGA mono"); - else + else printf("VGA color"); else if (crtc_addr == MONO_BASE) printf("MDA/hercules"); - else + else printf("CGA/EGA"); printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, configuration); @@ -298,7 +298,7 @@ scattach(struct isa_device *dev) return 0; } -struct tty +struct tty *scdevtotty(dev_t dev) { int unit = minor(dev); @@ -310,7 +310,7 @@ struct tty return VIRTUAL_TTY(unit); } -static scr_stat +static scr_stat *get_scr_stat(dev_t dev) { int unit = minor(dev); @@ -332,7 +332,7 @@ get_scr_num() return i < MAXCONS ? i : 0; } -int +int scopen(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -352,8 +352,8 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; scparam(tp, &tp->t_termios); ttsetwater(tp); - } - else + } + else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) return(EBUSY); tp->t_state |= TS_CARR_ON; @@ -363,7 +363,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) return((*linesw[tp->t_line].l_open)(dev, tp)); } -int +int scclose(dev_t dev, int flag, int mode, struct proc *p) { struct tty *tp = scdevtotty(dev); @@ -382,8 +382,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) scp->smode.mode = VT_AUTO; } else { - free(scp->scr_buf, M_DEVBUF); - free(scp->history, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); + free(scp->history, M_DEVBUF); free(scp, M_DEVBUF); console[minor(dev)] = NULL; } @@ -394,11 +394,11 @@ scclose(dev_t dev, int flag, int mode, struct proc *p) #endif } (*linesw[tp->t_line].l_close)(tp, flag); - ttyclose(tp); + ttyclose(tp); return(0); } -int +int scread(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -408,7 +408,7 @@ scread(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_read)(tp, uio, flag)); } -int +int scwrite(dev_t dev, struct uio *uio, int flag) { struct tty *tp = scdevtotty(dev); @@ -418,7 +418,7 @@ scwrite(dev_t dev, struct uio *uio, int flag) return((*linesw[tp->t_line].l_write)(tp, uio, flag)); } -void +void scintr(int unit) { static struct tty *cur_tty; @@ -461,10 +461,10 @@ scintr(int unit) (*linesw[cur_tty->t_line].l_rint)('[', cur_tty); (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty); break; - } + } } -int +int scparam(struct tty *tp, struct termios *t) { tp->t_ispeed = t->c_ispeed; @@ -473,13 +473,13 @@ scparam(struct tty *tp, struct termios *t) return 0; } -int +int scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { int i, error; struct tty *tp; struct trapframe *fp; - scr_stat *scp; + scr_stat *scp; tp = scdevtotty(dev); if (!tp) @@ -498,14 +498,14 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) else *(int*)data = 0; return 0; - + case CONS_CURRENT: /* get current adapter type */ if (crtc_vga) *(int*)data = KD_VGA; else if (crtc_addr == MONO_BASE) *(int*)data = KD_MONO; - else + else *(int*)data = KD_CGA; return 0; @@ -538,7 +538,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case CONS_HISTORY: /* set history size */ if (*data) { - free(scp->history, M_DEVBUF); + free(scp->history, M_DEVBUF); scp->history_size = *(int*)data; if (scp->history_size < scp->ysize) scp->history = NULL; @@ -604,7 +604,7 @@ set_mouse_pos: scp->mouse_xpos = (scp->xsize*8)-1; if (scp->mouse_ypos >= scp->ysize*fontsize) scp->mouse_ypos = (scp->ysize*fontsize)-1; - scp->mouse_pos = scp->scr_buf + + scp->mouse_pos = scp->scr_buf + (scp->mouse_ypos/fontsize)*scp->xsize + scp->mouse_xpos/8; if (scp->status & MOUSE_ENABLED) scp->status |= UPDATE_MOUSE; @@ -664,7 +664,7 @@ set_mouse_pos: case SW_VGA_C80x60: case SW_VGA_M80x60: case SW_B40x25: case SW_C40x25: case SW_B80x25: case SW_C80x25: - case SW_ENH_B40x25: case SW_ENH_C40x25: + case SW_ENH_B40x25: case SW_ENH_C40x25: case SW_ENH_B80x25: case SW_ENH_C80x25: case SW_ENH_B80x43: case SW_ENH_C80x43: @@ -696,26 +696,26 @@ set_mouse_pos: default: if ((cmd & 0xff) > M_VGA_CG320) return EINVAL; - else + else scp->xsize = *(video_mode_ptr+((cmd&0xff)*64)); scp->ysize = *(video_mode_ptr+((cmd&0xff)*64)+1)+1; break; } scp->mode = cmd & 0xff; scp->status &= ~UNKNOWN_MODE; /* text mode */ - free(scp->scr_buf, M_DEVBUF); + free(scp->scr_buf, M_DEVBUF); scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short), M_DEVBUF, M_NOWAIT); if (scp == cur_console) set_mode(scp); clear_screen(scp); - if (tp->t_winsize.ws_col != scp->xsize + if (tp->t_winsize.ws_col != scp->xsize || tp->t_winsize.ws_row != scp->ysize) { tp->t_winsize.ws_col = scp->xsize; tp->t_winsize.ws_row = scp->ysize; pgsignal(tp->t_pgrp, SIGWINCH, 1); } - return 0; + return 0; /* GRAPHICS MODES */ case SW_BG320: case SW_BG640: @@ -733,7 +733,7 @@ set_mouse_pos: set_mode(scp); /* clear_graphics();*/ - if (tp->t_winsize.ws_xpixel != scp->xsize + if (tp->t_winsize.ws_xpixel != scp->xsize || tp->t_winsize.ws_ypixel != scp->ysize) { tp->t_winsize.ws_xpixel = scp->xsize; tp->t_winsize.ws_ypixel = scp->ysize; @@ -748,11 +748,11 @@ set_mouse_pos: scp->pid = scp->proc->p_pid; } return 0; - + case VT_GETMODE: /* get screen switcher mode */ bcopy(&scp->smode, data, sizeof(struct vt_mode)); return 0; - + case VT_RELDISP: /* screen switcher ioctl */ switch(*data) { case VT_FALSE: /* user refuses to release screen, abort */ @@ -771,7 +771,7 @@ set_mouse_pos: new_scp->status |= SWITCH_WAIT_ACQ; psignal(new_scp->proc, new_scp->smode.acqsig); } - else + else switch_in_progress = FALSE; return 0; } @@ -797,24 +797,24 @@ set_mouse_pos: *data = i + 1; return 0; } - } + } return EINVAL; case VT_ACTIVATE: /* switch to screen *data */ return switch_scr(scp, (*data) - 1); case VT_WAITACTIVE: /* wait for switch to occur */ - if (*data > MAXCONS || *data < 0) + if (*data > MAXCONS || *data < 0) return EINVAL; - if (minor(dev) == (*data) - 1) + if (minor(dev) == (*data) - 1) return 0; if (*data == 0) { if (scp == cur_console) return 0; } - else + else scp = console[(*data) - 1]; - while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, + while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH, "waitvt", 0)) == ERESTART) ; return error; @@ -825,7 +825,7 @@ set_mouse_pos: case KDENABIO: /* allow io operations */ fp = (struct trapframe *)p->p_md.md_regs; fp->tf_eflags |= PSL_IOPL; - return 0; + return 0; case KDDISABIO: /* disallow io operations (default) */ fp = (struct trapframe *)p->p_md.md_regs; @@ -873,7 +873,7 @@ set_mouse_pos: if (!crtc_vga) return ENXIO; scp->border = *data; - if (scp == cur_console) + if (scp == cur_console) set_border(scp->border); return 0; @@ -881,7 +881,7 @@ set_mouse_pos: if (*data >= 0 && *data <= LOCK_KEY_MASK) { scp->status &= ~LOCK_KEY_MASK; scp->status |= *data; - if (scp == cur_console) + if (scp == cur_console) update_leds(scp->status); return 0; } @@ -984,7 +984,7 @@ set_mouse_pos: case SETFKEY: /* set functionkey string */ if (*(u_short*)data < n_fkey_tab) { fkeyarg_t *ptr = (fkeyarg_t*)data; - bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, + bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str, min(ptr->flen, MAXFK)); fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK); return 0; @@ -1069,8 +1069,8 @@ set_mouse_pos: return ENXIO; default: break; - } - + } + error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); if (error >= 0) return(error); @@ -1080,7 +1080,7 @@ set_mouse_pos: return(ENOTTY); } -void +void scxint(dev_t dev) { struct tty *tp = scdevtotty(dev); @@ -1094,7 +1094,7 @@ scxint(dev_t dev) scstart(tp); } -void +void scstart(struct tty *tp) { struct clist *rbp; @@ -1126,7 +1126,7 @@ scstart(struct tty *tp) splx(s); } -void +void pccnprobe(struct consdev *cp) { int maj; @@ -1141,13 +1141,13 @@ pccnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; } -void +void pccninit(struct consdev *cp) { scinit(); } -void +void pccnputc(dev_t dev, int c) { u_char buf[1]; @@ -1169,7 +1169,7 @@ pccnputc(dev_t dev, int c) scp->term = save; if (scp == cur_console /* && scrn_timer not running */) { if (scp->scr_buf != Crtat && (scp->start <= scp->end)) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->start = scp->xsize * scp->ysize; scp->end = 0; @@ -1179,7 +1179,7 @@ pccnputc(dev_t dev, int c) } } -int +int pccngetc(dev_t dev) { int s = spltty(); /* block scintr while we poll */ @@ -1188,13 +1188,13 @@ pccngetc(dev_t dev) return(c); } -int +int pccncheckc(dev_t dev) { return (scgetc(1) & 0xff); } -static void +static void scrn_timer() { static int cursor_blinkrate; @@ -1205,11 +1205,11 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/10); return; } - + if (!scrn_blanked) { /* update screen image */ if (scp->start <= scp->end) { - bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, + bcopyw(scp->scr_buf + scp->start, Crtat + scp->start, (1 + scp->end - scp->start) * sizeof(u_short)); scp->status &= ~CURSOR_SHOWN; scp->start = scp->xsize * scp->ysize; @@ -1229,7 +1229,7 @@ scrn_timer() timeout((timeout_func_t)scrn_timer, 0, hz/25); } -static void +static void clear_screen(scr_stat *scp) { move_crsr(scp, 0, 0); @@ -1238,14 +1238,14 @@ clear_screen(scr_stat *scp) mark_all(scp); } -static int +static int switch_scr(scr_stat *scp, u_int next_scr) { if (switch_in_progress && (cur_console->proc != pfind(cur_console->pid))) switch_in_progress = FALSE; - if (next_scr >= MAXCONS || switch_in_progress || - (cur_console->smode.mode == VT_AUTO + if (next_scr >= MAXCONS || switch_in_progress || + (cur_console->smode.mode == VT_AUTO && cur_console->status & UNKNOWN_MODE)) { do_bell(scp, BELL_PITCH, BELL_DURATION); return EINVAL; @@ -1273,7 +1273,7 @@ switch_scr(scr_stat *scp, u_int next_scr) delayed_next_scr = FALSE; return 0; } - + /* has controlling process died? */ if (old_scp->proc && (old_scp->proc != pfind(old_scp->pid))) old_scp->smode.mode = VT_AUTO; @@ -1297,8 +1297,8 @@ switch_scr(scr_stat *scp, u_int next_scr) return 0; } -static void -exchange_scr(void) +static void +exchange_scr(void) { move_crsr(old_scp, old_scp->xpos, old_scp->ypos); cur_console = new_scp; @@ -1327,7 +1327,7 @@ exchange_scr(void) new_scp->status &= ~CURSOR_SHOWN; } -static inline void +static inline void move_crsr(scr_stat *scp, int x, int y) { if (x < 0 || y < 0 || x >= scp->xsize || y >= scp->ysize) @@ -1339,10 +1339,10 @@ move_crsr(scr_stat *scp, int x, int y) mark_for_update(scp, scp->cursor_pos - scp->scr_buf); } -static void +static void scan_esc(scr_stat *scp, u_char c) { - static u_char ansi_col[16] = + static u_char ansi_col[16] = {0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15}; int i, n; u_short *src, *dst, count; @@ -1364,7 +1364,7 @@ scan_esc(scr_stat *scp, u_char c) else { bcopyw(scp->scr_buf, scp->scr_buf + scp->xsize, (scp->ysize - 1) * scp->xsize * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize); mark_all(scp); } @@ -1440,7 +1440,7 @@ scan_esc(scr_stat *scp, u_char c) case 'f': /* Cursor move */ case 'H': - if (scp->term.num_param == 0) + if (scp->term.num_param == 0) move_crsr(scp, 0, 0); else if (scp->term.num_param == 2) move_crsr(scp, scp->term.param[1] - 1, scp->term.param[0] - 1); @@ -1454,14 +1454,14 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of display */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->scr_buf + scp->xsize * scp->ysize - scp->cursor_pos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->xsize * scp->ysize); break; case 1: /* clear from beginning of display to cursor */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf, + scp->scr_buf, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, 0); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); @@ -1480,21 +1480,21 @@ scan_esc(scr_stat *scp, u_char c) switch (n) { case 0: /* clear form cursor to end of line */ fillw(scp->term.cur_attr | scr_map[0x20], - scp->cursor_pos, + scp->cursor_pos, scp->xsize - scp->xpos); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + scp->xsize - scp->xpos); break; case 1: /* clear from beginning of line to cursor */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), (scp->xsize - scp->xpos) + 1); mark_for_update(scp, scp->ypos * scp->xsize); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); break; case 2: /* clear entire line */ - fillw(scp->term.cur_attr|scr_map[0x20], + fillw(scp->term.cur_attr|scr_map[0x20], scp->cursor_pos - (scp->xsize - scp->xpos), scp->xsize); mark_for_update(scp, scp->ypos * scp->xsize); @@ -1563,11 +1563,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf + (scp->xsize * n), - scp->scr_buf, + bcopyw(scp->scr_buf + (scp->xsize * n), + scp->scr_buf, scp->xsize * (scp->ysize - n) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - n), + scp->scr_buf + scp->xsize * (scp->ysize - n), scp->xsize * n); mark_all(scp); break; @@ -1576,11 +1576,11 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->ysize) n = scp->ysize; - bcopyw(scp->scr_buf, + bcopyw(scp->scr_buf, scp->scr_buf + (scp->xsize * n), - scp->xsize * (scp->ysize - n) * + scp->xsize * (scp->ysize - n) * sizeof(u_short)); - fillw(scp->term.cur_attr | scr_map[0x20], + fillw(scp->term.cur_attr | scr_map[0x20], scp->scr_buf, scp->xsize * n); mark_all(scp); break; @@ -1589,8 +1589,8 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if (n > scp->xsize - scp->xpos) n = scp->xsize - scp->xpos; - fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xpos + + fillw(scp->term.cur_attr | scr_map[0x20], + scp->scr_buf + scp->xpos + ((scp->xsize*scp->ypos) * sizeof(u_short)), n); mark_for_update(scp, scp->cursor_pos - scp->scr_buf); mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n); @@ -1600,9 +1600,9 @@ scan_esc(scr_stat *scp, u_char c) n = scp->term.param[0]; if (n < 1) n = 1; if ((i = scp->xpos & 0xf8) == scp->xpos) i -= 8*n; - else - i -= 8*(n-1); - if (i < 0) + else + i -= 8*(n-1); + if (i < 0) i = 0; move_crsr(scp, i, scp->ypos); break; @@ -1653,15 +1653,15 @@ scan_esc(scr_stat *scp, u_char c) scp->term.cur_attr = scp->term.rev_attr; break; case 30: case 31: /* set fg color */ - case 32: case 33: case 34: + case 32: case 33: case 34: case 35: case 36: case 37: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0xF8FF) | (ansi_col[(n-30)&7]<<8); break; case 40: case 41: /* set bg color */ - case 42: case 43: case 44: + case 42: case 43: case 44: case 45: case 46: case 47: - scp->term.cur_attr = + scp->term.cur_attr = (scp->term.cur_attr&0x8FFF) | (ansi_col[(n-40)&7]<<12); break; } @@ -1680,12 +1680,12 @@ scan_esc(scr_stat *scp, u_char c) scp->term.rev_attr = current_default->rev_attr; break; case 1: /* set ansi background */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 2: /* set ansi foreground */ - scp->term.cur_attr = scp->term.std_attr = + scp->term.cur_attr = scp->term.std_attr = (scp->term.std_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1694,12 +1694,12 @@ scan_esc(scr_stat *scp, u_char c) (scp->term.param[1]&0xFF)<<8; break; case 5: /* set ansi reverse video background */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0x0F00) | (ansi_col[(scp->term.param[1])&0x0F]<<12); break; case 6: /* set ansi reverse video foreground */ - scp->term.rev_attr = + scp->term.rev_attr = (scp->term.rev_attr & 0xF000) | (ansi_col[(scp->term.param[1])&0x0F]<<8); break; @@ -1764,38 +1764,38 @@ scan_esc(scr_stat *scp, u_char c) configuration &= ~CHAR_CURSOR; } else if (scp->term.num_param == 2) { - scp->cursor_start = scp->term.param[0] & 0x1F; - scp->cursor_end = scp->term.param[1] & 0x1F; + scp->cursor_start = scp->term.param[0] & 0x1F; + scp->cursor_end = scp->term.param[1] & 0x1F; if (configuration & CHAR_CURSOR) set_destructive_cursor(scp, TRUE); } break; case 'F': /* set ansi foreground */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'G': /* set ansi background */ - if (scp->term.num_param == 1) - scp->term.cur_attr = scp->term.std_attr = - (scp->term.std_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.cur_attr = scp->term.std_attr = + (scp->term.std_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; case 'H': /* set ansi reverse video foreground */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0xF000) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0xF000) | ((scp->term.param[0] & 0x0F) << 8); break; case 'I': /* set ansi reverse video background */ - if (scp->term.num_param == 1) - scp->term.rev_attr = - (scp->term.rev_attr & 0x0F00) + if (scp->term.num_param == 1) + scp->term.rev_attr = + (scp->term.rev_attr & 0x0F00) | ((scp->term.param[0] & 0x0F) << 12); break; } @@ -1803,7 +1803,7 @@ scan_esc(scr_stat *scp, u_char c) scp->term.esc = 0; } -static inline void +static inline void draw_cursor(scr_stat *scp, int show) { if (show && !(scp->status & CURSOR_SHOWN)) { @@ -1836,12 +1836,12 @@ draw_cursor(scr_stat *scp, int show) } } -static void +static void ansi_put(scr_stat *scp, u_char *buf, int len) { u_char *ptr = buf; - if (scp->status & UNKNOWN_MODE) + if (scp->status & UNKNOWN_MODE) return; /* make screensaver happy */ @@ -1945,7 +1945,7 @@ outloop: bcopyw(scp->scr_buf + scp->xsize, scp->scr_buf, scp->xsize * (scp->ysize - 1) * sizeof(u_short)); fillw(scp->term.cur_attr | scr_map[0x20], - scp->scr_buf + scp->xsize * (scp->ysize - 1), + scp->scr_buf + scp->xsize * (scp->ysize - 1), scp->xsize); scp->cursor_pos -= scp->xsize; scp->ypos--; @@ -1958,14 +1958,14 @@ outloop: switch_scr(scp, delayed_next_scr - 1); } -static void +static void scinit(void) { u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/sizeof(u_short), was; unsigned hw_cursor; int i; - if (init_done) + if (init_done) return; init_done = TRUE; /* @@ -2033,7 +2033,7 @@ scinit(void) scr_map[i] = i; } -static scr_stat +static scr_stat *alloc_scp() { scr_stat *scp; @@ -2081,7 +2081,7 @@ init_scp(scr_stat *scp) scp->history_size = HISTORY_SIZE; } -static u_char +static u_char *get_fstr(u_int c, u_int *len) { u_int i; @@ -2095,7 +2095,7 @@ static u_char return(fkey_tab[i].str); } -static void +static void update_leds(int which) { int s; @@ -2113,14 +2113,14 @@ update_leds(int which) kbd_cmd(xlate_leds[which & LED_MASK]); splx(s); } - + static void history_to_screen(scr_stat *scp) { int i; for (i=0; i<scp->ysize; i++) - bcopyw(scp->history + (((scp->history_pos - scp->history) + + bcopyw(scp->history + (((scp->history_pos - scp->history) + scp->history_size-((i+1)*scp->xsize))%scp->history_size), scp->scr_buf + (scp->xsize * (scp->ysize-1 - i)), scp->xsize * sizeof(u_short)); @@ -2153,11 +2153,11 @@ history_down_line(scr_stat *scp) } /* - * scgetc(noblock) - get character from keyboard. + * scgetc(noblock) - get character from keyboard. * If noblock = 0 wait until a key is pressed. * Else return NOKEY. */ -u_int +u_int scgetc(int noblock) { u_char scancode, keycode; @@ -2192,9 +2192,9 @@ next_code: switch(scancode) { case 0xB8: /* left alt (compose key) */ if (compose) { - compose = 0; + compose = 0; if (chr > 255) { - do_bell(cur_console, + do_bell(cur_console, BELL_PITCH, BELL_DURATION); chr = 0; } @@ -2209,7 +2209,7 @@ next_code: case 0xE0: case 0xE1: esc_flag = scancode; - goto next_code; + goto next_code; } break; case 0xE0: /* 0xE0 prefix */ @@ -2276,13 +2276,13 @@ next_code: } break; case 0xE1: /* 0xE1 prefix */ - esc_flag = 0; + esc_flag = 0; if (keycode == 0x1D) esc_flag = 0x1D; goto next_code; /* NOT REACHED */ case 0x1D: /* pause / break */ - esc_flag = 0; + esc_flag = 0; if (keycode != 0x45) goto next_code; keycode = 0x68; @@ -2300,7 +2300,7 @@ next_code: /* copy screen into top of history buffer */ for (i=0; i<cur_console->ysize; i++) { - bcopyw(cur_console->scr_buf + (cur_console->xsize * i), + bcopyw(cur_console->scr_buf + (cur_console->xsize * i), cur_console->history_head, cur_console->xsize * sizeof(u_short)); cur_console->history_head += cur_console->xsize; @@ -2319,7 +2319,7 @@ next_code: case 0x4F: /* end key */ cur_console->history_pos = - WRAPHIST(cur_console, cur_console->history_head, + WRAPHIST(cur_console, cur_console->history_head, cur_console->xsize*cur_console->ysize); history_to_screen(cur_console); goto next_code; @@ -2358,10 +2358,10 @@ next_code: case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */ chr = (scancode - 0x40) + chr*10; goto next_code; - case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ + case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */ chr = (scancode - 0x47) + chr*10; goto next_code; - case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ + case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */ chr = (scancode - 0x4E) + chr*10; goto next_code; case 0x52: /* keypad 0 */ @@ -2370,8 +2370,8 @@ next_code: /* key release, no interest here */ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */ - case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ - case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ + case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */ + case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */ case 0xD2: /* keypad 0 */ goto next_code; @@ -2381,12 +2381,12 @@ next_code: if (chr) { compose = chr = 0; do_bell(cur_console, BELL_PITCH, BELL_DURATION); - goto next_code; + goto next_code; } break; } } - + state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0)); if ((!agrs && (cur_console->status & ALKED)) || (agrs && !(cur_console->status & ALKED))) @@ -2420,7 +2420,7 @@ next_code: alts &= ~2; break; case NLK: - nlkcnt = 0; + nlkcnt = 0; break; case CLK: clkcnt = 0; @@ -2452,7 +2452,7 @@ next_code: case NLK: if (!nlkcnt) { nlkcnt++; - if (cur_console->status & NLKED) + if (cur_console->status & NLKED) cur_console->status &= ~NLKED; else cur_console->status |= NLKED; @@ -2479,7 +2479,7 @@ next_code: u_short *ptr = cur_console->history_save; for (i=0; i<cur_console->ysize; i++) { - bcopyw(ptr, + bcopyw(ptr, cur_console->scr_buf + (cur_console->xsize*i), cur_console->xsize * sizeof(u_short)); @@ -2495,8 +2495,8 @@ next_code: mark_all(cur_console); } scstart(VIRTUAL_TTY(get_scr_num())); - } - else + } + else cur_console->status |= SLKED; update_leds(cur_console->status); } @@ -2517,9 +2517,9 @@ next_code: break; case RBT: shutdown_nice(); - break; + break; case SUSP: -#if NAPM > 0 +#if NAPM > 0 apm_suspend(); #endif break; @@ -2528,7 +2528,7 @@ next_code: #ifdef DDB /* try to switch to console 0 */ if (cur_console->smode.mode == VT_AUTO && console[0]->smode.mode == VT_AUTO) - switch_scr(cur_console, 0); + switch_scr(cur_console, 0); Debugger("manual escape to debugger"); return(NOKEY); #else @@ -2569,7 +2569,7 @@ next_code: switch_scr(cur_console, action - F_SCR); break; } - if (action >= F_FN && action <= L_FN) + if (action >= F_FN && action <= L_FN) action |= FKEY; return(action); } @@ -2583,7 +2583,7 @@ next_code: goto next_code; } -int +int scmmap(dev_t dev, int offset, int nprot) { if (offset > 0x20000 - PAGE_SIZE) @@ -2591,19 +2591,19 @@ scmmap(dev_t dev, int offset, int nprot) return i386_btop((VIDEOMEM + offset)); } -static void +static void kbd_wait(void) { int i = 1000; while (i--) { - if ((inb(KB_STAT) & KB_READY) == 0) + if ((inb(KB_STAT) & KB_READY) == 0) break; DELAY (10); } } -static void +static void kbd_cmd(u_char command) { int retry = 5; @@ -2637,7 +2637,7 @@ kbd_cmd(u_char command) } while (retry--); } -static void +static void set_mode(scr_stat *scp) { char *modetable; @@ -2649,11 +2649,11 @@ set_mode(scr_stat *scp) /* setup video hardware for the given mode */ switch (scp->mode) { - case M_VGA_M80x60: + case M_VGA_M80x60: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x60; - case M_VGA_C80x60: + case M_VGA_C80x60: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); special_80x60: special_modetable[2] = 0x08; @@ -2673,7 +2673,7 @@ special_480l: special_modetable[16] = 0x08; special_modetable[17] = 0x3e; special_modetable[26] = 0xea; - special_modetable[28] = 0xdf; + special_modetable[28] = 0xdf; special_modetable[31] = 0xe7; special_modetable[32] = 0x04; modetable = special_modetable; @@ -2685,17 +2685,17 @@ special_480l: case M_ENH_C80x43: bcopyw(video_mode_ptr+(64*M_ENH_C80x25),&special_modetable, 64); -special_80x43: +special_80x43: special_modetable[28] = 87; goto special_80x50; - case M_VGA_M80x50: + case M_VGA_M80x50: bcopyw(video_mode_ptr+(64*M_VGA_M80x25),&special_modetable, 64); goto special_80x50; case M_VGA_C80x50: bcopyw(video_mode_ptr+(64*M_VGA_C80x25),&special_modetable, 64); -special_80x50: +special_80x50: special_modetable[2] = 8; special_modetable[19] = 7; modetable = special_modetable; @@ -2737,7 +2737,7 @@ setup_mode: case M_CG320_D: case M_CG640_E: case M_CG640x350: case M_ENH_CG640: case M_BG640x480: case M_CG640x480: case M_VGA_CG320: - + set_vgaregs(video_mode_ptr + (scp->mode * 64)); break; @@ -2751,11 +2751,11 @@ setup_mode: return; } -void +void set_border(int color) { inb(crtc_addr+6); /* reset flip-flop */ - outb(ATC, 0x11); outb(ATC, color); + outb(ATC, 0x11); outb(ATC, color); inb(crtc_addr+6); /* reset flip-flop */ outb(ATC, 0x20); /* enable Palette */ } @@ -2768,7 +2768,7 @@ set_vgaregs(char *modetable) outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */ outb(TSIDX, 0x07); outb(TSREG, 0x00); /* unlock registers */ for (i=0; i<4; i++) { /* program sequencer */ - outb(TSIDX, i+1); + outb(TSIDX, i+1); outb(TSREG, modetable[i+5]); } outb(MISC, modetable[9]); /* set dot-clock */ @@ -2776,7 +2776,7 @@ set_vgaregs(char *modetable) outb(crtc_addr, 0x11); outb(crtc_addr+1, inb(crtc_addr+1) & 0x7F); for (i=0; i<25; i++) { /* program crtc */ - outb(crtc_addr, i); + outb(crtc_addr, i); if (i == 14 || i == 15) /* no hardware cursor */ outb(crtc_addr+1, 0xff); else @@ -2784,11 +2784,11 @@ set_vgaregs(char *modetable) } inb(crtc_addr+6); /* reset flip-flop */ for (i=0; i<20; i++) { /* program attribute ctrl */ - outb(ATC, i); + outb(ATC, i); outb(ATC, modetable[i+35]); } for (i=0; i<9; i++) { /* program graph data ctrl */ - outb(GDCIDX, i); + outb(GDCIDX, i); outb(GDCREG, modetable[i+55]); } inb(crtc_addr+6); /* reset flip-flop */ @@ -2807,7 +2807,7 @@ set_font_mode() outb(TSIDX, 0x04); outb(TSREG, 0x06); outb(GDCIDX, 0x04); outb(GDCREG, 0x02); outb(GDCIDX, 0x05); outb(GDCREG, 0x00); - outb(GDCIDX, 0x06); outb(GDCREG, 0x05); + outb(GDCIDX, 0x06); outb(GDCREG, 0x05); #else outw(TSIDX, 0x0402); outw(TSIDX, 0x0604); @@ -2849,7 +2849,7 @@ set_normal_mode() splx(s); } -static void +static void copy_font(int operation, int font_type, char* font_image) { int ch, line, segment, fontsize; @@ -2873,11 +2873,11 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */ outb(TSIDX, 0x01); outb(TSREG, val | 0x20); set_font_mode(); - for (ch=0; ch < 256; ch++) - for (line=0; line < fontsize; line++) + for (ch=0; ch < 256; ch++) + for (line=0; line < fontsize; line++) if (operation) *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line) = - font_image[(ch*fontsize)+line]; + font_image[(ch*fontsize)+line]; else font_image[(ch*fontsize)+line] = *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line); @@ -2885,7 +2885,7 @@ copy_font(int operation, int font_type, char* font_image) outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); /* enable screen */ } -static void +static void set_destructive_cursor(scr_stat *scp, int force) { u_char cursor[32]; @@ -2918,7 +2918,7 @@ set_destructive_cursor(scr_stat *scp, int force) bcopyw(font_buffer + ((scp->cursor_saveunder & 0xff) * font_size), cursor, font_size); for (i=0; i<32; i++) - if ((i >= scp->cursor_start && i <= scp->cursor_end) || + if ((i >= scp->cursor_start && i <= scp->cursor_end) || (scp->cursor_start >= font_size && i == font_size - 1)) cursor[i] |= 0xff; while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ; @@ -3018,25 +3018,25 @@ draw_mouse_image(scr_stat *scp) set_normal_mode(); } -static void +static void save_palette(void) { int i; - outb(PALRADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALRADR, 0x00); + for (i=0x00; i<0x300; i++) palette[i] = inb(PALDATA); inb(crtc_addr+6); /* reset flip/flop */ } -void +void load_palette(void) { int i; outb(PIXMASK, 0xFF); /* no pixelmask */ - outb(PALWADR, 0x00); - for (i=0x00; i<0x300; i++) + outb(PALWADR, 0x00); + for (i=0x00; i<0x300; i++) outb(PALDATA, palette[i]); inb(crtc_addr+6); /* reset flip/flop */ outb(ATC, 0x20); /* enable palette */ @@ -3052,7 +3052,7 @@ do_bell(scr_stat *scp, int pitch, int duration) blink_in_progress = 4; blink_screen(scp); timeout((timeout_func_t)blink_screen, scp, hz/10); - } + } else sysbeep(pitch, duration); } diff --git a/sys/isa/syscons.h b/sys/isa/syscons.h index 649b653..4b22de6 100644 --- a/sys/isa/syscons.h +++ b/sys/isa/syscons.h @@ -6,7 +6,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.h,v 1.7 1995/04/04 20:04:17 sos Exp $ + * $Id: syscons.h,v 1.8 1995/04/23 10:15:38 bde Exp $ */ #ifndef SYSCONS_H diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c index 9ae15f6..e035ce0 100644 --- a/sys/isofs/cd9660/cd9660_lookup.c +++ b/sys/isofs/cd9660/cd9660_lookup.c @@ -38,7 +38,7 @@ * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 * * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_lookup.c,v 1.5 1994/09/26 00:32:54 gpalmer Exp $ + * $Id: cd9660_lookup.c,v 1.6 1995/01/16 17:03:23 joerg Exp $ */ #include <sys/param.h> @@ -126,7 +126,7 @@ cd9660_lookup(ap) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - + bp = NULL; *vpp = NULL; vdp = ap->a_dvp; @@ -134,7 +134,7 @@ cd9660_lookup(ap) imp = dp->i_mnt; lockparent = flags & LOCKPARENT; wantparent = flags & (LOCKPARENT|WANTPARENT); - + /* * Check accessiblity of directory. */ @@ -142,7 +142,7 @@ cd9660_lookup(ap) return (ENOTDIR); if ((error = VOP_ACCESS(vdp, VEXEC, cred, cnp->cn_proc))) return (error); - + /* * We now have a segment name to search for, and a directory to search. * @@ -197,7 +197,7 @@ cd9660_lookup(ap) vdp = ITOV(dp); *vpp = NULL; } - + len = cnp->cn_namelen; name = cnp->cn_nameptr; /* @@ -208,7 +208,7 @@ cd9660_lookup(ap) len--; name++; } - + /* * If there is cached information on a previous search of * this directory, pick up where we last left off. @@ -236,7 +236,7 @@ cd9660_lookup(ap) iso_nchstats.ncs_2passes++; } endsearch = roundup(dp->i_size, imp->logical_block_size); - + searchloop: while (dp->i_offset < endsearch) { /* @@ -256,7 +256,7 @@ searchloop: */ ep = (struct iso_directory_record *) (bp->b_un.b_addr + entryoffsetinblock); - + reclen = isonum_711 (ep->length); if (reclen == 0) { /* skip to next block, if any */ @@ -264,26 +264,26 @@ searchloop: roundup(dp->i_offset, imp->logical_block_size); continue; } - + if (reclen < ISO_DIRECTORY_RECORD_SIZE) /* illegal entry, stop */ break; - + if (entryoffsetinblock + reclen > imp->logical_block_size) /* entries are not allowed to cross boundaries */ break; - + /* * Check for a name match. */ namelen = isonum_711(ep->name_len); isoflags = isonum_711(imp->iso_ftype == ISO_FTYPE_HIGH_SIERRA? &ep->date[6]: ep->flags); - + if (reclen < ISO_DIRECTORY_RECORD_SIZE + namelen) /* illegal entry, stop */ break; - + switch (imp->iso_ftype) { default: if (!(isoflags & 4) == !assoc) { @@ -375,13 +375,13 @@ notfound: if (nameiop == CREATE || nameiop == RENAME) return (EJUSTRETURN); return (ENOENT); - + found: if (numdirpasses == 2) iso_nchstats.ncs_pass2++; if (bp != NULL) brelse(bp); - + /* * Found component in pathname. * If the final component of path name, save information @@ -389,7 +389,7 @@ found: */ if ((flags & ISLASTCN) && nameiop == LOOKUP) dp->i_diroff = dp->i_offset; - + /* * Step through the translation in the name. We do not `iput' the * directory because we may need it again if a symbolic link @@ -435,7 +435,7 @@ found: ISO_IUNLOCK(pdp); *vpp = ITOV(tdp); } - + /* * Insert name into cache if appropriate. */ @@ -461,13 +461,13 @@ iso_blkatoff(ip, offset, bpp) int bsize = iso_blksize(imp,ip,lbn); struct buf *bp; int error; - + if ((error = bread(ITOV(ip),lbn,bsize,NOCRED,&bp))) { brelse(bp); *bpp = 0; return (error); } *bpp = bp; - + return (0); } diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c index a6292f3..7b321a7 100644 --- a/sys/isofs/cd9660/cd9660_node.c +++ b/sys/isofs/cd9660/cd9660_node.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_node.c,v 1.9 1995/02/21 18:41:30 bde Exp $ + * $Id: cd9660_node.c,v 1.10 1995/03/16 18:12:15 bde Exp $ */ #include <sys/param.h> @@ -117,7 +117,7 @@ iso_dmap(dev,ino,create) { struct iso_dnode *dp; union iso_dhead *dh; - + dh = &iso_dhead[DNOHASH(dev, ino)]; for (dp = dh->dh_chain[0]; dp != (struct iso_dnode *)dh; @@ -132,7 +132,7 @@ iso_dmap(dev,ino,create) dp->i_dev = dev; dp->i_number = ino; insque(dp,dh); - + return dp; } @@ -142,7 +142,7 @@ iso_dunmap(dev) { struct iso_dnode *dp, *dq; union iso_dhead *dh; - + for (dh = iso_dhead; dh < iso_dhead + DNOHSZ; dh++) { for (dp = dh->dh_chain[0]; dp != (struct iso_dnode *)dh; @@ -184,7 +184,7 @@ iso_iget(xp, ino, relocated, ipp, isodir) union iso_ihead *ih; int error, result; struct iso_mnt *imp; - + ih = &iso_ihead[INOHASH(dev, ino)]; loop: for (ip = ih->ih_chain[0]; @@ -218,7 +218,7 @@ loop: ip->i_devvp = 0; ip->i_diroff = 0; ip->i_lockf = 0; - + /* * Put it onto its hash chain and lock it so that other requests for * this inode will block if they arrive while we are sleeping waiting @@ -234,7 +234,7 @@ loop: ip->i_mnt = imp; ip->i_devvp = imp->im_devvp; VREF(ip->i_devvp); - + if (relocated) { /* * On relocated directories we must @@ -252,13 +252,13 @@ loop: } isodir = (struct iso_directory_record *)bp->b_un.b_addr; } - + ip->iso_extent = isonum_733(isodir->extent); ip->i_size = isonum_733(isodir->size); ip->iso_start = isonum_711(isodir->ext_attr_length) + ip->iso_extent; - + vp = ITOV(ip); - + /* * Setup time stamp, attribute */ @@ -280,12 +280,12 @@ loop: brelse(bp2); if (bp) brelse(bp); - + /* * Initialize the associated vnode */ vp->v_type = IFTOVT(ip->inode.iso_mode); - + if ( vp->v_type == VFIFO ) { vp->v_op = cd9660_fifoop_p; } else if ( vp->v_type == VCHR || vp->v_type == VBLK ) { @@ -321,10 +321,10 @@ loop: ip = iq; } } - + if (ip->iso_extent == imp->root_extent) vp->v_flag |= VROOT; - + *ipp = ip; return 0; } @@ -336,7 +336,7 @@ int iso_iput(ip) register struct iso_node *ip; { - + if ((ip->i_flag & ILOCKED) == 0) panic("iso_iput"); ISO_IUNLOCK(ip); @@ -357,10 +357,10 @@ cd9660_inactive(ap) struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); int error = 0; - + if (prtactive && vp->v_usecount != 0) vprint("cd9660_inactive: pushing active", vp); - + ip->i_flag = 0; /* * If we are done with the inode, reclaim it @@ -382,7 +382,7 @@ cd9660_reclaim(ap) { register struct vnode *vp = ap->a_vp; register struct iso_node *ip = VTOI(vp); - + if (prtactive && vp->v_usecount != 0) vprint("cd9660_reclaim: pushing active", vp); /* @@ -411,7 +411,7 @@ int iso_ilock(ip) register struct iso_node *ip; { - + while (ip->i_flag & ILOCKED) { ip->i_flag |= IWANT; if (ip->i_spare0 == curproc->p_pid) @@ -458,7 +458,7 @@ cd9660_defattr(isodir,inop,bp,ftype) struct iso_mnt *imp; struct iso_extended_attributes *ap = NULL; int off; - + /* high sierra does not have timezone data, flag is one byte ahead */ if (isonum_711(ftype == ISO_FTYPE_HIGH_SIERRA? &isodir->date[6]: isodir->flags)&2) { @@ -480,7 +480,7 @@ cd9660_defattr(isodir,inop,bp,ftype) } if (bp) { ap = (struct iso_extended_attributes *)bp->b_un.b_addr; - + if (isonum_711(ap->version) == 1) { if (!(ap->perm[0]&0x40)) inop->inode.iso_mode |= VEXEC >> 6; @@ -522,7 +522,7 @@ cd9660_deftstamp(isodir,inop,bp,ftype) struct iso_mnt *imp; struct iso_extended_attributes *ap = NULL; int off; - + if (!bp && ((imp = inop->i_mnt)->im_flags&ISOFSMNT_EXTATT) && (off = isonum_711(isodir->ext_attr_length))) { @@ -531,7 +531,7 @@ cd9660_deftstamp(isodir,inop,bp,ftype) } if (bp) { ap = (struct iso_extended_attributes *)bp->b_un.b_addr; - + if (ftype != ISO_FTYPE_HIGH_SIERRA && isonum_711(ap->version) == 1) { if (!cd9660_tstamp_conv17(ap->ftime,&inop->inode.iso_atime)) @@ -560,7 +560,7 @@ enum ISO_FTYPE ftype; { int crtime, days; int y, m, d, hour, minute, second, tz; - + y = pi[0] + 1900; m = pi[1]; d = pi[2]; @@ -572,7 +572,7 @@ enum ISO_FTYPE ftype; else /* original high sierra misses timezone data */ tz = 0; - + if (y < 1970) { pu->ts_sec = 0; pu->ts_nsec = 0; @@ -590,7 +590,7 @@ enum ISO_FTYPE ftype; days = 367*(y-1960)-7*(y+(m+9)/12)/4-3*((y+(m+9)/12-1)/100+1)/4+275*m/9+d-239; #endif crtime = ((((days * 24) + hour) * 60 + minute) * 60) + second; - + /* timezone offset is unreliable on some disks */ if (-48 <= tz && tz <= 52) crtime -= tz * 15 * 60; @@ -606,7 +606,7 @@ cd9660_chars2ui(begin,len) int len; { unsigned rc; - + for (rc = 0; --len >= 0;) { rc *= 10; rc += *begin++ - '0'; @@ -620,28 +620,28 @@ cd9660_tstamp_conv17(pi,pu) struct timespec *pu; { unsigned char buf[7]; - + /* year:"0001"-"9999" -> -1900 */ buf[0] = cd9660_chars2ui(pi,4) - 1900; - + /* month: " 1"-"12" -> 1 - 12 */ buf[1] = cd9660_chars2ui(pi + 4,2); - + /* day: " 1"-"31" -> 1 - 31 */ buf[2] = cd9660_chars2ui(pi + 6,2); - + /* hour: " 0"-"23" -> 0 - 23 */ buf[3] = cd9660_chars2ui(pi + 8,2); - + /* minute:" 0"-"59" -> 0 - 59 */ buf[4] = cd9660_chars2ui(pi + 10,2); - + /* second:" 0"-"59" -> 0 - 59 */ buf[5] = cd9660_chars2ui(pi + 12,2); - + /* difference of GMT */ buf[6] = pi[16]; - + return cd9660_tstamp_conv7(buf, pu, ISO_FTYPE_DEFAULT); } diff --git a/sys/isofs/cd9660/cd9660_rrip.c b/sys/isofs/cd9660/cd9660_rrip.c index 87767ea..dca8983 100644 --- a/sys/isofs/cd9660/cd9660_rrip.c +++ b/sys/isofs/cd9660/cd9660_rrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94 - * $Id: cd9660_rrip.c,v 1.5 1994/09/26 00:32:57 gpalmer Exp $ + * $Id: cd9660_rrip.c,v 1.6 1995/01/16 17:03:26 joerg Exp $ */ #include <sys/param.h> @@ -95,13 +95,13 @@ cd9660_rrip_slink(p,ana) register ISO_RRIP_SLINK_COMPONENT *pcompe; int len, wlen, cont; char *outbuf, *inbuf; - + pcomp = (ISO_RRIP_SLINK_COMPONENT *)p->component; pcompe = (ISO_RRIP_SLINK_COMPONENT *)((char *)p + isonum_711(p->h.length)); len = *ana->outlen; outbuf = ana->outbuf; cont = ana->cont; - + /* * Gathering a Symbolic name from each component with path */ @@ -109,7 +109,7 @@ cd9660_rrip_slink(p,ana) pcomp < pcompe; pcomp = (ISO_RRIP_SLINK_COMPONENT *)((char *)pcomp + ISO_RRIP_SLSIZ + isonum_711(pcomp->clen))) { - + if (!cont) { if (len < ana->maxlen) { len++; @@ -117,29 +117,29 @@ cd9660_rrip_slink(p,ana) } } cont = 0; - + inbuf = ".."; wlen = 0; - + switch (*pcomp->cflag) { - + case ISO_SUSP_CFLAG_CURRENT: /* Inserting Current */ wlen = 1; break; - + case ISO_SUSP_CFLAG_PARENT: /* Inserting Parent */ wlen = 2; break; - + case ISO_SUSP_CFLAG_ROOT: /* Inserting slash for ROOT */ /* start over from beginning(?) */ outbuf -= len; len = 0; break; - + case ISO_SUSP_CFLAG_VOLROOT: /* Inserting a mount point i.e. "/cdrom" */ /* same as above */ @@ -148,13 +148,13 @@ cd9660_rrip_slink(p,ana) inbuf = ana->imp->im_mountp->mnt_stat.f_mntonname; wlen = strlen(inbuf); break; - + case ISO_SUSP_CFLAG_HOST: /* Inserting hostname i.e. "kurt.tools.de" */ inbuf = hostname; wlen = hostnamelen; break; - + case ISO_SUSP_CFLAG_CONTINUE: cont = 1; /* fall thru */ @@ -168,7 +168,7 @@ cd9660_rrip_slink(p,ana) wlen = ana->maxlen + 1; break; } - + if (len + wlen > ana->maxlen) { /* indicate error to caller */ ana->cont = 1; @@ -177,16 +177,16 @@ cd9660_rrip_slink(p,ana) *ana->outlen = 0; return 0; } - + bcopy(inbuf,outbuf,wlen); outbuf += wlen; len += wlen; - + } ana->outbuf = outbuf; *ana->outlen = len; ana->cont = cont; - + if (!isonum_711(p->flags)) { ana->fields &= ~ISO_SUSP_SLINK; return ISO_SUSP_SLINK; @@ -205,28 +205,28 @@ cd9660_rrip_altname(p,ana) char *inbuf; int wlen; int cont; - + inbuf = ".."; wlen = 0; cont = 0; - + switch (*p->flags) { case ISO_SUSP_CFLAG_CURRENT: /* Inserting Current */ wlen = 1; break; - + case ISO_SUSP_CFLAG_PARENT: /* Inserting Parent */ wlen = 2; break; - + case ISO_SUSP_CFLAG_HOST: /* Inserting hostname i.e. "kurt.tools.de" */ inbuf = hostname; wlen = hostnamelen; break; - + case ISO_SUSP_CFLAG_CONTINUE: cont = 1; /* fall thru */ @@ -235,13 +235,13 @@ cd9660_rrip_altname(p,ana) wlen = isonum_711(p->h.length) - 5; inbuf = (char *)p + 5; break; - + default: printf("RRIP with incorrect NM flags?\n"); wlen = ana->maxlen + 1; break; } - + if ((*ana->outlen += wlen) > ana->maxlen) { /* treat as no name field */ ana->fields &= ~ISO_SUSP_ALTNAME; @@ -249,10 +249,10 @@ cd9660_rrip_altname(p,ana) *ana->outlen = 0; return 0; } - + bcopy(inbuf,ana->outbuf,wlen); ana->outbuf += wlen; - + if (!cont) { ana->fields &= ~ISO_SUSP_ALTNAME; return ISO_SUSP_ALTNAME; @@ -314,55 +314,55 @@ cd9660_rrip_tstamp(p,ana) ISO_RRIP_ANALYZE *ana; { unsigned char *ptime; - + ptime = p->time; - + /* Check a format of time stamp (7bytes/17bytes) */ if (!(*p->flags&ISO_SUSP_TSTAMP_FORM17)) { if (*p->flags&ISO_SUSP_TSTAMP_CREAT) ptime += 7; - + if (*p->flags&ISO_SUSP_TSTAMP_MODIFY) { cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_mtime, ISO_FTYPE_RRIP); ptime += 7; } else bzero(&ana->inop->inode.iso_mtime,sizeof(struct timespec)); - + if (*p->flags&ISO_SUSP_TSTAMP_ACCESS) { cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_atime, ISO_FTYPE_RRIP); ptime += 7; } else ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime; - + if (*p->flags&ISO_SUSP_TSTAMP_ATTR) cd9660_tstamp_conv7(ptime,&ana->inop->inode.iso_ctime, ISO_FTYPE_RRIP); else ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime; - + } else { if (*p->flags&ISO_SUSP_TSTAMP_CREAT) ptime += 17; - + if (*p->flags&ISO_SUSP_TSTAMP_MODIFY) { cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_mtime); ptime += 17; } else bzero(&ana->inop->inode.iso_mtime,sizeof(struct timespec)); - + if (*p->flags&ISO_SUSP_TSTAMP_ACCESS) { cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_atime); ptime += 17; } else ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime; - + if (*p->flags&ISO_SUSP_TSTAMP_ATTR) cd9660_tstamp_conv17(ptime,&ana->inop->inode.iso_ctime); else ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime; - + } ana->fields &= ~ISO_SUSP_TSTAMP; return ISO_SUSP_TSTAMP; @@ -385,10 +385,10 @@ cd9660_rrip_device(p,ana) ISO_RRIP_ANALYZE *ana; { unsigned high, low; - + high = isonum_733(p->dev_t_high_l); low = isonum_733(p->dev_t_low_l); - + if ( high == 0 ) { ana->inop->inode.iso_rdev = makedev( major(low), minor(low) ); } else { @@ -410,7 +410,7 @@ cd9660_rrip_idflag(p,ana) /* special handling of RE field */ if (ana->fields&ISO_SUSP_RELDIR) return cd9660_rrip_reldir(p,ana); - + return ISO_SUSP_IDFLAG; } @@ -476,7 +476,7 @@ cd9660_rrip_loop(isodir,ana,table) struct buf *bp = NULL; char *pwhead; int result; - + /* * Note: If name length is odd, * it will be padding 1 byte after the name @@ -484,23 +484,23 @@ cd9660_rrip_loop(isodir,ana,table) pwhead = isodir->name + isonum_711(isodir->name_len); if (!(isonum_711(isodir->name_len)&1)) pwhead++; - + /* If it's not the '.' entry of the root dir obey SP field */ if (*isodir->name != 0 || isonum_733(isodir->extent) != ana->imp->root_extent) pwhead += ana->imp->rr_skip; else pwhead += ana->imp->rr_skip0; - + phead = (ISO_SUSP_HEADER *)pwhead; pend = (ISO_SUSP_HEADER *)((char *)isodir + isonum_711(isodir->length)); - + result = 0; while (1) { ana->iso_ce_len = 0; /* * Note: "pend" should be more than one SUSP header - */ + */ while (pend >= phead + 1) { if (isonum_711(phead->version) == 1) { for (ptable = table; ptable->func; ptable++) { @@ -519,7 +519,7 @@ cd9660_rrip_loop(isodir,ana,table) */ phead = (ISO_SUSP_HEADER *)((char *)phead + isonum_711(phead->length)); } - + if ( ana->fields && ana->iso_ce_len ) { if (ana->iso_ce_blk >= ana->imp->volume_space_size || ana->iso_ce_off + ana->iso_ce_len > ana->imp->logical_block_size @@ -542,7 +542,7 @@ cd9660_rrip_loop(isodir,ana,table) for (ptable = table; ptable->func2; ptable++) if (!(ptable->result&result)) ptable->func2(isodir,ana); - + return result; } @@ -563,17 +563,17 @@ cd9660_rrip_analyze(isodir,inop,imp) struct iso_mnt *imp; { ISO_RRIP_ANALYZE analyze; - + analyze.inop = inop; analyze.imp = imp; analyze.fields = ISO_SUSP_ATTR|ISO_SUSP_TSTAMP|ISO_SUSP_DEVICE; - + return cd9660_rrip_loop(isodir,&analyze,rrip_table_analyze); } -/* - * Get Alternate Name from 'AL' record - * If either no AL record or 0 length, +/* + * Get Alternate Name from 'AL' record + * If either no AL record or 0 length, * it will be return the translated ISO9660 name, */ static RRIP_TABLE rrip_table_getname[] = { @@ -597,7 +597,7 @@ cd9660_rrip_getname(isodir,outbuf,outlen,inump,imp) { ISO_RRIP_ANALYZE analyze; RRIP_TABLE *tab; - + analyze.outbuf = outbuf; analyze.outlen = outlen; analyze.maxlen = NAME_MAX; @@ -605,21 +605,21 @@ cd9660_rrip_getname(isodir,outbuf,outlen,inump,imp) analyze.imp = imp; analyze.fields = ISO_SUSP_ALTNAME|ISO_SUSP_RELDIR|ISO_SUSP_CLINK|ISO_SUSP_PLINK; *outlen = 0; - + tab = rrip_table_getname; if (*isodir->name == 0 || *isodir->name == 1) { cd9660_rrip_defname(isodir,&analyze); - + analyze.fields &= ~ISO_SUSP_ALTNAME; tab++; } - + return cd9660_rrip_loop(isodir,&analyze,tab); } -/* - * Get Symbolic Name from 'SL' record +/* + * Get Symbolic Name from 'SL' record * * Note: isodir should contains SL record! */ @@ -639,7 +639,7 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) struct iso_mnt *imp; { ISO_RRIP_ANALYZE analyze; - + analyze.outbuf = outbuf; analyze.outlen = outlen; *outlen = 0; @@ -647,7 +647,7 @@ cd9660_rrip_getsymname(isodir,outbuf,outlen,imp) analyze.cont = 1; /* don't start with a slash */ analyze.imp = imp; analyze.fields = ISO_SUSP_SLINK; - + return (cd9660_rrip_loop(isodir,&analyze,rrip_table_getsymname)&ISO_SUSP_SLINK); } @@ -669,7 +669,7 @@ cd9660_rrip_offset(isodir,imp) { ISO_RRIP_OFFSET *p; ISO_RRIP_ANALYZE analyze; - + imp->rr_skip0 = 0; p = (ISO_RRIP_OFFSET *)(isodir->name + 1); if (bcmp(p,"SP\7\1\276\357",6)) { @@ -679,11 +679,11 @@ cd9660_rrip_offset(isodir,imp) if (bcmp(p,"SP\7\1\276\357",6)) return -1; } - + analyze.imp = imp; analyze.fields = ISO_SUSP_EXTREF; if (!(cd9660_rrip_loop(isodir,&analyze,rrip_table_extref)&ISO_SUSP_EXTREF)) return -1; - + return isonum_711(p->skip); } diff --git a/sys/isofs/cd9660/cd9660_util.c b/sys/isofs/cd9660/cd9660_util.c index 52a80d7..3d58e4e 100644 --- a/sys/isofs/cd9660/cd9660_util.c +++ b/sys/isofs/cd9660/cd9660_util.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_util.c 8.1 (Berkeley) 1/21/94 - * $Id$ + * $Id: cd9660_util.c,v 1.3 1994/08/02 07:41:31 davidg Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ isofncmp(unsigned char *fn,int fnlen,unsigned char *isofn,int isolen) { int i, j; unsigned char c; - + while (--fnlen >= 0) { if (--isolen < 0) return *fn; @@ -216,14 +216,14 @@ isofntrans(unsigned char *infn,int infnlen, int original,int assoc) { int fnidx = 0; - + if (assoc) { *outfn++ = ASSOCCHAR; fnidx++; } for (; fnidx < infnlen; fnidx++) { char c = *infn++; - + if (!original && c >= 'A' && c <= 'Z') *outfn++ = c + ('a' - 'A'); else if (!original && c == '.' && *infn == ';') diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 8fc30a8..afa08f4 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.3 (Berkeley) 1/31/94 - * $Id: cd9660_vfsops.c,v 1.11 1995/03/16 20:23:24 wollman Exp $ + * $Id: cd9660_vfsops.c,v 1.12 1995/05/19 03:25:35 davidg Exp $ */ #include <sys/param.h> @@ -92,7 +92,7 @@ cd9660_mountroot() u_int size; int error; struct iso_args args; - + /* * Get vnode for rootdev. */ @@ -152,13 +152,13 @@ cd9660_mount(mp, path, data, ndp, p) u_int size; int error; struct iso_mnt *imp = 0; - + if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args)))) return (error); - + if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EROFS); - + /* * If updating, check whether changing from read-only to * read/write; if there is no device name, that's all we do. @@ -233,10 +233,10 @@ iso_mountfs(devvp, mp, p, argp) struct iso_sierra_primary_descriptor *pri_sierra; struct iso_directory_record *rootp; int logical_block_size; - + if (!ronly) return EROFS; - + /* * Disallow multiple mounts of the same device. * Disallow mounting of a device that is currently in use @@ -253,18 +253,18 @@ iso_mountfs(devvp, mp, p, argp) if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p))) return error; needclose = 1; - + /* This is the "logical sector size". The standard says this * should be 2048 or the physical sector size on the device, * whichever is greater. For now, we'll just use a constant. */ iso_bsize = ISO_DEFAULT_BLOCK_SIZE; - + for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) { if ((error = bread (devvp, btodb(iso_blknum * iso_bsize), iso_bsize, NOCRED, &bp))) goto out; - + vdp = (struct iso_volume_descriptor *)bp->b_un.b_addr; if (bcmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) != 0) { if (bcmp (vdp->id_sierra, ISO_SIERRA_ID, @@ -274,41 +274,41 @@ iso_mountfs(devvp, mp, p, argp) } else high_sierra = 1; } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) { error = EINVAL; goto out; } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY) break; brelse(bp); } - + if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) { error = EINVAL; goto out; } - + pri = (struct iso_primary_descriptor *)vdp; pri_sierra = (struct iso_sierra_primary_descriptor *)vdp; - + logical_block_size = isonum_723 (high_sierra? pri_sierra->logical_block_size: pri->logical_block_size); - + if (logical_block_size < DEV_BSIZE || logical_block_size > MAXBSIZE || (logical_block_size & (logical_block_size - 1)) != 0) { error = EINVAL; goto out; } - + rootp = (struct iso_directory_record *) (high_sierra? pri_sierra->root_directory_record: pri->root_directory_record); - + isomp = malloc(sizeof *isomp, M_ISOFSMNT, M_WAITOK); bzero((caddr_t)isomp, sizeof *isomp); isomp->logical_block_size = logical_block_size; @@ -319,16 +319,16 @@ iso_mountfs(devvp, mp, p, argp) bcopy (rootp, isomp->root, sizeof isomp->root); isomp->root_extent = isonum_733 (rootp->extent); isomp->root_size = isonum_733 (rootp->size); - + isomp->im_bmask = logical_block_size - 1; isomp->im_bshift = 0; while ((1 << isomp->im_bshift) < isomp->logical_block_size) isomp->im_bshift++; - + bp->b_flags |= B_AGE; brelse(bp); bp = NULL; - + mp->mnt_data = (qaddr_t)isomp; mp->mnt_stat.f_fsid.val[0] = (long)dev; mp->mnt_stat.f_fsid.val[1] = MOUNT_CD9660; @@ -337,9 +337,9 @@ iso_mountfs(devvp, mp, p, argp) isomp->im_mountp = mp; isomp->im_dev = dev; isomp->im_devvp = devvp; - + devvp->v_specflags |= SI_MOUNTEDON; - + /* Check the Rock Ridge Extention support */ if (!(argp->flags & ISOFSMNT_NORRIP)) { if ((error = bread (isomp->im_devvp, @@ -347,15 +347,15 @@ iso_mountfs(devvp, mp, p, argp) * isomp->logical_block_size / DEV_BSIZE, isomp->logical_block_size,NOCRED,&bp))) goto out; - + rootp = (struct iso_directory_record *)bp->b_un.b_addr; - + if ((isomp->rr_skip = cd9660_rrip_offset(rootp,isomp)) < 0) { argp->flags |= ISOFSMNT_NORRIP; } else { argp->flags &= ~ISOFSMNT_GENS; } - + /* * The contents are valid, * but they will get reread as part of another vnode, so... @@ -381,7 +381,7 @@ iso_mountfs(devvp, mp, p, argp) isomp->iso_ftype = ISO_FTYPE_RRIP; break; } - + return 0; out: if (bp) @@ -420,7 +420,7 @@ cd9660_unmount(mp, mntflags, p) { register struct iso_mnt *isomp; int error, flags = 0; - + if (mntflags & MNT_FORCE) { if (!iso_doforce) return (EINVAL); @@ -440,7 +440,7 @@ cd9660_unmount(mp, mntflags, p) if (isomp->iso_ftype == ISO_FTYPE_RRIP) iso_dunmap(isomp->im_dev); #endif - + isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON; error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p); vrele(isomp->im_devvp); @@ -464,7 +464,7 @@ cd9660_root(mp, vpp) int error; struct iso_mnt *imp = VFSTOISOFS (mp); struct iso_directory_record *dp; - + tvp.v_mount = mp; tvp.v_data = &tip; ip = VTOI(&tvp); @@ -473,7 +473,7 @@ cd9660_root(mp, vpp) ip->i_diroff = 0; dp = (struct iso_directory_record *)imp->root; isodirino(&ip->i_number,dp,imp); - + /* * With RRIP we must use the `.' entry of the root directory. * Simply tell iget, that it's a relocated directory. @@ -513,9 +513,9 @@ cd9660_statfs(mp, sbp, p) struct proc *p; { register struct iso_mnt *isomp; - + isomp = VFSTOISOFS(mp); - + sbp->f_type = MOUNT_CD9660; sbp->f_bsize = isomp->logical_block_size; sbp->f_iosize = sbp->f_bsize; /* XXX */ @@ -597,15 +597,15 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) struct iso_directory_record *dirp; struct iso_node tip, *ip, *nip; struct netcred *np; - + imp = VFSTOISOFS (mp); ifhp = (struct ifid *)fhp; - + #ifdef ISOFS_DBG printf("fhtovp: ino %d, start %ld\n", ifhp->ifid_ino, ifhp->ifid_start); #endif - + np = vfs_export_lookup(mp, &imp->im_export, nam); if (np == NULL) return (EACCES); @@ -615,14 +615,14 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) printf("fhtovp: lbn exceed volume space %d\n", lbn); return (ESTALE); } - + off = iso_blkoff(imp, ifhp->ifid_ino); if (off + ISO_DIRECTORY_RECORD_SIZE > imp->logical_block_size) { printf("fhtovp: crosses block boundary %d\n", off + ISO_DIRECTORY_RECORD_SIZE); return (ESTALE); } - + error = bread(imp->im_devvp, btodb(lbn * imp->logical_block_size), imp->logical_block_size, NOCRED, &bp); if (error) { @@ -630,7 +630,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) brelse(bp); return (error); } - + dirp = (struct iso_directory_record *)(bp->b_un.b_addr + off); if (off + isonum_711(dirp->length) > imp->logical_block_size) { brelse(bp); @@ -639,7 +639,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) isonum_711(dirp->length)); return (ESTALE); } - + if (isonum_733(dirp->extent) + isonum_711(dirp->ext_attr_length) != ifhp->ifid_start) { brelse(bp); @@ -649,7 +649,7 @@ cd9660_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) return (ESTALE); } brelse(bp); - + ip = &tip; tvp.v_mount = mp; tvp.v_data = ip; @@ -687,13 +687,13 @@ cd9660_vptofh(vp, fhp) { register struct iso_node *ip = VTOI(vp); register struct ifid *ifhp; - + ifhp = (struct ifid *)fhp; ifhp->ifid_len = sizeof(struct ifid); - + ifhp->ifid_ino = ip->i_number; ifhp->ifid_start = ip->iso_start; - + #ifdef ISOFS_DBG printf("vptofh: ino %d, start %ld\n", ifhp->ifid_ino,ifhp->ifid_start); diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 5e403e3..3b538a8 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.12 1995/02/13 06:12:32 phk Exp $ + * $Id: cd9660_vnops.c,v 1.13 1995/03/28 07:46:38 phk Exp $ */ #include <sys/param.h> @@ -81,10 +81,10 @@ cd9660_mknod(ndp, vap, cred, p) struct iso_node *ip; struct iso_dnode *dp; int error; - + vp = ndp->ni_vp; ip = VTOI(vp); - + if (ip->i_mnt->iso_ftype != ISO_FTYPE_RRIP || vap->va_type != vp->v_type || (vap->va_type != VCHR && vap->va_type != VBLK)) { @@ -93,7 +93,7 @@ cd9660_mknod(ndp, vap, cred, p) vput(ndp->ni_vp); return EINVAL; } - + dp = iso_dmap(ip->i_dev,ip->i_number,1); if (ip->inode.iso_rdev == vap->va_rdev || vap->va_rdev == VNOVAL) { /* same as the unmapped one, delete the mapping */ @@ -102,7 +102,7 @@ cd9660_mknod(ndp, vap, cred, p) } else /* enter new mapping */ dp->d_dev = vap->va_rdev; - + /* * Remove inode so that it will be reloaded by iget and * checked to see if it is an alias of an existing entry @@ -237,7 +237,7 @@ cd9660_read(ap) off_t diff; int rasize, error = 0; long size, n, on; - + if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) @@ -260,7 +260,7 @@ cd9660_read(ap) if (iso_lblktosize(imp, rablock) <= ip->i_size) error = cluster_read(vp, (off_t)ip->i_size, lbn, size, NOCRED, &bp); - else + else error = bread(vp, lbn, size, NOCRED, &bp); } else { if (vp->v_lastr + 1 == lbn && @@ -380,25 +380,25 @@ iso_uiodir(idp,dp,off) off_t off; { int error; - + dp->d_name[dp->d_namlen] = 0; dp->d_reclen = DIRSIZ(dp); - + if (idp->uio->uio_resid < dp->d_reclen) { idp->eof = 0; return -1; } - + if (idp->cookiep) { if (idp->ncookies <= 0) { idp->eof = 0; return -1; } - + *idp->cookiep++ = off; --idp->ncookies; } - + if ((error = uiomove((caddr_t)dp,dp->d_reclen,idp->uio))) return error; idp->uio_off = off; @@ -413,7 +413,7 @@ iso_shipdir(idp) int cl, sl, assoc; int error; char *cname, *sname; - + cl = idp->current.d_namlen; cname = idp->current.d_name; assoc = (cl > 1) && (*cname == ASSOCCHAR); @@ -421,7 +421,7 @@ assoc = (cl > 1) && (*cname == ASSOCCHAR); cl--; cname++; } - + dp = &idp->saveent; sname = dp->d_name; if (!(sl = dp->d_namlen)) { @@ -483,10 +483,10 @@ cd9660_readdir(ap) u_short tmplen; int ncookies = 0; u_int *cookies = NULL; - + ip = VTOI(ap->a_vp); imp = ip->i_mnt; - + MALLOC(idp,struct isoreaddir *,sizeof(*idp),M_TEMP,M_WAITOK); idp->saveent.d_namlen = 0; idp->assocent.d_namlen = 0; @@ -503,7 +503,7 @@ cd9660_readdir(ap) idp->cookiep = 0; idp->eof = 0; idp->curroff = uio->uio_offset; - + entryoffsetinblock = iso_blkoff(imp, idp->curroff); if (entryoffsetinblock != 0) { if ((error = iso_blkatoff(ip, idp->curroff, &bp))) { @@ -511,16 +511,16 @@ cd9660_readdir(ap) return (error); } } - + endsearch = ip->i_size; - + while (idp->curroff < endsearch) { /* * If offset is on a block boundary, * read the next directory block. * Release previous if it exists. */ - + if (iso_blkoff(imp, idp->curroff) == 0) { if (bp != NULL) brelse(bp); @@ -531,10 +531,10 @@ cd9660_readdir(ap) /* * Get pointer to next entry. */ - + ep = (struct iso_directory_record *) (bp->b_un.b_addr + entryoffsetinblock); - + reclen = isonum_711 (ep->length); isoflags = isonum_711(imp->iso_ftype == ISO_FTYPE_HIGH_SIERRA? &ep->date[6]: ep->flags); @@ -544,19 +544,19 @@ cd9660_readdir(ap) imp->logical_block_size); continue; } - + if (reclen < ISO_DIRECTORY_RECORD_SIZE) { error = EINVAL; /* illegal entry, stop */ break; } - + if (entryoffsetinblock + reclen > imp->logical_block_size) { error = EINVAL; /* illegal directory, so stop looking */ break; } - + /* XXX: be more intelligent if we can */ idp->current.d_type = DT_UNKNOWN; @@ -566,13 +566,13 @@ cd9660_readdir(ap) else idp->current.d_fileno = dbtob(bp->b_blkno) + idp->curroff; - + if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) { error = EINVAL; /* illegal entry, stop */ break; } - + idp->curroff += reclen; /* * @@ -612,10 +612,10 @@ cd9660_readdir(ap) } if (error) break; - + entryoffsetinblock += reclen; } - + if (!error && imp->iso_ftype == ISO_FTYPE_DEFAULT) { idp->current.d_namlen = 0; error = iso_shipdir(idp); @@ -634,16 +634,16 @@ cd9660_readdir(ap) *ap->a_cookies = cookies; } } - + if (bp) brelse (bp); uio->uio_offset = idp->uio_off; if (ap->a_eofflag) *ap->a_eofflag = idp->eof; - + FREE(idp,M_TEMP); - + return (error); } @@ -665,19 +665,19 @@ cd9660_readlink(ap) } */ *ap; { ISONODE *ip; - ISODIR *dirp; + ISODIR *dirp; ISOMNT *imp; struct buf *bp; u_short symlen; int error; char *symname; - + ip = VTOI(ap->a_vp); imp = ip->i_mnt; - + if (imp->iso_ftype != ISO_FTYPE_RRIP) return EINVAL; - + /* * Get parents directory record block that this inode included. */ @@ -706,7 +706,7 @@ cd9660_readlink(ap) ip->i_number, ip->i_number & imp->im_bmask ); #endif - + /* * Just make sure, we have a right one.... * 1: Check not cross boundary on block @@ -716,13 +716,13 @@ cd9660_readlink(ap) brelse(bp); return EINVAL; } - + /* * Now get a buffer * Abuse a namei buffer for now. */ MALLOC(symname,char *,MAXPATHLEN,M_NAMEI,M_WAITOK); - + /* * Ok, we just gathering a symbolic name in SL record. */ @@ -735,14 +735,14 @@ cd9660_readlink(ap) * Don't forget before you leave from home ;-) */ brelse(bp); - + /* * return with the symbolic name to caller's. */ error = uiomove(symname,symlen,ap->a_uio); - + FREE(symname,M_NAMEI); - + return error; } diff --git a/sys/isofs/cd9660/iso.h b/sys/isofs/cd9660/iso.h index 858dbb3..406572e 100644 --- a/sys/isofs/cd9660/iso.h +++ b/sys/isofs/cd9660/iso.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)iso.h 8.2 (Berkeley) 1/23/94 - * $Id: iso.h,v 1.3 1994/09/09 11:11:01 dfr Exp $ + * $Id: iso.h,v 1.4 1995/01/16 17:03:29 joerg Exp $ */ #define ISODCL(from, to) (to - from + 1) @@ -189,16 +189,16 @@ struct iso_mnt { int logical_block_size; int im_bshift; int im_bmask; - + int volume_space_size; char im_fsmnt[50]; struct netexport im_export; - + char root[ISODCL (157, 190)]; int root_extent; int root_size; enum ISO_FTYPE iso_ftype; - + int rr_skip; int rr_skip0; }; @@ -228,13 +228,13 @@ int cd9660_vptofh __P((struct vnode *, struct fid *)); int cd9660_init __P(()); struct iso_node; -int iso_blkatoff __P((struct iso_node *ip, long offset, struct buf **bpp)); +int iso_blkatoff __P((struct iso_node *ip, long offset, struct buf **bpp)); int iso_iget __P((struct iso_node *xp, ino_t ino, int relocated, struct iso_node **ipp, struct iso_directory_record *isodir)); -int iso_iput __P((struct iso_node *ip)); -int iso_ilock __P((struct iso_node *ip)); -int iso_iunlock __P((struct iso_node *ip)); -int cd9660_mountroot __P((void)); +int iso_iput __P((struct iso_node *ip)); +int iso_ilock __P((struct iso_node *ip)); +int iso_iunlock __P((struct iso_node *ip)); +int cd9660_mountroot __P((void)); extern int (**cd9660_vnodeop_p)(); diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 003e9b2..082088c 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact_aout.c,v 1.11 1995/02/20 22:23:03 davidg Exp $ + * $Id: imgact_aout.c,v 1.12 1995/03/16 18:12:25 bde Exp $ */ #include <sys/param.h> @@ -56,7 +56,7 @@ exec_aout_imgact(iparams) #ifdef COMPAT_LINUX /* * Linux and *BSD binaries look very much alike, - * only the machine id is different: + * only the machine id is different: * 0x64 for Linux, 0x86 for *BSD. */ if (((a_out->a_magic >> 16) & 0xff) != 0x86) @@ -190,7 +190,7 @@ exec_aout_imgact(iparams) /* Fill in image_params */ iparams->interpreted = 0; iparams->entry_addr = a_out->a_entry; - + iparams->proc->p_sysent = &aout_sysvec; return (0); } diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c index a7e5f3c..1fb4c92 100644 --- a/sys/kern/imgact_gzip.c +++ b/sys/kern/imgact_gzip.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: imgact_gzip.c,v 1.12 1995/02/20 22:23:07 davidg Exp $ + * $Id: imgact_gzip.c,v 1.13 1995/03/16 18:12:27 bde Exp $ * * This module handles execution of a.out files which have been run through * "gzip". This saves diskspace, but wastes cpu-cycles and VM. @@ -119,7 +119,7 @@ exec_gzip_imgact(iparams) return igz.error; if (error) return ENOEXEC; - if (error2) + if (error2) return error2; return 0; } diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 62d2bcb..7a6d79b 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.11 1994/12/12 11:58:46 bde Exp $ + * $Id: kern_clock.c,v 1.12 1995/03/16 18:12:29 bde Exp $ */ /* Portions of this software are covered by the following: */ @@ -459,7 +459,7 @@ hardclock(frame) statclock(frame); /* - * Increment the time-of-day. + * Increment the time-of-day. */ ticks++; { @@ -579,14 +579,14 @@ hardclock(frame) * replaced. */ switch (time_state) { - + case TIME_OK: if (time_status & STA_INS) time_state = TIME_INS; else if (time_status & STA_DEL) time_state = TIME_DEL; break; - + case TIME_INS: if (newtime.tv_sec % 86400 == 0) { newtime.tv_sec--; @@ -600,11 +600,11 @@ hardclock(frame) time_state = TIME_WAIT; } break; - + case TIME_OOP: time_state = TIME_WAIT; break; - + case TIME_WAIT: if (!(time_status & (STA_INS | STA_DEL))) time_state = TIME_OK; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 77d76b7..07cec1b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 - * $Id: kern_descrip.c,v 1.8 1995/02/20 19:42:33 guido Exp $ + * $Id: kern_descrip.c,v 1.9 1995/03/28 07:56:26 bde Exp $ */ #include <sys/param.h> @@ -871,7 +871,7 @@ fdopen(dev, mode, type, p) /* * XXX Kludge: set curproc->p_dupfd to contain the value of the - * the file descriptor being sought for duplication. The error + * the file descriptor being sought for duplication. The error * return ensures that the vnode for this device will be released * by vn_open. Open will detect this special error and take the * actions in dupfdopen below. Other callers of vn_open or VOP_OPEN @@ -893,7 +893,7 @@ dupfdopen(fdp, indx, dfd, mode, error) { register struct file *wfp; struct file *fp; - + /* * If the to-be-dup'd fd number is greater than the allowed number * of file descriptors, or the fd to be dup'd has already been diff --git a/sys/kern/kern_devconf.c b/sys/kern/kern_devconf.c index 452349b..bcdf87e 100644 --- a/sys/kern/kern_devconf.c +++ b/sys/kern/kern_devconf.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_devconf.c,v 1.8 1995/03/17 04:17:32 davidg Exp $ + * $Id: kern_devconf.c,v 1.9 1995/04/13 15:33:14 wollman Exp $ */ /* @@ -172,7 +172,7 @@ dev_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, return rv; if(kdc->kdc_externalize) - rv = kdc->kdc_externalize(p, kdc, + rv = kdc->kdc_externalize(p, kdc, &((struct devconf *)oldp)->dc_data, len - ((sizeof dc) - 1)); if(rv) @@ -184,7 +184,7 @@ dev_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, if(!kdc->kdc_internalize) return EOPNOTSUPP; - rv = kdc->kdc_internalize(p, kdc, + rv = kdc->kdc_internalize(p, kdc, &((struct devconf *)newp)->dc_data, newlen - ((sizeof dc) - 1)); return rv; diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 612f68f..59a411b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.19 1995/03/25 01:20:38 davidg Exp $ + * $Id: kern_exec.c,v 1.20 1995/03/25 01:34:21 davidg Exp $ */ #include <sys/param.h> @@ -123,7 +123,7 @@ interpret: if (error) { vm_map_remove(exec_map, (vm_offset_t)iparams->stringbase, (vm_offset_t)iparams->stringbase + ARG_MAX); - goto exec_fail; + goto exec_fail; } iparams->vnodep = vnodep = ndp->ni_vp; @@ -230,7 +230,7 @@ interpret: len = min(ndp->ni_cnd.cn_namelen,MAXCOMLEN); bcopy(ndp->ni_cnd.cn_nameptr, p->p_comm, len); p->p_comm[len] = 0; - + /* * mark as executable, wakeup any process that was vforked and tell * it that it now has it's own resources back @@ -240,7 +240,7 @@ interpret: p->p_flag &= ~P_PPWAIT; wakeup((caddr_t)p->p_pptr); } - + /* implement set userid/groupid */ p->p_flag &= ~P_SUGID; @@ -385,7 +385,7 @@ exec_extract_strings(iparams) * extract arguments first */ - argv = iparams->uap->argv; + argv = iparams->uap->argv; if (argv) { while ((argp = (caddr_t) fuword(argv++))) { @@ -407,7 +407,7 @@ exec_extract_strings(iparams) * extract environment strings */ - envv = iparams->uap->envv; + envv = iparams->uap->envv; if (envv) { while ((envp = (caddr_t) fuword(envv++))) { diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 3a8102c..156dc47 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 - * $Id: kern_exit.c,v 1.13 1994/12/28 06:15:07 davidg Exp $ + * $Id: kern_exit.c,v 1.14 1995/03/16 18:12:31 bde Exp $ */ #include <sys/param.h> @@ -184,7 +184,7 @@ exit1(p, rv) p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; (void)acct_process(p); #ifdef KTRACE - /* + /* * release trace file */ p->p_traceflag = 0; /* don't trace the vrele() */ diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0e2ba90..d1f671a 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 - * $Id: kern_fork.c,v 1.10 1995/01/21 15:08:57 bde Exp $ + * $Id: kern_fork.c,v 1.11 1995/03/16 18:12:32 bde Exp $ */ #include <sys/param.h> @@ -151,7 +151,7 @@ again: } if (p2->p_pid > nextpid && pidchecked > p2->p_pid) pidchecked = p2->p_pid; - if (p2->p_pgrp->pg_id > nextpid && + if (p2->p_pgrp->pg_id > nextpid && pidchecked > p2->p_pgrp->pg_id) pidchecked = p2->p_pgrp->pg_id; } diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 2bba4bb..d89e2ca 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93 - * $Id: kern_ktrace.c,v 1.4 1994/08/18 22:35:01 wollman Exp $ + * $Id: kern_ktrace.c,v 1.5 1994/10/02 17:35:15 phk Exp $ */ #ifdef KTRACE @@ -53,7 +53,7 @@ ktrgetheader(type) register struct ktr_header *kth; struct proc *p = curproc; /* XXX */ - MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header), + MALLOC(kth, struct ktr_header *, sizeof (struct ktr_header), M_TEMP, M_WAITOK); kth->ktr_type = type; microtime(&kth->ktr_time); @@ -143,7 +143,7 @@ ktrgenio(vp, fd, rw, iov, len, error) register caddr_t cp; register int resid = len, cnt; struct proc *p = curproc; /* XXX */ - + if (error) return; p->p_traceflag |= KTRFAC_ACTIVE; @@ -289,7 +289,7 @@ ktrace(curp, uap, retval) error = EINVAL; goto done; } - /* + /* * do it */ if (uap->pid < 0) { @@ -304,9 +304,9 @@ ktrace(curp, uap, retval) for (p = pg->pg_mem; p != NULL; p = p->p_pgrpnxt) if (descend) ret |= ktrsetchildren(curp, p, ops, facs, vp); - else + else ret |= ktrops(curp, p, ops, facs, vp); - + } else { /* * by pid @@ -340,7 +340,7 @@ ktrops(curp, p, ops, facs, vp) if (!ktrcanset(curp, p)) return (0); if (ops == KTROP_SET) { - if (p->p_tracep != vp) { + if (p->p_tracep != vp) { /* * if trace file already in use, relinquish */ @@ -352,7 +352,7 @@ ktrops(curp, p, ops, facs, vp) p->p_traceflag |= facs; if (curp->p_ucred->cr_uid == 0) p->p_traceflag |= KTRFAC_ROOT; - } else { + } else { /* KTROP_CLEAR */ if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) { /* no more tracing */ @@ -453,7 +453,7 @@ ktrwrite(vp, kth) * Return true if caller has permission to set the ktracing state * of target. Essentially, the target can't possess any * more permissions than the caller. KTRFAC_ROOT signifies that - * root previously set the tracing status on the target process, and + * root previously set the tracing status on the target process, and * so, only root may further change it. * * TODO: check groups. use caller effective gid. diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index f808f6d..ccc7c4e 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: kern_lkm.c,v 1.12 1995/04/20 05:08:31 wpaul Exp $ */ /* @@ -442,7 +442,7 @@ lkmcioctl(dev, cmd, data, flag) statp->size = curp->size / PAGESIZE; statp->private = (unsigned long)curp->private.lkm_any; statp->ver = curp->private.lkm_any->lkm_ver; - copystr(curp->private.lkm_any->lkm_name, + copystr(curp->private.lkm_any->lkm_name, statp->name, MAXLKMNAME - 2, NULL); @@ -547,11 +547,11 @@ _lkm_syscall(lkmtp, cmd) /* save old */ bcopy(&aout_sysvec.sv_table[i], - &(args->lkm_oldent), + &(args->lkm_oldent), sizeof(struct sysent)); /* replace with new */ - bcopy(args->lkm_sysent, + bcopy(args->lkm_sysent, &aout_sysvec.sv_table[i], sizeof(struct sysent)); @@ -565,8 +565,8 @@ _lkm_syscall(lkmtp, cmd) i = args->lkm_offset; /* replace current slot contents with old contents */ - bcopy(&(args->lkm_oldent), - &aout_sysvec.sv_table[i], + bcopy(&(args->lkm_oldent), + &aout_sysvec.sv_table[i], sizeof(struct sysent)); break; @@ -623,7 +623,7 @@ _lkm_vfs(lkmtp, cmd) for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) { struct vnodeopv_desc *opv = (struct vnodeopv_desc *)args->lkm_vnodeops->ls_items[i]; - *(opv->opv_desc_vector_p) = NULL; + *(opv->opv_desc_vector_p) = NULL; } vfs_opv_init((struct vnodeopv_desc **)args->lkm_vnodeops->ls_items); @@ -813,7 +813,7 @@ _lkm_exec(lkmtp, cmd) struct lkm_exec *args = lkmtp->private.lkm_exec; int i; int err = 0; - const struct execsw **execsw = + const struct execsw **execsw = (const struct execsw **)&execsw_set.ls_items[0]; #if 1 @@ -882,7 +882,7 @@ TEXT_SET(execsw_set, lkm_exec_dummy); */ int lkmdispatch(lkmtp, cmd) - struct lkm_table *lkmtp; + struct lkm_table *lkmtp; int cmd; { int err = 0; /* default = success */ diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index aebcbf2..261c47f 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 - * $Id: kern_lockf.c,v 1.2 1994/09/25 19:33:37 phk Exp $ + * $Id: kern_lockf.c,v 1.3 1994/10/25 11:27:51 davidg Exp $ */ #include <sys/param.h> @@ -146,7 +146,7 @@ lf_advlock(ap, head, size) error = lf_getlock(lock, fl); FREE(lock, M_LOCKF); return (error); - + default: free(lock, M_LOCKF); return (EINVAL); @@ -747,7 +747,7 @@ lf_print(tag, lock) char *tag; register struct lockf *lock; { - + printf("%s: lock 0x%lx for ", tag, lock); if (lock->lf_flags & F_POSIX) printf("proc %d", ((struct proc *)(lock->lf_id))->p_pid); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index ad0929d..600e54f 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94 - * $Id: kern_malloc.c,v 1.10 1995/03/19 14:28:52 davidg Exp $ + * $Id: kern_malloc.c,v 1.11 1995/04/16 11:25:15 davidg Exp $ */ #include <sys/param.h> @@ -374,7 +374,7 @@ kmeminit() npg = VM_KMEM_SIZE/ NBPG; if( npg > cnt.v_page_count) npg = cnt.v_page_count; - + kmemusage = (struct kmemusage *) kmem_alloc(kernel_map, (vm_size_t)(npg * sizeof(struct kmemusage))); kmem_map = kmem_suballoc(kernel_map, (vm_offset_t *)&kmembase, diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index aae22e7..a7006ef 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -53,7 +53,7 @@ /* * The following variables are used by the hardclock() routine in the - * kern_clock.c module and are described in that module. + * kern_clock.c module and are described in that module. */ extern int time_state; /* clock state */ extern int time_status; /* clock status bits */ @@ -120,7 +120,7 @@ ntp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, ntv.maxerror = time_maxerror; ntv.esterror = time_esterror; splx(s); - + ntv.time_state = time_state; /* diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index f8f4db8..b706dee 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: kern_physio.c,v 1.9 1995/01/09 16:04:51 davidg Exp $ + * $Id: kern_physio.c,v 1.10 1995/03/16 18:12:34 bde Exp $ */ #include <sys/param.h> @@ -90,7 +90,7 @@ physio(strategy, bp, dev, rw, minp, uio) bp->b_saveaddr = sa; bp->b_blkno = btodb(uio->uio_offset); - + if (rw && !useracc(bp->b_data, bp->b_bufsize, B_WRITE)) { error = EFAULT; goto doerror; @@ -115,7 +115,7 @@ physio(strategy, bp, dev, rw, minp, uio) /* * update the uio data */ - { + { int iolen = bp->b_bcount - bp->b_resid; if (iolen == 0 && !(bp->b_flags & B_ERROR)) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 527d53b..3fa8cf2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_proc.c 8.4 (Berkeley) 1/4/94 - * $Id: kern_proc.c,v 1.8 1994/10/09 07:34:57 davidg Exp $ + * $Id: kern_proc.c,v 1.9 1994/10/10 01:00:45 phk Exp $ */ #include <sys/param.h> @@ -303,7 +303,7 @@ pgdelete(pgrp) { register struct pgrp **pgp = &pgrphash[PIDHASH(pgrp->pg_id)]; - if (pgrp->pg_session->s_ttyp != NULL && + if (pgrp->pg_session->s_ttyp != NULL && pgrp->pg_session->s_ttyp->t_pgrp == pgrp) pgrp->pg_session->s_ttyp->t_pgrp = NULL; for (; *pgp; pgp = &(*pgp)->pg_hforw) { @@ -368,7 +368,7 @@ fixjobc(p, pgrp, entering) orphanpg(hispgrp); } -/* +/* * A process group has become orphaned; * if there are any stopped processes in the group, * hang-up all process in that group. @@ -406,7 +406,7 @@ pgrpdump() pgrp, pgrp->pg_id, pgrp->pg_session, pgrp->pg_session->s_count, pgrp->pg_mem); for (p=pgrp->pg_mem; p; p=p->p_pgrpnxt) { - printf("\t\tpid %d addr %x pgrp %x\n", + printf("\t\tpid %d addr %x pgrp %x\n", p->p_pid, p, p->p_pgrp); } } diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index d27ca57..732888d 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.10 1994/12/06 22:53:37 bde Exp $ + * $Id: kern_resource.c,v 1.11 1995/02/20 19:42:33 guido Exp $ */ #include <sys/param.h> @@ -144,7 +144,7 @@ setpriority(curp, uap, retval) case PRIO_PGRP: { register struct pgrp *pg; - + if (uap->who == 0) pg = curp->p_pgrp; else if ((pg = pgfind(uap->who)) == NULL) @@ -243,7 +243,7 @@ rtprio(curp, uap, retval) if (suser(pcred->pc_ucred, &curp->p_acflag)) { /* can't set someone else's */ if (uap->pid) - return (EPERM); + return (EPERM); /* can't set realtime priority */ if (rtp.type == RTP_PRIO_REALTIME) return (EPERM); @@ -259,7 +259,7 @@ rtprio(curp, uap, retval) default: return (EINVAL); } - + default: return (EINVAL); } @@ -355,7 +355,7 @@ dosetrlimit(p, which, limp) if (limp->rlim_max < 0) limp->rlim_max = RLIM_INFINITY; - if (limp->rlim_cur > alimp->rlim_max || + if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 08ff425..2808912 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 - * $Id: kern_sig.c,v 1.9 1995/01/29 01:19:12 ats Exp $ + * $Id: kern_sig.c,v 1.10 1995/03/16 18:12:35 bde Exp $ */ #define SIGPROP /* include signal properties table */ @@ -266,7 +266,7 @@ sigprocmask(p, uap, retval) case SIG_SETMASK: p->p_sigmask = uap->mask &~ sigcantmask; break; - + default: error = EINVAL; break; @@ -507,13 +507,13 @@ killpg1(cp, signum, pgid, all) register struct pcred *pc = cp->p_cred; struct pgrp *pgrp; int nfound = 0; - - if (all) - /* - * broadcast + + if (all) + /* + * broadcast */ for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { - if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || p == cp || !CANSIGNAL(cp, pc, p, signum)) continue; nfound++; @@ -521,8 +521,8 @@ killpg1(cp, signum, pgid, all) psignal(p, signum); } else { - if (pgid == 0) - /* + if (pgid == 0) + /* * zero pgid means send to my process group. */ pgrp = cp->p_pgrp; @@ -650,7 +650,7 @@ trapsignal(p, signum, code) p->p_stats->p_ru.ru_nsignals++; #ifdef KTRACE if (KTRPOINT(p, KTR_PSIG)) - ktrpsig(p->p_tracep, signum, ps->ps_sigact[signum], + ktrpsig(p->p_tracep, signum, ps->ps_sigact[signum], p->p_sigmask, code); #endif sendsig(ps->ps_sigact[signum], signum, p->p_sigmask, code); @@ -1134,7 +1134,7 @@ sigexit(p, signum) p->p_sigacts->ps_sig = signum; /* * Log signals which would cause core dumps - * (Log as LOG_INFO to appease those who don't want + * (Log as LOG_INFO to appease those who don't want * these messages.) * XXX : Todo, as well as euid, write out ruid too */ diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 4c977c7..534e477 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_synch.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_synch.c,v 1.9 1994/12/12 06:04:27 davidg Exp $ + * $Id: kern_synch.c,v 1.10 1995/03/16 18:12:36 bde Exp $ */ #include <sys/param.h> @@ -108,7 +108,7 @@ roundrobin(arg) * We now need to prove two things: * 1) Given factor ** (5 * loadavg) ~= .1, prove factor == b/(b+1) * 2) Given b/(b+1) ** power ~= .1, prove power == (5 * loadavg) - * + * * Facts: * For x close to zero, exp(x) =~ 1 + x, since * exp(x) = 0! + x**1/1! + x**2/2! + ... . diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index ea9ed9a..cec5d55 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 - * $Id: kern_sysctl.c,v 1.23 1995/03/16 18:12:37 bde Exp $ + * $Id: kern_sysctl.c,v 1.24 1995/05/12 19:17:31 wollman Exp $ */ /* @@ -230,7 +230,7 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) * `tsleep' takes a timeout argument of 0 as meaning * `no timeout'. */ - error = sysctl_int(oldp, oldlenp, newp, newlen, + error = sysctl_int(oldp, oldlenp, newp, newlen, &vfs_update_interval); if(!error) { wakeup(&vfs_update_wakeup); @@ -671,7 +671,7 @@ again: } if (buflen >= sizeof(struct kinfo_proc)) { fill_eproc(p, &eproc); - error = copyout((caddr_t)p, &dp->kp_proc, + error = copyout((caddr_t)p, &dp->kp_proc, sizeof(struct proc)); if (error) return (error); @@ -747,7 +747,7 @@ fill_eproc(p, ep) ep->e_tsess = tp->t_session; } else ep->e_tdev = NODEV; - if (ep->e_sess && ep->e_sess->s_ttyvp) + if (ep->e_sess && ep->e_sess->s_ttyvp) ep->e_flag = EPROC_CTTY; if (SESS_LEADER(p)) ep->e_flag |= EPROC_SLEADER; diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 62d2bcb..7a6d79b 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.11 1994/12/12 11:58:46 bde Exp $ + * $Id: kern_clock.c,v 1.12 1995/03/16 18:12:29 bde Exp $ */ /* Portions of this software are covered by the following: */ @@ -459,7 +459,7 @@ hardclock(frame) statclock(frame); /* - * Increment the time-of-day. + * Increment the time-of-day. */ ticks++; { @@ -579,14 +579,14 @@ hardclock(frame) * replaced. */ switch (time_state) { - + case TIME_OK: if (time_status & STA_INS) time_state = TIME_INS; else if (time_status & STA_DEL) time_state = TIME_DEL; break; - + case TIME_INS: if (newtime.tv_sec % 86400 == 0) { newtime.tv_sec--; @@ -600,11 +600,11 @@ hardclock(frame) time_state = TIME_WAIT; } break; - + case TIME_OOP: time_state = TIME_WAIT; break; - + case TIME_WAIT: if (!(time_status & (STA_INS | STA_DEL))) time_state = TIME_OK; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 5ab24de..319b00a 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.6 1995/02/14 06:33:53 phk Exp $ + * $Id: kern_time.c,v 1.7 1995/03/16 18:12:38 bde Exp $ */ #include <sys/param.h> @@ -44,7 +44,7 @@ #include <machine/cpu.h> -/* +/* * Time of day and interval timer support. * * These routines provide the kernel entry points to get and set diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 62d2bcb..7a6d79b 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.11 1994/12/12 11:58:46 bde Exp $ + * $Id: kern_clock.c,v 1.12 1995/03/16 18:12:29 bde Exp $ */ /* Portions of this software are covered by the following: */ @@ -459,7 +459,7 @@ hardclock(frame) statclock(frame); /* - * Increment the time-of-day. + * Increment the time-of-day. */ ticks++; { @@ -579,14 +579,14 @@ hardclock(frame) * replaced. */ switch (time_state) { - + case TIME_OK: if (time_status & STA_INS) time_state = TIME_INS; else if (time_status & STA_DEL) time_state = TIME_DEL; break; - + case TIME_INS: if (newtime.tv_sec % 86400 == 0) { newtime.tv_sec--; @@ -600,11 +600,11 @@ hardclock(frame) time_state = TIME_WAIT; } break; - + case TIME_OOP: time_state = TIME_WAIT; break; - + case TIME_WAIT: if (!(time_status & (STA_INS | STA_DEL))) time_state = TIME_OK; diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 6ac6596..23439a0 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 - * $Id: kern_xxx.c,v 1.8 1994/10/02 17:35:21 phk Exp $ + * $Id: kern_xxx.c,v 1.9 1994/12/04 19:58:43 phk Exp $ */ #include <sys/param.h> @@ -49,7 +49,7 @@ static void dummy_cleanup() {} TEXT_SET(cleanup_set, dummy_cleanup); - + typedef void (*cleanup_func_t)(void); extern const struct linker_set cleanup_set; static const cleanup_func_t *cleanups = diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index a261533..527b439 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -6,7 +6,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: tty_subr.c,v 1.8 1994/10/30 19:43:49 bde Exp $ + * $Id: tty_subr.c,v 1.9 1994/11/26 19:23:50 bde Exp $ */ /* @@ -433,7 +433,7 @@ b_to_q(src, amount, clistp) */ numc = min(amount, (char *)(cblockp + 1) - clistp->c_cl); bcopy(src, clistp->c_cl, numc); - + /* * Clear quote bits. The following could probably be made into * a seperate "bitzero()" routine, but why bother? @@ -548,7 +548,7 @@ unputc(clistp) cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND); /* - * Set quote flag if this character was quoted. + * Set quote flag if this character was quoted. */ if (isset(cblockp->c_quote, (u_char *)clistp->c_cl - cblockp->c_info)) chr |= TTY_QUOTE; diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index 8d4a6fd..958f594 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -42,7 +42,7 @@ * SUCH DAMAGE. * * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: ufs_disksubr.c,v 1.13 1995/03/18 06:38:04 davidg Exp $ + * $Id: ufs_disksubr.c,v 1.14 1995/03/18 07:06:51 davidg Exp $ */ #include <sys/param.h> @@ -255,7 +255,7 @@ readdisklabel(dev, strat, lp, dp, bdp) * will be relative to the base of the BSD part. */ msgMSP = readMSPtolabel(dev, strat, lp, dp, &cyl ); - + /* * next, dig out disk label, relative to either the base of the * BSD part, or block 0, depending on if an MSP was found. @@ -481,7 +481,7 @@ writedisklabel(dev, strat, lp) * force OURPART to start at block 0 as a default in case there is NO * MSP. * readMSPtolabel() will reset it to start at the start of the BSD - * part if it exists + * part if it exists * At this time this is an error contition but I've left support for it */ lp->d_npartitions = OURPART + 1; @@ -491,7 +491,7 @@ writedisklabel(dev, strat, lp) msg = readMSPtolabel(dev, strat, lp, 0, &cyl ); /* - * If we want to be able to install without an Machine Specific + * If we want to be able to install without an Machine Specific * Partitioning , then * the failure of readMSPtolabel() should be made non fatal. */ @@ -515,7 +515,7 @@ writedisklabel(dev, strat, lp) /* * get all the other bits back from the good new disklabel * (the user wouldn't try confuse us would he?) - * With the exception of the OURPART which now points to the + * With the exception of the OURPART which now points to the * BSD partition. */ BSDstart = lp->d_partitions[OURPART].p_offset; diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 6360027..618f4f4 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -43,7 +43,7 @@ * from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ - * $Id: subr_diskslice.c,v 1.12 1995/05/08 16:24:08 bde Exp $ + * $Id: subr_diskslice.c,v 1.13 1995/05/24 23:33:42 davidg Exp $ */ #include <sys/param.h> @@ -626,7 +626,7 @@ dsopen(dname, dev, mode, sspp, lp, strat, setgeom) set_ds_wlabel(ssp, slice, TRUE); /* XXX invert */ lp1 = malloc(sizeof *lp1, M_DEVBUF, M_WAITOK); *lp1 = *lp; - lp = lp1; + lp = lp1; TRACE(("readdisklabel\n")); msg = correct_readdisklabel(dkmodpart(dev, RAW_PART), strat, lp); #if 0 /* XXX */ diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 394bf9f..d4e181e 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_log.c,v 1.6 1995/04/29 05:09:19 jkh Exp $ + * $Id: subr_log.c,v 1.7 1995/04/29 11:36:47 jkh Exp $ */ /* @@ -181,7 +181,7 @@ logwakeup() selwakeup(&logsoftc.sc_selp); if (logsoftc.sc_state & LOG_ASYNC) { if (logsoftc.sc_pgid < 0) - gsignal(-logsoftc.sc_pgid, SIGIO); + gsignal(-logsoftc.sc_pgid, SIGIO); else if ((p = pfind(logsoftc.sc_pgid))) psignal(p, SIGIO); } diff --git a/sys/kern/subr_rlist.c b/sys/kern/subr_rlist.c index c64b685..0bc6f4c 100644 --- a/sys/kern/subr_rlist.c +++ b/sys/kern/subr_rlist.c @@ -12,25 +12,25 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This software is a component of "386BSD" developed by + * This software is a component of "386BSD" developed by William F. Jolitz, TeleMuse. * 4. Neither the name of the developer nor the name "386BSD" * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ - * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS - * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. - * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT + * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ + * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS + * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. + * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT * NOT MAKE USE THIS WORK. * * FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED - * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN - * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES - * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING - * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND - * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE - * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS + * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN + * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES + * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING + * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND + * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE + * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS * OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND @@ -54,7 +54,7 @@ * functioning of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: subr_rlist.c,v 1.8 1995/01/31 06:48:53 davidg Exp $ + * $Id: subr_rlist.c,v 1.9 1995/03/16 18:12:41 bde Exp $ */ #include <sys/param.h> @@ -87,7 +87,7 @@ rlist_malloc() splx(s); if( !rl) break; - + for(i=0;i<(NBPG/(sizeof *rl));i++) { rl->rl_next = rlfree; rlfree = rl; @@ -98,7 +98,7 @@ rlist_malloc() if( (rl = rlfree) == 0 ) panic("Cannot get an rlist entry"); - + --rlist_count; rlfree = rl->rl_next; return rl; @@ -111,7 +111,7 @@ rlist_mfree( struct rlist *rl) rlfree = rl; ++rlist_count; } - + void rlist_free(rlp, start, end) struct rlist **rlp; diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 6ca87c2..5e1489a 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.50 1995/03/21 07:02:51 davidg Exp $ + * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ */ /* @@ -174,7 +174,7 @@ trap(frame) type = frame.tf_trapno; code = frame.tf_err; - + if (ISPL(frame.tf_cs) == SEL_UPL) { /* user trap */ @@ -262,7 +262,7 @@ trap(frame) return; #endif /* NNPX > 0 */ -#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) +#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) i = math_emulate(&frame); if (i == 0) { if (!(frame.tf_eflags & PSL_T)) @@ -352,7 +352,7 @@ trap(frame) frame.tf_eflags &= ~PSL_T; return; #endif - + #if NISA > 0 case T_NMI: #ifdef DDB @@ -376,7 +376,7 @@ trap(frame) #ifdef DEBUG eva = rcr2(); if (type <= MAX_TRAP_MSG) { - uprintf("fatal process exception: %s", + uprintf("fatal process exception: %s", trap_msg[type]); if ((type == T_PAGEFLT) || (type == T_PROTFLT)) uprintf(", fault VA = 0x%x", eva); @@ -464,7 +464,7 @@ trap_pfault(frame, usermode) v = (vm_offset_t) vtopte(va); /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -580,7 +580,7 @@ trap_pfault(frame, usermode) */ /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + *(volatile char *)v += 0; pmap_use_pt( vm_map_pmap(map), va); @@ -804,7 +804,7 @@ syscall(frame) if (p->p_sysent->sv_mask) code = code & p->p_sysent->sv_mask; - + if (code >= p->p_sysent->sv_size) callp = &p->p_sysent->sv_table[0]; else @@ -852,7 +852,7 @@ syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = error; frame.tf_eflags |= PSL_C; /* carry bit */ @@ -966,7 +966,7 @@ linux_syscall(frame) if (p->p_sysent->sv_errsize) if (error >= p->p_sysent->sv_errsize) error = -1; /* XXX */ - else + else error = p->p_sysent->sv_errtbl[error]; frame.tf_eax = -error; frame.tf_eflags |= PSL_C; /* carry bit */ diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index e88e789..d464122 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $Id: sys_generic.c,v 1.11 1995/04/13 15:27:51 davidg Exp $ + * $Id: sys_generic.c,v 1.12 1995/04/13 18:24:33 davidg Exp $ */ #include <sys/param.h> @@ -445,7 +445,7 @@ ioctl(p, uap, retval) *(caddr_t *)data = uap->data; #ifdef COMPAT_IBCS2 else if (com) - /* + /* * Pick up such things as NIOCxx. * Any copyouts will have to be done prior * to return by their servicing code. diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 350433c..4a01c60 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sys_process.c,v 1.12 1995/03/16 18:12:42 bde Exp $ + * $Id: sys_process.c,v 1.13 1995/05/12 21:39:48 davidg Exp $ */ #include <sys/param.h> @@ -65,16 +65,16 @@ pread (struct proc *procp, unsigned int addr, unsigned int *retval) { page_offset = addr - trunc_page(addr); pageno = trunc_page(addr); - + tmap = map; rv = vm_map_lookup (&tmap, pageno, VM_PROT_READ, &out_entry, &object, &off, &out_prot, &wired, &single_use); if (rv != KERN_SUCCESS) return EINVAL; - + vm_map_lookup_done (tmap, out_entry); - + /* Find space in kernel_map for the page we're interested in */ rv = vm_map_find (kernel_map, object, off, &kva, PAGE_SIZE, 1); @@ -108,12 +108,12 @@ pwrite (struct proc *procp, unsigned int addr, unsigned int datum) { boolean_t fix_prot = 0; /* Map page into kernel space */ - + map = &procp->p_vmspace->vm_map; - + page_offset = addr - trunc_page(addr); pageno = trunc_page(addr); - + /* * Check the permissions for the area we're interested in. */ @@ -151,7 +151,7 @@ pwrite (struct proc *procp, unsigned int addr, unsigned int datum) { */ vm_map_lookup_done (tmap, out_entry); - + /* * Fault the page in... */ @@ -176,7 +176,7 @@ pwrite (struct proc *procp, unsigned int addr, unsigned int datum) { } vm_map_remove (kernel_map, kva, kva + PAGE_SIZE); } - + if (fix_prot) vm_map_protect (map, pageno, pageno + PAGE_SIZE, VM_PROT_READ|VM_PROT_EXECUTE, 0); diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index f7ced53..92cbedc 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 - * $Id: sys_socket.c,v 1.3 1994/08/02 07:42:42 davidg Exp $ + * $Id: sys_socket.c,v 1.4 1994/10/02 17:35:25 phk Exp $ */ #include <sys/param.h> @@ -131,7 +131,7 @@ soo_ioctl(fp, cmd, data, p) return (ifioctl(so, cmd, data, p)); if (IOCGROUP(cmd) == 'r') return (rtioctl(cmd, data, p)); - return ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL, + return ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL, (struct mbuf *)cmd, (struct mbuf *)data, (struct mbuf *)0)); } @@ -186,7 +186,7 @@ soo_stat(so, ub) bzero((caddr_t)ub, sizeof (*ub)); ub->st_mode = S_IFSOCK; return ((*so->so_proto->pr_usrreq)(so, PRU_SENSE, - (struct mbuf *)ub, (struct mbuf *)0, + (struct mbuf *)ub, (struct mbuf *)0, (struct mbuf *)0)); } diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 4ef4bf7..4444f6e 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $Id: sysv_msg.c,v 1.2 1994/09/17 13:24:16 davidg Exp $ */ +/* $Id: sysv_msg.c,v 1.3 1994/10/02 17:35:26 phk Exp $ */ /* * Implementation of SVID messages @@ -341,7 +341,7 @@ msgget(p, uap, retval) #ifdef MSG_DEBUG_OK printf("no more msqid_ds's available\n"); #endif - return(ENOSPC); + return(ENOSPC); } #ifdef MSG_DEBUG_OK printf("msqid %d is available\n", msqid); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 9bafdff..0be0e34 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,4 +1,4 @@ -/* $Id: sysv_sem.c,v 1.3 1994/10/02 17:35:27 phk Exp $ */ +/* $Id: sysv_sem.c,v 1.4 1994/10/06 21:06:32 davidg Exp $ */ /* * Implementation of SVID semaphores @@ -620,7 +620,7 @@ semop(p, uap, retval) return(eval); } - /* + /* * Loop trying to satisfy the vector of requests. * If we reach a point where we must wait, any requests already * performed are rolled back and we go to sleep until some other diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 09fe34b..de8379c 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $Id: sysv_shm.c,v 1.3 1994/10/02 17:35:28 phk Exp $ */ +/* $Id: sysv_shm.c,v 1.4 1995/02/20 22:23:13 davidg Exp $ */ /* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */ /* @@ -64,7 +64,7 @@ int oshmctl(); int shmat(), shmctl(), shmdt(), shmget(); int (*shmcalls[])() = { shmat, oshmctl, shmdt, shmget, shmctl }; - + #define SHMSEG_FREE 0x0200 #define SHMSEG_REMOVED 0x0400 #define SHMSEG_ALLOCATED 0x0800 @@ -143,7 +143,7 @@ shm_delete_mapping(p, shmmap_s) struct shmid_ds *shmseg; int segnum, result; size_t size; - + segnum = IPCID_TO_IX(shmmap_s->shmid); shmseg = &shmsegs[segnum]; size = (shmseg->shm_segsz + CLOFSET) & ~CLOFSET; @@ -230,7 +230,7 @@ shmat(p, uap, retval) flags = MAP_ANON | MAP_SHARED; if (uap->shmaddr) { flags |= MAP_FIXED; - if (uap->shmflg & SHM_RND) + if (uap->shmflg & SHM_RND) attach_va = (vm_offset_t)uap->shmaddr & ~(SHMLBA-1); else if (((vm_offset_t)uap->shmaddr & (SHMLBA-1)) == 0) attach_va = (vm_offset_t)uap->shmaddr; @@ -311,7 +311,7 @@ oshmctl(p, uap, retval) #else return EINVAL; #endif -} +} struct shmctl_args { int shmid; @@ -428,7 +428,7 @@ shmget_allocate_segment(p, uap, mode, retval) struct ucred *cred = p->p_ucred; struct shmid_ds *shmseg; struct shm_handle *shm_handle; - + if (uap->size < shminfo.shmmin || uap->size > shminfo.shmmax) return EINVAL; if (shm_nused >= shminfo.shmmni) /* any shmids left? */ @@ -510,7 +510,7 @@ shmget(p, uap, retval) goto again; return error; } - if ((uap->shmflg & IPC_CREAT) == 0) + if ((uap->shmflg & IPC_CREAT) == 0) return ENOENT; } return shmget_allocate_segment(p, uap, mode, retval); diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 66fec9e..b5b5f67 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.43 1995/05/07 06:32:28 bde Exp $ + * $Id: tty.c,v 1.44 1995/05/07 23:53:36 ache Exp $ */ #include "snp.h" @@ -208,7 +208,7 @@ ttyclose(tp) clist_free_cblocks(&tp->t_rawq); #if NSNP > 0 - if (ISSET(tp->t_state, TS_SNOOP) && tp->t_sc != NULL) + if (ISSET(tp->t_state, TS_SNOOP) && tp->t_sc != NULL) snpdown((struct snoop *)tp->t_sc); #endif diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index b420d46..9b4b731 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -31,10 +31,10 @@ * SUCH DAMAGE. * * @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 - * $Id: tty_compat.c,v 1.11 1995/04/02 19:26:50 ache Exp $ + * $Id: tty_compat.c,v 1.12 1995/04/11 17:54:25 ache Exp $ */ -/* +/* * mapping routines for old line discipline (yuck) */ #if defined(COMPAT_43) || defined(COMPAT_SUNOS) @@ -146,7 +146,7 @@ int ttsetcompat(tp, com, data, term) if (*com == TIOCLSET) tp->t_flags = (tp->t_flags&0xffff) | *(int *)data<<16; else { - tp->t_flags = + tp->t_flags = (ttcompatgetflags(tp)&0xffff0000)|(tp->t_flags&0xffff); if (*com == TIOCLBIS) tp->t_flags |= *(int *)data<<16; @@ -228,7 +228,7 @@ ttcompat(tp, com, data, flag) } case TIOCLGET: tp->t_flags = - (ttcompatgetflags(tp) & 0xffff0000UL) + (ttcompatgetflags(tp) & 0xffff0000UL) | (tp->t_flags & 0xffff); *(int *)data = tp->t_flags>>16; if (ttydebug) @@ -242,7 +242,7 @@ ttcompat(tp, com, data, flag) case OTIOCSETD: { int ldisczero = 0; - return (ttioctl(tp, TIOCSETD, + return (ttioctl(tp, TIOCSETD, *(int *)data == 2 ? (caddr_t)&ldisczero : data, flag)); } @@ -284,8 +284,8 @@ ttcompatgetflags(tp) } else flags |= EVENP | ODDP; } - - if ((lflag&ICANON) == 0) { + + if ((lflag&ICANON) == 0) { /* fudge */ if (iflag&(INPCK|ISTRIP|IXON) || lflag&(IEXTEN|ISIG) || cflag&(CSIZE|PARENB) != CS8) @@ -355,7 +355,7 @@ ttcompatsetflags(tp, t) lflag |= ECHO; else lflag &= ~ECHO; - + cflag &= ~(CSIZE|PARENB); if (flags&(RAW|LITOUT|PASS8)) { cflag |= CS8; @@ -379,7 +379,7 @@ ttcompatsetflags(tp, t) } else if ((flags&(EVENP|ODDP)) == ODDP) { iflag |= INPCK; cflag |= PARODD; - } else + } else iflag &= ~INPCK; if (flags&TANDEM) iflag |= IXOFF; diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index e565c61..c2acc9b 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty_conf.c 8.4 (Berkeley) 1/21/94 - * $Id: tty_conf.c,v 1.4 1994/10/05 21:22:24 wollman Exp $ + * $Id: tty_conf.c,v 1.5 1995/03/21 11:23:58 dufault Exp $ */ #include <sys/param.h> @@ -89,7 +89,7 @@ struct linesw linesw[MAXLDISC] = int nlinesw = sizeof (linesw) / sizeof (linesw[0]); -static struct linesw nodisc = +static struct linesw nodisc = { ttynodisc, ttyerrclose, diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 3076fab..1500ff2 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.26 1995/04/23 12:55:54 bde Exp $ + * $Id: cons.c,v 1.27 1995/04/24 16:42:59 bde Exp $ */ #include <sys/param.h> @@ -135,7 +135,7 @@ cnopen(dev, flag, mode, p) } return (retval); } - + int cnclose(dev, flag, mode, p) dev_t dev; @@ -168,7 +168,7 @@ cnclose(dev, flag, mode, p) } return ((*cn_phys_close)(dev, flag, mode, p)); } - + int cnread(dev, uio, flag) dev_t dev; @@ -180,7 +180,7 @@ cnread(dev, uio, flag) dev = cn_tab->cn_dev; return ((*cdevsw[major(dev)].d_read)(dev, uio, flag)); } - + int cnwrite(dev, uio, flag) dev_t dev; @@ -195,7 +195,7 @@ cnwrite(dev, uio, flag) dev = cn_tab->cn_dev; return ((*cdevsw[major(dev)].d_write)(dev, uio, flag)); } - + int cnioctl(dev, cmd, data, flag, p) dev_t dev; diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index a2f913b..182efae 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_pty.c,v 1.9 1995/04/09 22:28:24 ache Exp $ + * $Id: tty_pty.c,v 1.10 1995/04/10 01:45:43 ache Exp $ */ /* @@ -185,7 +185,7 @@ again: p->p_flag & P_PPWAIT) return (EIO); pgsignal(p->p_pgrp, SIGTTIN, 1); - error = ttysleep(tp, (caddr_t)&lbolt, + error = ttysleep(tp, (caddr_t)&lbolt, TTIPRI | PCATCH, ttybg, 0); if (error) return (error); @@ -641,7 +641,7 @@ ptyioctl(dev, cmd, data, flag, p) return (0); #ifdef COMPAT_43 - case TIOCSETP: + case TIOCSETP: case TIOCSETN: #endif case TIOCSETD: @@ -701,7 +701,7 @@ ptyioctl(dev, cmd, data, flag, p) break; } } - stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s')) + stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s')) && CCEQ(cc[VSTART], CTRL('q')); if (pti->pt_flags & PF_NOSTOP) { if (stop) { diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c index e36af00..503836b 100644 --- a/sys/kern/tty_snoop.c +++ b/sys/kern/tty_snoop.c @@ -63,7 +63,7 @@ snpwrite(dev, uio, flag) int unit = minor(dev), len, i, error; struct snoop *snp = &snoopsw[unit]; struct tty *tp; - char c[SNP_INPUT_BUF]; + char c[SNP_INPUT_BUF]; if (snp->snp_tty == NULL) return (EIO); @@ -71,16 +71,16 @@ snpwrite(dev, uio, flag) tp = snp->snp_tty; if ((tp->t_sc == snp) && (tp->t_state & TS_SNOOP) && - (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) + (tp->t_line == OTTYDISC || tp->t_line == NTTYDISC)) goto tty_input; printf("Snoop: attempt to write to bad tty.\n"); return (EIO); tty_input: - if (!(tp->t_state & TS_ISOPEN)) + if (!(tp->t_state & TS_ISOPEN)) return (EIO); - + while (uio->uio_resid > 0) { len = MIN(uio->uio_resid,SNP_INPUT_BUF); if ((error = uiomove(c, len, uio)) != 0) @@ -91,7 +91,7 @@ tty_input: } } return 0; - + } @@ -443,7 +443,7 @@ snpioctl(dev, cmd, data, flag) s = spltty(); if (snp->snp_tty != NULL) *(int *) data = snp->snp_len; - else + else if (snp->snp_flags & SNOOP_DOWN) { if (snp->snp_flags & SNOOP_OFLOW) *(int *) data = SNP_OFLOW; @@ -473,7 +473,7 @@ snpselect(dev, rw, p) if (rw != FREAD) return 1; - + if (snp->snp_len > 0) return 1; diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index a261533..527b439 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -6,7 +6,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: tty_subr.c,v 1.8 1994/10/30 19:43:49 bde Exp $ + * $Id: tty_subr.c,v 1.9 1994/11/26 19:23:50 bde Exp $ */ /* @@ -433,7 +433,7 @@ b_to_q(src, amount, clistp) */ numc = min(amount, (char *)(cblockp + 1) - clistp->c_cl); bcopy(src, clistp->c_cl, numc); - + /* * Clear quote bits. The following could probably be made into * a seperate "bitzero()" routine, but why bother? @@ -548,7 +548,7 @@ unputc(clistp) cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND); /* - * Set quote flag if this character was quoted. + * Set quote flag if this character was quoted. */ if (isset(cblockp->c_quote, (u_char *)clistp->c_cl - cblockp->c_info)) chr |= TTY_QUOTE; diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index e3c5035..9fe7f33 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_tty.c,v 1.3 1994/08/02 07:42:57 davidg Exp $ + * $Id: tty_tty.c,v 1.4 1994/12/04 01:46:13 ache Exp $ */ /* @@ -66,7 +66,7 @@ cttyopen(dev, flag, mode, p) * Since group is tty and mode is 620 on most terminal lines * and since sessions protect terminals from processes outside * your session, this check is probably no longer necessary. - * Since it inhibits setuid root programs that later switch + * Since it inhibits setuid root programs that later switch * to another user from accessing /dev/tty, we have decided * to delete this test. (mckusick 5/93) */ diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 2da7643..3f7d082 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.3 1994/08/02 07:43:08 davidg Exp $ + * $Id: uipc_socket2.c,v 1.4 1994/10/02 17:35:33 phk Exp $ */ #include <sys/param.h> @@ -79,7 +79,7 @@ u_long sb_max = SB_MAX; /* patchable */ * structure queued on so_q0 by calling sonewconn(). When the connection * is established, soisconnected() is called, and transfers the * socket structure to so_q, making it available to accept(). - * + * * If a socket is closed with sockets on either * so_q0 or so_q, these sockets are dropped. * @@ -162,7 +162,7 @@ sonewconn1(head, connstatus) if (head->so_qlen + head->so_q0len > 3 * head->so_qlimit / 2) return ((struct socket *)0); MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT); - if (so == NULL) + if (so == NULL) return ((struct socket *)0); bzero((caddr_t)so, sizeof(*so)); so->so_type = head->so_type; @@ -281,7 +281,7 @@ sbwait(sb) sb->sb_timeo)); } -/* +/* * Lock a sockbuf already known to be locked; * return any error returned from sleep (EINTR). */ @@ -293,7 +293,7 @@ sb_lock(sb) while (sb->sb_flags & SB_LOCK) { sb->sb_flags |= SB_WANT; - error = tsleep((caddr_t)&sb->sb_flags, + error = tsleep((caddr_t)&sb->sb_flags, (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK|PCATCH, netio, 0); if (error) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5e3bd97..90346e2 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 - * $Id: uipc_socket.c,v 1.8 1995/02/07 02:01:14 wollman Exp $ + * $Id: uipc_socket.c,v 1.9 1995/02/16 01:07:43 wollman Exp $ */ #include <sys/param.h> @@ -793,7 +793,7 @@ dontblock: splx(s); goto restart; } - + if (flagsp) *flagsp |= flags; release: diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 2da7643..3f7d082 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93 - * $Id: uipc_socket2.c,v 1.3 1994/08/02 07:43:08 davidg Exp $ + * $Id: uipc_socket2.c,v 1.4 1994/10/02 17:35:33 phk Exp $ */ #include <sys/param.h> @@ -79,7 +79,7 @@ u_long sb_max = SB_MAX; /* patchable */ * structure queued on so_q0 by calling sonewconn(). When the connection * is established, soisconnected() is called, and transfers the * socket structure to so_q, making it available to accept(). - * + * * If a socket is closed with sockets on either * so_q0 or so_q, these sockets are dropped. * @@ -162,7 +162,7 @@ sonewconn1(head, connstatus) if (head->so_qlen + head->so_q0len > 3 * head->so_qlimit / 2) return ((struct socket *)0); MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT); - if (so == NULL) + if (so == NULL) return ((struct socket *)0); bzero((caddr_t)so, sizeof(*so)); so->so_type = head->so_type; @@ -281,7 +281,7 @@ sbwait(sb) sb->sb_timeo)); } -/* +/* * Lock a sockbuf already known to be locked; * return any error returned from sleep (EINTR). */ @@ -293,7 +293,7 @@ sb_lock(sb) while (sb->sb_flags & SB_LOCK) { sb->sb_flags |= SB_WANT; - error = tsleep((caddr_t)&sb->sb_flags, + error = tsleep((caddr_t)&sb->sb_flags, (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK|PCATCH, netio, 0); if (error) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index d9a44e5..7c0864e 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 - * $Id: uipc_syscalls.c,v 1.4 1994/10/02 17:35:35 phk Exp $ + * $Id: uipc_syscalls.c,v 1.5 1995/03/16 18:12:46 bde Exp $ */ #include <sys/param.h> @@ -238,7 +238,7 @@ accept1(p, uap, retval) return (error); } -#ifdef COMPAT_OLDSOCK +#ifdef COMPAT_OLDSOCK int accept(p, uap, retval) struct proc *p; @@ -398,7 +398,7 @@ sendit(p, s, mp, flags, retsize) #ifdef KTRACE struct iovec *ktriov = NULL; #endif - + error = getsock(p->p_fd, s, &fp); if (error) return (error); @@ -564,7 +564,7 @@ osendmsg(p, uap, retval) if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) return (EMSGSIZE); MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, + sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, M_WAITOK); } else iov = aiov; @@ -649,7 +649,7 @@ recvit(p, s, mp, namelenp, retsize) #ifdef KTRACE struct iovec *ktriov = NULL; #endif - + error = getsock(p->p_fd, s, &fp); if (error) return (error); @@ -1096,7 +1096,7 @@ struct getsockname_args { #endif }; -#ifndef COMPAT_OLDSOCK +#ifndef COMPAT_OLDSOCK #define getsockname1 getsockname #endif @@ -1178,7 +1178,7 @@ struct getpeername_args { }; -#ifndef COMPAT_OLDSOCK +#ifndef COMPAT_OLDSOCK #define getpeername1 getpeername #endif diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index f425526..a54a46a 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 - * $Id: uipc_usrreq.c,v 1.7 1995/02/15 11:30:35 davidg Exp $ + * $Id: uipc_usrreq.c,v 1.8 1995/05/11 00:13:06 wollman Exp $ */ #include <sys/param.h> @@ -228,7 +228,7 @@ uipc_usrreq(so, req, m, nam, control) break; } } - + if (so->so_state & SS_CANTSENDMORE) { error = EPIPE; break; @@ -348,7 +348,7 @@ unp_attach(so) register struct mbuf *m; register struct unpcb *unp; int error; - + if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { switch (so->so_type) { @@ -379,7 +379,7 @@ void unp_detach(unp) register struct unpcb *unp; { - + if (unp->unp_vnode) { unp->unp_vnode->v_socket = 0; vrele(unp->unp_vnode); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f3f6528..e7ac981 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.44 1995/05/11 19:26:29 rgrimes Exp $ + * $Id: vfs_bio.c,v 1.45 1995/05/21 21:38:49 davidg Exp $ */ /* @@ -399,7 +399,7 @@ brelse(struct buf * bp) if (((bp->b_flags & B_VMIO) == 0) && bp->b_vp) brelvp(bp); } - + /* * VMIO buffer rundown. It is not very necessary to keep a VMIO buffer * constituted, so the B_INVAL flag is used to *invalidate* the buffer, @@ -449,7 +449,7 @@ brelse(struct buf * bp) vm_page_test_dirty(m); if (m->dirty == 0) { vm_page_set_invalid(m, foff, resid); - if (m->valid == 0) + if (m->valid == 0) vm_page_protect(m, VM_PROT_NONE); } } @@ -825,7 +825,7 @@ loop: bp->b_flags |= B_WANTED; if (!tsleep((caddr_t) bp, PRIBIO | slpflag, "getblk", slptimeo)) goto loop; - + splx(s); return (struct buf *) NULL; } @@ -861,7 +861,7 @@ loop: /* * This code is used to make sure that a buffer is not - * created while the getnewbuf routine is blocked. + * created while the getnewbuf routine is blocked. * Normally the vnode is locked so this isn't a problem. * VBLK type I/O requests, however, don't lock the vnode. * VOP_ISLOCKED would be much better but is also much @@ -1431,7 +1431,7 @@ vfs_bio_clrbuf(struct buf *bp) { } bp->b_resid = 0; return; - } + } for(i=0;i<bp->b_npages;i++) { if( bp->b_pages[i]->valid == VM_PAGE_BITS_ALL) continue; @@ -1440,7 +1440,7 @@ vfs_bio_clrbuf(struct buf *bp) { } else { int j; for(j=0;j<PAGE_SIZE/DEV_BSIZE;j++) { - if( (bp->b_pages[i]->valid & (1<<j)) == 0) + if( (bp->b_pages[i]->valid & (1<<j)) == 0) bzero(bp->b_data + i * PAGE_SIZE + j * DEV_BSIZE, DEV_BSIZE); } } diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e8f1b16..a05b4a0 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94 - * $Id: vfs_cache.c,v 1.13 1995/04/04 02:01:13 davidg Exp $ + * $Id: vfs_cache.c,v 1.14 1995/04/15 00:49:35 davidg Exp $ */ #include <sys/param.h> @@ -99,15 +99,15 @@ u_long nchnbr; NCHNBR(ncp); } } /* - * Lookup an entry in the cache + * Lookup an entry in the cache * - * We don't do this if the segment name is long, simply so the cache + * We don't do this if the segment name is long, simply so the cache * can avoid holding long names (which would either waste space, or * add greatly to the complexity). * * Lookup is called with dvp pointing to the directory to search, * cnp pointing to the name of the entry being sought. - * If the lookup succeeds, the vnode is returned in *vpp, and a status + * If the lookup succeeds, the vnode is returned in *vpp, and a status * of -1 is returned. * If the lookup determines that the name does not exist (negative cacheing), * a status of ENOENT is returned. @@ -161,7 +161,7 @@ cache_lookup(dvp, vpp, cnp) nchstats.ncs_badhits++; PURGE(ncp); return (0); - } + } /* We found a "positive" match, return the vnode */ if (ncp->nc_vp != &nchENOENT) { @@ -254,7 +254,7 @@ nchinit() /* * Invalidate a all entries to particular vnode. - * + * * We actually just increment the v_id, that will do it. The entries will * be purged by lookup as they get found. * If the v_id wraps around, we need to ditch the entire cache, to avoid diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 04d803d..89a0c1b 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 - * $Id: vfs_cluster.c,v 1.14 1995/03/19 13:28:54 davidg Exp $ + * $Id: vfs_cluster.c,v 1.15 1995/04/04 02:10:17 davidg Exp $ */ #include <sys/param.h> @@ -140,7 +140,7 @@ cluster_read(vp, filesize, lblkno, size, cred, bpp) if ( vp->v_maxra >= (origlblkno + vp->v_ralen)) return 0; lblkno = vp->v_maxra; - } + } bp = NULL; } else { /* @@ -422,7 +422,7 @@ cluster_write(bp, filesize) if (vp->v_clen != 0) { /* * Next block is not sequential. - * + * * If we are not writing at end of file, the process * seeked to another point in the file since its last * write, or we have reached our maximum cluster size, diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 508e23f..ad12721 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 - * $Id: vfs_init.c,v 1.8 1994/10/08 22:33:42 phk Exp $ + * $Id: vfs_init.c,v 1.9 1994/10/20 00:48:28 wollman Exp $ */ @@ -189,7 +189,7 @@ vfs_opv_init(struct vnodeopv_desc **them) } for (k = 0; k<vfs_opv_numops; k++) if (opv_desc_vector[k] == NULL) - opv_desc_vector[k] = + opv_desc_vector[k] = opv_desc_vector[VOFFSET(vop_default)]; } } @@ -250,7 +250,7 @@ vfsinit() vfsconf[(**vfc).vfc_index] = *vfc; vfc++; } - + /* * Initialize the vnode table */ @@ -319,7 +319,7 @@ fs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) } *oldlenp = where - start; return 0; - + default: if(namelen < 1) return EINVAL; diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 8936e2e..b25745c 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 - * $Id: vfs_lookup.c,v 1.5 1994/09/27 20:33:30 phk Exp $ + * $Id: vfs_lookup.c,v 1.6 1994/10/06 21:06:36 davidg Exp $ */ #include <sys/param.h> @@ -229,7 +229,7 @@ namei(ndp) * the target is returned locked, otherwise it is returned unlocked. * When creating or renaming and LOCKPARENT is specified, the target may not * be ".". When deleting and LOCKPARENT is specified, the target may be ".". - * + * * Overall outline of lookup: * * dirloop: @@ -645,7 +645,7 @@ relookup(dvp, vpp, cnp) /* ASSERT(dvp == ndp->ni_startdir) */ if (cnp->cn_flags & SAVESTART) VREF(dvp); - + if (!wantparent) vrele(dvp); if ((cnp->cn_flags & LOCKLEAF) == 0) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 187ff3b..bdd88d5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id: vfs_vnops.c,v 1.9 1995/03/19 12:08:03 davidg Exp $ + * $Id: vfs_vnops.c,v 1.10 1995/05/10 18:59:11 davidg Exp $ */ #include <sys/param.h> @@ -89,7 +89,7 @@ vn_open(ndp, fmode, cmode) LEASE_CHECK(ndp->ni_dvp, p, cred, LEASE_WRITE); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, vap); - if (error) + if (error) return (error); fmode &= ~O_TRUNC; vp = ndp->ni_vp; diff --git a/sys/libkern/inet_ntoa.c b/sys/libkern/inet_ntoa.c index dcc6078..75911a6 100644 --- a/sys/libkern/inet_ntoa.c +++ b/sys/libkern/inet_ntoa.c @@ -13,7 +13,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF diff --git a/sys/libkern/mcount.c b/sys/libkern/mcount.c index f9942e8..fc3625b 100644 --- a/sys/libkern/mcount.c +++ b/sys/libkern/mcount.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mcount.c,v 1.2 1994/08/02 07:44:09 davidg Exp $ + * $Id: mcount.c,v 1.3 1994/09/15 15:41:48 paul Exp $ */ #include <sys/param.h> @@ -49,7 +49,7 @@ * _mcount updates data structures that represent traversals of the * program's call graph edges. frompc and selfpc are the return * address and function address that represents the given call graph edge. - * + * * Note: the original BSD code used the same variable (frompcindex) for * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. @@ -156,7 +156,7 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ *frompcindex = toindex; goto done; } - + } done: #ifdef KERNEL diff --git a/sys/libkern/muldi3.c b/sys/libkern/muldi3.c index 49adc51..96d100c 100644 --- a/sys/libkern/muldi3.c +++ b/sys/libkern/muldi3.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: muldi3.c,v 1.2 1994/08/02 07:44:13 davidg Exp $ */ #include "quad.h" @@ -47,7 +47,7 @@ * * u = 2^n u1 * u0 (n = number of bits in `u_long', usu. 32) * - * and + * and * * v = 2^n v1 * v0 * diff --git a/sys/libkern/qdivrem.c b/sys/libkern/qdivrem.c index caf4d7c..a2a64c4 100644 --- a/sys/libkern/qdivrem.c +++ b/sys/libkern/qdivrem.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: qdivrem.c,v 1.2 1994/08/02 07:44:19 davidg Exp $ */ /* @@ -196,7 +196,7 @@ __qdivrem(uq, vq, arq) v2 = v[2]; /* for D3 */ do { register digit uj0, uj1, uj2; - + /* * D3: Calculate qhat (\^q, in TeX notation). * Let qhat = min((u[j]*B + u[j+1])/v[1], B-1), and diff --git a/sys/miscfs/devfs/devfs_back.c b/sys/miscfs/devfs/devfs_back.c index a12990a..5e615cb 100644 --- a/sys/miscfs/devfs/devfs_back.c +++ b/sys/miscfs/devfs/devfs_back.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /sys/miscfs/devfs/RCS/devfs_back.c,v 1.3 1995/01/07 04:20:25 root Exp root $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_back.c,v 1.2 1995/04/20 07:34:51 julian Exp $ */ #include "param.h" @@ -25,7 +25,7 @@ int devfs_set_up = 0; /* note tha we HAVE set up the backing tree */ /* * Set up the root directory node in the backing plane - * This is happenning before the vfs system has been + * This is happenning before the vfs system has been * set up yet, so be careful about what we reference.. * Notice that the ops are by indirection.. as they haven't * been set up yet! @@ -35,7 +35,7 @@ void devfs_back_init() /*proto*/ devnm_p devbp; dn_p dnp; - /* + /* * This may be called several times.. only do it if it needs * to be done. */ @@ -61,7 +61,7 @@ void devfs_back_init() /*proto*/ } bzero(dnp,sizeof(devnode_t)); /* - * Link the two together + * Link the two together */ devbp->dnp = dnp; dnp->links = 1; @@ -81,7 +81,7 @@ void devfs_back_init() /*proto*/ dnp->by.Dir.dirlast = &dnp->by.Dir.dirlist; dnp->by.Dir.myname = devbp; - /* + /* * set up a pointer to directory type ops */ dnp->ops = &devfs_vnodeop_p; @@ -92,7 +92,7 @@ void devfs_back_init() /*proto*/ TIMEVAL_TO_TIMESPEC(&time,&(dnp->ctime)) dnp->mtime = dnp->ctime; dnp->atime = dnp->ctime; - + /* * and the list of layers */ @@ -132,8 +132,8 @@ int dev_finddir(char *orig_path, dn_p dirnode, int create, dn_p *dn_pp) /*proto* char *name; register char *cp; int retval; - - + + DBPRINT(("dev_finddir\n")); devfs_back_init(); /* in case we are the first */ if(!dirnode) dirnode = dev_root->dnp; @@ -242,7 +242,7 @@ int dev_add_node(char *name, dn_p dirnode, int entrytype, union typeinfo *by, de dnp->links = 1; /* implicit from our own name-node */ /* - * note the node type we are adding + * note the node type we are adding * and set the creation times to NOW * put in it's name * include the implicit link in the count of links to the devnode.. @@ -294,7 +294,7 @@ int dev_add_node(char *name, dn_p dirnode, int entrytype, union typeinfo *by, de * Make sure it has DEVICE type ops * and device specific fields are correct */ - dnp->ops = &dev_spec_vnodeop_p; + dnp->ops = &dev_spec_vnodeop_p; dnp->by.Bdev.bdevsw = by->Bdev.bdevsw; dnp->by.Bdev.dev = by->Bdev.dev; break; @@ -308,7 +308,7 @@ int dev_add_node(char *name, dn_p dirnode, int entrytype, union typeinfo *by, de dnp->by.Cdev.dev = by->Cdev.dev; break; case DEV_DDEV: - /* + /* * store the address of (the address of) the ops * and the magic cookie to use with them */ @@ -389,7 +389,7 @@ int dev_remove(devnm_p devbp) /*proto*/ */ devfs_dn_free(devbp->dnp); free (devbp, M_DEVFSBACK); - return 0; + return 0; } int dev_touch(devnm_p key) /* update the node for this dev */ /*proto*/ @@ -421,7 +421,7 @@ void devfs_dn_free(dn_p dnp) /*proto*/ int get_cdev_major_num(caddr_t addr) /*proto*/ { int index = 0; - + DBPRINT(("get_cdev_major_num\n")); while (index < nchrdev) { @@ -439,7 +439,7 @@ int get_cdev_major_num(caddr_t addr) /*proto*/ int get_bdev_major_num(caddr_t addr) /*proto*/ { int index = 0; - + DBPRINT(("get_bdev_major_num\n")); while (index < nblkdev) { diff --git a/sys/miscfs/devfs/devfs_front.c b/sys/miscfs/devfs/devfs_front.c index 14bf104..a3d0255 100644 --- a/sys/miscfs/devfs/devfs_front.c +++ b/sys/miscfs/devfs/devfs_front.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_front.c,v 1.2 1995/04/20 07:34:52 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_front.c,v 1.3 1995/04/20 07:42:41 julian Exp $ * */ @@ -52,7 +52,7 @@ int devfs_add_fronts(devnm_p parent,devnm_p child) /*proto*/ child->name); continue; } - + } return(0); /* for now always succeed */ } @@ -201,14 +201,14 @@ int dev_mk_front(dn_p parent,devnm_p back,devnm_p *devnm_pp , struct devfsmount /* * not accounted for in the link counts.. * only used to get from the front name entries - * to the total length of the names + * to the total length of the names * which is stored in the parent's devnode */ newfp->parent = parent; /* is NULL for root */ /*******************************************************\ * Put it in the appropriate back/front list too. * \*******************************************************/ - newfp->next_front = *back->prev_frontp; + newfp->next_front = *back->prev_frontp; newfp->prev_frontp = back->prev_frontp; *back->prev_frontp = newfp; back->prev_frontp = &(newfp->next_front); @@ -237,7 +237,7 @@ int dev_mk_front(dn_p parent,devnm_p back,devnm_p *devnm_pp , struct devfsmount /* * duplicate the backing tree into a tree of nodes hung off the - * mount point given as the argument. Do this by + * mount point given as the argument. Do this by * calling dev_mk_front() which recurses all the way * up the tree.. */ @@ -293,7 +293,7 @@ void dev_free_front(devnm_p devfp) /*proto*/ { dev_free_front(devfp->dnp->by.Dir.dirlist); } - /* + /* * drop the reference counts on our and our parent's * nodes for "." and ".." (root has ".." -> "." ) */ @@ -319,7 +319,7 @@ void dev_free_front(devnm_p devfp) /*proto*/ } /* * If the node has a backing pointer we need to free ourselves - * from that.. + * from that.. * Remember that we may not HAVE a backing node. */ if (back = devfp->as.front.realthing) /* yes an assign */ diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index 96c34f44..5781df7 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /sys/miscfs/devfs/RCS/devfs_vfsops.c,v 1.4 1995/01/07 04:20:25 root Exp root $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.2 1995/04/20 07:34:53 julian Exp $ * * */ @@ -26,7 +26,7 @@ int devfs_init(void) /*proto*/ devfs_back_init(); /* devfs_front_init();*/ /* nothing to do at the moment */ return 0; /*XXX*/ -} +} /* * mp - pointer to 'mount' structure diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index 079ebd5..5deda3e 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.3 1995/04/20 22:00:05 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.4 1995/05/03 23:04:26 julian Exp $ * * symlinks can wait 'til later. */ @@ -187,7 +187,7 @@ DBPRINT(("errr, maybe not cached ")); /* notfound: */ /*XXX*/ /* possibly release some resources here */ /* - * If creating, and at end of pathname + * If creating, and at end of pathname * then can consider * allowing file to be created. * XXX original code (ufs_lookup) checked for . being deleted @@ -222,7 +222,7 @@ DBPRINT(("MKACCESS ")); if (!lockparent) VOP_UNLOCK(dir_vnode); /* DON't make a cache entry... status changing */ - return (EJUSTRETURN); + return (EJUSTRETURN); } /* * Insert name into cache (as non-existent) if appropriate. @@ -345,7 +345,7 @@ found: /* * Insert name into cache if appropriate. */ - if (cnp->cn_flags & MAKEENTRY) + if (cnp->cn_flags & MAKEENTRY) cache_enter(dir_vnode, *result_vnode, cnp); DBPRINT(("GOT\n")); return (0); @@ -640,7 +640,7 @@ DBPRINT(("setattr\n")); file_node->mode |= vap->va_mode & 07777; } - if (vap->va_uid != (uid_t)VNOVAL) + if (vap->va_uid != (uid_t)VNOVAL) { file_node->uid = vap->va_uid; } @@ -1038,7 +1038,7 @@ DBPRINT(("islocked\n")); return 0; } -int devfs_bmap(ap) +int devfs_bmap(ap) struct vop_bmap_args /* { struct vnode *a_vp; daddr_t a_bn; @@ -1080,7 +1080,7 @@ DBPRINT(("advlock\n")); } int devfs_reclaim(ap) - struct vop_reclaim_args /* { + struct vop_reclaim_args /* { struct vnode *a_vp; } */ *ap; { @@ -1094,7 +1094,7 @@ DBPRINT(("reclaim\n")); return error; } - file_node->vn = 0; + file_node->vn = 0; file_node->vn_id = 0; return(0); } diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h index a2f6d40..c6216e2 100644 --- a/sys/miscfs/devfs/devfsdefs.h +++ b/sys/miscfs/devfs/devfsdefs.h @@ -7,7 +7,7 @@ /* * Written by Julian Elischer (julian@DIALIX.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfsdefs.h,v 1.2 1995/04/20 07:34:55 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfsdefs.h,v 1.3 1995/05/03 23:06:31 julian Exp $ */ /* first a couple of defines for compatibility with inodes */ @@ -107,7 +107,7 @@ struct devnode /* the equivalent of an INODE */ dn_p parent; devnm_p myname; int entrycount; - }Dir; + }Dir; struct { char *name; /* must be allocated separatly */ int namelen; diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 6c20b26..420320a 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.7 1994/10/06 21:06:42 davidg Exp $ + * $Id: fdesc_vnops.c,v 1.8 1995/03/28 07:56:44 bde Exp $ */ /* @@ -138,7 +138,7 @@ loop: /* * otherwise lock the array while we call getnewvnode * since that can block. - */ + */ if (fdcache_lock & FDL_LOCKED) { fdcache_lock |= FDL_WANT; (void) tsleep((caddr_t) &fdcache_lock, PINOD, "fdalvp", 0); @@ -195,7 +195,7 @@ fdesc_lookup(ap) pname = ap->a_cnp->cn_nameptr; if (ap->a_cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; - VREF(dvp); + VREF(dvp); VOP_LOCK(dvp); return (0); } @@ -325,7 +325,7 @@ fdesc_open(ap) case Fdesc: /* * XXX Kludge: set p->p_dupfd to contain the value of the - * the file descriptor being sought for duplication. The error + * the file descriptor being sought for duplication. The error * return ensures that the vnode for this device will be * released by vn_open. Open will detect this special error and * take the actions in dupfdopen. Other callers of vn_open or @@ -467,7 +467,7 @@ fdesc_getattr(ap) default: panic("fdesc_getattr"); - break; + break; } if (error == 0) @@ -586,7 +586,7 @@ fdesc_readdir(ap) break; } i++; - + switch (dt->d_fileno) { case FD_CTTY: if (cttyvp(uio->uio_procp) == NULL) @@ -690,7 +690,7 @@ fdesc_read(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -714,7 +714,7 @@ fdesc_write(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -741,7 +741,7 @@ fdesc_ioctl(ap) error = EOPNOTSUPP; break; } - + return (error); } @@ -766,7 +766,7 @@ fdesc_select(ap) error = EOPNOTSUPP; break; } - + return (error); } diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index bf1ec82..106ac89 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 - * $Id: fifo_vnops.c,v 1.7 1995/02/03 06:46:13 davidg Exp $ + * $Id: fifo_vnops.c,v 1.8 1995/03/16 18:13:13 bde Exp $ */ #include <sys/param.h> @@ -124,7 +124,7 @@ fifo_lookup(ap) struct componentname * a_cnp; } */ *ap; { - + *ap->a_vpp = NULL; return (ENOTDIR); } @@ -169,7 +169,7 @@ fifo_open(ap) return (error); } fip->fi_writesock = wso; - error = unp_connect2(wso, rso); + error = unp_connect2(wso, rso); if (error) { (void)soclose(wso); (void)soclose(rso); @@ -251,7 +251,7 @@ fifo_read(ap) rso->so_state |= SS_NBIO; startresid = uio->uio_resid; VOP_UNLOCK(ap->a_vp); - error = soreceive(rso, (struct mbuf **)0, uio, + error = soreceive(rso, (struct mbuf **)0, uio, (struct mbuf **)0, (struct mbuf **)0, (int*)0); VOP_LOCK(ap->a_vp); /* diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index 9b7e9da..eb1a192 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -36,7 +36,7 @@ * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94 * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vfsops.c,v 1.5 1995/03/16 18:13:31 bde Exp $ + * $Id: null_vfsops.c,v 1.6 1995/03/16 20:23:39 wollman Exp $ */ /* @@ -149,7 +149,7 @@ nullfs_mount(mp, path, data, ndp, p) (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); - (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); #ifdef NULLFS_DIAGNOSTIC @@ -204,7 +204,7 @@ nullfs_unmount(mp, mntflags, p) * moment, but who knows... */ #if 0 - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif @@ -216,7 +216,7 @@ nullfs_unmount(mp, mntflags, p) #ifdef NULLFS_DIAGNOSTIC vprint("alias root of lower", nullm_rootvp); -#endif +#endif /* * Release reference on underlying root vnode */ @@ -327,7 +327,7 @@ nullfs_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, vpp); } diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 9136baf..464d15a 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -35,7 +35,7 @@ * * @(#)null_vnops.c 8.1 (Berkeley) 6/10/93 * - * $Id: null_vnops.c,v 1.6 1994/10/10 07:55:29 phk Exp $ + * $Id: null_vnops.c,v 1.7 1995/03/19 14:28:54 davidg Exp $ */ /* @@ -88,7 +88,7 @@ * in the arguments and, if a vnode is return by the operation, * stacks a null-node on top of the returned vnode. * - * Although bypass handles most operations, + * Although bypass handles most operations, * vop_getattr, _inactive, _reclaim, and _print are not bypassed. * Vop_getattr must change the fsid being returned. * Vop_inactive and vop_reclaim are not bypassed so that @@ -109,7 +109,7 @@ * this or other null vnode stacks. * * New vnode stacks come into existance as a result of - * an operation which returns a vnode. + * an operation which returns a vnode. * The bypass routine stacks a null-node above the new * vnode before returning it to the caller. * @@ -119,7 +119,7 @@ * the root null-node (which was created when the null layer was mounted). * Now consider opening "sys". A vop_lookup would be * done on the root null-node. This operation would bypass through - * to the lower layer which would return a vnode representing + * to the lower layer which would return a vnode representing * the UFS "sys". Null_bypass then builds a null-node * aliasing the UFS "sys" and returns this to the caller. * Later operations on the null-node "sys" will repeat this @@ -133,13 +133,13 @@ * then begin modifing the copy. Sed can be used to easily rename * all variables. * - * The umap layer is an example of a layer descended from the + * The umap layer is an example of a layer descended from the * null layer. * * * INVOKING OPERATIONS ON LOWER LAYERS * - * There are two techniques to invoke operations on a lower layer + * There are two techniques to invoke operations on a lower layer * when the operation cannot be completely bypassed. Each method * is appropriate in different situations. In both cases, * it is the responsibility of the aliasing layer to make @@ -200,7 +200,7 @@ int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ * to determine what implementation of the op should be invoked * - all mapped vnodes are of our vnode-type (NEEDSWORK: * problems on rmdir'ing mount points and renaming?) - */ + */ int null_bypass(ap) struct vop_generic_args /* { @@ -237,7 +237,7 @@ null_bypass(ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - vps_p[i] = this_vp_p = + vps_p[i] = this_vp_p = VOPARG_OFFSETTO(struct vnode**,descp->vdesc_vp_offsets[i],ap); /* * We're not guaranteed that any but the first vnode @@ -257,7 +257,7 @@ null_bypass(ap) if (reles & 1) VREF(*this_vp_p); } - + } /* diff --git a/sys/miscfs/portal/portal_vfsops.c b/sys/miscfs/portal/portal_vfsops.c index 130f991..52c7bcf 100644 --- a/sys/miscfs/portal/portal_vfsops.c +++ b/sys/miscfs/portal/portal_vfsops.c @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.6 (Berkeley) 1/21/94 * - * $Id: portal_vfsops.c,v 1.6 1995/03/16 18:13:38 bde Exp $ + * $Id: portal_vfsops.c,v 1.7 1995/03/16 20:23:41 wollman Exp $ */ /* @@ -172,7 +172,7 @@ portal_unmount(mp, mntflags, p) * moment, but who knows... */ #ifdef notyet - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c index 56f52fb..41fd2de 100644 --- a/sys/miscfs/portal/portal_vnops.c +++ b/sys/miscfs/portal/portal_vnops.c @@ -35,7 +35,7 @@ * * @(#)portal_vnops.c 8.8 (Berkeley) 1/21/94 * - * $Id: portal_vnops.c,v 1.4 1994/09/21 03:47:05 wollman Exp $ + * $Id: portal_vnops.c,v 1.5 1995/03/28 07:57:02 bde Exp $ */ /* @@ -272,7 +272,7 @@ portal_open(ap) error = so->so_error; goto bad; } - + /* * Set miscellaneous flags */ @@ -377,7 +377,7 @@ portal_open(ap) } /* - * Check that the mode the file is being opened for is a subset + * Check that the mode the file is being opened for is a subset * of the mode of the existing descriptor. */ fp = p->p_fd->fd_ofiles[fd]; @@ -399,7 +399,7 @@ bad:; /* * And discard the control message. */ - if (cm) { + if (cm) { m_freem(cm); } diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index f55e5e3..0f1b3b0 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -37,7 +37,7 @@ * * @(#)procfs_mem.c 8.4 (Berkeley) 1/21/94 * - * $Id: procfs_mem.c,v 1.5 1994/10/18 04:40:41 davidg Exp $ + * $Id: procfs_mem.c,v 1.6 1995/01/05 03:59:38 davidg Exp $ */ /* @@ -108,7 +108,7 @@ procfs_rwmem(p, uio) * The map we want... */ map = &p->p_vmspace->vm_map; - + /* * Check the permissions for the area we're interested * in. @@ -148,7 +148,7 @@ procfs_rwmem(p, uio) */ if (!error) vm_map_lookup_done(tmap, out_entry); - + /* * Fault the page in... */ diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index c74cde9..f129022 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -36,7 +36,7 @@ * * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * - * $Id: procfs_status.c,v 1.2 1994/08/02 07:45:20 davidg Exp $ + * $Id: procfs_status.c,v 1.3 1994/10/10 07:55:38 phk Exp $ */ #include <sys/param.h> @@ -109,7 +109,7 @@ procfs_dostatus(curp, p, pfs, uio) p->p_stats->p_start.tv_usec); else ps += sprintf(ps, " -1,-1"); - + { struct timeval ut, st; diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index e1cfdf3..6c464c1 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -36,7 +36,7 @@ * * @(#)procfs_subr.c 8.4 (Berkeley) 1/27/94 * - * $Id: procfs_subr.c,v 1.3 1994/10/06 21:06:44 davidg Exp $ + * $Id: procfs_subr.c,v 1.4 1995/04/15 02:30:12 davidg Exp $ */ #include <sys/param.h> @@ -103,7 +103,7 @@ loop: /* * otherwise lock the vp list while we call getnewvnode * since that can block. - */ + */ if (pfsvplock & PROCFS_LOCKED) { pfsvplock |= PROCFS_WANT; (void) tsleep((caddr_t) &pfsvplock, PINOD, "pfsavp", 0); diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 8decad4..738df27 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.12 1995/05/11 19:26:33 rgrimes Exp $ + * $Id: procfs_vnops.c,v 1.13 1995/05/25 01:35:24 davidg Exp $ */ /* @@ -666,7 +666,7 @@ procfs_readdir(ap) break; dt = &procent[i]; - + dp->d_reclen = UIO_MX; dp->d_fileno = PROCFS_FILENO(pfs->pfs_pid, dt->d_pfstype); dp->d_type = DT_REG; diff --git a/sys/miscfs/umapfs/umap.h b/sys/miscfs/umapfs/umap.h index 5903d30..5be2e5e 100644 --- a/sys/miscfs/umapfs/umap.h +++ b/sys/miscfs/umapfs/umap.h @@ -35,7 +35,7 @@ * * @(#)umap.h 8.3 (Berkeley) 1/21/94 * - * $Id$ + * $Id: umap.h,v 1.2 1994/08/02 07:45:33 davidg Exp $ */ #define MAPFILEENTRIES 64 @@ -56,9 +56,9 @@ struct umap_mount { struct vnode *umapm_rootvp; /* Reference to root umap_node */ int info_nentries; /* number of uid mappings */ int info_gnentries; /* number of gid mappings */ - u_long info_mapdata[MAPFILEENTRIES][2]; /* mapping data for + u_long info_mapdata[MAPFILEENTRIES][2]; /* mapping data for user mapping in ficus */ - u_long info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for + u_long info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for group mapping in ficus */ }; diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c index 4b2aad4b..792f4a8 100644 --- a/sys/miscfs/umapfs/umap_subr.c +++ b/sys/miscfs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.6 (Berkeley) 1/26/94 * - * $Id: umap_subr.c,v 1.2 1994/05/25 09:09:07 rgrimes Exp $ + * $Id: umap_subr.c,v 1.3 1994/10/10 07:55:43 phk Exp $ */ #include <sys/param.h> @@ -387,7 +387,7 @@ umap_mapids(v_mount, credp) credp->cr_gid = NULLGROUP; #endif - /* Now we must map each of the set of groups in the cr_groups + /* Now we must map each of the set of groups in the cr_groups structure. */ i = 0; diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c index a98ae18..64f05bb 100644 --- a/sys/miscfs/umapfs/umap_vfsops.c +++ b/sys/miscfs/umapfs/umap_vfsops.c @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.3 (Berkeley) 1/21/94 * - * $Id: umap_vfsops.c,v 1.6 1995/03/16 18:13:55 bde Exp $ + * $Id: umap_vfsops.c,v 1.7 1995/03/16 20:23:43 wollman Exp $ */ /* @@ -127,12 +127,12 @@ umapfs_mount(mp, path, data, ndp, p) */ amp->umapm_vfs = lowerrootvp->v_mount; - /* + /* * Now copy in the number of entries and maps for umap mapping. */ amp->info_nentries = args.nentries; amp->info_gnentries = args.gnentries; - error = copyin(args.mapdata, (caddr_t)amp->info_mapdata, + error = copyin(args.mapdata, (caddr_t)amp->info_mapdata, 2*sizeof(u_long)*args.nentries); if (error) return (error); @@ -144,7 +144,7 @@ umapfs_mount(mp, path, data, ndp, p) amp->info_mapdata[i][1]); #endif - error = copyin(args.gmapdata, (caddr_t)amp->info_gmapdata, + error = copyin(args.gmapdata, (caddr_t)amp->info_gmapdata, 2*sizeof(u_long)*args.nentries); if (error) return (error); @@ -152,7 +152,7 @@ umapfs_mount(mp, path, data, ndp, p) #ifdef UMAP_DIAGNOSTIC printf("umap_mount:gnentries %d\n",args.gnentries); for (i = 0; i < args.gnentries; i++) - printf(" group %d maps to %d\n", + printf(" group %d maps to %d\n", amp->info_gmapdata[i][0], amp->info_gmapdata[i][1]); #endif @@ -190,7 +190,7 @@ umapfs_mount(mp, path, data, ndp, p) (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); - (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void) copyinstr(args.target, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); #ifdef UMAPFS_DIAGNOSTIC @@ -245,7 +245,7 @@ umapfs_unmount(mp, mntflags, p) * moment, but who knows... */ #ifdef notyet - mntflushbuf(mp, 0); + mntflushbuf(mp, 0); if (mntinvalbuf(mp, 1)) return (EBUSY); #endif @@ -257,7 +257,7 @@ umapfs_unmount(mp, mntflags, p) #ifdef UMAPFS_DIAGNOSTIC vprint("alias root of lower", umapm_rootvp); -#endif +#endif /* * Release reference on underlying root vnode */ @@ -368,7 +368,7 @@ umapfs_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp)); } diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c index 14d3fcc..a82d1c6 100644 --- a/sys/miscfs/umapfs/umap_vnops.c +++ b/sys/miscfs/umapfs/umap_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)umap_vnops.c 8.3 (Berkeley) 1/5/94 - * $Id: umap_vnops.c,v 1.7 1994/10/10 07:55:44 phk Exp $ + * $Id: umap_vnops.c,v 1.8 1995/03/19 14:28:55 davidg Exp $ */ /* @@ -59,7 +59,7 @@ int umap_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ /* * This is the 10-Apr-92 bypass routine. * See null_vnops.c:null_bypass for more details. - */ + */ int umap_bypass(ap) struct vop_generic_args /* { @@ -101,7 +101,7 @@ umap_bypass(ap) for (i = 0; i < VDESC_MAX_VPS; reles >>= 1, i++) { if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ - vps_p[i] = this_vp_p = + vps_p[i] = this_vp_p = VOPARG_OFFSETTO(struct vnode**, descp->vdesc_vp_offsets[i], ap); if (i == 0) { @@ -122,7 +122,7 @@ umap_bypass(ap) if (reles & 1) VREF(*this_vp_p); } - + } /* @@ -131,7 +131,7 @@ umap_bypass(ap) if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) { - credpp = VOPARG_OFFSETTO(struct ucred**, + credpp = VOPARG_OFFSETTO(struct ucred**, descp->vdesc_cred_offset, ap); /* Save old values */ @@ -141,7 +141,7 @@ umap_bypass(ap) credp = *credpp; if (umap_bug_bypass && credp->cr_uid != 0) - printf("umap_bypass: user was %ld, group %ld\n", + printf("umap_bypass: user was %ld, group %ld\n", credp->cr_uid, credp->cr_gid); /* Map all ids in the credential structure. */ @@ -149,17 +149,17 @@ umap_bypass(ap) umap_mapids(vp1->v_mount, credp); if (umap_bug_bypass && credp->cr_uid != 0) - printf("umap_bypass: user now %ld, group %ld\n", + printf("umap_bypass: user now %ld, group %ld\n", credp->cr_uid, credp->cr_gid); } /* BSD often keeps a credential in the componentname structure - * for speed. If there is one, it better get mapped, too. + * for speed. If there is one, it better get mapped, too. */ if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) { - compnamepp = VOPARG_OFFSETTO(struct componentname**, + compnamepp = VOPARG_OFFSETTO(struct componentname**, descp->vdesc_componentname_offset, ap); compcredp = (*compnamepp)->cn_cred; @@ -167,7 +167,7 @@ umap_bypass(ap) compcredp = (*compnamepp)->cn_cred = crdup(savecompcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_bypass: component credit user was %ld, group %ld\n", + printf("umap_bypass: component credit user was %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); /* Map all ids in the credential structure. */ @@ -175,7 +175,7 @@ umap_bypass(ap) umap_mapids(vp1->v_mount, compcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_bypass: component credit user now %ld, group %ld\n", + printf("umap_bypass: component credit user now %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); } @@ -217,7 +217,7 @@ umap_bypass(ap) }; out: - /* + /* * Free duplicate cred structure and restore old one. */ if (descp->vdesc_cred_offset != VDESC_NO_OFFSET) { @@ -228,19 +228,19 @@ umap_bypass(ap) crfree(credp); (*credpp) = savecredp; if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0) - printf("umap_bypass: returning-user now %ld\n\n", + printf("umap_bypass: returning-user now %ld\n\n", (*credpp)->cr_uid); } if (descp->vdesc_componentname_offset != VDESC_NO_OFFSET) { if (umap_bug_bypass && compcredp && compcredp->cr_uid != 0) - printf("umap_bypass: returning-component-user was %ld\n", + printf("umap_bypass: returning-component-user was %ld\n", compcredp->cr_uid); crfree(compcredp); (*compnamepp)->cn_cred = savecompcredp; if (umap_bug_bypass && credpp && (*credpp)->cr_uid != 0) - printf("umap_bypass: returning-component-user now %ld\n", + printf("umap_bypass: returning-component-user now %ld\n", compcredp->cr_uid); } @@ -288,7 +288,7 @@ umap_getattr(ap) uid = ap->a_vap->va_uid; gid = ap->a_vap->va_gid; if (umap_bug_bypass) - printf("umap_getattr: mapped uid = %d, mapped gid = %d\n", uid, + printf("umap_getattr: mapped uid = %d, mapped gid = %d\n", uid, gid); vp1p = VOPARG_OFFSETTO(struct vnode**, descp->vdesc_vp_offsets[0], ap); @@ -307,7 +307,7 @@ umap_getattr(ap) ap->a_vap->va_uid = (uid_t) tmpid; if (umap_bug_bypass) printf("umap_getattr: original uid = %d\n", uid); - } else + } else ap->a_vap->va_uid = (uid_t) NOBODY; /* Reverse map the gid for the vnode. */ @@ -321,7 +321,7 @@ umap_getattr(ap) printf("umap_getattr: original gid = %d\n", gid); } else ap->a_vap->va_gid = (gid_t) NULLGROUP; - + return (0); } @@ -350,7 +350,7 @@ umap_reclaim(ap) struct vnode *vp = ap->a_vp; struct umap_node *xp = VTOUMAP(vp); struct vnode *lowervp = xp->umap_lowervp; - + /* After this assignment, this node will not be re-used. */ xp->umap_lowervp = NULL; remque(xp); @@ -442,7 +442,7 @@ umap_rename(ap) compcredp = compnamep->cn_cred = crdup(savecompcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_rename: rename component credit user was %ld, group %ld\n", + printf("umap_rename: rename component credit user was %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); /* Map all ids in the credential structure. */ @@ -450,11 +450,11 @@ umap_rename(ap) umap_mapids(vp->v_mount, compcredp); if (umap_bug_bypass && compcredp->cr_uid != 0) - printf("umap_rename: rename component credit user now %ld, group %ld\n", + printf("umap_rename: rename component credit user now %ld, group %ld\n", compcredp->cr_uid, compcredp->cr_gid); error = umap_bypass(ap); - + /* Restore the additional mapped componentname cred structure. */ crfree(compcredp); diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index 02f7a10..cbbd171 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.4 (Berkeley) 2/17/94 - * $Id: union_subr.c,v 1.4 1994/10/06 21:06:48 davidg Exp $ + * $Id: union_subr.c,v 1.5 1994/10/10 07:55:46 phk Exp $ */ #include <sys/param.h> @@ -130,7 +130,7 @@ union_updatevp(un, uppervp, lowervp) LIST_REMOVE(un, un_cache); union_list_unlock(ohash); - } else { + } else { while (union_list_lock(nhash)) continue; } @@ -372,7 +372,7 @@ loop: /* * otherwise lock the vp list while we call getnewvnode * since that can block. - */ + */ hash = UNION_HASH(uppervp, lowervp); if (union_list_lock(hash)) diff --git a/sys/miscfs/union/union_vfsops.c b/sys/miscfs/union/union_vfsops.c index c9e2c60..670c7ce 100644 --- a/sys/miscfs/union/union_vfsops.c +++ b/sys/miscfs/union/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94 - * $Id: union_vfsops.c,v 1.8 1995/03/16 18:14:02 bde Exp $ + * $Id: union_vfsops.c,v 1.9 1995/03/16 20:23:44 wollman Exp $ */ /* @@ -118,7 +118,7 @@ union_mount(mp, path, data, ndp, p) error = VOP_GETATTR(mp->mnt_vnodecovered, &va, cred, p); if (error) goto bad; - if ((va.va_uid != cred->cr_uid) && + if ((va.va_uid != cred->cr_uid) && (cred->cr_uid != 0)) { error = EACCES; goto bad; @@ -163,7 +163,7 @@ union_mount(mp, path, data, ndp, p) error = EINVAL; goto bad; } - + um = (struct union_mount *) malloc(sizeof(struct union_mount), M_UFSMNT, M_WAITOK); /* XXX */ @@ -338,7 +338,7 @@ union_unmount(mp, mntflags, p) #ifdef UNION_DIAGNOSTIC vprint("alias root of lower", um_rootvp); -#endif +#endif /* * Discard references to upper and lower target vnodes. */ @@ -517,7 +517,7 @@ union_vget(mp, ino, vpp) ino_t ino; struct vnode **vpp; { - + return (EOPNOTSUPP); } diff --git a/sys/msdosfs/bootsect.h b/sys/msdosfs/bootsect.h index 099b15f..f83b9ec 100644 --- a/sys/msdosfs/bootsect.h +++ b/sys/msdosfs/bootsect.h @@ -1,19 +1,19 @@ -/* $Id$ */ +/* $Id: bootsect.h,v 1.1 1994/09/19 15:41:36 dfr Exp $ */ /* $NetBSD: bootsect.h,v 1.4 1994/06/29 06:35:28 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/bpb.h b/sys/msdosfs/bpb.h index 70e4de2..7618126 100644 --- a/sys/msdosfs/bpb.h +++ b/sys/msdosfs/bpb.h @@ -1,19 +1,19 @@ -/* $Id$ */ +/* $Id: bpb.h,v 1.1 1994/09/19 15:41:37 dfr Exp $ */ /* $NetBSD: bpb.h,v 1.3 1994/06/29 06:35:29 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h index b47196a..a7f2928 100644 --- a/sys/msdosfs/denode.h +++ b/sys/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $Id: denode.h,v 1.3 1994/12/27 12:37:33 bde Exp $ */ +/* $Id: denode.h,v 1.4 1995/03/16 18:14:17 bde Exp $ */ /* $NetBSD: denode.h,v 1.8 1994/08/21 18:43:49 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/direntry.h b/sys/msdosfs/direntry.h index d2ec019..f4eecac 100644 --- a/sys/msdosfs/direntry.h +++ b/sys/msdosfs/direntry.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: direntry.h,v 1.1 1994/09/19 15:41:39 dfr Exp $ */ /* $NetBSD: direntry.h,v 1.7 1994/08/21 18:43:54 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/fat.h b/sys/msdosfs/fat.h index b5f223f..3b043c1 100644 --- a/sys/msdosfs/fat.h +++ b/sys/msdosfs/fat.h @@ -1,4 +1,4 @@ -/* $Id: fat.h,v 1.1 1994/09/19 15:41:40 dfr Exp $ */ +/* $Id: fat.h,v 1.2 1994/09/27 20:42:41 phk Exp $ */ /* $NetBSD: fat.h,v 1.4 1994/08/21 18:43:57 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c index d351a48..8899982 100644 --- a/sys/msdosfs/msdosfs_conv.c +++ b/sys/msdosfs/msdosfs_conv.c @@ -1,19 +1,19 @@ -/* $Id: msdosfs_conv.c,v 1.3 1994/12/12 12:35:42 bde Exp $ */ +/* $Id: msdosfs_conv.c,v 1.4 1995/03/29 18:48:06 ache Exp $ */ /* $NetBSD: msdosfs_conv.c,v 1.6.2.1 1994/08/30 02:27:57 cgd Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index c0e8823..60a6811 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_denode.c,v 1.10 1995/03/19 12:11:13 davidg Exp $ */ +/* $Id: msdosfs_denode.c,v 1.11 1995/04/11 17:13:17 bde Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -83,7 +83,7 @@ msdosfs_hashget(dev, dirclust, diroff) u_long diroff; { struct denode *dep; - + for (;;) for (dep = dehashtbl[DEHASH(dev, dirclust + diroff)];; dep = dep->de_next) { @@ -111,7 +111,7 @@ msdosfs_hashins(dep) struct denode *dep; { struct denode **depp, *deq; - + depp = &dehashtbl[DEHASH(dep->de_dev, dep->de_dirclust + dep->de_diroffset)]; deq = *depp; if (deq) @@ -137,17 +137,17 @@ msdosfs_hashrem(dep) } /* - * If deget() succeeds it returns with the gotten denode locked(). + * If deget() succeeds it returns with the gotten denode locked(). * * pmp - address of msdosfsmount structure of the filesystem containing * the denode of interest. The pm_dev field and the address of - * the msdosfsmount structure are used. + * the msdosfsmount structure are used. * dirclust - which cluster bp contains, if dirclust is 0 (root directory) * diroffset is relative to the beginning of the root directory, - * otherwise it is cluster relative. - * diroffset - offset past begin of cluster of denode we want + * otherwise it is cluster relative. + * diroffset - offset past begin of cluster of denode we want * direntptr - address of the direntry structure of interest. If direntptr is - * NULL, the block is read if necessary. + * NULL, the block is read if necessary. * depp - returns the address of the gotten denode. */ int @@ -187,7 +187,7 @@ deget(pmp, dirclust, diroffset, direntptr, depp) * the directory entry to compute the hash value. For subdir use * address of "." entry. for root dir use cluster MSDOSFSROOT, * offset MSDOSFSROOT_OFS - * + * * NOTE: The check for de_refcnt > 0 below insures the denode being * examined does not represent an unlinked but still open file. * These files are not to be accessible even when the directory @@ -337,7 +337,7 @@ deupdat(dep, tp, waitfor) * update. */ error = readde(dep, &bp, &dirp); - if (error) + if (error) return error; /* @@ -535,7 +535,7 @@ deextend(dep, length, cred) u_long count; int error; struct timespec ts; - + /* * The root of a DOS filesystem cannot be extended. */ @@ -554,7 +554,7 @@ deextend(dep, length, cred) if (length <= dep->de_FileSize) panic("deextend: file too large"); - + /* * Compute the number of clusters to allocate. */ @@ -569,7 +569,7 @@ deextend(dep, length, cred) return error; } } - + dep->de_flag |= DE_UPDATE; dep->de_FileSize = length; TIMEVAL_TO_TIMESPEC(&time, &ts); @@ -606,7 +606,7 @@ msdosfs_reclaim(ap) { struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); - + #ifdef MSDOSFS_DEBUG printf("msdosfs_reclaim(): dep %p, file %s, refcnt %ld\n", dep, dep->de_Name, dep->de_refcnt); @@ -630,10 +630,10 @@ msdosfs_reclaim(ap) } dep->de_flag = 0; - + FREE(dep, M_MSDOSFSNODE); vp->v_data = NULL; - + return 0; } @@ -647,7 +647,7 @@ msdosfs_inactive(ap) struct denode *dep = VTODE(vp); int error = 0; struct timespec ts; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]); #endif diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index 06b30e4..b43f959 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_fat.c,v 1.5 1995/02/10 18:39:45 bde Exp $ */ +/* $Id: msdosfs_fat.c,v 1.6 1995/04/11 16:43:20 bde Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.12 1994/08/21 18:44:04 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -251,7 +251,7 @@ hiteof:; * Find the closest entry in the fat cache to the cluster we are looking * for. */ -void +void fc_lookup(dep, findcn, frcnp, fsrcnp) struct denode *dep; u_long findcn; @@ -344,22 +344,22 @@ updatefats(pmp, bp, fatbn) /* * Updating entries in 12 bit fats is a pain in the butt. - * + * * The following picture shows where nibbles go when moving from a 12 bit * cluster number into the appropriate bytes in the FAT. - * + * * byte m byte m+1 byte m+2 * +----+----+ +----+----+ +----+----+ * | 0 1 | | 2 3 | | 4 5 | FAT bytes * +----+----+ +----+----+ +----+----+ - * + * * +----+----+----+ +----+----+----+ * | 3 0 1 | | 4 5 2 | * +----+----+----+ +----+----+----+ * cluster n cluster n+1 - * + * * Where n is even. m = n + (n >> 2) - * + * */ static inline void usemap_alloc(pmp, cn) @@ -414,10 +414,10 @@ clusterfree(pmp, cluster, oldcnp) * cluster'th entry if this is a get function * newcontents - the new value to be written into the cluster'th element of * the fat if this is a set function. - * + * * This function can also be used to free a cluster by setting the fat entry * for a cluster to 0. - * + * * All copies of the fat are updated if this is a set function. NOTE: If * fatentry() marks a cluster as free it does not update the inusemap in * the msdosfsmount structure. This is left to the caller. @@ -470,7 +470,7 @@ fatentry(function, pmp, cn, oldcontents, newcontents) error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); if (error) return error; - + if (function & FAT_GET) { readcn = getushort(&bp->b_data[bo]); if (FAT12(pmp)) { @@ -523,7 +523,7 @@ fatchain(pmp, start, count, fillwith) int error; u_long bn, bo, bsize, byteoffset, readcn, newc; struct buf *bp; - + #ifdef MSDOSFS_DEBUG printf("fatchain(pmp %p, start %ld, count %ld, fillwith %ld)\n", pmp, start, count, fillwith); @@ -533,7 +533,7 @@ fatchain(pmp, start, count, fillwith) */ if (start < CLUST_FIRST || start + count - 1 > pmp->pm_maxcluster) return EINVAL; - + while (count > 0) { byteoffset = FATOFS(pmp, start); fatblock(pmp, byteoffset, &bn, &bsize, &bo); @@ -585,7 +585,7 @@ chainlength(pmp, start, count) u_long idx, max_idx; u_int map; u_long len; - + max_idx = pmp->pm_maxcluster / N_INUSEBITS; idx = start / N_INUSEBITS; start %= N_INUSEBITS; @@ -632,7 +632,7 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) u_long *got; { int error; - + error = fatchain(pmp, start, count, fillwith); if (error == 0) { #ifdef MSDOSFS_DEBUG @@ -672,7 +672,7 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) u_long idx; u_long len, newst, foundcn, foundl, cn, l; u_int map; - + #ifdef MSDOSFS_DEBUG printf("clusteralloc(): find %d clusters\n",count); #endif @@ -684,19 +684,19 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) * This is a new file, initialize start */ struct timeval tv; - + microtime(&tv); start = (tv.tv_usec >> 10)|tv.tv_usec; len = 0; } - + /* * Start at a (pseudo) random place to maximize cluster runs * under multiple writers. */ foundcn = newst = (start * 1103515245 + 12345) % (pmp->pm_maxcluster + 1); foundl = 0; - + for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; @@ -759,7 +759,7 @@ freeclusterchain(pmp, cluster) struct buf *bp = NULL; u_long bn, bo, bsize, byteoffset; u_long readcn, lbn = -1; - + while (cluster >= CLUST_FIRST && cluster <= pmp->pm_maxcluster) { byteoffset = FATOFS(pmp, cluster); fatblock(pmp, byteoffset, &bn, &bsize, &bo); @@ -878,7 +878,7 @@ extendfile(dep, count, bpp, ncp, flags) u_long cn, got; struct msdosfsmount *pmp = dep->de_pmp; struct buf *bp; - + /* * Don't try to extend the root directory */ @@ -901,7 +901,7 @@ extendfile(dep, count, bpp, ncp, flags) return error; error = 0; } - + while (count > 0) { /* * Allocate a new cluster chain and cat onto the end of the file. @@ -918,9 +918,9 @@ extendfile(dep, count, bpp, ncp, flags) error = clusteralloc(pmp, cn, count, CLUST_EOFE, &cn, &got); if (error) return error; - + count -= got; - + /* * Give them the filesystem relative cluster number if they want * it. @@ -929,7 +929,7 @@ extendfile(dep, count, bpp, ncp, flags) *ncp = cn; ncp = NULL; } - + if (dep->de_StartCluster == 0) { dep->de_StartCluster = cn; frcn = 0; @@ -940,16 +940,16 @@ extendfile(dep, count, bpp, ncp, flags) clusterfree(pmp, cn, NULL); return error; } - + frcn = dep->de_fc[FC_LASTFC].fc_frcn + 1; } - + /* * Update the "last cluster of the file" entry in the denode's fat * cache. */ fc_setcache(dep, FC_LASTFC, frcn + got - 1, cn + got - 1); - + if (flags & DE_CLEAR) { while (got-- > 0) { /* @@ -979,6 +979,6 @@ extendfile(dep, count, bpp, ncp, flags) } } } - + return 0; } diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c index 5e9cbca..a80e5ae 100644 --- a/sys/msdosfs/msdosfs_lookup.c +++ b/sys/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_lookup.c,v 1.2 1994/09/27 20:42:51 phk Exp $ */ +/* $Id: msdosfs_lookup.c,v 1.3 1995/05/09 16:30:44 bde Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.14 1994/08/21 18:44:07 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 4a765b9..bbb4fc6 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.5 1994/10/02 17:48:21 phk Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.6 1994/12/12 12:35:47 bde Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -70,9 +70,9 @@ int msdosfsdoforce = 1; /* 1 = force unmount */ /* - * mp - path - addr in user space of mount point (ie /usr or whatever) + * mp - path - addr in user space of mount point (ie /usr or whatever) * data - addr in user space of mount params including the name of the block - * special file to treat as a filesystem. + * special file to treat as a filesystem. */ int msdosfs_mount(mp, path, data, ndp, p) @@ -169,7 +169,7 @@ msdosfs_mount(mp, path, data, ndp, p) crfree(cred); /* XXX */ if (error != 0) return error; - + /* * Be sure they've given us a block device to treat as a * filesystem. And, that its major number is within the bdevsw diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 0993c9d..047eea0 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.14 1995/04/11 18:32:17 ache Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.15 1995/05/09 16:30:45 bde Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -73,7 +73,7 @@ #include <msdosfs/fat.h> /* * Some general notes: - * + * * In the ufs filesystem the inodes, superblocks, and indirect blocks are * read/written using the vnode for the filesystem. Blocks that represent * the contents of a file are read/written using the vnode for the file @@ -156,7 +156,7 @@ msdosfs_mknod(ap) } */ *ap; { int error; - + switch (ap->a_vap->va_type) { case VDIR: error = msdosfs_mkdir((struct vop_mkdir_args *)ap); @@ -222,13 +222,13 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mode_t mask; int i; register gid_t *gp; - + /* User id 0 always gets access. */ if (cred->cr_uid == 0) return 0; - + mask = 0; - + /* Otherwise, check the owner. */ if (cred->cr_uid == uid) { if (acc_mode & VEXEC) @@ -239,7 +239,7 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mask |= S_IWUSR; return (file_mode & mask) == mask ? 0 : EACCES; } - + /* Otherwise, check the groups. */ for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++) if (gid == *gp) { @@ -251,7 +251,7 @@ vaccess(file_mode, uid, gid, acc_mode, cred) mask |= S_IWGRP; return (file_mode & mask) == mask ? 0 : EACCES; } - + /* Otherwise, check everyone else. */ if (acc_mode & VEXEC) mask |= S_IXOTH; @@ -274,11 +274,11 @@ msdosfs_access(ap) mode_t dosmode; struct denode *dep = VTODE(ap->a_vp); struct msdosfsmount *pmp = dep->de_pmp; - + dosmode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) | ((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH)); dosmode &= pmp->pm_mask; - + return vaccess(dosmode, pmp->pm_uid, pmp->pm_gid, ap->a_mode, ap->a_cred); } @@ -352,7 +352,7 @@ msdosfs_setattr(ap) struct denode *dep = VTODE(ap->a_vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_setattr(): vp %08x, vap %08x, cred %08x, p %08x\n", ap->a_vp, vap, cred, ap->a_p); @@ -396,7 +396,7 @@ msdosfs_setattr(ap) if (vap->va_mtime.ts_sec != VNOVAL) { if (cred->cr_uid != dep->de_pmp->pm_uid && (error = suser(cred, &ap->a_p->p_acflag)) && - ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || + ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, &ap->a_p)))) return error; dep->de_flag |= DE_UPDATE; @@ -574,7 +574,7 @@ msdosfs_write(ap) struct msdosfsmount *pmp = dep->de_pmp; struct ucred *cred = ap->a_cred; struct timespec ts; - + #ifdef MSDOSFS_DEBUG printf("msdosfs_write(vp %08x, uio %08x, ioflag %08x, cred %08x\n", vp, uio, ioflag, cred); @@ -658,7 +658,7 @@ msdosfs_write(ap) lastcn = dep->de_fc[FC_LASTFC].fc_frcn; } else lastcn = de_clcount(pmp, osize) - 1; - + do { bn = de_blk(pmp, uio->uio_offset); if (isadir) { @@ -669,7 +669,7 @@ msdosfs_write(ap) error = ENOSPC; break; } - + if ((uio->uio_offset & pmp->pm_crbomask) == 0 && (de_blk(pmp, uio->uio_offset + uio->uio_resid) > de_blk(pmp, uio->uio_offset) || uio->uio_offset + uio->uio_resid >= dep->de_FileSize)) { @@ -687,7 +687,7 @@ msdosfs_write(ap) if (!isadir) { if (bp->b_blkno == bp->b_lblkno) { error = pcbmap(dep, bp->b_lblkno, - &bp->b_blkno, 0); + &bp->b_blkno, 0); if (error) bp->b_blkno = -1; } @@ -802,7 +802,7 @@ msdosfs_mmap(ap) /* * Flush the blocks of a file to disk. - * + * * This function is worthless for vnodes that represent directories. Maybe we * could just do a sync if they try an fsync on a directory file. */ @@ -917,9 +917,9 @@ msdosfs_link(ap) * Renames on files require moving the denode to a new hash queue since the * denode's location is used to compute which hash queue to put the file * in. Unless it is a rename in place. For example "mv a b". - * + * * What follows is the basic algorithm: - * + * * if (file move) { * if (dest file exists) { * remove dest file @@ -951,13 +951,13 @@ msdosfs_link(ap) * clear old directory entry for moved directory * } * } - * + * * On entry: * source's parent directory is unlocked * source file or directory is unlocked * destination's parent directory is locked * destination file or directory is locked if it exists - * + * * On exit: * all denodes should be released * @@ -1646,7 +1646,7 @@ msdosfs_readdir(ap) ncookies++; } dentp++; - + crnt = (struct dirent *) ((char *) crnt + sizeof(struct direntry)); pushout = 1; @@ -1722,7 +1722,7 @@ out: ; *ap->a_eofflag = 1; else *ap->a_eofflag = 0; - + return error; } diff --git a/sys/msdosfs/msdosfsmount.h b/sys/msdosfs/msdosfsmount.h index 270b5b4..5309acb 100644 --- a/sys/msdosfs/msdosfsmount.h +++ b/sys/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $Id: msdosfsmount.h,v 1.1 1994/09/19 15:41:48 dfr Exp $ */ +/* $Id: msdosfsmount.h,v 1.2 1994/09/27 20:42:59 phk Exp $ */ /* $NetBSD: msdosfsmount.h,v 1.7 1994/08/21 18:44:17 ws Exp $ */ /*- @@ -34,17 +34,17 @@ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) - * + * * You can do anything you want with this software, just don't say you wrote * it, and don't remove this notice. - * + * * This software is provided "as is". - * + * * The author supplies this software to be publicly redistributed on the * understanding that the author is not responsible for the correct * functioning of this software in any circumstances and is not liable for * any damages caused by this software. - * + * * October 1992 */ @@ -88,19 +88,19 @@ struct msdosfsmount { /* * How to compute pm_cnshift and pm_crbomask. - * - * pm_crbomask = (pm_SectPerClust * pm_BytesPerSect) - 1 - * if (bytesperclust == * 0) - * return EBADBLKSZ; - * bit = 1; - * for (i = 0; i < 32; i++) { - * if (bit & bytesperclust) { - * if (bit ^ bytesperclust) - * return EBADBLKSZ; - * pm_cnshift = * i; - * break; - * } - * bit <<= 1; + * + * pm_crbomask = (pm_SectPerClust * pm_BytesPerSect) - 1 + * if (bytesperclust == * 0) + * return EBADBLKSZ; + * bit = 1; + * for (i = 0; i < 32; i++) { + * if (bit & bytesperclust) { + * if (bit ^ bytesperclust) + * return EBADBLKSZ; + * pm_cnshift = * i; + * break; + * } + * bit <<= 1; * } */ diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 4eb4412..c11a4cf 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -4,7 +4,7 @@ * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed - * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence * Berkeley Laboratory. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * * @(#)bpf.c 8.2 (Berkeley) 3/28/94 * - * $Id: bpf.c,v 1.5 1995/03/14 09:14:10 davidg Exp $ + * $Id: bpf.c,v 1.6 1995/05/09 13:35:38 davidg Exp $ */ #include "bpfilter.h" diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 4714ffb..2da90b0 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -37,15 +37,15 @@ * * @(#)bpf.h 8.1 (Berkeley) 6/10/93 * - * $Id: bpf.h,v 1.2 1994/08/02 07:45:54 davidg Exp $ + * $Id: bpf.h,v 1.3 1994/08/21 05:11:38 paul Exp $ */ #ifndef _NET_BPF_H_ #define _NET_BPF_H_ /* - * Alignment macros. BPF_WORDALIGN rounds up to the next - * even multiple of BPF_ALIGNMENT. + * Alignment macros. BPF_WORDALIGN rounds up to the next + * even multiple of BPF_ALIGNMENT. */ #define BPF_ALIGNMENT sizeof(long) #define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) @@ -61,7 +61,7 @@ struct bpf_program { u_int bf_len; struct bpf_insn *bf_insns; }; - + /* * Struct returned by BIOCGSTATS. */ @@ -71,7 +71,7 @@ struct bpf_stat { }; /* - * Struct return by BIOCVERSION. This represents the version number of + * Struct return by BIOCVERSION. This represents the version number of * the filter language described by the instruction encodings below. * bpf understands a program iff kernel_major == filter_major && * kernel_minor >= filter_minor, that is, if the value returned by the diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index b655dda2..076f255 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -37,7 +37,7 @@ * * @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 * - * $Id: bpf_filter.c,v 1.3 1994/08/02 07:45:58 davidg Exp $ + * $Id: bpf_filter.c,v 1.4 1995/04/01 01:46:27 davidg Exp $ */ #include <sys/param.h> @@ -115,7 +115,7 @@ m_xword(m, k, err) return (cp[0] << 24) | (np[0] << 16) | (np[1] << 8) | np[2]; case 2: - return (cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) | + return (cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) | np[1]; default: @@ -193,7 +193,7 @@ bpf_filter(pc, p, wirelen, buflen) return 0; #else abort(); -#endif +#endif case BPF_RET|BPF_K: return (u_int)pc->k; @@ -360,7 +360,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_MEM: A = mem[pc->k]; continue; - + case BPF_LDX|BPF_MEM: X = mem[pc->k]; continue; @@ -412,25 +412,25 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_ALU|BPF_ADD|BPF_X: A += X; continue; - + case BPF_ALU|BPF_SUB|BPF_X: A -= X; continue; - + case BPF_ALU|BPF_MUL|BPF_X: A *= X; continue; - + case BPF_ALU|BPF_DIV|BPF_X: if (X == 0) return 0; A /= X; continue; - + case BPF_ALU|BPF_AND|BPF_X: A &= X; continue; - + case BPF_ALU|BPF_OR|BPF_X: A |= X; continue; @@ -446,23 +446,23 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_ALU|BPF_ADD|BPF_K: A += pc->k; continue; - + case BPF_ALU|BPF_SUB|BPF_K: A -= pc->k; continue; - + case BPF_ALU|BPF_MUL|BPF_K: A *= pc->k; continue; - + case BPF_ALU|BPF_DIV|BPF_K: A /= pc->k; continue; - + case BPF_ALU|BPF_AND|BPF_K: A &= pc->k; continue; - + case BPF_ALU|BPF_OR|BPF_K: A |= pc->k; continue; @@ -494,9 +494,9 @@ bpf_filter(pc, p, wirelen, buflen) /* * Return true if the 'fcode' is a valid filter program. * The constraints are that each jump be forward and to a valid - * code. The code must terminate with either an accept or reject. + * code. The code must terminate with either an accept or reject. * 'valid' is an array for use by the routine (it must be at least - * 'len' bytes long). + * 'len' bytes long). * * The kernel needs to be able to verify an application's filter code. * Otherwise, a bogus program could easily crash the system. @@ -511,7 +511,7 @@ bpf_validate(f, len) for (i = 0; i < len; ++i) { /* - * Check that that jumps are forward, and within + * Check that that jumps are forward, and within * the code block. */ p = &f[i]; @@ -529,7 +529,7 @@ bpf_validate(f, len) * Check that memory operations use valid addresses. */ if ((BPF_CLASS(p->code) == BPF_ST || - (BPF_CLASS(p->code) == BPF_LD && + (BPF_CLASS(p->code) == BPF_LD && (p->code & 0xe0) == BPF_MEM)) && (p->k >= BPF_MEMWORDS || p->k < 0)) return 0; diff --git a/sys/net/fddi.h b/sys/net/fddi.h index a8efc5a..14ec343 100644 --- a/sys/net/fddi.h +++ b/sys/net/fddi.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_fddi.h 8.1 (Berkeley) 6/10/93 - * $Id: if_fddi.h,v 1.1 1995/03/10 17:43:45 thomas Exp $ + * $Id: if_fddi.h,v 1.1 1995/03/14 09:14:14 davidg Exp $ */ #ifndef _NETINET_IF_FDDI_H_ @@ -77,7 +77,7 @@ struct fddi_header { void fddi_ifattach __P((struct ifnet *)); void fddi_input __P((struct ifnet *, struct fddi_header *, struct mbuf *)); int fddi_output __P((struct ifnet *, - struct mbuf *, struct sockaddr *, struct rtentry *)); + struct mbuf *, struct sockaddr *, struct rtentry *)); #endif diff --git a/sys/net/if.c b/sys/net/if.c index 3756159..27d6149 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.13 1995/02/24 11:47:31 davidg Exp $ + * $Id: if.c,v 1.14 1995/05/27 04:37:24 davidg Exp $ */ #include <sys/param.h> @@ -203,7 +203,7 @@ ifa_ifwithdstaddr(addr) register struct ifnet *ifp; register struct ifaddr *ifa; - for (ifp = ifnet; ifp; ifp = ifp->if_next) + for (ifp = ifnet; ifp; ifp = ifp->if_next) if (ifp->if_flags & IFF_POINTOPOINT) for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -559,7 +559,7 @@ ifioctl(so, cmd, data, p) return (error); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); - /* + /* * 72 was chosen below because it is the size of a TCP/IP * header (40) + the minimum mss (32). */ @@ -659,7 +659,7 @@ ifconf(cmd, data) for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) { char workbuf[12], *unitname; int unitlen, ifnlen; - + unitname = sprint_d(ifp->if_unit, workbuf, sizeof workbuf); unitlen = strlen(unitname); ifnlen = strlen(ifp->if_name); @@ -677,7 +677,7 @@ ifconf(cmd, data) if (error) break; space -= sizeof (ifr), ifrp++; - } else + } else for ( ; space > sizeof (ifr) && ifa; ifa = ifa->ifa_next) { register struct sockaddr *sa = ifa->ifa_addr; #ifdef COMPAT_43 diff --git a/sys/net/if.h b/sys/net/if.h index 987e5c4..9e898fb 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id: if.h,v 1.16 1995/03/16 18:14:24 bde Exp $ + * $Id: if.h,v 1.17 1995/04/26 18:10:44 pst Exp $ */ #ifndef _NET_IF_H_ @@ -74,7 +74,7 @@ */ struct mbuf; struct proc; -struct rtentry; +struct rtentry; struct socket; struct ether_header; #endif @@ -133,7 +133,7 @@ struct ifnet { __P((struct ifnet *)); /* (XXX not used; fake prototype) */ int (*if_ioctl) /* ioctl routine */ __P((struct ifnet *, int, caddr_t)); - void (*if_reset) + void (*if_reset) __P((int)); /* new autoconfig will permit removal */ void (*if_watchdog) /* timer routine */ __P((int)); diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c index 5872595..7e80531 100644 --- a/sys/net/if_disc.c +++ b/sys/net/if_disc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 - * $Id: if_disc.c,v 1.2 1995/03/17 22:02:18 wollman Exp $ + * $Id: if_disc.c,v 1.3 1995/03/20 19:20:39 wollman Exp $ */ /* @@ -135,7 +135,7 @@ dsoutput(ifp, m, dst, rt) m0.m_next = m; m0.m_len = 4; m0.m_data = (char *)⁡ - + bpf_mtap(dsif.if_bpf, &m0); } #endif diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h index f3db94a..e76b88a 100644 --- a/sys/net/if_dl.h +++ b/sys/net/if_dl.h @@ -31,25 +31,25 @@ * SUCH DAMAGE. * * @(#)if_dl.h 8.1 (Berkeley) 6/10/93 - * $Id: if_dl.h,v 1.2 1994/08/02 07:46:12 davidg Exp $ + * $Id: if_dl.h,v 1.3 1994/08/21 05:11:41 paul Exp $ */ #ifndef _NET_IF_DL_H_ #define _NET_IF_DL_H_ -/* +/* * A Link-Level Sockaddr may specify the interface in one of two * ways: either by means of a system-provided index number (computed * anew and possibly differently on every reboot), or by a human-readable * string such as "il0" (for managerial convenience). - * + * * Census taking actions, such as something akin to SIOCGCONF would return * both the index and the human name. - * + * * High volume transactions (such as giving a link-level ``from'' address * in a recvfrom or recvmsg call) may be likely only to provide the indexed * form, (which requires fewer copy operations and less space). - * + * * The form and interpretation of the link-level address is purely a matter * of convention between the device driver and its consumers; however, it is * expected that all drivers for an interface of a given if_type will agree. diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 07d7867..18c45f4 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ethersubr.c,v 1.6 1995/03/16 18:14:25 bde Exp $ + * $Id: if_ethersubr.c,v 1.7 1995/05/09 13:35:39 davidg Exp $ */ #include <sys/param.h> @@ -115,7 +115,7 @@ ether_output(ifp, m0, dst, rt0) if ((rt->rt_flags & RTF_UP) == 0) { if (rt0 = rt = rtalloc1(dst, 1, 0UL)) rt->rt_refcnt--; - else + else senderr(EHOSTUNREACH); } if (rt->rt_flags & RTF_GATEWAY) { @@ -123,7 +123,7 @@ ether_output(ifp, m0, dst, rt0) goto lookup; if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) { rtfree(rt); rt = rt0; - lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1, + lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1, 0UL); if ((rt = rt->rt_gwroute) == 0) senderr(EHOSTUNREACH); @@ -206,7 +206,7 @@ ether_output(ifp, m0, dst, rt0) #ifdef LLC /* case AF_NSAP: */ case AF_CCITT: { - register struct sockaddr_dl *sdl = + register struct sockaddr_dl *sdl = (struct sockaddr_dl *) rt -> rt_gateway; if (sdl && sdl->sdl_family == AF_LINK @@ -234,14 +234,14 @@ ether_output(ifp, m0, dst, rt0) printf("ether_output: sending LLC2 pkt to: "); for (i=0; i<6; i++) printf("%x ", edst[i] & 0xff); - printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", + printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff, l->llc_control & 0xff); } #endif /* LLC_DEBUG */ } break; -#endif /* LLC */ +#endif /* LLC */ case AF_UNSPEC: eh = (struct ether_header *)dst->sa_data; @@ -356,7 +356,7 @@ ether_input(ifp, eh, m) l = mtod(m, struct llc *); switch (l->llc_dsap) { #ifdef ISO - case LLC_ISO_LSAP: + case LLC_ISO_LSAP: switch (l->llc_control) { case LLC_UI: /* LLC_UI_P forbidden in class 1 service */ @@ -380,7 +380,7 @@ ether_input(ifp, eh, m) break; } goto dropanyway; - + case LLC_XID: case LLC_XID_P: if(m->m_len < 6) @@ -408,7 +408,7 @@ ether_input(ifp, eh, m) eh2 = (struct ether_header *)sa.sa_data; for (i = 0; i < 6; i++) { eh2->ether_shost[i] = c = eh->ether_dhost[i]; - eh2->ether_dhost[i] = + eh2->ether_dhost[i] = eh->ether_dhost[i] = eh->ether_shost[i]; eh->ether_shost[i] = c; } @@ -430,7 +430,7 @@ ether_input(ifp, eh, m) if (m == 0) return; if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP, - eh->ether_dhost, LLC_X25_LSAP, 6, + eh->ether_dhost, LLC_X25_LSAP, 6, mtod(m, struct sdl_hdr *))) panic("ETHER cons addr failure"); mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type; diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 1ffdb2b..41ea156 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp - * $Id: if_fddisubr.c,v 1.3 1995/03/16 18:14:26 bde Exp $ + * $Id: if_fddisubr.c,v 1.4 1995/05/09 13:35:40 davidg Exp $ */ #include <sys/param.h> @@ -134,7 +134,7 @@ fddi_output(ifp, m0, dst, rt0) if ((rt->rt_flags & RTF_UP) == 0) { if (rt0 = rt = RTALLOC1(dst, 1)) rt->rt_refcnt--; - else + else senderr(EHOSTUNREACH); } if (rt->rt_flags & RTF_GATEWAY) { @@ -222,7 +222,7 @@ fddi_output(ifp, m0, dst, rt0) #ifdef LLC /* case AF_NSAP: */ case AF_CCITT: { - register struct sockaddr_dl *sdl = + register struct sockaddr_dl *sdl = (struct sockaddr_dl *) rt -> rt_gateway; if (sdl && sdl->sdl_family == AF_LINK @@ -251,14 +251,14 @@ fddi_output(ifp, m0, dst, rt0) printf("fddi_output: sending LLC2 pkt to: "); for (i=0; i<6; i++) printf("%x ", edst[i] & 0xff); - printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", + printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff, l->llc_control & 0xff); } #endif /* LLC_DEBUG */ } break; -#endif /* LLC */ +#endif /* LLC */ case AF_UNSPEC: { @@ -440,7 +440,7 @@ fddi_input(ifp, fh, m) } #endif /* INET || NS */ #ifdef ISO - case LLC_ISO_LSAP: + case LLC_ISO_LSAP: switch (l->llc_control) { case LLC_UI: /* LLC_UI_P forbidden in class 1 service */ @@ -462,7 +462,7 @@ fddi_input(ifp, fh, m) break; } goto dropanyway; - + case LLC_XID: case LLC_XID_P: if(m->m_len < 6) @@ -490,7 +490,7 @@ fddi_input(ifp, fh, m) eh2 = (struct ether_header *)sa.sa_data; for (i = 0; i < 6; i++) { eh2->ether_shost[i] = c = eh->fddi_dhost[i]; - eh2->ether_dhost[i] = + eh2->ether_dhost[i] = eh->ether_dhost[i] = eh->fddi_shost[i]; eh2->ether_shost[i] = c; } @@ -511,7 +511,7 @@ fddi_input(ifp, fh, m) if (m == 0) return; if ( !sdl_sethdrif(ifp, fh->fddi_shost, LLC_X25_LSAP, - fh->fddi_dhost, LLC_X25_LSAP, 6, + fh->fddi_dhost, LLC_X25_LSAP, 6, mtod(m, struct sdl_hdr *))) panic("ETHER cons addr failure"); mtod(m, struct sdl_hdr *)->sdlhdr_len = m->m_pkthdr.len - sizeof(struct sdl_hdr); @@ -523,7 +523,7 @@ fddi_input(ifp, fh, m) break; } #endif /* LLC */ - + default: printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); ifp->if_noproto++; diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 708da73..7673f7e 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_loop.c 8.1 (Berkeley) 6/10/93 - * $Id: if_loop.c,v 1.8 1995/03/20 19:20:41 wollman Exp $ + * $Id: if_loop.c,v 1.9 1995/04/26 18:10:45 pst Exp $ */ /* @@ -138,7 +138,7 @@ looutput(ifp, m, dst, rt) m0.m_next = m; m0.m_len = 4; m0.m_data = (char *)⁡ - + bpf_mtap(ifp->if_bpf, &m0); } #endif diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 6adb512..c0672ca 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.11 1995/03/20 19:20:42 wollman Exp $ */ +/* $Id: if_ppp.c,v 1.12 1995/03/29 20:34:17 ache Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "ppp.h" @@ -273,7 +273,7 @@ pppdealloc(sc) } sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); } - + /* * Line specific open routine for async tty devices. * Attach the given tty to the first available ppp unit. @@ -304,7 +304,7 @@ pppopen(dev, tp) m_freem(sc->sc_outm); sc->sc_outm = NULL; } - + if (pppgetm(sc) == 0) { sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); return (ENOBUFS); @@ -670,7 +670,7 @@ pppoutput(ifp, m0, dst, rt) error = ENETDOWN; goto bad; } - + /* * If this is a TCP packet to or from an "interactive" port, * put the packet on the fastq instead. @@ -1314,7 +1314,7 @@ pppinput(c, tp) sc->sc_ilen = 0; sc->sc_if.if_ibytes = sc->sc_bytesrcvd; - if (sc->sc_rawin_count > 0) + if (sc->sc_rawin_count > 0) ppplogchar(sc, -1); /* diff --git a/sys/net/if_ppp.h b/sys/net/if_ppp.h index 9f70af0..97df728 100644 --- a/sys/net/if_ppp.h +++ b/sys/net/if_ppp.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: if_ppp.h,v 1.5 1994/01/25 05:56:08 deraadt Exp $ + * $Id: if_ppp.h,v 1.2 1994/09/23 00:13:20 wollman Exp $ */ #ifndef _IF_PPP_H_ @@ -86,7 +86,7 @@ struct ppp_softc { u_int sc_bytessent; /* count of octets sent */ u_int sc_bytesrcvd; /* count of octets received */ caddr_t sc_bpf; /* hook for BPF */ - + /* Device-dependent part for async lines. */ ext_accm sc_asyncmap; /* async control character map */ u_long sc_rasyncmap; /* receive async control char map */ diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 1e1fa68..6ddd878 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $Id: if_sl.c,v 1.18 1995/04/02 00:11:48 bde Exp $ + * $Id: if_sl.c,v 1.19 1995/04/28 18:47:28 ache Exp $ */ /* @@ -60,7 +60,7 @@ * pinging you can use up all your bandwidth). Made low clist behavior * more robust and slightly less likely to hang serial line. * Sped up a bunch of things. - * + * * Note that splimp() is used throughout to block both (tty) input * interrupts and network activity; thus, splimp must be >= spltty. */ diff --git a/sys/net/if_slvar.h b/sys/net/if_slvar.h index 2fb3f9f..ade190f 100644 --- a/sys/net/if_slvar.h +++ b/sys/net/if_slvar.h @@ -32,7 +32,7 @@ * * @(#)if_slvar.h 8.3 (Berkeley) 2/1/94 * - * $Id: if_slvar.h,v 1.4 1994/10/08 01:40:23 phk Exp $ + * $Id: if_slvar.h,v 1.5 1995/03/30 20:43:32 ache Exp $ */ #ifndef _NET_IF_SLVAR_H_ @@ -40,7 +40,7 @@ /* * Definitions for SLIP interface data structures - * + * * (This exists so programs like slstats can get at the definition * of sl_softc.) */ diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index a2a1965..42037f1 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -196,7 +196,7 @@ tunclose(dev_t dev, int foo, int bar, struct proc *p) } tp->tun_pgrp = 0; selwakeup(&tp->tun_rsel); - + TUNDEBUG ("%s%d: closed\n", ifp->if_name, ifp->if_unit); return (0); } @@ -388,7 +388,7 @@ tunioctl(dev, cmd, data, flag, p) s = splimp(); if (tp->tun_if.if_snd.ifq_head) *(int *)data = tp->tun_if.if_snd.ifq_head->m_len; - else + else *(int *)data = 0; splx(s); break; diff --git a/sys/net/if_tun.h b/sys/net/if_tun.h index 50af6bc..b287636 100644 --- a/sys/net/if_tun.h +++ b/sys/net/if_tun.h @@ -12,7 +12,7 @@ * roots in a similar driver written by Phil Cockcroft (formerly) at * UCL. This driver is based much more on read/write/select mode of * operation though. - * + * * : $Header: if_tnreg.h,v 1.1.2.1 1992/07/16 22:39:16 friedl Exp */ diff --git a/sys/net/pppcompress.c b/sys/net/pppcompress.c index 8c7abdb..5485b0f 100644 --- a/sys/net/pppcompress.c +++ b/sys/net/pppcompress.c @@ -44,9 +44,9 @@ * so that the entire packet being decompressed doesn't have * to be in contiguous memory (just the compressed header). * - * $Id: pppcompress.c,v 1.2 1994/09/23 00:13:21 wollman Exp $ + * $Id: pppcompress.c,v 1.3 1994/11/01 09:03:20 pst Exp $ */ - + #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/pppcompress.h b/sys/net/pppcompress.h index ed30971..93f3e51 100644 --- a/sys/net/pppcompress.h +++ b/sys/net/pppcompress.h @@ -39,7 +39,7 @@ * - added sl_uncompress_tcp_part. * * From: slcompress.h 7.4 90/06/28 - * $Id: slcompress.h,v 1.5 1994/01/15 20:13:16 deraadt Exp $ + * $Id: pppcompress.h,v 1.2 1994/09/23 00:13:22 wollman Exp $ */ #ifndef _NET_PPPCOMPRESS_H_ @@ -60,7 +60,7 @@ * sequence number changes, one change per bit set in the header * (there may be no changes and there are two special cases where * the receiver implicitly knows what changed -- see below). - * + * * 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 diff --git a/sys/net/radix.c b/sys/net/radix.c index 6616277..7073d60 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)radix.c 8.4 (Berkeley) 11/2/94 - * $Id$ + * $Id: radix.c,v 1.8 1995/04/28 23:01:34 pst Exp $ */ /* @@ -76,18 +76,18 @@ static char *rn_zeros, *rn_ones; * We define the index of a route to associated with the mask to be * the first bit number in the mask where 0 occurs (with bit number 0 * representing the highest order bit). - * + * * We say a mask is normal if every bit is 0, past the index of the mask. * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b, * and m is a normal mask, then the route applies to every descendant of n. * If the index(m) < rn_b, this implies the trailing last few bits of k * before bit b are all 0, (and hence consequently true of every descendant * of n), so the route applies to all descendants of the node as well. - * + * * Similar logic shows that a non-normal mask m such that * index(m) <= index(n) could potentially apply to many children of n. * Thus, for each non-host route, we attach its mask to a list at an internal - * node as high in the tree as we can go. + * node as high in the tree as we can go. * * The present version of the code makes use of normal routes in short- * circuiting an explict mask and compare operation when testing whether @@ -300,7 +300,7 @@ on1: } while (t != top); return 0; }; - + #ifdef RN_DEBUG int rn_nodenum; struct radix_node *rn_clist; @@ -364,7 +364,7 @@ on1: cp = v; do { p = x; - if (cp[x->rn_off] & x->rn_bmask) + if (cp[x->rn_off] & x->rn_bmask) x = x->rn_r; else x = x->rn_l; } while (b > (unsigned) x->rn_b); /* x->rn_b < b && x->rn_b >= 0 */ @@ -452,7 +452,7 @@ rn_addmask(n_arg, search, skip) for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;) cp++; if (cp != cplim) { - for (j = 0x80; (j & *cp) != 0; j >>= 1) + for (j = 0x80; (j & *cp) != 0; j >>= 1) b++; if (*cp != normal_chars[b] || cp != (cplim - 1)) isnormal = 0; @@ -472,7 +472,7 @@ rn_lexobetter(m_arg, n_arg) if (*mp > *np) return 1; /* not really, but need to check longer one first */ - if (*mp == *np) + if (*mp == *np) for (lim = mp + *mp; mp < lim;) if (*mp++ > *np++) return 1; @@ -594,7 +594,7 @@ rn_addroute(v_arg, n_arg, head, treenodes) b_leaf = -1 - t->rn_b; if (t->rn_r == saved_tt) x = t->rn_l; else x = t->rn_r; /* Promote general routes from below */ - if (x->rn_b < 0) { + if (x->rn_b < 0) { for (mp = &t->rn_mklist; x; x = x->rn_dupedkey) if (x->rn_mask && (x->rn_b >= b_leaf) && x->rn_mklist == 0) { *mp = m = rn_new_radix_mask(x, 0); @@ -691,7 +691,7 @@ rn_delete(v_arg, netmask_arg, head) log(LOG_ERR, "rn_delete: inconsistent annotation\n"); return 0; /* dangling ref could cause disaster */ } - } else { + } else { if (m->rm_mask != tt->rn_mask) { log(LOG_ERR, "rn_delete: inconsistent annotation\n"); goto on1; @@ -865,7 +865,7 @@ rn_walktree_from(h, a, m, f, w) * while applying the function f to it, so we need to calculate * the successor node in advance. */ - while (rn->rn_b >= 0) + while (rn->rn_b >= 0) rn = rn->rn_l; while (!stopping) { @@ -875,7 +875,7 @@ rn_walktree_from(h, a, m, f, w) while (rn->rn_p->rn_r == rn && !(rn->rn_flags & RNF_ROOT)) { rn = rn->rn_p; - /* if went up beyond last, stop */ + /* if went up beyond last, stop */ if (rn->rn_b < lastb) { stopping = 1; /* printf("up too far\n"); */ @@ -890,7 +890,7 @@ rn_walktree_from(h, a, m, f, w) while ((rn = base) != 0) { base = rn->rn_dupedkey; /* printf("leaf %p\n", rn); */ - if (!(rn->rn_flags & RNF_ROOT) + if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w))) return (error); } diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index 0572378..dfb08e4 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_cb.c,v 1.2 1994/08/02 07:46:34 davidg Exp $ + * $Id: raw_cb.c,v 1.3 1994/10/08 22:38:24 phk Exp $ */ #include <sys/param.h> @@ -49,7 +49,7 @@ #include <netinet/in.h> /* - * Routines to manage the raw protocol control blocks. + * Routines to manage the raw protocol control blocks. * * TODO: * hash lookups by protocol family/protocol + address family diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index c66f5ef..bf6f6bb 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_usrreq.c,v 1.4 1994/10/08 22:38:25 phk Exp $ + * $Id: raw_usrreq.c,v 1.5 1995/02/16 01:11:38 wollman Exp $ */ #include <sys/param.h> @@ -191,7 +191,7 @@ raw_usrreq(so, req, m, nam, control) * If a socket isn't bound to a single address, * the raw input routine will hand it anything * within that protocol family (assuming there's - * nothing else around it should go to). + * nothing else around it should go to). */ case PRU_CONNECT: error = EINVAL; diff --git a/sys/net/route.c b/sys/net/route.c index a75cbc3..ca705b5 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)route.c 8.2 (Berkeley) 11/15/93 - * $Id: route.c,v 1.20 1995/03/23 18:07:29 wollman Exp $ + * $Id: route.c,v 1.22 1995/04/25 19:12:07 wollman Exp $ */ #include <sys/param.h> @@ -146,7 +146,7 @@ void rtfree(rt) register struct rtentry *rt; { - register struct radix_node_head *rnh = + register struct radix_node_head *rnh = rt_tables[rt_key(rt)->sa_family]; register struct ifaddr *ifa; @@ -237,7 +237,7 @@ rtredirect(dst, gateway, netmask, flags, src, rtp) goto create; /* * Don't listen to the redirect if it's - * for a route to an interface. + * for a route to an interface. */ if (rt->rt_flags & RTF_GATEWAY) { if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) { @@ -510,7 +510,7 @@ rt_fixdelete(struct radix_node *rn, void *vp) struct rtentry *rt0 = vp; if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) { - return rtrequest(RTM_DELETE, rt_key(rt), + return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt), rt->rt_flags, (struct rtentry **)0); } @@ -519,13 +519,13 @@ rt_fixdelete(struct radix_node *rn, void *vp) /* * This routine is called from rt_setgate() to do the analogous thing for - * adds and changes. There is the added complication in this case of a + * adds and changes. There is the added complication in this case of a * middle insert; i.e., insertion of a new network route between an older * network route and (cloned) host routes. For this reason, a simple check * of rt->rt_parent is insufficient; each candidate route must be tested * against the (mask, value) of the new route (passed as before in vp) * to see if the new route matches it. Unfortunately, this has the obnoxious - * property of also triggering for insertion /above/ a pre-existing network + * property of also triggering for insertion /above/ a pre-existing network * route and clones. Sigh. This may be fixed some day. * * XXX - it may be possible to do fixdelete() for changes and reserve this @@ -562,7 +562,7 @@ rt_fixchange(struct radix_node *rn, void *vp) #ifdef DEBUG if(rtfcdebug) printf("parent match\n"); #endif - return rtrequest(RTM_DELETE, rt_key(rt), + return rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt), rt->rt_flags, (struct rtentry **)0); } @@ -570,7 +570,7 @@ rt_fixchange(struct radix_node *rn, void *vp) /* * There probably is a function somewhere which does this... * if not, there should be. - */ + */ len = imin(((struct sockaddr *)rt_key(rt0))->sa_len, ((struct sockaddr *)rt_key(rt))->sa_len); @@ -655,7 +655,7 @@ rt_setgate(rt0, dst, gate) struct rtfc_arg arg; arg.rnh = rnh; arg.rt0 = rt; - rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), + rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), rt_fixchange, &arg); } diff --git a/sys/net/route.h b/sys/net/route.h index 58178ab..e12f986 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)route.h 8.3 (Berkeley) 4/19/94 - * $Id: route.h,v 1.12 1995/02/08 20:01:13 wollman Exp $ + * $Id: route.h,v 1.13 1995/03/20 21:30:21 wollman Exp $ */ #ifndef _NET_ROUTE_H_ @@ -39,7 +39,7 @@ /* * Kernel resident routing tables. - * + * * The routing tables are initialized when interface addresses * are set by making entries for all directly connected interfaces. */ diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 0db23bc..7e65578 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.5 (Berkeley) 11/2/94 - * $Id: rtsock.c,v 1.11 1995/05/11 00:13:11 wollman Exp $ + * $Id: rtsock.c,v 1.12 1995/05/15 22:57:53 davidg Exp $ */ #include <sys/param.h> @@ -308,7 +308,7 @@ flush: if (rtm) { if (error) rtm->rtm_errno = error; - else + else rtm->rtm_flags |= RTF_DONE; } if (rt) @@ -606,7 +606,7 @@ rt_newaddrmsg(cmd, ifa, error, rt) if ((cmd == RTM_ADD && pass == 2) || (cmd == RTM_DELETE && pass == 1)) { register struct rt_msghdr *rtm; - + if (rt == 0) continue; netmask = rt_mask(rt); diff --git a/sys/net/slcompress.c b/sys/net/slcompress.c index 42106d5..5630b51 100644 --- a/sys/net/slcompress.c +++ b/sys/net/slcompress.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)slcompress.c 8.2 (Berkeley) 4/16/94 - * $Id: slcompress.c,v 1.3 1994/08/18 22:35:22 wollman Exp $ + * $Id: slcompress.c,v 1.4 1994/10/08 22:38:27 phk Exp $ */ /* @@ -272,7 +272,7 @@ sl_compress_tcp(m, ip, comp, compress_cid) * with it. */ goto uncompressed; - deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win)); + deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win)); if (deltaS) { ENCODE(deltaS); changes |= NEW_W; diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h index 75e3a58..239f633 100644 --- a/sys/net/slcompress.h +++ b/sys/net/slcompress.h @@ -35,7 +35,7 @@ * * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. - * $Id: slcompress.h,v 1.4 1994/08/21 19:06:48 paul Exp $ + * $Id: slcompress.h,v 1.5 1994/08/22 14:16:36 bde Exp $ */ #ifndef _NET_SLCOMPRESS_H_ @@ -56,7 +56,7 @@ * sequence number changes, one change per bit set in the header * (there may be no changes and there are two special cases where * the receiver implicitly knows what changed -- see below). - * + * * 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 diff --git a/sys/netccitt/dll.h b/sys/netccitt/dll.h index c283918..005525b 100644 --- a/sys/netccitt/dll.h +++ b/sys/netccitt/dll.h @@ -1,5 +1,5 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -33,13 +33,13 @@ * SUCH DAMAGE. * * @(#)dll.h 8.1 (Berkeley) 6/10/93 - * $Id: dll.h,v 1.2 1994/08/02 07:46:56 davidg Exp $ + * $Id: dll.h,v 1.3 1994/08/21 05:44:06 paul Exp $ */ #ifndef _NETCCITT_DLL_H_ #define _NETCCITT_DLL_H_ -/* +/* * We define the additional PRC_* codes in here */ #ifdef KERNEL diff --git a/sys/netccitt/hd_debug.c b/sys/netccitt/hd_debug.c index bfd63a1..f368d42 100644 --- a/sys/netccitt/hd_debug.c +++ b/sys/netccitt/hd_debug.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)hd_debug.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_debug.c,v 1.2 1994/08/02 07:46:59 davidg Exp $ + * $Id: hd_debug.c,v 1.3 1995/02/15 06:29:42 jkh Exp $ */ #include <sys/param.h> @@ -94,19 +94,19 @@ register struct Hdlc_frame *frame; ns = iframe -> ns; switch (hd_decode (hdp, frame)) { - case SABM: + case SABM: printf ("SABM : PF=%d\n", pf); break; - case DISC: + case DISC: printf ("DISC : PF=%d\n", pf); break; - case DM: + case DM: printf ("DM : PF=%d\n", pf); break; - case FRMR: + case FRMR: { register struct Frmr_frame *f = (struct Frmr_frame *)frame; @@ -120,23 +120,23 @@ register struct Hdlc_frame *frame; break; } - case UA: + case UA: printf ("UA : PF=%d\n", pf); break; - case RR: + case RR: printf ("RR : N(R)=%d, PF=%d\n", nr, pf); break; - case RNR: + case RNR: printf ("RNR : N(R)=%d, PF=%d\n", nr, pf); break; - case REJ: + case REJ: printf ("REJ : N(R)=%d, PF=%d\n", nr, pf); break; - case IFRAME: + case IFRAME: { register struct mbuf *m; register int len = 0; @@ -152,7 +152,7 @@ register struct Hdlc_frame *frame; break; } - default: + default: printf ("ILLEGAL: "); for (s = (char *) frame, i = 0; i < 5; ++i, ++s) printf ("%x ", (int) *s & 0xff); diff --git a/sys/netccitt/hd_input.c b/sys/netccitt/hd_input.c index f23eada..91fd2fe 100644 --- a/sys/netccitt/hd_input.c +++ b/sys/netccitt/hd_input.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)hd_input.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_input.c,v 1.3 1995/02/15 06:29:43 jkh Exp $ + * $Id: hd_input.c,v 1.4 1995/05/11 19:26:39 rgrimes Exp $ */ #include <sys/param.h> @@ -157,11 +157,11 @@ register struct mbuf *fbuf; SET_TIMER (hdp); break; - case SABM + DM_SENT: - case SABM + WAIT_SABM: + case SABM + DM_SENT: + case SABM + WAIT_SABM: hd_writeinternal (hdp, UA, pf); - case UA + SABM_SENT: - case UA + WAIT_UA: + case UA + SABM_SENT: + case UA + WAIT_UA: KILL_TIMER (hdp); hd_initvars (hdp); hdp->hd_state = ABM; @@ -170,13 +170,13 @@ register struct mbuf *fbuf; (void) pk_ctlinput (PRC_LINKUP, hdp->hd_pkp); break; - case SABM + SABM_SENT: + case SABM + SABM_SENT: /* Got a SABM collision. Acknowledge the remote's SABM via UA but still wait for UA. */ hd_writeinternal (hdp, UA, pf); break; - case SABM + ABM: + case SABM + ABM: /* Request to reset the link from the remote. */ KILL_TIMER (hdp); hd_message (hdp, "Link reset"); @@ -190,28 +190,28 @@ register struct mbuf *fbuf; hdp->hd_resets++; break; - case SABM + WAIT_UA: + case SABM + WAIT_UA: hd_writeinternal (hdp, UA, pf); break; - case DM + ABM: + case DM + ABM: hd_message (hdp, "DM received: link down"); #ifdef HDLCDEBUG hd_dumptrace (hdp); #endif (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); hd_flush (hdp->hd_ifp); - case DM + DM_SENT: - case DM + WAIT_SABM: - case DM + WAIT_UA: + case DM + DM_SENT: + case DM + WAIT_SABM: + case DM + WAIT_UA: hd_writeinternal (hdp, SABM, pf); hdp->hd_state = SABM_SENT; SET_TIMER (hdp); break; case DISC + INIT: - case DISC + DM_SENT: - case DISC + SABM_SENT: + case DISC + DM_SENT: + case DISC + SABM_SENT: /* Note: This is a non-standard state change. */ hd_writeinternal (hdp, UA, pf); hd_writeinternal (hdp, SABM, POLLOFF); @@ -219,43 +219,43 @@ register struct mbuf *fbuf; SET_TIMER (hdp); break; - case DISC + WAIT_UA: + case DISC + WAIT_UA: hd_writeinternal (hdp, DM, pf); SET_TIMER (hdp); hdp->hd_state = DM_SENT; break; - case DISC + ABM: + case DISC + ABM: hd_message (hdp, "DISC received: link down"); (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); - case DISC + WAIT_SABM: + case DISC + WAIT_SABM: hd_writeinternal (hdp, UA, pf); hdp->hd_state = DM_SENT; SET_TIMER (hdp); break; - case UA + ABM: + case UA + ABM: hd_message (hdp, "UA received: link down"); (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); - case UA + WAIT_SABM: + case UA + WAIT_SABM: hd_writeinternal (hdp, DM, pf); hdp->hd_state = DM_SENT; SET_TIMER (hdp); break; - case FRMR + DM_SENT: + case FRMR + DM_SENT: hd_writeinternal (hdp, SABM, pf); hdp->hd_state = SABM_SENT; SET_TIMER (hdp); break; - case FRMR + WAIT_SABM: + case FRMR + WAIT_SABM: hd_writeinternal (hdp, DM, pf); hdp->hd_state = DM_SENT; SET_TIMER (hdp); break; - case FRMR + ABM: + case FRMR + ABM: hd_message (hdp, "FRMR received: link down"); (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); #ifdef HDLCDEBUG @@ -267,41 +267,41 @@ register struct mbuf *fbuf; SET_TIMER (hdp); break; - case RR + ABM: - case RNR + ABM: - case REJ + ABM: + case RR + ABM: + case RNR + ABM: + case REJ + ABM: process_sframe (hdp, (struct Hdlc_sframe *)frame, frametype); break; - case IFRAME + ABM: + case IFRAME + ABM: queued = process_iframe (hdp, fbuf, (struct Hdlc_iframe *)frame); break; - case IFRAME + SABM_SENT: - case RR + SABM_SENT: - case RNR + SABM_SENT: - case REJ + SABM_SENT: + case IFRAME + SABM_SENT: + case RR + SABM_SENT: + case RNR + SABM_SENT: + case REJ + SABM_SENT: hd_writeinternal (hdp, DM, POLLON); hdp->hd_state = DM_SENT; SET_TIMER (hdp); break; - case IFRAME + WAIT_SABM: - case RR + WAIT_SABM: - case RNR + WAIT_SABM: - case REJ + WAIT_SABM: + case IFRAME + WAIT_SABM: + case RR + WAIT_SABM: + case RNR + WAIT_SABM: + case REJ + WAIT_SABM: hd_writeinternal (hdp, FRMR, POLLOFF); SET_TIMER (hdp); break; - case ILLEGAL + SABM_SENT: + case ILLEGAL + SABM_SENT: hdp->hd_unknown++; hd_writeinternal (hdp, DM, POLLOFF); hdp->hd_state = DM_SENT; SET_TIMER (hdp); break; - case ILLEGAL + ABM: + case ILLEGAL + ABM: hd_message (hdp, "Unknown frame received: link down"); (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); case ILLEGAL + WAIT_SABM: @@ -329,7 +329,7 @@ register struct Hdlc_iframe *frame; pf = frame -> pf; register int queued = FALSE; - /* + /* * Validate the iframe's N(R) value. It's N(R) value must be in * sync with our V(S) value and our "last received nr". */ @@ -340,7 +340,7 @@ register struct Hdlc_iframe *frame; } - /* + /* * This section tests the IFRAME for proper sequence. That is, it's * sequence number N(S) MUST be equal to V(S). */ @@ -366,10 +366,10 @@ register struct Hdlc_iframe *frame; } hdp->hd_condition &= ~REJ_CONDITION; - /* + /* * This section finally tests the IFRAME's sequence number against * the window size (K) and the sequence number of the last frame - * we have acknowledged. If the IFRAME is completely correct then + * we have acknowledged. If the IFRAME is completely correct then * it is queued for the packet level. */ @@ -379,7 +379,7 @@ register struct Hdlc_iframe *frame; /* Must generate a RR or RNR with final bit on. */ hd_writeinternal (hdp, RR, POLLON); } else - /* + /* * Hopefully we can piggyback the RR, if not we will generate * a RR when T3 timer expires. */ @@ -396,7 +396,7 @@ register struct Hdlc_iframe *frame; #else { register struct mbuf *m; - + for (m = fbuf; m -> m_next; m = m -> m_next) m -> m_act = (struct mbuf *) 0; m -> m_act = (struct mbuf *) 1; @@ -406,9 +406,9 @@ register struct Hdlc_iframe *frame; queued = TRUE; hd_start (hdp); } else { - /* + /* * Here if the remote station has transmitted more iframes then - * the number which have been acknowledged plus K. + * the number which have been acknowledged plus K. */ hdp->hd_invalid_ns++; frame_reject (hdp, W, frame); @@ -416,7 +416,7 @@ register struct Hdlc_iframe *frame; return (queued); } -/* +/* * This routine is used to determine if a value (the middle parameter) * is between two other values. The low value is the first parameter * the high value is the last parameter. The routine checks the middle @@ -441,7 +441,7 @@ int rear, return (result); } -/* +/* * This routine handles all the frame reject conditions which can * arise as a result of secondary processing. The frame reject * condition Y (frame length error) are handled elsewhere. @@ -466,20 +466,20 @@ struct Hdlc_iframe *frame; frmr -> frmr_w = frmr -> frmr_x = frmr -> frmr_y = frmr -> frmr_z = 0; switch (rejectcode) { - case Z: + case Z: frmr -> frmr_z = 1;/* invalid N(R). */ break; - case Y: + case Y: frmr -> frmr_y = 1;/* iframe length error. */ break; - case X: + case X: frmr -> frmr_x = 1;/* invalid information field. */ frmr -> frmr_w = 1; break; - case W: + case W: frmr -> frmr_w = 1;/* invalid N(S). */ } @@ -489,7 +489,7 @@ struct Hdlc_iframe *frame; SET_TIMER (hdp); } -/* +/* * This procedure is invoked when ever we receive a supervisor * frame such as RR, RNR and REJ. All processing for these * frames is done here. @@ -505,16 +505,16 @@ int frametype; if (valid_nr (hdp, nr, pf) == TRUE) { switch (frametype) { - case RR: + case RR: hdp->hd_condition &= ~REMOTE_RNR_CONDITION; break; - case RNR: + case RNR: hdp->hd_condition |= REMOTE_RNR_CONDITION; hdp->hd_retxcnt = 0; break; - case REJ: + case REJ: hdp->hd_condition &= ~REMOTE_RNR_CONDITION; rej_routine (hdp, nr); } @@ -545,7 +545,7 @@ int frametype; frame_reject (hdp, Z, (struct Hdlc_iframe *)frame); /* Invalid N(R). */ } -/* +/* * This routine tests the validity of the N(R) which we have received. * If it is ok, then all the iframes which it acknowledges (if any) * will be freed. @@ -561,7 +561,7 @@ register int finalbit; if (hdp->hd_lastrxnr == nr) return (TRUE); - /* + /* * This section validates the frame's N(R) value. It's N(R) value * must be in syncronization with our V(S) value and our "last * received nr" variable. If it is correct then we are able to send @@ -579,7 +579,7 @@ register int finalbit; } } - /* + /* * If we get to here, we do have a valid frame but it might be out * of sequence. However, we should still accept the receive state * number N(R) since it has already passed our previous test and it @@ -594,7 +594,7 @@ register int finalbit; return (TRUE); } -/* +/* * This routine determines how many iframes need to be retransmitted. * It then resets the Send State Variable V(S) to accomplish this. */ @@ -613,10 +613,10 @@ register int rejnr; hd_flush (hdp->hd_ifp); - /* - * Determine how many frames should be re-transmitted. In the case + /* + * Determine how many frames should be re-transmitted. In the case * of a normal REJ this should be 1 to K. In the case of a timer - * recovery REJ (ie. a REJ with the Final Bit on) this could be 0. + * recovery REJ (ie. a REJ with the Final Bit on) this could be 0. */ anchor = hdp->hd_vs; @@ -638,7 +638,7 @@ register int rejnr; hd_start (hdp); } -/* +/* * This routine frees iframes from the retransmit queue. It is called * when a previously written iframe is acknowledged. */ @@ -652,12 +652,12 @@ register int finalbit; { register int i, k; - /* - * We need to do the following because of a funny quirk in the - * protocol. This case occures when in Timer recovery condition + /* + * We need to do the following because of a funny quirk in the + * protocol. This case occures when in Timer recovery condition * we get a N(R) which acknowledges all the outstanding iframes * but with the Final Bit off. In this case we need to save the last - * iframe for possible retransmission even though it has already been + * iframe for possible retransmission even though it has already been * acknowledged! */ diff --git a/sys/netccitt/hd_output.c b/sys/netccitt/hd_output.c index 08530ad..903c27e 100644 --- a/sys/netccitt/hd_output.c +++ b/sys/netccitt/hd_output.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)hd_output.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_output.c,v 1.2 1994/08/02 07:47:05 davidg Exp $ + * $Id: hd_output.c,v 1.3 1995/02/15 06:29:44 jkh Exp $ */ #include <sys/param.h> @@ -60,7 +60,7 @@ * HDLC OUTPUT INTERFACE * * This routine is called when the X.25 packet layer output routine - * has a information frame (iframe) to write. It is also called + * has a information frame (iframe) to write. It is also called * by the input and control routines of the HDLC layer. */ @@ -70,7 +70,7 @@ register struct hdcb *hdp; { register struct mbuf *m; - /* + /* * The iframe is only transmitted if all these conditions are FALSE. * The iframe remains queued (hdp->hd_txq) however and will be * transmitted as soon as these conditions are cleared. @@ -79,9 +79,9 @@ register struct hdcb *hdp; while (!(hdp->hd_condition & (TIMER_RECOVERY_CONDITION | REMOTE_RNR_CONDITION | REJ_CONDITION))) { if (hdp->hd_vs == (hdp->hd_lastrxnr + hdp->hd_xcp->xc_lwsize) % MODULUS) { - /* We have now exceeded the maximum number of - outstanding iframes. Therefore, we must wait - until at least one is acknowledged if this + /* We have now exceeded the maximum number of + outstanding iframes. Therefore, we must wait + until at least one is acknowledged if this condition is not turned off before we are requested to write another iframe. */ hdp->hd_window_condition++; @@ -133,7 +133,7 @@ struct mbuf *m0; hd_start (hdp); } -/* +/* * This procedure is passed a buffer descriptor for an iframe. It builds * the rest of the control part of the frame and then writes it out. It * also starts the acknowledgement timer and keeps the iframe in the @@ -221,7 +221,7 @@ register struct hdcb *hdp; } -/* +/* * This routine gets control when the timer expires because we have not * received an acknowledgement for a iframe. */ diff --git a/sys/netccitt/hd_subr.c b/sys/netccitt/hd_subr.c index 6dcfe2f..c379188 100644 --- a/sys/netccitt/hd_subr.c +++ b/sys/netccitt/hd_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)hd_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_subr.c,v 1.2 1994/08/02 07:47:07 davidg Exp $ + * $Id: hd_subr.c,v 1.3 1995/02/15 06:29:45 jkh Exp $ */ #include <sys/param.h> @@ -98,9 +98,9 @@ struct sockaddr *addr; return (ENOBUFS); bzero((caddr_t)hdp, sizeof(*hdp)); hdp->hd_pkp = - (caddr_t) pk_newlink ((struct x25_ifaddr *) ifa, + (caddr_t) pk_newlink ((struct x25_ifaddr *) ifa, (caddr_t) hdp); - ((struct x25_ifaddr *)ifa)->ia_pkcb = + ((struct x25_ifaddr *)ifa)->ia_pkcb = (struct pkcb *) hdp->hd_pkp; if (hdp -> hd_pkp == 0) { free(hdp, M_PCB); @@ -115,9 +115,9 @@ struct sockaddr *addr; hdcbhead = hdp; } else if (hdp->hd_pkp == 0) { /* interface got reconfigured */ hdp->hd_pkp = - (caddr_t) pk_newlink ((struct x25_ifaddr *) ifa, + (caddr_t) pk_newlink ((struct x25_ifaddr *) ifa, (caddr_t) hdp); - ((struct x25_ifaddr *)ifa)->ia_pkcb = + ((struct x25_ifaddr *)ifa)->ia_pkcb = (struct pkcb *) hdp->hd_pkp; if (hdp -> hd_pkp == 0) { free(hdp, M_PCB); @@ -198,17 +198,17 @@ struct Hdlc_frame *frame; else if (sframe -> hdlc_01 == 1) { /* Supervisory format. */ switch (sframe -> s2) { - case 0: + case 0: frametype = RR; hdp->hd_rrs_in++; break; - case 1: + case 1: frametype = RNR; hdp->hd_rnrs_in++; break; - case 2: + case 2: frametype = REJ; hdp->hd_rejs_in++; } @@ -216,23 +216,23 @@ struct Hdlc_frame *frame; else if (uframe -> hdlc_11 == 3) { /* Unnumbered format. */ switch (uframe -> m3) { - case 0: + case 0: frametype = DM; break; - case 1: + case 1: frametype = SABM; break; - case 2: + case 2: frametype = DISC; break; - case 3: + case 3: frametype = UA; break; - case 4: + case 4: frametype = FRMR; hdp->hd_frmrs_in++; } @@ -240,9 +240,9 @@ struct Hdlc_frame *frame; return (frametype); } -/* +/* * This routine is called when the HDLC layer internally generates a - * command or response for the remote machine ( eg. RR, UA etc. ). + * command or response for the remote machine ( eg. RR, UA etc. ). * Only supervisory or unnumbered frames are processed. */ @@ -270,27 +270,27 @@ register int frametype, pf; buf -> m_act = buf -> m_next = NULL; switch (frametype) { - case RR: + case RR: frame -> control = RR_CONTROL; hdp->hd_rrs_out++; break; - case RNR: + case RNR: frame -> control = RNR_CONTROL; hdp->hd_rnrs_out++; break; - case REJ: + case REJ: frame -> control = REJ_CONTROL; hdp->hd_rejs_out++; break; - case SABM: + case SABM: frame -> control = SABM_CONTROL; frame -> address = ADDRESS_B; break; - case DISC: + case DISC: if ((hdp->hd_ifp->if_flags & IFF_UP) == 0) { hdp->hd_state = DISCONNECTED; (void) m_freem (buf); @@ -301,15 +301,15 @@ register int frametype, pf; frame -> address = ADDRESS_B; break; - case DM: + case DM: frame -> control = DM_CONTROL; break; - case UA: + case UA: frame -> control = UA_CONTROL; break; - case FRMR: + case FRMR: frame -> control = FRMR_CONTROL; bcopy ((caddr_t)&hd_frmr, (caddr_t)frame -> info, 3); buf -> m_len = 5; diff --git a/sys/netccitt/hd_timer.c b/sys/netccitt/hd_timer.c index 925ff6a..8764043 100644 --- a/sys/netccitt/hd_timer.c +++ b/sys/netccitt/hd_timer.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)hd_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: hd_timer.c,v 1.2 1994/08/02 07:47:09 davidg Exp $ + * $Id: hd_timer.c,v 1.3 1995/02/15 06:29:46 jkh Exp $ */ #include <sys/param.h> @@ -61,7 +61,7 @@ */ /* - * HDLC TIMER + * HDLC TIMER * * This routine is called every 500ms by the kernel. Decrement timer by this * amount - if expired then process the event. @@ -83,19 +83,19 @@ hd_timer () continue; switch (hdp->hd_state) { - case INIT: + case INIT: case DISC_SENT: hd_writeinternal (hdp, DISC, POLLON); break; - case ABM: + case ABM: if (hdp->hd_lastrxnr != hdp->hd_vs) { /* XXX */ hdp->hd_timeouts++; hd_resend_iframe (hdp); } break; - case WAIT_SABM: + case WAIT_SABM: hd_writeinternal (hdp, FRMR, POLLOFF); if (++hdp->hd_retxcnt == hd_n2) { hdp->hd_retxcnt = 0; @@ -104,7 +104,7 @@ hd_timer () } break; - case DM_SENT: + case DM_SENT: if (++hdp->hd_retxcnt == hd_n2) { /* Notify the packet level. */ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp); @@ -115,7 +115,7 @@ hd_timer () hd_writeinternal (hdp, DM, POLLOFF); break; - case WAIT_UA: + case WAIT_UA: if (++hdp->hd_retxcnt == hd_n2) { hdp->hd_retxcnt = 0; hd_writeinternal (hdp, DM, POLLOFF); @@ -124,7 +124,7 @@ hd_timer () hd_writeinternal (hdp, SABM, POLLOFF); break; - case SABM_SENT: + case SABM_SENT: /* Do this indefinitely. */ hd_writeinternal (hdp, SABM, POLLON); break; diff --git a/sys/netccitt/if_x25subr.c b/sys/netccitt/if_x25subr.c index c5e5ad2..7b85f4a 100644 --- a/sys/netccitt/if_x25subr.c +++ b/sys/netccitt/if_x25subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_x25subr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_x25subr.c,v 1.4 1995/02/15 06:29:47 jkh Exp $ + * $Id: if_x25subr.c,v 1.5 1995/04/26 18:10:50 pst Exp $ */ #include <sys/param.h> @@ -88,7 +88,7 @@ struct sockaddr_x25 x25_dgmask = { -1, /* _udlen */ {-1} /* _udata */ }; - + struct if_x25stats { int ifx_wrongplen; int ifx_nophdr; @@ -161,7 +161,7 @@ register struct mbuf *m; extern struct timeval time; int s, len, isr; void x25_connect_callback(); - + if (m == 0 || lcp->lcd_state != DATA_TRANSFER) { x25_connect_callback(lcp, 0); return; @@ -442,7 +442,7 @@ struct sockaddr *dst; if (rt->rt_flags & RTF_GATEWAY) { if (rt->rt_llinfo) RTFREE((struct rtentry *)rt->rt_llinfo); - rt->rt_llinfo = (cmd == RTM_ADD) ? + rt->rt_llinfo = (cmd == RTM_ADD) ? (caddr_t)rtalloc1(rt->rt_gateway, 1, 0UL) : 0; return; } @@ -665,7 +665,7 @@ register struct x25_ifaddr *ia; rt->rt_refcnt--; } } - /* + /* * Call to rtalloc1 will create rtentry for reverse path * to callee by virtue of cloning magic and will allocate * space for local control block. @@ -706,7 +706,7 @@ register u_char *info; register struct x25_dgproto *dp = x25_dgprototab + ((sizeof x25_dgprototab) / (sizeof *dp)); register struct pklcd *lcp; - + while (dp > x25_dgprototab) if ((--dp)->spi == info[0]) goto gotspi; diff --git a/sys/netccitt/llc_input.c b/sys/netccitt/llc_input.c index f3a06dd..18effc3 100644 --- a/sys/netccitt/llc_input.c +++ b/sys/netccitt/llc_input.c @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)llc_input.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_input.c,v 1.2 1994/08/02 07:47:16 davidg Exp $ + * $Id: llc_input.c,v 1.3 1994/12/13 22:32:13 wollman Exp $ */ #include <sys/param.h> @@ -133,7 +133,7 @@ llcintr() * | ... | | / * -/ * - * Thus the we expect to have exactly + * Thus the we expect to have exactly * (sdlhdr->sdlhdr_len+sizeof(struct sdl_hdr)) in the mbuf chain */ expected_len = sdlhdr->sdlhdr_len + sizeof(struct sdl_hdr); @@ -166,7 +166,7 @@ llcintr() * is less than the established I/S frame length (DSAP + SSAP + * control + N(R)&P/F = 4) --- we drop those suckers */ - if (((frame->llc_control & 0x03) != 0x03) + if (((frame->llc_control & 0x03) != 0x03) && ((expected_len - sizeof(struct sdl_hdr)) < LLC_ISFRAMELEN)) { m_freem(m); printf("llc: hurz error\n"); @@ -186,9 +186,9 @@ llcintr() else llrt = npaidb_enter(&sdlhdr->sdlhdr_src, 0, 0, 0); #endif /* notyet */ else { - /* + /* * We cannot do anything currently here as we - * don't `know' this link --- drop it + * don't `know' this link --- drop it */ m_freem(m); continue; @@ -200,7 +200,7 @@ llcintr() * If the link is not existing right now, we can try and look up * the SAP info block. */ - if ((linkp == 0) && frame->llc_ssap) + if ((linkp == 0) && frame->llc_ssap) sapinfo = llc_getsapinfo(frame->llc_dsap, ifp); /* @@ -274,7 +274,7 @@ llcintr() * front of the mbuf chain (I don't like 'em) */ m_adj(m, sizeof(struct sdl_hdr)); - /* + /* * LLC_UFRAMELEN is sufficient, m_pullup() will pull up * the min(m->m_len, maxprotohdr_len [=40]) thus doing * the trick ... @@ -293,9 +293,9 @@ llcintr() * Basically we (indirectly) call the appropriate * state handler function that's pointed to by * llcl_statehandler. - * + * * The statehandler returns an action code --- - * further actions like + * further actions like * o notify network layer * o block further sending * o deblock link @@ -314,7 +314,7 @@ llc_input(struct llc_linkcb *linkp, struct mbuf *m, u_char cmdrsp) m_freem(m); return 0; } - pollfinal = ((frame->llc_control & 0x03) == 0x03) ? + pollfinal = ((frame->llc_control & 0x03) == 0x03) ? LLCGBITS(frame->llc_control, u_pf) : LLCGBITS(frame->llc_control_ext, s_pf); @@ -323,7 +323,7 @@ llc_input(struct llc_linkcb *linkp, struct mbuf *m, u_char cmdrsp) */ frame_kind = llc_decode(frame, linkp); - switch (action = llc_statehandler(linkp, frame, frame_kind, cmdrsp, + switch (action = llc_statehandler(linkp, frame, frame_kind, cmdrsp, pollfinal)) { case LLC_DATA_INDICATION: m_adj(m, LLC_ISFRAMELEN); @@ -379,7 +379,7 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) nlrt = (struct rtentry *) 0; } else { /* or this one */ - sap = 0; + sap = 0; config = (struct dllconfig *) 0; pcb = ctlinfo->dlcti_pcb; nlrt = ctlinfo->dlcti_rt; @@ -390,7 +390,7 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) linkp = ((struct npaidbentry *)llrt->rt_llinfo)->np_link; } - + switch (prc) { case PRC_IFUP: (void) llc_setsapinfo(ifp, addr->sa_family, sap, config); @@ -423,11 +423,11 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) } } } - - case PRC_CONNECT_REQUEST: + + case PRC_CONNECT_REQUEST: if (linkp == 0) { - if ((linkp = llc_newlink((struct sockaddr_dl *) nlrt->rt_gateway, - nlrt->rt_ifp, nlrt, + if ((linkp = llc_newlink((struct sockaddr_dl *) nlrt->rt_gateway, + nlrt->rt_ifp, nlrt, pcb, llrt)) == 0) return (0); ((struct npaidbentry *)llrt->rt_llinfo)->np_link = linkp; @@ -437,9 +437,9 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) splx(i); } return ((caddr_t)linkp); - + case PRC_DISCONNECT_REQUEST: - if (linkp == 0) + if (linkp == 0) panic("no link control block!"); i = splimp(); @@ -452,9 +452,9 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) * cleaning neutrum (i.e. llc_timer()). */ break; - + case PRC_RESET_REQUEST: - if (linkp == 0) + if (linkp == 0) panic("no link control block!"); i = splimp(); @@ -465,6 +465,6 @@ llc_ctlinput(int prc, struct sockaddr *addr, caddr_t info) break; } - + return 0; } diff --git a/sys/netccitt/llc_output.c b/sys/netccitt/llc_output.c index 64e595d..05cf9ae 100644 --- a/sys/netccitt/llc_output.c +++ b/sys/netccitt/llc_output.c @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)llc_output.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_output.c,v 1.2 1994/08/02 07:47:18 davidg Exp $ + * $Id: llc_output.c,v 1.3 1995/03/19 14:29:00 davidg Exp $ */ #include <sys/param.h> @@ -88,14 +88,14 @@ llc_start(struct llc_linkcb *linkp) int action; while ((LLC_STATEEQ(linkp, NORMAL) || LLC_STATEEQ(linkp, BUSY) || - LLC_STATEEQ(linkp, REJECT)) && - (linkp->llcl_slotsfree > 0) && + LLC_STATEEQ(linkp, REJECT)) && + (linkp->llcl_slotsfree > 0) && (LLC_GETFLAG(linkp, REMOTE_BUSY) == 0)) { LLC_DEQUEUE(linkp, m); if (m == NULL) break; LLC_SETFRAME(linkp, m); - (void)llc_statehandler(linkp, (struct llc *) 0, NL_DATA_REQUEST, + (void)llc_statehandler(linkp, (struct llc *) 0, NL_DATA_REQUEST, 0, 0); } } @@ -125,7 +125,7 @@ llc_send(struct llc_linkcb *linkp, int frame_kind, int cmdrsp, int pollfinal) return 0; } -/* +/* * llc_resend() --- llc_resend() retransmits all unacknowledged INFO frames. */ llc_resend(struct llc_linkcb *linkp, int cmdrsp, int pollfinal) @@ -140,16 +140,16 @@ llc_resend(struct llc_linkcb *linkp, int cmdrsp, int pollfinal) panic("llc: V(S) != N(R) received"); for (slot = llc_seq2slot(linkp, linkp->llcl_vs); - slot != linkp->llcl_freeslot; - LLC_INC(linkp->llcl_vs), + slot != linkp->llcl_freeslot; + LLC_INC(linkp->llcl_vs), slot = llc_seq2slot(linkp, linkp->llcl_vs)) { m = linkp->llcl_output_buffers[slot]; LLC_GETHDR(frame, m); - llc_rawsend(linkp, m, frame, LLCFT_INFO, linkp->llcl_vs, + llc_rawsend(linkp, m, frame, LLCFT_INFO, linkp->llcl_vs, cmdrsp, pollfinal); pollfinal = 0; } - + return 0; } @@ -225,7 +225,7 @@ llc_rawsend(struct llc_linkcb *linkp, struct mbuf *m, struct llc *frame, frame->llc_control = LLC_FRMR; /* get more space --- FRMR frame are longer then usual */ LLC_SETLEN(m, LLC_FRMRLEN); - bcopy((caddr_t) &linkp->llcl_frmrinfo, + bcopy((caddr_t) &linkp->llcl_frmrinfo, (caddr_t) &frame->llc_frmrinfo, sizeof(struct frmrinfo)); break; @@ -237,8 +237,8 @@ llc_rawsend(struct llc_linkcb *linkp, struct mbuf *m, struct llc *frame, m_freem(m); return; } - - /* + + /* * Fill in DSAP/SSAP */ frame->llc_dsap = frame->llc_ssap = LLSAPADDR(&linkp->llcl_addr); @@ -275,7 +275,7 @@ llc_rawsend(struct llc_linkcb *linkp, struct mbuf *m, struct llc *frame, } break; } - + if (adjust == LLC_UFRAMELEN) LLCSBITS(frame->llc_control, u_pf, pollfinal); else LLCSBITS(frame->llc_control_ext, s_pf, pollfinal); @@ -285,7 +285,7 @@ llc_rawsend(struct llc_linkcb *linkp, struct mbuf *m, struct llc *frame, */ ifp = linkp->llcl_if; if (frame_kind == LLCFT_INFO) { - /* + /* * send out a copy of the frame, retain the * original */ @@ -298,7 +298,7 @@ llc_rawsend(struct llc_linkcb *linkp, struct mbuf *m, struct llc *frame, * the output_buffers of the link. */ m_adj(m, LLC_ISFRAMELEN); - } else (*ifp->if_output)(ifp, m, + } else (*ifp->if_output)(ifp, m, rt_key(linkp->llcl_nlrt), linkp->llcl_nlrt); } diff --git a/sys/netccitt/llc_subr.c b/sys/netccitt/llc_subr.c index f38c575..9699be6 100644 --- a/sys/netccitt/llc_subr.c +++ b/sys/netccitt/llc_subr.c @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)llc_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: llc_subr.c,v 1.3 1994/12/13 22:32:14 wollman Exp $ + * $Id: llc_subr.c,v 1.4 1995/05/11 19:26:40 rgrimes Exp $ */ #include <sys/param.h> @@ -86,8 +86,8 @@ struct bitslice llc_bitslice[] = { }; /* - * We keep the link control blocks on a doubly linked list - - * primarily for checking in llc_time() + * We keep the link control blocks on a doubly linked list - + * primarily for checking in llc_time() */ struct llccb_q llccb_q = { &llccb_q, &llccb_q }; @@ -97,7 +97,7 @@ struct llccb_q llccb_q = { &llccb_q, &llccb_q }; * initialized yet. */ -int af_link_rts_init_done = 0; +int af_link_rts_init_done = 0; /* @@ -126,20 +126,20 @@ sdl_swapaddr(struct sockaddr_dl *sdl_a, struct sockaddr_dl *sdl_b) { struct sockaddr_dl sdl_tmp; - sdl_copy(sdl_a, &sdl_tmp); - sdl_copy(sdl_b, sdl_a); + sdl_copy(sdl_a, &sdl_tmp); + sdl_copy(sdl_b, sdl_a); sdl_copy(&sdl_tmp, sdl_b); } /* Fetch the sdl of the associated if */ -struct sockaddr_dl * +struct sockaddr_dl * sdl_getaddrif(struct ifnet *ifp) { register struct ifaddr *ifa; - for(ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) - if (ifa->ifa_addr->sa_family == AF_LINK ) + for(ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) + if (ifa->ifa_addr->sa_family == AF_LINK ) return((struct sockaddr_dl *)(ifa->ifa_addr)); return((struct sockaddr_dl *)0); @@ -151,27 +151,27 @@ sdl_checkaddrif(struct ifnet *ifp, struct sockaddr_dl *sdl_c) { register struct ifaddr *ifa; - for(ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) - if ((ifa->ifa_addr->sa_family == AF_LINK ) && + for(ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) + if ((ifa->ifa_addr->sa_family == AF_LINK ) && !sdl_cmp((struct sockaddr_dl *)(ifa->ifa_addr), sdl_c)) return(1); - + return(0); } /* Build an sdl from MAC addr, DLSAP addr, and interface */ -sdl_setaddrif(struct ifnet *ifp, u_char *mac_addr, u_char dlsap_addr, +sdl_setaddrif(struct ifnet *ifp, u_char *mac_addr, u_char dlsap_addr, u_char mac_len, struct sockaddr_dl *sdl_to) { register struct sockaddr_dl *sdl_tmp; - if ((sdl_tmp = sdl_getaddrif(ifp)) ) { - sdl_copy(sdl_tmp, sdl_to); + if ((sdl_tmp = sdl_getaddrif(ifp)) ) { + sdl_copy(sdl_tmp, sdl_to); bcopy((caddr_t) mac_addr, (caddr_t) LLADDR(sdl_to), mac_len); *(LLADDR(sdl_to)+mac_len) = dlsap_addr; - sdl_to->sdl_alen = mac_len+1; - return(1); + sdl_to->sdl_alen = mac_len+1; + return(1); } else return(0); } @@ -188,9 +188,9 @@ sdl_sethdrif(struct ifnet *ifp, u_char *mac_src, u_char dlsap_src, u_char *mac_d else return(1); } -static struct sockaddr_dl sap_saddr; +static struct sockaddr_dl sap_saddr; static struct sockaddr_dl sap_sgate = { - sizeof(struct sockaddr_dl), /* _len */ + sizeof(struct sockaddr_dl), /* _len */ AF_LINK /* _af */ }; @@ -200,61 +200,61 @@ static struct sockaddr_dl sap_sgate = { struct npaidbentry * llc_setsapinfo(struct ifnet *ifp, u_char af, u_char sap, struct dllconfig *llconf) { - struct protosw *pp; - struct sockaddr_dl *ifdl_addr; - struct rtentry *sirt = (struct rtentry *)0; - struct npaidbentry *sapinfo; - u_char saploc; + struct protosw *pp; + struct sockaddr_dl *ifdl_addr; + struct rtentry *sirt = (struct rtentry *)0; + struct npaidbentry *sapinfo; + u_char saploc; int size = sizeof(struct npaidbentry); USES_AF_LINK_RTS; - /* - * We rely/assume that only STREAM protocols will make use of - * connection oriented LLC2. If this will one day not be the - * case this will obviously fail. - */ - pp = pffindtype (af, SOCK_STREAM); - if (pp == 0 || pp->pr_input == 0 || pp->pr_ctlinput == 0) { - printf("network level protosw error"); - return 0; + /* + * We rely/assume that only STREAM protocols will make use of + * connection oriented LLC2. If this will one day not be the + * case this will obviously fail. + */ + pp = pffindtype (af, SOCK_STREAM); + if (pp == 0 || pp->pr_input == 0 || pp->pr_ctlinput == 0) { + printf("network level protosw error"); + return 0; } /* * We need a way to jot down the LLC2 configuration for - * a certain LSAP address. To do this we enter + * a certain LSAP address. To do this we enter * a "route" for the SAP. */ ifdl_addr = sdl_getaddrif(ifp); - sdl_copy(ifdl_addr, &sap_saddr); + sdl_copy(ifdl_addr, &sap_saddr); sdl_copy(ifdl_addr, &sap_sgate); - saploc = LLSAPLOC(&sap_saddr, ifp); + saploc = LLSAPLOC(&sap_saddr, ifp); sap_saddr.sdl_data[saploc] = sap; sap_saddr.sdl_alen++; - /* now enter it */ + /* now enter it */ rtrequest(RTM_ADD, (struct sockaddr *)&sap_saddr, - (struct sockaddr *)&sap_sgate, 0, 0, &sirt); - if (sirt == 0) + (struct sockaddr *)&sap_sgate, 0, 0, &sirt); + if (sirt == 0) return 0; /* Plug in config information in rt->rt_llinfo */ - sirt->rt_llinfo = malloc(size , M_PCB, M_WAITOK); - sapinfo = (struct npaidbentry *) sirt->rt_llinfo; - if (sapinfo) { - bzero ((caddr_t)sapinfo, size); - /* - * For the time being we support LLC CLASS II here - * only - */ - sapinfo->si_class = LLC_CLASS_II; + sirt->rt_llinfo = malloc(size , M_PCB, M_WAITOK); + sapinfo = (struct npaidbentry *) sirt->rt_llinfo; + if (sapinfo) { + bzero ((caddr_t)sapinfo, size); + /* + * For the time being we support LLC CLASS II here + * only + */ + sapinfo->si_class = LLC_CLASS_II; sapinfo->si_window = llconf->dllcfg_window; - sapinfo->si_trace = llconf->dllcfg_trace; + sapinfo->si_trace = llconf->dllcfg_trace; if (sapinfo->si_trace) llc_tracelevel--; else llc_tracelevel++; - sapinfo->si_input = pp->pr_input; + sapinfo->si_input = pp->pr_input; sapinfo->si_ctlinput = (caddr_t (*)())pp->pr_ctlinput; return (sapinfo); @@ -264,26 +264,26 @@ llc_setsapinfo(struct ifnet *ifp, u_char af, u_char sap, struct dllconfig *llcon } /* - * Get sapinfo for SAP address and interface + * Get sapinfo for SAP address and interface */ struct npaidbentry * llc_getsapinfo(u_char sap, struct ifnet *ifp) { - struct sockaddr_dl *ifdl_addr; - struct sockaddr_dl si_addr; - struct rtentry *sirt; + struct sockaddr_dl *ifdl_addr; + struct sockaddr_dl si_addr; + struct rtentry *sirt; u_char saploc; USES_AF_LINK_RTS; - ifdl_addr = sdl_getaddrif(ifp); - sdl_copy(ifdl_addr, &si_addr); - saploc = LLSAPLOC(&si_addr, ifp); + ifdl_addr = sdl_getaddrif(ifp); + sdl_copy(ifdl_addr, &si_addr); + saploc = LLSAPLOC(&si_addr, ifp); si_addr.sdl_data[saploc] = sap; si_addr.sdl_alen++; - if ((sirt = rtalloc1((struct sockaddr *)&si_addr, 0, 0UL))) - sirt->rt_refcnt--; + if ((sirt = rtalloc1((struct sockaddr *)&si_addr, 0, 0UL))) + sirt->rt_refcnt--; else return(0); return((struct npaidbentry *)sirt->rt_llinfo); @@ -305,8 +305,8 @@ llc_getsapinfo(u_char sap, struct ifnet *ifp) * The slot sl(sn) for any given sequence number sn is given by * * sl(sn) = (llcl_freeslot + llcl_window - 1 - (llcl_projvs + - * LLC_MAX_SEQUENCE- sn) % LLC_MAX_SEQUENCE) % - * llcl_window + * LLC_MAX_SEQUENCE- sn) % LLC_MAX_SEQUENCE) % + * llcl_window * * i.e. we first calculate the number of frames we need to ``go back'' * from the current one (really the next one, but that doesn't matter as @@ -319,8 +319,8 @@ llc_seq2slot(struct llc_linkcb *linkp, short seqn) { register sn = 0; - sn = (linkp->llcl_freeslot + linkp->llcl_window - - (linkp->llcl_projvs + LLC_MAX_SEQUENCE - seqn) % + sn = (linkp->llcl_freeslot + linkp->llcl_window - + (linkp->llcl_projvs + LLC_MAX_SEQUENCE - seqn) % LLC_MAX_SEQUENCE) % linkp->llcl_window; return sn; @@ -331,10 +331,10 @@ llc_seq2slot(struct llc_linkcb *linkp, short seqn) * * There is in most cases one function per LLC2 state. The LLC2 standard * ISO 8802-2 allows in some cases for ambiguities, i.e. we have the choice - * to do one thing or the other. Right now I have just chosen one but have also - * indicated the spot by "multiple possibilities". One could make the behavior + * to do one thing or the other. Right now I have just chosen one but have also + * indicated the spot by "multiple possibilities". One could make the behavior * in those cases configurable, allowing the superuser to enter a profile word - * (32/64 bits, whatever is needed) that would suit her needs [I quite like + * (32/64 bits, whatever is needed) that would suit her needs [I quite like * that idea, perhaps I'll get around to it]. * * [Preceeding each state handler function is the description as taken from @@ -364,7 +364,7 @@ llc_state_ADM(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_NEWSTATE(linkp, SETUP); break; case LLCFT_SABME + LLC_CMD: - /* + /* * ISO 8802-2, table 7-1, ADM state says to set * the P flag, yet this will cause an SABME [P] to be * answered with an UA only, not an UA [F], all @@ -378,7 +378,7 @@ llc_state_ADM(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, llc_send(linkp, LLCFT_DM, LLC_RSP, pollfinal); break; default: - if (cmdrsp == LLC_CMD && pollfinal == 1) + if (cmdrsp == LLC_CMD && pollfinal == 1) llc_send(linkp, LLCFT_DM, LLC_RSP, 1); /* remain in ADM state */ } @@ -424,7 +424,7 @@ llc_state_CONN(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, /* * RESET_WAIT --- The local connection component is waiting for the local user - * to indicate a RESET_REQUEST or a DISCONNECT_REQUEST. + * to indicate a RESET_REQUEST or a DISCONNECT_REQUEST. */ int llc_state_RESET_WAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, @@ -441,7 +441,7 @@ llc_state_RESET_WAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind linkp->llcl_retry = 0; LLC_NEWSTATE(linkp, RESET); } else { - llc_send(linkp, LLCFT_UA, LLC_RSP, + llc_send(linkp, LLCFT_UA, LLC_RSP, LLC_GETFLAG(linkp, F)); LLC_RESETCOUNTER(linkp); LLC_SETFLAG(linkp, P, 0); @@ -458,7 +458,7 @@ llc_state_RESET_WAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind linkp->llcl_retry = 0; LLC_NEWSTATE(linkp, D_CONN); } else { - llc_send(linkp, LLCFT_DM, LLC_RSP, + llc_send(linkp, LLCFT_DM, LLC_RSP, LLC_GETFLAG(linkp, F)); LLC_NEWSTATE(linkp, ADM); } @@ -682,7 +682,7 @@ llc_state_D_CONN(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, /* * ERROR --- The local connection component has detected an error in a received - * PDU and has sent a FRMR response PDU. It is waiting for a reply from + * PDU and has sent a FRMR response PDU. It is waiting for a reply from * the remote connection component. */ int @@ -790,7 +790,7 @@ llc_state_NBRAcore(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; case LLC_INVALID_NR + LLC_CMD: case LLC_INVALID_NS + LLC_CMD: - LLC_SETFRMR(linkp, frame, cmdrsp, + LLC_SETFRMR(linkp, frame, cmdrsp, (frame_kind == LLC_INVALID_NR ? LLC_FRMR_Z : (LLC_FRMR_V | LLC_FRMR_W))); llc_send(linkp, LLCFT_FRMR, LLC_RSP, pollfinal); @@ -821,7 +821,7 @@ llc_state_NBRAcore(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; } default: - if (cmdrsp == LLC_RSP && pollfinal == 1 && + if (cmdrsp == LLC_RSP && pollfinal == 1 && LLC_GETFLAG(linkp, P) == 0) { LLC_SETFRMR(linkp, frame, cmdrsp, LLC_FRMR_W); LLC_STOP_ALL_TIMERS(linkp); @@ -869,7 +869,7 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, if (LLC_TIMERXPIRED(linkp, ACK) != LLC_TIMER_RUNNING) LLC_START_ACK_TIMER(linkp); } else { -#endif +#endif /* multiple possibilities */ llc_send(linkp, LLCFT_INFO, LLC_CMD, 0); if (LLC_TIMERXPIRED(linkp, ACK) != LLC_TIMER_RUNNING) @@ -889,12 +889,12 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_SETFLAG(linkp, DATA, 0); LLC_NEWSTATE(linkp, BUSY); action = 0; - } else { + } else { /* multiple possibilities --- CMD/RSP-wise */ llc_send(linkp, LLCFT_RNR, LLC_CMD, 0); LLC_SETFLAG(linkp, DATA, 0); LLC_NEWSTATE(linkp, BUSY); - action = 0; + action = 0; } break; case LLC_INVALID_NS + LLC_CMD: @@ -914,7 +914,7 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_START_REJ_TIMER(linkp); LLC_NEWSTATE(linkp, REJECT); action = 0; - } else if ((pollfinal == 0 && p == 0) || + } else if ((pollfinal == 0 && p == 0) || (pollfinal == 1 && p == 1 && cmdrsp == LLC_RSP)) { llc_send(linkp, LLCFT_REJ, LLC_CMD, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -926,12 +926,12 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_NEWSTATE(linkp, REJECT); } break; - } + } case LLCFT_INFO + LLC_CMD: case LLCFT_INFO + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { LLC_INC(linkp->llcl_vr); LLC_SENDACKNOWLEDGE(linkp, LLC_RSP, 1); @@ -948,7 +948,7 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_SENDACKNOWLEDGE(linkp, LLC_CMD, 0); LLC_UPDATE_NR_RECEIVED(linkp, nr); - if (cmdrsp == LLC_RSP && pollfinal == 1) + if (cmdrsp == LLC_RSP && pollfinal == 1) LLC_CLEAR_REMOTE_BUSY(linkp, action); action = LLC_DATA_INDICATION; } @@ -963,24 +963,24 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_SENDACKNOWLEDGE(linkp, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_CLEAR_REMOTE_BUSY(linkp, action); - } else if ((pollfinal == 0) || + } else if ((pollfinal == 0) || (cmdrsp == LLC_RSP && pollfinal == 1 && p == 1)) { LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_CLEAR_REMOTE_BUSY(linkp, action); - } + } break; } case LLCFT_RNR + LLC_CMD: case LLCFT_RNR + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_SET_REMOTE_BUSY(linkp, action); - } else if ((pollfinal == 0) || + } else if ((pollfinal == 0) || (cmdrsp == LLC_RSP && pollfinal == 1 && p == 1)) { LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1031,7 +1031,7 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; case LLC_ACK_TIMER_EXPIRED: case LLC_BUSY_TIMER_EXPIRED: - if ((LLC_GETFLAG(linkp, P) == 0) + if ((LLC_GETFLAG(linkp, P) == 0) && (linkp->llcl_retry < llc_n2)) { llc_send(linkp, LLCFT_RR, LLC_CMD, 1); LLC_START_P_TIMER(linkp); @@ -1042,7 +1042,7 @@ llc_state_NORMAL(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1082,7 +1082,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, register int df = LLC_GETFLAG(linkp, DATA); switch (df) { - case 1: + case 1: if (p == 0) { /* multiple possibilities */ llc_send(linkp, LLCFT_REJ, LLC_CMD, 1); @@ -1142,7 +1142,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, llc_send(linkp, LLCFT_RNR, LLC_CMD, 0); LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_UPDATE_NR_RECEIVED(linkp, nr); - if (LLC_GETFLAG(linkp, DATA) == 0) + if (LLC_GETFLAG(linkp, DATA) == 0) LLC_SETFLAG(linkp, DATA, 1); if (cmdrsp == LLC_RSP && pollfinal == 1) { LLC_CLEAR_REMOTE_BUSY(linkp, action); @@ -1160,7 +1160,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLCFT_INFO + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { LLC_INC(linkp->llcl_vr); llc_send(linkp, LLCFT_RNR, LLC_RSP, 1); @@ -1168,7 +1168,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, if (LLC_GETFLAG(linkp, DATA) == 2) LLC_STOP_REJ_TIMER(linkp); LLC_SETFLAG(linkp, DATA, 0); - action = LLC_DATA_INDICATION; + action = LLC_DATA_INDICATION; } else if ((cmdrsp == LLC_CMD && pollfinal == 0 && p == 0) || (cmdrsp == LLC_RSP && pollfinal == p)) { LLC_INC(linkp->llcl_vr); @@ -1192,12 +1192,12 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; } case LLCFT_RR + LLC_CMD: - case LLCFT_RR + LLC_RSP: + case LLCFT_RR + LLC_RSP: case LLCFT_RNR + LLC_CMD: - case LLCFT_RNR + LLC_RSP: { + case LLCFT_RNR + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RNR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1206,7 +1206,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, } else { LLC_SET_REMOTE_BUSY(linkp, action); } - } else if (pollfinal = 0 || + } else if (pollfinal = 0 || (cmdrsp == LLC_RSP && pollfinal == 1)) { LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1272,7 +1272,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, } break; case LLC_REJ_TIMER_EXPIRED: - if (linkp->llcl_retry < llc_n2) + if (linkp->llcl_retry < llc_n2) if (LLC_GETFLAG(linkp, P) == 0) { /* multiple possibilities */ llc_send(linkp, LLCFT_RNR, LLC_CMD, 1); @@ -1286,11 +1286,11 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_NEWSTATE(linkp, BUSY); action = 0; } - + break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1303,7 +1303,7 @@ llc_state_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, * component resend a specific I PDU that the local connection * componnent has detected as being out of sequence. Both I PDUs and * supervisory PDUs may be sent and received. - */ + */ int llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, int cmdrsp, int pollfinal) @@ -1319,7 +1319,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_START_ACK_TIMER(linkp); LLC_NEWSTATE(linkp, REJECT); action = 0; - } else { + } else { llc_send(linkp, LLCFT_INFO, LLC_CMD, 0); if (LLC_TIMERXPIRED(linkp, ACK) != LLC_TIMER_RUNNING) LLC_START_ACK_TIMER(linkp); @@ -1342,7 +1342,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, } break; case LLC_INVALID_NS + LLC_CMD: - case LLC_INVALID_NS + LLC_RSP: { + case LLC_INVALID_NS + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); @@ -1350,7 +1350,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); action = 0; - } else if (pollfinal == 0 || + } else if (pollfinal == 0 || (cmdrsp == LLC_RSP && pollfinal == 1 && p == 1)) { LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); @@ -1364,7 +1364,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLCFT_INFO + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { LLC_INC(linkp->llcl_vr); LLC_SENDACKNOWLEDGE(linkp, LLC_RSP, 1); @@ -1401,7 +1401,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_SENDACKNOWLEDGE(linkp, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_CLEAR_REMOTE_BUSY(linkp, action); - } else if (pollfinal == 0 || + } else if (pollfinal == 0 || (cmdrsp == LLC_RSP && pollfinal == 1 && p == 1)) { LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1413,7 +1413,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLCFT_RNR + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1483,7 +1483,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, LLC_START_P_TIMER(linkp); LLC_START_REJ_TIMER(linkp); linkp->llcl_retry++; - /* + /* * I cannot locate the description of RESET_V(S) * in ISO 8802-2, table 7-1, state REJECT, last event, * and assume they meant to set V(S) to 0 ... @@ -1496,7 +1496,7 @@ llc_state_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1527,7 +1527,7 @@ llc_state_AWAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLC_INVALID_NS + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_REJ, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1556,7 +1556,7 @@ llc_state_AWAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLCFT_INFO + LLC_CMD: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + LLC_INC(linkp->llcl_vr); if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); @@ -1583,7 +1583,7 @@ llc_state_AWAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, case LLCFT_REJ + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1598,7 +1598,7 @@ llc_state_AWAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, } else if (pollfinal == 0) { LLC_UPDATE_NR_RECEIVED(linkp, nr); LLC_CLEAR_REMOTE_BUSY(linkp, action); - } + } break; } case LLCFT_RNR + LLC_CMD: @@ -1632,7 +1632,7 @@ llc_state_AWAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1707,7 +1707,7 @@ llc_state_AWAIT_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind case LLCFT_INFO + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RNR, LLC_RSP, 1); LLC_INC(linkp->llcl_vr); @@ -1740,7 +1740,7 @@ llc_state_AWAIT_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind case LLCFT_REJ + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RNR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1765,7 +1765,7 @@ llc_state_AWAIT_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind case LLCFT_RNR + LLC_RSP: { register int p = LLC_GETFLAG(linkp, P); register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RNR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1792,7 +1792,7 @@ llc_state_AWAIT_BUSY(struct llc_linkcb *linkp, struct llc *frame, int frame_kind break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1827,7 +1827,7 @@ llc_state_AWAIT_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_ki case LLC_INVALID_NS + LLC_CMD: case LLC_INVALID_NS + LLC_RSP: { register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1841,7 +1841,7 @@ llc_state_AWAIT_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_ki LLC_NEWSTATE(linkp, REJECT); } else if (pollfinal == 0) { LLC_UPDATE_NR_RECEIVED(linkp, nr); - action = 0; + action = 0; } break; } @@ -1881,7 +1881,7 @@ llc_state_AWAIT_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_ki case LLCFT_RR + LLC_RSP: case LLCFT_REJ + LLC_RSP: { register int nr = LLCGBITS(frame->llc_control_ext, s_nr); - + if (cmdrsp == LLC_CMD && pollfinal == 1) { llc_send(linkp, LLCFT_RR, LLC_RSP, 1); LLC_UPDATE_NR_RECEIVED(linkp, nr); @@ -1929,7 +1929,7 @@ llc_state_AWAIT_REJECT(struct llc_linkcb *linkp, struct llc *frame, int frame_ki break; } if (action == LLC_PASSITON) - action = llc_state_NBRAcore(linkp, frame, frame_kind, + action = llc_state_NBRAcore(linkp, frame, frame_kind, cmdrsp, pollfinal); return action; @@ -1958,7 +1958,7 @@ llc_statehandler(struct llc_linkcb *linkp, struct llc *frame, int frame_kind, /* * Now call the current statehandler function. */ - action = (*linkp->llcl_statehandler)(linkp, frame, frame_kind, + action = (*linkp->llcl_statehandler)(linkp, frame, frame_kind, cmdrsp, pollfinal); once_more_and_again: switch (action) { @@ -1966,7 +1966,7 @@ once_more_and_again: int naction; LLC_TRACE(linkp, LLCTR_INTERESTING, "CONNECT INDICATION"); - linkp->llcl_nlnext = + linkp->llcl_nlnext = (*linkp->llcl_sapinfo->si_ctlinput) (PRC_CONNECT_INDICATION, (struct sockaddr *) &linkp->llcl_addr, (caddr_t) linkp); @@ -1983,7 +1983,7 @@ once_more_and_again: case LLC_DISCONNECT_INDICATION: LLC_TRACE(linkp, LLCTR_INTERESTING, "DISCONNECT INDICATION"); (*linkp->llcl_sapinfo->si_ctlinput) - (PRC_DISCONNECT_INDICATION, + (PRC_DISCONNECT_INDICATION, (struct sockaddr *) &linkp->llcl_addr, linkp->llcl_nlnext); break; /* internally visible only */ @@ -1996,7 +1996,7 @@ once_more_and_again: break; case LLC_RESET_INDICATION_REMOTE: LLC_TRACE(linkp, LLCTR_SHOULDKNOW, "RESET INDICATION (REMOTE)"); - action = (*linkp->llcl_statehandler)(linkp, frame, + action = (*linkp->llcl_statehandler)(linkp, frame, NL_RESET_RESPONSE, 0, 0); goto once_more_and_again; case LLC_FRMR_SENT: @@ -2006,7 +2006,7 @@ once_more_and_again: LLC_TRACE(linkp, LLCTR_URGEN, "FRMR RECEIVED"); action = (*linkp->llcl_statehandler)(linkp, frame, NL_RESET_REQUEST, 0, 0); - + goto once_more_and_again; case LLC_REMOTE_BUSY: LLC_TRACE(linkp, LLCTR_SHOULDKNOW, "REMOTE BUSY"); @@ -2018,12 +2018,12 @@ once_more_and_again: */ llc_start(linkp); break; - } + } /* * Only LLC_DATA_INDICATION is for the time being * passed up to the network layer entity. - * The remaining action codes are for the time + * The remaining action codes are for the time * being visible internally only. * However, this can/may be changed if necessary. */ @@ -2034,7 +2034,7 @@ once_more_and_again: /* * Core LLC2 routines - */ + */ /* * The INIT call. This routine is called once after the system is booted. @@ -2061,8 +2061,8 @@ llc_resetwindow(struct llc_linkcb *linkp) /* Pick up all queued frames and collect them in a linked mbuf list */ if (linkp->llcl_slotsfree != linkp->llcl_window) { i = llc_seq2slot(linkp, linkp->llcl_nr_received); - anchor = mptr = linkp->llcl_output_buffers[i]; - for (; i != linkp->llcl_freeslot; + anchor = mptr = linkp->llcl_output_buffers[i]; + for (; i != linkp->llcl_freeslot; i = llc_seq2slot(linkp, i+1)) { if (linkp->llcl_output_buffers[i]) { mptr->m_nextpkt = linkp->llcl_output_buffers[i]; @@ -2083,7 +2083,7 @@ llc_resetwindow(struct llc_linkcb *linkp) } linkp->llcl_freeslot = i; } else linkp->llcl_freeslot = 0; - + /* We're resetting the link, the next frame to be acknowledged is 0 */ linkp->llcl_nr_received = 0; @@ -2092,14 +2092,14 @@ llc_resetwindow(struct llc_linkcb *linkp) return; } - + /* * llc_newlink() --- We allocate enough memory to contain a link control block * and initialize it properly. We don't intiate the actual setup * of the LLC2 link here. */ struct llc_linkcb * -llc_newlink(struct sockaddr_dl *dst, struct ifnet *ifp, struct rtentry *nlrt, +llc_newlink(struct sockaddr_dl *dst, struct ifnet *ifp, struct rtentry *nlrt, caddr_t nlnext, struct rtentry *llrt) { struct llc_linkcb *nlinkp; @@ -2113,7 +2113,7 @@ llc_newlink(struct sockaddr_dl *dst, struct ifnet *ifp, struct rtentry *nlrt, if (nlinkp == 0) return (NULL); bzero((caddr_t)nlinkp, sizeof(struct llc_linkcb)); - + /* copy link address */ sdl_copy(dst, &nlinkp->llcl_addr); @@ -2131,7 +2131,7 @@ llc_newlink(struct sockaddr_dl *dst, struct ifnet *ifp, struct rtentry *nlrt, /* setup initial state handler function */ nlinkp->llcl_statehandler = llc_state_ADM; - + /* hold on to interface pointer */ nlinkp->llcl_if = ifp; @@ -2143,13 +2143,13 @@ llc_newlink(struct sockaddr_dl *dst, struct ifnet *ifp, struct rtentry *nlrt, llcwindow = LLC_MAX_WINDOW; /* allocate memory for window buffer */ - MALLOC(nlinkp->llcl_output_buffers, struct mbuf **, + MALLOC(nlinkp->llcl_output_buffers, struct mbuf **, llcwindow*sizeof(struct mbuf *), M_PCB, M_DONTWAIT); if (nlinkp->llcl_output_buffers == 0) { FREE(nlinkp, M_PCB); return(NULL); } - bzero((caddr_t)nlinkp->llcl_output_buffers, + bzero((caddr_t)nlinkp->llcl_output_buffers, llcwindow*sizeof(struct mbuf *)); /* set window size & slotsfree */ @@ -2174,12 +2174,12 @@ llc_dellink(struct llc_linkcb *linkp) /* notify upper layer of imminent death */ if (linkp->llcl_nlnext && sapinfo->si_ctlinput) (*sapinfo->si_ctlinput) - (PRC_DISCONNECT_INDICATION, + (PRC_DISCONNECT_INDICATION, (struct sockaddr *)&linkp->llcl_addr, linkp->llcl_nlnext); /* pull the plug */ if (linkp->llcl_llrt) - ((struct npaidbentry *)(linkp->llcl_llrt->rt_llinfo))->np_link + ((struct npaidbentry *)(linkp->llcl_llrt->rt_llinfo))->np_link = (struct llc_linkcb *) 0; /* leave link control block queue */ @@ -2249,7 +2249,7 @@ llc_decode(struct llc* frame, struct llc_linkcb * linkp) case LLCFT_RNR: case LLCFT_REJ: /* splash! */ - if (LLC_NR_VALID(linkp, LLCGBITS(frame->llc_control_ext, + if (LLC_NR_VALID(linkp, LLCGBITS(frame->llc_control_ext, s_nr)) == 0) ft = LLC_INVALID_NR; break; @@ -2266,7 +2266,7 @@ int llc_anytimersup(struct llc_linkcb * linkp) { register int i; - + FOR_ALL_LLC_TIMERS(i) if (linkp->llcl_timers[i] > 0) break; @@ -2313,7 +2313,7 @@ llc_link_dump(struct llc_linkcb* linkp, const char *message) /* print interface */ printf("if %s%d\n", linkp->llcl_if->if_name, linkp->llcl_if->if_unit); - + /* print message */ printf(">> %s <<\n", message); @@ -2327,16 +2327,16 @@ llc_link_dump(struct llc_linkcb* linkp, const char *message) /* print state we're in and timers */ printf("state %s, ", llc_getstatename(linkp)); for (i = LLC_ACK_SHIFT; i < LLC_AGE_SHIFT; i++) - printf("%s-%c %d/", timer_names[i], + printf("%s-%c %d/", timer_names[i], (linkp->llcl_timerflags & (1<<i) ? 'R' : 'S'), linkp->llcl_timers[i]); - printf("%s-%c %d\n", timer_names[i], (linkp->llcl_timerflags & (1<<i) ? + printf("%s-%c %d\n", timer_names[i], (linkp->llcl_timerflags & (1<<i) ? 'R' : 'S'), linkp->llcl_timers[i]); /* print flag values */ printf("flags P %d/F %d/S %d/DATA %d/REMOTE_BUSY %d\n", LLC_GETFLAG(linkp, P), LLC_GETFLAG(linkp, F), - LLC_GETFLAG(linkp, S), + LLC_GETFLAG(linkp, S), LLC_GETFLAG(linkp, DATA), LLC_GETFLAG(linkp, REMOTE_BUSY)); /* print send and receive state variables, ack, and window */ diff --git a/sys/netccitt/llc_timer.c b/sys/netccitt/llc_timer.c index 06d3cf3..0714d51 100644 --- a/sys/netccitt/llc_timer.c +++ b/sys/netccitt/llc_timer.c @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)llc_timer.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: llc_timer.c,v 1.2 1994/08/02 07:47:23 davidg Exp $ */ #include <sys/param.h> @@ -147,8 +147,8 @@ llc_timer() } break; } - /* - * Now, check all the ISO 8802-2 timers + /* + * Now, check all the ISO 8802-2 timers */ FOR_ALL_LLC_TIMERS(timer) { action = 0; @@ -173,7 +173,7 @@ llc_timer() } else if (linkp->llcl_timers[timer] > 0) linkp->llcl_timers[timer]--; } - + gone: linkp = nlinkp; } } diff --git a/sys/netccitt/llc_var.h b/sys/netccitt/llc_var.h index f5452c1..6de1aa2 100644 --- a/sys/netccitt/llc_var.h +++ b/sys/netccitt/llc_var.h @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)llc_var.h 8.1 (Berkeley) 6/10/93 - * $Id: llc_var.h,v 1.2 1994/08/02 07:47:25 davidg Exp $ + * $Id: llc_var.h,v 1.3 1994/08/21 05:44:08 paul Exp $ */ #ifndef _NETCCITT_LLC_VAR_H_ @@ -69,9 +69,9 @@ struct npaidbentry { u_short SI_window; u_short SI_trace; u_short SI_xchxid; - void (*SI_input) + void (*SI_input) __P((struct mbuf *)); - caddr_t (*SI_ctlinput) + caddr_t (*SI_ctlinput) __P((int, struct sockaddr *, caddr_t)); } SI; } NESIun; @@ -126,9 +126,9 @@ extern struct bitslice llc_bitslice[]; /* * LLC events --- These events may either be frames received from the - * remote LLC DSAP, request from the network layer user, + * remote LLC DSAP, request from the network layer user, * timer events from llc_timer(), or diagnostic events from - * llc_input(). + * llc_input(). */ /* LLC frame types */ @@ -159,26 +159,26 @@ extern struct bitslice llc_bitslice[]; #define LLC_LOCAL_BUSY_CLEARED 20 * LLC_MAXCMDRSP /* Network layer user requests */ -/* +/* * NL_CONNECT_REQUEST --- The user has requested that a data link connection * be established with a remote LLC DSAP. */ #define NL_CONNECT_REQUEST 21 * LLC_MAXCMDRSP -/* +/* * NL_CONNECT_RESPONSE --- The user has accepted the data link connection. */ #define NL_CONNECT_RESPONSE 22 * LLC_MAXCMDRSP -/* +/* * NL_RESET_REQUEST --- The user has requested that the data link with the * remote LLC DSAP be reset. */ #define NL_RESET_REQUEST 23 * LLC_MAXCMDRSP -/* +/* * NL_RESET_RESPONSE --- The user has accepted the reset of the data link * connection. */ #define NL_RESET_RESPONSE 24 * LLC_MAXCMDRSP -/* +/* * NL_DISCONNECT_REQUEST --- The user has requested that the data link * connection with remote LLC DSAP be terminated. */ @@ -266,12 +266,12 @@ extern struct bitslice llc_bitslice[]; #define INFORMATION_CONTROL 0x00 #define SUPERVISORY_CONTROL 0x02 -#define UNUMBERED_CONTROL 0x03 - +#define UNUMBERED_CONTROL 0x03 + /* * Other necessary definitions */ - + #define LLC_MAX_SEQUENCE 128 #define LLC_MAX_WINDOW 127 #define LLC_WINDOW_SIZE 7 @@ -440,7 +440,7 @@ struct sdl_hdr { /* * LLC2 macro definitions */ - + #define LLC_START_ACK_TIMER(l) LLC_STARTTIMER((l), ACK) #define LLC_STOP_ACK_TIMER(l) LLC_STOPTIMER((l), ACK) @@ -568,7 +568,7 @@ struct sdl_hdr { #else /* LLCDEBUG */ #define LLC_TRACE(lp, l, msg) /* NOOP */ #endif /* LLCDEBUG */ - + #define LLC_N2_VALUE 15 /* up to 15 retries */ #define LLC_ACK_TIMER 10 /* 5 secs */ #define LLC_P_TIMER 4 /* 2 secs */ @@ -600,16 +600,16 @@ struct ifqueue llcintrq; extern struct llccb_q llccb_q; extern char *frame_names[]; -/* +/* * Function prototypes */ int sdl_cmp __P((struct sockaddr_dl *, struct sockaddr_dl *)); int sdl_copy __P((struct sockaddr_dl *, struct sockaddr_dl *)); int sdl_swapaddr __P((struct sockaddr_dl *, struct sockaddr_dl *)); int sdl_checkaddrif __P((struct ifnet *, struct sockaddr_dl *)); -int sdl_setaddrif __P((struct ifnet *, u_char *, u_char, u_char, +int sdl_setaddrif __P((struct ifnet *, u_char *, u_char, u_char, struct sockaddr_dl *)); -int sdl_sethdrif __P((struct ifnet *, u_char *, u_char, u_char *, u_char, u_char, +int sdl_sethdrif __P((struct ifnet *, u_char *, u_char, u_char *, u_char, u_char, struct sdl_hdr *)); struct npaidbentry *llc_setsapinfo __P((struct ifnet *, u_char, u_char, struct dllconfig *)); @@ -619,9 +619,9 @@ int npaidb_destroy __P((struct rtentry *)); short llc_seq2slot __P((struct llc_linkcb *, short)); int llc_state_ADM __P((struct llc_linkcb *, struct llc *, int, int, int)); int llc_state_CONN __P((struct llc_linkcb *, struct llc *, int, int, int)); -int llc_state_RESET_WAIT __P((struct llc_linkcb *, struct llc *, +int llc_state_RESET_WAIT __P((struct llc_linkcb *, struct llc *, int, int, int)); -int llc_state_RESET_CHECK __P((struct llc_linkcb *, struct llc *, +int llc_state_RESET_CHECK __P((struct llc_linkcb *, struct llc *, int, int, int)); int llc_state_SETUP __P((struct llc_linkcb *, struct llc *, int, int, int)); int llc_state_RESET __P((struct llc_linkcb *, struct llc *, int, int, int)); @@ -636,7 +636,7 @@ int llc_state_AWAIT_BUSY __P((struct llc_linkcb *, struct llc *, int, int, int)) int llc_state_AWAIT_REJECT __P((struct llc_linkcb *, struct llc *, int, int, int)); int llc_statehandler __P((struct llc_linkcb *, struct llc *, int, int, int)); int llc_init __P((void)); -struct llc_linkcb *llc_newlink __P((struct sockaddr_dl *, struct ifnet *, +struct llc_linkcb *llc_newlink __P((struct sockaddr_dl *, struct ifnet *, struct rtentry *, caddr_t, struct rtentry *)); int llc_dellink __P((struct llc_linkcb *)); int llc_anytimersup __P((struct llc_linkcb *)); diff --git a/sys/netccitt/pk.h b/sys/netccitt/pk.h index a1f8ebb..50b9b09 100644 --- a/sys/netccitt/pk.h +++ b/sys/netccitt/pk.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)pk.h 8.1 (Berkeley) 6/10/93 - * $Id: pk.h,v 1.2 1994/08/02 07:47:27 davidg Exp $ + * $Id: pk.h,v 1.3 1994/08/21 05:44:09 paul Exp $ */ #ifndef _NETCCITT_PK_H_ @@ -51,22 +51,22 @@ /* Packet type identifier field defintions. */ #define X25_CALL 11 -#define X25_CALL_ACCEPTED 15 +#define X25_CALL_ACCEPTED 15 #define X25_CLEAR 19 -#define X25_CLEAR_CONFIRM 23 -#define X25_DATA 0 -#define X25_INTERRUPT 35 -#define X25_INTERRUPT_CONFIRM 39 +#define X25_CLEAR_CONFIRM 23 +#define X25_DATA 0 +#define X25_INTERRUPT 35 +#define X25_INTERRUPT_CONFIRM 39 -#define X25_RR 1 -#define X25_RNR 5 +#define X25_RR 1 +#define X25_RNR 5 #define X25_REJECT 9 -#define X25_RESET 27 -#define X25_RESET_CONFIRM 31 +#define X25_RESET 27 +#define X25_RESET_CONFIRM 31 #define X25_DIAGNOSTIC 241 -#define X25_RESTART 251 -#define X25_RESTART_CONFIRM 255 +#define X25_RESTART 251 +#define X25_RESTART_CONFIRM 255 /* Restart cause field definitions. */ @@ -176,7 +176,7 @@ struct mbuf *pk_template (); /* * The following definitions are used in a switch statement after * determining the packet type. These values are returned by the - * pk_decode procedure. + * pk_decode procedure. */ #define CALL 0 * MAXSTATES diff --git a/sys/netccitt/pk_acct.c b/sys/netccitt/pk_acct.c index e05cf69..d3ba5bc 100644 --- a/sys/netccitt/pk_acct.c +++ b/sys/netccitt/pk_acct.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)pk_acct.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: pk_acct.c,v 1.2 1994/08/02 07:47:29 davidg Exp $ */ #include <sys/param.h> @@ -58,7 +58,7 @@ struct vnode *pkacctp; -/* +/* * Turn on packet accounting */ @@ -90,7 +90,7 @@ pk_accton (path) return (error); } -/* +/* * Write a record on the accounting file. */ diff --git a/sys/netccitt/pk_input.c b/sys/netccitt/pk_input.c index 9f24c3d..777de53 100644 --- a/sys/netccitt/pk_input.c +++ b/sys/netccitt/pk_input.c @@ -1,6 +1,6 @@ /* * Copyright (c) University of British Columbia, 1984 - * Copyright (C) Computer Science Department IV, + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1992 * Copyright (c) 1991, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_input.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_input.c,v 1.3 1994/12/13 22:32:15 wollman Exp $ + * $Id: pk_input.c,v 1.4 1995/05/11 00:13:14 wollman Exp $ */ #include <sys/param.h> @@ -143,7 +143,7 @@ register struct pkcb *pkp; { register int i; register struct protosw *pp; - + /* * Essentially we have the choice to * (a) go ahead and let the route be deleted and @@ -154,7 +154,7 @@ register struct pkcb *pkp; * * For the time being we stick with (b) */ - + for (i = 1; i < pkp -> pk_maxlcn; ++i) if (pkp -> pk_chan[i]) pk_disconnect (pkp -> pk_chan[i]); @@ -181,14 +181,14 @@ register struct pkcb *pkp; remque (pkp); if (pkp -> pk_rt -> rt_llinfo == (caddr_t) pkp) pkp -> pk_rt -> rt_llinfo = (caddr_t) NULL; - + /* * Tell the link level that the pkcb is dissolving */ if (pp -> pr_ctlinput && pkp -> pk_llnext) { ctlinfo.dlcti_pcb = pkp -> pk_llnext; ctlinfo.dlcti_rt = pkp -> pk_rt; - (pp -> pr_ctlinput)(PRC_DISCONNECT_REQUEST, + (pp -> pr_ctlinput)(PRC_DISCONNECT_REQUEST, pkp -> pk_xcp, &ctlinfo); } free ((caddr_t) pkp -> pk_chan, M_IFADDR); @@ -237,9 +237,9 @@ register struct pkcb *pkp; return 0; } -/* +/* * This procedure is called by the link level whenever the link - * becomes operational, is reset, or when the link goes down. + * becomes operational, is reset, or when the link goes down. */ /*VARARGS*/ caddr_t @@ -250,27 +250,27 @@ pk_ctlinput (code, src, addr) register struct pkcb *pkp = (struct pkcb *) addr; switch (code) { - case PRC_LINKUP: + case PRC_LINKUP: if (pkp -> pk_state == DTE_WAITING) pk_restart (pkp, X25_RESTART_NETWORK_CONGESTION); break; - case PRC_LINKDOWN: + case PRC_LINKDOWN: pk_restart (pkp, -1); /* Clear all active circuits */ pkp -> pk_state = DTE_WAITING; break; - case PRC_LINKRESET: + case PRC_LINKRESET: pk_restart (pkp, X25_RESTART_NETWORK_CONGESTION); break; - + case PRC_CONNECT_INDICATION: { struct rtentry *llrt; if ((llrt = rtalloc1(src, 0, 0UL)) == 0) return 0; else llrt -> rt_refcnt--; - + pkp = (((struct npaidbentry *) llrt -> rt_llinfo) -> np_rt) ? (struct pkcb *)(((struct npaidbentry *) llrt -> rt_llinfo) -> np_rt -> rt_llinfo) : (struct pkcb *) 0; if (pkp == (struct pkcb *) 0) @@ -315,7 +315,7 @@ pkintr () } struct mbuf *pk_bad_packet; struct mbuf_cache pk_input_cache = {0 }; -/* +/* * X.25 PACKET INPUT * * This procedure is called by a link level procedure whenever @@ -355,9 +355,9 @@ register struct mbuf *m; lcn = LCN(xp); lcp = pkp -> pk_chan[lcn]; - /* - * If the DTE is in Restart state, then it will ignore data, - * interrupt, call setup and clearing, flow control and reset + /* + * If the DTE is in Restart state, then it will ignore data, + * interrupt, call setup and clearing, flow control and reset * packets. */ if (lcn < 0 || lcn > pkp -> pk_maxlcn) { @@ -400,48 +400,48 @@ register struct mbuf *m; m -> m_pkthdr.rcvif = pkp -> pk_ia -> ia_ifp; switch (ptype + lcdstate) { - /* - * Incoming Call packet received. + /* + * Incoming Call packet received. */ - case CALL + LISTEN: + case CALL + LISTEN: pk_incoming_call (pkp, m); break; - /* - * Call collision: Just throw this "incoming call" away since - * the DCE will ignore it anyway. + /* + * Call collision: Just throw this "incoming call" away since + * the DCE will ignore it anyway. */ - case CALL + SENT_CALL: - pk_message ((int) lcn, pkp -> pk_xcp, + case CALL + SENT_CALL: + pk_message ((int) lcn, pkp -> pk_xcp, "incoming call collision"); break; - /* + /* * Call confirmation packet received. This usually means our * previous connect request is now complete. */ - case CALL_ACCEPTED + SENT_CALL: + case CALL_ACCEPTED + SENT_CALL: MCHTYPE(m, MT_CONTROL); pk_call_accepted (lcp, m); break; - /* + /* * This condition can only happen if the previous state was - * SENT_CALL. Just ignore the packet, eventually a clear + * SENT_CALL. Just ignore the packet, eventually a clear * confirmation should arrive. */ - case CALL_ACCEPTED + SENT_CLEAR: + case CALL_ACCEPTED + SENT_CLEAR: break; - /* + /* * Clear packet received. This requires a complete tear down * of the virtual circuit. Free buffers and control blocks. * and send a clear confirmation. */ case CLEAR + READY: - case CLEAR + RECEIVED_CALL: - case CLEAR + SENT_CALL: - case CLEAR + DATA_TRANSFER: + case CLEAR + RECEIVED_CALL: + case CLEAR + SENT_CALL: + case CLEAR + DATA_TRANSFER: lcp -> lcd_state = RECEIVED_CLEAR; lcp -> lcd_template = pk_template (lcp -> lcd_lcn, X25_CLEAR_CONFIRM); pk_output (lcp); @@ -454,22 +454,22 @@ register struct mbuf *m; lcp = 0; break; - /* + /* * Clear collision: Treat this clear packet as a confirmation. */ - case CLEAR + SENT_CLEAR: + case CLEAR + SENT_CLEAR: pk_close (lcp); break; - /* + /* * Clear confirmation received. This usually means the virtual * circuit is now completely removed. */ - case CLEAR_CONF + SENT_CLEAR: + case CLEAR_CONF + SENT_CLEAR: pk_close (lcp); break; - /* + /* * A clear confirmation on an unassigned logical channel - just * ignore it. Note: All other packets on an unassigned channel * results in a clear. @@ -478,20 +478,20 @@ register struct mbuf *m; case CLEAR_CONF + LISTEN: break; - /* + /* * Data packet received. Pass on to next level. Move the Q and M * bits into the data portion for the next level. */ - case DATA + DATA_TRANSFER: + case DATA + DATA_TRANSFER: if (lcp -> lcd_reset_condition) { ptype = DELETE_PACKET; break; } - /* - * Process the P(S) flow control information in this Data packet. - * Check that the packets arrive in the correct sequence and that - * they are within the "lcd_input_window". Input window rotation is + /* + * Process the P(S) flow control information in this Data packet. + * Check that the packets arrive in the correct sequence and that + * they are within the "lcd_input_window". Input window rotation is * initiated by the receive interface. */ @@ -559,7 +559,7 @@ register struct mbuf *m; * Discard Q-BIT packets if the application * doesn't want to be informed of M and Q bit status */ - if (X25GBITS(xp -> bits, q_bit) + if (X25GBITS(xp -> bits, q_bit) && (lcp -> lcd_flags & X25_MQBIT) == 0) { m_freem (m); /* @@ -575,10 +575,10 @@ register struct mbuf *m; } break; - /* + /* * Interrupt packet received. */ - case INTERRUPT + DATA_TRANSFER: + case INTERRUPT + DATA_TRANSFER: if (lcp -> lcd_reset_condition) break; lcp -> lcd_intrdata = xp -> packet_data; @@ -597,10 +597,10 @@ register struct mbuf *m; } break; - /* + /* * Interrupt confirmation packet received. */ - case INTERRUPT_CONF + DATA_TRANSFER: + case INTERRUPT_CONF + DATA_TRANSFER: if (lcp -> lcd_reset_condition) break; if (lcp -> lcd_intrconf_pending == TRUE) @@ -609,11 +609,11 @@ register struct mbuf *m; pk_procerror (RESET, lcp, "unexpected packet", 43); break; - /* + /* * Receiver ready received. Rotate the output window and output * any data packets waiting transmission. */ - case RR + DATA_TRANSFER: + case RR + DATA_TRANSFER: if (lcp -> lcd_reset_condition || pk_ack (lcp, PR(xp)) != PACKET_OK) { ptype = DELETE_PACKET; @@ -624,11 +624,11 @@ register struct mbuf *m; pk_output (lcp); break; - /* + /* * Receiver Not Ready received. Packets up to the P(R) can be * be sent. Condition is cleared with a RR. */ - case RNR + DATA_TRANSFER: + case RNR + DATA_TRANSFER: if (lcp -> lcd_reset_condition || pk_ack (lcp, PR(xp)) != PACKET_OK) { ptype = DELETE_PACKET; @@ -637,12 +637,12 @@ register struct mbuf *m; lcp -> lcd_rnr_condition = TRUE; break; - /* + /* * Reset packet received. Set state to FLOW_OPEN. The Input and * Output window edges ar set to zero. Both the send and receive * numbers are reset. A confirmation is returned. */ - case RESET + DATA_TRANSFER: + case RESET + DATA_TRANSFER: if (lcp -> lcd_reset_condition) /* Reset collision. Just ignore packet. */ break; @@ -666,10 +666,10 @@ register struct mbuf *m; sowwakeup (so); break; - /* + /* * Reset confirmation received. */ - case RESET_CONF + DATA_TRANSFER: + case RESET_CONF + DATA_TRANSFER: if (lcp -> lcd_reset_condition) { lcp -> lcd_reset_condition = FALSE; pk_output (lcp); @@ -678,27 +678,27 @@ register struct mbuf *m; pk_procerror (RESET, lcp, "unexpected packet", 32); break; - case DATA + SENT_CLEAR: + case DATA + SENT_CLEAR: ptype = DELETE_PACKET; - case RR + SENT_CLEAR: - case RNR + SENT_CLEAR: - case INTERRUPT + SENT_CLEAR: - case INTERRUPT_CONF + SENT_CLEAR: - case RESET + SENT_CLEAR: - case RESET_CONF + SENT_CLEAR: + case RR + SENT_CLEAR: + case RNR + SENT_CLEAR: + case INTERRUPT + SENT_CLEAR: + case INTERRUPT_CONF + SENT_CLEAR: + case RESET + SENT_CLEAR: + case RESET_CONF + SENT_CLEAR: /* Just ignore p if we have sent a CLEAR already. */ break; - /* + /* * Restart sets all the permanent virtual circuits to the "Data * Transfer" stae and all the switched virtual circuits to the * "Ready" state. */ - case RESTART + READY: + case RESTART + READY: switch (pkp -> pk_state) { - case DTE_SENT_RESTART: - /* + case DTE_SENT_RESTART: + /* * Restart collision. * If case the restart cause is "DTE originated" we * have a DTE-DTE situation and are trying to resolve @@ -720,13 +720,13 @@ register struct mbuf *m; pkp -> pk_dxerole &= ~DTE_PLAYDCE; pk_message (0, pkp -> pk_xcp, "Packet level operational"); - pk_message (0, pkp -> pk_xcp, + pk_message (0, pkp -> pk_xcp, "Assuming DTE role"); if (pkp -> pk_dxerole & DTE_CONNECTPENDING) pk_callcomplete (pkp); break; - default: + default: pk_restart (pkp, -1); pk_restartcause (pkp, xp); pkp -> pk_chan[0] -> lcd_template = pk_template (0, @@ -737,11 +737,11 @@ register struct mbuf *m; DTE_PLAYDTE; if (pkp -> pk_dxerole & DTE_PLAYDTE) { pkp -> pk_dxerole &= ~DTE_PLAYDCE; - pk_message (0, pkp -> pk_xcp, + pk_message (0, pkp -> pk_xcp, "Assuming DTE role"); } else { pkp -> pk_dxerole &= ~DTE_PLAYDTE; - pk_message (0, pkp -> pk_xcp, + pk_message (0, pkp -> pk_xcp, "Assuming DCE role"); } if (pkp -> pk_dxerole & DTE_CONNECTPENDING) @@ -749,13 +749,13 @@ register struct mbuf *m; } break; - /* + /* * Restart confirmation received. All logical channels are set - * to READY. + * to READY. */ - case RESTART_CONF + READY: + case RESTART_CONF + READY: switch (pkp -> pk_state) { - case DTE_SENT_RESTART: + case DTE_SENT_RESTART: pkp -> pk_state = DTE_READY; pkp -> pk_dxerole |= DTE_PLAYDTE; pkp -> pk_dxerole &= ~DTE_PLAYDCE; @@ -767,7 +767,7 @@ register struct mbuf *m; pk_callcomplete (pkp); break; - default: + default: /* Restart local procedure error. */ pk_restart (pkp, X25_RESTART_LOCAL_PROCEDURE_ERROR); pkp -> pk_state = DTE_SENT_RESTART; @@ -775,7 +775,7 @@ register struct mbuf *m; } break; - default: + default: if (lcp) { pk_procerror (CLEAR, lcp, "unknown packet error", 33); pk_message (lcn, pkp -> pk_xcp, @@ -884,9 +884,9 @@ struct socket *so; } } -/* +/* * This routine handles incoming call packets. It matches the protocol - * field on the Call User Data field (usually the first four bytes) with + * field on the Call User Data field (usually the first four bytes) with * sockets awaiting connections. */ @@ -930,7 +930,7 @@ struct pkcb *pkp; * Now, loop through the listen sockets looking for a match on the * PID. That is the first few octets of the user data field. * This is the closest thing to a port number for X.25 packets. - * It does provide a way of multiplexing services at the user level. + * It does provide a way of multiplexing services at the user level. */ for (l = pk_listenhead; l; l = l -> lcd_listen) { @@ -961,7 +961,7 @@ struct pkcb *pkp; if (l -> lcd_so) { if (so = sonewconn (l -> lcd_so, SS_ISCONNECTED)) lcp = (struct pklcd *) so -> so_pcb; - } else + } else lcp = pk_attach ((struct socket *) 0); if (lcp == 0) { /* diff --git a/sys/netccitt/pk_llcsubr.c b/sys/netccitt/pk_llcsubr.c index a1e18ad..be18daf 100644 --- a/sys/netccitt/pk_llcsubr.c +++ b/sys/netccitt/pk_llcsubr.c @@ -1,9 +1,9 @@ -/* - * Copyright (C) Dirk Husemann, Computer Science Department IV, +/* + * Copyright (C) Dirk Husemann, Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by * Dirk Husemann and the Computer Science Department (IV) of * the University of Erlangen-Nuremberg, Germany. @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)pk_llcsubr.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_llcsubr.c,v 1.2 1994/08/02 07:47:36 davidg Exp $ + * $Id: pk_llcsubr.c,v 1.3 1994/12/13 22:32:16 wollman Exp $ */ #include <sys/param.h> @@ -84,7 +84,7 @@ * * HDLC uses the DTE-DCE model of X.25, therefore we need a many-to-one * relationship, i.e.: - * + * * {X.121_a, X.121_b, X.121_c, ..., X.121_i} -> pkcb_0 * * LLC2 utilizes the DTE-DTE model of X.25, resulting effectively in a @@ -94,18 +94,18 @@ * {X.121_k} -> pkcb_1b * ... * {X.121_q} -> pkcb_1q - * + * * It might make sense to allow a many-to-one relation for LLC2 also, - * + * * {X.121_r, X.121_s, X.121_t, X.121_u} -> pkcb_2a * * This would make addresses X.121_[r-u] essentially aliases of one * address ({X.121_[r-u]} would constitute a representative set). * * Each one-to-one relation must obviously be entered individually with - * a route add command, whereas a many-to-one relationship can be + * a route add command, whereas a many-to-one relationship can be * either entered individually or generated by using a netmask. - * + * * To facilitate dealings the many-to-one case for LLC2 can only be * established via a netmask. * @@ -137,7 +137,7 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) switch(cmd) { case RTM_RESOLVE: case RTM_ADD: - if (pkp) + if (pkp) return(EEXIST); if (rt->rt_flags & RTF_GATEWAY) { @@ -149,21 +149,21 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) } /* * Assumptions: (1) ifnet structure is filled in - * (2) at least the pkcb created via - * x25config (ifconfig?) has been + * (2) at least the pkcb created via + * x25config (ifconfig?) has been * set up already. - * (3) HDLC interfaces have an if_type of - * IFT_X25{,DDN}, LLC2 interfaces - * anything else (any better way to + * (3) HDLC interfaces have an if_type of + * IFT_X25{,DDN}, LLC2 interfaces + * anything else (any better way to * do this?) * */ if (!rt->rt_ifa) return (ENETDOWN); - - /* + + /* * We differentiate between dealing with a many-to-one - * (HDLC: DTE-DCE) and a one-to-one (LLC2: DTE-DTE) + * (HDLC: DTE-DCE) and a one-to-one (LLC2: DTE-DTE) * relationship (by looking at the if type). * * Only in case of the many-to-one relationship (HDLC) @@ -172,19 +172,19 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) * future route additions (the rtentry->rt_llinfo pointer * points to the pkcb allocated for that route). * - * In case of the one-to-one relationship (LLC2) we + * In case of the one-to-one relationship (LLC2) we * create a new pkcb (via pk_newlink()) for each new rtentry. - * + * * NOTE: Only in case of HDLC does ia->ia_pkcb point - * to a pkcb, in the LLC2 case it doesn't (as we don't + * to a pkcb, in the LLC2 case it doesn't (as we don't * need it here)! */ one_to_one = ISISO8802(rt->rt_ifp); - if (!(pkp = XIFA(rt)->ia_pkcb) && !one_to_one) - XIFA(rt)->ia_pkcb = pkp = + if (!(pkp = XIFA(rt)->ia_pkcb) && !one_to_one) + XIFA(rt)->ia_pkcb = pkp = pk_newlink(XIFA(rt), (caddr_t) 0); - else if (one_to_one && + else if (one_to_one && !equal(rt->rt_gateway, rt->rt_ifa->ifa_addr)) { pkp = pk_newlink(XIFA(rt), (caddr_t) 0); /* @@ -206,7 +206,7 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) { /* * The pkp might be empty if we are dealing - * with an interface route entry for LLC2, in this + * with an interface route entry for LLC2, in this * case we don't need to do anything ... */ if (pkp) { @@ -215,12 +215,12 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) RTFREE((struct rtentry *)rt->rt_llinfo); return(0); } - + if (pkp->pk_llrt) npaidb_destroy(pkp->pk_llrt); pk_dellink (pkp); - + return(0); } } @@ -228,33 +228,33 @@ cons_rtrequest(int cmd, struct rtentry *rt, struct sockaddr *dst) } /* - * Network Protocol Addressing Information DataBase (npaidb) - * - * To speed up locating the entity dealing with an LLC packet use is made - * of a routing tree. This npaidb routing tree is handled - * by the normal rn_*() routines just like (almost) any other routing tree. - * - * The mapping being done by the npaidb_*() routines is as follows: - * - * Key: MAC,LSAP (enhancing struct sockaddr_dl) - * Gateway: sockaddr_x25 (i.e. X.25 address - X.121 or NSAP) - * Llinfo: npaidbentry { - * struct llc_linkcb *npaidb_linkp; - * struct rtentry *npaidb_rt; - * } - * - * Using the npaidbentry provided by llinfo we can then access - * + * Network Protocol Addressing Information DataBase (npaidb) + * + * To speed up locating the entity dealing with an LLC packet use is made + * of a routing tree. This npaidb routing tree is handled + * by the normal rn_*() routines just like (almost) any other routing tree. + * + * The mapping being done by the npaidb_*() routines is as follows: + * + * Key: MAC,LSAP (enhancing struct sockaddr_dl) + * Gateway: sockaddr_x25 (i.e. X.25 address - X.121 or NSAP) + * Llinfo: npaidbentry { + * struct llc_linkcb *npaidb_linkp; + * struct rtentry *npaidb_rt; + * } + * + * Using the npaidbentry provided by llinfo we can then access + * * o the pkcb by using (struct pkcb *) (npaidb_rt->rt_llinfo) - * o the linkcb via npaidb_linkp - * - * The following functions are provided - * - * o npaidb_enter(struct sockaddr_dl *sdl, struct sockaddr_x25 *sx25, - * struct struct llc_linkcb *link, struct rtentry *rt) - * - * o npaidb_enrich(short type, caddr_t info) - * + * o the linkcb via npaidb_linkp + * + * The following functions are provided + * + * o npaidb_enter(struct sockaddr_dl *sdl, struct sockaddr_x25 *sx25, + * struct struct llc_linkcb *link, struct rtentry *rt) + * + * o npaidb_enrich(short type, caddr_t info) + * */ struct sockaddr_dl npdl_netmask = { @@ -266,7 +266,7 @@ struct sockaddr_dl npdl_netmask = { -1, /* _alen */ -1, /* _slen */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* _data */ -}; +}; struct sockaddr npdl_dummy; int npdl_datasize = sizeof(struct sockaddr_dl)- @@ -284,15 +284,15 @@ npaidb_enter(struct sockaddr_dl *key, struct sockaddr *value, register u_int size = sizeof(struct npaidbentry); register u_char saploc = LLSAPLOC(key, rt->rt_ifp); - /* + /* * set up netmask: LLC2 packets have the lowest bit set in * response packets (e.g. 0x7e for command packets, 0x7f for * response packets), to facilitate the lookup we use a netmask - * of 11111110 for the SAP position. The remaining positions + * of 11111110 for the SAP position. The remaining positions * are zeroed out. */ npdl_netmask.sdl_data[saploc] = NPDL_SAPNETMASK; - bzero((caddr_t)&npdl_netmask.sdl_data[saploc+1], + bzero((caddr_t)&npdl_netmask.sdl_data[saploc+1], npdl_datasize-saploc-1); if (value == 0) @@ -326,12 +326,12 @@ npaidb_enrich(short type, caddr_t info, struct sockaddr_dl *sdl) rt->rt_refcnt--; switch (type) { case NPAIDB_LINK: - ((struct npaidbentry *)(rt->rt_llinfo))->np_link = + ((struct npaidbentry *)(rt->rt_llinfo))->np_link = (struct llc_linkcb *) info; break; } return rt; - } + } return ((struct rtentry *) 0); @@ -341,9 +341,9 @@ npaidb_destroy(struct rtentry *rt) { USES_AF_LINK_RTS; - if (rt->rt_llinfo) + if (rt->rt_llinfo) free((caddr_t) rt->rt_llinfo, M_PCB); - return(rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, rt_mask(rt), + return(rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, rt_mask(rt), 0, 0)); } @@ -358,7 +358,7 @@ x25_llcglue(int prc, struct sockaddr *addr) register struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)addr; register struct x25_ifaddr *x25ifa; struct dll_ctlinfo ctlinfo; - + if((x25ifa = (struct x25_ifaddr *)ifa_ifwithaddr(addr)) == 0) return 0; diff --git a/sys/netccitt/pk_output.c b/sys/netccitt/pk_output.c index 95b6026..7645502 100644 --- a/sys/netccitt/pk_output.c +++ b/sys/netccitt/pk_output.c @@ -1,6 +1,6 @@ /* * Copyright (c) University of British Columbia, 1984 - * Copyright (C) Computer Science Department IV, + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1992 * Copyright (c) 1991, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_output.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: pk_output.c,v 1.2 1994/08/02 07:47:38 davidg Exp $ */ #include <sys/param.h> @@ -75,11 +75,11 @@ register struct pklcd *lcp; xp = mtod (m, struct x25_packet *); switch (pk_decode (xp) + lcp -> lcd_state) { - /* + /* * All the work is already done - just set the state and * pass to peer. */ - case CALL + READY: + case CALL + READY: lcp -> lcd_state = SENT_CALL; lcp -> lcd_timer = pk_t21; break; @@ -88,17 +88,17 @@ register struct pklcd *lcp; * Just set the state to allow packet to flow and send the * confirmation. */ - case CALL_ACCEPTED + RECEIVED_CALL: + case CALL_ACCEPTED + RECEIVED_CALL: lcp -> lcd_state = DATA_TRANSFER; break; - /* + /* * Just set the state. Keep the LCD around till the clear * confirmation is returned. */ - case CLEAR + RECEIVED_CALL: - case CLEAR + SENT_CALL: - case CLEAR + DATA_TRANSFER: + case CLEAR + RECEIVED_CALL: + case CLEAR + SENT_CALL: + case CLEAR + DATA_TRANSFER: lcp -> lcd_state = SENT_CLEAR; lcp -> lcd_retry = 0; /* fall through */ @@ -108,13 +108,13 @@ register struct pklcd *lcp; lcp -> lcd_retry++; break; - case CLEAR_CONF + RECEIVED_CLEAR: - case CLEAR_CONF + SENT_CLEAR: - case CLEAR_CONF + READY: + case CLEAR_CONF + RECEIVED_CLEAR: + case CLEAR_CONF + SENT_CLEAR: + case CLEAR_CONF + READY: lcp -> lcd_state = READY; break; - case DATA + DATA_TRANSFER: + case DATA + DATA_TRANSFER: SPS(xp, lcp -> lcd_ssn); lcp -> lcd_input_window = (lcp -> lcd_rsn + 1) % MODULUS; @@ -125,49 +125,49 @@ register struct pklcd *lcp; lcp -> lcd_window_condition = TRUE; break; - case INTERRUPT + DATA_TRANSFER: + case INTERRUPT + DATA_TRANSFER: #ifdef ancient_history xp -> packet_data = 0; #endif lcp -> lcd_intrconf_pending = TRUE; break; - case INTERRUPT_CONF + DATA_TRANSFER: + case INTERRUPT_CONF + DATA_TRANSFER: break; - case RR + DATA_TRANSFER: - case RNR + DATA_TRANSFER: + case RR + DATA_TRANSFER: + case RNR + DATA_TRANSFER: lcp -> lcd_input_window = (lcp -> lcd_rsn + 1) % MODULUS; SPR(xp, lcp -> lcd_input_window); lcp -> lcd_last_transmitted_pr = lcp -> lcd_input_window; break; - case RESET + DATA_TRANSFER: + case RESET + DATA_TRANSFER: lcp -> lcd_reset_condition = TRUE; break; - case RESET_CONF + DATA_TRANSFER: + case RESET_CONF + DATA_TRANSFER: lcp -> lcd_reset_condition = FALSE; break; - /* + /* * A restart should be only generated internally. Therefore * all logic for restart is in the pk_restart routine. */ - case RESTART + READY: + case RESTART + READY: lcp -> lcd_timer = pk_t20; break; - /* + /* * Restarts are all handled internally. Therefore all the * logic for the incoming restart packet is handled in the * pk_input routine. */ - case RESTART_CONF + READY: + case RESTART_CONF + READY: break; - default: + default: m_freem (m); return; } @@ -184,7 +184,7 @@ register struct pklcd *lcp; } } -/* +/* * This procedure returns the next packet to send or null. A * packet is composed of one or more mbufs. */ diff --git a/sys/netccitt/pk_subr.c b/sys/netccitt/pk_subr.c index bd99308..a64375f 100644 --- a/sys/netccitt/pk_subr.c +++ b/sys/netccitt/pk_subr.c @@ -1,6 +1,6 @@ /* * Copyright (c) University of British Columbia, 1984 - * Copyright (C) Computer Science Department IV, + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1992 * Copyright (c) 1991, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: pk_subr.c,v 1.2 1994/08/02 07:47:41 davidg Exp $ + * $Id: pk_subr.c,v 1.3 1994/12/13 22:32:17 wollman Exp $ */ #include <sys/param.h> @@ -80,10 +80,10 @@ struct x25bitslice x25_bitslice[] = { }; -/* +/* * Attach X.25 protocol to socket, allocate logical channel descripter * and buffer space, and enter LISTEN state if we are to accept - * IN-COMMING CALL packets. + * IN-COMMING CALL packets. * */ @@ -116,7 +116,7 @@ struct socket *so; return (lcp); } -/* +/* * Disconnect X.25 protocol from socket. */ @@ -127,7 +127,7 @@ register struct pklcd *lcp; register struct pklcd *l, *p; switch (lcp -> lcd_state) { - case LISTEN: + case LISTEN: for (p = 0, l = pk_listenhead; l && l != lcp; p = l, l = l -> lcd_listen); if (p == 0) { if (l != 0) @@ -139,16 +139,16 @@ register struct pklcd *lcp; pk_close (lcp); break; - case READY: + case READY: pk_acct (lcp); pk_close (lcp); break; - case SENT_CLEAR: - case RECEIVED_CLEAR: + case SENT_CLEAR: + case RECEIVED_CLEAR: break; - default: + default: pk_acct (lcp); if (so) { soisdisconnecting (so); @@ -159,7 +159,7 @@ register struct pklcd *lcp; } } -/* +/* * Close an X.25 Logical Channel. Discard all space held by the * connection and internal descriptors. Wake up any sleepers. */ @@ -176,10 +176,10 @@ struct pklcd *lcp; * send buffer is locked. An attempt to sbflush () that send * buffer will lead us into - no, not temptation but - panic! * So - we'll just check wether the send buffer is locked - * and if that's the case we'll mark the lcp as zombie and + * and if that's the case we'll mark the lcp as zombie and * have the pk_timer () do the cleaning ... */ - + if (so && so -> so_snd.sb_flags & SB_LOCK) lcp -> lcd_state = LCN_ZOMBIE; else @@ -193,7 +193,7 @@ struct pklcd *lcp; /* sofree (so); /* gak!!! you can't do that here */ } -/* +/* * Create a template to be used to send X.25 packets on a logical * channel. It allocates an mbuf and fills in a skeletal packet * depending on its type. This packet is passed to pk_output where @@ -232,7 +232,7 @@ int lcn, type; return (m); } -/* +/* * This routine restarts all the virtual circuits. Actually, * the virtual circuits are not "restarted" as such. Instead, * any active switched circuit is simply returned to READY @@ -286,7 +286,7 @@ int restart_cause; } -/* +/* * This procedure frees up the Logical Channel Descripter. */ @@ -320,15 +320,15 @@ pk_ifwithaddr (sx) if (bcmp (addr, ia -> ia_xc.xc_addr.x25_addr, 16) == 0) return (ia); - + } return ((struct x25_ifaddr *)0); } -/* +/* * Bind a address and protocol value to a socket. The important - * part is the protocol value - the first four characters of the + * part is the protocol value - the first four characters of the * Call User Data field. */ @@ -490,7 +490,7 @@ register struct sockaddr_x25 *sa; return (ENETUNREACH); if (!(pkp = XTRACTPKP(rt))) - pkp = pk_newlink ((struct x25_ifaddr *) (rt -> rt_ifa), + pkp = pk_newlink ((struct x25_ifaddr *) (rt -> rt_ifa), (caddr_t) 0); /* @@ -507,9 +507,9 @@ register struct sockaddr_x25 *sa; ctlinfo.dlcti_rt = rt; ctlinfo.dlcti_pcb = (caddr_t) pkp; - ctlinfo.dlcti_conf = + ctlinfo.dlcti_conf = (struct dllconfig *) (&((struct x25_ifaddr *)(rt -> rt_ifa)) -> ia_xc); - pkp -> pk_llnext = + pkp -> pk_llnext = (pkp -> pk_llctlinput) (PRC_CONNECT_REQUEST, 0, &ctlinfo); } @@ -552,43 +552,43 @@ pk_callcomplete (pkp) register struct pklcd *lcp; register int i; register int ni; - - if (pkp -> pk_dxerole & DTE_CONNECTPENDING) + + if (pkp -> pk_dxerole & DTE_CONNECTPENDING) pkp -> pk_dxerole &= ~DTE_CONNECTPENDING; else return; if (pkp -> pk_chan == 0) return; - + /* * We pretended to be a DTE for allocating lcns, if * it turns out that we are in reality performing as a * DCE we need to reshuffle the lcps. - * - * /+---------------+-------- - - * / | a (maxlcn-1) | \ - * / +---------------+ \ - * +--- * | b (maxlcn-2) | \ - * | \ +---------------+ \ - * r | \ | c (maxlcn-3) | \ - * e | \+---------------+ | - * s | | . | + * + * /+---------------+-------- - + * / | a (maxlcn-1) | \ + * / +---------------+ \ + * +--- * | b (maxlcn-2) | \ + * | \ +---------------+ \ + * r | \ | c (maxlcn-3) | \ + * e | \+---------------+ | + * s | | . | * h | | . | m * u | | . | a * f | | . | x * f | | . | l * l | /+---------------+ | c * e | / | c' ( 3 ) | | n - * | / +---------------+ | + * | / +---------------+ | * +--> * | b' ( 2 ) | / - * \ +---------------+ / - * \ | a' ( 1 ) | / - * \+---------------+ / - * | 0 | / - * +---------------+-------- - - * - */ + * \ +---------------+ / + * \ | a' ( 1 ) | / + * \+---------------+ / + * | 0 | / + * +---------------+-------- - + * + */ if (pkp -> pk_dxerole & DTE_PLAYDCE) { /* Sigh, reshuffle it */ for (i = pkp -> pk_maxlcn; i > 0; --i) @@ -614,7 +614,7 @@ struct bcdinfo { octet *cp; unsigned posn; }; -/* +/* * Build the rest of the CALL REQUEST packet. Fill in calling * address, facilities fields and the user data field. */ @@ -641,7 +641,7 @@ register struct x25config *xcp; m -> m_pkthdr.len = m -> m_len += b.cp - (octet *) a; if (lcp -> lcd_facilities) { - m -> m_pkthdr.len += + m -> m_pkthdr.len += (m -> m_next = lcp -> lcd_facilities) -> m_pkthdr.len; lcp -> lcd_facilities = 0; } else @@ -723,9 +723,9 @@ register struct x25config *xcp; return ((b -> posn) - start); } -/* +/* * This routine gets the first available logical channel number. The - * search is + * search is * - from the highest number to lowest number if playing DTE, and * - from lowest to highest number if playing DCE. */ @@ -741,7 +741,7 @@ register struct pkcb *pkp; for (i = 1; i <= pkp -> pk_maxlcn; ++i) if (pkp -> pk_chan[i] == NULL) break; - } else { + } else { for (i = pkp -> pk_maxlcn; i > 0; --i) if (pkp -> pk_chan[i] == NULL) break; @@ -750,9 +750,9 @@ register struct pkcb *pkp; return (i); } -/* +/* * This procedure sends a CLEAR request packet. The lc state is - * set to "SENT_CLEAR". + * set to "SENT_CLEAR". */ pk_clear (lcp, diagnostic, abortive) @@ -783,7 +783,7 @@ register struct pklcd *lcp; /* * This procedure generates RNR's or RR's to inhibit or enable * inward data flow, if the current state changes (blocked ==> open or - * vice versa), or if forced to generate one. One forces RNR's to ack data. + * vice versa), or if forced to generate one. One forces RNR's to ack data. */ pk_flowcontrol (lcp, inhibit, forced) register struct pklcd *lcp; @@ -798,7 +798,7 @@ register struct pklcd *lcp; pk_output (lcp); } -/* +/* * This procedure sends a RESET request packet. It re-intializes * virtual circuit. */ @@ -854,13 +854,13 @@ register struct pklcd *lcp; m_freem (lcp -> lcd_facilities); lcp -> lcd_facilities = 0; } - if (so = lcp -> lcd_so) + if (so = lcp -> lcd_so) sbflush (&so -> so_snd); - else + else sbflush (&lcp -> lcd_sb); } -/* +/* * This procedure handles all local protocol procedure errors. */ @@ -872,7 +872,7 @@ char *errstr; pk_message (lcp -> lcd_lcn, lcp -> lcd_pkp -> pk_xcp, errstr); switch (error) { - case CLEAR: + case CLEAR: if (lcp -> lcd_so) { lcp -> lcd_so -> so_error = ECONNABORTED; soisdisconnecting (lcp -> lcd_so); @@ -880,13 +880,13 @@ char *errstr; pk_clear (lcp, diagnostic, 1); break; - case RESET: + case RESET: pk_reset (lcp, diagnostic); } } -/* - * This procedure is called during the DATA TRANSFER state to check +/* + * This procedure is called during the DATA TRANSFER state to check * and process the P(R) values received in the DATA, RR OR RNR * packets. */ @@ -918,15 +918,15 @@ unsigned pr; if (lcp -> lcd_window_condition == TRUE) lcp -> lcd_window_condition = FALSE; - if (so && ((so -> so_snd.sb_flags & SB_WAIT) || + if (so && ((so -> so_snd.sb_flags & SB_WAIT) || (so -> so_snd.sb_flags & SB_NOTIFY))) sowwakeup (so); return (PACKET_OK); } -/* - * This procedure decodes the X.25 level 3 packet returning a +/* + * This procedure decodes the X.25 level 3 packet returning a * code to be used in switchs or arrays. */ @@ -938,20 +938,20 @@ register struct x25_packet *xp; if (X25GBITS(xp -> bits, fmt_identifier) != 1) return (INVALID_PACKET); #ifdef ancient_history - /* + /* * Make sure that the logical channel group number is 0. * This restriction may be removed at some later date. */ if (xp -> lc_group_number != 0) return (INVALID_PACKET); #endif - /* + /* * Test for data packet first. */ if (!(xp -> packet_type & DATA_PACKET_DESIGNATOR)) return (DATA); - /* + /* * Test if flow control packet (RR or RNR). */ if (!(xp -> packet_type & RR_OR_RNR_PACKET_DESIGNATOR)) @@ -964,47 +964,47 @@ register struct x25_packet *xp; return (REJECT); } - /* + /* * Determine the rest of the packet types. */ switch (xp -> packet_type) { - case X25_CALL: + case X25_CALL: type = CALL; break; - case X25_CALL_ACCEPTED: + case X25_CALL_ACCEPTED: type = CALL_ACCEPTED; break; - case X25_CLEAR: + case X25_CLEAR: type = CLEAR; break; - case X25_CLEAR_CONFIRM: + case X25_CLEAR_CONFIRM: type = CLEAR_CONF; break; - case X25_INTERRUPT: + case X25_INTERRUPT: type = INTERRUPT; break; - case X25_INTERRUPT_CONFIRM: + case X25_INTERRUPT_CONFIRM: type = INTERRUPT_CONF; break; - case X25_RESET: + case X25_RESET: type = RESET; break; - case X25_RESET_CONFIRM: + case X25_RESET_CONFIRM: type = RESET_CONF; break; - case X25_RESTART: + case X25_RESTART: type = RESTART; break; - case X25_RESTART_CONFIRM: + case X25_RESTART_CONFIRM: type = RESTART_CONF; break; @@ -1012,13 +1012,13 @@ register struct x25_packet *xp; type = DIAG_TYPE; break; - default: + default: type = INVALID_PACKET; } return (type); } -/* +/* * A restart packet has been received. Print out the reason * for the restart. */ @@ -1031,19 +1031,19 @@ register struct x25_packet *xp; register int lcn = LCN(xp); switch (xp -> packet_data) { - case X25_RESTART_LOCAL_PROCEDURE_ERROR: + case X25_RESTART_LOCAL_PROCEDURE_ERROR: pk_message (lcn, xcp, "restart: local procedure error"); break; - case X25_RESTART_NETWORK_CONGESTION: + case X25_RESTART_NETWORK_CONGESTION: pk_message (lcn, xcp, "restart: network congestion"); break; - case X25_RESTART_NETWORK_OPERATIONAL: + case X25_RESTART_NETWORK_OPERATIONAL: pk_message (lcn, xcp, "restart: network operational"); break; - default: + default: pk_message (lcn, xcp, "restart: unknown cause"); } } @@ -1054,7 +1054,7 @@ int Reset_cause[] = { EXRESET, EXROUT, 0, EXRRPE, 0, EXRLPE, 0, EXRNCG }; -/* +/* * A reset packet has arrived. Return the cause to the user. */ @@ -1071,7 +1071,7 @@ register struct x25_packet *xp; pk_message (LCN(xp), lcp -> lcd_pkp, "reset code 0x%x, diagnostic 0x%x", xp -> packet_data, 4[(u_char *)xp]); - + if (lcp -> lcd_so) lcp -> lcd_so -> so_error = Reset_cause[code]; } @@ -1084,7 +1084,7 @@ int Clear_cause[] = { 0, EXCLPE, 0, 0, 0, 0, 0, EXCRRC }; -/* +/* * A clear packet has arrived. Return the cause to the user. */ diff --git a/sys/netccitt/pk_timer.c b/sys/netccitt/pk_timer.c index 4b7db0a..72aea77 100644 --- a/sys/netccitt/pk_timer.c +++ b/sys/netccitt/pk_timer.c @@ -1,10 +1,10 @@ -/* +/* * Copyright (c) Computing Centre, University of British Columbia, 1984 - * Copyright (C) Computer Science Department IV, + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1992 * Copyright (c) 1990, 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by the * Laboratory for Computation Vision and the Computer Science Department * of the the University of British Columbia and the Computer Science @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_timer.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: pk_timer.c,v 1.2 1994/08/02 07:47:44 davidg Exp $ */ #include <sys/param.h> @@ -93,7 +93,7 @@ pk_timer () if ((lcp = *pp) == 0) continue; switch (lcp -> lcd_state) { - case SENT_CALL: + case SENT_CALL: if (--lcp -> lcd_timer == 0) { if (lcp -> lcd_so) lcp -> lcd_so -> so_error = ETIMEDOUT; @@ -101,7 +101,7 @@ pk_timer () } break; - case SENT_CLEAR: + case SENT_CLEAR: if (lcp -> lcd_retry >= 3) lcns_jammed++; else diff --git a/sys/netccitt/pk_usrreq.c b/sys/netccitt/pk_usrreq.c index 1d1c0e7..84d6e2e 100644 --- a/sys/netccitt/pk_usrreq.c +++ b/sys/netccitt/pk_usrreq.c @@ -1,6 +1,6 @@ /* * Copyright (c) University of British Columbia, 1984 - * Copyright (C) Computer Science Department IV, + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1992 * Copyright (c) 1991, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: pk_usrreq.c,v 1.2 1994/08/02 07:47:46 davidg Exp $ */ #include <sys/param.h> @@ -63,7 +63,7 @@ static old_to_new(); static new_to_old(); /* - * + * * X.25 Packet level protocol interface to socket abstraction. * * Process an X.25 user request on a logical channel. If this is a send @@ -100,12 +100,12 @@ struct mbuf *control; */ switch (req) { - /* + /* * X.25 attaches to socket via PRU_ATTACH and allocates a logical * channel descriptor. If the socket is to receive connections, * then the LISTEN state is entered. */ - case PRU_ATTACH: + case PRU_ATTACH: if (lcp) { error = EISCONN; /* Socket already connected. */ @@ -116,37 +116,37 @@ struct mbuf *control; error = ENOBUFS; break; - /* + /* * Detach a logical channel from the socket. If the state of the - * channel is embryonic, simply discard it. Otherwise we have to + * channel is embryonic, simply discard it. Otherwise we have to * initiate a PRU_DISCONNECT which will finish later. */ - case PRU_DETACH: + case PRU_DETACH: pk_disconnect (lcp); break; - /* + /* * Give the socket an address. */ - case PRU_BIND: + case PRU_BIND: if (nam -> m_len == sizeof (struct x25_sockaddr)) old_to_new (nam); error = pk_bind (lcp, nam); break; - /* + /* * Prepare to accept connections. */ - case PRU_LISTEN: + case PRU_LISTEN: error = pk_listen (lcp); break; - /* + /* * Initiate a CALL REQUEST to peer entity. Enter state SENT_CALL - * and mark the socket as connecting. Set timer waiting for + * and mark the socket as connecting. Set timer waiting for * CALL ACCEPT or CLEAR. */ - case PRU_CONNECT: + case PRU_CONNECT: if (nam -> m_len == sizeof (struct x25_sockaddr)) old_to_new (nam); if (pk_checksockaddr (nam)) @@ -154,20 +154,20 @@ struct mbuf *control; error = pk_connect (lcp, mtod (nam, struct sockaddr_x25 *)); break; - /* + /* * Initiate a disconnect to peer entity via a CLEAR REQUEST packet. * The socket will be disconnected when we receive a confirmation * or a clear collision. */ - case PRU_DISCONNECT: + case PRU_DISCONNECT: pk_disconnect (lcp); break; - /* + /* * Accept an INCOMING CALL. Most of the work has already been done * by pk_input. Just return the callers address to the user. */ - case PRU_ACCEPT: + case PRU_ACCEPT: if (lcp -> lcd_craddr == NULL) break; bcopy ((caddr_t)lcp -> lcd_craddr, mtod (nam, caddr_t), @@ -177,17 +177,17 @@ struct mbuf *control; new_to_old (nam); break; - /* + /* * After a receive, we should send a RR. */ - case PRU_RCVD: + case PRU_RCVD: pk_flowcontrol (lcp, /*sbspace (&so -> so_rcv) <= */ 0, 1); break; - /* + /* * Send INTERRUPT packet. */ - case PRU_SENDOOB: + case PRU_SENDOOB: if (m == 0) { MGETHDR(m, M_WAITOK, MT_OOBDATA); m -> m_pkthdr.len = m -> m_len = 1; @@ -201,10 +201,10 @@ struct mbuf *control; MCHTYPE(m, MT_OOBDATA); /* FALLTHROUGH */ - /* + /* * Do send by placing data on the socket output queue. */ - case PRU_SEND: + case PRU_SEND: if (control) { register struct cmsghdr *ch = mtod (m, struct cmsghdr *); control -> m_len -= sizeof (*ch); @@ -216,25 +216,25 @@ struct mbuf *control; error = pk_send (lcp, m); break; - /* + /* * Abort a virtual circuit. For example all completed calls * waiting acceptance. */ - case PRU_ABORT: + case PRU_ABORT: pk_disconnect (lcp); break; /* Begin unimplemented hooks. */ - case PRU_SHUTDOWN: + case PRU_SHUTDOWN: error = EOPNOTSUPP; break; - case PRU_CONTROL: + case PRU_CONTROL: error = EOPNOTSUPP; break; - case PRU_SENSE: + case PRU_SENSE: #ifdef BSD4_3 ((struct stat *)m) -> st_blksize = so -> so_snd.sb_hiwat; #else @@ -244,7 +244,7 @@ struct mbuf *control; /* End unimplemented hooks. */ - case PRU_SOCKADDR: + case PRU_SOCKADDR: if (lcp -> lcd_ceaddr == 0) return (EADDRNOTAVAIL); nam -> m_len = sizeof (struct sockaddr_x25); @@ -265,10 +265,10 @@ struct mbuf *control; new_to_old (nam); break; - /* + /* * Receive INTERRUPT packet. */ - case PRU_RCVOOB: + case PRU_RCVOOB: if (so -> so_options & SO_OOBINLINE) { register struct mbuf *n = so -> so_rcv.sb_mb; if (n && n -> m_type == MT_OOBDATA) { @@ -287,7 +287,7 @@ struct mbuf *control; *mtod (m, char *) = lcp -> lcd_intrdata; break; - default: + default: panic ("pk_usrreq"); } release: @@ -296,7 +296,7 @@ release: return (error); } -/* +/* * If you want to use UBC X.25 level 3 in conjunction with some * other X.25 level 2 driver, have the ifp -> if_ioctl routine * assign pk_start to ia -> ia_start when called with SIOCSIFCONF_X25. @@ -394,7 +394,7 @@ p * is its first address, and to validate the address. ia -> ia_start = pk_start; s = splimp(); if (ifp -> if_ioctl) - error = (*ifp -> if_ioctl)(ifp, SIOCSIFCONF_X25, + error = (*ifp -> if_ioctl)(ifp, SIOCSIFCONF_X25, (caddr_t) ifa); if (error) ifp -> if_flags &= ~IFF_UP; @@ -441,7 +441,7 @@ int cmd, level, optname; case PK_RTATTACH: error = pk_rtattach (so, m); break; - + case PK_PRLISTEN: error = pk_user_protolisten (mtod (m, u_char *)); } diff --git a/sys/netccitt/pk_var.h b/sys/netccitt/pk_var.h index 2e58dd1..6bfe7bd 100644 --- a/sys/netccitt/pk_var.h +++ b/sys/netccitt/pk_var.h @@ -1,10 +1,10 @@ -/* - * Copyright (c) Computing Centre, University of British Columbia, 1985 - * Copyright (C) Computer Science Department IV, +/* + * Copyright (c) Computing Centre, University of British Columbia, 1985 + * Copyright (C) Computer Science Department IV, * University of Erlangen-Nuremberg, Germany, 1990, 1991, 1992 * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. - * + * * This code is derived from software contributed to Berkeley by the * Laboratory for Computation Vision and the Computer Science Department * of the the University of British Columbia and the Computer Science @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)pk_var.h 8.1 (Berkeley) 6/10/93 - * $Id: pk_var.h,v 1.3 1994/08/21 05:44:10 paul Exp $ + * $Id: pk_var.h,v 1.4 1995/03/16 18:14:40 bde Exp $ */ #ifndef _NETCCITT_PK_VAR_H_ @@ -130,7 +130,7 @@ struct pkcb { #define PQEMPTY (pkcb_q.q_forw == &pkcb_q) /* - * Interface address, x25 version. Exactly one of these structures is + * Interface address, x25 version. Exactly one of these structures is * allocated for each interface with an x25 address. * * The ifaddr structure conatins the protocol-independent part diff --git a/sys/netccitt/x25.h b/sys/netccitt/x25.h index 2d4a4f6..bb91460 100644 --- a/sys/netccitt/x25.h +++ b/sys/netccitt/x25.h @@ -3,7 +3,7 @@ * Copyright (c) 1990, 1992, 1993 * The Regents of the University of California. All rights reserved. * University of Erlangen-Nuremberg, Germany, 1992 - * + * * This code is derived from software contributed to Berkeley by the * Laboratory for Computation Vision and the Computer Science Department * of the the University of British Columbia and the Computer Science @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * @(#)x25.h 8.1 (Berkeley) 6/10/93 - * $Id: x25.h,v 1.2 1994/08/02 07:47:50 davidg Exp $ + * $Id: x25.h,v 1.3 1994/08/21 05:44:11 paul Exp $ */ #ifndef _NETCCITT_X25_H_ @@ -50,7 +50,7 @@ #define PRC_LINKDOWN 5 #define PRC_LINKRESET 6 #define PRC_LINKDONTCOPY 7 -#ifndef PRC_DISCONNECT_REQUEST +#ifndef PRC_DISCONNECT_REQUEST #define PRC_DISCONNECT_REQUEST 10 #endif #endif diff --git a/sys/netccitt/x25err.h b/sys/netccitt/x25err.h index 1ee8e69..94cf7cd 100644 --- a/sys/netccitt/x25err.h +++ b/sys/netccitt/x25err.h @@ -36,15 +36,15 @@ * SUCH DAMAGE. * * @(#)x25err.h 8.1 (Berkeley) 6/10/93 - * $Id: x25err.h,v 1.2 1994/08/02 07:47:53 davidg Exp $ + * $Id: x25err.h,v 1.3 1994/08/21 05:44:12 paul Exp $ */ #ifndef _NETCCITT_X25ERR_H_ #define _NETCCITT_X25ERR_H_ -/* - * - * X.25 Reset and Clear errors and diagnostics. These values are +/* + * + * X.25 Reset and Clear errors and diagnostics. These values are * returned in the u_error field of the u structure. * */ diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index cc1611f..0beb578 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.15 1995/05/09 13:35:44 davidg Exp $ + * $Id: if_ether.c,v 1.16 1995/05/11 00:13:16 wollman Exp $ */ /* @@ -516,7 +516,7 @@ reply: (void)memcpy(ea->arp_sha, ac->ac_enaddr, sizeof(ea->arp_sha)); rtfree(rt); #ifdef DEBUG_PROXY - printf("arp: proxying for %s\n", + printf("arp: proxying for %s\n", inet_ntoa(itaddr)); #endif #else diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 935788c..2551fe3 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.h 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.h,v 1.7 1994/12/22 22:00:30 wollman Exp $ + * $Id: if_ether.h,v 1.8 1995/04/02 01:26:26 wpaul Exp $ */ #ifndef _NETINET_IF_ETHER_H_ @@ -92,7 +92,7 @@ struct ether_addr { * Ethernet Address Resolution Protocol. * * See RFC 826 for protocol description. Structure below is adapted - * to resolving internet addresses. Field names used correspond to + * to resolving internet addresses. Field names used correspond to * RFC 826. */ struct ether_arp { @@ -119,10 +119,10 @@ struct arpcom { u_char ac_enaddr[6]; /* ethernet hardware address */ struct in_addr ac_ipaddr; /* copy of ip address- XXX */ struct ether_multi *ac_multiaddrs; /* list of ether multicast addrs */ - int ac_multicnt; /* length of ac_multiaddrs list */ + int ac_multicnt; /* length of ac_multiaddrs list */ }; -struct llinfo_arp { +struct llinfo_arp { struct llinfo_arp *la_next; struct llinfo_arp *la_prev; struct rtentry *la_rt; diff --git a/sys/netinet/if_fddi.h b/sys/netinet/if_fddi.h index a8efc5a..14ec343 100644 --- a/sys/netinet/if_fddi.h +++ b/sys/netinet/if_fddi.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_fddi.h 8.1 (Berkeley) 6/10/93 - * $Id: if_fddi.h,v 1.1 1995/03/10 17:43:45 thomas Exp $ + * $Id: if_fddi.h,v 1.1 1995/03/14 09:14:14 davidg Exp $ */ #ifndef _NETINET_IF_FDDI_H_ @@ -77,7 +77,7 @@ struct fddi_header { void fddi_ifattach __P((struct ifnet *)); void fddi_input __P((struct ifnet *, struct fddi_header *, struct mbuf *)); int fddi_output __P((struct ifnet *, - struct mbuf *, struct sockaddr *, struct rtentry *)); + struct mbuf *, struct sockaddr *, struct rtentry *)); #endif diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index c864e14..dac0add 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)igmp.c 8.1 (Berkeley) 7/19/93 - * $Id: igmp.c,v 1.9 1995/04/26 18:10:53 pst Exp $ + * $Id: igmp.c,v 1.10 1995/05/16 01:28:29 davidg Exp $ */ /* @@ -97,12 +97,12 @@ fill_rti(inm) #endif while (rti) { if (rti->ifp == inm->inm_ifp){ /* ? is it ok to compare */ - /* pointers */ + /* pointers */ inm->inm_rti = rti; #ifdef IGMP_DEBUG printf("[igmp.c, _fill_rti] --> found old entry \n"); #endif - if (rti->type == IGMP_OLD_ROUTER) + if (rti->type == IGMP_OLD_ROUTER) return IGMP_HOST_MEMBERSHIP_REPORT; else return IGMP_HOST_NEW_MEMBERSHIP_REPORT; @@ -114,7 +114,7 @@ fill_rti(inm) rti->type = IGMP_NEW_ROUTER; rti->time = IGMP_AGE_THRESHOLD; rti->next = Head; - Head = rti; + Head = rti; inm->inm_rti = rti; #ifdef IGMP_DEBUG printf("[igmp.c, _fill_rti] --> created new entry \n"); @@ -166,7 +166,7 @@ igmp_input(m, iphlen) register struct in_ifaddr *ia; struct in_multistep step; struct router_info *rti; - + int timer; /** timer value in the igmp query header **/ ++igmpstat.igps_rcv_total; @@ -237,9 +237,9 @@ igmp_input(m, iphlen) */ IN_FIRST_MULTI(step, inm); while (inm != NULL) { - if (inm->inm_ifp == ifp + if (inm->inm_ifp == ifp && inm->inm_timer == 0 - && inm->inm_addr.s_addr + && inm->inm_addr.s_addr != igmp_all_hosts_group) { inm->inm_state = IGMP_DELAYING_MEMBER; @@ -254,7 +254,7 @@ igmp_input(m, iphlen) /* ** New Router */ - + if (ip->ip_dst.s_addr != igmp_all_hosts_group) { if (!(m->m_flags & M_MCAST)) { ++igmpstat.igps_rcv_badqueries; @@ -263,14 +263,14 @@ igmp_input(m, iphlen) } } if (ip->ip_dst.s_addr == igmp_all_hosts_group) { - + /* * - Start the timers in all of our membership records * for the interface on which the query arrived * excl. those that belong to the "all-hosts" group. * - For timers already running check if they need to * be reset. - * - Use the igmp->igmp_code filed as the maximum + * - Use the igmp->igmp_code filed as the maximum * delay possible */ IN_FIRST_MULTI(step, inm); @@ -307,7 +307,7 @@ igmp_input(m, iphlen) /* ** group specific query */ - + IN_FIRST_MULTI(step, inm); while (inm != NULL) { if (inm->inm_addr.s_addr == ip->ip_dst.s_addr) { @@ -382,7 +382,7 @@ igmp_input(m, iphlen) if (inm != NULL) { inm->inm_timer = 0; ++igmpstat.igps_rcv_ourreports; - + switch(inm->inm_state){ case IGMP_IDLE_MEMBER: case IGMP_LAZY_MEMBER: @@ -398,7 +398,7 @@ igmp_input(m, iphlen) break; } } - + break; case IGMP_HOST_NEW_MEMBERSHIP_REPORT: @@ -406,17 +406,17 @@ igmp_input(m, iphlen) * an new report */ ++igmpstat.igps_rcv_reports; - + if (ifp->if_flags & IFF_LOOPBACK) break; - + if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr)) || igmp->igmp_group.s_addr != ip->ip_dst.s_addr) { ++igmpstat.igps_rcv_badreports; m_freem(m); return; } - + /* * KLUDGE: if the IP source address of the report has an * unspecified (i.e., zero) subnet number, as is allowed for @@ -430,7 +430,7 @@ igmp_input(m, iphlen) IFP_TO_IA(ifp, ia); if (ia) ip->ip_src.s_addr = htonl(ia->ia_subnet); } - + /* * If we belong to the group being reported, stop * our timer for that group. @@ -439,7 +439,7 @@ igmp_input(m, iphlen) if (inm != NULL) { inm->inm_timer = 0; ++igmpstat.igps_rcv_ourreports; - + switch(inm->inm_state){ case IGMP_DELAYING_MEMBER: case IGMP_IDLE_MEMBER: @@ -558,7 +558,7 @@ igmp_slowtimo() } rti = rti->next; } -#ifdef IGMP_DEBUG +#ifdef IGMP_DEBUG printf("[igmp.c,_slowtimo] -- > exiting \n"); #endif splx(s); @@ -638,7 +638,7 @@ igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, switch(name[0]) { case IGMPCTL_STATS: - return sysctl_rdstruct(oldp, oldlenp, newp, &igmpstat, + return sysctl_rdstruct(oldp, oldlenp, newp, &igmpstat, sizeof igmpstat); default: return ENOPROTOOPT; diff --git a/sys/netinet/igmp.h b/sys/netinet/igmp.h index 1e082c4..4011b4c 100644 --- a/sys/netinet/igmp.h +++ b/sys/netinet/igmp.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)igmp.h 8.1 (Berkeley) 6/10/93 - * $Id: igmp.h,v 1.3 1994/08/21 05:27:25 paul Exp $ + * $Id: igmp.h,v 1.4 1994/09/06 22:42:17 wollman Exp $ */ #ifndef _NETINET_IGMP_H_ @@ -76,15 +76,15 @@ struct igmp { #define IGMP_DELAYING_MEMBER 1 #define IGMP_IDLE_MEMBER 2 -#define IGMP_LAZY_MEMBER 3 -#define IGMP_SLEEPING_MEMBER 4 -#define IGMP_AWAKENING_MEMBER 5 +#define IGMP_LAZY_MEMBER 3 +#define IGMP_SLEEPING_MEMBER 4 +#define IGMP_AWAKENING_MEMBER 5 #define IGMP_OLD_ROUTER 0 #define IGMP_NEW_ROUTER 1 -#define IGMP_AGE_THRESHOLD 540 +#define IGMP_AGE_THRESHOLD 540 #ifdef IGMP_STATES static char *tostate[]={"","DELAYING_MEMBER","IDLE","LAZY","SLEEPING", diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 230ff10..1ebbab3 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in.c 8.2 (Berkeley) 11/15/93 - * $Id: in.c,v 1.12 1995/04/25 19:50:20 wollman Exp $ + * $Id: in.c,v 1.13 1995/04/26 18:10:54 pst Exp $ */ #include <sys/param.h> @@ -209,7 +209,7 @@ in_control(so, cmd, data, ifp) ifra->ifra_addr.sin_addr.s_addr) break; } - if ((ifp->if_flags & IFF_POINTOPOINT) + if ((ifp->if_flags & IFF_POINTOPOINT) && (cmd == SIOCAIFADDR) && (ifra->ifra_dstaddr.sin_addr.s_addr == INADDR_ANY)) { @@ -411,7 +411,7 @@ in_control(so, cmd, data, ifp) IFP_TO_IA(oia->ia_ifp, ia); if (ia) { /* there is another address */ struct in_multi *inm; - for(inm = oia->ia_multiaddrs.lh_first; inm; + for(inm = oia->ia_multiaddrs.lh_first; inm; inm = inm->inm_entry.le_next) { IFAFREE(&inm->inm_ia->ia_ifa); ia->ia_ifa.ifa_refcnt++; @@ -426,7 +426,7 @@ in_control(so, cmd, data, ifp) LIST_INIT(&mk->mk_head); mk->mk_ifp = ifp; - for(inm = oia->ia_multiaddrs.lh_first; inm; + for(inm = oia->ia_multiaddrs.lh_first; inm; inm = inm->inm_entry.le_next) { LIST_INSERT_HEAD(&mk->mk_head, inm, inm_entry); } @@ -437,7 +437,7 @@ in_control(so, cmd, data, ifp) FREE(mk, M_IPMADDR); } } - + IFAFREE((&oia->ia_ifa)); break; @@ -551,20 +551,20 @@ in_ifinit(ifp, ia, sin, scrub) /* * Continuation of multicast address hack: - * If there was a multicast group list previously saved + * If there was a multicast group list previously saved * for this interface, then we re-attach it to the first * address configured on the i/f. */ for(mk = in_mk.lh_first; mk; mk = mk->mk_entry.le_next) { if(mk->mk_ifp == ifp) { struct in_multi *inm; - - for(inm = mk->mk_head.lh_first; inm; + + for(inm = mk->mk_head.lh_first; inm; inm = inm->inm_entry.le_next) { IFAFREE(&inm->inm_ia->ia_ifa); ia->ia_ifa.ifa_refcnt++; inm->inm_ia = ia; - LIST_INSERT_HEAD(&ia->ia_multiaddrs, + LIST_INSERT_HEAD(&ia->ia_multiaddrs, inm, inm_entry); } LIST_REMOVE(mk, mk_entry); diff --git a/sys/netinet/in_cksum.c b/sys/netinet/in_cksum.c index daac129..9f12495 100644 --- a/sys/netinet/in_cksum.c +++ b/sys/netinet/in_cksum.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: in_cksum.c,v 1.2 1994/08/02 07:48:16 davidg Exp $ */ #include <sys/param.h> @@ -76,7 +76,7 @@ in_cksum(m, len) * of a word spanning between this mbuf and the * last mbuf. * - * s_util.c[0] is already saved when scanning previous + * s_util.c[0] is already saved when scanning previous * mbuf. */ s_util.c[1] = *(char *)w; diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 16dabf7..6f8fe0e 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.2 (Berkeley) 1/4/94 - * $Id: in_pcb.c,v 1.10 1995/04/10 08:52:45 davidg Exp $ + * $Id: in_pcb.c,v 1.11 1995/05/03 07:16:51 davidg Exp $ */ #include <sys/param.h> @@ -208,14 +208,14 @@ in_pcbladdr(inp, nam, plocal_sin) register struct route *ro; ia = (struct in_ifaddr *)0; - /* + /* * If route is known or can be allocated now, * our src addr is taken from the i/f, else punt. */ ro = &inp->inp_route; if (ro->ro_rt && (satosin(&ro->ro_dst)->sin_addr.s_addr != - sin->sin_addr.s_addr || + sin->sin_addr.s_addr || inp->inp_socket->so_options & SO_DONTROUTE)) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; @@ -276,7 +276,7 @@ in_pcbladdr(inp, nam, plocal_sin) * and exit to caller, that will do the lookup. */ *plocal_sin = &ia->ia_addr; - + } return(0); } @@ -357,7 +357,7 @@ in_setsockaddr(inp, nam) struct mbuf *nam; { register struct sockaddr_in *sin; - + nam->m_len = sizeof (*sin); sin = mtod(nam, struct sockaddr_in *); bzero((caddr_t)sin, sizeof (*sin)); @@ -373,7 +373,7 @@ in_setpeeraddr(inp, nam) struct mbuf *nam; { register struct sockaddr_in *sin; - + nam->m_len = sizeof (*sin); sin = mtod(nam, struct sockaddr_in *); bzero((caddr_t)sin, sizeof (*sin)); @@ -470,9 +470,9 @@ in_losing(inp) rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0); if (rt->rt_flags & RTF_DYNAMIC) (void) rtrequest(RTM_DELETE, rt_key(rt), - rt->rt_gateway, rt_mask(rt), rt->rt_flags, + rt->rt_gateway, rt_mask(rt), rt->rt_flags, (struct rtentry **)0); - else + else /* * A new route can be allocated * the next time output is attempted. diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 82fcde2..1a5f6d9 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)in_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: in_proto.c,v 1.13 1995/04/09 01:29:20 davidg Exp $ + * $Id: in_proto.c,v 1.14 1995/05/11 00:13:17 wollman Exp $ */ #include <sys/param.h> @@ -160,7 +160,7 @@ struct protosw inetsw[] = { extern int in_inithead(void **, int); struct domain inetdomain = - { AF_INET, "internet", 0, 0, 0, + { AF_INET, "internet", 0, 0, 0, inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0, in_inithead, 32, sizeof(struct sockaddr_in) }; diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index 73b91b5..150d989 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: in_rmx.c,v 1.11 1995/02/20 15:48:44 davidg Exp $ + * $Id: in_rmx.c,v 1.12 1995/03/19 14:29:01 davidg Exp $ */ /* @@ -114,14 +114,14 @@ static void in_clsroute(struct radix_node *rn, struct radix_node_head *head) { struct rtentry *rt = (struct rtentry *)rn; - + if(!(rt->rt_flags & RTF_UP)) return; /* prophylactic measures */ if((rt->rt_flags & (RTF_LLINFO | RTF_HOST)) != RTF_HOST) return; - if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS)) + if((rt->rt_flags & (RTF_WASCLONED | RTPRF_OURS)) != RTF_WASCLONED) return; @@ -180,10 +180,10 @@ in_rtqkill(struct radix_node *rn, void *rock) ap->killed++; } } else { - if(ap->updating - && (time.tv_sec - rt->rt_rmx.rmx_expire + if(ap->updating + && (time.tv_sec - rt->rt_rmx.rmx_expire > rtq_reallyold)) { - rt->rt_rmx.rmx_expire = time.tv_sec + rt->rt_rmx.rmx_expire = time.tv_sec + rtq_reallyold; } ap->nextstop = lmin(ap->nextstop, diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index f4548c6..a21ec47 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_var.h 8.1 (Berkeley) 6/10/93 - * $Id: in_var.h,v 1.8 1995/03/16 18:14:53 bde Exp $ + * $Id: in_var.h,v 1.9 1995/03/23 18:14:41 wollman Exp $ */ #ifndef _NETINET_IN_VAR_H_ @@ -60,7 +60,7 @@ struct in_ifaddr { struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */ #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ - LIST_HEAD(in_multihead, in_multi) ia_multiaddrs; + LIST_HEAD(in_multihead, in_multi) ia_multiaddrs; /* list of multicast addresses */ }; @@ -80,7 +80,7 @@ struct in_aliasreq { #define IN_LNAOF(in, ifa) \ ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask)) - + #ifdef KERNEL extern struct in_ifaddr *in_ifaddr; diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h index d3e3517..864474a 100644 --- a/sys/netinet/ip.h +++ b/sys/netinet/ip.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip.h 8.1 (Berkeley) 6/10/93 - * $Id: ip.h,v 1.3 1994/08/21 05:27:30 paul Exp $ + * $Id: ip.h,v 1.4 1995/05/05 14:36:38 ache Exp $ */ #ifndef _NETINET_IP_H_ @@ -51,11 +51,11 @@ * against negative integers quite easily, and fail in subtle ways. */ struct ip { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN u_char ip_hl:4, /* header length */ ip_v:4; /* version */ #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN u_char ip_v:4, /* version */ ip_hl:4; /* header length */ #endif @@ -131,11 +131,11 @@ struct ip_timestamp { u_char ipt_code; /* IPOPT_TS */ u_char ipt_len; /* size of structure (variable) */ u_char ipt_ptr; /* index of current entry */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN u_char ipt_flg:4, /* flags, see below */ ipt_oflw:4; /* overflow counter */ #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN u_char ipt_oflw:4, /* overflow counter */ ipt_flg:4; /* flags, see below */ #endif diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index a4bf19f..8e0bc5b 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -24,7 +24,7 @@ #include <sys/protosw.h> #include <sys/socket.h> #include <sys/errno.h> -#include <sys/time.h> +#include <sys/time.h> #include <sys/kernel.h> #include <net/if.h> @@ -42,13 +42,13 @@ #include <netinet/ip_fw.h> -#ifdef IPFIREWALL_DEBUG +#ifdef IPFIREWALL_DEBUG #define dprintf1(a) printf(a) #define dprintf2(a1,a2) printf(a1,a2) #define dprintf3(a1,a2,a3) printf(a1,a2,a3) #define dprintf4(a1,a2,a3,a4) printf(a1,a2,a3,a4) #else -#define dprintf1(a) +#define dprintf1(a) #define dprintf2(a1,a2) #define dprintf3(a1,a2,a3) #define dprintf4(a1,a2,a3,a4) @@ -63,7 +63,7 @@ #ifdef IPFIREWALL_DEBUG #define dprint_ip(a) print_ip(a) #else -#define dprint_ip(a) +#define dprint_ip(a) #endif @@ -118,13 +118,13 @@ struct ip_fw *chain; /* * If the chain is empty - * allow any packet-this is equal + * allow any packet-this is equal * to disabling firewall. */ - if (!chain) - return(1); + if (!chain) + return(1); - /* + /* * This way we handle fragmented packets. * we ignore all fragments but the first one * so the whole packet can't be reassembled. @@ -181,7 +181,7 @@ struct ip_fw *chain; dprintf1("\n"); - for (f=chain;f;f=f->fw_next) + for (f=chain;f;f=f->fw_next) if ((src.s_addr&f->fw_smsk.s_addr)==f->fw_src.s_addr && (dst.s_addr&f->fw_dmsk.s_addr)==f->fw_dst.s_addr) { @@ -190,7 +190,7 @@ struct ip_fw *chain; if (f->fw_flg&IP_FW_F_IFNAME) { - if (!f->fw_via_name[0]) + if (!f->fw_via_name[0]) goto via_match; /* No name/unit set,match any */ if (rif->if_unit==f->fw_via_unit && @@ -198,9 +198,9 @@ struct ip_fw *chain; goto via_match; } else { - if (!f->fw_via_ip.s_addr) + if (!f->fw_via_ip.s_addr) goto via_match; /* No via ip set,match any */ - + for (ia_p=ia;ia_p;ia_p=ia_p->ifa_next) { if (!ia_p->ifa_addr||ia_p->ifa_addr->sa_family!=AF_INET) continue; @@ -212,11 +212,11 @@ struct ip_fw *chain; } } - /* + /* * If we got here,no "via"'s matched,so * we should continue to the next firewall entry. */ - continue; + continue; via_match: f_prt=f->fw_flg&IP_FW_F_KIND; if (f_prt==IP_FW_F_ALL) { @@ -224,8 +224,8 @@ via_match: goto got_match; } else { /* - * This is actually buggy as if you set SYN flag - * on UDp or ICMP firewall it will never work,but + * This is actually buggy as if you set SYN flag + * on UDp or ICMP firewall it will never work,but * actually it is a concern of software which sets * firewall entries. */ @@ -286,7 +286,7 @@ got_match: break; } print_ip(ip->ip_src); - if (ip->ip_p==IPPROTO_TCP || ip->ip_p==IPPROTO_UDP) + if (ip->ip_p==IPPROTO_TCP || ip->ip_p==IPPROTO_UDP) printf(":%d",src_port); printf(" "); print_ip(ip->ip_dst); @@ -317,10 +317,10 @@ bad_packet: */ if (!(f->fw_flg&IP_FW_F_ICMPRPL)) return 0; - m = m_get(M_DONTWAIT, MT_SOOPTS); + m = m_get(M_DONTWAIT, MT_SOOPTS); /* - * We never retry,we don't want to - * waste time-it is not so critical + * We never retry,we don't want to + * waste time-it is not so critical * if ICMP unsent. */ if (!m) @@ -363,8 +363,8 @@ int nh_conv; u_short f_prt, prt=0; char rev=0; - if (!chain) - return; + if (!chain) + return; if (ip->ip_off&IP_OFFMASK) return; @@ -402,7 +402,7 @@ int nh_conv; } if ((f->fw_flg&IP_FW_F_BIDIR) && ((src.s_addr&f->fw_smsk.s_addr)==f->fw_dst.s_addr - && (dst.s_addr&f->fw_dmsk.s_addr)==f->fw_src.s_addr)) { + && (dst.s_addr&f->fw_dmsk.s_addr)==f->fw_src.s_addr)) { rev=1; goto addr_match; } @@ -410,7 +410,7 @@ int nh_conv; addr_match: /* * We use here same code for "via" matching - * as in firewall.This is wrong and does not do + * as in firewall.This is wrong and does not do * much use,because in most cases instead of interface * passed NULL pointer.Need to be completely * rewritten. @@ -420,7 +420,7 @@ addr_match: if (f->fw_flg&IP_FW_F_IFNAME) { - if (!f->fw_via_name[0]) + if (!f->fw_via_name[0]) goto via_match; /* No name/unit set,match any */ if (rif->if_unit==f->fw_via_unit && @@ -428,9 +428,9 @@ addr_match: goto via_match; } else { - if (!f->fw_via_ip.s_addr) + if (!f->fw_via_ip.s_addr) goto via_match; /* No via ip set,match any */ - + for (ia_p=ia;ia_p;ia_p=ia_p->ifa_next) { if (!ia_p->ifa_addr||ia_p->ifa_addr->sa_family!=AF_INET) continue; @@ -442,11 +442,11 @@ addr_match: } } - /* + /* * If we got here,no "via"'s matched,so * we should continue to the next firewall entry. */ - continue; + continue; via_match: f_prt=f->fw_flg&IP_FW_F_KIND; if (f_prt==IP_FW_F_ALL) { @@ -457,10 +457,10 @@ via_match: /* * Rise byte count, * if need to convert from - * host to network byte + * host to network byte * order,do it. */ - if (nh_conv) + if (nh_conv) f->fw_bcnt+=ntohs(ip->ip_len); else f->fw_bcnt+=ip->ip_len; @@ -476,7 +476,7 @@ via_match: f->fw_flg&IP_FW_F_SRNG) && port_match(&f->fw_pts[f->fw_nsp],f->fw_ndp,dst_port, f->fw_flg&IP_FW_F_DRNG))) - || ((rev) + || ((rev) && (port_match(&f->fw_pts[0],f->fw_nsp,dst_port, f->fw_flg&IP_FW_F_SRNG) && port_match(&f->fw_pts[f->fw_nsp],f->fw_ndp,src_port, @@ -486,10 +486,10 @@ via_match: /* * Rise byte count, * if need to convert from - * host to network byte + * host to network byte * order,do it. */ - if (nh_conv) + if (nh_conv) f->fw_bcnt+=ntohs(ip->ip_len); else f->fw_bcnt+=ip->ip_len; @@ -540,7 +540,7 @@ struct ip_fw *frwl; int s=splnet(); u_long m_src_mask,m_dst_mask; u_long n_sa,n_da,o_sa,o_da,o_sm,o_dm,n_sm,n_dm; - u_short n_sr,n_dr,o_sr,o_dr; + u_short n_sr,n_dr,o_sr,o_dr; u_short oldkind,newkind; int addb4=0; int n_o,n_n; @@ -572,7 +572,7 @@ struct ip_fw *frwl; newkind=ftmp->fw_flg & IP_FW_F_KIND; oldkind=chtmp->fw_flg & IP_FW_F_KIND; - if (newkind!=IP_FW_F_ALL + if (newkind!=IP_FW_F_ALL && oldkind!=IP_FW_F_ALL && oldkind!=newkind) { chtmp_prev=chtmp; @@ -596,9 +596,9 @@ struct ip_fw *frwl; m_dst_mask = o_dm & n_dm; if ((o_sa & m_src_mask) == (n_sa & m_src_mask)) { - if (n_sm > o_sm) + if (n_sm > o_sm) addb4++; - if (n_sm < o_sm) + if (n_sm < o_sm) addb4--; } @@ -629,15 +629,15 @@ struct ip_fw *frwl; * of ports. */ - if (ftmp->fw_flg & IP_FW_F_SRNG) + if (ftmp->fw_flg & IP_FW_F_SRNG) n_sr=ftmp->fw_pts[1]-ftmp->fw_pts[0]; - else + else n_sr=(ftmp->fw_nsp)? ftmp->fw_nsp : USHRT_MAX; - - if (chtmp->fw_flg & IP_FW_F_SRNG) + + if (chtmp->fw_flg & IP_FW_F_SRNG) o_sr=chtmp->fw_pts[1]-chtmp->fw_pts[0]; - else + else o_sr=(chtmp->fw_nsp)? chtmp->fw_nsp : USHRT_MAX; @@ -645,7 +645,7 @@ struct ip_fw *frwl; addb4++; if (n_sr>o_sr) addb4--; - + n_n=ftmp->fw_nsp; n_o=chtmp->fw_nsp; /* @@ -657,15 +657,15 @@ struct ip_fw *frwl; (n_o>(IP_FW_MAX_PORTS-2))) goto skip_check; - if (ftmp->fw_flg & IP_FW_F_DRNG) + if (ftmp->fw_flg & IP_FW_F_DRNG) n_dr=ftmp->fw_pts[n_n+1]-ftmp->fw_pts[n_n]; - else + else n_dr=(ftmp->fw_ndp)? ftmp->fw_ndp : USHRT_MAX; - if (chtmp->fw_flg & IP_FW_F_DRNG) + if (chtmp->fw_flg & IP_FW_F_DRNG) o_dr=chtmp->fw_pts[n_o+1]-chtmp->fw_pts[n_o]; - else + else o_dr=(chtmp->fw_ndp)? chtmp->fw_ndp : USHRT_MAX; if (n_dr<o_dr) @@ -678,7 +678,7 @@ skip_check: } if (addb4>0) { if (chtmp_prev) { - chtmp_prev->fw_next=ftmp; + chtmp_prev->fw_next=ftmp; ftmp->fw_next=chtmp; } else { *chainptr=ftmp; @@ -727,7 +727,7 @@ struct ip_fw *frwl; while(ftmp) { matches=1; - if (ftmp->fw_src.s_addr!=frwl->fw_src.s_addr + if (ftmp->fw_src.s_addr!=frwl->fw_src.s_addr || ftmp->fw_dst.s_addr!=frwl->fw_dst.s_addr || ftmp->fw_smsk.s_addr!=frwl->fw_smsk.s_addr || ftmp->fw_dmsk.s_addr!=frwl->fw_dmsk.s_addr @@ -756,12 +756,12 @@ struct ip_fw *frwl; } else { - *chainptr=ftmp->fw_next; + *chainptr=ftmp->fw_next; free(ftmp,M_IPFW); ftmp=*chainptr; } - - } + + } else { ltmp = ftmp; @@ -795,7 +795,7 @@ struct ip_fw *frwl; while(ftmp) { matches=1; - if (ftmp->fw_src.s_addr!=frwl->fw_src.s_addr + if (ftmp->fw_src.s_addr!=frwl->fw_src.s_addr || ftmp->fw_dst.s_addr!=frwl->fw_dst.s_addr || ftmp->fw_smsk.s_addr!=frwl->fw_smsk.s_addr || ftmp->fw_dmsk.s_addr!=frwl->fw_dmsk.s_addr @@ -885,7 +885,7 @@ if ( stage == IP_ACCT_FLUSH ) { free_fw_chain(&ip_acct_chain); return(0); - } + } if ( stage == IP_ACCT_ZERO ) { zero_fw_chain(ip_acct_chain); @@ -925,16 +925,16 @@ if ( stage == IP_ACCT_ADD #ifdef IPFIREWALL int ip_fw_ctl(stage,m) -int stage; +int stage; struct mbuf *m; { if ( stage == IP_FW_FLUSH ) { free_fw_chain(&ip_fw_chain); return(0); - } + } -if ( m == 0 ) +if ( m == 0 ) { printf("ip_fw_ctl: NULL mbuf ptr\n"); return(EINVAL); @@ -955,11 +955,11 @@ if ( stage == IP_FW_POLICY ) * to firewall chain or deleting'em */ -if ( stage == IP_FW_ADD || +if ( stage == IP_FW_ADD || stage == IP_FW_DEL ) { struct ip_fw *frwl; - + if (!(frwl=check_ipfw_struct(m))) return (EINVAL); @@ -976,7 +976,7 @@ if ( stage == IP_FW_ADD || return(EINVAL); #endif } -} +} dprintf2("ip_fw_ctl: unknown request %d\n",stage); return(EINVAL); diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index 87ba0fb..47e5131 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -86,15 +86,15 @@ struct ip_fw { #define IP_FW_F_IFNAME 0x200 /* Use interface name/unit (not IP) */ #define IP_FW_F_MASK 0x3FF /* All possible flag bits mask */ -/* +/* * New IP firewall options for [gs]etsockopt at the RAW IP level. - */ + */ #define IP_FW_BASE_CTL 53 #define IP_FW_ADD (IP_FW_BASE_CTL) #define IP_FW_DEL (IP_FW_BASE_CTL+4) #define IP_FW_FLUSH (IP_FW_BASE_CTL+6) -#define IP_FW_POLICY (IP_FW_BASE_CTL+7) +#define IP_FW_POLICY (IP_FW_BASE_CTL+7) #define IP_ACCT_ADD (IP_FW_BASE_CTL+10) #define IP_ACCT_DEL (IP_FW_BASE_CTL+11) diff --git a/sys/netinet/ip_fwdef.c b/sys/netinet/ip_fwdef.c index c1050e5..2f2a966 100644 --- a/sys/netinet/ip_fwdef.c +++ b/sys/netinet/ip_fwdef.c @@ -13,7 +13,7 @@ */ /* - * Dumb definitions which needed when + * Dumb definitions which needed when * firewall/accounting module is not loaded. */ @@ -22,7 +22,7 @@ #include <sys/domain.h> #include <sys/socket.h> #include <sys/errno.h> -#include <sys/time.h> +#include <sys/time.h> #include <sys/kernel.h> #include <net/if.h> diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 031de2e..d7b4a11 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_icmp.c,v 1.5 1995/02/16 00:27:43 wollman Exp $ + * $Id: ip_icmp.c,v 1.6 1995/03/16 18:14:54 bde Exp $ */ #include <sys/param.h> @@ -128,7 +128,7 @@ icmp_error(n, type, code, dest, destifp) icp->icmp_gwaddr.s_addr = dest; else { icp->icmp_void = 0; - /* + /* * The following assignments assume an overlay with the * zeroed icmp_void field. */ @@ -246,7 +246,7 @@ icmp_input(m, hlen) case ICMP_UNREACH_NEEDFRAG: code = PRC_MSGSIZE; break; - + case ICMP_UNREACH_NET_UNKNOWN: case ICMP_UNREACH_NET_PROHIB: case ICMP_UNREACH_TOSNET: @@ -319,7 +319,7 @@ icmp_input(m, hlen) icp->icmp_rtime = iptime(); icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */ goto reflect; - + case ICMP_MASKREQ: #define satosin(sa) ((struct sockaddr_in *)(sa)) if (icmpmaskrepl == 0) @@ -378,7 +378,7 @@ reflect: icmpdst.sin_addr = icp->icmp_gwaddr; #ifdef ICMPPRINTFS if (icmpprintfs) - printf("redirect dst %lx to %lx\n", + printf("redirect dst %lx to %lx\n", NTOHL(icp->icmp_ip.ip_dst.s_addr), NTOHL(icp->icmp_gwaddr.s_addr)); #endif @@ -495,7 +495,7 @@ icmp_reflect(m) /* * Should check for overflow, but it "can't happen" */ - if (opt == IPOPT_RR || opt == IPOPT_TS || + if (opt == IPOPT_RR || opt == IPOPT_TS || opt == IPOPT_SECURITY) { bcopy((caddr_t)cp, mtod(opts, caddr_t) + opts->m_len, len); diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h index 1a73e0d..aa0e3e1 100644 --- a/sys/netinet/ip_icmp.h +++ b/sys/netinet/ip_icmp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_icmp.h,v 1.2 1994/08/02 07:48:35 davidg Exp $ + * $Id: ip_icmp.h,v 1.3 1994/08/21 05:27:31 paul Exp $ */ #ifndef _NETINET_IP_ICMP_H_ @@ -60,7 +60,7 @@ struct icmp { /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ struct ih_pmtu { - n_short ipm_void; + n_short ipm_void; n_short ipm_nextmtu; } ih_pmtu; } icmp_hun; diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 89498b9..22a4f45 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.20 1995/05/09 13:35:45 davidg Exp $ + * $Id: ip_input.c,v 1.21 1995/05/11 00:13:18 wollman Exp $ */ #include <sys/param.h> @@ -255,12 +255,12 @@ next: goto next; /* greedy RSVP, snatches any PATH packet of the RSVP protocol and no - * matter if it is destined to another node, or whether it is + * matter if it is destined to another node, or whether it is * a multicast one, RSVP wants it! and prevents it from being forwarded * anywhere else. Also checks if the rsvp daemon is running before * grabbing the packet. */ - if (ip_rsvpd != NULL && ip->ip_p==IPPROTO_RSVP) + if (ip_rsvpd != NULL && ip->ip_p==IPPROTO_RSVP) goto ours; /* @@ -357,9 +357,9 @@ ours: /* * If packet came to us we count it... - * This way we count all incoming packets which has + * This way we count all incoming packets which has * not been forwarded... - * Do not convert ip_len to host byte order when + * Do not convert ip_len to host byte order when * counting,ppl already made it for us before.. */ if (ip_acct_cnt_ptr!=NULL) @@ -747,7 +747,7 @@ ip_dooptions(m) char buf[4*sizeof "123"]; strcpy(buf, inet_ntoa(ip->ip_dst)); - log(LOG_WARNING, + log(LOG_WARNING, "attempted source route from %s to %s\n", inet_ntoa(ip->ip_src), buf); type = ICMP_UNREACH; @@ -1207,17 +1207,17 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case IPCTL_DEFTTL: return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_defttl)); case IPCTL_SOURCEROUTE: - return (sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_dosourceroute)); #ifdef notyet case IPCTL_DEFMTU: return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); #endif case IPCTL_RTEXPIRE: - return (sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &rtq_reallyold)); case IPCTL_RTMINEXPIRE: - return (sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &rtq_minreallyold)); case IPCTL_RTMAXCACHE: return (sysctl_int(oldp, oldlenp, newp, newlen, diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index fc5b618..7226fd4 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -138,8 +138,8 @@ u_long timeout_val = 0; /* count of outstanding upcalls */ /* * Define the token bucket filter structures - * tbftable -> each vif has one of these for storing info - * qtable -> each interface has an associated queue of pkts + * tbftable -> each vif has one of these for storing info + * qtable -> each interface has an associated queue of pkts */ struct tbf tbftable[MAXVIFS]; @@ -169,7 +169,7 @@ struct ip multicast_encap_iphdr = { sizeof(struct ip), /* total length */ 0, /* id */ 0, /* frag offset */ - ENCAP_TTL, ENCAP_PROTO, + ENCAP_TTL, ENCAP_PROTO, 0, /* checksum */ }; @@ -217,7 +217,7 @@ void multiencap_decap(struct mbuf *m); /* * A simple hash function: returns MFCHASHMOD of the low-order octet of * the argument's network or subnet number and the multicast group assoc. - */ + */ static u_long nethash_fc(m,n) register u_long m; @@ -269,7 +269,7 @@ struct mfc *mfchash[MFCHASHSIZ]; */ static struct mfc * mfcfind(origin, mcastgrp) - u_long origin; + u_long origin; u_long mcastgrp; { register struct mbuf *mb_rt; @@ -538,7 +538,7 @@ X_ip_mrouter_done() */ last_encap_src = NULL; last_encap_vif = NULL; - + ip_mrouter = NULL; splx(s); @@ -632,12 +632,12 @@ add_vif(vifcp) if (mrtdebug) log(LOG_DEBUG, "add_vif #%d, lcladdr %x, %s %x, thresh %x, rate %d\n", - vifcp->vifc_vifi, + vifcp->vifc_vifi, ntohl(vifcp->vifc_lcl_addr.s_addr), (vifcp->vifc_flags & VIFF_TUNNEL) ? "rmtaddr" : "mask", ntohl(vifcp->vifc_rmt_addr.s_addr), vifcp->vifc_threshold, - vifcp->vifc_rate_limit); + vifcp->vifc_rate_limit); return 0; } @@ -727,16 +727,16 @@ add_mfc(mfccp) return 0; } - /* + /* * Find the entry for which the upcall was made and update */ s = splnet(); hash = nethash_fc(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr); - for (prev_mb_rt = mb_rt = mfctable[hash], nstl = 0; + for (prev_mb_rt = mb_rt = mfctable[hash], nstl = 0; mb_rt; prev_mb_rt = mb_rt, mb_rt = mb_rt->m_next) { rt = mtod(mb_rt, struct mfc *); - if (((rt->mfc_origin.s_addr & mfccp->mfcc_originmask.s_addr) + if (((rt->mfc_origin.s_addr & mfccp->mfcc_originmask.s_addr) == mfccp->mfcc_origin.s_addr) && (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) && (mb_rt->m_act != NULL)) { @@ -768,14 +768,14 @@ add_mfc(mfccp) while (mb_rt->m_act) { mb_ntry = mb_rt->m_act; rte = mtod(mb_ntry, struct rtdetq *); - ip_mdq(rte->m, rte->ifp, rte->tunnel_src, + ip_mdq(rte->m, rte->ifp, rte->tunnel_src, rt1, rte->imo); mb_rt->m_act = mb_ntry->m_act; m_freem(rte->m); m_free(mb_ntry); } - /* + /* * If more than one entry was created for a single upcall * delete that entry */ @@ -796,12 +796,12 @@ add_mfc(mfccp) ntohl(mfccp->mfcc_mcastgrp.s_addr), ntohl(mfccp->mfcc_originmask.s_addr), mfccp->mfcc_parent); - + for (prev_mb_rt = mb_rt = mfctable[hash]; mb_rt; prev_mb_rt = mb_rt, mb_rt = mb_rt->m_next) { - + rt = mtod(mb_rt, struct mfc *); - if (((rt->mfc_origin.s_addr & mfccp->mfcc_originmask.s_addr) + if (((rt->mfc_origin.s_addr & mfccp->mfcc_originmask.s_addr) == mfccp->mfcc_origin.s_addr) && (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) { @@ -822,9 +822,9 @@ add_mfc(mfccp) splx(s); return ENOBUFS; } - + rt = mtod(mb_rt, struct mfc *); - + /* insert new entry at head of hash chain */ rt->mfc_origin = mfccp->mfcc_origin; rt->mfc_originmask = mfccp->mfcc_originmask; @@ -834,7 +834,7 @@ add_mfc(mfccp) VIFM_COPY(mfccp->mfcc_ttls[i], rt->mfc_ttls[i]); /* initialize pkt counters per src-grp */ rt->mfc_pkt_cnt = 0; - + /* link into table */ mb_rt->m_next = mfctable[hash]; mfctable[hash] = mb_rt; @@ -964,7 +964,7 @@ X_ip_mforward(ip, ifp, m, imo) * on intermediate routing hosts! Therefore, we hereby * change the spec. */ - + /* * Verify that the tunnel options are well-formed. */ @@ -1038,7 +1038,7 @@ X_ip_mforward(ip, ifp, m, imo) hash = nethash_fc(ip->ip_src.s_addr, ip->ip_dst.s_addr); for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) { rt = mtod(mb_rt, struct mfc *); - if (((ip->ip_src.s_addr & rt->mfc_originmask.s_addr) == + if (((ip->ip_src.s_addr & rt->mfc_originmask.s_addr) == rt->mfc_origin.s_addr) && (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) && (mb_rt->m_act != NULL)) @@ -1104,33 +1104,33 @@ X_ip_mforward(ip, ifp, m, imo) splx(s); if (hash == 0) { - /* - * Send message to routing daemon to install + /* + * Send message to routing daemon to install * a route into the kernel table */ k_igmpsrc.sin_addr = ip->ip_src; k_igmpdst.sin_addr = ip->ip_dst; - + mm = m_copy(m, 0, M_COPYALL); if (mm == NULL) { splx(s); return ENOBUFS; } - + k_data = mtod(mm, struct ip *); k_data->ip_p = 0; - + mrtstat.mrts_upcalls++; rip_ip_input(mm, ip_mrouter, (struct sockaddr *)&k_igmpsrc); - + /* set timer to cleanup entry if upcall is lost */ timeout(cleanup_cache, (caddr_t)mb_rt, 100); timeout_val++; } - + return 0; - } + } } #ifndef MROUTE_LKM @@ -1158,8 +1158,8 @@ cleanup_cache(xmb_rt) hash = nethash_fc(rt->mfc_origin.s_addr, rt->mfc_mcastgrp.s_addr); if (mrtdebug) - log(LOG_DEBUG, "ip_mforward: cleanup ipm %d h %d s %x g %x\n", - ip_mrouter, hash, ntohl(rt->mfc_origin.s_addr), + log(LOG_DEBUG, "ip_mforward: cleanup ipm %d h %d s %x g %x\n", + ip_mrouter, hash, ntohl(rt->mfc_origin.s_addr), ntohl(rt->mfc_mcastgrp.s_addr)); mrtstat.mrts_cache_cleanups++; @@ -1172,7 +1172,7 @@ cleanup_cache(xmb_rt) if (m0 == mb_rt) break; - /* + /* * drop all the packets * free the mbuf with the pkt, if, timing info */ @@ -1185,14 +1185,14 @@ cleanup_cache(xmb_rt) m_free(m); } - /* + /* * Delete the entry from the cache */ if (prev_m0 != m0) { /* if moved past head of list */ MFREE(m0, prev_m0->m_next); } else /* delete head of list, it is in the table */ mfctable[hash] = m_free(m0); - + timeout_val--; splx(s); } @@ -1227,7 +1227,7 @@ ip_mdq(m, ifp, tunnel_src, rt, imo) /* came in the wrong interface */ if (mrtdebug) log(LOG_DEBUG, "wrong if: ifp %x vifi %d\n", - ifp, vifi); + ifp, vifi); ++mrtstat.mrts_wrong_if; return (int)tunnel_src; } @@ -1250,13 +1250,13 @@ ip_mdq(m, ifp, tunnel_src, rt, imo) encap_send((ip), (vifp), (m)); \ else \ phyint_send((ip), (vifp), (m)); \ - } + } -/* If no options or the imo_multicast_vif option is 0, don't do this part +/* If no options or the imo_multicast_vif option is 0, don't do this part */ - if ((imo != NULL) && - (( vifi = imo->imo_multicast_vif - 1) < numvifs) /*&& (vifi>=0)*/) - { + if ((imo != NULL) && + (( vifi = imo->imo_multicast_vif - 1) < numvifs) /*&& (vifi>=0)*/) + { MC_SEND(ip,viftable+vifi,m); return (1); /* make sure we are done: No more physical sends */ } @@ -1270,7 +1270,7 @@ ip_mdq(m, ifp, tunnel_src, rt, imo) } /* check if a vif number is legal/ok. This is used by ip_output, to export - * numvifs there, + * numvifs there, */ int X_legal_vif_num(vif) @@ -1394,7 +1394,7 @@ srcrt_send(ip, vifp, m) if (vifp->v_rate_limit <= 0) tbf_send_packet(vifp, mb_opts, 0); else - tbf_control(vifp, mb_opts, + tbf_control(vifp, mb_opts, mtod(mb_opts, struct ip *), ip_copy->ip_len, 0); } @@ -1502,7 +1502,7 @@ multiencap_decap(m) } if (ip->ip_src.s_addr != last_encap_src) { register struct vif *vife; - + vifp = viftable; vife = vifp + numvifs; last_encap_src = ip->ip_src.s_addr; @@ -1564,7 +1564,7 @@ tbf_control(vifp, m, ip, p_len, imo) { tbf_update_tokens(vifp); - /* if there are enough tokens, + /* if there are enough tokens, * and the queue is empty, * send this packet out */ @@ -1601,11 +1601,11 @@ tbf_control(vifp, m, ip, p_len, imo) return; } -/* +/* * adds a packet to the queue at the interface */ void -tbf_queue(vifp, m, ip, imo) +tbf_queue(vifp, m, ip, imo) register struct vif *vifp; register struct mbuf *m; register struct ip *ip; @@ -1627,7 +1627,7 @@ tbf_queue(vifp, m, ip, imo) } -/* +/* * processes the queue at the interface */ void @@ -1665,11 +1665,11 @@ tbf_process_q(vifp) splx(s); } -/* +/* * removes the jth packet from the queue at the interface */ void -tbf_dequeue(vifp,j) +tbf_dequeue(vifp,j) register struct vif *vifp; register int j; { @@ -1681,7 +1681,7 @@ tbf_dequeue(vifp,j) qtable[index][i-1].pkt_len = qtable[index][i].pkt_len; qtable[index][i-1].pkt_ip = qtable[index][i].pkt_ip; qtable[index][i-1].pkt_imo = qtable[index][i].pkt_imo; - } + } qtable[index][i-1].pkt_m = NULL; qtable[index][i-1].pkt_len = NULL; qtable[index][i-1].pkt_ip = NULL; @@ -1698,7 +1698,7 @@ tbf_reprocess_q(xvifp) void *xvifp; { register struct vif *vifp = xvifp; - if (ip_mrouter == NULL) + if (ip_mrouter == NULL) return; tbf_update_tokens(vifp); @@ -1806,7 +1806,7 @@ priority(vifp, ip) /* temporary hack; will add general packet classifier some day */ prio = 50; /* default priority */ - + /* check for source route options and add option length to get dst */ if (vifp->v_flags & VIFF_SRCRT) graddr = ntohl((ip+8)->ip_dst.s_addr); @@ -1845,7 +1845,7 @@ priority(vifp, ip) } /* - * End of token bucket filter modifications + * End of token bucket filter modifications */ #ifdef MROUTE_LKM diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h index 945c6bd..4c815e8 100644 --- a/sys/netinet/ip_mroute.h +++ b/sys/netinet/ip_mroute.h @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_mroute.h,v 1.5 1994/09/14 03:10:12 wollman Exp $ + * $Id: ip_mroute.h,v 1.6 1995/03/16 18:14:59 bde Exp $ */ #ifndef _NETINET_IP_MROUTE_H_ @@ -125,7 +125,7 @@ struct vif_req { u_char v_flags; /* VIFF_ flags defined above */ u_char v_threshold; /* min ttl required to forward on vif */ struct in_addr v_lcl_addr; /* local interface address */ - struct in_addr v_rmt_addr; + struct in_addr v_rmt_addr; char v_if_name[IFNAMSIZ]; /* if name */ }; @@ -170,7 +170,7 @@ struct sioc_vif_req { u_long icount; u_long ocount; }; - + #ifdef KERNEL @@ -187,8 +187,8 @@ struct vif { }; /* - * The kernel's multicast forwarding cache entry structure - * (A field for the type of service (mfc_tos) is to be added + * The kernel's multicast forwarding cache entry structure + * (A field for the type of service (mfc_tos) is to be added * at a future point) */ struct mfc { @@ -220,7 +220,7 @@ struct rtdetq { #define MAX_UPQ 4 /* max. no of pkts in upcall Q */ /* - * Token Bucket filter code + * Token Bucket filter code */ #define MAX_BKT_SIZE 10000 /* 10K bytes size */ #define MAXQSIZE 10 /* max # of pkts in queue */ @@ -228,7 +228,7 @@ struct rtdetq { /* * queue structure at each vif */ -struct pkt_queue +struct pkt_queue { u_long pkt_len; /* length of packet in queue */ struct mbuf *pkt_m; /* pointer to packet mbuf */ diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 8869323..8e6fb56 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $Id: ip_output.c,v 1.17 1995/04/26 18:10:55 pst Exp $ + * $Id: ip_output.c,v 1.18 1995/05/09 13:35:46 davidg Exp $ */ #include <sys/param.h> @@ -1065,7 +1065,7 @@ ip_getmoptions(optname, imo, mp) switch (optname) { - case IP_MULTICAST_VIF: + case IP_MULTICAST_VIF: if (imo != NULL) *(mtod(*mp, int *)) = imo->imo_multicast_vif; else diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index a1f0c42..73bd43d 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_var.h 8.1 (Berkeley) 6/10/93 - * $Id: ip_var.h,v 1.8 1995/03/16 16:25:42 wollman Exp $ + * $Id: ip_var.h,v 1.9 1995/03/16 18:15:01 bde Exp $ */ #ifndef _NETINET_IP_VAR_H_ @@ -71,11 +71,11 @@ struct ipq { * Note: ipf_next must be at same offset as ipq_next above */ struct ipasfrag { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN u_char ip_hl:4, ip_v:4; #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN u_char ip_v:4, ip_hl:4; #endif diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 441f5f5..89697a0 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 - * $Id: raw_ip.c,v 1.17 1995/04/09 01:29:23 davidg Exp $ + * $Id: raw_ip.c,v 1.18 1995/05/12 20:00:21 ache Exp $ */ #include <sys/param.h> @@ -249,7 +249,7 @@ rip_ctloutput(op, so, level, optname, m) } if (op == PRCO_SETOPT) { - error=(*ip_fw_ctl_ptr)(optname, *m); + error=(*ip_fw_ctl_ptr)(optname, *m); if (*m) (void)m_free(*m); } @@ -261,13 +261,13 @@ rip_ctloutput(op, so, level, optname, m) case IP_ACCT_ADD: case IP_ACCT_CLR: case IP_ACCT_FLUSH: - case IP_ACCT_ZERO: + case IP_ACCT_ZERO: if (ip_acct_ctl_ptr==NULL) { if (*m) (void)m_free(*m); return(EINVAL); } - + if (op == PRCO_SETOPT) { error=(*ip_acct_ctl_ptr)(optname, *m); if (*m) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index cb7d75c..a79acf9 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp.h 8.1 (Berkeley) 6/10/93 - * $Id: tcp.h,v 1.4 1995/02/08 20:18:44 wollman Exp $ + * $Id: tcp.h,v 1.5 1995/02/14 02:35:14 wollman Exp $ */ #ifndef _NETINET_TCP_H_ @@ -49,11 +49,11 @@ struct tcphdr { u_short th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN u_char th_x2:4, /* (unused) */ th_off:4; /* data offset */ #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN u_char th_off:4, /* data offset */ th_x2:4; /* (unused) */ #endif diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 47fd018..bf0fd0c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.23 1995/05/09 12:32:06 olah Exp $ + * $Id: tcp_input.c,v 1.24 1995/05/11 01:41:06 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -318,7 +318,7 @@ tcp_input(m, iphlen) } optlen = off - sizeof (struct tcphdr); optp = mtod(m, caddr_t) + sizeof (struct tcpiphdr); - /* + /* * Do quick retrieval of timestamp options ("options * prediction?"). If timestamp is the only option and it's * formatted as recommended in RFC 1323 appendix A, we @@ -382,7 +382,7 @@ findpcb: goto dropwithreset; if (tp->t_state == TCPS_CLOSED) goto drop; - + /* Unscale the window into a 32-bit value. */ if ((tiflags & TH_SYN) == 0) tiwin = ti->ti_win << tp->snd_scale; @@ -447,7 +447,7 @@ findpcb: tcp_dooptions(tp, optp, optlen, ti, &to); - /* + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has * no control flags, is in-sequence, the window didn't @@ -480,7 +480,7 @@ findpcb: tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { - /* + /* * If last ACK falls within this segment's sequence numbers, * record the timestamp. * NOTE that the test is modified according to the latest @@ -666,7 +666,7 @@ findpcb: tp->cc_recv = to.to_cc; /* * Perform TAO test on incoming CC (SEG.CC) option, if any. - * - compare SEG.CC against cached CC from the same host, + * - compare SEG.CC against cached CC from the same host, * if any. * - if SEG.CC > chached value, SYN must be new and is accepted * immediately: save new CC in the cache, mark the socket @@ -794,7 +794,7 @@ findpcb: /* Segment is acceptable, update cache if undefined. */ if (taop->tao_ccsent == 0) taop->tao_ccsent = to.to_ccecho; - + tp->rcv_adv += tp->rcv_wnd; tp->snd_una++; /* SYN is acked */ /* @@ -822,19 +822,19 @@ findpcb: /* * Received initial SYN in SYN-SENT[*] state => simul- * taneous open. If segment contains CC option and there is - * a cached CC, apply TAO test; if it succeeds, connection is + * a cached CC, apply TAO test; if it succeeds, connection is * half-synchronized. Otherwise, do 3-way handshake: * SYN-SENT -> SYN-RECEIVED * SYN-SENT* -> SYN-RECEIVED* * If there was no CC option, clear cached CC value. */ tp->t_flags |= TF_ACKNOW; - tp->t_timer[TCPT_REXMT] = 0; + tp->t_timer[TCPT_REXMT] = 0; if (to.to_flag & TOF_CC) { if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) { /* - * update cache and make transition: + * update cache and make transition: * SYN-SENT -> ESTABLISHED* * SYN-SENT* -> FIN-WAIT-1* */ @@ -852,7 +852,7 @@ findpcb: taop->tao_cc = 0; tp->t_state = TCPS_SYN_RECEIVED; } - } + } trimthenstep6: /* @@ -877,7 +877,7 @@ trimthenstep6: * our data will be ACK'd; if so, enter normal data segment * processing in the middle of step 5, ack processing. * Otherwise, goto step 6. - */ + */ if (tiflags & TH_ACK) goto process_ACK; goto step6; @@ -893,8 +893,8 @@ trimthenstep6: * segment, hoping to find new TCPCB in LISTEN state; * * else must be old SYN; drop it. - * else do normal processing. - */ + * else do normal processing. + */ case TCPS_LAST_ACK: case TCPS_CLOSING: case TCPS_TIME_WAIT: @@ -917,7 +917,7 @@ trimthenstep6: * States other than LISTEN or SYN_SENT. * First check timestamp, if present. * Then check the connection count, if present. - * Then check that at least some bytes of segment are within + * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. * @@ -965,7 +965,7 @@ trimthenstep6: if (tiflags & TH_SYN) { tiflags &= ~TH_SYN; ti->ti_seq++; - if (ti->ti_urp > 1) + if (ti->ti_urp > 1) ti->ti_urp--; else tiflags &= ~TH_URG; @@ -1064,7 +1064,7 @@ trimthenstep6: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ - if ((to.to_flag & TOF_TS) != 0 && + if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; @@ -1125,7 +1125,7 @@ trimthenstep6: else goto drop; } - + /* * Ack processing. */ @@ -1159,7 +1159,7 @@ trimthenstep6: taop->tao_cc = tp->cc_recv; /* - * Make transitions: + * Make transitions: * SYN-RECEIVED -> ESTABLISHED * SYN-RECEIVED* -> FIN-WAIT-1 */ @@ -1168,7 +1168,7 @@ trimthenstep6: tp->t_flags &= ~TF_NEEDFIN; } else tp->t_state = TCPS_ESTABLISHED; - /* + /* * If segment contains data or ACK, will call tcp_reass() * later; if not, do so now to pass queued data to user. */ @@ -1216,7 +1216,7 @@ trimthenstep6: * the new ssthresh). * * Dup acks mean that packets have left the - * network (they're now cached at the receiver) + * network (they're now cached at the receiver) * so bump cwnd by the amount in the receiver * to keep a constant cwnd packets in the * network. @@ -1265,11 +1265,11 @@ trimthenstep6: goto dropafterack; } /* - * If we reach this point, ACK is not a duplicate, + * If we reach this point, ACK is not a duplicate, * i.e., it ACKs something we sent. */ if (tp->t_flags & TF_NEEDSYN) { - /* + /* * T/TCP: Connection was half-synchronized, and our * SYN has been ACK'd (so connection is now fully * synchronized). Go to non-starred state and @@ -1422,7 +1422,7 @@ step6: * Don't look at window if no ACK: TAC's send garbage on first SYN. */ if ((tiflags & TH_ACK) && - (SEQ_LT(tp->snd_wl1, ti->ti_seq) || + (SEQ_LT(tp->snd_wl1, ti->ti_seq) || (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) || (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ @@ -1457,14 +1457,14 @@ step6: * If this segment advances the known urgent pointer, * then mark the data stream. This should not happen * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since - * a FIN has been received from the remote side. + * a FIN has been received from the remote side. * In these states we ignore the URG. * * According to RFC961 (Assigned Protocols), * the urgent pointer points to the last octet * of urgent data. We continue, however, * to consider it to indicate the first octet - * of data past the urgent section as the original + * of data past the urgent section as the original * spec states (in one of two places). */ if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) { @@ -1532,11 +1532,11 @@ dodata: /* XXX */ * (ie SEND_SYN flag on) then delay ACK, * so it may be piggybacked when SYN is sent. * Otherwise, since we received a FIN then no - * more input can be expected, send ACK now. + * more input can be expected, send ACK now. */ if (tp->t_flags & TF_NEEDSYN) tp->t_flags |= TF_DELACK; - else + else tp->t_flags |= TF_ACKNOW; tp->rcv_nxt++; } @@ -1561,7 +1561,7 @@ dodata: /* XXX */ /* * In FIN_WAIT_2 state enter the TIME_WAIT state, - * starting the time-wait timer, turning off the other + * starting the time-wait timer, turning off the other * standard timers. */ case TCPS_FIN_WAIT_2: @@ -1714,7 +1714,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) (char *)&to->to_tsecr, sizeof(to->to_tsecr)); NTOHL(to->to_tsecr); - /* + /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. */ @@ -1731,7 +1731,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) bcopy((char *)cp + 2, (char *)&to->to_cc, sizeof(to->to_cc)); NTOHL(to->to_cc); - /* + /* * A CC or CC.new option received in a SYN makes * it ok to send CC in subsequent segments. */ @@ -1747,7 +1747,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) bcopy((char *)cp + 2, (char *)&to->to_cc, sizeof(to->to_cc)); NTOHL(to->to_cc); - /* + /* * A CC or CC.new option received in a SYN makes * it ok to send CC in subsequent segments. */ @@ -1782,7 +1782,7 @@ tcp_pulloutofband(so, ti, m) register struct mbuf *m; { int cnt = ti->ti_urp - 1; - + while (cnt >= 0) { if (m->m_len > cnt) { char *cp = mtod(m, caddr_t) + cnt; @@ -1841,7 +1841,7 @@ tcp_xmit_timer(tp, rtt) if ((tp->t_rttvar += delta) <= 0) tp->t_rttvar = 1; } else { - /* + /* * No rtt measurement yet - use the unsmoothed rtt. * Set the variance to half the rtt (so our first * retransmit happens at 3*rtt). @@ -1865,7 +1865,7 @@ tcp_xmit_timer(tp, rtt) */ TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), tp->t_rttmin, TCPTV_REXMTMAX); - + /* * We received an ack for a packet that wasn't retransmitted; * it is probably safe to discard any error indications we've diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b3f5365..33a6b83 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.3 (Berkeley) 12/30/93 - * $Id: tcp_output.c,v 1.9 1995/04/09 01:29:25 davidg Exp $ + * $Id: tcp_output.c,v 1.10 1995/05/09 13:35:47 davidg Exp $ */ #include <sys/param.h> @@ -226,7 +226,7 @@ again: * window, then want to send a window update to peer. */ if (win > 0) { - /* + /* * "adv" is the amount we can increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. @@ -313,7 +313,7 @@ send: mss = htons((u_short) tcp_mssopt(tp)); (void)memcpy(opt + 2, &mss, sizeof(mss)); optlen = TCPOLEN_MAXSEG; - + if ((tp->t_flags & TF_REQ_SCALE) && ((flags & TH_ACK) == 0 || (tp->t_flags & TF_RCVD_SCALE))) { @@ -326,9 +326,9 @@ send: } } } - + /* - * Send a timestamp and echo-reply if this is a SYN and our side + * Send a timestamp and echo-reply if this is a SYN and our side * wants to use timestamps (TF_REQ_TSTMP is set) or both our side * and our peer have sent timestamps in our SYN's. */ @@ -337,7 +337,7 @@ send: ((flags & TH_ACK) == 0 || (tp->t_flags & TF_RCVD_TSTMP))) { u_long *lp = (u_long *)(opt + optlen); - + /* Form timestamp option as shown in appendix A of RFC 1323. */ *lp++ = htonl(TCPOPT_TSTAMP_HDR); *lp++ = htonl(tcp_now); @@ -373,7 +373,7 @@ send: opt[optlen++] = TCPOPT_CC; opt[optlen++] = TCPOLEN_CC; *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send); - + optlen += 4; break; @@ -408,7 +408,7 @@ send: opt[optlen++] = TCPOPT_NOP; opt[optlen++] = TCPOPT_CC; opt[optlen++] = TCPOLEN_CC; - *(u_int32_t *)&opt[optlen] = + *(u_int32_t *)&opt[optlen] = htonl(tp->cc_send); optlen += 4; opt[optlen++] = TCPOPT_NOP; @@ -424,7 +424,7 @@ send: } hdrlen += optlen; - + /* * Adjust data length if insertion of options will * bump the packet length beyond the t_maxopd length. @@ -527,7 +527,7 @@ send: * window for use in delaying messages about window sizes. * If resending a FIN, be sure not to use a new sequence number. */ - if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && + if (flags & TH_FIN && tp->t_flags & TF_SENTFIN && tp->snd_nxt == tp->snd_max) tp->snd_nxt--; /* @@ -665,7 +665,7 @@ send: error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE, 0); #else - error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route, + error = ip_output(m, (struct mbuf *)0, &tp->t_inpcb->inp_route, so->so_options & SO_DONTROUTE); #endif } diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 47fd018..bf0fd0c 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.23 1995/05/09 12:32:06 olah Exp $ + * $Id: tcp_input.c,v 1.24 1995/05/11 01:41:06 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -318,7 +318,7 @@ tcp_input(m, iphlen) } optlen = off - sizeof (struct tcphdr); optp = mtod(m, caddr_t) + sizeof (struct tcpiphdr); - /* + /* * Do quick retrieval of timestamp options ("options * prediction?"). If timestamp is the only option and it's * formatted as recommended in RFC 1323 appendix A, we @@ -382,7 +382,7 @@ findpcb: goto dropwithreset; if (tp->t_state == TCPS_CLOSED) goto drop; - + /* Unscale the window into a 32-bit value. */ if ((tiflags & TH_SYN) == 0) tiwin = ti->ti_win << tp->snd_scale; @@ -447,7 +447,7 @@ findpcb: tcp_dooptions(tp, optp, optlen, ti, &to); - /* + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has * no control flags, is in-sequence, the window didn't @@ -480,7 +480,7 @@ findpcb: tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { - /* + /* * If last ACK falls within this segment's sequence numbers, * record the timestamp. * NOTE that the test is modified according to the latest @@ -666,7 +666,7 @@ findpcb: tp->cc_recv = to.to_cc; /* * Perform TAO test on incoming CC (SEG.CC) option, if any. - * - compare SEG.CC against cached CC from the same host, + * - compare SEG.CC against cached CC from the same host, * if any. * - if SEG.CC > chached value, SYN must be new and is accepted * immediately: save new CC in the cache, mark the socket @@ -794,7 +794,7 @@ findpcb: /* Segment is acceptable, update cache if undefined. */ if (taop->tao_ccsent == 0) taop->tao_ccsent = to.to_ccecho; - + tp->rcv_adv += tp->rcv_wnd; tp->snd_una++; /* SYN is acked */ /* @@ -822,19 +822,19 @@ findpcb: /* * Received initial SYN in SYN-SENT[*] state => simul- * taneous open. If segment contains CC option and there is - * a cached CC, apply TAO test; if it succeeds, connection is + * a cached CC, apply TAO test; if it succeeds, connection is * half-synchronized. Otherwise, do 3-way handshake: * SYN-SENT -> SYN-RECEIVED * SYN-SENT* -> SYN-RECEIVED* * If there was no CC option, clear cached CC value. */ tp->t_flags |= TF_ACKNOW; - tp->t_timer[TCPT_REXMT] = 0; + tp->t_timer[TCPT_REXMT] = 0; if (to.to_flag & TOF_CC) { if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) { /* - * update cache and make transition: + * update cache and make transition: * SYN-SENT -> ESTABLISHED* * SYN-SENT* -> FIN-WAIT-1* */ @@ -852,7 +852,7 @@ findpcb: taop->tao_cc = 0; tp->t_state = TCPS_SYN_RECEIVED; } - } + } trimthenstep6: /* @@ -877,7 +877,7 @@ trimthenstep6: * our data will be ACK'd; if so, enter normal data segment * processing in the middle of step 5, ack processing. * Otherwise, goto step 6. - */ + */ if (tiflags & TH_ACK) goto process_ACK; goto step6; @@ -893,8 +893,8 @@ trimthenstep6: * segment, hoping to find new TCPCB in LISTEN state; * * else must be old SYN; drop it. - * else do normal processing. - */ + * else do normal processing. + */ case TCPS_LAST_ACK: case TCPS_CLOSING: case TCPS_TIME_WAIT: @@ -917,7 +917,7 @@ trimthenstep6: * States other than LISTEN or SYN_SENT. * First check timestamp, if present. * Then check the connection count, if present. - * Then check that at least some bytes of segment are within + * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. * @@ -965,7 +965,7 @@ trimthenstep6: if (tiflags & TH_SYN) { tiflags &= ~TH_SYN; ti->ti_seq++; - if (ti->ti_urp > 1) + if (ti->ti_urp > 1) ti->ti_urp--; else tiflags &= ~TH_URG; @@ -1064,7 +1064,7 @@ trimthenstep6: * NOTE that the test is modified according to the latest * proposal of the tcplw@cray.com list (Braden 1993/04/26). */ - if ((to.to_flag & TOF_TS) != 0 && + if ((to.to_flag & TOF_TS) != 0 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent)) { tp->ts_recent_age = tcp_now; tp->ts_recent = to.to_tsval; @@ -1125,7 +1125,7 @@ trimthenstep6: else goto drop; } - + /* * Ack processing. */ @@ -1159,7 +1159,7 @@ trimthenstep6: taop->tao_cc = tp->cc_recv; /* - * Make transitions: + * Make transitions: * SYN-RECEIVED -> ESTABLISHED * SYN-RECEIVED* -> FIN-WAIT-1 */ @@ -1168,7 +1168,7 @@ trimthenstep6: tp->t_flags &= ~TF_NEEDFIN; } else tp->t_state = TCPS_ESTABLISHED; - /* + /* * If segment contains data or ACK, will call tcp_reass() * later; if not, do so now to pass queued data to user. */ @@ -1216,7 +1216,7 @@ trimthenstep6: * the new ssthresh). * * Dup acks mean that packets have left the - * network (they're now cached at the receiver) + * network (they're now cached at the receiver) * so bump cwnd by the amount in the receiver * to keep a constant cwnd packets in the * network. @@ -1265,11 +1265,11 @@ trimthenstep6: goto dropafterack; } /* - * If we reach this point, ACK is not a duplicate, + * If we reach this point, ACK is not a duplicate, * i.e., it ACKs something we sent. */ if (tp->t_flags & TF_NEEDSYN) { - /* + /* * T/TCP: Connection was half-synchronized, and our * SYN has been ACK'd (so connection is now fully * synchronized). Go to non-starred state and @@ -1422,7 +1422,7 @@ step6: * Don't look at window if no ACK: TAC's send garbage on first SYN. */ if ((tiflags & TH_ACK) && - (SEQ_LT(tp->snd_wl1, ti->ti_seq) || + (SEQ_LT(tp->snd_wl1, ti->ti_seq) || (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) || (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ @@ -1457,14 +1457,14 @@ step6: * If this segment advances the known urgent pointer, * then mark the data stream. This should not happen * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since - * a FIN has been received from the remote side. + * a FIN has been received from the remote side. * In these states we ignore the URG. * * According to RFC961 (Assigned Protocols), * the urgent pointer points to the last octet * of urgent data. We continue, however, * to consider it to indicate the first octet - * of data past the urgent section as the original + * of data past the urgent section as the original * spec states (in one of two places). */ if (SEQ_GT(ti->ti_seq+ti->ti_urp, tp->rcv_up)) { @@ -1532,11 +1532,11 @@ dodata: /* XXX */ * (ie SEND_SYN flag on) then delay ACK, * so it may be piggybacked when SYN is sent. * Otherwise, since we received a FIN then no - * more input can be expected, send ACK now. + * more input can be expected, send ACK now. */ if (tp->t_flags & TF_NEEDSYN) tp->t_flags |= TF_DELACK; - else + else tp->t_flags |= TF_ACKNOW; tp->rcv_nxt++; } @@ -1561,7 +1561,7 @@ dodata: /* XXX */ /* * In FIN_WAIT_2 state enter the TIME_WAIT state, - * starting the time-wait timer, turning off the other + * starting the time-wait timer, turning off the other * standard timers. */ case TCPS_FIN_WAIT_2: @@ -1714,7 +1714,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) (char *)&to->to_tsecr, sizeof(to->to_tsecr)); NTOHL(to->to_tsecr); - /* + /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. */ @@ -1731,7 +1731,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) bcopy((char *)cp + 2, (char *)&to->to_cc, sizeof(to->to_cc)); NTOHL(to->to_cc); - /* + /* * A CC or CC.new option received in a SYN makes * it ok to send CC in subsequent segments. */ @@ -1747,7 +1747,7 @@ tcp_dooptions(tp, cp, cnt, ti, to) bcopy((char *)cp + 2, (char *)&to->to_cc, sizeof(to->to_cc)); NTOHL(to->to_cc); - /* + /* * A CC or CC.new option received in a SYN makes * it ok to send CC in subsequent segments. */ @@ -1782,7 +1782,7 @@ tcp_pulloutofband(so, ti, m) register struct mbuf *m; { int cnt = ti->ti_urp - 1; - + while (cnt >= 0) { if (m->m_len > cnt) { char *cp = mtod(m, caddr_t) + cnt; @@ -1841,7 +1841,7 @@ tcp_xmit_timer(tp, rtt) if ((tp->t_rttvar += delta) <= 0) tp->t_rttvar = 1; } else { - /* + /* * No rtt measurement yet - use the unsmoothed rtt. * Set the variance to half the rtt (so our first * retransmit happens at 3*rtt). @@ -1865,7 +1865,7 @@ tcp_xmit_timer(tp, rtt) */ TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), tp->t_rttmin, TCPTV_REXMTMAX); - + /* * We received an ack for a packet that wasn't retransmitted; * it is probably safe to discard any error indications we've diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index ea68652..381824d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.9 1995/03/16 18:15:05 bde Exp $ + * $Id: tcp_subr.c,v 1.10 1995/04/09 01:29:26 davidg Exp $ */ #include <sys/param.h> @@ -251,7 +251,7 @@ tcp_newtcpcb(inp) tp->t_srtt = TCPTV_SRTTBASE; tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2; tp->t_rttmin = TCPTV_MIN; - TCPT_RANGESET(tp->t_rxtcur, + TCPT_RANGESET(tp->t_rxtcur, ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1, TCPTV_MIN, TCPTV_REXMTMAX); tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; @@ -304,7 +304,7 @@ tcp_close(tp) /* * If we sent enough data to get some meaningful characteristics, - * save them in the routing entry. 'Enough' is arbitrarily + * save them in the routing entry. 'Enough' is arbitrarily * defined as the sendpipesize (default 4K) * 16. This would * give us 16 rtt samples assuming we only get one sample per * window (the usual case on a long haul net). 16 samples is @@ -420,7 +420,7 @@ tcp_notify(inp, error) } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 && tp->t_softerror) so->so_error = error; - else + else tp->t_softerror = error; wakeup((caddr_t) &so->so_timeo); sorwakeup(so); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 4437ce0..ddab8d6 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_timer.c,v 1.5 1995/04/09 01:29:27 davidg Exp $ + * $Id: tcp_timer.c,v 1.6 1995/04/12 06:49:56 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -238,7 +238,7 @@ tcp_timers(tp, timer) * size increase exponentially with time. If the * window is larger than the path can handle, this * exponential growth results in dropped packet(s) - * almost immediately. To get more time between + * almost immediately. To get more time between * drops but still "push" the network to take advantage * of improving conditions, we switch from exponential * to linear window opening at some threshhold size. diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index ea68652..381824d 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tcp_subr.c,v 1.9 1995/03/16 18:15:05 bde Exp $ + * $Id: tcp_subr.c,v 1.10 1995/04/09 01:29:26 davidg Exp $ */ #include <sys/param.h> @@ -251,7 +251,7 @@ tcp_newtcpcb(inp) tp->t_srtt = TCPTV_SRTTBASE; tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2; tp->t_rttmin = TCPTV_MIN; - TCPT_RANGESET(tp->t_rxtcur, + TCPT_RANGESET(tp->t_rxtcur, ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1, TCPTV_MIN, TCPTV_REXMTMAX); tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; @@ -304,7 +304,7 @@ tcp_close(tp) /* * If we sent enough data to get some meaningful characteristics, - * save them in the routing entry. 'Enough' is arbitrarily + * save them in the routing entry. 'Enough' is arbitrarily * defined as the sendpipesize (default 4K) * 16. This would * give us 16 rtt samples assuming we only get one sample per * window (the usual case on a long haul net). 16 samples is @@ -420,7 +420,7 @@ tcp_notify(inp, error) } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 && tp->t_softerror) so->so_error = error; - else + else tp->t_softerror = error; wakeup((caddr_t) &so->so_timeo); sorwakeup(so); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index eb8237c..b2bc22c 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $Id: tcp_usrreq.c,v 1.12 1995/03/16 18:15:06 bde Exp $ + * $Id: tcp_usrreq.c,v 1.13 1995/04/09 01:29:28 davidg Exp $ */ #include <sys/param.h> @@ -206,7 +206,7 @@ tcp_usrreq(so, req, m, nam, control) error = EAFNOSUPPORT; break; } - + if ((error = tcp_connect(tp, nam)) != 0) break; error = tcp_output(tp); @@ -402,7 +402,7 @@ tcp_connect(tp, nam) return error; } - /* + /* * Cannot simply call in_pcbconnect, because there might be an * earlier incarnation of this same connection still in * TIME_WAIT state, creating an ADDRINUSE error. @@ -697,7 +697,7 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) case TCPCTL_RTTDFLT: return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_rttdflt)); case TCPCTL_KEEPIDLE: - return (sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_keepidle)); case TCPCTL_KEEPINTVL: return (sysctl_int(oldp, oldlenp, newp, newlen, diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 055d20b..7e13103 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94 - * $Id: udp_usrreq.c,v 1.10 1995/05/03 07:16:53 davidg Exp $ + * $Id: udp_usrreq.c,v 1.11 1995/05/09 13:35:48 davidg Exp $ */ #include <sys/param.h> @@ -650,7 +650,7 @@ udp_sysctl(name, namelen, oldp, oldlenp, newp, newlen) return (sysctl_rdstruct(oldp, oldlenp, newp, &udpstat, sizeof udpstat)); case UDPCTL_MAXDGRAM: - return (sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, (int *)&udp_sendspace)); /* XXX */ case UDPCTL_RECVSPACE: return (sysctl_int(oldp, oldlenp, newp, newlen, diff --git a/sys/netiso/argo_debug.h b/sys/netiso/argo_debug.h index 6adcd52..e87da1c 100644 --- a/sys/netiso/argo_debug.h +++ b/sys/netiso/argo_debug.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)argo_debug.h 8.1 (Berkeley) 6/10/93 - * $Id: argo_debug.h,v 1.2 1994/08/02 07:49:31 davidg Exp $ + * $Id: argo_debug.h,v 1.3 1994/08/21 06:14:11 paul Exp $ */ #ifndef _NETISO_ARGO_DEBUG_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,8 +63,8 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* - * $Header: /home/ncvs/src/sys/netiso/argo_debug.h,v 1.2 1994/08/02 07:49:31 davidg Exp $ +/* + * $Header: /home/ncvs/src/sys/netiso/argo_debug.h,v 1.3 1994/08/21 06:14:11 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/argo_debug.h,v $ */ @@ -75,8 +75,8 @@ SOFTWARE. * Lint stuff **********************************************/ #if defined(lint) -/* - * lint can't handle the flaky vacuous definitions +/* + * lint can't handle the flaky vacuous definitions * of IFDEBUG, ENDDEBUG, etc. */ #endif /* defined(lint) */ @@ -103,7 +103,7 @@ SOFTWARE. unsigned char argo_debug[128]; #define IFDEBUG(ascii) \ - if(argo_debug[ascii]) { + if(argo_debug[ascii]) { #define ENDDEBUG ; } #else /* ARGO_DEBUG */ @@ -121,7 +121,7 @@ unsigned char argo_debug[128]; #endif /* ARGO_DEBUG */ /*********************************************** - * ASSERT + * ASSERT **********************************************/ #ifdef ARGO_DEBUG @@ -162,19 +162,19 @@ if( !(phrase) ) printf("ASSERTION NOT VALID at line %d file %s\n",__LINE__,__FIL /* clnp over token ring */ #define D_ADCOM '\12' /* clnp over the adcom */ -#define D_ISO '\13' +#define D_ISO '\13' /* iso address family */ #define D_FORWARD '\14' /* clnp forwarding */ #define D_DUMPOUT '\15' /* dump clnp outgoing packets */ -#define D_DUMPIN '\16' +#define D_DUMPIN '\16' /* dump clnp input packets */ -#define D_DISCARD '\17' +#define D_DISCARD '\17' /* debug clnp packet discard/er function */ -#define D_FRAG '\20' +#define D_FRAG '\20' /* clnp fragmentation */ -#define D_REASS '\21' +#define D_REASS '\21' /* clnp reassembly */ char *clnp_iso_addrp(); @@ -295,4 +295,4 @@ void dump_mbuf(); #endif /* ARGO_DEBUG */ -#endif +#endif diff --git a/sys/netiso/clnl.h b/sys/netiso/clnl.h index 2bc739e..65c536a 100644 --- a/sys/netiso/clnl.h +++ b/sys/netiso/clnl.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnl.h 8.1 (Berkeley) 6/10/93 - * $Id: clnl.h,v 1.2 1994/08/02 07:49:33 davidg Exp $ + * $Id: clnl.h,v 1.3 1994/08/21 06:14:12 paul Exp $ */ #ifndef _NETISO_CLNL_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/sys/netiso/clnp.h b/sys/netiso/clnp.h index be162f3..646b6b8 100644 --- a/sys/netiso/clnp.h +++ b/sys/netiso/clnp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp.h 8.2 (Berkeley) 4/16/94 - * $Id: clnp.h,v 1.2 1994/08/02 07:49:34 davidg Exp $ + * $Id: clnp.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */ #ifndef _NETISO_CLNP_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,7 +63,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp.h,v 1.2 1994/08/02 07:49:34 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp.h,v $ */ /* should be config option but cpp breaks with too many #defines */ @@ -129,9 +129,9 @@ struct clnp_segment { /* * Clnp fragment reassembly structures: * - * All packets undergoing reassembly are linked together in + * All packets undergoing reassembly are linked together in * clnp_fragl structures. Each clnp_fragl structure contains a - * pointer to the original clnp packet header, as well as a + * pointer to the original clnp packet header, as well as a * list of packet fragments. Each packet fragment * is headed by a clnp_frag structure. This structure contains the * offset of the first and last byte of the fragment, as well as @@ -142,10 +142,10 @@ struct clnp_segment { * NOTE: * The clnp_frag structure is stored in an mbuf immedately preceeding * the fragment data. Since there are words in this struct, - * it must be word aligned. + * it must be word aligned. * * NOTE: - * All the fragment code assumes that the entire clnp header is + * All the fragment code assumes that the entire clnp header is * contained in the first mbuf. */ struct clnp_frag { @@ -237,9 +237,9 @@ struct clnp_optidx { #define CLNPSRCRT_CADDR(oidx, options)\ ((caddr_t)(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + CLNPSRCRT_OFF(oidx, options))) -/* +/* * return true if the src route has run out of routes - * this is true if the offset of next route is greater than the end of the rt + * this is true if the offset of next route is greater than the end of the rt */ #define CLNPSRCRT_TERM(oidx, options)\ (CLNPSRCRT_OFF(oidx, options) > oidx->cni_srcrt_len) @@ -274,7 +274,7 @@ struct clnp_optidx { #define CLNPOVAL_COMPRT 0x01 /* complete source routing */ /* - * Clnp flags used in a control block flags field. + * Clnp flags used in a control block flags field. * NOTE: these must be out of the range of bits defined in ../net/raw_cb.h */ #define CLNP_NO_SEG 0x010 /* segmentation not permitted */ @@ -289,7 +289,7 @@ struct clnp_optidx { #define CLNP_VFLAGS (CLNP_SEND_RAW|CLNP_NO_SEG|CLNP_NO_ER|CLNP_NO_CKSUM\ |CLNP_ECHO|CLNP_NOCACHE|CLNP_ECHOR) -/* +/* * Constants used by clnp */ #define CLNP_HDR_MIN (sizeof (struct clnp_fixed)) diff --git a/sys/netiso/clnp_debug.c b/sys/netiso/clnp_debug.c index d389834..52d6f04 100644 --- a/sys/netiso/clnp_debug.c +++ b/sys/netiso/clnp_debug.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_debug.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: clnp_debug.c,v 1.2 1994/08/02 07:49:35 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_debug.c,v 1.1.1.1 1994/05/24 10:07:26 rgrimes Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_debug.c,v 1.2 1994/08/02 07:49:35 davidg Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_debug.c,v $ */ #include <sys/param.h> @@ -84,7 +84,7 @@ SOFTWARE. #ifdef TESTDEBUG #ifdef notdef struct addr_37 u_37 = { - {0x00, 0x02, 0x00, 0x10, 0x20, 0x30, 0x35}, + {0x00, 0x02, 0x00, 0x10, 0x20, 0x30, 0x35}, {0x01, 0x02, 0x03, 0x04, 0x50, 0x60, 0x70, 0x80, 0x90} }; struct addr_osinet u_osinet = { @@ -156,7 +156,7 @@ char *where; /* where to put data */ } /* - * Return a ptr to a human readable form of an iso addr + * Return a ptr to a human readable form of an iso addr */ static char iso_addr_b[50]; #define DELIM '.'; @@ -187,7 +187,7 @@ struct iso_addr *isoa; *cp++ = DELIM; cp = clnp_hexp(isoa->t37_dsp, ADDR37_DSP_LEN, cp); break; - + /* case AFI_OSINET:*/ case AFI_RFC986: { u_short idi; @@ -212,7 +212,7 @@ struct iso_addr *isoa; cp = clnp_hexp(&o986->o986_vers, 1, cp); *cp++ = DELIM; #ifdef vax - sprintf(cp, "%d.%d.%d.%d.%d", + sprintf(cp, "%d.%d.%d.%d.%d", o986->o986_inetaddr[0] & 0xff, o986->o986_inetaddr[1] & 0xff, o986->o986_inetaddr[2] & 0xff, @@ -231,7 +231,7 @@ struct iso_addr *isoa; cp = clnp_hexp(&o986->o986_upid, 1, cp); #endif /* vax */ } - + } break; default: @@ -240,7 +240,7 @@ struct iso_addr *isoa; } #endif /* notdef */ *cp = (char)0; - + return(iso_addr_b); } diff --git a/sys/netiso/clnp_er.c b/sys/netiso/clnp_er.c index 8d70c48..ca12308 100644 --- a/sys/netiso/clnp_er.c +++ b/sys/netiso/clnp_er.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_er.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_er.c,v 1.2 1994/08/02 07:49:36 davidg Exp $ + * $Id: clnp_er.c,v 1.3 1994/11/15 14:26:10 bde Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_er.c,v 1.2 1994/08/02 07:49:36 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_er.c,v 1.3 1994/11/15 14:26:10 bde Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_er.c,v $ */ #include <sys/param.h> @@ -98,11 +98,11 @@ static struct clnp_fixed er_template = { * * PURPOSE: Process an ER pdu. * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_er_input(m, src, reason) struct mbuf *m; /* ptr to packet itself */ @@ -113,7 +113,7 @@ u_char reason; /* reason code of er */ extern u_char clnp_protox[]; IFDEBUG(D_CTLINPUT) - printf("clnp_er_input: m x%x, src %s, reason x%x\n", m, + printf("clnp_er_input: m x%x, src %s, reason x%x\n", m, clnp_iso_addrp(src), reason); ENDDEBUG @@ -122,29 +122,29 @@ u_char reason; /* reason code of er */ case GEN_NOREAS: case GEN_PROTOERR: break; - case GEN_BADCSUM: + case GEN_BADCSUM: cmd = PRC_PARAMPROB; break; - case GEN_CONGEST: + case GEN_CONGEST: cmd = PRC_QUENCH; break; - case GEN_HDRSYNTAX: + case GEN_HDRSYNTAX: cmd = PRC_PARAMPROB; break; - case GEN_SEGNEEDED: - cmd = PRC_MSGSIZE; + case GEN_SEGNEEDED: + cmd = PRC_MSGSIZE; break; - case GEN_INCOMPLETE: - cmd = PRC_PARAMPROB; + case GEN_INCOMPLETE: + cmd = PRC_PARAMPROB; break; - case GEN_DUPOPT: - cmd = PRC_PARAMPROB; + case GEN_DUPOPT: + cmd = PRC_PARAMPROB; break; - case ADDR_DESTUNREACH: - cmd = PRC_UNREACH_HOST; + case ADDR_DESTUNREACH: + cmd = PRC_UNREACH_HOST; break; - case ADDR_DESTUNKNOWN: - cmd = PRC_UNREACH_PROTOCOL; + case ADDR_DESTUNKNOWN: + cmd = PRC_UNREACH_PROTOCOL; break; case SRCRT_UNSPECERR: case SRCRT_SYNTAX: @@ -152,20 +152,20 @@ u_char reason; /* reason code of er */ case SRCRT_BADPATH: cmd = PRC_UNREACH_SRCFAIL; break; - case TTL_EXPTRANSIT: - cmd = PRC_TIMXCEED_INTRANS; + case TTL_EXPTRANSIT: + cmd = PRC_TIMXCEED_INTRANS; break; - case TTL_EXPREASS: - cmd = PRC_TIMXCEED_REASS; + case TTL_EXPREASS: + cmd = PRC_TIMXCEED_REASS; break; case DISC_UNSUPPOPT: case DISC_UNSUPPVERS: case DISC_UNSUPPSECURE: case DISC_UNSUPPSRCRT: case DISC_UNSUPPRECRT: - cmd = PRC_PARAMPROB; + cmd = PRC_PARAMPROB; break; - case REASS_INTERFERE: + case REASS_INTERFERE: cmd = PRC_TIMXCEED_REASS; break; } @@ -224,7 +224,7 @@ char reason; /* reason for discard */ * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Takes responsibility for freeing mbuf passed * This function may be called with a packet that @@ -260,7 +260,7 @@ char reason; /* reason for discard */ (clnp->cnf_hdr_len > CLNP_HDR_MAX) || (clnp->cnf_hdr_len > m->m_len)) goto bad; - + /* extract src, dest address */ hend = (caddr_t)clnp + clnp->cnf_hdr_len; hoff = (caddr_t)clnp + sizeof(struct clnp_fixed); @@ -272,14 +272,14 @@ char reason; /* reason for discard */ if (hoff == (caddr_t)0) { goto bad; } - + /* * Do not send ER if we generated the packet. */ if (clnp_ours(&src)) goto bad; - /* + /* * Trim mbuf to hold only the header. * This mbuf will be the 'data' of the er pdu */ @@ -308,7 +308,7 @@ char reason; /* reason for discard */ ENDDEBUG IFDEBUG(D_DISCARD) - printf("clnp_emit_er: packet routed to %s\n", + printf("clnp_emit_er: packet routed to %s\n", clnp_iso_addrp(&((struct sockaddr_iso *)first_hop)->siso_addr)); ENDDEBUG @@ -316,7 +316,7 @@ char reason; /* reason for discard */ MGET(m0, M_DONTWAIT, MT_HEADER); if (m0 == 0) goto bad; - + m0->m_next = m; er = mtod(m0, struct clnp_fixed *); *er = er_template; @@ -349,7 +349,7 @@ char reason; /* reason for discard */ /* trim packet if too large for interface */ if (total_len > ifp->if_mtu) m_adj(m0, -(total_len - ifp->if_mtu)); - + /* send packet */ INCSTAT(cns_er_outhist[clnp_er_index(reason)]); (void) (*ifp->if_output)(ifp, m0, first_hop, route.ro_rt); diff --git a/sys/netiso/clnp_frag.c b/sys/netiso/clnp_frag.c index 50e13d4..69c92a5 100644 --- a/sys/netiso/clnp_frag.c +++ b/sys/netiso/clnp_frag.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_frag.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: clnp_frag.c,v 1.2 1994/08/02 07:49:37 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_frag.c,v 1.1.1.1 1994/05/24 10:07:25 rgrimes Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_frag.c,v 1.2 1994/08/02 07:49:37 davidg Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_frag.c,v $ */ #include <sys/param.h> @@ -96,12 +96,12 @@ struct mbuf *clnp_comp_pdu(); * RETURNS: success - 0 * failure - unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: If there is an error sending the packet, clnp_discard * is called to discard the packet and send an ER. If * clnp_fragment was called from clnp_output, then - * we generated the packet, and should not send an + * we generated the packet, and should not send an * ER -- clnp_emit_er will check for this. Otherwise, * the packet was fragmented during forwarding. In this * case, we ought to send an ER back. @@ -153,20 +153,20 @@ struct rtentry *rt; /* route if direct ether */ int tot_mlen = 0; printf("clnp_fragment: total_len %d:\n", total_len); while (mdump != NULL) { - printf("\tmbuf x%x, m_len %d\n", + printf("\tmbuf x%x, m_len %d\n", mdump, mdump->m_len); tot_mlen += mdump->m_len; mdump = mdump->m_next; } printf("clnp_fragment: sum of mbuf chain %d:\n", tot_mlen); ENDDEBUG - + frag_size = min(total_len, frag_size); if ((remaining = total_len - frag_size) == 0) last_frag = 1; else { /* - * If this fragment will cause the last one to + * If this fragment will cause the last one to * be less than 8 bytes, shorten this fragment a bit. * The obscure test on frag_size above ensures that * frag_size will be positive. @@ -175,17 +175,17 @@ struct rtentry *rt; /* route if direct ether */ if (remaining < 8) frag_size -= 8; } - + IFDEBUG(D_FRAG) - printf("clnp_fragment: seg off %d, size %d, remaining %d\n", + printf("clnp_fragment: seg off %d, size %d, remaining %d\n", ntohs(seg_part.cng_off), frag_size, total_len-frag_size); if (last_frag) printf("clnp_fragment: last fragment\n"); ENDDEBUG if (last_frag) { - /* + /* * this is the last fragment; we don't need to get any other * mbufs. */ @@ -210,7 +210,7 @@ struct rtentry *rt; /* route if direct ether */ if (!last_frag) clnp->cnf_type |= CNF_MORE_SEGS; - + /* link together */ m_cat(frag_hdr, frag_data); @@ -248,7 +248,7 @@ struct rtentry *rt; /* route if direct ether */ #endif /* TROLL */ /* - * Tough situation: if the error occured on the last + * Tough situation: if the error occured on the last * fragment, we can not send an ER, as the if_output * routine consumed the packet. If the error occured * on any intermediate packets, we can send an ER @@ -256,7 +256,7 @@ struct rtentry *rt; /* route if direct ether */ */ if (error) { if (frag_hdr != hdr) { - /* + /* * The error was not on the last fragment. We must * free hdr and m before returning */ @@ -278,7 +278,7 @@ struct rtentry *rt; /* route if direct ether */ if ((trollctl.tr_ops & TR_DUPEND) && (!last_frag)) { int num_bytes = frag_size; - if (trollctl.tr_dup_size > 0) + if (trollctl.tr_dup_size > 0) num_bytes *= trollctl.tr_dup_size; else num_bytes *= troll_random(); @@ -309,16 +309,16 @@ struct rtentry *rt; /* route if direct ether */ * are present), then return a pointer to an mbuf chain * containing the reassembled packet. This packet will * appear in the mbufs as if it had just arrived in - * one piece. + * one piece. * * If reassembly fails, then save this fragment and * return 0. * * RETURNS: Ptr to assembled packet, or 0 * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: * clnp_slowtimo can not affect this code because clnpintr, and thus * this code, is called at a higher priority than clnp_slowtimo. */ @@ -334,7 +334,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ /* look for other fragments of this datagram */ for (cfh = clnp_frags; cfh != NULL; cfh = cfh->cfl_next) { if (seg->cng_id == cfh->cfl_id && - iso_addrmatch1(src, &cfh->cfl_src) && + iso_addrmatch1(src, &cfh->cfl_src) && iso_addrmatch1(dst, &cfh->cfl_dst)) { IFDEBUG(D_REASS) printf("clnp_reass: found packet\n"); @@ -379,7 +379,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ * * RETURNS: non-zero if it succeeds, zero if fails. * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Failure is only due to insufficient resources. */ @@ -392,10 +392,10 @@ struct clnp_segment *seg; /* segment part of fragment header */ register struct clnp_fragl *cfh; register struct clnp_fixed *clnp; struct mbuf *m0; - + clnp = mtod(m, struct clnp_fixed *); - /* + /* * Allocate new clnp fragl structure to act as header of all fragments * for this datagram. */ @@ -405,7 +405,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ } cfh = mtod(m0, struct clnp_fragl *); - /* + /* * Duplicate the header of this fragment, and save in cfh. * Free m0 and return if m_copy does not succeed. */ @@ -413,7 +413,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ m_freem(m0); return (0); } - + /* Fill in rest of fragl structure */ bcopy((caddr_t)src, (caddr_t)&cfh->cfl_src, sizeof(struct iso_addr)); bcopy((caddr_t)dst, (caddr_t)&cfh->cfl_dst, sizeof(struct iso_addr)); @@ -439,7 +439,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: This is the 'guts' of the reassembly algorithm. * Each fragment in this list contains a clnp_frag @@ -459,7 +459,7 @@ struct clnp_segment *seg; /* segment part of fragment header */ u_short first; /* offset of first byte of initial pdu*/ u_short last; /* offset of last byte of initial pdu */ u_short fraglen;/* length of fragment */ - + clnp = mtod(m, struct clnp_fixed *); first = seg->cng_off; CTOH(clnp->cnf_seglen_msb, clnp->cnf_seglen_lsb, fraglen); @@ -490,12 +490,12 @@ struct clnp_segment *seg; /* segment part of fragment header */ printf("clnp_insert_frag: Previous frag is "); if (cf_prev == NULL) printf("NULL\n"); - else + else printf("[%d ... %d]\n", cf_prev->cfr_first, cf_prev->cfr_last); printf("clnp_insert_frag: Subsequent frag is "); if (cf_sub == NULL) printf("NULL\n"); - else + else printf("[%d ... %d]\n", cf_sub->cfr_first, cf_sub->cfr_last); ENDDEBUG @@ -569,10 +569,10 @@ struct clnp_segment *seg; /* segment part of fragment header */ /* * Insert the new fragment beween cf_prev and cf_sub * - * Note: the clnp hdr is still in the mbuf. + * Note: the clnp hdr is still in the mbuf. * If the data of the mbuf is not word aligned, shave off enough * so that it is. Then, cast the clnp_frag structure on top - * of the clnp header. + * of the clnp header. * The clnp_hdr will not be used again (as we already have * saved a copy of it). * @@ -655,7 +655,7 @@ struct clnp_fragl *cfh; /* fragment header */ IFDEBUG(D_REASS) printf("clnp_comp_pdu: comparing: [%d ... %d] to [%d ... %d]\n", - cf->cfr_first, cf->cfr_last, cf_next->cfr_first, + cf->cfr_first, cf->cfr_last, cf_next->cfr_first, cf_next->cfr_last); ENDDEBUG @@ -677,7 +677,7 @@ struct clnp_fragl *cfh; /* fragment header */ struct mbuf *mdump; int l; printf("clnp_comp_pdu: merging fragments\n"); - printf("clnp_comp_pdu: 1st: [%d ... %d] (bytes %d)\n", + printf("clnp_comp_pdu: 1st: [%d ... %d] (bytes %d)\n", cf->cfr_first, cf->cfr_last, cf->cfr_bytes); mdump = cf->cfr_data; l = 0; @@ -687,7 +687,7 @@ struct clnp_fragl *cfh; /* fragment header */ mdump = mdump->m_next; } printf("\ttotal len: %d\n", l); - printf("clnp_comp_pdu: 2nd: [%d ... %d] (bytes %d)\n", + printf("clnp_comp_pdu: 2nd: [%d ... %d] (bytes %d)\n", cf_next->cfr_first, cf_next->cfr_last, cf_next->cfr_bytes); mdump = cf_next->cfr_data; l = 0; @@ -705,7 +705,7 @@ struct clnp_fragl *cfh; /* fragment header */ * have adjusted the clnp_frag structure away... */ IFDEBUG(D_REASS) - printf("clnp_comp_pdu: shaving off %d bytes\n", + printf("clnp_comp_pdu: shaving off %d bytes\n", cf_next_hdr.cfr_bytes); ENDDEBUG m_adj(cf_next_hdr.cfr_data, (int)cf_next_hdr.cfr_bytes); @@ -792,7 +792,7 @@ static int troll_cnt; * * RETURNS: the random number * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: This is based on the clock. */ @@ -816,7 +816,7 @@ float troll_random() * * RETURNS: 0, or unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: The operation of this procedure is regulated by the * troll control structure (Troll). diff --git a/sys/netiso/clnp_input.c b/sys/netiso/clnp_input.c index b04ba3b..c67df92 100644 --- a/sys/netiso/clnp_input.c +++ b/sys/netiso/clnp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_input.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_input.c,v 1.4 1995/03/16 18:15:20 bde Exp $ + * $Id: clnp_input.c,v 1.5 1995/05/11 00:13:20 wollman Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,8 +60,8 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /a/ncvs/src/sys/netiso/clnp_input.c,v 1.4 1995/03/16 18:15:20 bde Exp $ */ -/* $Source: /a/ncvs/src/sys/netiso/clnp_input.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_input.c,v 1.5 1995/05/11 00:13:20 wollman Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/clnp_input.c,v $ */ #include <sys/param.h> #include <sys/systm.h> @@ -114,7 +114,7 @@ int x25esis_input(); * SIDE EFFECTS: fills in clnp_protox table with correct offsets into * the isosw table. * - * NOTES: + * NOTES: */ clnp_init() { @@ -148,9 +148,9 @@ clnp_init() * * RETURNS: nothing. * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ void clnlintr(void) @@ -238,7 +238,7 @@ next: /* * Drop packet if the length of the header is not reasonable. */ - if ((clnl->cnf_hdr_len < CLNP_HDR_MIN) || + if ((clnl->cnf_hdr_len < CLNP_HDR_MIN) || (clnl->cnf_hdr_len > CLNP_HDR_MAX)) { INCSTAT(cns_badhlen); /* TODO: use clnl stats */ m_freem(m); @@ -279,9 +279,9 @@ NETISR_SET(NETISR_ISO, clnlintr); * RETURNS: nothing * * SIDE EFFECTS: increments fields of clnp_stat structure. - * + * * NOTES: - * TODO: I would like to make seg_part a pointer into the mbuf, but + * TODO: I would like to make seg_part a pointer into the mbuf, but * will it be correctly aligned? */ clnp_input(m, shp) @@ -301,14 +301,14 @@ struct snpa_hdr *shp; /* subnetwork header */ struct clnp_optidx oidx, *oidxp = NULL; /* option index */ extern int iso_systype; /* used by ESIS config resp */ extern struct sockaddr_iso blank_siso; /* used for initializing */ - int need_afrin = 0; + int need_afrin = 0; /* true if congestion experienced */ /* which means you need afrin nose */ /* spray. How clever! */ IFDEBUG(D_INPUT) printf( - "clnp_input: proccessing dg; First mbuf m_len %d, m_type x%x, %s\n", + "clnp_input: proccessing dg; First mbuf m_len %d, m_type x%x, %s\n", m->m_len, m->m_type, IS_CLUSTER(m) ? "cluster" : "normal"); ENDDEBUG need_afrin = 0; @@ -321,7 +321,7 @@ struct snpa_hdr *shp; /* subnetwork header */ clnp_discard(m, ADDR_DESTUNREACH); return; } - + INCSTAT(cns_total); clnp = mtod(m, struct clnp_fixed *); @@ -359,11 +359,11 @@ struct snpa_hdr *shp; /* subnetwork header */ CTOH(clnp->cnf_seglen_msb, clnp->cnf_seglen_lsb, seg_len); if ((m = clnp_data_ck(m, seg_len)) == 0) return; - + clnp = mtod(m, struct clnp_fixed *); hend = (caddr_t)clnp + clnp->cnf_hdr_len; - /* + /* * extract the source and destination address * drop packet on failure */ @@ -426,7 +426,7 @@ struct snpa_hdr *shp; /* subnetwork header */ errcode = DISC_UNSUPPSECURE; /* the er option is valid with ER pdus only */ - if ((errcode == 0) && (oidxp->cni_er_reason != ER_INVALREAS) && + if ((errcode == 0) && (oidxp->cni_er_reason != ER_INVALREAS) && ((clnp->cnf_type & CNF_TYPE) != CLNP_ER)) errcode = DISC_UNSUPPOPT; @@ -452,7 +452,7 @@ struct snpa_hdr *shp; /* subnetwork header */ return; } } - + /* * check if this packet is for us. if not, then forward */ @@ -497,7 +497,7 @@ struct snpa_hdr *shp; /* subnetwork header */ return; } } - + /* * give the packet to the higher layer * diff --git a/sys/netiso/clnp_options.c b/sys/netiso/clnp_options.c index de44ff0..bac8b5b 100644 --- a/sys/netiso/clnp_options.c +++ b/sys/netiso/clnp_options.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_options.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: clnp_options.c,v 1.2 1994/08/02 07:49:40 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_options.c,v 1.1.1.1 1994/05/24 10:07:23 rgrimes Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_options.c,v 1.2 1994/08/02 07:49:40 davidg Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_options.c,v $ */ #ifdef ISO @@ -90,7 +90,7 @@ SOFTWARE. * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: If source routing has been terminated, do nothing. */ @@ -111,9 +111,9 @@ struct clnp_optidx *oidx; /* ptr to option index */ len = CLNPSRCRT_CLEN(oidx, options); bcopy(CLNPSRCRT_CADDR(oidx, options), (caddr_t)&isoa, len); isoa.isoa_len = len; - + IFDEBUG(D_OPTIONS) - printf("clnp_update_srcrt: current src rt: %s\n", + printf("clnp_update_srcrt: current src rt: %s\n", clnp_iso_addrp(&isoa)); ENDDEBUG @@ -137,9 +137,9 @@ struct clnp_optidx *oidx; /* ptr to option index */ * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_dooptions(options, oidx, ifp, isoa) struct mbuf *options; /* ptr to options mbuf */ @@ -173,7 +173,7 @@ struct iso_addr *isoa; /* ptr to our address for this ifp */ /* proceed only if recording has not been terminated */ if (off != 0xff) { int new_addrlen = isoa->isoa_len + 1; - /* + /* * if there is insufficient room to store the next address, * then terminate recording. Plus 1 on isoa_len is for the * length byte itself @@ -211,9 +211,9 @@ struct iso_addr *isoa; /* ptr to our address for this ifp */ * * RETURNS: unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_set_opts(options, data) struct mbuf **options; /* target for option information */ @@ -239,7 +239,7 @@ struct mbuf **data; /* source of option information */ * * The QOS parameter is checked for the DECBIT. */ - if ((clnp_opt_sanity(*data, mtod(*data, caddr_t), (*data)->m_len, + if ((clnp_opt_sanity(*data, mtod(*data, caddr_t), (*data)->m_len, &dummy) != 0) || (dummy.cni_securep) || (dummy.cni_priorp) || @@ -257,13 +257,13 @@ struct mbuf **data; /* source of option information */ * FUNCTION: clnp_opt_sanity * * PURPOSE: Check the options (beginning at opts for len bytes) for - * sanity. In addition, fill in the option index structure + * sanity. In addition, fill in the option index structure * in with information about each option discovered. * * RETURNS: success (options check out) - 0 * failure - an ER pdu error code describing failure * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Each pointer field of the option index is filled in with * the offset from the beginning of the mbuf data, not the @@ -280,7 +280,7 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ caddr_t opts_end; /* ptr to end of options */ u_char pad = 0, secure = 0, srcrt = 0, recrt = 0, qos = 0, prior = 0; /* flags for catching duplicate options */ - + IFDEBUG(D_OPTIONS) printf("clnp_opt_sanity: checking %d bytes of data:\n", len); dump_buf(opts, len); @@ -302,7 +302,7 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ /* must have at least 2 bytes per option (opcode and len) */ if (opts + 2 > opts_end) return(GEN_INCOMPLETE); - + opcode = *opts++; oplen = *opts++; IFDEBUG(D_OPTIONS) @@ -381,17 +381,17 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ if (srcrt++) /* duplicate ? */ return(GEN_DUPOPT); - /* + /* * source route: There must be 2 bytes following the length * field: type and offset. The type must be either * partial route or complete route. The offset field must * be within the option. A single exception is made, however. - * The offset may be 1 greater than the length. This case - * occurs when the last source route record is consumed. + * The offset may be 1 greater than the length. This case + * occurs when the last source route record is consumed. * In this case, we ignore the source route option. * RAH? You should be able to set offset to 'ff' like in record * route! - * Following this is a series of address fields. + * Following this is a series of address fields. * Each address field is composed of a (length, address) pair. * Insure that the offset and each address length is reasonable */ @@ -407,13 +407,13 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ /* type must be partial or complete */ if (!((type == CLNPOVAL_PARTRT) || (type == CLNPOVAL_COMPRT))) return(SRCRT_SYNTAX); - + oidx->cni_srcrt_s = CLNP_OPTTOOFF(m, opts); oidx->cni_srcrt_len = oplen; opts += offset-1; /*set opts to first addr in rt */ - /* + /* * Offset must be reasonable: * less than end of options, or equal to end of options */ @@ -423,7 +423,7 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ printf("clnp_opt_sanity: end of src route info\n"); ENDDEBUG break; - } else + } else return(SRCRT_SYNTAX); } @@ -461,7 +461,7 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ /* type must be partial or complete */ if (!((type == CLNPOVAL_PARTRT) || (type == CLNPOVAL_COMPRT))) return(GEN_HDRSYNTAX); - + /* offset must be reasonable */ if ((offset < 0xff) && (opts + offset > record_end)) return(GEN_HDRSYNTAX); @@ -481,10 +481,10 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ * remaining octets indicate actual qos. */ if (((format & 0xc0) == 0) || /* high 2 bits zero ? */ - (((format & 0xc0) != CLNPOVAL_GLOBAL) && + (((format & 0xc0) != CLNPOVAL_GLOBAL) && ((format & 0x3f) > 0))) /* not global,low bits used ? */ return(GEN_HDRSYNTAX); - + oidx->cni_qos_formatp = CLNP_OPTTOOFF(m, opts); oidx->cni_qos_len = oplen; @@ -499,7 +499,7 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */ */ if (oplen != 1) return(GEN_HDRSYNTAX); - + oidx->cni_priorp = CLNP_OPTTOOFF(m, opts); opts += oplen; diff --git a/sys/netiso/clnp_output.c b/sys/netiso/clnp_output.c index aa18f89..579d923 100644 --- a/sys/netiso/clnp_output.c +++ b/sys/netiso/clnp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_output.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_output.c,v 1.2 1994/08/02 07:49:42 davidg Exp $ + * $Id: clnp_output.c,v 1.3 1994/11/15 14:26:12 bde Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_output.c,v 1.2 1994/08/02 07:49:42 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_output.c,v 1.3 1994/11/15 14:26:12 bde Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_output.c,v $ */ #include <sys/param.h> @@ -124,7 +124,7 @@ static struct clnp_fixed echor_template = { }; #ifdef DECBIT -u_char qos_option[] = {CLNPOVAL_QOS, 1, +u_char qos_option[] = {CLNPOVAL_QOS, 1, CLNPOVAL_GLOBAL|CLNPOVAL_SEQUENCING|CLNPOVAL_LOWDELAY}; #endif /* DECBIT */ @@ -135,7 +135,7 @@ int clnp_id = 0; /* id for segmented dgrams */ * * PURPOSE: output the data in the mbuf as a clnp datagram * - * The data specified by m0 is sent as a clnp datagram. + * The data specified by m0 is sent as a clnp datagram. * The mbuf chain m0 will be freed when this routine has * returned. * @@ -144,12 +144,12 @@ int clnp_id = 0; /* id for segmented dgrams */ * be formatted in the mbuf according to clnp rules. Options * will not be freed. * - * Datalen specifies the length of the data in m0. + * Datalen specifies the length of the data in m0. * - * Src and dst are the addresses for the packet. + * Src and dst are the addresses for the packet. * - * If route is non-null, it is used as the route for - * the packet. + * If route is non-null, it is used as the route for + * the packet. * * By default, a DT is sent. However, if flags & CNLP_SEND_ER * then an ER will be sent. If flags & CLNP_SEND_RAW, then @@ -160,7 +160,7 @@ int clnp_id = 0; /* id for segmented dgrams */ * * SIDE EFFECTS: none * - * NOTES: + * NOTES: * Flags are interpretated as follows: * CLNP_NO_SEG - do not allow this pkt to be segmented. * CLNP_NO_ER - have pkt request ER suppression. @@ -207,14 +207,14 @@ int flags; /* flags */ IFDEBUG(D_OUTPUT) printf("clnp_output: to %s", clnp_iso_addrp(dst)); printf(" from %s of %d bytes\n", clnp_iso_addrp(src), datalen); - printf("\toptions x%x, flags x%x, isop_clnpcache x%x\n", + printf("\toptions x%x, flags x%x, isop_clnpcache x%x\n", isop->isop_options, flags, isop->isop_clnpcache); ENDDEBUG if (isop->isop_clnpcache != NULL) { clcp = mtod(isop->isop_clnpcache, struct clnp_cache *); } - + /* * Check if cache is valid ... */ @@ -354,7 +354,7 @@ int flags; /* flags */ * Don't allow funny lengths on dst; src may be zero in which * case we insert the source address based upon the interface */ - if ((src->isoa_len > sizeof(struct iso_addr)) || + if ((src->isoa_len > sizeof(struct iso_addr)) || (dst->isoa_len == 0) || (dst->isoa_len > sizeof(struct iso_addr))) { m_freem(m0); @@ -405,7 +405,7 @@ int flags; /* flags */ } else { IFDEBUG(D_OUTPUT) ENDDEBUG - error = clnp_route(dst, &isop->isop_route, flags, + error = clnp_route(dst, &isop->isop_route, flags, &clcp->clc_firsthop, &clcp->clc_ifa); } if (error || (clcp->clc_ifa == 0)) { @@ -420,13 +420,13 @@ int flags; /* flags */ clcp->clc_ifp = clcp->clc_ifa->ia_ifp; /* XXX */ IFDEBUG(D_OUTPUT) - printf("clnp_output: packet routed to %s\n", + printf("clnp_output: packet routed to %s\n", clnp_iso_addrp( &((struct sockaddr_iso *)clcp->clc_firsthop)->siso_addr)); ENDDEBUG - + /* - * If src address is not yet specified, use address of + * If src address is not yet specified, use address of * interface. NOTE: this will now update the laddr field in * the isopcb. Is this desirable? RAH? */ @@ -514,7 +514,7 @@ int flags; /* flags */ seg_part.cng_id = htons(clnp_id++); seg_part.cng_off = htons(0); seg_part.cng_tot_len = htons(total_len); - (void) bcopy((caddr_t)&seg_part, (caddr_t) clnp + clcp->clc_segoff, + (void) bcopy((caddr_t)&seg_part, (caddr_t) clnp + clcp->clc_segoff, sizeof(seg_part)); } if (total_len <= SN_MTU(clcp->clc_ifp, clcp->clc_rt)) { diff --git a/sys/netiso/clnp_raw.c b/sys/netiso/clnp_raw.c index df6878c..ade1ba2 100644 --- a/sys/netiso/clnp_raw.c +++ b/sys/netiso/clnp_raw.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_raw.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: clnp_raw.c,v 1.2 1994/08/02 07:49:44 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_raw.c,v 1.1.1.1 1994/05/24 10:07:22 rgrimes Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_raw.c,v 1.2 1994/08/02 07:49:44 davidg Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_raw.c,v $ */ #include <sys/param.h> @@ -94,7 +94,7 @@ struct sockproto rclnp_proto = { PF_ISO, 0 }; * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: The protocol field of rclnp_proto is set to zero indicating * no protocol. @@ -125,9 +125,9 @@ int hdrlen; /* length (in bytes) of clnp header */ * RETURNS: success - 0 * failure - an appropriate error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ rclnp_output(m0, so) struct mbuf *m0; /* packet to send */ @@ -172,7 +172,7 @@ bad: * FUNCTION: rclnp_ctloutput * * PURPOSE: Raw clnp socket option processing - * All options are stored inside an mbuf. + * All options are stored inside an mbuf. * * RETURNS: success - 0 * failure - unix error code @@ -180,7 +180,7 @@ bad: * SIDE EFFECTS: If the options mbuf does not exist, it the mbuf passed * is used. * - * NOTES: + * NOTES: */ rclnp_ctloutput(op, so, level, optname, m) int op; /* type of operation */ @@ -212,14 +212,14 @@ struct mbuf **m; /* ptr to ptr to option data */ switch (optname) { case CLNPOPT_FLAGS: { u_short usr_flags; - /* - * Insure that the data passed has exactly one short in it + /* + * Insure that the data passed has exactly one short in it */ if ((*m == NULL) || ((*m)->m_len != sizeof(short))) { error = EINVAL; break; } - + /* * Don't allow invalid flags to be set */ @@ -231,18 +231,18 @@ struct mbuf **m; /* ptr to ptr to option data */ rp->risop_flags |= usr_flags; } break; - + case CLNPOPT_OPTS: if (error = clnp_set_opts(&rp->risop_isop.isop_options, m)) break; rp->risop_isop.isop_optindex = m_get(M_WAIT, MT_SOOPTS); - (void) clnp_opt_sanity(rp->risop_isop.isop_options, + (void) clnp_opt_sanity(rp->risop_isop.isop_options, mtod(rp->risop_isop.isop_options, caddr_t), - rp->risop_isop.isop_options->m_len, + rp->risop_isop.isop_options->m_len, mtod(rp->risop_isop.isop_optindex, struct clnp_optidx *)); break; - } + } break; case PRCO_GETOPT: @@ -264,7 +264,7 @@ struct mbuf **m; /* ptr to ptr to option data */ m_freem(*m); *m = NULL; } - + return error; } @@ -301,7 +301,7 @@ clnp_usrreq(so, req, m, nam, control) rp->risop_rcb.rcb_laddr = 0; /* free clnp cached hdr if necessary */ if (rp->risop_isop.isop_clnpcache != NULL) { - struct clnp_cache *clcp = + struct clnp_cache *clcp = mtod(rp->risop_isop.isop_clnpcache, struct clnp_cache *); if (clcp->clc_hdr != NULL) { m_free(clcp->clc_hdr); diff --git a/sys/netiso/clnp_stat.h b/sys/netiso/clnp_stat.h index 3361342..a6cdd04 100644 --- a/sys/netiso/clnp_stat.h +++ b/sys/netiso/clnp_stat.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_stat.h 8.1 (Berkeley) 6/10/93 - * $Id: clnp_stat.h,v 1.2 1994/08/02 07:49:47 davidg Exp $ + * $Id: clnp_stat.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */ #ifndef _NETISO_CLNP_STAT_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,7 +63,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_stat.h,v 1.2 1994/08/02 07:49:47 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_stat.h,v 1.3 1994/08/21 06:14:13 paul Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_stat.h,v $ */ struct clnp_stat { @@ -100,4 +100,4 @@ struct clnp_stat { #endif /* INCSTAT */ #define INCSTAT(x) clnp_stat./**/x/**/++ -#endif +#endif diff --git a/sys/netiso/clnp_subr.c b/sys/netiso/clnp_subr.c index 29a2ab1..138871e 100644 --- a/sys/netiso/clnp_subr.c +++ b/sys/netiso/clnp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: clnp_subr.c,v 1.2 1994/08/02 07:49:50 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_subr.c,v 1.1.1.1 1994/05/24 10:07:20 rgrimes Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_subr.c,v 1.2 1994/08/02 07:49:50 davidg Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_subr.c,v $ */ #ifdef ISO @@ -97,9 +97,9 @@ SOFTWARE. * RETURNS: success - ptr to mbuf chain * failure - 0 * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ struct mbuf * clnp_data_ck(m, length) @@ -139,13 +139,13 @@ int length; /* length (in bytes) of packet */ * supplied buffer. Place them in the supplied address buffers. * If insufficient data is supplied, then fail. * - * RETURNS: success - Address of first byte in the packet past + * RETURNS: success - Address of first byte in the packet past * the address part. * failure - 0 * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ caddr_t clnp_extract_addr(bufp, buflen, srcp, destp) @@ -156,7 +156,7 @@ register struct iso_addr *destp; /* ptr to destination address buffer */ { int len; /* argument to bcopy */ - /* + /* * check that we have enough data. Plus1 is for length octet */ if ((u_char)*bufp + 1 > buflen) { @@ -167,7 +167,7 @@ register struct iso_addr *destp; /* ptr to destination address buffer */ buflen -= len; bufp += len; - /* + /* * check that we have enough data. Plus1 is for length octet */ if ((u_char)*bufp + 1 > buflen) { @@ -196,9 +196,9 @@ register struct iso_addr *destp; /* ptr to destination address buffer */ * RETURNS: packet is for us - 1 * packet is not for us - 0 * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_ours(dst) register struct iso_addr *dst; /* ptr to destination address */ @@ -207,7 +207,7 @@ register struct iso_addr *dst; /* ptr to destination address */ for (ia = iso_ifaddr; ia; ia = ia->ia_next) { IFDEBUG(D_ROUTE) - printf("clnp_ours: ia_sis x%x, dst x%x\n", &ia->ia_addr, + printf("clnp_ours: ia_sis x%x, dst x%x\n", &ia->ia_addr, dst); ENDDEBUG /* @@ -237,9 +237,9 @@ int congest_threshold = 0; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_forward(m, len, dst, oidx, seg_off, inbound_shp) struct mbuf *m; /* pkt to forward */ @@ -313,7 +313,7 @@ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */ ifp = ia->ia_ifp; IFDEBUG(D_FORWARD) - printf("clnp_forward: packet routed to %s\n", + printf("clnp_forward: packet routed to %s\n", clnp_iso_addrp(&((struct sockaddr_iso *)next_hop)->siso_addr)); ENDDEBUG @@ -322,10 +322,10 @@ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */ /* * If we are an intermediate system and * we are routing outbound on the same ifp that the packet - * arrived upon, and we know the next hop snpa, + * arrived upon, and we know the next hop snpa, * then generate a redirect request */ - if ((iso_systype & SNPA_IS) && (inbound_shp) && + if ((iso_systype & SNPA_IS) && (inbound_shp) && (ifp == inbound_shp->snh_ifp)) esis_rdoutput(inbound_shp, m, oidx, dst, route.ro_rt); /* @@ -365,7 +365,7 @@ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */ } } #endif /* DECBIT */ - + /* * Dispatch the datagram if it is small enough, otherwise fragment */ @@ -375,7 +375,7 @@ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */ } else { (void) clnp_fragment(ifp, m, next_hop, len, seg_off, /* flags */0, route.ro_rt); } - + done: /* * Free route @@ -393,7 +393,7 @@ done: * * RETURNS: Address of first byte after address part in datagram. * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Assume that there is enough space for the address part. */ @@ -419,7 +419,7 @@ register struct iso_addr *dstp; /* ptr to dst addr */ /* * FUNCTION: clnp_route * - * PURPOSE: Route a clnp datagram to the first hop toward its + * PURPOSE: Route a clnp datagram to the first hop toward its * destination. In many cases, the first hop will be * the destination. The address of a route * is specified. If a routing entry is present in @@ -430,7 +430,7 @@ register struct iso_addr *dstp; /* ptr to dst addr */ * RETURNS: route found - 0 * unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: It is up to the caller to free the routing entry * allocated in route. @@ -525,7 +525,7 @@ clnp_route(dst, ro, flags, first_hop, ifa) * * RETURNS: 0 or unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Remember that option index pointers are really * offsets from the beginning of the mbuf. @@ -542,7 +542,7 @@ struct iso_addr *final_dst; /* final destination */ int error = 0; /* return code */ /* - * Check if we have run out of routes + * Check if we have run out of routes * If so, then try to route on destination. */ if CLNPSRCRT_TERM(oidx, options) { @@ -562,7 +562,7 @@ struct iso_addr *final_dst; /* final destination */ error = clnp_route(&dst, ro, 0, first_hop, ifa); if (error != 0) return error; - + /* * If complete src rt, first hop must be equal to dst */ @@ -573,7 +573,7 @@ struct iso_addr *final_dst; /* final destination */ ENDDEBUG return EHOSTUNREACH; /* RAH? would like ESRCRTFAILED */ } - + return error; } @@ -584,7 +584,7 @@ struct iso_addr *final_dst; /* final destination */ * * RETURNS: result of clnp_output * - * SIDE EFFECTS: + * SIDE EFFECTS: */ clnp_echoreply(ec_m, ec_len, ec_src, ec_dst, ec_oidxp) struct mbuf *ec_m; /* echo request */ @@ -644,7 +644,7 @@ char *file; /* where the dirty deed occured */ * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: No attempt has been made to make this efficient */ diff --git a/sys/netiso/clnp_timer.c b/sys/netiso/clnp_timer.c index f104f52..401d358 100644 --- a/sys/netiso/clnp_timer.c +++ b/sys/netiso/clnp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)clnp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id: clnp_timer.c,v 1.2 1994/08/02 07:49:52 davidg Exp $ + * $Id: clnp_timer.c,v 1.3 1994/11/15 14:26:13 bde Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/clnp_timer.c,v 1.2 1994/08/02 07:49:52 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/clnp_timer.c,v 1.3 1994/11/15 14:26:13 bde Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/clnp_timer.c,v $ */ #include <sys/param.h> @@ -89,9 +89,9 @@ extern struct clnp_fragl *clnp_frags; * * RETURNS: pointer to next fragment in list of fragments * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: * TODO: send ER back to source */ struct clnp_fragl * @@ -136,14 +136,14 @@ register struct clnp_fragl *cfh; /* fragment header to delete */ /* * FUNCTION: clnp_slowtimo * - * PURPOSE: clnp timer processing; if the ttl expires on a + * PURPOSE: clnp timer processing; if the ttl expires on a * packet on the reassembly queue, discard it. * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ clnp_slowtimo() { @@ -168,9 +168,9 @@ clnp_slowtimo() * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: * TODO: should send back ER */ clnp_drain() diff --git a/sys/netiso/cltp_usrreq.c b/sys/netiso/cltp_usrreq.c index ef4c703..7b95f93 100644 --- a/sys/netiso/cltp_usrreq.c +++ b/sys/netiso/cltp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)cltp_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: cltp_usrreq.c,v 1.2 1994/08/02 07:49:55 davidg Exp $ + * $Id: cltp_usrreq.c,v 1.3 1994/11/15 14:26:14 bde Exp $ */ #ifndef CLTPOVAL_SRC /* XXX -- till files gets changed */ @@ -104,7 +104,7 @@ cltp_input(m0, srcsa, dstsa, cons_channel, output) bcopy((caddr_t)up + 2, TSEL(src), up[1]); up += 2 + src->siso_tlen; continue; - + case CLTPOVAL_DST: dtsap = 2 + (caddr_t)up; dlen = up[1]; diff --git a/sys/netiso/cons.h b/sys/netiso/cons.h index 60b4996..ecaa374 100644 --- a/sys/netiso/cons.h +++ b/sys/netiso/cons.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)cons.h 8.1 (Berkeley) 6/10/93 - * $Id: cons.h,v 1.2 1994/08/02 07:50:00 davidg Exp $ + * $Id: cons.h,v 1.3 1994/08/21 06:14:15 paul Exp $ */ #ifndef _NETISO_CONS_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -64,7 +64,7 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/cons.h,v 1.2 1994/08/02 07:50:00 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/cons.h,v 1.3 1994/08/21 06:14:15 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/cons.h,v $ * * interface between TP and CONS diff --git a/sys/netiso/cons_pcb.h b/sys/netiso/cons_pcb.h index 95ac89f..7a3b52f 100644 --- a/sys/netiso/cons_pcb.h +++ b/sys/netiso/cons_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)cons_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: cons_pcb.h,v 1.2 1994/08/02 07:50:03 davidg Exp $ + * $Id: cons_pcb.h,v 1.3 1994/08/21 06:14:16 paul Exp $ */ #ifndef _NETISO_CONS_PCB_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,7 +63,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/cons_pcb.h,v 1.2 1994/08/02 07:50:03 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/cons_pcb.h,v 1.3 1994/08/21 06:14:16 paul Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/cons_pcb.h,v $ */ /* @@ -102,13 +102,13 @@ struct cons_pcb { #define co_negchanmask _co_isopcb.isop_negchanmask #define co_x25crud _co_isopcb.isop_x25crud #define co_x25crud_len _co_isopcb.isop_x25crud_len - u_short co_state; - u_char co_flags; + u_short co_state; + u_char co_flags; u_short co_ttl; /* time to live timer */ u_short co_init_ttl; /* initial value of ttl */ int co_channel; /* logical channel */ struct ifnet * co_ifp; /* interface */ - struct protosw *co_proto; + struct protosw *co_proto; struct ifqueue co_pending; /* queue data to send when connection completes*/ @@ -118,7 +118,7 @@ struct cons_pcb { }; /* - * X.25 Packet types + * X.25 Packet types */ #define XPKT_DATA 1 #define XPKT_INTERRUPT 2 @@ -184,7 +184,7 @@ struct cons_stat { u_char x25_error_stats[CONL_ERROR_MAX + 1]; -struct ifqueue consintrq; +struct ifqueue consintrq; /* reasons for clear are in a data mbuf chained to a clear ecn_request */ struct e_clear_data { diff --git a/sys/netiso/eonvar.h b/sys/netiso/eonvar.h index edbc46d..8b00532 100644 --- a/sys/netiso/eonvar.h +++ b/sys/netiso/eonvar.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)eonvar.h 8.1 (Berkeley) 6/10/93 - * $Id: eonvar.h,v 1.2 1994/08/02 07:50:06 davidg Exp $ + * $Id: eonvar.h,v 1.3 1994/08/21 06:14:17 paul Exp $ */ #ifndef _NETISO_EONVAR_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -73,9 +73,9 @@ SOFTWARE. #define E_LINK 2 #define E_ES 3 #define E_IS 4 - -/* + +/* * this overlays a sockaddr_iso */ diff --git a/sys/netiso/esis.c b/sys/netiso/esis.c index 8860932..f62de5d 100644 --- a/sys/netiso/esis.c +++ b/sys/netiso/esis.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)esis.c 8.1 (Berkeley) 6/10/93 - * $Id: esis.c,v 1.2 1994/08/02 07:50:09 davidg Exp $ + * $Id: esis.c,v 1.3 1994/12/13 22:33:03 wollman Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -124,9 +124,9 @@ extern char all_es_snpa[], all_is_snpa[]; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_init() { @@ -156,7 +156,7 @@ esis_init() * * RETURNS: 0 or appropriate errno * - * SIDE EFFECTS: + * SIDE EFFECTS: * */ /*ARGSUSED*/ @@ -238,9 +238,9 @@ release: * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ @@ -294,7 +294,7 @@ bad: * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Assumes there is enough space for fixed part of header, * DA, BSNPA and NET in first mbuf. @@ -366,14 +366,14 @@ struct rtentry *rt; /* snpa cache info regarding next hop of cp += sdl->sdl_alen; len += (sdl->sdl_alen + 1); - /* + /* * If the next hop is not the destination, then it ought to be * an IS and it should be inserted next. Else, set the * NETL to 0 */ /* PHASE2 use mask from ifp of outgoing interface */ if (!iso_addrmatch1(rd_dstnsap, rd_gwnsap)) { - /* this should not happen: + /* this should not happen: if ((nhop_sc->sc_flags & SNPA_IS) == 0) { printf("esis_rdoutput: next hop is not dst and not an IS\n"); m_freem(m0); @@ -392,7 +392,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of * used should be the mask present in the routing entry used to * forward the original data packet. */ - + /* * Copy Qos, priority, or security options present in original npdu */ @@ -411,7 +411,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of /* assumes MLEN > optlen */ } /* assume MLEN-len > optlen */ - /* + /* * When copying options, copy from ptr - 2 in order to grab * the option code and length */ @@ -426,7 +426,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of cp += 3; } if (inbound_oidx->cni_securep) { - bcopy(mtod(inbound_m, caddr_t) + inbound_oidx->cni_securep - 2, cp, + bcopy(mtod(inbound_m, caddr_t) + inbound_oidx->cni_securep - 2, cp, (unsigned)(inbound_oidx->cni_secure_len + 2)); cp += inbound_oidx->cni_secure_len + 2; } @@ -485,7 +485,7 @@ int nsellen; if (b > buflim) {esis_stat.es_toosmall++; goto bad;}} int ESHonly = 0; /* - + /* * FUNCTION: esis_eshinput * @@ -493,9 +493,9 @@ int ESHonly = 0; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_eshinput(m, shp) struct mbuf *m; /* esh pdu */ @@ -544,7 +544,7 @@ struct snpa_hdr *shp; /* subnetwork header */ if (nsellength != 0) for (buf2 = buf; buf2 < buflim;) { ESIS_EXTRACT_ADDR(nsap2, buf2); IFDEBUG(D_ESISINPUT) - printf("esis_eshinput: comparing %s ", + printf("esis_eshinput: comparing %s ", clnp_iso_addrp(nsap)); printf("and %s\n", clnp_iso_addrp(nsap2)); ENDDEBUG @@ -560,7 +560,7 @@ struct snpa_hdr *shp; /* subnetwork header */ } } IFDEBUG(D_ESISINPUT) - printf("esis_eshinput: nsap %s is %s\n", + printf("esis_eshinput: nsap %s is %s\n", clnp_iso_addrp(nsap), new_entry ? "new" : "old"); ENDDEBUG if (new_entry && (iso_systype & SNPA_IS)) @@ -575,11 +575,11 @@ bad: * * PURPOSE: process an incoming ISH pdu * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_ishinput(m, shp) struct mbuf *m; /* esh pdu */ @@ -617,7 +617,7 @@ struct snpa_hdr *shp; /* subnetwork header */ esis_config(); } break; - + default: printf("Unknown ISH option: %x\n", *buf); } @@ -625,12 +625,12 @@ struct snpa_hdr *shp; /* subnetwork header */ } new_entry = snpac_add(shp->snh_ifp, nsap, shp->snh_shost, SNPA_IS, ht, 0); IFDEBUG(D_ESISINPUT) - printf("esis_ishinput: nsap %s is %s\n", + printf("esis_ishinput: nsap %s is %s\n", clnp_iso_addrp(nsap), new_entry ? "new" : "old"); ENDDEBUG if (new_entry) - esis_shoutput(shp->snh_ifp, + esis_shoutput(shp->snh_ifp, iso_systype & SNPA_ES ? ESIS_ESH : ESIS_ISH, esis_holding_time, shp->snh_shost, 6, (struct iso_addr *)0); bad: @@ -642,11 +642,11 @@ bad: * * PURPOSE: Process an incoming RD pdu * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_rdinput(m0, shp) struct mbuf *m0; /* esh pdu */ @@ -737,9 +737,9 @@ bad: ; /* Needed by ESIS_NEXT_OPTION */ * * PURPOSE: Report configuration * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Called every esis_config_time seconds */ @@ -750,8 +750,8 @@ esis_config() timeout(esis_config, (caddr_t)0, hz * esis_config_time); - /* - * Report configuration for each interface that + /* + * Report configuration for each interface that * - is UP * - has BROADCAST capability * - has an ISO address @@ -761,7 +761,7 @@ esis_config() * a method in the iso_ifaddr structure to encapsulate and * transmit it. This could work to advantage for non-broadcast media */ - + for (ifp = ifnet; ifp; ifp = ifp->if_next) { if ((ifp->if_flags & IFF_UP) && (ifp->if_flags & IFF_BROADCAST)) { @@ -770,10 +770,10 @@ esis_config() for (ia = ifp->if_addrlist; ia; ia = ia->ifa_next) { if (ia->ifa_addr->sa_family == AF_ISO) { - esis_shoutput(ifp, + esis_shoutput(ifp, iso_systype & SNPA_ES ? ESIS_ESH : ESIS_ISH, esis_holding_time, - (caddr_t)(iso_systype & SNPA_ES ? all_is_snpa : + (caddr_t)(iso_systype & SNPA_ES ? all_is_snpa : all_es_snpa), 6, (struct iso_addr *)0); break; } @@ -789,9 +789,9 @@ esis_config() * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ esis_shoutput(ifp, type, ht, sn_addr, sn_len, isoa) struct ifnet *ifp; @@ -811,7 +811,7 @@ struct iso_addr *isoa; if (type == ESIS_ESH) esis_stat.es_eshsent++; - else if (type == ESIS_ISH) + else if (type == ESIS_ISH) esis_stat.es_ishsent++; else { printf("esis_shoutput: bad pdu type\n"); @@ -865,7 +865,7 @@ struct iso_addr *isoa; naddr = 1; } for (ia = iso_ifaddr; ia; ia = ia->ia_next) { - int nsellen = (type == ESIS_ISH ? ia->ia_addr.siso_tlen : 0); + int nsellen = (type == ESIS_ISH ? ia->ia_addr.siso_tlen : 0); int n = ia->ia_addr.siso_nlen; register struct iso_ifaddr *ia2; @@ -881,7 +881,7 @@ struct iso_addr *isoa; continue; /* Ditto */ } IFDEBUG(D_ESISOUTPUT) - printf("esis_shoutput: adding NSAP %s\n", + printf("esis_shoutput: adding NSAP %s\n", clnp_iso_addrp(&ia->ia_addr.siso_addr)); ENDDEBUG if (!esis_insert_addr(&cp, &len, @@ -931,9 +931,9 @@ struct iso_addr *isoa; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ isis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ @@ -948,7 +948,7 @@ struct snpa_hdr *shp; /* subnetwork header */ IFDEBUG(D_ISISINPUT) int i; - printf("isis_input: pkt on ifp x%x (%s%d): from:", ifp, + printf("isis_input: pkt on ifp x%x (%s%d): from:", ifp, ifp->if_name, ifp->if_unit); for (i=0; i<6; i++) printf("%x%c", shp->snh_shost[i]&0xff, (i<5) ? ':' : ' '); @@ -1042,7 +1042,7 @@ release: * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Calls snpac_flush for interface specified. * The loop through iso_ifaddr is stupid because diff --git a/sys/netiso/esis.h b/sys/netiso/esis.h index 1b864c9..400d120 100644 --- a/sys/netiso/esis.h +++ b/sys/netiso/esis.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)esis.h 8.1 (Berkeley) 6/10/93 - * $Id: esis.h,v 1.2 1994/08/02 07:50:11 davidg Exp $ + * $Id: esis.h,v 1.3 1994/08/21 06:14:18 paul Exp $ */ #ifndef _NETISO_ESIS_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -64,7 +64,7 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/esis.h,v 1.2 1994/08/02 07:50:11 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/esis.h,v 1.3 1994/08/21 06:14:18 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/esis.h,v $ */ diff --git a/sys/netiso/idrp_usrreq.c b/sys/netiso/idrp_usrreq.c index b551231..8e3a3d2 100644 --- a/sys/netiso/idrp_usrreq.c +++ b/sys/netiso/idrp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)idrp_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: idrp_usrreq.c,v 1.2 1994/08/02 07:50:16 davidg Exp $ */ #include <sys/param.h> @@ -79,7 +79,7 @@ idrp_init() * FUNCTION and ARGUMENTS: * Take a packet (m) from clnp, strip off the clnp header * and mke suitable for the idrp socket. - * No return value. + * No return value. */ idrp_input(m, src, dst) register struct mbuf *m; diff --git a/sys/netiso/if_cons.c b/sys/netiso/if_cons.c index 8c519ed..28559b7 100644 --- a/sys/netiso/if_cons.c +++ b/sys/netiso/if_cons.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_cons.c 8.1 (Berkeley) 6/10/93 - * $Id: if_cons.c,v 1.2 1994/08/02 07:50:20 davidg Exp $ + * $Id: if_cons.c,v 1.3 1994/12/13 22:33:04 wollman Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,18 +61,18 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/if_cons.c,v 1.2 1994/08/02 07:50:20 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/if_cons.c,v 1.3 1994/12/13 22:33:04 wollman Exp $ * $Source: /home/ncvs/src/sys/netiso/if_cons.c,v $ * * cons.c - Connection Oriented Network Service: - * including support for a) user transport-level service, + * including support for a) user transport-level service, * b) COSNS below CLNP, and c) CONS below TP. */ #ifdef TPCONS #ifdef KERNEL #ifdef ARGO_DEBUG -#define Static +#define Static unsigned LAST_CALL_PCB; #else /* ARGO_DEBUG */ #define Static static @@ -121,7 +121,7 @@ unsigned LAST_CALL_PCB; #define DONTCLEAR -1 -/********************************************************************* +/********************************************************************* * cons.c - CONS interface to the x.25 layer * * TODO: figure out what resources we might run out of besides mbufs. @@ -129,21 +129,21 @@ unsigned LAST_CALL_PCB; * lru x% of the connections, for some parameter x. * * There are 2 interfaces from above: - * 1) from TP0: + * 1) from TP0: * cons CO network service * TP associates a transport connection with a network connection. - * cons_output( isop, m, len, isdgm==0 ) + * cons_output( isop, m, len, isdgm==0 ) * co_flags == 0 * 2) from TP4: * It's a datagram service, like clnp is. - even though it calls - * cons_output( isop, m, len, isdgm==1 ) + * cons_output( isop, m, len, isdgm==1 ) * it eventually goes through * cosns_output(ifp, m, dst). - * TP4 permits multiplexing (reuse, possibly simultaneously) of the + * TP4 permits multiplexing (reuse, possibly simultaneously) of the * network connections. * This means that many sockets (many tpcbs) may be associated with * this pklcd, hence cannot have a back ptr from pklcd to a tpcb. - * co_flags & CONSF_DGM + * co_flags & CONSF_DGM * co_socket is null since there may be many sockets that use this pklcd. * NOTE: @@ -151,7 +151,7 @@ NOTE: NOTE: PVCs could be handled by config-ing a cons with an address and with the IFF_POINTTOPOINT flag on. This code would then have to skip the - connection setup stuff for pt-to-pt links. + connection setup stuff for pt-to-pt links. *********************************************************************/ @@ -205,7 +205,7 @@ nibble_copy(src_octet, src_nibble, dst_octet, dst_nibble, len) register unsigned dshift, sshift; IFDEBUG(D_CADDR) - printf("nibble_copy ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n", + printf("nibble_copy ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n", src_octet, src_nibble, dst_octet, dst_nibble, len); ENDDEBUG #define SHIFT 0x4 @@ -252,7 +252,7 @@ nibble_match( src_octet, src_nibble, dst_octet, dst_nibble, len) u_char nibble_a, nibble_b; IFDEBUG(D_CADDR) - printf("nibble_match ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n", + printf("nibble_match ( 0x%x, 0x%x, 0x%x, 0x%x 0x%x)\n", src_octet, src_nibble, dst_octet, dst_nibble, len); ENDDEBUG #define SHIFT 0x4 @@ -294,7 +294,7 @@ cons_init() int tp_incoming(), clnp_incoming(); - CLNP_proto = pffindproto(AF_ISO, ISOPROTO_CLNP, SOCK_DGRAM); + CLNP_proto = pffindproto(AF_ISO, ISOPROTO_CLNP, SOCK_DGRAM); X25_proto = pffindproto(AF_ISO, ISOPROTO_X25, SOCK_STREAM); TP_proto = pffindproto(AF_ISO, ISOPROTO_TP0, SOCK_SEQPACKET); IFDEBUG(D_CCONS) @@ -375,7 +375,7 @@ struct pklcd *lcp; cmd = PRC_ROUTEDEAD; } tpcons_ctlinput(cmd, isop->isop_faddr, isop); - if (cmd = PRC_ROUTEDEAD && isop->isop_refcnt == 0) + if (cmd = PRC_ROUTEDEAD && isop->isop_refcnt == 0) iso_pcbdetach(isop); } } @@ -383,7 +383,7 @@ struct pklcd *lcp; /* * NAME: cons_connect() * CALLED FROM: - * tpcons_pcbconnect() when opening a new connection. + * tpcons_pcbconnect() when opening a new connection. * FUNCTION anD ARGUMENTS: * Figures out which device to use, finding a route if one doesn't * already exist. @@ -411,8 +411,8 @@ cons_connect(isop) IFDEBUG(D_CCONN) printf( "calling make_partial_x25_packet( 0x%x, 0x%x, 0x%x)\n", - &lcp->lcd_faddr, &lcp->lcd_laddr, - isop->isop_socket->so_proto->pr_protocol); + &lcp->lcd_faddr, &lcp->lcd_laddr, + isop->isop_socket->so_proto->pr_protocol); ENDDEBUG if ((error = make_partial_x25_packet(isop, lcp, m)) == 0) error = pk_connect(lcp, &lcp->lcd_faddr); @@ -424,7 +424,7 @@ cons_connect(isop) */ -/* +/* * NAME: cons_ctlinput() * CALLED FROM: * lower layer when ECN_CLEAR occurs : this routine is here @@ -486,8 +486,8 @@ find_error_reason( xp ) case 0x0d: case 0x95: /* RPOA out of order */ case 0x15: - /* take out bit 8 - * so we don't have to have so many perror entries + /* take out bit 8 + * so we don't have to have so many perror entries */ error = (CONL_ERROR_MASK | 0x100 | (cause & ~0x80)); goto done; @@ -497,8 +497,8 @@ find_error_reason( xp ) error = (CONL_ERROR_MASK | 0x100 | cause); goto done; - } - } + } + } /* otherwise, a *hopefully* valid perror exists in the e_reason field */ error = xp->packet_data; if (error = 0) { @@ -506,7 +506,7 @@ find_error_reason( xp ) pk_decode(xp), cause); error = E_CO_HLI_DISCA; - } + } done: return error; @@ -530,9 +530,9 @@ done: * m+1 facil param len (for >2-byte facilities) in octets * m+2..p facil param field * q user data (protocol identification octet) - * * - * RETURNS: + * + * RETURNS: * 0 if OK * E* if failed. * @@ -541,7 +541,7 @@ done: * routine knows where to look for it. */ -#ifdef X25_1984 +#ifdef X25_1984 int cons_use_facils = 1; #else /* X25_1984 */ int cons_use_facils = 0; @@ -589,14 +589,14 @@ make_partial_x25_packet(isop, lcp) return ENOBUFS; buf = mtod(m, caddr_t); ptr = buf; - + /* ptr now points to facil length (len of whole facil field in OCTETS */ facil_len = ptr ++; m->m_len = 0; pk_build_facilities(m, &lcp->lcd_faddr, 0); IFDEBUG(D_CADDR) - printf("make_partial calling: ptr 0x%x, len 0x%x\n", ptr, + printf("make_partial calling: ptr 0x%x, len 0x%x\n", ptr, isop->isop_laddr->siso_addr.isoa_len); ENDDEBUG if (cons_use_facils) { @@ -615,7 +615,7 @@ make_partial_x25_packet(isop, lcp) ptr += len; IFDEBUG(D_CADDR) - printf("make_partial called: ptr 0x%x, len 0x%x\n", ptr, + printf("make_partial called: ptr 0x%x, len 0x%x\n", ptr, isop->isop_faddr->siso_addr.isoa_len); ENDDEBUG *ptr = 0xc9; /* called facility code */ @@ -641,7 +641,7 @@ make_partial_x25_packet(isop, lcp) IFDEBUG(D_CDUMP_REQ) register int i; - printf("ECN_CONNECT DATA buf 0x%x len %d (0x%x)\n", + printf("ECN_CONNECT DATA buf 0x%x len %d (0x%x)\n", buf, buflen, buflen); for( i=0; i < buflen; ) { printf("+%d: %x %x %x %x %x %x %x %x\n", @@ -652,7 +652,7 @@ make_partial_x25_packet(isop, lcp) } ENDDEBUG IFDEBUG(D_CADDR) - printf("make_partial returns buf 0x%x size 0x%x bytes\n", + printf("make_partial returns buf 0x%x size 0x%x bytes\n", mtod(m, caddr_t), buflen); ENDDEBUG @@ -668,7 +668,7 @@ make_partial_x25_packet(isop, lcp) * NAME: NSAPtoDTE() * CALLED FROM: * make_partial_x25_packet() - * FUNCTION and ARGUMENTS: + * FUNCTION and ARGUMENTS: * get a DTE address from an NSAP-address (struct sockaddr_iso) * (dst_octet) is the octet into which to begin stashing the DTE addr * (dst_nibble) takes 0 or 1. 1 means begin filling in the DTE addr @@ -761,7 +761,7 @@ FACILtoNSAP(addr, buf) u_char buf_len = (len_in_nibbles + 1) >> 1;; /* in bytes */ IFDEBUG(D_CADDR) - printf("FACILtoNSAP( 0x%x, 0x%x, 0x%x )\n", + printf("FACILtoNSAP( 0x%x, 0x%x, 0x%x )\n", buf, buf_len, addr ); ENDDEBUG @@ -807,7 +807,7 @@ register struct sockaddr_iso *siso; * FUNCTION and ARGUMENTS: * Creates a type 37 NSAP in the sockaddr_iso (addr) * from a DTE address found in a sockaddr_x25. - * + * * RETURNS: * 0 if ok; E* otherwise. */ @@ -867,15 +867,15 @@ parse_facil(lcp, isop, buf, buf_len) int facil_param_len, facil_len; IFDEBUG(D_CADDR) - printf("parse_facil(0x%x, 0x%x, 0x%x, 0x%x)\n", + printf("parse_facil(0x%x, 0x%x, 0x%x, 0x%x)\n", lcp, isop, buf, buf_len); dump_buf(buf, buf_len); ENDDEBUG - /* find the beginnings of the facility fields in buf + /* find the beginnings of the facility fields in buf * by skipping over the called & calling DTE addresses * i <- # nibbles in called + # nibbles in calling - * i += 1 so that an odd nibble gets rounded up to even + * i += 1 so that an odd nibble gets rounded up to even * before dividing by 2, then divide by two to get # octets */ i = (int)(*ptr >> 4) + (int)(*ptr&0xf); @@ -919,7 +919,7 @@ parse_facil(lcp, isop, buf, buf_len) case 0x02: /* throughput class */ case 0x03: case 0x47: /* CUG shit */ case 0x0b: /* expedited data negot */ - case 0x01: /* Fast select or reverse charging + case 0x01: /* Fast select or reverse charging (example of intelligent protocol design) */ case 0x04: /* charging info : requesting service */ case 0x08: /* called line addr modified notification */ @@ -951,7 +951,7 @@ parse_facil(lcp, isop, buf, buf_len) } if (facil_param_len == -1) return E_CO_REG_ICDA; - if (facil_param_len == 0) /* variable length */ + if (facil_param_len == 0) /* variable length */ facil_param_len = (int)*ptr++; /* 1 + the real facil param */ ptr += facil_param_len; } diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c index a7cba8e..c8ac599 100644 --- a/sys/netiso/if_eon.c +++ b/sys/netiso/if_eon.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_eon.c 8.1 (Berkeley) 6/10/93 - * $Id: if_eon.c,v 1.2 1994/08/02 07:50:23 davidg Exp $ + * $Id: if_eon.c,v 1.3 1995/04/26 18:10:57 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,10 +61,10 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/if_eon.c,v 1.2 1994/08/02 07:50:23 davidg Exp $ - * $Source: /home/ncvs/src/sys/netiso/if_eon.c,v $ + * $Header: /home/ncvs/src/sys/netiso/if_eon.c,v 1.3 1995/04/26 18:10:57 pst Exp $ + * $Source: /home/ncvs/src/sys/netiso/if_eon.c,v $ * - * EON rfc + * EON rfc * Layer between IP and CLNL * * TODO: @@ -144,7 +144,7 @@ eonattach() ENDDEBUG ifp->if_unit = 0; ifp->if_name = "eon"; - ifp->if_mtu = ETHERMTU; + ifp->if_mtu = ETHERMTU; /* since everything will go out over ether or token ring */ ifp->if_init = eoninit; @@ -156,7 +156,7 @@ eonattach() ifp->if_flags = IFF_BROADCAST; if_attach(ifp); eonioctl(ifp, SIOCSIFADDR, (caddr_t)ifp->if_addrlist); - eon_llinfo.el_qhdr.link = + eon_llinfo.el_qhdr.link = eon_llinfo.el_qhdr.rlink = &(eon_llinfo.el_qhdr); IFDEBUG(D_EON) @@ -169,7 +169,7 @@ eonattach() * FUNCTION: eonioctl * * PURPOSE: io controls - ifconfig - * need commands to + * need commands to * link-UP (core addr) (flags: ES, IS) * link-DOWN (core addr) (flags: ES, IS) * must be callable from kernel or user @@ -237,7 +237,7 @@ caddr_t loc; ro->ro_rt->rt_use++; hdr->ei_ip.ip_dst = sin->sin_addr; hdr->ei_ip.ip_p = IPPROTO_EON; - hdr->ei_ip.ip_ttl = MAXTTL; + hdr->ei_ip.ip_ttl = MAXTTL; hdr->ei_eh.eonh_class = class; hdr->ei_eh.eonh_vers = EON_VERSION; hdr->ei_eh.eonh_csum = 0; @@ -245,12 +245,12 @@ caddr_t loc; mhead.m_len = sizeof(struct eon_hdr); mhead.m_next = 0; IFDEBUG(D_EON) - printf("eonoutput : gen csum (0x%x, offset %d, datalen %d)\n", + printf("eonoutput : gen csum (0x%x, offset %d, datalen %d)\n", &mhead, - _offsetof(struct eon_hdr, eonh_csum), sizeof(struct eon_hdr)); + _offsetof(struct eon_hdr, eonh_csum), sizeof(struct eon_hdr)); ENDDEBUG - iso_gen_csum(&mhead, - _offsetof(struct eon_hdr, eonh_csum), sizeof(struct eon_hdr)); + iso_gen_csum(&mhead, + _offsetof(struct eon_hdr, eonh_csum), sizeof(struct eon_hdr)); } /* * FUNCTION: eonrtrequest @@ -343,7 +343,7 @@ eoninit(unit) * * RETURNS: unix error code * - * NOTES: + * NOTES: * */ eonoutput(ifp, m, dst, rt) @@ -494,7 +494,7 @@ drop: goto drop; } m->m_data -= sizeof(struct ip); - + IFDEBUG(D_EON) printf("eoninput csum ok class 0x%x\n", eonhdr->eonh_class ); printf("eoninput: eon header:\n"); @@ -546,9 +546,9 @@ drop: return; } IF_ENQUEUE(ifq, m); - IFDEBUG(D_EON) + IFDEBUG(D_EON) printf( - "0x%x enqueued on clnp Q: m_len 0x%x m_type 0x%x m_data 0x%x\n", + "0x%x enqueued on clnp Q: m_len 0x%x m_type 0x%x m_data 0x%x\n", m, m->m_len, m->m_type, m->m_data); dump_buf(mtod(m, caddr_t), m->m_len); ENDDEBUG diff --git a/sys/netiso/iso.c b/sys/netiso/iso.c index ce2a573..447fb21 100644 --- a/sys/netiso/iso.c +++ b/sys/netiso/iso.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso.c 8.2 (Berkeley) 11/15/93 - * $Id: iso.c,v 1.2 1994/08/02 07:50:26 davidg Exp $ + * $Id: iso.c,v 1.3 1995/04/26 18:10:58 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,8 +61,8 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/iso.c,v 1.2 1994/08/02 07:50:26 davidg Exp $ - * $Source: /home/ncvs/src/sys/netiso/iso.c,v $ + * $Header: /home/ncvs/src/sys/netiso/iso.c,v 1.3 1995/04/26 18:10:58 pst Exp $ + * $Source: /home/ncvs/src/sys/netiso/iso.c,v $ * * iso.c: miscellaneous routines to support the iso address family */ @@ -103,9 +103,9 @@ void llc_rtrequest(); * * RETURNS: true if the addrs match, false if they do not * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ iso_addrmatch1(isoaa, isoab) register struct iso_addr *isoaa, *isoab; /* addresses to check */ @@ -127,14 +127,14 @@ register struct iso_addr *isoaa, *isoab; /* addresses to check */ ENDDEBUG return 0; } - + #ifdef notdef /* TODO : generalize this to all afis with masks */ if( isoaa->isoa_afi == AFI_37 ) { /* must not compare 2 least significant digits, or for * that matter, the DSP */ - compare_len = ADDR37_IDI_LEN - 1; + compare_len = ADDR37_IDI_LEN - 1; } #endif @@ -166,9 +166,9 @@ register struct iso_addr *isoaa, *isoab; /* addresses to check */ * * RETURNS: true if the addrs match, false if they do not * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ iso_addrmatch(sisoa, sisob) struct sockaddr_iso *sisoa, *sisob; /* addresses to check */ @@ -184,9 +184,9 @@ struct sockaddr_iso *sisoa, *sisob; /* addresses to check */ * * RETURNS: true if same net, false if not * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ iso_netmatch(sisoa, sisob) struct sockaddr_iso *sisoa, *sisob; @@ -218,10 +218,10 @@ struct sockaddr_iso *sisoa, *sisob; * * RETURNS: The hash value. * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: The hash is achieved by exclusive ORing 4 byte - * quantities. + * quantities. */ u_long iso_hashchar(buf, len) @@ -257,7 +257,7 @@ register int len; /* length of buffer */ h ^= l; } - + h ^= (u_long) (len % 4); return(h); @@ -270,9 +270,9 @@ register int len; /* length of buffer */ * * RETURNS: none * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ iso_hash(siso, hp) struct sockaddr_iso *siso; /* address to perform hash on */ @@ -291,12 +291,12 @@ struct afhash *hp; /* RETURN: hash info here */ printf("iso_hash: iso_netof: bufsize = %d\n", bufsize); ENDDEBUG - hp->afh_hosthash = iso_hashchar((caddr_t)&siso->siso_addr, + hp->afh_hosthash = iso_hashchar((caddr_t)&siso->siso_addr, siso->siso_addr.isoa_len); IFDEBUG(D_ROUTE) printf("iso_hash: %s: nethash = x%x, hosthash = x%x\n", - clnp_iso_addrp(&siso->siso_addr), hp->afh_nethash, + clnp_iso_addrp(&siso->siso_addr), hp->afh_nethash, hp->afh_hosthash); ENDDEBUG } @@ -307,7 +307,7 @@ struct afhash *hp; /* RETURN: hash info here */ * The network portion of the iso address varies depending * on the type of address. The network portion of the * address will include the IDP. The network portion is: - * + * * TYPE DESC * t37 The AFI and x.121 (IDI) * osinet The AFI, orgid, snetid @@ -316,7 +316,7 @@ struct afhash *hp; /* RETURN: hash info here */ * * RETURNS: number of bytes placed into buf. * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Buf is assumed to be big enough */ @@ -350,7 +350,7 @@ caddr_t buf; /* RESULT: network portion of address here */ * Network portion of OSINET address can only be the IDI. Clearly, * with one x25 interface, one could get to several orgids, and * several snetids. - len += (ADDROSINET_IDI_LEN + OVLOSINET_ORGID_LEN + + len += (ADDROSINET_IDI_LEN + OVLOSINET_ORGID_LEN + OVLOSINET_SNETID_LEN); */ len += ADDROSINET_IDI_LEN; @@ -692,7 +692,7 @@ iso_ifwithidi(addr) &(((struct sockaddr_iso *)addr)->siso_addr)); ENDDEBUG - if (iso_eqtype(&(IFA_SIS(ifa)->siso_addr), + if (iso_eqtype(&(IFA_SIS(ifa)->siso_addr), &(((struct sockaddr_iso *)addr)->siso_addr))) { IFDEBUG(D_ROUTE) printf("ifa_ifwithidi: ifa found\n"); @@ -711,12 +711,12 @@ iso_ifwithidi(addr) /* * FUNCTION: iso_ck_addr * - * PURPOSE: return true if the iso_addr passed is + * PURPOSE: return true if the iso_addr passed is * within the legal size limit for an iso address. * * RETURNS: true or false * - * SIDE EFFECTS: + * SIDE EFFECTS: * */ iso_ck_addr(isoa) @@ -737,7 +737,7 @@ struct iso_addr *isoa; /* address to check */ * * RETURNS: true if the addresses are the same type * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: By type, I mean rfc986, t37, or osinet * @@ -751,7 +751,7 @@ struct iso_addr *isoab; /* other addr to check */ if (isoaa->isoa_afi == isoab->isoa_afi) { if (isoaa->isoa_afi == AFI_37) return(1); - else + else return (!bcmp(&isoaa->isoa_u, &isoab->isoa_u, 2)); } return(0); @@ -763,11 +763,11 @@ struct iso_addr *isoab; /* other addr to check */ * PURPOSE: Find an interface addresss having a given destination * or at least matching the net. * - * RETURNS: ptr to an interface address + * RETURNS: ptr to an interface address * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ struct iso_ifaddr * iso_localifa(siso) @@ -820,7 +820,7 @@ iso_localifa(siso) * * RETURNS: E* * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: This could embody some of the functions of * rclnp_ctloutput and cons_ctloutput. @@ -891,7 +891,7 @@ struct mbuf *m; /* data for set, buffer for get */ * * PURPOSE: debugging * - * RETURNS: nada + * RETURNS: nada * */ dump_isoaddr(s) @@ -907,7 +907,7 @@ dump_isoaddr(s) /* hack */ struct sockaddr_in *sin = (struct sockaddr_in *)s; - printf("%d.%d.%d.%d: %d", + printf("%d.%d.%d.%d: %d", (sin->sin_addr.s_addr>>24)&0xff, (sin->sin_addr.s_addr>>16)&0xff, (sin->sin_addr.s_addr>>8)&0xff, diff --git a/sys/netiso/iso.h b/sys/netiso/iso.h index 089d85e..1ac1f13 100644 --- a/sys/netiso/iso.h +++ b/sys/netiso/iso.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso.h 8.1 (Berkeley) 6/10/93 - * $Id: iso.h,v 1.2 1994/08/02 07:50:28 davidg Exp $ + * $Id: iso.h,v 1.3 1994/08/21 06:14:19 paul Exp $ */ #ifndef _NETISO_ISO_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,19 +63,19 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/iso.h,v 1.2 1994/08/02 07:50:28 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/iso.h,v 1.3 1994/08/21 06:14:19 paul Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/iso.h,v $ */ /* * Return true if this is a multicast address - * This assumes that the bit transmission is lsb first. This + * This assumes that the bit transmission is lsb first. This * assumption is valid for 802.3 but not 802.5. There is a * kludge to get around this for 802.5 -- see if_lan.c * where subnetwork header is setup. */ #define IS_MULTICAST(snpa)\ ((snpa)[0] & 0x01) - + /* * Protocols */ @@ -171,7 +171,7 @@ struct sockaddr_iso { #ifdef KERNEL extern int iso_netmatch(); -extern int iso_hash(); +extern int iso_hash(); extern int iso_addrmatch(); extern struct iso_ifaddr *iso_iaonnetof(); extern struct domain isodomain; @@ -194,4 +194,4 @@ __END_DECLS #define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m)) -#endif +#endif diff --git a/sys/netiso/iso_chksum.c b/sys/netiso/iso_chksum.c index c95a9b7..19a3b65 100644 --- a/sys/netiso/iso_chksum.c +++ b/sys/netiso/iso_chksum.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_chksum.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: iso_chksum.c,v 1.2 1994/08/02 07:50:31 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,8 +60,8 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* - * $Header: /home/ncvs/src/sys/netiso/iso_chksum.c,v 1.1.1.1 1994/05/24 10:07:12 rgrimes Exp $ +/* + * $Header: /home/ncvs/src/sys/netiso/iso_chksum.c,v 1.2 1994/08/02 07:50:31 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/iso_chksum.c,v $ * * ISO CHECKSUM @@ -73,7 +73,7 @@ SOFTWARE. * chains. * Furthermore, there is the possibility of wraparound in the running * sums after adding up 4102 octets. In order to avoid doing a mod - * operation after EACH add, we have restricted this implementation to + * operation after EACH add, we have restricted this implementation to * negotiating a maximum of 4096-octets per TPDU (for the transport layer). * The routine iso_check_csum doesn't need to know where the checksum * octets are. @@ -111,7 +111,7 @@ SOFTWARE. * a horrible thing to fiddle with anyway, it probably * isn't worth it. */ -int +int iso_check_csum(m, len) struct mbuf *m; int len; @@ -153,7 +153,7 @@ iso_check_csum(m, len) } if ( ((int)c0 % 255) || ((int)c1 % 255) ) { IFDEBUG(D_CHKSUM) - printf("BAD iso_check_csum l 0x%x cum 0x%x len 0x%x, i 0x%x", + printf("BAD iso_check_csum l 0x%x cum 0x%x len 0x%x, i 0x%x", l, cum, len, i); ENDDEBUG return ((int)c0 % 255)<<8 | ((int)c1 % 255); @@ -165,9 +165,9 @@ iso_check_csum(m, len) * FUNCTION: iso_gen_csum * * PURPOSE: To generate the checksum of the packet in the mbuf chain (m). - * The first of the 2 (logically) adjacent checksum bytes + * The first of the 2 (logically) adjacent checksum bytes * (x and y) go at offset (n). - * (n) is an offset relative to the beginning of the data, + * (n) is an offset relative to the beginning of the data, * not the beginning of the mbuf. * (l) is the length of the total mbuf chain's data. * Called from tp_emit(), tp_error_emit() @@ -235,7 +235,7 @@ iso_gen_csum(m,n,l) while(i < cum) { c0 = (c0 + *p); c1 += c0 ; - i++; + i++; p++; } m = m->m_next; @@ -265,13 +265,13 @@ iso_gen_csum(m,n,l) * * SIDE EFFECTS: none * - * NOTES: + * NOTES: */ int m_datalen (m) register struct mbuf *m; -{ +{ register int datalen; for (datalen = 0; m; m = m->m_next) @@ -301,7 +301,7 @@ m_compress(in, out) printf("m_compress returning -1: B\n"); ENDDEBUG splx(s); - return -1; + return -1; } (*out)->m_len = 0; (*out)->m_act = MNULL; @@ -310,7 +310,7 @@ m_compress(in, out) IFDEBUG(D_REQUEST) printf("m_compress in 0x%x *out 0x%x\n", in, *out); printf("m_compress in: len 0x%x, off 0x%x\n", in->m_len, in->m_data); - printf("m_compress *out: len 0x%x, off 0x%x\n", (*out)->m_len, + printf("m_compress *out: len 0x%x, off 0x%x\n", (*out)->m_len, (*out)->m_data); ENDDEBUG if (in->m_flags & M_EXT) { diff --git a/sys/netiso/iso_errno.h b/sys/netiso/iso_errno.h index 5c2c3c7..7f03492 100644 --- a/sys/netiso/iso_errno.h +++ b/sys/netiso/iso_errno.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_errno.h 8.1 (Berkeley) 6/10/93 - * $Id: iso_errno.h,v 1.3 1994/08/21 06:14:20 paul Exp $ + * $Id: iso_errno.h,v 1.4 1994/11/27 20:58:30 ats Exp $ */ #ifndef _NETISO_ISO_ERRNO_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -67,7 +67,7 @@ SOFTWARE. #define ISO_ERROR_MASK 0x8000 #define BSD_ERROR_MASK 0x0000 #define TP_ERROR_MASK 0x8800 /* transport layer */ -#define CONL_ERROR_MASK 0x8400 /* co network layer */ +#define CONL_ERROR_MASK 0x8400 /* co network layer */ #define CLNL_ERROR_MASK 0x8200 /* cl network layer */ #define TP_ERROR_SNDC 0x10000 /* kludge to force DC's on certain errors */ @@ -251,7 +251,7 @@ SOFTWARE. #define E_CO_RPOAOOO (CONL_ERROR_MASK | 0x115) /* RPOA out of order */ #define E_CO_NOREVCHG (CONL_ERROR_MASK | 0x119) /* Revs chg not accepted*/ #define E_CO_INCOMPAT (CONL_ERROR_MASK | 0x121) /* Incompatible dest */ -#define E_CO_NOFASTSEL (CONL_ERROR_MASK | 0x129) +#define E_CO_NOFASTSEL (CONL_ERROR_MASK | 0x129) /* Fast select accpt not subscribed */ #define E_CO_NOSHIP (CONL_ERROR_MASK | 0x139) /* ship absent */ #define E_CO_GWPROCERR (CONL_ERROR_MASK | 0x1c1) /* Gateway-detected err*/ @@ -272,4 +272,4 @@ SOFTWARE. #define CONL_ERROR_MAX 0x1c3 -#endif +#endif diff --git a/sys/netiso/iso_pcb.c b/sys/netiso/iso_pcb.c index ad91ff4..613f2c4 100644 --- a/sys/netiso/iso_pcb.c +++ b/sys/netiso/iso_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_pcb.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: iso_pcb.c,v 1.2 1994/08/02 07:50:37 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,7 +61,7 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/iso_pcb.c,v 1.1.1.1 1994/05/24 10:07:10 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/iso_pcb.c,v 1.2 1994/08/02 07:50:37 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/iso_pcb.c,v $ * * Iso address family net-layer(s) pcb stuff. NEH 1/29/87 @@ -102,7 +102,7 @@ struct iso_addr zeroiso_addr = { * FUNCTION: iso_pcballoc * * PURPOSE: creates an isopcb structure in an mbuf, - * with socket (so), and + * with socket (so), and * puts it in the queue with head (head) * * RETURNS: 0 if OK, ENOBUFS if can't alloc the necessary mbuf @@ -128,7 +128,7 @@ iso_pcballoc(so, head) so->so_pcb = (caddr_t)isop; return 0; } - + /* * FUNCTION: iso_pcbbind * @@ -144,7 +144,7 @@ iso_pcballoc(so, head) * * SIDE EFFECTS: increments head->isop_lport if it allocates a port # * - * NOTES: + * NOTES: */ #define satosiso(sa) ((struct sockaddr_iso *)(sa)) int @@ -200,12 +200,12 @@ iso_pcbbind(isop, nam) IFDEBUG(D_ISO) printf("iso_pcbbind: bind to NOT zeroisoaddr\n"); ENDDEBUG - for (ia = iso_ifaddr; ia; ia = ia->ia_next) + for (ia = iso_ifaddr; ia; ia = ia->ia_next) if (SAME_ISOADDR(siso, &ia->ia_addr)) break; if (ia == 0) return EADDRNOTAVAIL; - } + } if (siso->siso_len <= sizeof (isop->isop_sladdr)) { isop->isop_laddr = &isop->isop_sladdr; } else { @@ -250,14 +250,14 @@ noname: * FUNCTION: iso_pcbconnect * * PURPOSE: Make the isopcb (isop) look like it's connected. - * In other words, give it the peer address given in + * In other words, give it the peer address given in * the mbuf * (nam). Make sure such a combination * of local, peer addresses doesn't already exist * for this protocol. Internet mentality prevails here, * wherein a src,dst pair uniquely identifies a connection. - * Both net address and port must be specified in argument + * Both net address and port must be specified in argument * (nam). - * If we don't have a local address for this socket yet, + * If we don't have a local address for this socket yet, * we pick one by calling iso_pcbbind(). * * RETURNS: errno E* or 0 if ok. @@ -265,7 +265,7 @@ noname: * SIDE EFFECTS: Looks up a route, which may cause one to be left * in the isopcb. * - * NOTES: + * NOTES: */ int iso_pcbconnect(isop, nam) @@ -283,7 +283,7 @@ iso_pcbconnect(isop, nam) dump_isoaddr(siso); ENDDEBUG if (nam->m_len < siso->siso_len) - return EINVAL; + return EINVAL; if (siso->siso_family != AF_ISO) return EAFNOSUPPORT; if (siso->siso_nlen == 0) { @@ -302,7 +302,7 @@ iso_pcbconnect(isop, nam) * particular local interface. So, if we want to send somebody * we need to choose a return address. */ - local_zero = + local_zero = ((isop->isop_laddr == 0) || (isop->isop_laddr->siso_nlen == 0)); if (local_zero) { int flags; @@ -310,7 +310,7 @@ iso_pcbconnect(isop, nam) IFDEBUG(D_ISO) printf("iso_pcbconnect localzero 1\n"); ENDDEBUG - /* + /* * If route is known or can be allocated now, * our src addr is taken from the i/f, else punt. */ @@ -325,7 +325,7 @@ iso_pcbconnect(isop, nam) ENDDEBUG } IFDEBUG(D_ISO) - printf("in iso_pcbconnect before lookup isop 0x%x isop->sock 0x%x\n", + printf("in iso_pcbconnect before lookup isop 0x%x isop->sock 0x%x\n", isop, isop->isop_socket); ENDDEBUG if (local_zero) { @@ -361,7 +361,7 @@ iso_pcbconnect(isop, nam) siso = mtod(nam, struct sockaddr_iso *); } IFDEBUG(D_ISO) - printf("in iso_pcbconnect before bcopy isop 0x%x isop->sock 0x%x\n", + printf("in iso_pcbconnect before bcopy isop 0x%x isop->sock 0x%x\n", isop, isop->isop_socket); ENDDEBUG /* @@ -384,7 +384,7 @@ iso_pcbconnect(isop, nam) } bcopy((caddr_t)siso, (caddr_t)isop->isop_faddr, siso->siso_len); IFDEBUG(D_ISO) - printf("in iso_pcbconnect after bcopy isop 0x%x isop->sock 0x%x\n", + printf("in iso_pcbconnect after bcopy isop 0x%x isop->sock 0x%x\n", isop, isop->isop_socket); printf("iso_pcbconnect connected to addr:\n"); dump_isoaddr(isop->isop_faddr); @@ -406,7 +406,7 @@ iso_pcbconnect(isop, nam) * * SIDE EFFECTS: May detach the pcb. * - * NOTES: + * NOTES: */ void iso_pcbdisconnect(isop) @@ -442,9 +442,9 @@ iso_pcbdisconnect(isop) * * RETURNS: Nada. * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ void iso_pcbdetach(isop) @@ -453,7 +453,7 @@ iso_pcbdetach(isop) struct socket *so = isop->isop_socket; IFDEBUG(D_ISO) - printf("iso_pcbdetach(isop 0x%x socket 0x%x so 0x%x)\n", + printf("iso_pcbdetach(isop 0x%x socket 0x%x so 0x%x)\n", isop, isop->isop_socket, so); ENDDEBUG #ifdef TPCONS @@ -471,7 +471,7 @@ iso_pcbdetach(isop) #endif if (so) { /* in the x.25 domain, we sometimes have no socket */ so->so_pcb = 0; - sofree(so); + sofree(so); } IFDEBUG(D_ISO) printf("iso_pcbdetach 2 \n"); @@ -490,13 +490,13 @@ iso_pcbdetach(isop) struct clnp_cache *clcp = mtod(isop->isop_clnpcache, struct clnp_cache *); IFDEBUG(D_ISO) - printf("iso_pcbdetach 3.2: clcp 0x%x freeing clc_hdr x%x\n", + printf("iso_pcbdetach 3.2: clcp 0x%x freeing clc_hdr x%x\n", clcp, clcp->clc_hdr); ENDDEBUG if (clcp->clc_hdr != NULL) m_free(clcp->clc_hdr); IFDEBUG(D_ISO) - printf("iso_pcbdetach 3.3: freeing cache x%x\n", + printf("iso_pcbdetach 3.3: freeing cache x%x\n", isop->isop_clnpcache); ENDDEBUG m_free(isop->isop_clnpcache); @@ -523,7 +523,7 @@ iso_pcbdetach(isop) * * RETURNS: Rien. * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: (notify) is called at splimp! */ @@ -550,7 +550,7 @@ iso_pcbnotify(head, siso, errno, notify) ENDDEBUG continue; } - if (errno) + if (errno) isop->isop_socket->so_error = errno; if (notify) (*notify)(isop); @@ -572,9 +572,9 @@ iso_pcbnotify(head, siso, errno, notify) * RETURNS: ptr to the isopcb if it finds a connection matching * these arguments, o.w. returns zero. * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ struct isopcb * iso_pcblookup(head, fportlen, fport, laddr) @@ -588,7 +588,7 @@ iso_pcblookup(head, fportlen, fport, laddr) unsigned int llen = laddr->siso_tlen; IFDEBUG(D_ISO) - printf("iso_pcblookup(head 0x%x laddr 0x%x fport 0x%x)\n", + printf("iso_pcblookup(head 0x%x laddr 0x%x fport 0x%x)\n", head, laddr, fport); ENDDEBUG for (isop = head->isop_next; isop != head; isop = isop->isop_next) { diff --git a/sys/netiso/iso_pcb.h b/sys/netiso/iso_pcb.h index 1431363..80fc29a 100644 --- a/sys/netiso/iso_pcb.h +++ b/sys/netiso/iso_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: iso_pcb.h,v 1.2 1994/08/02 07:50:40 davidg Exp $ + * $Id: iso_pcb.h,v 1.3 1994/08/21 06:14:20 paul Exp $ */ #ifndef _NETISO_ISO_PCB_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,7 +63,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/iso_pcb.h,v 1.2 1994/08/02 07:50:40 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/iso_pcb.h,v 1.3 1994/08/21 06:14:20 paul Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/iso_pcb.h,v $ */ #define MAXX25CRUDLEN 16 /* 16 bytes of call request user data */ @@ -73,7 +73,7 @@ SOFTWARE. */ struct isopcb { struct isopcb *isop_next,*isop_prev; /* pointers to other pcb's */ - struct isopcb *isop_head; /* pointer back to chain of pcbs for + struct isopcb *isop_head; /* pointer back to chain of pcbs for this protocol */ struct socket *isop_socket; /* back pointer to socket */ struct sockaddr_iso *isop_laddr; diff --git a/sys/netiso/iso_proto.c b/sys/netiso/iso_proto.c index 17afcc0..86d6cf2 100644 --- a/sys/netiso/iso_proto.c +++ b/sys/netiso/iso_proto.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: iso_proto.c,v 1.2 1994/08/02 07:50:42 davidg Exp $ + * $Id: iso_proto.c,v 1.3 1995/05/11 00:13:20 wollman Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,8 +60,8 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/iso_proto.c,v 1.2 1994/08/02 07:50:42 davidg Exp $ - * $Source: /home/ncvs/src/sys/netiso/iso_proto.c,v $ +/* $Header: /home/ncvs/src/sys/netiso/iso_proto.c,v 1.3 1995/05/11 00:13:20 wollman Exp $ + * $Source: /home/ncvs/src/sys/netiso/iso_proto.c,v $ * * iso_proto.c : protocol switch tables in the ISO domain * @@ -95,8 +95,8 @@ int idrp_input(), idrp_init(), idrp_usrreq(); int cltp_input(), cltp_ctlinput(), cltp_init(), cltp_usrreq(), cltp_output(); #ifdef TUBA -int tuba_usrreq(), tuba_ctloutput(), tuba_init(), tuba_tcpinput(); -int tuba_slowtimo(), tuba_fasttimo(); +int tuba_usrreq(), tuba_ctloutput(), tuba_init(), tuba_tcpinput(); +int tuba_slowtimo(), tuba_fasttimo(); #endif struct protosw isosw[] = { diff --git a/sys/netiso/iso_snpac.c b/sys/netiso/iso_snpac.c index fd9b529..3650231 100644 --- a/sys/netiso/iso_snpac.c +++ b/sys/netiso/iso_snpac.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_snpac.c 8.1 (Berkeley) 6/10/93 - * $Id: iso_snpac.c,v 1.2 1994/08/02 07:50:44 davidg Exp $ + * $Id: iso_snpac.c,v 1.3 1994/12/13 22:33:05 wollman Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,7 +60,7 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/iso_snpac.c,v 1.2 1994/08/02 07:50:44 davidg Exp $ */ +/* $Header: /home/ncvs/src/sys/netiso/iso_snpac.c,v 1.3 1994/12/13 22:33:05 wollman Exp $ */ /* $Source: /home/ncvs/src/sys/netiso/iso_snpac.c,v $ */ #ifdef ISO @@ -269,7 +269,7 @@ iso_setmcasts(ifp, req) * RETURNS: 0 if addr is resolved * errno if addr is unknown * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: Now that we have folded the snpa cache into the routing * table, we know there is no snpa address known for this @@ -294,7 +294,7 @@ int *snpa_len; /* RESULT: length of snpa */ /* * This hack allows us to send esis packets that have the destination snpa - * addresss embedded in the destination nsap address + * addresss embedded in the destination nsap address */ if (dest->siso_data[0] == AFI_SNA) { /* @@ -305,7 +305,7 @@ int *snpa_len; /* RESULT: length of snpa */ ENDDEBUG addrlen = dest->siso_nlen - 1; /* subtract size of AFI */ found_snpa = (caddr_t) dest->siso_data + 1; - /* + /* * If we are an IS, we can't do much with the packet; * Check if we know about an IS. */ @@ -317,7 +317,7 @@ int *snpa_len; /* RESULT: length of snpa */ found_snpa = LLADDR(sdl); addrlen = sdl->sdl_alen; } else if (ifp->if_flags & IFF_BROADCAST) { - /* + /* * no IS, no match. Return "all es" multicast address for this * interface, as per Query Configuration Function (9542 sec 6.5) * @@ -342,7 +342,7 @@ int *snpa_len; /* RESULT: length of snpa */ * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: If there is a route entry associated with cache * entry, then delete that as well @@ -369,9 +369,9 @@ register struct llinfo_llc *lc; /* entry to free */ * * PURPOSE: Add an entry to the snpa cache * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: If entry already exists, then update holding time. */ @@ -481,9 +481,9 @@ snpac_fixdstandmask(nsellength) * * RETURNS: 0 on success, or unix error code * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ snpac_ioctl (so, cmd, data) struct socket *so; @@ -537,9 +537,9 @@ caddr_t data; /* data for the cmd */ * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ snpac_logdefis(sc) register struct rtentry *sc; @@ -560,7 +560,7 @@ register struct rtentry *sc; rtrequest(RTM_ADD, S(zsi), rt_key(sc), S(zmk), RTF_DYNAMIC|RTF_GATEWAY, 0); else { - if ((rt->rt_flags & RTF_DYNAMIC) && + if ((rt->rt_flags & RTF_DYNAMIC) && (rt->rt_flags & RTF_GATEWAY) && rt_mask(rt)->sa_len == 0) rt_setgate(rt, rt_key(rt), rt_key(sc)); } @@ -571,9 +571,9 @@ register struct rtentry *sc; * * PURPOSE: Time out snpac entries * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: When encountering an entry for the first time, snpac_age * may delete up to SNPAC_AGE too many seconds. Ie. @@ -613,9 +613,9 @@ snpac_age() * * RETURNS: true or false * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: Used by interface drivers when not in eavesdrop mode + * NOTES: Used by interface drivers when not in eavesdrop mode * as interm kludge until * real multicast addresses can be configured */ @@ -636,9 +636,9 @@ u_int len; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ snpac_flushifp(ifp) struct ifnet *ifp; @@ -658,7 +658,7 @@ struct ifnet *ifp; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: In the future, this should make a request of a user * level routing daemon. @@ -679,7 +679,7 @@ struct rtentry **ret_nrt; printf("add"); else if (req == RTM_DELETE) printf("delete"); - else + else printf("unknown command"); printf(" dst: %s\n", clnp_iso_addrp(host)); printf("\tgateway: %s\n", clnp_iso_addrp(gateway)); @@ -705,7 +705,7 @@ struct rtentry **ret_nrt; * * RETURNS: nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: If a cache entry exists for gateway, then * make a routing entry (host, gateway) and associate @@ -714,7 +714,7 @@ struct rtentry **ret_nrt; * If a route already exists and is different, first delete * it. * - * This could be made more efficient by checking + * This could be made more efficient by checking * the existing route before adding a new one. */ snpac_addrt(ifp, host, gateway, netmask) diff --git a/sys/netiso/iso_snpac.h b/sys/netiso/iso_snpac.h index 429ac37..e817b81 100644 --- a/sys/netiso/iso_snpac.h +++ b/sys/netiso/iso_snpac.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_snpac.h 8.1 (Berkeley) 6/10/93 - * $Id: iso_snpac.h,v 1.3 1994/08/21 06:14:21 paul Exp $ + * $Id: iso_snpac.h,v 1.4 1995/03/28 07:57:14 bde Exp $ */ #ifndef _NETISO_ISO_SNPAC_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -69,7 +69,7 @@ SOFTWARE. struct snpa_req { struct iso_addr sr_isoa; /* nsap address */ u_char sr_len; /* length of snpa */ - u_char sr_snpa[MAX_SNPALEN]; /* snpa associated + u_char sr_snpa[MAX_SNPALEN]; /* snpa associated with nsap address */ u_char sr_flags; /* true if entry is valid */ u_short sr_ht; /* holding time */ diff --git a/sys/netiso/iso_var.h b/sys/netiso/iso_var.h index bee5422..b874995 100644 --- a/sys/netiso/iso_var.h +++ b/sys/netiso/iso_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)iso_var.h 8.1 (Berkeley) 6/10/93 - * $Id: iso_var.h,v 1.3 1994/08/21 06:14:22 paul Exp $ + * $Id: iso_var.h,v 1.4 1995/03/16 18:15:21 bde Exp $ */ #ifndef _NETISO_ISO_VAR_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,12 +63,12 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* $Header: /home/ncvs/src/sys/netiso/iso_var.h,v 1.3 1994/08/21 06:14:22 paul Exp $ +/* $Header: /home/ncvs/src/sys/netiso/iso_var.h,v 1.4 1995/03/16 18:15:21 bde Exp $ * $Source: /home/ncvs/src/sys/netiso/iso_var.h,v $ */ /* - * Interface address, iso version. One of these structures is + * Interface address, iso version. One of these structures is * allocated for each interface with an osi address. The ifaddr * structure conatins the protocol-independent part * of the structure, and is assumed to be first. diff --git a/sys/netiso/tp_clnp.h b/sys/netiso/tp_clnp.h index 528e3f0..7e54a67 100644 --- a/sys/netiso/tp_clnp.h +++ b/sys/netiso/tp_clnp.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_clnp.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_clnp.h,v 1.2 1994/08/02 07:50:54 davidg Exp $ + * $Id: tp_clnp.h,v 1.3 1994/08/21 06:14:23 paul Exp $ */ #ifndef _NETISO_TP_CLNP_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_clnp.h,v 1.2 1994/08/02 07:50:54 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_clnp.h,v 1.3 1994/08/21 06:14:23 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_clnp.h,v $ * * AF_ISO net-dependent structures and include files @@ -88,7 +88,7 @@ SOFTWARE. #endif #include <netiso/iso_var.h> -struct isopcb tp_isopcb; +struct isopcb tp_isopcb; /* queue of active inpcbs for tp ; for tp with dod ip */ -#endif +#endif diff --git a/sys/netiso/tp_cons.c b/sys/netiso/tp_cons.c index 76e5775..ca2dc32 100644 --- a/sys/netiso/tp_cons.c +++ b/sys/netiso/tp_cons.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_cons.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_cons.c,v 1.2 1994/08/02 07:50:56 davidg Exp $ + * $Id: tp_cons.c,v 1.3 1994/11/15 14:26:15 bde Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,16 +60,16 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP - * $Header: /home/ncvs/src/sys/netiso/tp_cons.c,v 1.2 1994/08/02 07:50:56 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_cons.c,v 1.3 1994/11/15 14:26:15 bde Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_cons.c,v $ * * Here is where you find the iso- and cons-dependent code. We've tried * keep all net-level and (primarily) address-family-dependent stuff * out of the tp source, and everthing here is reached indirectly - * through a switch table (struct nl_protosw *) tpcb->tp_nlproto - * (see tp_pcb.c). + * through a switch table (struct nl_protosw *) tpcb->tp_nlproto + * (see tp_pcb.c). * The routines here are: * tpcons_input: pullup and call tp_input w/ correct arguments * tpcons_output: package a pkt for cons given an isopcb & some data @@ -136,7 +136,7 @@ register struct mbuf *nam; /* oh, dear, throw packet away */ pk_disconnect((struct pklcd *)isop->isop_chan); isop->isop_chan = 0; - } else + } else isop->isop_refcnt = 1; return error; } @@ -150,7 +150,7 @@ register struct mbuf *nam; */ ProtoHook tpcons_ctlinput(cmd, siso, isop) - int cmd; + int cmd; struct sockaddr_iso *siso; struct isopcb *isop; { @@ -173,7 +173,7 @@ tpcons_ctlinput(cmd, siso, isop) register SeqNum seq = SEQ_ADD(tpcb, tpcb->tp_snduna, 1); IFTRACE(D_DATA) - tptrace(TPPTmisc, "FAKE ACK seq cdt 1", + tptrace(TPPTmisc, "FAKE ACK seq cdt 1", seq, 0,0,0); ENDTRACE IFDEBUG(D_DATA) @@ -207,8 +207,8 @@ tpcons_ctlinput(cmd, siso, isop) * cons's intr routine * FUNCTION and ARGUMENTS: * Take a packet (m) from cons, pullup m as required by tp, - * ignore the socket argument, and call tp_input. - * No return value. + * ignore the socket argument, and call tp_input. + * No return value. */ ProtoHook tpcons_input(m, faddr, laddr, channel) diff --git a/sys/netiso/tp_driver.c b/sys/netiso/tp_driver.c index ead2c89..5c42447 100644 --- a/sys/netiso/tp_driver.c +++ b/sys/netiso/tp_driver.c @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: tp_driver.c,v 1.2 1994/08/02 07:50:59 davidg Exp $ */ #define _XEBEC_PG static @@ -42,9 +42,9 @@ int tp_emit(), tp_goodack(), tp_goodXack(), tp_stash() ; -void tp_indicate(), tp_getoptions(), +void tp_indicate(), tp_getoptions(), tp_soisdisconnecting(), tp_soisdisconnected(), - tp_recycle_tsuffix(), + tp_recycle_tsuffix(), #ifdef TP_DEBUG_TIMERS tp_etimeout(), tp_euntimeout(), tp_ctimeout(), tp_cuntimeout(), @@ -70,12 +70,12 @@ tp_PCB_ *p; { switch(a) { case -1: return tp_protocol_error(e,p); -case 0x1: +case 0x1: { (void) tp_emit(DC_TPDU_type, p, 0, 0, MNULL); } break; -case 0x2: +case 0x2: { # ifdef TP_DEBUG if( e->ev_number != AK_TPDU ) @@ -83,7 +83,7 @@ case 0x2: # endif TP_DEBUG } break; -case 0x3: +case 0x3: { /* oh, man is this grotesque or what? */ (void) tp_goodack(p, e->ev_union.EV_AK_TPDU.e_cdt, e->ev_union.EV_AK_TPDU.e_seq, e->ev_union.EV_AK_TPDU.e_subseq); @@ -93,17 +93,17 @@ case 0x3: */ } break; -case 0x4: +case 0x4: { tp_detach(p); } break; -case 0x5: +case 0x5: { p->tp_refstate = REF_OPEN; /* has timers ??? */ } break; -case 0x6: +case 0x6: { IFTRACE(D_CONN) tptrace(TPPTmisc, "CR datalen data", e->ev_union.EV_CR_TPDU.e_datalen, e->ev_union.EV_CR_TPDU.e_data,0,0); @@ -116,13 +116,13 @@ case 0x6: if (e->ev_union.EV_CR_TPDU.e_datalen > 0) { /* n/a for class 0 */ - ASSERT(p->tp_Xrcv.sb_cc == 0); + ASSERT(p->tp_Xrcv.sb_cc == 0); sbappendrecord(&p->tp_Xrcv, e->ev_union.EV_CR_TPDU.e_data); - e->ev_union.EV_CR_TPDU.e_data = MNULL; - } + e->ev_union.EV_CR_TPDU.e_data = MNULL; + } } break; -case 0x7: +case 0x7: { IncStat(ts_tp0_conn); IFTRACE(D_CONN) @@ -136,7 +136,7 @@ case 0x7: p->tp_fcredit = 1; } break; -case 0x8: +case 0x8: { IncStat(ts_tp4_conn); /* even though not quite open */ IFTRACE(D_CONN) @@ -153,7 +153,7 @@ case 0x8: tp_ctimeout(p, TM_retrans, (int)p->tp_cc_ticks); } break; -case 0x9: +case 0x9: { IFDEBUG(D_CONN) printf("event: CR_TPDU emit CC failed done " ); @@ -164,7 +164,7 @@ case 0x9: tp_detach(p); } break; -case 0xa: +case 0xa: { int error; struct mbuf *data = MNULL; @@ -176,7 +176,7 @@ case 0xa: data = MCPY(p->tp_ucddata, M_WAIT); if (data) { IFDEBUG(D_CONN) - printf("T_CONN_req.trans m_copy cc 0x%x\n", + printf("T_CONN_req.trans m_copy cc 0x%x\n", p->tp_ucddata); dump_mbuf(data, "sosnd @ T_CONN_req"); ENDDEBUG @@ -184,7 +184,7 @@ case 0xa: if (error = tp_emit(CR_TPDU_type, p, 0, 0, data) ) return error; /* driver WON'T change state; will return error */ - + p->tp_refstate = REF_OPEN; /* has timers */ if(p->tp_class != TP_CLASS_0) { p->tp_retrans = p->tp_Nretrans; @@ -192,13 +192,13 @@ case 0xa: } } break; -case 0xb: +case 0xb: { sbflush(&p->tp_Xrcv); /* purge non-delivered data data */ if (e->ev_union.EV_DR_TPDU.e_datalen > 0) { sbappendrecord(&p->tp_Xrcv, e->ev_union.EV_DR_TPDU.e_data); e->ev_union.EV_DR_TPDU.e_data = MNULL; - } + } if (p->tp_state == TP_OPEN) tp_indicate(T_DISCONNECT, p, 0); else { @@ -219,53 +219,53 @@ case 0xb: p->tp_flags &= ~TPF_DELACK; } tp_cuntimeout(p, TM_retrans); - if( e->ev_union.EV_DR_TPDU.e_sref != 0 ) + if( e->ev_union.EV_DR_TPDU.e_sref != 0 ) (void) tp_emit(DC_TPDU_type, p, 0, 0, MNULL); } } break; -case 0xc: +case 0xc: { if( e->ev_union.EV_DR_TPDU.e_sref != 0 ) - (void) tp_emit(DC_TPDU_type, p, 0, 0, MNULL); + (void) tp_emit(DC_TPDU_type, p, 0, 0, MNULL); /* reference timer already set - reset it to be safe (???) */ tp_euntimeout(p, TM_reference); /* all */ tp_etimeout(p, TM_reference, (int)p->tp_refer_ticks); } break; -case 0xd: - { +case 0xd: + { tp_cuntimeout(p, TM_retrans); tp_indicate(ER_TPDU, p, e->ev_union.EV_ER_TPDU.e_reason); tp_soisdisconnected(p); } break; -case 0xe: - { +case 0xe: + { tp_cuntimeout(p, TM_retrans); tp_soisdisconnected(p); } break; -case 0xf: - { +case 0xf: + { tp_indicate(ER_TPDU, p, e->ev_union.EV_ER_TPDU.e_reason); tp_cuntimeout(p, TM_retrans); tp_soisdisconnected(p); } break; -case 0x10: - { +case 0x10: + { tp_cuntimeout(p, TM_retrans); tp_soisdisconnected(p); } break; -case 0x11: +case 0x11: { /* don't ask me why we have to do this - spec says so */ (void) tp_emit(DR_TPDU_type, p, 0, E_TP_NO_SESSION, MNULL); /* don't bother with retransmissions of the DR */ } break; -case 0x12: +case 0x12: { tp_soisdisconnecting(p->tp_sock); tp_indicate(ER_TPDU, p, e->ev_union.EV_ER_TPDU.e_reason); @@ -273,7 +273,7 @@ case 0x12: tp_netcmd( p, CONN_CLOSE ); } break; -case 0x13: +case 0x13: { if (p->tp_state == TP_OPEN) { tp_euntimeout(p, TM_data_retrans); /* all */ @@ -287,18 +287,18 @@ case 0x13: (void) tp_emit(DR_TPDU_type, p, 0, E_TP_PROTO_ERR, MNULL); } break; -case 0x14: - { +case 0x14: + { tp_cuntimeout(p, TM_retrans); IncStat(ts_tp0_conn); p->tp_fcredit = 1; soisconnected(p->tp_sock); } break; -case 0x15: - { +case 0x15: + { IFDEBUG(D_CONN) - printf("trans: CC_TPDU in CRSENT state flags 0x%x\n", + printf("trans: CC_TPDU in CRSENT state flags 0x%x\n", (int)p->tp_flags); ENDDEBUG IncStat(ts_tp4_conn); @@ -327,7 +327,7 @@ case 0x15: tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); } break; -case 0x16: +case 0x16: { struct mbuf *data = MNULL; int error; @@ -351,16 +351,16 @@ case 0x16: tp_ctimeout(p, TM_retrans, (int)p->tp_cr_ticks); } break; -case 0x17: - { +case 0x17: + { IncStat(ts_conn_gaveup); p->tp_sock->so_error = ETIMEDOUT; tp_indicate(T_DISCONNECT, p, ETIMEDOUT); tp_soisdisconnected(p); } break; -case 0x18: - { +case 0x18: + { int error; struct mbuf *data = MCPY(p->tp_ucddata, M_WAIT); @@ -371,7 +371,7 @@ case 0x18: tp_ctimeout(p, TM_retrans, (int)p->tp_cc_ticks); } break; -case 0x19: +case 0x19: { int doack; @@ -396,17 +396,17 @@ case 0x19: ENDDEBUG if (doack) { - (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); + (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); tp_ctimeout(p, TM_sendack, (int)p->tp_keepalive_ticks); } else tp_ctimeout( p, TM_sendack, (int)p->tp_sendack_ticks); - + IFDEBUG(D_DATA) printf("after stash calling sbwakeup\n"); ENDDEBUG } break; -case 0x1a: +case 0x1a: { tp0_stash(p, e); sbwakeup( &p->tp_sock->so_rcv ); @@ -416,7 +416,7 @@ case 0x1a: ENDDEBUG } break; -case 0x1b: +case 0x1b: { int doack; /* tells if we must ack immediately */ @@ -429,17 +429,17 @@ case 0x1b: ENDDEBUG if(doack) - (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); + (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); else tp_ctimeout_MIN( p, TM_sendack, (int)p->tp_sendack_ticks); - + IFDEBUG(D_DATA) printf("after stash calling sbwakeup\n"); ENDDEBUG } break; -case 0x1c: - { +case 0x1c: + { IFTRACE(D_DATA) tptrace(TPPTmisc, "NIW seq rcvnxt lcredit ", e->ev_union.EV_DT_TPDU.e_seq, p->tp_rcvnxt, p->tp_lcredit, 0); @@ -447,10 +447,10 @@ case 0x1c: IncStat(ts_dt_niw); m_freem(e->ev_union.EV_DT_TPDU.e_data); tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); - (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); + (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL ); } break; -case 0x1d: +case 0x1d: { if (p->tp_ucddata) { m_freem(p->tp_ucddata); @@ -462,10 +462,10 @@ case 0x1d: soisconnected(p->tp_sock); IFTRACE(D_CONN) struct socket *so = p->tp_sock; - tptrace(TPPTmisc, + tptrace(TPPTmisc, "called sosiconn: so so_state rcv.sb_sel rcv.sb_flags", so, so->so_state, so->so_rcv.sb_sel, so->so_rcv.sb_flags); - tptrace(TPPTmisc, + tptrace(TPPTmisc, "called sosiconn 2: so_qlen so_error so_rcv.sb_cc so_head", so->so_qlen, so->so_error, so->so_rcv.sb_cc, so->so_head); ENDTRACE @@ -474,7 +474,7 @@ case 0x1d: tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); } break; -case 0x1e: +case 0x1e: { if( p->tp_state == TP_AKWAIT ) { if (p->tp_ucddata) { @@ -485,7 +485,7 @@ case 0x1e: soisconnected(p->tp_sock); tp_ctimeout(p, TM_sendack, (int)p->tp_keepalive_ticks); tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); - } + } IFTRACE(D_XPD) tptrace(TPPTmisc, "XPD tpdu accepted Xrcvnxt, e_seq datalen m_len\n", p->tp_Xrcvnxt,e->ev_union.EV_XPD_TPDU.e_seq, e->ev_union.EV_XPD_TPDU.e_datalen, e->ev_union.EV_XPD_TPDU.e_data->m_len); @@ -504,15 +504,15 @@ case 0x1e: SEQ_INC(p, p->tp_Xrcvnxt); } break; -case 0x1f: +case 0x1f: { if( p->tp_Xrcv.sb_cc == 0 ) { - /* kludge for select(): */ + /* kludge for select(): */ /* p->tp_sock->so_state &= ~SS_OOBAVAIL; */ } } break; -case 0x20: +case 0x20: { IFTRACE(D_XPD) tptrace(TPPTmisc, "XPD tpdu niw (Xrcvnxt, e_seq) or not cdt (cc)\n", @@ -532,7 +532,7 @@ case 0x20: */ } break; -case 0x21: +case 0x21: { struct socket *so = p->tp_sock; @@ -547,7 +547,7 @@ case 0x21: tp_soisdisconnected(p); } break; -case 0x22: +case 0x22: { struct socket *so = p->tp_sock; struct mbuf *data = MNULL; @@ -567,14 +567,14 @@ case 0x22: } } break; -case 0x23: +case 0x23: { tp_soisdisconnecting(p->tp_sock); tp_netcmd( p, CONN_CLOSE); tp_soisdisconnected(p); } break; -case 0x24: +case 0x24: { struct mbuf *data = MCPY(p->tp_ucddata, M_WAIT); @@ -586,7 +586,7 @@ case 0x24: } if (data) { IFDEBUG(D_CONN) - printf("T_DISC_req.trans tp_ucddata 0x%x\n", + printf("T_DISC_req.trans tp_ucddata 0x%x\n", p->tp_ucddata); dump_mbuf(data, "ucddata @ T_DISC_req"); ENDDEBUG @@ -599,7 +599,7 @@ case 0x24: return tp_emit(DR_TPDU_type, p, 0, e->ev_union.EV_T_DISC_req.e_reason, data); } break; -case 0x25: +case 0x25: { int error; struct mbuf *data = MCPY(p->tp_ucddata, M_WAIT); @@ -608,12 +608,12 @@ case 0x25: p->tp_retrans --; p->tp_cong_win = 1 * p->tp_l_tpdusize; - if( error = tp_emit(CC_TPDU_type, p, 0, 0, data) ) + if( error = tp_emit(CC_TPDU_type, p, 0, 0, data) ) p->tp_sock->so_error = error; tp_ctimeout(p, TM_retrans, (int)p->tp_cc_ticks); } break; -case 0x26: +case 0x26: { IncStat(ts_conn_gaveup); tp_soisdisconnecting(p->tp_sock); @@ -624,10 +624,10 @@ case 0x26: tp_ctimeout(p, TM_retrans, (int)p->tp_dr_ticks); } break; -case 0x27: +case 0x27: { tp_euntimeout(p, TM_data_retrans); /* all */ - tp_cuntimeout(p, TM_inact); + tp_cuntimeout(p, TM_inact); tp_cuntimeout(p, TM_sendack); IncStat(ts_conn_gaveup); @@ -639,7 +639,7 @@ case 0x27: tp_ctimeout(p, TM_retrans, (int)p->tp_dr_ticks); } break; -case 0x28: +case 0x28: { p->tp_cong_win = 1 * p->tp_l_tpdusize; /* resume XPD */ @@ -649,8 +649,8 @@ case 0x28: IFTRACE(D_XPD) tptrace(TPPTmisc, "XPD retrans: Xuna Xsndnxt sndnxt snduna", - p->tp_Xuna, p->tp_Xsndnxt, p->tp_sndnxt, - p->tp_snduna); + p->tp_Xuna, p->tp_Xsndnxt, p->tp_sndnxt, + p->tp_snduna); ENDTRACE IFDEBUG(D_XPD) dump_mbuf(m, "XPD retrans emitting M"); @@ -663,45 +663,45 @@ case 0x28: } } break; -case 0x29: - { +case 0x29: + { p->tp_rxtshift++; (void) tp_data_retrans(p); } break; -case 0x2a: - { +case 0x2a: + { p->tp_retrans --; (void) tp_emit(DR_TPDU_type, p, 0, E_TP_DR_NO_REAS, MNULL); IncStat(ts_retrans_dr); tp_ctimeout(p, TM_retrans, (int)p->tp_dr_ticks); } break; -case 0x2b: - { +case 0x2b: + { p->tp_sock->so_error = ETIMEDOUT; p->tp_refstate = REF_FROZEN; tp_recycle_tsuffix( p ); tp_etimeout(p, TM_reference, (int)p->tp_refer_ticks); } break; -case 0x2c: +case 0x2c: { tp_freeref(p->tp_lref); tp_detach(p); } break; -case 0x2d: - { +case 0x2d: + { if( p->tp_class != TP_CLASS_0) { tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); if ( e->ev_number == CC_TPDU ) - (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL); + (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 0, MNULL); } /* ignore it if class 0 - state tables are blank for this */ } break; -case 0x2e: +case 0x2e: { IFTRACE(D_DATA) tptrace(TPPTmisc, "T_DATA_req sndnxt snduna fcredit, tpcb", @@ -711,7 +711,7 @@ case 0x2e: tp_send(p); } break; -case 0x2f: +case 0x2f: { int error = 0; @@ -724,25 +724,25 @@ case 0x2f: IFTRACE(D_XPD) tptrace(TPPTmisc, "XPD req: Xuna Xsndnxt sndnxt snduna", - p->tp_Xuna, p->tp_Xsndnxt, p->tp_sndnxt, - p->tp_snduna); + p->tp_Xuna, p->tp_Xsndnxt, p->tp_sndnxt, + p->tp_snduna); ENDTRACE IFDEBUG(D_XPD) printf("T_XPD_req: sb_cc 0x%x\n", p->tp_Xsnd.sb_cc); dump_mbuf(m, "XPD req emitting M"); ENDDEBUG - error = + error = tp_emit(XPD_TPDU_type, p, p->tp_Xuna, 1, m); p->tp_retrans = p->tp_Nretrans; tp_ctimeout(p, TM_retrans, (int)p->tp_rxtcur); SEQ_INC(p, p->tp_Xsndnxt); - } + } if(trick_hc) return error; } break; -case 0x30: +case 0x30: { struct sockbuf *sb = &p->tp_sock->so_snd; @@ -758,10 +758,10 @@ case 0x30: ENDDEBUG } break; -case 0x31: +case 0x31: { IFTRACE(D_ACKRECV) - tptrace(TPPTmisc, "BOGUS ACK fcc_present, tp_r_subseq e_subseq", + tptrace(TPPTmisc, "BOGUS ACK fcc_present, tp_r_subseq e_subseq", e->ev_union.EV_AK_TPDU.e_fcc_present, p->tp_r_subseq, e->ev_union.EV_AK_TPDU.e_subseq, 0); ENDTRACE if( p->tp_class != TP_CLASS_0 ) { @@ -772,11 +772,11 @@ case 0x31: (void) tp_emit(AK_TPDU_type, p, p->tp_rcvnxt, 1, MNULL); } tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); - } + } } break; -case 0x32: - { +case 0x32: + { tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); tp_cuntimeout(p, TM_retrans); @@ -786,21 +786,21 @@ case 0x32: tp_send(p); } break; -case 0x33: +case 0x33: { IFTRACE(D_ACKRECV) tptrace(TPPTmisc, "BOGUS XACK eventtype ", e->ev_number, 0, 0,0); ENDTRACE if( p->tp_class != TP_CLASS_0 ) { tp_ctimeout(p, TM_inact, (int)p->tp_inact_ticks); - } + } } break; -case 0x34: - { +case 0x34: + { int timo; IFTRACE(D_TIMER) - tptrace(TPPTsendack, -1, p->tp_lcredit, p->tp_sent_uwe, + tptrace(TPPTsendack, -1, p->tp_lcredit, p->tp_sent_uwe, p->tp_sent_lcdt, 0); ENDTRACE IncPStat(p, tps_n_TMsendack); @@ -814,14 +814,14 @@ case 0x34: tp_ctimeout(p, TM_sendack, timo); } break; -case 0x35: +case 0x35: { if (sbspace(&p->tp_sock->so_rcv) > 0) tp0_openflow(p); } break; -case 0x36: - { +case 0x36: + { if( trick_hc ) { SeqNum ack_thresh; /* @@ -842,13 +842,13 @@ case 0x36: } } break; -case 0x37: +case 0x37: { if(trick_hc) return ECONNABORTED; } break; -case 0x38: +case 0x38: { ASSERT( p->tp_state != TP_LISTENING ); tp_indicate(T_DISCONNECT, p, ECONNRESET); diff --git a/sys/netiso/tp_emit.c b/sys/netiso/tp_emit.c index 0c9a831..d26cea0 100644 --- a/sys/netiso/tp_emit.c +++ b/sys/netiso/tp_emit.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_emit.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tp_emit.c,v 1.2 1994/08/02 07:51:02 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_emit.c,v 1.1.1.1 1994/05/24 10:06:56 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_emit.c,v 1.2 1994/08/02 07:51:02 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_emit.c,v $ * * This file contains tp_emit() and tp_error_emit(), which @@ -133,19 +133,19 @@ char tp_delay = 0x00; /* delay to keep token ring from blowing it */ * For DR and ER tpdus, the argument (eot) is * the reason for issuing the tpdu rather than an end-of-tsdu indicator. * - * RETURNS: + * RETURNS: * 0 OK - * ENOBUFS - * E* returned from net layer output rtn + * ENOBUFS + * E* returned from net layer output rtn + * + * SIDE EFFECTS: * - * SIDE EFFECTS: + * NOTES: * - * NOTES: - * - * WE ASSUME that the tp header + all options will fit in ONE mbuf. + * WE ASSUME that the tp header + all options will fit in ONE mbuf. * If mbufs are 256 this will most likely be true, but if they are 128 it's - * possible that they won't. - * If you used every option on the CR + max. user data you'd overrun + * possible that they won't. + * If you used every option on the CR + max. user data you'd overrun * 112 but unless you used > 115 bytes for the security * parameter, it would fit in a 256-byte mbuf (240 bytes for the header) * We don't support the security parameter, so this isn't a problem. @@ -171,7 +171,7 @@ tp_emit(dutype, tpcb, seq, eot, data) u_int eot; struct mbuf *data; { - register struct tpdu *hdr; + register struct tpdu *hdr; register struct mbuf *m; int csum_offset=0; int datalen = 0; @@ -202,7 +202,7 @@ tp_emit(dutype, tpcb, seq, eot, data) m->m_flags = M_PKTHDR; } } else { - MGETHDR(m, M_DONTWAIT, TPMT_TPHDR); + MGETHDR(m, M_DONTWAIT, TPMT_TPHDR); } m->m_data += max_hdr; if (m == NULL) { @@ -221,13 +221,13 @@ tp_emit(dutype, tpcb, seq, eot, data) int tp_headersize(); hdr->tpdu_type = dutype; - hdr->tpdu_li = tp_headersize(dutype, tpcb); + hdr->tpdu_li = tp_headersize(dutype, tpcb); /* * class 0 doesn't use this for DT - * it'll just get overwritten below + * it'll just get overwritten below */ - hdr->tpdu_dref = htons(tpcb->tp_fref); - if( tpcb->tp_use_checksum || + hdr->tpdu_dref = htons(tpcb->tp_fref); + if( tpcb->tp_use_checksum || (dutype == CR_TPDU_type && (tpcb->tp_class & TP_CLASS_4) )) { csum_offset = hdr->tpdu_li + 2; /* DOESN'T include csum */ ADDOPTION(TPP_checksum, hdr, 2, eot /* dummy arg */); @@ -236,7 +236,7 @@ tp_emit(dutype, tpcb, seq, eot, data) "tp_emit: csum_offset 0x%x, hdr->tpdu_li 0x%x\n", csum_offset, hdr->tpdu_li); ENDDEBUG - } + } /* * VARIABLE PARTS... */ @@ -244,7 +244,7 @@ tp_emit(dutype, tpcb, seq, eot, data) case CR_TPDU_type: hdr->tpdu_CRdref_0 = 0; /* must be zero */ - case CC_TPDU_type: + case CC_TPDU_type: if (!tpcb->tp_cebit_off) { tpcb->tp_win_recv = tp_start_win << 8; LOCAL_CREDIT(tpcb); @@ -274,7 +274,7 @@ tp_emit(dutype, tpcb, seq, eot, data) hdr->tpdu_cdt = 0; } hdr->tpdu_CCclass = tp_mask_to_num(tpcb->tp_class); - hdr->tpdu_CCoptions = + hdr->tpdu_CCoptions = (tpcb->tp_xtd_format? TPO_XTD_FMT:0) | (tpcb->tp_use_efc? TPO_USE_EFC:0); @@ -297,7 +297,7 @@ tp_emit(dutype, tpcb, seq, eot, data) IncStat(ts_CC_sent); } - ADDOPTION(TPP_tpdu_size, hdr, + ADDOPTION(TPP_tpdu_size, hdr, sizeof(tpcb->tp_tpdusize), tpcb->tp_tpdusize); if (tpcb->tp_class != TP_CLASS_0) { @@ -307,7 +307,7 @@ tp_emit(dutype, tpcb, seq, eot, data) ADDOPTION(TPP_acktime, hdr, sizeof(short), millisec); x = (tpcb->tp_use_nxpd? TPAO_USE_NXPD: 0) - | (tpcb->tp_use_rcc? TPAO_USE_RCC : 0) + | (tpcb->tp_use_rcc? TPAO_USE_RCC : 0) | (tpcb->tp_use_checksum?0: TPAO_NO_CSUM) | (tpcb->tp_xpd_service? TPAO_USE_TXPD: 0); ADDOPTION(TPP_addl_opt, hdr, 1, x); @@ -326,7 +326,7 @@ tp_emit(dutype, tpcb, seq, eot, data) } } } - + if( (dutype == CR_TPDU_type) && (tpcb->tp_class != TP_CLASS_0)){ ASSERT( 1 == sizeof(tpcb->tp_vers) ); @@ -346,7 +346,7 @@ tp_emit(dutype, tpcb, seq, eot, data) ADDOPTION(TPP_alt_class, hdr, 1, x); } - if( hdr->tpdu_li > MLEN) + if( hdr->tpdu_li > MLEN) panic("tp_emit CR/CC"); } break; @@ -430,7 +430,7 @@ tp_emit(dutype, tpcb, seq, eot, data) case DT_TPDU_type: hdr->tpdu_cdt = 0; IFTRACE(D_DATA) - tptraceTPCB(TPPTmisc, "emit DT: eot seq tpdu_li", eot, seq, + tptraceTPCB(TPPTmisc, "emit DT: eot seq tpdu_li", eot, seq, hdr->tpdu_li, 0); ENDTRACE if (tpcb->tp_xtd_format) { @@ -467,13 +467,13 @@ tp_emit(dutype, tpcb, seq, eot, data) break; case AK_TPDU_type:/* ak not used in class 0 */ - ASSERT( tpcb->tp_class != TP_CLASS_0); + ASSERT( tpcb->tp_class != TP_CLASS_0); data = (struct mbuf *)0; olduwe = tpcb->tp_sent_uwe; if (seq != tpcb->tp_sent_rcvnxt || tpcb->tp_rsycnt == 0) { - LOCAL_CREDIT( tpcb ); - tpcb->tp_sent_uwe = + LOCAL_CREDIT( tpcb ); + tpcb->tp_sent_uwe = SEQ(tpcb,tpcb->tp_rcvnxt + tpcb->tp_lcredit -1); tpcb->tp_sent_lcdt = tpcb->tp_lcredit; acking_ooo = 0; @@ -481,14 +481,14 @@ tp_emit(dutype, tpcb, seq, eot, data) acking_ooo = 1; IFDEBUG(D_RENEG) - /* occasionally fake a reneging so + /* occasionally fake a reneging so you can test subsequencing */ if( olduwe & 0x1 ) { tpcb->tp_reneged = 1; IncStat(ts_ldebug); } ENDDEBUG - /* Are we about to reneg on credit? + /* Are we about to reneg on credit? * When might we do so? * a) when using optimistic credit (which we no longer do). * b) when drain() gets implemented (not in the plans). @@ -501,7 +501,7 @@ tp_emit(dutype, tpcb, seq, eot, data) tpcb->tp_reneged = 1; IncStat(ts_lcdt_reduced); IFTRACE(D_CREDIT) - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "RENEG: olduwe newuwe lcredit rcvnxt", olduwe, tpcb->tp_sent_uwe, tpcb->tp_lcredit, @@ -514,7 +514,7 @@ tp_emit(dutype, tpcb, seq, eot, data) */ if( SEQ_LT( tpcb, tpcb->tp_rcvnxt, olduwe) ) { /* tmp1 = number of pkts fewer than the full window */ - register int tmp1 = + register int tmp1 = (int) SEQ_SUB( tpcb, olduwe, tpcb->tp_rcvnxt); if(tmp1 > TP_PM_MAX) @@ -526,7 +526,7 @@ tp_emit(dutype, tpcb, seq, eot, data) if(tmp1 > TP_PM_MAX ) tmp1 = TP_PM_MAX; - IncPStat( tpcb, + IncPStat( tpcb, tps_cdt_acked [ tmp1 ] [ ((tpcb->tp_lcredit > TP_PM_MAX)? TP_PM_MAX:tpcb->tp_lcredit) ] ); @@ -535,7 +535,7 @@ tp_emit(dutype, tpcb, seq, eot, data) ENDPERF IFTRACE(D_ACKSEND) - tptraceTPCB(TPPTack, seq, tpcb->tp_lcredit, tpcb->tp_sent_uwe, + tptraceTPCB(TPPTack, seq, tpcb->tp_lcredit, tpcb->tp_sent_uwe, tpcb->tp_r_subseq, 0); ENDTRACE if (tpcb->tp_xtd_format) { @@ -547,7 +547,7 @@ tp_emit(dutype, tpcb, seq, eot, data) hdr->tpdu_seqeotX = htonl(seqeotX.s_seqeot); hdr->tpdu_AKcdtX = htons(tpcb->tp_lcredit); #else - hdr->tpdu_cdt = 0; + hdr->tpdu_cdt = 0; hdr->tpdu_AKseqX = seq; hdr->tpdu_AKcdtX = tpcb->tp_lcredit; #endif /* BYTE_ORDER */ @@ -557,8 +557,8 @@ tp_emit(dutype, tpcb, seq, eot, data) } if ((tpcb->tp_class == TP_CLASS_4) && (tpcb->tp_reneged || acking_ooo)) { - /* - * Ack subsequence parameter req'd if WE reneged on + /* + * Ack subsequence parameter req'd if WE reneged on * credit offered. (ISO 8073, 12.2.3.8.2, p. 74) */ IFDEBUG(D_RENEG) @@ -568,13 +568,13 @@ tp_emit(dutype, tpcb, seq, eot, data) /* * add tmp subseq and do a htons on it. */ - ADDOPTION(TPP_subseq, hdr, + ADDOPTION(TPP_subseq, hdr, sizeof(tpcb->tp_s_subseq), tpcb->tp_s_subseq); } else tpcb->tp_s_subseq = 0; if ( tpcb->tp_sendfcc || eot ) /* overloaded to mean SEND FCC */ { - /* + /* * Rules for sending FCC ("should" send when) : * %a) received an ack from peer with NO NEWS whatsoever, * and it did not contain an FCC @@ -584,19 +584,19 @@ tp_emit(dutype, tpcb, seq, eot, data) * and below UWE at time of reneging (reduction) * Now, ISO 8073 12.2.3.8.3 says * that a retransmitted AK shall not contain the FCC - * parameter. Now, how the hell you tell the difference - * between a retransmitted ack and an ack that's sent in + * parameter. Now, how the hell you tell the difference + * between a retransmitted ack and an ack that's sent in * response to a received ack, I don't know, because without * any local activity, and w/o any received DTs, they * will contain exactly the same credit/seq# information. * Anyway, given that the "retransmission of acks" * procedure (ISO 8073 12.2.3.8.3) is optional, and we - * don't do it (although the peer can't tell that), we + * don't do it (although the peer can't tell that), we * ignore this last rule. * - * We send FCC for reasons a) and b) only. + * We send FCC for reasons a) and b) only. * To add reason c) would require a ridiculous amount of state. - * + * */ u_short bogus[4]; /* lwe(32), subseq(16), cdt(16) */ SeqNum lwe; @@ -613,15 +613,15 @@ tp_emit(dutype, tpcb, seq, eot, data) bcopy((caddr_t) &fcredit, (caddr_t)&bogus[3], sizeof(u_short)); IFTRACE(D_ACKSEND) - tptraceTPCB(TPPTmisc, - "emit w/FCC: snduna r_subseq fcredit", + tptraceTPCB(TPPTmisc, + "emit w/FCC: snduna r_subseq fcredit", tpcb->tp_snduna, tpcb->tp_r_subseq, tpcb->tp_fcredit, 0); ENDTRACE IFDEBUG(D_ACKSEND) printf("Calling ADDOPTION 0x%x, 0x%x, 0x%x,0x%x\n", - TPP_flow_cntl_conf, + TPP_flow_cntl_conf, hdr, sizeof(bogus), bogus[0]); ENDDEBUG ADDOPTION(TPP_flow_cntl_conf, hdr, sizeof(bogus), bogus[0]); @@ -632,7 +632,7 @@ tp_emit(dutype, tpcb, seq, eot, data) "after ADDOPTION csum_offset 0x%x, hdr->tpdu_li 0x%x\n", csum_offset, hdr->tpdu_li); ENDDEBUG - + } tpcb->tp_reneged = 0; tpcb->tp_sent_rcvnxt = seq; @@ -654,7 +654,7 @@ tp_emit(dutype, tpcb, seq, eot, data) break; case ER_TPDU_type: - hdr->tpdu_ERreason = eot; + hdr->tpdu_ERreason = eot; hdr->tpdu_cdt = 0; /* no user data */ data = (struct mbuf *)0; @@ -670,7 +670,7 @@ tp_emit(dutype, tpcb, seq, eot, data) ASSERT( hdr->tpdu_li < MLEN ); /* leave this in */ ASSERT( hdr->tpdu_li != 0 ); /* leave this in */ - m->m_len = hdr->tpdu_li ; + m->m_len = hdr->tpdu_li ; hdr->tpdu_li --; /* doesn't include the li field */ datalen = m_datalen( m ); /* total len */ @@ -683,7 +683,7 @@ tp_emit(dutype, tpcb, seq, eot, data) csum_offset, hdr->tpdu_li); ENDDEBUG if( datalen > tpcb->tp_l_tpdusize ) { - printf("data len 0x%x tpcb->tp_l_tpdusize 0x%x\n", + printf("data len 0x%x tpcb->tp_l_tpdusize 0x%x\n", datalen, tpcb->tp_l_tpdusize); } IFDEBUG(D_EMIT) @@ -691,7 +691,7 @@ tp_emit(dutype, tpcb, seq, eot, data) "tp_emit before gen_csum m_len 0x%x, csum_offset 0x%x, datalen 0x%x\n", m->m_len, csum_offset, datalen); ENDDEBUG - if( tpcb->tp_use_checksum || + if( tpcb->tp_use_checksum || (dutype == CR_TPDU_type && (tpcb->tp_class & TP_CLASS_4)) ) { iso_gen_csum(m, csum_offset, datalen); } @@ -734,9 +734,9 @@ tp_emit(dutype, tpcb, seq, eot, data) printf("OUTPUT: returned 0x%x\n", error); ENDDEBUG IFTRACE(D_EMIT) - tptraceTPCB(TPPTmisc, - "tp_emit nlproto->output netservice returns datalen", - tpcb->tp_nlproto->nlp_output, tpcb->tp_netservice, error, datalen); + tptraceTPCB(TPPTmisc, + "tp_emit nlproto->output netservice returns datalen", + tpcb->tp_nlproto->nlp_output, tpcb->tp_netservice, error, datalen); ENDTRACE done: if (error) { @@ -757,7 +757,7 @@ done: * The error type is the first argument. * The argument (sref) is the source reference on the bad incoming tpdu, * and is used for a destination reference on the outgoing packet. - * (faddr) and (laddr) are the foreign and local addresses for this + * (faddr) and (laddr) are the foreign and local addresses for this * connection. * (erdata) is a ptr to the errant incoming tpdu, and is copied into the * outgoing ER, if an ER is to be issued. @@ -769,9 +769,9 @@ done: * 0 OK * ENOBUFS * E* from net layer datagram output routine - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ int @@ -788,21 +788,21 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, { int dutype; int datalen = 0; - register struct tpdu *hdr; + register struct tpdu *hdr; register struct mbuf *m; int csum_offset; IFTRACE(D_ERROR_EMIT) - tptrace(TPPTmisc, "tp_error_emit error sref tpcb erlen", + tptrace(TPPTmisc, "tp_error_emit error sref tpcb erlen", error, sref, tpcb, erlen); ENDTRACE IFDEBUG(D_ERROR_EMIT) printf( - "tp_error_emit error 0x%x sref 0x%x tpcb 0x%x erlen 0x%x chan 0x%x\n", + "tp_error_emit error 0x%x sref 0x%x tpcb 0x%x erlen 0x%x chan 0x%x\n", error, sref, tpcb, erlen, cons_channel); ENDDEBUG - MGET(m, M_DONTWAIT, TPMT_TPHDR); + MGET(m, M_DONTWAIT, TPMT_TPHDR); if (m == NULL) { return ENOBUFS; } @@ -858,7 +858,7 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, case ER_TPDU_type: IncStat(ts_ER_sent); - hdr->tpdu_li = 5; + hdr->tpdu_li = 5; hdr->tpdu_ERreason = (char)error; hdr->tpdu_ERdref = htons(sref); break; @@ -870,11 +870,11 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, if(tpcb) if( tpcb->tp_use_checksum ) { - ADDOPTION(TPP_checksum, hdr, 2, csum_offset /* dummy argument */); + ADDOPTION(TPP_checksum, hdr, 2, csum_offset /* dummy argument */); csum_offset = hdr->tpdu_li - 2; } - ASSERT( hdr->tpdu_li < MLEN ); + ASSERT( hdr->tpdu_li < MLEN ); if (dutype == ER_TPDU_type) { /* copy the errant tpdu into another 'variable part' */ @@ -891,7 +891,7 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, /* copy at most as many octets for which you have room */ if (erlen + hdr->tpdu_li + 2 > TP_MAX_HEADER_LEN) erlen = TP_MAX_HEADER_LEN - hdr->tpdu_li - 2; - + /* add the "invalid tpdu" parameter : required in class 0 */ P = (caddr_t)hdr + (int)(hdr->tpdu_li); vbptr(P)->tpv_code = TPP_invalid_tpdu; /* parameter code */ @@ -909,7 +909,7 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, * (or max that will fit in a header */ m->m_next = m_copy(erdata, 0, erlen); - hdr->tpdu_li += erlen + 2; + hdr->tpdu_li += erlen + 2; m_freem(erdata); } else { IFDEBUG(D_ERROR_EMIT) @@ -932,7 +932,7 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, tptrace(TPPTmisc, "before gen csum datalen", datalen,0,0,0); ENDTRACE IFDEBUG(D_ERROR_EMIT) - printf("before gen csum datalen 0x%x, csum_offset 0x%x\n", + printf("before gen csum datalen 0x%x, csum_offset 0x%x\n", datalen, csum_offset); ENDDEBUG @@ -972,10 +972,10 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, dump_addr((struct sockaddr *)faddr); ENDDEBUG return (tpcb->tp_nlproto->nlp_dgoutput)( - &laddr->siso_addr, - &faddr->siso_addr, - m, datalen, - /* no route */ (caddr_t)0, !tpcb->tp_use_checksum); + &laddr->siso_addr, + &faddr->siso_addr, + m, datalen, + /* no route */ (caddr_t)0, !tpcb->tp_use_checksum); } else if (dgout_routine) { IFDEBUG(D_ERROR_EMIT) printf("tp_error_emit sending DG: Laddr\n"); @@ -983,8 +983,8 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel, printf("Faddr\n"); dump_addr((struct sockaddr *)faddr); ENDDEBUG - return (*dgout_routine)( &laddr->siso_addr, &faddr->siso_addr, - m, datalen, /* no route */ + return (*dgout_routine)( &laddr->siso_addr, &faddr->siso_addr, + m, datalen, /* no route */ (caddr_t)0, /* nochecksum==false */0); } else { IFDEBUG(D_ERROR_EMIT) diff --git a/sys/netiso/tp_events.h b/sys/netiso/tp_events.h index 16d622b..c425cee 100644 --- a/sys/netiso/tp_events.h +++ b/sys/netiso/tp_events.h @@ -1,5 +1,5 @@ /* - * $Id: tp_events.h,v 1.2 1994/08/02 07:51:05 davidg Exp $ + * $Id: tp_events.h,v 1.3 1994/08/21 06:14:24 paul Exp $ */ #ifndef _NETISO_TP_EVENTS_H_ @@ -7,7 +7,7 @@ struct tp_event { int ev_number; - struct timeval e_time; + struct timeval e_time; #define TM_inact 0x0 #define TM_retrans 0x1 #define TM_sendack 0x2 @@ -46,23 +46,23 @@ struct { struct mbuf *e_data; /* first field */ } EV_CC_TPDU; #define CC_TPDU 0xa -struct { u_int e_cdt; - SeqNum e_seq; - SeqNum e_subseq; - u_char e_fcc_present; +struct { u_int e_cdt; + SeqNum e_seq; + SeqNum e_subseq; + u_char e_fcc_present; } EV_AK_TPDU; #define AK_TPDU 0xb struct { struct mbuf *e_data; /* first field */ int e_datalen; /* 2nd field */ u_int e_eot; - SeqNum e_seq; + SeqNum e_seq; } EV_DT_TPDU; #define DT_TPDU 0xc struct { struct mbuf *e_data; /* first field */ int e_datalen; /* 2nd field */ - SeqNum e_seq; + SeqNum e_seq; } EV_XPD_TPDU; #define XPD_TPDU 0xd diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c index 63ef233..d8a9a42 100644 --- a/sys/netiso/tp_inet.c +++ b/sys/netiso/tp_inet.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_inet.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_inet.c,v 1.3 1994/11/15 14:26:16 bde Exp $ + * $Id: tp_inet.c,v 1.4 1995/04/26 21:32:36 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,16 +60,16 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP - * $Header: /home/ncvs/src/sys/netiso/tp_inet.c,v 1.3 1994/11/15 14:26:16 bde Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_inet.c,v 1.4 1995/04/26 21:32:36 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_inet.c,v $ * * Here is where you find the inet-dependent code. We've tried * keep all net-level and (primarily) address-family-dependent stuff * out of the tp source, and everthing here is reached indirectly - * through a switch table (struct nl_protosw *) tpcb->tp_nlproto - * (see tp_pcb.c). + * through a switch table (struct nl_protosw *) tpcb->tp_nlproto + * (see tp_pcb.c). * The routines here are: * in_getsufx: gets transport suffix out of an inpcb structure. * in_putsufx: put transport suffix into an inpcb structure. @@ -113,7 +113,7 @@ SOFTWARE. /* * NAME: in_getsufx() - * CALLED FROM: pr_usrreq() on PRU_BIND, + * CALLED FROM: pr_usrreq() on PRU_BIND, * PRU_CONNECT, PRU_ACCEPT, and PRU_PEERADDR * * FUNCTION, ARGUMENTS, and RETURN VALUE: @@ -123,9 +123,9 @@ SOFTWARE. * RETURNS: internet port / transport suffix * (CAST TO AN INT) * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ in_getsufx(inp, lenp, data_out, which) struct inpcb *inp; @@ -148,7 +148,7 @@ in_getsufx(inp, lenp, data_out, which) /* * NAME: in_putsufx() * - * CALLED FROM: tp_newsocket(); i.e., when a connection + * CALLED FROM: tp_newsocket(); i.e., when a connection * is being established by an incoming CR_TPDU. * * FUNCTION, ARGUMENTS: @@ -157,9 +157,9 @@ in_getsufx(inp, lenp, data_out, which) * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ /*ARGSUSED*/ void @@ -174,19 +174,19 @@ in_putsufx(inp, sufxloc, sufxlen, which) } /* - * NAME: in_recycle_tsuffix() + * NAME: in_recycle_tsuffix() * * CALLED FROM: tp.trans whenever we go into REFWAIT state. * * FUNCTION and ARGUMENT: - * Called when a ref is frozen, to allow the suffix to be reused. - * (inp) is the net level pcb. + * Called when a ref is frozen, to allow the suffix to be reused. + * (inp) is the net level pcb. * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: This really shouldn't have to be done in a NET level pcb + * NOTES: This really shouldn't have to be done in a NET level pcb * but... for the internet world that just the way it is done in BSD... * The alternative is to have the port unusable until the reference * timer goes off. @@ -212,10 +212,10 @@ in_recycle_tsuffix(inp) * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: - */ + * NOTES: + */ void in_putnetaddr(inp, name, which) register struct inpcb *inp; @@ -224,14 +224,14 @@ in_putnetaddr(inp, name, which) { switch (which) { case TP_LOCAL: - bcopy((caddr_t)&name->sin_addr, + bcopy((caddr_t)&name->sin_addr, (caddr_t)&inp->inp_laddr, sizeof(struct in_addr)); /* won't work if the dst address (name) is INADDR_ANY */ break; case TP_FOREIGN: if( name != (struct sockaddr_in *)0 ) { - bcopy((caddr_t)&name->sin_addr, + bcopy((caddr_t)&name->sin_addr, (caddr_t)&inp->inp_faddr, sizeof(struct in_addr)); } } @@ -251,10 +251,10 @@ in_putnetaddr(inp, name, which) * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: - */ + * NOTES: + */ in_cmpnetaddr(inp, name, which) register struct inpcb *inp; register struct sockaddr_in *name; @@ -282,10 +282,10 @@ in_cmpnetaddr(inp, name, which) * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: - */ + * NOTES: + */ void in_getnetaddr( inp, name, which) @@ -323,7 +323,7 @@ in_getnetaddr( inp, name, which) * It appears that setting a double pointer to the rtentry associated with * the destination, and returning the header size for the network protocol * suffices. - * + * * SIDE EFFECTS: * Sets tp_routep pointer in pcb. * @@ -355,12 +355,12 @@ register struct tp_pcb *tpcb; * of the fields. * inp is the inpcb structure; datalen is the length of the data in the * mbuf string m0. - * RETURNS: + * RETURNS: * whatever (E*) is returned form the net layer output routine. * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ int @@ -384,12 +384,12 @@ tpip_output(inp, m0, datalen, nochksum) * instead of a pcb. It's used by the tp_error_emit, when we * don't have an in_pcb with which to call the normal output rtn. * - * RETURNS: ENOBUFS or whatever (E*) is + * RETURNS: ENOBUFS or whatever (E*) is * returned form the net layer output routine. * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ /*ARGSUSED*/ @@ -424,7 +424,7 @@ tpip_output_dg(laddr, faddr, m0, datalen, ro, nochksum) ip->ip_p = IPPROTO_TP; m->m_pkthdr.len = ip->ip_len = sizeof(struct ip) + datalen; - ip->ip_ttl = MAXTTL; + ip->ip_ttl = MAXTTL; /* don't know why you need to set ttl; * overlay doesn't even make this available */ @@ -460,8 +460,8 @@ bad: * FUNCTION and ARGUMENTS: * Take a packet (m) from ip, strip off the ip header and give it to tp * - * RETURNS: No return value. - * + * RETURNS: No return value. + * * SIDE EFFECTS: * * NOTES: @@ -490,7 +490,7 @@ tpip_input(m, iplen) if((m = m_pullup(m, iplen + 1)) == MNULL) goto discard; CHANGE_MTYPE(m, TPMT_DATA); - + /* * Now pull up the whole tp header: * Unfortunately, there may be IP options to skip past so we @@ -506,15 +506,15 @@ tpip_input(m, iplen) goto discard; } } - /* - * cannot use tp_inputprep() here 'cause you don't + /* + * cannot use tp_inputprep() here 'cause you don't * have quite the same situation */ IFDEBUG(D_TPINPUT) dump_mbuf(m, "after tpip_input both pullups"); ENDDEBUG - /* + /* * m_pullup may have returned a different mbuf */ ip = mtod(m, struct ip *); @@ -530,7 +530,7 @@ tpip_input(m, iplen) src.sin_family = AF_INET; src.sin_len = sizeof(src); dst.sin_addr = *(struct in_addr *)&(ip->ip_dst); - dst.sin_family = AF_INET; + dst.sin_family = AF_INET; dst.sin_len = sizeof(dst); (void) tp_input(m, (struct sockaddr *)&src, (struct sockaddr *)&dst, @@ -564,9 +564,9 @@ extern void tp_quench(); * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ void @@ -587,14 +587,14 @@ tpin_quench(inp) * It either returns an error status to the user or * causes all connections on this address to be aborted * by calling the appropriate xx_notify() routine. - * (cmd) is the type of ICMP error. + * (cmd) is the type of ICMP error. * (sa) the address of the sender * * RETURNS: Nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ ProtoHook tpip_ctlinput(cmd, sin) @@ -664,9 +664,9 @@ tpip_ctlinput(cmd, sin) * * RETURNS: Nothing * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ ProtoHook diff --git a/sys/netiso/tp_input.c b/sys/netiso/tp_input.c index 1eac406..2caa2bf 100644 --- a/sys/netiso/tp_input.c +++ b/sys/netiso/tp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_input.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tp_input.c,v 1.2 1994/08/02 07:51:11 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_input.c,v 1.1.1.1 1994/05/24 10:06:54 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_input.c,v 1.2 1994/08/02 07:51:11 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_input.c,v $ * * tp_input() gets an mbuf chain from ip. Actually, not directly @@ -81,7 +81,7 @@ SOFTWARE. * socket. tp_input calls sonewconn() and tp_newsocket() to set up the * "child" socket. Most tpcb values are copied from the parent tpcb into * the child. - * + * * Also in here is tp_headersize() (grot) which tells the expected size * of a tp header, to be used by other layers. It's in here because it * uses the static structure tpdu_info. @@ -128,7 +128,7 @@ int iso_check_csum(), tp_driver(), tp_headersize(), tp_error_emit(); */ struct mbuf * -tp_inputprep(m) +tp_inputprep(m) register struct mbuf *m; { int hdrlen; @@ -157,7 +157,7 @@ tp_inputprep(m) if(((int)m->m_data) & 0x3) { /* If we are not 4-byte aligned, we have to be * above the beginning of the mbuf, and it is ok just - * to slide it back. + * to slide it back. */ caddr_t ocp = m->m_data; @@ -172,7 +172,7 @@ tp_inputprep(m) hdrlen = 1 + *mtod( m, u_char *); /* - * now pull up the whole tp header + * now pull up the whole tp header */ if ( m->m_len < hdrlen) { if ((m = m_pullup(m, hdrlen)) == MNULL ) { @@ -224,9 +224,9 @@ static u_char tpdu_info[][4] = if (Phrase) {error = (Erval); errlen = (int)(Loc); IncStat(Stat);\ goto Whattodo; } -/* +/* * WHENEVER YOU USE THE FOLLOWING MACRO, - * BE SURE THE TPDUTYPE IS A LEGIT VALUE FIRST! + * BE SURE THE TPDUTYPE IS A LEGIT VALUE FIRST! */ #define WHILE_OPTIONS(P, hdr, format)\ @@ -273,7 +273,7 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice) register struct tp_pcb *tpcb = sototpcb(so); /* old tpcb, needed below */ register struct tp_pcb *newtpcb; - /* + /* * sonewconn() gets a new socket structure, * a new lower layer pcb and a new tpcb, * but the pcbs are unnamed (not bound) @@ -281,20 +281,20 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice) IFTRACE(D_NEWSOCK) tptraceTPCB(TPPTmisc, "newsock: listg_so, _tpcb, so_head", so, tpcb, so->so_head, 0); - ENDTRACE + ENDTRACE if ((so = sonewconn(so, SS_ISCONFIRMING)) == (struct socket *)0) return so; IFTRACE(D_NEWSOCK) tptraceTPCB(TPPTmisc, "newsock: after newconn so, so_head", so, so->so_head, 0, 0); - ENDTRACE + ENDTRACE IFDEBUG(D_NEWSOCK) printf("tp_newsocket(channel 0x%x) after sonewconn so 0x%x \n", cons_channel, so); dump_addr(fname); - { + { struct socket *t, *head ; head = so->so_head; @@ -307,8 +307,8 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice) } ENDDEBUG - /* - * before we clobber the old tpcb ptr, get these items from the parent pcb + /* + * before we clobber the old tpcb ptr, get these items from the parent pcb */ newtpcb = sototpcb(so); newtpcb->_tp_param = tpcb->_tp_param; @@ -319,7 +319,7 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice) bcopy( tpcb->tp_lsuffix, newtpcb->tp_lsuffix, newtpcb->tp_lsuffixlen); if( /* old */ tpcb->tp_ucddata) { - /* + /* * These data are the connect- , confirm- or disconnect- data. */ struct mbuf *conndata; @@ -370,7 +370,7 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice) printf("tp_route_to FAILED! detaching tpcb 0x%x, so 0x%x\n", tpcb, so); ENDDEBUG - (void) tp_detach(tpcb); + (void) tp_detach(tpcb); return 0; } ok: @@ -388,7 +388,7 @@ tpcons_output() } #endif /* !CONS */ -/* +/* * NAME: tp_input() * * CALLED FROM: @@ -398,12 +398,12 @@ tpcons_output() * Process an incoming TPDU (m), finding the associated tpcb if there * is one. Create the appropriate type of event and call the driver. * (faddr) and (laddr) are the foreign and local addresses. - * + * * When tp_input() is called we KNOW that the ENTIRE TP HEADER * has been m_pullup-ed. * * RETURN VALUE: Nada - * + * * SIDE EFFECTS: * When using COSNS it may affect the state of the net-level pcb * @@ -439,7 +439,7 @@ tp_input(m, faddr, laddr, cons_channel, dgout_routine, ce_bit) caddr_t fsufxloc, lsufxloc; int tpdu_len; u_int takes_data; - u_int fcc_present; + u_int fcc_present; int errlen; struct tp_conn_param tpp; int tpcons_output(); @@ -457,16 +457,16 @@ again: #ifdef TP_PERF_MEAS GET_CUR_TIME( &e.e_time ); perf_meas = 0; #endif /* TP_PERF_MEAS */ - + IFDEBUG(D_TPINPUT) printf("tp_input(0x%x, ... 0x%x)\n", m, cons_channel); ENDDEBUG - /* + /* * get the actual tpdu length - necessary for monitoring * and for checksumming - * + * * Also, maybe measure the mbuf chain lengths and sizes. */ @@ -497,7 +497,7 @@ again: ENDDEBUG } IFTRACE(D_TPINPUT) - tptraceTPCB(TPPTtpduin, hdr->tpdu_type, hdr, hdr->tpdu_li+1, tpdu_len, + tptraceTPCB(TPPTtpduin, hdr->tpdu_type, hdr, hdr->tpdu_li+1, tpdu_len, 0); ENDTRACE @@ -511,7 +511,7 @@ again: printf("input: dref 0x%x sref 0x%x\n", dref, sref); ENDDEBUG IFTRACE(D_TPINPUT) - tptrace(TPPTmisc, "channel dutype dref ", + tptrace(TPPTmisc, "channel dutype dref ", cons_channel, dutype, dref, 0); ENDTRACE @@ -528,7 +528,7 @@ again: #endif /* ARGO_DEBUG */ CHECK( (dutype < TP_MIN_TPDUTYPE || dutype > TP_MAX_TPDUTYPE), - E_TP_INV_TPDU, ts_inv_dutype, respond, + E_TP_INV_TPDU, ts_inv_dutype, respond, 2 ); /* unfortunately we can't take the address of the tpdu_type field, * since it's a bit field - so we just use the constant offset 2 @@ -548,7 +548,7 @@ again: switch( vbptr(P)->tpv_code ) { - case TPP_tpdu_size: + case TPP_tpdu_size: vb_getval(P, u_char, dusize); IFDEBUG(D_TPINPUT) printf("CR dusize 0x%x\n", dusize); @@ -612,7 +612,7 @@ again: case TPP_vers: /* not in class 0; 1 octet; in CR_TPDU only */ /* COS tests says if version wrong, use default version!?XXX */ - CHECK( (vbval(P, u_char) != TP_VERSION ), + CHECK( (vbval(P, u_char) != TP_VERSION ), E_TP_INV_PVAL, ts_inv_pval, setversion, (1 + (caddr_t)&vbptr(P)->tpv_val - (caddr_t)hdr) ); setversion: @@ -636,7 +636,7 @@ again: static u_char bad_alt_classes[5] = { ~0, ~3, ~5, ~0xf, ~0x1f}; - aclass = + aclass = (u_char *) &(((struct tp_vbp *)P)->tpv_val); for (i = ((struct tp_vbp *)P)->tpv_len; i>0; i--) { alt_classes |= (1<<((*aclass++)>>4)); @@ -654,8 +654,8 @@ again: case TPP_residER: case TPP_priority: case TPP_transdelay: - case TPP_throughput: - case TPP_addl_info: + case TPP_throughput: + case TPP_addl_info: case TPP_subseq: default: IFDEBUG(D_TPINPUT) @@ -665,12 +665,12 @@ again: IncStat(ts_param_ignored); break; - case TPP_checksum: + case TPP_checksum: IFDEBUG(D_TPINPUT) printf("CR before cksum\n"); ENDDEBUG - CHECK( iso_check_csum(m, tpdu_len), + CHECK( iso_check_csum(m, tpdu_len), E_TP_INV_PVAL, ts_bad_csum, discard, 0) IFDEBUG(D_TPINPUT) @@ -711,8 +711,8 @@ again: CHECK(t == 0, E_TP_NO_SESSION, ts_inv_sufx, respond, (1 + 2 + (caddr_t)&hdr->_tpduf - (caddr_t)hdr)) - /* _tpduf is the fixed part; add 2 to get the dref bits of - * the fixed part (can't take the address of a bit field) + /* _tpduf is the fixed part; add 2 to get the dref bits of + * the fixed part (can't take the address of a bit field) */ IFDEBUG(D_TPINPUT) printf("checking if dup CR\n"); @@ -730,13 +730,13 @@ again: } } IFTRACE(D_TPINPUT) - tptrace(TPPTmisc, "tp_input: tpcb *lsufxloc tpstate", + tptrace(TPPTmisc, "tp_input: tpcb *lsufxloc tpstate", tpcb, *lsufxloc, tpcb->tp_state, 0); ENDTRACE } - /* - * WE HAVE A TPCB + /* + * WE HAVE A TPCB * already know that the classes in the CR match at least * one class implemented, but we don't know yet if they * include any classes permitted by this server. @@ -747,7 +747,7 @@ again: ENDDEBUG IFDEBUG(D_CONN) printf( -"CR: bef CHKS: flags 0x%x class_to_use 0x%x alt 0x%x opt 0x%x tp_class 0x%x\n", +"CR: bef CHKS: flags 0x%x class_to_use 0x%x alt 0x%x opt 0x%x tp_class 0x%x\n", tpcb->tp_flags, class_to_use, alt_classes, opt, tpcb->tp_class); ENDDEBUG /* tpcb->tp_class doesn't include any classes not implemented */ @@ -774,27 +774,27 @@ again: #endif /* notdef */ CHECK( - tp_consistency(tpcb, 0 /* not force or strict */, &tpp) != 0, + tp_consistency(tpcb, 0 /* not force or strict */, &tpp) != 0, E_TP_NEGOT_FAILED, ts_negotfailed, clear_parent_tcb, - (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) + (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) /* ^ more or less the location of class */ ) } IFTRACE(D_CONN) - tptrace(TPPTmisc, + tptrace(TPPTmisc, "after 1 consist class_to_use class, out, tpconsout", - class_to_use, + class_to_use, tpcb->tp_class, dgout_routine, tpcons_output ); ENDTRACE CHECK( ((class_to_use == TP_CLASS_0)&&(dgout_routine != tpcons_output)), E_TP_NEGOT_FAILED, ts_negotfailed, clear_parent_tcb, - (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) + (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) /* ^ more or less the location of class */ ) IFDEBUG(D_CONN) - printf("CR: after CRCCCHECKS: tpcb 0x%x, flags 0x%x\n", + printf("CR: after CRCCCHECKS: tpcb 0x%x, flags 0x%x\n", tpcb, tpcb->tp_flags); ENDDEBUG takes_data = TRUE; @@ -804,17 +804,17 @@ again: so = tpcb->tp_sock; if (so->so_options & SO_ACCEPTCONN) { struct tp_pcb *parent_tpcb = tpcb; - /* - * Create a socket, tpcb, ll pcb, etc. - * for this newborn connection, and fill in all the values. + /* + * Create a socket, tpcb, ll pcb, etc. + * for this newborn connection, and fill in all the values. */ IFDEBUG(D_CONN) printf("abt to call tp_newsocket(0x%x, 0x%x, 0x%x, 0x%x)\n", so, laddr, faddr, cons_channel); ENDDEBUG - if( (so = - tp_newsocket(so, faddr, cons_channel, - class_to_use, + if( (so = + tp_newsocket(so, faddr, cons_channel, + class_to_use, ((tpcb->tp_netservice == IN_CLNS) ? IN_CLNS : (dgout_routine == tpcons_output)?ISO_CONS:ISO_CLNS)) ) == (struct socket *)0 ) { @@ -834,7 +834,7 @@ again: insque(tpcb, parent_tpcb); /* - * Stash the addresses in the net level pcb + * Stash the addresses in the net level pcb * kind of like a pcbconnect() but don't need * or want all those checks. */ @@ -855,15 +855,15 @@ again: #ifdef TP_PERF_MEAS if( tpcb->tp_perf_on = perf_meas ) { /* assignment */ /* ok, let's create an mbuf for stashing the - * statistics if one doesn't already exist + * statistics if one doesn't already exist */ (void) tp_setup_perf(tpcb); } #endif /* TP_PERF_MEAS */ tpcb->tp_fref = sref; - /* We've already checked for consistency with the options - * set in tpp, but we couldn't set them earlier because + /* We've already checked for consistency with the options + * set in tpp, but we couldn't set them earlier because * we didn't want to change options in the LISTENING tpcb. * Now we set the options in the new socket's tpcb. */ @@ -878,8 +878,8 @@ again: tpcb->tp_peer_acktime = acktime; - /* - * The following kludge is used to test retransmissions and + /* + * The following kludge is used to test retransmissions and * timeout during connection establishment. */ IFDEBUG(D_ZDREF) @@ -896,12 +896,12 @@ again: CONG_UPDATE_SAMPLE(tpcb, ce_bit); } } else if ( dutype == ER_TPDU_type ) { - /* + /* * ER TPDUs have to be recognized separately * because they don't necessarily have a tpcb * with them and we don't want err out looking for such * a beast. - * We could put a bunch of little kludges in the + * We could put a bunch of little kludges in the * next section of code so it would avoid references to tpcb * if dutype == ER_TPDU_type but we don't want code for ERs to * mess up code for data transfer. @@ -909,7 +909,7 @@ again: IncStat(ts_ER_rcvd); e.ev_number = ER_TPDU; e.ATTR(ER_TPDU).e_reason = (u_char)hdr->tpdu_ERreason; - CHECK (((int)dref <= 0 || dref >= tp_refinfo.tpr_size || + CHECK (((int)dref <= 0 || dref >= tp_refinfo.tpr_size || (tpcb = tp_ref[dref].tpr_pcb ) == (struct tp_pcb *) 0 || tpcb->tp_refstate == REF_FREE || tpcb->tp_refstate == REF_FROZEN), @@ -919,8 +919,8 @@ again: /* tpdu type is CC, XPD, XAK, GR, AK, DR, DC, or DT */ /* In the next 4 checks, - * _tpduf is the fixed part; add 2 to get the dref bits of - * the fixed part (can't take the address of a bit field) + * _tpduf is the fixed part; add 2 to get the dref bits of + * the fixed part (can't take the address of a bit field) */ #ifdef TPCONS if (cons_channel && dutype == DT_TPDU_type) { @@ -934,7 +934,7 @@ again: ENDDEBUG dref = tpcb->tp_lref; sref = tpcb->tp_fref; - CHECK( (tpcb->tp_refstate == REF_FREE), + CHECK( (tpcb->tp_refstate == REF_FREE), E_TP_MISM_REFS,ts_inv_dref, nonx_dref, (1 + 2 + (caddr_t)&hdr->_tpduf - (caddr_t)hdr)) goto tp0_data; @@ -947,10 +947,10 @@ again: CHECK( ((int)dref <= 0 || dref >= tp_refinfo.tpr_size) , E_TP_MISM_REFS,ts_inv_dref, nonx_dref, (1 + 2 + (caddr_t)&hdr->_tpduf - (caddr_t)hdr)) - CHECK( ((tpcb = tp_ref[dref].tpr_pcb ) == (struct tp_pcb *) 0 ), + CHECK( ((tpcb = tp_ref[dref].tpr_pcb ) == (struct tp_pcb *) 0 ), E_TP_MISM_REFS,ts_inv_dref, nonx_dref, (1 + 2 + (caddr_t)&hdr->_tpduf - (caddr_t)hdr)) - CHECK( (tpcb->tp_refstate == REF_FREE), + CHECK( (tpcb->tp_refstate == REF_FREE), E_TP_MISM_REFS,ts_inv_dref, nonx_dref, (1 + 2 + (caddr_t)&hdr->_tpduf - (caddr_t)hdr)) } @@ -968,7 +968,7 @@ again: IFDEBUG(D_TPINPUT) printf("state of dref %d ok, tpcb 0x%x\n", dref,tpcb); ENDDEBUG - /* + /* * At this point the state of the dref could be * FROZEN: tpr_pcb == NULL, has ( reference only) timers * for example, DC may arrive after the close() has detached @@ -983,18 +983,18 @@ again: dusize = tpcb->tp_tpdusize; pdusize = tpcb->tp_ptpdusize; - dutype = hdr->tpdu_type << 8; /* for the switch below */ + dutype = hdr->tpdu_type << 8; /* for the switch below */ WHILE_OPTIONS(P, hdr, tpcb->tp_xtd_format) /* { */ #define caseof(x,y) case (((x)<<8)+(y)) switch( dutype | vbptr(P)->tpv_code ) { - caseof( CC_TPDU_type, TPP_addl_opt ): + caseof( CC_TPDU_type, TPP_addl_opt ): /* not in class 0; 1 octet */ vb_getval(P, u_char, addlopt); break; - caseof( CC_TPDU_type, TPP_tpdu_size ): + caseof( CC_TPDU_type, TPP_tpdu_size ): { u_char odusize = dusize; vb_getval(P, u_char, dusize); @@ -1007,7 +1007,7 @@ again: ENDDEBUG } break; - caseof( CC_TPDU_type, TPP_ptpdu_size ): + caseof( CC_TPDU_type, TPP_ptpdu_size ): { u_short opdusize = pdusize; switch (vbptr(P)->tpv_len) { @@ -1047,24 +1047,24 @@ again: ENDDEBUG break; - caseof( CC_TPDU_type, TPP_checksum): - caseof( DR_TPDU_type, TPP_checksum): - caseof( DT_TPDU_type, TPP_checksum): - caseof( XPD_TPDU_type, TPP_checksum): + caseof( CC_TPDU_type, TPP_checksum): + caseof( DR_TPDU_type, TPP_checksum): + caseof( DT_TPDU_type, TPP_checksum): + caseof( XPD_TPDU_type, TPP_checksum): if( tpcb->tp_use_checksum ) { - CHECK( iso_check_csum(m, tpdu_len), + CHECK( iso_check_csum(m, tpdu_len), E_TP_INV_PVAL, ts_bad_csum, discard, 0) } break; /* this is different from the above because in the context - * of concat/ sep tpdu_len might not be the same as hdr len + * of concat/ sep tpdu_len might not be the same as hdr len */ - caseof( AK_TPDU_type, TPP_checksum): - caseof( XAK_TPDU_type, TPP_checksum): - caseof( DC_TPDU_type, TPP_checksum): + caseof( AK_TPDU_type, TPP_checksum): + caseof( XAK_TPDU_type, TPP_checksum): + caseof( DC_TPDU_type, TPP_checksum): if( tpcb->tp_use_checksum ) { - CHECK( iso_check_csum(m, (int)hdr->tpdu_li + 1), + CHECK( iso_check_csum(m, (int)hdr->tpdu_li + 1), E_TP_INV_PVAL, ts_bad_csum, discard, 0) } break; @@ -1099,13 +1099,13 @@ again: ysubseq = ntohs(ysubseq); ycredit = ntohs(ycredit); IFDEBUG(D_ACKRECV) - printf("%s%x, subseq 0x%x, cdt 0x%x dref 0x%x\n", + printf("%s%x, subseq 0x%x, cdt 0x%x dref 0x%x\n", "AK FCC lwe 0x", ylwe, ysubseq, ycredit, dref); ENDDEBUG } break; - default: + default: IFDEBUG(D_TPINPUT) printf("param ignored dutype 0x%x, code 0x%x\n", dutype, vbptr(P)->tpv_code); @@ -1123,7 +1123,7 @@ again: /* NOTE: the variable dutype has been shifted left! */ switch( hdr->tpdu_type ) { - case CC_TPDU_type: + case CC_TPDU_type: /* If CC comes back with an unacceptable class * respond with a DR or ER */ @@ -1146,13 +1146,13 @@ again: #endif /* notdef */ CHECK( - tp_consistency(tpcb, TP_FORCE, &tpp) != 0, + tp_consistency(tpcb, TP_FORCE, &tpp) != 0, E_TP_NEGOT_FAILED, ts_negotfailed, respond, - (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) + (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) /* ^ more or less the location of class */ ) IFTRACE(D_CONN) - tptrace(TPPTmisc, + tptrace(TPPTmisc, "after 1 consist class, out, tpconsout", tpcb->tp_class, dgout_routine, tpcons_output, 0 ); @@ -1161,7 +1161,7 @@ again: ((class_to_use == TP_CLASS_0)&& (dgout_routine != tpcons_output)), E_TP_NEGOT_FAILED, ts_negotfailed, respond, - (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) + (1 + 2 + (caddr_t)&hdr->_tpdufr.CRCC - (caddr_t)hdr) /* ^ more or less the location of class */ ) #ifdef TPCONS @@ -1182,23 +1182,23 @@ again: IFTRACE(D_CONN) tptrace(TPPTmisc, "after CC class flags dusize CCclass", - tpcb->tp_class, tpcb->tp_flags, tpcb->tp_tpdusize, + tpcb->tp_class, tpcb->tp_flags, tpcb->tp_tpdusize, hdr->tpdu_CCclass); ENDTRACE - /* if called or calling suffices appeared on the CC, + /* if called or calling suffices appeared on the CC, * they'd better jive with what's in the pcb */ if( fsufxlen ) { CHECK( ((tpcb->tp_fsuffixlen != fsufxlen) || bcmp(fsufxloc, tpcb->tp_fsuffix, fsufxlen)), - E_TP_INV_PVAL,ts_inv_sufx, respond, + E_TP_INV_PVAL,ts_inv_sufx, respond, (1+fsufxloc - (caddr_t)hdr)) } if( lsufxlen ) { CHECK( ((tpcb->tp_lsuffixlen != lsufxlen) || bcmp(lsufxloc, tpcb->tp_lsuffix, lsufxlen)), - E_TP_INV_PVAL,ts_inv_sufx, respond, + E_TP_INV_PVAL,ts_inv_sufx, respond, (1+lsufxloc - (caddr_t)hdr)) } @@ -1213,16 +1213,16 @@ again: if (sref != tpcb->tp_fref) printf("INPUT: inv sufx DCsref 0x%x, tp_fref 0x%x\n", sref, tpcb->tp_fref); - - CHECK( (sref != tpcb->tp_fref), + + CHECK( (sref != tpcb->tp_fref), E_TP_MISM_REFS, ts_inv_sufx, discard, (1 + (caddr_t)&hdr->tpdu_DCsref - (caddr_t)hdr)) - + e.ev_number = DC_TPDU; IncStat(ts_DC_rcvd); break; - case DR_TPDU_type: + case DR_TPDU_type: IFTRACE(D_TPINPUT) tptrace(TPPTmisc, "DR recvd", hdr->tpdu_DRreason, 0, 0, 0); ENDTRACE @@ -1230,9 +1230,9 @@ again: printf("INPUT: inv sufx DRsref 0x%x tp_fref 0x%x\n", sref, tpcb->tp_fref); } - + CHECK( (sref != 0 && sref != tpcb->tp_fref && - tpcb->tp_state != TP_CRSENT), + tpcb->tp_state != TP_CRSENT), (TP_ERROR_SNDC | E_TP_MISM_REFS),ts_inv_sufx, respond, (1 + (caddr_t)&hdr->tpdu_DRsref - (caddr_t)hdr)) @@ -1252,7 +1252,7 @@ again: IncStat(ts_ER_rcvd); break; - case AK_TPDU_type: + case AK_TPDU_type: e.ATTR(AK_TPDU).e_subseq = subseq; e.ATTR(AK_TPDU).e_fcc_present = fcc_present; @@ -1273,7 +1273,7 @@ again: e.ATTR(AK_TPDU).e_seq = hdr->tpdu_AKseq; } IFTRACE(D_TPINPUT) - tptrace(TPPTmisc, "AK recvd seq cdt subseq fcc_pres", + tptrace(TPPTmisc, "AK recvd seq cdt subseq fcc_pres", e.ATTR(AK_TPDU).e_seq, e.ATTR(AK_TPDU).e_cdt, subseq, fcc_present); ENDTRACE @@ -1283,7 +1283,7 @@ again: IncPStat(tpcb, tps_AK_rcvd); break; - case XAK_TPDU_type: + case XAK_TPDU_type: if (tpcb->tp_xtd_format) { #ifdef BYTE_ORDER union seq_type seqeotX; @@ -1301,7 +1301,7 @@ again: IncPStat(tpcb, tps_XAK_rcvd); break; - case XPD_TPDU_type: + case XPD_TPDU_type: if (tpcb->tp_xtd_format) { #ifdef BYTE_ORDER union seq_type seqeotX; @@ -1359,7 +1359,7 @@ again: IncPStat(tpcb, tps_DT_rcvd); break; - case GR_TPDU_type: + case GR_TPDU_type: tp_indicate(T_DISCONNECT, tpcb, ECONNABORTED); /* drop through */ default: @@ -1374,7 +1374,7 @@ again: goto respond; } } - /* peel off the tp header; + /* peel off the tp header; * remember that the du_li doesn't count itself. * This may leave us w/ an empty mbuf at the front of a chain. * We can't just throw away the empty mbuf because hdr still points @@ -1436,7 +1436,7 @@ again: /* FALLTHROUGH */ case DT_TPDU_type: - for (n = m; n; n = n->m_next) { + for (n = m; n; n = n->m_next) { MCHTYPE(n, mbtype); } invoke: @@ -1481,14 +1481,14 @@ again: case CR_TPDU: m = e.ATTR(CC_TPDU).e_data; /* same field for all three dutypes */ IFDEBUG(D_TPINPUT) - printf("after driver, restoring m to 0x%x, takes_data 0x%x\n", + printf("after driver, restoring m to 0x%x, takes_data 0x%x\n", m, takes_data); ENDDEBUG break; default: break; } - /* Concatenated sequences are terminated by any tpdu that + /* Concatenated sequences are terminated by any tpdu that * carries data: CR, CC, DT, XPD, DR. * All other tpdu types may be concatenated: AK, XAK, DC, ER. */ @@ -1496,15 +1496,15 @@ again: separate: if ( takes_data == 0 ) { ASSERT( m != MNULL ); - /* - * we already peeled off the prev. tp header so + /* + * we already peeled off the prev. tp header so * we can just pull up some more and repeat */ if( m = tp_inputprep(m) ) { IFDEBUG(D_TPINPUT) hdr = mtod(m, struct tpdu *); - printf("tp_input @ separate: hdr 0x%x size %d m 0x%x\n", + printf("tp_input @ separate: hdr 0x%x size %d m 0x%x\n", hdr, (int) hdr->tpdu_li + 1, m); dump_mbuf(m, "tp_input after driver, at separate"); ENDDEBUG @@ -1582,17 +1582,17 @@ respond: * much data to put in each tpdu. * * FUNCTION, ARGUMENTS, and RETURN VALUE: - * For a given connection, represented by (tpcb), and + * For a given connection, represented by (tpcb), and * tpdu type (dutype), return the size of a tp header. * * RETURNS: the expected size of the heade in bytesr * - * SIDE EFFECTS: + * SIDE EFFECTS: * * NOTES: It would be nice if it got the network header size as well. */ int -tp_headersize(dutype, tpcb) +tp_headersize(dutype, tpcb) int dutype; struct tp_pcb *tpcb; { @@ -1602,24 +1602,24 @@ tp_headersize(dutype, tpcb) tptrace(TPPTmisc, "tp_headersize dutype class xtd_format", dutype, tpcb->tp_class, tpcb->tp_xtd_format, 0); ENDTRACE - if( !( (tpcb->tp_class == TP_CLASS_0) || - (tpcb->tp_class == TP_CLASS_4) || - (dutype == DR_TPDU_type) || + if( !( (tpcb->tp_class == TP_CLASS_0) || + (tpcb->tp_class == TP_CLASS_4) || + (dutype == DR_TPDU_type) || (dutype == CR_TPDU_type) )) { - printf("tp_headersize:dutype 0x%x, class 0x%x", + printf("tp_headersize:dutype 0x%x, class 0x%x", dutype, tpcb->tp_class); /* TODO: identify this and GET RID OF IT */ } - ASSERT( (tpcb->tp_class == TP_CLASS_0) || - (tpcb->tp_class == TP_CLASS_4) || - (dutype == DR_TPDU_type) || + ASSERT( (tpcb->tp_class == TP_CLASS_0) || + (tpcb->tp_class == TP_CLASS_4) || + (dutype == DR_TPDU_type) || (dutype == CR_TPDU_type) ); if( tpcb->tp_class == TP_CLASS_0 ) { size = tpdu_info[ dutype ] [TP_LEN_CLASS_0_INDEX]; } else { size = tpdu_info[ dutype ] [tpcb->tp_xtd_format]; - } + } return size; /* caller must get network level header size separately */ } diff --git a/sys/netiso/tp_ip.h b/sys/netiso/tp_ip.h index 0849813..865e2fd 100644 --- a/sys/netiso/tp_ip.h +++ b/sys/netiso/tp_ip.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_ip.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_ip.h,v 1.2 1994/08/02 07:51:13 davidg Exp $ + * $Id: tp_ip.h,v 1.3 1994/08/21 06:14:24 paul Exp $ */ #ifndef _NETISO_TP_IP_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_ip.h,v 1.2 1994/08/02 07:51:13 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_ip.h,v 1.3 1994/08/21 06:14:24 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_ip.h,v $ * * internet IP-dependent structures and include files @@ -85,7 +85,7 @@ SOFTWARE. #include <netinet/ip_var.h> -struct inpcb tp_inpcb; +struct inpcb tp_inpcb; /* queue of active inpcbs for tp ; for tp with dod ip */ #endif diff --git a/sys/netiso/tp_iso.c b/sys/netiso/tp_iso.c index 21f3f7d..b62debe 100644 --- a/sys/netiso/tp_iso.c +++ b/sys/netiso/tp_iso.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_iso.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tp_iso.c,v 1.2 1994/08/02 07:51:14 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,16 +60,16 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP - * $Header: /home/ncvs/src/sys/netiso/tp_iso.c,v 1.1.1.1 1994/05/24 10:06:52 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_iso.c,v 1.2 1994/08/02 07:51:14 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_iso.c,v $ * * Here is where you find the iso-dependent code. We've tried * keep all net-level and (primarily) address-family-dependent stuff * out of the tp source, and everthing here is reached indirectly - * through a switch table (struct nl_protosw *) tpcb->tp_nlproto - * (see tp_pcb.c). + * through a switch table (struct nl_protosw *) tpcb->tp_nlproto + * (see tp_pcb.c). * The routines here are: * iso_getsufx: gets transport suffix out of an isopcb structure. * iso_putsufx: put transport suffix into an isopcb structure. @@ -79,7 +79,7 @@ SOFTWARE. * iso_recycle_suffix: clear suffix for reuse in isopcb * tpclnp_ctlinput: handle ER CNLPdu : icmp-like stuff * tpclnp_mtu: figure out what size tpdu to use - * tpclnp_input: take a pkt from clnp, strip off its clnp header, + * tpclnp_input: take a pkt from clnp, strip off its clnp header, * give to tp * tpclnp_output_dg: package a pkt for clnp given 2 addresses & some data * tpclnp_output: package a pkt for clnp given an isopcb & some data @@ -197,7 +197,7 @@ iso_putsufx(isop, sufxloc, sufxlen, which) * CALLED FROM: * tp.trans whenever we go into REFWAIT state. * FUNCTION and ARGUMENT: - * Called when a ref is frozen, to allow the suffix to be reused. + * Called when a ref is frozen, to allow the suffix to be reused. * (isop) is the net level pcb. This really shouldn't have to be * done in a NET level pcb but... for the internet world that just * the way it is done in BSD... @@ -220,7 +220,7 @@ iso_recycle_tsuffix(isop) * Copy a whole net addr from a struct sockaddr (name). * into an isopcb (isop). * The argument (which) takes values TP_LOCAL or TP_FOREIGN - */ + */ void iso_putnetaddr(isop, name, which) register struct isopcb *isop; @@ -259,7 +259,7 @@ iso_putnetaddr(isop, name, which) * compare a whole net addr from a struct sockaddr (name), * with that implicitly stored in an isopcb (isop). * The argument (which) takes values TP_LOCAL or TP_FOREIGN. - */ + */ iso_cmpnetaddr(isop, name, which) register struct isopcb *isop; register struct sockaddr_iso *name; @@ -298,7 +298,7 @@ iso_cmpnetaddr(isop, name, which) * Copy a whole net addr from an isopcb (isop) into * a struct sockaddr (name). * The argument (which) takes values TP_LOCAL or TP_FOREIGN. - */ + */ void iso_getnetaddr( isop, name, which) @@ -326,7 +326,7 @@ iso_getnetaddr( isop, name, which) * It appears that setting a double pointer to the rtentry associated with * the destination, and returning the header size for the network protocol * suffices. - * + * * SIDE EFFECTS: * Sets tp_routep pointer in pcb. * @@ -385,7 +385,7 @@ tpclnp_output(isop, m0, datalen, nochksum) dump_mbuf(m0, "at tpclnp_output"); ENDDEBUG - return + return clnp_output(m0, isop, datalen, /* flags */nochksum ? CLNP_NO_CKSUM : 0); } @@ -444,13 +444,13 @@ tpclnp_output_dg(laddr, faddr, m0, datalen, ro, nochksum) IncStat(ts_tpdu_sent); err = clnp_output(m0, &tmppcb, datalen, flags); - + /* * Free route allocated by clnp (if the route was indeed allocated) */ if (tmppcb.isop_route.ro_rt) RTFREE(tmppcb.isop_route.ro_rt); - + return(err); } /* @@ -458,7 +458,7 @@ tpclnp_output_dg(laddr, faddr, m0, datalen, ro, nochksum) * clnp's input routine, indirectly through the protosw. * FUNCTION and ARGUMENTS: * Take a packet (m) from clnp, strip off the clnp header and give it to tp - * No return value. + * No return value. */ ProtoHook tpclnp_input(m, src, dst, clnp_len, ce_bit) @@ -507,7 +507,7 @@ tpclnp_input(m, src, dst, clnp_len, ce_bit) ENDDEBUG IFDEBUG(D_TPISO) - printf("calling %sinput : src 0x%x, dst 0x%x, src addr:\n", + printf("calling %sinput : src 0x%x, dst 0x%x, src addr:\n", (input == tp_input ? "tp_" : "clts_"), src, dst); dump_isoaddr(src); printf(" dst addr:\n"); @@ -518,9 +518,9 @@ tpclnp_input(m, src, dst, clnp_len, ce_bit) 0, tpclnp_output_dg, ce_bit); IFDEBUG(D_QUENCH) - { + { if(time.tv_usec & 0x4 && time.tv_usec & 0x40) { - printf("tpclnp_input: FAKING %s\n", + printf("tpclnp_input: FAKING %s\n", tp_stat.ts_pkt_rcvd & 0x1?"QUENCH":"QUENCH2"); if(tp_stat.ts_pkt_rcvd & 0x1) { tpclnp_ctlinput(PRC_QUENCH, &src); @@ -573,7 +573,7 @@ tpiso_quench(isop) * It either returns an error status to the user or * it causes all connections on this address to be aborted * by calling the appropriate xx_notify() routine. - * (cmd) is the type of ICMP error. + * (cmd) is the type of ICMP error. * (siso) is the address of the guy who sent the ER CLNPDU */ ProtoHook diff --git a/sys/netiso/tp_meas.c b/sys/netiso/tp_meas.c index 460403e..f7bbecb 100644 --- a/sys/netiso/tp_meas.c +++ b/sys/netiso/tp_meas.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_meas.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tp_meas.c,v 1.2 1994/08/02 07:51:15 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -61,9 +61,9 @@ SOFTWARE. * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ /* - * $Header: /home/ncvs/src/sys/netiso/tp_meas.c,v 1.1.1.1 1994/05/24 10:06:52 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_meas.c,v 1.2 1994/08/02 07:51:15 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_meas.c,v $ - * + * * tp_meas.c : create a performance measurement event * in the circular buffer tp_Meas[] */ @@ -90,14 +90,14 @@ struct tp_Meas tp_Meas[TPMEASN]; * stashes a performance-measurement event for the given reference (ref) * (kind) tells which kind of event, timev is the time to be stored * with this event, (seq), (win), and (size) are integers that usually - * refer to the sequence number, window number (on send) and + * refer to the sequence number, window number (on send) and * size of tpdu or window. * * RETURNS: Nada * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ void Tpmeas(ref, kind, timev, seq, win, size) @@ -118,7 +118,7 @@ Tpmeas(ref, kind, timev, seq, win, size) if(kind == TPtime_from_ll) bcopy((caddr_t)timev, (caddr_t)&tpm->tpm_time, sizeof(struct timeval)); else - bcopy( (caddr_t)&time, + bcopy( (caddr_t)&time, (caddr_t)&tpm->tpm_time, sizeof(struct timeval) ); tpm->tpm_seq = seq; tpm->tpm_window = win; diff --git a/sys/netiso/tp_meas.h b/sys/netiso/tp_meas.h index 5613db5..ec38744 100644 --- a/sys/netiso/tp_meas.h +++ b/sys/netiso/tp_meas.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_meas.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_meas.h,v 1.2 1994/08/02 07:51:16 davidg Exp $ + * $Id: tp_meas.h,v 1.3 1994/08/21 06:14:25 paul Exp $ */ #ifndef _NETISO_TP_MEAS_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -86,11 +86,11 @@ extern struct tp_Meas tp_Meas[]; */ #define TPtime_from_session 0x01 #define TPtime_to_session 0x02 -#define TPtime_ack_rcvd 0x03 +#define TPtime_ack_rcvd 0x03 #define TPtime_ack_sent 0x04 #define TPtime_from_ll 0x05 #define TPtime_to_ll 0x06 -#define TPsbsend 0x07 +#define TPsbsend 0x07 #define TPtime_open 0x08 #define TPtime_open_X 0x28 /* xtd format */ #define TPtime_close 0x09 diff --git a/sys/netiso/tp_output.c b/sys/netiso/tp_output.c index 0ae2683..bfa938b 100644 --- a/sys/netiso/tp_output.c +++ b/sys/netiso/tp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_output.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_output.c,v 1.2 1994/08/02 07:51:17 davidg Exp $ + * $Id: tp_output.c,v 1.3 1995/04/26 21:32:37 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_output.c,v 1.2 1994/08/02 07:51:17 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_output.c,v 1.3 1995/04/26 21:32:37 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_output.c,v $ * * In here is tp_ctloutput(), the guy called by [sg]etsockopt(), @@ -107,8 +107,8 @@ SOFTWARE. * the input arguements iff no errors were encountered. * Strict means that no inconsistency will be tolerated. If it's * not used, checksum and tpdusize inconsistencies will be tolerated. - * The reason for this is that in some cases, when we're negotiating down - * from class 4, these options should be changed but should not + * The reason for this is that in some cases, when we're negotiating down + * from class 4, these options should be changed but should not * cause negotiation to fail. * * RETURNS @@ -127,12 +127,12 @@ tp_consistency( tpcb, cmd, param ) int class_to_use = tp_mask_to_num(param->p_class); IFTRACE(D_SETPARAMS) - tptrace(TPPTmisc, - "tp_consist enter class_to_use dontchange param.class cmd", + tptrace(TPPTmisc, + "tp_consist enter class_to_use dontchange param.class cmd", class_to_use, param->p_dont_change_params, param->p_class, cmd); ENDTRACE IFDEBUG(D_SETPARAMS) - printf("tp_consistency %s %s\n", + printf("tp_consistency %s %s\n", cmd& TP_FORCE? "TP_FORCE": "", cmd& TP_STRICT? "TP_STRICT":""); ENDDEBUG @@ -140,7 +140,7 @@ tp_consistency( tpcb, cmd, param ) cmd &= ~TP_FORCE; } /* can switch net services within a domain, but - * cannot switch domains + * cannot switch domains */ switch( param->p_netservice) { case ISO_CONS: @@ -169,7 +169,7 @@ tp_consistency( tpcb, cmd, param ) } if( (param->p_class & TP_CLASSES_IMPLEMENTED) == 0 ) { error = EINVAL; goto done; - } + } IFDEBUG(D_SETPARAMS) printf("Nretrans 0x%x\n", param->p_Nretrans ); ENDDEBUG @@ -211,12 +211,12 @@ tp_consistency( tpcb, cmd, param ) } if (param->p_tpdusize > TP0_TPDUSIZE) { if (cmd & TP_STRICT) { - error = EINVAL; + error = EINVAL; } else { param->p_tpdusize = TP0_TPDUSIZE; } break; - } + } /* connect/disc data not allowed for class 0 */ if (tpcb->tp_ucddata) { @@ -228,7 +228,7 @@ tp_consistency( tpcb, cmd, param ) } } break; - + case 4: IFDEBUG(D_SETPARAMS) printf("dt_ticks 0x%x\n", param->p_dt_ticks ); @@ -240,7 +240,7 @@ tp_consistency( tpcb, cmd, param ) printf("ref 0x%x\n", param->p_ref_ticks ); ENDDEBUG if( (param->p_class & TP_CLASS_4 ) && ( - (param->p_dt_ticks < 1) || (param->p_dr_ticks < 1) || + (param->p_dt_ticks < 1) || (param->p_dr_ticks < 1) || (param->p_x_ticks < 1) || (param->p_keepalive_ticks < 1) || (param->p_sendack_ticks < 1) || (param->p_ref_ticks < 1) || (param->p_inact_ticks < 1) ) ) { @@ -250,7 +250,7 @@ tp_consistency( tpcb, cmd, param ) IFDEBUG(D_SETPARAMS) printf("rx_strat 0x%x\n", param->p_rx_strat ); ENDDEBUG - if(param->p_rx_strat > + if(param->p_rx_strat > ( TPRX_USE_CW | TPRX_EACH | TPRX_FASTSTART) ) { if(cmd & TP_STRICT) { error = EINVAL; @@ -280,12 +280,12 @@ tp_consistency( tpcb, cmd, param ) } if (param->p_tpdusize > TP_TPDUSIZE) { if(cmd & TP_STRICT) { - error = EINVAL; + error = EINVAL; } else { param->p_tpdusize = TP_TPDUSIZE; } break; - } + } break; } @@ -315,7 +315,7 @@ tp_consistency( tpcb, cmd, param ) done: IFTRACE(D_CONN) - tptrace(TPPTmisc, "tp_consist returns class xtdfmt cmd", + tptrace(TPPTmisc, "tp_consist returns class xtdfmt cmd", error, tpcb->tp_class, tpcb->tp_xtd_format, cmd); ENDTRACE IFDEBUG(D_CONN) @@ -330,7 +330,7 @@ done: * NAME: tp_ctloutput() * * CALLED FROM: - * [sg]etsockopt(), via so[sg]etopt(). + * [sg]etsockopt(), via so[sg]etopt(). * * FUNCTION and ARGUMENTS: * Implements the socket options at transport level. @@ -338,18 +338,18 @@ done: * (so) is the socket. * (level) is SOL_TRANSPORT (see ../sys/socket.h) * (optname) is the particular command or option to be set. - * (**mp) is an mbuf structure. + * (**mp) is an mbuf structure. * * RETURN VALUE: * ENOTSOCK if the socket hasn't got an associated tpcb - * EINVAL if + * EINVAL if * trying to set window too big - * trying to set illegal max tpdu size + * trying to set illegal max tpdu size * trying to set illegal credit fraction * trying to use unknown or unimplemented class of TP * structure passed to set timer values is wrong size - * illegal combination of command/GET-SET option, - * e.g., GET w/ TPOPT_CDDATA_CLEAR: + * illegal combination of command/GET-SET option, + * e.g., GET w/ TPOPT_CDDATA_CLEAR: * EOPNOTSUPP if the level isn't transport, or command is neither GET nor SET * or if the transport-specific command is not implemented * EISCONN if trying a command that isn't allowed after a connection @@ -362,7 +362,7 @@ done: * * NOTES: */ -ProtoHook +ProtoHook tp_ctloutput(cmd, so, level, optname, mp) int cmd, level, optname; struct socket *so; @@ -375,12 +375,12 @@ tp_ctloutput(cmd, so, level, optname, mp) int error = 0; IFTRACE(D_REQUEST) - tptrace(TPPTmisc, "tp_ctloutput cmd so optname mp", + tptrace(TPPTmisc, "tp_ctloutput cmd so optname mp", cmd, so, optname, mp); ENDTRACE IFDEBUG(D_REQUEST) printf( - "tp_ctloutput so 0x%x cmd 0x%x optname 0x%x, mp 0x%x *mp 0x%x tpcb 0x%x\n", + "tp_ctloutput so 0x%x cmd 0x%x optname 0x%x, mp 0x%x *mp 0x%x tpcb 0x%x\n", so, cmd, optname, mp, mp?*mp:0, tpcb); ENDDEBUG if( tpcb == (struct tp_pcb *)0 ) { @@ -408,7 +408,7 @@ tp_ctloutput(cmd, so, level, optname, mp) else if (tpcb->tp_nlproto->nlp_ctloutput == NULL) error = EOPNOTSUPP; else - return ((tpcb->tp_nlproto->nlp_ctloutput)(cmd, optname, + return ((tpcb->tp_nlproto->nlp_ctloutput)(cmd, optname, tpcb->tp_npcb, *mp)); goto done; } else if ( level == SOL_SOCKET) { @@ -425,10 +425,10 @@ tp_ctloutput(cmd, so, level, optname, mp) goto done; } else if ( level != SOL_TRANSPORT ) { error = EOPNOTSUPP; goto done; - } + } if (cmd != PRCO_GETOPT && cmd != PRCO_SETOPT) { error = EOPNOTSUPP; goto done; - } + } if ( so->so_error ) { error = so->so_error; goto done; } @@ -438,17 +438,17 @@ tp_ctloutput(cmd, so, level, optname, mp) */ if ( ((so->so_state & SS_ISCONNECTING)||(so->so_state & SS_ISCONNECTED)) && - (cmd == PRCO_SETOPT && - optname != TPOPT_DISC_DATA && - optname != TPOPT_CFRM_DATA && + (cmd == PRCO_SETOPT && + optname != TPOPT_DISC_DATA && + optname != TPOPT_CFRM_DATA && optname != TPOPT_PERF_MEAS && optname != TPOPT_CDDATA_CLEAR ) ) { error = EISCONN; goto done; - } + } /* The only options allowed after disconnection are GET DISC DATA, * and TPOPT_PSTATISTICS * and they're not allowed if the ref timer has gone off, because - * the tpcb is gone + * the tpcb is gone */ if ((so->so_state & (SS_ISCONNECTED | SS_ISCONFIRMING)) == 0) { if ( so->so_pcb == (caddr_t)0 ) { @@ -461,7 +461,7 @@ tp_ctloutput(cmd, so, level, optname, mp) } value = mtod(*mp, caddr_t); /* it's aligned, don't worry, - * but lint complains about it + * but lint complains about it */ val_len = (*mp)->m_len; @@ -534,7 +534,7 @@ tp_ctloutput(cmd, so, level, optname, mp) } else /* cmd == PRCO_SETOPT */ { if( (val_len > MAX_TSAP_SEL_LEN) || (val_len <= 0 )) { printf("val_len 0x%x (*mp)->m_len 0x%x\n", val_len, (*mp)); - error = EINVAL; + error = EINVAL; } else { bcopy(value, (caddr_t)tpcb->tp_fsuffix, val_len); tpcb->tp_fsuffixlen = val_len; @@ -544,10 +544,10 @@ tp_ctloutput(cmd, so, level, optname, mp) case TPOPT_FLAGS: IFDEBUG(D_REQUEST) - printf("%s TPOPT_FLAGS value 0x%x *value 0x%x, flags 0x%x \n", - cmd==PRCO_GETOPT?"GET":"SET", + printf("%s TPOPT_FLAGS value 0x%x *value 0x%x, flags 0x%x \n", + cmd==PRCO_GETOPT?"GET":"SET", value, - *value, + *value, tpcb->tp_flags); ENDDEBUG @@ -579,11 +579,11 @@ tp_ctloutput(cmd, so, level, optname, mp) *(struct tp_conn_param *)value = tpcb->_tp_param; (*mp)->m_len = sizeof(tpcb->_tp_param); } else /* cmd == PRCO_SETOPT */ { - if( (error = - tp_consistency(tpcb, TP_STRICT | TP_FORCE, + if( (error = + tp_consistency(tpcb, TP_STRICT | TP_FORCE, (struct tp_conn_param *)value))==0) { - /* - * tp_consistency doesn't copy the whole set of params + /* + * tp_consistency doesn't copy the whole set of params */ tpcb->_tp_param = *(struct tp_conn_param *)value; (*mp)->m_len = sizeof(tpcb->_tp_param); @@ -591,11 +591,11 @@ tp_ctloutput(cmd, so, level, optname, mp) } break; - case TPOPT_PSTATISTICS: + case TPOPT_PSTATISTICS: #ifdef TP_PERF_MEAS if (cmd == PRCO_SETOPT) { error = EINVAL; goto done; - } + } IFPERF(tpcb) if (*mp) { struct mbuf * n; @@ -605,17 +605,17 @@ tp_ctloutput(cmd, so, level, optname, mp) } while (n); } *mp = m_copym(tpcb->tp_p_mbuf, (int)M_COPYALL, M_WAITOK); - ENDPERF + ENDPERF else { error = EINVAL; goto done; - } + } break; #else error = EOPNOTSUPP; goto done; #endif /* TP_PERF_MEAS */ - - case TPOPT_CDDATA_CLEAR: + + case TPOPT_CDDATA_CLEAR: if (cmd == PRCO_GETOPT) { error = EINVAL; } else { @@ -627,25 +627,25 @@ tp_ctloutput(cmd, so, level, optname, mp) break; case TPOPT_CFRM_DATA: - case TPOPT_DISC_DATA: - case TPOPT_CONN_DATA: + case TPOPT_DISC_DATA: + case TPOPT_CONN_DATA: if( tpcb->tp_class == TP_CLASS_0 ) { error = EOPNOTSUPP; break; } IFDEBUG(D_REQUEST) printf("%s\n", optname==TPOPT_DISC_DATA?"DISC data":"CONN data"); - printf("m_len 0x%x, vallen 0x%x so_snd.cc 0x%x\n", + printf("m_len 0x%x, vallen 0x%x so_snd.cc 0x%x\n", (*mp)->m_len, val_len, so->so_snd.sb_cc); dump_mbuf(so->so_snd.sb_mb, "tp_ctloutput: sosnd "); ENDDEBUG if (cmd == PRCO_SETOPT) { int len = tpcb->tp_ucddata ? tpcb->tp_ucddata->m_len : 0; /* can append connect data in several calls */ - if (len + val_len > + if (len + val_len > (optname==TPOPT_CONN_DATA?TP_MAX_CR_DATA:TP_MAX_DR_DATA) ) { error = EMSGSIZE; goto done; - } + } (*mp)->m_next = MNULL; (*mp)->m_act = 0; if (tpcb->tp_ucddata) @@ -665,7 +665,7 @@ tp_ctloutput(cmd, so, level, optname, mp) } break; - case TPOPT_PERF_MEAS: + case TPOPT_PERF_MEAS: #ifdef TP_PERF_MEAS if (cmd == PRCO_GETOPT) { *value = (u_int)tpcb->tp_perf_on; @@ -676,7 +676,7 @@ tp_ctloutput(cmd, so, level, optname, mp) error = EINVAL; else tpcb->tp_perf_on = (*value); } - if( tpcb->tp_perf_on ) + if( tpcb->tp_perf_on ) error = tp_setup_perf(tpcb); #else /* TP_PERF_MEAS */ error = EOPNOTSUPP; @@ -686,15 +686,15 @@ tp_ctloutput(cmd, so, level, optname, mp) default: error = EOPNOTSUPP; } - + done: IFDEBUG(D_REQUEST) dump_mbuf(so->so_snd.sb_mb, "tp_ctloutput sosnd at end"); dump_mbuf(*mp, "tp_ctloutput *mp"); ENDDEBUG - /* - * sigh: getsockopt looks only at m_len : all output data must - * reside in the first mbuf + /* + * sigh: getsockopt looks only at m_len : all output data must + * reside in the first mbuf */ if (*mp) { if (cmd == PRCO_SETOPT) { diff --git a/sys/netiso/tp_param.h b/sys/netiso/tp_param.h index a9c0ff2..6b01953 100644 --- a/sys/netiso/tp_param.h +++ b/sys/netiso/tp_param.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_param.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_param.h,v 1.2 1994/08/02 07:51:19 davidg Exp $ + * $Id: tp_param.h,v 1.3 1994/08/21 06:14:26 paul Exp $ */ #ifndef _NETISO_TP_PARAM_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_param.h,v 1.2 1994/08/02 07:51:19 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_param.h,v 1.3 1994/08/21 06:14:26 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_param.h,v $ * */ @@ -92,7 +92,7 @@ extern int N_TPREF; #define TP_TPDUSIZE 0xc /* 4096 octets for classes 1-4*/ #define TP0_TPDUSIZE 0xb /* 2048 octets for class 0 */ #define TP_DFL_TPDUSIZE 0x7 /* 128 octets default */ - /* NOTE: don't ever negotiate 8192 because could get + /* NOTE: don't ever negotiate 8192 because could get * wraparound in checksumming * (No mtu is likely to be larger than 4K anyway...) */ @@ -100,10 +100,10 @@ extern int N_TPREF; #define TP_MAXRXTSHIFT 6 /* factor of 64 */ #define TP_MAXPORT 0xefff -/* ALPHA: to be used in the context: gain= 1/(2**alpha), or - * put another way, gaintimes(x) (x)>>alpha (forgetting the case alpha==0) +/* ALPHA: to be used in the context: gain= 1/(2**alpha), or + * put another way, gaintimes(x) (x)>>alpha (forgetting the case alpha==0) */ -#define TP_RTT_ALPHA 3 +#define TP_RTT_ALPHA 3 #define TP_RTV_ALPHA 2 #define TP_REXMTVAL(tpcb)\ ((tp_rttadd + (tpcb)->tp_rtt + ((tpcb)->tp_rtv) << 2) / tp_rttdiv) @@ -111,7 +111,7 @@ extern int N_TPREF; ((tv = value) > (max) ? (tv = max) : (tv < min ? tv = min : tv)) /* - * not sure how to treat data on disconnect + * not sure how to treat data on disconnect */ #define T_CONN_DATA 0x1 #define T_DISCONNECT 0x2 @@ -144,7 +144,7 @@ extern int N_TPREF; #define ACK_REORDER (1<< _ACK_REORDER_) /****************************************************** - * constants used in the protocol + * constants used in the protocol *****************************************************/ #define TP_VERSION 0x1 @@ -164,15 +164,15 @@ extern int N_TPREF; #define TP_NML_FMT_BIT 0x80 #define TP_NML_FMT_MASK 0x7f -/* - * values for the tpdu_type field, 2nd byte in a tpdu +/* + * values for the tpdu_type field, 2nd byte in a tpdu */ #define TP_MIN_TPDUTYPE 0x1 #define XPD_TPDU_type 0x1 #define XAK_TPDU_type 0x2 -#define GR_TPDU_type 0x3 +#define GR_TPDU_type 0x3 #define AK_TPDU_type 0x6 #define ER_TPDU_type 0x7 #define DR_TPDU_type 0x8 @@ -184,7 +184,7 @@ extern int N_TPREF; #define TP_MAX_TPDUTYPE 0xf /* - * identifiers for the variable-length options in tpdus + * identifiers for the variable-length options in tpdus */ #define TPP_acktime 0x85 @@ -239,10 +239,10 @@ extern int N_TPREF; #ifndef MNULL #define MNULL (struct mbuf *)0 #endif /* MNULL */ - /* if ../sys/mbuf.h gets MT_types up to 0x40, these will + /* if ../sys/mbuf.h gets MT_types up to 0x40, these will * have to be changed: */ -#define MT_XPD 0x44 +#define MT_XPD 0x44 #define MT_EOT 0x40 #define TP_ENOREF 0x80000000 @@ -272,7 +272,7 @@ typedef int ProtoHook; (diffp)->tv_usec = 1000000 - (diffp)->tv_usec;\ }\ } - + /****************************************************** * Some macros used for address families *****************************************************/ @@ -326,7 +326,7 @@ bcopy((caddr_t)&(((struct tp_vbp *)(src))->tpv_val),(caddr_t)&(dst),sizeof(type) /****************************************************** * Macro for the local credit: * uses max transmission unit for the ll - * (as modified by the max TPDU size negotiated) + * (as modified by the max TPDU size negotiated) *****************************************************/ #if defined(ARGO_DEBUG)&&!defined(LOCAL_CREDIT_EXPAND) @@ -352,7 +352,7 @@ extern int tp_rttadd, tp_rttdiv; #include <sys/syslog.h> #define printf logpri(LOG_DEBUG),addlog -#ifndef tp_NSTATES +#ifndef tp_NSTATES #include <netiso/tp_states.h> #include <netiso/tp_events.h> @@ -364,4 +364,4 @@ extern int tp_rttadd, tp_rttdiv; #endif /* tp_NSTATES */ #endif /* KERNEL */ -#endif +#endif diff --git a/sys/netiso/tp_pcb.c b/sys/netiso/tp_pcb.c index 2fe3812..da34f3f 100644 --- a/sys/netiso/tp_pcb.c +++ b/sys/netiso/tp_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_pcb.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_pcb.c,v 1.3 1994/11/15 14:23:06 bde Exp $ + * $Id: tp_pcb.c,v 1.4 1995/04/26 21:32:38 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,20 +60,20 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_pcb.c,v 1.3 1994/11/15 14:23:06 bde Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_pcb.c,v 1.4 1995/04/26 21:32:38 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_pcb.c,v $ * * - * This is the initialization and cleanup stuff - + * This is the initialization and cleanup stuff - * for the tp machine in general as well as for the individual pcbs. * tp_init() is called at system startup. tp_attach() and tp_getref() are * called when a socket is created. tp_detach() and tp_freeref() - * are called during the closing stage and/or when the reference timer - * goes off. - * tp_soisdisconnecting() and tp_soisdisconnected() are tp-specific + * are called during the closing stage and/or when the reference timer + * goes off. + * tp_soisdisconnecting() and tp_soisdisconnected() are tp-specific * versions of soisconnect* * and are called (obviously) during the closing phase. * @@ -102,10 +102,10 @@ SOFTWARE. #include <netiso/tp_seq.h> #include <netiso/tp_clnp.h> -/* ticks are in units of: +/* ticks are in units of: * 500 nano-fortnights ;-) or - * 500 ms or - * 1/2 second + * 500 ms or + * 1/2 second */ struct tp_conn_param tp_conn_param[] = { @@ -131,7 +131,7 @@ struct tp_conn_param tp_conn_param[] = { TP_TPDUSIZE, /* u_char p_tpdusize */ TPACK_WINDOW, /* 4 bits p_ack_strat */ - TPRX_USE_CW | TPRX_FASTSTART, + TPRX_USE_CW | TPRX_FASTSTART, /* 4 bits p_rx_strat*/ TP_CLASS_4 | TP_CLASS_0,/* 5 bits p_class */ 1, /* 1 bit xtd format */ @@ -166,7 +166,7 @@ struct tp_conn_param tp_conn_param[] = { TP_TPDUSIZE, /* u_char p_tpdusize */ TPACK_WINDOW, /* 4 bits p_ack_strat */ - TPRX_USE_CW | TPRX_FASTSTART, + TPRX_USE_CW | TPRX_FASTSTART, /* 4 bits p_rx_strat*/ TP_CLASS_4, /* 5 bits p_class */ 1, /* 1 bit xtd format */ @@ -197,7 +197,7 @@ struct tp_conn_param tp_conn_param[] = { 0, /* n/a */ /* short p_inact_ticks; */ /* Use tp4 defaults just in case the user changes ONLY - * the class + * the class */ (short) 100, /* short p_lcdtfract */ (short) TP0_SOCKBUFSIZE, /* short p_winsize */ @@ -238,7 +238,7 @@ struct tp_conn_param tp_conn_param[] = { TP0_TPDUSIZE, /* u_char p_tpdusize */ TPACK_WINDOW, /* 4 bits p_ack_strat */ - TPRX_USE_CW , /* No fast start */ + TPRX_USE_CW , /* No fast start */ /* 4 bits p_rx_strat*/ TP_CLASS_4 | TP_CLASS_0,/* 5 bits p_class */ 0, /* 1 bit xtd format */ @@ -257,37 +257,37 @@ struct tp_conn_param tp_conn_param[] = { int in_putnetaddr(); int in_getnetaddr(); int in_cmpnetaddr(); -int in_putsufx(); -int in_getsufx(); -int in_recycle_tsuffix(); -int tpip_mtu(); -int in_pcbbind(); -int in_pcbconnect(); +int in_putsufx(); +int in_getsufx(); +int in_recycle_tsuffix(); +int tpip_mtu(); +int in_pcbbind(); +int in_pcbconnect(); #if 0 /* XXX these are now declared as returning void in <netinet/in_pcb.h>. */ -int in_pcbdisconnect(); -int in_pcbdetach(); +int in_pcbdisconnect(); +int in_pcbdetach(); #endif -int in_pcballoc(); -int tpip_output(); -int tpip_output_dg(); +int in_pcballoc(); +int tpip_output(); +int tpip_output_dg(); struct inpcb tp_inpcb; #endif /* INET */ #ifdef ISO int iso_putnetaddr(); int iso_getnetaddr(); int iso_cmpnetaddr(); -int iso_putsufx(); -int iso_getsufx(); -int iso_recycle_tsuffix(); -int tpclnp_mtu(); -int iso_pcbbind(); -int iso_pcbconnect(); -int iso_pcbdisconnect(); -int iso_pcbdetach(); -int iso_pcballoc(); -int tpclnp_output(); -int tpclnp_output_dg(); +int iso_putsufx(); +int iso_getsufx(); +int iso_recycle_tsuffix(); +int tpclnp_mtu(); +int iso_pcbbind(); +int iso_pcbconnect(); +int iso_pcbdisconnect(); +int iso_pcbdetach(); +int iso_pcballoc(); +int tpclnp_output(); +int tpclnp_output_dg(); int iso_nlctloutput(); struct isopcb tp_isopcb; #endif /* ISO */ @@ -295,16 +295,16 @@ struct isopcb tp_isopcb; int iso_putnetaddr(); int iso_getnetaddr(); int iso_cmpnetaddr(); -int iso_putsufx(); -int iso_getsufx(); -int iso_recycle_tsuffix(); -int iso_pcbbind(); -int tpcons_pcbconnect(); +int iso_putsufx(); +int iso_getsufx(); +int iso_recycle_tsuffix(); +int iso_pcbbind(); +int tpcons_pcbconnect(); int tpclnp_mtu(); -int iso_pcbdisconnect(); -int iso_pcbdetach(); -int iso_pcballoc(); -int tpcons_output(); +int iso_pcbdisconnect(); +int iso_pcbdetach(); +int iso_pcballoc(); +int tpcons_output(); struct isopcb tp_isopcb; #endif /* TPCONS */ @@ -371,7 +371,7 @@ u_long tp_recvspace = 1024 * 4; * RETURNS: Nada * * SIDE EFFECTS: - * + * * NOTES: */ int @@ -439,7 +439,7 @@ tp_soisdisconnecting(so) * NAME: tp_soisdisconnected() * * CALLED FROM: - * tp.trans + * tp.trans * * FUNCTION and ARGUMENTS: * Set state of the socket (so) to reflect that fact that we're disconnectED @@ -474,7 +474,7 @@ tp_soisdisconnected(tpcb) bcopy ((caddr_t)ttpcb->tp_fsuffix, (caddr_t)&fsufx, sizeof(u_int) ); bcopy ((caddr_t)ttpcb->tp_lsuffix, (caddr_t)&lsufx, sizeof(u_int) ); - tpmeas(ttpcb->tp_lref, TPtime_close, + tpmeas(ttpcb->tp_lref, TPtime_close, &time, &lsufx, &fsufx, ttpcb->tp_fref); tpcb->tp_perf_on = 0; /* turn perf off */ ENDPERF @@ -497,7 +497,7 @@ tp_soisdisconnected(tpcb) * Frees the reference represented by (r) for re-use. * * RETURNS: Nothing - * + * * SIDE EFFECTS: * * NOTES: better be called at clock priority !!!!! @@ -511,7 +511,7 @@ RefNum n; tpcb = r->tpr_pcb; IFDEBUG(D_TIMER) - printf("tp_freeref called for ref %d pcb %x maxrefopen %d\n", + printf("tp_freeref called for ref %d pcb %x maxrefopen %d\n", n, tpcb, tp_refinfo.tpr_maxopen); ENDDEBUG IFTRACE(D_TIMER) @@ -545,7 +545,7 @@ RefNum n; * * FUNCTION and ARGUMENTS: * obtains the next free reference and allocates the appropriate - * ref structure, links that structure to (tpcb) + * ref structure, links that structure to (tpcb) * * RETURN VALUE: * a reference number @@ -556,7 +556,7 @@ RefNum n; * NOTES: */ u_long -tp_getref(tpcb) +tp_getref(tpcb) register struct tp_pcb *tpcb; { register struct tp_ref *r, *rlim; @@ -587,7 +587,7 @@ got_one: r->tpr_pcb = tpcb; tpcb->tp_refstate = REF_OPENING; i = r - tp_refinfo.tpr_base; - if (tp_refinfo.tpr_maxopen < i) + if (tp_refinfo.tpr_maxopen < i) tp_refinfo.tpr_maxopen = i; return (u_long)i; } @@ -663,7 +663,7 @@ tp_attach(so, protocol) tptrace(TPPTmisc, "tp_attach:dom so", dom, so, 0, 0); ENDTRACE - if (so->so_pcb != NULL) { + if (so->so_pcb != NULL) { return EISCONN; /* socket already part of a connection*/ } @@ -681,8 +681,8 @@ tp_attach(so, protocol) } bzero( (caddr_t)tpcb, sizeof (struct tp_pcb) ); - if ( ((lref = tp_getref(tpcb)) & TP_ENOREF) != 0 ) { - error = ETOOMANYREFS; + if ( ((lref = tp_getref(tpcb)) & TP_ENOREF) != 0 ) { + error = ETOOMANYREFS; goto bad3; } tpcb->tp_lref = lref; @@ -708,13 +708,13 @@ tp_attach(so, protocol) /* Spec says default is 128 octets, * that is, if the tpdusize argument never appears, use 128. * As the initiator, we will always "propose" the 2048 - * size, that is, we will put this argument in the CR + * size, that is, we will put this argument in the CR * always, but accept what the other side sends on the CC. * If the initiator sends us something larger on a CR, * we'll respond w/ this. * Our maximum is 4096. See tp_chksum.c comments. */ - tpcb->tp_cong_win = + tpcb->tp_cong_win = tpcb->tp_l_tpdusize = 1 << tpcb->tp_tpdusize; tpcb->tp_seqmask = TP_NML_FMT_MASK; @@ -764,7 +764,7 @@ bad2: * CALLED FROM: * tp.trans, on behalf of a user close request * and when the reference timer goes off - * (if the disconnect was initiated by the protocol entity + * (if the disconnect was initiated by the protocol entity * rather than by the user) * * FUNCTION and ARGUMENTS: @@ -793,7 +793,7 @@ tp_detach(tpcb) tpcb,so); ENDDEBUG IFTRACE(D_CONN) - tptraceTPCB(TPPTmisc, "tp_detach tpcb so lsufx", + tptraceTPCB(TPPTmisc, "tp_detach tpcb so lsufx", tpcb, so, *(u_short *)(tpcb->tp_lsuffix), 0); ENDTRACE @@ -825,9 +825,9 @@ tp_detach(tpcb) tpcb->tp_notdetached = 0; IFDEBUG(D_CONN) - printf("calling (...nlproto->...)(0x%x, so 0x%x)\n", + printf("calling (...nlproto->...)(0x%x, so 0x%x)\n", tpcb->tp_npcb, so); - printf("so 0x%x so_head 0x%x, qlen %d q0len %d qlimit %d\n", + printf("so 0x%x so_head 0x%x, qlen %d q0len %d qlimit %d\n", so, so->so_head, so->so_q0len, so->so_qlen, so->so_qlimit); ENDDEBUG @@ -858,11 +858,11 @@ tp_detach(tpcb) tp_freeref(tpcb->tp_lref); } #ifdef TP_PERF_MEAS - /* + /* * Get rid of the cluster mbuf allocated for performance measurements, if - * there is one. Note that tpcb->tp_perf_on says nothing about whether or - * not a cluster mbuf was allocated, so you have to check for a pointer - * to one (that is, we need the TP_PERF_MEASs around the following section + * there is one. Note that tpcb->tp_perf_on says nothing about whether or + * not a cluster mbuf was allocated, so you have to check for a pointer + * to one (that is, we need the TP_PERF_MEASs around the following section * of code, not the IFPERFs) */ if (tpcb->tp_p_mbuf) { diff --git a/sys/netiso/tp_pcb.h b/sys/netiso/tp_pcb.h index 9d32431..6322835 100644 --- a/sys/netiso/tp_pcb.h +++ b/sys/netiso/tp_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_pcb.h,v 1.3 1994/08/21 06:14:27 paul Exp $ + * $Id: tp_pcb.h,v 1.4 1995/04/26 21:32:39 pst Exp $ */ #ifndef _NETISO_TP_PCB_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,13 +63,13 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_pcb.h,v 1.3 1994/08/21 06:14:27 paul Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_pcb.h,v 1.4 1995/04/26 21:32:39 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_pcb.h,v $ * - * + * * This file defines the transport protocol control block (tpcb). * and a bunch of #define values that are used in the tpcb. */ @@ -187,7 +187,7 @@ struct tp_pcb { SeqNum tp_rcvnxt; /* next DT seq # expect to recv */ SeqNum tp_sent_lcdt; /* cdt according to last ack sent */ SeqNum tp_sent_uwe; /* uwe according to last ack sent */ - SeqNum tp_sent_rcvnxt; /* rcvnxt according to last ack sent + SeqNum tp_sent_rcvnxt; /* rcvnxt according to last ack sent * needed for perf measurements only */ u_short tp_lcredit; /* current local credit in # packets */ @@ -209,7 +209,7 @@ struct tp_pcb { /* parameters per-connection controllable by user */ - struct tp_conn_param _tp_param; + struct tp_conn_param _tp_param; #define tp_Nretrans _tp_param.p_Nretrans #define tp_dr_ticks _tp_param.p_dr_ticks @@ -263,7 +263,7 @@ struct tp_pcb { #define USES_PDN(t) (((t)->tp_flags & TPF_NLQOS_PDN) != 0) - unsigned + unsigned tp_sendfcc:1, /* shall next ack include FCC parameter? */ tp_trace:1, /* is this pcb being traced? (not used yet) */ tp_perf_on:1, /* 0/1 -> performance measuring on */ @@ -356,4 +356,4 @@ extern struct tp_pcb *tp_ftimeolist; #define tpcbtoso(tp) ((struct socket *)((tp)->tp_sock)) #define tpcbtoref(tp) ((struct tp_ref *)((tp)->tp_ref)) -#endif +#endif diff --git a/sys/netiso/tp_seq.h b/sys/netiso/tp_seq.h index 2441e6a..7b8fcd3 100644 --- a/sys/netiso/tp_seq.h +++ b/sys/netiso/tp_seq.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_seq.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_seq.h,v 1.2 1994/08/02 07:51:22 davidg Exp $ + * $Id: tp_seq.h,v 1.3 1994/08/21 06:14:28 paul Exp $ */ #ifndef _NETISO_TP_SEQ_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_seq.h,v 1.2 1994/08/02 07:51:22 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_seq.h,v 1.3 1994/08/21 06:14:28 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_seq.h,v $ * * These macros perform sequence number arithmetic modulo (2**7 or 2**31). @@ -99,7 +99,7 @@ SOFTWARE. ( ((int)((seq)-(operand)) < 0)\ ? ((-(int)((seq)-(operand))) < (int)(tpcb)->tp_seqhalf)\ : !(((int)(seq)-(operand)) < (int)(tpcb)->tp_seqhalf)) - + #define SEQ_MIN(tpcb, a, b) ( SEQ_GT(tpcb, a, b) ? b : a) #define SEQ_MAX(tpcb, a, b) ( SEQ_GT(tpcb, a, b) ? a : b) @@ -122,4 +122,4 @@ SOFTWARE. #define IN_SWINDOW(tpcb, seq, lwe, uwe)\ ( SEQ_GT(tpcb, seq, lwe) && SEQ_LEQ(tpcb, seq, uwe) ) -#endif +#endif diff --git a/sys/netiso/tp_stat.h b/sys/netiso/tp_stat.h index c5a3f3f..e7c80fd 100644 --- a/sys/netiso/tp_stat.h +++ b/sys/netiso/tp_stat.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_stat.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_stat.h,v 1.2 1994/08/02 07:51:23 davidg Exp $ + * $Id: tp_stat.h,v 1.3 1994/08/21 06:14:28 paul Exp $ */ #ifndef _NETISO_TP_STAT_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_stat.h,v 1.2 1994/08/02 07:51:23 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_stat.h,v 1.3 1994/08/21 06:14:28 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_stat.h,v $ * * Here are the data structures in which the global @@ -98,11 +98,11 @@ struct tp_stat { u_long ts_dt_ooo; /* dt tpdus received out of order */ u_long ts_dt_niw; /* dt tpdus received & not in window */ u_long ts_xpd_niw; /* xpd tpdus received & not in window */ - u_long ts_xpd_dup; + u_long ts_xpd_dup; u_long ts_dt_dup; /* dt tpdus received & are duplicates */ u_long ts_zfcdt; /* # times f credit went down to 0 */ - u_long ts_lcdt_reduced; /* + u_long ts_lcdt_reduced; /* # times local cdt reduced on an acknowledgement. */ @@ -199,30 +199,30 @@ struct tp_stat { #define IncPStat(Tpcb, X) if((Tpcb)->tp_perf_on) (Tpcb)->tp_p_meas->/**/X/**/++ /* BEWARE OF MACROS like this ^^^ must be sure it's surrounded by {} if - * it's used in an if-else statement. + * it's used in an if-else statement. */ /* for perf measurement stuff: maximum window size it can handle */ struct tp_pmeas { - /* the first few are distributions as a fn of window size + /* the first few are distributions as a fn of window size * only keep enough space for normal format plus 1 slot for * extended format, in case any windows larger than 15 are used */ - /* - * tps_npdusent: for each call to tp_sbsend, we inc the + /* + * tps_npdusent: for each call to tp_sbsend, we inc the * element representing the number of pdus sent in this call */ - int tps_win_lim_by_cdt[TP_PM_MAX+1]; - int tps_win_lim_by_data[TP_PM_MAX+1]; - /* + int tps_win_lim_by_cdt[TP_PM_MAX+1]; + int tps_win_lim_by_data[TP_PM_MAX+1]; + /* * tps_sendtime: Each call to tp_sbsend() is timed. For * Each window size, we keep the running average of the time * taken by tp_sbsend() for each window size. */ - int tps_sendtime[TP_PM_MAX+1]; + int tps_sendtime[TP_PM_MAX+1]; /* * n_TMsendack: # times ack sent because timer went off * n_ack_cuz_eot: # times ack sent due to EOTSDU on incoming packet @@ -243,13 +243,13 @@ struct tp_pmeas { * only received 6 since our last credit advertisement, we'll * keep the difference, 4, in this variable. */ - int tps_ack_early[TP_PM_MAX+1]; + int tps_ack_early[TP_PM_MAX+1]; /* * when we ack, for the # pkts we actually acked w/ this ack, * how much cdt are we advertising? * [ size of window acknowledged ] [ cdt we're giving ] */ - int tps_cdt_acked[TP_PM_MAX+1][TP_PM_MAX+1]; + int tps_cdt_acked[TP_PM_MAX+1][TP_PM_MAX+1]; int tps_AK_sent; int tps_XAK_sent; @@ -281,4 +281,4 @@ int PStat_Junk; #endif /* TP_PERF_MEAS */ -#endif +#endif diff --git a/sys/netiso/tp_subr.c b/sys/netiso/tp_subr.c index 12193a9..6125a0a 100644 --- a/sys/netiso/tp_subr.c +++ b/sys/netiso/tp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_subr.c,v 1.2 1994/08/02 07:51:25 davidg Exp $ + * $Id: tp_subr.c,v 1.3 1995/04/26 21:32:40 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_subr.c,v 1.2 1994/08/02 07:51:25 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_subr.c,v 1.3 1995/04/26 21:32:40 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_subr.c,v $ * * The main work of data transfer is done here. @@ -71,7 +71,7 @@ SOFTWARE. * They include the routines that check the validity of acks and Xacks, * (tp_goodack() and tp_goodXack() ) * take packets from socket buffers and send them (tp_send()), - * drop the data from the socket buffers (tp_sbdrop()), + * drop the data from the socket buffers (tp_sbdrop()), * and put incoming packet data into socket buffers (tp_stash()). */ @@ -107,7 +107,7 @@ void tp_send(); * CALLED FROM: * tp.trans, when an XAK arrives * FUNCTION and ARGUMENTS: - * Determines if the sequence number (seq) from the XAK + * Determines if the sequence number (seq) from the XAK * acks anything new. If so, drop the appropriate tpdu * from the XPD send queue. * RETURN VALUE: @@ -116,13 +116,13 @@ void tp_send(); int tp_goodXack(tpcb, seq) struct tp_pcb *tpcb; - SeqNum seq; + SeqNum seq; { IFTRACE(D_XPD) - tptraceTPCB(TPPTgotXack, - seq, tpcb->tp_Xuna, tpcb->tp_Xsndnxt, tpcb->tp_sndnew, - tpcb->tp_snduna); + tptraceTPCB(TPPTgotXack, + seq, tpcb->tp_Xuna, tpcb->tp_Xsndnxt, tpcb->tp_sndnew, + tpcb->tp_snduna); ENDTRACE if ( seq == tpcb->tp_Xuna ) { @@ -141,14 +141,14 @@ tp_goodXack(tpcb, seq) ENDDEBUG IFTRACE(D_XPD) - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "goodXack: dropping cc ", (int)(tpcb->tp_Xsnd.sb_cc), 0,0,0); ENDTRACE sbdroprecord(&tpcb->tp_Xsnd); return 1; - } + } return 0; } @@ -194,7 +194,7 @@ register struct tp_pcb *tpcb; if ((tpcb->tp_rtv += ((delta - tpcb->tp_rtv) >> TP_RTV_ALPHA)) <= 0) tpcb->tp_rtv = 1; } else { - /* + /* * No rtt measurement yet - use the unsmoothed rtt. * Set the variance to half the rtt (so our first * retransmit happens at 3*rtt) @@ -228,7 +228,7 @@ register struct tp_pcb *tpcb; * CALLED FROM: * tp.trans when an AK arrives * FUNCTION and ARGUMENTS: - * Given (cdt), the credit from the AK tpdu, and + * Given (cdt), the credit from the AK tpdu, and * (seq), the sequence number from the AK tpdu, * tp_goodack() determines if the AK acknowledges something in the send * window, and if so, drops the appropriate packets from the retransmission @@ -250,7 +250,7 @@ tp_goodack(tpcb, cdt, seq, subseq) register SeqNum seq; u_int subseq; { - int old_fcredit; + int old_fcredit; int bang = 0; /* bang --> ack for something heretofore unacked */ u_int bytes_acked; @@ -259,8 +259,8 @@ tp_goodack(tpcb, cdt, seq, subseq) tpcb, seq, cdt, tpcb->tp_snduna, tpcb->tp_sndnew, tpcb->tp_sndnxt); ENDDEBUG IFTRACE(D_ACKRECV) - tptraceTPCB(TPPTgotack, - seq,cdt, tpcb->tp_snduna,tpcb->tp_sndnew,subseq); + tptraceTPCB(TPPTgotack, + seq,cdt, tpcb->tp_snduna,tpcb->tp_sndnew,subseq); ENDTRACE IFPERF(tpcb) @@ -379,7 +379,7 @@ tp_goodack(tpcb, cdt, seq, subseq) tpcb->tp_sndnxt_m = 0; } bang++; - } + } if( cdt != 0 && old_fcredit == 0 ) { tpcb->tp_sendfcc = 1; @@ -417,7 +417,7 @@ done: * drops everything up TO but not INCLUDING seq # (seq) * from the retransmission queue. */ -tp_sbdrop(tpcb, seq) +tp_sbdrop(tpcb, seq) register struct tp_pcb *tpcb; SeqNum seq; { @@ -469,7 +469,7 @@ tp_send(tpcb) int idle, idleticks, off, cong_win; #ifdef TP_PERF_MEAS int send_start_time = ticks; - SeqNum oldnxt = tpcb->tp_sndnxt; + SeqNum oldnxt = tpcb->tp_sndnxt; #endif /* TP_PERF_MEAS */ idle = (tpcb->tp_snduna == tpcb->tp_sndnew); @@ -488,19 +488,19 @@ tp_send(tpcb) highseq = SEQ(tpcb, tpcb->tp_fcredit + tpcb->tp_snduna); if (tpcb->tp_Xsnd.sb_mb) highseq = SEQ_MIN(tpcb, highseq, tpcb->tp_sndnew); - + IFDEBUG(D_DATA) printf("tp_send enter tpcb 0x%x nxt 0x%x win %d high 0x%x\n", tpcb, tpcb->tp_sndnxt, cong_win, highseq); ENDDEBUG IFTRACE(D_DATA) - tptraceTPCB( TPPTmisc, "tp_send sndnew snduna", + tptraceTPCB( TPPTmisc, "tp_send sndnew snduna", tpcb->tp_sndnew, tpcb->tp_snduna, 0, 0); - tptraceTPCB( TPPTmisc, "tp_send tpcb->tp_sndnxt win fcredit congwin", + tptraceTPCB( TPPTmisc, "tp_send tpcb->tp_sndnxt win fcredit congwin", tpcb->tp_sndnxt, cong_win, tpcb->tp_fcredit, tpcb->tp_cong_win); ENDTRACE IFTRACE(D_DATA) - tptraceTPCB( TPPTmisc, "tp_send 2 nxt high fcredit congwin", + tptraceTPCB( TPPTmisc, "tp_send 2 nxt high fcredit congwin", tpcb->tp_sndnxt, highseq, tpcb->tp_fcredit, cong_win); ENDTRACE @@ -527,7 +527,7 @@ send: len < (tpcb->tp_l_tpdusize / 2)) break; /* Nagle . . . . . */ cong_win -= len; - /* make a copy - mb goes into the retransmission list + /* make a copy - mb goes into the retransmission list * while m gets emitted. m_copy won't copy a zero-length mbuf. */ mb = m; @@ -535,8 +535,8 @@ send: if (m == MNULL) break; IFTRACE(D_STASH) - tptraceTPCB( TPPTmisc, - "tp_send mcopy nxt high eotsdu len", + tptraceTPCB( TPPTmisc, + "tp_send mcopy nxt high eotsdu len", tpcb->tp_sndnxt, highseq, eotsdu, len); ENDTRACE @@ -591,11 +591,11 @@ send: npkts = SEQ_SUB(tpcb, tpcb->tp_sndnxt, oldnxt); - if (npkts > 0) + if (npkts > 0) tpcb->tp_Nwindow++; - if (npkts > TP_PM_MAX) - npkts = TP_PM_MAX; + if (npkts > TP_PM_MAX) + npkts = TP_PM_MAX; t = &(tpcb->tp_p_meas->tps_sendtime[npkts]); *t += (t - elapsed) >> TP_RTT_ALPHA; @@ -608,7 +608,7 @@ send: } now.tv_sec = elapsed / hz; now.tv_usec = (elapsed - (hz * now.tv_sec)) * 1000000 / hz; - tpmeas( tpcb->tp_lref, + tpmeas( tpcb->tp_lref, TPsbsend, &elapsed, newseq, tpcb->tp_Nwindow, npkts); } ENDPERF @@ -616,10 +616,10 @@ send: IFTRACE(D_DATA) - tptraceTPCB( TPPTmisc, + tptraceTPCB( TPPTmisc, "tp_send at end: new nxt eotsdu error", tpcb->tp_sndnew, tpcb->tp_sndnxt, eotsdu, tpcb->tp_sock->so_error); - + ENDTRACE } @@ -633,7 +633,7 @@ int eotsdu; { register struct mbuf *n; register struct sockbuf *sb = &tpcb->tp_sock->so_snd; - int maxsize = tpcb->tp_l_tpdusize + int maxsize = tpcb->tp_l_tpdusize - tp_headersize(DT_TPDU_type, tpcb) - (tpcb->tp_use_checksum?4:0) ; int totlen = m->m_pkthdr.len; @@ -707,18 +707,18 @@ out: * CALLED FROM: * tp.trans on arrival of a DT tpdu * FUNCTION, ARGUMENTS, and RETURN VALUE: - * Returns 1 if + * Returns 1 if * a) something new arrived and it's got eotsdu_reached bit on, * b) this arrival was caused other out-of-sequence things to be * accepted, or * c) this arrival is the highest seq # for which we last gave credit * (sender just sent a whole window) - * In other words, returns 1 if tp should send an ack immediately, 0 if + * In other words, returns 1 if tp should send an ack immediately, 0 if * the ack can wait a while. * * Note: this implementation no longer renegs on credit, (except * when debugging option D_RENEG is on, for the purpose of testing - * ack subsequencing), so we don't need to check for incoming tpdus + * ack subsequencing), so we don't need to check for incoming tpdus * being in a reneged portion of the window. */ @@ -741,7 +741,7 @@ tp_stash(tpcb, e) n->m_act = 0; } IFDEBUG(D_STASH) - dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, + dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, "stash: so_rcv before appending"); dump_mbuf(E.e_data, "stash: e_data before appending"); @@ -756,12 +756,12 @@ tp_stash(tpcb, e) if (E.e_seq == tpcb->tp_rcvnxt) { IFDEBUG(D_STASH) - printf("stash EQ: seq 0x%x datalen 0x%x eot 0x%x\n", + printf("stash EQ: seq 0x%x datalen 0x%x eot 0x%x\n", E.e_seq, E.e_datalen, E.e_eot); ENDDEBUG IFTRACE(D_STASH) - tptraceTPCB(TPPTmisc, "stash EQ: seq len eot", + tptraceTPCB(TPPTmisc, "stash EQ: seq len eot", E.e_seq, E.e_datalen, E.e_eot, 0); ENDTRACE @@ -770,7 +770,7 @@ tp_stash(tpcb, e) sbappend(&tpcb->tp_sock->so_rcv, E.e_data); SEQ_INC( tpcb, tpcb->tp_rcvnxt ); - /* + /* * move chains from the reassembly queue to the socket buffer */ if (tpcb->tp_rsycnt) { @@ -791,7 +791,7 @@ tp_stash(tpcb, e) } } IFDEBUG(D_STASH) - dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, + dump_mbuf(tpcb->tp_sock->so_rcv.sb_mb, "stash: so_rcv after appending"); ENDDEBUG @@ -800,7 +800,7 @@ tp_stash(tpcb, e) SeqNum uwe; IFTRACE(D_STASH) - tptraceTPCB(TPPTmisc, "stash Reseq: seq rcvnxt lcdt", + tptraceTPCB(TPPTmisc, "stash Reseq: seq rcvnxt lcdt", E.e_seq, tpcb->tp_rcvnxt, tpcb->tp_lcredit, 0); ENDTRACE @@ -838,9 +838,9 @@ tp_stash(tpcb, e) ack_reason |= ACK_STRAT_FULLWIN; IFTRACE(D_STASH) - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "end of stash, eot, ack_reason, sent_uwe ", - E.e_eot, ack_reason, tpcb->tp_sent_uwe, 0); + E.e_eot, ack_reason, tpcb->tp_sent_uwe, 0); ENDTRACE if ( ack_reason == ACK_DONT ) { @@ -855,7 +855,7 @@ tp_stash(tpcb, e) } else if(ack_reason & ACK_REORDER) { IncPStat(tpcb, tps_n_ack_cuz_reorder); } - tpmeas(tpcb->tp_lref, TPtime_ack_sent, 0, + tpmeas(tpcb->tp_lref, TPtime_ack_sent, 0, SEQ_ADD(tpcb, E.e_seq, 1), 0, 0); ENDPERF { @@ -863,7 +863,7 @@ tp_stash(tpcb, e) /* keep track of all reasons that apply */ for( i=1; i<_ACK_NUM_REASONS_ ;i++) { - if( ack_reason & (1<<i) ) + if( ack_reason & (1<<i) ) IncStat( ts_ackreason[i] ); } } diff --git a/sys/netiso/tp_subr2.c b/sys/netiso/tp_subr2.c index 6928049..943d11b 100644 --- a/sys/netiso/tp_subr2.c +++ b/sys/netiso/tp_subr2.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_subr2.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_subr2.c,v 1.2 1994/08/02 07:51:26 davidg Exp $ + * $Id: tp_subr2.c,v 1.3 1995/04/26 21:32:41 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_subr2.c,v 1.2 1994/08/02 07:51:26 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_subr2.c,v 1.3 1995/04/26 21:32:41 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_subr2.c,v $ * * Some auxiliary routines: @@ -134,7 +134,7 @@ void tp_rsyset(); * SIDE EFFECTS: * * NOTES: - * This doesn't actually get called in a production system - + * This doesn't actually get called in a production system - * the macro gets expanded instead in place of calls to this proc. * But for debugging, we call this and that allows us to add * debugging messages easily here. @@ -146,10 +146,10 @@ tp_local_credit(tpcb) LOCAL_CREDIT(tpcb); IFDEBUG(D_CREDIT) printf("ref 0x%x lcdt 0x%x l_tpdusize 0x%x decbit 0x%x\n", - tpcb->tp_lref, - tpcb->tp_lcredit, - tpcb->tp_l_tpdusize, - tpcb->tp_decbit, + tpcb->tp_lref, + tpcb->tp_lcredit, + tpcb->tp_l_tpdusize, + tpcb->tp_decbit, tpcb->tp_cong_win ); ENDDEBUG @@ -168,7 +168,7 @@ tp_local_credit(tpcb) * a combo of event, state, predicate * * FUNCTION and ARGUMENTS: - * print error mesg + * print error mesg * * RETURN VALUE: * EIO - always @@ -215,30 +215,30 @@ tp_drain() * attached to the tpcb. * * RETURNS: Rien - * + * * SIDE EFFECTS: * * NOTES: */ void tp_indicate(ind, tpcb, error) - int ind; + int ind; u_short error; register struct tp_pcb *tpcb; { register struct socket *so = tpcb->tp_sock; IFTRACE(D_INDICATION) - tptraceTPCB(TPPTindicate, ind, *(u_short *)(tpcb->tp_lsuffix), + tptraceTPCB(TPPTindicate, ind, *(u_short *)(tpcb->tp_lsuffix), *(u_short *)(tpcb->tp_fsuffix), error,so->so_pgid); ENDTRACE IFDEBUG(D_INDICATION) char *ls, *fs; - ls = tpcb->tp_lsuffix, - fs = tpcb->tp_fsuffix, + ls = tpcb->tp_lsuffix, + fs = tpcb->tp_fsuffix, printf( "indicate 0x%x lsuf 0x%02x%02x fsuf 0x%02x%02x err 0x%x noind 0x%x ref 0x%x\n", - ind, + ind, *ls, *(ls+1), *fs, *(fs+1), error, /*so->so_pgrp,*/ tpcb->tp_no_disc_indications, @@ -280,15 +280,15 @@ tp_indicate(ind, tpcb, error) * NAME : tp_getoptions() * * CALLED FROM: - * tp.trans whenever we go into OPEN state + * tp.trans whenever we go into OPEN state * * FUNCTION and ARGUMENTS: * sets the proper flags and values in the tpcb, to control * the appropriate actions for the given class, options, * sequence space, etc, etc. - * + * * RETURNS: Nada - * + * * SIDE EFFECTS: * * NOTES: @@ -297,7 +297,7 @@ void tp_getoptions(tpcb) struct tp_pcb *tpcb; { - tpcb->tp_seqmask = + tpcb->tp_seqmask = tpcb->tp_xtd_format ? TP_XTD_FMT_MASK : TP_NML_FMT_MASK ; tpcb->tp_seqbit = tpcb->tp_xtd_format ? TP_XTD_FMT_BIT : TP_NML_FMT_BIT ; @@ -305,7 +305,7 @@ struct tp_pcb *tpcb; tpcb->tp_dt_ticks = max(tpcb->tp_dt_ticks, (tpcb->tp_peer_acktime + 2)); tp_rsyset(tpcb); - + } /* @@ -315,7 +315,7 @@ struct tp_pcb *tpcb; * Called when a ref is frozen. * * FUNCTION and ARGUMENTS: - * allows the suffix to be reused. + * allows the suffix to be reused. * * RETURNS: zilch * @@ -345,20 +345,20 @@ tp_recycle_tsuffix(tpcb) * Congestion window scheme: * Initial value is 1. ("slow start" as Nagle, et. al. call it) * For each good ack that arrives, the congestion window is increased - * by 1 (up to max size of logical infinity, which is to say, + * by 1 (up to max size of logical infinity, which is to say, * it doesn't wrap around). * Source quench causes it to drop back to 1. - * tp_send() uses the smaller of (regular window, congestion window). - * One retransmission strategy option is to have any retransmission + * tp_send() uses the smaller of (regular window, congestion window). + * One retransmission strategy option is to have any retransmission * cause reset the congestion window back to 1. * * (cmd) is either PRC_QUENCH: source quench, or * PRC_QUENCH2: dest. quench (dec bit) * * RETURNS: - * + * * SIDE EFFECTS: - * + * * NOTES: */ void @@ -389,15 +389,15 @@ tp_quench( tpcb, cmd ) /* * NAME: tp_netcmd() * - * CALLED FROM: + * CALLED FROM: * - * FUNCTION and ARGUMENTS: + * FUNCTION and ARGUMENTS: * - * RETURNS: + * RETURNS: * - * SIDE EFFECTS: + * SIDE EFFECTS: * - * NOTES: + * NOTES: */ tp_netcmd( tpcb, cmd ) struct tp_pcb *tpcb; @@ -467,7 +467,7 @@ tp_mask_to_num(x) return j; } -static +static copyQOSparms(src, dst) struct tp_conn_param *src, *dst; { @@ -598,15 +598,15 @@ punt_route: /* * CALLED FROM: * tp_usrreq on PRU_CONNECT and tp_input on receipt of CR - * + * * FUNCTION and ARGUMENTS: * -- An mbuf containing the peer's network address. * -- Our control block, which will be modified * -- In the case of cons, a control block for that layer. * - * + * * RETURNS: - * errno value : + * errno value : * EAFNOSUPPORT if can't find an nl_protosw for x.25 (really could panic) * ECONNREFUSED if trying to run TP0 with non-type 37 address * possibly other E* returned from cons_netcmd() @@ -629,13 +629,13 @@ tp_route_to( m, tpcb, channel) siso = mtod(m, struct sockaddr_iso *); IFTRACE(D_CONN) - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "route_to: so afi netservice class", tpcb->tp_sock, siso->siso_addr.isoa_genaddr[0], tpcb->tp_netservice, tpcb->tp_class); ENDTRACE IFDEBUG(D_CONN) - printf("tp_route_to( m x%x, channel 0x%x, tpcb 0x%x netserv 0x%x)\n", + printf("tp_route_to( m x%x, channel 0x%x, tpcb 0x%x netserv 0x%x)\n", m, channel, tpcb, tpcb->tp_netservice); printf("m->mlen x%x, m->m_data:\n", m->m_len); dump_buf(mtod(m, caddr_t), m->m_len); @@ -685,7 +685,7 @@ tp_route_to( m, tpcb, channel) } if (tpcb->tp_nlproto->nlp_afamily != siso->siso_family) { IFDEBUG(D_CONN) - printf("tp_route_to( CHANGING nlproto old 0x%x new 0x%x)\n", + printf("tp_route_to( CHANGING nlproto old 0x%x new 0x%x)\n", save_netservice, tpcb->tp_netservice); ENDDEBUG if (error = tp_set_npcb(tpcb)) @@ -707,7 +707,7 @@ done: printf("tp_route_to returns 0x%x\n", error); ENDDEBUG IFTRACE(D_CONN) - tptraceTPCB(TPPTmisc, "route_to: returns: error netserv class", error, + tptraceTPCB(TPPTmisc, "route_to: returns: error netserv class", error, tpcb->tp_netservice, tpcb->tp_class, 0); ENDTRACE return error; @@ -736,12 +736,12 @@ tp0_stash( tpcb, e ) ENDPERF IFDEBUG(D_STASH) - printf("stash EQ: seq 0x%x datalen 0x%x eot 0x%x", + printf("stash EQ: seq 0x%x datalen 0x%x eot 0x%x", E.e_seq, E.e_datalen, E.e_eot); ENDDEBUG IFTRACE(D_STASH) - tptraceTPCB(TPPTmisc, "stash EQ: seq len eot", + tptraceTPCB(TPPTmisc, "stash EQ: seq len eot", E.e_seq, E.e_datalen, E.e_eot, 0); ENDTRACE @@ -760,7 +760,7 @@ tp0_stash( tpcb, e ) register struct pklcd *lcp = (struct pklcd *)isop->isop_chan; pk_flowcontrol(lcp, sbspace(sb) <= 0, 1); } -} +} void tp0_openflow(tpcb) @@ -784,7 +784,7 @@ pk_flowcontrol() {} /* * CALLED FROM: * tp_ctloutput() when the user sets TPOPT_PERF_MEAS on - * and tp_newsocket() when a new connection is made from + * and tp_newsocket() when a new connection is made from * a listening socket with tp_perf_on == true. * FUNCTION and ARGUMENTS: * (tpcb) is the usual; this procedure gets a clear cluster mbuf for @@ -793,7 +793,7 @@ pk_flowcontrol() {} * ENOBUFS if it cannot get a cluster mbuf. */ -int +int tp_setup_perf(tpcb) register struct tp_pcb *tpcb; { @@ -814,8 +814,8 @@ tp_setup_perf(tpcb) bzero( (caddr_t)tpcb->tp_p_meas, sizeof (struct tp_pmeas) ); IFDEBUG(D_PERF_MEAS) printf( - "tpcb 0x%x so 0x%x ref 0x%x tp_p_meas 0x%x tp_perf_on 0x%x\n", - tpcb, tpcb->tp_sock, tpcb->tp_lref, + "tpcb 0x%x so 0x%x ref 0x%x tp_p_meas 0x%x tp_perf_on 0x%x\n", + tpcb, tpcb->tp_sock, tpcb->tp_lref, tpcb->tp_p_meas, tpcb->tp_perf_on); ENDDEBUG tpcb->tp_perf_on = 1; diff --git a/sys/netiso/tp_timer.c b/sys/netiso/tp_timer.c index 34fa0cc..6ccc615 100644 --- a/sys/netiso/tp_timer.c +++ b/sys/netiso/tp_timer.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_timer.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tp_timer.c,v 1.2 1994/08/02 07:51:27 davidg Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_timer.c,v 1.1.1.1 1994/05/24 10:06:44 rgrimes Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_timer.c,v 1.2 1994/08/02 07:51:27 davidg Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_timer.c,v $ * */ @@ -92,7 +92,7 @@ struct tp_pcb *tp_ftimeolist = (struct tp_pcb *)&tp_ftimeolist; /* * CALLED FROM: - * at autoconfig time from tp_init() + * at autoconfig time from tp_init() * a combo of event, state, predicate * FUNCTION and ARGUMENTS: * initialize data structures for the timers @@ -197,7 +197,7 @@ tp_slowtimo() IncStat(ts_Cticks); /* tp_ref[0] is never used */ for (rp = tp_ref + tp_refinfo.tpr_maxopen; rp > tp_ref; rp--) { - if ((tpcb = rp->tpr_pcb) == 0 || tpcb->tp_refstate < REF_OPEN) + if ((tpcb = rp->tpr_pcb) == 0 || tpcb->tp_refstate < REF_OPEN) continue; /* check the timers */ for (t = 0; t < TM_NTIMERS; t++) { @@ -309,11 +309,11 @@ tp_fasttimo() void tp_ctimeout(tpcb, which, ticks) register struct tp_pcb *tpcb; - int which, ticks; + int which, ticks; { IFTRACE(D_TIMER) - tptrace(TPPTmisc, "tp_ctimeout ref which tpcb active", + tptrace(TPPTmisc, "tp_ctimeout ref which tpcb active", tpcb->tp_lref, which, tpcb, tpcb->tp_timer[which]); ENDTRACE if(tpcb->tp_timer[which]) @@ -326,18 +326,18 @@ tp_ctimeout(tpcb, which, ticks) /* * CALLED FROM: - * tp.trans + * tp.trans * FUNCTION and ARGUMENTS: - * Version of tp_ctimeout that resets the C-type time if the + * Version of tp_ctimeout that resets the C-type time if the * parameter (ticks) is > the current value of the timer. */ void tp_ctimeout_MIN(tpcb, which, ticks) register struct tp_pcb *tpcb; - int which, ticks; + int which, ticks; { IFTRACE(D_TIMER) - tptrace(TPPTmisc, "tp_ctimeout_MIN ref which tpcb active", + tptrace(TPPTmisc, "tp_ctimeout_MIN ref which tpcb active", tpcb->tp_lref, which, tpcb, tpcb->tp_timer[which]); ENDTRACE IncStat(ts_Cset); @@ -365,7 +365,7 @@ tp_cuntimeout(tpcb, which) ENDDEBUG IFTRACE(D_TIMER) - tptrace(TPPTmisc, "tp_cuntimeout ref which, active", refp-tp_ref, + tptrace(TPPTmisc, "tp_cuntimeout ref which, active", refp-tp_ref, which, tpcb->tp_timer[which], 0); ENDTRACE diff --git a/sys/netiso/tp_timer.h b/sys/netiso/tp_timer.h index 0ee6182..0894480 100644 --- a/sys/netiso/tp_timer.h +++ b/sys/netiso/tp_timer.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_timer.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_timer.h,v 1.2 1994/08/02 07:51:28 davidg Exp $ + * $Id: tp_timer.h,v 1.3 1994/08/21 06:14:30 paul Exp $ */ #ifndef _NETISO_TP_TIMER_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_timer.h,v 1.2 1994/08/02 07:51:28 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_timer.h,v 1.3 1994/08/21 06:14:30 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_timer.h,v $ * * ARGO TP @@ -91,4 +91,4 @@ SOFTWARE. { if((p)->tp_timer[w] > (t)) (p)->tp_timer[w] = (t);} #endif /* TP_DEBUG_TIMERS */ -#endif +#endif diff --git a/sys/netiso/tp_tpdu.h b/sys/netiso/tp_tpdu.h index c281ecf..c9a3679 100644 --- a/sys/netiso/tp_tpdu.h +++ b/sys/netiso/tp_tpdu.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_tpdu.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_tpdu.h,v 1.2 1994/08/02 07:51:29 davidg Exp $ + * $Id: tp_tpdu.h,v 1.3 1994/08/21 06:14:31 paul Exp $ */ #ifndef _NETISO_TP_TPDU_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,10 +63,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_tpdu.h,v 1.2 1994/08/02 07:51:29 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_tpdu.h,v 1.3 1994/08/21 06:14:31 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_tpdu.h,v $ * * This ghastly set of macros makes it possible to @@ -110,7 +110,7 @@ struct tpdu_fixed { #define tpdu_type _tpduf._tpduf_type #define tpdu_cdt _tpduf._tpduf_cdt #define tpdu_dref _tpduf._tpduf_dref - + struct tp0du { u_char _tp0_li, _tp0_cdt_type, /* same as in tpdu_fixed */ @@ -127,10 +127,10 @@ struct tp0du { #define tp0du_eot _tp0_eot #define tp0du_mbz _tp0_mbz - + /* * This is used when the extended format seqence numbers are - * being sent and received. + * being sent and received. */ /* * the seqeot field is an int that overlays the seq @@ -294,4 +294,4 @@ struct tpdu { union tpdu_fixed_rest _tpdufr; }; -#endif +#endif diff --git a/sys/netiso/tp_trace.c b/sys/netiso/tp_trace.c index 20a40ea..a6f64ef 100644 --- a/sys/netiso/tp_trace.c +++ b/sys/netiso/tp_trace.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_trace.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_trace.c,v 1.2 1994/08/02 07:51:30 davidg Exp $ + * $Id: tp_trace.c,v 1.3 1995/04/26 21:32:41 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_trace.c,v 1.2 1994/08/02 07:51:30 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_trace.c,v 1.3 1995/04/26 21:32:41 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_trace.c,v $ * * The whole protocol trace module. @@ -110,7 +110,7 @@ tpTrace(tpcb, event, arg, src, len, arg4, arg5) struct tp_pcb *tpcb; u_int event, arg; u_int src; - u_int len; + u_int len; u_int arg4; u_int arg5; { @@ -137,27 +137,27 @@ tpTrace(tpcb, event, arg, src, len, arg4, arg5) case TPPTmisc: /* arg is a string */ - bcopy((caddr_t)arg, (caddr_t)tp->tpt_str, + bcopy((caddr_t)arg, (caddr_t)tp->tpt_str, (unsigned)MIN(1+strlen((caddr_t) arg), TPTRACE_STRLEN)); - tp->tpt_m2 = src; + tp->tpt_m2 = src; tp->tpt_m3 = len; tp->tpt_m4 = arg4; tp->tpt_m1 = arg5; break; - case TPPTgotXack: - case TPPTXack: - case TPPTsendack: - case TPPTgotack: - case TPPTack: - case TPPTindicate: + case TPPTgotXack: + case TPPTXack: + case TPPTsendack: + case TPPTgotack: + case TPPTack: + case TPPTindicate: default: - case TPPTdriver: - tp->tpt_m2 = arg; + case TPPTdriver: + tp->tpt_m2 = arg; tp->tpt_m3 = src; tp->tpt_m4 = len; tp->tpt_m5 = arg4; - tp->tpt_m1 = arg5; + tp->tpt_m1 = arg5; break; case TPPTparam: bcopy((caddr_t)src, (caddr_t)&tp->tpt_param, sizeof(struct tp_param)); diff --git a/sys/netiso/tp_trace.h b/sys/netiso/tp_trace.h index fb5365f..b2dd01c 100644 --- a/sys/netiso/tp_trace.h +++ b/sys/netiso/tp_trace.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_trace.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_trace.h,v 1.2 1994/08/02 07:51:31 davidg Exp $ + * $Id: tp_trace.h,v 1.3 1994/08/21 06:14:32 paul Exp $ */ #ifndef _NETISO_TP_TRACE_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,13 +63,13 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_trace.h,v 1.2 1994/08/02 07:51:31 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_trace.h,v 1.3 1994/08/21 06:14:32 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_trace.h,v $ * - * + * * Definitions needed for the protocol trace mechanism. */ @@ -171,7 +171,7 @@ int tp_Tracen = 0; #define IFTRACE(ascii)\ if(tp_traceflags[ascii]) { -/* +/* * for some reason lint complains about tp_param being undefined no * matter where or how many times I define it. */ @@ -193,4 +193,4 @@ int tp_Tracen = 0; #endif /* TPPT */ -#endif +#endif diff --git a/sys/netiso/tp_user.h b/sys/netiso/tp_user.h index 3916865..bc86c2e 100644 --- a/sys/netiso/tp_user.h +++ b/sys/netiso/tp_user.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_user.h 8.1 (Berkeley) 6/10/93 - * $Id: tp_user.h,v 1.2 1994/08/02 07:51:32 davidg Exp $ + * $Id: tp_user.h,v 1.3 1994/08/21 06:14:32 paul Exp $ */ #ifndef _NETISO_TP_USER_H_ @@ -42,13 +42,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -63,13 +63,13 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_user.h,v 1.2 1994/08/02 07:51:32 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_user.h,v 1.3 1994/08/21 06:14:32 paul Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_user.h,v $ * - * These are the values a real-live user ;-) needs. + * These are the values a real-live user ;-) needs. */ #ifndef _TYPES_ @@ -78,7 +78,7 @@ SOFTWARE. struct tp_conn_param { /* PER CONNECTION parameters */ - short p_Nretrans; + short p_Nretrans; short p_dr_ticks; short p_cc_ticks; @@ -129,12 +129,12 @@ struct tp_conn_param { #define TPOPT_INTERCEPT 0x200 #define TPOPT_FLAGS 0x300 -#define TPOPT_CONN_DATA 0x400 -#define TPOPT_DISC_DATA 0x500 -#define TPOPT_CFRM_DATA 0x600 -#define TPOPT_CDDATA_CLEAR 0x700 -#define TPOPT_MY_TSEL 0x800 -#define TPOPT_PEER_TSEL 0x900 +#define TPOPT_CONN_DATA 0x400 +#define TPOPT_DISC_DATA 0x500 +#define TPOPT_CFRM_DATA 0x600 +#define TPOPT_CDDATA_CLEAR 0x700 +#define TPOPT_MY_TSEL 0x800 +#define TPOPT_PEER_TSEL 0x900 #define TPOPT_PERF_MEAS 0xa00 #define TPOPT_PSTATISTICS 0xb00 #define TPOPT_PARAMS 0xc00 /* to replace a bunch of the others */ @@ -145,7 +145,7 @@ struct tp_disc_reason { u_int dr_reason; }; -/* +/* ***********************flags********************************** */ @@ -155,7 +155,7 @@ struct tp_disc_reason { #define TPFLAG_GENERAL_ADDR (u_char)0x04 /* bound to wildcard addr */ -/* +/* ***********************end flags****************************** */ diff --git a/sys/netiso/tp_usrreq.c b/sys/netiso/tp_usrreq.c index 4532770..13948e8 100644 --- a/sys/netiso/tp_usrreq.c +++ b/sys/netiso/tp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tp_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: tp_usrreq.c,v 1.2 1994/08/02 07:51:33 davidg Exp $ + * $Id: tp_usrreq.c,v 1.3 1995/04/26 21:32:42 pst Exp $ */ /*********************************************************** @@ -39,13 +39,13 @@ All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -60,10 +60,10 @@ SOFTWARE. /* * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison */ -/* +/* * ARGO TP * - * $Header: /home/ncvs/src/sys/netiso/tp_usrreq.c,v 1.2 1994/08/02 07:51:33 davidg Exp $ + * $Header: /home/ncvs/src/sys/netiso/tp_usrreq.c,v 1.3 1995/04/26 21:32:42 pst Exp $ * $Source: /home/ncvs/src/sys/netiso/tp_usrreq.c,v $ * * tp_usrreq(), the fellow that gets called from most of the socket code. @@ -121,7 +121,7 @@ dump_mbuf(n, str) printf("EMPTY:\n"); return; } - + while (n) { nextrecord = n->m_act; printf("RECORD:\n"); @@ -199,7 +199,7 @@ restart: } /* Take the first mbuf off the chain. - * Each XPD TPDU gives you a complete TSDU so the chains don't get + * Each XPD TPDU gives you a complete TSDU so the chains don't get * coalesced, but one TSDU may span several mbufs. * Nevertheless, since n should have a most 16 bytes, it * will fit into m. (size was checked in tp_input() ) @@ -209,7 +209,7 @@ restart: * Code for excision of OOB data should be added to * uipc_socket2.c (like sbappend). */ - + sblock(sb, M_WAITOK); for (nn = &sb->sb_mb; n = *nn; nn = &n->m_act) if (n->m_type == MT_OOBDATA) @@ -247,7 +247,7 @@ restart: if ((inflags & MSG_PEEK) == 0) { n = *nn; *nn = n->m_act; - for (; n; n = m_free(n)) + for (; n; n = m_free(n)) sbfree(sb, n); } @@ -259,7 +259,7 @@ release: tpcb->tp_Xrcv.sb_cc, m->m_len, 0, 0); ENDTRACE if (error == 0) - error = DoEvent(T_USR_Xrcvd); + error = DoEvent(T_USR_Xrcvd); return error; } @@ -290,7 +290,7 @@ tp_sendoob(tpcb, so, xdata, outflags) * mbuf (mark) into the DATA queue, with its sequence number in m_next * to be assigned to this XPD tpdu, so data xfer can stop * when it reaches the zero-length mbuf if this XPD TPDU hasn't - * yet been acknowledged. + * yet been acknowledged. */ register struct sockbuf *sb = &(tpcb->tp_Xsnd); register struct mbuf *xmark; @@ -302,7 +302,7 @@ tp_sendoob(tpcb, so, xdata, outflags) if (xdata) printf("xdata len 0x%x\n", xdata->m_len); ENDDEBUG - /* DO NOT LOCK the Xsnd buffer!!!! You can have at MOST one + /* DO NOT LOCK the Xsnd buffer!!!! You can have at MOST one * socket buf locked at any time!!! (otherwise you might * sleep() in sblock() w/ a signal pending and cause the * system call to be aborted w/ a locked socketbuf, which @@ -353,14 +353,14 @@ tp_sendoob(tpcb, so, xdata, outflags) tptraceTPCB(TPPTmisc, "XPD mark m_next ", xdata->m_next, 0, 0, 0); ENDTRACE - sbappendrecord(sb, xdata); + sbappendrecord(sb, xdata); IFDEBUG(D_XPD) printf("tp_sendoob len 0x%x\n", len); dump_mbuf(so->so_snd.sb_mb, "XPD request Regular sndbuf:"); dump_mbuf(tpcb->tp_Xsnd.sb_mb, "XPD request Xsndbuf:"); ENDDEBUG - return DoEvent(T_XPD_req); + return DoEvent(T_XPD_req); } /* @@ -368,11 +368,11 @@ tp_sendoob(tpcb, so, xdata, outflags) * the socket routines * FUNCTION and ARGUMENTS: * Handles all "user requests" except the [gs]ockopts() requests. - * The argument (req) is the request type (PRU*), + * The argument (req) is the request type (PRU*), * (m) is an mbuf chain, generally used for send and * receive type requests only. * (nam) is used for addresses usually, in particular for the bind request. - * + * */ /*ARGSUSED*/ ProtoHook @@ -380,11 +380,11 @@ tp_usrreq(so, req, m, nam, controlp) struct socket *so; u_int req; struct mbuf *m, *nam, *controlp; -{ +{ register struct tp_pcb *tpcb = sototpcb(so); int s = splnet(); int error = 0; - int flags, *outflags = &flags; + int flags, *outflags = &flags; u_long eotsdu = 0; struct tp_event E; @@ -394,7 +394,7 @@ tp_usrreq(so, req, m, nam, controlp) printf("WARNING!!! so->so_error is 0x%x\n", so->so_error); ENDDEBUG IFTRACE(D_REQUEST) - tptraceTPCB(TPPTusrreq, "req so m state [", req, so, m, + tptraceTPCB(TPPTusrreq, "req so m state [", req, so, m, tpcb?tpcb->tp_state:0); ENDTRACE @@ -416,8 +416,8 @@ tp_usrreq(so, req, m, nam, controlp) break; case PRU_ABORT: /* called from close() */ - /* called for each incoming connect queued on the - * parent (accepting) socket + /* called for each incoming connect queued on the + * parent (accepting) socket */ if (tpcb->tp_state == TP_OPEN || tpcb->tp_state == TP_CONFIRMING) { E.ATTR(T_DISC_req).e_reason = E_TP_NO_SESSION; @@ -474,7 +474,7 @@ tp_usrreq(so, req, m, nam, controlp) case PRU_CONNECT: IFTRACE(D_CONN) - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "PRU_CONNECT: so 0x%x *SHORT_LSUFXP(tpcb) 0x%x lsuflen 0x%x, class 0x%x", tpcb->tp_sock, *SHORT_LSUFXP(tpcb), tpcb->tp_lsuffixlen, tpcb->tp_class); @@ -500,7 +500,7 @@ tp_usrreq(so, req, m, nam, controlp) break; IFDEBUG(D_CONN) printf( - "PRU_CONNECT after tpcb 0x%x so 0x%x npcb 0x%x flags 0x%x\n", + "PRU_CONNECT after tpcb 0x%x so 0x%x npcb 0x%x flags 0x%x\n", tpcb, so, tpcb->tp_npcb, tpcb->tp_flags); printf("isop 0x%x isop->isop_socket offset 12 :\n", tpcb->tp_npcb); dump_buf(tpcb->tp_npcb, 16); @@ -511,7 +511,7 @@ tp_usrreq(so, req, m, nam, controlp) tpcb->tp_fsuffix, TP_FOREIGN); } if (tpcb->tp_state == TP_CLOSED) { - soisconnecting(so); + soisconnecting(so); error = DoEvent(T_CONN_req); } else { (tpcb->tp_nlproto->nlp_pcbdisc)(tpcb->tp_npcb); @@ -522,13 +522,13 @@ tp_usrreq(so, req, m, nam, controlp) lsufx = *(u_short *)(tpcb->tp_lsuffix); fsufx = *(u_short *)(tpcb->tp_fsuffix); - tpmeas(tpcb->tp_lref, - TPtime_open | (tpcb->tp_xtd_format << 4), + tpmeas(tpcb->tp_lref, + TPtime_open | (tpcb->tp_xtd_format << 4), &time, lsufx, fsufx, tpcb->tp_fref); ENDPERF break; - case PRU_ACCEPT: + case PRU_ACCEPT: (tpcb->tp_nlproto->nlp_getnetaddr)(tpcb->tp_npcb, nam, TP_FOREIGN); IFDEBUG(D_REQUEST) printf("ACCEPT PEERADDDR:"); @@ -539,7 +539,7 @@ tp_usrreq(so, req, m, nam, controlp) lsufx = *(u_short *)(tpcb->tp_lsuffix); fsufx = *(u_short *)(tpcb->tp_fsuffix); - tpmeas(tpcb->tp_lref, TPtime_open, + tpmeas(tpcb->tp_lref, TPtime_open, &time, lsufx, fsufx, tpcb->tp_fref); ENDPERF break; @@ -556,7 +556,7 @@ tp_usrreq(so, req, m, nam, controlp) tpcb->tp_lcredit, tpcb->tp_sent_lcdt, so->so_rcv.sb_cc, so->so_rcv.sb_hiwat); LOCAL_CREDIT(tpcb); - tptraceTPCB(TPPTmisc, + tptraceTPCB(TPPTmisc, "PRU_RCVD AF sbspace lcredit hiwat cc", sbspace(&so->so_rcv), tpcb->tp_lcredit, so->so_rcv.sb_cc, so->so_rcv.sb_hiwat); @@ -567,9 +567,9 @@ tp_usrreq(so, req, m, nam, controlp) so->so_rcv.sb_hiwat); ENDDEBUG if (((int)nam) & MSG_OOB) - error = DoEvent(T_USR_Xrcvd); - else - error = DoEvent(T_USR_rcvd); + error = DoEvent(T_USR_Xrcvd); + else + error = DoEvent(T_USR_rcvd); break; case PRU_RCVOOB: @@ -627,13 +627,13 @@ tp_usrreq(so, req, m, nam, controlp) { /* * Could have eotsdu and no data.(presently MUST have - * an mbuf though, even if its length == 0) + * an mbuf though, even if its length == 0) */ int totlen = m->m_pkthdr.len; struct sockbuf *sb = &so->so_snd; IFPERF(tpcb) PStat(tpcb, Nb_from_sess) += totlen; - tpmeas(tpcb->tp_lref, TPtime_from_session, 0, 0, + tpmeas(tpcb->tp_lref, TPtime_from_session, 0, 0, PStat(tpcb, Nb_from_sess), totlen); ENDPERF IFDEBUG(D_SYSCALL) @@ -649,7 +649,7 @@ tp_usrreq(so, req, m, nam, controlp) dump_mbuf(sb->sb_mb, "so_snd.sb_mb"); ENDDEBUG if (tpcb->tp_state == TP_OPEN) - error = DoEvent(T_DATA_req); + error = DoEvent(T_DATA_req); IFDEBUG(D_SYSCALL) printf("PRU_SEND: after driver error 0x%x \n",error); printf("so_snd 0x%x cc 0t%d mbcnt 0t%d\n", @@ -692,7 +692,7 @@ tp_usrreq(so, req, m, nam, controlp) tpcb ? tpcb->tp_state : 0); ENDDEBUG IFTRACE(D_REQUEST) - tptraceTPCB(TPPTusrreq, "END req so m state [", req, so, m, + tptraceTPCB(TPPTusrreq, "END req so m state [", req, so, m, tpcb ? tpcb->tp_state : 0); ENDTRACE if (controlp) { diff --git a/sys/netiso/tuba_subr.c b/sys/netiso/tuba_subr.c index b7131ad..80a1e67 100644 --- a/sys/netiso/tuba_subr.c +++ b/sys/netiso/tuba_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tuba_subr.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tuba_subr.c,v 1.2 1994/08/02 07:51:34 davidg Exp $ */ #include <sys/param.h> @@ -129,7 +129,7 @@ tuba_output(m, tp) struct isopcb *isop; struct addr_arg arg; - if (tp == 0 || (n = tp->t_template) == 0 || + if (tp == 0 || (n = tp->t_template) == 0 || (isop = (struct isopcb *)tp->t_tuba_pcb) == 0) { isop = &tuba_isopcb; n = mtod(m, struct tcpiphdr *); @@ -231,7 +231,7 @@ tuba_pcbconnect(inp, nam) * FUNCTION and ARGUMENTS: * Take a packet (m) from clnp, strip off the clnp header * and do tcp input processing. - * No return value. + * No return value. */ tuba_tcpinput(m, src, dst) register struct mbuf *m; @@ -289,7 +289,7 @@ tuba_tcpinput(m, src, dst) struct mbuf *m0 = m; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == 0) { + if (m == 0) { m = m0; goto drop; } diff --git a/sys/netiso/tuba_usrreq.c b/sys/netiso/tuba_usrreq.c index e1e922a..2b4f716 100644 --- a/sys/netiso/tuba_usrreq.c +++ b/sys/netiso/tuba_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tuba_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tuba_usrreq.c,v 1.2 1994/08/02 07:51:38 davidg Exp $ */ #include <sys/param.h> @@ -170,7 +170,7 @@ tuba_usrreq(so, req, m, nam, control) error = EINVAL; break; } - if ((error = iso_pcbbind(isop, nam)) || + if ((error = iso_pcbbind(isop, nam)) || (siso = isop->isop_laddr) == 0) break; bcopy(TSEL(siso), &inp->inp_lport, 2); @@ -216,7 +216,7 @@ tuba_usrreq(so, req, m, nam, control) } bcopy(TSEL(isop->isop_faddr), &inp->inp_fport, 2); if (inp->inp_laddr.s_addr == 0 && - (inp->inp_laddr.s_addr = + (inp->inp_laddr.s_addr = tuba_lookup(isop->isop_laddr, M_WAITOK)) == 0) goto unconnect; if ((tp->t_template = tcp_template(tp)) == 0) diff --git a/sys/netiso/xebec/debug.h b/sys/netiso/xebec/debug.h index 2e3f167..c5b3622 100644 --- a/sys/netiso/xebec/debug.h +++ b/sys/netiso/xebec/debug.h @@ -1,5 +1,5 @@ -/* $Header: debug.h,v 2.1 88/09/19 12:56:16 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/debug.h,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/debug.h,v 1.1.1.1 1994/05/24 10:07:51 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/debug.h,v $ */ #define OUT stdout @@ -9,10 +9,10 @@ extern int debug[128]; extern int column; #define IFDEBUG(letter) \ - if(debug['letter']) { + if(debug['letter']) { #define ENDDEBUG ; (void) fflush(stdout);} -#else +#else #define STAR * #define IFDEBUG(letter) //*beginning of comment*/STAR diff --git a/sys/netiso/xebec/llparse.c b/sys/netiso/xebec/llparse.c index fee7a9f..68b511e 100644 --- a/sys/netiso/xebec/llparse.c +++ b/sys/netiso/xebec/llparse.c @@ -1,13 +1,13 @@ -/* $Header: llparse.c,v 2.2 88/09/19 12:54:59 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/llparse.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/llparse.c,v 1.1.1.1 1994/05/24 10:07:51 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/llparse.c,v $ */ /* * ************************* NOTICE ******************************* * This code is in the public domain. It cannot be copyrighted. - * This ll parser was originally written by Keith Thompson for the + * This ll parser was originally written by Keith Thompson for the * University of Wisconsin Crystal project. * It was based on an FMQ lr parser written by Jon Mauney at the * University of Wisconsin. - * It was subsequently modified very slightly by Nancy Hall at the + * It was subsequently modified very slightly by Nancy Hall at the * University of Wisconsin for the Crystal project. * **************************************************************** */ @@ -293,13 +293,13 @@ llsetattr(n) ENDDEBUG if(lldescindex >= LLMAXDESC) { fprintf(stdout, "llattribute stack overflow: desc\n"); - fprintf(stdout, + fprintf(stdout, "lldescindex=0x%x, llattrtop=0x%x\n",lldescindex, llattrtop); Exit(-1); } ptr = &llattrdesc[lldescindex]; ptr->llabase = &llattributes[llattrtop]; - ptr->lloldtop = ++llattrtop; + ptr->lloldtop = ++llattrtop; ptr->llaindex = 1; ptr->llacnt = n+1; /* the lhs ALWAYS uses an attr; it remains on the stack when the production is recognized */ diff --git a/sys/netiso/xebec/llparse.h b/sys/netiso/xebec/llparse.h index 1b6133b..718c360 100644 --- a/sys/netiso/xebec/llparse.h +++ b/sys/netiso/xebec/llparse.h @@ -1,5 +1,5 @@ -/* $Header: llparse.h,v 2.1 88/09/19 12:56:20 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/llparse.h,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/llparse.h,v 1.1.1.1 1994/05/24 10:07:50 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/llparse.h,v $ */ /************************************************************ attributes stack garbage @@ -42,7 +42,7 @@ extern struct lltoken { short llterm; /* token number */ short llstate; /* inserted deleted normal */ - LLattrib llattrib; + LLattrib llattrib; } lltoken; typedef struct lltoken LLtoken; diff --git a/sys/netiso/xebec/llscan.c b/sys/netiso/xebec/llscan.c index ffdb9a9..8f1f1a0 100644 --- a/sys/netiso/xebec/llscan.c +++ b/sys/netiso/xebec/llscan.c @@ -1,11 +1,11 @@ -/* $Header: llscan.c,v 2.2 88/09/19 12:55:06 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/llscan.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/llscan.c,v 1.1.1.1 1994/05/24 10:07:50 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/llscan.c,v $ */ /* * ************************* NOTICE ******************************* * This code is in the public domain. It cannot be copyrighted. - * This scanner was originally written by Keith Thompson for the + * This scanner was originally written by Keith Thompson for the * University of Wisconsin Crystal project. - * It was subsequently modified significantly by Nancy Hall at the + * It was subsequently modified significantly by Nancy Hall at the * University of Wisconsin for the ARGO project. * **************************************************************** */ @@ -63,7 +63,7 @@ int chtype[128] = { }; -extern FILE *astringfile; +extern FILE *astringfile; static char *buffptr; static char buffer[2][LINELEN]; static int currentbuf = 1; @@ -135,9 +135,9 @@ char **buf; return(0); } -getstr(o,c) - /* c is the string delimiter - * allow the delimiter to be escaped +getstr(o,c) + /* c is the string delimiter + * allow the delimiter to be escaped * the messy part: translate $ID to * e->ev_union.ID * where ID is an event with a non-zero obj_struc @@ -146,7 +146,7 @@ getstr(o,c) char o,c; { register int nested = 1; - register int allow_nesting = (o==c)?-1:1; + register int allow_nesting = (o==c)?-1:1; IFDEBUG(S) fprintf(stdout,"getstr: ch=%c, delimiters %c %c\n", @@ -170,14 +170,14 @@ char o,c; /* assume it's an event */ /* addbuf is a macro so this isn't as bad as - * it looks + * it looks * add "e->ev_union." */ if( (ch = getch()) == '$' ) { addbuf('e'); addbuf('-'); addbuf('>'); addbuf('e'); addbuf('v'); addbuf('_'); addbuf('u'); addbuf('n'); addbuf('i'); - addbuf('o'); addbuf('n'); + addbuf('o'); addbuf('n'); addbuf('.'); AddCurrentEventName(& buffptr); } else { @@ -195,7 +195,7 @@ char o,c; } else if( !strncmp(obufp, synonyms[EVENT_SYN], strlen(synonyms[EVENT_SYN]))) { buffptr = obufp; - addbuf('e'); + addbuf('e'); } else { fprintf(stderr, "Unknown synonym %s\n", obufp); Exit(-1); @@ -219,7 +219,7 @@ char o,c; if( (ch != o ) && (ch != c) && (ch != '$') ) { /* may need to handle case where \ is last char in file... */ /* don't treat is as escape; not open or close so - * don't have to worry about nesting either + * don't have to worry about nesting either */ addbuf('\\'); } @@ -231,14 +231,14 @@ char o,c; if( ch == o ) nested += allow_nesting; else if( ch == c ) nested--; if ( (buffptr - buffer[currentbuf]) > LINELEN) { - fprintf(stderr, + fprintf(stderr, "%s too long.\n", (o=='{')?"Action":"Predicate"); /*}*/ - fprintf(stderr, + fprintf(stderr, "buffptr, currentbuf 0x%x, 0x%x\n",buffptr,currentbuf ); Exit(-1); } IFDEBUG(S) - fprintf(stdout,"loop in getstr: ch 0x%x,%c o=%c,c=%c nested=%d\n", + fprintf(stdout,"loop in getstr: ch 0x%x,%c o=%c,c=%c nested=%d\n", ch,ch,o,c,nested); ENDDEBUG } @@ -324,7 +324,7 @@ again: break; whatchar = (c=='*')?0:(c=='/'?1:2); IFDEBUG(S) - fprintf(stdout, + fprintf(stdout, "comment: whatchar = %d, c = 0x%x,%c, oldstate=%d", whatchar, c,c, state); ENDDEBUG diff --git a/sys/netiso/xebec/main.c b/sys/netiso/xebec/main.c index a0b4842..b46a930 100644 --- a/sys/netiso/xebec/main.c +++ b/sys/netiso/xebec/main.c @@ -1,5 +1,5 @@ -/* $Header: main.c,v 2.4 88/09/19 12:55:13 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/main.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/main.c,v 1.1.1.1 1994/05/24 10:07:49 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/main.c,v $ */ /* * TODO: * rewrite the command line stuff altogether - it's kludged beyond @@ -45,7 +45,7 @@ char *synonyms[] = { usage(a) char *a; { - fprintf(stderr, + fprintf(stderr, "usage: %s <transition file> {-D<debug options>} <other options>\n", a); fprintf(stderr, "\t<other options> is any combination of:\n"); @@ -55,9 +55,9 @@ char *a; fprintf(stderr, "\t\t-I<initial values file name>\n"); fprintf(stderr, "\t\t-X<debugging file name>\n"); fprintf(stderr, "\t\t-K<directory name>\n"); - fprintf(stderr, + fprintf(stderr, "\tThese names do NOT include the suffices (.c, .h)\n"); - fprintf(stderr, + fprintf(stderr, "\t\t-D<options> to turn on debug options for xebec itself\n"); fprintf(stderr, "\t-<nn> for levels of debugging output\n"); fprintf(stderr, "\t\t<nn> ranges from 1 to 3, 1 is default(everything)\n"); @@ -97,7 +97,7 @@ register char *proto; #ifdef DEBUG DOIT(astringfile); #endif DEBUG - fprintf(astringfile, + fprintf(astringfile, "#ifndef _NFILE\n#include <stdio.h>\n#endif _NFILE\n" ); ENDDEBUG @@ -109,7 +109,7 @@ register char *proto; if(pgoption) putdriver(actfile, 15); - else + else putdriver(actfile, 14); FakeFilename(actfile, Transfilename, lineno); @@ -338,7 +338,7 @@ char *argv[]; /* putdriver(actfile, 10); */ - if(debug['K']) { + if(debug['K']) { putdriver(actfile, 11); } else { switch(debug['X']) { @@ -356,8 +356,8 @@ char *argv[]; ENDDEBUG putdriver(actfile, 8); (void) fclose(actfile); - IFDEBUG(X) - /* { */ + IFDEBUG(X) + /* { */ fprintf(astringfile, "};\n"); (void) fclose(astringfile); ENDDEBUG @@ -369,7 +369,7 @@ char *argv[]; finish = time(0); fprintf(stdout, "%d seconds\n", finish - start); - if( print_protoerrs ) + if( print_protoerrs ) printprotoerrs(); } @@ -386,7 +386,7 @@ Exit(n) exit(n); } -syntax() +syntax() { static char *synt[] = { "*PROTOCOL <string>\n", @@ -397,7 +397,7 @@ syntax() "*TRANSITIONS <string>\n", }; } - + FakeFilename(outfile, name, l) FILE *outfile; char *name; diff --git a/sys/netiso/xebec/main.h b/sys/netiso/xebec/main.h index cb5bd74..236058d 100644 --- a/sys/netiso/xebec/main.h +++ b/sys/netiso/xebec/main.h @@ -1,10 +1,10 @@ -/* $Header: main.h,v 2.1 88/09/19 12:56:24 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/main.h,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/main.h,v 1.1.1.1 1994/05/24 10:07:49 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/main.h,v $ */ #define TRUE 1 #define FALSE 0 #define LINELEN 2350 - /* approx limit on token size for C compiler + /* approx limit on token size for C compiler * which matters for the purpose of debugging (astring.c...) */ diff --git a/sys/netiso/xebec/malloc.c b/sys/netiso/xebec/malloc.c index 5cdfc14..d09af29 100644 --- a/sys/netiso/xebec/malloc.c +++ b/sys/netiso/xebec/malloc.c @@ -1,15 +1,15 @@ -/* $Header: malloc.c,v 2.2 88/09/19 12:55:18 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/malloc.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/malloc.c,v 1.1.1.1 1994/05/24 10:07:48 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/malloc.c,v $ */ /* * This code is such a kludge that I don't want to put my name on it. * It was a ridiculously fast hack and needs rewriting. * However it does work... */ -/* +/* * a simple malloc * it might be brain-damaged but for the purposes of xebec - * it's a whole lot faster than the c library malloc + * it's a whole lot faster than the c library malloc */ #include <stdio.h> @@ -72,7 +72,7 @@ int x; if(((unsigned)(hiwat) & 0x3)) { bytesmalloced = 4 - (int) ((unsigned)(hiwat) & 0x3); hiwat = sbrk( bytesmalloced ); - } else + } else bytesmalloced = 0; firsttime = 0; highend = hiwat; diff --git a/sys/netiso/xebec/procs.c b/sys/netiso/xebec/procs.c index 49d862a..8134a82 100644 --- a/sys/netiso/xebec/procs.c +++ b/sys/netiso/xebec/procs.c @@ -1,5 +1,5 @@ -/* $Header: procs.c,v 2.3 88/09/19 12:55:22 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/procs.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/procs.c,v 1.1.1.1 1994/05/24 10:07:46 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/procs.c,v $ */ /* * This code is such a kludge that I don't want to put my name on it. * It was a ridiculously fast hack and needs rewriting. @@ -47,11 +47,11 @@ end_events() { protocol); ENDDEBUG /* NOSTRICT */ - Statelist = + Statelist = (struct Stateent **) Malloc((Nstates+1) * sizeof(struct Statent *)); /* NOSTRICT */ - Predlist = - (struct Predicate **) + Predlist = + (struct Predicate **) Malloc ( (((Nevents)<<Eventshift)+Nstates)*sizeof(struct Predicate *) ); size = (((Nevents)<<Eventshift)+Nstates)*sizeof(struct Predicate *) ; @@ -141,7 +141,7 @@ static int Npred=0, Ndefpred=0, Ntrans=0, Ndefevent=0, Nnulla=0; statetable(string, oldstate, newstate, action, event) char *string; int action; -struct Object *oldstate, *newstate, *event; +struct Object *oldstate, *newstate, *event; { register int different; @@ -168,7 +168,7 @@ struct Object *oldstate, *newstate, *event; stateentry(index, oldstate, newstate, action) int index, action; -int oldstate, newstate; +int oldstate, newstate; { extern FILE *statevalfile; @@ -232,18 +232,18 @@ int action, newstate; state, event, Index); fflush(stdout); ENDDEBUG - } else + } else Npred++; /* put at END of list */ #ifndef LINT IFDEBUG(g) - fprintf(stdout, - "predicate for event 0x%x, state 0x%x is 0x%x, %s\n", + fprintf(stdout, + "predicate for event 0x%x, state 0x%x is 0x%x, %s\n", event, state, Index, str); fflush(stdout); ENDDEBUG #endif LINT - for( ((q = &Predlist[(event<<Eventshift)+state]), + for( ((q = &Predlist[(event<<Eventshift)+state]), (p = Predlist[(event<<Eventshift)+state])); p ; p = p->p_next ) { q = &p->p_next; @@ -257,7 +257,7 @@ int action, newstate; *q = p; IFDEBUG(g) - fprintf(stdout, + fprintf(stdout, "predtable index 0x%x, transno %d, E 0x%x, S 0x%x\n", Index, transno, e, s); ENDDEBUG @@ -274,7 +274,7 @@ printprotoerrs() register int e,s; fprintf(stderr, "[ Event, State ] without any transitions :\n"); - for(e = 0; e < Nevents; e++) { + for(e = 0; e < Nevents; e++) { fprintf(stderr, "Event 0x%x: states ", e); for(s = 0; s < Nstates; s++) { if( Predlist[(e<<Eventshift)+s] == 0 ) @@ -297,10 +297,10 @@ FILE *f; #ifdef notdef fprintf(stdout, - " Xebec used %8d bytes of storage, wasted %8d bytes\n", + " Xebec used %8d bytes of storage, wasted %8d bytes\n", bytesmalloced, byteswasted); #endif notdef - fprintf(stdout, + fprintf(stdout, " %8d states\n %8d events\n %8d transitions\n", Nstates, Nevents, Ntrans); fprintf(stdout, @@ -325,11 +325,11 @@ FILE *f; if(!hadapred) fprintf(f, "case 0x%x:\n\t", (e<<Eventshift) + s); hadapred = 1; - fprintf(f, "if %s return 0x%x;\n\t else ", + fprintf(f, "if %s return 0x%x;\n\t else ", p->p_str, p->p_index); } else { if(defaultindex) { - fprintf(stderr, + fprintf(stderr, "\nConflict between transitions %d and %d: duplicate default \n", p->p_transno, defaultItrans); Exit(-1); @@ -345,9 +345,9 @@ FILE *f; IFDEBUG(d) fflush(f); ENDDEBUG - } + } IFDEBUG(g) - fprintf(stdout, + fprintf(stdout, "loop: e 0x%x s 0x%x hadapred 0x%x dindex 0x%x for trans 0x%x\n", e, s, hadapred, defaultindex, defaultItrans); ENDDEBUG @@ -375,19 +375,19 @@ FILE *f; for(s = 0; s< Nstates; s++) fprintf(f, "0,"); /* event 0 */ fprintf(f, "},\n"); - for(e = 0; e < Nevents; e++) { - fprintf(f, " {"); + for(e = 0; e < Nevents; e++) { + fprintf(f, " {"); for(s = 0; s < Nstates; s++) { register struct Predicate *xyz = Predlist[(e<<Eventshift)+s]; /* this kludge is to avoid a lint msg. concerning - * loss of bits + * loss of bits */ if (xyz == (struct Predicate *)(-1)) fprintf(f, "-1,"); else fprintf(f, "0x%x,", Predlist[(e<<Eventshift)+s]); } - fprintf(f, " },\n"); + fprintf(f, " },\n"); } fprintf(f, "};"); } @@ -420,14 +420,14 @@ int event,state; { register struct Predicate *p, **q; - for( - ((q = &Predlist[(event<<Eventshift) +state]), + for( + ((q = &Predlist[(event<<Eventshift) +state]), (p = Predlist[(event<<Eventshift) + state])); p!= (struct Predicate *)0 ; p = p->p_next ) { #ifndef LINT IFDEBUG(a) - fprintf(OUT, - "dump_pentry for event 0x%x, state 0x%x is 0x%x\n", + fprintf(OUT, + "dump_pentry for event 0x%x, state 0x%x is 0x%x\n", event, state, p); ENDDEBUG #endif LINT diff --git a/sys/netiso/xebec/putdriver.c b/sys/netiso/xebec/putdriver.c index 996ac64..85fcd50 100644 --- a/sys/netiso/xebec/putdriver.c +++ b/sys/netiso/xebec/putdriver.c @@ -1,5 +1,5 @@ -/* $Header: putdriver.c,v 2.2 88/09/19 12:55:27 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/putdriver.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/putdriver.c,v 1.1.1.1 1994/05/24 10:07:46 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/putdriver.c,v $ */ /* * This code is such a kludge that I don't want to put my name on it. @@ -90,7 +90,7 @@ static char *strings[] = { protocol, "_debug;\n\textern FILE *", protocol, - "_astringfile;\n", + "_astringfile;\n", (char *)0, (char *)0, (char *)0, @@ -137,7 +137,7 @@ static char *strings[] = { "\n_XEBEC_PG int _Xebec_action(a,e,p)\nint a;\nstruct ", protocol, "_event *e;\n", - protocol, + protocol, PCBNAME, " *p;\n{\n", "switch(a) {\n", @@ -161,15 +161,15 @@ static char *strings[] = { "\n_XEBEC_PG int\n_Xebec_index( e,p )\n", "\tstruct ", protocol, - "_event *e;\n\t", - protocol, + "_event *e;\n\t", + protocol, PCBNAME, " *p;\n{\nswitch( (e->ev_number<<", Eventshiftstring, ")+(p->", - protocol, + protocol, statename, - ") ) {\n", + ") ) {\n", (char *)0, (char *)0, (char *)0, @@ -230,11 +230,11 @@ static struct { int start; int finish; } parts[] = { PART15, }; -putdriver(f, x) +putdriver(f, x) FILE *f; int x; { - register int i; + register int i; for( i = parts[x].start; i<= parts[x].finish; i++) fprintf(f, "%s", strings[i]); diff --git a/sys/netiso/xebec/sets.c b/sys/netiso/xebec/sets.c index 3bb74ed..6022a89 100644 --- a/sys/netiso/xebec/sets.c +++ b/sys/netiso/xebec/sets.c @@ -1,5 +1,5 @@ -/* $Header: sets.c,v 2.3 88/09/19 12:55:30 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/sets.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/sets.c,v 1.1.1.1 1994/05/24 10:07:45 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/sets.c,v $ */ /* * This code is such a kludge that I don't want to put my name on it. * It was a ridiculously fast hack and needs rewriting. @@ -14,9 +14,9 @@ struct Object *CurrentEvent = (struct Object *)0; struct Object *Objtree; struct Object dummy; -/* +/* * define a set w/ type and name - * return a set number + * return a set number */ #undef NULL #define NULL (struct Object *)0 @@ -118,19 +118,19 @@ FILE *f; fprintf(f, "struct %s_event {\n\tint ev_number;\n", &protocol[0]); IFDEBUG(X) /* finish sstring[] & start estring[] */ - fprintf(astringfile, + fprintf(astringfile, "};\n\nchar *%s_estring[] = {\n", protocol); ENDDEBUG } int FirstEventAttribute = 1; -static -insert(o) +static +insert(o) struct Object *o; { struct Object *p = Objtree; - struct Object **q = &Objtree; + struct Object **q = &Objtree; int val=1; @@ -143,7 +143,7 @@ struct Object *o; fprintf(stderr, "No states may be defined after *TRANSITIONS\n"); Exit(-1); } - o->obj_number = Nstates++ ; + o->obj_number = Nstates++ ; if(Nstates > MAXSTATES) { fprintf(stderr, "Too many states\n"); Exit(-1); @@ -153,7 +153,7 @@ struct Object *o; fprintf(astringfile, "\"%s(0x%x)\",\n", o->obj_name, o->obj_number); ENDDEBUG } else { - /* EVENTSET */ + /* EVENTSET */ if( ! states_done ) { fprintf(stderr, "states must precede events\n"); Exit(-1); @@ -168,7 +168,7 @@ struct Object *o; fprintf(Efile, "\n\tunion{\n"); /*} */ FirstEventAttribute = 0; } - fprintf(Efile, + fprintf(Efile, "struct %s %s%s;\n\n", o->obj_struc, EV_PREFIX, o->obj_name); } fprintf(Efile, "#define %s 0x%x\n", o->obj_name, o->obj_number); @@ -215,10 +215,10 @@ struct Object *o; ENDDEBUG } -delete(o) +delete(o) struct Object *o; { - register struct Object *p = o->obj_right; + register struct Object *p = o->obj_right; register struct Object *q; register struct Object *newparent; register struct Object **np_childlink; @@ -262,7 +262,7 @@ struct Object *o; p = o->obj_left; } *np_childlink = p; - if(p) + if(p) p->obj_parent = newparent; IFDEBUG(T) @@ -281,13 +281,13 @@ int keep; IFDEBUG(o) printf("defineset(0x%x,%s, %s)\n", type , adr, keep?"KEEP":"NO_KEEP"); ENDDEBUG - + onew = (struct Object *)Malloc(sizeof (struct Object)); bzero(onew, sizeof(struct Object)); onew->obj_name = adr; onew->obj_kind = OBJ_SET; onew->obj_type = type; - if(keep) + if(keep) insert( onew ); /* address already stashed before calling defineset */ IFDEBUG(o) @@ -321,9 +321,9 @@ char *struc; IFDEBUG(o) printf("defineitem(0x%x, %s at 0x%x, %s)\n", type, adr, adr, struc); ENDDEBUG - + if( onew = lookup( type, adr ) ) { - fprintf(stderr, + fprintf(stderr, "Internal error at defineitem: trying to redefine obj type 0x%x, adr %s\n", type, adr); exit(-1); @@ -349,7 +349,7 @@ char *adr; IFDEBUG(o) printf("member(0x%x, %s)\n", o, adr); ENDDEBUG - + oold = lookup( o->obj_type, adr ); onew = (struct Object *)Malloc(sizeof (struct Object)); @@ -396,7 +396,7 @@ AddCurrentEventName(x) register char **x; { register char *n = EV_PREFIX; ; - + if( CurrentEvent == (struct Object *)0 ) { fprintf(stderr, "No event named! BARF!\n"); Exit(-1); } @@ -429,7 +429,7 @@ dumptree(o,i) fprintf(stdout, "%3d NULL\n", i); } else { dumptree(o->obj_left, i+1); - for(j=0; j<i; j++) + for(j=0; j<i; j++) fputc(' ', stdout); fprintf(stdout, "%3d 0x%x: %s\n", i,o, OBJ_NAME(o)); dumptree(o->obj_right, i+1); @@ -467,6 +467,6 @@ char *pred, *action; fprintf(stdout, " <== "); dumpit(oldstate); dumpit(event); - fprintf(stdout, "\n\t\t%s\n\t\t%s\n", pred?pred:"DEFAULT", + fprintf(stdout, "\n\t\t%s\n\t\t%s\n", pred?pred:"DEFAULT", action); } diff --git a/sys/netiso/xebec/sets.h b/sys/netiso/xebec/sets.h index 96eb791..15168ef 100644 --- a/sys/netiso/xebec/sets.h +++ b/sys/netiso/xebec/sets.h @@ -1,5 +1,5 @@ -/* $Header: sets.h,v 2.1 88/09/19 12:56:33 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/sets.h,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/sets.h,v 1.1.1.1 1994/05/24 10:07:44 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/sets.h,v $ */ #define MAXEVENTS 200 #define MAXSTATES 200 @@ -15,7 +15,7 @@ struct Object { unsigned char obj_type; /* state or event */ char *obj_name; char *obj_struc; - int obj_number; + int obj_number; struct Object *obj_members; /* must be null for kind==item */ /* for the tree */ struct Object *obj_left; diff --git a/sys/netiso/xebec/xebec.c b/sys/netiso/xebec/xebec.c index 132bcb8..40f862f 100644 --- a/sys/netiso/xebec/xebec.c +++ b/sys/netiso/xebec/xebec.c @@ -1,5 +1,5 @@ -/* $Header: xebec.c,v 2.2 88/09/19 12:55:37 nhall Exp $ */ -/* $Source: /var/home/tadl/src/argo/xebec/RCS/xebec.c,v $ */ +/* $Header: /home/ncvs/src/sys/netiso/xebec/xebec.c,v 1.1.1.1 1994/05/24 10:07:43 rgrimes Exp $ */ +/* $Source: /home/ncvs/src/sys/netiso/xebec/xebec.c,v $ */ #include "xebec.h" #include "llparse.h" @@ -9,9 +9,9 @@ #include "main.h" #include "sets.h" -#include <stdio.h> +#include <stdio.h> -extern FILE *eventfile_h, *actfile; +extern FILE *eventfile_h, *actfile; llaction(lln,token) LLtoken *token; @@ -24,41 +24,41 @@ case 1: break; case 10: { - + if(strlen(llattr->llabase[3].ID.address) > 50 ) { - fprintf(stderr, - "Protocol name may not exceed 50 chars in length.\n"); + fprintf(stderr, + "Protocol name may not exceed 50 chars in length.\n"); Exit(-1); } - strcpy(protocol, llattr->llabase[3].ID.address); - openfiles(protocol); - + strcpy(protocol, llattr->llabase[3].ID.address); + openfiles(protocol); + } break; case 11: { - - llattr->llabase[7].pcb.isevent = 0; - + + llattr->llabase[7].pcb.isevent = 0; + } break; case 12: { fprintf(actfile, "\ntypedef %s %s%s;\n", - llattr->llabase[7].pcb.address,protocol, PCBNAME); + llattr->llabase[7].pcb.address,protocol, PCBNAME); llattr->llabase[8].syn.type = PCB_SYN; - + } break; case 13: { - llattr->llabase[11].part.type = (unsigned char) STATESET; + llattr->llabase[11].part.type = (unsigned char) STATESET; } break; case 14: { - end_states(eventfile_h); + end_states(eventfile_h); } break; case 15: { - llattr->llabase[14].pcb.isevent = 1; + llattr->llabase[14].pcb.isevent = 1; } break; case 16: { @@ -67,56 +67,56 @@ case 16: { includecode(eventfile_h, llattr->llabase[14].pcb.address); fprintf(eventfile_h, "\n"); /* fmq gags on single chars */ llattr->llabase[15].syn.type = EVENT_SYN; - + } break; case 17: { - - llattr->llabase[16].part.type = (unsigned char)EVENTSET; - + + llattr->llabase[16].part.type = (unsigned char)EVENTSET; + } break; case 18: { - end_events(); + end_events(); } break; case 19: { - + putincludes(); putdriver(actfile, 9); - + } break; case 20: { if(llattr->llabase[0].pcb.isevent) { - fprintf(stderr, + fprintf(stderr, "Event is a list of objects enclosed by \"{}\"\n"); Exit(-1); } - fprintf(eventfile_h, "struct "); - + fprintf(eventfile_h, "struct "); + } break; case 21: { - llattr->llabase[0].pcb.address = llattr->llabase[2].ACTION.address; + llattr->llabase[0].pcb.address = llattr->llabase[2].ACTION.address; } break; case 22: { if( ! llattr->llabase[0].pcb.isevent) { - fprintf(stderr, + fprintf(stderr, "Pcb requires a type or structure definition.\"{}\"\n"); Exit(-1); } - llattr->llabase[0].pcb.address = llattr->llabase[1].ACTION.address; - + llattr->llabase[0].pcb.address = llattr->llabase[1].ACTION.address; + } break; case 23: { - llattr->llabase[0].pcb.address = llattr->llabase[1].ID.address; + llattr->llabase[0].pcb.address = llattr->llabase[1].ID.address; } break; case 24: { - synonyms[llattr->llabase[0].syn.type] = stash( llattr->llabase[2].ID.address ); + synonyms[llattr->llabase[0].syn.type] = stash( llattr->llabase[2].ID.address ); } break; case 25: { @@ -124,130 +124,130 @@ case 25: { } break; case 26: { - + llattr->llabase[2].partrest.address = llattr->llabase[1].ID.address; - llattr->llabase[2].partrest.type = llattr->llabase[0].part.type; - + llattr->llabase[2].partrest.type = llattr->llabase[0].part.type; + } break; case 27: { - llattr->llabase[3].parttail.type = llattr->llabase[0].part.type; + llattr->llabase[3].parttail.type = llattr->llabase[0].part.type; } break; case 28: { - llattr->llabase[1].part.type = llattr->llabase[0].parttail.type; + llattr->llabase[1].part.type = llattr->llabase[0].parttail.type; } break; case 29: { - + if( lookup( llattr->llabase[0].partrest.type, llattr->llabase[0].partrest.address ) ) { fprintf(stderr, "bnf:trying to redefine obj type 0x%x, adr %s\n", llattr->llabase[0].partrest.type, llattr->llabase[0].partrest.address); Exit(-1); - } + } llattr->llabase[2].setdef.type = llattr->llabase[0].partrest.type; llattr->llabase[2].setdef.address = stash( llattr->llabase[0].partrest.address ); llattr->llabase[2].setdef.keep = 1; - + } break; case 30: { - llattr->llabase[3].setstruct.object = llattr->llabase[2].setdef.object; + llattr->llabase[3].setstruct.object = llattr->llabase[2].setdef.object; } break; case 31: { - - defineitem(llattr->llabase[0].partrest.type, - llattr->llabase[0].partrest.address, llattr->llabase[1].ACTION.address); - + + defineitem(llattr->llabase[0].partrest.type, + llattr->llabase[0].partrest.address, llattr->llabase[1].ACTION.address); + } break; case 32: { - + defineitem(llattr->llabase[0].partrest.type, llattr->llabase[0].partrest.address, (char *)0); - + } break; case 33: { if(llattr->llabase[0].setstruct.object) { - /* WHEN COULD THIS BE FALSE?? + /* WHEN COULD THIS BE FALSE?? * isn't it supposed to be setstruct.object??? * (it used to be $ACTION.address) */ llattr->llabase[0].setstruct.object->obj_struc = llattr->llabase[1].ACTION.address; - fprintf(eventfile_h, - "struct %s %s%s;\n\n", llattr->llabase[1].ACTION.address, + fprintf(eventfile_h, + "struct %s %s%s;\n\n", llattr->llabase[1].ACTION.address, EV_PREFIX, llattr->llabase[0].setstruct.object->obj_name); } - + } break; case 34: { - - llattr->llabase[2].setlist.setnum = - defineset(llattr->llabase[0].setdef.type, llattr->llabase[0].setdef.address, llattr->llabase[0].setdef.keep); - + + llattr->llabase[2].setlist.setnum = + defineset(llattr->llabase[0].setdef.type, llattr->llabase[0].setdef.address, llattr->llabase[0].setdef.keep); + } break; case 35: { - llattr->llabase[0].setdef.object = llattr->llabase[2].setlist.setnum; + llattr->llabase[0].setdef.object = llattr->llabase[2].setlist.setnum; } break; case 36: { - - member(llattr->llabase[0].setlist.setnum, llattr->llabase[1].ID.address); - llattr->llabase[2].setlisttail.setnum = llattr->llabase[0].setlist.setnum; - + + member(llattr->llabase[0].setlist.setnum, llattr->llabase[1].ID.address); + llattr->llabase[2].setlisttail.setnum = llattr->llabase[0].setlist.setnum; + } break; case 37: { - llattr->llabase[2].setlist.setnum = llattr->llabase[0].setlisttail.setnum; + llattr->llabase[2].setlist.setnum = llattr->llabase[0].setlisttail.setnum; } break; case 38: { - transno ++; + transno ++; } break; case 39: { - - CurrentEvent /* GAG! */ = llattr->llabase[6].event.object; - + + CurrentEvent /* GAG! */ = llattr->llabase[6].event.object; + } break; case 40: { - - llattr->llabase[8].actionpart.string = llattr->llabase[7].predicatepart.string; - llattr->llabase[8].actionpart.newstate = llattr->llabase[1].newstate.object; + + llattr->llabase[8].actionpart.string = llattr->llabase[7].predicatepart.string; + llattr->llabase[8].actionpart.newstate = llattr->llabase[1].newstate.object; llattr->llabase[8].actionpart.oldstate = llattr->llabase[5].oldstate.object; - + } break; case 41: { - + llattr->llabase[0].predicatepart.string = stash ( llattr->llabase[1].PREDICATE.address ); - + } break; case 42: { - + llattr->llabase[0].predicatepart.string = (char *)0; - + } break; case 43: { - statetable( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, + statetable( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, llattr->llabase[0].actionpart.newstate, - acttable(actfile, llattr->llabase[1].ACTION.address ), - CurrentEvent ); + acttable(actfile, llattr->llabase[1].ACTION.address ), + CurrentEvent ); if( print_trans ) { - dump_trans( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, + dump_trans( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, llattr->llabase[0].actionpart.newstate, - llattr->llabase[1].ACTION.address, CurrentEvent ); + llattr->llabase[1].ACTION.address, CurrentEvent ); } - + } break; case 44: { @@ -255,65 +255,65 @@ case 44: { statetable(llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, llattr->llabase[0].actionpart.newstate, 0, CurrentEvent ); /* KLUDGE - remove this */ if( print_trans ) { - dump_trans( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, + dump_trans( llattr->llabase[0].actionpart.string, llattr->llabase[0].actionpart.oldstate, llattr->llabase[0].actionpart.newstate, - "NULLACTION", CurrentEvent ); + "NULLACTION", CurrentEvent ); } - + } break; case 45: { - + llattr->llabase[0].oldstate.object = Lookup(STATESET, llattr->llabase[1].ID.address); - + } break; case 46: { llattr->llabase[1].setdef.address = (char *)0; - llattr->llabase[1].setdef.type = (unsigned char)STATESET; + llattr->llabase[1].setdef.type = (unsigned char)STATESET; llattr->llabase[1].setdef.keep = 0; - + } break; case 47: { - - llattr->llabase[0].oldstate.object = llattr->llabase[1].setdef.object; - + + llattr->llabase[0].oldstate.object = llattr->llabase[1].setdef.object; + } break; case 48: { - - llattr->llabase[0].newstate.object = Lookup(STATESET, llattr->llabase[1].ID.address); - + + llattr->llabase[0].newstate.object = Lookup(STATESET, llattr->llabase[1].ID.address); + } break; case 49: { - + extern struct Object *SameState; llattr->llabase[0].newstate.object = SameState; - + } break; case 50: { - llattr->llabase[0].event.object = Lookup(EVENTSET, llattr->llabase[1].ID.address); - + llattr->llabase[0].event.object = Lookup(EVENTSET, llattr->llabase[1].ID.address); + } break; case 51: { llattr->llabase[1].setdef.address = (char *)0; - llattr->llabase[1].setdef.type = (unsigned char)EVENTSET; + llattr->llabase[1].setdef.type = (unsigned char)EVENTSET; llattr->llabase[1].setdef.keep = 0; - + } break; case 52: { - - llattr->llabase[0].event.object = llattr->llabase[1].setdef.object; - + + llattr->llabase[0].event.object = llattr->llabase[1].setdef.object; + } break; } } @@ -369,55 +369,55 @@ short llnsyms = 44; short llnprods = 38; short llinfinite = 10000; short llproductions[] = { -41, -21, 5, -20, 2, -41, -22, 5, -41, -23, 1, --24, 1, 3, - -26, -36, 1, -25, -37, 11, - -28, -27, 29, -26, 1, -27, -28, - -30, -30, 31, -29, 10, --31, 5, --32, --33, 5, - --35, 8, 25, -34, 7, -42, 33, -17, 38, -40, 37, -39, 34, 35, 10, 10, 9, -38, 36, --50, 1, --52, 31, -51, --45, 1, --47, 31, -46, --48, 1, --49, 21, --41, 4, --42, 19, --43, 5, --44, 20, -32, -19, 14, -18, 12, 27, -17, 24, -16, 23, -15, 13, -14, 12, 27, -13, 16, 12, 24, -12, 23, -11, 18, 40, 12, -10, 1, 6, 12, -12, -25, 5, 15, - -17, - -32, - -22, 39, +41, -21, 5, -20, 2, +41, -22, 5, +41, -23, 1, +-24, 1, 3, + +26, -36, 1, +25, -37, 11, + +28, -27, 29, -26, 1, +27, -28, + +30, -30, 31, -29, 10, +-31, 5, +-32, +-33, 5, + +-35, 8, 25, -34, 7, +42, 33, +17, 38, -40, 37, -39, 34, 35, 10, 10, 9, -38, 36, +-50, 1, +-52, 31, -51, +-45, 1, +-47, 31, -46, +-48, 1, +-49, 21, +-41, 4, +-42, 19, +-43, 5, +-44, 20, +32, -19, 14, -18, 12, 27, -17, 24, -16, 23, -15, 13, -14, 12, 27, -13, 16, 12, 24, -12, 23, -11, 18, 40, 12, -10, 1, 6, 12, +12, -25, 5, 15, + +17, + +32, + +22, 39, 0 }; struct llprodindex llprodindex[] = { -{ 0, 0, 0 }, { 0, 5, 19 }, { 5, 3, 3 }, { 8, 3, 2 }, -{ 11, 3, 2 }, { 14, 0, 2 }, { 14, 3, 0 }, { 17, 3, 1 }, -{ 20, 0, 0 }, { 20, 5, 3 }, { 25, 2, 0 }, { 27, 0, 3 }, -{ 27, 5, 1 }, { 32, 2, 0 }, { 34, 1, 3 }, { 35, 2, 1 }, -{ 37, 0, 0 }, { 37, 5, 1 }, { 42, 2, 0 }, { 44, 12, 3 }, -{ 56, 2, 2 }, { 58, 3, 2 }, { 61, 2, 0 }, { 63, 3, 2 }, -{ 66, 2, 1 }, { 68, 2, 0 }, { 70, 2, 9 }, { 72, 2, 1 }, -{ 74, 2, 1 }, { 76, 2, 1 }, { 78, 29, 1 }, { 107, 4, 1 }, -{ 111, 0, 1 }, { 111, 1, 1 }, { 112, 0, 1 }, { 112, 1, 1 }, +{ 0, 0, 0 }, { 0, 5, 19 }, { 5, 3, 3 }, { 8, 3, 2 }, +{ 11, 3, 2 }, { 14, 0, 2 }, { 14, 3, 0 }, { 17, 3, 1 }, +{ 20, 0, 0 }, { 20, 5, 3 }, { 25, 2, 0 }, { 27, 0, 3 }, +{ 27, 5, 1 }, { 32, 2, 0 }, { 34, 1, 3 }, { 35, 2, 1 }, +{ 37, 0, 0 }, { 37, 5, 1 }, { 42, 2, 0 }, { 44, 12, 3 }, +{ 56, 2, 2 }, { 58, 3, 2 }, { 61, 2, 0 }, { 63, 3, 2 }, +{ 66, 2, 1 }, { 68, 2, 0 }, { 70, 2, 9 }, { 72, 2, 1 }, +{ 74, 2, 1 }, { 76, 2, 1 }, { 78, 29, 1 }, { 107, 4, 1 }, +{ 111, 0, 1 }, { 111, 1, 1 }, { 112, 0, 1 }, { 112, 1, 1 }, { 113, 0, 1 }, { 113, 2, 2 }, { 0, 0, 0 } }; short llepsilon[] = { @@ -427,19 +427,19 @@ short llepsilon[] = { 0, 0, 1, 0, 1, 0, 1, 0, 0 }; struct llparsetable llparsetable[] = { -{ 1, 3 }, { 2, 1 }, { 5, 2 }, { 0, 23 }, { 1, 5 }, -{ 3, 4 }, { 12, 5 }, { 0, 24 }, { 1, 6 }, { 0, 25 }, -{ 8, 8 }, { 11, 7 }, { 0, 26 }, { 1, 9 }, { 0, 27 }, -{ 1, 10 }, { 12, 11 }, { 0, 28 }, { 1, 14 }, { 5, 13 }, -{ 10, 12 }, { 12, 14 }, { 0, 29 }, { 1, 16 }, { 5, 15 }, -{ 12, 16 }, { 0, 30 }, { 7, 17 }, { 0, 31 }, { 1, 18 }, -{ 21, 18 }, { 0, 32 }, { 1, 19 }, { 21, 19 }, { 0, 33 }, -{ 1, 20 }, { 7, 21 }, { 0, 34 }, { 1, 22 }, { 7, 23 }, -{ 0, 35 }, { 1, 24 }, { 21, 25 }, { 0, 36 }, { 4, 26 }, -{ 19, 27 }, { 0, 37 }, { 5, 28 }, { 20, 29 }, { 0, 38 }, -{ 12, 30 }, { 0, 39 }, { 15, 31 }, { 18, 32 }, { 0, 40 }, -{ 1, 34 }, { 3, 34 }, { 12, 34 }, { 17, 33 }, { 0, 41 }, -{ 1, 35 }, { 21, 35 }, { 22, 36 }, { 0, 42 }, { 12, 37 }, +{ 1, 3 }, { 2, 1 }, { 5, 2 }, { 0, 23 }, { 1, 5 }, +{ 3, 4 }, { 12, 5 }, { 0, 24 }, { 1, 6 }, { 0, 25 }, +{ 8, 8 }, { 11, 7 }, { 0, 26 }, { 1, 9 }, { 0, 27 }, +{ 1, 10 }, { 12, 11 }, { 0, 28 }, { 1, 14 }, { 5, 13 }, +{ 10, 12 }, { 12, 14 }, { 0, 29 }, { 1, 16 }, { 5, 15 }, +{ 12, 16 }, { 0, 30 }, { 7, 17 }, { 0, 31 }, { 1, 18 }, +{ 21, 18 }, { 0, 32 }, { 1, 19 }, { 21, 19 }, { 0, 33 }, +{ 1, 20 }, { 7, 21 }, { 0, 34 }, { 1, 22 }, { 7, 23 }, +{ 0, 35 }, { 1, 24 }, { 21, 25 }, { 0, 36 }, { 4, 26 }, +{ 19, 27 }, { 0, 37 }, { 5, 28 }, { 20, 29 }, { 0, 38 }, +{ 12, 30 }, { 0, 39 }, { 15, 31 }, { 18, 32 }, { 0, 40 }, +{ 1, 34 }, { 3, 34 }, { 12, 34 }, { 17, 33 }, { 0, 41 }, +{ 1, 35 }, { 21, 35 }, { 22, 36 }, { 0, 42 }, { 12, 37 }, { 0, 43 }, { 0, 0 } }; short llparseindex[] = { diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c index 12d56a6..d6ffaf4 100644 --- a/sys/netns/idp_usrreq.c +++ b/sys/netns/idp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)idp_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: idp_usrreq.c,v 1.2 1994/08/02 07:51:41 davidg Exp $ + * $Id: idp_usrreq.c,v 1.3 1994/11/15 14:26:30 bde Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ idp_output(nsp, m0) /* * Make sure packet is actually of even length. */ - + if (len & 1) { m = mprev; if ((m->m_flags & M_EXT) == 0 && @@ -244,7 +244,7 @@ idp_output(nsp, m0) &satons_addr(ro->ro_dst); dst->x_host = idp->idp_dna.x_host; } - /* + /* * Otherwise, we go through the same gateway * and dst is already set up. */ @@ -291,7 +291,7 @@ idp_ctloutput(req, so, level, name, value) case SO_HEADERS_ON_INPUT: mask = NSP_RAWIN; goto get_flags; - + case SO_HEADERS_ON_OUTPUT: mask = NSP_RAWOUT; get_flags: diff --git a/sys/netns/ns.c b/sys/netns/ns.c index 972fc3b..61536e1 100644 --- a/sys/netns/ns.c +++ b/sys/netns/ns.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ns.c 8.2 (Berkeley) 11/15/93 - * $Id: ns.c,v 1.2 1994/08/02 07:51:43 davidg Exp $ + * $Id: ns.c,v 1.3 1994/11/15 14:26:31 bde Exp $ */ #include <sys/param.h> @@ -217,7 +217,7 @@ ns_control(so, cmd, data, ifp) ns_thishost = ns_zerohost; } return (0); - + case SIOCAIFADDR: dstIsNew = 0; hostIsNew = 1; if (ia->ia_addr.sns_family == AF_NS) { @@ -252,7 +252,7 @@ ns_control(so, cmd, data, ifp) */ ns_ifscrub(ifp, ia) register struct ifnet *ifp; - register struct ns_ifaddr *ia; + register struct ns_ifaddr *ia; { if (ia->ia_flags & IFA_ROUTE) { if (ifp->if_flags & IFF_POINTOPOINT) { diff --git a/sys/netns/ns_error.c b/sys/netns/ns_error.c index 5626166..0e7e24f 100644 --- a/sys/netns/ns_error.c +++ b/sys/netns/ns_error.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ns_error.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: ns_error.c,v 1.2 1994/08/02 07:51:46 davidg Exp $ */ #include <sys/param.h> @@ -157,7 +157,7 @@ ns_error(om, type, param) if (idpcksum) { nip->idp_sum = 0; nip->idp_sum = ns_cksum(m, sizeof(*ep)); - } else + } else nip->idp_sum = 0xffff; (void) ns_output(m, (struct route *)0, 0); @@ -269,7 +269,7 @@ ns_err_input(m) default: idp_ctlinput(code, (caddr_t)ep); } - + goto freeit; default: diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index 83b0281..6fa2e9c 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ns_input.c 8.1 (Berkeley) 6/10/93 - * $Id: ns_input.c,v 1.3 1995/03/16 18:15:28 bde Exp $ + * $Id: ns_input.c,v 1.4 1995/05/11 00:13:22 wollman Exp $ */ #include <sys/param.h> @@ -391,7 +391,7 @@ struct mbuf *m; x.l = x.s[0] + x.s[1]; if (x.l==0xffff) idp->idp_sum = 0; else idp->idp_sum = x.l; } - if ((error = ns_output(m, &idp_droute, flags)) && + if ((error = ns_output(m, &idp_droute, flags)) && (mcopy!=NULL)) { idp = mtod(mcopy, struct idp *); type = NS_ERR_UNSPEC_T, code = 0; @@ -431,7 +431,7 @@ idp_do_route(src, ro) struct ns_addr *src; struct route *ro; { - + struct sockaddr_ns *dst; bzero((caddr_t)ro, sizeof (*ro)); diff --git a/sys/netns/ns_pcb.c b/sys/netns/ns_pcb.c index 155d6ba..754c9fb 100644 --- a/sys/netns/ns_pcb.c +++ b/sys/netns/ns_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ns_pcb.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: ns_pcb.c,v 1.2 1994/08/02 07:51:52 davidg Exp $ */ #include <sys/param.h> @@ -67,7 +67,7 @@ ns_pcballoc(so, head) so->so_pcb = (caddr_t)nsp; return (0); } - + ns_pcbbind(nsp, nam) register struct nspcb *nsp; struct mbuf *nam; @@ -176,7 +176,7 @@ ns_pcbconnect(nsp, nam) rtalloc(ro); } if (ns_neteqnn(nsp->nsp_laddr.x_net, ns_zeronet)) { - /* + /* * If route is known or can be allocated now, * our src addr is taken from the i/f, else punt. */ @@ -244,7 +244,7 @@ ns_setsockaddr(nsp, nam) struct mbuf *nam; { register struct sockaddr_ns *sns = mtod(nam, struct sockaddr_ns *); - + nam->m_len = sizeof (*sns); sns = mtod(nam, struct sockaddr_ns *); bzero((caddr_t)sns, sizeof (*sns)); @@ -258,7 +258,7 @@ ns_setpeeraddr(nsp, nam) struct mbuf *nam; { register struct sockaddr_ns *sns = mtod(nam, struct sockaddr_ns *); - + nam->m_len = sizeof (*sns); sns = mtod(nam, struct sockaddr_ns *); bzero((caddr_t)sns, sizeof (*sns)); @@ -290,7 +290,7 @@ ns_pcbnotify(dst, errno, notify, param) } if (nsp->nsp_socket == 0) goto next; - if (errno) + if (errno) nsp->nsp_socket->so_error = errno; oinp = nsp; nsp = nsp->nsp_next; diff --git a/sys/netns/ns_proto.c b/sys/netns/ns_proto.c index ff26004e..3352aa0 100644 --- a/sys/netns/ns_proto.c +++ b/sys/netns/ns_proto.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)ns_proto.c 8.1 (Berkeley) 6/10/93 - * $Id: ns_proto.c,v 1.2 1994/08/02 07:51:54 davidg Exp $ + * $Id: ns_proto.c,v 1.3 1995/05/11 00:13:23 wollman Exp $ */ #include <sys/param.h> @@ -92,7 +92,7 @@ struct protosw nssw[] = { }; struct domain nsdomain = - { AF_NS, "network systems", 0, 0, 0, + { AF_NS, "network systems", 0, 0, 0, nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])], 0, rn_inithead, 16, sizeof(struct sockaddr_ns)}; diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c index 88643b8..fbce16a 100644 --- a/sys/netns/spp_usrreq.c +++ b/sys/netns/spp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spp_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: spp_usrreq.c,v 1.2 1994/08/02 07:52:00 davidg Exp $ + * $Id: spp_usrreq.c,v 1.3 1995/03/19 14:29:04 davidg Exp $ */ #include <sys/param.h> @@ -662,7 +662,7 @@ register struct nspcb *nsp; struct mbuf *firstbad, *m0; if (cb) { - /* + /* * The notification that we have sent * too much is bad news -- we will * have to go through queued up so far @@ -917,7 +917,7 @@ again: if (rcv_win > 0) { u_short delta = 1 + cb->s_alo - cb->s_ack; int adv = rcv_win - (delta * cb->s_mtu); - + if ((so->so_rcv.sb_cc == 0 && adv >= (2 * cb->s_mtu)) || (100 * adv / so->so_rcv.sb_hiwat >= 35)) { sppstat.spps_sndwinup++; @@ -972,7 +972,7 @@ send: if (rcv_win < 0) rcv_win = 0; alo = cb->s_ack - 1 + (rcv_win / ((short)cb->s_mtu)); - if (SSEQ_LT(alo, cb->s_alo)) + if (SSEQ_LT(alo, cb->s_alo)) alo = cb->s_alo; if (si) { @@ -1026,7 +1026,7 @@ send: if (cb->s_force != (1 + SPPT_PERSIST) || cb->s_timer[SPPT_PERSIST] == 0) { /* - * If this is a new packet and we are not currently + * If this is a new packet and we are not currently * timing anything, time this one. */ if (SSEQ_LT(cb->s_smax, si->si_seq)) { @@ -1329,7 +1329,7 @@ spp_usrreq(so, req, m, nam, controlp) SPPT_RANGESET(cb->s_rxtcur, ((SPPTV_SRTTBASE >> 2) + (SPPTV_SRTTDFLT << 2)) >> 1, SPPTV_MIN, SPPTV_REXMTMAX); - nsp->nsp_pcb = (caddr_t) cb; + nsp->nsp_pcb = (caddr_t) cb; break; case PRU_DETACH: diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index 057ffb6..f929012 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.12 1995/04/16 05:05:25 davidg Exp $ + * $Id: nfs_bio.c,v 1.13 1995/05/21 21:39:21 davidg Exp $ */ #include <sys/param.h> @@ -185,7 +185,7 @@ nfs_bioread(vp, uio, ioflag, cred) error = nfs_readdirrpc(vp, uio, cred); break; default: - printf(" NQNFSNONCACHE: type %x unexpected\n", + printf(" NQNFSNONCACHE: type %x unexpected\n", vp->v_type); break; }; @@ -694,7 +694,7 @@ nfs_asyncio(bp, cred) bp->b_wcred = cred; } } - + TAILQ_INSERT_TAIL(&nfs_bufq, bp, b_freelist); nfs_iodwant[i] = (struct proc *)0; wakeup((caddr_t)&nfs_iodwant[i]); diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 3ccc10a..9aeb0d6 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.13 1995/04/21 02:58:49 dyson Exp $ + * $Id: nfs_subs.c,v 1.14 1995/05/29 04:01:09 davidg Exp $ */ /* @@ -137,7 +137,7 @@ nfsm_reqh(vp, procid, hsiz, bposp) MCLGET(mb, M_WAIT); mb->m_len = 0; bpos = mtod(mb, caddr_t); - + /* * For NQNFS, add lease request. */ @@ -723,7 +723,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) } /* * If v_type == VNON it is a new node, so fill in the v_type, - * n_mtime fields. Check to see if it represents a special + * n_mtime fields. Check to see if it represents a special * device, and if so, check for a possible alias. Once the * correct vnode has been obtained, fill in the rest of the * information. diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h index 994c0b6..030a985 100644 --- a/sys/nfs/nfs_common.h +++ b/sys/nfs/nfs_common.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93 - * $Id: nfsm_subs.h,v 1.4 1994/10/02 17:27:05 phk Exp $ + * $Id: nfsm_subs.h,v 1.5 1994/10/17 17:47:42 phk Exp $ */ #ifndef _NFS_NFSM_SUBS_H_ @@ -167,7 +167,7 @@ extern struct mbuf *nfsm_reqh(); mb = mreq = nfsm_reqh((v),(a),(s),&bpos) #define nfsm_reqdone m_freem(mrep); \ - nfsmout: + nfsmout: #define nfsm_rndup(a) (((a)+3)&(~0x3)) diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c index c204ea6..81571de 100644 --- a/sys/nfs/nfs_nqlease.c +++ b/sys/nfs/nfs_nqlease.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_nqlease.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_nqlease.c,v 1.9 1995/01/29 06:37:13 bde Exp $ + * $Id: nfs_nqlease.c,v 1.10 1995/02/15 03:39:58 davidg Exp $ */ /* @@ -821,7 +821,7 @@ nqnfs_getlease(vp, rwflag, cred, p) struct mbuf *mreq, *mrep, *md, *mb, *mb2; int cachable; u_quad_t frev; - + nfsstats.rpccnt[NQNFSPROC_GETLEASE]++; mb = mreq = nfsm_reqh(vp, NQNFSPROC_GETLEASE, NFSX_FH+2*NFSX_UNSIGNED, &bpos); @@ -862,7 +862,7 @@ nqnfs_vacated(vp, cred) struct mbuf *mreq, *mb, *mb2, *mheadend; struct nfsmount *nmp; struct nfsreq myrep; - + nmp = VFSTONFS(vp->v_mount); nfsstats.rpccnt[NQNFSPROC_VACATED]++; nfsm_reqhead(vp, NQNFSPROC_VACATED, NFSX_FH); diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index bd8f0c3..366a076 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.12 1995/03/19 12:04:11 davidg Exp $ + * $Id: nfs_serv.c,v 1.13 1995/05/29 04:01:08 davidg Exp $ */ /* @@ -966,7 +966,7 @@ nfsrv_rename(nfsd, mrep, md, dpos, cred, nam, mrq) fromnd.ni_cnd.cn_cred = cred; fromnd.ni_cnd.cn_nameiop = DELETE; fromnd.ni_cnd.cn_flags = WANTPARENT | SAVESTART; - error = nfs_namei(&fromnd, ffhp, len, nfsd->nd_slp, nam, &md, &dpos, + error = nfs_namei(&fromnd, ffhp, len, nfsd->nd_slp, nam, &md, &dpos, nfsd->nd_procp); if(error) nfsm_reply(0); @@ -1038,7 +1038,7 @@ out: vm_object_deallocate((vm_object_t) fvp->v_vmdata); if (deallocobjto) vm_object_deallocate((vm_object_t) tvp->v_vmdata); - + } else { VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd); if (tdvp == tvp) @@ -1574,7 +1574,7 @@ again: nfsm_clget; *tl = txdr_unsigned(nlen); bp += NFSX_UNSIGNED; - + /* And loop around copying the name */ xfer = nlen; cp = dp->d_name; @@ -1594,7 +1594,7 @@ again: for (i = 0; i < rem; i++) *bp++ = '\0'; nfsm_clget; - + /* Finish off the record */ *tl = txdr_unsigned(*cookiep); bp += NFSX_UNSIGNED; @@ -1761,7 +1761,7 @@ again: if (dp->d_fileno != 0) { nlen = dp->d_namlen; rem = nfsm_rndup(nlen)-nlen; - + /* * For readdir_and_lookup get the vnode using * the file number. @@ -1827,7 +1827,7 @@ again: nfsm_clget; *tl = txdr_unsigned(nlen); bp += NFSX_UNSIGNED; - + /* And loop around copying the name */ xfer = nlen; cp = dp->d_name; @@ -1847,7 +1847,7 @@ again: for (i = 0; i < rem; i++) *bp++ = '\0'; nfsm_clget; - + /* Finish off the record */ *tl = txdr_unsigned(*cookiep); bp += NFSX_UNSIGNED; diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index ccd187a..20253ef 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.5 1994/10/17 17:47:35 phk Exp $ + * $Id: nfs_socket.c,v 1.6 1995/03/16 18:15:37 bde Exp $ */ /* @@ -226,7 +226,7 @@ nfs_connect(nmp, rep) nmp->nm_so = (struct socket *)0; saddr = mtod(nmp->nm_nam, struct sockaddr *); - error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, + error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, nmp->nm_soproto); if (error) goto bad; @@ -529,7 +529,7 @@ tryagain: } so = rep->r_nmp->nm_so; if (!so) { - error = nfs_reconnect(rep); + error = nfs_reconnect(rep); if (error) { nfs_sndunlock(&rep->r_nmp->nm_flag); return (error); @@ -739,7 +739,7 @@ nfs_reply(myrep) } if (nam) m_freem(nam); - + /* * Get the xid and check that it is an rpc reply */ @@ -1493,7 +1493,7 @@ nfs_realign(m, hsiz) tcp = mtod(m, caddr_t); mnew = m; m2 = m->m_next; - + /* * If possible, only put the first invariant part * of the RPC header in the first mbuf. @@ -1501,7 +1501,7 @@ nfs_realign(m, hsiz) mlen = M_TRAILINGSPACE(m); if (olen <= hsiz && mlen > hsiz) mlen = hsiz; - + /* * Loop through the mbuf list consolidating data. */ @@ -1534,7 +1534,7 @@ nfs_realign(m, hsiz) fcp = mtod(m, caddr_t); } } - + /* * Finally, set m_len == 0 for any trailing mbufs that have * been copied out of. diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 3ccc10a..9aeb0d6 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.13 1995/04/21 02:58:49 dyson Exp $ + * $Id: nfs_subs.c,v 1.14 1995/05/29 04:01:09 davidg Exp $ */ /* @@ -137,7 +137,7 @@ nfsm_reqh(vp, procid, hsiz, bposp) MCLGET(mb, M_WAIT); mb->m_len = 0; bpos = mtod(mb, caddr_t); - + /* * For NQNFS, add lease request. */ @@ -723,7 +723,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) } /* * If v_type == VNON it is a new node, so fill in the v_type, - * n_mtime fields. Check to see if it represents a special + * n_mtime fields. Check to see if it represents a special * device, and if so, check for a possible alias. Once the * correct vnode has been obtained, fill in the rest of the * information. diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 8cdbfe7..f7e159f 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.4 1994/10/02 17:27:02 phk Exp $ + * $Id: nfs_syscalls.c,v 1.5 1994/10/17 17:47:38 phk Exp $ */ #include <sys/param.h> @@ -319,7 +319,7 @@ nfssvc_addsock(fp, mynam) siz = NFS_MAXPACKET + sizeof (u_long); else siz = NFS_MAXPACKET; - error = soreserve(so, siz, siz); + error = soreserve(so, siz, siz); if (error) { m_freem(mynam); return (error); diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 7e3c696..037d0dd 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.12 1995/03/16 20:23:46 wollman Exp $ + * $Id: nfs_vfsops.c,v 1.13 1995/05/14 03:00:01 davidg Exp $ */ #include <sys/param.h> @@ -198,7 +198,7 @@ nfs_mountroot() if (time.tv_sec == 0) time.tv_sec = 1; - /* + /* * XXX splnet, so networks will receive... */ splnet(); @@ -230,11 +230,11 @@ nfs_mountroot() */ for (i = strlen(nd->myif.ifra_name) - 1; - nd->myif.ifra_name[i] >= '0' && + nd->myif.ifra_name[i] >= '0' && nd->myif.ifra_name[i] <= '9'; nd->myif.ifra_name[i] ++) { error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, p); - if(!error) + if(!error) break; } if (error) @@ -281,7 +281,7 @@ nfs_mountroot() vp->v_flag = 0; VREF(vp); swaponvp(p, vp, NODEV, nd->swap_nblks * 2); - } + } /* * Create the rootfs mount point. diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 1cfe1a0..46484ea 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.13 1995/03/16 18:15:41 bde Exp $ + * $Id: nfs_vnops.c,v 1.14 1995/03/23 09:43:40 davidg Exp $ */ /* @@ -252,7 +252,7 @@ nfs_null(vp, cred, procp) caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep, *md, *mb; - + nfsm_reqhead(vp, NFSPROC_NULL, 0); nfsm_request(vp, NFSPROC_NULL, procp, cred); nfsm_reqdone; @@ -436,7 +436,7 @@ nfs_getattr(ap) caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep, *md, *mb, *mb2; - + /* * Update local times for special files. */ @@ -497,7 +497,7 @@ nfs_setattr(ap) break; default: if (np->n_flag & NMODIFIED) { - error = nfs_vinvalbuf(vp, + error = nfs_vinvalbuf(vp, vap->va_size ? V_SAVE : 0, ap->a_cred, ap->a_p, 1); if (error) @@ -1666,11 +1666,11 @@ nfs_readdirrpc(vp, uiop, cred) siz = 0; nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); more_dirs = fxdr_unsigned(int, *tl); - + /* Save the position so that we can do nfsm_mtouio() later */ dpos2 = dpos; md2 = md; - + /* loop thru the dir entries, doctoring them to 4bsd form */ #ifdef lint dp = (struct dirent *)0; @@ -1817,7 +1817,7 @@ nfs_readdirlookrpc(vp, uiop, cred) nfsm_request(vp, NQNFSPROC_READDIRLOOK, uiop->uio_procp, cred); nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); more_dirs = fxdr_unsigned(int, *tl); - + /* loop thru the dir entries, doctoring them to 4bsd form */ bigenough = 1; while (more_dirs && bigenough) { diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h index 994c0b6..030a985 100644 --- a/sys/nfs/nfsm_subs.h +++ b/sys/nfs/nfsm_subs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93 - * $Id: nfsm_subs.h,v 1.4 1994/10/02 17:27:05 phk Exp $ + * $Id: nfsm_subs.h,v 1.5 1994/10/17 17:47:42 phk Exp $ */ #ifndef _NFS_NFSM_SUBS_H_ @@ -167,7 +167,7 @@ extern struct mbuf *nfsm_reqh(); mb = mreq = nfsm_reqh((v),(a),(s),&bpos) #define nfsm_reqdone m_freem(mrep); \ - nfsmout: + nfsmout: #define nfsm_rndup(a) (((a)+3)&(~0x3)) diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index 057ffb6..f929012 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.12 1995/04/16 05:05:25 davidg Exp $ + * $Id: nfs_bio.c,v 1.13 1995/05/21 21:39:21 davidg Exp $ */ #include <sys/param.h> @@ -185,7 +185,7 @@ nfs_bioread(vp, uio, ioflag, cred) error = nfs_readdirrpc(vp, uio, cred); break; default: - printf(" NQNFSNONCACHE: type %x unexpected\n", + printf(" NQNFSNONCACHE: type %x unexpected\n", vp->v_type); break; }; @@ -694,7 +694,7 @@ nfs_asyncio(bp, cred) bp->b_wcred = cred; } } - + TAILQ_INSERT_TAIL(&nfs_bufq, bp, b_freelist); nfs_iodwant[i] = (struct proc *)0; wakeup((caddr_t)&nfs_iodwant[i]); diff --git a/sys/nfsclient/nfs_nfsiod.c b/sys/nfsclient/nfs_nfsiod.c index 8cdbfe7..f7e159f 100644 --- a/sys/nfsclient/nfs_nfsiod.c +++ b/sys/nfsclient/nfs_nfsiod.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.4 1994/10/02 17:27:02 phk Exp $ + * $Id: nfs_syscalls.c,v 1.5 1994/10/17 17:47:38 phk Exp $ */ #include <sys/param.h> @@ -319,7 +319,7 @@ nfssvc_addsock(fp, mynam) siz = NFS_MAXPACKET + sizeof (u_long); else siz = NFS_MAXPACKET; - error = soreserve(so, siz, siz); + error = soreserve(so, siz, siz); if (error) { m_freem(mynam); return (error); diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index ccd187a..20253ef 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.5 1994/10/17 17:47:35 phk Exp $ + * $Id: nfs_socket.c,v 1.6 1995/03/16 18:15:37 bde Exp $ */ /* @@ -226,7 +226,7 @@ nfs_connect(nmp, rep) nmp->nm_so = (struct socket *)0; saddr = mtod(nmp->nm_nam, struct sockaddr *); - error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, + error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, nmp->nm_soproto); if (error) goto bad; @@ -529,7 +529,7 @@ tryagain: } so = rep->r_nmp->nm_so; if (!so) { - error = nfs_reconnect(rep); + error = nfs_reconnect(rep); if (error) { nfs_sndunlock(&rep->r_nmp->nm_flag); return (error); @@ -739,7 +739,7 @@ nfs_reply(myrep) } if (nam) m_freem(nam); - + /* * Get the xid and check that it is an rpc reply */ @@ -1493,7 +1493,7 @@ nfs_realign(m, hsiz) tcp = mtod(m, caddr_t); mnew = m; m2 = m->m_next; - + /* * If possible, only put the first invariant part * of the RPC header in the first mbuf. @@ -1501,7 +1501,7 @@ nfs_realign(m, hsiz) mlen = M_TRAILINGSPACE(m); if (olen <= hsiz && mlen > hsiz) mlen = hsiz; - + /* * Loop through the mbuf list consolidating data. */ @@ -1534,7 +1534,7 @@ nfs_realign(m, hsiz) fcp = mtod(m, caddr_t); } } - + /* * Finally, set m_len == 0 for any trailing mbufs that have * been copied out of. diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 3ccc10a..9aeb0d6 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.13 1995/04/21 02:58:49 dyson Exp $ + * $Id: nfs_subs.c,v 1.14 1995/05/29 04:01:09 davidg Exp $ */ /* @@ -137,7 +137,7 @@ nfsm_reqh(vp, procid, hsiz, bposp) MCLGET(mb, M_WAIT); mb->m_len = 0; bpos = mtod(mb, caddr_t); - + /* * For NQNFS, add lease request. */ @@ -723,7 +723,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) } /* * If v_type == VNON it is a new node, so fill in the v_type, - * n_mtime fields. Check to see if it represents a special + * n_mtime fields. Check to see if it represents a special * device, and if so, check for a possible alias. Once the * correct vnode has been obtained, fill in the rest of the * information. diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 7e3c696..037d0dd 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.12 1995/03/16 20:23:46 wollman Exp $ + * $Id: nfs_vfsops.c,v 1.13 1995/05/14 03:00:01 davidg Exp $ */ #include <sys/param.h> @@ -198,7 +198,7 @@ nfs_mountroot() if (time.tv_sec == 0) time.tv_sec = 1; - /* + /* * XXX splnet, so networks will receive... */ splnet(); @@ -230,11 +230,11 @@ nfs_mountroot() */ for (i = strlen(nd->myif.ifra_name) - 1; - nd->myif.ifra_name[i] >= '0' && + nd->myif.ifra_name[i] >= '0' && nd->myif.ifra_name[i] <= '9'; nd->myif.ifra_name[i] ++) { error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, p); - if(!error) + if(!error) break; } if (error) @@ -281,7 +281,7 @@ nfs_mountroot() vp->v_flag = 0; VREF(vp); swaponvp(p, vp, NODEV, nd->swap_nblks * 2); - } + } /* * Create the rootfs mount point. diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 1cfe1a0..46484ea 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.13 1995/03/16 18:15:41 bde Exp $ + * $Id: nfs_vnops.c,v 1.14 1995/03/23 09:43:40 davidg Exp $ */ /* @@ -252,7 +252,7 @@ nfs_null(vp, cred, procp) caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep, *md, *mb; - + nfsm_reqhead(vp, NFSPROC_NULL, 0); nfsm_request(vp, NFSPROC_NULL, procp, cred); nfsm_reqdone; @@ -436,7 +436,7 @@ nfs_getattr(ap) caddr_t bpos, dpos; int error = 0; struct mbuf *mreq, *mrep, *md, *mb, *mb2; - + /* * Update local times for special files. */ @@ -497,7 +497,7 @@ nfs_setattr(ap) break; default: if (np->n_flag & NMODIFIED) { - error = nfs_vinvalbuf(vp, + error = nfs_vinvalbuf(vp, vap->va_size ? V_SAVE : 0, ap->a_cred, ap->a_p, 1); if (error) @@ -1666,11 +1666,11 @@ nfs_readdirrpc(vp, uiop, cred) siz = 0; nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); more_dirs = fxdr_unsigned(int, *tl); - + /* Save the position so that we can do nfsm_mtouio() later */ dpos2 = dpos; md2 = md; - + /* loop thru the dir entries, doctoring them to 4bsd form */ #ifdef lint dp = (struct dirent *)0; @@ -1817,7 +1817,7 @@ nfs_readdirlookrpc(vp, uiop, cred) nfsm_request(vp, NQNFSPROC_READDIRLOOK, uiop->uio_procp, cred); nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); more_dirs = fxdr_unsigned(int, *tl); - + /* loop thru the dir entries, doctoring them to 4bsd form */ bigenough = 1; while (more_dirs && bigenough) { diff --git a/sys/nfsclient/nfsm_subs.h b/sys/nfsclient/nfsm_subs.h index 994c0b6..030a985 100644 --- a/sys/nfsclient/nfsm_subs.h +++ b/sys/nfsclient/nfsm_subs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93 - * $Id: nfsm_subs.h,v 1.4 1994/10/02 17:27:05 phk Exp $ + * $Id: nfsm_subs.h,v 1.5 1994/10/17 17:47:42 phk Exp $ */ #ifndef _NFS_NFSM_SUBS_H_ @@ -167,7 +167,7 @@ extern struct mbuf *nfsm_reqh(); mb = mreq = nfsm_reqh((v),(a),(s),&bpos) #define nfsm_reqdone m_freem(mrep); \ - nfsmout: + nfsmout: #define nfsm_rndup(a) (((a)+3)&(~0x3)) diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index bd8f0c3..366a076 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.12 1995/03/19 12:04:11 davidg Exp $ + * $Id: nfs_serv.c,v 1.13 1995/05/29 04:01:08 davidg Exp $ */ /* @@ -966,7 +966,7 @@ nfsrv_rename(nfsd, mrep, md, dpos, cred, nam, mrq) fromnd.ni_cnd.cn_cred = cred; fromnd.ni_cnd.cn_nameiop = DELETE; fromnd.ni_cnd.cn_flags = WANTPARENT | SAVESTART; - error = nfs_namei(&fromnd, ffhp, len, nfsd->nd_slp, nam, &md, &dpos, + error = nfs_namei(&fromnd, ffhp, len, nfsd->nd_slp, nam, &md, &dpos, nfsd->nd_procp); if(error) nfsm_reply(0); @@ -1038,7 +1038,7 @@ out: vm_object_deallocate((vm_object_t) fvp->v_vmdata); if (deallocobjto) vm_object_deallocate((vm_object_t) tvp->v_vmdata); - + } else { VOP_ABORTOP(tond.ni_dvp, &tond.ni_cnd); if (tdvp == tvp) @@ -1574,7 +1574,7 @@ again: nfsm_clget; *tl = txdr_unsigned(nlen); bp += NFSX_UNSIGNED; - + /* And loop around copying the name */ xfer = nlen; cp = dp->d_name; @@ -1594,7 +1594,7 @@ again: for (i = 0; i < rem; i++) *bp++ = '\0'; nfsm_clget; - + /* Finish off the record */ *tl = txdr_unsigned(*cookiep); bp += NFSX_UNSIGNED; @@ -1761,7 +1761,7 @@ again: if (dp->d_fileno != 0) { nlen = dp->d_namlen; rem = nfsm_rndup(nlen)-nlen; - + /* * For readdir_and_lookup get the vnode using * the file number. @@ -1827,7 +1827,7 @@ again: nfsm_clget; *tl = txdr_unsigned(nlen); bp += NFSX_UNSIGNED; - + /* And loop around copying the name */ xfer = nlen; cp = dp->d_name; @@ -1847,7 +1847,7 @@ again: for (i = 0; i < rem; i++) *bp++ = '\0'; nfsm_clget; - + /* Finish off the record */ *tl = txdr_unsigned(*cookiep); bp += NFSX_UNSIGNED; diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index ccd187a..20253ef 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.5 1994/10/17 17:47:35 phk Exp $ + * $Id: nfs_socket.c,v 1.6 1995/03/16 18:15:37 bde Exp $ */ /* @@ -226,7 +226,7 @@ nfs_connect(nmp, rep) nmp->nm_so = (struct socket *)0; saddr = mtod(nmp->nm_nam, struct sockaddr *); - error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, + error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, nmp->nm_soproto); if (error) goto bad; @@ -529,7 +529,7 @@ tryagain: } so = rep->r_nmp->nm_so; if (!so) { - error = nfs_reconnect(rep); + error = nfs_reconnect(rep); if (error) { nfs_sndunlock(&rep->r_nmp->nm_flag); return (error); @@ -739,7 +739,7 @@ nfs_reply(myrep) } if (nam) m_freem(nam); - + /* * Get the xid and check that it is an rpc reply */ @@ -1493,7 +1493,7 @@ nfs_realign(m, hsiz) tcp = mtod(m, caddr_t); mnew = m; m2 = m->m_next; - + /* * If possible, only put the first invariant part * of the RPC header in the first mbuf. @@ -1501,7 +1501,7 @@ nfs_realign(m, hsiz) mlen = M_TRAILINGSPACE(m); if (olen <= hsiz && mlen > hsiz) mlen = hsiz; - + /* * Loop through the mbuf list consolidating data. */ @@ -1534,7 +1534,7 @@ nfs_realign(m, hsiz) fcp = mtod(m, caddr_t); } } - + /* * Finally, set m_len == 0 for any trailing mbufs that have * been copied out of. diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 3ccc10a..9aeb0d6 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.13 1995/04/21 02:58:49 dyson Exp $ + * $Id: nfs_subs.c,v 1.14 1995/05/29 04:01:09 davidg Exp $ */ /* @@ -137,7 +137,7 @@ nfsm_reqh(vp, procid, hsiz, bposp) MCLGET(mb, M_WAIT); mb->m_len = 0; bpos = mtod(mb, caddr_t); - + /* * For NQNFS, add lease request. */ @@ -723,7 +723,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) } /* * If v_type == VNON it is a new node, so fill in the v_type, - * n_mtime fields. Check to see if it represents a special + * n_mtime fields. Check to see if it represents a special * device, and if so, check for a possible alias. Once the * correct vnode has been obtained, fill in the rest of the * information. diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 8cdbfe7..f7e159f 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.4 1994/10/02 17:27:02 phk Exp $ + * $Id: nfs_syscalls.c,v 1.5 1994/10/17 17:47:38 phk Exp $ */ #include <sys/param.h> @@ -319,7 +319,7 @@ nfssvc_addsock(fp, mynam) siz = NFS_MAXPACKET + sizeof (u_long); else siz = NFS_MAXPACKET; - error = soreserve(so, siz, siz); + error = soreserve(so, siz, siz); if (error) { m_freem(mynam); return (error); diff --git a/sys/nfsserver/nfsm_subs.h b/sys/nfsserver/nfsm_subs.h index 994c0b6..030a985 100644 --- a/sys/nfsserver/nfsm_subs.h +++ b/sys/nfsserver/nfsm_subs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsm_subs.h 8.1 (Berkeley) 6/16/93 - * $Id: nfsm_subs.h,v 1.4 1994/10/02 17:27:05 phk Exp $ + * $Id: nfsm_subs.h,v 1.5 1994/10/17 17:47:42 phk Exp $ */ #ifndef _NFS_NFSM_SUBS_H_ @@ -167,7 +167,7 @@ extern struct mbuf *nfsm_reqh(); mb = mreq = nfsm_reqh((v),(a),(s),&bpos) #define nfsm_reqdone m_freem(mrep); \ - nfsmout: + nfsmout: #define nfsm_rndup(a) (((a)+3)&(~0x3)) diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c index f07222b..6028455 100644 --- a/sys/pci/aic7870.c +++ b/sys/pci/aic7870.c @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7870.c,v 1.8 1995/03/31 14:08:33 gibbs Exp $ + * $Id: aic7870.c,v 1.9 1995/04/15 21:38:34 gibbs Exp $ */ #include <pci.h> @@ -53,9 +53,9 @@ struct pci_device ahc_device = { DATA_SET (pcidevice_set, ahc_device); -static char* +static char* aic7870_probe (pcici_t tag, pcidi_t type) -{ +{ switch(type) { case PCI_DEVICE_ID_ADAPTEC_2940: return ("Adaptec 294X SCSI host adapter"); @@ -74,8 +74,8 @@ void aic7870_attach(config_id, unit) pcici_t config_id; int unit; -{ - u_long io_port; +{ + u_long io_port; unsigned opri = 0; ahc_type ahc_t = AHC_NONE; if(!(io_port = pci_conf_read(config_id, PCI_BASEADR0))) @@ -86,11 +86,11 @@ aic7870_attach(config_id, unit) * set hence we subtract 0xc01 instead of the * 0xc00 that you would expect. */ - io_port -= 0xc01ul; + io_port -= 0xc01ul; switch (pci_conf_read (config_id, PCI_ID_REG)) { case PCI_DEVICE_ID_ADAPTEC_2940: - ahc_t = AHC_294; + ahc_t = AHC_294; break; case PCI_DEVICE_ID_ADAPTEC_AIC7870: ahc_t = AHC_AIC7870; @@ -121,6 +121,6 @@ aic7870_attach(config_id, unit) splx(opri); } return; -} +} #endif /* NPCI > 0 */ diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 2767cce..7a0eee7 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_de.c,v 1.26 1995/05/22 13:32:24 davidg Exp $ + * $Id: if_de.c,v 1.27 1995/05/26 02:02:44 davidg Exp $ * */ @@ -187,7 +187,7 @@ typedef struct { * And the number of receive descriptors multiplied by the size * of the receive buffers must equal the recevive space. This * is so that we can manipulate the page tables so that even if a - * packet wraps around the end of the receive space, we can + * packet wraps around the end of the receive space, we can * treat it as virtually contiguous. * * The above used to be true (the stupid restriction is still true) @@ -257,7 +257,7 @@ struct _tulip_softc_t { #ifndef IFF_ALTPHYS #define IFF_ALTPHYS IFF_LINK0 /* In case it isn't defined */ #endif -static const char *tulip_chipdescs[] = { +static const char *tulip_chipdescs[] = { "DC21040 [10Mb/s]", "DC21140 [10-100Mb/s]", "DC21041 [10Mb/s]" @@ -500,7 +500,7 @@ tulip_reset( tulip_desc_t *di; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ @@ -532,7 +532,7 @@ tulip_reset( di->d_status = 0; /* - * We need to collect all the mbufs were on the + * We need to collect all the mbufs were on the * receive ring before we reinit it either to put * them back on or to know if we have to allocate * more. @@ -648,7 +648,7 @@ tulip_rx_intr( if (((volatile tulip_desc_t *) eop)->d_status & TULIP_DSTS_OWNER) break; - + total_len = ((eop->d_status >> 16) & 0x7FF) - 4; IF_DEQUEUE(&sc->tulip_rxq, m); if ((eop->d_status & TULIP_DSTS_ERRSUM) == 0) { @@ -1056,8 +1056,8 @@ tulip_idle_srom( tulip_softc_t * const sc) { unsigned bit, csr; - - csr = SROMSEL | SROMRD; EMIT; + + csr = SROMSEL | SROMRD; EMIT; csr ^= SROMCS; EMIT; csr ^= SROMCLKON; EMIT; @@ -1073,12 +1073,12 @@ tulip_idle_srom( csr = 0; EMIT; } - + static void tulip_read_srom( tulip_softc_t * const sc) -{ - int idx; +{ + int idx; const unsigned bitwidth = SROM_BITWIDTH; const unsigned cmdmask = (SROMCMD_RD << bitwidth); const unsigned msb = 1 << (bitwidth + 3 - 1); @@ -1091,7 +1091,7 @@ tulip_read_srom( csr = SROMSEL | SROMRD; EMIT; csr ^= SROMCSON; EMIT; csr ^= SROMCLKON; EMIT; - + lastbit = 0; for (bits = idx|cmdmask, bit = bitwidth + 3; bit > 0; bit--, bits <<= 1) { const unsigned thisbit = bits & msb; @@ -1106,7 +1106,7 @@ tulip_read_srom( for (data = 0, bits = 0; bits < 16; bits++) { data <<= 1; - csr ^= SROMCLKON; EMIT; /* clock high; data valid */ + csr ^= SROMCLKON; EMIT; /* clock high; data valid */ data |= TULIP_READ_CSR(sc, csr_srom_mii) & SROMDIN ? 1 : 0; csr ^= SROMCLKOFF; EMIT; /* clock low; data not valid */ } @@ -1227,7 +1227,7 @@ tulip_read_macaddr( if (cksum >= 65535) cksum -= 65535; rom_cksum = *(u_short *) &sc->tulip_rombuf[6]; - + if (cksum != rom_cksum) return -1; @@ -1274,8 +1274,8 @@ tulip_addr_filter( ETHER_NEXT_MULTI(step, enm); } sc->tulip_flags |= TULIP_WANTHASH; - sp[39] = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; - sp[40] = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; + sp[39] = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; + sp[40] = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; sp[41] = ((u_short *) sc->tulip_ac.ac_enaddr)[2]; } else { /* @@ -1284,8 +1284,8 @@ tulip_addr_filter( i = 0; ETHER_FIRST_MULTI(step, &sc->tulip_ac, enm); for (; enm != NULL; i++) { - *sp++ = ((u_short *) enm->enm_addrlo)[0]; - *sp++ = ((u_short *) enm->enm_addrlo)[1]; + *sp++ = ((u_short *) enm->enm_addrlo)[0]; + *sp++ = ((u_short *) enm->enm_addrlo)[1]; *sp++ = ((u_short *) enm->enm_addrlo)[2]; ETHER_NEXT_MULTI(step, enm); } @@ -1302,8 +1302,8 @@ tulip_addr_filter( * Pad the rest with our hardware address */ for (; i < 16; i++) { - *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; - *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; + *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[0]; + *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[1]; *sp++ = ((u_short *) sc->tulip_ac.ac_enaddr)[2]; } } @@ -1441,11 +1441,11 @@ tulip_attach( ifp->if_ioctl = tulip_ioctl; ifp->if_output = ether_output; ifp->if_start = tulip_start; - + #ifdef __FreeBSD__ printf("%s%d", sc->tulip_name, sc->tulip_unit); #endif - printf(": %s%s pass %d.%d Ethernet address %s\n", + printf(": %s%s pass %d.%d Ethernet address %s\n", sc->tulip_boardsw->bd_description, tulip_chipdescs[sc->tulip_chipid], (sc->tulip_revinfo & 0xF0) >> 4, @@ -1550,7 +1550,7 @@ tulip_pci_shutdown( if (kdc->kdc_unit < NDE) { tulip_softc_t * const sc = TULIP_UNIT_TO_SOFTC(kdc->kdc_unit); TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } @@ -1595,7 +1595,7 @@ tulip_pci_shutdown( { tulip_softc_t * const sc = (tulip_softc_t *) arg; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } @@ -1684,7 +1684,7 @@ tulip_pci_shutdown( { tulip_softc_t * const sc = (tulip_softc_t *) arg; TULIP_WRITE_CSR(sc, csr_busmode, TULIP_BUSMODE_SWRESET); - DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at + DELAY(10); /* Wait 10 microsends (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a bit longer anyways) */ } diff --git a/sys/pci/if_pdq.c b/sys/pci/if_pdq.c index 577b2fe..2c8885bd 100644 --- a/sys/pci/if_pdq.c +++ b/sys/pci/if_pdq.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_pdq.c,v 1.4 1995/03/25 22:06:27 bde Exp $ + * $Id: if_pdq.c,v 1.5 1995/04/05 08:19:23 davidg Exp $ * */ @@ -417,7 +417,7 @@ pdq_ifattach( ifp->if_ioctl = pdq_ifioctl; ifp->if_output = fddi_output; ifp->if_start = pdq_ifstart; - + if_attach(ifp); fddi_ifattach(ifp); #if NBPFILTER > 0 diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 7b733ad..74fb3c5 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: ncr.c,v 1.35 1995/03/22 19:45:22 se Exp $ +** $Id: ncr.c,v 1.36 1995/03/31 00:05:08 se Exp $ ** ** Device driver for the NCR 53C810 PCI-SCSI-Controller. ** @@ -1216,7 +1216,7 @@ static void ncr_attach (pcici_t tag, int unit); static char ident[] = - "\n$Id: ncr.c,v 1.35 1995/03/22 19:45:22 se Exp $\n"; + "\n$Id: ncr.c,v 1.36 1995/03/31 00:05:08 se Exp $\n"; u_long ncr_version = NCR_VERSION + (u_long) sizeof (struct ncb) @@ -2941,7 +2941,7 @@ static void ncr_script_copy_and_bind (struct script *script, ncb_p np) start = src; end = src + (sizeof(struct script) / 4); - + while (src < end) { *dst++ = opcode = *src++; @@ -3449,7 +3449,7 @@ static INT32 ncr_start (struct scsi_xfer * xp) int i, oldspl, segments, flags = xp->flags; u_char ptr, nego, idmsg; u_long msglen, msglen2; - + /*--------------------------------------------- @@ -3592,7 +3592,7 @@ static INT32 ncr_start (struct scsi_xfer * xp) /* ** negotiate synchronous transfers? */ - + if (!tp->period) { if (tp->inqdata[7] & INQ7_SYNC) { nego = NS_SYNC; @@ -4560,7 +4560,7 @@ static void ncr_setmaxtags (tcb_p tp, u_long usrtags) static void ncr_settags (tcb_p tp, lcb_p lp) { u_char reqtags, tmp; - + if ((!tp) || (!lp)) return; /* @@ -6050,9 +6050,9 @@ static void ncr_alloc_ccb (ncb_p np, struct scsi_xfer * xp) tp->getscr[4] = vtophys (&tp->wval); tp->getscr[5] = np->paddr + offsetof (struct ncr_reg, nc_scntl3); - assert (( (offsetof(struct ncr_reg, nc_sxfer) ^ + assert (( (offsetof(struct ncr_reg, nc_sxfer) ^ offsetof(struct tcb , sval )) &3) == 0); - assert (( (offsetof(struct ncr_reg, nc_scntl3) ^ + assert (( (offsetof(struct ncr_reg, nc_scntl3) ^ offsetof(struct tcb , wval )) &3) == 0); tp->call_lun.l_cmd = (SCR_CALL); diff --git a/sys/pci/pci.c b/sys/pci/pci.c index e124740..0d0c2f8 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pci.c,v 1.21 1995/03/23 06:14:44 davidg Exp $ +** $Id: pci.c,v 1.22 1995/05/04 06:57:11 davidg Exp $ ** ** General subroutines for the PCI bus. ** pci_configure () @@ -113,7 +113,7 @@ struct pcicb { static int pci_externalize (struct proc *, struct kern_devconf *, void *, size_t); - + static int pci_internalize (struct proc *, struct kern_devconf *, void *, size_t); @@ -234,7 +234,7 @@ pci_register_io (struct pcicb * cb, u_int base, u_int limit) cb->pcicb_pupto = limit; /* - ** XXX should set bridge io mapping here + ** XXX should set bridge io mapping here ** but it can be mapped in 4k blocks only, ** leading to conflicts with isa/eisa .. */ @@ -1097,8 +1097,8 @@ pci_externalize (struct proc *p, struct kern_devconf *kdcp, void *u, size_t l) return copyout(&buffer, u, sizeof buffer); } - - + + static int pci_internalize (struct proc *p, struct kern_devconf *kdcp, void *u, size_t s) { @@ -1476,7 +1476,7 @@ static struct vt VendorTable[] = { static const char *const majclasses[] = { "old", "storage", "network", "display", - "multimedia", "memory", "bridge" + "multimedia", "memory", "bridge" }; void not_supported (pcici_t tag, u_long type) diff --git a/sys/pci/pcivar.h b/sys/pci/pcivar.h index 712c670..207a743 100644 --- a/sys/pci/pcivar.h +++ b/sys/pci/pcivar.h @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcivar.h,v 1.4 1995/03/21 23:01:06 se Exp $ +** $Id: pcivar.h,v 1.5 1995/03/25 21:10:38 bde Exp $ ** ** Declarations for pci device drivers. ** @@ -159,8 +159,8 @@ extern unsigned pci_maxdevice; struct pci_info { u_short pi_bus; u_short pi_device; -}; - +}; + #define PCI_EXT_CONF_LEN (16) #define PCI_EXTERNAL_LEN (sizeof(struct pci_externalize_buffer)) diff --git a/sys/pci/pdq.c b/sys/pci/pdq.c index 0460ee5..610458b 100644 --- a/sys/pci/pdq.c +++ b/sys/pci/pdq.c @@ -21,9 +21,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pdq.c,v 1.3 1995/03/25 22:40:48 bde Exp $ + * $Id: pdq.c,v 1.4 1995/04/01 01:43:56 davidg Exp $ * * $Log: pdq.c,v $ + * Revision 1.4 1995/04/01 01:43:56 davidg + * Patch from Matt Thomas to fix mbuf leak in FDDI driver. + * * Revision 1.3 1995/03/25 22:40:48 bde * Remove wrong redeclarations of printf() and bzero(). Include the correct * header to declare DELAY(). @@ -78,7 +81,7 @@ #if defined(PDQTEST) && !defined(PDQ_NOPRINTF) #define PDQ_PRINTF(x) printf x #else -#define PDQ_PRINTF(x) +#define PDQ_PRINTF(x) #endif const char * const pdq_halt_codes[] = { @@ -93,7 +96,7 @@ const char * const pdq_adapter_states[] = { }; /* - * The following are used in conjunction with + * The following are used in conjunction with * unsolicited events */ const char * const pdq_entities[] = { @@ -177,7 +180,7 @@ const char * const pdq_pmd_types100[] = { "Unshielded Twisted Pair" }; -const char * const * const pdq_pmd_types[] = { +const char * const * const pdq_pmd_types[] = { pdq_pmd_types0, pdq_pmd_types100 }; @@ -764,7 +767,7 @@ pdq_process_received_data( * the real length. */ pdulen = datalen - 4 /* CRC */ + 1 /* FC */; - segcnt = (pdulen + PDQ_RX_FC_OFFSET + PDQ_OS_DATABUF_SIZE - 1) / PDQ_OS_DATABUF_SIZE; + segcnt = (pdulen + PDQ_RX_FC_OFFSET + PDQ_OS_DATABUF_SIZE - 1) / PDQ_OS_DATABUF_SIZE; PDQ_OS_DATABUF_ALLOC(npdu); if (npdu == NULL) { printf("discard: no databuf #0\n"); @@ -784,7 +787,7 @@ pdq_process_received_data( } PDQ_OS_DATABUF_NEXT_SET(lpdu, NULL); for (idx = 0; idx < PDQ_RX_SEGCNT; idx++) { - buffers[(producer + idx) & ring_mask] = + buffers[(producer + idx) & ring_mask] = buffers[(completion + idx) & ring_mask]; buffers[(completion + idx) & ring_mask] = NULL; } @@ -833,8 +836,8 @@ pdq_process_received_data( rxd->rxd_pa_hi = 0; rxd->rxd_seg_len_hi = PDQ_OS_DATABUF_SIZE / 16; rxd->rxd_pa_lo = PDQ_OS_VA_TO_PA(PDQ_OS_DATABUF_PTR(buffers[rx->rx_producer])); - PDQ_ADVANCE(rx->rx_producer, 1, ring_mask); - PDQ_ADVANCE(producer, 1, ring_mask); + PDQ_ADVANCE(rx->rx_producer, 1, ring_mask); + PDQ_ADVANCE(producer, 1, ring_mask); PDQ_ADVANCE(completion, 1, ring_mask); } } @@ -995,7 +998,7 @@ pdq_flush_transmitter( } /* - * The following routine brings the PDQ from whatever state it is + * The following routine brings the PDQ from whatever state it is * in to DMA_UNAVAILABLE (ie. like a RESET but without doing a RESET). */ pdq_state_t @@ -1125,7 +1128,7 @@ pdq_stop( pdq->pdq_tx_info.tx_free = PDQ_RING_MASK(pdq->pdq_dbp->pdqdb_transmits); /* - * Allow the DEFPA to do DMA. Then program the physical + * Allow the DEFPA to do DMA. Then program the physical * addresses of the consumer and descriptor blocks. */ if (pdq->pdq_type == PDQ_DEFPA) { @@ -1169,7 +1172,7 @@ pdq_stop( PDQ_OS_USEC_DELAY(1000); } PDQ_ASSERT(state == PDQS_DMA_AVAILABLE); - + *csrs->csr_host_int_type_0 = 0xFF; *csrs->csr_host_int_enable = 0 /* PDQ_HOST_INT_STATE_CHANGE |PDQ_HOST_INT_FATAL_ERROR|PDQ_HOST_INT_CMD_RSP_ENABLE diff --git a/sys/pci/pdqreg.h b/sys/pci/pdqreg.h index d664aa9..08038f4 100644 --- a/sys/pci/pdqreg.h +++ b/sys/pci/pdqreg.h @@ -21,9 +21,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pdqreg.h,v 1.5 1995/03/10 17:41:55 thomas Exp $ + * $Id: pdqreg.h,v 1.1 1995/03/14 09:16:07 davidg Exp $ * * $Log: pdqreg.h,v $ + * Revision 1.1 1995/03/14 09:16:07 davidg + * Added support for generic FDDI and the DEC DEFEA and DEFPA FDDI adapters. + * + * Submitted by: Matt Thomas + * * Revision 1.5 1995/03/10 17:41:55 thomas * Add DEFTA, DEFQA, and DEFAA * @@ -1046,7 +1051,7 @@ typedef enum { PDQ_LINK_EVENT_ARGUMENT_REASON=0, /* pdq_rireason_t */ PDQ_LINK_EVENT_ARGUMENT_DATA_LINK_HEADER=1, /* pdq_dlhdr_t */ PDQ_LINK_EVENT_ARGUMENT_SOURCE=2, /* pdq_lanaddr_t */ - PDQ_LINK_EVENT_ARGUMENT_UPSTREAM_NEIGHBOR=3,/* pdq_lanaddr_t */ + PDQ_LINK_EVENT_ARGUMENT_UPSTREAM_NEIGHBOR=3,/* pdq_lanaddr_t */ PDQ_LINK_EVENT_ARGUMENT_EOL=0xFF } pdq_link_event_argument_t; diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index cb6b010..550b5da 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: cd.c,v 1.39 1995/04/23 22:07:48 gibbs Exp $ + * $Id: cd.c,v 1.40 1995/05/03 18:09:06 dufault Exp $ */ #define SPLCD splbio @@ -128,7 +128,7 @@ struct scsi_device cd_switch = #define CD_EJECT -2 static int -cd_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, +cd_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, size_t len) { return scsi_externalize(SCSI_LINK(&cd_switch, kdc->kdc_unit), @@ -170,7 +170,7 @@ cd_registerdev(int unit) * The routine called by the low level scsi routine when it discovers * A device suitable for this driver */ -int +int cdattach(struct scsi_link *sc_link) { u_int32 unit; @@ -211,7 +211,7 @@ cdattach(struct scsi_link *sc_link) /* * open the device. Make sure the partition info is a up-to-date as can be. */ -errval +errval cd_open(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -268,7 +268,7 @@ struct scsi_link *sc_link) scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT); SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted ")); /* - * Load the physical device parameters + * Load the physical device parameters */ if (cd_get_parms(unit, 0)) { errcode = ENXIO; @@ -325,7 +325,7 @@ struct scsi_link *sc_link) * close the device.. only called if we are the LAST * occurence of an open device */ -errval +errval cd_close(dev_t dev, int flag, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -356,7 +356,7 @@ cd_close(dev_t dev, int flag, int fmt, struct proc *p, * understand. The transfer is described by a buf and will include only one * physical transfer. */ -void +void cd_strategy(struct buf *bp, struct scsi_link *sc_link) { struct buf *dp; @@ -447,7 +447,7 @@ cd_strategy(struct buf *bp, struct scsi_link *sc_link) * must be called at the correct (highish) spl level * cdstart() is called at SPLCD from cdstrategy and scsi_done */ -void +void cdstart(unit, flags) u_int32 unit; u_int32 flags; @@ -484,7 +484,7 @@ cdstart(unit, flags) goto bad; /* no I/O.. media changed or something */ } /* - * We have a buf, now we should make a command + * We have a buf, now we should make a command * * First, translate the block to absolute and put it in terms of the * logical blocksize of the device. Really a bit silly until we have @@ -544,7 +544,7 @@ cdstart(unit, flags) * Perform special action on behalf of the user. * Knows about the internals of this device */ -errval +errval cd_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p, struct scsi_link *sc_link) { @@ -582,7 +582,7 @@ struct scsi_link *sc_link) break; /* - * a bit silly, but someone might want to test something on a + * a bit silly, but someone might want to test something on a * section of cdrom. */ case DIOCWDINFO: @@ -675,7 +675,7 @@ struct scsi_link *sc_link) args->data_format, args->track, &data, len); if (error) break; - len = min(len, ((data.header.data_len[0] << 8) + + len = min(len, ((data.header.data_len[0] << 8) + data.header.data_len[1] + sizeof(struct cd_sub_channel_header))); if (copyout(&data, args->data, len) != 0) { @@ -686,7 +686,7 @@ struct scsi_link *sc_link) case CDIOREADTOCHEADER: { /* ??? useless bcopy? XXX */ struct ioc_toc_header th; - error = cd_read_toc(unit, 0, 0, + error = cd_read_toc(unit, 0, 0, (struct cd_toc_entry *)&th, sizeof th); if (error) break; @@ -887,11 +887,11 @@ struct scsi_link *sc_link) /* * Load the label information on the named device * Actually fabricate a disklabel - * + * * EVENTUALLY take information about different * data tracks from the TOC and put it in the disklabel */ -errval +errval cd_getdisklabel(unit) u_int8 unit; { @@ -940,7 +940,7 @@ cd_getdisklabel(unit) /* * Find out from the device what it's capacity is */ -u_int32 +u_int32 cd_size(unit, flags) int unit; int flags; @@ -997,7 +997,7 @@ cd_size(unit, flags) /* * Get the requested page into the buffer given */ -static errval +static errval cd_get_mode(unit, data, page) u_int32 unit; struct cd_mode_data *data; @@ -1026,7 +1026,7 @@ cd_get_mode(unit, data, page) /* * Get the requested page into the buffer given */ -errval +errval cd_set_mode(unit, data) u_int32 unit; struct cd_mode_data *data; @@ -1052,7 +1052,7 @@ cd_set_mode(unit, data) /* * Get scsi driver to send a "start playing" command */ -errval +errval cd_play(unit, blk, len) u_int32 unit, blk, len; { @@ -1080,7 +1080,7 @@ cd_play(unit, blk, len) /* * Get scsi driver to send a "start playing" command */ -errval +errval cd_play_big(unit, blk, len) u_int32 unit, blk, len; { @@ -1110,7 +1110,7 @@ cd_play_big(unit, blk, len) /* * Get scsi driver to send a "start playing" command */ -errval +errval cd_play_tracks(unit, strack, sindex, etrack, eindex) u_int32 unit, strack, sindex, etrack, eindex; { @@ -1136,7 +1136,7 @@ cd_play_tracks(unit, strack, sindex, etrack, eindex) /* * Get scsi driver to send a "play msf" command */ -errval +errval cd_play_msf(unit, startm, starts, startf, endm, ends, endf) u_int32 unit, startm, starts, startf, endm, ends, endf; { @@ -1165,7 +1165,7 @@ cd_play_msf(unit, startm, starts, startf, endm, ends, endf) /* * Get scsi driver to send a "start up" command */ -errval +errval cd_pause(unit, go) u_int32 unit, go; { @@ -1189,7 +1189,7 @@ cd_pause(unit, go) /* * Get scsi driver to send a "RESET" command */ -errval +errval cd_reset(unit) u_int32 unit; { @@ -1199,7 +1199,7 @@ cd_reset(unit) /* * Read subchannel */ -errval +errval cd_read_subchannel(unit, mode, format, track, data, len) u_int32 unit, mode, format; int track; @@ -1232,7 +1232,7 @@ cd_read_subchannel(unit, mode, format, track, data, len) /* * Read table of contents */ -static errval +static errval cd_read_toc(unit, mode, start, data, len) u_int32 unit, mode, start; struct cd_toc_entry *data; @@ -1270,7 +1270,7 @@ cd_read_toc(unit, mode, start, data, len) * Get the scsi driver to send a full inquiry to the device and use the * results to fill out the disk parameter structure. */ -static errval +static errval cd_get_parms(unit, flags) int unit; int flags; @@ -1284,7 +1284,7 @@ cd_get_parms(unit, flags) return (0); /* * give a number of sectors so that sec * trks * cyls - * is <= disk_size + * is <= disk_size */ if (cd_size(unit, flags)) { sc_link->flags |= SDEV_MEDIA_LOADED; diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index 14534b7..a7c36d9 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,8 +1,8 @@ -/* +/* * Written by grefen@????? * Based on scsi drivers by Julian Elischer (julian@tfs.com) * - * $Id: ch.c,v 1.19 1995/05/03 18:09:08 dufault Exp $ + * $Id: ch.c,v 1.20 1995/05/11 19:26:46 rgrimes Exp $ */ #include <sys/types.h> @@ -95,7 +95,7 @@ struct scsi_device ch_switch = #define CH_OPEN 0x01 static int -ch_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, +ch_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, size_t len) { return scsi_externalize(SCSI_LINK(&ch_switch, kdc->kdc_unit), @@ -128,7 +128,7 @@ ch_registerdev(int unit) * The routine called by the low level scsi routine when it discovers * a device suitable for this driver. */ -errval +errval chattach(struct scsi_link *sc_link) { u_int32 unit; @@ -156,7 +156,7 @@ chattach(struct scsi_link *sc_link) /* * open the device. */ -errval +errval ch_open(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -205,7 +205,7 @@ struct scsi_link *sc_link) * close the device.. only called if we are the LAST * occurence of an open device */ -errval +errval ch_close(dev_t dev, int flag, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -218,7 +218,7 @@ ch_close(dev_t dev, int flag, int fmt, struct proc *p, * Perform special action on behalf of the user * Knows about the internals of this device */ -errval +errval ch_ioctl(dev_t dev, int cmd, caddr_t arg, int mode, struct proc *p, struct scsi_link *sc_link) { @@ -277,7 +277,7 @@ struct proc *p, struct scsi_link *sc_link) return (ret ? ESUCCESS : EIO); } -errval +errval ch_getelem(unit, stat, type, from, data, flags) u_int32 unit, from, flags; int type; @@ -317,7 +317,7 @@ ch_getelem(unit, stat, type, from, data, flags) return ret; } -errval +errval ch_move(unit, stat, chm, from, to, flags) u_int32 unit, chm, from, to, flags; short *stat; @@ -353,7 +353,7 @@ ch_move(unit, stat, chm, from, to, flags) return ret; } -errval +errval ch_position(unit, stat, chm, to, flags) u_int32 unit, chm, to, flags; short *stat; @@ -395,10 +395,10 @@ ch_position(unit, stat, chm, to, flags) /* * Get the scsi driver to send a full inquiry to the - * device and use the results to fill out the global + * device and use the results to fill out the global * parameter structure. */ -static errval +static errval ch_mode_sense(unit, flags) u_int32 unit, flags; { @@ -424,7 +424,7 @@ ch_mode_sense(unit, flags) return 0; /* - * First do a mode sense + * First do a mode sense */ /* sc_link->flags &= ~SDEV_MEDIA_LOADED; *//*XXX */ bzero(&scsi_cmd, sizeof(scsi_cmd)); diff --git a/sys/scsi/pt.c b/sys/scsi/pt.c index 3194cd8..2d1a10b 100644 --- a/sys/scsi/pt.c +++ b/sys/scsi/pt.c @@ -1,4 +1,4 @@ -/* +/* * pt: Processor Type driver. * * Copyright (C) 1995, HD Associates, Inc. @@ -37,7 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: pt.c,v 1.3 1995/04/23 22:07:49 gibbs Exp $ + * $Id: pt.c,v 1.4 1995/05/03 18:09:09 dufault Exp $ */ /* @@ -99,7 +99,7 @@ struct scsi_device pt_switch = * continues to be drained. * ptstart() is called at splbio */ -void +void ptstart(unit, flags) u_int32 unit; u_int32 flags; @@ -170,7 +170,7 @@ ptstart(unit, flags) } /* go back and see if we can cram more work in.. */ } -void +void pt_strategy(struct buf *bp, struct scsi_link *sc_link) { struct buf **dp; @@ -183,9 +183,9 @@ pt_strategy(struct buf *bp, struct scsi_link *sc_link) opri = splbio(); - /* + /* * Use a bounce buffer if necessary - */ + */ #ifdef BOUNCE_BUFFERS if (sc_link->flags & SDEV_BOUNCE) vm_bounce_alloc(bp); diff --git a/sys/scsi/scsi_all.h b/sys/scsi/scsi_all.h index 7d806c7..8da591e 100644 --- a/sys/scsi/scsi_all.h +++ b/sys/scsi/scsi_all.h @@ -4,7 +4,7 @@ * * TRW Financial Systems, in accordance with their agreement with Carnegie * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with + * or use in any manner that they see fit as long as this message is kept with * the software. For this reason TFS also grants any other persons or * organisations permission to use or modify this software. * @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsi_all.h,v 1.11 1995/03/04 12:36:55 bde Exp $ + * $Id: scsi_all.h,v 1.12 1995/04/14 15:10:29 dufault Exp $ */ /* @@ -344,7 +344,7 @@ struct scsi_mode_header_big */ #define SCSI_OK 0x00 #define SCSI_CHECK 0x02 -#define SCSI_BUSY 0x08 +#define SCSI_BUSY 0x08 #define SCSI_INTERM 0x10 #define SCSI_QUEUE_FULL 0x28 #endif /*_SCSI_SCSI_ALL_H*/ diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index b1cf2cc..487173a 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -2,13 +2,13 @@ * Written By Julian ELischer * Copyright julian Elischer 1993. * Permission is granted to use or redistribute this file in any way as long - * as this notice remains. Julian Elischer does not guarantee that this file - * is totally correct for any given task and users of this file must + * as this notice remains. Julian Elischer does not guarantee that this file + * is totally correct for any given task and users of this file must * accept responsibility for any damage that occurs from the application of this * file. - * + * * Written by Julian Elischer (julian@dialix.oz.au) - * $Id: scsi_base.c,v 1.27 1995/04/14 15:10:31 dufault Exp $ + * $Id: scsi_base.c,v 1.28 1995/04/23 22:07:50 gibbs Exp $ */ #define SPLSD splbio @@ -34,7 +34,7 @@ struct scsi_xfer *next_free_xs; /* * Get a scsi transfer structure for the caller. Charge the structure - * to the device that is referenced by the sc_link structure. If the + * to the device that is referenced by the sc_link structure. If the * sc_link structure has no 'credits' then the device already has the * maximum number or outstanding operations under way. In this stage, * wait on the structure so that when one is freed, we are awoken again @@ -88,7 +88,7 @@ get_xs(sc_link, flags) * return the struct to the free pool and credit the device with it * If another process is waiting for an xs, do a wakeup, let it proceed */ -void +void free_xs(xs, sc_link, flags) struct scsi_xfer *xs; struct scsi_link *sc_link; /* who to credit for returning it */ @@ -117,7 +117,7 @@ free_xs(xs, sc_link, flags) /* * Find out from the device what its capacity is. */ -u_int32 +u_int32 scsi_read_capacity(sc_link, blk_size, flags) struct scsi_link *sc_link; u_int32 *blk_size; @@ -198,7 +198,7 @@ scsi_target_mode(sc_link, on_off) /* * Get scsi driver to send a "are you ready?" command */ -errval +errval scsi_test_unit_ready(sc_link, flags) struct scsi_link *sc_link; u_int32 flags; @@ -222,7 +222,7 @@ scsi_test_unit_ready(sc_link, flags) /* * Do a scsi operation, asking a device to run as SCSI-II if it can. */ -errval +errval scsi_change_def(sc_link, flags) struct scsi_link *sc_link; u_int32 flags; @@ -248,7 +248,7 @@ scsi_change_def(sc_link, flags) * Do a scsi operation asking a device what it is * Use the scsi_cmd routine in the switch table. */ -errval +errval scsi_inquire(sc_link, inqbuf, flags) struct scsi_link *sc_link; struct scsi_inquiry_data *inqbuf; @@ -274,7 +274,7 @@ scsi_inquire(sc_link, inqbuf, flags) /* * Prevent or allow the user to remove the media */ -errval +errval scsi_prevent(sc_link, type, flags) struct scsi_link *sc_link; u_int32 type, flags; @@ -298,7 +298,7 @@ scsi_prevent(sc_link, type, flags) /* * Get scsi driver to send a "start up" command */ -errval +errval scsi_start_unit(sc_link, flags) struct scsi_link *sc_link; u_int32 flags; @@ -323,7 +323,7 @@ scsi_start_unit(sc_link, flags) /* * Get scsi driver to send a "stop" command */ -errval +errval scsi_stop_unit(sc_link, eject, flags) struct scsi_link *sc_link; u_int32 eject; @@ -351,7 +351,7 @@ scsi_stop_unit(sc_link, eject, flags) /* * This routine is called by the scsi interrupt when the transfer is complete. */ -void +void scsi_done(xs) struct scsi_xfer *xs; { @@ -395,7 +395,7 @@ scsi_done(xs) } /* XXX: This isn't used anywhere. Do you have plans for it, * Julian? (dufault@hda.com). - * This allows a private 'done' handler to + * This allows a private 'done' handler to * resubmit the command if it wants to retry, * In this case the xs must NOT be freed. (julian) */ @@ -435,7 +435,7 @@ scsi_done(xs) * long the data is supposed to be. If we have a buf * to associate with the transfer, we need that too. */ -errval +errval scsi_scsi_cmd(sc_link, scsi_cmd, cmdlen, data_addr, datalen, retries, timeout, bp, flags) struct scsi_link *sc_link; @@ -502,7 +502,7 @@ scsi_scsi_cmd(sc_link, scsi_cmd, cmdlen, data_addr, datalen, #ifdef BOUNCE_BUFFERS xs->data = (caddr_t) vm_bounce_kva_alloc( (datalen + PAGE_SIZE - 1)/PAGE_SIZE); #else - xs->data = malloc(datalen, M_TEMP, M_WAITOK); + xs->data = malloc(datalen, M_TEMP, M_WAITOK); #endif /* I think waiting is ok *//*XXX */ switch ((int)(flags & (SCSI_DATA_IN | SCSI_DATA_OUT))) { @@ -533,12 +533,12 @@ retry: * Do the transfer. If we are polling we will return: * COMPLETE, Was poll, and scsi_done has been called * TRY_AGAIN_LATER, Adapter short resources, try again - * + * * if under full steam (interrupts) it will return: * SUCCESSFULLY_QUEUED, will do a wakeup when complete * TRY_AGAIN_LATER, (as for polling) * After the wakeup, we must still check if it succeeded - * + * * If we have a bp however, all the error proccessing * and the buffer code both expect us to return straight * to them, so as soon as the command is queued, return @@ -710,13 +710,13 @@ errval scsi_retry(xs,delay) /* * handle checking for errors.. - * called at interrupt time from scsi_done() and + * called at interrupt time from scsi_done() and * at user time from scsi_scsi_cmd(), depending on whether * there was a bp (basically, if there is a bp, there may be no * associated process at the time. (it could be an async operation)) * lower level routines shouldn't know about xs->bp.. we are the lowest. */ -static errval +static errval sc_err1(xs) struct scsi_xfer *xs; { @@ -870,12 +870,12 @@ void scsi_sense_print(xs) printf(" %s", desc); } - + if (ext->extra_len >= 7 && ext->fru) { printf(" field replaceable unit: %x", ext->fru); } - if (ext->extra_len >= 10 && + if (ext->extra_len >= 10 && (ext->sense_key_spec_1 & SSD_SCS_VALID)) { printf(" sks:%x,%x", ext->sense_key_spec_1, (ext->sense_key_spec_2 | @@ -907,7 +907,7 @@ void scsi_sense_print(xs) * * THIS IS THE DEFAULT SENSE HANDLER */ -static errval +static errval scsi_interpret_sense(xs) struct scsi_xfer *xs; { @@ -1083,7 +1083,7 @@ scsi_interpret_sense(xs) */ /* - * convert a physical address to 3 bytes, + * convert a physical address to 3 bytes, * MSB at the lowest address, * LSB at the highest. */ diff --git a/sys/scsi/scsi_cd.h b/sys/scsi/scsi_cd.h index 0a4759b..7b8f63c 100644 --- a/sys/scsi/scsi_cd.h +++ b/sys/scsi/scsi_cd.h @@ -4,7 +4,7 @@ * * TRW Financial Systems, in accordance with their agreement with Carnegie * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with + * or use in any manner that they see fit as long as this message is kept with * the software. For this reason TFS also grants any other persons or * organisations permission to use or modify this software. * @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsi_cd.h,v 1.6 93/08/26 21:09:19 julian Exp Locker: julian $ + * $Id: scsi_cd.h,v 1.6 1993/11/18 05:02:52 rgrimes Exp $ */ #ifndef _SCSI_SCSI_CD_H #define _SCSI_SCSI_CD_H 1 @@ -89,7 +89,7 @@ struct scsi_play u_char control; }; -struct scsi_play_big +struct scsi_play_big { u_char op_code; u_char byte2; /* same as above */ diff --git a/sys/scsi/scsi_changer.h b/sys/scsi/scsi_changer.h index 85819c8..d7d628a 100644 --- a/sys/scsi/scsi_changer.h +++ b/sys/scsi/scsi_changer.h @@ -9,7 +9,7 @@ * * TRW Financial Systems, in accordance with their agreement with Carnegie * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with + * or use in any manner that they see fit as long as this message is kept with * the software. For this reason TFS also grants any other persons or * organisations permission to use or modify this software. * @@ -19,7 +19,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsi_changer.h,v 1.5 93/08/26 21:09:22 julian Exp Locker: julian $ + * $Id: scsi_changer.h,v 1.6 1993/11/18 05:02:53 rgrimes Exp $ */ #ifndef _SCSI_SCSI_CHANGER_H #define _SCSI_SCSI_CHANGER_H 1 @@ -68,7 +68,7 @@ struct scsi_position_to_element u_char invert; u_char control; }; - + /* * Opcodes */ @@ -76,7 +76,7 @@ struct scsi_position_to_element #define MOVE_MEDIUM 0xa5 #define READ_ELEMENT_STATUS 0xb8 -struct scsi_element_status_data +struct scsi_element_status_data { u_char first_element_reported[2]; u_char number_of_elements_reported[2]; @@ -84,7 +84,7 @@ struct scsi_element_status_data u_char byte_count_of_report[3]; }; -struct element_status_page +struct element_status_page { u_char element_type_code; u_char flags; diff --git a/sys/scsi/scsi_debug.h b/sys/scsi/scsi_debug.h index 480ff14..578cd43 100644 --- a/sys/scsi/scsi_debug.h +++ b/sys/scsi/scsi_debug.h @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@tfs.com) * - * $Id: scsi_debug.h,v 1.3 93/10/10 09:26:05 julian Exp Locker: julian $ + * $Id: scsi_debug.h,v 1.1 1993/11/18 05:02:54 rgrimes Exp $ */ #ifndef _SCSI_SCSI_DEBUG_H #define _SCSI_SCSI_DEBUG_H 1 @@ -12,7 +12,7 @@ * the following DEBUG bits are defined to exist in the flags word of * the scsi_link structure. */ -#define SDEV_DB1 0x10 /* scsi commands, errors, data */ +#define SDEV_DB1 0x10 /* scsi commands, errors, data */ #define SDEV_DB2 0x20 /* routine flow tracking */ #define SDEV_DB3 0x40 /* internal to routine flows */ #define SDEV_DB4 0x80 /* level 4 debugging for this dev */ @@ -21,7 +21,7 @@ #define DEBUGTARG 9 /*9 = dissable*/ #define DEBUGLUN 0 #define DEBUGLEVEL (SDEV_DB1|SDEV_DB2) - + /* * This is the usual debug macro for use with the above bits */ diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h index a2720d5..ecac2a4 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -11,7 +11,7 @@ * Grenoble, FRANCE * * All Rights Reserved - * + * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appears in all copies and @@ -20,7 +20,7 @@ * Foundation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. - * + * * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR @@ -36,7 +36,7 @@ * * TRW Financial Systems, in accordance with their agreement with Carnegie * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with + * or use in any manner that they see fit as long as this message is kept with * the software. For this reason TFS also grants any other persons or * organisations permission to use or modify this software. * @@ -46,7 +46,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsi_disk.h,v 1.6 1993/11/18 05:02:55 rgrimes Exp $ + * $Id: scsi_disk.h,v 1.7 1995/01/08 15:13:40 ats Exp $ */ /* diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c index 40b8559..23370a9 100644 --- a/sys/scsi/scsi_driver.c +++ b/sys/scsi/scsi_driver.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1995, HD Associates, Inc. * PO Box 276 * Pepperell, MA 01463 @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_driver.c,v 1.8 1995/04/14 15:10:33 dufault Exp $ + * $Id: scsi_driver.c,v 1.9 1995/05/03 18:09:11 dufault Exp $ * */ #include <sys/types.h> @@ -102,7 +102,7 @@ int scsi_device_attach(struct scsi_link *sc_link) return errcode; } -int +int scsi_open(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_device *device) { @@ -117,7 +117,7 @@ struct scsi_device *device) sc_link = SCSI_LINK(device, unit); /* - * Check the unit is legal + * Check the unit is legal */ if (sc_link == 0 || sc_link->sd == 0) return ENXIO; @@ -143,7 +143,7 @@ struct scsi_device *device) return errcode; } -int +int scsi_close(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_device *device) { @@ -162,7 +162,7 @@ struct scsi_device *device) return errcode; } -int +int scsi_ioctl(dev_t dev, u_int32 cmd, caddr_t arg, int flags, struct proc *p, struct scsi_device *device) { @@ -177,7 +177,7 @@ struct scsi_device *device) return errcode; } -void +void scsi_minphys(struct buf *bp, struct scsi_device *device) { struct scsi_link *sc_link = SCSI_LINK(device, GETUNIT(device, bp->b_dev)); diff --git a/sys/scsi/scsi_driver.h b/sys/scsi/scsi_driver.h index 9d325ef..ec2e1c8 100644 --- a/sys/scsi/scsi_driver.h +++ b/sys/scsi/scsi_driver.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1995, HD Associates, Inc. * PO Box 276 * Pepperell, MA 01463 @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_driver.h,v 1.2 1995/03/04 20:50:52 dufault Exp $ + * $Id: scsi_driver.h,v 1.3 1995/04/14 15:10:34 dufault Exp $ * */ #ifndef _SCSI__DRIVER_H_ diff --git a/sys/scsi/scsi_generic.h b/sys/scsi/scsi_generic.h index db694f4..e1a3d88 100644 --- a/sys/scsi/scsi_generic.h +++ b/sys/scsi/scsi_generic.h @@ -1,4 +1,4 @@ -/* +/* * Contributed by HD Associates (contact: dufault@hda.com) * Copyright (c) 1992, 1993 HD Associates * @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * from: @(#)stdio.h 5.17 (Berkeley) 6/3/91 - * $Id: scsi_generic.h,v 1.2 1993/10/16 17:21:05 rgrimes Exp $ + * $Id: scsi_generic.h,v 1.3 1995/01/08 13:38:31 dufault Exp $ */ /* generic SCSI header file. We use the same minor number format diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index 6e4d6cb..9471307 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1992, 1993, 1994, HD Associates, Inc. * PO Box 276 * Pepperell, MA 01463 @@ -36,7 +36,7 @@ * SUCH DAMAGE. *End copyright * - * $Id: scsi_ioctl.c,v 1.14 1995/05/03 18:09:12 dufault Exp $ + * $Id: scsi_ioctl.c,v 1.15 1995/05/09 02:38:15 dyson Exp $ * * */ @@ -142,7 +142,7 @@ struct scsi_xfer *xs; /* Pseudo strategy function * Called by scsi_do_ioctl() via physio/physstrat if there is to * be data transfered, and directly if there is no data transfer. - * + * * Can't be used with block devices or raw_read/raw_write directly * from the cdevsw/bdevsw tables because they couldn't have added * the screq structure. [JRE] diff --git a/sys/scsi/scsi_tape.h b/sys/scsi/scsi_tape.h index 602ac71..0e184d1 100644 --- a/sys/scsi/scsi_tape.h +++ b/sys/scsi/scsi_tape.h @@ -8,7 +8,7 @@ * * TRW Financial Systems, in accordance with their agreement with Carnegie * Mellon University, makes this software available to CMU to distribute - * or use in any manner that they see fit as long as this message is kept with + * or use in any manner that they see fit as long as this message is kept with * the software. For this reason TFS also grants any other persons or * organisations permission to use or modify this software. * @@ -21,7 +21,7 @@ /* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsi_tape.h,v 1.11 1995/03/21 11:21:03 dufault Exp $ + * $Id: scsi_tape.h,v 1.12 1995/04/29 21:30:26 joerg Exp $ */ #ifndef SCSI_SCSI_TAPE_H #define SCSI_SCSI_TAPE_H 1 @@ -80,8 +80,8 @@ struct scsi_erase u_char op_code; u_char byte2; #define SE_LONG 0x01 /* - ** Archive Viper 2525 doesn't allow short - ** erase, other tapes possibly don't allow + ** Archive Viper 2525 doesn't allow short + ** erase, other tapes possibly don't allow ** that, too. */ #define SE_IMMED 0x02 @@ -160,7 +160,7 @@ struct blk_desc_cipher * This structure defines the various mode pages that tapes know about. */ #define PAGE_HEADERLEN 2 -struct tape_pages +struct tape_pages { u_char pg_code; /* page code */ #define ST_PAGE_CONFIGURATION 0x10 @@ -171,9 +171,9 @@ struct tape_pages #define ST_P_CODE 0x3F /* page code */ #define ST_P_PS 0x80 /* page savable */ u_char pg_length; /* page length */ - union + union { - struct + struct { u_char active_format; /* active format for density*/ #define ST_P_CAP 0x40 /* change active Partition */ @@ -206,7 +206,7 @@ struct tape_pages u_char data_compress_alg; /* 0 = off, 1 = default */ u_char reserved; /* The standard says so */ } configuration; - struct + struct { #define ST_MAXPARTS 16 /*for now*/ u_char max_add_parts; /* that drive allows */ @@ -232,7 +232,7 @@ struct tape_pages u_char low; }part[ST_MAXPARTS]; } medium_partition; - struct + struct { struct { diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index d551ccb..d1771f8 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -16,7 +16,7 @@ * * New configuration setup: dufault@hda.com * - * $Id: scsiconf.c,v 1.28 1995/04/23 07:47:10 bde Exp $ + * $Id: scsiconf.c,v 1.29 1995/05/03 18:09:13 dufault Exp $ */ #include <sys/types.h> @@ -162,14 +162,14 @@ struct scsidevs { #define SC_ONE_LU 0x00 #define SC_MORE_LUS 0x02 -static struct scsidevs unknowndev = +static struct scsidevs unknowndev = { - T_UNKNOWN, 0, "*", "*", "*", + T_UNKNOWN, 0, "*", "*", "*", "uk", SC_MORE_LUS }; #ifdef NEW_SCSICONF -static st_modes mode_tandberg3600 = +static st_modes mode_tandberg3600 = { {0, 0, 0}, /* minor 0,1,2,3 */ {0, ST_Q_FORCE_VAR_MODE, QIC_525}, /* minor 4,5,6,7 */ @@ -218,11 +218,11 @@ static struct scsidevs knowndevs[] = { #if NSD > 0 { - T_DIRECT, T_FIXED, "MAXTOR", "XT-4170S", "B5A", + T_DIRECT, T_FIXED, "MAXTOR", "XT-4170S", "B5A", "mx1", SC_ONE_LU }, { - T_DIRECT, T_FIXED, "*", "*", "*", + T_DIRECT, T_FIXED, "*", "*", "*", "sd", SC_ONE_LU }, #endif /* NSD */ @@ -248,20 +248,20 @@ static struct scsidevs knowndevs[] = "st", SC_ONE_LU, 0, mode_wangdat1300 }, { - T_SEQUENTIAL, T_REMOV, "*", "*", "*", + T_SEQUENTIAL, T_REMOV, "*", "*", "*", "st", SC_ONE_LU, 0, mode_unktape }, #endif /* NST */ #if NCH > 0 { - T_CHANGER, T_REMOV, "*", "*", "*", + T_CHANGER, T_REMOV, "*", "*", "*", "ch", SC_ONE_LU }, #endif /* NCH */ #if NCD > 0 #ifndef UKTEST /* make cdroms unrecognised to test the uk driver */ { - T_READONLY, T_REMOV, "SONY", "CD-ROM CDU-8012", "3.1a", + T_READONLY, T_REMOV, "SONY", "CD-ROM CDU-8012", "3.1a", "cd", SC_ONE_LU }, { @@ -434,7 +434,7 @@ scsi_device_lookup_by_name(char *name) /* scsi_init: Do all the one time processing. This initializes the * type drivers and initializes the configuration. */ -static void +static void scsi_init(void) { static int done = 0; @@ -462,7 +462,7 @@ scsi_init(void) if (IS_SPECIFIED(scsi_cinit[i].unit) && free_bus <= scsi_cinit[i].unit) free_bus = scsi_cinit[i].unit + 1; - + /* Lowest free unit for each type for auto-configure is one * more than the first one not specified in the config file: */ @@ -903,7 +903,7 @@ scsi_probe_bus(int bus, int targ, int lun) sc_link->device = scsi_device_lookup(type); (void)scsi_assign_unit(sc_link); - + if (scsi_alloc_unit(sc_link)) { if (scsi_device_attach(sc_link) == 0) { @@ -989,7 +989,7 @@ scsi_probedev(sc_link, maybe_more, type_p) char version[4 + 1]; inqbuf = &sc_link->inqbuf; - + bzero(inqbuf, sizeof(*inqbuf)); /* * Ask the device what it is @@ -1117,7 +1117,7 @@ scsi_probedev(sc_link, maybe_more, type_p) /* * Try make as good a match as possible with - * available sub drivers + * available sub drivers */ bestmatch = (scsi_selectdev( qualifier, type, remov ? T_REMOV : T_FIXED, manu, model, version)); @@ -1159,7 +1159,7 @@ scsi_dev_lookup(d_open) #ifdef NEW_SCSICONF /* * Compare name with pattern, return 0 on match. - * Short pattern matches trailing blanks in name, + * Short pattern matches trailing blanks in name, * wildcard '*' in pattern matches rest of name */ int @@ -1183,7 +1183,7 @@ match(pattern, name) /* * Try make as good a match as possible with - * available sub drivers + * available sub drivers */ struct scsidevs * scsi_selectdev(qualifier, type, remov, manu, model, rev) diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 1a9765e..53574cd 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsiconf.h,v 1.24 1995/04/23 22:07:51 gibbs Exp $ + * $Id: scsiconf.h,v 1.25 1995/05/03 18:09:14 dufault Exp $ */ #ifndef SCSI_SCSICONF_H #define SCSI_SCSICONF_H 1 @@ -54,9 +54,9 @@ typedef unsigned char u_int8; * * ------------- * - * The key to all this is the scsi_link structure which associates all the + * The key to all this is the scsi_link structure which associates all the * other structures with each other in the correct configuration. The - * scsi_link is the connecting information that allows each part of the + * scsi_link is the connecting information that allows each part of the * scsi system to find the associated other parts. */ @@ -313,7 +313,7 @@ struct scsi_link #define SDEV_WAITING 0x0002 /* a process is waiting for this */ #define SDEV_OPEN 0x0004 /* at least 1 open session */ #define SDEV_BOUNCE 0x0008 /* XXX-HA: unit needs DMA bounce buffer */ -#define SDEV_DBX 0x00F0 /* debugging flags (scsi_debug.h) */ +#define SDEV_DBX 0x00F0 /* debugging flags (scsi_debug.h) */ #define SDEV_ONCE_ONLY 0x0100 /* unit can only be opened once */ #define SDEV_BOOTVERBOSE 0x0200 /* be noisy during boot */ #define SDEV_RESIDS_WORK 0x0400 /* XXX-HA: Residuals work */ diff --git a/sys/scsi/sctarg.c b/sys/scsi/sctarg.c index d7513db..2e433ac 100644 --- a/sys/scsi/sctarg.c +++ b/sys/scsi/sctarg.c @@ -1,4 +1,4 @@ -/* +/* * sctarg: Processor Type driver. * * Copyright (C) 1995, HD Associates, Inc. @@ -37,7 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sctarg.c,v 1.1 1995/04/14 15:10:41 dufault Exp $ + * $Id: sctarg.c,v 1.2 1995/05/03 18:09:15 dufault Exp $ */ /* @@ -156,7 +156,7 @@ struct scsi_link *sc_link) * continues to be drained. * sctargstart() is called at splbio */ -void +void sctargstart(unit) u_int32 unit; { @@ -228,7 +228,7 @@ sctargstart(unit) } /* go back and see if we can cram more work in.. */ } -void +void sctarg_strategy(struct buf *bp, struct scsi_link *sc_link) { struct buf **dp; @@ -241,9 +241,9 @@ sctarg_strategy(struct buf *bp, struct scsi_link *sc_link) opri = splbio(); - /* + /* * Use a bounce buffer if necessary - */ + */ #ifdef BOUNCE_BUFFERS if (sc_link->flags & SDEV_BOUNCE) vm_bounce_alloc(bp); diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index e7bd97a..1ae8533 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.63 1995/05/03 18:09:17 dufault Exp $ + * $Id: sd.c,v 1.64 1995/05/08 16:53:33 bde Exp $ */ #define SPLSD splbio @@ -117,7 +117,7 @@ struct scsi_device sd_switch = static struct scsi_xfer sx; static int -sd_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, +sd_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, size_t len) { return scsi_externalize(SCSI_LINK(&sd_switch, kdc->kdc_unit), @@ -158,7 +158,7 @@ sd_registerdev(int unit) * The routine called by the low level scsi routine when it discovers * a device suitable for this driver. */ -errval +errval sdattach(struct scsi_link *sc_link) { u_int32 unit; @@ -170,7 +170,7 @@ sdattach(struct scsi_link *sc_link) dp = &(sd->params); - if (sc_link->opennings > SDOUTSTANDING) + if (sc_link->opennings > SDOUTSTANDING) sc_link->opennings = SDOUTSTANDING; /* * Use the subdriver to request information regarding @@ -237,7 +237,7 @@ sd_open(dev, mode, fmt, p, sc_link) dev, unit, PARTITION(dev))); /* - * "unit attention" errors should occur here if the + * "unit attention" errors should occur here if the * drive has been restarted or the pack changed. * just ingnore the result, it's a decoy instruction * The error code will act on the error though @@ -280,7 +280,7 @@ sd_open(dev, mode, fmt, p, sc_link) SC_DEBUG(sc_link, SDEV_DB3, ("device ok\n")); /* - * Load the physical device parameters + * Load the physical device parameters */ sd_get_parms(unit, 0); /* sets SDEV_MEDIA_LOADED */ if (sd->params.secsiz != SECSIZE) { /* XXX One day... */ @@ -330,7 +330,7 @@ bad: * close the device.. only called if we are the LAST occurence of an open * device. Convenient now but usually a pain. */ -errval +errval sd_close(dev, fflag, fmt, p, sc_link) dev_t dev; int fflag; @@ -389,9 +389,9 @@ sd_strategy(struct buf *bp, struct scsi_link *sc_link) opri = SPLSD(); dp = &sd->buf_queue; - /* + /* * Use a bounce buffer if necessary - */ + */ #ifdef BOUNCE_BUFFERS if (sc_link->flags & SDEV_BOUNCE) vm_bounce_alloc(bp); @@ -448,7 +448,7 @@ sdstrategy1(struct buf *bp) * must be called at the correct (highish) spl level * sdstart() is called at SPLSD from sdstrategy and scsi_done */ -void +void sdstart(u_int32 unit, u_int32 flags) { register struct scsi_link *sc_link = SCSI_LINK(&sd_switch, unit); @@ -465,7 +465,7 @@ sdstart(u_int32 unit, u_int32 flags) while (sc_link->opennings) { /* - * there is excess capacity, but a special waits + * there is excess capacity, but a special waits * It'll need the adapter as soon as we clear out of the * way and let it run (user level wait). */ @@ -547,7 +547,7 @@ bad: * Perform special action on behalf of the user * Knows about the internals of this device */ -errval +errval sd_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p, struct scsi_link *sc_link) { @@ -587,7 +587,7 @@ sd_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p, /* * Find out from the device what it's capacity is */ -u_int32 +u_int32 sd_size(unit, flags) int unit, flags; { @@ -630,7 +630,7 @@ sd_size(unit, flags) /* * Tell the device to map out a defective block */ -errval +errval sd_reassign_blocks(unit, block) int unit, block; { @@ -663,10 +663,10 @@ sd_reassign_blocks(unit, block) /* * Get the scsi driver to send a full inquiry to the - * device and use the results to fill out the disk + * device and use the results to fill out the disk * parameter structure. */ -errval +errval sd_get_parms(unit, flags) int unit, flags; { @@ -734,7 +734,7 @@ sd_get_parms(unit, flags) /* * KLUDGE!!(for zone recorded disks) * give a number of sectors so that sec * trks * cyls - * is <= disk_size + * is <= disk_size * can lead to wasted space! THINK ABOUT THIS ! */ disk_parms->heads = scsi_sense.pages.rigid_geometry.nheads; @@ -780,7 +780,7 @@ sdsize(dev_t dev) * This will issue a retry when the device returns a * non-media hardware failure. The CDC-WREN IV does this * when you access it during thermal calibrarion, so the drive - * is pretty useless without this. + * is pretty useless without this. * * In general, you probably almost always would like to issue a retry * for your disk I/O. It can't hurt too much (the caller only retries @@ -910,7 +910,7 @@ sddump(dev_t dev) /* * Fill out the scsi_xfer structure * Note: we cannot sleep as we may be an interrupt - * don't use scsi_scsi_cmd() as it may want + * don't use scsi_scsi_cmd() as it may want * to wait for an xs. */ bzero(xs, sizeof(sx)); diff --git a/sys/scsi/st.c b/sys/scsi/st.c index f8c168f..4320f56 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: st.c,v 1.34 1995/04/29 21:30:29 joerg Exp $ + * $Id: st.c,v 1.35 1995/05/03 18:09:19 dufault Exp $ */ /* @@ -285,7 +285,7 @@ struct scsi_device st_switch = ST_FM_WRITTEN | ST_2FM_AT_EOD | ST_PER_ACTION) static int -st_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, +st_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, size_t len) { return scsi_externalize(SCSI_LINK(&st_switch, kdc->kdc_unit), @@ -319,7 +319,7 @@ st_registerdev(int unit) * a device suitable for this driver */ -errval +errval stattach(struct scsi_link *sc_link) { u_int32 unit; @@ -507,7 +507,7 @@ st_loadquirks(sc_link) /* * open the device. */ -errval +errval st_open(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -568,7 +568,7 @@ struct scsi_link *sc_link) st_unmount(unit, NOEJECT); } /* - * If we are not mounted, then we should start a new + * If we are not mounted, then we should start a new * mount session. */ if (!(st->flags & ST_MOUNTED)) { @@ -593,7 +593,7 @@ struct scsi_link *sc_link) * close the device.. only called if we are the LAST * occurence of an open device */ -errval +errval st_close(dev_t dev, int flag, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -760,7 +760,7 @@ st_unmount(int unit, boolean eject) * initial operation, make a decision as to how we should be set * to run (regarding blocking and EOD marks) */ -errval +errval st_decide_mode(unit, first_read) u_int32 unit; boolean first_read; @@ -896,7 +896,7 @@ done: * The transfer is described by a buf and will include * only one physical transfer. */ -void +void st_strategy(struct buf *bp, struct scsi_link *sc_link) { struct buf **dp; @@ -935,9 +935,9 @@ st_strategy(struct buf *bp, struct scsi_link *sc_link) } opri = splbio(); - /* + /* * Use a bounce buffer if necessary - */ + */ #ifdef BOUNCE_BUFFERS if (sc_link->flags & SDEV_BOUNCE) vm_bounce_alloc(bp); @@ -988,7 +988,7 @@ done: * continues to be drained. * ststart() is called at splbio */ -void +void ststart(unit, flags) u_int32 unit; u_int32 flags; @@ -1117,7 +1117,7 @@ badnews: * Perform special action on behalf of the user; * knows about the internals of this device */ -errval +errval st_ioctl(dev_t dev, int cmd, caddr_t arg, int flag, struct proc *p, struct scsi_link *sc_link) { @@ -1282,7 +1282,7 @@ try_new_value: /* * As the drive liked it, if we are setting a new default, * set it into the structures as such. - * + * * The means for deciding this are not finalised yet */ if (IS_CTLMODE(dev)) { @@ -1305,7 +1305,7 @@ try_new_value: /* * Do a synchronous read. */ -errval +errval st_read(unit, buf, size, flags) u_int32 unit, size, flags; char *buf; @@ -1348,7 +1348,7 @@ st_read(unit, buf, size, flags) /* * Ask the drive what it's min and max blk sizes are. */ -errval +errval st_rd_blk_lim(unit, flags) u_int32 unit, flags; { @@ -1394,7 +1394,7 @@ st_rd_blk_lim(unit, flags) /* * Get the scsi driver to send a full inquiry to the - * device and use the results to fill out the global + * device and use the results to fill out the global * parameter structure. * * called from: @@ -1402,7 +1402,7 @@ st_rd_blk_lim(unit, flags) * open * ioctl (to reset original blksize) */ -static errval +static errval st_mode_sense(unit, flags, page, pagelen, pagecode) u_int32 unit, flags; struct tape_pages *page; @@ -1442,7 +1442,7 @@ st_mode_sense(unit, flags, page, pagelen, pagecode) + sizeof(struct blk_desc) + (page ? pagelen : 0); /* - * Set up a mode sense + * Set up a mode sense */ bzero(&scsi_cmd, sizeof(scsi_cmd)); scsi_cmd.op_code = MODE_SENSE; @@ -1450,7 +1450,7 @@ st_mode_sense(unit, flags, page, pagelen, pagecode) scsi_cmd.length = dat_len; /* - * do the command, + * do the command, * use the results to set blksiz, numblks and density * or if we need it as a template for the mode select * store it away. @@ -1489,7 +1489,7 @@ st_mode_sense(unit, flags, page, pagelen, pagecode) * Send a filled out parameter structure to the drive to * set it into the desire modes etc. */ -errval +errval st_mode_select(unit, flags, page, pagelen) u_int32 unit, flags; struct tape_pages *page; @@ -1604,7 +1604,7 @@ u_int32 unit,mode; /* * skip N blocks/filemarks/seq filemarks/eom */ -errval +errval st_space(unit, number, what, flags) u_int32 unit, what, flags; int32 number; @@ -1689,7 +1689,7 @@ st_space(unit, number, what, flags) /* * write N filemarks */ -errval +errval st_write_filemarks(unit, number, flags) u_int32 unit, flags; int32 number; @@ -1741,7 +1741,7 @@ st_write_filemarks(unit, number, flags) * nmarks returns the number of marks to skip (or, if position * true, which were skipped) to get back original position. */ -int32 +int32 st_chkeod(unit, position, nmarks, flags) u_int32 unit; boolean position; @@ -1771,7 +1771,7 @@ st_chkeod(unit, position, nmarks, flags) /* * load/unload (with retension if true) */ -errval +errval st_load(unit, type, flags) u_int32 unit, type, flags; { @@ -1807,7 +1807,7 @@ st_load(unit, type, flags) /* * Rewind the device */ -errval +errval st_rewind(unit, immed, flags) u_int32 unit, flags; boolean immed; @@ -1838,8 +1838,8 @@ st_rewind(unit, immed, flags) /* ** Erase the device -*/ -errval +*/ +errval st_erase(unit, immed, flags) u_int32 unit, flags; boolean immed; @@ -1883,7 +1883,7 @@ st_erase(unit, immed, flags) * The unix error number to pass back... (0 = report no error) * (SCSIRET_CONTINUE = continue processing) */ -errval +errval st_interpret_sense(xs) struct scsi_xfer *xs; { @@ -1929,7 +1929,7 @@ st_interpret_sense(xs) ,info); /*XXX*/ /* is this how it works ? */ /* check def of ILI for fixed blk tapes */ - + /* * This quirk code helps the drive read * the first tape block, regardless of diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c index d3c3506..0518612 100644 --- a/sys/scsi/uk.c +++ b/sys/scsi/uk.c @@ -1,8 +1,8 @@ -/* +/* * Driver for a device we can't identify. * by Julian Elischer (julian@tfs.com) * - * $Id: uk.c,v 1.7 1995/03/01 22:24:47 dufault Exp $ + * $Id: uk.c,v 1.8 1995/03/04 20:51:08 dufault Exp $ * * If you find that you are adding any code to this file look closely * at putting it in "scsi_driver.c" instead. diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c index b62fc02..9f5375d 100644 --- a/sys/scsi/worm.c +++ b/sys/scsi/worm.c @@ -1,4 +1,4 @@ -/* +/* * worm: Write Once device driver * * Copyright (C) 1995, HD Associates, Inc. @@ -37,7 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: worm.c,v 1.5 1995/05/03 23:38:20 gpalmer Exp $ + * $Id: worm.c,v 1.6 1995/05/03 23:53:32 dufault Exp $ */ /* XXX This is PRELIMINARY. @@ -123,7 +123,7 @@ static int worm_size(struct scsi_link *sc_link) return ret; } -errval +errval wormattach(struct scsi_link *sc_link) { struct scsi_data *worm = sc_link->sd; @@ -156,7 +156,7 @@ wormattach(struct scsi_link *sc_link) * into. In particular, the removable media checking should be * handled in one place. */ -void +void wormstart(unit, flags) u_int32 unit; u_int32 flags; @@ -248,7 +248,7 @@ badnews: } /* go back and see if we can cram more work in.. */ } -void +void worm_strategy(struct buf *bp, struct scsi_link *sc_link) { struct buf **dp; @@ -272,10 +272,10 @@ worm_strategy(struct buf *bp, struct scsi_link *sc_link) opri = splbio(); - /* + /* * Use a bounce buffer if necessary * XXX: How can we move this up? - */ + */ #ifdef BOUNCE_BUFFERS if (sc_link->flags & SDEV_BOUNCE) vm_bounce_alloc(bp); @@ -301,7 +301,7 @@ worm_strategy(struct buf *bp, struct scsi_link *sc_link) /* * Open the device. XXX: I'm completely guessing at this sequence. */ -int +int worm_open(dev_t dev, int flags, int fmt, struct proc *p, struct scsi_link *sc_link) { @@ -347,7 +347,7 @@ struct scsi_link *sc_link) return 0; } -int +int worm_close(dev_t dev, int flag, int fmt, struct proc *p, struct scsi_link *sc_link) { diff --git a/sys/sys/bio.h b/sys/sys/bio.h index a142fec..89d289f 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.7 (Berkeley) 1/21/94 - * $Id: buf.h,v 1.17 1995/04/09 06:03:32 davidg Exp $ + * $Id: buf.h,v 1.18 1995/04/19 10:31:56 davidg Exp $ */ #ifndef _SYS_BUF_H_ @@ -156,7 +156,7 @@ struct cluster_save { struct buf **bs_children; /* List of associated buffers. */ }; -/* +/* * number of buffer hash entries */ #define BUFHSZ 512 diff --git a/sys/sys/buf.h b/sys/sys/buf.h index a142fec..89d289f 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.7 (Berkeley) 1/21/94 - * $Id: buf.h,v 1.17 1995/04/09 06:03:32 davidg Exp $ + * $Id: buf.h,v 1.18 1995/04/19 10:31:56 davidg Exp $ */ #ifndef _SYS_BUF_H_ @@ -156,7 +156,7 @@ struct cluster_save { struct buf **bs_children; /* List of associated buffers. */ }; -/* +/* * number of buffer hash entries */ #define BUFHSZ 512 diff --git a/sys/sys/cdio.h b/sys/sys/cdio.h index 9db1bd3..8af5d65 100644 --- a/sys/sys/cdio.h +++ b/sys/sys/cdio.h @@ -1,7 +1,7 @@ /* * 16 Feb 93 Julian Elischer (julian@dialix.oz.au) * - * $Id: cdio.h,v 1.6 1994/02/05 09:14:24 swallace Exp $ + * $Id: cdio.h,v 1.7 1995/04/09 15:50:48 jkh Exp $ */ /* <1> Fixed a conflict with ioctl usage. There were two different @@ -20,7 +20,7 @@ 2-Apr-95 Frank Durda IV bsdmail@nemesis.lonestar.org */ - + /* Shared between kernel & process */ #ifndef _SYS_CDIO_H_ #define _SYS_CDIO_H_ @@ -46,8 +46,8 @@ struct cd_toc_entry { }; struct cd_sub_channel_header { - u_char :8; - u_char audio_status; + u_char :8; + u_char audio_status; #define CD_AS_AUDIO_INVALID 0x00 #define CD_AS_PLAY_IN_PROGRESS 0x11 #define CD_AS_PLAY_PAUSED 0x12 @@ -74,7 +74,7 @@ struct cd_sub_channel_media_catalog { u_char :8; u_char :7; u_char mc_valid:1; - u_char mc_number[15]; + u_char mc_number[15]; }; struct cd_sub_channel_track_info { @@ -83,8 +83,8 @@ struct cd_sub_channel_track_info { u_char track_number; u_char :8; u_char :7; - u_char ti_valid:1; - u_char ti_number[15]; + u_char ti_valid:1; + u_char ti_number[15]; }; struct cd_sub_channel_info { @@ -92,7 +92,7 @@ struct cd_sub_channel_info { union { struct cd_sub_channel_position_data position; struct cd_sub_channel_media_catalog media_catalog; - struct cd_sub_channel_track_info track_info; + struct cd_sub_channel_track_info track_info; } what; }; diff --git a/sys/sys/chio.h b/sys/sys/chio.h index 10fa51d..cc566ec 100644 --- a/sys/sys/chio.h +++ b/sys/sys/chio.h @@ -1,11 +1,11 @@ /* * 16 Feb 93 Julian Elischer ADDED for SCSI system * - * $Id: chio.h,v 1.3 1993/10/16 17:16:27 rgrimes Exp $ + * $Id: chio.h,v 1.4 1993/11/18 05:03:24 rgrimes Exp $ */ -/* This is a "convertet" mtio.h from 386BSD - Stefan Grefen grefen@goofy.zdv.uni-mainz.de +/* This is a "convertet" mtio.h from 386BSD + Stefan Grefen grefen@goofy.zdv.uni-mainz.de */ /* @@ -28,7 +28,7 @@ struct chop { struct { int chm; /* Transport element */ int to; - } position; + } position; struct { short chmo; /* Offset of first CHM */ short chms; /* No. of CHM */ diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 10fbbd3a..d42e116 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.3 (Berkeley) 1/21/94 - * $Id: conf.h,v 1.13 1995/05/12 19:17:24 wollman Exp $ + * $Id: conf.h,v 1.14 1995/05/14 03:00:03 davidg Exp $ */ #ifndef _SYS_CONF_H_ @@ -55,10 +55,10 @@ struct vnode; typedef void d_strategy_t __P((struct buf *)); typedef int d_open_t __P((dev_t, int, int, struct proc *)); typedef int d_close_t __P((dev_t, int, int, struct proc *)); -typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); +typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); typedef int d_dump_t __P((dev_t)); typedef int d_psize_t __P((dev_t)); - + typedef int d_read_t __P((dev_t, struct uio *, int)); typedef int d_write_t __P((dev_t, struct uio *, int)); typedef int d_rdwr_t __P((dev_t, struct uio *, int)); diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index 80c519e..53b9e7a 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -31,14 +31,14 @@ * SUCH DAMAGE. * * @(#)dirent.h 8.1 (Berkeley) 6/2/93 - * $Id: dirent.h,v 1.2 1994/08/02 07:52:47 davidg Exp $ + * $Id: dirent.h,v 1.3 1994/08/21 04:41:38 paul Exp $ */ #ifndef _SYS_DIRENT_H_ #define _SYS_DIRENT_H_ /* - * The dirent structure defines the format of directory entries returned by + * The dirent structure defines the format of directory entries returned by * the getdirentries(2) system call. * * A directory entry has a struct dirent at the front of it, containing its diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index 851d24a..f9e77f9 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.1 (Berkeley) 6/2/93 - * $Id: disklabel.h,v 1.14 1995/05/15 22:27:48 davidg Exp $ + * $Id: disklabel.h,v 1.15 1995/05/16 07:52:17 davidg Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -104,7 +104,7 @@ struct disklabel { short d_type; /* drive type */ short d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ - /* + /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the @@ -113,15 +113,15 @@ struct disklabel { * getdiskbyname(3) to retrieve the values from /etc/disktab. */ #if defined(KERNEL) || defined(STANDALONE) - char d_packname[16]; /* pack identifier */ + char d_packname[16]; /* pack identifier */ #else union { - char un_d_packname[16]; /* pack identifier */ + char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ - } un_b; - } d_un; + } un_b; + } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 @@ -389,7 +389,7 @@ extern struct dos_partition dos_partitions[NDOSPART]; * See <sys/reboot.h> for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor - * numbers (but not ones >= 2^31). Old cpio formats and all tar formats + * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index 851d24a..f9e77f9 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.1 (Berkeley) 6/2/93 - * $Id: disklabel.h,v 1.14 1995/05/15 22:27:48 davidg Exp $ + * $Id: disklabel.h,v 1.15 1995/05/16 07:52:17 davidg Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -104,7 +104,7 @@ struct disklabel { short d_type; /* drive type */ short d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ - /* + /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the @@ -113,15 +113,15 @@ struct disklabel { * getdiskbyname(3) to retrieve the values from /etc/disktab. */ #if defined(KERNEL) || defined(STANDALONE) - char d_packname[16]; /* pack identifier */ + char d_packname[16]; /* pack identifier */ #else union { - char un_d_packname[16]; /* pack identifier */ + char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ - } un_b; - } d_un; + } un_b; + } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 @@ -389,7 +389,7 @@ extern struct dos_partition dos_partitions[NDOSPART]; * See <sys/reboot.h> for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor - * numbers (but not ones >= 2^31). Old cpio formats and all tar formats + * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h index 851d24a..f9e77f9 100644 --- a/sys/sys/diskpc98.h +++ b/sys/sys/diskpc98.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.1 (Berkeley) 6/2/93 - * $Id: disklabel.h,v 1.14 1995/05/15 22:27:48 davidg Exp $ + * $Id: disklabel.h,v 1.15 1995/05/16 07:52:17 davidg Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -104,7 +104,7 @@ struct disklabel { short d_type; /* drive type */ short d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ - /* + /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the @@ -113,15 +113,15 @@ struct disklabel { * getdiskbyname(3) to retrieve the values from /etc/disktab. */ #if defined(KERNEL) || defined(STANDALONE) - char d_packname[16]; /* pack identifier */ + char d_packname[16]; /* pack identifier */ #else union { - char un_d_packname[16]; /* pack identifier */ + char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ - } un_b; - } d_un; + } un_b; + } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 @@ -389,7 +389,7 @@ extern struct dos_partition dos_partitions[NDOSPART]; * See <sys/reboot.h> for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor - * numbers (but not ones >= 2^31). Old cpio formats and all tar formats + * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ diff --git a/sys/sys/diskslice.h b/sys/sys/diskslice.h index c672733..6721e33 100644 --- a/sys/sys/diskslice.h +++ b/sys/sys/diskslice.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: diskslice.h,v 1.8 1995/05/01 00:07:17 julian Exp $ + * $Id: diskslice.h,v 1.9 1995/05/08 16:27:10 bde Exp $ */ #ifndef _SYS_DISKSLICE_H_ @@ -61,7 +61,7 @@ struct slice_switch ( /* * etc. * each routine is called with the address of the private data - * and the minor number.. + * and the minor number.. * Other arguments as needed */ }; diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 258695f..4742a01 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 - * $Id: filedesc.h,v 1.4 1994/10/02 17:24:44 phk Exp $ + * $Id: filedesc.h,v 1.5 1995/03/16 18:16:16 bde Exp $ */ #ifndef _SYS_FILEDESC_H_ @@ -52,7 +52,7 @@ * that will fit in a power-of-two sized piece of memory. */ #define NDFILE 20 -#define NDEXTENT 50 /* 250 bytes in 256-byte alloc. */ +#define NDEXTENT 50 /* 250 bytes in 256-byte alloc. */ struct filedesc { struct file **fd_ofiles; /* file structures for open files */ diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h index 471694d..bc60cf4 100644 --- a/sys/sys/gmon.h +++ b/sys/sys/gmon.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)gmon.h 8.2 (Berkeley) 1/4/94 - * $Id: gmon.h,v 1.4 1995/03/16 18:16:17 bde Exp $ + * $Id: gmon.h,v 1.5 1995/05/14 03:00:04 davidg Exp $ */ #ifndef _SYS_GMON_H_ @@ -76,7 +76,7 @@ struct gmonhdr { * calls $0,(r0) * calls $0,(r0) * - * which is separated by only three bytes, thus HASHFRACTION is + * which is separated by only three bytes, thus HASHFRACTION is * calculated as: * * HASHFRACTION = 3 / (2 * 2 - 1) = 1 @@ -84,9 +84,9 @@ struct gmonhdr { * Note that the division above rounds down, thus if MIN_SUBR_FRACTION * is less than three, this algorithm will not work! * - * In practice, however, call instructions are rarely at a minimal + * In practice, however, call instructions are rarely at a minimal * distance. Hence, we will define HASHFRACTION to be 2 across all - * architectures. This saves a reasonable amount of space for + * architectures. This saves a reasonable amount of space for * profiling data structures without (in practice) sacrificing * any granularity. */ @@ -112,7 +112,7 @@ struct tostruct { }; /* - * a raw arc, with pointers to the calling site and + * a raw arc, with pointers to the calling site and * the called site and a count. */ struct rawarc { diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 320794b..354efb2 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact.h,v 1.7 1994/08/21 04:41:47 paul Exp $ + * $Id: imgact.h,v 1.8 1994/10/02 17:24:45 phk Exp $ */ #ifndef _SYS_IMGACT_H_ @@ -60,4 +60,4 @@ struct image_params { int exec_extract_strings __P((struct image_params *)); int exec_new_vmspace __P((struct image_params *)); #endif -#endif +#endif diff --git a/sys/sys/imgact_aout.h b/sys/sys/imgact_aout.h index d701509..50d5979 100644 --- a/sys/sys/imgact_aout.h +++ b/sys/sys/imgact_aout.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)exec.h 8.1 (Berkeley) 6/11/93 - * $Id: imgact_aout.h,v 1.1 1994/09/24 21:09:18 davidg Exp $ + * $Id: imgact_aout.h,v 1.2 1994/12/30 08:06:19 bde Exp $ */ #ifndef _IMGACT_AOUT_H_ @@ -84,7 +84,7 @@ /* Text segment offset. */ #define N_TXTOFF(ex) \ (N_GETMAGIC(ex) == ZMAGIC ? __LDPGSZ : (N_GETMAGIC(ex) == QMAGIC || \ - N_GETMAGIC_NET(ex) == ZMAGIC) ? 0 : sizeof(struct exec)) + N_GETMAGIC_NET(ex) == ZMAGIC) ? 0 : sizeof(struct exec)) /* Data segment offset. */ #define N_DATOFF(ex) \ diff --git a/sys/sys/inflate.h b/sys/sys/inflate.h index 57a0c0f..a16ce4f 100644 --- a/sys/sys/inflate.h +++ b/sys/sys/inflate.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: inflate.h,v 1.4 1994/10/22 11:40:38 phk Exp $ + * $Id: inflate.h,v 1.5 1995/04/15 06:54:04 phk Exp $ * */ #ifndef _SYS_INFLATE_H_ @@ -27,7 +27,7 @@ struct inflate { /* This pointer is passed along to the two functions below */ void *gz_private; - + /* Fetch next character to be uncompressed */ int (*gz_input) (void *); diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index 10fbbd3a..d42e116 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.3 (Berkeley) 1/21/94 - * $Id: conf.h,v 1.13 1995/05/12 19:17:24 wollman Exp $ + * $Id: conf.h,v 1.14 1995/05/14 03:00:03 davidg Exp $ */ #ifndef _SYS_CONF_H_ @@ -55,10 +55,10 @@ struct vnode; typedef void d_strategy_t __P((struct buf *)); typedef int d_open_t __P((dev_t, int, int, struct proc *)); typedef int d_close_t __P((dev_t, int, int, struct proc *)); -typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); +typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); typedef int d_dump_t __P((dev_t)); typedef int d_psize_t __P((dev_t)); - + typedef int d_read_t __P((dev_t, struct uio *, int)); typedef int d_write_t __P((dev_t, struct uio *, int)); typedef int d_rdwr_t __P((dev_t, struct uio *, int)); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index d102a1e..1e6b19a 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mount.h 8.13 (Berkeley) 3/27/94 - * $Id: mount.h,v 1.17 1995/04/20 03:18:17 julian Exp $ + * $Id: mount.h,v 1.18 1995/05/21 21:39:24 davidg Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -298,7 +298,7 @@ struct vfsops { }; \ DATA_SET(vfs_set,_fs_vfsconf) #endif /* VFS_LKM */ - + #endif /* KERNEL */ /* diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 2a257e0..0c53c00 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)queue.h 8.4 (Berkeley) 1/4/94 - * $Id$ + * $Id: queue.h,v 1.2 1994/08/02 07:53:25 davidg Exp $ */ #ifndef _SYS_QUEUE_H_ diff --git a/sys/sys/snoop.h b/sys/sys/snoop.h index 82d5849..2b7180b 100644 --- a/sys/sys/snoop.h +++ b/sys/sys/snoop.h @@ -22,13 +22,13 @@ * usage there is no need to * allocate more. */ -#define SNOOP_MAXLEN (64*1024) /* This one also,64K enough +#define SNOOP_MAXLEN (64*1024) /* This one also,64K enough * If we grow more,something * really bad in this world.. */ /* - * This is the main snoop per-device + * This is the main snoop per-device * structure... */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index e215e1f..9ac9dfa 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)socketvar.h 8.1 (Berkeley) 6/2/93 - * $Id: socketvar.h,v 1.4 1994/08/21 04:41:58 paul Exp $ + * $Id: socketvar.h,v 1.5 1994/10/02 17:24:57 phk Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -231,7 +231,7 @@ int sbreserve __P((struct sockbuf *,u_long)); int soreserve __P((struct socket *,u_long,u_long)); int sb_lock __P((struct sockbuf *)); int sbwait __P((struct sockbuf *)); -void sbdrop __P((struct sockbuf *, int)); +void sbdrop __P((struct sockbuf *, int)); void sofree __P((struct socket *)); void sorflush __P((struct socket *)); int soqremque __P((struct socket *,int)); diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index 8291c07..7bd55eb 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -25,12 +25,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: soundcard.h,v 1.11 1995/02/13 22:48:54 jkh Exp $ + * $Id: soundcard.h,v 1.12 1995/03/08 18:43:49 ugen Exp $ */ - /* + /* * If you make modifications to this file, please contact me before - * distributing the modified version. There is already enough + * distributing the modified version. There is already enough * divercity in the world. * * Regards, @@ -134,7 +134,7 @@ struct patch_info { long len; /* Size of the wave data in bytes */ long loop_start, loop_end; /* Byte offsets from the beginning */ -/* +/* * The base_freq and base_note fields are used when computing the * playback speed for a note. The base_note defines the tone frequency * which is heard if the sample is played using the base_freq as the @@ -163,7 +163,7 @@ struct patch_info { unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */ unsigned char env_offset[ 6 ]; /* 255 == 100% */ - /* + /* * The tremolo, vibrato and scale info are not supported yet. * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or * WAVE_SCALE @@ -172,14 +172,14 @@ struct patch_info { unsigned char tremolo_sweep; unsigned char tremolo_rate; unsigned char tremolo_depth; - + unsigned char vibrato_sweep; unsigned char vibrato_rate; unsigned char vibrato_depth; int scale_frequency; unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */ - + int volume; int spare[4]; char data[1]; /* The waveform data starts here */ @@ -216,7 +216,7 @@ struct sysex_info { * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows * a patch manager daemon to read and write device parameters. This * ioctl available through /dev/sequencer also. Avoid using it since it's - * extremely hardware dependent. In addition access trough /dev/sequencer + * extremely hardware dependent. In addition access trough /dev/sequencer * may confuse the patch manager daemon. */ @@ -230,8 +230,8 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ int device; int command; -/* - * Commands 0x000 to 0xfff reserved for patch manager programs +/* + * Commands 0x000 to 0xfff reserved for patch manager programs */ #define PM_GET_DEVTYPE 1 /* Returns type of the patch mgr interface of dev */ #define PMTYPE_FM2 1 /* 2 OP fm */ @@ -251,7 +251,7 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ */ #define _PM_LOAD_PATCH 0x100 -/* +/* * Commands above 0xffff reserved for device specific use */ @@ -282,7 +282,7 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ * /dev/sequencer input events. * * The data written to the /dev/sequencer is a stream of events. Events - * are records of 4 or 8 bytes. The first byte defines the size. + * are records of 4 or 8 bytes. The first byte defines the size. * Any number of events can be written with a write call. There * is a set of macros for sending these events. Use these macros if you * want to maximize portability of your program. @@ -421,13 +421,13 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ * of the associated synthesizer device. There is no limit to the size * of the extended events. These events are not queued but executed * immediately when the write() is called (execution can take several - * seconds of time). + * seconds of time). * * When a SEQ_FULLSIZE message is written to the device, it must * be written using exactly one write() call. Other events cannot * be mixed to the same write. - * - * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the + * + * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the * /dev/sequencer. Don't write other data together with the instrument structure * Set the key field of the structure to FM_PATCH. The device field is used to * route the patch to the corresponding device. @@ -471,7 +471,7 @@ struct synth_info { /* Read only */ int nr_voices; int nr_drums; /* Obsolete field */ int instr_bank_size; - unsigned long capabilities; + unsigned long capabilities; #define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */ #define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */ #define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */ @@ -572,12 +572,12 @@ struct pss_speaker { /********************************************* * IOCTL commands for /dev/mixer */ - -/* + +/* * Mixer devices * * There can be up to 20 different analog mixer channels. The - * SOUND_MIXER_NRDEVICES gives the currently supported maximum. + * SOUND_MIXER_NRDEVICES gives the currently supported maximum. * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells * the devices supported by the particular mixer. */ @@ -688,7 +688,7 @@ struct pss_speaker { /* * The 4 most significant bits of byte 0 specify the class of - * the event: + * the event: * * 0x8X = system level events, * 0x9X = device/port specific events, event[1] = device/port, @@ -742,7 +742,7 @@ struct pss_speaker { #define TMR_SPP 10 /* Song position pointer */ #define TMR_TIMESIG 11 /* Time signature */ -#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) +#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) /* * Some convenience macros to simplify programming of the * /dev/sequencer interface @@ -783,16 +783,16 @@ void seqbuf_dump(void); /* This function must be provided by programs */ /* * This variation of the sequencer macros is used just to format one event * using fixed buffer. - * + * * The program using the macro library must define the following macros before * using this library. * - * #define _seqbuf name of the buffer (unsigned char[]) + * #define _seqbuf name of the buffer (unsigned char[]) * #define _SEQ_ADVBUF(len) If the applic needs to know the exact * size of the event, this macro can be used. * Otherwise this must be defined as empty. * #define _seqbufptr Define the name of index variable or 0 if - * not required. + * not required. */ #define _SEQ_NEEDBUF(len) /* empty */ #endif @@ -914,7 +914,7 @@ void seqbuf_dump(void); /* This function must be provided by programs */ #define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig) /* - * Events for the level 1 interface only + * Events for the level 1 interface only */ #define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\ diff --git a/sys/sys/stat.h b/sys/sys/stat.h index 0755fae..99ae6b9 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)stat.h 8.6 (Berkeley) 3/8/94 - * $Id: stat.h,v 1.4 1994/09/20 22:24:26 bde Exp $ + * $Id: stat.h,v 1.5 1994/10/02 17:24:57 phk Exp $ */ #ifndef _SYS_STAT_H_ @@ -180,7 +180,7 @@ struct stat { #endif /* !_POSIX_SOURCE */ #ifdef KERNEL -void cvtstat __P((struct stat *, struct ostat *)); +void cvtstat __P((struct stat *, struct ostat *)); #else /* KERNEL */ #include <sys/cdefs.h> diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 822f70c..2c61798 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 - * $Id: sysctl.h,v 1.21 1995/03/16 18:16:26 bde Exp $ + * $Id: sysctl.h,v 1.22 1995/05/12 19:17:25 wollman Exp $ */ #ifndef _SYS_SYSCTL_H_ @@ -63,7 +63,7 @@ /* * Each subsystem defined by sysctl defines a list of variables - * for that subsystem. Each name is either a node with further + * for that subsystem. Each name is either a node with further * levels defined below it, or it is a leaf of some particular * type given below. Each sysctl level defines a set of name/type * pairs to be used by sysctl(1) in manipulating the subsystem. @@ -181,7 +181,7 @@ struct ctlname { { "vfsconf", CTLTYPE_STRUCT }, \ } -/* +/* * KERN_PROC subtypes */ #define KERN_PROC_ALL 0 /* everything */ @@ -192,7 +192,7 @@ struct ctlname { #define KERN_PROC_UID 5 /* by effective uid */ #define KERN_PROC_RUID 6 /* by real uid */ -/* +/* * KERN_PROC subtype ops return arrays of augmented proc structures: */ struct kinfo_proc { diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 5676b88..54a3d44 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)systm.h 8.4 (Berkeley) 2/23/94 - * $Id: systm.h,v 1.20 1995/05/02 05:35:07 davidg Exp $ + * $Id: systm.h,v 1.21 1995/05/14 03:00:06 davidg Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -57,7 +57,7 @@ * raw disks of mounted filesystems, /dev/mem, and /dev/kmem are * read-only. * 2 highly secure mode - same as (1) plus raw disks are always - * read-only whether mounted or not. This level precludes tampering + * read-only whether mounted or not. This level precludes tampering * with filesystems by unmounting them, but also inhibits running * newfs while the system is secured. * diff --git a/sys/sys/termios.h b/sys/sys/termios.h index 8c83d1d..14b2648 100644 --- a/sys/sys/termios.h +++ b/sys/sys/termios.h @@ -31,18 +31,18 @@ * SUCH DAMAGE. * * @(#)termios.h 8.3 (Berkeley) 3/28/94 - * $Id: termios.h,v 1.4 1995/04/30 14:56:30 bde Exp $ + * $Id: termios.h,v 1.5 1995/05/11 07:52:47 bde Exp $ */ #ifndef _SYS_TERMIOS_H_ #define _SYS_TERMIOS_H_ -/* - * Special Control Characters +/* + * Special Control Characters * * Index into c_cc[] character array. * - * Name Subscript Enabled by + * Name Subscript Enabled by */ #define VEOF 0 /* ICANON */ #define VEOL 1 /* ICANON */ @@ -52,7 +52,7 @@ #define VERASE 3 /* ICANON */ #ifndef _POSIX_SOURCE #define VWERASE 4 /* ICANON */ -#endif +#endif #define VKILL 5 /* ICANON */ #ifndef _POSIX_SOURCE #define VREPRINT 6 /* ICANON */ @@ -141,7 +141,7 @@ #endif -/* +/* * "Local" flags - dumping ground for other state * * Warning: some flags in this structure begin with @@ -189,7 +189,7 @@ struct termios { speed_t c_ospeed; /* output speed */ }; -/* +/* * Commands passed to tcsetattr() for setting the termios structure. */ #define TCSANOW 0 /* make change immediate */ diff --git a/sys/sys/ttycom.h b/sys/sys/ttycom.h index 00a8e26..75c8619 100644 --- a/sys/sys/ttycom.h +++ b/sys/sys/ttycom.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ttycom.h 8.1 (Berkeley) 3/28/94 - * $Id: ttycom.h,v 1.7 1995/01/05 00:01:07 ache Exp $ + * $Id: ttycom.h,v 1.8 1995/03/30 05:17:50 ache Exp $ */ #ifndef _SYS_TTYCOM_H_ @@ -124,7 +124,7 @@ struct winsize { #define TIOCDRAIN _IO('t', 94) /* wait till output drained */ #define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */ #define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */ -#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* get timestamp of +#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* get timestamp of last interrupt for xntp. */ #define TIOCDSIMICROCODE _IO('t', 85) /* Download microcode to DSI Softmodem */ diff --git a/sys/sys/ttydefaults.h b/sys/sys/ttydefaults.h index dfc7e47..43216c7 100644 --- a/sys/sys/ttydefaults.h +++ b/sys/sys/ttydefaults.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 - * $Id: ttydefaults.h,v 1.7 1995/03/06 02:50:49 nate Exp $ + * $Id: ttydefaults.h,v 1.8 1995/05/11 07:52:48 bde Exp $ */ /* @@ -89,7 +89,7 @@ */ #ifdef TTYDEFCHARS static cc_t ttydefchars[NCCS] = { - CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, + CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }; diff --git a/sys/sys/un.h b/sys/sys/un.h index a2de0ee..b85714b 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)un.h 8.1 (Berkeley) 6/2/93 - * $Id: un.h,v 1.4 1994/08/21 04:42:09 paul Exp $ + * $Id: un.h,v 1.5 1994/10/02 17:25:03 phk Exp $ */ #ifndef _SYS_UN_H_ @@ -52,9 +52,9 @@ struct sockaddr_un { #ifdef KERNEL int unp_connect2 __P((struct socket*,struct socket*)); -void unp_detach __P((struct unpcb *)); +void unp_detach __P((struct unpcb *)); void unp_disconnect __P((struct unpcb *)); -void unp_shutdown __P((struct unpcb *)); +void unp_shutdown __P((struct unpcb *)); void unp_drop __P((struct unpcb *, int)); void unp_gc __P((void)); void unp_scan __P((struct mbuf *, void (*)(struct file *))); diff --git a/sys/sys/user.h b/sys/sys/user.h index 607acdd..08e74dc 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)user.h 8.2 (Berkeley) 9/23/93 - * $Id: user.h,v 1.2 1994/08/02 07:54:06 davidg Exp $ + * $Id: user.h,v 1.3 1994/08/21 04:42:10 paul Exp $ */ #ifndef _SYS_USER_H_ @@ -58,7 +58,7 @@ * This structure may or may not be at the same kernel address * in all processes. */ - + struct user { struct pcb u_pcb; diff --git a/sys/sys/vlimit.h b/sys/sys/vlimit.h index 9cd1bf5..b1a1fe3 100644 --- a/sys/sys/vlimit.h +++ b/sys/sys/vlimit.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vlimit.h 8.1 (Berkeley) 6/2/93 - * $Id: vlimit.h,v 1.2 1994/08/02 07:54:11 davidg Exp $ + * $Id: vlimit.h,v 1.3 1994/08/21 04:42:13 paul Exp $ */ #ifndef _SYS_VLIMIT_H_ @@ -52,4 +52,4 @@ #define INFINITY 0x7fffffff -#endif +#endif diff --git a/sys/sys/vsio.h b/sys/sys/vsio.h index 3d67cd6..b867b8b 100644 --- a/sys/sys/vsio.h +++ b/sys/sys/vsio.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vsio.h 8.1 (Berkeley) 6/2/93 - * $Id: vsio.h,v 1.2 1994/08/02 07:54:14 davidg Exp $ + * $Id: vsio.h,v 1.3 1994/08/21 04:42:16 paul Exp $ */ #ifndef _SYS_VSIO_H_ @@ -58,16 +58,16 @@ * * * * ****************************************************************************/ -/* +/* * vsio.h - VS100 I/O command definitions - * + * * Author: Christopher A. Kent * Digital Equipment Corporation * Western Research Lab * Date: Tue Jun 21 1983 */ -/* +/* * Possible ioctl calls */ @@ -92,7 +92,7 @@ #define VS_FIB_FINITE 1 /* finite retries */ #define VS_FIB_INFINITE 2 /* infinite retries */ -/* +/* * Event queue entries */ diff --git a/sys/sys/wait.h b/sys/sys/wait.h index 85ae401..0b8ec48 100644 --- a/sys/sys/wait.h +++ b/sys/sys/wait.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)wait.h 8.1 (Berkeley) 6/2/93 - * $Id: wait.h,v 1.2 1994/08/02 07:54:15 davidg Exp $ + * $Id: wait.h,v 1.3 1994/08/21 04:42:17 paul Exp $ */ #ifndef _SYS_WAIT_H_ @@ -103,13 +103,13 @@ union wait { * Terminated process status. */ struct { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN unsigned int w_Termsig:7, /* termination signal */ w_Coredump:1, /* core dump indicator */ w_Retcode:8, /* exit code if w_termsig==0 */ w_Filler:16; /* upper bits filler */ #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN unsigned int w_Filler:16, /* upper bits filler */ w_Retcode:8, /* exit code if w_termsig==0 */ w_Coredump:1, /* core dump indicator */ @@ -122,12 +122,12 @@ union wait { * with the WUNTRACED option bit. */ struct { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN unsigned int w_Stopval:8, /* == W_STOPPED if stopped */ w_Stopsig:8, /* signal that stopped us */ w_Filler:16; /* upper bits filler */ #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN unsigned int w_Filler:16, /* upper bits filler */ w_Stopsig:8, /* signal that stopped us */ w_Stopval:8; /* == W_STOPPED if stopped */ diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 1e9ce49..d91c557 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94 - * $Id: ffs_alloc.c,v 1.12 1995/03/26 23:29:09 davidg Exp $ + * $Id: ffs_alloc.c,v 1.13 1995/05/11 19:26:48 rgrimes Exp $ */ #include <sys/param.h> @@ -69,7 +69,7 @@ void ffs_clusteracct __P((struct fs *, struct cg *, daddr_t, int)); /* * Allocate a block in the file system. - * + * * The size of the requested block is given, which must be some * multiple of fs_fsize and <= fs_bsize. * A preference may be optionally specified. If a preference is given @@ -100,8 +100,8 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp) #ifdef QUOTA int error; #endif - - + + *bnp = 0; fs = ip->i_fs; #ifdef DIAGNOSTIC @@ -169,7 +169,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) struct buf *bp; int cg, request, error; daddr_t bprev, bno; - + *bpp = 0; fs = ip->i_fs; #ifdef DIAGNOSTIC @@ -206,7 +206,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) panic("ffs_realloccg: lbprev out of range"); bp->b_blkno = fsbtodb(fs, bprev); } - + #ifdef QUOTA error = chkdq(ip, (long)btodb(nsize - osize), cred, 0); if (error) { @@ -238,8 +238,8 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp) switch ((int)fs->fs_optim) { case FS_OPTSPACE: /* - * Allocate an exact sized fragment. Although this makes - * best use of space, we will waste time relocating it if + * Allocate an exact sized fragment. Although this makes + * best use of space, we will waste time relocating it if * the file continues to grow. If the fragmentation is * less than half of the minimum free reserve, we choose * to begin optimizing for time. @@ -432,7 +432,7 @@ ffs_reallocblks(ap) * Next we must write out the modified inode and indirect blocks. * For strict correctness, the writes should be synchronous since * the old block values may have been written to disk. In practise - * they are almost never written, but if we are concerned about + * they are almost never written, but if we are concerned about * strict correctness, the `doasyncfree' flag should be set to zero. * * The test on `doasyncfree' should be changed to test a flag @@ -477,7 +477,7 @@ fail: /* * Allocate an inode in the file system. - * + * * If allocating a directory, use ffs_dirpref to select the inode. * If allocating in a directory, the following hierarchy is followed: * 1) allocate the preferred inode. @@ -506,7 +506,7 @@ ffs_valloc(ap) mode_t mode = ap->a_mode; ino_t ino, ipref; int cg, error; - + *ap->a_vpp = NULL; pip = VTOI(pvp); fs = pip->i_fs; @@ -582,7 +582,7 @@ ffs_dirpref(fs) * Select the desired position for the next block in a file. The file is * logically divided into sections. The first section is composed of the * direct blocks. Each additional section contains fs_maxbpg blocks. - * + * * If no blocks have been allocated in the first section, the policy is to * request a block in the same cylinder group as the inode that describes * the file. If no blocks have been allocated in any other section, the @@ -596,7 +596,7 @@ ffs_dirpref(fs) * indirect block, the information on the previous allocation is unavailable; * here a best guess is made based upon the logical block number being * allocated. - * + * * If a section is already partially allocated, the policy is to * contiguously allocate fs_maxcontig blocks. The end of one of these * contiguous blocks and the beginning of the next is physically separated @@ -726,7 +726,7 @@ ffs_hashalloc(ip, cg, pref, size, allocator) /* * Determine whether a fragment can be extended. * - * Check to see if the necessary fragments are available, and + * Check to see if the necessary fragments are available, and * if they are, allocate them. */ static daddr_t @@ -844,7 +844,7 @@ ffs_alloccg(ip, cg, bpref, size) break; if (allocsiz == fs->fs_frag) { /* - * no fragments were available, so a block will be + * no fragments were available, so a block will be * allocated, and hacked up */ if (cgp->cg_cs.cs_nbfree == 0) { @@ -921,7 +921,7 @@ ffs_alloccgblk(fs, cgp, bpref) /* * Block layout information is not available. * Leaving bpref unchanged means we take the - * next available free block following the one + * next available free block following the one * we just allocated. Hopefully this will at * least hit a track cache on drives of unknown * geometry (e.g. SCSI). @@ -935,7 +935,7 @@ ffs_alloccgblk(fs, cgp, bpref) if (cg_blktot(cgp)[cylno] == 0) goto norot; /* - * check the summary information to see if a block is + * check the summary information to see if a block is * available in the requested cylinder starting at the * requested rotational position and proceeding around. */ @@ -1172,7 +1172,7 @@ gotit: * Free a block or fragment. * * The specified block or fragment is placed back in the - * free map. If a fragment is deallocated, a possible + * free map. If a fragment is deallocated, a possible * block reassembly is checked. */ void @@ -1486,7 +1486,7 @@ ffs_clusteracct(fs, cgp, blkno, cnt) /* * Fserr prints the name of a file system with an error diagnostic. - * + * * The form of the error message is: * fs: error message */ diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index 687781e..cbe9c60 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_balloc.c 8.4 (Berkeley) 9/23/93 - * $Id: ffs_balloc.c,v 1.7 1995/04/09 06:03:36 davidg Exp $ + * $Id: ffs_balloc.c,v 1.8 1995/05/28 04:32:23 davidg Exp $ */ #include <sys/param.h> @@ -174,7 +174,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) nb = ip->i_ib[indirs[0].in_off]; if (nb == 0) { pref = ffs_blkpref(ip, lbn, 0, (daddr_t *)0); - error = ffs_alloc(ip, lbn, pref, + error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb); if (error) return (error); diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 4a02c4b..cbf9652 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_subr.c 8.2 (Berkeley) 9/21/93 - * $Id: ffs_subr.c,v 1.2 1994/08/02 07:54:22 davidg Exp $ + * $Id: ffs_subr.c,v 1.3 1994/10/10 01:04:38 phk Exp $ */ #include <sys/param.h> @@ -84,7 +84,7 @@ ffs_blkatoff(ap) #endif /* - * Update the frsum fields to reflect addition or deletion + * Update the frsum fields to reflect addition or deletion * of some frags. */ void diff --git a/sys/ufs/ffs/ffs_tables.c b/sys/ufs/ffs/ffs_tables.c index cc70ee1..089334f 100644 --- a/sys/ufs/ffs/ffs_tables.c +++ b/sys/ufs/ffs/ffs_tables.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_tables.c 8.1 (Berkeley) 6/11/93 - * $Id$ + * $Id: ffs_tables.c,v 1.2 1994/08/02 07:54:22 davidg Exp $ */ #include <sys/param.h> @@ -49,7 +49,7 @@ int inside[9] = { /* * Given a block map bit pattern, the frag tables tell whether a - * particular size fragment is available. + * particular size fragment is available. * * used as: * if ((1 << (size - 1)) & fragtbl[fs->fs_frag][map] { diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index a52ddd5..6622113 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.19 1995/05/15 08:39:37 davidg Exp $ + * $Id: ffs_vfsops.c,v 1.20 1995/05/19 03:26:56 davidg Exp $ */ #include <sys/param.h> @@ -103,7 +103,7 @@ ffs_mountroot() struct ufsmount *ump; u_int size; int error; - + /* * Get vnode for rootdev. */ @@ -246,7 +246,7 @@ ffs_mount(mp, path, data, ndp, p) bzero(fs->fs_fsmnt + size, sizeof(fs->fs_fsmnt) - size); bcopy((caddr_t)fs->fs_fsmnt, (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN); - (void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, + (void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); (void)ffs_statfs(mp, &mp->mnt_stat, p); @@ -706,7 +706,7 @@ loop: 0, 0, 0); vput(vp); } - + if ((((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0)) && vp->v_dirtyblkhd.lh_first == NULL) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index e2abd2b..c5209fc 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vnops.c 8.7 (Berkeley) 2/3/94 - * $Id: ffs_vnops.c,v 1.9 1995/04/09 06:03:40 davidg Exp $ + * $Id: ffs_vnops.c,v 1.10 1995/05/21 21:39:26 davidg Exp $ */ #include <sys/param.h> @@ -267,7 +267,7 @@ loop: panic("ffs_fsync: not dirty"); if (bp->b_vp != vp || ap->a_waitfor != MNT_NOWAIT) { - + bremfree(bp); bp->b_flags |= B_BUSY; splx(s); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 0aa090a..41f204c 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fs.h 8.7 (Berkeley) 4/19/94 - * $Id: fs.h,v 1.3 1994/08/21 07:03:56 paul Exp $ + * $Id: fs.h,v 1.4 1995/03/10 22:18:16 davidg Exp $ */ #ifndef _UFS_FFS_FS_H_ @@ -70,7 +70,7 @@ /* * Addresses stored in inodes are capable of addressing fragments - * of `blocks'. File system blocks of at most size MAXBSIZE can + * of `blocks'. File system blocks of at most size MAXBSIZE can * be optionally broken into 2, 4, or 8 pieces, each of which is * addressible; these pieces may be DEV_BSIZE, or some multiple of * a DEV_BSIZE unit. @@ -100,7 +100,7 @@ /* * The path name on which the file system is mounted is maintained - * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in + * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. * The limit on the amount of summary information per file system * is defined by MAXCSBUFS. It is currently parameterized for a @@ -224,7 +224,7 @@ struct fs { long fs_cpc; /* cyl per cycle in postbl */ short fs_opostbl[16][8]; /* old rotation block list head */ long fs_sparecon[50]; /* reserved for future constants */ - long fs_contigsumsize; /* size of cluster summary array */ + long fs_contigsumsize; /* size of cluster summary array */ long fs_maxsymlinklen; /* max length of an internal symlink */ long fs_inodefmt; /* format of on-disk inodes */ u_quad_t fs_maxfilesize; /* maximum representable file size */ @@ -272,7 +272,7 @@ struct fs { /* * The size of a cylinder group is calculated by CGSIZE. The maximum size * is limited by the fact that cylinder groups are at most one block. - * Its size is derived from the size of the maps maintained in the + * Its size is derived from the size of the maps maintained in the * cylinder group and the (struct cg) size. */ #define CGSIZE(fs) \ diff --git a/sys/ufs/lfs/lfs.h b/sys/ufs/lfs/lfs.h index 3a072a8..1ae1e23 100644 --- a/sys/ufs/lfs/lfs.h +++ b/sys/ufs/lfs/lfs.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs.h 8.3 (Berkeley) 9/23/93 - * $Id: lfs.h,v 1.4 1994/10/10 01:04:47 phk Exp $ + * $Id: lfs.h,v 1.5 1994/11/17 01:30:47 gibbs Exp $ */ #ifndef _UFS_LFS_LFS_H_ @@ -286,7 +286,7 @@ struct segsum { */ #endif -/* +/* * Determine if there is enough room currently available to write db * disk blocks. We need enough blocks for the new blocks, the current, * inode blocks, a summary block, plus potentially the ifile inode and diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c index 8491494..81fac0d 100644 --- a/sys/ufs/lfs/lfs_balloc.c +++ b/sys/ufs/lfs/lfs_balloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_balloc.c 8.1 (Berkeley) 6/11/93 - * $Id: lfs_balloc.c,v 1.5 1995/03/28 07:58:02 bde Exp $ + * $Id: lfs_balloc.c,v 1.6 1995/04/09 06:03:41 davidg Exp $ */ #include <sys/param.h> #include <sys/systm.h> @@ -68,7 +68,7 @@ lfs_balloc(vp, iosize, lbn, bpp) ip = VTOI(vp); fs = ip->i_lfs; - /* + /* * Three cases: it's a block beyond the end of file, it's a block in * the file that may or may not have been assigned a disk address or * we're writing an entire block. Note, if the daddr is unassigned, @@ -114,7 +114,7 @@ lfs_balloc(vp, iosize, lbn, bpp) /* Now, we may need to allocate the data block */ if (!(bp->b_flags & (B_CACHE | B_DONE | B_DELWRI))) { - if (daddr == UNASSIGNED) + if (daddr == UNASSIGNED) if (!ISSPACE(fs, bb, curproc->p_ucred)) { bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/ufs/lfs/lfs_cksum.c b/sys/ufs/lfs/lfs_cksum.c index 8b70a40..b3f689c 100644 --- a/sys/ufs/lfs/lfs_cksum.c +++ b/sys/ufs/lfs/lfs_cksum.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_cksum.c 8.1 (Berkeley) 6/11/93 - * $Id$ + * $Id: lfs_cksum.c,v 1.2 1994/08/02 07:54:32 davidg Exp $ */ #include <sys/types.h> @@ -49,7 +49,7 @@ cksum(str, len) register size_t len; { register u_long sum; - + len &= ~(sizeof(u_short) - 1); for (sum = 0; len; len -= sizeof(u_short)) { sum ^= *(u_short *)str; diff --git a/sys/ufs/lfs/lfs_debug.c b/sys/ufs/lfs/lfs_debug.c index 5816c89..1edffbf 100644 --- a/sys/ufs/lfs/lfs_debug.c +++ b/sys/ufs/lfs/lfs_debug.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_debug.c 8.1 (Berkeley) 6/11/93 - * $Id$ + * $Id: lfs_debug.c,v 1.2 1994/08/02 07:54:33 davidg Exp $ */ #ifdef DEBUG @@ -45,7 +45,7 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> -void +void lfs_dump_super(lfsp) struct lfs *lfsp; { @@ -86,7 +86,7 @@ lfs_dump_super(lfsp) "fbmask ", lfsp->lfs_fbmask, "fbshift ", lfsp->lfs_fbshift); - (void)printf("%s%d\t%s%d\t%s%lx\t%s%qx\n", + (void)printf("%s%d\t%s%d\t%s%lx\t%s%qx\n", "sushift ", lfsp->lfs_sushift, "fsbtodb ", lfsp->lfs_fsbtodb, "cksum ", lfsp->lfs_cksum, diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c index cc298d9..61437c5 100644 --- a/sys/ufs/lfs/lfs_inode.c +++ b/sys/ufs/lfs/lfs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_inode.c 8.5 (Berkeley) 12/30/93 - * $Id: lfs_inode.c,v 1.7 1995/03/19 14:29:17 davidg Exp $ + * $Id: lfs_inode.c,v 1.8 1995/03/26 23:29:13 davidg Exp $ */ #include <sys/param.h> @@ -128,7 +128,7 @@ lfs_update(ap) if(ap->a_waitfor & LFS_SYNC && vp->v_dirtyblkhd.lh_first != NULL) panic("lfs_update: dirty bufs"); return( error ); - + } /* Update segment usage information when removing a block. */ @@ -229,7 +229,7 @@ lfs_truncate(ap) #ifdef QUOTA if (e1 = getinoquota(ip)) return (e1); -#endif +#endif if (e1 = bread(vp, lbn, fs->lfs_bsize, NOCRED, &bp)) return (e1); ip->i_size = length; @@ -289,9 +289,9 @@ lfs_truncate(ap) brelse (bp); else { bzero((daddr_t *)bp->b_data + - inp->in_off, fs->lfs_bsize - + inp->in_off, fs->lfs_bsize - inp->in_off * sizeof(daddr_t)); - if (e1 = VOP_BWRITE(bp)) + if (e1 = VOP_BWRITE(bp)) return (e1); } } @@ -370,7 +370,7 @@ lfs_truncate(ap) #endif fs->lfs_avail += fsbtodb(fs, a_released); e1 = vinvalbuf(vp, (length > 0) ? V_SAVE : 0, ap->a_cred, ap->a_p, - 0, 0); + 0, 0); e2 = VOP_UPDATE(vp, &tv, &tv, 0); return (e1 ? e1 : e2 ? e2 : 0); } diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index d639747..48a73ce 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_segment.c 8.5 (Berkeley) 1/4/94 - * $Id: lfs_segment.c,v 1.9 1995/03/28 07:58:05 bde Exp $ + * $Id: lfs_segment.c,v 1.10 1995/05/11 19:26:51 rgrimes Exp $ */ #include <sys/param.h> @@ -98,7 +98,7 @@ lfs_reclaim_buffers() { reclaimed = 1; if( lfs_freebufs[i].address ){ splx(s); - free(lfs_freebufs[i].address, M_SEGMENT); + free(lfs_freebufs[i].address, M_SEGMENT); s = splhigh(); } lfs_total_io_size -= lfs_freebufs[i].size; @@ -133,8 +133,8 @@ lfs_alloc_buffer(int size) { rtval = malloc(size, M_SEGMENT, M_WAITOK); return rtval; } - - + + /* * Determine if it's OK to start a partial in this segment, or if we need * to go on to a new segment. @@ -187,14 +187,14 @@ lfs_vflush(vp) int error; fs = VFSTOUFS(vp->v_mount)->um_lfs; - /* XXX - * lfs_segwrite uses lfs_writevnodes to flush dirty vnodes. - * lfs_writevnodes (by way of a check with lfs_vref) passes over + /* XXX + * lfs_segwrite uses lfs_writevnodes to flush dirty vnodes. + * lfs_writevnodes (by way of a check with lfs_vref) passes over * locked vnodes. Since we usually come here with vp locked, anytime * we just happen to call lfs_vflush and we are past the "MAX_ACTIVE" * threshold, we used to call lfs_seqwrite and assume it would take - * care of the problem... but of course it didn't. Now the question - * remains, is this the right thing to do, or should lfs_seqwrite or + * care of the problem... but of course it didn't. Now the question + * remains, is this the right thing to do, or should lfs_seqwrite or * lfs_writevnodes be fixed to handle locked vnodes?? */ if (fs->lfs_nactive > MAX_ACTIVE){ @@ -283,7 +283,7 @@ loop: (void) lfs_writeinode(fs, sp, ip); } vp->v_flag &= ~VDIROP; - lfs_vunref(vp); + lfs_vunref(vp); } } @@ -338,7 +338,7 @@ lfs_segwrite(mp, flags) if (fs->lfs_dirops && (error = tsleep(&fs->lfs_writer, PRIBIO + 1, "lfs writer", 0))) { free(sp->bpp, M_SEGMENT); - free(sp, M_SEGMENT); + free(sp, M_SEGMENT); fs->lfs_writer = 0; return (error); } @@ -360,7 +360,7 @@ lfs_segwrite(mp, flags) segusep = (SEGUSE *)bp->b_data; for (i = fs->lfs_sepb; i--; segusep++) segusep->su_flags &= ~SEGUSE_ACTIVE; - + error = VOP_BWRITE(bp); } @@ -526,7 +526,7 @@ lfs_writeinode(fs, sp, ip) * No need to update segment usage if there was no former inode address * or if the last inode address is in the current partial segment. */ - if (daddr != LFS_UNUSED_DADDR && + if (daddr != LFS_UNUSED_DADDR && !(daddr >= fs->lfs_lastpseg && daddr <= bp->b_blkno)) { LFS_SEGENTRY(sup, fs, datosn(fs, daddr), bp); #ifdef DIAGNOSTIC @@ -576,7 +576,7 @@ lfs_gatherblock(sp, bp, sptr) sp->fip->fi_ino = VTOI(sp->vp)->i_number; /* Add the current file to the segment summary. */ ++((SEGSUM *)(sp->segsum))->ss_nfinfo; - sp->sum_bytes_left -= + sp->sum_bytes_left -= sizeof(struct finfo) - sizeof(daddr_t); if (sptr) @@ -644,7 +644,7 @@ lfs_updatemeta(sp) vp = sp->vp; nblocks = &sp->fip->fi_blocks[sp->fip->fi_nblocks] - sp->start_lbp; - if (vp == NULL || nblocks == 0) + if (vp == NULL || nblocks == 0) return; /* Sort the blocks. */ @@ -1171,7 +1171,7 @@ int lfs_vref(vp) register struct vnode *vp; { - if ((vp->v_flag & VXLOCK) || + if ((vp->v_flag & VXLOCK) || (vp->v_usecount == 0 && vp->v_freelist.tqe_prev == (struct vnode **)0xdeadb)) return(1); diff --git a/sys/ufs/lfs/lfs_subr.c b/sys/ufs/lfs/lfs_subr.c index 52d1574..f911c3f 100644 --- a/sys/ufs/lfs/lfs_subr.c +++ b/sys/ufs/lfs/lfs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_subr.c 8.2 (Berkeley) 9/21/93 - * $Id: lfs_subr.c,v 1.5 1995/01/04 23:46:32 gibbs Exp $ + * $Id: lfs_subr.c,v 1.6 1995/01/09 16:05:23 davidg Exp $ */ #include <sys/param.h> @@ -101,7 +101,7 @@ lfs_seglock(fs, flags) if (fs->lfs_lockpid == curproc->p_pid) { ++fs->lfs_seglock; fs->lfs_sp->seg_flags |= flags; - return; + return; } else while (fs->lfs_seglock) (void)tsleep(&fs->lfs_seglock, PRIBIO + 1, "lfs seglock", 0); diff --git a/sys/ufs/lfs/lfs_syscalls.c b/sys/ufs/lfs/lfs_syscalls.c index 13f71e2..1ec0cdc 100644 --- a/sys/ufs/lfs/lfs_syscalls.c +++ b/sys/ufs/lfs/lfs_syscalls.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_syscalls.c 8.5 (Berkeley) 4/20/94 - * $Id: lfs_syscalls.c,v 1.8 1995/04/24 05:13:28 dyson Exp $ + * $Id: lfs_syscalls.c,v 1.9 1995/05/11 19:26:52 rgrimes Exp $ */ #include <sys/param.h> @@ -171,7 +171,7 @@ lfs_markv(p, uap, retval) /* Get the vnode/inode. */ if (lfs_fastvget(mntp, blkp->bi_inode, v_daddr, &vp, - blkp->bi_lbn == LFS_UNUSED_LBN ? + blkp->bi_lbn == LFS_UNUSED_LBN ? blkp->bi_bp : NULL)) { #ifdef DIAGNOSTIC printf("lfs_markv: VFS_VGET failed (%ld)\n", @@ -244,7 +244,7 @@ err2: lfs_vunref(vp); } else brelse(*bpp); lfs_segunlock(fs); -err1: +err1: free(start, M_SEGMENT); return (error); } @@ -320,7 +320,7 @@ lfs_bmapv(p, uap, retval) struct lfs_segclean_args { fsid_t *fsidp; /* file system */ u_long segment; /* segment number */ -}; +}; int lfs_segclean(p, uap, retval) struct proc *p; diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index eff079f..3d26953 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93 - * $Id: lfs_vnops.c,v 1.7 1995/03/28 07:58:06 bde Exp $ + * $Id: lfs_vnops.c,v 1.8 1995/04/09 06:03:42 davidg Exp $ */ #include <sys/param.h> @@ -496,7 +496,7 @@ lfs_inactive(ap) struct vnode *a_vp; } */ *ap; { - + if (ap->a_vp->v_flag & VNINACT) { return(0); } diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index f0c7297..00105ea 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)inode.h 8.4 (Berkeley) 1/21/94 - * $Id: inode.h,v 1.4 1994/12/27 13:59:14 bde Exp $ + * $Id: inode.h,v 1.5 1995/04/24 05:13:11 dyson Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -57,7 +57,7 @@ * file in the UFS filesystem. It is composed of two types of * information. The first part is the information that is needed * only while the file is active (such as the identity of the file - * and linkage to speed its lookup). The second part is the + * and linkage to speed its lookup). The second part is the * permannent meta-data associated with the file which is read * in from the permanent dinode from long term storage when the * file becomes active, and is put back when the file is no longer diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index 1bc8455..900d2c2 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_bmap.c 8.6 (Berkeley) 1/21/94 - * $Id: ufs_bmap.c,v 1.6 1995/03/04 03:24:45 davidg Exp $ + * $Id: ufs_bmap.c,v 1.7 1995/03/28 07:58:16 bde Exp $ */ #include <sys/param.h> @@ -159,7 +159,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) devvp = VFSTOUFS(vp->v_mount)->um_devvp; for (bp = NULL, ++xap; --num; ++xap) { - /* + /* * Exit the loop if there is no disk address assigned yet and * the indirect block isn't in the cache, or if we were * looking for an indirect block and we've found it. @@ -242,7 +242,7 @@ ufs_getlbns(vp, bn, ap, nump) if (bn < NDADDR) return (0); - /* + /* * Determine the number of levels of indirection. After this loop * is done, blockcnt indicates the number of data blocks possible * at the given level of indirection, and NIADDR - i is the number @@ -262,7 +262,7 @@ ufs_getlbns(vp, bn, ap, nump) else metalbn = -(-realbn - bn + NIADDR - i); - /* + /* * At each iteration, off is the offset into the bap array which is * an array of disk addresses at the current level of indirection. * The logical block number and the offset in that block are stored diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index 8d4a6fd..958f594 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -42,7 +42,7 @@ * SUCH DAMAGE. * * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: ufs_disksubr.c,v 1.13 1995/03/18 06:38:04 davidg Exp $ + * $Id: ufs_disksubr.c,v 1.14 1995/03/18 07:06:51 davidg Exp $ */ #include <sys/param.h> @@ -255,7 +255,7 @@ readdisklabel(dev, strat, lp, dp, bdp) * will be relative to the base of the BSD part. */ msgMSP = readMSPtolabel(dev, strat, lp, dp, &cyl ); - + /* * next, dig out disk label, relative to either the base of the * BSD part, or block 0, depending on if an MSP was found. @@ -481,7 +481,7 @@ writedisklabel(dev, strat, lp) * force OURPART to start at block 0 as a default in case there is NO * MSP. * readMSPtolabel() will reset it to start at the start of the BSD - * part if it exists + * part if it exists * At this time this is an error contition but I've left support for it */ lp->d_npartitions = OURPART + 1; @@ -491,7 +491,7 @@ writedisklabel(dev, strat, lp) msg = readMSPtolabel(dev, strat, lp, 0, &cyl ); /* - * If we want to be able to install without an Machine Specific + * If we want to be able to install without an Machine Specific * Partitioning , then * the failure of readMSPtolabel() should be made non fatal. */ @@ -515,7 +515,7 @@ writedisklabel(dev, strat, lp) /* * get all the other bits back from the good new disklabel * (the user wouldn't try confuse us would he?) - * With the exception of the OURPART which now points to the + * With the exception of the OURPART which now points to the * BSD partition. */ BSDstart = lp->d_partitions[OURPART].p_offset; diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index e1ba55cd..9b1f621 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)ufs_quota.c 8.2 (Berkeley) 12/30/93 - * $Id: ufs_quota.c,v 1.3 1994/10/06 21:07:02 davidg Exp $ + * $Id: ufs_quota.c,v 1.4 1994/10/08 06:57:27 phk Exp $ */ #include <sys/param.h> #include <sys/kernel.h> @@ -450,7 +450,7 @@ quotaoff(p, mp, type) register struct dquot *dq; register struct inode *ip; int error; - + if ((mp->mnt_flag & MNT_MPBUSY) == 0) panic("quotaoff: not busy"); if ((qvp = ump->um_quotas[type]) == NULLVP) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b5fef5d..48e52dd 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94 - * $Id: ufs_vnops.c,v 1.22 1995/04/25 03:32:37 dyson Exp $ + * $Id: ufs_vnops.c,v 1.23 1995/05/15 07:31:09 davidg Exp $ */ #include <sys/param.h> @@ -393,7 +393,7 @@ ufs_setattr(ap) if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) { if (cred->cr_uid != ip->i_uid && (error = suser(cred, &p->p_acflag)) && - ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || + ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) return (error); if (vap->va_atime.ts_sec != VNOVAL) @@ -878,7 +878,7 @@ abortit: * directory heirarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so - * as to be able to change "..". We must repeat the call + * as to be able to change "..". We must repeat the call * to namei, as the parent directory is unlocked by the * call to checkpath(). */ @@ -906,7 +906,7 @@ abortit: } /* * 2) If target doesn't exist, link the target - * to the source and unlink the source. + * to the source and unlink the source. * Otherwise, rewrite the target directory * entry to reference the source inode and * expunge the original entry's existence. @@ -966,7 +966,7 @@ abortit: * (both directories, or both not directories). */ if ((xp->i_mode&IFMT) == IFDIR) { - if (!ufs_dirempty(xp, dp->i_number, tcnp->cn_cred) || + if (!ufs_dirempty(xp, dp->i_number, tcnp->cn_cred) || xp->i_nlink > 2) { error = ENOTEMPTY; goto bad; @@ -1061,7 +1061,7 @@ abortit: dp->i_flag |= IN_CHANGE; error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED, + UIO_SYSSPACE, IO_NODELOCKED, tcnp->cn_cred, (int *)0, (struct proc *)0); if (error == 0) { # if (BYTE_ORDER == LITTLE_ENDIAN) @@ -1366,7 +1366,7 @@ ufs_symlink(ap) /* * Vnode op for reading directories. - * + * * The routine below assumes that the on-disk format of a directory * is the same as that defined by <sys/dirent.h>. If the on-disk * format changes, then it will be necessary to do a conversion @@ -1916,7 +1916,7 @@ ufs_vinit(mntp, specops, fifoops, vpp) break; default: break; - + } if (ip->i_number == ROOTINO) vp->v_flag |= VROOT; @@ -1953,7 +1953,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) if ((mode & IFMT) == 0) mode |= IFREG; - error = VOP_VALLOC(dvp, mode, cnp->cn_cred, &tvp); + error = VOP_VALLOC(dvp, mode, cnp->cn_cred, &tvp); if (error) { free(cnp->cn_pnbuf, M_NAMEI); vput(dvp); diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 5dad126..8ce0bc16 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)device_pager.c 8.1 (Berkeley) 6/11/93 - * $Id: device_pager.c,v 1.9 1995/05/10 18:56:01 davidg Exp $ + * $Id: device_pager.c,v 1.10 1995/05/18 02:59:18 davidg Exp $ */ /* @@ -142,7 +142,7 @@ dev_pager_alloc(handle, size, prot, foff) /* * Check that the specified range of the device allows the desired * protection. - * + * * XXX assumes VM_PROT_* == PROT_* */ npages = atop(round_page(size)); diff --git a/sys/vm/kern_lock.c b/sys/vm/kern_lock.c index dbc13ae..30be676 100644 --- a/sys/vm/kern_lock.c +++ b/sys/vm/kern_lock.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: kern_lock.c,v 1.4 1995/03/01 21:37:37 davidg Exp $ + * $Id: kern_lock.c,v 1.5 1995/04/16 12:56:12 davidg Exp $ */ /* @@ -114,14 +114,14 @@ typedef int *thread_t; * may only be used for exclusive locks. */ -void +void simple_lock_init(l) simple_lock_t l; { *(boolean_t *) l = FALSE; } -void +void simple_lock(l) simple_lock_t l; { @@ -129,14 +129,14 @@ simple_lock(l) continue; } -void +void simple_unlock(l) simple_lock_t l; { *(boolean_t *) l = FALSE; } -boolean_t +boolean_t simple_lock_try(l) simple_lock_t l; { @@ -167,7 +167,7 @@ int lock_wait_time; * variables and then initialize them, rather * than getting a new one from this module. */ -void +void lock_init(l, can_sleep) lock_t l; boolean_t can_sleep; @@ -182,7 +182,7 @@ lock_init(l, can_sleep) l->recursion_depth = 0; } -void +void lock_sleepable(l, can_sleep) lock_t l; boolean_t can_sleep; @@ -199,7 +199,7 @@ lock_sleepable(l, can_sleep) * for the lock. These work on uniprocessor systems. */ -void +void lock_write(l) register lock_t l; { @@ -252,7 +252,7 @@ lock_write(l) simple_unlock(&l->interlock); } -void +void lock_done(l) register lock_t l; { @@ -274,7 +274,7 @@ lock_done(l) simple_unlock(&l->interlock); } -void +void lock_read(l) register lock_t l; { @@ -318,7 +318,7 @@ lock_read(l) * * Returns TRUE if the upgrade *failed*. */ -boolean_t +boolean_t lock_read_to_write(l) register lock_t l; { @@ -368,7 +368,7 @@ lock_read_to_write(l) return (FALSE); } -void +void lock_write_to_read(l) register lock_t l; { @@ -398,7 +398,7 @@ lock_write_to_read(l) * Returns FALSE if the lock is not held on return. */ -boolean_t +boolean_t lock_try_write(l) register lock_t l; { @@ -437,7 +437,7 @@ lock_try_write(l) * Returns FALSE if the lock is not held on return. */ -boolean_t +boolean_t lock_try_read(l) register lock_t l; { @@ -470,7 +470,7 @@ lock_try_read(l) * * Returns FALSE if the upgrade *failed*. */ -boolean_t +boolean_t lock_try_read_to_write(l) register lock_t l; { @@ -507,7 +507,7 @@ lock_try_read_to_write(l) * Allow a process that has a lock for write to acquire it * recursively (for read, write, or update). */ -void +void lock_set_recursive(l) lock_t l; { @@ -522,7 +522,7 @@ lock_set_recursive(l) /* * Prevent a lock from being re-acquired. */ -void +void lock_clear_recursive(l) lock_t l; { diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index e672bb6..16ec7bb 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.39 1995/05/14 03:00:08 davidg Exp $ + * $Id: swap_pager.c,v 1.40 1995/05/18 02:59:20 davidg Exp $ */ /* @@ -135,7 +135,7 @@ int require_swap_init; void swap_pager_finish(); int dmmin, dmmax; -static inline void +static inline void swapsizecheck() { if (vm_swap_size < 128 * btodb(PAGE_SIZE)) { @@ -793,7 +793,7 @@ swap_pager_putpage(pager, m, sync) } static inline int -const +const swap_pager_block_index(swp, offset) sw_pager_t swp; vm_offset_t offset; @@ -802,7 +802,7 @@ swap_pager_block_index(swp, offset) } static inline int -const +const swap_pager_block_offset(swp, offset) sw_pager_t swp; vm_offset_t offset; diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index aba9ecf..c061c3e 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -66,7 +66,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_fault.c,v 1.23 1995/04/16 14:12:12 davidg Exp $ + * $Id: vm_fault.c,v 1.24 1995/05/18 02:59:22 davidg Exp $ */ /* @@ -221,27 +221,27 @@ RetryFault:; /* * INVARIANTS (through entire routine): - * + * * 1) At all times, we must either have the object lock or a busy * page in some object to prevent some other thread from trying to * bring in the same page. - * + * * Note that we cannot hold any locks during the pager access or when * waiting for memory, so we use a busy page then. - * + * * Note also that we aren't as concerned about more than one thead * attempting to pager_data_unlock the same page at once, so we don't * hold the page as busy then, but do record the highest unlock value * so far. [Unlock requests may also be delivered out of order.] - * + * * 2) Once we have a busy page, we must remove it from the pageout * queues, so that the pageout daemon will not grab it away. - * + * * 3) To prevent another thread from racing us down the shadow chain * and entering a new page in the top object before we do, we must * keep a busy page in the top object while following the shadow * chain. - * + * * 4) We must increment paging_in_progress on any object for which * we have a busy page, to prevent vm_object_collapse from removing * the busy page without our noticing. @@ -381,7 +381,7 @@ readrest: UNLOCK_AND_DEALLOCATE; goto RetryFault; } - + pmap_clear_modify(VM_PAGE_TO_PHYS(m)); m->valid = VM_PAGE_BITS_ALL; hardfault++; @@ -391,10 +391,10 @@ readrest: * Remove the bogus page (which does not exist at this * object/offset); before doing so, we must get back * our object lock to preserve our invariant. - * + * * Also wake up any other thread that may want to bring * in this page. - * + * * If this is the top-level object, we must leave the * busy page to prevent another thread from rushing * past us, and inserting the page in that object at @@ -501,11 +501,11 @@ readrest: * object locked). We can't unlock the bottom object, * because the page we found may move (by collapse) if * we do. - * + * * Instead, we first copy the page. Then, when we have * no more use for the bottom object, we unlock it and * try to collapse. - * + * * Note that we copy the page even if we didn't need * to... that's the breaks. */ @@ -523,7 +523,7 @@ readrest: * we have to flush all uses of the original page, * since we can't distinguish those which want the * original from those which need the new copy. - * + * * XXX If we know that only one map has access to this * page, then we could avoid the pmap_page_protect() * call. diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 973b867..02b1b70 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -59,7 +59,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_glue.c,v 1.18 1995/03/28 07:58:53 bde Exp $ + * $Id: vm_glue.c,v 1.19 1995/04/16 12:56:15 davidg Exp $ */ #include <sys/param.h> @@ -111,7 +111,7 @@ useracc(addr, len, rw) /* * XXX - check separately to disallow access to user area and user * page tables - they are in the map. - * + * * XXX - VM_MAXUSER_ADDRESS is an end address, not a max. It was once * only used (as an end address) in trap.c. Use it as an end address * here too. This bogusness has spread. I just fixed where it was diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 47cbb91..07b4c49 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_kern.c,v 1.11 1995/02/21 01:22:45 davidg Exp $ + * $Id: vm_kern.c,v 1.12 1995/03/15 07:52:06 davidg Exp $ */ /* @@ -99,7 +99,7 @@ extern int mb_map_full; * map must be "kernel_map" below. */ -vm_offset_t +vm_offset_t kmem_alloc_pageable(map, size) vm_map_t map; register vm_size_t size; @@ -127,7 +127,7 @@ kmem_alloc_pageable(map, size) * Allocate wired-down memory in the kernel's address map * or a submap. */ -vm_offset_t +vm_offset_t kmem_alloc(map, size) register vm_map_t map; register vm_size_t size; @@ -162,7 +162,7 @@ kmem_alloc(map, size) * Guarantee that there are pages already in this object before * calling vm_map_pageable. This is to prevent the following * scenario: - * + * * 1) Threads have swapped out, so that there is a pager for the * kernel_object. 2) The kmsg zone is empty, and so we are * kmem_allocing a new page for it. 3) vm_map_pageable calls vm_fault; @@ -171,7 +171,7 @@ kmem_alloc(map, size) * kmem_alloc. 4) goto 1 5) Even if the kmsg zone is not empty: when * we get the data back from the pager, it will be (very stale) * non-zero data. kmem_alloc is defined to return zero-filled memory. - * + * * We're intentionally not activating the pages we allocate to prevent a * race with page-out. vm_map_pageable will wire the pages. */ @@ -212,7 +212,7 @@ kmem_alloc(map, size) * with kmem_alloc, and return the physical pages * associated with that region. */ -void +void kmem_free(map, addr, size) vm_map_t map; register vm_offset_t addr; @@ -234,7 +234,7 @@ kmem_free(map, addr, size) * min, max Returned endpoints of map * pageable Can the region be paged */ -vm_map_t +vm_map_t kmem_suballoc(parent, min, max, size, pageable) register vm_map_t parent; vm_offset_t *min, *max; @@ -397,7 +397,7 @@ kmem_malloc(map, size, waitflag) * has no room, the caller sleeps waiting for more memory in the submap. * */ -vm_offset_t +vm_offset_t kmem_alloc_wait(map, size) vm_map_t map; vm_size_t size; @@ -434,7 +434,7 @@ kmem_alloc_wait(map, size) * Returns memory to a submap of the kernel, and wakes up any threads * waiting for memory in that map. */ -void +void kmem_free_wakeup(map, addr, size) vm_map_t map; vm_offset_t addr; @@ -452,7 +452,7 @@ kmem_free_wakeup(map, addr, size) * map the range between VM_MIN_KERNEL_ADDRESS and `start' as allocated, and * the range between `start' and `end' as free. */ -void +void kmem_init(start, end) vm_offset_t start, end; { diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d7c1b1f..c87fe77 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.20 1995/03/25 17:36:57 davidg Exp $ + * $Id: vm_map.c,v 1.21 1995/04/16 12:56:17 davidg Exp $ */ /* @@ -148,7 +148,7 @@ static int mapvmpgcnt; static void _vm_map_clip_end __P((vm_map_t, vm_map_entry_t, vm_offset_t)); static void _vm_map_clip_start __P((vm_map_t, vm_map_entry_t, vm_offset_t)); -void +void vm_map_startup() { register int i; @@ -245,7 +245,7 @@ vmspace_free(vm) * the given physical map structure, and having * the given lower and upper address bounds. */ -vm_map_t +vm_map_t vm_map_create(pmap, min, max, pageable) pmap_t pmap; vm_offset_t min, max; @@ -429,7 +429,7 @@ vm_map_entry_dispose(map, entry) * Creates another valid reference to the given map. * */ -void +void vm_map_reference(map) register vm_map_t map; { @@ -448,7 +448,7 @@ vm_map_reference(map) * destroying it if no references remain. * The map should not be locked. */ -void +void vm_map_deallocate(map) register vm_map_t map; { @@ -626,7 +626,7 @@ vm_map_insert(map, object, offset, start, end) * result indicates whether the address is * actually contained in the map. */ -boolean_t +boolean_t vm_map_lookup_entry(map, address, entry) register vm_map_t map; register vm_offset_t address; @@ -649,7 +649,7 @@ vm_map_lookup_entry(map, address, entry) if (address >= cur->start) { /* * Go from hint to end of list. - * + * * But first, make a quick check to see if we are already looking * at the entry we want (which is usually the case). Note also * that we don't need to save the hint here... it is the same @@ -804,7 +804,7 @@ vm_map_find(map, object, offset, addr, length, find_space) * removing extra sharing maps * [XXX maybe later] merging with a neighbor */ -void +void vm_map_simplify_entry(map, entry) vm_map_t map; vm_map_entry_t entry; @@ -843,16 +843,16 @@ vm_map_simplify_entry(map, entry) } else { /* * Try to merge with our neighbors. - * + * * Conditions for merge are: - * + * * 1. entries are adjacent. 2. both entries point to objects * with null pagers. - * + * * If a merge is possible, we replace the two entries with a * single entry, then merge the two objects into a single * object. - * + * * Now, all that is left to do is write the code! */ } @@ -875,7 +875,7 @@ vm_map_simplify_entry(map, entry) * This routine is called only when it is known that * the entry must be split. */ -static void +static void _vm_map_clip_start(map, entry, start) register vm_map_t map; register vm_map_entry_t entry; @@ -928,7 +928,7 @@ _vm_map_clip_start(map, entry, start) * This routine is called only when it is known that * the entry must be split. */ -static void +static void _vm_map_clip_end(map, entry, end) register vm_map_t map; register vm_map_entry_t entry; @@ -1279,17 +1279,17 @@ vm_map_pageable(map, start, end, new_pageable) } else { /* * Wiring. We must do this in two passes: - * + * * 1. Holding the write lock, we create any shadow or zero-fill * objects that need to be created. Then we clip each map * entry to the region to be wired and increment its wiring * count. We create objects before clipping the map entries * to avoid object proliferation. - * + * * 2. We downgrade to a read lock, and call vm_fault_wire to * fault in the pages for any newly wired area (wired_count is * 1). - * + * * Downgrading to a read lock for vm_fault_wire avoids a possible * deadlock with another thread that may have faulted on one * of the pages to be wired (it would mark the page busy, @@ -1313,7 +1313,7 @@ vm_map_pageable(map, start, end, new_pageable) * the write lock on the map: create a shadow * object for a copy-on-write region, or an * object for a zero-fill region. - * + * * We don't have to do this for entries that * point to sharing maps, because we won't * hold the lock on the sharing map. @@ -1366,14 +1366,14 @@ vm_map_pageable(map, start, end, new_pageable) /* * HACK HACK HACK HACK - * + * * If we are wiring in the kernel map or a submap of it, unlock * the map to avoid deadlocks. We trust that the kernel * threads are well-behaved, and therefore will not do * anything destructive to this region of the map while we * have it unlocked. We cannot trust user threads to do the * same. - * + * * HACK HACK HACK HACK */ if (vm_map_pmap(map) == kernel_pmap) { @@ -1391,7 +1391,7 @@ vm_map_pageable(map, start, end, new_pageable) * what has been done. We decrement the wiring count * for those pages which have not yet been wired (now) * and unwire those that have (later). - * + * * XXX this violates the locking protocol on the map, * needs to be fixed. */ @@ -1525,7 +1525,7 @@ vm_map_clean(map, start, end, syncio, invalidate) * The map in question should be locked. * [This is the reason for this routine's existence.] */ -void +void vm_map_entry_unwire(map, entry) vm_map_t map; register vm_map_entry_t entry; @@ -1539,7 +1539,7 @@ vm_map_entry_unwire(map, entry) * * Deallocate the given entry from the target map. */ -void +void vm_map_entry_delete(map, entry) register vm_map_t map; register vm_map_entry_t entry; @@ -1689,7 +1689,7 @@ vm_map_remove(map, start, end) * privilege on the entire address region given. * The entire region must be allocated. */ -boolean_t +boolean_t vm_map_check_protection(map, start, end, protection) register vm_map_t map; register vm_offset_t start; @@ -1736,7 +1736,7 @@ vm_map_check_protection(map, start, end, protection) * Copies the contents of the source entry to the destination * entry. The entries *must* be aligned properly. */ -void +void vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry) vm_map_t src_map, dst_map; register vm_map_entry_t src_entry, dst_entry; @@ -1958,9 +1958,9 @@ vm_map_copy(dst_map, src_map, } /* * Find the start entries and clip. - * + * * Note that checking protection asserts that the lookup cannot fail. - * + * * Also note that we wait to do the second lookup until we have done the * first clip, as the clip may affect which entry we get! */ @@ -2014,7 +2014,7 @@ vm_map_copy(dst_map, src_map, /* * Both entries now match in size and relative endpoints. - * + * * If both entries refer to a VM object, we can deal with them * now. */ @@ -2438,7 +2438,7 @@ RetryLookup:; /* * If we want to write the page, we may as well handle that * now since we've got the sharing map locked. - * + * * If we don't need to write the page, we just demote the * permissions allowed. */ @@ -2520,7 +2520,7 @@ RetryLookup:; * (according to the handle returned by that lookup). */ -void +void vm_map_lookup_done(map, entry) register vm_map_t map; vm_map_entry_t entry; @@ -2551,7 +2551,7 @@ vm_map_lookup_done(map, entry) * at allocation time because the adjacent entry * is often wired down. */ -void +void vm_map_simplify(map, start) vm_map_t map; vm_offset_t start; @@ -2603,7 +2603,7 @@ vm_map_simplify(map, start) /* * vm_map_print: [ debug ] */ -void +void vm_map_print(map, full) register vm_map_t map; boolean_t full; diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 381603e..1f9c041 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.22 1995/04/16 12:56:18 davidg Exp $ + * $Id: vm_mmap.c,v 1.23 1995/05/18 02:59:24 davidg Exp $ */ /* @@ -181,7 +181,7 @@ mmap(p, uap, retval) /* * XXX if no hint provided for a non-fixed mapping place it after the * end of the largest possible heap. - * + * * There should really be a pmap call to determine a reasonable location. */ if (addr == 0 && (flags & MAP_FIXED) == 0) @@ -760,7 +760,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) vm_object_deallocate(user_object); goto out; } - + /* * this is a consistancy check, gets the map entry, and should * never fail diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 1d5ee25..7309034 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.45 1995/05/02 05:57:10 davidg Exp $ + * $Id: vm_object.c,v 1.46 1995/05/21 21:39:30 davidg Exp $ */ /* @@ -171,7 +171,7 @@ vm_object_init(vm_offset_t nothing) vm_object_count = 0; simple_lock_init(&vm_cache_lock); simple_lock_init(&vm_object_list_lock); - + vm_object_cache_max = 84; if (cnt.v_page_count > 1000) vm_object_cache_max += (cnt.v_page_count - 1000) / 4; @@ -592,7 +592,7 @@ startover: TAILQ_INSERT_TAIL(&object->memq, p, listq); pgcount--; } - if ((!allclean && (pass == 0)) || + if ((!allclean && (pass == 0)) || (entireobj && (object->flags & OBJ_WRITEABLE))) { pass = 1; if (entireobj) @@ -604,7 +604,7 @@ startover: void -vm_object_page_clean(object, start, end, syncio) +vm_object_page_clean(object, start, end, syncio) register vm_object_t object; register vm_offset_t start; register vm_offset_t end; @@ -700,7 +700,7 @@ vm_object_cache_trim() * * The object must *not* be locked. */ -void +void vm_object_pmap_copy(object, start, end) register vm_object_t object; register vm_offset_t start; @@ -772,7 +772,7 @@ again: * May defer the copy until later if the object is not backed * up by a non-default pager. */ -void +void vm_object_copy(src_object, src_offset, size, dst_object, dst_offset, src_needs_copy) register vm_object_t src_object; @@ -840,7 +840,7 @@ vm_object_copy(src_object, src_offset, size, /* * If the object has a pager, the pager wants to see all of the * changes. We need a copy-object for the changed pages. - * + * * If there is a copy-object, and it is empty, no changes have been made * to the object since the copy-object was made. We can use the same * copy- object. @@ -882,7 +882,7 @@ Retry1: * If the object has a pager, the pager wants to see all of the * changes. We must make a copy-object and put the changed pages * there. - * + * * The copy-object is always made large enough to completely shadow the * original object, since it may have several users who want to shadow * the original object at different points. @@ -1013,7 +1013,7 @@ vm_object_shadow(object, offset, length) * specified pager and paging id. */ -vm_object_t +vm_object_t vm_object_lookup(pager) vm_pager_t pager; { @@ -1048,7 +1048,7 @@ vm_object_lookup(pager) * the hash table. */ -void +void vm_object_enter(object, pager) vm_object_t object; vm_pager_t pager; @@ -1206,7 +1206,7 @@ vm_object_collapse(object) while (TRUE) { /* * Verify that the conditions are right for collapse: - * + * * The object exists and no pages in it are currently being paged * out. */ @@ -1274,7 +1274,7 @@ vm_object_collapse(object) backing_object->flags |= OBJ_DEAD; /* * We can collapse the backing object. - * + * * Move all in-memory pages from backing_object to the * parent. Pages that have been paged out will be * overwritten by any of the parent's pages that @@ -1289,7 +1289,7 @@ vm_object_collapse(object) * If the parent has a page here, or if this * page falls outside the parent, dispose of * it. - * + * * Otherwise, move it as planned. */ @@ -1373,7 +1373,7 @@ vm_object_collapse(object) object->shadow_offset += backing_object->shadow_offset; /* * Discard backing_object. - * + * * Since the backing object has no pages, no pager left, * and no object references within it, all that is * necessary is to dispose of it. @@ -1396,7 +1396,7 @@ vm_object_collapse(object) * shadowed by the parent object, the parent object no * longer has to shadow the backing object; it can * shadow the next one in the chain. - * + * * The backing object must not be paged out - we'd have * to check all of the paged-out pages, as well. */ @@ -1416,7 +1416,7 @@ vm_object_collapse(object) /* * If the parent has a page here, or if this * page falls outside the parent, keep going. - * + * * Otherwise, the backing_object must be left in * the chain. */ @@ -1586,7 +1586,7 @@ again: * Conditions: * The object must *not* be locked. */ -boolean_t +boolean_t vm_object_coalesce(prev_object, next_object, prev_offset, next_offset, prev_size, next_size) @@ -1765,7 +1765,7 @@ vm_object_check() { if( lsize > maxhash) maxhash = lsize; } - + printf("maximum object hash queue size: %d\n", maxhash); /* @@ -1791,7 +1791,7 @@ vm_object_check() { /* * vm_object_print: [ debug ] */ -void +void vm_object_print(object, full) vm_object_t object; boolean_t full; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 96537d0..30983e1 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_page.c,v 1.30 1995/04/16 11:50:45 davidg Exp $ + * $Id: vm_page.c,v 1.31 1995/04/16 12:56:21 davidg Exp $ */ /* @@ -126,7 +126,7 @@ static u_short vm_page_dev_bsize_chunks[] = { * * Sets page_shift and page_mask from cnt.v_page_size. */ -void +void vm_set_page_size() { @@ -216,11 +216,11 @@ vm_page_startup(starta, enda, vaddr) /* * Allocate (and initialize) the hash table buckets. - * + * * The number of buckets MUST BE a power of 2, and the actual value is * the next power of 2 greater than the number of physical pages in * the system. - * + * * Note: This computation can be tweaked if desired. */ vm_page_buckets = (struct pglist *) vaddr; @@ -262,7 +262,7 @@ vm_page_startup(starta, enda, vaddr) * kmem_map which must be initialized before malloc() will work * (obviously). Also could include pager maps which would be * allocated before kmeminit. - * + * * Allow some kernel map entries... this should be plenty since people * shouldn't be cluttering up the kernel map (they should use their * own maps). @@ -375,7 +375,7 @@ vm_page_hash(object, offset) * The object and page must be locked, and must be splhigh. */ -inline void +inline void vm_page_insert(mem, object, offset) register vm_page_t mem; register vm_object_t object; @@ -428,7 +428,7 @@ vm_page_insert(mem, object, offset) * The object and page must be locked, and at splhigh. */ -inline void +inline void vm_page_remove(mem) register vm_page_t mem; { @@ -472,7 +472,7 @@ vm_page_remove(mem) * The object must be locked. No side effects. */ -vm_page_t +vm_page_t vm_page_lookup(object, offset) register vm_object_t object; register vm_offset_t offset; @@ -511,7 +511,7 @@ vm_page_lookup(object, offset) * * The object must be locked. */ -void +void vm_page_rename(mem, new_object, new_offset) register vm_page_t mem; register vm_object_t new_object; @@ -586,7 +586,7 @@ vm_page_alloc(object, offset, page_req) if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) { page_req = VM_ALLOC_SYSTEM; }; - + simple_lock(&vm_page_queue_free_lock); s = splhigh(); @@ -763,7 +763,7 @@ again: * * Object and page must be locked prior to entry. */ -void +void vm_page_free(mem) register vm_page_t mem; { @@ -836,7 +836,7 @@ vm_page_free(mem) * * The page queues must be locked. */ -void +void vm_page_wire(mem) register vm_page_t mem; { @@ -861,7 +861,7 @@ vm_page_wire(mem) * * The page queues must be locked. */ -void +void vm_page_unwire(mem) register vm_page_t mem; { @@ -889,7 +889,7 @@ vm_page_unwire(mem) * * The page queues must be locked. */ -void +void vm_page_activate(m) register vm_page_t m; { @@ -937,7 +937,7 @@ vm_page_deactivate(m) /* * Only move active pages -- ignore locked or already inactive ones. - * + * * XXX: sometimes we get pages which aren't wired down or on any queue - * we need to put them on the inactive queue also, otherwise we lose * track of them. Paul Mackerras (paulus@cs.anu.edu.au) 9-Jan-93. @@ -963,7 +963,7 @@ vm_page_deactivate(m) * * Put the specified page onto the page cache queue (if appropriate). */ -void +void vm_page_cache(m) register vm_page_t m; { @@ -1033,7 +1033,7 @@ vm_page_copy(src_m, dest_m) * mapping function for valid bits or for dirty bits in * a page */ -inline int +inline int vm_page_bits(int base, int size) { u_short chunk; diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 79d28c9..c4c351f 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -65,7 +65,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.c,v 1.49 1995/05/10 18:56:06 davidg Exp $ + * $Id: vm_pageout.c,v 1.50 1995/05/21 21:39:31 davidg Exp $ */ /* @@ -121,10 +121,10 @@ vm_pageout_clean(m, sync) { /* * Clean the page and remove it from the laundry. - * + * * We set the busy bit to cause potential page faults on this page to * block. - * + * * And we set pageout-in-progress to keep the object from disappearing * during pageout. This guarantees that the page won't move from the * inactive queue. (However, any other page on the inactive queue may @@ -234,7 +234,7 @@ vm_pageout_clean(m, sync) pageout_count += b_pageout_count; } } - + /* * we allow reads during pageouts... */ diff --git a/sys/vm/vm_pageout.h b/sys/vm/vm_pageout.h index 99a1559..d1da63c 100644 --- a/sys/vm/vm_pageout.h +++ b/sys/vm/vm_pageout.h @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.h,v 1.10 1995/03/16 18:17:30 bde Exp $ + * $Id: vm_pageout.h,v 1.11 1995/04/09 06:03:55 davidg Exp $ */ #ifndef _VM_VM_PAGEOUT_H_ @@ -103,7 +103,7 @@ pagedaemon_wakeup() #define VM_WAIT vm_wait() -static inline void +static inline void vm_wait() { int s; diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 010ba9d..9b90074 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.19 1995/05/19 03:27:08 davidg Exp $ + * $Id: vm_swap.c,v 1.20 1995/05/25 03:38:11 davidg Exp $ */ #include <sys/param.h> @@ -225,7 +225,7 @@ swaponvp(p, vp, dev, nblks) error = VOP_OPEN(vp, FREAD | FWRITE, p->p_ucred, p); if (error) return (error); - + if (nblks == 0 && (bdevsw[major(dev)].d_psize == 0 || (nblks = (*bdevsw[major(dev)].d_psize) (dev)) == -1)) { (void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, p); diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 759abde..6b93ec8 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.38 1995/05/10 18:56:09 davidg Exp $ + * $Id: vnode_pager.c,v 1.39 1995/05/18 02:59:26 davidg Exp $ */ /* @@ -314,11 +314,11 @@ vnode_pager_haspage(pager, offset) /* * Read the index to find the disk block to read from. If there is no * block, report that we don't have this data. - * + * * Assumes that the vnode has whole page or nothing. */ err = VOP_BMAP(vp, block, (struct vnode **) 0, &bn, 0); - if (err) + if (err) return (TRUE); return ((long) bn < 0 ? FALSE : TRUE); } |