• Home
  • Raw
  • Download

Lines Matching refs:fc

172 	struct fritzcard *fc = p;  in ReadISAC_V1()  local
175 outb(idx, fc->addr + CHIP_INDEX); in ReadISAC_V1()
176 return inb(fc->addr + CHIP_WINDOW + (offset & 0xf)); in ReadISAC_V1()
182 struct fritzcard *fc = p; in WriteISAC_V1() local
185 outb(idx, fc->addr + CHIP_INDEX); in WriteISAC_V1()
186 outb(value, fc->addr + CHIP_WINDOW + (offset & 0xf)); in WriteISAC_V1()
192 struct fritzcard *fc = p; in ReadFiFoISAC_V1() local
194 outb(AVM_ISAC_FIFO, fc->addr + CHIP_INDEX); in ReadFiFoISAC_V1()
195 insb(fc->addr + CHIP_WINDOW, data, size); in ReadFiFoISAC_V1()
201 struct fritzcard *fc = p; in WriteFiFoISAC_V1() local
203 outb(AVM_ISAC_FIFO, fc->addr + CHIP_INDEX); in WriteFiFoISAC_V1()
204 outsb(fc->addr + CHIP_WINDOW, data, size); in WriteFiFoISAC_V1()
210 struct fritzcard *fc = p; in ReadISAC_V2() local
212 outl(offset, fc->addr + AVM_ISACX_INDEX); in ReadISAC_V2()
213 return 0xff & inl(fc->addr + AVM_ISACX_DATA); in ReadISAC_V2()
219 struct fritzcard *fc = p; in WriteISAC_V2() local
221 outl(offset, fc->addr + AVM_ISACX_INDEX); in WriteISAC_V2()
222 outl(value, fc->addr + AVM_ISACX_DATA); in WriteISAC_V2()
228 struct fritzcard *fc = p; in ReadFiFoISAC_V2() local
231 outl(off, fc->addr + AVM_ISACX_INDEX); in ReadFiFoISAC_V2()
233 data[i] = 0xff & inl(fc->addr + AVM_ISACX_DATA); in ReadFiFoISAC_V2()
239 struct fritzcard *fc = p; in WriteFiFoISAC_V2() local
242 outl(off, fc->addr + AVM_ISACX_INDEX); in WriteFiFoISAC_V2()
244 outl(data[i], fc->addr + AVM_ISACX_DATA); in WriteFiFoISAC_V2()
248 Sel_BCS(struct fritzcard *fc, u32 channel) in Sel_BCS() argument
250 if (test_bit(FLG_ACTIVE, &fc->bch[0].Flags) && in Sel_BCS()
251 (fc->bch[0].nr & channel)) in Sel_BCS()
252 return &fc->bch[0]; in Sel_BCS()
253 else if (test_bit(FLG_ACTIVE, &fc->bch[1].Flags) && in Sel_BCS()
254 (fc->bch[1].nr & channel)) in Sel_BCS()
255 return &fc->bch[1]; in Sel_BCS()
261 __write_ctrl_pci(struct fritzcard *fc, struct hdlc_hw *hdlc, u32 channel) { in __write_ctrl_pci() argument
264 outl(idx, fc->addr + CHIP_INDEX); in __write_ctrl_pci()
265 outl(hdlc->ctrl.ctrl, fc->addr + CHIP_WINDOW + HDLC_STATUS); in __write_ctrl_pci()
269 __write_ctrl_pciv2(struct fritzcard *fc, struct hdlc_hw *hdlc, u32 channel) { in __write_ctrl_pciv2() argument
270 outl(hdlc->ctrl.ctrl, fc->addr + (channel == 2 ? AVM_HDLC_STATUS_2 : in __write_ctrl_pciv2()
276 struct fritzcard *fc = bch->hw; in write_ctrl() local
279 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in write_ctrl()
280 pr_debug("%s: hdlc %c wr%x ctrl %x\n", fc->name, '@' + bch->nr, in write_ctrl()
282 switch (fc->type) { in write_ctrl()
284 __write_ctrl_pciv2(fc, hdlc, bch->nr); in write_ctrl()
287 __write_ctrl_pci(fc, hdlc, bch->nr); in write_ctrl()
309 read_status(struct fritzcard *fc, u32 channel) in read_status() argument
311 switch (fc->type) { in read_status()
313 return __read_status_pciv2(fc->addr, channel); in read_status()
315 return __read_status_pci(fc->addr, channel); in read_status()
322 enable_hwirq(struct fritzcard *fc) in enable_hwirq() argument
324 fc->ctrlreg |= AVM_STATUS0_ENA_IRQ; in enable_hwirq()
325 outb(fc->ctrlreg, fc->addr + 2); in enable_hwirq()
329 disable_hwirq(struct fritzcard *fc) in disable_hwirq() argument
331 fc->ctrlreg &= ~AVM_STATUS0_ENA_IRQ; in disable_hwirq()
332 outb(fc->ctrlreg, fc->addr + 2); in disable_hwirq()
338 struct fritzcard *fc = bch->hw; in modehdlc() local
342 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in modehdlc()
343 pr_debug("%s: hdlc %c protocol %x-->%x ch %d\n", fc->name, in modehdlc()
346 mode = (fc->type == AVM_FRITZ_PCIV2) ? HDLC_FIFO_SIZE_128 : 0; in modehdlc()
383 pr_info("%s: protocol not known %x\n", fc->name, protocol); in modehdlc()
396 struct fritzcard *fc = bch->hw; in hdlc_empty_fifo() local
398 pr_debug("%s: %s %d\n", fc->name, __func__, count); in hdlc_empty_fifo()
406 fc->name, bch->nr, count); in hdlc_empty_fifo()
412 if (fc->type == AVM_FRITZ_PCIV2) in hdlc_empty_fifo()
413 addr = fc->addr + (bch->nr == 2 ? in hdlc_empty_fifo()
416 addr = fc->addr + CHIP_WINDOW; in hdlc_empty_fifo()
417 outl(bch->nr == 2 ? AVM_HDLC_2 : AVM_HDLC_1, fc->addr); in hdlc_empty_fifo()
429 snprintf(fc->log, LOG_SIZE, "B%1d-recv %s %d ", in hdlc_empty_fifo()
430 bch->nr, fc->name, count); in hdlc_empty_fifo()
431 print_hex_dump_bytes(fc->log, DUMP_PREFIX_OFFSET, p, count); in hdlc_empty_fifo()
438 struct fritzcard *fc = bch->hw; in hdlc_fill_fifo() local
446 hdlc = &fc->hdlc[idx]; in hdlc_fill_fifo()
447 fs = (fc->type == AVM_FRITZ_PCIV2) ? in hdlc_fill_fifo()
470 pr_debug("%s.B%d: %d/%d/%d", fc->name, bch->nr, count, in hdlc_fill_fifo()
474 pr_debug("%s.B%d: fillempty %d\n", fc->name, bch->nr, count); in hdlc_fill_fifo()
477 if (fc->type == AVM_FRITZ_PCIV2) { in hdlc_fill_fifo()
478 __write_ctrl_pciv2(fc, hdlc, bch->nr); in hdlc_fill_fifo()
479 addr = fc->addr + (bch->nr == 2 ? in hdlc_fill_fifo()
482 __write_ctrl_pci(fc, hdlc, bch->nr); in hdlc_fill_fifo()
483 addr = fc->addr + CHIP_WINDOW; in hdlc_fill_fifo()
500 snprintf(fc->log, LOG_SIZE, "B%1d-send %s %d ", in hdlc_fill_fifo()
501 bch->nr, fc->name, count); in hdlc_fill_fifo()
502 print_hex_dump_bytes(fc->log, DUMP_PREFIX_OFFSET, p, count); in hdlc_fill_fifo()
525 struct fritzcard *fc = bch->hw; in HDLC_irq() local
530 hdlc = &fc->hdlc[(bch->nr - 1) & 1]; in HDLC_irq()
531 pr_debug("%s: ch%d stat %#x\n", fc->name, bch->nr, stat); in HDLC_irq()
532 if (fc->type == AVM_FRITZ_PCIV2) { in HDLC_irq()
542 fc->name, bch->nr, stat); in HDLC_irq()
565 fc->name); in HDLC_irq()
577 pr_warn("%s: ch%d stat %x XDU %s\n", fc->name, bch->nr, in HDLC_irq()
596 HDLC_irq_main(struct fritzcard *fc) in HDLC_irq_main() argument
601 stat = read_status(fc, 1); in HDLC_irq_main()
603 bch = Sel_BCS(fc, 1); in HDLC_irq_main()
607 pr_debug("%s: spurious ch1 IRQ\n", fc->name); in HDLC_irq_main()
609 stat = read_status(fc, 2); in HDLC_irq_main()
611 bch = Sel_BCS(fc, 2); in HDLC_irq_main()
615 pr_debug("%s: spurious ch2 IRQ\n", fc->name); in HDLC_irq_main()
622 struct fritzcard *fc = dev_id; in avm_fritz_interrupt() local
626 spin_lock(&fc->lock); in avm_fritz_interrupt()
627 sval = inb(fc->addr + 2); in avm_fritz_interrupt()
628 pr_debug("%s: irq stat0 %x\n", fc->name, sval); in avm_fritz_interrupt()
631 spin_unlock(&fc->lock); in avm_fritz_interrupt()
634 fc->irqcnt++; in avm_fritz_interrupt()
637 val = ReadISAC_V1(fc, ISAC_ISTA); in avm_fritz_interrupt()
638 mISDNisac_irq(&fc->isac, val); in avm_fritz_interrupt()
641 HDLC_irq_main(fc); in avm_fritz_interrupt()
642 spin_unlock(&fc->lock); in avm_fritz_interrupt()
649 struct fritzcard *fc = dev_id; in avm_fritzv2_interrupt() local
653 spin_lock(&fc->lock); in avm_fritzv2_interrupt()
654 sval = inb(fc->addr + 2); in avm_fritzv2_interrupt()
655 pr_debug("%s: irq stat0 %x\n", fc->name, sval); in avm_fritzv2_interrupt()
658 spin_unlock(&fc->lock); in avm_fritzv2_interrupt()
661 fc->irqcnt++; in avm_fritzv2_interrupt()
664 HDLC_irq_main(fc); in avm_fritzv2_interrupt()
666 val = ReadISAC_V2(fc, ISACX_ISTA); in avm_fritzv2_interrupt()
667 mISDNisac_irq(&fc->isac, val); in avm_fritzv2_interrupt()
670 pr_debug("%s: timer irq\n", fc->name); in avm_fritzv2_interrupt()
671 outb(fc->ctrlreg | AVM_STATUS0_RES_TIMER, fc->addr + 2); in avm_fritzv2_interrupt()
673 outb(fc->ctrlreg, fc->addr + 2); in avm_fritzv2_interrupt()
675 spin_unlock(&fc->lock); in avm_fritzv2_interrupt()
683 struct fritzcard *fc = bch->hw; in avm_l2l1B() local
690 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
696 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
699 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
704 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
710 spin_lock_irqsave(&fc->lock, flags); in avm_l2l1B()
713 spin_unlock_irqrestore(&fc->lock, flags); in avm_l2l1B()
725 inithdlc(struct fritzcard *fc) in inithdlc() argument
727 modehdlc(&fc->bch[0], -1); in inithdlc()
728 modehdlc(&fc->bch[1], -1); in inithdlc()
732 clear_pending_hdlc_ints(struct fritzcard *fc) in clear_pending_hdlc_ints() argument
736 val = read_status(fc, 1); in clear_pending_hdlc_ints()
737 pr_debug("%s: HDLC 1 STA %x\n", fc->name, val); in clear_pending_hdlc_ints()
738 val = read_status(fc, 2); in clear_pending_hdlc_ints()
739 pr_debug("%s: HDLC 2 STA %x\n", fc->name, val); in clear_pending_hdlc_ints()
743 reset_avm(struct fritzcard *fc) in reset_avm() argument
745 switch (fc->type) { in reset_avm()
747 fc->ctrlreg = AVM_STATUS0_RESET | AVM_STATUS0_DIS_TIMER; in reset_avm()
750 fc->ctrlreg = AVM_STATUS0_RESET; in reset_avm()
754 pr_notice("%s: reset\n", fc->name); in reset_avm()
755 disable_hwirq(fc); in reset_avm()
757 switch (fc->type) { in reset_avm()
759 fc->ctrlreg = AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER; in reset_avm()
760 disable_hwirq(fc); in reset_avm()
761 outb(AVM_STATUS1_ENA_IOM, fc->addr + 3); in reset_avm()
764 fc->ctrlreg = 0; in reset_avm()
765 disable_hwirq(fc); in reset_avm()
770 pr_notice("%s: S0/S1 %x/%x\n", fc->name, in reset_avm()
771 inb(fc->addr + 2), inb(fc->addr + 3)); in reset_avm()
775 init_card(struct fritzcard *fc) in init_card() argument
780 reset_avm(fc); /* disable IRQ */ in init_card()
781 if (fc->type == AVM_FRITZ_PCIV2) in init_card()
782 ret = request_irq(fc->irq, avm_fritzv2_interrupt, in init_card()
783 IRQF_SHARED, fc->name, fc); in init_card()
785 ret = request_irq(fc->irq, avm_fritz_interrupt, in init_card()
786 IRQF_SHARED, fc->name, fc); in init_card()
789 fc->name, fc->irq); in init_card()
793 spin_lock_irqsave(&fc->lock, flags); in init_card()
794 ret = fc->isac.init(&fc->isac); in init_card()
796 spin_unlock_irqrestore(&fc->lock, flags); in init_card()
798 fc->name, ret); in init_card()
801 clear_pending_hdlc_ints(fc); in init_card()
802 inithdlc(fc); in init_card()
803 enable_hwirq(fc); in init_card()
805 if (fc->type == AVM_FRITZ_PCIV2) { in init_card()
806 WriteISAC_V2(fc, ISACX_MASK, 0); in init_card()
807 WriteISAC_V2(fc, ISACX_CMDRD, 0x41); in init_card()
809 WriteISAC_V1(fc, ISAC_MASK, 0); in init_card()
810 WriteISAC_V1(fc, ISAC_CMDR, 0x41); in init_card()
812 spin_unlock_irqrestore(&fc->lock, flags); in init_card()
816 pr_notice("%s: IRQ %d count %d\n", fc->name, in init_card()
817 fc->irq, fc->irqcnt); in init_card()
818 if (!fc->irqcnt) { in init_card()
820 fc->name, fc->irq, 3 - cnt); in init_card()
821 reset_avm(fc); in init_card()
825 free_irq(fc->irq, fc); in init_card()
839 struct fritzcard *fc = bch->hw; in avm_bctrl() local
843 pr_debug("%s: %s cmd:%x %p\n", fc->name, __func__, cmd, arg); in avm_bctrl()
848 spin_lock_irqsave(&fc->lock, flags); in avm_bctrl()
851 spin_unlock_irqrestore(&fc->lock, flags); in avm_bctrl()
861 pr_info("%s: %s unknown prim(%x)\n", fc->name, __func__, cmd); in avm_bctrl()
867 channel_ctrl(struct fritzcard *fc, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
881 ret = fc->isac.ctrl(&fc->isac, HW_TESTLOOP, cq->channel); in channel_ctrl()
884 ret = fc->isac.ctrl(&fc->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
887 pr_info("%s: %s unknown Op %x\n", fc->name, __func__, cq->op); in channel_ctrl()
895 open_bchannel(struct fritzcard *fc, struct channel_req *rq) in open_bchannel() argument
903 bch = &fc->bch[rq->adr.channel - 1]; in open_bchannel()
919 struct fritzcard *fc = dch->hw; in avm_dctrl() local
923 pr_debug("%s: %s cmd:%x %p\n", fc->name, __func__, cmd, arg); in avm_dctrl()
928 err = fc->isac.open(&fc->isac, rq); in avm_dctrl()
930 err = open_bchannel(fc, rq); in avm_dctrl()
934 pr_info("%s: cannot get module\n", fc->name); in avm_dctrl()
937 pr_debug("%s: dev(%d) close from %p\n", fc->name, dch->dev.id, in avm_dctrl()
942 err = channel_ctrl(fc, arg); in avm_dctrl()
946 fc->name, __func__, cmd); in avm_dctrl()
953 setup_fritz(struct fritzcard *fc) in setup_fritz() argument
957 if (!request_region(fc->addr, 32, fc->name)) { in setup_fritz()
959 fc->name, fc->addr, fc->addr + 31); in setup_fritz()
962 switch (fc->type) { in setup_fritz()
964 val = inl(fc->addr); in setup_fritz()
965 outl(AVM_HDLC_1, fc->addr + CHIP_INDEX); in setup_fritz()
966 ver = inl(fc->addr + CHIP_WINDOW + HDLC_STATUS) >> 24; in setup_fritz()
968 pr_notice("%s: PCI stat %#x\n", fc->name, val); in setup_fritz()
969 pr_notice("%s: PCI Class %X Rev %d\n", fc->name, in setup_fritz()
971 pr_notice("%s: HDLC version %x\n", fc->name, ver & 0xf); in setup_fritz()
973 ASSIGN_FUNC(V1, ISAC, fc->isac); in setup_fritz()
974 fc->isac.type = IPAC_TYPE_ISAC; in setup_fritz()
977 val = inl(fc->addr); in setup_fritz()
978 ver = inl(fc->addr + AVM_HDLC_STATUS_1) >> 24; in setup_fritz()
980 pr_notice("%s: PCI V2 stat %#x\n", fc->name, val); in setup_fritz()
981 pr_notice("%s: PCI V2 Class %X Rev %d\n", fc->name, in setup_fritz()
983 pr_notice("%s: HDLC version %x\n", fc->name, ver & 0xf); in setup_fritz()
985 ASSIGN_FUNC(V2, ISAC, fc->isac); in setup_fritz()
986 fc->isac.type = IPAC_TYPE_ISACX; in setup_fritz()
989 release_region(fc->addr, 32); in setup_fritz()
990 pr_info("%s: AVM unknown type %d\n", fc->name, fc->type); in setup_fritz()
993 pr_notice("%s: %s config irq:%d base:0x%X\n", fc->name, in setup_fritz()
994 (fc->type == AVM_FRITZ_PCI) ? "AVM Fritz!CARD PCI" : in setup_fritz()
995 "AVM Fritz!CARD PCIv2", fc->irq, fc->addr); in setup_fritz()