Lines Matching +full:cmd +full:- +full:cnt +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0-only
101 u8 cmd; member
103 u8 cmd;
121 char name[MISDN_MAX_IDLEN]; member
140 card->isac.dch.debug = debug; in _set_debug()
141 card->bch[0].debug = debug; in _set_debug()
142 card->bch[1].debug = debug; in _set_debug()
176 outb(idx, fc->addr + CHIP_INDEX); in ReadISAC_V1()
177 return inb(fc->addr + CHIP_WINDOW + (offset & 0xf)); in ReadISAC_V1()
186 outb(idx, fc->addr + CHIP_INDEX); in WriteISAC_V1()
187 outb(value, fc->addr + CHIP_WINDOW + (offset & 0xf)); in WriteISAC_V1()
195 outb(AVM_ISAC_FIFO, fc->addr + CHIP_INDEX); in ReadFiFoISAC_V1()
196 insb(fc->addr + CHIP_WINDOW, data, size); in ReadFiFoISAC_V1()
204 outb(AVM_ISAC_FIFO, fc->addr + CHIP_INDEX); in WriteFiFoISAC_V1()
205 outsb(fc->addr + CHIP_WINDOW, data, size); in WriteFiFoISAC_V1()
213 outl(offset, fc->addr + AVM_ISACX_INDEX); in ReadISAC_V2()
214 return 0xff & inl(fc->addr + AVM_ISACX_DATA); in ReadISAC_V2()
222 outl(offset, fc->addr + AVM_ISACX_INDEX); in WriteISAC_V2()
223 outl(value, fc->addr + AVM_ISACX_DATA); in WriteISAC_V2()
232 outl(off, fc->addr + AVM_ISACX_INDEX); in ReadFiFoISAC_V2()
234 data[i] = 0xff & inl(fc->addr + AVM_ISACX_DATA); in ReadFiFoISAC_V2()
243 outl(off, fc->addr + AVM_ISACX_INDEX); in WriteFiFoISAC_V2()
245 outl(data[i], fc->addr + AVM_ISACX_DATA); in WriteFiFoISAC_V2()
251 if (test_bit(FLG_ACTIVE, &fc->bch[0].Flags) && in Sel_BCS()
252 (fc->bch[0].nr & channel)) in Sel_BCS()
253 return &fc->bch[0]; in Sel_BCS()
254 else if (test_bit(FLG_ACTIVE, &fc->bch[1].Flags) && in Sel_BCS()
255 (fc->bch[1].nr & channel)) in Sel_BCS()
256 return &fc->bch[1]; in Sel_BCS()
265 outl(idx, fc->addr + CHIP_INDEX); in __write_ctrl_pci()
266 outl(hdlc->ctrl.ctrl, fc->addr + CHIP_WINDOW + HDLC_STATUS); in __write_ctrl_pci()
271 outl(hdlc->ctrl.ctrl, fc->addr + (channel == 2 ? AVM_HDLC_STATUS_2 : in __write_ctrl_pciv2()
277 struct fritzcard *fc = bch->hw; in write_ctrl()
280 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in write_ctrl()
281 pr_debug("%s: hdlc %c wr%x ctrl %x\n", fc->name, '@' + bch->nr, in write_ctrl()
282 which, hdlc->ctrl.ctrl); in write_ctrl()
283 switch (fc->type) { in write_ctrl()
285 __write_ctrl_pciv2(fc, hdlc, bch->nr); in write_ctrl()
288 __write_ctrl_pci(fc, hdlc, bch->nr); in write_ctrl()
312 switch (fc->type) { in read_status()
314 return __read_status_pciv2(fc->addr, channel); in read_status()
316 return __read_status_pci(fc->addr, channel); in read_status()
325 fc->ctrlreg |= AVM_STATUS0_ENA_IRQ; in enable_hwirq()
326 outb(fc->ctrlreg, fc->addr + 2); in enable_hwirq()
332 fc->ctrlreg &= ~AVM_STATUS0_ENA_IRQ; in disable_hwirq()
333 outb(fc->ctrlreg, fc->addr + 2); in disable_hwirq()
339 struct fritzcard *fc = bch->hw; in modehdlc()
343 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in modehdlc()
344 pr_debug("%s: hdlc %c protocol %x-->%x ch %d\n", fc->name, in modehdlc()
345 '@' + bch->nr, bch->state, protocol, bch->nr); in modehdlc()
346 hdlc->ctrl.ctrl = 0; in modehdlc()
347 mode = (fc->type == AVM_FRITZ_PCIV2) ? HDLC_FIFO_SIZE_128 : 0; in modehdlc()
350 case -1: /* used for init */ in modehdlc()
351 bch->state = -1; in modehdlc()
354 if (bch->state == ISDN_P_NONE) in modehdlc()
356 hdlc->ctrl.sr.cmd = HDLC_CMD_XRS | HDLC_CMD_RRS; in modehdlc()
357 hdlc->ctrl.sr.mode = mode | HDLC_MODE_TRANS; in modehdlc()
359 bch->state = ISDN_P_NONE; in modehdlc()
360 test_and_clear_bit(FLG_HDLC, &bch->Flags); in modehdlc()
361 test_and_clear_bit(FLG_TRANSPARENT, &bch->Flags); in modehdlc()
364 bch->state = protocol; in modehdlc()
365 hdlc->ctrl.sr.cmd = HDLC_CMD_XRS | HDLC_CMD_RRS; in modehdlc()
366 hdlc->ctrl.sr.mode = mode | HDLC_MODE_TRANS; in modehdlc()
368 hdlc->ctrl.sr.cmd = HDLC_CMD_XRS; in modehdlc()
370 hdlc->ctrl.sr.cmd = 0; in modehdlc()
371 test_and_set_bit(FLG_TRANSPARENT, &bch->Flags); in modehdlc()
374 bch->state = protocol; in modehdlc()
375 hdlc->ctrl.sr.cmd = HDLC_CMD_XRS | HDLC_CMD_RRS; in modehdlc()
376 hdlc->ctrl.sr.mode = mode | HDLC_MODE_ITF_FLG; in modehdlc()
378 hdlc->ctrl.sr.cmd = HDLC_CMD_XRS; in modehdlc()
380 hdlc->ctrl.sr.cmd = 0; in modehdlc()
381 test_and_set_bit(FLG_HDLC, &bch->Flags); in modehdlc()
384 pr_info("%s: protocol not known %x\n", fc->name, protocol); in modehdlc()
385 return -ENOPROTOOPT; in modehdlc()
396 int cnt; in hdlc_empty_fifo() local
397 struct fritzcard *fc = bch->hw; in hdlc_empty_fifo()
399 pr_debug("%s: %s %d\n", fc->name, __func__, count); in hdlc_empty_fifo()
400 if (test_bit(FLG_RX_OFF, &bch->Flags)) { in hdlc_empty_fifo()
402 bch->dropcnt += count; in hdlc_empty_fifo()
404 cnt = bchannel_get_rxbuf(bch, count); in hdlc_empty_fifo()
405 if (cnt < 0) { in hdlc_empty_fifo()
407 fc->name, bch->nr, count); in hdlc_empty_fifo()
410 p = skb_put(bch->rx_skb, count); in hdlc_empty_fifo()
413 if (fc->type == AVM_FRITZ_PCIV2) in hdlc_empty_fifo()
414 addr = fc->addr + (bch->nr == 2 ? in hdlc_empty_fifo()
417 addr = fc->addr + CHIP_WINDOW; in hdlc_empty_fifo()
418 outl(bch->nr == 2 ? AVM_HDLC_2 : AVM_HDLC_1, fc->addr); in hdlc_empty_fifo()
420 cnt = 0; in hdlc_empty_fifo()
421 while (cnt < count) { in hdlc_empty_fifo()
427 cnt += 4; in hdlc_empty_fifo()
430 snprintf(fc->log, LOG_SIZE, "B%1d-recv %s %d ", in hdlc_empty_fifo()
431 bch->nr, fc->name, count); in hdlc_empty_fifo()
432 print_hex_dump_bytes(fc->log, DUMP_PREFIX_OFFSET, p, count); in hdlc_empty_fifo()
439 struct fritzcard *fc = bch->hw; in hdlc_fill_fifo()
441 int count, fs, cnt = 0, idx; in hdlc_fill_fifo() local
446 idx = (bch->nr - 1) & 1; in hdlc_fill_fifo()
447 hdlc = &fc->hdlc[idx]; in hdlc_fill_fifo()
448 fs = (fc->type == AVM_FRITZ_PCIV2) ? in hdlc_fill_fifo()
450 if (!bch->tx_skb) { in hdlc_fill_fifo()
451 if (!test_bit(FLG_TX_EMPTY, &bch->Flags)) in hdlc_fill_fifo()
454 p = bch->fill; in hdlc_fill_fifo()
457 count = bch->tx_skb->len - bch->tx_idx; in hdlc_fill_fifo()
460 p = bch->tx_skb->data + bch->tx_idx; in hdlc_fill_fifo()
462 hdlc->ctrl.sr.cmd &= ~HDLC_CMD_XME; in hdlc_fill_fifo()
466 if (test_bit(FLG_HDLC, &bch->Flags)) in hdlc_fill_fifo()
467 hdlc->ctrl.sr.cmd |= HDLC_CMD_XME; in hdlc_fill_fifo()
471 pr_debug("%s.B%d: %d/%d/%d", fc->name, bch->nr, count, in hdlc_fill_fifo()
472 bch->tx_idx, bch->tx_skb->len); in hdlc_fill_fifo()
473 bch->tx_idx += count; in hdlc_fill_fifo()
475 pr_debug("%s.B%d: fillempty %d\n", fc->name, bch->nr, count); in hdlc_fill_fifo()
477 hdlc->ctrl.sr.xml = ((count == fs) ? 0 : count); in hdlc_fill_fifo()
478 if (fc->type == AVM_FRITZ_PCIV2) { in hdlc_fill_fifo()
479 __write_ctrl_pciv2(fc, hdlc, bch->nr); in hdlc_fill_fifo()
480 addr = fc->addr + (bch->nr == 2 ? in hdlc_fill_fifo()
483 __write_ctrl_pci(fc, hdlc, bch->nr); in hdlc_fill_fifo()
484 addr = fc->addr + CHIP_WINDOW; in hdlc_fill_fifo()
487 while (cnt < count) { in hdlc_fill_fifo()
488 /* all bytes the same - no worry about endian */ in hdlc_fill_fifo()
490 cnt += 4; in hdlc_fill_fifo()
493 while (cnt < count) { in hdlc_fill_fifo()
497 cnt += 4; in hdlc_fill_fifo()
501 snprintf(fc->log, LOG_SIZE, "B%1d-send %s %d ", in hdlc_fill_fifo()
502 bch->nr, fc->name, count); in hdlc_fill_fifo()
503 print_hex_dump_bytes(fc->log, DUMP_PREFIX_OFFSET, p, count); in hdlc_fill_fifo()
510 if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) { in HDLC_irq_xpr()
513 dev_kfree_skb(bch->tx_skb); in HDLC_irq_xpr()
516 test_and_clear_bit(FLG_TX_EMPTY, &bch->Flags); in HDLC_irq_xpr()
517 } else if (test_bit(FLG_TX_EMPTY, &bch->Flags)) { in HDLC_irq_xpr()
526 struct fritzcard *fc = bch->hw; in HDLC_irq()
531 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in HDLC_irq()
532 pr_debug("%s: ch%d stat %#x\n", fc->name, bch->nr, stat); in HDLC_irq()
533 if (fc->type == AVM_FRITZ_PCIV2) { in HDLC_irq()
543 fc->name, bch->nr, stat); in HDLC_irq()
544 hdlc->ctrl.sr.xml = 0; in HDLC_irq()
545 hdlc->ctrl.sr.cmd |= HDLC_CMD_RRS; in HDLC_irq()
547 hdlc->ctrl.sr.cmd &= ~HDLC_CMD_RRS; in HDLC_irq()
549 if (bch->rx_skb) in HDLC_irq()
550 skb_trim(bch->rx_skb, 0); in HDLC_irq()
556 if (!bch->rx_skb) in HDLC_irq()
558 if (test_bit(FLG_TRANSPARENT, &bch->Flags)) { in HDLC_irq()
566 fc->name); in HDLC_irq()
567 skb_trim(bch->rx_skb, 0); in HDLC_irq()
578 pr_warn("%s: ch%d stat %x XDU %s\n", fc->name, bch->nr, in HDLC_irq()
579 stat, bch->tx_skb ? "tx_skb" : "no tx_skb"); in HDLC_irq()
580 if (bch->tx_skb && bch->tx_skb->len) { in HDLC_irq()
581 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in HDLC_irq()
582 bch->tx_idx = 0; in HDLC_irq()
583 } else if (test_bit(FLG_FILLEMPTY, &bch->Flags)) { in HDLC_irq()
584 test_and_set_bit(FLG_TX_EMPTY, &bch->Flags); in HDLC_irq()
586 hdlc->ctrl.sr.xml = 0; in HDLC_irq()
587 hdlc->ctrl.sr.cmd |= HDLC_CMD_XRS; in HDLC_irq()
589 hdlc->ctrl.sr.cmd &= ~HDLC_CMD_XRS; in HDLC_irq()
608 pr_debug("%s: spurious ch1 IRQ\n", fc->name); in HDLC_irq_main()
616 pr_debug("%s: spurious ch2 IRQ\n", fc->name); in HDLC_irq_main()
627 spin_lock(&fc->lock); in avm_fritz_interrupt()
628 sval = inb(fc->addr + 2); in avm_fritz_interrupt()
629 pr_debug("%s: irq stat0 %x\n", fc->name, sval); in avm_fritz_interrupt()
632 spin_unlock(&fc->lock); in avm_fritz_interrupt()
635 fc->irqcnt++; in avm_fritz_interrupt()
639 mISDNisac_irq(&fc->isac, val); in avm_fritz_interrupt()
643 spin_unlock(&fc->lock); in avm_fritz_interrupt()
654 spin_lock(&fc->lock); in avm_fritzv2_interrupt()
655 sval = inb(fc->addr + 2); in avm_fritzv2_interrupt()
656 pr_debug("%s: irq stat0 %x\n", fc->name, sval); in avm_fritzv2_interrupt()
659 spin_unlock(&fc->lock); in avm_fritzv2_interrupt()
662 fc->irqcnt++; in avm_fritzv2_interrupt()
668 mISDNisac_irq(&fc->isac, val); in avm_fritzv2_interrupt()
671 pr_debug("%s: timer irq\n", fc->name); in avm_fritzv2_interrupt()
672 outb(fc->ctrlreg | AVM_STATUS0_RES_TIMER, fc->addr + 2); in avm_fritzv2_interrupt()
674 outb(fc->ctrlreg, fc->addr + 2); in avm_fritzv2_interrupt()
676 spin_unlock(&fc->lock); in avm_fritzv2_interrupt()
684 struct fritzcard *fc = bch->hw; in avm_l2l1B()
685 int ret = -EINVAL; in avm_l2l1B()
689 switch (hh->prim) { in avm_l2l1B()
691 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
697 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
700 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
701 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in avm_l2l1B()
702 ret = modehdlc(bch, ch->protocol); in avm_l2l1B()
705 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
711 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
714 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
728 modehdlc(&fc->bch[0], -1); in inithdlc()
729 modehdlc(&fc->bch[1], -1); in inithdlc()
738 pr_debug("%s: HDLC 1 STA %x\n", fc->name, val); in clear_pending_hdlc_ints()
740 pr_debug("%s: HDLC 2 STA %x\n", fc->name, val); in clear_pending_hdlc_ints()
746 switch (fc->type) { in reset_avm()
748 fc->ctrlreg = AVM_STATUS0_RESET | AVM_STATUS0_DIS_TIMER; in reset_avm()
751 fc->ctrlreg = AVM_STATUS0_RESET; in reset_avm()
755 pr_notice("%s: reset\n", fc->name); in reset_avm()
758 switch (fc->type) { in reset_avm()
760 fc->ctrlreg = AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER; in reset_avm()
762 outb(AVM_STATUS1_ENA_IOM, fc->addr + 3); in reset_avm()
765 fc->ctrlreg = 0; in reset_avm()
771 pr_notice("%s: S0/S1 %x/%x\n", fc->name, in reset_avm()
772 inb(fc->addr + 2), inb(fc->addr + 3)); in reset_avm()
778 int ret, cnt = 3; in init_card() local
782 if (fc->type == AVM_FRITZ_PCIV2) in init_card()
783 ret = request_irq(fc->irq, avm_fritzv2_interrupt, in init_card()
784 IRQF_SHARED, fc->name, fc); in init_card()
786 ret = request_irq(fc->irq, avm_fritz_interrupt, in init_card()
787 IRQF_SHARED, fc->name, fc); in init_card()
790 fc->name, fc->irq); in init_card()
793 while (cnt--) { in init_card()
794 spin_lock_irqsave(&fc->lock, flags); in init_card()
795 ret = fc->isac.init(&fc->isac); in init_card()
797 spin_unlock_irqrestore(&fc->lock, flags); in init_card()
799 fc->name, ret); in init_card()
806 if (fc->type == AVM_FRITZ_PCIV2) { in init_card()
813 spin_unlock_irqrestore(&fc->lock, flags); in init_card()
817 pr_notice("%s: IRQ %d count %d\n", fc->name, in init_card()
818 fc->irq, fc->irqcnt); in init_card()
819 if (!fc->irqcnt) { in init_card()
821 fc->name, fc->irq, 3 - cnt); in init_card()
826 free_irq(fc->irq, fc); in init_card()
827 return -EIO; in init_card()
837 avm_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg) in avm_bctrl() argument
840 struct fritzcard *fc = bch->hw; in avm_bctrl()
841 int ret = -EINVAL; in avm_bctrl()
844 pr_debug("%s: %s cmd:%x %p\n", fc->name, __func__, cmd, arg); in avm_bctrl()
845 switch (cmd) { in avm_bctrl()
847 test_and_clear_bit(FLG_OPEN, &bch->Flags); in avm_bctrl()
848 cancel_work_sync(&bch->workq); in avm_bctrl()
849 spin_lock_irqsave(&fc->lock, flags); in avm_bctrl()
852 spin_unlock_irqrestore(&fc->lock, flags); in avm_bctrl()
853 ch->protocol = ISDN_P_NONE; in avm_bctrl()
854 ch->peer = NULL; in avm_bctrl()
862 pr_info("%s: %s unknown prim(%x)\n", fc->name, __func__, cmd); in avm_bctrl()
872 switch (cq->op) { in channel_ctrl()
874 cq->op = MISDN_CTRL_LOOP | MISDN_CTRL_L1_TIMER3; in channel_ctrl()
877 /* cq->channel: 0 disable, 1 B1 loop 2 B2 loop, 3 both */ in channel_ctrl()
878 if (cq->channel < 0 || cq->channel > 3) { in channel_ctrl()
879 ret = -EINVAL; in channel_ctrl()
882 ret = fc->isac.ctrl(&fc->isac, HW_TESTLOOP, cq->channel); in channel_ctrl()
885 ret = fc->isac.ctrl(&fc->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
888 pr_info("%s: %s unknown Op %x\n", fc->name, __func__, cq->op); in channel_ctrl()
889 ret = -EINVAL; in channel_ctrl()
900 if (rq->adr.channel == 0 || rq->adr.channel > 2) in open_bchannel()
901 return -EINVAL; in open_bchannel()
902 if (rq->protocol == ISDN_P_NONE) in open_bchannel()
903 return -EINVAL; in open_bchannel()
904 bch = &fc->bch[rq->adr.channel - 1]; in open_bchannel()
905 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
906 return -EBUSY; /* b-channel can be only open once */ in open_bchannel()
907 bch->ch.protocol = rq->protocol; in open_bchannel()
908 rq->ch = &bch->ch; in open_bchannel()
916 avm_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg) in avm_dctrl() argument
920 struct fritzcard *fc = dch->hw; in avm_dctrl()
924 pr_debug("%s: %s cmd:%x %p\n", fc->name, __func__, cmd, arg); in avm_dctrl()
925 switch (cmd) { in avm_dctrl()
928 if (rq->protocol == ISDN_P_TE_S0) in avm_dctrl()
929 err = fc->isac.open(&fc->isac, rq); in avm_dctrl()
935 pr_info("%s: cannot get module\n", fc->name); in avm_dctrl()
938 pr_debug("%s: dev(%d) close from %p\n", fc->name, dch->dev.id, in avm_dctrl()
947 fc->name, __func__, cmd); in avm_dctrl()
948 return -EINVAL; in avm_dctrl()
958 if (!request_region(fc->addr, 32, fc->name)) { in setup_fritz()
959 pr_info("%s: AVM config port %x-%x already in use\n", in setup_fritz()
960 fc->name, fc->addr, fc->addr + 31); in setup_fritz()
961 return -EIO; in setup_fritz()
963 switch (fc->type) { in setup_fritz()
965 val = inl(fc->addr); in setup_fritz()
966 outl(AVM_HDLC_1, fc->addr + CHIP_INDEX); in setup_fritz()
967 ver = inl(fc->addr + CHIP_WINDOW + HDLC_STATUS) >> 24; in setup_fritz()
969 pr_notice("%s: PCI stat %#x\n", fc->name, val); in setup_fritz()
970 pr_notice("%s: PCI Class %X Rev %d\n", fc->name, in setup_fritz()
972 pr_notice("%s: HDLC version %x\n", fc->name, ver & 0xf); in setup_fritz()
974 ASSIGN_FUNC(V1, ISAC, fc->isac); in setup_fritz()
975 fc->isac.type = IPAC_TYPE_ISAC; in setup_fritz()
978 val = inl(fc->addr); in setup_fritz()
979 ver = inl(fc->addr + AVM_HDLC_STATUS_1) >> 24; in setup_fritz()
981 pr_notice("%s: PCI V2 stat %#x\n", fc->name, val); in setup_fritz()
982 pr_notice("%s: PCI V2 Class %X Rev %d\n", fc->name, in setup_fritz()
984 pr_notice("%s: HDLC version %x\n", fc->name, ver & 0xf); in setup_fritz()
986 ASSIGN_FUNC(V2, ISAC, fc->isac); in setup_fritz()
987 fc->isac.type = IPAC_TYPE_ISACX; in setup_fritz()
990 release_region(fc->addr, 32); in setup_fritz()
991 pr_info("%s: AVM unknown type %d\n", fc->name, fc->type); in setup_fritz()
992 return -ENODEV; in setup_fritz()
994 pr_notice("%s: %s config irq:%d base:0x%X\n", fc->name, in setup_fritz()
995 (fc->type == AVM_FRITZ_PCI) ? "AVM Fritz!CARD PCI" : in setup_fritz()
996 "AVM Fritz!CARD PCIv2", fc->irq, fc->addr); in setup_fritz()
1006 spin_lock_irqsave(&card->lock, flags); in release_card()
1007 modehdlc(&card->bch[0], ISDN_P_NONE); in release_card()
1008 modehdlc(&card->bch[1], ISDN_P_NONE); in release_card()
1009 spin_unlock_irqrestore(&card->lock, flags); in release_card()
1010 card->isac.release(&card->isac); in release_card()
1011 free_irq(card->irq, card); in release_card()
1012 mISDN_freebchannel(&card->bch[1]); in release_card()
1013 mISDN_freebchannel(&card->bch[0]); in release_card()
1014 mISDN_unregister_device(&card->isac.dch.dev); in release_card()
1015 release_region(card->addr, 32); in release_card()
1016 pci_disable_device(card->pdev); in release_card()
1017 pci_set_drvdata(card->pdev, NULL); in release_card()
1019 list_del(&card->list); in release_card()
1022 AVM_cnt--; in release_card()
1032 snprintf(card->name, MISDN_MAX_IDLEN - 1, "AVM.%d", AVM_cnt + 1); in setup_instance()
1034 list_add_tail(&card->list, &Cards); in setup_instance()
1038 card->isac.name = card->name; in setup_instance()
1039 spin_lock_init(&card->lock); in setup_instance()
1040 card->isac.hwlock = &card->lock; in setup_instance()
1041 mISDNisac_init(&card->isac, card); in setup_instance()
1043 card->isac.dch.dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in setup_instance()
1045 card->isac.dch.dev.D.ctrl = avm_dctrl; in setup_instance()
1047 card->bch[i].nr = i + 1; in setup_instance()
1048 set_channelmap(i + 1, card->isac.dch.dev.channelmap); in setup_instance()
1049 if (AVM_FRITZ_PCIV2 == card->type) in setup_instance()
1053 mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM, minsize); in setup_instance()
1054 card->bch[i].hw = card; in setup_instance()
1055 card->bch[i].ch.send = avm_l2l1B; in setup_instance()
1056 card->bch[i].ch.ctrl = avm_bctrl; in setup_instance()
1057 card->bch[i].ch.nr = i + 1; in setup_instance()
1058 list_add(&card->bch[i].ch.list, &card->isac.dch.dev.bchannels); in setup_instance()
1063 err = mISDN_register_device(&card->isac.dch.dev, &card->pdev->dev, in setup_instance()
1064 card->name); in setup_instance()
1073 mISDN_unregister_device(&card->isac.dch.dev); in setup_instance()
1075 release_region(card->addr, 32); in setup_instance()
1077 card->isac.release(&card->isac); in setup_instance()
1078 mISDN_freebchannel(&card->bch[1]); in setup_instance()
1079 mISDN_freebchannel(&card->bch[0]); in setup_instance()
1081 list_del(&card->list); in setup_instance()
1090 int err = -ENOMEM; in fritzpci_probe()
1098 if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2) in fritzpci_probe()
1099 card->type = AVM_FRITZ_PCIV2; in fritzpci_probe()
1101 card->type = AVM_FRITZ_PCI; in fritzpci_probe()
1102 card->pdev = pdev; in fritzpci_probe()
1110 (char *) ent->driver_data, pci_name(pdev)); in fritzpci_probe()
1112 card->addr = pci_resource_start(pdev, 1); in fritzpci_probe()
1113 card->irq = pdev->irq; in fritzpci_probe()
1143 .name = "fcpci",