Lines Matching full:card
58 u32 fmask; /* feature mask - bit set per card nr */
80 _set_debug(struct w6692_hw *card) in _set_debug() argument
82 card->dch.debug = debug; in _set_debug()
83 card->bc[0].bch.debug = debug; in _set_debug()
84 card->bc[1].bch.debug = debug; in _set_debug()
91 struct w6692_hw *card; in set_debug() local
96 list_for_each_entry(card, &Cards, list) in set_debug()
97 _set_debug(card); in set_debug()
110 MODULE_PARM_DESC(led, "W6692 LED support bitmask (one bit per card)");
112 MODULE_PARM_DESC(pots, "W6692 POTS support bitmask (one bit per card)");
115 ReadW6692(struct w6692_hw *card, u8 offset) in ReadW6692() argument
117 return inb(card->addr + offset); in ReadW6692()
121 WriteW6692(struct w6692_hw *card, u8 offset, u8 value) in WriteW6692() argument
123 outb(value, card->addr + offset); in WriteW6692()
139 enable_hwirq(struct w6692_hw *card) in enable_hwirq() argument
141 WriteW6692(card, W_IMASK, card->imask); in enable_hwirq()
145 disable_hwirq(struct w6692_hw *card) in disable_hwirq() argument
147 WriteW6692(card, W_IMASK, 0xff); in disable_hwirq()
153 W6692Version(struct w6692_hw *card) in W6692Version() argument
157 val = ReadW6692(card, W_D_RBCH); in W6692Version()
158 pr_notice("%s: Winbond W6692 version: %s\n", card->name, in W6692Version()
163 w6692_led_handler(struct w6692_hw *card, int on) in w6692_led_handler() argument
165 if ((!(card->fmask & led)) || card->subtype == W6692_USR) in w6692_led_handler()
168 card->xdata &= 0xfb; /* LED ON */ in w6692_led_handler()
169 WriteW6692(card, W_XDATA, card->xdata); in w6692_led_handler()
171 card->xdata |= 0x04; /* LED OFF */ in w6692_led_handler()
172 WriteW6692(card, W_XDATA, card->xdata); in w6692_led_handler()
177 ph_command(struct w6692_hw *card, u8 cmd) in ph_command() argument
179 pr_debug("%s: ph_command %x\n", card->name, cmd); in ph_command()
180 WriteW6692(card, W_CIX, cmd); in ph_command()
184 W6692_new_ph(struct w6692_hw *card) in W6692_new_ph() argument
186 if (card->state == W_L1CMD_RST) in W6692_new_ph()
187 ph_command(card, W_L1CMD_DRC); in W6692_new_ph()
188 schedule_event(&card->dch, FLG_PHCHANGE); in W6692_new_ph()
194 struct w6692_hw *card = dch->hw; in W6692_ph_bh() local
196 switch (card->state) { in W6692_ph_bh()
236 card->name, card->state, dch->state); in W6692_ph_bh()
239 pr_debug("%s: TE newstate %02x\n", card->name, dch->state); in W6692_ph_bh()
243 W6692_empty_Dfifo(struct w6692_hw *card, int count) in W6692_empty_Dfifo() argument
245 struct dchannel *dch = &card->dch; in W6692_empty_Dfifo()
248 pr_debug("%s: empty_Dfifo %d\n", card->name, count); in W6692_empty_Dfifo()
250 dch->rx_skb = mI_alloc_skb(card->dch.maxlen, GFP_ATOMIC); in W6692_empty_Dfifo()
252 pr_info("%s: D receive out of memory\n", card->name); in W6692_empty_Dfifo()
253 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
258 pr_debug("%s: empty_Dfifo overrun %d\n", card->name, in W6692_empty_Dfifo()
260 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
264 insb(card->addr + W_D_RFIFO, ptr, count); in W6692_empty_Dfifo()
265 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
267 snprintf(card->log, 63, "D-recv %s %d ", in W6692_empty_Dfifo()
268 card->name, count); in W6692_empty_Dfifo()
269 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_empty_Dfifo()
274 W6692_fill_Dfifo(struct w6692_hw *card) in W6692_fill_Dfifo() argument
276 struct dchannel *dch = &card->dch; in W6692_fill_Dfifo()
281 pr_debug("%s: fill_Dfifo\n", card->name); in W6692_fill_Dfifo()
293 outsb(card->addr + W_D_XFIFO, ptr, count); in W6692_fill_Dfifo()
294 WriteW6692(card, W_D_CMDR, cmd); in W6692_fill_Dfifo()
296 pr_debug("%s: fill_Dfifo dbusytimer running\n", card->name); in W6692_fill_Dfifo()
302 snprintf(card->log, 63, "D-send %s %d ", in W6692_fill_Dfifo()
303 card->name, count); in W6692_fill_Dfifo()
304 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_fill_Dfifo()
309 d_retransmit(struct w6692_hw *card) in d_retransmit() argument
311 struct dchannel *dch = &card->dch; in d_retransmit()
322 W6692_fill_Dfifo(card); in d_retransmit()
324 pr_info("%s: %s without TX_BUSY\n", card->name, __func__); in d_retransmit()
327 W6692_fill_Dfifo(card); in d_retransmit()
329 pr_info("%s: XDU no TX_BUSY\n", card->name); in d_retransmit()
331 W6692_fill_Dfifo(card); in d_retransmit()
336 handle_rxD(struct w6692_hw *card) { in handle_rxD() argument
340 stat = ReadW6692(card, W_D_RSTA); in handle_rxD()
343 pr_debug("%s: D-channel RDOV\n", card->name); in handle_rxD()
345 card->dch.err_rx++; in handle_rxD()
349 pr_debug("%s: D-channel CRC error\n", card->name); in handle_rxD()
351 card->dch.err_crc++; in handle_rxD()
355 pr_debug("%s: D-channel ABORT\n", card->name); in handle_rxD()
357 card->dch.err_rx++; in handle_rxD()
360 dev_kfree_skb(card->dch.rx_skb); in handle_rxD()
361 card->dch.rx_skb = NULL; in handle_rxD()
362 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); in handle_rxD()
364 count = ReadW6692(card, W_D_RBCL) & (W_D_FIFO_THRESH - 1); in handle_rxD()
367 W6692_empty_Dfifo(card, count); in handle_rxD()
368 recv_Dchannel(&card->dch); in handle_rxD()
373 handle_txD(struct w6692_hw *card) { in handle_txD() argument
374 if (test_and_clear_bit(FLG_BUSY_TIMER, &card->dch.Flags)) in handle_txD()
375 del_timer(&card->dch.timer); in handle_txD()
376 if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) { in handle_txD()
377 W6692_fill_Dfifo(card); in handle_txD()
379 dev_kfree_skb(card->dch.tx_skb); in handle_txD()
380 if (get_next_dframe(&card->dch)) in handle_txD()
381 W6692_fill_Dfifo(card); in handle_txD()
386 handle_statusD(struct w6692_hw *card) in handle_statusD() argument
388 struct dchannel *dch = &card->dch; in handle_statusD()
391 exval = ReadW6692(card, W_D_EXIR); in handle_statusD()
393 pr_debug("%s: D_EXIR %02x\n", card->name, exval); in handle_statusD()
396 pr_debug("%s: D-channel underrun/collision\n", card->name); in handle_statusD()
400 d_retransmit(card); in handle_statusD()
403 pr_debug("%s: D-channel RDOV\n", card->name); in handle_statusD()
404 WriteW6692(card, W_D_CMDR, W_D_CMDR_RRST); in handle_statusD()
407 pr_debug("%s: spurious TIN2 interrupt\n", card->name); in handle_statusD()
409 v1 = ReadW6692(card, W_MOSR); in handle_statusD()
411 card->name, v1); in handle_statusD()
414 cir = ReadW6692(card, W_CIR); in handle_statusD()
415 pr_debug("%s: ISC CIR %02X\n", card->name, cir); in handle_statusD()
418 pr_debug("%s: ph_state_change %x -> %x\n", card->name, in handle_statusD()
420 card->state = v1; in handle_statusD()
421 if (card->fmask & led) { in handle_statusD()
425 w6692_led_handler(card, 1); in handle_statusD()
428 w6692_led_handler(card, 0); in handle_statusD()
432 W6692_new_ph(card); in handle_statusD()
435 v1 = ReadW6692(card, W_SQR); in handle_statusD()
436 pr_debug("%s: SCC SQR %02X\n", card->name, v1); in handle_statusD()
440 pr_debug("%s: spurious WEXP interrupt!\n", card->name); in handle_statusD()
442 pr_debug("%s: spurious TEXP interrupt!\n", card->name); in handle_statusD()
448 struct w6692_hw *card = wch->bch.hw; in W6692_empty_Bfifo() local
452 pr_debug("%s: empty_Bfifo %d\n", card->name, count); in W6692_empty_Bfifo()
454 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card->name); in W6692_empty_Bfifo()
471 card->name, wch->bch.nr, count); in W6692_empty_Bfifo()
478 snprintf(card->log, 63, "B%1d-recv %s %d ", in W6692_empty_Bfifo()
479 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
480 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_empty_Bfifo()
487 struct w6692_hw *card = wch->bch.hw; in W6692_fill_Bfifo() local
491 pr_debug("%s: fill Bfifo\n", card->name); in W6692_fill_Bfifo()
509 pr_debug("%s: fill Bfifo%d/%d\n", card->name, in W6692_fill_Bfifo()
522 snprintf(card->log, 63, "B%1d-send %s %d ", in W6692_fill_Bfifo()
523 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
524 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_fill_Bfifo()
532 struct w6692_hw *card = wch->bch.hw;
536 if ((!(card->fmask & pots)) ||
547 card->xaddr &= 0xc7;
549 card->xaddr &= 0xf8;
551 card->xaddr |= val;
552 WriteW6692(card, W_XADDR, card->xaddr);
559 struct w6692_hw *card = wch->bch.hw;
561 if ((!(card->fmask & pots)) ||
567 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
568 WriteW6692(card, W_PCTL, card->pctl);
576 struct w6692_hw *card = wch->bch.hw; in disable_pots() local
578 if (!(card->fmask & pots)) in disable_pots()
590 struct w6692_hw *card; in w6692_mode() local
592 card = wch->bch.hw; in w6692_mode()
593 pr_debug("%s: B%d protocol %x-->%x\n", card->name, in w6692_mode()
597 if ((card->fmask & pots) && (wch->b_mode & W_B_MODE_EPCM)) in w6692_mode()
625 pr_info("%s: protocol %x not known\n", card->name, pr); in w6692_mode()
649 W6692B_interrupt(struct w6692_hw *card, int ch) in W6692B_interrupt() argument
651 struct w6692_ch *wch = &card->bc[ch]; in W6692B_interrupt()
656 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
662 pr_debug("%s: B%d RDOV proto=%x\n", card->name, in W6692B_interrupt()
671 card->name, wch->bch.nr); in W6692B_interrupt()
678 card->name, wch->bch.nr); in W6692B_interrupt()
701 pr_debug("%s: B%d RDOV proto=%x\n", card->name, in W6692B_interrupt()
717 pr_debug("%s: B%d RDOV IRQ proto=%x\n", card->name, in W6692B_interrupt()
729 pr_debug("%s: B%d star %02x\n", card->name, in W6692B_interrupt()
733 pr_warn("%s: B%d XDOW proto=%x\n", card->name, in W6692B_interrupt()
751 pr_warn("%s: B%d XDUN proto=%x\n", card->name, in W6692B_interrupt()
770 struct w6692_hw *card = dev_id; in w6692_irq() local
773 spin_lock(&card->lock); in w6692_irq()
774 ista = ReadW6692(card, W_ISTA); in w6692_irq()
775 if ((ista | card->imask) == card->imask) { in w6692_irq()
777 spin_unlock(&card->lock); in w6692_irq()
780 card->irqcnt++; in w6692_irq()
781 pr_debug("%s: ista %02x\n", card->name, ista); in w6692_irq()
782 ista &= ~card->imask; in w6692_irq()
784 W6692B_interrupt(card, 0); in w6692_irq()
786 W6692B_interrupt(card, 1); in w6692_irq()
788 handle_rxD(card); in w6692_irq()
790 W6692_empty_Dfifo(card, W_D_FIFO_THRESH); in w6692_irq()
792 handle_txD(card); in w6692_irq()
794 handle_statusD(card); in w6692_irq()
796 pr_debug("%s: W6692 spurious XINT!\n", card->name); in w6692_irq()
798 spin_unlock(&card->lock); in w6692_irq()
806 struct w6692_hw *card = dch->hw; in dbusy_timer_handler() local
811 spin_lock_irqsave(&card->lock, flags); in dbusy_timer_handler()
812 rbch = ReadW6692(card, W_D_RBCH); in dbusy_timer_handler()
813 star = ReadW6692(card, W_D_STAR); in dbusy_timer_handler()
815 card->name, rbch, star); in dbusy_timer_handler()
825 card->name); in dbusy_timer_handler()
827 WriteW6692(card, W_D_CMDR, W_D_CMDR_XRST); in dbusy_timer_handler()
829 spin_unlock_irqrestore(&card->lock, flags); in dbusy_timer_handler()
833 static void initW6692(struct w6692_hw *card) in initW6692() argument
837 timer_setup(&card->dch.timer, dbusy_timer_handler, 0); in initW6692()
838 w6692_mode(&card->bc[0], ISDN_P_NONE); in initW6692()
839 w6692_mode(&card->bc[1], ISDN_P_NONE); in initW6692()
840 WriteW6692(card, W_D_CTL, 0x00); in initW6692()
841 disable_hwirq(card); in initW6692()
842 WriteW6692(card, W_D_SAM, 0xff); in initW6692()
843 WriteW6692(card, W_D_TAM, 0xff); in initW6692()
844 WriteW6692(card, W_D_MODE, W_D_MODE_RACT); in initW6692()
845 card->state = W_L1CMD_RST; in initW6692()
846 ph_command(card, W_L1CMD_RST); in initW6692()
847 ph_command(card, W_L1CMD_ECK); in initW6692()
849 card->imask = 0x18; in initW6692()
850 WriteW6692(card, W_D_EXIM, 0x00); in initW6692()
851 WriteW6692B(&card->bc[0], W_B_EXIM, 0); in initW6692()
852 WriteW6692B(&card->bc[1], W_B_EXIM, 0); in initW6692()
854 WriteW6692(card, W_D_CMDR, W_D_CMDR_RRST | W_D_CMDR_XRST); in initW6692()
856 WriteW6692B(&card->bc[0], W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); in initW6692()
857 WriteW6692B(&card->bc[1], W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); in initW6692()
859 if (card->subtype == W6692_USR) { in initW6692()
864 card->pctl = 0x80; in initW6692()
865 card->xdata = 0; in initW6692()
866 WriteW6692(card, W_PCTL, card->pctl); in initW6692()
867 WriteW6692(card, W_XDATA, card->xdata); in initW6692()
869 card->pctl = W_PCTL_OE5 | W_PCTL_OE4 | W_PCTL_OE2 | in initW6692()
871 card->xaddr = 0x00;/* all sw off */ in initW6692()
872 if (card->fmask & pots) in initW6692()
873 card->xdata |= 0x06; /* POWER UP/ LED OFF / ALAW */ in initW6692()
874 if (card->fmask & led) in initW6692()
875 card->xdata |= 0x04; /* LED OFF */ in initW6692()
876 if ((card->fmask & pots) || (card->fmask & led)) { in initW6692()
877 WriteW6692(card, W_PCTL, card->pctl); in initW6692()
878 WriteW6692(card, W_XADDR, card->xaddr); in initW6692()
879 WriteW6692(card, W_XDATA, card->xdata); in initW6692()
880 val = ReadW6692(card, W_XADDR); in initW6692()
883 card->name, val); in initW6692()
889 reset_w6692(struct w6692_hw *card) in reset_w6692() argument
891 WriteW6692(card, W_D_CTL, W_D_CTL_SRST); in reset_w6692()
893 WriteW6692(card, W_D_CTL, 0); in reset_w6692()
897 init_card(struct w6692_hw *card) in init_card() argument
902 spin_lock_irqsave(&card->lock, flags); in init_card()
903 disable_hwirq(card); in init_card()
904 spin_unlock_irqrestore(&card->lock, flags); in init_card()
905 if (request_irq(card->irq, w6692_irq, IRQF_SHARED, card->name, card)) { in init_card()
906 pr_info("%s: couldn't get interrupt %d\n", card->name, in init_card()
907 card->irq); in init_card()
911 spin_lock_irqsave(&card->lock, flags); in init_card()
912 initW6692(card); in init_card()
913 enable_hwirq(card); in init_card()
914 spin_unlock_irqrestore(&card->lock, flags); in init_card()
918 pr_notice("%s: IRQ %d count %d\n", card->name, in init_card()
919 card->irq, card->irqcnt); in init_card()
920 if (!card->irqcnt) { in init_card()
922 card->name, card->irq, 3 - cnt); in init_card()
923 reset_w6692(card); in init_card()
927 free_irq(card->irq, card); in init_card()
936 struct w6692_hw *card = bch->hw; in w6692_l2l1B() local
943 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
949 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
952 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
957 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
963 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
966 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
973 card->name, __func__, hh->prim, hh->id); in w6692_l2l1B()
988 open_bchannel(struct w6692_hw *card, struct channel_req *rq) in open_bchannel() argument
996 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
1005 channel_ctrl(struct w6692_hw *card, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
1014 ret = l1_event(card->dch.l1, HW_TIMER3_VALUE | (cq->p1 & 0xff)); in channel_ctrl()
1017 pr_info("%s: unknown CTRL OP %x\n", card->name, cq->op); in channel_ctrl()
1029 struct w6692_hw *card = bch->hw; in w6692_bctrl() local
1033 pr_debug("%s: %s cmd:%x %p\n", card->name, __func__, cmd, arg); in w6692_bctrl()
1038 spin_lock_irqsave(&card->lock, flags); in w6692_bctrl()
1041 spin_unlock_irqrestore(&card->lock, flags); in w6692_bctrl()
1052 card->name, __func__, cmd); in w6692_bctrl()
1062 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_l2l1D() local
1070 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1D()
1074 W6692_fill_Dfifo(card); in w6692_l2l1D()
1076 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1D()
1079 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1D()
1098 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_l1callback() local
1101 pr_debug("%s: cmd(%x) state(%02x)\n", card->name, cmd, card->state); in w6692_l1callback()
1104 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1105 ph_command(card, W_L1CMD_AR8); in w6692_l1callback()
1106 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1109 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1110 ph_command(card, W_L1CMD_AR10); in w6692_l1callback()
1111 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1114 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1115 if (card->state != W_L1IND_DRD) in w6692_l1callback()
1116 ph_command(card, W_L1CMD_RST); in w6692_l1callback()
1117 ph_command(card, W_L1CMD_ECK); in w6692_l1callback()
1118 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1136 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1137 ph_command(card, W_L1CMD_ECK); in w6692_l1callback()
1138 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1151 pr_debug("%s: %s unknown command %x\n", card->name, in w6692_l1callback()
1159 open_dchannel(struct w6692_hw *card, struct channel_req *rq, void *caller) in open_dchannel() argument
1161 pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, in open_dchannel()
1162 card->dch.dev.id, caller); in open_dchannel()
1168 rq->ch = &card->dch.dev.D; in open_dchannel()
1170 if (card->dch.state == 7) in open_dchannel()
1181 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_dctrl() local
1185 pr_debug("%s: DCTRL: %x %p\n", card->name, cmd, arg); in w6692_dctrl()
1190 err = open_dchannel(card, rq, __builtin_return_address(0)); in w6692_dctrl()
1192 err = open_bchannel(card, rq); in w6692_dctrl()
1196 pr_info("%s: cannot get module\n", card->name); in w6692_dctrl()
1199 pr_debug("%s: dev(%d) close from %p\n", card->name, in w6692_dctrl()
1204 err = channel_ctrl(card, arg); in w6692_dctrl()
1207 pr_debug("%s: unknown DCTRL command %x\n", card->name, cmd); in w6692_dctrl()
1214 setup_w6692(struct w6692_hw *card) in setup_w6692() argument
1218 if (!request_region(card->addr, 256, card->name)) { in setup_w6692()
1219 pr_info("%s: config port %x-%x already in use\n", card->name, in setup_w6692()
1220 card->addr, card->addr + 255); in setup_w6692()
1223 W6692Version(card); in setup_w6692()
1224 card->bc[0].addr = card->addr; in setup_w6692()
1225 card->bc[1].addr = card->addr + 0x40; in setup_w6692()
1226 val = ReadW6692(card, W_ISTA); in setup_w6692()
1228 pr_notice("%s ISTA=%02x\n", card->name, val); in setup_w6692()
1229 val = ReadW6692(card, W_IMASK); in setup_w6692()
1231 pr_notice("%s IMASK=%02x\n", card->name, val); in setup_w6692()
1232 val = ReadW6692(card, W_D_EXIR); in setup_w6692()
1234 pr_notice("%s D_EXIR=%02x\n", card->name, val); in setup_w6692()
1235 val = ReadW6692(card, W_D_EXIM); in setup_w6692()
1237 pr_notice("%s D_EXIM=%02x\n", card->name, val); in setup_w6692()
1238 val = ReadW6692(card, W_D_RSTA); in setup_w6692()
1240 pr_notice("%s D_RSTA=%02x\n", card->name, val); in setup_w6692()
1245 release_card(struct w6692_hw *card) in release_card() argument
1249 spin_lock_irqsave(&card->lock, flags); in release_card()
1250 disable_hwirq(card); in release_card()
1251 w6692_mode(&card->bc[0], ISDN_P_NONE); in release_card()
1252 w6692_mode(&card->bc[1], ISDN_P_NONE); in release_card()
1253 if ((card->fmask & led) || card->subtype == W6692_USR) { in release_card()
1254 card->xdata |= 0x04; /* LED OFF */ in release_card()
1255 WriteW6692(card, W_XDATA, card->xdata); in release_card()
1257 spin_unlock_irqrestore(&card->lock, flags); in release_card()
1258 free_irq(card->irq, card); in release_card()
1259 l1_event(card->dch.l1, CLOSE_CHANNEL); in release_card()
1260 mISDN_unregister_device(&card->dch.dev); in release_card()
1261 release_region(card->addr, 256); in release_card()
1262 mISDN_freebchannel(&card->bc[1].bch); in release_card()
1263 mISDN_freebchannel(&card->bc[0].bch); in release_card()
1264 mISDN_freedchannel(&card->dch); in release_card()
1266 list_del(&card->list); in release_card()
1268 pci_disable_device(card->pdev); in release_card()
1269 pci_set_drvdata(card->pdev, NULL); in release_card()
1270 kfree(card); in release_card()
1274 setup_instance(struct w6692_hw *card) in setup_instance() argument
1279 snprintf(card->name, MISDN_MAX_IDLEN - 1, "w6692.%d", w6692_cnt + 1); in setup_instance()
1281 list_add_tail(&card->list, &Cards); in setup_instance()
1283 card->fmask = (1 << w6692_cnt); in setup_instance()
1284 _set_debug(card); in setup_instance()
1285 spin_lock_init(&card->lock); in setup_instance()
1286 mISDN_initdchannel(&card->dch, MAX_DFRAME_LEN_L1, W6692_ph_bh); in setup_instance()
1287 card->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0); in setup_instance()
1288 card->dch.dev.D.send = w6692_l2l1D; in setup_instance()
1289 card->dch.dev.D.ctrl = w6692_dctrl; in setup_instance()
1290 card->dch.dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in setup_instance()
1292 card->dch.hw = card; in setup_instance()
1293 card->dch.dev.nrbchan = 2; in setup_instance()
1295 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM, in setup_instance()
1297 card->bc[i].bch.hw = card; in setup_instance()
1298 card->bc[i].bch.nr = i + 1; in setup_instance()
1299 card->bc[i].bch.ch.nr = i + 1; in setup_instance()
1300 card->bc[i].bch.ch.send = w6692_l2l1B; in setup_instance()
1301 card->bc[i].bch.ch.ctrl = w6692_bctrl; in setup_instance()
1302 set_channelmap(i + 1, card->dch.dev.channelmap); in setup_instance()
1303 list_add(&card->bc[i].bch.ch.list, &card->dch.dev.bchannels); in setup_instance()
1305 err = setup_w6692(card); in setup_instance()
1308 err = mISDN_register_device(&card->dch.dev, &card->pdev->dev, in setup_instance()
1309 card->name); in setup_instance()
1312 err = init_card(card); in setup_instance()
1315 err = create_l1(&card->dch, w6692_l1callback); in setup_instance()
1322 free_irq(card->irq, card); in setup_instance()
1324 mISDN_unregister_device(&card->dch.dev); in setup_instance()
1326 release_region(card->addr, 256); in setup_instance()
1328 mISDN_freebchannel(&card->bc[1].bch); in setup_instance()
1329 mISDN_freebchannel(&card->bc[0].bch); in setup_instance()
1330 mISDN_freedchannel(&card->dch); in setup_instance()
1332 list_del(&card->list); in setup_instance()
1334 kfree(card); in setup_instance()
1342 struct w6692_hw *card; in w6692_probe() local
1345 card = kzalloc(sizeof(struct w6692_hw), GFP_KERNEL); in w6692_probe()
1346 if (!card) { in w6692_probe()
1347 pr_info("No kmem for w6692 card\n"); in w6692_probe()
1350 card->pdev = pdev; in w6692_probe()
1351 card->subtype = m->subtype; in w6692_probe()
1354 kfree(card); in w6692_probe()
1361 card->addr = pci_resource_start(pdev, 1); in w6692_probe()
1362 card->irq = pdev->irq; in w6692_probe()
1363 pci_set_drvdata(pdev, card); in w6692_probe()
1364 err = setup_instance(card); in w6692_probe()
1373 struct w6692_hw *card = pci_get_drvdata(pdev); in w6692_remove_pci() local
1375 if (card) in w6692_remove_pci()
1376 release_card(card); in w6692_remove_pci()