diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nls.h | 5 | ||||
-rw-r--r-- | include/linux/usb.h | 13 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 2 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 11 |
4 files changed, 24 insertions, 7 deletions
diff --git a/include/linux/nls.h b/include/linux/nls.h index d47beef08dfd..5dc635f8d79e 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
@@ -43,7 +43,7 @@ enum utf16_endian { | |||
43 | UTF16_BIG_ENDIAN | 43 | UTF16_BIG_ENDIAN |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /* nls.c */ | 46 | /* nls_base.c */ |
47 | extern int register_nls(struct nls_table *); | 47 | extern int register_nls(struct nls_table *); |
48 | extern int unregister_nls(struct nls_table *); | 48 | extern int unregister_nls(struct nls_table *); |
49 | extern struct nls_table *load_nls(char *); | 49 | extern struct nls_table *load_nls(char *); |
@@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void); | |||
52 | 52 | ||
53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); | 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); |
54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); | 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); |
55 | extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); | 55 | extern int utf8s_to_utf16s(const u8 *s, int len, |
56 | enum utf16_endian endian, wchar_t *pwcs, int maxlen); | ||
56 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, | 57 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, |
57 | enum utf16_endian endian, u8 *s, int maxlen); | 58 | enum utf16_endian endian, u8 *s, int maxlen); |
58 | 59 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index d3d0c1374334..2f05a7fa1ecf 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1598,6 +1598,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out) | |||
1598 | 1598 | ||
1599 | /* ----------------------------------------------------------------------- */ | 1599 | /* ----------------------------------------------------------------------- */ |
1600 | 1600 | ||
1601 | /* translate USB error codes to codes user space understands */ | ||
1602 | static inline int usb_translate_errors(int error_code) | ||
1603 | { | ||
1604 | switch (error_code) { | ||
1605 | case 0: | ||
1606 | case -ENOMEM: | ||
1607 | case -ENODEV: | ||
1608 | return error_code; | ||
1609 | default: | ||
1610 | return -EIO; | ||
1611 | } | ||
1612 | } | ||
1613 | |||
1601 | /* Events from the usb core */ | 1614 | /* Events from the usb core */ |
1602 | #define USB_DEVICE_ADD 0x0001 | 1615 | #define USB_DEVICE_ADD 0x0001 |
1603 | #define USB_DEVICE_REMOVE 0x0002 | 1616 | #define USB_DEVICE_REMOVE 0x0002 |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 03354d557b79..b2f62f3a32af 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -99,7 +99,6 @@ struct usb_hcd { | |||
99 | */ | 99 | */ |
100 | unsigned long flags; | 100 | unsigned long flags; |
101 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ | 101 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ |
102 | #define HCD_FLAG_SAW_IRQ 1 | ||
103 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ | 102 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ |
104 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ | 103 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ |
105 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ | 104 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ |
@@ -110,7 +109,6 @@ struct usb_hcd { | |||
110 | * be slightly faster than test_bit(). | 109 | * be slightly faster than test_bit(). |
111 | */ | 110 | */ |
112 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) | 111 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) |
113 | #define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ)) | ||
114 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) | 112 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) |
115 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) | 113 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) |
116 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) | 114 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index b29f70b2ecae..4267a9c717ba 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -58,11 +58,13 @@ enum port_dev_state { | |||
58 | * @read_urb: pointer to the bulk in struct urb for this port. | 58 | * @read_urb: pointer to the bulk in struct urb for this port. |
59 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this | 59 | * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this |
60 | * port. | 60 | * port. |
61 | * @bulk_in_buffers: pointers to the bulk in buffers for this port | ||
62 | * @read_urbs: pointers to the bulk in urbs for this port | ||
63 | * @read_urbs_free: status bitmap the for bulk in urbs | ||
61 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 64 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
62 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 65 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
63 | * @write_urb: pointer to the bulk out struct urb for this port. | 66 | * @write_urb: pointer to the bulk out struct urb for this port. |
64 | * @write_fifo: kfifo used to buffer outgoing data | 67 | * @write_fifo: kfifo used to buffer outgoing data |
65 | * @write_urb_busy: port`s writing status | ||
66 | * @bulk_out_buffers: pointers to the bulk out buffers for this port | 68 | * @bulk_out_buffers: pointers to the bulk out buffers for this port |
67 | * @write_urbs: pointers to the bulk out urbs for this port | 69 | * @write_urbs: pointers to the bulk out urbs for this port |
68 | * @write_urbs_free: status bitmap the for bulk out urbs | 70 | * @write_urbs_free: status bitmap the for bulk out urbs |
@@ -99,11 +101,14 @@ struct usb_serial_port { | |||
99 | struct urb *read_urb; | 101 | struct urb *read_urb; |
100 | __u8 bulk_in_endpointAddress; | 102 | __u8 bulk_in_endpointAddress; |
101 | 103 | ||
104 | unsigned char *bulk_in_buffers[2]; | ||
105 | struct urb *read_urbs[2]; | ||
106 | unsigned long read_urbs_free; | ||
107 | |||
102 | unsigned char *bulk_out_buffer; | 108 | unsigned char *bulk_out_buffer; |
103 | int bulk_out_size; | 109 | int bulk_out_size; |
104 | struct urb *write_urb; | 110 | struct urb *write_urb; |
105 | struct kfifo write_fifo; | 111 | struct kfifo write_fifo; |
106 | int write_urb_busy; | ||
107 | 112 | ||
108 | unsigned char *bulk_out_buffers[2]; | 113 | unsigned char *bulk_out_buffers[2]; |
109 | struct urb *write_urbs[2]; | 114 | struct urb *write_urbs[2]; |
@@ -340,7 +345,7 @@ extern void usb_serial_generic_disconnect(struct usb_serial *serial); | |||
340 | extern void usb_serial_generic_release(struct usb_serial *serial); | 345 | extern void usb_serial_generic_release(struct usb_serial *serial); |
341 | extern int usb_serial_generic_register(int debug); | 346 | extern int usb_serial_generic_register(int debug); |
342 | extern void usb_serial_generic_deregister(void); | 347 | extern void usb_serial_generic_deregister(void); |
343 | extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, | 348 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
344 | gfp_t mem_flags); | 349 | gfp_t mem_flags); |
345 | extern void usb_serial_generic_process_read_urb(struct urb *urb); | 350 | extern void usb_serial_generic_process_read_urb(struct urb *urb); |
346 | extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, | 351 | extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, |