9 #include <linux/module.h>
11 #include <linux/sched.h>
12 #include <linux/netdevice.h>
13 #include <linux/errno.h>
14 #include <linux/input.h>
15 #include <asm/unaligned.h>
28 #define MAX_ISOC_FIXED_DATA (253-sizeof(struct oz_isoc_fixed))
42 spin_lock_bh(&eb->
lock);
51 spin_unlock_bh(&eb->
lock);
66 oz_trace(
" req_type = 0x%x\n", req_type);
67 oz_trace(
" desc_type = 0x%x\n", desc_type);
69 oz_trace(
" windex = 0x%x\n", windex);
70 oz_trace(
" offset = 0x%x\n", offset);
87 return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
108 return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
113 static int oz_usb_set_interface_req(
void *hpd,
u8 req_id,
u8 index,
u8 alt)
116 struct oz_pd *pd = usb_ctx->
pd;
130 return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
135 static int oz_usb_set_clear_feature_req(
void *hpd,
u8 req_id,
u8 type,
139 struct oz_pd *pd = usb_ctx->
pd;
154 return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
159 static int oz_usb_vendor_class_req(
void *hpd,
u8 req_id,
u8 req_type,
163 struct oz_pd *pd = usb_ctx->
pd;
181 return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
187 u8 *data,
int data_len)
194 (
void *)(((
unsigned long)(setup->
wValue))<<16 |
195 ((
unsigned long)setup->
wIndex)),
202 (
u8)wvalue, setup->
wIndex, 0, wlength);
205 rc = oz_usb_set_config_req(hpd, req_id, (
u8)wvalue);
208 u8 if_num = (
u8)windex;
210 rc = oz_usb_set_interface_req(hpd, req_id,
215 rc = oz_usb_set_clear_feature_req(hpd, req_id,
221 rc = oz_usb_set_clear_feature_req(hpd, req_id,
228 rc = oz_usb_vendor_class_req(hpd, req_id, setup->
bRequestType,
240 struct oz_pd *pd = usb_ctx->
pd;
245 struct usb_iso_packet_descriptor *
desc;
248 for (i = 0; i < urb->number_of_packets; i++) {
250 desc = &urb->iso_frame_desc[
i];
251 data = ((
u8 *)urb->transfer_buffer)+desc->offset;
260 while (i < urb->number_of_packets) {
275 unit_size = urb->iso_frame_desc[
i].length;
277 data = ((
u8 *)(elt+1)) + hdr_size;
279 while (i < urb->number_of_packets) {
280 desc = &urb->iso_frame_desc[
i];
281 if ((unit_size == desc->length) &&
282 (desc->length <= rem)) {
283 memcpy(data, ((
u8 *)urb->transfer_buffer) +
284 desc->offset, unit_size);
289 desc->actual_length = desc->length;
300 oz_usb_submit_elt(eb, ei, usb_ctx, ep_num,
312 switch (data_hdr->
format) {
337 for (i = 0; i <
count; i++) {
375 switch (usb_hdr->
type) {
379 int data_len = elt->
length -
384 oz_trace(
"USB_REQ_GET_DESCRIPTOR - cnf\n");
387 data_len, offs, total_size);
433 oz_trace(
"Farewell indicated ep = 0x%x\n", ep_num);