summaryrefslogtreecommitdiff
path: root/nuttx/drivers
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-01-16 14:02:42 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-01-16 14:02:42 +0000
commitb7145b509d269f4a5ffcecad9a969c6a0a480f20 (patch)
tree035ba62000a7edb601c2a7b5243176dd8228c096 /nuttx/drivers
parent979c0410e02cb6217fdc87bff44d17c3182ed1d7 (diff)
downloadpx4-nuttx-b7145b509d269f4a5ffcecad9a969c6a0a480f20.tar.gz
px4-nuttx-b7145b509d269f4a5ffcecad9a969c6a0a480f20.tar.bz2
px4-nuttx-b7145b509d269f4a5ffcecad9a969c6a0a480f20.zip
Make space for int/isoc endpoint support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3254 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r--nuttx/drivers/usbhost/usbhost_hidkbd.c9
-rw-r--r--nuttx/drivers/usbhost/usbhost_skeleton.c2
-rw-r--r--nuttx/drivers/usbhost/usbhost_storage.c9
3 files changed, 18 insertions, 2 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c
index 782069c9f..7cdc41b0b 100644
--- a/nuttx/drivers/usbhost/usbhost_hidkbd.c
+++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c
@@ -59,6 +59,10 @@
#include <nuttx/usb/usbhost.h>
#include <nuttx/usb/hid.h>
+/* Don't compile if prerequisites are not met */
+
+#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_INT_DISABLE) && CONFIG_NFILE_DESCRIPTORS > 0
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -654,6 +658,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
epoutdesc.in = false;
epoutdesc.funcaddr = funcaddr;
epoutdesc.xfrtype = USB_EP_ATTR_XFER_INT;
+ epoutdesc.interval = epdesc->interval;
epoutdesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Interrupt OUT EP addr:%d mxpacketsize:%d\n",
epoutdesc.addr, epoutdesc.mxpacketsize);
@@ -680,6 +685,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
epindesc.in = 1;
epindesc.funcaddr = funcaddr;
epindesc.xfrtype = USB_EP_ATTR_XFER_INT;
+ epindesc.interval = epdesc->interval;
epindesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Interrupt IN EP addr:%d mxpacketsize:%d\n",
epindesc.addr, epindesc.mxpacketsize);
@@ -1280,3 +1286,6 @@ int usbhost_kbdinit(void)
return usbhost_registerclass(&g_skeleton);
}
+#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE && CONFIG_NFILE_DESCRIPTORS */
+
+
diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c
index d04954f02..fe3d71a28 100644
--- a/nuttx/drivers/usbhost/usbhost_skeleton.c
+++ b/nuttx/drivers/usbhost/usbhost_skeleton.c
@@ -503,6 +503,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
boutdesc.in = false;
boutdesc.funcaddr = funcaddr;
boutdesc.xfrtype = USB_EP_ATTR_XFER_BULK;
+ boutdesc.interval = epdesc->interval;
boutdesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Bulk OUT EP addr:%d mxpacketsize:%d\n",
boutdesc.addr, boutdesc.mxpacketsize);
@@ -529,6 +530,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
bindesc.in = 1;
bindesc.funcaddr = funcaddr;
bindesc.xfrtype = USB_EP_ATTR_XFER_BULK;
+ bindesc.interval = epdesc->interval;
bindesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Bulk IN EP addr:%d mxpacketsize:%d\n",
bindesc.addr, bindesc.mxpacketsize);
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c
index 286a26885..759d5bd6c 100644
--- a/nuttx/drivers/usbhost/usbhost_storage.c
+++ b/nuttx/drivers/usbhost/usbhost_storage.c
@@ -56,7 +56,10 @@
#include <nuttx/usb/usbhost.h>
#include <nuttx/usb/storage.h>
-#if defined(CONFIG_USBHOST) && !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+/* Don't compile if prerequisites are not met */
+
+#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_BULK_DISABLE) && \
+ !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
/****************************************************************************
* Pre-processor Definitions
@@ -1039,6 +1042,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
boutdesc.in = false;
boutdesc.funcaddr = funcaddr;
boutdesc.xfrtype = USB_EP_ATTR_XFER_BULK;
+ boutdesc.interval = epdesc->interval;
boutdesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Bulk OUT EP addr:%d mxpacketsize:%d\n",
boutdesc.addr, boutdesc.mxpacketsize);
@@ -1065,6 +1069,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
bindesc.in = 1;
bindesc.funcaddr = funcaddr;
bindesc.xfrtype = USB_EP_ATTR_XFER_BULK;
+ bindesc.interval = epdesc->interval;
bindesc.mxpacketsize = usbhost_getle16(epdesc->mxpacketsize);
uvdbg("Bulk IN EP addr:%d mxpacketsize:%d\n",
bindesc.addr, bindesc.mxpacketsize);
@@ -2199,4 +2204,4 @@ int usbhost_storageinit(void)
return usbhost_registerclass(&g_storage);
}
-#endif /* CONFIG_USBHOST && !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 */
+#endif /* CONFIG_USBHOST && !CONFIG_USBHOST_BULK_DISABLE && !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 */