Lines Matching refs:hx
873 waitforCEC(struct hscx_hw *hx) in waitforCEC() argument
878 starb = ReadHSCX(hx, IPAC_STARB); in waitforCEC()
885 pr_debug("%s: B%1d CEC %d us\n", hx->ip->name, hx->bch.nr, in waitforCEC()
888 pr_info("%s: B%1d CEC timeout\n", hx->ip->name, hx->bch.nr); in waitforCEC()
893 waitforXFW(struct hscx_hw *hx) in waitforXFW() argument
898 starb = ReadHSCX(hx, IPAC_STARB); in waitforXFW()
905 pr_debug("%s: B%1d XFW %d us\n", hx->ip->name, hx->bch.nr, in waitforXFW()
908 pr_info("%s: B%1d XFW timeout\n", hx->ip->name, hx->bch.nr); in waitforXFW()
912 hscx_cmdr(struct hscx_hw *hx, u8 cmd) in hscx_cmdr() argument
914 if (hx->ip->type & IPAC_TYPE_IPACX) in hscx_cmdr()
915 WriteHSCX(hx, IPACX_CMDRB, cmd); in hscx_cmdr()
917 waitforCEC(hx); in hscx_cmdr()
918 WriteHSCX(hx, IPAC_CMDRB, cmd); in hscx_cmdr()
1007 hscx_xpr(struct hscx_hw *hx) in hscx_xpr() argument
1009 if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) { in hscx_xpr()
1010 hscx_fill_fifo(hx); in hscx_xpr()
1012 dev_kfree_skb(hx->bch.tx_skb); in hscx_xpr()
1013 if (get_next_bframe(&hx->bch)) { in hscx_xpr()
1014 hscx_fill_fifo(hx); in hscx_xpr()
1015 test_and_clear_bit(FLG_TX_EMPTY, &hx->bch.Flags); in hscx_xpr()
1016 } else if (test_bit(FLG_TX_EMPTY, &hx->bch.Flags)) { in hscx_xpr()
1017 hscx_fill_fifo(hx); in hscx_xpr()
1023 ipac_rme(struct hscx_hw *hx) in ipac_rme() argument
1028 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_rme()
1029 rstab = ReadHSCX(hx, IPACX_RSTAB); in ipac_rme()
1031 rstab = ReadHSCX(hx, IPAC_RSTAB); in ipac_rme()
1032 pr_debug("%s: B%1d RSTAB %02x\n", hx->ip->name, hx->bch.nr, rstab); in ipac_rme()
1036 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1038 hx->ip->name, hx->bch.nr); in ipac_rme()
1041 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1043 hx->ip->name, hx->bch.nr, in ipac_rme()
1044 hx->bch.state); in ipac_rme()
1047 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1049 hx->ip->name, hx->bch.nr); in ipac_rme()
1051 hscx_cmdr(hx, 0x80); /* Do RMC */ in ipac_rme()
1054 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_rme()
1055 count = ReadHSCX(hx, IPACX_RBCLB); in ipac_rme()
1057 count = ReadHSCX(hx, IPAC_RBCLB); in ipac_rme()
1058 count &= (hx->fifo_size - 1); in ipac_rme()
1060 count = hx->fifo_size; in ipac_rme()
1061 hscx_empty_fifo(hx, count); in ipac_rme()
1062 if (!hx->bch.rx_skb) in ipac_rme()
1064 if (hx->bch.rx_skb->len < 2) { in ipac_rme()
1066 hx->ip->name, hx->bch.nr, hx->bch.rx_skb->len); in ipac_rme()
1067 skb_trim(hx->bch.rx_skb, 0); in ipac_rme()
1069 skb_trim(hx->bch.rx_skb, hx->bch.rx_skb->len - 1); in ipac_rme()
1070 recv_Bchannel(&hx->bch, 0, false); in ipac_rme()
1075 ipac_irq(struct hscx_hw *hx, u8 ista) in ipac_irq() argument
1079 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_irq()
1080 istab = ReadHSCX(hx, IPACX_ISTAB); in ipac_irq()
1081 else if (hx->ip->type & IPAC_TYPE_IPAC) { in ipac_irq()
1082 istab = ReadHSCX(hx, IPAC_ISTAB); in ipac_irq()
1083 m = (hx->bch.nr & 1) ? IPAC__EXA : IPAC__EXB; in ipac_irq()
1085 exirb = ReadHSCX(hx, IPAC_EXIRB); in ipac_irq()
1086 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1087 hx->bch.nr, exirb); in ipac_irq()
1089 } else if (hx->bch.nr & 2) { /* HSCX B */ in ipac_irq()
1091 ipac_irq(&hx->ip->hscx[0], ista); in ipac_irq()
1093 exirb = ReadHSCX(hx, IPAC_EXIRB); in ipac_irq()
1094 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1095 hx->bch.nr, exirb); in ipac_irq()
1099 istab = ReadHSCX(hx, IPAC_ISTAB); in ipac_irq()
1101 exirb = ReadHSCX(hx, IPAC_EXIRB); in ipac_irq()
1102 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1103 hx->bch.nr, exirb); in ipac_irq()
1111 pr_debug("%s: B%1d ISTAB %02x\n", hx->ip->name, hx->bch.nr, istab); in ipac_irq()
1113 if (!test_bit(FLG_ACTIVE, &hx->bch.Flags)) in ipac_irq()
1117 ipac_rme(hx); in ipac_irq()
1120 hscx_empty_fifo(hx, hx->fifo_size); in ipac_irq()
1121 if (test_bit(FLG_TRANSPARENT, &hx->bch.Flags)) in ipac_irq()
1122 recv_Bchannel(&hx->bch, 0, false); in ipac_irq()
1126 pr_debug("%s: B%1d RFO error\n", hx->ip->name, hx->bch.nr); in ipac_irq()
1127 hscx_cmdr(hx, 0x40); /* RRES */ in ipac_irq()
1131 hscx_xpr(hx); in ipac_irq()
1134 if (test_bit(FLG_TRANSPARENT, &hx->bch.Flags)) { in ipac_irq()
1135 if (test_bit(FLG_FILLEMPTY, &hx->bch.Flags)) in ipac_irq()
1136 test_and_set_bit(FLG_TX_EMPTY, &hx->bch.Flags); in ipac_irq()
1137 hscx_xpr(hx); in ipac_irq()
1140 pr_debug("%s: B%1d XDU error at len %d\n", hx->ip->name, in ipac_irq()
1141 hx->bch.nr, hx->bch.tx_idx); in ipac_irq()
1142 hx->bch.tx_idx = 0; in ipac_irq()
1143 hscx_cmdr(hx, 0x01); /* XRES */ in ipac_irq()
1334 struct hscx_hw *hx = container_of(bch, struct hscx_hw, bch); in hscx_l2l1() local
1341 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1345 hscx_fill_fifo(hx); in hscx_l2l1()
1347 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1350 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1352 ret = hscx_mode(hx, ch->protocol); in hscx_l2l1()
1355 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1361 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1363 hscx_mode(hx, ISDN_P_NONE); in hscx_l2l1()
1364 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1371 hx->ip->name, __func__, hh->prim, hh->id); in hscx_l2l1()
1389 struct hscx_hw *hx = container_of(bch, struct hscx_hw, bch); in hscx_bctrl() local
1393 pr_debug("%s: %s cmd:%x %p\n", hx->ip->name, __func__, cmd, arg); in hscx_bctrl()
1398 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_bctrl()
1400 hscx_mode(hx, ISDN_P_NONE); in hscx_bctrl()
1401 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_bctrl()
1404 module_put(hx->ip->owner); in hscx_bctrl()
1412 hx->ip->name, __func__, cmd); in hscx_bctrl()
1430 hscx_init(struct hscx_hw *hx) in hscx_init() argument
1434 WriteHSCX(hx, IPAC_RAH2, 0xFF); in hscx_init()
1435 WriteHSCX(hx, IPAC_XBCH, 0x00); in hscx_init()
1436 WriteHSCX(hx, IPAC_RLCR, 0x00); in hscx_init()
1438 if (hx->ip->type & IPAC_TYPE_HSCX) { in hscx_init()
1439 WriteHSCX(hx, IPAC_CCR1, 0x85); in hscx_init()
1440 val = ReadHSCX(hx, HSCX_VSTR); in hscx_init()
1441 pr_debug("%s: HSCX VSTR %02x\n", hx->ip->name, val); in hscx_init()
1442 if (hx->bch.debug & DEBUG_HW) in hscx_init()
1443 pr_notice("%s: HSCX version %s\n", hx->ip->name, in hscx_init()
1446 WriteHSCX(hx, IPAC_CCR1, 0x82); in hscx_init()
1447 WriteHSCX(hx, IPAC_CCR2, 0x30); in hscx_init()
1448 WriteHSCX(hx, IPAC_XCCR, 0x07); in hscx_init()
1449 WriteHSCX(hx, IPAC_RCCR, 0x07); in hscx_init()