Lines Matching refs:bcs
19 static inline void B_L1L2(struct st5481_bcs *bcs, int pr, void *arg) in B_L1L2() argument
21 struct hisax_if *ifc = (struct hisax_if *) &bcs->b_if; in B_L1L2()
29 static void usb_b_out(struct st5481_bcs *bcs,int buf_nr) in usb_b_out() argument
31 struct st5481_b_out *b_out = &bcs->b_out; in usb_b_out()
32 struct st5481_adapter *adapter = bcs->adapter; in usb_b_out()
40 DBG(4,"ep %d urb %d busy",(bcs->channel+1)*2,buf_nr); in usb_b_out()
49 DBG(4,"B%d,adjust flow,add %d bytes",bcs->channel+1,B_FLOW_ADJUST); in usb_b_out()
53 DBG(4,"B%d,adjust flow,remove %d bytes",bcs->channel+1,B_FLOW_ADJUST); in usb_b_out()
64 DBG(4,"B%d,len=%d",bcs->channel+1,skb->len); in usb_b_out()
66 if (bcs->mode == L1_MODE_TRANS) { in usb_b_out()
89 B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize); in usb_b_out()
97 if (bcs->mode == L1_MODE_TRANS) { in usb_b_out()
131 struct st5481_bcs *bcs = context; in st5481B_start_xfer() local
133 DBG(4,"B%d",bcs->channel+1); in st5481B_start_xfer()
137 usb_b_out(bcs,0); in st5481B_start_xfer()
138 usb_b_out(bcs,1); in st5481B_start_xfer()
166 struct st5481_bcs *bcs = urb->context; in usb_b_out_complete() local
167 struct st5481_b_out *b_out = &bcs->b_out; in usb_b_out_complete()
168 struct st5481_adapter *adapter = bcs->adapter; in usb_b_out_complete()
178 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2 | USB_DIR_OUT, NULL, NULL); in usb_b_out_complete()
186 usb_b_out(bcs,buf_nr); in usb_b_out_complete()
195 static void st5481B_mode(struct st5481_bcs *bcs, int mode) in st5481B_mode() argument
197 struct st5481_b_out *b_out = &bcs->b_out; in st5481B_mode()
198 struct st5481_adapter *adapter = bcs->adapter; in st5481B_mode()
200 DBG(4,"B%d,mode=%d", bcs->channel + 1, mode); in st5481B_mode()
202 if (bcs->mode == mode) in st5481B_mode()
205 bcs->mode = mode; in st5481B_mode()
212 st5481_in_mode(&bcs->b_in, mode); in st5481B_mode()
213 if (bcs->mode != L1_MODE_NULL) { in st5481B_mode()
215 if (bcs->mode != L1_MODE_TRANS) { in st5481B_mode()
216 isdnhdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K); in st5481B_mode()
218 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL); in st5481B_mode()
221 st5481_usb_device_ctrl_msg(adapter, FFMSK_B1+(bcs->channel*2), in st5481B_mode()
225 st5481_usb_device_ctrl_msg(adapter, OUT_B1_COUNTER+(bcs->channel*2), 32, st5481B_start_xfer, bcs); in st5481B_mode()
227 if (bcs->channel == 0) { in st5481B_mode()
235 st5481_usb_device_ctrl_msg(adapter, FFMSK_B1+(bcs->channel*2), 0, NULL, NULL); in st5481B_mode()
238 st5481_usb_device_ctrl_msg(adapter, OUT_B1_COUNTER+(bcs->channel*2), 0, NULL, NULL); in st5481B_mode()
241 if (bcs->channel == 0) { in st5481B_mode()
257 static int __devinit st5481_setup_b_out(struct st5481_bcs *bcs) in st5481_setup_b_out() argument
259 struct usb_device *dev = bcs->adapter->usb_dev; in st5481_setup_b_out()
262 struct st5481_b_out *b_out = &bcs->b_out; in st5481_setup_b_out()
269 endpoint = &altsetting->endpoint[EP_B1_OUT - 1 + bcs->channel * 2]; in st5481_setup_b_out()
279 usb_b_out_complete, bcs); in st5481_setup_b_out()
282 static void st5481_release_b_out(struct st5481_bcs *bcs) in st5481_release_b_out() argument
284 struct st5481_b_out *b_out = &bcs->b_out; in st5481_release_b_out()
291 int __devinit st5481_setup_b(struct st5481_bcs *bcs) in st5481_setup_b() argument
297 retval = st5481_setup_b_out(bcs); in st5481_setup_b()
300 bcs->b_in.bufsize = HSCX_BUFMAX; in st5481_setup_b()
301 bcs->b_in.num_packets = NUM_ISO_PACKETS_B; in st5481_setup_b()
302 bcs->b_in.packet_size = SIZE_ISO_PACKETS_B_IN; in st5481_setup_b()
303 bcs->b_in.ep = (bcs->channel ? EP_B2_IN : EP_B1_IN) | USB_DIR_IN; in st5481_setup_b()
304 bcs->b_in.counter = bcs->channel ? IN_B2_COUNTER : IN_B1_COUNTER; in st5481_setup_b()
305 bcs->b_in.adapter = bcs->adapter; in st5481_setup_b()
306 bcs->b_in.hisax_if = &bcs->b_if.ifc; in st5481_setup_b()
307 retval = st5481_setup_in(&bcs->b_in); in st5481_setup_b()
315 st5481_release_b_out(bcs); in st5481_setup_b()
323 void st5481_release_b(struct st5481_bcs *bcs) in st5481_release_b() argument
327 st5481_release_in(&bcs->b_in); in st5481_release_b()
328 st5481_release_b_out(bcs); in st5481_release_b()
342 struct st5481_bcs *bcs = ifc->priv; in st5481_b_l2l1() local
350 if (bcs->b_out.tx_skb) in st5481_b_l2l1()
353 bcs->b_out.tx_skb = skb; in st5481_b_l2l1()
357 DBG(4,"B%d,PH_ACTIVATE_REQUEST %d", bcs->channel + 1, mode); in st5481_b_l2l1()
358 st5481B_mode(bcs, mode); in st5481_b_l2l1()
359 B_L1L2(bcs, PH_ACTIVATE | INDICATION, NULL); in st5481_b_l2l1()
362 DBG(4,"B%d,PH_DEACTIVATE_REQUEST", bcs->channel + 1); in st5481_b_l2l1()
363 st5481B_mode(bcs, L1_MODE_NULL); in st5481_b_l2l1()
364 B_L1L2(bcs, PH_DEACTIVATE | INDICATION, NULL); in st5481_b_l2l1()