2 * Wire Adapter Host Controller Driver
3 * Common items to HWA and DWA based HCDs
5 * Copyright (C) 2005-2006 Intel Corporation
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #include <linux/slab.h>
26 #include <linux/module.h>
33 * wa->usb_dev and wa->usb_iface initialized and refcounted,
34 * wa->wa_descr initialized.
36 int wa_create(struct wahc
*wa
, struct usb_interface
*iface
,
37 kernel_ulong_t quirks
)
40 struct device
*dev
= &iface
->dev
;
42 if (iface
->cur_altsetting
->desc
.bNumEndpoints
< 3)
45 result
= wa_rpipes_create(wa
);
47 goto error_rpipes_create
;
49 /* Fill up Data Transfer EP pointers */
50 wa
->dti_epd
= &iface
->cur_altsetting
->endpoint
[1].desc
;
51 wa
->dto_epd
= &iface
->cur_altsetting
->endpoint
[2].desc
;
52 wa
->dti_buf_size
= usb_endpoint_maxp(wa
->dti_epd
);
53 wa
->dti_buf
= kmalloc(wa
->dti_buf_size
, GFP_KERNEL
);
54 if (wa
->dti_buf
== NULL
) {
56 goto error_dti_buf_alloc
;
58 result
= wa_nep_create(wa
, iface
);
60 dev_err(dev
, "WA-CDS: can't initialize notif endpoint: %d\n",
62 goto error_nep_create
;
69 wa_rpipes_destroy(wa
);
73 EXPORT_SYMBOL_GPL(wa_create
);
76 void __wa_destroy(struct wahc
*wa
)
79 usb_kill_urb(wa
->dti_urb
);
80 usb_put_urb(wa
->dti_urb
);
84 wa_rpipes_destroy(wa
);
86 EXPORT_SYMBOL_GPL(__wa_destroy
);
89 * wa_reset_all - reset the WA device
90 * @wa: the WA to be reset
92 * For HWAs the radio controller and all other PALs are also reset.
94 void wa_reset_all(struct wahc
*wa
)
96 /* FIXME: assuming HWA. */
97 wusbhc_reset_all(wa
->wusb
);
100 MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
101 MODULE_DESCRIPTION("Wireless USB Wire Adapter core");
102 MODULE_LICENSE("GPL");