2 #include <linux/slab.h>
9 * wa->usb_dev and wa->usb_iface initialized and refcounted,
10 * wa->wa_descr initialized.
12 int wa_create(struct wahc
*wa
, struct usb_interface
*iface
)
15 struct device
*dev
= &iface
->dev
;
17 result
= wa_rpipes_create(wa
);
19 goto error_rpipes_create
;
20 /* Fill up Data Transfer EP pointers */
21 wa
->dti_epd
= &iface
->cur_altsetting
->endpoint
[1].desc
;
22 wa
->dto_epd
= &iface
->cur_altsetting
->endpoint
[2].desc
;
23 wa
->xfer_result_size
= le16_to_cpu(wa
->dti_epd
->wMaxPacketSize
);
24 wa
->xfer_result
= kmalloc(wa
->xfer_result_size
, GFP_KERNEL
);
25 if (wa
->xfer_result
== NULL
)
26 goto error_xfer_result_alloc
;
27 result
= wa_nep_create(wa
, iface
);
29 dev_err(dev
, "WA-CDS: can't initialize notif endpoint: %d\n",
31 goto error_nep_create
;
36 kfree(wa
->xfer_result
);
37 error_xfer_result_alloc
:
38 wa_rpipes_destroy(wa
);
42 EXPORT_SYMBOL_GPL(wa_create
);
45 void __wa_destroy(struct wahc
*wa
)
48 usb_kill_urb(wa
->dti_urb
);
49 usb_put_urb(wa
->dti_urb
);
50 usb_kill_urb(wa
->buf_in_urb
);
51 usb_put_urb(wa
->buf_in_urb
);
53 kfree(wa
->xfer_result
);
55 wa_rpipes_destroy(wa
);
57 EXPORT_SYMBOL_GPL(__wa_destroy
);
60 * wa_reset_all - reset the WA device
61 * @wa: the WA to be reset
63 * For HWAs the radio controller and all other PALs are also reset.
65 void wa_reset_all(struct wahc
*wa
)
67 wusbhc_reset_all(wa
->wusb
);
70 MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
71 MODULE_DESCRIPTION("Wireless USB Wire Adapter core");
72 MODULE_LICENSE("GPL");