summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-08-13 14:12:27 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-08-13 14:12:27 -0600
commit61c04ffffaf6cf9024d740c04443e66c6fff500e (patch)
tree01551d7fde98839794c304ad107cc60f3a813d31
parent40b7091f0f82c08d8da62c5ea913dbca122ca1f1 (diff)
downloadnuttx-61c04ffffaf6cf9024d740c04443e66c6fff500e.tar.gz
nuttx-61c04ffffaf6cf9024d740c04443e66c6fff500e.tar.bz2
nuttx-61c04ffffaf6cf9024d740c04443e66c6fff500e.zip
Back out most of the changes of 3b04d08043742b9e65cf38d45988b35bff91daed
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c7
-rw-r--r--nuttx/arch/arm/src/sama5/sam_ohci.c25
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_otgfshost.c7
-rw-r--r--nuttx/drivers/usbhost/usbhost_hidkbd.c12
-rw-r--r--nuttx/drivers/usbhost/usbhost_skeleton.c12
-rw-r--r--nuttx/drivers/usbhost/usbhost_storage.c12
-rw-r--r--nuttx/include/nuttx/usb/usbhost.h5
7 files changed, 23 insertions, 57 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
index 4983d1ec3..fbf2b214d 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
@@ -315,7 +315,7 @@ static int lpc17_ctrlout(FAR struct usbhost_driver_s *drvr,
FAR const uint8_t *buffer);
static int lpc17_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
FAR uint8_t *buffer, size_t buflen);
-static void lpc17_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr);
+static void lpc17_disconnect(FAR struct usbhost_driver_s *drvr);
/* Initialization **************************************************************/
@@ -2378,7 +2378,6 @@ errout:
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
* the class create() method.
- * funcaddr - Address of the function to be disconnected.
*
* Returned Values:
* None
@@ -2389,10 +2388,10 @@ errout:
*
*******************************************************************************/
-static void lpc17_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr)
+static void lpc17_disconnect(FAR struct usbhost_driver_s *drvr)
{
struct lpc17_usbhost_s *priv = (struct lpc17_usbhost_s *)drvr;
- DEBUGASSERT(priv && funcaddr == 1);
+ DEBUGASSERT(priv);
priv->class = NULL;
}
diff --git a/nuttx/arch/arm/src/sama5/sam_ohci.c b/nuttx/arch/arm/src/sama5/sam_ohci.c
index 3c275010f..ff45f7bb0 100644
--- a/nuttx/arch/arm/src/sama5/sam_ohci.c
+++ b/nuttx/arch/arm/src/sama5/sam_ohci.c
@@ -182,8 +182,8 @@ struct sam_rhport_s
{
/* Root hub port status */
- volatile bool connected; /* Connected to device */
- volatile bool lowspeed; /* Low speed device attached. */
+ volatile bool connected; /* Connected to device */
+ volatile bool lowspeed; /* Low speed device attached. */
/* The bound device class driver */
@@ -203,14 +203,14 @@ struct sam_ohci_s
/* Driver status */
- volatile bool rhswait; /* TRUE: Thread is waiting for Root Hub Status change */
+ volatile bool rhswait; /* TRUE: Thread is waiting for Root Hub Status change */
#ifndef CONFIG_USBHOST_INT_DISABLE
- uint8_t ininterval; /* Minimum periodic IN EP polling interval: 2, 4, 6, 16, or 32 */
- uint8_t outinterval; /* Minimum periodic IN EP polling interval: 2, 4, 6, 16, or 32 */
+ uint8_t ininterval; /* Minimum periodic IN EP polling interval: 2, 4, 6, 16, or 32 */
+ uint8_t outinterval; /* Minimum periodic IN EP polling interval: 2, 4, 6, 16, or 32 */
#endif
- sem_t exclsem; /* Support mutually exclusive access */
- sem_t rhssem; /* Semaphore to wait Writeback Done Head event */
+ sem_t exclsem; /* Support mutually exclusive access */
+ sem_t rhssem; /* Semaphore to wait Writeback Done Head event */
/* Root hub ports */
@@ -219,10 +219,10 @@ struct sam_ohci_s
/* Debug stuff */
#ifdef CONFIG_SAMA5_SPI_REGDEBUG
- bool wrlast; /* Last was a write */
+ bool wrlast; /* Last was a write */
uint32_t addresslast; /* Last address */
uint32_t valuelast; /* Last value */
- int ntimes; /* Number of times */
+ int ntimes; /* Number of times */
#endif
};
@@ -372,7 +372,7 @@ static int sam_ctrlout(FAR struct usbhost_driver_s *drvr,
FAR const uint8_t *buffer);
static int sam_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
FAR uint8_t *buffer, size_t buflen);
-static void sam_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr);
+static void sam_disconnect(FAR struct usbhost_driver_s *drvr);
/* Initialization **************************************************************/
@@ -2457,7 +2457,6 @@ errout:
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
* the class create() method.
- * funcaddr - Address of the function to be disconnected.
*
* Returned Values:
* None
@@ -2468,10 +2467,10 @@ errout:
*
*******************************************************************************/
-static void sam_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr)
+static void sam_disconnect(FAR struct usbhost_driver_s *drvr)
{
struct sam_ohci_s *priv = (struct sam_ohci_s *)drvr;
- DEBUGASSERT(priv && funcaddr > 0 && funcaddr <= SAM_USBHOST_NRHPORT);
+ DEBUGASSERT(priv);
priv->rhport[funcaddr - 1].class = NULL;
}
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
index 4f3683177..475cd710f 100644
--- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
@@ -380,7 +380,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr,
FAR const uint8_t *buffer);
static int stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
FAR uint8_t *buffer, size_t buflen);
-static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr);
+static void stm32_disconnect(FAR struct usbhost_driver_s *drvr);
/* Initialization **************************************************************/
@@ -3795,7 +3795,6 @@ static int stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
* the class create() method.
- * funcaddr - Address of the function to be disconnected.
*
* Returned Values:
* None
@@ -3806,10 +3805,10 @@ static int stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
*
*******************************************************************************/
-static void stm32_disconnect(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr)
+static void stm32_disconnect(FAR struct usbhost_driver_s *drvr)
{
struct stm32_usbhost_s *priv = (struct stm32_usbhost_s *)drvr;
- DEBUGASSERT(priv && funcaddr == 1);
+ DEBUGASSERT(priv);
priv->class = NULL;
}
diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c
index 6a83fb759..1710a2bb8 100644
--- a/nuttx/drivers/usbhost/usbhost_hidkbd.c
+++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c
@@ -208,7 +208,6 @@ struct usbhost_state_s
volatile bool open; /* TRUE: The keyboard device is open */
volatile bool waiting; /* TRUE: waiting for keyboard data */
uint8_t ifno; /* Interface number */
- uint8_t funcaddr; /* USB function address */
int16_t crefs; /* Reference count on the driver instance */
sem_t exclsem; /* Used to maintain mutual exclusive access */
sem_t waitsem; /* Used to wait for keyboard data */
@@ -798,7 +797,7 @@ static void usbhost_destroy(FAR void *arg)
/* Disconnect the USB host device */
- DRVR_DISCONNECT(priv->drvr, priv->funcaddr);
+ DRVR_DISCONNECT(priv->drvr);
/* 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
@@ -1893,15 +1892,6 @@ static int usbhost_connect(FAR struct usbhost_class_s *class,
{
udbg("usbhost_devinit() 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;
- }
}
/* ERROR handling: Do nothing. If we return and error during connection,
diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c
index a486f8768..53552c683 100644
--- a/nuttx/drivers/usbhost/usbhost_skeleton.c
+++ b/nuttx/drivers/usbhost/usbhost_skeleton.c
@@ -105,7 +105,6 @@ struct usbhost_state_s
char devchar; /* Character identifying the /dev/skel[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 */
sem_t exclsem; /* Used to maintain mutual exclusive access */
struct work_s work; /* For interacting with the worker thread */
@@ -369,7 +368,7 @@ static void usbhost_destroy(FAR void *arg)
/* Disconnect the USB host device */
- DRVR_DISCONNECT(priv->drvr, priv->funcaddr);
+ DRVR_DISCONNECT(priv->drvr);
/* 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
@@ -955,15 +954,6 @@ static int usbhost_connect(FAR struct usbhost_class_s *class,
{
udbg("usbhost_devinit() 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;
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c
index bc0f78c75..89ec6238f 100644
--- a/nuttx/drivers/usbhost/usbhost_storage.c
+++ b/nuttx/drivers/usbhost/usbhost_storage.c
@@ -128,7 +128,6 @@ 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 */
@@ -930,7 +929,7 @@ static void usbhost_destroy(FAR void *arg)
/* Disconnect the USB host device */
- DRVR_DISCONNECT(priv->drvr, priv->funcaddr);
+ DRVR_DISCONNECT(priv->drvr);
/* 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
@@ -1741,15 +1740,6 @@ 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;
diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h
index 80b6f9cf6..d357e0b9b 100644
--- a/nuttx/include/nuttx/usb/usbhost.h
+++ b/nuttx/include/nuttx/usb/usbhost.h
@@ -481,7 +481,6 @@
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
* the class create() method.
- * funcaddr - Address of the function to be disconnected.
*
* Returned Values:
* None
@@ -491,7 +490,7 @@
*
************************************************************************************/
-#define DRVR_DISCONNECT(drvr,funcaddr) ((drvr)->disconnect(drvr,funcaddr))
+#define DRVR_DISCONNECT(drvr) ((drvr)->disconnect(drvr))
/************************************************************************************
* Public Types
@@ -685,7 +684,7 @@ struct usbhost_driver_s
* (until a new instance is received from the create() method).
*/
- void (*disconnect)(FAR struct usbhost_driver_s *drvr, uint8_t funcaddr);
+ void (*disconnect)(FAR struct usbhost_driver_s *drvr);
};
/************************************************************************************