diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-08-12 16:29:33 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-08-12 16:29:33 -0600 |
commit | a9aab75d3c0903c8cfb75b4abfc44d2fc82ef2df (patch) | |
tree | 1503588f076c2528d287ba96dc2da1b8543e0f1b /nuttx/drivers/usbhost/usbhost_storage.c | |
parent | 3a469a7a7a10d28fb81f53b4494ff137a998bd30 (diff) | |
download | px4-nuttx-a9aab75d3c0903c8cfb75b4abfc44d2fc82ef2df.tar.gz px4-nuttx-a9aab75d3c0903c8cfb75b4abfc44d2fc82ef2df.tar.bz2 px4-nuttx-a9aab75d3c0903c8cfb75b4abfc44d2fc82ef2df.zip |
More changes to USB host interface to support multiple downstream ports
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_storage.c')
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_storage.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index 89ec6238f..bc0f78c75 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -128,6 +128,7 @@ struct usbhost_state_s char sdchar; /* Character identifying the /dev/sd[n] device */ volatile bool disconnected; /* TRUE: Device has been disconnected */ uint8_t ifno; /* Interface number */ + uint8_t funcaddr; /* USB function address */ int16_t crefs; /* Reference count on the driver instance */ uint16_t blocksize; /* Block size of USB mass storage device */ uint32_t nblocks; /* Number of blocks on the USB mass storage device */ @@ -929,7 +930,7 @@ static void usbhost_destroy(FAR void *arg) /* Disconnect the USB host device */ - DRVR_DISCONNECT(priv->drvr); + DRVR_DISCONNECT(priv->drvr, priv->funcaddr); /* And free the class instance. Hmmm.. this may execute on the worker * thread and the work structure is part of what is getting freed. That @@ -1740,6 +1741,15 @@ static int usbhost_connect(FAR struct usbhost_class_s *class, { udbg("usbhost_initvolume() failed: %d\n", ret); } + else + { + /* Save the function address (We will need it when we disconnect). + * NOTE that address is available in the endpoint structures as + * well. + */ + + priv->funcaddr = funcaddr; + } } return ret; |