aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 7f8d4d61ca47..27a4e16d2bf1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1233,6 +1233,7 @@ struct urb {
1233 void *transfer_buffer; /* (in) associated data buffer */ 1233 void *transfer_buffer; /* (in) associated data buffer */
1234 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ 1234 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1235 struct scatterlist *sg; /* (in) scatter gather buffer list */ 1235 struct scatterlist *sg; /* (in) scatter gather buffer list */
1236 int num_mapped_sgs; /* (internal) mapped sg entries */
1236 int num_sgs; /* (in) number of entries in the sg list */ 1237 int num_sgs; /* (in) number of entries in the sg list */
1237 u32 transfer_buffer_length; /* (in) data buffer length */ 1238 u32 transfer_buffer_length; /* (in) data buffer length */
1238 u32 actual_length; /* (return) actual transfer length */ 1239 u32 actual_length; /* (return) actual transfer length */
@@ -1610,6 +1611,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1610 1611
1611/* ----------------------------------------------------------------------- */ 1612/* ----------------------------------------------------------------------- */
1612 1613
1614/* translate USB error codes to codes user space understands */
1615static inline int usb_translate_errors(int error_code)
1616{
1617 switch (error_code) {
1618 case 0:
1619 case -ENOMEM:
1620 case -ENODEV:
1621 return error_code;
1622 default:
1623 return -EIO;
1624 }
1625}
1626
1613/* Events from the usb core */ 1627/* Events from the usb core */
1614#define USB_DEVICE_ADD 0x0001 1628#define USB_DEVICE_ADD 0x0001
1615#define USB_DEVICE_REMOVE 0x0002 1629#define USB_DEVICE_REMOVE 0x0002