18 #include <linux/kernel.h>
20 #include <linux/module.h>
23 #include "../../wusbcore/wusbhc.h"
32 static int whc_reset(
struct usb_hcd *usb_hcd)
44 static int whc_start(
struct usb_hcd *usb_hcd)
71 usb_hcd->uses_new_polling = 1;
72 set_bit(HCD_FLAG_POLL_RH, &usb_hcd->flags);
73 usb_hcd->state = HC_STATE_RUNNING;
88 static void whc_stop(
struct usb_hcd *usb_hcd)
107 static int whc_get_frame_number(
struct usb_hcd *usb_hcd)
117 static int whc_urb_enqueue(
struct usb_hcd *usb_hcd,
struct urb *
urb,
124 switch (usb_pipetype(urb->pipe)) {
128 case PIPE_ISOCHRONOUS:
129 dev_err(&whc->
umc->dev,
"isochronous transfers unsupported\n");
145 static int whc_urb_dequeue(
struct usb_hcd *usb_hcd,
struct urb *urb,
int status)
151 switch (usb_pipetype(urb->pipe)) {
155 case PIPE_ISOCHRONOUS:
172 static void whc_endpoint_disable(
struct usb_hcd *usb_hcd,
173 struct usb_host_endpoint *ep)
182 if (usb_endpoint_xfer_bulk(&ep->desc)
183 || usb_endpoint_xfer_control(&ep->desc))
190 static void whc_endpoint_reset(
struct usb_hcd *usb_hcd,
191 struct usb_host_endpoint *ep)
205 if (usb_endpoint_xfer_bulk(&ep->desc)
206 || usb_endpoint_xfer_control(&ep->desc))
212 spin_unlock_irqrestore(&whc->
lock, flags);
216 static struct hc_driver whc_hc_driver = {
217 .description =
"whci-hcd",
218 .product_desc =
"Wireless host controller",
219 .hcd_priv_size =
sizeof(
struct whc) -
sizeof(
struct usb_hcd),
226 .get_frame_number = whc_get_frame_number,
227 .urb_enqueue = whc_urb_enqueue,
228 .urb_dequeue = whc_urb_dequeue,
229 .endpoint_disable = whc_endpoint_disable,
230 .endpoint_reset = whc_endpoint_reset,
242 struct usb_hcd *usb_hcd;
243 struct wusbhc *wusbhc;
248 if (usb_hcd ==
NULL) {
249 dev_err(dev,
"unable to create hcd\n");
253 usb_hcd->wireless = 1;
254 usb_hcd->self.sg_tablesize = 2048;
268 dev_err(dev,
"cannot get radio controller\n");
273 dev_warn(dev,
"USB_MAXCHILDREN too low for WUSB adapter (%u ports)\n",
291 goto error_wusbhc_create;
295 dev_err(dev,
"cannot add HCD: %d\n", ret);
296 goto error_usb_add_hcd;
301 dev_err(dev,
"WUSBHC phase B setup failed: %d\n", ret);
302 goto error_wusbhc_b_create;
309 error_wusbhc_b_create:
323 static void whc_remove(
struct umc_dev *umc)
344 .remove = whc_remove,
347 static int __init whci_hc_driver_init(
void)
353 static void __exit whci_hc_driver_exit(
void)