This source file includes following definitions.
- wa_create
- __wa_destroy
- wa_reset_all
1
2
3
4
5
6
7
8
9
10
11 #include <linux/slab.h>
12 #include <linux/module.h>
13 #include "wusbhc.h"
14 #include "wa-hc.h"
15
16
17
18
19
20
21
22 int wa_create(struct wahc *wa, struct usb_interface *iface,
23 kernel_ulong_t quirks)
24 {
25 int result;
26 struct device *dev = &iface->dev;
27
28 if (iface->cur_altsetting->desc.bNumEndpoints < 3)
29 return -ENODEV;
30
31 result = wa_rpipes_create(wa);
32 if (result < 0)
33 goto error_rpipes_create;
34 wa->quirks = quirks;
35
36 wa->dti_epd = &iface->cur_altsetting->endpoint[1].desc;
37 wa->dto_epd = &iface->cur_altsetting->endpoint[2].desc;
38 wa->dti_buf_size = usb_endpoint_maxp(wa->dti_epd);
39 wa->dti_buf = kmalloc(wa->dti_buf_size, GFP_KERNEL);
40 if (wa->dti_buf == NULL) {
41 result = -ENOMEM;
42 goto error_dti_buf_alloc;
43 }
44 result = wa_nep_create(wa, iface);
45 if (result < 0) {
46 dev_err(dev, "WA-CDS: can't initialize notif endpoint: %d\n",
47 result);
48 goto error_nep_create;
49 }
50 return 0;
51
52 error_nep_create:
53 kfree(wa->dti_buf);
54 error_dti_buf_alloc:
55 wa_rpipes_destroy(wa);
56 error_rpipes_create:
57 return result;
58 }
59 EXPORT_SYMBOL_GPL(wa_create);
60
61
62 void __wa_destroy(struct wahc *wa)
63 {
64 if (wa->dti_urb) {
65 usb_kill_urb(wa->dti_urb);
66 usb_put_urb(wa->dti_urb);
67 }
68 kfree(wa->dti_buf);
69 wa_nep_destroy(wa);
70 wa_rpipes_destroy(wa);
71 }
72 EXPORT_SYMBOL_GPL(__wa_destroy);
73
74
75
76
77
78
79
80 void wa_reset_all(struct wahc *wa)
81 {
82
83 wusbhc_reset_all(wa->wusb);
84 }
85
86 MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
87 MODULE_DESCRIPTION("Wireless USB Wire Adapter core");
88 MODULE_LICENSE("GPL");