• Home
  • Raw
  • Download

Lines Matching refs:card

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()
114 ReadW6692(struct w6692_hw *card, u8 offset) in ReadW6692() argument
116 return inb(card->addr + offset); in ReadW6692()
120 WriteW6692(struct w6692_hw *card, u8 offset, u8 value) in WriteW6692() argument
122 outb(value, card->addr + offset); in WriteW6692()
138 enable_hwirq(struct w6692_hw *card) in enable_hwirq() argument
140 WriteW6692(card, W_IMASK, card->imask); in enable_hwirq()
144 disable_hwirq(struct w6692_hw *card) in disable_hwirq() argument
146 WriteW6692(card, W_IMASK, 0xff); in disable_hwirq()
152 W6692Version(struct w6692_hw *card) in W6692Version() argument
156 val = ReadW6692(card, W_D_RBCH); in W6692Version()
157 pr_notice("%s: Winbond W6692 version: %s\n", card->name, in W6692Version()
162 w6692_led_handler(struct w6692_hw *card, int on) in w6692_led_handler() argument
164 if ((!(card->fmask & led)) || card->subtype == W6692_USR) in w6692_led_handler()
167 card->xdata &= 0xfb; /* LED ON */ in w6692_led_handler()
168 WriteW6692(card, W_XDATA, card->xdata); in w6692_led_handler()
170 card->xdata |= 0x04; /* LED OFF */ in w6692_led_handler()
171 WriteW6692(card, W_XDATA, card->xdata); in w6692_led_handler()
176 ph_command(struct w6692_hw *card, u8 cmd) in ph_command() argument
178 pr_debug("%s: ph_command %x\n", card->name, cmd); in ph_command()
179 WriteW6692(card, W_CIX, cmd); in ph_command()
183 W6692_new_ph(struct w6692_hw *card) in W6692_new_ph() argument
185 if (card->state == W_L1CMD_RST) in W6692_new_ph()
186 ph_command(card, W_L1CMD_DRC); in W6692_new_ph()
187 schedule_event(&card->dch, FLG_PHCHANGE); in W6692_new_ph()
193 struct w6692_hw *card = dch->hw; in W6692_ph_bh() local
195 switch (card->state) { in W6692_ph_bh()
235 card->name, card->state, dch->state); in W6692_ph_bh()
238 pr_debug("%s: TE newstate %02x\n", card->name, dch->state); in W6692_ph_bh()
242 W6692_empty_Dfifo(struct w6692_hw *card, int count) in W6692_empty_Dfifo() argument
244 struct dchannel *dch = &card->dch; in W6692_empty_Dfifo()
247 pr_debug("%s: empty_Dfifo %d\n", card->name, count); in W6692_empty_Dfifo()
249 dch->rx_skb = mI_alloc_skb(card->dch.maxlen, GFP_ATOMIC); in W6692_empty_Dfifo()
251 pr_info("%s: D receive out of memory\n", card->name); in W6692_empty_Dfifo()
252 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
257 pr_debug("%s: empty_Dfifo overrun %d\n", card->name, in W6692_empty_Dfifo()
259 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
263 insb(card->addr + W_D_RFIFO, ptr, count); in W6692_empty_Dfifo()
264 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK); in W6692_empty_Dfifo()
266 snprintf(card->log, 63, "D-recv %s %d ", in W6692_empty_Dfifo()
267 card->name, count); in W6692_empty_Dfifo()
268 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_empty_Dfifo()
273 W6692_fill_Dfifo(struct w6692_hw *card) in W6692_fill_Dfifo() argument
275 struct dchannel *dch = &card->dch; in W6692_fill_Dfifo()
280 pr_debug("%s: fill_Dfifo\n", card->name); in W6692_fill_Dfifo()
292 outsb(card->addr + W_D_XFIFO, ptr, count); in W6692_fill_Dfifo()
293 WriteW6692(card, W_D_CMDR, cmd); in W6692_fill_Dfifo()
295 pr_debug("%s: fill_Dfifo dbusytimer running\n", card->name); in W6692_fill_Dfifo()
301 snprintf(card->log, 63, "D-send %s %d ", in W6692_fill_Dfifo()
302 card->name, count); in W6692_fill_Dfifo()
303 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_fill_Dfifo()
308 d_retransmit(struct w6692_hw *card) in d_retransmit() argument
310 struct dchannel *dch = &card->dch; in d_retransmit()
321 W6692_fill_Dfifo(card); in d_retransmit()
323 pr_info("%s: %s without TX_BUSY\n", card->name, __func__); in d_retransmit()
326 W6692_fill_Dfifo(card); in d_retransmit()
328 pr_info("%s: XDU no TX_BUSY\n", card->name); in d_retransmit()
330 W6692_fill_Dfifo(card); in d_retransmit()
335 handle_rxD(struct w6692_hw *card) { in handle_rxD() argument
339 stat = ReadW6692(card, W_D_RSTA); in handle_rxD()
342 pr_debug("%s: D-channel RDOV\n", card->name); in handle_rxD()
344 card->dch.err_rx++; in handle_rxD()
348 pr_debug("%s: D-channel CRC error\n", card->name); in handle_rxD()
350 card->dch.err_crc++; in handle_rxD()
354 pr_debug("%s: D-channel ABORT\n", card->name); in handle_rxD()
356 card->dch.err_rx++; in handle_rxD()
359 dev_kfree_skb(card->dch.rx_skb); in handle_rxD()
360 card->dch.rx_skb = NULL; in handle_rxD()
361 WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); in handle_rxD()
363 count = ReadW6692(card, W_D_RBCL) & (W_D_FIFO_THRESH - 1); in handle_rxD()
366 W6692_empty_Dfifo(card, count); in handle_rxD()
367 recv_Dchannel(&card->dch); in handle_rxD()
372 handle_txD(struct w6692_hw *card) { in handle_txD() argument
373 if (test_and_clear_bit(FLG_BUSY_TIMER, &card->dch.Flags)) in handle_txD()
374 del_timer(&card->dch.timer); in handle_txD()
375 if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) { in handle_txD()
376 W6692_fill_Dfifo(card); in handle_txD()
378 dev_kfree_skb(card->dch.tx_skb); in handle_txD()
379 if (get_next_dframe(&card->dch)) in handle_txD()
380 W6692_fill_Dfifo(card); in handle_txD()
385 handle_statusD(struct w6692_hw *card) in handle_statusD() argument
387 struct dchannel *dch = &card->dch; in handle_statusD()
390 exval = ReadW6692(card, W_D_EXIR); in handle_statusD()
392 pr_debug("%s: D_EXIR %02x\n", card->name, exval); in handle_statusD()
395 pr_debug("%s: D-channel underrun/collision\n", card->name); in handle_statusD()
399 d_retransmit(card); in handle_statusD()
402 pr_debug("%s: D-channel RDOV\n", card->name); in handle_statusD()
403 WriteW6692(card, W_D_CMDR, W_D_CMDR_RRST); in handle_statusD()
406 pr_debug("%s: spurious TIN2 interrupt\n", card->name); in handle_statusD()
408 v1 = ReadW6692(card, W_MOSR); in handle_statusD()
410 card->name, v1); in handle_statusD()
413 cir = ReadW6692(card, W_CIR); in handle_statusD()
414 pr_debug("%s: ISC CIR %02X\n", card->name, cir); in handle_statusD()
417 pr_debug("%s: ph_state_change %x -> %x\n", card->name, in handle_statusD()
419 card->state = v1; in handle_statusD()
420 if (card->fmask & led) { in handle_statusD()
424 w6692_led_handler(card, 1); in handle_statusD()
427 w6692_led_handler(card, 0); in handle_statusD()
431 W6692_new_ph(card); in handle_statusD()
434 v1 = ReadW6692(card, W_SQR); in handle_statusD()
435 pr_debug("%s: SCC SQR %02X\n", card->name, v1); in handle_statusD()
439 pr_debug("%s: spurious WEXP interrupt!\n", card->name); in handle_statusD()
441 pr_debug("%s: spurious TEXP interrupt!\n", card->name); in handle_statusD()
447 struct w6692_hw *card = wch->bch.hw; in W6692_empty_Bfifo() local
451 pr_debug("%s: empty_Bfifo %d\n", card->name, count); in W6692_empty_Bfifo()
453 pr_debug("%s: empty_Bfifo ISDN_P_NONE\n", card->name); in W6692_empty_Bfifo()
470 card->name, wch->bch.nr, count); in W6692_empty_Bfifo()
477 snprintf(card->log, 63, "B%1d-recv %s %d ", in W6692_empty_Bfifo()
478 wch->bch.nr, card->name, count); in W6692_empty_Bfifo()
479 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_empty_Bfifo()
486 struct w6692_hw *card = wch->bch.hw; in W6692_fill_Bfifo() local
490 pr_debug("%s: fill Bfifo\n", card->name); in W6692_fill_Bfifo()
508 pr_debug("%s: fill Bfifo%d/%d\n", card->name, in W6692_fill_Bfifo()
521 snprintf(card->log, 63, "B%1d-send %s %d ", in W6692_fill_Bfifo()
522 wch->bch.nr, card->name, count); in W6692_fill_Bfifo()
523 print_hex_dump_bytes(card->log, DUMP_PREFIX_OFFSET, ptr, count); in W6692_fill_Bfifo()
531 struct w6692_hw *card = wch->bch.hw;
535 if ((!(card->fmask & pots)) ||
546 card->xaddr &= 0xc7;
548 card->xaddr &= 0xf8;
550 card->xaddr |= val;
551 WriteW6692(card, W_XADDR, card->xaddr);
558 struct w6692_hw *card = wch->bch.hw;
560 if ((!(card->fmask & pots)) ||
566 card->pctl |= ((wch->bch.nr & 2) ? W_PCTL_PCX : 0);
567 WriteW6692(card, W_PCTL, card->pctl);
575 struct w6692_hw *card = wch->bch.hw; in disable_pots() local
577 if (!(card->fmask & pots)) in disable_pots()
589 struct w6692_hw *card; in w6692_mode() local
591 card = wch->bch.hw; in w6692_mode()
592 pr_debug("%s: B%d protocol %x-->%x\n", card->name, in w6692_mode()
596 if ((card->fmask & pots) && (wch->b_mode & W_B_MODE_EPCM)) in w6692_mode()
624 pr_info("%s: protocol %x not known\n", card->name, pr); in w6692_mode()
648 W6692B_interrupt(struct w6692_hw *card, int ch) in W6692B_interrupt() argument
650 struct w6692_ch *wch = &card->bc[ch]; in W6692B_interrupt()
655 pr_debug("%s: B%d EXIR %02x\n", card->name, wch->bch.nr, stat); in W6692B_interrupt()
661 pr_debug("%s: B%d RDOV proto=%x\n", card->name, in W6692B_interrupt()
670 card->name, wch->bch.nr); in W6692B_interrupt()
677 card->name, wch->bch.nr); in W6692B_interrupt()
700 pr_debug("%s: B%d RDOV proto=%x\n", card->name, in W6692B_interrupt()
716 pr_debug("%s: B%d RDOV IRQ proto=%x\n", card->name, in W6692B_interrupt()
728 pr_debug("%s: B%d star %02x\n", card->name, in W6692B_interrupt()
732 pr_warn("%s: B%d XDOW proto=%x\n", card->name, in W6692B_interrupt()
750 pr_warn("%s: B%d XDUN proto=%x\n", card->name, in W6692B_interrupt()
769 struct w6692_hw *card = dev_id; in w6692_irq() local
772 spin_lock(&card->lock); in w6692_irq()
773 ista = ReadW6692(card, W_ISTA); in w6692_irq()
774 if ((ista | card->imask) == card->imask) { in w6692_irq()
776 spin_unlock(&card->lock); in w6692_irq()
779 card->irqcnt++; in w6692_irq()
780 pr_debug("%s: ista %02x\n", card->name, ista); in w6692_irq()
781 ista &= ~card->imask; in w6692_irq()
783 W6692B_interrupt(card, 0); in w6692_irq()
785 W6692B_interrupt(card, 1); in w6692_irq()
787 handle_rxD(card); in w6692_irq()
789 W6692_empty_Dfifo(card, W_D_FIFO_THRESH); in w6692_irq()
791 handle_txD(card); in w6692_irq()
793 handle_statusD(card); in w6692_irq()
795 pr_debug("%s: W6692 spurious XINT!\n", card->name); in w6692_irq()
797 spin_unlock(&card->lock); in w6692_irq()
805 struct w6692_hw *card = dch->hw; in dbusy_timer_handler() local
810 spin_lock_irqsave(&card->lock, flags); in dbusy_timer_handler()
811 rbch = ReadW6692(card, W_D_RBCH); in dbusy_timer_handler()
812 star = ReadW6692(card, W_D_STAR); in dbusy_timer_handler()
814 card->name, rbch, star); in dbusy_timer_handler()
824 card->name); in dbusy_timer_handler()
826 WriteW6692(card, W_D_CMDR, W_D_CMDR_XRST); in dbusy_timer_handler()
828 spin_unlock_irqrestore(&card->lock, flags); in dbusy_timer_handler()
832 static void initW6692(struct w6692_hw *card) in initW6692() argument
836 timer_setup(&card->dch.timer, dbusy_timer_handler, 0); in initW6692()
837 w6692_mode(&card->bc[0], ISDN_P_NONE); in initW6692()
838 w6692_mode(&card->bc[1], ISDN_P_NONE); in initW6692()
839 WriteW6692(card, W_D_CTL, 0x00); in initW6692()
840 disable_hwirq(card); in initW6692()
841 WriteW6692(card, W_D_SAM, 0xff); in initW6692()
842 WriteW6692(card, W_D_TAM, 0xff); in initW6692()
843 WriteW6692(card, W_D_MODE, W_D_MODE_RACT); in initW6692()
844 card->state = W_L1CMD_RST; in initW6692()
845 ph_command(card, W_L1CMD_RST); in initW6692()
846 ph_command(card, W_L1CMD_ECK); in initW6692()
848 card->imask = 0x18; in initW6692()
849 WriteW6692(card, W_D_EXIM, 0x00); in initW6692()
850 WriteW6692B(&card->bc[0], W_B_EXIM, 0); in initW6692()
851 WriteW6692B(&card->bc[1], W_B_EXIM, 0); in initW6692()
853 WriteW6692(card, W_D_CMDR, W_D_CMDR_RRST | W_D_CMDR_XRST); in initW6692()
855 WriteW6692B(&card->bc[0], W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); in initW6692()
856 WriteW6692B(&card->bc[1], W_B_CMDR, W_B_CMDR_RRST | W_B_CMDR_XRST); in initW6692()
858 if (card->subtype == W6692_USR) { in initW6692()
863 card->pctl = 0x80; in initW6692()
864 card->xdata = 0; in initW6692()
865 WriteW6692(card, W_PCTL, card->pctl); in initW6692()
866 WriteW6692(card, W_XDATA, card->xdata); in initW6692()
868 card->pctl = W_PCTL_OE5 | W_PCTL_OE4 | W_PCTL_OE2 | in initW6692()
870 card->xaddr = 0x00;/* all sw off */ in initW6692()
871 if (card->fmask & pots) in initW6692()
872 card->xdata |= 0x06; /* POWER UP/ LED OFF / ALAW */ in initW6692()
873 if (card->fmask & led) in initW6692()
874 card->xdata |= 0x04; /* LED OFF */ in initW6692()
875 if ((card->fmask & pots) || (card->fmask & led)) { in initW6692()
876 WriteW6692(card, W_PCTL, card->pctl); in initW6692()
877 WriteW6692(card, W_XADDR, card->xaddr); in initW6692()
878 WriteW6692(card, W_XDATA, card->xdata); in initW6692()
879 val = ReadW6692(card, W_XADDR); in initW6692()
882 card->name, val); in initW6692()
888 reset_w6692(struct w6692_hw *card) in reset_w6692() argument
890 WriteW6692(card, W_D_CTL, W_D_CTL_SRST); in reset_w6692()
892 WriteW6692(card, W_D_CTL, 0); in reset_w6692()
896 init_card(struct w6692_hw *card) in init_card() argument
901 spin_lock_irqsave(&card->lock, flags); in init_card()
902 disable_hwirq(card); in init_card()
903 spin_unlock_irqrestore(&card->lock, flags); in init_card()
904 if (request_irq(card->irq, w6692_irq, IRQF_SHARED, card->name, card)) { in init_card()
905 pr_info("%s: couldn't get interrupt %d\n", card->name, in init_card()
906 card->irq); in init_card()
910 spin_lock_irqsave(&card->lock, flags); in init_card()
911 initW6692(card); in init_card()
912 enable_hwirq(card); in init_card()
913 spin_unlock_irqrestore(&card->lock, flags); in init_card()
917 pr_notice("%s: IRQ %d count %d\n", card->name, in init_card()
918 card->irq, card->irqcnt); in init_card()
919 if (!card->irqcnt) { in init_card()
921 card->name, card->irq, 3 - cnt); in init_card()
922 reset_w6692(card); in init_card()
926 free_irq(card->irq, card); in init_card()
935 struct w6692_hw *card = bch->hw; in w6692_l2l1B() local
942 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
948 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
951 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
956 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
962 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1B()
965 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1B()
972 card->name, __func__, hh->prim, hh->id); in w6692_l2l1B()
987 open_bchannel(struct w6692_hw *card, struct channel_req *rq) in open_bchannel() argument
995 bch = &card->bc[rq->adr.channel - 1].bch; in open_bchannel()
1004 channel_ctrl(struct w6692_hw *card, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
1013 ret = l1_event(card->dch.l1, HW_TIMER3_VALUE | (cq->p1 & 0xff)); in channel_ctrl()
1016 pr_info("%s: unknown CTRL OP %x\n", card->name, cq->op); in channel_ctrl()
1028 struct w6692_hw *card = bch->hw; in w6692_bctrl() local
1032 pr_debug("%s: %s cmd:%x %p\n", card->name, __func__, cmd, arg); in w6692_bctrl()
1037 spin_lock_irqsave(&card->lock, flags); in w6692_bctrl()
1040 spin_unlock_irqrestore(&card->lock, flags); in w6692_bctrl()
1051 card->name, __func__, cmd); in w6692_bctrl()
1061 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_l2l1D() local
1069 spin_lock_irqsave(&card->lock, flags); in w6692_l2l1D()
1073 W6692_fill_Dfifo(card); in w6692_l2l1D()
1075 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1D()
1078 spin_unlock_irqrestore(&card->lock, flags); in w6692_l2l1D()
1097 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_l1callback() local
1100 pr_debug("%s: cmd(%x) state(%02x)\n", card->name, cmd, card->state); in w6692_l1callback()
1103 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1104 ph_command(card, W_L1CMD_AR8); in w6692_l1callback()
1105 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1108 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1109 ph_command(card, W_L1CMD_AR10); in w6692_l1callback()
1110 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1113 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1114 if (card->state != W_L1IND_DRD) in w6692_l1callback()
1115 ph_command(card, W_L1CMD_RST); in w6692_l1callback()
1116 ph_command(card, W_L1CMD_ECK); in w6692_l1callback()
1117 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1135 spin_lock_irqsave(&card->lock, flags); in w6692_l1callback()
1136 ph_command(card, W_L1CMD_ECK); in w6692_l1callback()
1137 spin_unlock_irqrestore(&card->lock, flags); in w6692_l1callback()
1150 pr_debug("%s: %s unknown command %x\n", card->name, in w6692_l1callback()
1158 open_dchannel(struct w6692_hw *card, struct channel_req *rq, void *caller) in open_dchannel() argument
1160 pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, in open_dchannel()
1161 card->dch.dev.id, caller); in open_dchannel()
1167 rq->ch = &card->dch.dev.D; in open_dchannel()
1169 if (card->dch.state == 7) in open_dchannel()
1180 struct w6692_hw *card = container_of(dch, struct w6692_hw, dch); in w6692_dctrl() local
1184 pr_debug("%s: DCTRL: %x %p\n", card->name, cmd, arg); in w6692_dctrl()
1189 err = open_dchannel(card, rq, __builtin_return_address(0)); in w6692_dctrl()
1191 err = open_bchannel(card, rq); in w6692_dctrl()
1195 pr_info("%s: cannot get module\n", card->name); in w6692_dctrl()
1198 pr_debug("%s: dev(%d) close from %p\n", card->name, in w6692_dctrl()
1203 err = channel_ctrl(card, arg); in w6692_dctrl()
1206 pr_debug("%s: unknown DCTRL command %x\n", card->name, cmd); in w6692_dctrl()
1213 setup_w6692(struct w6692_hw *card) in setup_w6692() argument
1217 if (!request_region(card->addr, 256, card->name)) { in setup_w6692()
1218 pr_info("%s: config port %x-%x already in use\n", card->name, in setup_w6692()
1219 card->addr, card->addr + 255); in setup_w6692()
1222 W6692Version(card); in setup_w6692()
1223 card->bc[0].addr = card->addr; in setup_w6692()
1224 card->bc[1].addr = card->addr + 0x40; in setup_w6692()
1225 val = ReadW6692(card, W_ISTA); in setup_w6692()
1227 pr_notice("%s ISTA=%02x\n", card->name, val); in setup_w6692()
1228 val = ReadW6692(card, W_IMASK); in setup_w6692()
1230 pr_notice("%s IMASK=%02x\n", card->name, val); in setup_w6692()
1231 val = ReadW6692(card, W_D_EXIR); in setup_w6692()
1233 pr_notice("%s D_EXIR=%02x\n", card->name, val); in setup_w6692()
1234 val = ReadW6692(card, W_D_EXIM); in setup_w6692()
1236 pr_notice("%s D_EXIM=%02x\n", card->name, val); in setup_w6692()
1237 val = ReadW6692(card, W_D_RSTA); in setup_w6692()
1239 pr_notice("%s D_RSTA=%02x\n", card->name, val); in setup_w6692()
1244 release_card(struct w6692_hw *card) in release_card() argument
1248 spin_lock_irqsave(&card->lock, flags); in release_card()
1249 disable_hwirq(card); in release_card()
1250 w6692_mode(&card->bc[0], ISDN_P_NONE); in release_card()
1251 w6692_mode(&card->bc[1], ISDN_P_NONE); in release_card()
1252 if ((card->fmask & led) || card->subtype == W6692_USR) { in release_card()
1253 card->xdata |= 0x04; /* LED OFF */ in release_card()
1254 WriteW6692(card, W_XDATA, card->xdata); in release_card()
1256 spin_unlock_irqrestore(&card->lock, flags); in release_card()
1257 free_irq(card->irq, card); in release_card()
1258 l1_event(card->dch.l1, CLOSE_CHANNEL); in release_card()
1259 mISDN_unregister_device(&card->dch.dev); in release_card()
1260 release_region(card->addr, 256); in release_card()
1261 mISDN_freebchannel(&card->bc[1].bch); in release_card()
1262 mISDN_freebchannel(&card->bc[0].bch); in release_card()
1263 mISDN_freedchannel(&card->dch); in release_card()
1265 list_del(&card->list); in release_card()
1267 pci_disable_device(card->pdev); in release_card()
1268 pci_set_drvdata(card->pdev, NULL); in release_card()
1269 kfree(card); in release_card()
1273 setup_instance(struct w6692_hw *card) in setup_instance() argument
1278 snprintf(card->name, MISDN_MAX_IDLEN - 1, "w6692.%d", w6692_cnt + 1); in setup_instance()
1280 list_add_tail(&card->list, &Cards); in setup_instance()
1282 card->fmask = (1 << w6692_cnt); in setup_instance()
1283 _set_debug(card); in setup_instance()
1284 spin_lock_init(&card->lock); in setup_instance()
1285 mISDN_initdchannel(&card->dch, MAX_DFRAME_LEN_L1, W6692_ph_bh); in setup_instance()
1286 card->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0); in setup_instance()
1287 card->dch.dev.D.send = w6692_l2l1D; in setup_instance()
1288 card->dch.dev.D.ctrl = w6692_dctrl; in setup_instance()
1289 card->dch.dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in setup_instance()
1291 card->dch.hw = card; in setup_instance()
1292 card->dch.dev.nrbchan = 2; in setup_instance()
1294 mISDN_initbchannel(&card->bc[i].bch, MAX_DATA_MEM, in setup_instance()
1296 card->bc[i].bch.hw = card; in setup_instance()
1297 card->bc[i].bch.nr = i + 1; in setup_instance()
1298 card->bc[i].bch.ch.nr = i + 1; in setup_instance()
1299 card->bc[i].bch.ch.send = w6692_l2l1B; in setup_instance()
1300 card->bc[i].bch.ch.ctrl = w6692_bctrl; in setup_instance()
1301 set_channelmap(i + 1, card->dch.dev.channelmap); in setup_instance()
1302 list_add(&card->bc[i].bch.ch.list, &card->dch.dev.bchannels); in setup_instance()
1304 err = setup_w6692(card); in setup_instance()
1307 err = mISDN_register_device(&card->dch.dev, &card->pdev->dev, in setup_instance()
1308 card->name); in setup_instance()
1311 err = init_card(card); in setup_instance()
1314 err = create_l1(&card->dch, w6692_l1callback); in setup_instance()
1321 free_irq(card->irq, card); in setup_instance()
1323 mISDN_unregister_device(&card->dch.dev); in setup_instance()
1325 release_region(card->addr, 256); in setup_instance()
1327 mISDN_freebchannel(&card->bc[1].bch); in setup_instance()
1328 mISDN_freebchannel(&card->bc[0].bch); in setup_instance()
1329 mISDN_freedchannel(&card->dch); in setup_instance()
1331 list_del(&card->list); in setup_instance()
1333 kfree(card); in setup_instance()
1341 struct w6692_hw *card; in w6692_probe() local
1344 card = kzalloc(sizeof(struct w6692_hw), GFP_KERNEL); in w6692_probe()
1345 if (!card) { in w6692_probe()
1349 card->pdev = pdev; in w6692_probe()
1350 card->subtype = m->subtype; in w6692_probe()
1353 kfree(card); in w6692_probe()
1360 card->addr = pci_resource_start(pdev, 1); in w6692_probe()
1361 card->irq = pdev->irq; in w6692_probe()
1362 pci_set_drvdata(pdev, card); in w6692_probe()
1363 err = setup_instance(card); in w6692_probe()
1372 struct w6692_hw *card = pci_get_drvdata(pdev); in w6692_remove_pci() local
1374 if (card) in w6692_remove_pci()
1375 release_card(card); in w6692_remove_pci()