Commit af71c8d4 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Fix the workqueue changes for the HiSax driver

Whoever did the tqueue -> workqueue changes didn't really care to look
at how it was used in the HiSax driver, making the driver compile but
oops with NULL pointer derefs.

Oh, and workqueues are really not the right solution here, tasklets are.
But that's for later.
parent 8f702872
...@@ -106,8 +106,9 @@ static const char *amd7930_revision = "$Revision: 1.5.6.4 $"; ...@@ -106,8 +106,9 @@ static const char *amd7930_revision = "$Revision: 1.5.6.4 $";
static void Bchan_fill_fifo(struct BCState *, struct sk_buff *); static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
static void static void
Bchan_xmt_bh(struct BCState *bcs) Bchan_xmt_bh(void *data)
{ {
struct BCState *bcs = data;
struct sk_buff *skb; struct sk_buff *skb;
if (bcs->hw.amd7930.tx_skb != NULL) { if (bcs->hw.amd7930.tx_skb != NULL) {
...@@ -120,14 +121,14 @@ Bchan_xmt_bh(struct BCState *bcs) ...@@ -120,14 +121,14 @@ Bchan_xmt_bh(struct BCState *bcs)
} else { } else {
clear_bit(BC_FLG_BUSY, &bcs->Flag); clear_bit(BC_FLG_BUSY, &bcs->Flag);
bcs->event |= 1 << B_XMTBUFREADY; bcs->event |= 1 << B_XMTBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} }
static void static void
Bchan_xmit_callback(struct BCState *bcs) Bchan_xmit_callback(struct BCState *bcs)
{ {
schedule_work(&bcs->hw.amd7930.tq_xmt); schedule_work(&bcs->hw.amd7930.xmt_work);
} }
/* B channel transmission: two modes (three, if you count L1_MODE_NULL) /* B channel transmission: two modes (three, if you count L1_MODE_NULL)
...@@ -259,12 +260,13 @@ Bchan_recv_callback(struct BCState *bcs) ...@@ -259,12 +260,13 @@ Bchan_recv_callback(struct BCState *bcs)
(void *) &Bchan_recv_callback, (void *) bcs); (void *) &Bchan_recv_callback, (void *) bcs);
} }
schedule_work(&hw->tq_rcv); schedule_work(&hw->rcv_work);
} }
static void static void
Bchan_rcv_bh(struct BCState *bcs) Bchan_rcv_bh(void *data)
{ {
struct BCState *bcs = data;
struct IsdnCardState *cs = bcs->cs; struct IsdnCardState *cs = bcs->cs;
struct amd7930_hw *hw = &bcs->hw.amd7930; struct amd7930_hw *hw = &bcs->hw.amd7930;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -305,7 +307,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -305,7 +307,7 @@ Bchan_rcv_bh(struct BCState *bcs)
skb_queue_tail(&bcs->rqueue, hw->rv_skb); skb_queue_tail(&bcs->rqueue, hw->rv_skb);
hw->rv_skb = skb; hw->rv_skb = skb;
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} else if (len > 0) { } else if (len > 0) {
/* Small packet received */ /* Small packet received */
...@@ -316,7 +318,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -316,7 +318,7 @@ Bchan_rcv_bh(struct BCState *bcs)
memcpy(skb_put(skb, len), hw->rv_skb->tail, len); memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
skb_queue_tail(&bcs->rqueue, skb); skb_queue_tail(&bcs->rqueue, skb);
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} else { } else {
/* Reception Error */ /* Reception Error */
...@@ -332,7 +334,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -332,7 +334,7 @@ Bchan_rcv_bh(struct BCState *bcs)
RCV_BUFSIZE/RCV_BUFBLKS); RCV_BUFSIZE/RCV_BUFBLKS);
skb_queue_tail(&bcs->rqueue, skb); skb_queue_tail(&bcs->rqueue, skb);
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} }
...@@ -416,12 +418,8 @@ Bchan_init(struct BCState *bcs) ...@@ -416,12 +418,8 @@ Bchan_init(struct BCState *bcs)
return; return;
} }
bcs->hw.amd7930.tq_rcv.sync = 0; INIT_WORK(&bcs->hw.amd7930.rcv_work, &Bchan_rcv_bh, bcs);
INIT_WORK(&bcs->hw.amd7930.tq_rcv, (void (*)(void *)) &Bchan_rcv_bh, INIT_WORK(&bcs->hw.amd7930.xmt_work, &Bchan_xmt_bh, bcs);
(void *) bcs);
INIT_WORK(&bcs->hw.amd7930.tq_xmt, (void (*)(void *)) &Bchan_xmt_bh,
(void *) bcs);
} }
static void static void
......
...@@ -232,9 +232,9 @@ Amd7930_new_ph(struct IsdnCardState *cs) ...@@ -232,9 +232,9 @@ Amd7930_new_ph(struct IsdnCardState *cs)
static void static void
Amd7930_bh(struct IsdnCardState *cs) Amd7930_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *stptr; struct PStack *stptr;
if (!cs) if (!cs)
...@@ -277,7 +277,7 @@ Amd7930_sched_event(struct IsdnCardState *cs, int event) // ok ...@@ -277,7 +277,7 @@ Amd7930_sched_event(struct IsdnCardState *cs, int event) // ok
} }
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
static void static void
...@@ -790,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs) ...@@ -790,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs)
cs->dc.amd7930.old_state = 0; cs->dc.amd7930.old_state = 0;
cs->dc.amd7930.lmr1 = 0x40; cs->dc.amd7930.lmr1 = 0x40;
cs->dc.amd7930.ph_command = Amd7930_ph_command; cs->dc.amd7930.ph_command = Amd7930_ph_command;
INIT_WORK(&cs->tqueue, (void *) (void *) Amd7930_bh, NULL); INIT_WORK(&cs->work, Amd7930_bh, cs);
cs->setstack_d = setstack_Amd7930; cs->setstack_d = setstack_Amd7930;
cs->DC_Close = DC_Close_Amd7930; cs->DC_Close = DC_Close_Amd7930;
cs->dbusytimer.function = (void *) dbusy_timer_handler; cs->dbusytimer.function = (void *) dbusy_timer_handler;
......
...@@ -195,7 +195,7 @@ void inline ...@@ -195,7 +195,7 @@ void inline
hdlc_sched_event(struct BCState *bcs, int event) hdlc_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
void void
......
...@@ -1160,7 +1160,6 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag) ...@@ -1160,7 +1160,6 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
cs->tx_skb = NULL; cs->tx_skb = NULL;
cs->tx_cnt = 0; cs->tx_cnt = 0;
cs->event = 0; cs->event = 0;
cs->tqueue.data = cs;
skb_queue_head_init(&cs->rq); skb_queue_head_init(&cs->rq);
skb_queue_head_init(&cs->sq); skb_queue_head_init(&cs->sq);
...@@ -1738,7 +1737,7 @@ static void hisax_b_l2l1(struct PStack *st, int pr, void *arg); ...@@ -1738,7 +1737,7 @@ static void hisax_b_l2l1(struct PStack *st, int pr, void *arg);
static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg); static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg);
static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs); static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs);
static void hisax_bc_close(struct BCState *bcs); static void hisax_bc_close(struct BCState *bcs);
static void hisax_bh(struct IsdnCardState *cs); static void hisax_bh(void *data);
static void EChannel_proc_rcv(struct hisax_d_if *d_if); static void EChannel_proc_rcv(struct hisax_d_if *d_if);
int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
...@@ -1770,7 +1769,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[], ...@@ -1770,7 +1769,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
hisax_d_if->cs = cs; hisax_d_if->cs = cs;
cs->hw.hisax_d_if = hisax_d_if; cs->hw.hisax_d_if = hisax_d_if;
cs->cardmsg = hisax_cardmsg; cs->cardmsg = hisax_cardmsg;
INIT_WORK(&cs->tqueue, (void *) (void *) hisax_bh, NULL); INIT_WORK(&cs->work, hisax_bh, cs);
cs->channel[0].d_st->l1.l2l1 = hisax_d_l2l1; cs->channel[0].d_st->l1.l2l1 = hisax_d_l2l1;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
cs->bcs[i].BC_SetStack = hisax_bc_setstack; cs->bcs[i].BC_SetStack = hisax_bc_setstack;
...@@ -1799,11 +1798,12 @@ void hisax_unregister(struct hisax_d_if *hisax_d_if) ...@@ -1799,11 +1798,12 @@ void hisax_unregister(struct hisax_d_if *hisax_d_if)
static void hisax_sched_event(struct IsdnCardState *cs, int event) static void hisax_sched_event(struct IsdnCardState *cs, int event)
{ {
cs->event |= 1 << event; cs->event |= 1 << event;
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
static void hisax_bh(struct IsdnCardState *cs) static void hisax_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *st; struct PStack *st;
int pr; int pr;
...@@ -1825,7 +1825,7 @@ static void hisax_bh(struct IsdnCardState *cs) ...@@ -1825,7 +1825,7 @@ static void hisax_bh(struct IsdnCardState *cs)
static void hisax_b_sched_event(struct BCState *bcs, int event) static void hisax_b_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static inline void D_L2L1(struct hisax_d_if *d_if, int pr, void *arg) static inline void D_L2L1(struct hisax_d_if *d_if, int pr, void *arg)
......
...@@ -146,7 +146,7 @@ static void change_speed(struct IsdnCardState *cs, int baud) ...@@ -146,7 +146,7 @@ static void change_speed(struct IsdnCardState *cs, int baud)
static int mstartup(struct IsdnCardState *cs) static int mstartup(struct IsdnCardState *cs)
{ {
unsigned unsigned long flags; unsigned long flags;
int retval=0; int retval=0;
......
...@@ -202,7 +202,7 @@ static void ...@@ -202,7 +202,7 @@ static void
hfc_sched_event(struct BCState *bcs, int event) hfc_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static struct sk_buff static struct sk_buff
...@@ -608,8 +608,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs) ...@@ -608,8 +608,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs)
} }
static void static void
hfcd_bh(struct IsdnCardState *cs) hfcd_bh(void *data)
{ {
struct IsdnCardState *cs = data;
/* struct PStack *stptr; /* struct PStack *stptr;
*/ */
if (!cs) if (!cs)
...@@ -645,7 +646,7 @@ void ...@@ -645,7 +646,7 @@ void
sched_event_D(struct IsdnCardState *cs, int event) sched_event_D(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
static static
...@@ -1127,7 +1128,7 @@ init2bds0(struct IsdnCardState *cs) ...@@ -1127,7 +1128,7 @@ init2bds0(struct IsdnCardState *cs)
cs->dbusytimer.function = (void *) hfc_dbusy_timer; cs->dbusytimer.function = (void *) hfc_dbusy_timer;
cs->dbusytimer.data = (long) cs; cs->dbusytimer.data = (long) cs;
init_timer(&cs->dbusytimer); init_timer(&cs->dbusytimer);
INIT_WORK(&cs->tqueue, (void *) (void *) hfcd_bh, NULL); INIT_WORK(&cs->work, hfcd_bh, cs);
if (!cs->hw.hfcD.send) if (!cs->hw.hfcD.send)
cs->hw.hfcD.send = init_send_hfcd(16); cs->hw.hfcD.send = init_send_hfcd(16);
if (!cs->bcs[0].hw.hfc.send) if (!cs->bcs[0].hw.hfc.send)
......
...@@ -86,7 +86,7 @@ void ...@@ -86,7 +86,7 @@ void
hfc_sched_event(struct BCState *bcs, int event) hfc_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static void static void
......
...@@ -194,7 +194,7 @@ static void ...@@ -194,7 +194,7 @@ static void
sched_event_D_pci(struct IsdnCardState *cs, int event) sched_event_D_pci(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
/*********************************/ /*********************************/
...@@ -204,7 +204,7 @@ static void ...@@ -204,7 +204,7 @@ static void
hfcpci_sched_event(struct BCState *bcs, int event) hfcpci_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
/************************************************/ /************************************************/
...@@ -1535,8 +1535,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs) ...@@ -1535,8 +1535,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs)
/* handle L1 state changes */ /* handle L1 state changes */
/***************************/ /***************************/
static void static void
hfcpci_bh(struct IsdnCardState *cs) hfcpci_bh(void *data)
{ {
struct IsdnCardState *cs = data;
unsigned long flags; unsigned long flags;
/* struct PStack *stptr; /* struct PStack *stptr;
*/ */
...@@ -1622,7 +1623,7 @@ inithfcpci(struct IsdnCardState *cs) ...@@ -1622,7 +1623,7 @@ inithfcpci(struct IsdnCardState *cs)
cs->dbusytimer.function = (void *) hfcpci_dbusy_timer; cs->dbusytimer.function = (void *) hfcpci_dbusy_timer;
cs->dbusytimer.data = (long) cs; cs->dbusytimer.data = (long) cs;
init_timer(&cs->dbusytimer); init_timer(&cs->dbusytimer);
INIT_WORK(&cs->tqueue, (void *) (void *) hfcpci_bh, NULL); INIT_WORK(&cs->work, hfcpci_bh, cs);
cs->BC_Send_Data = &hfcpci_send_data; cs->BC_Send_Data = &hfcpci_send_data;
cs->bcs[0].BC_SetStack = setstack_2b; cs->bcs[0].BC_SetStack = setstack_2b;
cs->bcs[1].BC_SetStack = setstack_2b; cs->bcs[1].BC_SetStack = setstack_2b;
......
...@@ -464,7 +464,7 @@ static void ...@@ -464,7 +464,7 @@ static void
sched_event_D_sx(struct IsdnCardState *cs, int event) sched_event_D_sx(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
/*********************************/ /*********************************/
...@@ -474,7 +474,7 @@ static void ...@@ -474,7 +474,7 @@ static void
hfcsx_sched_event(struct BCState *bcs, int event) hfcsx_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
/************************************************/ /************************************************/
...@@ -1323,8 +1323,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs) ...@@ -1323,8 +1323,9 @@ setstack_2b(struct PStack *st, struct BCState *bcs)
/* handle L1 state changes */ /* handle L1 state changes */
/***************************/ /***************************/
static void static void
hfcsx_bh(struct IsdnCardState *cs) hfcsx_bh(void *data)
{ {
struct IsdnCardState *cs = data;
unsigned long flags; unsigned long flags;
/* struct PStack *stptr; /* struct PStack *stptr;
*/ */
...@@ -1410,7 +1411,7 @@ inithfcsx(struct IsdnCardState *cs) ...@@ -1410,7 +1411,7 @@ inithfcsx(struct IsdnCardState *cs)
cs->dbusytimer.function = (void *) hfcsx_dbusy_timer; cs->dbusytimer.function = (void *) hfcsx_dbusy_timer;
cs->dbusytimer.data = (long) cs; cs->dbusytimer.data = (long) cs;
init_timer(&cs->dbusytimer); init_timer(&cs->dbusytimer);
INIT_WORK(&cs->tqueue, (void *) (void *) hfcsx_bh, NULL); INIT_WORK(&cs->work, hfcsx_bh, cs);
cs->BC_Send_Data = &hfcsx_send_data; cs->BC_Send_Data = &hfcsx_send_data;
cs->bcs[0].BC_SetStack = setstack_2b; cs->bcs[0].BC_SetStack = setstack_2b;
cs->bcs[1].BC_SetStack = setstack_2b; cs->bcs[1].BC_SetStack = setstack_2b;
......
...@@ -453,8 +453,8 @@ struct amd7930_hw { ...@@ -453,8 +453,8 @@ struct amd7930_hw {
int rv_buff_out; int rv_buff_out;
struct sk_buff *rv_skb; struct sk_buff *rv_skb;
struct hdlc_state *hdlc_state; struct hdlc_state *hdlc_state;
struct work_struct tq_rcv; struct work_struct rcv_work;
struct work_struct tq_xmt; struct work_struct xmt_work;
}; };
#define BC_FLG_INIT 1 #define BC_FLG_INIT 1
...@@ -495,7 +495,7 @@ struct BCState { ...@@ -495,7 +495,7 @@ struct BCState {
u_char *blog; u_char *blog;
u_char *conmsg; u_char *conmsg;
struct timer_list transbusy; struct timer_list transbusy;
struct work_struct tqueue; struct work_struct work;
unsigned long event; unsigned long event;
int (*BC_SetStack) (struct PStack *, struct BCState *); int (*BC_SetStack) (struct PStack *, struct BCState *);
void (*BC_Close) (struct BCState *); void (*BC_Close) (struct BCState *);
...@@ -954,7 +954,7 @@ struct IsdnCardState { ...@@ -954,7 +954,7 @@ struct IsdnCardState {
struct sk_buff *tx_skb; struct sk_buff *tx_skb;
int tx_cnt; int tx_cnt;
long event; long event;
struct work_struct tqueue; struct work_struct work;
struct timer_list dbusytimer; struct timer_list dbusytimer;
#ifdef ERROR_STATISTIC #ifdef ERROR_STATISTIC
int err_crc; int err_crc;
......
...@@ -95,7 +95,7 @@ void ...@@ -95,7 +95,7 @@ void
hscx_sched_event(struct BCState *bcs, int event) hscx_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
void void
......
...@@ -78,8 +78,9 @@ icc_new_ph(struct IsdnCardState *cs) ...@@ -78,8 +78,9 @@ icc_new_ph(struct IsdnCardState *cs)
} }
static void static void
icc_bh(struct IsdnCardState *cs) icc_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *stptr; struct PStack *stptr;
if (!cs) if (!cs)
...@@ -190,7 +191,7 @@ void ...@@ -190,7 +191,7 @@ void
icc_sched_event(struct IsdnCardState *cs, int event) icc_sched_event(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
void void
...@@ -622,7 +623,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -622,7 +623,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
void __init void __init
initicc(struct IsdnCardState *cs) initicc(struct IsdnCardState *cs)
{ {
INIT_WORK(&cs->tqueue, (void *) (void *) icc_bh, NULL); INIT_WORK(&cs->work, icc_bh, cs);
cs->setstack_d = setstack_icc; cs->setstack_d = setstack_icc;
cs->DC_Close = DC_Close_icc; cs->DC_Close = DC_Close_icc;
cs->dc.icc.mon_tx = NULL; cs->dc.icc.mon_tx = NULL;
......
...@@ -38,7 +38,7 @@ static inline void cic_int(struct IsdnCardState *cs); ...@@ -38,7 +38,7 @@ static inline void cic_int(struct IsdnCardState *cs);
static void dch_l2l1(struct PStack *st, int pr, void *arg); static void dch_l2l1(struct PStack *st, int pr, void *arg);
static void dbusy_timer_handler(struct IsdnCardState *cs); static void dbusy_timer_handler(struct IsdnCardState *cs);
static void ipacx_new_ph(struct IsdnCardState *cs); static void ipacx_new_ph(struct IsdnCardState *cs);
static void dch_bh(struct IsdnCardState *cs); static void dch_bh(void *data);
static void dch_sched_event(struct IsdnCardState *cs, int event); static void dch_sched_event(struct IsdnCardState *cs, int event);
static void dch_empty_fifo(struct IsdnCardState *cs, int count); static void dch_empty_fifo(struct IsdnCardState *cs, int count);
static void dch_fill_fifo(struct IsdnCardState *cs); static void dch_fill_fifo(struct IsdnCardState *cs);
...@@ -272,8 +272,9 @@ ipacx_new_ph(struct IsdnCardState *cs) ...@@ -272,8 +272,9 @@ ipacx_new_ph(struct IsdnCardState *cs)
// bottom half handler for D channel // bottom half handler for D channel
//---------------------------------------------------------- //----------------------------------------------------------
static void static void
dch_bh(struct IsdnCardState *cs) dch_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *st; struct PStack *st;
if (!cs) return; if (!cs) return;
...@@ -305,7 +306,7 @@ static void ...@@ -305,7 +306,7 @@ static void
dch_sched_event(struct IsdnCardState *cs, int event) dch_sched_event(struct IsdnCardState *cs, int event)
{ {
set_bit(event, &cs->event); set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
//---------------------------------------------------------- //----------------------------------------------------------
...@@ -507,7 +508,7 @@ dch_init(struct IsdnCardState *cs) ...@@ -507,7 +508,7 @@ dch_init(struct IsdnCardState *cs)
{ {
printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n"); printk(KERN_INFO "HiSax: IPACX ISDN driver v0.1.0\n");
INIT_WORK(&cs->tqueue, (void *)(void *) dch_bh, cs); INIT_WORK(&cs->work, dch_bh, cs);
cs->setstack_d = dch_setstack; cs->setstack_d = dch_setstack;
cs->dbusytimer.function = (void *) dbusy_timer_handler; cs->dbusytimer.function = (void *) dbusy_timer_handler;
...@@ -589,7 +590,7 @@ static void ...@@ -589,7 +590,7 @@ static void
bch_sched_event(struct BCState *bcs, int event) bch_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
//---------------------------------------------------------- //----------------------------------------------------------
......
...@@ -82,8 +82,9 @@ isac_new_ph(struct IsdnCardState *cs) ...@@ -82,8 +82,9 @@ isac_new_ph(struct IsdnCardState *cs)
} }
static void static void
isac_bh(struct IsdnCardState *cs) isac_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *stptr; struct PStack *stptr;
if (!cs) if (!cs)
...@@ -194,7 +195,7 @@ void ...@@ -194,7 +195,7 @@ void
isac_sched_event(struct IsdnCardState *cs, int event) isac_sched_event(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
void void
...@@ -624,7 +625,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -624,7 +625,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
void __devinit void __devinit
initisac(struct IsdnCardState *cs) initisac(struct IsdnCardState *cs)
{ {
INIT_WORK(&cs->tqueue, (void *) (void *) isac_bh, NULL); INIT_WORK(&cs->work, isac_bh, cs);
cs->setstack_d = setstack_isac; cs->setstack_d = setstack_isac;
cs->DC_Close = DC_Close_isac; cs->DC_Close = DC_Close_isac;
cs->dc.isac.mon_tx = NULL; cs->dc.isac.mon_tx = NULL;
......
...@@ -429,8 +429,10 @@ extern void BChannel_bh(struct BCState *); ...@@ -429,8 +429,10 @@ extern void BChannel_bh(struct BCState *);
#define B_LL_OK 10 #define B_LL_OK 10
static void static void
isar_bh(struct BCState *bcs) isar_bh(void *data)
{ {
struct BCState *bcs = data;
BChannel_bh(bcs); BChannel_bh(bcs);
if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event))
ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR);
...@@ -444,7 +446,7 @@ static void ...@@ -444,7 +446,7 @@ static void
isar_sched_event(struct BCState *bcs, int event) isar_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static inline void static inline void
...@@ -1555,7 +1557,7 @@ isar_setup(struct IsdnCardState *cs) ...@@ -1555,7 +1557,7 @@ isar_setup(struct IsdnCardState *cs)
cs->bcs[i].mode = 0; cs->bcs[i].mode = 0;
cs->bcs[i].hw.isar.dpath = i + 1; cs->bcs[i].hw.isar.dpath = i + 1;
modeisar(&cs->bcs[i], 0, 0); modeisar(&cs->bcs[i], 0, 0);
INIT_WORK(&cs->bcs[i].tqueue, (void *) (void *) isar_bh, NULL); INIT_WORK(&cs->bcs[i].work, isar_bh, &cs->bcs[i]);
} }
} }
......
...@@ -299,10 +299,10 @@ BChannel_proc_rcv(struct BCState *bcs) ...@@ -299,10 +299,10 @@ BChannel_proc_rcv(struct BCState *bcs)
} }
void void
BChannel_bh(struct BCState *bcs) BChannel_bh(void *data)
{ {
if (!bcs) struct BCState *bcs = data;
return;
if (test_and_clear_bit(B_RCVBUFREADY, &bcs->event)) if (test_and_clear_bit(B_RCVBUFREADY, &bcs->event))
BChannel_proc_rcv(bcs); BChannel_proc_rcv(bcs);
if (test_and_clear_bit(B_XMTBUFREADY, &bcs->event)) if (test_and_clear_bit(B_XMTBUFREADY, &bcs->event))
...@@ -345,7 +345,7 @@ init_bcstate(struct IsdnCardState *cs, ...@@ -345,7 +345,7 @@ init_bcstate(struct IsdnCardState *cs,
bcs->cs = cs; bcs->cs = cs;
bcs->channel = bc; bcs->channel = bc;
INIT_WORK(&bcs->tqueue, (void *) (void *) BChannel_bh, bcs); INIT_WORK(&bcs->work, BChannel_bh, bcs);
bcs->BC_SetStack = NULL; bcs->BC_SetStack = NULL;
bcs->BC_Close = NULL; bcs->BC_Close = NULL;
bcs->Flag = 0; bcs->Flag = 0;
......
...@@ -138,7 +138,7 @@ void ...@@ -138,7 +138,7 @@ void
jade_sched_event(struct BCState *bcs, int event) jade_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static void static void
......
...@@ -433,7 +433,7 @@ static void got_frame(struct BCState *bcs, int count) { ...@@ -433,7 +433,7 @@ static void got_frame(struct BCState *bcs, int count) {
skb_queue_tail(&bcs->rqueue, skb); skb_queue_tail(&bcs->rqueue, skb);
} }
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
if (bcs->cs->debug & L1_DEB_RECEIVE_FRAME) if (bcs->cs->debug & L1_DEB_RECEIVE_FRAME)
printframe(bcs->cs, bcs->hw.tiger.rcvbuf, count, "rec"); printframe(bcs->cs, bcs->hw.tiger.rcvbuf, count, "rec");
...@@ -789,7 +789,7 @@ static void write_raw(struct BCState *bcs, u_int *buf, int cnt) { ...@@ -789,7 +789,7 @@ static void write_raw(struct BCState *bcs, u_int *buf, int cnt) {
cnt - s_cnt); cnt - s_cnt);
} }
bcs->event |= 1 << B_XMTBUFREADY; bcs->event |= 1 << B_XMTBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} }
} else if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) { } else if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) {
......
...@@ -104,8 +104,9 @@ W6692_new_ph(struct IsdnCardState *cs) ...@@ -104,8 +104,9 @@ W6692_new_ph(struct IsdnCardState *cs)
} }
static void static void
W6692_bh(struct IsdnCardState *cs) W6692_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *stptr; struct PStack *stptr;
if (!cs) if (!cs)
...@@ -137,14 +138,14 @@ void ...@@ -137,14 +138,14 @@ void
W6692_sched_event(struct IsdnCardState *cs, int event) W6692_sched_event(struct IsdnCardState *cs, int event)
{ {
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
static void static void
W6692B_sched_event(struct BCState *bcs, int event) W6692B_sched_event(struct BCState *bcs, int event)
{ {
bcs->event |= 1 << event; bcs->event |= 1 << event;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
static void static void
...@@ -883,7 +884,7 @@ void resetW6692(struct IsdnCardState *cs) ...@@ -883,7 +884,7 @@ void resetW6692(struct IsdnCardState *cs)
void __init initW6692(struct IsdnCardState *cs, int part) void __init initW6692(struct IsdnCardState *cs, int part)
{ {
if (part & 1) { if (part & 1) {
INIT_WORK(&cs->tqueue, (void *) (void *) W6692_bh, NULL); INIT_WORK(&cs->work, W6692_bh, cs);
cs->setstack_d = setstack_W6692; cs->setstack_d = setstack_W6692;
cs->DC_Close = DC_Close_W6692; cs->DC_Close = DC_Close_W6692;
cs->dbusytimer.function = (void *) dbusy_timer_handler; cs->dbusytimer.function = (void *) dbusy_timer_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment