summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2012-01-16 15:32:21 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-01-16 15:32:21 +0530
commit7919e929aa227048738e14df6bcbad3ee4458443 (patch)
tree0c38267369fa636d7435bf22af39e3783a24ef62 /include
parentfcbd75c6b179b717b074d0cb7490e42ae728fb2d (diff)
parent93dad393c796013cb6371be63d7af600c5e36c2c (diff)
Merge branch 'linux-3.1.y' into android-tegra-nv-3.1
Linux 3.1.9 Conflicts: Makefile Change-Id: I22227ab33ba7ddaba8e6fe049393c58a83d73648 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
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 73c7df489607..b08e04cf202b 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1202,6 +1202,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 0fd3fbdd8283..cf65b5cff722 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -583,8 +583,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))