29 urb->transfer_buffer =
buffer;
34 urb->dev = rt->
chip->dev;
37 static void usb6fire_comm_receiver_handler(
struct urb *urb)
50 if (!rt->
chip->shutdown) {
52 urb->actual_length = 0;
55 "comm data receiver aborted.\n");
59 static void usb6fire_comm_init_buffer(
u8 *buffer,
u8 id,
u8 request,
96 static int usb6fire_comm_send_buffer(
u8 *buffer,
struct usb_device *
dev)
102 buffer, buffer[1] + 2, &actual_len,
HZ);
105 else if (actual_len != buffer[1] + 2)
110 static int usb6fire_comm_write8(
struct comm_runtime *rt,
u8 request,
115 usb6fire_comm_init_buffer(buffer, 0x00, request, reg, value, 0x00);
116 return usb6fire_comm_send_buffer(buffer, rt->
chip->dev);
119 static int usb6fire_comm_write16(
struct comm_runtime *rt,
u8 request,
124 usb6fire_comm_init_buffer(buffer, 0x00, request, reg, vl, vh);
125 return usb6fire_comm_send_buffer(buffer, rt->
chip->dev);
141 rt->
init_urb = usb6fire_comm_init_urb;
142 rt->
write8 = usb6fire_comm_write8;
143 rt->
write16 = usb6fire_comm_write16;
148 urb->pipe = usb_rcvintpipe(chip->
dev,
COMM_EP);
149 urb->dev = chip->
dev;
150 urb->complete = usb6fire_comm_receiver_handler;