summaryrefslogtreecommitdiff
path: root/nuttx/drivers/usbhost/usbhost_storage.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-16 02:06:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-16 02:06:24 +0000
commit301b4221503c4a34bcb9f54b6d3045de72bf8442 (patch)
treeb82b24dc3ac2ff5465a86b34c149d72e342ef682 /nuttx/drivers/usbhost/usbhost_storage.c
parent7c72e2ee4631a6186f0f2e6ab5691c7b4e0737d6 (diff)
downloadpx4-nuttx-301b4221503c4a34bcb9f54b6d3045de72bf8442.tar.gz
px4-nuttx-301b4221503c4a34bcb9f54b6d3045de72bf8442.tar.bz2
px4-nuttx-301b4221503c4a34bcb9f54b6d3045de72bf8442.zip
Add a complete method
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3187 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_storage.c')
-rw-r--r--nuttx/drivers/usbhost/usbhost_storage.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c
index 064cc7de0..05739e350 100644
--- a/nuttx/drivers/usbhost/usbhost_storage.c
+++ b/nuttx/drivers/usbhost/usbhost_storage.c
@@ -164,6 +164,8 @@ static struct usbhost_class_s *usbhost_create(FAR struct usbhost_driver_s *drvr,
static int usbhost_configdesc(FAR struct usbhost_class_s *class,
FAR const uint8_t *configdesc, int desclen);
+static int usbhost_complete(FAR struct usbhost_class_s *class,
+ FAR const uint8_t *response, int resplen);
static int usbhost_disconnected(FAR struct usbhost_class_s *class);
/* struct block_operations methods */
@@ -585,6 +587,7 @@ static FAR struct usbhost_class_s *usbhost_create(FAR struct usbhost_driver_s *d
if (usbhost_allocdevno(priv) == OK)
{
priv->class.configdesc = usbhost_configdesc;
+ priv->class.complete = usbhost_complete;
priv->class.disconnected = usbhost_disconnected;
priv->crefs = 1;
@@ -774,6 +777,41 @@ static int usbhost_configdesc(FAR struct usbhost_class_s *class,
}
/****************************************************************************
+ * Name: usbhost_complete
+ *
+ * Description:
+ * This function implements will the complete() method of struct
+ * usbhost_class_s. In the interface with the USB host drivers, the class
+ * will queue USB IN/OUT transactions. The enqueuing function will return
+ * and the transactions will be performed asynchrounously. When the
+ * transaction completes, the USB host driver will call this function in
+ * order to inform the class that the transaction has completed and to
+ * provide any response data.
+ *
+ * Input Parameters:
+ * class - The USB host class entry previously obtained from a call to
+ * create().
+ * response - Response data buffer
+ * resplen - Number of bytes of data in the response data buffer.
+ *
+ * Returned Values:
+ * On success, zero (OK) is returned. On a failure, a negated errno value is
+ * returned indicating the nature of the failure
+ *
+ * Assumptions:
+ * This function may be called from an interrupt handler.
+ *
+ ****************************************************************************/
+
+static int usbhost_complete(FAR struct usbhost_class_s *class,
+ FAR const uint8_t *response, int resplen)
+{
+ FAR struct usbhost_state_s *priv = (FAR struct usbhost_state_s *)class;
+#warning "Not implemented"
+ return -ENOSYS;
+}
+
+/****************************************************************************
* Name: usbhost_disconnected
*
* Description: