mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
Back out most of the changes of 3b04d08043742b9e65cf38d45988b35bff91daed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user