aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2012-01-19 18:25:13 +0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2012-01-19 18:25:13 +0400
commit8511c8cce280177ec9999d162e0f63bddfdbc732 (patch)
treea7182fd6c43b540586101b25dad9e319b31548b9 /include
parentb93b9d935637fc8ecc90d163587bd37201de3aed (diff)
parentb8ed9e5b8c34dc9fb1882669e45b21e3d0194881 (diff)
Merge branch 'linux-3.2.y' into linux-linaro-3.2
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h1
-rw-r--r--include/linux/usb/ch9.h20
2 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d3d0c137433..75033529c05 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1221,6 +1221,7 @@ struct urb {
void *transfer_buffer; /* (in) associated data buffer */
dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
struct scatterlist *sg; /* (in) scatter gather buffer list */
+ int num_mapped_sgs; /* (internal) mapped sg entries */
int num_sgs; /* (in) number of entries in the sg list */
u32 transfer_buffer_length; /* (in) data buffer length */
u32 actual_length; /* (return) actual transfer length */
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index d5da6c68c25..61b29057b05 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -605,8 +605,26 @@ struct usb_ss_ep_comp_descriptor {
} __attribute__ ((packed));
#define USB_DT_SS_EP_COMP_SIZE 6
+
/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
-#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f))
+static inline int
+usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
+{
+ int max_streams;
+
+ if (!comp)
+ return 0;
+
+ max_streams = comp->bmAttributes & 0x1f;
+
+ if (!max_streams)
+ return 0;
+
+ max_streams = 1 << max_streams;
+
+ return max_streams;
+}
+
/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
#define USB_SS_MULT(p) (1 + ((p) & 0x3))