Lines Matching refs:hscx
939 hscx_empty_fifo(struct hscx_hw *hscx, u8 count) in hscx_empty_fifo() argument
944 pr_debug("%s: B%1d %d\n", hscx->ip->name, hscx->bch.nr, count); in hscx_empty_fifo()
945 if (test_bit(FLG_RX_OFF, &hscx->bch.Flags)) { in hscx_empty_fifo()
946 hscx->bch.dropcnt += count; in hscx_empty_fifo()
947 hscx_cmdr(hscx, 0x80); /* RMC */ in hscx_empty_fifo()
950 maxlen = bchannel_get_rxbuf(&hscx->bch, count); in hscx_empty_fifo()
952 hscx_cmdr(hscx, 0x80); /* RMC */ in hscx_empty_fifo()
953 if (hscx->bch.rx_skb) in hscx_empty_fifo()
954 skb_trim(hscx->bch.rx_skb, 0); in hscx_empty_fifo()
956 hscx->ip->name, hscx->bch.nr, count); in hscx_empty_fifo()
959 p = skb_put(hscx->bch.rx_skb, count); in hscx_empty_fifo()
961 if (hscx->ip->type & IPAC_TYPE_IPACX) in hscx_empty_fifo()
962 hscx->ip->read_fifo(hscx->ip->hw, in hscx_empty_fifo()
963 hscx->off + IPACX_RFIFOB, p, count); in hscx_empty_fifo()
965 hscx->ip->read_fifo(hscx->ip->hw, in hscx_empty_fifo()
966 hscx->off, p, count); in hscx_empty_fifo()
968 hscx_cmdr(hscx, 0x80); /* RMC */ in hscx_empty_fifo()
970 if (hscx->bch.debug & DEBUG_HW_BFIFO) { in hscx_empty_fifo()
971 snprintf(hscx->log, 64, "B%1d-recv %s %d ", in hscx_empty_fifo()
972 hscx->bch.nr, hscx->ip->name, count); in hscx_empty_fifo()
973 print_hex_dump_bytes(hscx->log, DUMP_PREFIX_OFFSET, p, count); in hscx_empty_fifo()
978 hscx_fill_fifo(struct hscx_hw *hscx) in hscx_fill_fifo() argument
983 if (!hscx->bch.tx_skb) { in hscx_fill_fifo()
984 if (!test_bit(FLG_TX_EMPTY, &hscx->bch.Flags)) in hscx_fill_fifo()
986 count = hscx->fifo_size; in hscx_fill_fifo()
988 p = hscx->log; in hscx_fill_fifo()
989 memset(p, hscx->bch.fill[0], count); in hscx_fill_fifo()
991 count = hscx->bch.tx_skb->len - hscx->bch.tx_idx; in hscx_fill_fifo()
994 p = hscx->bch.tx_skb->data + hscx->bch.tx_idx; in hscx_fill_fifo()
996 more = test_bit(FLG_TRANSPARENT, &hscx->bch.Flags) ? 1 : 0; in hscx_fill_fifo()
997 if (count > hscx->fifo_size) { in hscx_fill_fifo()
998 count = hscx->fifo_size; in hscx_fill_fifo()
1001 pr_debug("%s: B%1d %d/%d/%d\n", hscx->ip->name, hscx->bch.nr, in hscx_fill_fifo()
1002 count, hscx->bch.tx_idx, hscx->bch.tx_skb->len); in hscx_fill_fifo()
1003 hscx->bch.tx_idx += count; in hscx_fill_fifo()
1005 if (hscx->ip->type & IPAC_TYPE_IPACX) in hscx_fill_fifo()
1006 hscx->ip->write_fifo(hscx->ip->hw, in hscx_fill_fifo()
1007 hscx->off + IPACX_XFIFOB, p, count); in hscx_fill_fifo()
1009 waitforXFW(hscx); in hscx_fill_fifo()
1010 hscx->ip->write_fifo(hscx->ip->hw, in hscx_fill_fifo()
1011 hscx->off, p, count); in hscx_fill_fifo()
1013 hscx_cmdr(hscx, more ? 0x08 : 0x0a); in hscx_fill_fifo()
1015 if (hscx->bch.tx_skb && (hscx->bch.debug & DEBUG_HW_BFIFO)) { in hscx_fill_fifo()
1016 snprintf(hscx->log, 64, "B%1d-send %s %d ", in hscx_fill_fifo()
1017 hscx->bch.nr, hscx->ip->name, count); in hscx_fill_fifo()
1018 print_hex_dump_bytes(hscx->log, DUMP_PREFIX_OFFSET, p, count); in hscx_fill_fifo()
1108 ipac_irq(&hx->ip->hscx[0], ista); in ipac_irq()
1176 ipac_irq(&ipac->hscx[0], ista); in mISDNipac_irq()
1178 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1197 ipac_irq(&ipac->hscx[0], ista); in mISDNipac_irq()
1199 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1204 ista = ReadIPAC(ipac, IPAC_ISTAB + ipac->hscx[1].off); in mISDNipac_irq()
1207 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1229 hscx_mode(struct hscx_hw *hscx, u32 bprotocol) in hscx_mode() argument
1231 pr_debug("%s: HSCX %c protocol %x-->%x ch %d\n", hscx->ip->name, in hscx_mode()
1232 '@' + hscx->bch.nr, hscx->bch.state, bprotocol, hscx->bch.nr); in hscx_mode()
1233 if (hscx->ip->type & IPAC_TYPE_IPACX) { in hscx_mode()
1234 if (hscx->bch.nr & 1) { /* B1 and ICA */ in hscx_mode()
1235 WriteIPAC(hscx->ip, ISACX_BCHA_TSDP_BC1, 0x80); in hscx_mode()
1236 WriteIPAC(hscx->ip, ISACX_BCHA_CR, 0x88); in hscx_mode()
1238 WriteIPAC(hscx->ip, ISACX_BCHB_TSDP_BC1, 0x81); in hscx_mode()
1239 WriteIPAC(hscx->ip, ISACX_BCHB_CR, 0x88); in hscx_mode()
1243 WriteHSCX(hscx, IPACX_MODEB, 0xC0); /* rec off */ in hscx_mode()
1244 WriteHSCX(hscx, IPACX_EXMB, 0x30); /* std adj. */ in hscx_mode()
1245 WriteHSCX(hscx, IPACX_MASKB, 0xFF); /* ints off */ in hscx_mode()
1246 hscx_cmdr(hscx, 0x41); in hscx_mode()
1247 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1248 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1251 WriteHSCX(hscx, IPACX_MODEB, 0x88); /* ex trans */ in hscx_mode()
1252 WriteHSCX(hscx, IPACX_EXMB, 0x00); /* trans */ in hscx_mode()
1253 hscx_cmdr(hscx, 0x41); in hscx_mode()
1254 WriteHSCX(hscx, IPACX_MASKB, IPACX_B_ON); in hscx_mode()
1255 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1258 WriteHSCX(hscx, IPACX_MODEB, 0xC0); /* trans */ in hscx_mode()
1259 WriteHSCX(hscx, IPACX_EXMB, 0x00); /* hdlc,crc */ in hscx_mode()
1260 hscx_cmdr(hscx, 0x41); in hscx_mode()
1261 WriteHSCX(hscx, IPACX_MASKB, IPACX_B_ON); in hscx_mode()
1262 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1265 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1269 } else if (hscx->ip->type & IPAC_TYPE_IPAC) { /* IPAC */ in hscx_mode()
1270 WriteHSCX(hscx, IPAC_CCR1, 0x82); in hscx_mode()
1271 WriteHSCX(hscx, IPAC_CCR2, 0x30); in hscx_mode()
1272 WriteHSCX(hscx, IPAC_XCCR, 0x07); in hscx_mode()
1273 WriteHSCX(hscx, IPAC_RCCR, 0x07); in hscx_mode()
1274 WriteHSCX(hscx, IPAC_TSAX, hscx->slot); in hscx_mode()
1275 WriteHSCX(hscx, IPAC_TSAR, hscx->slot); in hscx_mode()
1278 WriteHSCX(hscx, IPAC_TSAX, 0x1F); in hscx_mode()
1279 WriteHSCX(hscx, IPAC_TSAR, 0x1F); in hscx_mode()
1280 WriteHSCX(hscx, IPAC_MODEB, 0x84); in hscx_mode()
1281 WriteHSCX(hscx, IPAC_CCR1, 0x82); in hscx_mode()
1282 WriteHSCX(hscx, IPAC_MASKB, 0xFF); /* ints off */ in hscx_mode()
1283 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1284 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1287 WriteHSCX(hscx, IPAC_MODEB, 0xe4); /* ex trans */ in hscx_mode()
1288 WriteHSCX(hscx, IPAC_CCR1, 0x82); in hscx_mode()
1289 hscx_cmdr(hscx, 0x41); in hscx_mode()
1290 WriteHSCX(hscx, IPAC_MASKB, 0); in hscx_mode()
1291 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1294 WriteHSCX(hscx, IPAC_MODEB, 0x8c); in hscx_mode()
1295 WriteHSCX(hscx, IPAC_CCR1, 0x8a); in hscx_mode()
1296 hscx_cmdr(hscx, 0x41); in hscx_mode()
1297 WriteHSCX(hscx, IPAC_MASKB, 0); in hscx_mode()
1298 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1301 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1305 } else if (hscx->ip->type & IPAC_TYPE_HSCX) { /* HSCX */ in hscx_mode()
1306 WriteHSCX(hscx, IPAC_CCR1, 0x85); in hscx_mode()
1307 WriteHSCX(hscx, IPAC_CCR2, 0x30); in hscx_mode()
1308 WriteHSCX(hscx, IPAC_XCCR, 0x07); in hscx_mode()
1309 WriteHSCX(hscx, IPAC_RCCR, 0x07); in hscx_mode()
1310 WriteHSCX(hscx, IPAC_TSAX, hscx->slot); in hscx_mode()
1311 WriteHSCX(hscx, IPAC_TSAR, hscx->slot); in hscx_mode()
1314 WriteHSCX(hscx, IPAC_TSAX, 0x1F); in hscx_mode()
1315 WriteHSCX(hscx, IPAC_TSAR, 0x1F); in hscx_mode()
1316 WriteHSCX(hscx, IPAC_MODEB, 0x84); in hscx_mode()
1317 WriteHSCX(hscx, IPAC_CCR1, 0x85); in hscx_mode()
1318 WriteHSCX(hscx, IPAC_MASKB, 0xFF); /* ints off */ in hscx_mode()
1319 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1320 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1323 WriteHSCX(hscx, IPAC_MODEB, 0xe4); /* ex trans */ in hscx_mode()
1324 WriteHSCX(hscx, IPAC_CCR1, 0x85); in hscx_mode()
1325 hscx_cmdr(hscx, 0x41); in hscx_mode()
1326 WriteHSCX(hscx, IPAC_MASKB, 0); in hscx_mode()
1327 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1330 WriteHSCX(hscx, IPAC_MODEB, 0x8c); in hscx_mode()
1331 WriteHSCX(hscx, IPAC_CCR1, 0x8d); in hscx_mode()
1332 hscx_cmdr(hscx, 0x41); in hscx_mode()
1333 WriteHSCX(hscx, IPAC_MASKB, 0); in hscx_mode()
1334 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1337 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1343 hscx->bch.state = bprotocol; in hscx_mode()
1475 hscx_init(&ipac->hscx[0]); in ipac_init()
1476 hscx_init(&ipac->hscx[1]); in ipac_init()
1479 hscx_init(&ipac->hscx[0]); in ipac_init()
1480 hscx_init(&ipac->hscx[1]); in ipac_init()
1488 if (ipac->hscx[0].bch.debug & DEBUG_HW) in ipac_init()
1504 bch = &ipac->hscx[rq->adr.channel - 1].bch; in open_bchannel()
1590 ipac->hscx[0].off = 0; in mISDNipac_init()
1591 ipac->hscx[1].off = 0x40; in mISDNipac_init()
1592 ipac->hscx[0].fifo_size = 32; in mISDNipac_init()
1593 ipac->hscx[1].fifo_size = 32; in mISDNipac_init()
1596 ipac->hscx[0].off = 0; in mISDNipac_init()
1597 ipac->hscx[1].off = 0x40; in mISDNipac_init()
1598 ipac->hscx[0].fifo_size = 64; in mISDNipac_init()
1599 ipac->hscx[1].fifo_size = 64; in mISDNipac_init()
1602 ipac->hscx[0].off = IPACX_OFF_ICA; in mISDNipac_init()
1603 ipac->hscx[1].off = IPACX_OFF_ICB; in mISDNipac_init()
1604 ipac->hscx[0].fifo_size = 64; in mISDNipac_init()
1605 ipac->hscx[1].fifo_size = 64; in mISDNipac_init()
1614 ipac->hscx[i].bch.nr = i + 1; in mISDNipac_init()
1616 list_add(&ipac->hscx[i].bch.ch.list, in mISDNipac_init()
1618 mISDN_initbchannel(&ipac->hscx[i].bch, MAX_DATA_MEM, in mISDNipac_init()
1619 ipac->hscx[i].fifo_size); in mISDNipac_init()
1620 ipac->hscx[i].bch.ch.nr = i + 1; in mISDNipac_init()
1621 ipac->hscx[i].bch.ch.send = &hscx_l2l1; in mISDNipac_init()
1622 ipac->hscx[i].bch.ch.ctrl = hscx_bctrl; in mISDNipac_init()
1623 ipac->hscx[i].bch.hw = hw; in mISDNipac_init()
1624 ipac->hscx[i].ip = ipac; in mISDNipac_init()
1627 ipac->hscx[i].slot = (i == 0) ? 0x2f : 0x03; in mISDNipac_init()