aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 09:54:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:00 -0500
commit3b640f21af4b6b36b546fecbd3fe5109981360da (patch)
tree5fce049b149283f8864d60b5b265a12b08827b3f /drivers/net/wireless/rt2x00/rt2x00usb.c
parenta9450b70a755abf093600035ef5361c53343fe9a (diff)
rt2x00: Enable LED class support for rt2500usb/rt73usb
Add kerneldoc for vendor request functions in rt2x00usb. Add asynchroneous vendor request function in rt2x00usb. With the availability of the asynchroneuous vendor request we can now enable LED class support for rt2500usb and rt73usb. Since LED handling is not important, it doesn't really matter if a register call fails (This solution is better then no LED class support at all). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index fc606448908e..44ab2167c6ee 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -122,6 +122,58 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev,
122} 122}
123EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff); 123EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff);
124 124
125static void rt2x00usb_vendor_request_async_complete(struct urb *urb)
126{
127 /*
128 * We're done with it, descrease usage count and let the
129 * usb layer delete it as soon as it is done with it.
130 */
131 usb_put_urb(urb);
132}
133
134int rt2x00usb_vendor_request_async(struct rt2x00_dev *rt2x00dev,
135 const u8 request, const u16 offset,
136 const u16 value)
137{
138 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev);
139 struct usb_ctrlrequest *ctrl;
140 struct urb *urb;
141 int status;
142
143 urb = usb_alloc_urb(0, GFP_NOIO);
144 if (!urb)
145 return -ENOMEM;
146
147 ctrl = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
148 if (!ctrl) {
149 status = -ENOMEM;
150 goto exit;
151 }
152
153 ctrl->bRequestType= USB_VENDOR_REQUEST_OUT;
154 ctrl->bRequest = request;
155 ctrl->wValue = cpu_to_le16p(&value);
156 ctrl->wIndex = cpu_to_le16p(&offset);
157 ctrl->wLength = 0;
158
159 usb_fill_control_urb(urb, usb_dev, usb_sndctrlpipe(usb_dev, 0),
160 (unsigned char *)ctrl, NULL, 0,
161 rt2x00usb_vendor_request_async_complete, NULL);
162
163 status = usb_submit_urb(urb, GFP_ATOMIC);
164 if (!status)
165 goto exit;
166
167 return 0;
168
169exit:
170 usb_put_urb(urb);
171 kfree(ctrl);
172
173 return status;
174}
175EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_async);
176
125/* 177/*
126 * TX data handlers. 178 * TX data handlers.
127 */ 179 */