Lines Matching refs:bcs
345 static inline void error_hangup(struct bc_state *bcs) in error_hangup() argument
347 struct cardstate *cs = bcs->cs; in error_hangup()
349 gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL); in error_hangup()
365 if (req_submit(cs->bcs, HD_RESET_INTERRUPT_PIPE, 0, BAS_TIMEOUT)) in error_reset()
675 struct bc_state *bcs; in read_int_callback() local
742 bcs = cs->bcs + channel; in read_int_callback()
744 gigaset_bchannel_up(bcs); in read_int_callback()
755 bcs = cs->bcs + channel; in read_int_callback()
757 stopurbs(bcs->hw.bas); in read_int_callback()
758 gigaset_bchannel_down(bcs); in read_int_callback()
768 bcs = cs->bcs + channel; in read_int_callback()
770 &bcs->hw.bas->corrbytes); in read_int_callback()
773 channel, bcs->hw.bas->numsub, l, in read_int_callback()
774 atomic_read(&bcs->hw.bas->corrbytes)); in read_int_callback()
854 struct bc_state *bcs; in read_iso_callback() local
871 bcs = urb->context; in read_iso_callback()
872 ubc = bcs->hw.bas; in read_iso_callback()
894 urb->dev = bcs->cs->hw.bas->udev; in read_iso_callback()
899 dev_err(bcs->cs->dev, in read_iso_callback()
903 error_hangup(bcs); in read_iso_callback()
937 ubc = ucx->bcs->hw.bas; in write_iso_callback()
955 static int starturbs(struct bc_state *bcs) in starturbs() argument
957 struct bas_bc_state *ubc = bcs->hw.bas; in starturbs()
963 if (bcs->proto2 == L2_HDLC) in starturbs()
964 bcs->inputstate |= INS_flag_hunt; in starturbs()
975 urb->dev = bcs->cs->hw.bas->udev; in starturbs()
976 urb->pipe = usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel); in starturbs()
983 urb->context = bcs; in starturbs()
1007 urb->dev = bcs->cs->hw.bas->udev; in starturbs()
1008 urb->pipe = usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel); in starturbs()
1083 struct bas_bc_state *ubc = ucx->bcs->hw.bas; in submit_iso_write_urb()
1088 urb->dev = ucx->bcs->cs->hw.bas->udev; in submit_iso_write_urb()
1120 dev_err(ucx->bcs->cs->dev, in submit_iso_write_urb()
1142 dev_err(ucx->bcs->cs->dev, in submit_iso_write_urb()
1159 struct bc_state *bcs = (struct bc_state *) data; in write_iso_tasklet() local
1160 struct bas_bc_state *ubc = bcs->hw.bas; in write_iso_tasklet()
1161 struct cardstate *cs = bcs->cs; in write_iso_tasklet()
1188 error_hangup(bcs); in write_iso_tasklet()
1213 error_hangup(bcs); in write_iso_tasklet()
1248 error_hangup(bcs); in write_iso_tasklet()
1269 error_hangup(bcs); in write_iso_tasklet()
1275 while ((skb = skb_dequeue(&bcs->squeue))) { in write_iso_tasklet()
1278 if (gigaset_isoc_buildframe(bcs, skb->data, len) == -EAGAIN) { in write_iso_tasklet()
1280 skb_queue_head(&bcs->squeue, skb); in write_iso_tasklet()
1282 __func__, skb_queue_len(&bcs->squeue)); in write_iso_tasklet()
1286 gigaset_skb_sent(bcs, skb); in write_iso_tasklet()
1302 struct bc_state *bcs = (struct bc_state *) data; in read_iso_tasklet() local
1303 struct bas_bc_state *ubc = bcs->hw.bas; in read_iso_tasklet()
1304 struct cardstate *cs = bcs->cs; in read_iso_tasklet()
1356 error_hangup(bcs); in read_iso_tasklet()
1408 gigaset_isoc_receive(rcvbuf + offset, numbytes, bcs); in read_iso_tasklet()
1422 urb->dev = bcs->cs->hw.bas->udev; in read_iso_tasklet()
1431 error_hangup(bcs); in read_iso_tasklet()
1470 error_hangup(&cs->bcs[0]); in req_timeout()
1475 error_hangup(&cs->bcs[1]); in req_timeout()
1593 static int req_submit(struct bc_state *bcs, int req, int val, int timeout) in req_submit() argument
1595 struct bas_cardstate *ucs = bcs->cs->hw.bas; in req_submit()
1604 dev_err(bcs->cs->dev, in req_submit()
1623 dev_err(bcs->cs->dev, "could not submit request 0x%02x: %s\n", in req_submit()
1647 static int gigaset_init_bchannel(struct bc_state *bcs) in gigaset_init_bchannel() argument
1649 struct cardstate *cs = bcs->cs; in gigaset_init_bchannel()
1667 ret = starturbs(bcs); in gigaset_init_bchannel()
1672 bcs->channel + 1, in gigaset_init_bchannel()
1675 error_hangup(bcs); in gigaset_init_bchannel()
1679 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL; in gigaset_init_bchannel()
1680 ret = req_submit(bcs, req, 0, BAS_TIMEOUT); in gigaset_init_bchannel()
1683 bcs->channel + 1); in gigaset_init_bchannel()
1684 stopurbs(bcs->hw.bas); in gigaset_init_bchannel()
1689 error_hangup(bcs); in gigaset_init_bchannel()
1703 static int gigaset_close_bchannel(struct bc_state *bcs) in gigaset_close_bchannel() argument
1705 struct cardstate *cs = bcs->cs; in gigaset_close_bchannel()
1716 if (!(cs->hw.bas->basstate & (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) { in gigaset_close_bchannel()
1719 gigaset_bchannel_down(bcs); in gigaset_close_bchannel()
1724 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL; in gigaset_close_bchannel()
1725 ret = req_submit(bcs, req, 0, BAS_TIMEOUT); in gigaset_close_bchannel()
1728 bcs->channel + 1); in gigaset_close_bchannel()
1927 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT); in start_cbsend()
2004 rc = req_submit(cs->bcs, HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT); in gigaset_write_cmd()
2088 static void gigaset_freebcshw(struct bc_state *bcs) in gigaset_freebcshw() argument
2090 struct bas_bc_state *ubc = bcs->hw.bas; in gigaset_freebcshw()
2111 bcs->hw.bas = NULL; in gigaset_freebcshw()
2120 static int gigaset_initbcshw(struct bc_state *bcs) in gigaset_initbcshw() argument
2125 bcs->hw.bas = ubc = kmalloc(sizeof(struct bas_bc_state), GFP_KERNEL); in gigaset_initbcshw()
2136 ubc->isoouturbs[i].bcs = bcs; in gigaset_initbcshw()
2144 bcs->hw.bas = NULL; in gigaset_initbcshw()
2148 write_iso_tasklet, (unsigned long) bcs); in gigaset_initbcshw()
2169 read_iso_tasklet, (unsigned long) bcs); in gigaset_initbcshw()
2173 static void gigaset_reinitbcshw(struct bc_state *bcs) in gigaset_reinitbcshw() argument
2175 struct bas_bc_state *ubc = bcs->hw.bas; in gigaset_reinitbcshw()
2177 bcs->hw.bas->running = 0; in gigaset_reinitbcshw()
2178 atomic_set(&bcs->hw.bas->corrbytes, 0); in gigaset_reinitbcshw()
2179 bcs->hw.bas->numsub = 0; in gigaset_reinitbcshw()
2248 ubc = cs->bcs[j].hw.bas; in freeurbs()
2353 ubc = cs->bcs[j].hw.bas; in gigaset_probe()
2383 rc = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0); in gigaset_probe()
2431 gigaset_bchannel_down(cs->bcs + j); in gigaset_disconnect()
2496 rc = req_submit(cs->bcs, HD_CLOSE_ATCHANNEL, 0, 0); in gigaset_suspend()