aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 18:57:39 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 18:57:39 -0700
commit25c263542ddf9396012b6a6fa2b327d304f7f9a3 (patch)
treed7258f81da125b0bf4a2ce0ede2e79db38a7ed04
parentd8581969904b8a72db726c4b9090234c0f0bb18f (diff)
parent7c2399756ab8ccb2c57da4630b4aa4a1d61b3846 (diff)
Merge branch 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
* 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6: [SPARC, XEN, NET/CXGB3] use irq_handler_t where appropriate drivers/char/riscom8: clean up irq handling isdn/sc: irq handler clean isdn/act2000: fix major bug. clean irq handler. char/pcmcia/synclink_cs: trim trailing whitespace drivers/char/ip2: separate polling and irq-driven work entry points drivers/char/ip2: split out irq core logic into separate function [NETDRVR] lib82596, netxen: delete pointless tests from irq handler Eliminate pointless casts from void* in a few driver irq handlers. [PARPORT] Remove unused 'irq' argument from parport irq functions [PARPORT] Kill useful 'irq' arg from parport_{generic_irq,ieee1284_interrupt} [PARPORT] Consolidate code copies into a single generic irq handler
-rw-r--r--arch/sparc/kernel/irq.c4
-rw-r--r--arch/x86/xen/events.c4
-rw-r--r--drivers/atm/horizon.c5
-rw-r--r--drivers/char/ip2/ip2main.c69
-rw-r--r--drivers/char/pcmcia/synclink_cs.c706
-rw-r--r--drivers/char/ppdev.c4
-rw-r--r--drivers/char/riscom8.c16
-rw-r--r--drivers/char/tpm/tpm_tis.c4
-rw-r--r--drivers/input/serio/parkbd.c2
-rw-r--r--drivers/isdn/act2000/act2000_isa.c12
-rw-r--r--drivers/isdn/sc/init.c3
-rw-r--r--drivers/isdn/sc/interrupt.c17
-rw-r--r--drivers/mtd/onenand/onenand_base.c2
-rw-r--r--drivers/net/cxgb3/adapter.h4
-rw-r--r--drivers/net/cxgb3/sge.c2
-rw-r--r--drivers/net/hamradio/baycom_epp.c8
-rw-r--r--drivers/net/hamradio/baycom_par.c4
-rw-r--r--drivers/net/lib82596.c8
-rw-r--r--drivers/net/netxen/netxen_nic_main.c11
-rw-r--r--drivers/net/plip.c6
-rw-r--r--drivers/net/typhoon.c2
-rw-r--r--drivers/net/ucc_geth.c2
-rw-r--r--drivers/net/wan/sbni.c4
-rw-r--r--drivers/parport/daisy.c13
-rw-r--r--drivers/parport/ieee1284.c2
-rw-r--r--drivers/parport/parport_amiga.c9
-rw-r--r--drivers/parport/parport_atari.c9
-rw-r--r--drivers/parport/parport_ax88796.c10
-rw-r--r--drivers/parport/parport_gsc.c8
-rw-r--r--drivers/parport/parport_ip32.c6
-rw-r--r--drivers/parport/parport_mfc3.c2
-rw-r--r--drivers/parport/parport_pc.c9
-rw-r--r--drivers/parport/parport_sunbpp.c8
-rw-r--r--drivers/parport/probe.c3
-rw-r--r--drivers/parport/share.c12
-rw-r--r--drivers/usb/misc/uss720.c4
-rw-r--r--include/linux/parport.h22
-rw-r--r--sound/drivers/mts64.c2
-rw-r--r--sound/drivers/portman2x4.c2
39 files changed, 484 insertions, 536 deletions
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 722d67d3296..e1e24f31aa5 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -479,7 +479,7 @@ EXPORT_SYMBOL(pdma_areasize);
extern void floppy_hardint(void);
-static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
+static irq_handler_t floppy_irq_handler;
void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
{
@@ -500,7 +500,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
}
int sparc_floppy_request_irq(int irq, unsigned long flags,
- irqreturn_t (*irq_handler)(int irq, void *))
+ irq_handler_t irq_handler)
{
floppy_irq_handler = irq_handler;
return request_fast_irq(irq, floppy_hardint, flags, "floppy");
diff --git a/arch/x86/xen/events.c b/arch/x86/xen/events.c
index da1b173547a..6d1da5809e6 100644
--- a/arch/x86/xen/events.c
+++ b/arch/x86/xen/events.c
@@ -383,7 +383,7 @@ static void unbind_from_irq(unsigned int irq)
}
int bind_evtchn_to_irqhandler(unsigned int evtchn,
- irqreturn_t (*handler)(int, void *),
+ irq_handler_t handler,
unsigned long irqflags,
const char *devname, void *dev_id)
{
@@ -402,7 +402,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
- irqreturn_t (*handler)(int, void *),
+ irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
{
unsigned int irq;
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index f96446c358b..9b2cf253f02 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -1382,8 +1382,9 @@ static inline void rx_data_av_handler (hrz_dev * dev) {
/********** interrupt handler **********/
-static irqreturn_t interrupt_handler(int irq, void *dev_id) {
- hrz_dev * dev = (hrz_dev *) dev_id;
+static irqreturn_t interrupt_handler(int irq, void *dev_id)
+{
+ hrz_dev *dev = dev_id;
u32 int_source;
unsigned int irq_ok;
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 2124dce38f2..e04e66cf2c6 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -752,7 +752,7 @@ retry:
continue;
rc = request_irq( ip2config.irq[i], ip2_interrupt,
IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0),
- pcName, (void *)&pcName);
+ pcName, i2BoardPtrTable[i]);
if (rc) {
printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc);
ip2config.irq[i] = CIR_POLL;
@@ -1166,12 +1166,37 @@ ip2_interrupt_bh(struct work_struct *work)
/* */
/* */
/******************************************************************************/
-static irqreturn_t
-ip2_interrupt(int irq, void *dev_id)
+static void
+ip2_irq_work(i2eBordStrPtr pB)
+{
+#ifdef USE_IQI
+ if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
+// Disable his interrupt (will be enabled when serviced)
+// This is mostly to protect from reentrancy.
+ iiDisableMailIrq(pB);
+
+// Park the board on the immediate queue for processing.
+ schedule_work(&pB->tqueue_interrupt);
+
+// Make sure the immediate queue is flagged to fire.
+ }
+#else
+
+// We are using immediate servicing here. This sucks and can
+// cause all sorts of havoc with ppp and others. The failsafe
+// check on iiSendPendingMail could also throw a hairball.
+
+ i2ServiceBoard( pB );
+
+#endif /* USE_IQI */
+}
+
+static void
+ip2_polled_interrupt(void)
{
int i;
i2eBordStrPtr pB;
- int handled = 0;
+ const int irq = 0;
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
@@ -1183,32 +1208,28 @@ ip2_interrupt(int irq, void *dev_id)
// IRQ = 0 for polled boards, we won't poll "IRQ" boards
if ( pB && (pB->i2eUsingIrq == irq) ) {
- handled = 1;
-#ifdef USE_IQI
+ ip2_irq_work(pB);
+ }
+ }
- if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
-// Disable his interrupt (will be enabled when serviced)
-// This is mostly to protect from reentrancy.
- iiDisableMailIrq(pB);
+ ++irq_counter;
-// Park the board on the immediate queue for processing.
- schedule_work(&pB->tqueue_interrupt);
+ ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
+}
-// Make sure the immediate queue is flagged to fire.
- }
-#else
-// We are using immediate servicing here. This sucks and can
-// cause all sorts of havoc with ppp and others. The failsafe
-// check on iiSendPendingMail could also throw a hairball.
- i2ServiceBoard( pB );
-#endif /* USE_IQI */
- }
- }
+static irqreturn_t
+ip2_interrupt(int irq, void *dev_id)
+{
+ i2eBordStrPtr pB = dev_id;
+
+ ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, pB->i2eUsingIrq );
+
+ ip2_irq_work(pB);
++irq_counter;
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
- return IRQ_RETVAL(handled);
+ return IRQ_HANDLED;
}
/******************************************************************************/
@@ -1231,7 +1252,7 @@ ip2_poll(unsigned long arg)
// Just polled boards, IRQ = 0 will hit all non-interrupt boards.
// It will NOT poll boards handled by hard interrupts.
// The issue of queued BH interrups is handled in ip2_interrupt().
- ip2_interrupt(0, NULL);
+ ip2_polled_interrupt();
PollTimer.expires = POLL_TIMEOUT;
add_timer( &PollTimer );
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 2b889317461..8caff0ca80f 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -123,7 +123,7 @@ typedef struct
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
struct _input_signal_events {
- int ri_up;
+ int ri_up;
int ri_down;
int dsr_up;
int dsr_down;
@@ -137,7 +137,7 @@ struct _input_signal_events {
/*
* Device instance data structure
*/
-
+
typedef struct _mgslpc_info {
void *if_ptr; /* General purpose pointer (used by SPPP) */
int magic;
@@ -146,15 +146,15 @@ typedef struct _mgslpc_info {
int line;
unsigned short close_delay;
unsigned short closing_wait; /* time to wait before closing */
-
+
struct mgsl_icount icount;
-
+
struct tty_struct *tty;
int timeout;
int x_char; /* xon/xoff character */
int blocked_open; /* # of blocked opens */
unsigned char read_status_mask;
- unsigned char ignore_status_mask;
+ unsigned char ignore_status_mask;
unsigned char *tx_buf;
int tx_put;
@@ -170,10 +170,10 @@ typedef struct _mgslpc_info {
int rx_buf_size; /* size in bytes of single rx buffer */
int rx_buf_count; /* total number of rx buffers */
int rx_frame_count; /* number of full rx buffers */
-
+
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
-
+
wait_queue_head_t status_event_wait_q;
wait_queue_head_t event_wait_q;
struct timer_list tx_timer; /* HDLC transmit timeout timer */
@@ -192,7 +192,7 @@ typedef struct _mgslpc_info {
int bh_running;
int bh_requested;
-
+
int dcd_chkcount; /* check counts to prevent */
int cts_chkcount; /* too many IRQs if a signal */
int dsr_chkcount; /* is floating */
@@ -212,7 +212,7 @@ typedef struct _mgslpc_info {
unsigned int io_base; /* base I/O address of adapter */
unsigned int irq_level;
-
+
MGSL_PARAMS params; /* communications parameters */
unsigned char serial_signals; /* current serial signal states */
@@ -249,7 +249,7 @@ typedef struct _mgslpc_info {
*/
#define TXBUFSIZE 4096
-
+
#define CHA 0x00 /* channel A offset */
#define CHB 0x40 /* channel B offset */
@@ -298,9 +298,9 @@ typedef struct _mgslpc_info {
#define PIM 0x3d
#define PCR 0x3e
#define CCR4 0x3f
-
+
// IMR/ISR
-
+
#define IRQ_BREAK_ON BIT15 // rx break detected
#define IRQ_DATAOVERRUN BIT14 // receive data overflow
#define IRQ_ALLSENT BIT13 // all sent
@@ -315,13 +315,13 @@ typedef struct _mgslpc_info {
#define IRQ_DCD BIT2 // carrier detect status change
#define IRQ_OVERRUN BIT1 // receive frame overflow
#define IRQ_RXFIFO BIT0 // receive pool full
-
+
// STAR
-
+
#define XFW BIT6 // transmit FIFO write enable
#define CEC BIT2 // command executing
#define CTS BIT1 // CTS state
-
+
#define PVR_DTR BIT0
#define PVR_DSR BIT1
#define PVR_RI BIT2
@@ -329,25 +329,25 @@ typedef struct _mgslpc_info {
#define PVR_RS232 0x20 /* 0010b */
#define PVR_V35 0xe0 /* 1110b */
#define PVR_RS422 0x40 /* 0100b */
-
-/* Register access functions */
-
+
+/* Register access functions */
+
#define write_reg(info, reg, val) outb((val),(info)->io_base + (reg))
#define read_reg(info, reg) inb((info)->io_base + (reg))
-#define read_reg16(info, reg) inw((info)->io_base + (reg))
+#define read_reg16(info, reg) inw((info)->io_base + (reg))
#define write_reg16(info, reg, val) outw((val), (info)->io_base + (reg))
-
+
#define set_reg_bits(info, reg, mask) \
write_reg(info, (reg), \
- (unsigned char) (read_reg(info, (reg)) | (mask)))
+ (unsigned char) (read_reg(info, (reg)) | (mask)))
#define clear_reg_bits(info, reg, mask) \
write_reg(info, (reg), \
- (unsigned char) (read_reg(info, (reg)) & ~(mask)))
+ (unsigned char) (read_reg(info, (reg)) & ~(mask)))
/*
* interrupt enable/disable routines
- */
-static void irq_disable(MGSLPC_INFO *info, unsigned char channel, unsigned short mask)
+ */
+static void irq_disable(MGSLPC_INFO *info, unsigned char channel, unsigned short mask)
{
if (channel == CHA) {
info->imra_value |= mask;
@@ -357,7 +357,7 @@ static void irq_disable(MGSLPC_INFO *info, unsigned char channel, unsigned short
write_reg16(info, CHB + IMR, info->imrb_value);
}
}
-static void irq_enable(MGSLPC_INFO *info, unsigned char channel, unsigned short mask)
+static void irq_enable(MGSLPC_INFO *info, unsigned char channel, unsigned short mask)
{
if (channel == CHA) {
info->imra_value &= ~mask;
@@ -558,7 +558,7 @@ static int mgslpc_probe(struct pcmcia_device *link)
spin_lock_init(&info->lock);
spin_lock_init(&info->netlock);
memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS));
- info->idle_mode = HDLC_TXIDLE_FLAGS;
+ info->idle_mode = HDLC_TXIDLE_FLAGS;
info->imra_value = 0xffff;
info->imrb_value = 0xffff;
info->pim_value = 0xff;
@@ -600,7 +600,7 @@ static int mgslpc_config(struct pcmcia_device *link)
u_char buf[64];
cistpl_cftable_entry_t dflt = { 0 };
cistpl_cftable_entry_t *cfg;
-
+
if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_config(0x%p)\n", link);
@@ -624,7 +624,7 @@ static int mgslpc_config(struct pcmcia_device *link)
link->conf.ConfigIndex = cfg->index;
link->conf.Attributes |= CONF_ENABLE_IRQ;
-
+
/* IO window settings */
link->io.NumPorts1 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
@@ -644,7 +644,7 @@ static int mgslpc_config(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 8;
link->conf.Present = PRESENT_OPTION;
-
+
link->irq.Attributes |= IRQ_HANDLE_PRESENT;
link->irq.Handler = mgslpc_isr;
link->irq.Instance = info;
@@ -753,10 +753,10 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
#define CMD_TXEOM BIT1 // transmit end message
#define CMD_TXRESET BIT0 // transmit reset
-static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel)
+static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel)
{
int i = 0;
- /* wait for command completion */
+ /* wait for command completion */
while (read_reg(info, (unsigned char)(channel+STAR)) & BIT2) {
udelay(1);
if (i++ == 1000)
@@ -765,7 +765,7 @@ static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel)
return TRUE;
}
-static void issue_command(MGSLPC_INFO *info, unsigned char channel, unsigned char cmd)
+static void issue_command(MGSLPC_INFO *info, unsigned char channel, unsigned char cmd)
{
wait_command_complete(info, channel);
write_reg(info, (unsigned char) (channel + CMDR), cmd);
@@ -775,12 +775,12 @@ static void tx_pause(struct tty_struct *tty)
{
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
-
+
if (mgslpc_paranoia_check(info, tty->name, "tx_pause"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
- printk("tx_pause(%s)\n",info->device_name);
-
+ printk("tx_pause(%s)\n",info->device_name);
+
spin_lock_irqsave(&info->lock,flags);
if (info->tx_enabled)
tx_stop(info);
@@ -791,12 +791,12 @@ static void tx_release(struct tty_struct *tty)
{
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
-
+
if (mgslpc_paranoia_check(info, tty->name, "tx_release"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
- printk("tx_release(%s)\n",info->device_name);
-
+ printk("tx_release(%s)\n",info->device_name);
+
spin_lock_irqsave(&info->lock,flags);
if (!info->tx_enabled)
tx_start(info);
@@ -810,7 +810,7 @@ static int bh_action(MGSLPC_INFO *info)
{
unsigned long flags;
int rc = 0;
-
+
spin_lock_irqsave(&info->lock,flags);
if (info->pending_bh & BH_RECEIVE) {
@@ -829,9 +829,9 @@ static int bh_action(MGSLPC_INFO *info)
info->bh_running = 0;
info->bh_requested = 0;
}
-
+
spin_unlock_irqrestore(&info->lock,flags);
-
+
return rc;
}
@@ -842,22 +842,22 @@ static void bh_handler(struct work_struct *work)
if (!info)
return;
-
+
if (debug_level >= DEBUG_LEVEL_BH)
printk( "%s(%d):bh_handler(%s) entry\n",
__FILE__,__LINE__,info->device_name);
-
+
info->bh_running = 1;
while((action = bh_action(info)) != 0) {
-
+
/* Process work item */
if ( debug_level >= DEBUG_LEVEL_BH )
printk( "%s(%d):bh_handler() work item action=%d\n",
__FILE__,__LINE__,action);
switch (action) {
-
+
case BH_RECEIVE:
while(rx_get_frame(info));
break;
@@ -897,7 +897,7 @@ static void bh_status(MGSLPC_INFO *info)
info->cts_chkcount = 0;
}
-/* eom: non-zero = end of frame */
+/* eom: non-zero = end of frame */
static void rx_ready_hdlc(MGSLPC_INFO *info, int eom)
{
unsigned char data[2];
@@ -906,7 +906,7 @@ static void rx_ready_hdlc(MGSLPC_INFO *info, int eom)
if (debug_level >= DEBUG_LEVEL_ISR)
printk("%s(%d):rx_ready_hdlc(eom=%d)\n",__FILE__,__LINE__,eom);
-
+
if (!info->rx_enabled)
return;
@@ -920,12 +920,12 @@ static void rx_ready_hdlc(MGSLPC_INFO *info, int eom)
}
if (eom) {
- /* end of frame, get FIFO count from RBCL register */
+ /* end of frame, get FIFO count from RBCL register */
if (!(fifo_count = (unsigned char)(read_reg(info, CHA+RBCL) & 0x1f)))
fifo_count = 32;
} else
fifo_count = 32;
-
+
do {
if (fifo_count == 1) {
read_count = 1;
@@ -969,7 +969,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd)
struct mgsl_icount *icount = &info->icount;
if (tcd) {
- /* early termination, get FIFO count from RBCL register */
+ /* early termination, get FIFO count from RBCL register */
fifo_count = (unsigned char)(read_reg(info, CHA+RBCL) & 0x1f);
/* Zero fifo count could mean 0 or 32 bytes available.
@@ -981,7 +981,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd)
fifo_count = 32;
tty_buffer_request_room(tty, fifo_count);
- /* Flush received async data to receive data buffer. */
+ /* Flush received async data to receive data buffer. */
while (fifo_count) {
data = read_reg(info, CHA + RXFIFO);
status = read_reg(info, CHA + RXFIFO);
@@ -995,7 +995,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd)
// BIT6:framing error
if (status & (BIT7 + BIT6)) {
- if (status & BIT7)
+ if (status & BIT7)
icount->parity++;
else
icount->frame++;
@@ -1003,7 +1003,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd)
/* discard char if tty control flags say so */
if (status & info->ignore_status_mask)
continue;
-
+
status &= info->read_status_mask;
if (status & BIT7)
@@ -1022,7 +1022,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd)
__FILE__,__LINE__,icount->rx,icount->brk,
icount->parity,icount->frame,icount->overrun);
}
-
+
if (work)
tty_flip_buffer_push(tty);
}
@@ -1032,7 +1032,7 @@ static void tx_done(MGSLPC_INFO *info)
{
if (!info->tx_active)
return;
-
+
info->tx_active = 0;
info->tx_aborting = 0;
@@ -1040,8 +1040,8 @@ static void tx_done(MGSLPC_INFO *info)
return;
info->tx_count = info->tx_put = info->tx_get = 0;
- del_timer(&info->tx_timer);
-
+ del_timer(&info->tx_timer);
+
if (info->drop_rts_on_tx_done) {
get_signals(info);
if (info->serial_signals & SerialSignal_RTS) {
@@ -1054,7 +1054,7 @@ static void tx_done(MGSLPC_INFO *info)
#if SYNCLINK_GENERIC_HDLC
if (info->netcount)
hdlcdev_tx_done(info);
- else
+ else
#endif
{
if (info->tty->stopped || info->tty->hw_stopped) {
@@ -1090,7 +1090,7 @@ static void tx_ready(MGSLPC_INFO *info)
while (info->tx_count && fifo_count) {
c = min(2, min_t(int, fifo_count, min(info->tx_count, TXBUFSIZE - info->tx_get)));
-
+
if (c == 1) {
write_reg(info, CHA + TXFIFO, *(info->tx_buf + info->tx_get));
} else {
@@ -1220,9 +1220,9 @@ static void ri_change(MGSLPC_INFO *info)
}
/* Interrupt service routine entry point.
- *
+ *
* Arguments:
- *
+ *
* irq interrupt number that caused interrupt
* dev_id device ID supplied during interrupt registration
*/
@@ -1233,18 +1233,18 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
unsigned char gis, pis;
int count=0;
- if (debug_level >= DEBUG_LEVEL_ISR)
+ if (debug_level >= DEBUG_LEVEL_ISR)
printk("mgslpc_isr(%d) entry.\n", irq);
if (!info)
return IRQ_NONE;
-
+
if (!(info->p_dev->_locked))
return IRQ_HANDLED;
spin_lock(&info->lock);
while ((gis = read_reg(info, CHA + GIS))) {
- if (debug_level >= DEBUG_LEVEL_ISR)
+ if (debug_level >= DEBUG_LEVEL_ISR)
printk("mgslpc_isr %s gis=%04X\n", info->device_name,gis);
if ((gis & 0x70) || count > 1000) {
@@ -1268,7 +1268,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
irq_disable(info, CHA, IRQ_TIMER);
}
- /* receive IRQs */
+ /* receive IRQs */
if (isr & IRQ_EXITHUNT) {
info->icount.exithunt++;
wake_up_interruptible(&info->event_wait_q);
@@ -1283,12 +1283,12 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
}
if (isr & (IRQ_RXEOM + IRQ_RXFIFO)) {
if (info->params.mode == MGSL_MODE_HDLC)
- rx_ready_hdlc(info, isr & IRQ_RXEOM);
+ rx_ready_hdlc(info, isr & IRQ_RXEOM);
else
rx_ready_async(info, isr & IRQ_RXEOM);
}
- /* transmit IRQs */
+ /* transmit IRQs */
if (isr & IRQ_UNDERRUN) {
if (info->tx_aborting)
info->icount.txabort++;
@@ -1311,13 +1311,13 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
ri_change(info);
}
}
-
- /* Request bottom half processing if there's something
+
+ /* Request bottom half processing if there's something
* for it to do and the bh is not already running
*/
if (info->pending_bh && !info->bh_running && !info->bh_requested) {
- if ( debug_level >= DEBUG_LEVEL_ISR )
+ if ( debug_level >= DEBUG_LEVEL_ISR )
printk("%s(%d):%s queueing bh task.\n",
__FILE__,__LINE__,info->device_name);
schedule_work(&info->task);
@@ -1325,8 +1325,8 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
}
spin_unlock(&info->lock);
-
- if (debug_level >= DEBUG_LEVEL_ISR)
+
+ if (debug_level >= DEBUG_LEVEL_ISR)
printk("%s(%d):mgslpc_isr(%d)exit.\n",
__FILE__,__LINE__,irq);
@@ -1338,13 +1338,13 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
static int startup(MGSLPC_INFO * info)
{
int retval = 0;
-
+
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):startup(%s)\n",__FILE__,__LINE__,info->device_name);
-
+
if (info->flags & ASYNC_INITIALIZED)
return 0;
-
+
if (!info->tx_buf) {
/* allocate a page of memory for a transmit buffer */
info->tx_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL);
@@ -1356,18 +1356,18 @@ static int startup(MGSLPC_INFO * info)
}
info->pending_bh = 0;
-
+
memset(&info->icount, 0, sizeof(info->icount));
setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info);
/* Allocate and claim adapter resources */
retval = claim_resources(info);
-
+
/* perform existance check and diagnostics */
if ( !retval )
retval = adapter_test(info);
-
+
if ( retval ) {
if (capable(CAP_SYS_ADMIN) && info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
@@ -1377,12 +1377,12 @@ static int startup(MGSLPC_INFO * info)
/* program hardware for current parameters */
mgslpc_change_params(info);
-
+
if (info->tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags);
info->flags |= ASYNC_INITIALIZED;
-
+
return 0;
}
@@ -1391,7 +1391,7 @@ static int startup(MGSLPC_INFO * info)
static void shutdown(MGSLPC_INFO * info)
{
unsigned long flags;
-
+
if (!(info->flags & ASYNC_INITIALIZED))
return;
@@ -1418,16 +1418,16 @@ static void shutdown(MGSLPC_INFO * info)
/* TODO:disable interrupts instead of reset to preserve signal states */
reset_device(info);
-
+
if (!info->tty || info->tty->termios->c_cflag & HUPCL) {
info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS);
set_signals(info);
}
-
+
spin_unlock_irqrestore(&info->lock,flags);
- release_resources(info);
-
+ release_resources(info);
+
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
@@ -1439,18 +1439,18 @@ static void mgslpc_program_hw(MGSLPC_INFO *info)
unsigned long flags;
spin_lock_irqsave(&info->lock,flags);
-
+
rx_stop(info);
tx_stop(info);
info->tx_count = info->tx_put = info->tx_get = 0;
-
+
if (info->params.mode == MGSL_MODE_HDLC || info->netcount)
hdlc_mode(info);
else
async_mode(info);
-
+
set_signals(info);
-
+
info->dcd_chkcount = 0;
info->cts_chkcount = 0;
info->ri_chkcount = 0;
@@ -1459,10 +1459,10 @@ static void mgslpc_program_hw(MGSLPC_INFO *info)
irq_enable(info, CHB, IRQ_DCD | IRQ_CTS);
port_irq_enable(info, (unsigned char) PVR_DSR | PVR_RI);
get_signals(info);
-
+
if (info->netcount || info->tty->termios->c_cflag & CREAD)
rx_start(info);
-
+
spin_unlock_irqrestore(&info->lock,flags);
}
@@ -1475,11 +1475,11 @@ static void mgslpc_change_params(MGSLPC_INFO *info)
if (!info->tty || !info->tty->termios)
return;
-
+
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):mgslpc_change_params(%s)\n",
__FILE__,__LINE__, info->device_name );
-
+
cflag = info->tty->termios->c_cflag;
/* if B0 rate (hangup) specified then negate DTR and RTS */
@@ -1488,9 +1488,9 @@ static void mg