From: Jan-Benedict G. <jb...@us...> - 2005-04-25 09:37:22
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/vax/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10024/char Modified Files: dz.c Log Message: - Some more __iomem and whitespace updates. Index: dz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/vax/char/dz.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dz.c 28 Mar 2005 16:26:54 -0000 1.3 +++ dz.c 25 Apr 2005 09:37:12 -0000 1.4 @@ -1,9 +1,9 @@ /* - * dz.c: Serial port driver for DECStations & VAXstations equiped + * dz.c: Serial port driver for DECStations & VAXstations equiped * with the DZ chipset. * - * Copyright (C) 1998 Olivier A. D. Lebaillif - * + * Copyright (C) 1998 Olivier A. D. Lebaillif + * * Email: oli...@if... * * [31-AUG-98] triemer @@ -11,13 +11,13 @@ * removed base_addr code - moving address assignment to setup.c * Changed name of dz_init to rs_init to be consistent with tc code * [13-NOV-98] triemer fixed code to receive characters - * after patches by harald to irq code. + * after patches by harald to irq code. * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout * field from "current" - somewhere between 2.1.121 and 2.1.131 * [27-JUN-2001] Arnaldo Carvalho de Melo <ac...@co...> - cleanups - * - * Parts (C) 1999 David Airlie, ai...@li... - * [07-SEP-99] Bugfixes + * + * Parts (C) 1999 David Airlie, ai...@li... + * [07-SEP-99] Bugfixes */ /* #define DEBUG_DZ 1 */ @@ -28,7 +28,7 @@ #include <linux/device.h> #include <linux/kernel.h> #include <linux/sched.h> -#include <linux/init.h> +#include <linux/init.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/major.h> @@ -76,7 +76,7 @@ #ifdef DEBUG_DZ /* - * debugging code to send out chars via prom + * debugging code to send out chars via prom */ static void debug_console( const char *s,int count) { @@ -94,7 +94,7 @@ * ------------------------------------------------------------ * dz_in () and dz_out () * - * These routines are used to access the registers of the DZ + * These routines are used to access the registers of the DZ * chip, hiding relocation differences between implementation. * ------------------------------------------------------------ */ @@ -117,21 +117,21 @@ * ------------------------------------------------------------ * rs_stop () and rs_start () * - * These routines are called before setting or resetting - * tty->stopped. They enable or disable transmitter interrupts, + * These routines are called before setting or resetting + * tty->stopped. They enable or disable transmitter interrupts, * as necessary. * ------------------------------------------------------------ */ static void dz_stop (struct tty_struct *tty) { - struct dz_serial *info; + struct dz_serial *info; unsigned short mask, tmp; - if (!tty) - return; - - info = (struct dz_serial *)tty->driver_data; + if (!tty) + return; + + info = (struct dz_serial *)tty->driver_data; mask = 1 << info->line; tmp = dz_in (info, DZ_TCR); /* read the TX flag */ @@ -154,17 +154,17 @@ /* * ------------------------------------------------------------ - * Here starts the interrupt handling routines. All of the - * following subroutines are declared as inline and are folded - * into dz_interrupt. They were separated out for readability's - * sake. + * Here starts the interrupt handling routines. All of the + * following subroutines are declared as inline and are folded + * into dz_interrupt. They were separated out for readability's + * sake. * * Note: rs_interrupt() is a "fast" interrupt, which means that it * runs with interrupts turned off. People who may want to modify * rs_interrupt() should try to keep the interrupt handler as fast as * possible. After you are done making modifications, it is not a bad * idea to do: - * + * * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c * * and look at the resulting assemble code in serial.s. @@ -267,7 +267,7 @@ #ifdef DEBUG_DZ debug_console("FERR\n",5); #endif /* DEBUG_DZ */ - } if (tmp & DZ_OERR) { + } if (tmp & DZ_OERR) { #ifdef DEBUG_DZ debug_console("OERR\n",5); #endif /* DEBUG_DZ */ @@ -348,7 +348,7 @@ return; status = dz_in(info, DZ_MSR); - + /* it's easy, since DSR2 is the only bit in the register */ if (status) info->icount.dsr++; @@ -372,7 +372,7 @@ status = dz_in ((struct dz_serial *)dev, DZ_CSR); /* get the reason why we just got an irq */ info = lines[LINE(status)]; /* re-arrange info the proper port */ - if (status & DZ_RDONE) + if (status & DZ_RDONE) receive_chars (info); /* the receive function */ return IRQ_HANDLED; @@ -386,7 +386,7 @@ status = dz_in ((struct dz_serial *)dev, DZ_CSR); /* get the reason why we just got an irq */ info = lines[LINE(status)]; /* re-arrange info the proper port */ - if (status & DZ_TRDY) + if (status & DZ_TRDY) transmit_chars (info); return IRQ_HANDLED; @@ -422,13 +422,13 @@ * * serial interrupt routine -> (scheduler tqueue) -> * do_serial_hangup() -> tty->hangup() -> rs_hangup() - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void do_serial_hangup (void *private_data) { struct dz_serial *info = (struct dz_serial *) private_data; struct tty_struct *tty = info->tty; - + if (!tty) return; @@ -440,22 +440,22 @@ * startup () * * various initialization tasks - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static int startup (struct dz_serial *info) { unsigned long page, flags; unsigned short tmp; - if (info->is_initialized) + if (info->is_initialized) return 0; - + save_and_cli(flags); if (!info->port) { if (info->tty) set_bit (TTY_IO_ERROR, &info->tty->flags); restore_flags (flags); - return -ENODEV; + return -ENODEV; } if (!info->xmit_buf) { @@ -467,7 +467,7 @@ info->xmit_buf = (unsigned char *)page; } - if (info->tty) + if (info->tty) clear_bit (TTY_IO_ERROR, &info->tty->flags); /* enable the interrupt and the scanning */ @@ -479,7 +479,7 @@ change_speed (info); /* set up the speed */ - /* + /* * Clear the line transmitter buffer I can't figure out why I need to * do this - but its necessary - in order for the console portion and * the interrupt portion to live happily side by side. @@ -487,18 +487,18 @@ info->is_initialized = 1; - restore_flags (flags); + restore_flags (flags); return 0; } -/* +/* * ------------------------------------------------------------------- * shutdown () * * This routine will shutdown a serial port; interrupts are disabled, and * DTR is dropped if the hangup on close termio flag is on. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void shutdown (struct dz_serial *info) { @@ -536,12 +536,12 @@ restore_flags (flags); } -/* +/* * ------------------------------------------------------------------- * change_speed () * * set the baud rate. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void change_speed (struct dz_serial *info) { @@ -551,9 +551,9 @@ if (!info->tty || !info->tty->termios) return; - + save_and_cli(flags); - + info->cflags = info->line; cflag = info->tty->termios->c_cflag; @@ -568,7 +568,7 @@ case CS7: info->cflags |= DZ_CS7; break; - case CS8: + case CS8: default: info->cflags |= DZ_CS8; } @@ -579,7 +579,7 @@ info->cflags |= DZ_PARENB; if (cflag & PARODD) info->cflags |= DZ_PARODD; - + baud = tty_get_baud_rate(info->tty); switch (baud) { case 50: @@ -593,19 +593,19 @@ break; case 134: info->cflags |= DZ_B134; - break; + break; case 150: info->cflags |= DZ_B150; break; case 300: info->cflags |= DZ_B300; - break; + break; case 600: info->cflags |= DZ_B600; break; case 1200: info->cflags |= DZ_B1200; - break; + break; case 1800: info->cflags |= DZ_B1800; break; @@ -617,16 +617,16 @@ break; case 3600: info->cflags |= DZ_B3600; - break; + break; case 4800: info->cflags |= DZ_B4800; break; case 7200: info->cflags |= DZ_B7200; - break; - case 9600: + break; + case 9600: default: - info->cflags |= DZ_B9600; + info->cflags |= DZ_B9600; } info->cflags |= DZ_RXENAB; @@ -635,8 +635,8 @@ /* setup accept flag */ info->read_status_mask = DZ_OERR; if (I_INPCK(info->tty)) - info->read_status_mask |= (DZ_FERR | DZ_PERR); - + info->read_status_mask |= (DZ_FERR | DZ_PERR); + /* characters to ignore */ info->ignore_status_mask = 0; if (I_IGNPAR(info->tty)) @@ -645,12 +645,12 @@ restore_flags(flags); } -/* +/* * ------------------------------------------------------------------- * dz_flush_char () * * Flush the buffer. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void dz_flush_chars (struct tty_struct *tty) { @@ -667,12 +667,12 @@ } -/* +/* * ------------------------------------------------------------------- * dz_write () * * main output routine. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static int dz_write (struct tty_struct *tty, const unsigned char *buf, int count) @@ -720,12 +720,12 @@ return ret; } -/* +/* * ------------------------------------------------------------------- * dz_write_room () * * compute the amount of space available for writing. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static int dz_write_room (struct tty_struct *tty) { @@ -739,31 +739,31 @@ return ret; } -/* +/* * ------------------------------------------------------------------- * dz_chars_in_buffer () * * compute the amount of char left to be transmitted - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static int dz_chars_in_buffer (struct tty_struct *tty) { struct dz_serial *info = (struct dz_serial *)tty->driver_data; - + return info->xmit_cnt; } -/* +/* * ------------------------------------------------------------------- * dz_flush_buffer () * * Empty the output buffer - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ static void dz_flush_buffer (struct tty_struct *tty) { struct dz_serial *info = (struct dz_serial *)tty->driver_data; - + cli(); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; sti(); @@ -778,14 +778,14 @@ /* * ------------------------------------------------------------ * dz_throttle () and dz_unthrottle () - * + * * This routine is called by the upper-layer tty layer to signal that * incoming characters should be throttled (or not). * ------------------------------------------------------------ */ static void dz_throttle (struct tty_struct *tty) { - struct dz_serial *info = (struct dz_serial *)tty->driver_data; + struct dz_serial *info = (struct dz_serial *)tty->driver_data; if (I_IXOFF(tty)) info->x_char = STOP_CHAR(tty); @@ -793,7 +793,7 @@ static void dz_unthrottle (struct tty_struct *tty) { - struct dz_serial *info = (struct dz_serial *)tty->driver_data; + struct dz_serial *info = (struct dz_serial *)tty->driver_data; if (I_IXOFF(tty)) { if (info->x_char) @@ -822,7 +822,7 @@ struct serial_struct *retinfo) { struct serial_struct tmp; - + if (!retinfo) return -EFAULT; @@ -884,7 +884,7 @@ * release the bus after transmitting. This must be done when * the transmit shift register is empty, not be done when the * transmit holding register is empty. This functionality - * allows an RS485 driver to be written in user space. + * allows an RS485 driver to be written in user space. */ static int get_lsr_info (struct dz_serial *info, unsigned int *value) { @@ -972,7 +972,7 @@ case TIOCSERGSTRUCT: return copy_to_user((struct dz_serial *)arg, info, sizeof(struct dz_serial)) ? -EFAULT : 0; - + default: return -ENOIOCTLCMD; } @@ -1000,7 +1000,7 @@ /* * ------------------------------------------------------------ * dz_close() - * + * * This routine is called when the serial port gets closed. First, we * wait for the last remaining data to be sent. Then, we turn off * the transmit enable and receive enable flags. @@ -1013,8 +1013,8 @@ if (!info) return; - - save_and_cli(flags); + + save_and_cli(flags); if (tty_hung_up_p(filp)) { restore_flags(flags); @@ -1089,7 +1089,7 @@ static void dz_hangup (struct tty_struct *tty) { struct dz_serial *info = (struct dz_serial *) tty->driver_data; - + dz_flush_buffer(tty); shutdown(info); info->event = 0; @@ -1107,7 +1107,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, struct dz_serial *info) { - DECLARE_WAITQUEUE(wait, current); + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0; @@ -1159,7 +1159,7 @@ } schedule(); } - + current->state = TASK_RUNNING; remove_wait_queue (&info->open_wait, &wait); if (!tty_hung_up_p(filp)) @@ -1174,7 +1174,7 @@ /* * This routine is called whenever a serial port is opened. It - * enables interrupts for a serial port. It also performs the + * enables interrupts for a serial port. It also performs the * serial-specific initialization for the tty structure. */ static int dz_open (struct tty_struct *tty, struct file *filp) @@ -1314,7 +1314,7 @@ local_irq_save(flags); for (i=0; i < DZ_NB_PORT; i++) { - info = &multi[i]; + info = &multi[i]; lines[i] = info; info->magic = SERIAL_MAGIC; @@ -1329,8 +1329,8 @@ info->blocked_open = 0; INIT_WORK(&info->tqueue, do_softint, info); INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); - init_waitqueue_head(&info->open_wait); - init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); /* * If we are pointing to address zero then punt - not correctly @@ -1383,35 +1383,35 @@ int tmp; dz_out(info, DZ_CSR, DZ_CLR); while ((tmp = dz_in(info,DZ_CSR)) & DZ_CLR); - + /* Enable scanning */ - dz_out(info, DZ_CSR, DZ_MSE); + dz_out(info, DZ_CSR, DZ_MSE); } #endif - + /* * Order matters here... the trick is that flags is updated... in * request_irq - to immediatedly obliterate it is unwise. */ local_irq_restore(flags); - + /* The bus-specific IRQ we are handed in the vsbus_dev * structure is the TX interrupt. The RX is always the * next one up. */ - printk("dz.c: using irq rx %d(bus %d), irq tx %d(bus %d)\n", + printk("dz.c: using irq rx %d(bus %d), irq tx %d(bus %d)\n", vsbus_irqindex_to_irq(vsbus_dev->vsbus_irq + 1), vsbus_dev->vsbus_irq + 1, vsbus_irqindex_to_irq(vsbus_dev->vsbus_irq), vsbus_dev->vsbus_irq); - + if (vsbus_request_irq (vsbus_dev->vsbus_irq, dz_interrupt_tx, SA_INTERRUPT, "DZ-TX", lines[0])) panic ("Unable to register DZ TX interrupt\n"); if (vsbus_request_irq (vsbus_dev->vsbus_irq + 1, dz_interrupt_rx, SA_INTERRUPT, "DZ-RX", lines[0])) panic ("Unable to register DZ RX interrupt\n"); /* enable scanning */ - dz_out(info, DZ_CSR, DZ_MSE); + dz_out(info, DZ_CSR, DZ_MSE); return 0; } @@ -1433,7 +1433,7 @@ dz_console = &multi[CONSOLE_LINE]; save_and_cli(flags); - + mask = 1 << dz_console->line; tcr = dz_in (dz_console, DZ_TCR); /* read the TX flag */ dz_out(dz_console, DZ_TCR, mask); @@ -1441,7 +1441,7 @@ /* spin our wheels */ while (((dz_in(dz_console, DZ_CSR) & DZ_TRDY) != DZ_TRDY) && loops--) ; - + /* Actually transmit the character. */ dz_out(dz_console, DZ_TDR, tmp); @@ -1450,19 +1450,19 @@ ; dz_out(dz_console, DZ_TCR, tcr); - restore_flags(flags); + restore_flags(flags); } -/* +/* * ------------------------------------------------------------------- * dz_console_print () * * dz_console_print is registered for printk. * The console must be locked when we get here. - * ------------------------------------------------------------------- + * ------------------------------------------------------------------- */ -static void dz_console_print (struct console *cons, - const char *str, +static void dz_console_print (struct console *cons, + const char *str, unsigned int count) { #ifdef DEBUG_DZ @@ -1529,11 +1529,11 @@ break; } switch(parity) { - case 'o': + case 'o': case 'O': cflag |= DZ_PARODD; break; - case 'e': + case 'e': case 'E': cflag |= DZ_PARENB; break; @@ -1542,7 +1542,7 @@ /* TOFIX: force to console line */ dz_console = &multi[CONSOLE_LINE]; - dz_console->port = (unsigned long)dz11_addr; + dz_console->port = (unsigned long)dz11_addr; dz_console->line = CONSOLE_LINE; /* This line locks up Dave Airlie's VS3100m38 after HALT */ @@ -1551,21 +1551,21 @@ while ((tmp = dz_in(dz_console,DZ_CSR)) & DZ_CLR) ; - /* enable scanning */ - dz_out(dz_console, DZ_CSR, DZ_MSE); - + /* enable scanning */ + dz_out(dz_console, DZ_CSR, DZ_MSE); + /* Set up flags... */ - dz_console->cflags = 0; - dz_console->cflags |= DZ_B9600; - dz_console->cflags |= DZ_CS8; - dz_console->cflags |= DZ_PARENB; + dz_console->cflags = 0; + dz_console->cflags |= DZ_B9600; + dz_console->cflags |= DZ_CS8; + dz_console->cflags |= DZ_PARENB; dz_out (dz_console, DZ_LPR, dz_console->cflags); mask = 1 << dz_console->line; tmp = dz_in (dz_console, DZ_TCR); /* read the TX flag */ if (!(tmp & mask)) { tmp |= mask; /* set the TX flag */ - dz_out (dz_console, DZ_TCR, tmp); + dz_out (dz_console, DZ_TCR, tmp); } return 0; @@ -1602,3 +1602,4 @@ module_init(dz_init_new); MODULE_LICENSE("GPL"); + |