summaryrefslogtreecommitdiff
path: root/nuttx/drivers/usbhost/usbhost_storage.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-01-14 17:06:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-01-14 17:06:30 +0000
commitdba61e642d8471a75bb3b23dd74d127cb7a51ad0 (patch)
treeb5e7686b3e7becbf3f01cf7113e2474b4908e233 /nuttx/drivers/usbhost/usbhost_storage.c
parent754e81dbafc4def5572bc9d0b91a799d0b68af52 (diff)
downloadnuttx-dba61e642d8471a75bb3b23dd74d127cb7a51ad0.tar.gz
nuttx-dba61e642d8471a75bb3b23dd74d127cb7a51ad0.tar.bz2
nuttx-dba61e642d8471a75bb3b23dd74d127cb7a51ad0.zip
Fleshing out keyboard driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3250 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_storage.c')
-rw-r--r--nuttx/drivers/usbhost/usbhost_storage.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c
index bef82ba3a..2cfc61500 100644
--- a/nuttx/drivers/usbhost/usbhost_storage.c
+++ b/nuttx/drivers/usbhost/usbhost_storage.c
@@ -186,6 +186,9 @@ static inline int usbhost_inquiry(FAR struct usbhost_state_s *priv);
/* Worker thread actions */
static void usbhost_destroy(FAR void *arg);
+
+/* Helpers for usbhost_connect() */
+
static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
FAR const uint8_t *configdesc, int desclen,
uint8_t funcaddr);
@@ -987,7 +990,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
if ((found & USBHOST_IFFOUND) != 0)
{
- /* Oops.. more than one interface. We don't know what to do with this. */
+ /* Oops.. more than one interface. We don't know what to
+ * do with this.
+ */
return -ENOSYS;
}
@@ -995,7 +1000,10 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
}
break;
- /* Endpoint descriptor. We expect two bulk endpoints, an IN and an OUT */
+ /* Endpoint descriptor. We expect two bulk endpoints, an IN and an
+ * OUT.
+ */
+
case USB_DESC_TYPE_ENDPOINT:
{
FAR struct usb_epdesc_s *epdesc = (FAR struct usb_epdesc_s *)configdesc;
@@ -1011,11 +1019,15 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
if (USB_ISEPOUT(epdesc->addr))
{
- /* It is an OUT bulk endpoint. There should be only one bulk OUT endpoint. */
+ /* It is an OUT bulk endpoint. There should be only one
+ * bulk OUT endpoint.
+ */
if ((found & USBHOST_BOUTFOUND) != 0)
{
- /* Oops.. more than one interface. We don't know what to do with this. */
+ /* Oops.. more than one endpoint. We don't know
+ * what to do with this.
+ */
return -EINVAL;
}
@@ -1032,11 +1044,15 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
}
else
{
- /* It is an IN bulk endpoint. There should be only one bulk IN endpoint. */
+ /* It is an IN bulk endpoint. There should be only one
+ * bulk IN endpoint.
+ */
if ((found & USBHOST_BINFOUND) != 0)
{
- /* Oops.. more than one interface. We don't know what to do with this. */
+ /* Oops.. more than one endpoint. We don't know
+ * what to do with this.
+ */
return -EINVAL;
}