16 #include <linux/netdevice.h>
24 ifc->
l1l2(ifc, pr, arg);
35 unsigned int packet_size,
offset;
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);
62 while (len < buf_size) {
63 if ((skb = b_out->
tx_skb)) {
68 bytes_sent = buf_size -
len;
69 if (skb->
len < bytes_sent)
70 bytes_sent = skb->
len;
72 register unsigned char *
src = skb->
data;
73 register unsigned char *
dest = urb->transfer_buffer +
len;
74 register unsigned int count;
75 for (count = 0; count < bytes_sent; count++)
76 *dest++ = bitrev8(*src++);
81 skb->
data, skb->
len, &bytes_sent,
82 urb->transfer_buffer + len, buf_size-len);
99 memset(urb->transfer_buffer + len, 0xff, buf_size-len);
104 NULL, 0, &bytes_sent,
105 urb->transfer_buffer + len, buf_size-len);
111 for (i = 0, offset = 0; offset <
len; i++) {
112 urb->iso_frame_desc[
i].offset =
offset;
113 urb->iso_frame_desc[
i].length = packet_size;
114 offset += packet_size;
117 urb->transfer_buffer_length =
len;
118 urb->number_of_packets =
i;
130 static void st5481B_start_xfer(
void *
context)
165 static void usb_b_out_complete(
struct urb *urb)
172 buf_nr = get_buf_nr(b_out->
urb, urb);
176 switch (urb->status) {
180 DBG(4,
"urb killed status %d", urb->status);
183 WARNING(
"urb status %d", urb->status);
184 if (b_out->
busy == 0) {
191 usb_b_out(bcs, buf_nr);
205 DBG(4,
"B%d,mode=%d", bcs->
channel + 1, mode);
207 if (bcs->
mode == mode)
265 static int st5481_setup_b_out(
struct st5481_bcs *bcs)
267 struct usb_device *
dev = bcs->
adapter->usb_dev;
269 struct usb_host_interface *altsetting =
NULL;
284 DBG(4,
"endpoint address=%02x,packet size=%d",
285 endpoint->desc.bEndpointAddress,
le16_to_cpu(endpoint->desc.wMaxPacketSize));
289 usb_sndisocpipe(dev, endpoint->desc.bEndpointAddress),
292 usb_b_out_complete, bcs);
295 static void st5481_release_b_out(
struct st5481_bcs *bcs)
310 retval = st5481_setup_b_out(bcs);
319 bcs->
b_in.hisax_if = &bcs->
b_if.ifc;
328 st5481_release_b_out(bcs);
341 st5481_release_b_out(bcs);
368 DBG(4,
"B%d,PH_ACTIVATE_REQUEST %ld", bcs->
channel + 1, mode);
369 st5481B_mode(bcs, mode);
373 DBG(4,
"B%d,PH_DEACTIVATE_REQUEST", bcs->
channel + 1);