diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-30 18:21:33 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:35:07 -0500 |
commit | 41dceed51f0e6105ca2bf45c3835a7cd9eaa077b (patch) | |
tree | 99e6614643f12c126ff83720cc6b76012e44b3d2 /include | |
parent | 969ab2ee9d68bd037e2db7ea12ff78baae5d2f94 (diff) |
USB: fix codingstyle issues in include/linux/usb/
Fixes a number of coding style issues in the USB public header files.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/audio.h | 14 | ||||
-rw-r--r-- | include/linux/usb/cdc.h | 16 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 123 | ||||
-rw-r--r-- | include/linux/usb/gadgetfs.h | 22 | ||||
-rw-r--r-- | include/linux/usb/iowarrior.h | 25 | ||||
-rw-r--r-- | include/linux/usb/isp116x.h | 2 | ||||
-rw-r--r-- | include/linux/usb/midi.h | 26 | ||||
-rw-r--r-- | include/linux/usb/net2280.h | 32 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 2 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 157 | ||||
-rw-r--r-- | include/linux/usb/sl811.h | 6 |
11 files changed, 220 insertions, 205 deletions
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index 6bd235994dc2..2dfeef16b221 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -27,13 +27,13 @@ | |||
27 | 27 | ||
28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
29 | struct usb_ac_header_descriptor { | 29 | struct usb_ac_header_descriptor { |
30 | __u8 bLength; // 8+n | 30 | __u8 bLength; /* 8+n */ |
31 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | 31 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
32 | __u8 bDescriptorSubtype; // USB_MS_HEADER | 32 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ |
33 | __le16 bcdADC; // 0x0100 | 33 | __le16 bcdADC; /* 0x0100 */ |
34 | __le16 wTotalLength; // includes Unit and Terminal desc. | 34 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ |
35 | __u8 bInCollection; // n | 35 | __u8 bInCollection; /* n */ |
36 | __u8 baInterfaceNr[]; // [n] | 36 | __u8 baInterfaceNr[]; /* [n] */ |
37 | } __attribute__ ((packed)); | 37 | } __attribute__ ((packed)); |
38 | 38 | ||
39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) | 39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index 2204ae22c381..94ee4ecf0564 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -29,16 +29,16 @@ | |||
29 | * Class-Specific descriptors ... there are a couple dozen of them | 29 | * Class-Specific descriptors ... there are a couple dozen of them |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ | 32 | #define USB_CDC_HEADER_TYPE 0x00 /* header_desc */ |
33 | #define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ | 33 | #define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */ |
34 | #define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ | 34 | #define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ |
35 | #define USB_CDC_UNION_TYPE 0x06 /* union_desc */ | 35 | #define USB_CDC_UNION_TYPE 0x06 /* union_desc */ |
36 | #define USB_CDC_COUNTRY_TYPE 0x07 | 36 | #define USB_CDC_COUNTRY_TYPE 0x07 |
37 | #define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ | 37 | #define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */ |
38 | #define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ | 38 | #define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ |
39 | #define USB_CDC_WHCM_TYPE 0x11 | 39 | #define USB_CDC_WHCM_TYPE 0x11 |
40 | #define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ | 40 | #define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ |
41 | #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ | 41 | #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ |
42 | #define USB_CDC_DMM_TYPE 0x14 | 42 | #define USB_CDC_DMM_TYPE 0x14 |
43 | #define USB_CDC_OBEX_TYPE 0x15 | 43 | #define USB_CDC_OBEX_TYPE 0x15 |
44 | 44 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index c1527c2ef3cb..aa3047ff00d1 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -70,9 +70,10 @@ struct usb_ep; | |||
70 | * | 70 | * |
71 | * Bulk endpoints can use any size buffers, and can also be used for interrupt | 71 | * Bulk endpoints can use any size buffers, and can also be used for interrupt |
72 | * transfers. interrupt-only endpoints can be much less functional. | 72 | * transfers. interrupt-only endpoints can be much less functional. |
73 | * | ||
74 | * NOTE: this is analagous to 'struct urb' on the host side, except that | ||
75 | * it's thinner and promotes more pre-allocation. | ||
73 | */ | 76 | */ |
74 | // NOTE this is analagous to 'struct urb' on the host side, | ||
75 | // except that it's thinner and promotes more pre-allocation. | ||
76 | 77 | ||
77 | struct usb_request { | 78 | struct usb_request { |
78 | void *buf; | 79 | void *buf; |
@@ -168,10 +169,10 @@ struct usb_ep { | |||
168 | * | 169 | * |
169 | * returns zero, or a negative error code. | 170 | * returns zero, or a negative error code. |
170 | */ | 171 | */ |
171 | static inline int | 172 | static inline int usb_ep_enable(struct usb_ep *ep, |
172 | usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) | 173 | const struct usb_endpoint_descriptor *desc) |
173 | { | 174 | { |
174 | return ep->ops->enable (ep, desc); | 175 | return ep->ops->enable(ep, desc); |
175 | } | 176 | } |
176 | 177 | ||
177 | /** | 178 | /** |
@@ -186,10 +187,9 @@ usb_ep_enable (struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) | |||
186 | * | 187 | * |
187 | * returns zero, or a negative error code. | 188 | * returns zero, or a negative error code. |
188 | */ | 189 | */ |
189 | static inline int | 190 | static inline int usb_ep_disable(struct usb_ep *ep) |
190 | usb_ep_disable (struct usb_ep *ep) | ||
191 | { | 191 | { |
192 | return ep->ops->disable (ep); | 192 | return ep->ops->disable(ep); |
193 | } | 193 | } |
194 | 194 | ||
195 | /** | 195 | /** |
@@ -206,10 +206,10 @@ usb_ep_disable (struct usb_ep *ep) | |||
206 | * | 206 | * |
207 | * Returns the request, or null if one could not be allocated. | 207 | * Returns the request, or null if one could not be allocated. |
208 | */ | 208 | */ |
209 | static inline struct usb_request * | 209 | static inline struct usb_request *usb_ep_alloc_request(struct usb_ep *ep, |
210 | usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) | 210 | gfp_t gfp_flags) |
211 | { | 211 | { |
212 | return ep->ops->alloc_request (ep, gfp_flags); | 212 | return ep->ops->alloc_request(ep, gfp_flags); |
213 | } | 213 | } |
214 | 214 | ||
215 | /** | 215 | /** |
@@ -221,10 +221,10 @@ usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) | |||
221 | * Caller guarantees the request is not queued, and that it will | 221 | * Caller guarantees the request is not queued, and that it will |
222 | * no longer be requeued (or otherwise used). | 222 | * no longer be requeued (or otherwise used). |
223 | */ | 223 | */ |
224 | static inline void | 224 | static inline void usb_ep_free_request(struct usb_ep *ep, |
225 | usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | 225 | struct usb_request *req) |
226 | { | 226 | { |
227 | ep->ops->free_request (ep, req); | 227 | ep->ops->free_request(ep, req); |
228 | } | 228 | } |
229 | 229 | ||
230 | /** | 230 | /** |
@@ -281,10 +281,10 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | |||
281 | * report errors; errors will also be | 281 | * report errors; errors will also be |
282 | * reported when the usb peripheral is disconnected. | 282 | * reported when the usb peripheral is disconnected. |
283 | */ | 283 | */ |
284 | static inline int | 284 | static inline int usb_ep_queue(struct usb_ep *ep, |
285 | usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) | 285 | struct usb_request *req, gfp_t gfp_flags) |
286 | { | 286 | { |
287 | return ep->ops->queue (ep, req, gfp_flags); | 287 | return ep->ops->queue(ep, req, gfp_flags); |
288 | } | 288 | } |
289 | 289 | ||
290 | /** | 290 | /** |
@@ -301,9 +301,9 @@ usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) | |||
301 | * restrictions prevent drivers from supporting configuration changes, | 301 | * restrictions prevent drivers from supporting configuration changes, |
302 | * even to configuration zero (a "chapter 9" requirement). | 302 | * even to configuration zero (a "chapter 9" requirement). |
303 | */ | 303 | */ |
304 | static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) | 304 | static inline int usb_ep_dequeue(struct usb_ep *ep, struct usb_request *req) |
305 | { | 305 | { |
306 | return ep->ops->dequeue (ep, req); | 306 | return ep->ops->dequeue(ep, req); |
307 | } | 307 | } |
308 | 308 | ||
309 | /** | 309 | /** |
@@ -327,10 +327,9 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) | |||
327 | * transfer requests are still queued, or if the controller hardware | 327 | * transfer requests are still queued, or if the controller hardware |
328 | * (usually a FIFO) still holds bytes that the host hasn't collected. | 328 | * (usually a FIFO) still holds bytes that the host hasn't collected. |
329 | */ | 329 | */ |
330 | static inline int | 330 | static inline int usb_ep_set_halt(struct usb_ep *ep) |
331 | usb_ep_set_halt (struct usb_ep *ep) | ||
332 | { | 331 | { |
333 | return ep->ops->set_halt (ep, 1); | 332 | return ep->ops->set_halt(ep, 1); |
334 | } | 333 | } |
335 | 334 | ||
336 | /** | 335 | /** |
@@ -346,10 +345,9 @@ usb_ep_set_halt (struct usb_ep *ep) | |||
346 | * Note that some hardware can't support this request (like pxa2xx_udc), | 345 | * Note that some hardware can't support this request (like pxa2xx_udc), |
347 | * and accordingly can't correctly implement interface altsettings. | 346 | * and accordingly can't correctly implement interface altsettings. |
348 | */ | 347 | */ |
349 | static inline int | 348 | static inline int usb_ep_clear_halt(struct usb_ep *ep) |
350 | usb_ep_clear_halt (struct usb_ep *ep) | ||
351 | { | 349 | { |
352 | return ep->ops->set_halt (ep, 0); | 350 | return ep->ops->set_halt(ep, 0); |
353 | } | 351 | } |
354 | 352 | ||
355 | /** | 353 | /** |
@@ -367,11 +365,10 @@ usb_ep_clear_halt (struct usb_ep *ep) | |||
367 | * errno if the endpoint doesn't use a FIFO or doesn't support such | 365 | * errno if the endpoint doesn't use a FIFO or doesn't support such |
368 | * precise handling. | 366 | * precise handling. |
369 | */ | 367 | */ |
370 | static inline int | 368 | static inline int usb_ep_fifo_status(struct usb_ep *ep) |
371 | usb_ep_fifo_status (struct usb_ep *ep) | ||
372 | { | 369 | { |
373 | if (ep->ops->fifo_status) | 370 | if (ep->ops->fifo_status) |
374 | return ep->ops->fifo_status (ep); | 371 | return ep->ops->fifo_status(ep); |
375 | else | 372 | else |
376 | return -EOPNOTSUPP; | 373 | return -EOPNOTSUPP; |
377 | } | 374 | } |
@@ -385,11 +382,10 @@ usb_ep_fifo_status (struct usb_ep *ep) | |||
385 | * must never be used except when endpoint is not being used for any | 382 | * must never be used except when endpoint is not being used for any |
386 | * protocol translation. | 383 | * protocol translation. |
387 | */ | 384 | */ |
388 | static inline void | 385 | static inline void usb_ep_fifo_flush(struct usb_ep *ep) |
389 | usb_ep_fifo_flush (struct usb_ep *ep) | ||
390 | { | 386 | { |
391 | if (ep->ops->fifo_flush) | 387 | if (ep->ops->fifo_flush) |
392 | ep->ops->fifo_flush (ep); | 388 | ep->ops->fifo_flush(ep); |
393 | } | 389 | } |
394 | 390 | ||
395 | 391 | ||
@@ -469,10 +465,10 @@ struct usb_gadget { | |||
469 | struct device dev; | 465 | struct device dev; |
470 | }; | 466 | }; |
471 | 467 | ||
472 | static inline void set_gadget_data (struct usb_gadget *gadget, void *data) | 468 | static inline void set_gadget_data(struct usb_gadget *gadget, void *data) |
473 | { dev_set_drvdata (&gadget->dev, data); } | 469 | { dev_set_drvdata(&gadget->dev, data); } |
474 | static inline void *get_gadget_data (struct usb_gadget *gadget) | 470 | static inline void *get_gadget_data(struct usb_gadget *gadget) |
475 | { return dev_get_drvdata (&gadget->dev); } | 471 | { return dev_get_drvdata(&gadget->dev); } |
476 | 472 | ||
477 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ | 473 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ |
478 | #define gadget_for_each_ep(tmp,gadget) \ | 474 | #define gadget_for_each_ep(tmp,gadget) \ |
@@ -511,7 +507,6 @@ static inline int gadget_is_otg(struct usb_gadget *g) | |||
511 | #endif | 507 | #endif |
512 | } | 508 | } |
513 | 509 | ||
514 | |||
515 | /** | 510 | /** |
516 | * usb_gadget_frame_number - returns the current frame number | 511 | * usb_gadget_frame_number - returns the current frame number |
517 | * @gadget: controller that reports the frame number | 512 | * @gadget: controller that reports the frame number |
@@ -519,9 +514,9 @@ static inline int gadget_is_otg(struct usb_gadget *g) | |||
519 | * Returns the usb frame number, normally eleven bits from a SOF packet, | 514 | * Returns the usb frame number, normally eleven bits from a SOF packet, |
520 | * or negative errno if this device doesn't support this capability. | 515 | * or negative errno if this device doesn't support this capability. |
521 | */ | 516 | */ |
522 | static inline int usb_gadget_frame_number (struct usb_gadget *gadget) | 517 | static inline int usb_gadget_frame_number(struct usb_gadget *gadget) |
523 | { | 518 | { |
524 | return gadget->ops->get_frame (gadget); | 519 | return gadget->ops->get_frame(gadget); |
525 | } | 520 | } |
526 | 521 | ||
527 | /** | 522 | /** |
@@ -537,11 +532,11 @@ static inline int usb_gadget_frame_number (struct usb_gadget *gadget) | |||
537 | * even if OTG isn't otherwise in use. OTG devices may also start | 532 | * even if OTG isn't otherwise in use. OTG devices may also start |
538 | * remote wakeup even when hosts don't explicitly enable it. | 533 | * remote wakeup even when hosts don't explicitly enable it. |
539 | */ | 534 | */ |
540 | static inline int usb_gadget_wakeup (struct usb_gadget *gadget) | 535 | static inline int usb_gadget_wakeup(struct usb_gadget *gadget) |
541 | { | 536 | { |
542 | if (!gadget->ops->wakeup) | 537 | if (!gadget->ops->wakeup) |
543 | return -EOPNOTSUPP; | 538 | return -EOPNOTSUPP; |
544 | return gadget->ops->wakeup (gadget); | 539 | return gadget->ops->wakeup(gadget); |
545 | } | 540 | } |
546 | 541 | ||
547 | /** | 542 | /** |
@@ -553,12 +548,11 @@ static inline int usb_gadget_wakeup (struct usb_gadget *gadget) | |||
553 | * | 548 | * |
554 | * returns zero on success, else negative errno. | 549 | * returns zero on success, else negative errno. |
555 | */ | 550 | */ |
556 | static inline int | 551 | static inline int usb_gadget_set_selfpowered(struct usb_gadget *gadget) |
557 | usb_gadget_set_selfpowered (struct usb_gadget *gadget) | ||
558 | { | 552 | { |
559 | if (!gadget->ops->set_selfpowered) | 553 | if (!gadget->ops->set_selfpowered) |
560 | return -EOPNOTSUPP; | 554 | return -EOPNOTSUPP; |
561 | return gadget->ops->set_selfpowered (gadget, 1); | 555 | return gadget->ops->set_selfpowered(gadget, 1); |
562 | } | 556 | } |
563 | 557 | ||
564 | /** | 558 | /** |
@@ -571,12 +565,11 @@ usb_gadget_set_selfpowered (struct usb_gadget *gadget) | |||
571 | * | 565 | * |
572 | * returns zero on success, else negative errno. | 566 | * returns zero on success, else negative errno. |
573 | */ | 567 | */ |
574 | static inline int | 568 | static inline int usb_gadget_clear_selfpowered(struct usb_gadget *gadget) |
575 | usb_gadget_clear_selfpowered (struct usb_gadget *gadget) | ||
576 | { | 569 | { |
577 | if (!gadget->ops->set_selfpowered) | 570 | if (!gadget->ops->set_selfpowered) |
578 | return -EOPNOTSUPP; | 571 | return -EOPNOTSUPP; |
579 | return gadget->ops->set_selfpowered (gadget, 0); | 572 | return gadget->ops->set_selfpowered(gadget, 0); |
580 | } | 573 | } |
581 | 574 | ||
582 | /** | 575 | /** |
@@ -591,12 +584,11 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget) | |||
591 | * | 584 | * |
592 | * Returns zero on success, else negative errno. | 585 | * Returns zero on success, else negative errno. |
593 | */ | 586 | */ |
594 | static inline int | 587 | static inline int usb_gadget_vbus_connect(struct usb_gadget *gadget) |
595 | usb_gadget_vbus_connect(struct usb_gadget *gadget) | ||
596 | { | 588 | { |
597 | if (!gadget->ops->vbus_session) | 589 | if (!gadget->ops->vbus_session) |
598 | return -EOPNOTSUPP; | 590 | return -EOPNOTSUPP; |
599 | return gadget->ops->vbus_session (gadget, 1); | 591 | return gadget->ops->vbus_session(gadget, 1); |
600 | } | 592 | } |
601 | 593 | ||
602 | /** | 594 | /** |
@@ -611,12 +603,11 @@ usb_gadget_vbus_connect(struct usb_gadget *gadget) | |||
611 | * | 603 | * |
612 | * Returns zero on success, else negative errno. | 604 | * Returns zero on success, else negative errno. |
613 | */ | 605 | */ |
614 | static inline int | 606 | static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) |
615 | usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) | ||
616 | { | 607 | { |
617 | if (!gadget->ops->vbus_draw) | 608 | if (!gadget->ops->vbus_draw) |
618 | return -EOPNOTSUPP; | 609 | return -EOPNOTSUPP; |
619 | return gadget->ops->vbus_draw (gadget, mA); | 610 | return gadget->ops->vbus_draw(gadget, mA); |
620 | } | 611 | } |
621 | 612 | ||
622 | /** | 613 | /** |
@@ -629,12 +620,11 @@ usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) | |||
629 | * | 620 | * |
630 | * Returns zero on success, else negative errno. | 621 | * Returns zero on success, else negative errno. |
631 | */ | 622 | */ |
632 | static inline int | 623 | static inline int usb_gadget_vbus_disconnect(struct usb_gadget *gadget) |
633 | usb_gadget_vbus_disconnect(struct usb_gadget *gadget) | ||
634 | { | 624 | { |
635 | if (!gadget->ops->vbus_session) | 625 | if (!gadget->ops->vbus_session) |
636 | return -EOPNOTSUPP; | 626 | return -EOPNOTSUPP; |
637 | return gadget->ops->vbus_session (gadget, 0); | 627 | return gadget->ops->vbus_session(gadget, 0); |
638 | } | 628 | } |
639 | 629 | ||
640 | /** | 630 | /** |
@@ -648,12 +638,11 @@ usb_gadget_vbus_disconnect(struct usb_gadget *gadget) | |||
648 | * | 638 | * |
649 | * Returns zero on success, else negative errno. | 639 | * Returns zero on success, else negative errno. |
650 | */ | 640 | */ |
651 | static inline int | 641 | static inline int usb_gadget_connect(struct usb_gadget *gadget) |
652 | usb_gadget_connect (struct usb_gadget *gadget) | ||
653 | { | 642 | { |
654 | if (!gadget->ops->pullup) | 643 | if (!gadget->ops->pullup) |
655 | return -EOPNOTSUPP; | 644 | return -EOPNOTSUPP; |
656 | return gadget->ops->pullup (gadget, 1); | 645 | return gadget->ops->pullup(gadget, 1); |
657 | } | 646 | } |
658 | 647 | ||
659 | /** | 648 | /** |
@@ -671,16 +660,14 @@ usb_gadget_connect (struct usb_gadget *gadget) | |||
671 | * | 660 | * |
672 | * Returns zero on success, else negative errno. | 661 | * Returns zero on success, else negative errno. |
673 | */ | 662 | */ |
674 | static inline int | 663 | static inline int usb_gadget_disconnect(struct usb_gadget *gadget) |
675 | usb_gadget_disconnect (struct usb_gadget *gadget) | ||
676 | { | 664 | { |
677 | if (!gadget->ops->pullup) | 665 | if (!gadget->ops->pullup) |
678 | return -EOPNOTSUPP; | 666 | return -EOPNOTSUPP; |
679 | return gadget->ops->pullup (gadget, 0); | 667 | return gadget->ops->pullup(gadget, 0); |
680 | } | 668 | } |
681 | 669 | ||
682 | 670 | ||
683 | |||
684 | /*-------------------------------------------------------------------------*/ | 671 | /*-------------------------------------------------------------------------*/ |
685 | 672 | ||
686 | /** | 673 | /** |
@@ -764,7 +751,7 @@ struct usb_gadget_driver { | |||
764 | void (*suspend)(struct usb_gadget *); | 751 | void (*suspend)(struct usb_gadget *); |
765 | void (*resume)(struct usb_gadget *); | 752 | void (*resume)(struct usb_gadget *); |
766 | 753 | ||
767 | // FIXME support safe rmmod | 754 | /* FIXME support safe rmmod */ |
768 | struct device_driver driver; | 755 | struct device_driver driver; |
769 | }; | 756 | }; |
770 | 757 | ||
@@ -790,7 +777,7 @@ struct usb_gadget_driver { | |||
790 | * the bind() functions will be in init sections. | 777 | * the bind() functions will be in init sections. |
791 | * This function must be called in a context that can sleep. | 778 | * This function must be called in a context that can sleep. |
792 | */ | 779 | */ |
793 | int usb_gadget_register_driver (struct usb_gadget_driver *driver); | 780 | int usb_gadget_register_driver(struct usb_gadget_driver *driver); |
794 | 781 | ||
795 | /** | 782 | /** |
796 | * usb_gadget_unregister_driver - unregister a gadget driver | 783 | * usb_gadget_unregister_driver - unregister a gadget driver |
@@ -805,7 +792,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver); | |||
805 | * will in in exit sections, so may not be linked in some kernels. | 792 | * will in in exit sections, so may not be linked in some kernels. |
806 | * This function must be called in a context that can sleep. | 793 | * This function must be called in a context that can sleep. |
807 | */ | 794 | */ |
808 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); | 795 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); |
809 | 796 | ||
810 | /*-------------------------------------------------------------------------*/ | 797 | /*-------------------------------------------------------------------------*/ |
811 | 798 | ||
@@ -838,7 +825,7 @@ struct usb_gadget_strings { | |||
838 | }; | 825 | }; |
839 | 826 | ||
840 | /* put descriptor for string with that id into buf (buflen >= 256) */ | 827 | /* put descriptor for string with that id into buf (buflen >= 256) */ |
841 | int usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf); | 828 | int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); |
842 | 829 | ||
843 | /*-------------------------------------------------------------------------*/ | 830 | /*-------------------------------------------------------------------------*/ |
844 | 831 | ||
@@ -856,10 +843,10 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config, | |||
856 | 843 | ||
857 | /* utility wrapping a simple endpoint selection policy */ | 844 | /* utility wrapping a simple endpoint selection policy */ |
858 | 845 | ||
859 | extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, | 846 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
860 | struct usb_endpoint_descriptor *) __devinit; | 847 | struct usb_endpoint_descriptor *) __devinit; |
861 | 848 | ||
862 | extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit; | 849 | extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; |
863 | 850 | ||
864 | #endif /* __KERNEL__ */ | 851 | #endif /* __KERNEL__ */ |
865 | 852 | ||
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h index 981e9ceb8fe7..c291ab1af747 100644 --- a/include/linux/usb/gadgetfs.h +++ b/include/linux/usb/gadgetfs.h | |||
@@ -36,7 +36,7 @@ enum usb_gadgetfs_event_type { | |||
36 | GADGETFS_DISCONNECT, | 36 | GADGETFS_DISCONNECT, |
37 | GADGETFS_SETUP, | 37 | GADGETFS_SETUP, |
38 | GADGETFS_SUSPEND, | 38 | GADGETFS_SUSPEND, |
39 | // and likely more ! | 39 | /* and likely more ! */ |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* NOTE: this structure must stay the same size and layout on | 42 | /* NOTE: this structure must stay the same size and layout on |
@@ -44,15 +44,17 @@ enum usb_gadgetfs_event_type { | |||
44 | */ | 44 | */ |
45 | struct usb_gadgetfs_event { | 45 | struct usb_gadgetfs_event { |
46 | union { | 46 | union { |
47 | // NOP, DISCONNECT, SUSPEND: nothing | 47 | /* NOP, DISCONNECT, SUSPEND: nothing |
48 | // ... some hardware can't report disconnection | 48 | * ... some hardware can't report disconnection |
49 | */ | ||
49 | 50 | ||
50 | // CONNECT: just the speed | 51 | /* CONNECT: just the speed */ |
51 | enum usb_device_speed speed; | 52 | enum usb_device_speed speed; |
52 | 53 | ||
53 | // SETUP: packet; DATA phase i/o precedes next event | 54 | /* SETUP: packet; DATA phase i/o precedes next event |
54 | // (setup.bmRequestType & USB_DIR_IN) flags direction | 55 | *(setup.bmRequestType & USB_DIR_IN) flags direction |
55 | // ... includes SET_CONFIGURATION, SET_INTERFACE | 56 | * ... includes SET_CONFIGURATION, SET_INTERFACE |
57 | */ | ||
56 | struct usb_ctrlrequest setup; | 58 | struct usb_ctrlrequest setup; |
57 | } u; | 59 | } u; |
58 | enum usb_gadgetfs_event_type type; | 60 | enum usb_gadgetfs_event_type type; |
@@ -73,14 +75,14 @@ struct usb_gadgetfs_event { | |||
73 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | 75 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo |
74 | * (needed for precise fault handling, when the hardware allows it) | 76 | * (needed for precise fault handling, when the hardware allows it) |
75 | */ | 77 | */ |
76 | #define GADGETFS_FIFO_STATUS _IO('g',1) | 78 | #define GADGETFS_FIFO_STATUS _IO('g', 1) |
77 | 79 | ||
78 | /* discards any unclaimed data in the fifo. */ | 80 | /* discards any unclaimed data in the fifo. */ |
79 | #define GADGETFS_FIFO_FLUSH _IO('g',2) | 81 | #define GADGETFS_FIFO_FLUSH _IO('g', 2) |
80 | 82 | ||
81 | /* resets endpoint halt+toggle; used to implement set_interface. | 83 | /* resets endpoint halt+toggle; used to implement set_interface. |
82 | * some hardware (like pxa2xx) can't support this. | 84 | * some hardware (like pxa2xx) can't support this. |
83 | */ | 85 | */ |
84 | #define GADGETFS_CLEAR_HALT _IO('g',3) | 86 | #define GADGETFS_CLEAR_HALT _IO('g', 3) |
85 | 87 | ||
86 | #endif /* __LINUX_USB_GADGETFS_H */ | 88 | #endif /* __LINUX_USB_GADGETFS_H */ |
diff --git a/include/linux/usb/iowarrior.h b/include/linux/usb/iowarrior.h index cbbe020a4f5c..de6f380e17a2 100644 --- a/include/linux/usb/iowarrior.h +++ b/include/linux/usb/iowarrior.h | |||
@@ -14,14 +14,23 @@ | |||
14 | this information. | 14 | this information. |
15 | */ | 15 | */ |
16 | struct iowarrior_info { | 16 | struct iowarrior_info { |
17 | __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ | 17 | /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ |
18 | __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ | 18 | __u32 vendor; |
19 | __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ | 19 | /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_X) */ |
20 | __u32 revision; /* revision number of the chip */ | 20 | __u32 product; |
21 | __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ | 21 | /* the serial number of our chip (if a serial-number is not available |
22 | __u32 power; /* power consumption of the device in mA */ | 22 | * this is empty string) */ |
23 | __u32 if_num; /* the number of the endpoint */ | 23 | __u8 serial[9]; |
24 | __u32 report_size; /* size of the data-packets on this interface */ | 24 | /* revision number of the chip */ |
25 | __u32 revision; | ||
26 | /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ | ||
27 | __u32 speed; | ||
28 | /* power consumption of the device in mA */ | ||
29 | __u32 power; | ||
30 | /* the number of the endpoint */ | ||
31 | __u32 if_num; | ||
32 | /* size of the data-packets on this interface */ | ||
33 | __u32 report_size; | ||
25 | }; | 34 | }; |
26 | 35 | ||
27 | /* | 36 | /* |
diff --git a/include/linux/usb/isp116x.h b/include/linux/usb/isp116x.h index 436dd8a2b64a..67d2826f34fe 100644 --- a/include/linux/usb/isp116x.h +++ b/include/linux/usb/isp116x.h | |||
@@ -25,5 +25,5 @@ struct isp116x_platform_data { | |||
25 | 300ns delay between access to ADDR_REG and DATA_REG | 25 | 300ns delay between access to ADDR_REG and DATA_REG |
26 | OE, WE MUST NOT be changed during these intervals | 26 | OE, WE MUST NOT be changed during these intervals |
27 | */ | 27 | */ |
28 | void (*delay) (struct device * dev, int delay); | 28 | void (*delay) (struct device *dev, int delay); |
29 | }; | 29 | }; |
diff --git a/include/linux/usb/midi.h b/include/linux/usb/midi.h index 11a97d5ffd34..80624c562921 100644 --- a/include/linux/usb/midi.h +++ b/include/linux/usb/midi.h | |||
@@ -47,9 +47,9 @@ struct usb_ms_header_descriptor { | |||
47 | /* 6.1.2.2 MIDI IN Jack Descriptor */ | 47 | /* 6.1.2.2 MIDI IN Jack Descriptor */ |
48 | struct usb_midi_in_jack_descriptor { | 48 | struct usb_midi_in_jack_descriptor { |
49 | __u8 bLength; | 49 | __u8 bLength; |
50 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | 50 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
51 | __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK | 51 | __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */ |
52 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | 52 | __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ |
53 | __u8 bJackID; | 53 | __u8 bJackID; |
54 | __u8 iJack; | 54 | __u8 iJack; |
55 | } __attribute__ ((packed)); | 55 | } __attribute__ ((packed)); |
@@ -64,12 +64,12 @@ struct usb_midi_source_pin { | |||
64 | /* 6.1.2.3 MIDI OUT Jack Descriptor */ | 64 | /* 6.1.2.3 MIDI OUT Jack Descriptor */ |
65 | struct usb_midi_out_jack_descriptor { | 65 | struct usb_midi_out_jack_descriptor { |
66 | __u8 bLength; | 66 | __u8 bLength; |
67 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | 67 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
68 | __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK | 68 | __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */ |
69 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | 69 | __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */ |
70 | __u8 bJackID; | 70 | __u8 bJackID; |
71 | __u8 bNrInputPins; // p | 71 | __u8 bNrInputPins; /* p */ |
72 | struct usb_midi_source_pin pins[]; // [p] | 72 | struct usb_midi_source_pin pins[]; /* [p] */ |
73 | /*__u8 iJack; -- ommitted due to variable-sized pins[] */ | 73 | /*__u8 iJack; -- ommitted due to variable-sized pins[] */ |
74 | } __attribute__ ((packed)); | 74 | } __attribute__ ((packed)); |
75 | 75 | ||
@@ -90,11 +90,11 @@ struct usb_midi_out_jack_descriptor_##p { \ | |||
90 | 90 | ||
91 | /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ | 91 | /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ |
92 | struct usb_ms_endpoint_descriptor { | 92 | struct usb_ms_endpoint_descriptor { |
93 | __u8 bLength; // 4+n | 93 | __u8 bLength; /* 4+n */ |
94 | __u8 bDescriptorType; // USB_DT_CS_ENDPOINT | 94 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ |
95 | __u8 bDescriptorSubtype; // USB_MS_GENERAL | 95 | __u8 bDescriptorSubtype; /* USB_MS_GENERAL */ |
96 | __u8 bNumEmbMIDIJack; // n | 96 | __u8 bNumEmbMIDIJack; /* n */ |
97 | __u8 baAssocJackID[]; // [n] | 97 | __u8 baAssocJackID[]; /* [n] */ |
98 | } __attribute__ ((packed)); | 98 | } __attribute__ ((packed)); |
99 | 99 | ||
100 | #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) | 100 | #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) |
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h index c602f884f182..ec897cb844ab 100644 --- a/include/linux/usb/net2280.h +++ b/include/linux/usb/net2280.h | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | /* main registers, BAR0 + 0x0000 */ | 38 | /* main registers, BAR0 + 0x0000 */ |
39 | struct net2280_regs { | 39 | struct net2280_regs { |
40 | // offset 0x0000 | 40 | /* offset 0x0000 */ |
41 | u32 devinit; | 41 | u32 devinit; |
42 | #define LOCAL_CLOCK_FREQUENCY 8 | 42 | #define LOCAL_CLOCK_FREQUENCY 8 |
43 | #define FORCE_PCI_RESET 7 | 43 | #define FORCE_PCI_RESET 7 |
@@ -61,7 +61,7 @@ struct net2280_regs { | |||
61 | #define EEPROM_WRITE_DATA 0 | 61 | #define EEPROM_WRITE_DATA 0 |
62 | u32 eeclkfreq; | 62 | u32 eeclkfreq; |
63 | u32 _unused0; | 63 | u32 _unused0; |
64 | // offset 0x0010 | 64 | /* offset 0x0010 */ |
65 | 65 | ||
66 | u32 pciirqenb0; /* interrupt PCI master ... */ | 66 | u32 pciirqenb0; /* interrupt PCI master ... */ |
67 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 | 67 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 |
@@ -131,7 +131,7 @@ struct net2280_regs { | |||
131 | #define RESUME_INTERRUPT_ENABLE 1 | 131 | #define RESUME_INTERRUPT_ENABLE 1 |
132 | #define SOF_INTERRUPT_ENABLE 0 | 132 | #define SOF_INTERRUPT_ENABLE 0 |
133 | 133 | ||
134 | // offset 0x0020 | 134 | /* offset 0x0020 */ |
135 | u32 _unused1; | 135 | u32 _unused1; |
136 | u32 usbirqenb1; | 136 | u32 usbirqenb1; |
137 | #define USB_INTERRUPT_ENABLE 31 | 137 | #define USB_INTERRUPT_ENABLE 31 |
@@ -195,7 +195,7 @@ struct net2280_regs { | |||
195 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 | 195 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 |
196 | #define RESUME_INTERRUPT 1 | 196 | #define RESUME_INTERRUPT 1 |
197 | #define SOF_INTERRUPT 0 | 197 | #define SOF_INTERRUPT 0 |
198 | // offset 0x0030 | 198 | /* offset 0x0030 */ |
199 | u32 idxaddr; | 199 | u32 idxaddr; |
200 | u32 idxdata; | 200 | u32 idxdata; |
201 | u32 fifoctl; | 201 | u32 fifoctl; |
@@ -204,7 +204,7 @@ struct net2280_regs { | |||
204 | #define PCI_BASE2_SELECT 2 | 204 | #define PCI_BASE2_SELECT 2 |
205 | #define FIFO_CONFIGURATION_SELECT 0 | 205 | #define FIFO_CONFIGURATION_SELECT 0 |
206 | u32 _unused2; | 206 | u32 _unused2; |
207 | // offset 0x0040 | 207 | /* offset 0x0040 */ |
208 | u32 memaddr; | 208 | u32 memaddr; |
209 | #define START 28 | 209 | #define START 28 |
210 | #define DIRECTION 27 | 210 | #define DIRECTION 27 |
@@ -213,7 +213,7 @@ struct net2280_regs { | |||
213 | u32 memdata0; | 213 | u32 memdata0; |
214 | u32 memdata1; | 214 | u32 memdata1; |
215 | u32 _unused3; | 215 | u32 _unused3; |
216 | // offset 0x0050 | 216 | /* offset 0x0050 */ |
217 | u32 gpioctl; | 217 | u32 gpioctl; |
218 | #define GPIO3_LED_SELECT 12 | 218 | #define GPIO3_LED_SELECT 12 |
219 | #define GPIO3_INTERRUPT_ENABLE 11 | 219 | #define GPIO3_INTERRUPT_ENABLE 11 |
@@ -237,7 +237,7 @@ struct net2280_regs { | |||
237 | 237 | ||
238 | /* usb control, BAR0 + 0x0080 */ | 238 | /* usb control, BAR0 + 0x0080 */ |
239 | struct net2280_usb_regs { | 239 | struct net2280_usb_regs { |
240 | // offset 0x0080 | 240 | /* offset 0x0080 */ |
241 | u32 stdrsp; | 241 | u32 stdrsp; |
242 | #define STALL_UNSUPPORTED_REQUESTS 31 | 242 | #define STALL_UNSUPPORTED_REQUESTS 31 |
243 | #define SET_TEST_MODE 16 | 243 | #define SET_TEST_MODE 16 |
@@ -275,7 +275,7 @@ struct net2280_usb_regs { | |||
275 | #define PME_WAKEUP_ENABLE 2 | 275 | #define PME_WAKEUP_ENABLE 2 |
276 | #define DEVICE_REMOTE_WAKEUP_ENABLE 1 | 276 | #define DEVICE_REMOTE_WAKEUP_ENABLE 1 |
277 | #define SELF_POWERED_STATUS 0 | 277 | #define SELF_POWERED_STATUS 0 |
278 | // offset 0x0090 | 278 | /* offset 0x0090 */ |
279 | u32 usbstat; | 279 | u32 usbstat; |
280 | #define HIGH_SPEED 7 | 280 | #define HIGH_SPEED 7 |
281 | #define FULL_SPEED 6 | 281 | #define FULL_SPEED 6 |
@@ -291,7 +291,7 @@ struct net2280_usb_regs { | |||
291 | #define TERMINATION_SELECT 0 | 291 | #define TERMINATION_SELECT 0 |
292 | u32 setup0123; | 292 | u32 setup0123; |
293 | u32 setup4567; | 293 | u32 setup4567; |
294 | // offset 0x0090 | 294 | /* offset 0x0090 */ |
295 | u32 _unused0; | 295 | u32 _unused0; |
296 | u32 ouraddr; | 296 | u32 ouraddr; |
297 | #define FORCE_IMMEDIATE 7 | 297 | #define FORCE_IMMEDIATE 7 |
@@ -301,7 +301,7 @@ struct net2280_usb_regs { | |||
301 | 301 | ||
302 | /* pci control, BAR0 + 0x0100 */ | 302 | /* pci control, BAR0 + 0x0100 */ |
303 | struct net2280_pci_regs { | 303 | struct net2280_pci_regs { |
304 | // offset 0x0100 | 304 | /* offset 0x0100 */ |
305 | u32 pcimstctl; | 305 | u32 pcimstctl; |
306 | #define PCI_ARBITER_PARK_SELECT 13 | 306 | #define PCI_ARBITER_PARK_SELECT 13 |
307 | #define PCI_MULTI LEVEL_ARBITER 12 | 307 | #define PCI_MULTI LEVEL_ARBITER 12 |
@@ -331,7 +331,7 @@ struct net2280_pci_regs { | |||
331 | * that can be loaded into some of these registers. | 331 | * that can be loaded into some of these registers. |
332 | */ | 332 | */ |
333 | struct net2280_dma_regs { /* [11.7] */ | 333 | struct net2280_dma_regs { /* [11.7] */ |
334 | // offset 0x0180, 0x01a0, 0x01c0, 0x01e0, | 334 | /* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */ |
335 | u32 dmactl; | 335 | u32 dmactl; |
336 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 | 336 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 |
337 | #define DMA_CLEAR_COUNT_ENABLE 21 | 337 | #define DMA_CLEAR_COUNT_ENABLE 21 |
@@ -355,7 +355,7 @@ struct net2280_dma_regs { /* [11.7] */ | |||
355 | #define DMA_ABORT 1 | 355 | #define DMA_ABORT 1 |
356 | #define DMA_START 0 | 356 | #define DMA_START 0 |
357 | u32 _unused0 [2]; | 357 | u32 _unused0 [2]; |
358 | // offset 0x0190, 0x01b0, 0x01d0, 0x01f0, | 358 | /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ |
359 | u32 dmacount; | 359 | u32 dmacount; |
360 | #define VALID_BIT 31 | 360 | #define VALID_BIT 31 |
361 | #define DMA_DIRECTION 30 | 361 | #define DMA_DIRECTION 30 |
@@ -371,9 +371,9 @@ struct net2280_dma_regs { /* [11.7] */ | |||
371 | /* dedicated endpoint registers, BAR0 + 0x0200 */ | 371 | /* dedicated endpoint registers, BAR0 + 0x0200 */ |
372 | 372 | ||
373 | struct net2280_dep_regs { /* [11.8] */ | 373 | struct net2280_dep_regs { /* [11.8] */ |
374 | // offset 0x0200, 0x0210, 0x220, 0x230, 0x240 | 374 | /* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */ |
375 | u32 dep_cfg; | 375 | u32 dep_cfg; |
376 | // offset 0x0204, 0x0214, 0x224, 0x234, 0x244 | 376 | /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ |
377 | u32 dep_rsp; | 377 | u32 dep_rsp; |
378 | u32 _unused [2]; | 378 | u32 _unused [2]; |
379 | } __attribute__ ((packed)); | 379 | } __attribute__ ((packed)); |
@@ -383,7 +383,7 @@ struct net2280_dep_regs { /* [11.8] */ | |||
383 | * ep0 reserved for control; E and F have only 64 bytes of fifo | 383 | * ep0 reserved for control; E and F have only 64 bytes of fifo |
384 | */ | 384 | */ |
385 | struct net2280_ep_regs { /* [11.9] */ | 385 | struct net2280_ep_regs { /* [11.9] */ |
386 | // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 | 386 | /* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */ |
387 | u32 ep_cfg; | 387 | u32 ep_cfg; |
388 | #define ENDPOINT_BYTE_COUNT 16 | 388 | #define ENDPOINT_BYTE_COUNT 16 |
389 | #define ENDPOINT_ENABLE 10 | 389 | #define ENDPOINT_ENABLE 10 |
@@ -435,7 +435,7 @@ struct net2280_ep_regs { /* [11.9] */ | |||
435 | #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 | 435 | #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 |
436 | #define DATA_OUT_PING_TOKEN_INTERRUPT 1 | 436 | #define DATA_OUT_PING_TOKEN_INTERRUPT 1 |
437 | #define DATA_IN_TOKEN_INTERRUPT 0 | 437 | #define DATA_IN_TOKEN_INTERRUPT 0 |
438 | // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 | 438 | /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ |
439 | u32 ep_avail; | 439 | u32 ep_avail; |
440 | u32 ep_data; | 440 | u32 ep_data; |
441 | u32 _unused0 [2]; | 441 | u32 _unused0 [2]; |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 9897f7a818c5..e007074ebe41 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -1,4 +1,4 @@ | |||
1 | // include/linux/usb/otg.h | 1 | /* USB OTG (On The Go) defines */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * These APIs may be used between USB controllers. USB device drivers | 4 | * These APIs may be used between USB controllers. USB device drivers |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 63b29b5332e6..21b4a1c6f585 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -20,7 +20,8 @@ | |||
20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
21 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ | 21 | #define SERIAL_TTY_MINORS 255 /* loads of devices :) */ |
22 | 22 | ||
23 | #define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ | 23 | /* The maximum number of ports one device can grab at once */ |
24 | #define MAX_NUM_PORTS 8 | ||
24 | 25 | ||
25 | /* parity check flag */ | 26 | /* parity check flag */ |
26 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | 27 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
@@ -61,29 +62,29 @@ | |||
61 | * ports of a device. | 62 | * ports of a device. |
62 | */ | 63 | */ |
63 | struct usb_serial_port { | 64 | struct usb_serial_port { |
64 | struct usb_serial * serial; | 65 | struct usb_serial *serial; |
65 | struct tty_struct * tty; | 66 | struct tty_struct *tty; |
66 | spinlock_t lock; | 67 | spinlock_t lock; |
67 | struct mutex mutex; | 68 | struct mutex mutex; |
68 | unsigned char number; | 69 | unsigned char number; |
69 | 70 | ||
70 | unsigned char * interrupt_in_buffer; | 71 | unsigned char *interrupt_in_buffer; |
71 | struct urb * interrupt_in_urb; | 72 | struct urb *interrupt_in_urb; |
72 | __u8 interrupt_in_endpointAddress; | 73 | __u8 interrupt_in_endpointAddress; |
73 | 74 | ||
74 | unsigned char * interrupt_out_buffer; | 75 | unsigned char *interrupt_out_buffer; |
75 | int interrupt_out_size; | 76 | int interrupt_out_size; |
76 | struct urb * interrupt_out_urb; | 77 | struct urb *interrupt_out_urb; |
77 | __u8 interrupt_out_endpointAddress; | 78 | __u8 interrupt_out_endpointAddress; |
78 | 79 | ||
79 | unsigned char * bulk_in_buffer; | 80 | unsigned char *bulk_in_buffer; |
80 | int bulk_in_size; | 81 | int bulk_in_size; |
81 | struct urb * read_urb; | 82 | struct urb *read_urb; |
82 | __u8 bulk_in_endpointAddress; | 83 | __u8 bulk_in_endpointAddress; |
83 | 84 | ||
84 | unsigned char * bulk_out_buffer; | 85 | unsigned char *bulk_out_buffer; |
85 | int bulk_out_size; | 86 | int bulk_out_size; |
86 | struct urb * write_urb; | 87 | struct urb *write_urb; |
87 | int write_urb_busy; | 88 | int write_urb_busy; |
88 | __u8 bulk_out_endpointAddress; | 89 | __u8 bulk_out_endpointAddress; |
89 | 90 | ||
@@ -98,12 +99,13 @@ struct usb_serial_port { | |||
98 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 99 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
99 | 100 | ||
100 | /* get and set the port private data pointer helper functions */ | 101 | /* get and set the port private data pointer helper functions */ |
101 | static inline void *usb_get_serial_port_data (struct usb_serial_port *port) | 102 | static inline void *usb_get_serial_port_data(struct usb_serial_port *port) |
102 | { | 103 | { |
103 | return dev_get_drvdata(&port->dev); | 104 | return dev_get_drvdata(&port->dev); |
104 | } | 105 | } |
105 | 106 | ||
106 | static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data) | 107 | static inline void usb_set_serial_port_data(struct usb_serial_port *port, |
108 | void *data) | ||
107 | { | 109 | { |
108 | dev_set_drvdata(&port->dev, data); | 110 | dev_set_drvdata(&port->dev, data); |
109 | } | 111 | } |
@@ -126,9 +128,9 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void | |||
126 | * usb_set_serial_data() to access this. | 128 | * usb_set_serial_data() to access this. |
127 | */ | 129 | */ |
128 | struct usb_serial { | 130 | struct usb_serial { |
129 | struct usb_device * dev; | 131 | struct usb_device *dev; |
130 | struct usb_serial_driver * type; | 132 | struct usb_serial_driver *type; |
131 | struct usb_interface * interface; | 133 | struct usb_interface *interface; |
132 | unsigned char disconnected; | 134 | unsigned char disconnected; |
133 | unsigned char minor; | 135 | unsigned char minor; |
134 | unsigned char num_ports; | 136 | unsigned char num_ports; |
@@ -137,30 +139,30 @@ struct usb_serial { | |||
137 | char num_interrupt_out; | 139 | char num_interrupt_out; |
138 | char num_bulk_in; | 140 | char num_bulk_in; |
139 | char num_bulk_out; | 141 | char num_bulk_out; |
140 | struct usb_serial_port * port[MAX_NUM_PORTS]; | 142 | struct usb_serial_port *port[MAX_NUM_PORTS]; |
141 | struct kref kref; | 143 | struct kref kref; |
142 | struct mutex disc_mutex; | 144 | struct mutex disc_mutex; |
143 | void * private; | 145 | void *private; |
144 | }; | 146 | }; |
145 | #define to_usb_serial(d) container_of(d, struct usb_serial, kref) | 147 | #define to_usb_serial(d) container_of(d, struct usb_serial, kref) |
146 | 148 | ||
147 | #define NUM_DONT_CARE 99 | 149 | #define NUM_DONT_CARE 99 |
148 | 150 | ||
149 | /* get and set the serial private data pointer helper functions */ | 151 | /* get and set the serial private data pointer helper functions */ |
150 | static inline void *usb_get_serial_data (struct usb_serial *serial) | 152 | static inline void *usb_get_serial_data(struct usb_serial *serial) |
151 | { | 153 | { |
152 | return serial->private; | 154 | return serial->private; |
153 | } | 155 | } |
154 | 156 | ||
155 | static inline void usb_set_serial_data (struct usb_serial *serial, void *data) | 157 | static inline void usb_set_serial_data(struct usb_serial *serial, void *data) |
156 | { | 158 | { |
157 | serial->private = data; | 159 | serial->private = data; |
158 | } | 160 | } |
159 | 161 | ||
160 | /** | 162 | /** |
161 | * usb_serial_driver - describes a usb serial driver | 163 | * usb_serial_driver - describes a usb serial driver |
162 | * @description: pointer to a string that describes this driver. This string used | 164 | * @description: pointer to a string that describes this driver. This string |
163 | * in the syslog messages when a device is inserted or removed. | 165 | * used in the syslog messages when a device is inserted or removed. |
164 | * @id_table: pointer to a list of usb_device_id structures that define all | 166 | * @id_table: pointer to a list of usb_device_id structures that define all |
165 | * of the devices this structure can support. | 167 | * of the devices this structure can support. |
166 | * @num_interrupt_in: If a device doesn't have this many interrupt-in | 168 | * @num_interrupt_in: If a device doesn't have this many interrupt-in |
@@ -221,82 +223,91 @@ struct usb_serial_driver { | |||
221 | struct usb_driver *usb_driver; | 223 | struct usb_driver *usb_driver; |
222 | struct usb_dynids dynids; | 224 | struct usb_dynids dynids; |
223 | 225 | ||
224 | int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); | 226 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
225 | int (*attach) (struct usb_serial *serial); | 227 | int (*attach)(struct usb_serial *serial); |
226 | int (*calc_num_ports) (struct usb_serial *serial); | 228 | int (*calc_num_ports) (struct usb_serial *serial); |
227 | 229 | ||
228 | void (*shutdown) (struct usb_serial *serial); | 230 | void (*shutdown)(struct usb_serial *serial); |
229 | 231 | ||
230 | int (*port_probe) (struct usb_serial_port *port); | 232 | int (*port_probe)(struct usb_serial_port *port); |
231 | int (*port_remove) (struct usb_serial_port *port); | 233 | int (*port_remove)(struct usb_serial_port *port); |
232 | 234 | ||
233 | int (*suspend) (struct usb_serial *serial, pm_message_t message); | 235 | int (*suspend)(struct usb_serial *serial, pm_message_t message); |
234 | int (*resume) (struct usb_serial *serial); | 236 | int (*resume)(struct usb_serial *serial); |
235 | 237 | ||
236 | /* serial function calls */ | 238 | /* serial function calls */ |
237 | int (*open) (struct usb_serial_port *port, struct file * filp); | 239 | int (*open)(struct usb_serial_port *port, struct file *filp); |
238 | void (*close) (struct usb_serial_port *port, struct file * filp); | 240 | void (*close)(struct usb_serial_port *port, struct file *filp); |
239 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); | 241 | int (*write)(struct usb_serial_port *port, const unsigned char *buf, |
240 | int (*write_room) (struct usb_serial_port *port); | 242 | int count); |
241 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); | 243 | int (*write_room)(struct usb_serial_port *port); |
242 | void (*set_termios) (struct usb_serial_port *port, struct ktermios * old); | 244 | int (*ioctl)(struct usb_serial_port *port, struct file *file, |
243 | void (*break_ctl) (struct usb_serial_port *port, int break_state); | 245 | unsigned int cmd, unsigned long arg); |
244 | int (*chars_in_buffer) (struct usb_serial_port *port); | 246 | void (*set_termios)(struct usb_serial_port *port, struct ktermios *old); |
245 | void (*throttle) (struct usb_serial_port *port); | 247 | void (*break_ctl)(struct usb_serial_port *port, int break_state); |
246 | void (*unthrottle) (struct usb_serial_port *port); | 248 | int (*chars_in_buffer)(struct usb_serial_port *port); |
247 | int (*tiocmget) (struct usb_serial_port *port, struct file *file); | 249 | void (*throttle)(struct usb_serial_port *port); |
248 | int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); | 250 | void (*unthrottle)(struct usb_serial_port *port); |
251 | int (*tiocmget)(struct usb_serial_port *port, struct file *file); | ||
252 | int (*tiocmset)(struct usb_serial_port *port, struct file *file, | ||
253 | unsigned int set, unsigned int clear); | ||
249 | 254 | ||
250 | void (*read_int_callback)(struct urb *urb); | 255 | void (*read_int_callback)(struct urb *urb); |
251 | void (*write_int_callback)(struct urb *urb); | 256 | void (*write_int_callback)(struct urb *urb); |
252 | void (*read_bulk_callback)(struct urb *urb); | 257 | void (*read_bulk_callback)(struct urb *urb); |
253 | void (*write_bulk_callback)(struct urb *urb); | 258 | void (*write_bulk_callback)(struct urb *urb); |
254 | }; | 259 | }; |
255 | #define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver) | 260 | #define to_usb_serial_driver(d) \ |
261 | container_of(d, struct usb_serial_driver, driver) | ||
256 | 262 | ||
257 | extern int usb_serial_register(struct usb_serial_driver *driver); | 263 | extern int usb_serial_register(struct usb_serial_driver *driver); |
258 | extern void usb_serial_deregister(struct usb_serial_driver *driver); | 264 | extern void usb_serial_deregister(struct usb_serial_driver *driver); |
259 | extern void usb_serial_port_softint(struct usb_serial_port *port); | 265 | extern void usb_serial_port_softint(struct usb_serial_port *port); |
260 | 266 | ||
261 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); | 267 | extern int usb_serial_probe(struct usb_interface *iface, |
268 | const struct usb_device_id *id); | ||
262 | extern void usb_serial_disconnect(struct usb_interface *iface); | 269 | extern void usb_serial_disconnect(struct usb_interface *iface); |
263 | 270 | ||
264 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | 271 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); |
265 | extern int usb_serial_resume(struct usb_interface *intf); | 272 | extern int usb_serial_resume(struct usb_interface *intf); |
266 | 273 | ||
267 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); | 274 | extern int ezusb_writememory(struct usb_serial *serial, int address, |
268 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); | 275 | unsigned char *data, int length, __u8 bRequest); |
276 | extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit); | ||
269 | 277 | ||
270 | /* USB Serial console functions */ | 278 | /* USB Serial console functions */ |
271 | #ifdef CONFIG_USB_SERIAL_CONSOLE | 279 | #ifdef CONFIG_USB_SERIAL_CONSOLE |
272 | extern void usb_serial_console_init (int debug, int minor); | 280 | extern void usb_serial_console_init(int debug, int minor); |
273 | extern void usb_serial_console_exit (void); | 281 | extern void usb_serial_console_exit(void); |
274 | extern void usb_serial_console_disconnect(struct usb_serial *serial); | 282 | extern void usb_serial_console_disconnect(struct usb_serial *serial); |
275 | #else | 283 | #else |
276 | static inline void usb_serial_console_init (int debug, int minor) { } | 284 | static inline void usb_serial_console_init(int debug, int minor) { } |
277 | static inline void usb_serial_console_exit (void) { } | 285 | static inline void usb_serial_console_exit(void) { } |
278 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | 286 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} |
279 | #endif | 287 | #endif |
280 | 288 | ||
281 | /* Functions needed by other parts of the usbserial core */ | 289 | /* Functions needed by other parts of the usbserial core */ |
282 | extern struct usb_serial *usb_serial_get_by_index (unsigned int minor); | 290 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); |
283 | extern void usb_serial_put(struct usb_serial *serial); | 291 | extern void usb_serial_put(struct usb_serial *serial); |
284 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); | 292 | extern int usb_serial_generic_open(struct usb_serial_port *port, |
285 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); | 293 | struct file *filp); |
286 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); | 294 | extern int usb_serial_generic_write(struct usb_serial_port *port, |
287 | extern int usb_serial_generic_resume (struct usb_serial *serial); | 295 | const unsigned char *buf, int count); |
288 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); | 296 | extern void usb_serial_generic_close(struct usb_serial_port *port, |
289 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | 297 | struct file *filp); |
290 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); | 298 | extern int usb_serial_generic_resume(struct usb_serial *serial); |
291 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb); | 299 | extern int usb_serial_generic_write_room(struct usb_serial_port *port); |
292 | extern void usb_serial_generic_throttle (struct usb_serial_port *port); | 300 | extern int usb_serial_generic_chars_in_buffer(struct usb_serial_port *port); |
293 | extern void usb_serial_generic_unthrottle (struct usb_serial_port *port); | 301 | extern void usb_serial_generic_read_bulk_callback(struct urb *urb); |
294 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); | 302 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
295 | extern int usb_serial_generic_register (int debug); | 303 | extern void usb_serial_generic_throttle(struct usb_serial_port *port); |
296 | extern void usb_serial_generic_deregister (void); | 304 | extern void usb_serial_generic_unthrottle(struct usb_serial_port *port); |
297 | 305 | extern void usb_serial_generic_shutdown(struct usb_serial *serial); | |
298 | extern int usb_serial_bus_register (struct usb_serial_driver *device); | 306 | extern int usb_serial_generic_register(int debug); |
299 | extern void usb_serial_bus_deregister (struct usb_serial_driver *device); | 307 | extern void usb_serial_generic_deregister(void); |
308 | |||
309 | extern int usb_serial_bus_register(struct usb_serial_driver *device); | ||
310 | extern void usb_serial_bus_deregister(struct usb_serial_driver *device); | ||
300 | 311 | ||
301 | extern struct usb_serial_driver usb_serial_generic_device; | 312 | extern struct usb_serial_driver usb_serial_generic_device; |
302 | extern struct bus_type usb_serial_bus_type; | 313 | extern struct bus_type usb_serial_bus_type; |
@@ -310,16 +321,22 @@ static inline void usb_serial_debug_data(int debug, | |||
310 | int i; | 321 | int i; |
311 | 322 | ||
312 | if (debug) { | 323 | if (debug) { |
313 | dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size); | 324 | dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", |
325 | function, size); | ||
314 | for (i = 0; i < size; ++i) | 326 | for (i = 0; i < size; ++i) |
315 | printk ("%.2x ", data[i]); | 327 | printk("%.2x ", data[i]); |
316 | printk ("\n"); | 328 | printk("\n"); |
317 | } | 329 | } |
318 | } | 330 | } |
319 | 331 | ||
320 | /* Use our own dbg macro */ | 332 | /* Use our own dbg macro */ |
321 | #undef dbg | 333 | #undef dbg |
322 | #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) | 334 | #define dbg(format, arg...) \ |
335 | do { \ | ||
336 | if (debug) \ | ||
337 | printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \ | ||
338 | ## arg); \ | ||
339 | } while (0) | ||
323 | 340 | ||
324 | 341 | ||
325 | 342 | ||
diff --git a/include/linux/usb/sl811.h b/include/linux/usb/sl811.h index 397ee3b3d7f3..877373da410d 100644 --- a/include/linux/usb/sl811.h +++ b/include/linux/usb/sl811.h | |||
@@ -19,8 +19,8 @@ struct sl811_platform_data { | |||
19 | /* pulse sl811 nRST (probably with a GPIO) */ | 19 | /* pulse sl811 nRST (probably with a GPIO) */ |
20 | void (*reset)(struct device *dev); | 20 | void (*reset)(struct device *dev); |
21 | 21 | ||
22 | // some boards need something like these: | 22 | /* some boards need something like these: */ |
23 | // int (*check_overcurrent)(struct device *dev); | 23 | /* int (*check_overcurrent)(struct device *dev); */ |
24 | // void (*clock_enable)(struct device *dev, int is_on); | 24 | /* void (*clock_enable)(struct device *dev, int is_on); */ |
25 | }; | 25 | }; |
26 | 26 | ||