diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-08-13 15:03:46 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-08-13 15:03:46 -0600 |
commit | c5b10e879ed80495b250e2d9ca7a55ae7d27e57b (patch) | |
tree | 7defee4e62136636ba1a10744e1c50c210572aed /nuttx/configs | |
parent | 61c04ffffaf6cf9024d740c04443e66c6fff500e (diff) | |
download | px4-nuttx-c5b10e879ed80495b250e2d9ca7a55ae7d27e57b.tar.gz px4-nuttx-c5b10e879ed80495b250e2d9ca7a55ae7d27e57b.tar.bz2 px4-nuttx-c5b10e879ed80495b250e2d9ca7a55ae7d27e57b.zip |
Separate wait() and enumerate() methods from struct usbhost_driver_s and move to new interface, struct usbhost_connection_s. This is part of the necessary restructuring of the USB host interface to support multiple root hub ports.
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/cloudctrl/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/mikroe-stm32f4/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/olimex-lpc1766stk/src/up_nsh.c | 10 | ||||
-rw-r--r-- | nuttx/configs/open1788/src/lpc17_nsh.c | 10 | ||||
-rw-r--r-- | nuttx/configs/pic32-starterkit/src/up_nsh.c | 10 | ||||
-rw-r--r-- | nuttx/configs/pic32mx7mmb/src/up_nsh.c | 10 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_usb.c | 22 | ||||
-rw-r--r-- | nuttx/configs/shenzhou/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/stm3220g-eval/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/stm32f4discovery/src/up_usb.c | 10 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c | 10 |
12 files changed, 66 insertions, 66 deletions
diff --git a/nuttx/configs/cloudctrl/src/up_usb.c b/nuttx/configs/cloudctrl/src/up_usb.c index 2407285c5..2ef928c14 100644 --- a/nuttx/configs/cloudctrl/src/up_usb.c +++ b/nuttx/configs/cloudctrl/src/up_usb.c @@ -83,7 +83,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -109,7 +109,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -187,8 +187,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/mikroe-stm32f4/src/up_usb.c b/nuttx/configs/mikroe-stm32f4/src/up_usb.c index cb94e5cbe..967da72fb 100644 --- a/nuttx/configs/mikroe-stm32f4/src/up_usb.c +++ b/nuttx/configs/mikroe-stm32f4/src/up_usb.c @@ -82,7 +82,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -186,8 +186,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c index e893ba27e..d74ec7c8a 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c @@ -143,7 +143,7 @@ ****************************************************************************/ #ifdef NSH_HAVEUSBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /**************************************************************************** @@ -169,7 +169,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -181,7 +181,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -279,8 +279,8 @@ static int nsh_usbhostinitialize(void) /* Then get an instance of the USB host interface */ message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) + g_usbconn = usbhost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/open1788/src/lpc17_nsh.c b/nuttx/configs/open1788/src/lpc17_nsh.c index fa6e086ed..a1899501e 100644 --- a/nuttx/configs/open1788/src/lpc17_nsh.c +++ b/nuttx/configs/open1788/src/lpc17_nsh.c @@ -164,7 +164,7 @@ ****************************************************************************/ #ifdef NSH_HAVE_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif #ifdef NSH_HAVE_MMCSD static FAR struct sdio_dev_s *g_sdiodev; @@ -193,7 +193,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -205,7 +205,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -336,8 +336,8 @@ static int nsh_usbhostinitialize(void) /* Then get an instance of the USB host interface */ message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) + g_usbconn = usbhost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/pic32-starterkit/src/up_nsh.c b/nuttx/configs/pic32-starterkit/src/up_nsh.c index 7c8e21412..f0731b8f4 100644 --- a/nuttx/configs/pic32-starterkit/src/up_nsh.c +++ b/nuttx/configs/pic32-starterkit/src/up_nsh.c @@ -171,7 +171,7 @@ ****************************************************************************/ #ifdef NSH_HAVEUSBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /**************************************************************************** @@ -197,7 +197,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -209,7 +209,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -300,8 +300,8 @@ static int nsh_usbhostinitialize(void) /* Then get an instance of the USB host interface */ message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) + g_usbconn = usbhost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/pic32mx7mmb/src/up_nsh.c b/nuttx/configs/pic32mx7mmb/src/up_nsh.c index 5e59af564..5647702fc 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_nsh.c +++ b/nuttx/configs/pic32mx7mmb/src/up_nsh.c @@ -170,7 +170,7 @@ ****************************************************************************/ #ifdef NSH_HAVEUSBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /**************************************************************************** @@ -196,7 +196,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -208,7 +208,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -308,8 +308,8 @@ static int nsh_usbhostinitialize(void) /* Then get an instance of the USB host interface */ message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) + g_usbconn = usbhost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/sama5d3x-ek/src/sam_usb.c b/nuttx/configs/sama5d3x-ek/src/sam_usb.c index 3ab5d3c39..56348c2cf 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_usb.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_usb.c @@ -77,10 +77,10 @@ /* Retained device driver handles */ #ifdef CONFIG_SAMA5_OHCI -static struct usbhost_driver_s *g_ohci; +static struct usbhost_connection_s *g_ohciconn; #endif #ifdef CONFIG_SAMA5_EHCI -static struct usbhost_driver_s *g_ehci; +static struct usbhost_connection_s *g_ehciconn; #endif /************************************************************************************ @@ -96,7 +96,7 @@ static struct usbhost_driver_s *g_ehci; ************************************************************************************/ #if HAVE_USBHOST -static int usbhost_waiter(struct usbhost_driver_s *dev) +static int usbhost_waiter(struct usbhost_connection_s *dev) { bool connected[SAM_USBHOST_NRHPORT] = {false, false, false}; int rhpndx; @@ -106,7 +106,7 @@ static int usbhost_waiter(struct usbhost_driver_s *dev) { /* Wait for the device to change state */ - rhpndx = DRVR_WAIT(dev, connected); + rhpndx = CONN_WAIT(dev, connected); DEBUGASSERT(rhpndx >= 0 && rhpndx < SAM_USBHOST_NRHPORT); connected[rhpndx] = !connected[rhpndx]; @@ -120,7 +120,7 @@ static int usbhost_waiter(struct usbhost_driver_s *dev) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(dev, rhpndx); + (void)CONN_ENUMERATE(dev, rhpndx); } } @@ -141,7 +141,7 @@ static int usbhost_waiter(struct usbhost_driver_s *dev) #ifdef CONFIG_SAMA5_OHCI static int ohci_waiter(int argc, char *argv[]) { - return usbhost_waiter(g_ohci); + return usbhost_waiter(g_ohciconn); } #endif @@ -156,7 +156,7 @@ static int ohci_waiter(int argc, char *argv[]) #ifdef CONFIG_SAMA5_EHCI static int ehci_waiter(int argc, char *argv[]) { - return usbhost_waiter(g_ehci); + return usbhost_waiter(g_ehciconn); } #endif @@ -287,8 +287,8 @@ int sam_usbhost_initialize(void) #ifdef CONFIG_SAMA5_OHCI /* Get an instance of the USB OHCI interface */ - g_ohci = sam_ohci_initialize(0); - if (!g_ohci) + g_ohciconn = sam_ohci_initialize(0); + if (!g_ohciconn) { udbg("ERROR: sam_ohci_initialize failed\n"); return -ENODEV; @@ -308,8 +308,8 @@ int sam_usbhost_initialize(void) #ifdef CONFIG_SAMA5_EHCI /* Get an instance of the USB EHCI interface */ - g_ehci = sam_ehci_initialize(0); - if (!g_ehci) + g_ehciconn = sam_ehci_initialize(0); + if (!g_ehciconn) { udbg("ERROR: sam_ehci_initialize failed\n"); return -ENODEV; diff --git a/nuttx/configs/shenzhou/src/up_usb.c b/nuttx/configs/shenzhou/src/up_usb.c index 88f6d96ba..95e3a3c39 100644 --- a/nuttx/configs/shenzhou/src/up_usb.c +++ b/nuttx/configs/shenzhou/src/up_usb.c @@ -82,7 +82,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -186,8 +186,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/stm3220g-eval/src/up_usb.c b/nuttx/configs/stm3220g-eval/src/up_usb.c index 4de02df96..72187d009 100644 --- a/nuttx/configs/stm3220g-eval/src/up_usb.c +++ b/nuttx/configs/stm3220g-eval/src/up_usb.c @@ -82,7 +82,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -186,8 +186,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/stm3240g-eval/src/up_usb.c b/nuttx/configs/stm3240g-eval/src/up_usb.c index c69a017bb..d27ac3735 100644 --- a/nuttx/configs/stm3240g-eval/src/up_usb.c +++ b/nuttx/configs/stm3240g-eval/src/up_usb.c @@ -82,7 +82,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -186,8 +186,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/stm32f4discovery/src/up_usb.c b/nuttx/configs/stm32f4discovery/src/up_usb.c index 166f4e7a9..2ac9b6271 100644 --- a/nuttx/configs/stm32f4discovery/src/up_usb.c +++ b/nuttx/configs/stm32f4discovery/src/up_usb.c @@ -82,7 +82,7 @@ ************************************************************************************/ #ifdef CONFIG_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /************************************************************************************ @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -186,8 +186,8 @@ int stm32_usbhost_initialize(void) /* Then get an instance of the USB host interface */ uvdbg("Initialize USB host\n"); - g_drvr = stm32_otgfshost_initialize(0); - if (g_drvr) + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c index b9ea90dba..f36830fcb 100644 --- a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c @@ -162,7 +162,7 @@ ****************************************************************************/ #ifdef NSH_HAVE_USBHOST -static struct usbhost_driver_s *g_drvr; +static struct usbhost_connection_s *g_usbconn; #endif /**************************************************************************** @@ -188,7 +188,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, &connected); + ret = CONN_WAIT(g_usbconn, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -200,7 +200,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr, 0); + (void)CONN_ENUMERATE(g_usbconn, 0); } } @@ -300,8 +300,8 @@ static int nsh_usbhostinitialize(void) /* Then get an instance of the USB host interface */ message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) + g_usbconn = usbhost_initialize(0); + if (g_usbconn) { /* Start a thread to handle device connection. */ |