Lines Matching defs:bcs
20 static inline void B_L1L2(struct st5481_bcs *bcs, int pr, void *arg)
22 struct hisax_if *ifc = (struct hisax_if *) &bcs->b_if;
30 static void usb_b_out(struct st5481_bcs *bcs, int buf_nr)
32 struct st5481_b_out *b_out = &bcs->b_out;
33 struct st5481_adapter *adapter = bcs->adapter;
41 DBG(4, "ep %d urb %d busy", (bcs->channel + 1) * 2, buf_nr);
50 DBG(4, "B%d,adjust flow,add %d bytes", bcs->channel + 1, B_FLOW_ADJUST);
54 DBG(4, "B%d,adjust flow,remove %d bytes", bcs->channel + 1, B_FLOW_ADJUST);
65 DBG(4, "B%d,len=%d", bcs->channel + 1, skb->len);
67 if (bcs->mode == L1_MODE_TRANS) {
90 B_L1L2(bcs, PH_DATA | CONFIRM, (void *)(unsigned long) skb->truesize);
93 /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
94 /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
98 if (bcs->mode == L1_MODE_TRANS) {
132 struct st5481_bcs *bcs = context;
134 DBG(4, "B%d", bcs->channel + 1);
138 usb_b_out(bcs, 0);
139 usb_b_out(bcs, 1);
167 struct st5481_bcs *bcs = urb->context;
168 struct st5481_b_out *b_out = &bcs->b_out;
169 struct st5481_adapter *adapter = bcs->adapter;
185 st5481_usb_pipe_reset(adapter, (bcs->channel + 1) * 2 | USB_DIR_OUT, NULL, NULL);
191 usb_b_out(bcs, buf_nr);
200 static void st5481B_mode(struct st5481_bcs *bcs, int mode)
202 struct st5481_b_out *b_out = &bcs->b_out;
203 struct st5481_adapter *adapter = bcs->adapter;
205 DBG(4, "B%d,mode=%d", bcs->channel + 1, mode);
207 if (bcs->mode == mode)
210 bcs->mode = mode;
217 st5481_in_mode(&bcs->b_in, mode);
218 if (bcs->mode != L1_MODE_NULL) {
220 if (bcs->mode != L1_MODE_TRANS) {
222 if (bcs->mode == L1_MODE_HDLC_56K)
226 st5481_usb_pipe_reset(adapter, (bcs->channel + 1) * 2, NULL, NULL);
229 st5481_usb_device_ctrl_msg(adapter, FFMSK_B1 + (bcs->channel * 2),
233 st5481_usb_device_ctrl_msg(adapter, OUT_B1_COUNTER+(bcs->channel * 2), 32, st5481B_start_xfer, bcs);
235 if (bcs->channel == 0) {
243 st5481_usb_device_ctrl_msg(adapter, FFMSK_B1+(bcs->channel * 2), 0, NULL, NULL);
246 st5481_usb_device_ctrl_msg(adapter, OUT_B1_COUNTER+(bcs->channel * 2), 0, NULL, NULL);
249 if (bcs->channel == 0) {
265 static int st5481_setup_b_out(struct st5481_bcs *bcs)
267 struct usb_device *dev = bcs->adapter->usb_dev;
271 struct st5481_b_out *b_out = &bcs->b_out;
282 endpoint = &altsetting->endpoint[EP_B1_OUT - 1 + bcs->channel * 2];
292 usb_b_out_complete, bcs);
295 static void st5481_release_b_out(struct st5481_bcs *bcs)
297 struct st5481_b_out *b_out = &bcs->b_out;
304 int st5481_setup_b(struct st5481_bcs *bcs)
310 retval = st5481_setup_b_out(bcs);
313 bcs->b_in.bufsize = HSCX_BUFMAX;
314 bcs->b_in.num_packets = NUM_ISO_PACKETS_B;
315 bcs->b_in.packet_size = SIZE_ISO_PACKETS_B_IN;
316 bcs->b_in.ep = (bcs->channel ? EP_B2_IN : EP_B1_IN) | USB_DIR_IN;
317 bcs->b_in.counter = bcs->channel ? IN_B2_COUNTER : IN_B1_COUNTER;
318 bcs->b_in.adapter = bcs->adapter;
319 bcs->b_in.hisax_if = &bcs->b_if.ifc;
320 retval = st5481_setup_in(&bcs->b_in);
328 st5481_release_b_out(bcs);
336 void st5481_release_b(struct st5481_bcs *bcs)
340 st5481_release_in(&bcs->b_in);
341 st5481_release_b_out(bcs);
355 struct st5481_bcs *bcs = ifc->priv;
363 BUG_ON(bcs->b_out.tx_skb);
364 bcs->b_out.tx_skb = skb;
368 DBG(4, "B%d,PH_ACTIVATE_REQUEST %ld", bcs->channel + 1, mode);
369 st5481B_mode(bcs, mode);
370 B_L1L2(bcs, PH_ACTIVATE | INDICATION, NULL);
373 DBG(4, "B%d,PH_DEACTIVATE_REQUEST", bcs->channel + 1);
374 st5481B_mode(bcs, L1_MODE_NULL);
375 B_L1L2(bcs, PH_DEACTIVATE | INDICATION, NULL);