diff options
Diffstat (limited to 'drivers/isdn')
32 files changed, 190 insertions, 165 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 2da3ff650e1d..20d0a080a2b0 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c @@ -89,6 +89,7 @@ static int start_cbsend(struct cardstate *); struct bas_cardstate { struct usb_device *udev; /* USB device pointer */ + struct cardstate *cs; struct usb_interface *interface; /* interface for this device */ unsigned char minor; /* starting minor number */ @@ -433,10 +434,10 @@ static void check_pending(struct bas_cardstate *ucs) * argument: * controller state structure */ -static void cmd_in_timeout(unsigned long data) +static void cmd_in_timeout(struct timer_list *t) { - struct cardstate *cs = (struct cardstate *) data; - struct bas_cardstate *ucs = cs->hw.bas; + struct bas_cardstate *ucs = from_timer(ucs, t, timer_cmd_in); + struct cardstate *cs = ucs->cs; int rc; if (!ucs->rcvbuf_size) { @@ -639,10 +640,10 @@ static void int_in_work(struct work_struct *work) * argument: * controller state structure */ -static void int_in_resubmit(unsigned long data) +static void int_in_resubmit(struct timer_list *t) { - struct cardstate *cs = (struct cardstate *) data; - struct bas_cardstate *ucs = cs->hw.bas; + struct bas_cardstate *ucs = from_timer(ucs, t, timer_int_in); + struct cardstate *cs = ucs->cs; int rc; if (ucs->retry_int_in++ >= BAS_RETRY) { @@ -1441,10 +1442,10 @@ error: * argument: * controller state structure */ -static void req_timeout(unsigned long data) +static void req_timeout(struct timer_list *t) { - struct cardstate *cs = (struct cardstate *) data; - struct bas_cardstate *ucs = cs->hw.bas; + struct bas_cardstate *ucs = from_timer(ucs, t, timer_ctrl); + struct cardstate *cs = ucs->cs; int pending; unsigned long flags; @@ -1837,10 +1838,10 @@ static void write_command_callback(struct urb *urb) * argument: * controller state structure */ -static void atrdy_timeout(unsigned long data) +static void atrdy_timeout(struct timer_list *t) { - struct cardstate *cs = (struct cardstate *) data; - struct bas_cardstate *ucs = cs->hw.bas; + struct bas_cardstate *ucs = from_timer(ucs, t, timer_atrdy); + struct cardstate *cs = ucs->cs; dev_warn(cs->dev, "timeout waiting for HD_READY_SEND_ATDATA\n"); @@ -2200,7 +2201,7 @@ static int gigaset_initcshw(struct cardstate *cs) { struct bas_cardstate *ucs; - cs->hw.bas = ucs = kmalloc(sizeof *ucs, GFP_KERNEL); + cs->hw.bas = ucs = kzalloc(sizeof(*ucs), GFP_KERNEL); if (!ucs) { pr_err("out of memory\n"); return -ENOMEM; @@ -2212,19 +2213,12 @@ static int gigaset_initcshw(struct cardstate *cs) return -ENOMEM; } - ucs->urb_cmd_in = NULL; - ucs->urb_cmd_out = NULL; - ucs->rcvbuf = NULL; - ucs->rcvbuf_size = 0; - spin_lock_init(&ucs->lock); - ucs->pending = 0; - - ucs->basstate = 0; - setup_timer(&ucs->timer_ctrl, req_timeout, (unsigned long) cs); - setup_timer(&ucs->timer_atrdy, atrdy_timeout, (unsigned long) cs); - setup_timer(&ucs->timer_cmd_in, cmd_in_timeout, (unsigned long) cs); - setup_timer(&ucs->timer_int_in, int_in_resubmit, (unsigned long) cs); + ucs->cs = cs; + timer_setup(&ucs->timer_ctrl, req_timeout, 0); + timer_setup(&ucs->timer_atrdy, atrdy_timeout, 0); + timer_setup(&ucs->timer_cmd_in, cmd_in_timeout, 0); + timer_setup(&ucs->timer_int_in, int_in_resubmit, 0); init_waitqueue_head(&ucs->waitqueue); INIT_WORK(&ucs->int_in_wq, int_in_work); diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 7c7814497e3e..15482c5de33c 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c @@ -153,9 +153,9 @@ static int test_timeout(struct at_state_t *at_state) return 1; } -static void timer_tick(unsigned long data) +static void timer_tick(struct timer_list *t) { - struct cardstate *cs = (struct cardstate *) data; + struct cardstate *cs = from_timer(cs, t, timer); unsigned long flags; unsigned channel; struct at_state_t *at_state; @@ -687,7 +687,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, cs->ignoreframes = ignoreframes; INIT_LIST_HEAD(&cs->temp_at_states); cs->running = 0; - init_timer(&cs->timer); /* clear next & prev */ + timer_setup(&cs->timer, timer_tick, 0); spin_lock_init(&cs->ev_lock); cs->ev_tail = 0; cs->ev_head = 0; @@ -768,7 +768,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, spin_lock_irqsave(&cs->lock, flags); cs->running = 1; spin_unlock_irqrestore(&cs->lock, flags); - setup_timer(&cs->timer, timer_tick, (unsigned long) cs); cs->timer.expires = jiffies + msecs_to_jiffies(GIG_TICK); add_timer(&cs->timer); diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c index eadd1ed1e014..def7992a38e6 100644 --- a/drivers/isdn/hardware/eicon/message.c +++ b/drivers/isdn/hardware/eicon/message.c @@ -4501,6 +4501,7 @@ static void control_rc(PLCI *plci, byte req, byte rc, byte ch, byte global_req, plci->channels++; a->ncci_state[ncci] = OUTG_CON_PENDING; } + /* fall through */ default: if (plci->internal_command_queue[0]) @@ -7020,6 +7021,7 @@ static void nl_ind(PLCI *plci) plci->NL.RNum = 1; return; } + /* fall through */ case N_BDATA: case N_DATA: if (((a->ncci_state[ncci] != CONNECTED) && (plci->B2_prot == 1)) /* transparent */ @@ -9626,9 +9628,9 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) { case DTMF_LISTEN_TONE_START: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_LISTEN_MF_START: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_LISTEN_START: switch (internal_command) @@ -9636,6 +9638,7 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) default: adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | B1_FACILITY_DTMFR), DTMF_COMMAND_1); + /* fall through */ case DTMF_COMMAND_1: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -9646,6 +9649,7 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) } if (plci->internal_command) return; + /* fall through */ case DTMF_COMMAND_2: if (plci_nl_busy(plci)) { @@ -9673,9 +9677,9 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) case DTMF_LISTEN_TONE_STOP: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_LISTEN_MF_STOP: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_LISTEN_STOP: switch (internal_command) @@ -9710,6 +9714,7 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) */ adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & ~(B1_FACILITY_DTMFX | B1_FACILITY_DTMFR)), DTMF_COMMAND_3); + /* fall through */ case DTMF_COMMAND_3: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -9726,9 +9731,9 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) case DTMF_SEND_TONE: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_SEND_MF: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_DIGITS_SEND: switch (internal_command) @@ -9737,6 +9742,7 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | ((plci->dtmf_parameter_length != 0) ? B1_FACILITY_DTMFX | B1_FACILITY_DTMFR : B1_FACILITY_DTMFX)), DTMF_COMMAND_1); + /* fall through */ case DTMF_COMMAND_1: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -9747,6 +9753,7 @@ static void dtmf_command(dword Id, PLCI *plci, byte Rc) } if (plci->internal_command) return; + /* fall through */ case DTMF_COMMAND_2: if (plci_nl_busy(plci)) { @@ -9863,7 +9870,7 @@ static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci case DTMF_LISTEN_TONE_START: case DTMF_LISTEN_TONE_STOP: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_LISTEN_MF_START: case DTMF_LISTEN_MF_STOP: mask <<= 1; @@ -9875,6 +9882,7 @@ static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci PUT_WORD(&result[1], DTMF_UNKNOWN_REQUEST); break; } + /* fall through */ case DTMF_LISTEN_START: case DTMF_LISTEN_STOP: @@ -9904,7 +9912,7 @@ static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci case DTMF_SEND_TONE: - mask <<= 1; + mask <<= 1; /* fall through */ case DTMF_SEND_MF: mask <<= 1; if (!((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_table[appl->Id - 1]) @@ -9915,6 +9923,7 @@ static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci PUT_WORD(&result[1], DTMF_UNKNOWN_REQUEST); break; } + /* fall through */ case DTMF_DIGITS_SEND: if (api_parse(&msg[1].info[1], msg[1].length, "wwws", dtmf_parms)) @@ -11315,6 +11324,7 @@ static word mixer_restore_config(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_5; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_MIXER_2: case ADJUST_B_RESTORE_MIXER_3: case ADJUST_B_RESTORE_MIXER_4: @@ -11344,10 +11354,12 @@ static word mixer_restore_config(dword Id, PLCI *plci, byte Rc) plci->internal_command = plci->adjust_b_command; break; } + /* fall through */ case ADJUST_B_RESTORE_MIXER_5: xconnect_write_coefs(plci, plci->adjust_b_command); plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_6; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_MIXER_6: if (!xconnect_write_coefs_process(Id, plci, Rc)) { @@ -11392,6 +11404,7 @@ static void mixer_command(dword Id, PLCI *plci, byte Rc) adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | B1_FACILITY_MIXER), MIXER_COMMAND_1); } + /* fall through */ case MIXER_COMMAND_1: if (plci->li_channel_bits & LI_CHANNEL_INVOLVED) { @@ -11419,6 +11432,7 @@ static void mixer_command(dword Id, PLCI *plci, byte Rc) mixer_indication_coefs_set(Id, plci); } while (plci->li_plci_b_read_pos != plci->li_plci_b_req_pos); } + /* fall through */ case MIXER_COMMAND_2: if ((plci->li_channel_bits & LI_CHANNEL_INVOLVED) || ((get_b1_facilities(plci, plci->B1_resource) & B1_FACILITY_MIXER) @@ -11450,6 +11464,7 @@ static void mixer_command(dword Id, PLCI *plci, byte Rc) adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & ~B1_FACILITY_MIXER), MIXER_COMMAND_3); } + /* fall through */ case MIXER_COMMAND_3: if (!(plci->li_channel_bits & LI_CHANNEL_INVOLVED)) { @@ -12602,6 +12617,7 @@ static void ec_command(dword Id, PLCI *plci, byte Rc) default: adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | B1_FACILITY_EC), EC_COMMAND_1); + /* fall through */ case EC_COMMAND_1: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -12612,6 +12628,7 @@ static void ec_command(dword Id, PLCI *plci, byte Rc) } if (plci->internal_command) return; + /* fall through */ case EC_COMMAND_2: if (plci->sig_req) { @@ -12650,6 +12667,7 @@ static void ec_command(dword Id, PLCI *plci, byte Rc) return; } Rc = OK; + /* fall through */ case EC_COMMAND_2: if ((Rc != OK) && (Rc != OK_FC)) { @@ -12660,6 +12678,7 @@ static void ec_command(dword Id, PLCI *plci, byte Rc) } adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & ~B1_FACILITY_EC), EC_COMMAND_3); + /* fall through */ case EC_COMMAND_3: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -13485,6 +13504,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SAVE_MIXER_1; Rc = OK; + /* fall through */ case ADJUST_B_SAVE_MIXER_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) { @@ -13496,6 +13516,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SAVE_DTMF_1; Rc = OK; + /* fall through */ case ADJUST_B_SAVE_DTMF_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) { @@ -13506,6 +13527,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_REMOVE_L23_1; + /* fall through */ case ADJUST_B_REMOVE_L23_1: if ((plci->adjust_b_mode & ADJUST_B_MODE_REMOVE_L23) && plci->NL.Id && !plci->nl_remove_id) @@ -13530,6 +13552,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_REMOVE_L23_2; Rc = OK; + /* fall through */ case ADJUST_B_REMOVE_L23_2: if ((Rc != OK) && (Rc != OK_FC)) { @@ -13548,6 +13571,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SAVE_EC_1; Rc = OK; + /* fall through */ case ADJUST_B_SAVE_EC_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) { @@ -13559,6 +13583,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SAVE_DTMF_PARAMETER_1; Rc = OK; + /* fall through */ case ADJUST_B_SAVE_DTMF_PARAMETER_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) { @@ -13570,6 +13595,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SAVE_VOICE_1; Rc = OK; + /* fall through */ case ADJUST_B_SAVE_VOICE_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) { @@ -13578,6 +13604,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) break; } plci->adjust_b_state = ADJUST_B_SWITCH_L1_1; + /* fall through */ case ADJUST_B_SWITCH_L1_1: if (plci->adjust_b_mode & ADJUST_B_MODE_SWITCH_L1) { @@ -13608,6 +13635,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_SWITCH_L1_2; Rc = OK; + /* fall through */ case ADJUST_B_SWITCH_L1_2: if ((Rc != OK) && (Rc != OK_FC)) { @@ -13619,6 +13647,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_VOICE_1; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_VOICE_1: case ADJUST_B_RESTORE_VOICE_2: if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) @@ -13629,6 +13658,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_PARAMETER_1; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_DTMF_PARAMETER_1: case ADJUST_B_RESTORE_DTMF_PARAMETER_2: if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) @@ -13641,6 +13671,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_EC_1; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_EC_1: case ADJUST_B_RESTORE_EC_2: if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) @@ -13652,6 +13683,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_ASSIGN_L23_1; + /* fall through */ case ADJUST_B_ASSIGN_L23_1: if (plci->adjust_b_mode & ADJUST_B_MODE_ASSIGN_L23) { @@ -13681,6 +13713,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_ASSIGN_L23_2; Rc = ASSIGN_OK; + /* fall through */ case ADJUST_B_ASSIGN_L23_2: if ((Rc != OK) && (Rc != OK_FC) && (Rc != ASSIGN_OK)) { @@ -13703,6 +13736,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) break; } plci->adjust_b_state = ADJUST_B_CONNECT_1; + /* fall through */ case ADJUST_B_CONNECT_1: if (plci->adjust_b_mode & ADJUST_B_MODE_CONNECT) { @@ -13716,6 +13750,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_1; Rc = OK; + /* fall through */ case ADJUST_B_CONNECT_2: case ADJUST_B_CONNECT_3: case ADJUST_B_CONNECT_4: @@ -13751,6 +13786,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) break; } Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_DTMF_1: case ADJUST_B_RESTORE_DTMF_2: if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) @@ -13763,6 +13799,7 @@ static word adjust_b_process(dword Id, PLCI *plci, byte Rc) } plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_1; Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_MIXER_1: case ADJUST_B_RESTORE_MIXER_2: case ADJUST_B_RESTORE_MIXER_3: @@ -13827,6 +13864,7 @@ static void adjust_b_restore(dword Id, PLCI *plci, byte Rc) break; } Rc = OK; + /* fall through */ case ADJUST_B_RESTORE_1: if ((Rc != OK) && (Rc != OK_FC)) { @@ -13841,6 +13879,7 @@ static void adjust_b_restore(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: Adjust B restore...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case ADJUST_B_RESTORE_2: if (adjust_b_process(Id, plci, Rc) != GOOD) { @@ -13877,6 +13916,7 @@ static void reset_b3_command(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: Reset B3...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case RESET_B3_COMMAND_1: Info = adjust_b_process(Id, plci, Rc); if (Info != GOOD) @@ -13930,6 +13970,7 @@ static void select_b_command(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: Select B protocol...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case SELECT_B_COMMAND_1: Info = adjust_b_process(Id, plci, Rc); if (Info != GOOD) @@ -13965,7 +14006,7 @@ static void fax_connect_ack_command(dword Id, PLCI *plci, byte Rc) switch (internal_command) { default: - plci->command = 0; + plci->command = 0; /* fall through */ case FAX_CONNECT_ACK_COMMAND_1: if (plci_nl_busy(plci)) { @@ -14013,6 +14054,7 @@ static void fax_edata_ack_command(dword Id, PLCI *plci, byte Rc) { default: plci->command = 0; + /* fall through */ case FAX_EDATA_ACK_COMMAND_1: if (plci_nl_busy(plci)) { @@ -14052,7 +14094,7 @@ static void fax_connect_info_command(dword Id, PLCI *plci, byte Rc) switch (internal_command) { default: - plci->command = 0; + plci->command = 0; /* fall through */ case FAX_CONNECT_INFO_COMMAND_1: if (plci_nl_busy(plci)) { @@ -14112,6 +14154,7 @@ static void fax_adjust_b23_command(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: FAX adjust B23...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case FAX_ADJUST_B23_COMMAND_1: Info = adjust_b_process(Id, plci, Rc); if (Info != GOOD) @@ -14122,6 +14165,7 @@ static void fax_adjust_b23_command(dword Id, PLCI *plci, byte Rc) } if (plci->internal_command) return; + /* fall through */ case FAX_ADJUST_B23_COMMAND_2: if (plci_nl_busy(plci)) { @@ -14194,7 +14238,7 @@ static void rtp_connect_b3_req_command(dword Id, PLCI *plci, byte Rc) switch (internal_command) { default: - plci->command = 0; + plci->command = 0; /* fall through */ case RTP_CONNECT_B3_REQ_COMMAND_1: if (plci_nl_busy(plci)) { @@ -14245,7 +14289,7 @@ static void rtp_connect_b3_res_command(dword Id, PLCI *plci, byte Rc) switch (internal_command) { default: - plci->command = 0; + plci->command = 0; /* fall through */ case RTP_CONNECT_B3_RES_COMMAND_1: if (plci_nl_busy(plci)) { @@ -14310,6 +14354,7 @@ static void hold_save_command(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: HOLD save...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case HOLD_SAVE_COMMAND_1: Info = adjust_b_process(Id, plci, Rc); if (Info != GOOD) @@ -14349,6 +14394,7 @@ static void retrieve_restore_command(dword Id, PLCI *plci, byte Rc) plci->adjust_b_state = ADJUST_B_START; dbug(1, dprintf("[%06lx] %s,%d: RETRIEVE restore...", UnMapId(Id), (char *)(FILE_), __LINE__)); + /* fall through */ case RETRIEVE_RESTORE_COMMAND_1: Info = adjust_b_process(Id, plci, Rc); if (Info != GOOD) diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index d2e401a8090e..e4ebbee863a1 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -2265,7 +2265,7 @@ static struct pci_driver hfc_driver = { }; static int -_hfcpci_softirq(struct device *dev, void *arg) +_hfcpci_softirq(struct device *dev, void *unused) { struct hfc_pci *hc = dev_get_drvdata(dev); struct bchannel *bch; @@ -2290,9 +2290,9 @@ _hfcpci_softirq(struct device *dev, void *arg) } static void -hfcpci_softirq(void *arg) +hfcpci_softirq(struct timer_list *unused) { - WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, arg, + WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, NULL, _hfcpci_softirq) != 0); /* if next event would be in the past ... */ @@ -2327,9 +2327,7 @@ HFC_init(void) if (poll != HFCPCI_BTRANS_THRESHOLD) { printk(KERN_INFO "%s: Using alternative poll value of %d\n", __func__, poll); - hfc_tl.function = (void *)hfcpci_softirq; - hfc_tl.data = 0; - init_timer(&hfc_tl); + timer_setup(&hfc_tl, hfcpci_softirq, 0); hfc_tl.expires = jiffies + tics; hfc_jiffies = hfc_tl.expires; add_timer(&hfc_tl); diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index e240010b93fa..4d78f870435e 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -172,7 +172,6 @@ isac_fill_fifo(struct isac_hw *isac) pr_debug("%s: %s dbusytimer running\n", isac->name, __func__); del_timer(&isac->dch.timer); } - init_timer(&isac->dch.timer); isac->dch.timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000); add_timer(&isac->dch.timer); if (isac->dch.debug & DEBUG_HW_DFIFO) { @@ -727,8 +726,9 @@ isac_release(struct isac_hw *isac) } static void -dbusy_timer_handler(struct isac_hw *isac) +dbusy_timer_handler(struct timer_list *t) { + struct isac_hw *isac = from_timer(isac, t, dch.timer); int rbch, star; u_long flags; @@ -796,8 +796,7 @@ isac_init(struct isac_hw *isac) } isac->mon_tx = NULL; isac->mon_rx = NULL; - setup_timer(&isac->dch.timer, (void *)dbusy_timer_handler, - (long)isac); + timer_setup(&isac->dch.timer, dbusy_timer_handler, 0); isac->mocr = 0xaa; if (isac->type & IPAC_TYPE_ISACX) { /* Disable all IRQ */ diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index d80072fef434..536d5137f49d 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -311,7 +311,6 @@ W6692_fill_Dfifo(struct w6692_hw *card) pr_debug("%s: fill_Dfifo dbusytimer running\n", card->name); del_timer(&dch->timer); } - init_timer(&dch->timer); dch->timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000); add_timer(&dch->timer); if (debug & DEBUG_HW_DFIFO) { @@ -819,8 +818,9 @@ w6692_irq(int intno, void *dev_id) } static void -dbusy_timer_handler(struct dchannel *dch) +dbusy_timer_handler(struct timer_list *t) { + struct dchannel *dch = from_timer(dch, t, timer); struct w6692_hw *card = dch->hw; int rbch, star; u_long flags; @@ -852,8 +852,7 @@ static void initW6692(struct w6692_hw *card) { u8 val; - setup_timer(&card->dch.timer, (void *)dbusy_timer_handler, - (u_long)&card->dch); + timer_setup(&card->dch.timer, dbusy_timer_handler, 0); w6692_mode(&card->bc[0], ISDN_P_NONE); w6692_mode(&card->bc[1], ISDN_P_NONE); WriteW6692(card, W_D_CTL, 0x00); diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index dcf4c2a9fcea..77debda2221b 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c @@ -398,7 +398,6 @@ Amd7930_fill_Dfifo(struct IsdnCardState *cs) debugl1(cs, "Amd7930: fill_Dfifo dbusytimer running"); del_timer(&cs->dbusytimer); } - init_timer(&cs->dbusytimer); cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000); add_timer(&cs->dbusytimer); @@ -686,8 +685,9 @@ DC_Close_Amd7930(struct IsdnCardState *cs) { static void -dbusy_timer_handler(struct IsdnCardState *cs) +dbusy_timer_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dbusytimer); u_long flags; struct PStack *stptr; WORD dtcr, der; @@ -790,5 +790,5 @@ void Amd7930_init(struct IsdnCardState *cs) void setup_Amd7930(struct IsdnCardState *cs) { INIT_WORK(&cs->tqueue, Amd7930_bh); - setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs); + timer_setup(&cs->dbusytimer, dbusy_timer_handler, 0); } diff --git a/drivers/isdn/hisax/arcofi.c b/drivers/isdn/hisax/arcofi.c index 9826bad49e2c..2f784f96d439 100644 --- a/drivers/isdn/hisax/arcofi.c +++ b/drivers/isdn/hisax/arcofi.c @@ -23,7 +23,6 @@ add_arcofi_timer(struct IsdnCardState *cs) { if (test_and_set_bit(FLG_ARCOFI_TIMER, &cs->HW_Flags)) { del_timer(&cs->dc.isac.arcofitimer); } - init_timer(&cs->dc.isac.arcofitimer); cs->dc.isac.arcofitimer.expires = jiffies + ((ARCOFI_TIMER_VALUE * HZ) / 1000); add_timer(&cs->dc.isac.arcofitimer); } @@ -112,7 +111,8 @@ arcofi_fsm(struct IsdnCardState *cs, int event, void *data) { } static void -arcofi_timer(struct IsdnCardState *cs) { +arcofi_timer(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dc.isac.arcofitimer); arcofi_fsm(cs, ARCOFI_TIMEOUT, NULL); } @@ -125,7 +125,7 @@ clear_arcofi(struct IsdnCardState *cs) { void init_arcofi(struct IsdnCardState *cs) { - setup_timer(&cs->dc.isac.arcofitimer, (void *)arcofi_timer, (long)cs); + timer_setup(&cs->dc.isac.arcofitimer, arcofi_timer, 0); init_waitqueue_head(&cs->dc.isac.arcofi_wait); test_and_set_bit(HW_ARCOFI, &cs->HW_Flags); } diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 3fc94e7741ae..38bdd3f7b960 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -798,8 +798,9 @@ reset_diva(struct IsdnCardState *cs) #define DIVA_ASSIGN 1 static void -diva_led_handler(struct IsdnCardState *cs) +diva_led_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.diva.tl); int blink = 0; if ((cs->subtyp == DIVA_IPAC_ISA) || @@ -828,7 +829,6 @@ diva_led_handler(struct IsdnCardState *cs) byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg); if (blink) { - init_timer(&cs->hw.diva.tl); cs->hw.diva.tl.expires = jiffies + ((blink * HZ) / 1000); add_timer(&cs->hw.diva.tl); } @@ -900,7 +900,7 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg) (cs->subtyp != DIVA_IPAC_PCI) && (cs->subtyp != DIVA_IPACX_PCI)) { spin_lock_irqsave(&cs->lock, flags); - diva_led_handler(cs); + diva_led_handler(&cs->hw.diva.tl); spin_unlock_irqrestore(&cs->lock, flags); } return (0); @@ -978,8 +978,7 @@ static int setup_diva_common(struct IsdnCardState *cs) printk(KERN_INFO "Diva: IPACX Design Id: %x\n", MemReadISAC_IPACX(cs, IPACX_ID) & 0x3F); } else { /* DIVA 2.0 */ - setup_timer(&cs->hw.diva.tl, (void *)diva_led_handler, - (long)cs); + timer_setup(&cs->hw.diva.tl, diva_led_handler, 0); cs->readisac = &ReadISAC; cs->writeisac = &WriteISAC; cs->readisacfifo = &ReadISACfifo; diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 03bc5d504e22..b21c05820f44 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -606,8 +606,9 @@ check_arcofi(struct IsdnCardState *cs) #endif /* ARCOFI_USE */ static void -elsa_led_handler(struct IsdnCardState *cs) +elsa_led_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.elsa.tl); int blink = 0; if (cs->subtyp == ELSA_PCMCIA || cs->subtyp == ELSA_PCMCIA_IPAC) @@ -640,7 +641,6 @@ elsa_led_handler(struct IsdnCardState *cs) } else byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); if (blink) { - init_timer(&cs->hw.elsa.tl); cs->hw.elsa.tl.expires = jiffies + ((blink * HZ) / 1000); add_timer(&cs->hw.elsa.tl); } @@ -715,7 +715,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) init_modem(cs); } #endif - elsa_led_handler(cs); + elsa_led_handler(&cs->hw.elsa.tl); return (ret); case (MDL_REMOVE | REQUEST): cs->hw.elsa.status &= 0; @@ -767,7 +767,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) else cs->hw.elsa.status &= ~ELSA_BAD_PWR; } - elsa_led_handler(cs); + elsa_led_handler(&cs->hw.elsa.tl); return (ret); } @@ -1147,7 +1147,7 @@ static int setup_elsa_common(struct IsdnCard *card) init_arcofi(cs); #endif setup_isac(cs); - setup_timer(&cs->hw.elsa.tl, (void *)elsa_led_handler, (long)cs); + timer_setup(&cs->hw.elsa.tl, elsa_led_handler, 0); /* Teste Timer */ if (cs->hw.elsa.timer) { byteout(cs->hw.elsa.trig, 0xff); diff --git a/drivers/isdn/hisax/fsm.c b/drivers/isdn/hisax/fsm.c index d63266fa8cbd..3e020ec0f65e 100644 --- a/drivers/isdn/hisax/fsm.c +++ b/drivers/isdn/hisax/fsm.c @@ -85,8 +85,9 @@ FsmChangeState(struct FsmInst *fi, int newstate) } static void -FsmExpireTimer(struct FsmTimer *ft) +FsmExpireTimer(struct timer_list *t) { + struct FsmTimer *ft = from_timer(ft, t, tl); #if FSM_TIMER_DEBUG if (ft->fi->debug) ft->fi->printdebug(ft->fi, "FsmExpireTimer %lx", (long) ft); @@ -102,7 +103,7 @@ FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft) if (ft->fi->debug) ft->fi->printdebug(ft->fi, "FsmInitTimer %lx", (long) ft); #endif - setup_timer(&ft->tl, (void *)FsmExpireTimer, (long)ft); + timer_setup(&ft->tl, FsmExpireTimer, 0); } void @@ -131,7 +132,6 @@ FsmAddTimer(struct FsmTimer *ft, ft->fi->printdebug(ft->fi, "FsmAddTimer already active!"); return -1; } - init_timer(&ft->tl); ft->event = event; ft->arg = arg; ft->tl.expires = jiffies + (millisec * HZ) / 1000; @@ -152,7 +152,6 @@ FsmRestartTimer(struct FsmTimer *ft, if (timer_pending(&ft->tl)) del_timer(&ft->tl); - init_timer(&ft->tl); ft->event = event; ft->arg = arg; ft->tl.expires = jiffies + (millisec * HZ) / 1000; diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index 9090cc1e1f29..e9bb8fb67ad0 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c @@ -591,8 +591,9 @@ bch_l2l1(struct hisax_if *ifc, int pr, void *arg) /* layer 1 timer function */ /**************************/ static void -hfc_l1_timer(struct hfc4s8s_l1 *l1) +hfc_l1_timer(struct timer_list *t) { + struct hfc4s8s_l1 *l1 = from_timer(l1, t, l1_timer); u_long flags; if (!l1->enabled) @@ -1396,8 +1397,7 @@ setup_instance(hfc4s8s_hw *hw) l1p = hw->l1 + i; spin_lock_init(&l1p->lock); l1p->hw = hw; - setup_timer(&l1p->l1_timer, (void *)hfc_l1_timer, - (long)(l1p)); + timer_setup(&l1p->l1_timer, hfc_l1_timer, 0); l1p->st_num = i; skb_queue_head_init(&l1p->d_tx_queue); l1p->d_if.ifc.priv = hw->l1 + i; diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index ad8597a1a07e..86b82172e992 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c @@ -1014,7 +1014,7 @@ setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) } static void -hfc_dbusy_timer(struct IsdnCardState *cs) +hfc_dbusy_timer(struct timer_list *t) { } @@ -1073,6 +1073,6 @@ set_cs_func(struct IsdnCardState *cs) cs->writeisacfifo = &dummyf; cs->BC_Read_Reg = &ReadReg; cs->BC_Write_Reg = &WriteReg; - setup_timer(&cs->dbusytimer, (void *)hfc_dbusy_timer, (long)cs); + timer_setup(&cs->dbusytimer, hfc_dbusy_timer, 0); INIT_WORK(&cs->tqueue, hfcd_bh); } diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index f9ca35cc32b1..8e5b03161b2f 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -165,8 +165,9 @@ reset_hfcpci(struct IsdnCardState *cs) /* Timer function called when kernel timer expires */ /***************************************************/ static void -hfcpci_Timer(struct IsdnCardState *cs) +hfcpci_Timer(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.hfcpci.timer); cs->hw.hfcpci.timer.expires = jiffies + 75; /* WD RESET */ /* WriteReg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcpci.ctmt | 0x80); @@ -1095,7 +1096,7 @@ hfcpci_interrupt(int intno, void *dev_id) /* timer callback for D-chan busy resolution. Currently no function */ /********************************************************************/ static void -hfcpci_dbusy_timer(struct IsdnCardState *cs) +hfcpci_dbusy_timer(struct timer_list *t) { } @@ -1582,7 +1583,7 @@ inithfcpci(struct IsdnCardState *cs) cs->bcs[1].BC_SetStack = setstack_2b; cs->bcs[0].BC_Close = close_hfcpci; cs->bcs[1].BC_Close = close_hfcpci; - setup_timer(&cs->dbusytimer, (void *)hfcpci_dbusy_timer, (long)cs); + timer_setup(&cs->dbusytimer, hfcpci_dbusy_timer, 0); mode_hfcpci(cs->bcs, 0, 0); mode_hfcpci(cs->bcs + 1, 0, 1); } @@ -1744,7 +1745,7 @@ setup_hfcpci(struct IsdnCard *card) cs->BC_Write_Reg = NULL; cs->irq_func = &hfcpci_interrupt; cs->irq_flags |= IRQF_SHARED; - setup_timer(&cs->hw.hfcpci.timer, (void *)hfcpci_Timer, (long)cs); + timer_setup(&cs->hw.hfcpci.timer, hfcpci_Timer, 0); cs->cardmsg = &hfcpci_card_msg; cs->auxcmd = &hfcpci_auxcmd; diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index 3aef8e1a90e4..d925f579bc80 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c @@ -418,8 +418,9 @@ reset_hfcsx(struct IsdnCardState *cs) /* Timer function called when kernel timer expires */ /***************************************************/ static void -hfcsx_Timer(struct IsdnCardState *cs) +hfcsx_Timer(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.hfcsx.timer); cs->hw.hfcsx.timer.expires = jiffies + 75; /* WD RESET */ /* WriteReg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcsx.ctmt | 0x80); @@ -860,7 +861,7 @@ hfcsx_interrupt(int intno, void *dev_id) /* timer callback for D-chan busy resolution. Currently no function */ /********************************************************************/ static void -hfcsx_dbusy_timer(struct IsdnCardState *cs) +hfcsx_dbusy_timer(struct timer_list *t) { } @@ -1495,7 +1496,7 @@ int setup_hfcsx(struct IsdnCard *card) } else return (0); /* no valid card type */ - setup_timer(&cs->dbusytimer, (void *)hfcsx_dbusy_timer, (long)cs); + timer_setup(&cs->dbusytimer, hfcsx_dbusy_timer, 0); INIT_WORK(&cs->tqueue, hfcsx_bh); cs->readisac = NULL; cs->writeisac = NULL; @@ -1507,7 +1508,7 @@ int setup_hfcsx(struct IsdnCard *card) cs->hw.hfcsx.b_fifo_size = 0; /* fifo size still unknown */ cs->hw.hfcsx.cirm = ccd_sp_irqtab[cs->irq & 0xF]; /* RAM not evaluated */ - setup_timer(&cs->hw.hfcsx.timer, (void *)hfcsx_Timer, (long)cs); + timer_setup(&cs->hw.hfcsx.timer, hfcsx_Timer, 0); reset_hfcsx(cs); cs->cardmsg = &hfcsx_card_msg; diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index e8212185d386..97ecb3073045 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -343,8 +343,9 @@ handle_led(hfcusb_data *hfc, int event) /* ISDN l1 timer T3 expires */ static void -l1_timer_expire_t3(hfcusb_data *hfc) +l1_timer_expire_t3(struct timer_list *t) { + hfcusb_data *hfc = from_timer(hfc, t, t3_timer); hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, NULL); @@ -360,8 +361,9 @@ l1_timer_expire_t3(hfcusb_data *hfc) /* ISDN l1 timer T4 expires */ static void -l1_timer_expire_t4(hfcusb_data *hfc) +l1_timer_expire_t4(struct timer_list *t) { + hfcusb_data *hfc = from_timer(hfc, t, t4_timer); hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, NULL); @@ -1165,10 +1167,10 @@ hfc_usb_init(hfcusb_data *hfc) hfc->old_led_state = 0; /* init the t3 timer */ - setup_timer(&hfc->t3_timer, (void *)l1_timer_expire_t3, (long)hfc); + timer_setup(&hfc->t3_timer, l1_timer_expire_t3, 0); /* init the t4 timer */ - setup_timer(&hfc->t4_timer, (void *)l1_timer_expire_t4, (long)hfc); + timer_setup(&hfc->t4_timer, l1_timer_expire_t4, 0); /* init the background machinery for control requests */ hfc->ctrl_read.bRequestType = 0xc0; diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c index 467287096918..380bbeda9c74 100644 --- a/drivers/isdn/hisax/hfcscard.c +++ b/drivers/isdn/hisax/hfcscard.c @@ -41,8 +41,9 @@ hfcs_interrupt(int intno, void *dev_id) } static void -hfcs_Timer(struct IsdnCardState *cs) +hfcs_Timer(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.hfcD.timer); cs->hw.hfcD.timer.expires = jiffies + 75; /* WD RESET */ /* WriteReg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt | 0x80); @@ -253,7 +254,7 @@ int setup_hfcs(struct IsdnCard *card) outb(0x57, cs->hw.hfcD.addr | 1); } set_cs_func(cs); - setup_timer(&cs->hw.hfcD.timer, (void *)hfcs_Timer, (long)cs); + timer_setup(&cs->hw.hfcD.timer, hfcs_Timer, 0); cs->cardmsg = &hfcs_card_msg; cs->irq_func = &hfcs_interrupt; return (1); diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c index 8d1804572b32..831dd1bb81ef 100644 --- a/drivers/isdn/hisax/icc.c +++ b/drivers/isdn/hisax/icc.c @@ -168,7 +168,6 @@ icc_fill_fifo(struct IsdnCardState *cs) debugl1(cs, "icc_fill_fifo dbusytimer running"); del_timer(&cs->dbusytimer); } - init_timer(&cs->dbusytimer); cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000); add_timer(&cs->dbusytimer); if (cs->debug & L1_DEB_ISAC_FIFO) { @@ -580,8 +579,9 @@ DC_Close_icc(struct IsdnCardState *cs) { } static void -dbusy_timer_handler(struct IsdnCardState *cs) +dbusy_timer_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dbusytimer); struct PStack *stptr; int rbch, star; @@ -676,5 +676,5 @@ clear_pending_icc_ints(struct IsdnCardState *cs) void setup_icc(struct IsdnCardState *cs) { INIT_WORK(&cs->tqueue, icc_bh); - setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs); + timer_setup(&cs->dbusytimer, dbusy_timer_handler, 0); } diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c index c426b4fea28a..c7086c1534bd 100644 --- a/drivers/isdn/hisax/ipacx.c +++ b/drivers/isdn/hisax/ipacx.c @@ -35,7 +35,7 @@ static void ph_command(struct IsdnCardState *cs, unsigned int command); static inline void cic_int(struct IsdnCardState *cs); 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 timer_list *t); static void dch_empty_fifo(struct IsdnCardState *cs, int count); static void dch_fill_fifo(struct IsdnCardState *cs); static inline void dch_int(struct IsdnCardState *cs); @@ -198,8 +198,9 @@ dch_l2l1(struct PStack *st, int pr, void *arg) //---------------------------------------------------------- //---------------------------------------------------------- static void -dbusy_timer_handler(struct IsdnCardState *cs) +dbusy_timer_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dbusytimer); struct PStack *st; int rbchd, stard; @@ -298,7 +299,6 @@ dch_fill_fifo(struct IsdnCardState *cs) debugl1(cs, "dch_fill_fifo dbusytimer running"); del_timer(&cs->dbusytimer); } - init_timer(&cs->dbusytimer); cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000); add_timer(&cs->dbusytimer); @@ -424,7 +424,7 @@ dch_init(struct IsdnCardState *cs) cs->setstack_d = dch_setstack; - setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs); + timer_setup(&cs->dbusytimer, dbusy_timer_handler, 0); cs->writeisac(cs, IPACX_TR_CONF0, 0x00); // clear LDD cs->writeisac(cs, IPACX_TR_CONF2, 0x00); // enable transmitter diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c index ea965f29a555..bd40e0671ded 100644 --- a/drivers/isdn/hisax/isac.c +++ b/drivers/isdn/hisax/isac.c @@ -171,7 +171,6 @@ isac_fill_fifo(struct IsdnCardState *cs) debugl1(cs, "isac_fill_fifo dbusytimer running"); del_timer(&cs->dbusytimer); } - init_timer(&cs->dbusytimer); cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000); add_timer(&cs->dbusytimer); if (cs->debug & L1_DEB_ISAC_FIFO) { @@ -584,8 +583,9 @@ DC_Close_isac(struct IsdnCardState *cs) } static void -dbusy_timer_handler(struct IsdnCardState *cs) +dbusy_timer_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dbusytimer); struct PStack *stptr; int rbch, star; @@ -677,5 +677,5 @@ void clear_pending_isac_ints(struct IsdnCardState *cs) void setup_isac(struct IsdnCardState *cs) { INIT_WORK(&cs->tqueue, isac_bh); - setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, (long)cs); + timer_setup(&cs->dbusytimer, dbusy_timer_handler, 0); } diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 98b4b67ea337..d01ff116797b 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -1267,7 +1267,8 @@ isar_int_main(struct IsdnCardState *cs) } static void -ftimer_handler(struct BCState *bcs) { +ftimer_handler(struct timer_list *t) { + struct BCState *bcs = from_timer(bcs, t, hw.isar.ftimer); if (bcs->cs->debug) debugl1(bcs->cs, "ftimer flags %04lx", bcs->Flag); @@ -1902,8 +1903,6 @@ void initisar(struct IsdnCardState *cs) cs->bcs[1].BC_SetStack = setstack_isar; cs->bcs[0].BC_Close = close_isarstate; cs->bcs[1].BC_Close = close_isarstate; - setup_timer(&cs->bcs[0].hw.isar.ftimer, (void *)ftimer_handler, - (long)&cs->bcs[0]); - setup_timer(&cs->bcs[1].hw.isar.ftimer, (void *)ftimer_handler, - (long)&cs->bcs[1]); + timer_setup(&cs->bcs[0].hw.isar.ftimer, ftimer_handler, 0); + timer_setup(&cs->bcs[1].hw.isar.ftimer, ftimer_handler, 0); } diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c index 569ce52c567b..bb3f9ec62749 100644 --- a/drivers/isdn/hisax/isdnl3.c +++ b/drivers/isdn/hisax/isdnl3.c @@ -160,8 +160,9 @@ newl3state(struct l3_process *pc, int state) } static void -L3ExpireTimer(struct L3Timer *t) +L3ExpireTimer(struct timer_list *timer) { + struct L3Timer *t = from_timer(t, timer, tl); t->pc->st->lli.l4l3(t->pc->st, t->event, t->pc); } @@ -169,7 +170,7 @@ void L3InitTimer(struct l3_process *pc, struct L3Timer *t) { t->pc = pc; - setup_timer(&t->tl, (void *)L3ExpireTimer, (long)t); + timer_setup(&t->tl, L3ExpireTimer, 0); } void @@ -186,7 +187,6 @@ L3AddTimer(struct L3Timer *t, printk(KERN_WARNING "L3AddTimer: timer already active!\n"); return -1; } - init_timer(&t->tl); t->event = event; t->tl.expires = jiffies + (millisec * HZ) / 1000; add_timer(&t->tl); diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c index 6b2d0eccdd56..db906cb37a3f 100644 --- a/drivers/isdn/hisax/saphir.c +++ b/drivers/isdn/hisax/saphir.c @@ -159,8 +159,9 @@ Start_ISAC: } static void -SaphirWatchDog(struct IsdnCardState *cs) +SaphirWatchDog(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.saphir.timer); u_long flags; spin_lock_irqsave(&cs->lock, flags); @@ -268,9 +269,7 @@ int setup_saphir(struct IsdnCard *card) cs->irq, cs->hw.saphir.cfg_reg); setup_isac(cs); - cs->hw.saphir.timer.function = (void *) SaphirWatchDog; - cs->hw.saphir.timer.data = (long) cs; - init_timer(&cs->hw.saphir.timer); + timer_setup(&cs->hw.saphir.timer, SaphirWatchDog, 0); cs->hw.saphir.timer.expires = jiffies + 4 * HZ; add_timer(&cs->hw.saphir.timer); if (saphir_reset(cs)) { diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c index 950399f066ef..247aa33076b1 100644 --- a/drivers/isdn/hisax/teleint.c +++ b/drivers/isdn/hisax/teleint.c @@ -179,8 +179,9 @@ Start_ISAC: } static void -TeleInt_Timer(struct IsdnCardState *cs) +TeleInt_Timer(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, hw.hfc.timer); int stat = 0; u_long flags; @@ -278,7 +279,7 @@ int setup_TeleInt(struct IsdnCard *card) cs->bcs[0].hw.hfc.send = NULL; cs->bcs[1].hw.hfc.send = NULL; cs->hw.hfc.fifosize = 7 * 1024 + 512; - setup_timer(&cs->hw.hfc.timer, (void *)TeleInt_Timer, (long)cs); + timer_setup(&cs->hw.hfc.timer, TeleInt_Timer, 0); if (!request_region(cs->hw.hfc.addr, 2, "TeleInt isdn")) { printk(KERN_WARNING "HiSax: TeleInt config port %x-%x already in use\n", diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index 6f6733b7c1e4..c4be1644f5bb 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -188,7 +188,6 @@ W6692_fill_fifo(struct IsdnCardState *cs) debugl1(cs, "W6692_fill_fifo dbusytimer running"); del_timer(&cs->dbusytimer); } - init_timer(&cs->dbusytimer); cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000); add_timer(&cs->dbusytimer); if (cs->debug & L1_DEB_ISAC_FIFO) { @@ -684,8 +683,9 @@ DC_Close_W6692(struct IsdnCardState *cs) } static void -dbusy_timer_handler(struct IsdnCardState *cs) +dbusy_timer_handler(struct timer_list *t) { + struct IsdnCardState *cs = from_timer(cs, t, dbusytimer); struct PStack *stptr; int rbch, star; u_long flags; @@ -904,8 +904,7 @@ static void initW6692(struct IsdnCardState *cs, int part) if (part & 1) { cs->setstack_d = setstack_W6692; cs->DC_Close = DC_Close_W6692; - setup_timer(&cs->dbusytimer, (void *)dbusy_timer_handler, - (long)cs); + timer_setup(&cs->dbusytimer, dbusy_timer_handler, 0); resetW6692(cs); ph_command(cs, W_L1CMD_RST); cs->dc.w6692.ph_state = W_L1CMD_RST; diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index e97232646ba1..a4597e96c916 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -90,9 +90,9 @@ isdnloop_bchan_send(isdnloop_card *card, int ch) * data = pointer to card struct, set by kernel timer.data */ static void -isdnloop_pollbchan(unsigned long data) +isdnloop_pollbchan(struct timer_list *t) { - isdnloop_card *card = (isdnloop_card *) data; + isdnloop_card *card = from_timer(card, t, rb_timer); unsigned long flags; if (card->flags & ISDNLOOP_FLAGS_B1ACTIVE) @@ -305,9 +305,9 @@ isdnloop_putmsg(isdnloop_card *card, unsigned char c) * data = pointer to card struct */ static void -isdnloop_polldchan(unsigned long data) +isdnloop_polldchan(struct timer_list *t) { - isdnloop_card *card = (isdnloop_card *) data; + isdnloop_card *card = from_timer(card, t, st_timer); struct sk_buff *skb; int avail; int left; @@ -373,8 +373,6 @@ isdnloop_polldchan(unsigned long data) card->flags |= ISDNLOOP_FLAGS_RBTIMER; spin_lock_irqsave(&card->isdnloop_lock, flags); del_timer(&card->rb_timer); - card->rb_timer.function = isdnloop_pollbchan; - card->rb_timer.data = (unsigned long) card; card->rb_timer.expires = jiffies + ISDNLOOP_TIMER_BCREAD; add_timer(&card->rb_timer); spin_unlock_irqrestore(&card->isdnloop_lock, flags); @@ -588,9 +586,10 @@ isdnloop_atimeout(isdnloop_card *card, int ch) * Wrapper for isdnloop_atimeout(). */ static void -isdnloop_atimeout0(unsigned long data) +isdnloop_atimeout0(struct timer_list *t) { - isdnloop_card *card = (isdnloop_card *) data; + isdnloop_card *card = from_timer(card, t, c_timer[0]); + isdnloop_atimeout(card, 0); } @@ -598,9 +597,10 @@ isdnloop_atimeout0(unsigned long data) * Wrapper for isdnloop_atimeout(). */ static void -isdnloop_atimeout1(unsigned long data) +isdnloop_atimeout1(struct timer_list *t) { - isdnloop_card *card = (isdnloop_card *) data; + isdnloop_card *card = from_timer(card, t, c_timer[1]); + isdnloop_atimeout(card, 1); } @@ -617,13 +617,9 @@ isdnloop_start_ctimer(isdnloop_card *card, int ch) unsigned long flags; spin_lock_irqsave(&card->isdnloop_lock, flags); - init_timer(&card->c_timer[ch]); + timer_setup(&card->c_timer[ch], ch ? isdnloop_atimeout1 + : isdnloop_atimeout0, 0); card->c_timer[ch].expires = jiffies + ISDNLOOP_TIMER_ALERTWAIT; - if (ch) - card->c_timer[ch].function = isdnloop_atimeout1; - else - card->c_timer[ch].function = isdnloop_atimeout0; - card->c_timer[ch].data = (unsigned long) card; add_timer(&card->c_timer[ch]); spin_unlock_irqrestore(&card->isdnloop_lock, flags); } @@ -1113,10 +1109,9 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp) sdef.ptype); return -EINVAL; } - init_timer(&card->st_timer); + timer_setup(&card->rb_timer, isdnloop_pollbchan, 0); + timer_setup(&card->st_timer, isdnloop_polldchan, 0); card->st_timer.expires = jiffies + ISDNLOOP_TIMER_DCREAD; - card->st_timer.function = isdnloop_polldchan; - card->st_timer.data = (unsigned long) card; add_timer(&card->st_timer); card->flags |= ISDNLOOP_FLAGS_RUNNING; spin_unlock_irqrestore(&card->isdnloop_lock, flags); diff --git a/drivers/isdn/mISDN/dsp.h b/drivers/isdn/mISDN/dsp.h index fc1733a08845..fa09d511a8ed 100644 --- a/drivers/isdn/mISDN/dsp.h +++ b/drivers/isdn/mISDN/dsp.h @@ -259,7 +259,7 @@ extern u8 *dsp_dtmf_goertzel_decode(struct dsp *dsp, u8 *data, int len, extern int dsp_tone(struct dsp *dsp, int tone); extern void dsp_tone_copy(struct dsp *dsp, u8 *data, int len); -extern void dsp_tone_timeout(void *arg); +extern void dsp_tone_timeout(struct timer_list *t); extern void dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len); extern void dsp_bf_decrypt(struct dsp *dsp, u8 *data, int len); diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index 880e9d367a39..cd036e87335a 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c @@ -1092,7 +1092,7 @@ dspcreate(struct channel_req *crq) ndsp->pcm_bank_tx = -1; ndsp->hfc_conf = -1; /* current conference number */ /* set tone timer */ - setup_timer(&ndsp->tone.tl, (void *)dsp_tone_timeout, (long)ndsp); + timer_setup(&ndsp->tone.tl, dsp_tone_timeout, 0); if (dtmfthreshold < 20 || dtmfthreshold > 500) dtmfthreshold = 200; @@ -1202,9 +1202,7 @@ static int __init dsp_init(void) } /* set sample timer */ - dsp_spl_tl.function = (void *)dsp_cmx_send; - dsp_spl_tl.data = 0; - init_timer(&dsp_spl_tl); + timer_setup(&dsp_spl_tl, (void *)dsp_cmx_send, 0); dsp_spl_tl.expires = jiffies + dsp_tics; dsp_spl_jiffies = dsp_spl_tl.expires; add_timer(&dsp_spl_tl); diff --git a/drivers/isdn/mISDN/dsp_tones.c b/drivers/isdn/mISDN/dsp_tones.c index 057e0d6a369b..8389e2105cdc 100644 --- a/drivers/isdn/mISDN/dsp_tones.c +++ b/drivers/isdn/mISDN/dsp_tones.c @@ -457,9 +457,9 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len) * timer expires * *****************/ void -dsp_tone_timeout(void *arg) +dsp_tone_timeout(struct timer_list *t) { - struct dsp *dsp = arg; + struct dsp *dsp = from_timer(dsp, t, tone.tl); struct dsp_tone *tone = &dsp->tone; struct pattern *pat = (struct pattern *)tone->pattern; int index = tone->index; @@ -478,7 +478,6 @@ dsp_tone_timeout(void *arg) else dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index])); /* set timer */ - init_timer(&tone->tl); tone->tl.expires = jiffies + (pat->seq[index] * HZ) / 8000; add_timer(&tone->tl); } @@ -541,7 +540,6 @@ dsp_tone(struct dsp *dsp, int tone) /* set timer */ if (timer_pending(&tonet->tl)) del_timer(&tonet->tl); - init_timer(&tonet->tl); tonet->tl.expires = jiffies + (pat->seq[0] * HZ) / 8000; add_timer(&tonet->tl); } else { diff --git a/drivers/isdn/mISDN/fsm.c b/drivers/isdn/mISDN/fsm.c index 92e6570b1143..cabcb906e0b5 100644 --- a/drivers/isdn/mISDN/fsm.c +++ b/drivers/isdn/mISDN/fsm.c @@ -100,8 +100,9 @@ mISDN_FsmChangeState(struct FsmInst *fi, int newstate) EXPORT_SYMBOL(mISDN_FsmChangeState); static void -FsmExpireTimer(struct FsmTimer *ft) +FsmExpireTimer(struct timer_list *t) { + struct FsmTimer *ft = from_timer(ft, t, tl); #if FSM_TIMER_DEBUG if (ft->fi->debug) ft->fi->printdebug(ft->fi, "FsmExpireTimer %lx", (long) ft); @@ -117,7 +118,7 @@ mISDN_FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft) if (ft->fi->debug) ft->fi->printdebug(ft->fi, "mISDN_FsmInitTimer %lx", (long) ft); #endif - setup_timer(&ft->tl, (void *)FsmExpireTimer, (long)ft); + timer_setup(&ft->tl, FsmExpireTimer, 0); } EXPORT_SYMBOL(mISDN_FsmInitTimer); @@ -153,7 +154,6 @@ mISDN_FsmAddTimer(struct FsmTimer *ft, } return -1; } - init_timer(&ft->tl); ft->event = event; ft->arg = arg; ft->tl.expires = jiffies + (millisec * HZ) / 1000; @@ -175,7 +175,6 @@ mISDN_FsmRestartTimer(struct FsmTimer *ft, if (timer_pending(&ft->tl)) del_timer(&ft->tl); - init_timer(&ft->tl); ft->event = event; ft->arg = arg; ft->tl.expires = jiffies + (millisec * HZ) / 1000; diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 6be2041248d3..b5d590e378ac 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -842,17 +842,18 @@ l1oip_send_bh(struct work_struct *work) * timer stuff */ static void -l1oip_keepalive(void *data) +l1oip_keepalive(struct timer_list *t) { - struct l1oip *hc = (struct l1oip *)data; + struct l1oip *hc = from_timer(hc, t, keep_tl); schedule_work(&hc->workq); } static void -l1oip_timeout(void *data) +l1oip_timeout(struct timer_list *t) { - struct l1oip *hc = (struct l1oip *)data; + struct l1oip *hc = from_timer(hc, t, + timeout_tl); struct dchannel *dch = hc->chan[hc->d_idx].dch; if (debug & DEBUG_L1OIP_MSG) @@ -1437,13 +1438,11 @@ init_card(struct l1oip *hc, int pri, int bundle) if (ret) return ret; - hc->keep_tl.function = (void *)l1oip_keepalive; - hc->keep_tl.data = (ulong)hc; - init_timer(&hc->keep_tl); + timer_setup(&hc->keep_tl, l1oip_keepalive, 0); hc->keep_tl.expires = jiffies + 2 * HZ; /* two seconds first time */ add_timer(&hc->keep_tl); - setup_timer(&hc->timeout_tl, (void *)l1oip_timeout, (ulong)hc); + timer_setup(&hc->timeout_tl, l1oip_timeout, 0); hc->timeout_on = 0; /* state that we have timer off */ return 0; diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index b1e135fc1fb5..c50a34340f67 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -162,9 +162,9 @@ mISDN_poll(struct file *filep, poll_table *wait) } static void -dev_expire_timer(unsigned long data) +dev_expire_timer(struct timer_list *t) { - struct mISDNtimer *timer = (void *)data; + struct mISDNtimer *timer = from_timer(timer, t, tl); u_long flags; spin_lock_irqsave(&timer->dev->lock, flags); @@ -189,7 +189,7 @@ misdn_add_timer(struct mISDNtimerdev *dev, int timeout) if (!timer) return -ENOMEM; timer->dev = dev; - setup_timer(&timer->tl, dev_expire_timer, (long)timer); + timer_setup(&timer->tl, dev_expire_timer, 0); spin_lock_irq(&dev->lock); id = timer->id = dev->next_id++; if (dev->next_id < 0) |