diff options
Diffstat (limited to 'drivers/staging/dgnc/dgnc_cls.c')
-rw-r--r-- | drivers/staging/dgnc/dgnc_cls.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 117e15808240..fdc1aabc7fde 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -33,7 +33,7 @@ #include <linux/sched.h> /* For jiffies, task states */ #include <linux/interrupt.h> /* For tasklet and interrupt structs/defines */ #include <linux/delay.h> /* For udelay */ -#include <asm/io.h> /* For read[bwl]/write[bwl] */ +#include <linux/io.h> /* For read[bwl]/write[bwl] */ #include <linux/serial.h> /* For struct async_serial */ #include <linux/serial_reg.h> /* For the various UART offsets */ #include <linux/pci.h> @@ -43,7 +43,7 @@ #include "dgnc_tty.h" #include "dgnc_trace.h" -static inline void cls_parse_isr(struct board_t *brd, uint port); +static inline void cls_parse_isr(struct dgnc_board *brd, uint port); static inline void cls_clear_break(struct channel_t *ch, int force); static inline void cls_set_cts_flow_control(struct channel_t *ch); static inline void cls_set_rts_flow_control(struct channel_t *ch); @@ -53,7 +53,7 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch); static inline void cls_set_no_input_flow_control(struct channel_t *ch); static void cls_parse_modem(struct channel_t *ch, uchar signals); static void cls_tasklet(unsigned long data); -static void cls_vpd(struct board_t *brd); +static void cls_vpd(struct dgnc_board *brd); static void cls_uart_init(struct channel_t *ch); static void cls_uart_off(struct channel_t *ch); static int cls_drain(struct tty_struct *tty, uint seconds); @@ -393,7 +393,7 @@ static inline void cls_clear_break(struct channel_t *ch, int force) /* Parse the ISR register for the specific port */ -static inline void cls_parse_isr(struct board_t *brd, uint port) +static inline void cls_parse_isr(struct dgnc_board *brd, uint port) { struct channel_t *ch; uchar isr = 0; @@ -417,9 +417,8 @@ static inline void cls_parse_isr(struct board_t *brd, uint port) isr = readb(&ch->ch_cls_uart->isr_fcr); /* Bail if no pending interrupt on port */ - if (isr & UART_IIR_NO_INT) { + if (isr & UART_IIR_NO_INT) break; - } DPR_INTR(("%s:%d port: %x isr: %x\n", __FILE__, __LINE__, port, isr)); @@ -444,9 +443,8 @@ static inline void cls_parse_isr(struct board_t *brd, uint port) } /* Received Xoff signal/Special character */ - if (isr & UART_IIR_XOFF) { + if (isr & UART_IIR_XOFF) /* Empty */ - } /* CTS/RTS change of state */ if (isr & UART_IIR_CTSRTS) { @@ -477,28 +475,24 @@ static void cls_param(struct tty_struct *tty) uchar uart_ier = 0; uint baud = 9600; int quot = 0; - struct board_t *bd; + struct dgnc_board *bd; struct channel_t *ch; struct un_t *un; - if (!tty || tty->magic != TTY_MAGIC) { + if (!tty || tty->magic != TTY_MAGIC) return; - } un = (struct un_t *) tty->driver_data; - if (!un || un->magic != DGNC_UNIT_MAGIC) { + if (!un || un->magic != DGNC_UNIT_MAGIC) return; - } ch = un->un_ch; - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) { + if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) return; - } bd = ch->ch_bd; - if (!bd || bd->magic != DGNC_BOARD_MAGIC) { + if (!bd || bd->magic != DGNC_BOARD_MAGIC) return; - } DPR_PARAM(("param start: tdev: %x cflags: %x oflags: %x iflags: %x\n", ch->ch_tun.un_dev, ch->ch_c_cflag, ch->ch_c_oflag, ch->ch_c_iflag)); @@ -725,7 +719,7 @@ static void cls_param(struct tty_struct *tty) */ static void cls_tasklet(unsigned long data) { - struct board_t *bd = (struct board_t *) data; + struct dgnc_board *bd = (struct dgnc_board *) data; struct channel_t *ch; ulong lock_flags; int i; @@ -802,7 +796,7 @@ static void cls_tasklet(unsigned long data) */ static irqreturn_t cls_intr(int irq, void *voidbrd) { - struct board_t *brd = (struct board_t *) voidbrd; + struct dgnc_board *brd = (struct dgnc_board *) voidbrd; uint i = 0; uchar poll_reg; unsigned long lock_flags; @@ -976,17 +970,17 @@ static int cls_drain(struct tty_struct *tty, uint seconds) int rc = 0; if (!tty || tty->magic != TTY_MAGIC) { - return (-ENXIO); + return -ENXIO; } un = (struct un_t *) tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) { - return (-ENXIO); + return -ENXIO; } ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) { - return (-ENXIO); + return -ENXIO; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -1002,7 +996,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds) if (rc) DPR_IOCTL(("%d Drain - User ctrl c'ed\n", __LINE__)); - return (rc); + return rc; } @@ -1305,9 +1299,8 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch) /* Determine whether the Transmitter is empty or not */ if (!(lsr & UART_LSR_TEMT)) { - if (ch->ch_flags & CH_TX_FIFO_EMPTY) { + if (ch->ch_flags & CH_TX_FIFO_EMPTY) tasklet_schedule(&ch->ch_bd->helper_tasklet); - } left = 1; } else { @@ -1378,7 +1371,7 @@ static void cls_send_immediate_char(struct channel_t *ch, unsigned char c) writeb(c, &ch->ch_cls_uart->txrx); } -static void cls_vpd(struct board_t *brd) +static void cls_vpd(struct dgnc_board *brd) { ulong vpdbase; /* Start of io base of the card */ u8 __iomem *re_map_vpdbase;/* Remapped memory of the card */ |