Lines Matching refs:iforce_usb
12 struct iforce_usb { struct
25 struct iforce_usb *iforce_usb = container_of(iforce, struct iforce_usb, in __iforce_usb_xmit() argument
38 ((char *)iforce_usb->out->transfer_buffer)[0] = iforce->xmit.buf[iforce->xmit.tail]; in __iforce_usb_xmit()
43 iforce_usb->out->transfer_buffer_length = n + 1; in __iforce_usb_xmit()
44 iforce_usb->out->dev = iforce_usb->usbdev; in __iforce_usb_xmit()
50 memcpy(iforce_usb->out->transfer_buffer + 1, in __iforce_usb_xmit()
54 memcpy(iforce_usb->out->transfer_buffer + 1 + c, in __iforce_usb_xmit()
60 if ( (n=usb_submit_urb(iforce_usb->out, GFP_ATOMIC)) ) { in __iforce_usb_xmit()
62 dev_warn(&iforce_usb->intf->dev, in __iforce_usb_xmit()
81 struct iforce_usb *iforce_usb = container_of(iforce, struct iforce_usb, in iforce_usb_get_id() local
90 status = usb_control_msg(iforce_usb->usbdev, in iforce_usb_get_id()
91 usb_rcvctrlpipe(iforce_usb->usbdev, 0), in iforce_usb_get_id()
97 dev_err(&iforce_usb->intf->dev, in iforce_usb_get_id()
113 struct iforce_usb *iforce_usb = container_of(iforce, struct iforce_usb, in iforce_usb_start_io() local
116 if (usb_submit_urb(iforce_usb->irq, GFP_KERNEL)) in iforce_usb_start_io()
124 struct iforce_usb *iforce_usb = container_of(iforce, struct iforce_usb, in iforce_usb_stop_io() local
127 usb_kill_urb(iforce_usb->irq); in iforce_usb_stop_io()
128 usb_kill_urb(iforce_usb->out); in iforce_usb_stop_io()
140 struct iforce_usb *iforce_usb = urb->context; in iforce_usb_irq() local
141 struct iforce *iforce = &iforce_usb->iforce; in iforce_usb_irq()
142 struct device *dev = &iforce_usb->intf->dev; in iforce_usb_irq()
162 iforce_process_packet(iforce, iforce_usb->data_in[0], in iforce_usb_irq()
163 iforce_usb->data_in + 1, urb->actual_length - 1); in iforce_usb_irq()
174 struct iforce_usb *iforce_usb = urb->context; in iforce_usb_out() local
175 struct iforce *iforce = &iforce_usb->iforce; in iforce_usb_out()
179 dev_dbg(&iforce_usb->intf->dev, "urb->status %d, exiting\n", in iforce_usb_out()
195 struct iforce_usb *iforce_usb; in iforce_usb_probe() local
211 iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL); in iforce_usb_probe()
212 if (!iforce_usb) in iforce_usb_probe()
215 iforce_usb->irq = usb_alloc_urb(0, GFP_KERNEL); in iforce_usb_probe()
216 if (!iforce_usb->irq) in iforce_usb_probe()
219 iforce_usb->out = usb_alloc_urb(0, GFP_KERNEL); in iforce_usb_probe()
220 if (!iforce_usb->out) in iforce_usb_probe()
223 iforce_usb->iforce.xport_ops = &iforce_usb_xport_ops; in iforce_usb_probe()
225 iforce_usb->usbdev = dev; in iforce_usb_probe()
226 iforce_usb->intf = intf; in iforce_usb_probe()
228 usb_fill_int_urb(iforce_usb->irq, dev, in iforce_usb_probe()
230 iforce_usb->data_in, sizeof(iforce_usb->data_in), in iforce_usb_probe()
231 iforce_usb_irq, iforce_usb, epirq->bInterval); in iforce_usb_probe()
233 usb_fill_int_urb(iforce_usb->out, dev, in iforce_usb_probe()
235 iforce_usb->data_out, sizeof(iforce_usb->data_out), in iforce_usb_probe()
236 iforce_usb_out, iforce_usb, epout->bInterval); in iforce_usb_probe()
238 err = iforce_init_device(&intf->dev, BUS_USB, &iforce_usb->iforce); in iforce_usb_probe()
242 usb_set_intfdata(intf, iforce_usb); in iforce_usb_probe()
246 if (iforce_usb) { in iforce_usb_probe()
247 usb_free_urb(iforce_usb->irq); in iforce_usb_probe()
248 usb_free_urb(iforce_usb->out); in iforce_usb_probe()
249 kfree(iforce_usb); in iforce_usb_probe()
257 struct iforce_usb *iforce_usb = usb_get_intfdata(intf); in iforce_usb_disconnect() local
261 input_unregister_device(iforce_usb->iforce.dev); in iforce_usb_disconnect()
263 usb_free_urb(iforce_usb->irq); in iforce_usb_disconnect()
264 usb_free_urb(iforce_usb->out); in iforce_usb_disconnect()
266 kfree(iforce_usb); in iforce_usb_disconnect()