You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/01/29 18:40:54 UTC
[incubator-nuttx] branch master updated (bd37272 -> b288986)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from bd37272 boards/arm/imxrt/teensy-4.x: added configuration for PiKRON's BaseBoard v1.
new fe4be42 include :nuttx: nxstyle error fix
new 2b6cad5 include: nuttx: net: nxstyle error fix
new fa10244 include: nuttx: power: nxstyle error fix
new 83ebb64 include: nuttx: serial: nxstyle error fix
new 419bcb0 include: nuttx: spi: nxstyle error fix
new 3bdf98c include: nuttx: syslog: nxstyle error fix
new 30a5a3e include: nuttx: timers: nxstyle error fix
new b288986 include: nuttx: usb: nxstyle error fix
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
include/nuttx/ascii.h | 1 +
include/nuttx/can.h | 83 ++---
include/nuttx/cancelpt.h | 4 +-
include/nuttx/init.h | 2 +
include/nuttx/mmcsd.h | 12 +-
include/nuttx/module.h | 3 +-
include/nuttx/net/arp.h | 12 +-
include/nuttx/net/encx24j600.h | 4 +-
include/nuttx/net/ftmac100.h | 18 +-
include/nuttx/net/gmii.h | 32 +-
include/nuttx/net/icmp.h | 4 +-
include/nuttx/net/icmpv6.h | 5 +-
include/nuttx/net/ieee802154.h | 2 +-
include/nuttx/net/ioctl.h | 3 +-
include/nuttx/net/ipopt.h | 29 +-
include/nuttx/net/ipv6ext.h | 15 +-
include/nuttx/net/netdev.h | 33 +-
include/nuttx/net/radiodev.h | 7 +-
include/nuttx/net/sixlowpan.h | 12 +-
include/nuttx/net/slip.h | 8 +-
include/nuttx/net/tcp.h | 2 +-
include/nuttx/net/w5500.h | 33 +-
include/nuttx/page.h | 76 +++--
include/nuttx/pgalloc.h | 2 +
include/nuttx/power/battery_charger.h | 34 +-
include/nuttx/power/relay.h | 1 +
include/nuttx/progmem.h | 20 +-
include/nuttx/scsi.h | 9 +-
include/nuttx/serial/mxser.h | 21 +-
include/nuttx/serial/serial.h | 190 +++++------
include/nuttx/serial/tioctl.h | 24 +-
include/nuttx/serial/uart_16550.h | 57 ++--
include/nuttx/spi/spi_bitbang.h | 5 +-
include/nuttx/spi/spi_transfer.h | 3 +-
include/nuttx/symtab.h | 10 +-
include/nuttx/syslog/syslog_console.h | 2 +
include/nuttx/timers/cs2100-cp.h | 48 +--
include/nuttx/timers/ds3231.h | 20 +-
include/nuttx/timers/oneshot.h | 11 +-
include/nuttx/timers/pcf85263.h | 22 +-
include/nuttx/timers/pwm.h | 57 ++--
include/nuttx/timers/watchdog.h | 23 +-
include/nuttx/usb/audio.h | 148 +++++----
include/nuttx/usb/cdcecm.h | 22 +-
include/nuttx/usb/composite.h | 8 +-
include/nuttx/usb/dfu.h | 10 +-
include/nuttx/usb/ehci.h | 235 +++++++++----
include/nuttx/usb/fusb301.h | 10 +-
include/nuttx/usb/fusb303.h | 15 +
include/nuttx/usb/hid.h | 18 +-
include/nuttx/usb/hub.h | 16 +-
include/nuttx/usb/max3421e.h | 5 +-
include/nuttx/usb/ohci.h | 15 +-
include/nuttx/usb/pl2303.h | 33 +-
include/nuttx/usb/rndis.h | 39 ++-
include/nuttx/usb/storage.h | 26 +-
include/nuttx/usb/usb.h | 73 ++--
include/nuttx/usb/usbdev.h | 106 +++---
include/nuttx/usb/usbdev_trace.h | 17 +-
include/nuttx/usb/usbhost.h | 605 ++++++++++++++++++----------------
include/nuttx/usb/usbhost_devaddr.h | 8 +-
include/nuttx/usb/usbhost_trace.h | 8 +-
include/nuttx/usb/usbmsc.h | 17 +-
include/nuttx/vt100.h | 27 +-
64 files changed, 1366 insertions(+), 1054 deletions(-)
[incubator-nuttx] 07/08: include: nuttx: timers: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 30a5a3edad0bb852c60ab82119bf511fa7c096b0
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 17:42:40 2021 +0100
include: nuttx: timers: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/timers/cs2100-cp.h | 48 +++++++++++++++++----------------
include/nuttx/timers/ds3231.h | 20 +++++++-------
include/nuttx/timers/oneshot.h | 11 +++++---
include/nuttx/timers/pcf85263.h | 22 +++++++++-------
include/nuttx/timers/pwm.h | 57 +++++++++++++++++++++-------------------
include/nuttx/timers/watchdog.h | 23 ++++++++++------
6 files changed, 102 insertions(+), 79 deletions(-)
diff --git a/include/nuttx/timers/cs2100-cp.h b/include/nuttx/timers/cs2100-cp.h
index 578a808..750e2fc 100644
--- a/include/nuttx/timers/cs2100-cp.h
+++ b/include/nuttx/timers/cs2100-cp.h
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/timers/cs2100-cp.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
@@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_TIMERS_CS2100_CP_H
#define __INCLUDE_NUTTX_TIMERS_CS2100_CP_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -47,9 +47,10 @@
#ifdef CONFIG_TIMERS_CS2100CP
-/********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ********************************************************************************************/
+ ****************************************************************************/
+
/* Configuration ************************************************************/
#ifndef CONFIG_I2C
@@ -65,7 +66,7 @@
# undef CONFIG_CS2100CP_REGDEBUG
#endif
-/* Register Addresses ***********************************************************************/
+/* Register Addresses *******************************************************/
#define CS2100_DEVID 0x01 /* Device ID and Revision */
#define CS2100_DEVCTL 0x02 /* Device Control */
@@ -79,7 +80,7 @@
#define CS2100_FNCCFG2 0x17 /* Function Configuration 2 */
#define CS2100_FNCCFG3 0x1e /* Function Configuration 3 */
-/* Register Bit Field Definitions ***********************************************************/
+/* Register Bit Field Definitions *******************************************/
/* Device ID and Revision */
@@ -104,6 +105,7 @@
# define CS2100_DEVCFG1_AUXOUTSRC_CLKIN (1 << CS2100_DEVCFG1_AUXOUTSRC_SHIFT) /* CLK_IN */
# define CS2100_DEVCFG1_AUXOUTSRC_CLKOUT (2 << CS2100_DEVCFG1_AUXOUTSRC_SHIFT) /* CLK_OUT */
# define CS2100_DEVCFG1_AUXOUTSRC_PLLLOCK (3 << CS2100_DEVCFG1_AUXOUTSRC_SHIFT) /* PLL Lock Status Indicator*/
+
#define CS2100_DEVCFG1_RMODSEL_SHIFT (5) /* Bit 5-7: Selects R-Mod value */
#define CS2100_DEVCFG1_RMODSEL_MASK (7 << CS2100_DEVCFG1_RMODSEL_SHIFT)
# define CS2100_DEVCFG1_RMODSEL_NONE (0 << CS2100_DEVCFG1_RMODSEL_SHIFT) /* Left-shift R-value by 0 (x 1) */
@@ -153,9 +155,9 @@
# define CS2100_FNCCFG3_CLKINBW_64HZ (6 << CS2100_FNCCFG3_CLKINBW_SHIFT) /* 64 Hz */
# define CS2100_FNCCFG3_CLKINBW_128HZ (7 << CS2100_FNCCFG3_CLKINBW_SHIFT) /* 128 Hz */
-/********************************************************************************************
+/****************************************************************************
* Public Types
- ********************************************************************************************/
+ ****************************************************************************/
struct cs2100_config_s
{
@@ -169,9 +171,9 @@ struct cs2100_config_s
bool xtal; /* false: Refclck, true: Crystal on XTI/XTO */
};
-/********************************************************************************************
+/****************************************************************************
* Public Data
- ********************************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
@@ -181,13 +183,13 @@ extern "C"
#define EXTERN extern
#endif
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
struct i2c_master_s; /* Forward reference */
-/********************************************************************************************
+/****************************************************************************
* Name: cs2100_enable
*
* Description:
@@ -199,39 +201,41 @@ struct i2c_master_s; /* Forward reference */
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
- ********************************************************************************************/
+ ****************************************************************************/
int cs2100_enable(FAR const struct cs2100_config_s *config);
-/********************************************************************************************
+/****************************************************************************
* Name: cs2100_disable
*
* Description:
* Disable CS2100 CLK_OUT
*
* Input Parameters:
- * config - CS2100-CP configuration (Needed only for I2C access: i2c and i2caddr)
+ * config - CS2100-CP configuration
+ * (Needed only for I2C access: i2c and i2caddr)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
- ********************************************************************************************/
+ ****************************************************************************/
int cs2100_disable(FAR const struct cs2100_config_s *config);
-/********************************************************************************************
+/****************************************************************************
* Name: cs2100_dump
*
* Description:
* Dump CS2100-CP registers to the SysLog
*
* Input Parameters:
- * config - CS2100-CP configuration (Needed only for I2C access: i2c and i2caddr)
+ * config - CS2100-CP configuration
+ * (Needed only for I2C access: i2c and i2caddr)
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
- ********************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_CS2100CP_DEBUG
int cs2100_dump(FAR const struct cs2100_config_s *config);
diff --git a/include/nuttx/timers/ds3231.h b/include/nuttx/timers/ds3231.h
index b26878a..77b304b 100644
--- a/include/nuttx/timers/ds3231.h
+++ b/include/nuttx/timers/ds3231.h
@@ -56,18 +56,20 @@ extern "C"
#define EXTERN extern
#endif
-/************************************************************************************
+/****************************************************************************
* Name: dsxxxx_rtc_initialize
*
* Description:
- * Initialize the hardware RTC per the selected configuration. This function is
- * called once during the OS initialization sequence by board-specific logic.
+ * Initialize the hardware RTC per the selected configuration.
+ * This function is called once during the OS initialization sequence by
+ * board-specific logic.
*
- * After dsxxxx_rtc_initialize() is called, the OS function clock_synchronize()
- * should also be called to synchronize the system timer to the hardware RTC. That
- * operation is normally performed automatically by the system during clock
- * initialization. However, when an external RTC is used, the board logic will
- * need to explicitly re-synchronize the system timer to the RTC when the RTC
+ * After dsxxxx_rtc_initialize() is called, the OS function
+ * clock_synchronize() should also be called to synchronize the system
+ * timer to the hardware RTC. That operation is normally performed
+ * automatically by the system during clock initialization.
+ * However, when an external RTC is used, the board logic will need to
+ * explicitly re-synchronize the system timer to the RTC when the RTC
* becomes available.
*
* Input Parameters:
@@ -76,7 +78,7 @@ extern "C"
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
- ************************************************************************************/
+ ****************************************************************************/
struct i2c_master_s; /* Forward reference */
int dsxxxx_rtc_initialize(FAR struct i2c_master_s *i2c);
diff --git a/include/nuttx/timers/oneshot.h b/include/nuttx/timers/oneshot.h
index 9992515..b426d84 100644
--- a/include/nuttx/timers/oneshot.h
+++ b/include/nuttx/timers/oneshot.h
@@ -52,7 +52,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* IOCTL commands ***********************************************************/
+
/* These commands are used by applications to access the oneshot lower-half
* logic via the oneshot character driver IOCTL command. Since the oneshot
* driver is a device control interface and not a data transfer interface,
@@ -187,8 +189,9 @@
*/
struct oneshot_lowerhalf_s;
-typedef CODE void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
- FAR void *arg);
+typedef CODE void (*oneshot_callback_t)
+ (FAR struct oneshot_lowerhalf_s *lower,
+ FAR void *arg);
/* The one short operations supported by the lower half driver */
@@ -206,7 +209,9 @@ struct oneshot_operations_s
FAR struct timespec *ts);
};
-/* This structure describes the state of the oneshot timer lower-half driver */
+/* This structure describes the state of the oneshot timer lower-half
+ * driver
+ */
struct oneshot_lowerhalf_s
{
diff --git a/include/nuttx/timers/pcf85263.h b/include/nuttx/timers/pcf85263.h
index 6510c98..33b2f21 100644
--- a/include/nuttx/timers/pcf85263.h
+++ b/include/nuttx/timers/pcf85263.h
@@ -56,19 +56,21 @@ extern "C"
#define EXTERN extern
#endif
-/************************************************************************************
+/****************************************************************************
* Name: pcf85263_rtc_initialize
*
* Description:
- * Initialize the hardware RTC per the selected configuration. This function is
- * called once during the OS initialization sequence by board-specific logic.
+ * Initialize the hardware RTC per the selected configuration.
+ * This function is called once during the OS initialization sequence by
+ * board-specific logic.
*
- * After pcf85263_rtc_initialize() is called, the OS function clock_synchronize()
- * should also be called to synchronize the system timer to a hardware RTC. That
- * operation is normally performed automatically by the system during clock
- * initialization. However, when an external RTC is used, the board logic will
- * need to explicitly re-synchronize the system timer to the RTC when the RTC
- * becomes available.
+ * After pcf85263_rtc_initialize() is called, the OS function
+ * clock_synchronize() should also be called to synchronize the system
+ * timer to a hardware RTC.
+ * That operation is normally performed automatically by the system during
+ * clock initialization. However, when an external RTC is used, the board
+ * logic will need to explicitly re-synchronize the system timer to the RTC
+ * when the RTC becomes available.
*
* Input Parameters:
* None
@@ -76,7 +78,7 @@ extern "C"
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
- ************************************************************************************/
+ ****************************************************************************/
struct i2c_master_s; /* Forward reference */
int pcf85263_rtc_initialize(FAR struct i2c_master_s *i2c);
diff --git a/include/nuttx/timers/pwm.h b/include/nuttx/timers/pwm.h
index 6d1d326..d3df501 100644
--- a/include/nuttx/timers/pwm.h
+++ b/include/nuttx/timers/pwm.h
@@ -38,9 +38,9 @@
/* For the purposes of this driver, a PWM device is any device that generates
* periodic output pulses s of controlled frequency and pulse width. Such a
- * device might be used, for example, to perform pulse-width modulated output or
- * frequency/pulse-count modulated output (such as might be needed to control
- * a stepper motor).
+ * device might be used, for example, to perform pulse-width modulated output
+ * or frequency/pulse-count modulated output (such as might be needed to
+ * control a stepper motor).
*
* The PWM driver is split into two parts:
*
@@ -87,34 +87,35 @@
* ioctl calls. The PWM ioctl commands are listed below:
*
* PWMIOC_SETCHARACTERISTICS - Set the characteristics of the next pulsed
- * output. This command will neither start nor stop the pulsed output.
- * It will either setup the configuration that will be used when the
- * output is started; or it will change the characteristics of the pulsed
- * output on the fly if the timer is already started. This command will
- * set the PWM characteristics and return immediately.
+ * output. This command will neither start nor stop the pulsed output.
+ * It will either setup the configuration that will be used when the
+ * output is started; or it will change the characteristics of the pulsed
+ * output on the fly if the timer is already started. This command will
+ * set the PWM characteristics and return immediately.
*
- * ioctl argument: A read-only reference to struct pwm_info_s that provides
- * the characteristics of the pulsed output.
+ * ioctl argument: A read-only reference to struct pwm_info_s that provides
+ * the characteristics of the pulsed output.
*
* PWMIOC_GETCHARACTERISTICS - Get the currently selected characteristics of
- * the pulsed output (independent of whether the output is start or stopped).
+ * the pulsed output (independent of whether the
+ * output is start or stopped).
*
- * ioctl argument: A reference to struct pwm_info_s to receive the
- * characteristics of the pulsed output.
+ * ioctl argument: A reference to struct pwm_info_s to receive the
+ * characteristics of the pulsed output.
*
* PWMIOC_START - Start the pulsed output. The PWMIOC_SETCHARACTERISTICS
- * command must have previously been sent. If CONFIG_PWM_PULSECOUNT is
- * defined and the pulse count was configured to a non-zero value, then
- * this ioctl call will, by default, block until the programmed pulse count
- * completes. That default blocking behavior can be overridden by using
- * the O_NONBLOCK flag when the PWM driver is opened.
+ * command must have previously been sent. If CONFIG_PWM_PULSECOUNT is
+ * defined and the pulse count was configured to a non-zero value, then
+ * this ioctl call will, by default, block until the programmed pulse count
+ * completes. That default blocking behavior can be overridden by using
+ * the O_NONBLOCK flag when the PWM driver is opened.
*
- * ioctl argument: None
+ * ioctl argument: None
*
* PWMIOC_STOP - Stop the pulsed output. This command will stop the PWM
- * and return immediately.
+ * and return immediately.
*
- * ioctl argument: None
+ * ioctl argument: None
*/
#define PWMIOC_SETCHARACTERISTICS _PWMIOC(1)
@@ -146,6 +147,7 @@ struct pwm_info_s
#ifdef CONFIG_PWM_MULTICHAN
/* Per-channel output state */
+
struct pwm_chan_s channels[CONFIG_PWM_NCHANNELS];
#else
@@ -175,8 +177,8 @@ struct pwm_ops_s
CODE int (*setup)(FAR struct pwm_lowerhalf_s *dev);
/* This method is called when the driver is closed. The lower half driver
- * should stop pulsed output, free any resources, disable the timer hardware, and
- * put the system into the lowest possible power usage state
+ * should stop pulsed output, free any resources, disable the timer
+ * hardware, and put the system into the lowest possible power usage state
*/
CODE int (*shutdown)(FAR struct pwm_lowerhalf_s *dev);
@@ -212,9 +214,9 @@ struct pwm_ops_s
* maintain state information.
*
* Normally that timer logic will have its own, custom state structure
- * that is simply cast to struct pwm_lowerhalf_s. In order to perform such casts,
- * the initial fields of the custom state structure match the initial fields
- * of the following generic PWM state structure.
+ * that is simply cast to struct pwm_lowerhalf_s. In order to perform such
+ * casts, the initial fields of the custom state structure match the initial
+ * fields of the following generic PWM state structure.
*/
struct pwm_lowerhalf_s
@@ -249,6 +251,7 @@ extern "C"
/****************************************************************************
* "Upper-Half" PWM Driver Interfaces
****************************************************************************/
+
/****************************************************************************
* Name: pwm_register
*
@@ -265,7 +268,7 @@ extern "C"
* filesystem. The recommended convention is to name all PWM drivers
* as "/dev/pwm0", "/dev/pwm1", etc. where the driver path differs only
* in the "minor" number at the end of the device name.
- * dev - A pointer to an instance of lower half timer driver. This instance
+ * dev - A pointer to an instance of lower half timer driver. This instance
* is bound to the PWM driver and must persists as long as the driver
* persists.
*
diff --git a/include/nuttx/timers/watchdog.h b/include/nuttx/timers/watchdog.h
index 89c6236..19bdf04 100644
--- a/include/nuttx/timers/watchdog.h
+++ b/include/nuttx/timers/watchdog.h
@@ -50,7 +50,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* IOCTL Commands ***********************************************************/
+
/* The watchdog driver uses a standard character driver framework. However,
* since the watchdog driver is a device control interface and not a data
* transfer interface, the majority of the functionality is implemented in
@@ -63,7 +65,8 @@
* WDIOC_STOP - Stop the watchdog timer
* Argument: Ignored
* WDIOC_GETSTATUS - Get the status of the watchdog timer.
- * Argument: A writeable pointer to struct watchdog_status_s.
+ * Argument: A writeable pointer to struct
+ * watchdog_status_s.
* WDIOC_SETTIMEOUT - Reset the watchdog timeout to this value
* Argument: A 32-bit timeout value in milliseconds.
* WDIOC_CAPTURE - Do not reset. Instead, called this handler.
@@ -90,6 +93,7 @@
#define WDIOC_MINTIME _WDIOC(0x080)
/* Bit Settings *************************************************************/
+
/* Bit settings for the struct watchdog_status_s flags field */
#define WDFLAGS_ACTIVE (1 << 0) /* 1=The watchdog timer is running */
@@ -100,6 +104,7 @@
/****************************************************************************
* Public Types
****************************************************************************/
+
/* This is the type of the argument passed to the WDIOC_CAPTURE ioctl */
struct watchdog_capture_s
@@ -127,7 +132,8 @@ struct watchdog_status_s
struct watchdog_lowerhalf_s;
struct watchdog_ops_s
{
- /* Required methods ********************************************************/
+ /* Required methods *******************************************************/
+
/* Start the watchdog timer, resetting the time to the current timeout */
CODE int (*start)(FAR struct watchdog_lowerhalf_s *lower);
@@ -136,7 +142,8 @@ struct watchdog_ops_s
CODE int (*stop)(FAR struct watchdog_lowerhalf_s *lower);
- /* Optional methods ********************************************************/
+ /* Optional methods *******************************************************/
+
/* Reset the watchdog timer to the current timeout value, prevent any
* imminent watchdog timeouts. This is sometimes referred as "pinging" the
* watchdog timer or "petting the dog".
@@ -207,15 +214,15 @@ extern "C"
* Name: watchdog_register
*
* Description:
- * This function binds an instance of a "lower half" watchdog driver with the
- * "upper half" watchdog device and registers that device so that can be used
- * by application code.
+ * This function binds an instance of a "lower half" watchdog driver with
+ * the "upper half" watchdog device and registers that device so that can
+ * be used by application code.
*
* When this function is called, the "lower half" driver should be in the
* disabled state (as if the stop() method had already been called).
*
- * NOTE: This function would not be called by application code. Rather it is
- * called indirectly through the architecture-specific interfaces.
+ * NOTE: This function would not be called by application code. Rather it
+ * is called indirectly through the architecture-specific interfaces.
*
* Input Parameters:
* dev path - The full path to the driver to be registers in the NuttX
[incubator-nuttx] 05/08: include: nuttx: spi: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 419bcb05d557d5e3145352a52c4860cf3d00fab5
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 17:26:30 2021 +0100
include: nuttx: spi: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/spi/spi_bitbang.h | 5 +++--
include/nuttx/spi/spi_transfer.h | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/nuttx/spi/spi_bitbang.h b/include/nuttx/spi/spi_bitbang.h
index 25392b0..af40db4 100644
--- a/include/nuttx/spi/spi_bitbang.h
+++ b/include/nuttx/spi/spi_bitbang.h
@@ -48,7 +48,7 @@
#ifdef CONFIG_SPI_BITBANG
/****************************************************************************
- * Private Types
+ * Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
@@ -139,7 +139,8 @@ extern "C"
*
****************************************************************************/
-FAR struct spi_dev_s *spi_create_bitbang(FAR const struct spi_bitbang_ops_s *low);
+FAR struct spi_dev_s *spi_create_bitbang(
+ FAR const struct spi_bitbang_ops_s *low);
#undef EXTERN
#if defined(__cplusplus)
diff --git a/include/nuttx/spi/spi_transfer.h b/include/nuttx/spi/spi_transfer.h
index 071f5c1..1dd27d7 100644
--- a/include/nuttx/spi/spi_transfer.h
+++ b/include/nuttx/spi/spi_transfer.h
@@ -52,6 +52,7 @@
#ifdef CONFIG_SPI_EXCHANGE
/* SPI Character Driver IOCTL Commands **************************************/
+
/* The SPI driver is intended to support application testing of the SPI bus.
* The SPI driver simply provides a user-accessible wrapper around the
* OS internal spi_transfer() function. The following IOCTL commands to
@@ -126,7 +127,7 @@ struct spi_sequence_s
};
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
/****************************************************************************
[incubator-nuttx] 04/08: include: nuttx: serial: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 83ebb6448cc539f1e8de3145e04440df99cfa523
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 17:23:15 2021 +0100
include: nuttx: serial: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/serial/mxser.h | 21 +++--
include/nuttx/serial/serial.h | 190 ++++++++++++++++++++------------------
include/nuttx/serial/tioctl.h | 24 ++---
include/nuttx/serial/uart_16550.h | 57 ++++++------
4 files changed, 152 insertions(+), 140 deletions(-)
diff --git a/include/nuttx/serial/mxser.h b/include/nuttx/serial/mxser.h
index f20f2d6..63c9239 100644
--- a/include/nuttx/serial/mxser.h
+++ b/include/nuttx/serial/mxser.h
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/serial/mxser.h
*
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
@@ -31,23 +31,24 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
-/* This function should not be included directly. Rather, it should be included indirectly
- * via include/nuttx/fs/ioctl.h.
+ ****************************************************************************/
+
+/* This function should not be included directly.
+ * Rather, it should be included indirectly via include/nuttx/fs/ioctl.h.
*/
#ifndef __INCLUDE_NUTTX_SERIAL_MXSER_H
#define __INCLUDE_NUTTX_SERIAL_MXSER_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <stdint.h>
-/********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ********************************************************************************************/
+ ****************************************************************************/
#define MOXA 0x400
#define MOXA_SET_OP_MODE (MOXA + 66)
@@ -59,9 +60,9 @@
#define RS485_4WIRE_MODE 3
#define OP_MODE_MASK 3
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
diff --git a/include/nuttx/serial/serial.h b/include/nuttx/serial/serial.h
index 147c5c2..4c7019c 100644
--- a/include/nuttx/serial/serial.h
+++ b/include/nuttx/serial/serial.h
@@ -1,7 +1,8 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/serial/serial.h
*
- * Copyright (C) 2007-2008, 2012-2015, 2018 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2008, 2012-2015, 2018 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -31,14 +32,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_SERIAL_SERIAL_H
#define __INCLUDE_NUTTX_SERIAL_SERIAL_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -53,9 +54,9 @@
#include <nuttx/fs/fs.h>
#include <nuttx/semaphore.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
/* Maximum number of threads than can be waiting for POLL events */
@@ -126,13 +127,13 @@
(dev->ops->rxflowcontrol && dev->ops->rxflowcontrol(dev,n,u))
#endif
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
-/* This structure defines one serial I/O buffer. The serial infrastructure will
- * initialize the 'sem' field but all other fields must be initialized by the
- * caller of uart_register().
+/* This structure defines one serial I/O buffer.
+ * The serial infrastructure will initialize the 'sem' field but all other
+ * fields must be initialized by the caller of uart_register().
*/
struct uart_buffer_s
@@ -155,46 +156,47 @@ struct uart_dmaxfer_s
};
#endif /* CONFIG_SERIAL_RXDMA || CONFIG_SERIAL_TXDMA */
-/* This structure defines all of the operations providd by the architecture specific
- * logic. All fields must be provided with non-NULL function pointers by the
- * caller of uart_register().
+/* This structure defines all of the operations providd by the architecture
+ * specific logic. All fields must be provided with non-NULL function
+ * pointers by the caller of uart_register().
*/
struct uart_dev_s;
struct uart_ops_s
{
/* Configure the UART baud, bits, parity, fifos, etc. This method is called
- * the first time that the serial port is opened. For the serial console,
- * this will occur very early in initialization; for other serial ports this
- * will occur when the port is first opened. This setup does not include
- * attaching or enabling interrupts. That portion of the UART setup is
- * performed when the attach() method is called.
+ * the first time that the serial port is opened. For the serial console,
+ * this will occur very early in initialization; for other serial ports
+ * this will occur when the port is first opened. This setup does not
+ * include attaching or enabling interrupts. That portion of the UART setup
+ * is performed when the attach() method is called.
*/
CODE int (*setup)(FAR struct uart_dev_s *dev);
/* Disable the UART. This method is called when the serial port is closed.
- * This method reverses the operation the setup method. NOTE that the serial
- * console is never shutdown.
+ * This method reverses the operation the setup method.
+ * NOTE that the serial console is never shutdown.
*/
CODE void (*shutdown)(FAR struct uart_dev_s *dev);
- /* Configure the UART to operation in interrupt driven mode. This method is
- * called when the serial port is opened. Normally, this is just after the
+ /* Configure the UART to operation in interrupt driven mode. This method is
+ * called when the serial port is opened. Normally, this is just after the
* the setup() method is called, however, the serial console may operate in
* a non-interrupt driven mode during the boot phase.
*
- * RX and TX interrupts are not enabled when by the attach method (unless the
- * hardware supports multiple levels of interrupt enabling). The RX and TX
- * interrupts are not enabled until the txint() and rxint() methods are called.
+ * RX and TX interrupts are not enabled when by the attach method (unless
+ * the hardware supports multiple levels of interrupt enabling). The RX
+ * and TX interrupts are not enabled until the txint() and rxint() methods
+ * are called.
*/
CODE int (*attach)(FAR struct uart_dev_s *dev);
- /* Detach UART interrupts. This method is called when the serial port is
- * closed normally just before the shutdown method is called. The exception is
- * the serial console which is never shutdown.
+ /* Detach UART interrupts. This method is called when the serial port is
+ * closed normally just before the shutdown method is called.
+ * The exception is the serial console which is never shutdown.
*/
CODE void (*detach)(FAR struct uart_dev_s *dev);
@@ -257,8 +259,8 @@ struct uart_ops_s
CODE void (*txint)(FAR struct uart_dev_s *dev, bool enable);
- /* Return true if the tranmsit hardware is ready to send another byte. This
- * is used to determine if send() method can be called.
+ /* Return true if the tranmsit hardware is ready to send another byte.
+ * This is used to determine if send() method can be called.
*/
CODE bool (*txready)(FAR struct uart_dev_s *dev);
@@ -341,9 +343,9 @@ struct uart_dev_s
typedef struct uart_dev_s uart_dev_t;
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -354,155 +356,159 @@ extern "C"
#define EXTERN extern
#endif
-/************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: uart_register
*
* Description:
* Register serial console and serial ports.
*
- ************************************************************************************/
+ ****************************************************************************/
int uart_register(FAR const char *path, FAR uart_dev_t *dev);
-/************************************************************************************
+/****************************************************************************
* Name: uart_xmitchars
*
* Description:
- * This function is called from the UART interrupt handler when an interrupt
- * is received indicating that there is more space in the transmit FIFO. This
- * function will send characters from the tail of the xmit buffer while the driver
- * write() logic adds data to the head of the xmit buffer.
+ * This function is called from the UART interrupt handler when an interrupt
+ * is received indicating that there is more space in the transmit FIFO.
+ * This function will send characters from the tail of the xmit buffer while
+ * the driver write() logic adds data to the head of the xmit buffer.
*
- ************************************************************************************/
+ ****************************************************************************/
void uart_xmitchars(FAR uart_dev_t *dev);
-/************************************************************************************
+/****************************************************************************
* Name: uart_receivechars
*
* Description:
- * This function is called from the UART interrupt handler when an interrupt
- * is received indicating that are bytes available to be received. This
- * function will add chars to head of receive buffer. Driver read() logic
- * will take characters from the tail of the buffer.
+ * This function is called from the UART interrupt handler when an interrupt
+ * is received indicating that are bytes available to be received. This
+ * function will add chars to head of receive buffer. Driver read() logic
+ * will take characters from the tail of the buffer.
*
- ************************************************************************************/
+ ****************************************************************************/
void uart_recvchars(FAR uart_dev_t *dev);
-/************************************************************************************
+/****************************************************************************
* Name: uart_datareceived
*
* Description:
- * This function is called from uart_recvchars when new serial data is place in
- * the driver's circular buffer. This function will wake-up any stalled read()
- * operations that are waiting for incoming data.
+ * This function is called from uart_recvchars when new serial data is place
+ * in the driver's circular buffer. This function will wake-up any stalled
+ * read() operations that are waiting for incoming data.
*
- ************************************************************************************/
+ ****************************************************************************/
void uart_datareceived(FAR uart_dev_t *dev);
-/************************************************************************************
+/****************************************************************************
* Name: uart_datasent
*
* Description:
- * This function is called from uart_xmitchars after serial data has been sent,
- * freeing up some space in the driver's circular buffer. This function will
- * wake-up any stalled write() operations that was waiting for space to buffer
- * outgoing data.
+ * This function is called from uart_xmitchars after serial data has been
+ * sent, freeing up some space in the driver's circular buffer.
+ * This function will wake-up any stalled write() operations that was
+ * waiting for space to buffer outgoing data.
*
- ************************************************************************************/
+ ****************************************************************************/
void uart_datasent(FAR uart_dev_t *dev);
-/************************************************************************************
+/****************************************************************************
* Name: uart_connected
*
* Description:
- * Serial devices (like USB serial) can be removed. In that case, the "upper
- * half" serial driver must be informed that there is no longer a valid serial
- * channel associated with the driver.
+ * Serial devices (like USB serial) can be removed. In that case, the "upper
+ * half" serial driver must be informed that there is no longer a valid
+ * serial channel associated with the driver.
*
- * In this case, the driver will terminate all pending transfers wint ENOTCONN and
- * will refuse all further transactions while the "lower half" is disconnected.
- * The driver will continue to be registered, but will be in an unusable state.
+ * In this case, the driver will terminate all pending transfers wint
+ * ENOTCONN and will refuse all further transactions while the "lower half"
+ * is disconnected.
+ * The driver will continue to be registered, but will be in an unusable
+ * state.
*
- * Conversely, the "upper half" serial driver needs to know when the serial
- * device is reconnected so that it can resume normal operations.
+ * Conversely, the "upper half" serial driver needs to know when the
+ * serial device is reconnected so that it can resume normal operations.
*
* Assumptions/Limitations:
- * This function may be called from an interrupt handler.
+ * This function may be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_SERIAL_REMOVABLE
void uart_connected(FAR uart_dev_t *dev, bool connected);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: uart_xmitchars_dma
*
* Description:
- * Set up to transfer bytes from the TX circular buffer using DMA
+ * Set up to transfer bytes from the TX circular buffer using DMA
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_SERIAL_TXDMA
void uart_xmitchars_dma(FAR uart_dev_t *dev);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: uart_xmitchars_done
*
* Description:
- * Perform operations necessary at the complete of DMA including adjusting the
- * TX circular buffer indices and waking up of any threads that may have been
- * waiting for space to become available in the TX circular buffer.
+ * Perform operations necessary at the complete of DMA including adjusting
+ * the TX circular buffer indices and waking up of any threads that may
+ * have been waiting for space to become available in the TX circular
+ * buffer.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_SERIAL_TXDMA
void uart_xmitchars_done(FAR uart_dev_t *dev);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: uart_recvchars_dma
*
* Description:
- * Set up to receive bytes into the RX circular buffer using DMA
+ * Set up to receive bytes into the RX circular buffer using DMA
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_SERIAL_RXDMA
void uart_recvchars_dma(FAR uart_dev_t *dev);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: uart_recvchars_done
*
* Description:
- * Perform operations necessary at the complete of DMA including adjusting the
- * RX circular buffer indices and waking up of any threads that may have been
- * waiting for new data to become available in the RX circular buffer.
+ * Perform operations necessary at the complete of DMA including adjusting
+ * the RX circular buffer indices and waking up of any threads that may have
+ * been waiting for new data to become available in the RX circular buffer.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_SERIAL_RXDMA
void uart_recvchars_done(FAR uart_dev_t *dev);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: uart_reset_sem
*
* Description:
- * This function is called when need reset uart semaphore, this may used in
- * kill one process, but this process was reading/writing with the semaphore.
+ * This function is called when need reset uart semaphore, this may used in
+ * kill one process, but this process was reading/writing with the
+ * semaphore.
*
- ************************************************************************************/
+ ****************************************************************************/
void uart_reset_sem(FAR uart_dev_t *dev);
diff --git a/include/nuttx/serial/tioctl.h b/include/nuttx/serial/tioctl.h
index 0c146e5..e991c2d 100644
--- a/include/nuttx/serial/tioctl.h
+++ b/include/nuttx/serial/tioctl.h
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/serial/tioctl.h
*
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
@@ -31,24 +31,24 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
-/* This function should not be included directly. Rather, it should be included indirectly
- * via include/nuttx/fs/ioctl.h.
+/* This function should not be included directly.
+ * Rather, it should be included indirectly via include/nuttx/fs/ioctl.h.
*/
#ifndef __INCLUDE_NUTTX_SERIAL_TIOCTL_H
#define __INCLUDE_NUTTX_SERIAL_TIOCTL_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <stdint.h>
-/********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ********************************************************************************************/
+ ****************************************************************************/
/* Get and Set Terminal Attributes (see termios.h) */
@@ -212,9 +212,9 @@
#define SER_SWAP_ENABLED (1 << 0) /* Enable/disable RX/TX swap */
-/********************************************************************************************
+/****************************************************************************
* Public Type Definitions
- ********************************************************************************************/
+ ****************************************************************************/
/* Used with TTY ioctls */
@@ -237,9 +237,9 @@ struct serial_rs485
uint32_t delay_rts_after_send; /* Delay after send (milliseconds) */
};
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
diff --git a/include/nuttx/serial/uart_16550.h b/include/nuttx/serial/uart_16550.h
index a40b564..5593e94 100644
--- a/include/nuttx/serial/uart_16550.h
+++ b/include/nuttx/serial/uart_16550.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/serial/uart_16550.h
* Serial driver for 16550 UART
*
@@ -32,24 +32,24 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_SERIAL_UART_16550_H
#define __INCLUDE_NUTTX_SERIAL_UART_16550_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#ifdef CONFIG_16550_UART
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/* CONFIGURATION ********************************************************************/
+/* CONFIGURATION ************************************************************/
/* Are any UARTs enabled? */
@@ -59,8 +59,8 @@
# define HAVE_UART 1
#endif
-/* We need to be told the address increment between registers and the register bit
- * width.
+/* We need to be told the address increment between registers and the
+ * register bit width.
*/
#ifndef CONFIG_16550_REGINCR
@@ -87,7 +87,9 @@
# error "CONFIG_16550_ADDRWIDTH not supported"
#endif
-/* If a UART is enabled, then its base address, clock, and IRQ must also be provided */
+/* If a UART is enabled, then its base address, clock, and IRQ
+ * must also be provided
+ */
#ifdef CONFIG_16550_UART0
# ifndef CONFIG_16550_UART0_BASE
@@ -149,8 +151,8 @@
# endif
#endif
-/* Is there a serial console? There should be at most one defined. It could be on
- * any UARTn, n=0,1,2,3
+/* Is there a serial console? There should be at most one defined.
+ * It could be on any UARTn, n=0,1,2,3
*/
#if defined(CONFIG_16550_UART0_SERIAL_CONSOLE) && defined(CONFIG_16550_UART0)
@@ -181,7 +183,7 @@
# undef HAVE_16550_CONSOLE
#endif
-/* Register offsets *****************************************************************/
+/* Register offsets *********************************************************/
#define UART_RBR_INCR 0 /* (DLAB =0) Receiver Buffer Register */
#define UART_THR_INCR 0 /* (DLAB =0) Transmit Holding Register */
@@ -209,7 +211,7 @@
#define UART_MSR_OFFSET (CONFIG_16550_REGINCR*UART_MSR_INCR)
#define UART_SCR_OFFSET (CONFIG_16550_REGINCR*UART_SCR_INCR)
-/* Register bit definitions *********************************************************/
+/* Register bit definitions *************************************************/
/* RBR (DLAB =0) Receiver Buffer Register */
@@ -250,6 +252,7 @@
# define UART_IIR_INTID_RDA (2 << UART_IIR_INTID_SHIFT) /* Receive Data Available (RDA) */
# define UART_IIR_INTID_RLS (3 << UART_IIR_INTID_SHIFT) /* Receiver Line Status (RLS) */
# define UART_IIR_INTID_CTI (6 << UART_IIR_INTID_SHIFT) /* Character Time-out Indicator (CTI) */
+
/* Bits 4-5: Reserved */
#define UART_IIR_FIFOEN_SHIFT (6) /* Bits 6-7: RCVR FIFO interrupt */
#define UART_IIR_FIFOEN_MASK (3 << UART_IIR_FIFOEN_SHIFT)
@@ -308,9 +311,9 @@
#define UART_SCR_MASK (0xff) /* Bits 0-7: SCR data */
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
#if CONFIG_16550_REGWIDTH == 8
typedef uint8_t uart_datawidth_t;
@@ -328,27 +331,29 @@ typedef uint16_t uart_addrwidth_t;
typedef uint32_t uart_addrwidth_t;
#endif
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Defintions
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: uart_getreg(), uart_putreg(), uart_ioctl()
*
* Description:
- * These functions must be provided by the processor-specific code in order to
- * correctly access 16550 registers
+ * These functions must be provided by the processor-specific code in order
+ * to correctly access 16550 registers
* uart_ioctl() is optional to provide custom IOCTLs
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef CONFIG_SERIAL_UART_ARCH_MMIO
uart_datawidth_t uart_getreg(uart_addrwidth_t base, unsigned int offset);
-void uart_putreg(uart_addrwidth_t base, unsigned int offset, uart_datawidth_t value);
+void uart_putreg(uart_addrwidth_t base,
+ unsigned int offset,
+ uart_datawidth_t value);
#endif
struct file; /* Forward reference */
[incubator-nuttx] 02/08: include: nuttx: net: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 2b6cad5178f8720bc923db2a0eba8f33931c41c9
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 16:33:53 2021 +0100
include: nuttx: net: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/net/arp.h | 12 +++++++-----
include/nuttx/net/encx24j600.h | 4 ++--
include/nuttx/net/ftmac100.h | 18 +++++++++---------
include/nuttx/net/gmii.h | 32 +++++++++++++++++---------------
include/nuttx/net/icmp.h | 4 ++--
include/nuttx/net/icmpv6.h | 5 +++--
include/nuttx/net/ieee802154.h | 2 +-
include/nuttx/net/ioctl.h | 3 ++-
include/nuttx/net/ipopt.h | 29 +++++++++++++++--------------
include/nuttx/net/ipv6ext.h | 15 ++++++++-------
include/nuttx/net/netdev.h | 33 +++++++++++++++++++--------------
include/nuttx/net/radiodev.h | 7 ++++---
include/nuttx/net/sixlowpan.h | 12 ++++++++----
include/nuttx/net/slip.h | 8 +++++---
include/nuttx/net/tcp.h | 2 +-
include/nuttx/net/w5500.h | 33 ++++++++++++++++++---------------
16 files changed, 121 insertions(+), 98 deletions(-)
diff --git a/include/nuttx/net/arp.h b/include/nuttx/net/arp.h
index 1894577..920a636 100644
--- a/include/nuttx/net/arp.h
+++ b/include/nuttx/net/arp.h
@@ -114,7 +114,8 @@ struct net_driver_s; /* Forward reference */
* The arp_ipin() function should be called by Ethernet device drivers
* whenever an IP packet arrives from the network. The function will
* check if the address is in the ARP cache, and if so the ARP cache entry
- * will be refreshed. If no ARP cache entry was found, a new one is created.
+ * will be refreshed.
+ * If no ARP cache entry was found, a new one is created.
*
* This function expects that an IP packet with an Ethernet header is
* present in the d_buf buffer and that the length of the packet is in the
@@ -144,10 +145,11 @@ void arp_ipin(FAR struct net_driver_s *dev);
* Ethernet header is present in the d_buf buffer and that the length of
* the packet is set in the d_len field.
*
- * When the function returns, the value of the field d_len indicates whether
- * the device driver should send out the ARP reply packet or not. If d_len
- * is zero, no packet should be sent; If d_len is non-zero, it contains the
- * length of the outbound packet that is present in the d_buf buffer.
+ * When the function returns, the value of the field d_len indicates
+ * whether the device driver should send out the ARP reply packet or not.
+ * If d_len is zero, no packet should be sent; If d_len is non-zero, it
+ * contains the length of the outbound packet that is present in the d_buf
+ * buffer.
*
****************************************************************************/
diff --git a/include/nuttx/net/encx24j600.h b/include/nuttx/net/encx24j600.h
index d02d31a..6152b96 100644
--- a/include/nuttx/net/encx24j600.h
+++ b/include/nuttx/net/encx24j600.h
@@ -54,8 +54,8 @@
* CONFIG_ENCX24J600 - Enabled ENCX24J600 support
* CONFIG_ENCX24J600_SPIMODE - Controls the SPI mode
* CONFIG_ENCX24J600_FREQUENCY - Define to use a different bus frequency
- * CONFIG_ENCX24J600_NINTERFACES - Specifies the number of physical ENCX24J600
- * devices that will be supported.
+ * CONFIG_ENCX24J600_NINTERFACES - Specifies the number of physical
+ * ENCX24J600 devices that will be supported.
* CONFIG_ENCX24J600_HALFDUPPLEX - Default is full duplex
*/
diff --git a/include/nuttx/net/ftmac100.h b/include/nuttx/net/ftmac100.h
index 4fb1d15..bc918fd 100644
--- a/include/nuttx/net/ftmac100.h
+++ b/include/nuttx/net/ftmac100.h
@@ -39,7 +39,7 @@
#ifndef __INCLUDE_NUTTX_NET_FTMAC100_H
#define __INCLUDE_NUTTX_NET_FTMAC100_H
-/****************************************************************************'
+/****************************************************************************
* Included Files
****************************************************************************/
@@ -47,11 +47,11 @@
#ifdef CONFIG_NET_FTMAC100
-/****************************************************************************'
+/****************************************************************************
* Pre-processor definitions
****************************************************************************/
-/* Interrupt status register & interrupt mask register definitions*/
+/* Interrupt status register & interrupt mask register definitions */
#define FTMAC100_INT_RPKT_FINISH (1 << 0)
#define FTMAC100_INT_NORXBUF (1 << 1)
@@ -146,7 +146,7 @@
#define FTMAC100_RXDES1_RXBUF_SIZE(x) ((x) & 0x7ff)
#define FTMAC100_RXDES1_EDORR (1 << 31)
-/****************************************************************************'
+/****************************************************************************
* Public Types
****************************************************************************/
@@ -194,25 +194,25 @@ struct ftmac100_register_s
/* Transmit descriptor, aligned to 16 bytes */
-struct ftmac100_txdes_s
+struct __attribute__ ((aligned(16))) ftmac100_txdes_s
{
uint32_t txdes0;
uint32_t txdes1;
uint32_t txdes2; /* TXBUF_BADR */
uint32_t txdes3; /* not used by HW */
-} __attribute__ ((aligned(16)));
+};
/* Receive descriptor, aligned to 16 bytes */
-struct ftmac100_rxdes_s
+struct __attribute__ ((aligned(16))) ftmac100_rxdes_s
{
uint32_t rxdes0;
uint32_t rxdes1;
uint32_t rxdes2; /* RXBUF_BADR */
uint32_t rxdes3; /* not used by HW */
-} __attribute__ ((aligned(16)));
+};
-/****************************************************************************'
+/****************************************************************************
* Pre-processor definitions
****************************************************************************/
diff --git a/include/nuttx/net/gmii.h b/include/nuttx/net/gmii.h
index c3e3f38..806aed7 100644
--- a/include/nuttx/net/gmii.h
+++ b/include/nuttx/net/gmii.h
@@ -1,4 +1,4 @@
-/*********************************************************************************************
+/****************************************************************************
* include/nuttx/net/gmii.h
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,23 +31,23 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- *********************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_NET_GMII_H
#define __INCLUDE_NUTTX_NET_GMII_H
-/*********************************************************************************************
+/****************************************************************************
* Included Files
- *********************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/net/mii.h>
-/*********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- *********************************************************************************************/
+ ****************************************************************************/
-/* MII register offsets **********************************************************************/
+/* MII register offsets *****************************************************/
/* Common MII management registers. The IEEE 802.3 standard specifies a
* register set for controlling and gathering status from the PHY layer. The
@@ -71,9 +71,11 @@
#define GMII_ERDRR 13 /* Extend Register - Data Read Register */
#define GMII_ESTATUS MII_ESTATUS /* Extended MII status register */
-/* Extended Registers: Registers 16-31 may be used for vendor specific abilities */
+/* Extended Registers:
+ * Registers 16-31 may be used for vendor specific abilities
+ */
-/* Micrel KSZ9021/31 Vendor Specific Register Addresses **************************************/
+/* Micrel KSZ9021/31 Vendor Specific Register Addresses *********************/
#define GMII_KSZ90x1_RLPBK 17 /* Remote loopback, LED mode */
#define GMII_KSZ90x1_LINKMD 18 /* LinkMD(c) cable diagnostic */
@@ -93,7 +95,7 @@
#define GMII_KSZ90X1_RRDPSR 261 /* RGMII RX data pad skew */
#define GMII_KSZ90x1_ATR 263 /* Analog test register */
-/* MII register bit settings *****************************************************************/
+/* MII register bit settings ************************************************/
/* MII Control register bit definitions */
@@ -271,7 +273,7 @@
/* Extend Register - Data Read Register (16-bit data value) */
-/* Micrel KSZ9021/31 Vendor Specific Register Bit Definitions ********************************/
+/* Micrel KSZ9021/31 Vendor Specific Register Bit Definitions ***************/
/* KSZ8021/31 Register 27: Interrupt control/status */
@@ -293,13 +295,13 @@
#define GMII_KSZ90x1_INT_RF (1 << 1) /* Remote fault interrupt */
#define GMII_KSZ90x1_INT_LU (1 << 0) /* Link up interrupt */
-/*********************************************************************************************
+/****************************************************************************
* Type Definitions
- *********************************************************************************************/
+ ****************************************************************************/
-/*********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- *********************************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
diff --git a/include/nuttx/net/icmp.h b/include/nuttx/net/icmp.h
index dacde22..d949c25 100644
--- a/include/nuttx/net/icmp.h
+++ b/include/nuttx/net/icmp.h
@@ -107,8 +107,8 @@ struct icmp_hdr_s
uint16_t icmpchksum; /* Checksum of ICMP header and data */
/* All ICMP packets have an 8-byte header and variable-sized data section.
- * The first 4 bytes of the header have fixed format, while the last 4 bytes
- * depend on the type/code of that ICMP packet.
+ * The first 4 bytes of the header have fixed format, while the last
+ * 4 bytes depend on the type/code of that ICMP packet.
*/
/* ICMP_ECHO_REQUEST and ICMP_ECHO_REPLY data */
diff --git a/include/nuttx/net/icmpv6.h b/include/nuttx/net/icmpv6.h
index 201afed..e520fc1 100644
--- a/include/nuttx/net/icmpv6.h
+++ b/include/nuttx/net/icmpv6.h
@@ -2,7 +2,8 @@
* include/nuttx/net/icmpv6.h
* Header file for the NuttX ICMPv6 stack.
*
- * Copyright (C) 2007-2009, 2012, 2014, 2017 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2012, 2014, 2017 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@@ -121,7 +122,7 @@
/* Prefix option flags */
#define ICMPv6_PRFX_FLAG_L (1 << 7) /* On-link flag */
-#define ICMPv6_PRFX_FLAG_A (1 << 6) /* Autonomous address-configuration flag
+#define ICMPv6_PRFX_FLAG_A (1 << 6) /* Autonomous address-configuration flag */
/* Return with size of an option (in full octects) using the size of a link
* layer address taking into account a header of the two-bytes.
diff --git a/include/nuttx/net/ieee802154.h b/include/nuttx/net/ieee802154.h
index 6cf5c04..e224c61 100644
--- a/include/nuttx/net/ieee802154.h
+++ b/include/nuttx/net/ieee802154.h
@@ -82,7 +82,7 @@
*
****************************************************************************/
-struct radio_driver_s; /* Forward reference */
+struct radio_driver_s; /* Forward reference */
struct ieee802154_data_ind_s; /* Forward reference */
struct iob_s; /* Forward reference */
diff --git a/include/nuttx/net/ioctl.h b/include/nuttx/net/ioctl.h
index 6f2f20e..1c02a74 100644
--- a/include/nuttx/net/ioctl.h
+++ b/include/nuttx/net/ioctl.h
@@ -1,7 +1,8 @@
/****************************************************************************
* include/nuttx/net/ioctl.h
*
- * Copyright (C) 2007-2008, 2010-2013, 2015-2016 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2008, 2010-2013, 2015-2016 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
diff --git a/include/nuttx/net/ipopt.h b/include/nuttx/net/ipopt.h
index f9c67cf..91fc718 100644
--- a/include/nuttx/net/ipopt.h
+++ b/include/nuttx/net/ipopt.h
@@ -1,4 +1,4 @@
-/************************************************************************************************************
+/****************************************************************************
* include/nuttx/net/ipopt.h
* Defines values for the IPv4 header options
*
@@ -32,20 +32,20 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_NET_IPOPT_H
#define __INCLUDE_NUTTX_NET_IPOPT_H
-/************************************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
-/************************************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************************************/
+ ****************************************************************************/
/* IP Header Options:
*
@@ -95,10 +95,11 @@
# define IPOPT_TYPE_OPTION_UMP (24 << IPOPT_TYPE_OPTION_SHIFT) /* Upstream multicast packet */
# define IPOPT_TYPE_OPTION_QS (25 << IPOPT_TYPE_OPTION_SHIFT) /* Quick start (RFC 4782) */
# define IPOPT_TYPE_OPTION_EXP3692 (30 << IPOPT_TYPE_OPTION_SHIFT) /* RFC 3692-style experiment (RFC 4782) */
-#define IPOPT_TYPE_CLASS_SHIFT (5) /* Bits 5-6: Class */
+#define IPOPT_TYPE_CLASS_SHIFT (5) /* Bits 5-6: Class */
#define IPOPT_TYPE_CLASS_MASK (3 << IPOPT_TYPE_CLASS_SHIFT)
# define IPOPT_TYPE_CLASS_CTRL (0 << IPOPT_TYPE_CLASS_SHIFT) /* Control */
# define IPOPT_TYPE_CLASS_MEASURE (2 << IPOPT_TYPE_CLASS_SHIFT) /* Debugging and measurement */
+
#define IPOPT_TYPE_COPIED (1 << 7) /* Bit 7: IP layer must copy option to each fragment */
#define IPOPT_TYPE_NOTCOPIED (0)
@@ -113,7 +114,7 @@
(uint32_t)(ptr) << 8 | (uint32_t)(data))
/* Option Copy Class Length Description References
- * ------ ---- ----- --------- ------------------------------------------------
+ * ------ ---- ----- --------- ----------------------------------------------
* 0 0 0 1 End of options list (RFC 791)
* 1 0 0 1 NOP (RFC 791
* 2 1 0 11 Security (RFC 791, RFC 1108)
@@ -235,16 +236,16 @@
#define IPOPT_QS_TYPE \
IPOPT_MKTYPE(IPOPT_TYPE_NOTCOPIED, IPOPT_TYPE_CLASS_CTRL, IPOPT_TYPE_OPTION_QS)
-/************************************************************************************************************
+/****************************************************************************
* Public Type Definitions
- ************************************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************************************/
+ ****************************************************************************/
#endif /* __INCLUDE_NUTTX_NET_IPOPT_H */
diff --git a/include/nuttx/net/ipv6ext.h b/include/nuttx/net/ipv6ext.h
index 72fb54a..c29bad0 100644
--- a/include/nuttx/net/ipv6ext.h
+++ b/include/nuttx/net/ipv6ext.h
@@ -34,9 +34,9 @@
/* Extension headers carry optional Internet Layer information, and are
* placed between the fixed IPv6 header and the upper-layer protocol header.
* The headers form a chain, using the Next Header fields. The Next Header
- * field in the fixed header indicates the type of the first extension header;
- * the Next Header field of the last extension header indicates the type of
- * the upper-layer protocol header in the payload of the packet.
+ * field in the fixed header indicates the type of the first extension
+ * header; the Next Header field of the last extension header indicates the
+ * type of the upper-layer protocol header in the payload of the packet.
*
* All extension headers are a multiple of 8 octets in size; some extension
* headers require internal padding to meet this requirement.
@@ -46,8 +46,9 @@
* processed at every intermediate node on the packet's path, including
* sending and receiving node.
*
- * If a node does not recognize a specific extension header, it should discard
- * the packet and send a Parameter Problem message (ICMPv6 type 4, code 1).
+ * If a node does not recognize a specific extension header, it should
+ * discard the packet and send a Parameter Problem message (ICMPv6 type 4,
+ * code 1).
* When a Next Header value 0 appears in a header other than the fixed header
* a node should do the same.
*/
@@ -79,8 +80,8 @@
* fragmented packets (in IPv6, the traffic source must do fragmentation-
* routers do not perform fragmentation of the packets they forward)
* - Mobility EH is used in support of Mobile IPv6 service
- * - Authentication EH is similar in format and use to the IPv4 authentication
- * header defined in RFC2402.
+ * - Authentication EH is similar in format and use to the IPv4
+ * authentication header defined in RFC2402.
* - Encapsulating Security Payload EH is similar in format and use to the
* IPv4 ESP header defined in RFC2406 [5]. All information following the
* Encapsulating Security Header (ESH) is encrypted and for that reason, it
diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h
index ee46c03..856fe05 100644
--- a/include/nuttx/net/netdev.h
+++ b/include/nuttx/net/netdev.h
@@ -6,7 +6,8 @@
* Copyright (C) 2007, 2009, 2011-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
- * Derived largely from portions of uIP with has a similar BSD-styple license:
+ * Derived largely from portions of uIP with has a similar BSD-styple
+ * license:
*
* Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
@@ -215,8 +216,8 @@ struct netdev_varaddr_s
#endif
/* This structure collects information that is specific to a specific network
- * interface driver. If the hardware platform supports only a single instance
- * of this structure.
+ * interface driver. If the hardware platform supports only a single
+ * instance of this structure.
*/
struct devif_callback_s; /* Forward reference */
@@ -230,7 +231,8 @@ struct net_driver_s
#ifdef CONFIG_NET
FAR struct net_driver_s *flink;
- /* This is the name of network device assigned when netdev_register was called.
+ /* This is the name of network device assigned when netdev_register was
+ * called.
* This name is only used to support socket ioctl lookups by device name
* Examples: "eth0"
*/
@@ -242,7 +244,9 @@ struct net_driver_s
uint8_t d_flags;
- /* Multi network devices using multiple link layer protocols are supported */
+ /* Multi network devices using multiple link layer protocols are
+ * supported
+ */
uint8_t d_lltype; /* See enum net_lltype_e */
uint8_t d_llhdrlen; /* Link layer header size */
@@ -309,7 +313,7 @@ struct net_driver_s
#ifdef CONFIG_NET_TCPURGDATA
/* This pointer points to any urgent TCP data that has been received. Only
- * present if compiled with support for urgent data (CONFIG_NET_TCPURGDATA).
+ * present if compiled with support for urgent data(CONFIG_NET_TCPURGDATA).
*/
FAR uint8_t *d_urgdata;
@@ -334,8 +338,8 @@ struct net_driver_s
uint16_t d_len;
- /* When d_buf contains outgoing xmit data, d_sndlen is non-zero and represents
- * the amount of application data after d_appdata
+ /* When d_buf contains outgoing xmit data, d_sndlen is non-zero and
+ * represents the amount of application data after d_appdata
*/
uint16_t d_sndlen;
@@ -579,9 +583,9 @@ void neighbor_out(FAR struct net_driver_s *dev);
*
* Description:
* This function should be called before sending out a packet. The function
- * checks the destination address of the packet to see whether the target of
- * packet is ourself and then consume the packet directly by calling input
- * process functions.
+ * checks the destination address of the packet to see whether the target
+ * of packet is ourself and then consume the packet directly by calling
+ * input process functions.
*
* Returned Value:
* Zero is returned if the packet don't loop back to ourself, otherwise
@@ -594,8 +598,8 @@ int devif_loopback(FAR struct net_driver_s *dev);
/****************************************************************************
* Carrier detection
*
- * Call netdev_carrier_on when the carrier has become available and the device
- * is ready to receive/transmit packets.
+ * Call netdev_carrier_on when the carrier has become available and the
+ * device is ready to receive/transmit packets.
*
* Call detdev_carrier_off when the carrier disappeared and the device has
* moved into non operational state.
@@ -642,7 +646,8 @@ ssize_t net_ioctl_arglen(int cmd);
*
* buf - A pointer to the buffer over which the checksum is to be computed.
*
- * len - The length of the buffer over which the checksum is to be computed.
+ * len - The length of the buffer over which the checksum is to be
+ * computed.
*
* Returned Value:
* The Internet checksum of the buffer.
diff --git a/include/nuttx/net/radiodev.h b/include/nuttx/net/radiodev.h
index 9201b22..4177749 100644
--- a/include/nuttx/net/radiodev.h
+++ b/include/nuttx/net/radiodev.h
@@ -137,9 +137,9 @@ struct radiodev_properties_s
* driver must still provide its (single) reassembly buffer in d_buf;
* that buffer is still used for the case where the packet is not
* fragmented into many frames. In either case, the packet buffer will
- * have a size of advertised MTU of the protocol, CONFIG_NET_6LOWPAN_PKTSIZE,
- * plus CONFIG_NET_GUARDSIZE and some additional overhead for reassembly
- * state data.
+ * have a size of advertised MTU of the protocol,
+ * CONFIG_NET_6LOWPAN_PKTSIZE, plus CONFIG_NET_GUARDSIZE and some
+ * additional overhead for reassembly state data.
*
* The radio network driver should then inform the network of the recipt
* of a frame by calling sixlowpan_input() or ieee802154_input(). That
@@ -184,6 +184,7 @@ struct radio_driver_s
#endif
/* MAC network driver callback functions **********************************/
+
/**************************************************************************
* Name: r_get_mhrlen
*
diff --git a/include/nuttx/net/sixlowpan.h b/include/nuttx/net/sixlowpan.h
index 786262c..623dba9 100644
--- a/include/nuttx/net/sixlowpan.h
+++ b/include/nuttx/net/sixlowpan.h
@@ -65,6 +65,7 @@
****************************************************************************/
/* Frame format definitions *************************************************/
+
/* Fragment header.
*
* The fragment header is used when the payload is too large to fit in a
@@ -164,7 +165,9 @@
* Values of fields within the IPHC encoding first byte
* (Using MS-to-LS bit numbering of the draft RFC)
*/
+
/* Bits 0-2: 011 */
+
#define SIXLOWPAN_IPHC_TC_MASK 0x18 /* Bits 3-4: Traffic Class, Flow Label */
# define SIXLOWPAN_IPHC_TC_00 0x00 /* ECN+DSCP+4-bit Pad+Flow Label (4 bytes) */
# define SIXLOWPAN_IPHC_TC_01 0x08 /* ECN+2-bit Pad+ Flow Label (3 bytes), DSCP is elided. */
@@ -467,11 +470,12 @@ struct sixlowpan_reassbuf_s
* - The io_flink field points to the next frame in the list (if enable)
* - The last frame in the list will have io_flink == NULL.
*
- * An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE + CONFIG_NET_GUARDSIZE
- * must also be provided. The frame will be decompressed and placed in
- * the d_buf. Fragmented packets will also be reassembled in the d_buf as
+ * An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE +
+ * CONFIG_NET_GUARDSIZE must also be provided.
+ * The frame will be decompressed and placed in the d_buf.
+ * Fragmented packets will also be reassembled in the d_buf as
* they are received (meaning for the driver, that two packet buffers are
- * required: One for reassembly of RX packets and one used for TX polling).
+ * required: One for reassembly of RX packets and one used for TX polling).
*
* After each frame is processed into d_buf, the IOB is deallocated. If
* reassembly is incomplete, the partially reassembled packet must be
diff --git a/include/nuttx/net/slip.h b/include/nuttx/net/slip.h
index 0efae08..5c5447e 100644
--- a/include/nuttx/net/slip.h
+++ b/include/nuttx/net/slip.h
@@ -50,7 +50,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-/* Configuration ***********************************************************/
+
+/* Configuration ************************************************************/
+
/* SLIP Configuration:
*
* CONFIG_NET_SLIP - Enables building of the SLIP driver
@@ -58,8 +60,8 @@
* threads. Default: 2048
* CONFIG_NET_SLIP_DEFPRIO - Provides the priority for SLIP RX and TX
* threads. Default 128.
- * CONFIG_NET_NET_SLIP_PKTSIZE - Provides the size of the SLIP packet buffers.
- * Default 296
+ * CONFIG_NET_NET_SLIP_PKTSIZE - Provides the size of the SLIP packet
+ * buffers. Default 296
*
* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
* IP+TCP headers plus 256 bytes of data). So you might as well set
diff --git a/include/nuttx/net/tcp.h b/include/nuttx/net/tcp.h
index a3f3750..e209ea5 100644
--- a/include/nuttx/net/tcp.h
+++ b/include/nuttx/net/tcp.h
@@ -189,7 +189,7 @@ struct tcp_stats_s
net_stats_t rst; /* Number of received TCP RST (reset) segments */
net_stats_t rexmit; /* Number of retransmitted TCP segments */
net_stats_t syndrop; /* Number of dropped SYNs due to too few
- available connections */
+ * available connections */
net_stats_t synrst; /* Number of SYNs for closed ports triggering a RST */
};
#endif
diff --git a/include/nuttx/net/w5500.h b/include/nuttx/net/w5500.h
index 594a027..9eeb58d 100644
--- a/include/nuttx/net/w5500.h
+++ b/include/nuttx/net/w5500.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/net/w5500.h
* WIZnet W5500 Ethernet Controller
*
@@ -32,14 +32,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_NET_W5500_H
#define __INCLUDE_NUTTX_NET_W5500_H
-/************************************************************************************'
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -48,11 +48,11 @@
#ifdef CONFIG_NET_W5500
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
-/* W5500 Register Addresses *********************************************************/
+/* W5500 Register Addresses *************************************************/
/* Common Register Block */
@@ -153,7 +153,7 @@
#define W5500_SN_KPALVTR 0x002f /* Keep alive timer */
/* 0x0030-0xffff: Reserved */
-/* W5500 Register Bitfield Definitions **********************************************/
+/* W5500 Register Bitfield Definitions **************************************/
/* Common Register Block */
@@ -197,6 +197,7 @@
# define PHYCFGR_OPMDC_POWER_DOWN (6 << PHYCFGR_OPMDC_SHIFT) /* Power Down mode */
# define PHYCFGR_OPMDC_ALLCAP_AN (7 << PHYCFGR_OPMDC_SHIFT) /* All capable,
* Auto-negotiation */
+
#define PHYCFGR_OPMD (1 << 6) /* Bit 6: Configure PHY Operation Mode */
#define PHYCFGR_RST (1 << 7) /* Bit 7: Reset */
@@ -238,7 +239,9 @@
#define SN_CR_SEND_KEEP 0x22 /* Send TCP keep-alive packet */
#define SN_CR_RECV 0x40 /* Complete received data in Socket n RX buffer */
-/* Socket n Interrupt Register (SN_IR) and Socket n Interrupt Mask Register (SN_IMR) */
+/* Socket n Interrupt Register (SN_IR) and
+ * Socket n Interrupt Mask Register (SN_IMR)
+ */
#define SN_INT_CON (1 << 0) /* Bit 0: Connection with peer successful */
#define SN_INT_DISCON (1 << 1) /* Bit 1: FIN or FIN/ACK received from peer */
@@ -281,9 +284,9 @@
#define SN_TXBUF_8KB 5
#define SN_TXBUF_16KB 16
-/************************************************************************************'
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
/* This structure describes the lower-half interface provided by board-
* specific logic.
@@ -308,11 +311,11 @@ struct w5500_lower_s
void (*reset)(FAR const struct w5500_lower_s *lower, bool reset);
};
-/************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: w5500_initialize
*
* Description:
@@ -326,7 +329,7 @@ struct w5500_lower_s
*
* Assumptions:
*
- ************************************************************************************/
+ ****************************************************************************/
int w5500_initialize(FAR struct w5500_lower_s *lower);
[incubator-nuttx] 03/08: include: nuttx: power: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit fa10244ccb280a2bc15b9d25562ee99edddd8ae7
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 17:03:50 2021 +0100
include: nuttx: power: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/power/battery_charger.h | 34 ++++++++++++++++++++++------------
include/nuttx/power/relay.h | 1 +
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/include/nuttx/power/battery_charger.h b/include/nuttx/power/battery_charger.h
index af99027..5f66666 100644
--- a/include/nuttx/power/battery_charger.h
+++ b/include/nuttx/power/battery_charger.h
@@ -52,7 +52,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Configuration ************************************************************/
+
/* CONFIG_BATTERY_CHARGER - Upper half battery charger driver support
*
* Specific, lower-half drivers will have other configuration requirements
@@ -64,8 +66,10 @@
*/
/* IOCTL Commands ***********************************************************/
-/* The upper-half battery charger driver provides a character driver "wrapper"
- * around the lower-half battery charger driver that does all of the real work.
+
+/* The upper-half battery charger driver provides a character driver
+ * "wrapper" around the lower-half battery charger driver that does all of
+ * the real work.
* Since there is no real data transfer to/or from a battery, all of the
* driver interaction is through IOCTL commands. The IOCTL commands
* supported by the upper-half driver simply provide calls into the
@@ -86,7 +90,8 @@
* BATIOC_INPUT_CURRENT - Define the input current limit of power supply.
* Input value: An int defining the input current limit value.
* BATIOC_OPERATE - Perform miscellaneous, device-specific charger operation.
- * Input value: An uintptr_t that can hold a pointer to struct batio_operate_msg_s.
+ * Input value: An uintptr_t that can hold a pointer to struct
+ * batio_operate_msg_s.
*/
/* Special input values for BATIOC_INPUT_CURRENT that may optionally
@@ -98,6 +103,7 @@
/****************************************************************************
* Public Types
****************************************************************************/
+
/* Battery status */
enum battery_charger_status_e
@@ -126,7 +132,7 @@ enum battery_charger_health_e
BATTERY_HEALTH_DISCONNECTED /* Battery is not connected */
};
- /* This structure defines the lower half battery interface */
+ /* This structure defines the lower half battery interface */
struct battery_charger_dev_s;
struct battery_charger_operations_s
@@ -167,6 +173,7 @@ struct battery_charger_dev_s
/* Fields required by the upper-half driver */
FAR const struct battery_charger_operations_s *ops; /* Battery operations */
+
sem_t batsem; /* Enforce mutually exclusive access */
/* Data fields specific to the lower-half driver may follow */
@@ -189,6 +196,7 @@ extern "C"
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
+
/****************************************************************************
* Name: battery_charger_register
*
@@ -238,10 +246,11 @@ int battery_charger_register(FAR const char *devpath,
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_BQ2425X)
struct i2c_master_s;
-FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_master_s *i2c,
- uint8_t addr,
- uint32_t frequency,
- int current);
+FAR struct battery_charger_dev_s *bq2425x_initialize(
+ FAR struct i2c_master_s *i2c,
+ uint8_t addr,
+ uint32_t frequency,
+ int current);
#endif
/****************************************************************************
@@ -287,10 +296,11 @@ FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_master_s *i2
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_BQ2429X)
struct i2c_master_s;
-FAR struct battery_charger_dev_s *bq2429x_initialize(FAR struct i2c_master_s *i2c,
- uint8_t addr,
- uint32_t frequency,
- int current);
+FAR struct battery_charger_dev_s *bq2429x_initialize(
+ FAR struct i2c_master_s *i2c,
+ uint8_t addr,
+ uint32_t frequency,
+ int current);
#endif
#undef EXTERN
diff --git a/include/nuttx/power/relay.h b/include/nuttx/power/relay.h
index 4b8fa49..ff3d8e4 100644
--- a/include/nuttx/power/relay.h
+++ b/include/nuttx/power/relay.h
@@ -50,6 +50,7 @@
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
+
/* IOCTL Commands ***********************************************************/
#define RELAYIOC_CTRL _RELAYIOC(0x0001) /* Relay control
[incubator-nuttx] 01/08: include :nuttx: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit fe4be428f51b4e4b9086a25f40e71ccc4e94d166
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 14:28:18 2021 +0100
include :nuttx: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/ascii.h | 1 +
include/nuttx/can.h | 83 ++++++++++++++++++++++++++----------------------
include/nuttx/cancelpt.h | 4 +--
include/nuttx/init.h | 2 ++
include/nuttx/mmcsd.h | 12 ++++---
include/nuttx/module.h | 3 +-
include/nuttx/page.h | 76 +++++++++++++++++++++++---------------------
include/nuttx/pgalloc.h | 2 ++
include/nuttx/progmem.h | 20 ++++++------
include/nuttx/scsi.h | 9 +++---
include/nuttx/symtab.h | 10 +++---
include/nuttx/vt100.h | 27 ++++++++++------
12 files changed, 139 insertions(+), 110 deletions(-)
diff --git a/include/nuttx/ascii.h b/include/nuttx/ascii.h
index 9cb05e1..bca433f 100644
--- a/include/nuttx/ascii.h
+++ b/include/nuttx/ascii.h
@@ -44,6 +44,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* All 7-bit ASCII codes */
#define ASCII_NUL 0x00 /* Null character (^@) */
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
index c681b32..a08ad70 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/can.h
@@ -1,8 +1,8 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/can/can.h
*
- * Copyright (C) 2008, 2009, 2011-2012, 2015-2017, 2019 Gregory Nutt. All rights
- * reserved.
+ * Copyright (C) 2008, 2009, 2011-2012, 2015-2017, 2019 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -32,14 +32,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_CAN_CAN_H
#define __INCLUDE_NUTTX_CAN_CAN_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_CAN_TXREADY
# include <nuttx/wqueue.h>
@@ -49,19 +49,21 @@
#ifdef CONFIG_NET_CAN
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/* Ioctl Commands *******************************************************************/
+/* Ioctl Commands ***********************************************************/
/* Ioctl commands supported by the upper half CAN driver.
*
* CANIOC_RTR:
- * Description: Send the remote transmission request and wait for the response.
+ * Description: Send the remote transmission request and wait for the
+ * response.
* Argument: A reference to struct canioc_rtr_s
*
- * Ioctl commands that may or may not be supported by the lower half CAN driver.
+ * Ioctl commands that may or may not be supported by the lower half CAN
+ * driver.
*
* CANIOC_ADD_STDFILTER:
* Description: Add an address filter for a standard 11 bit address.
@@ -120,7 +122,8 @@
* CANIOC_GET_CONNMODES:
* Description: Get the current bus connection modes
* Argument: A pointer to a write-able instance of struct
- * canioc_connmodes_s in which the new bus modes will be returned.
+ * canioc_connmodes_s in which the new bus modes will be
+ * returned.
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
@@ -129,7 +132,8 @@
* CANIOC_SET_CONNMODES:
* Description: Set new bus connection modes values
* Argument: A pointer to a read-able instance of struct
- * canioc_connmodes_s in which the new bus modes are provided.
+ * canioc_connmodes_s in which the new bus modes are
+ * provided.
* Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
@@ -159,29 +163,30 @@
#define CAN_NCMDS 10 /* Ten common commands */
/* User defined ioctl commands are also supported. These will be forwarded
- * by the upper-half CAN driver to the lower-half CAN driver via the co_ioctl()
- * method fo the CAN lower-half interface. However, the lower-half driver
- * must reserve a block of commands as follows in order prevent IOCTL
- * command numbers from overlapping.
+ * by the upper-half CAN driver to the lower-half CAN driver via the
+ * co_ioctl() method fo the CAN lower-half interface.
+ * However, the lower-half driver must reserve a block of commands as follows
+ * in order prevent IOCTL command numbers from overlapping.
*
- * This is generally done as follows. The first reservation for CAN driver A would
- * look like:
+ * This is generally done as follows. The first reservation for CAN driver A
+ * would look like:
*
- * CAN_A_FIRST (CAN_FIRST + CAN_NCMDS) <- First command
- * CAN_A_NCMDS 42 <- Number of commands
+ * CAN_A_FIRST (CAN_FIRST + CAN_NCMDS) <- First command
+ * CAN_A_NCMDS 42 <- Number of commands
*
- * IOCTL commands for CAN driver A would then be defined in a CAN A header file like:
+ * IOCTL commands for CAN driver A would then be defined in a CAN A header
+ * file like:
*
- * CANIOC_A_CMD1 _CANIOC(CAN_A_FIRST+0)
- * CANIOC_A_CMD2 _CANIOC(CAN_A_FIRST+1)
- * CANIOC_A_CMD3 _CANIOC(CAN_A_FIRST+2)
+ * CANIOC_A_CMD1 _CANIOC(CAN_A_FIRST+0)
+ * CANIOC_A_CMD2 _CANIOC(CAN_A_FIRST+1)
+ * CANIOC_A_CMD3 _CANIOC(CAN_A_FIRST+2)
* ...
- * CANIOC_A_CMD42 _CANIOC(CAN_A_FIRST+41)
+ * CANIOC_A_CMD42 _CANIOC(CAN_A_FIRST+41)
*
* The next reservation would look like:
*
- * CAN_B_FIRST (CAN_A_FIRST + CAN_A_NCMDS) <- Next command
- * CAN_B_NCMDS 77 <- Number of commands
+ * CAN_B_FIRST (CAN_A_FIRST + CAN_A_NCMDS) <- Next command
+ * CAN_B_NCMDS 77 <- Number of commands
*/
/* CAN payload length and DLC definitions according to ISO 11898-1 */
@@ -196,18 +201,20 @@
/* Defined bits for canfd_frame.flags
*
- * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
- * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
+ * The use of struct canfd_frame implies the Extended Data Length (EDL) bit
+ * to be set in the CAN frame bitstream on the wire. The EDL bit switch turns
* the CAN controllers bitstream processor into the CAN FD mode which creates
* two new options within the CAN FD frame specification:
*
* Bit Rate Switch - to indicate a second bitrate is/was used for the payload
- * Error State Indicator - represents the error state of the transmitting node
+ * Error State Indicator - represents the error state of the transmitting
+ * node
*
* As the CANFD_ESI bit is internally generated by the transmitting CAN
- * controller only the CANFD_BRS bit is relevant for real CAN controllers when
- * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
- * sense for virtual CAN interfaces to test applications with echoed frames.
+ * controller only the CANFD_BRS bit is relevant for real CAN controllers
+ * when building a CAN FD frame for transmission. Setting the CANFD_ESI bit
+ * can make sense for virtual CAN interfaces to test applications with echoed
+ * frames.
*/
#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
@@ -215,9 +222,9 @@
#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
typedef FAR void *CAN_HANDLE;
@@ -297,9 +304,9 @@ struct can_filter
canid_t can_mask;
};
-/************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
diff --git a/include/nuttx/cancelpt.h b/include/nuttx/cancelpt.h
index 10cd20b..e8df8ec 100644
--- a/include/nuttx/cancelpt.h
+++ b/include/nuttx/cancelpt.h
@@ -60,8 +60,8 @@
* mq_timedreceive() putmsg() sigsuspend()
*
* Each of the above function must call enter_cancellation_point() on entry
- * in order to establish the cancellation point and leave_cancellation_point()
- * on exit. These functions are described below.
+ * in order to establish the cancellation point and
+ * leave_cancellation_point() on exit. These functions are described below.
*
****************************************************************************/
diff --git a/include/nuttx/init.h b/include/nuttx/init.h
index d80fd64..696de37 100644
--- a/include/nuttx/init.h
+++ b/include/nuttx/init.h
@@ -48,6 +48,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Macros for testing which OS services are available at this phase of
* initialization.
*/
@@ -111,6 +112,7 @@ EXTERN uint8_t g_nx_initstate; /* See enum nx_initstate_e */
int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);
/* Functions contained in nx_task.c *****************************************/
+
/* OS entry point called by boot logic */
void nx_start(void) noreturn_function;
diff --git a/include/nuttx/mmcsd.h b/include/nuttx/mmcsd.h
index 684f397..985a089 100644
--- a/include/nuttx/mmcsd.h
+++ b/include/nuttx/mmcsd.h
@@ -43,7 +43,7 @@
#include <nuttx/config.h>
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
#undef EXTERN
@@ -81,9 +81,9 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev);
* Input Parameters:
* minor - The MMC/SD minor device number. The MMC/SD device will be
* registered as /dev/mmcsdN where N is the minor number
- * slotno - The slot number to use. This is only meaningful for architectures
- * that support multiple MMC/SD slots. This value must be in the range
- * {0, ..., CONFIG_MMCSD_NSLOTS}.
+ * slotno - The slot number to use. This is only meaningful for
+ * architectures that support multiple MMC/SD slots. This value must be
+ * in the range {0, ..., CONFIG_MMCSD_NSLOTS}.
* spi - And instance of an SPI interface obtained by called the
* appropriate xyz_spibus_initialize() function for the MCU "xyz" with
* the appropriate port number.
@@ -91,7 +91,9 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev);
****************************************************************************/
struct spi_dev_s; /* See nuttx/spi/spi.h */
-int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi);
+int mmcsd_spislotinitialize(int minor,
+ int slotno,
+ FAR struct spi_dev_s *spi);
#undef EXTERN
#if defined(__cplusplus)
diff --git a/include/nuttx/module.h b/include/nuttx/module.h
index 844b7be..b0b96ec 100644
--- a/include/nuttx/module.h
+++ b/include/nuttx/module.h
@@ -64,7 +64,8 @@ extern "C"
* Verify that the file is an ELF module binary and, if so, load the
* module into kernel memory and initialize it for use.
*
- * NOTE: modlib_setsymtab had to have been called in board-specific OS logic
+ * NOTE:
+ * modlib_setsymtab had to have been called in board-specific OS logic
* prior to calling this function from application logic (perhaps via
* boardctl(BOARDIOC_OS_SYMTAB). Otherwise, insmod will be unable to
* resolve symbols in the OS module.
diff --git a/include/nuttx/page.h b/include/nuttx/page.h
index 68a958a..d7f441d 100644
--- a/include/nuttx/page.h
+++ b/include/nuttx/page.h
@@ -55,6 +55,7 @@
****************************************************************************/
/* Configuration ************************************************************/
+
/* CONFIG_PAGING_PAGESIZE - The size of one managed page. This must be a
* value supported by the processor's memory management unit. The
* following may need to be extended to support additional page sizes at
@@ -96,9 +97,9 @@
* from the beginning of this region for vectors or for a page table.
* In such cases, either (1) CONFIG_PAGING_LOCKED_P/VBASE might take that
* into consideration to prevent overlapping the locked memory region
- * and the system data at the beginning of SRAM, (2) you extend CONFIG_PAGING_NLOCKED
- * include these pages at the beginning of memory and map let them be
- * mapped read-only.
+ * and the system data at the beginning of SRAM, (2) you extend
+ * CONFIG_PAGING_NLOCKED include these pages at the beginning
+ * of memory and map let them be mapped read-only.
*/
#if defined(CONFIG_PAGING_LOCKED_PBASE) && defined(CONFIG_PAGING_LOCKED_VBASE)
@@ -117,13 +118,13 @@
#endif
/* CONFIG_PAGING_NPPAGED - This is the number of physical pages available to
- * support the paged text region.
- * CONFIG_PAGING_NVPAGED - This actual size of the virtual paged text region (in
- * pages). This is also the number of virtual pages required to span
- * the entire paged region. The on-demand paging feature is intended to
- * support only the case where the virtual paged text area is much larger
- * the available physical pages. Otherwise, why would you enable on-demand
- * paging?
+ * support the paged text region.
+ * CONFIG_PAGING_NVPAGED - This actual size of the virtual paged text region
+ * (in pages). This is also the number of virtual pages required to span
+ * the entire paged region. The on-demand paging feature is intended to
+ * support only the case where the virtual paged text area is much larger
+ * the available physical pages. Otherwise, why would you enable on-demand
+ * paging?
*/
#if CONFIG_PAGING_NPPAGED >= CONFIG_PAGING_NVPAGED
@@ -201,22 +202,22 @@
#endif
/* CONFIG_PAGING_DEFPRIO - The default, minimum priority of the page fill
- * worker thread. The priority of the page fill work thread will be boosted
- * boosted dynamically so that it matches the priority of the task on behalf
- * of which it performs the fill. This defines the minimum priority that
- * will be used. Default: 50.
+ * worker thread. The priority of the page fill work thread will be
+ * boosted boosted dynamically so that it matches the priority of the
+ * task on behalf of which it performs the fill. This defines the
+ * minimum priority that will be used. Default: 50.
* CONFIG_PAGING_STACKSIZE - Defines the size of the allocated stack
* for the page fill worker thread. Default: 1024.
* CONFIG_PAGING_BLOCKINGFILL - The architecture specific up_fillpage()
* function may be blocking or non-blocking. If defined, this setting
- * indicates that the up_fillpage() implementation will block until the
- * transfer is completed. Default: Undefined (non-blocking).
- * CONFIG_PAGING_WORKPERIOD - The page fill worker thread will wake periodically
- * even if there is no mapping to do. This selection controls that wake-up
- * period (in microseconds). This wake-up a failsafe that will handle any
- * cases where a single is lost (that would really be a bug and shouldn't
- * happen!) and also supports timeouts for case of non-blocking, asynchronous
- * fills (see CONFIG_PAGING_TIMEOUT_TICKS).
+ * indicates that the up_fillpage() implementation will block until
+ * the transfer is completed. Default: Undefined (non-blocking).
+ * CONFIG_PAGING_WORKPERIOD - The page fill worker thread will wake
+ * periodically even if there is no mapping to do. This selection controls
+ * that wake-up period (in microseconds). This wake-up a failsafe that
+ * will handle any cases where a single is lost (that would really be a bug
+ * and shouldn't happen!) and also supports timeouts for case of
+ * non-blocking, asynchronous fills (see CONFIG_PAGING_TIMEOUT_TICKS).
* CONFIG_PAGING_TIMEOUT_TICKS - If defined, the implementation will monitor
* the (asynchronous) page fill logic. If the fill takes longer than this
* number if microseconds, then a fatal error will be declared.
@@ -329,9 +330,9 @@ void pg_miss(void);
* tcb - A reference to the task control block of the task that we believe
* needs to have a page fill. Architecture-specific logic can
* retrieve page fault information from the architecture-specific
- * context information in this TCB and can consult processor resources
- * (page tables or TLBs or ???) to determine if the fill still needs
- * to be performed or not.
+ * context information in this TCB and can consult processor
+ * resources (page tables or TLBs or ???) to determine if the fill
+ * still needs to be performed or not.
*
* Returned Value:
* This function will return true if the mapping is in place and false
@@ -368,11 +369,12 @@ bool up_checkmapping(FAR struct tcb_s *tcb);
* NOTE 2: If an in-use page is un-mapped, it may be necessary to flush the
* instruction cache in some architectures.
*
- * NOTE 3: Allocating and filling a page is a two step process. up_allocpage()
- * allocates the page, and up_fillpage() fills it with data from some non-
- * volatile storage device. This distinction is made because up_allocpage()
- * can probably be implemented in board-independent logic whereas up_fillpage()
- * probably must be implemented as board-specific logic.
+ * NOTE 3: Allocating and filling a page is a two step process.
+ * up_allocpage() allocates the page, and up_fillpage() fills it with data
+ * from some non- volatile storage device. This distinction is made because
+ * up_allocpage() can probably be implemented in board-independent logic
+ * whereas up_fillpage() probably must be implemented as board-specific
+ * logic.
*
* NOTE 4: The initial mapping of vpage should be read-able and write-
* able (but not cached). No special actions will be required of
@@ -412,11 +414,12 @@ int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage);
* This callback is assumed to occur from an interrupt level when the
* device driver completes the fill operation.
*
- * NOTE 1: Allocating and filling a page is a two step process. up_allocpage()
- * allocates the page, and up_fillpage() fills it with data from some non-
- * volatile storage device. This distinction is made because up_allocpage()
- * can probably be implemented in board-independent logic whereas up_fillpage()
- * probably must be implemented as board-specific logic.
+ * NOTE 1: Allocating and filling a page is a two step process.
+ * up_allocpage() allocates the page, and up_fillpage() fills it with data
+ * from some non- volatile storage device. This distinction is made because
+ * up_allocpage() can probably be implemented in board-independent logic
+ * whereas up_fillpage() probably must be implemented as board-specific
+ * logic.
*
* NOTE 2: The initial mapping of vpage will be read-able, write-able,
* but non-cacheable. No special actions will be required of
@@ -445,7 +448,8 @@ int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage);
* Assumptions:
* - This function is called from the normal tasking context (but
* interrupts siabled). The implementation must take whatever actions
- * are necessary to assure that the operation is safe within this context.
+ * are necessary to assure that the operation is safe within this
+ * context.
* - Upon return, the caller will sleep waiting for the page fill callback
* to occur. The callback function will perform the wakeup.
*
diff --git a/include/nuttx/pgalloc.h b/include/nuttx/pgalloc.h
index 30d57c5..4197f61 100644
--- a/include/nuttx/pgalloc.h
+++ b/include/nuttx/pgalloc.h
@@ -51,7 +51,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Configuration ************************************************************/
+
/* CONFIG_MM_PGALLOC - Enable page allocator support
* CONFIG_MM_PGSIZE - The page size. Must be one of {1024, 2048,
* 4096, 8192, or 16384}. This is easily extensible, but only those
diff --git a/include/nuttx/progmem.h b/include/nuttx/progmem.h
index 5eb7586..0a7f99c 100644
--- a/include/nuttx/progmem.h
+++ b/include/nuttx/progmem.h
@@ -61,7 +61,7 @@ extern "C"
#endif
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
/****************************************************************************
@@ -78,7 +78,7 @@ size_t up_progmem_neraseblocks(void);
* Name: up_progmem_isuniform
*
* Description:
- * Is program memory uniform or erase page and read/write page size differs?
+ * Is program memory uniform or erase page and read/write page size differs?
*
****************************************************************************/
@@ -98,7 +98,7 @@ size_t up_progmem_pagesize(size_t page);
* Name: up_progmem_erasesize
*
* Description:
- * Return erase block size. Must be a multiple of the read/write page size.
+ * Return erase block size. Must be a multiple of the read/write page size.
*
****************************************************************************/
@@ -111,11 +111,12 @@ size_t up_progmem_erasesize(size_t block);
* Address to read/write page conversion
*
* Input Parameters:
- * addr - Address with or without flash offset (absolute or aligned to page0)
+ * addr - Address with or without flash offset
+ * (absolute or aligned to page0)
*
* Returned Value:
- * Page or negative value on error. The following errors are reported
- * (errno is not set!):
+ * Page or negative value on error.
+ * The following errors are reported (errno is not set!):
*
* -EFAULT: On invalid address
*
@@ -149,8 +150,8 @@ size_t up_progmem_getaddress(size_t page);
* block - The erase block index to be erased.
*
* Returned Value:
- * block size or negative value on error. The following errors are reported
- * (errno is not set!):
+ * block size or negative value on error.
+ * The following errors are reported (errno is not set!):
*
* -EFAULT: On invalid page
* -EIO: On unsuccessful erase
@@ -193,7 +194,8 @@ ssize_t up_progmem_ispageerased(size_t page);
* the address be aligned inside the page boundaries.
*
* Input Parameters:
- * addr - Address with or without flash offset (absolute or aligned to page0)
+ * addr - Address with or without flash offset
+ * (absolute or aligned to page0)
* buf - Pointer to buffer
* count - Number of bytes to write
*
diff --git a/include/nuttx/scsi.h b/include/nuttx/scsi.h
index e10c7d9..5e51bcb 100644
--- a/include/nuttx/scsi.h
+++ b/include/nuttx/scsi.h
@@ -327,7 +327,7 @@
/* Illegal Request KCQ values */
#define SCSI_KCQIR_PARMLISTLENGTHERROR 0x051a00 /* Illegal Request - parm list length error */
-#define SCSI_KCQIR_INVALIDCOMMAND 0x052000 /* Illegal Request - invalid/unsupported command code */
+#define SCSI_KCQIR_INVALIDCOMMAND 0x052000 /* Illegal Request - invalid/unsupported command code */
#define SCSI_KCQIR_LBAOUTOFRANGE 0x052100 /* Illegal Request - LBA out of range */
#define SCSI_KCQIR_INVALIDFIELDINCBA 0x052400 /* Illegal Request - invalid field in CDB (Command Descriptor Block) */
#define SCSI_KCQIR_INVALIDLUN 0x052500 /* Illegal Request - invalid LUN */
@@ -475,6 +475,7 @@
#define SCSIRESP_INQUIRYFLAGS6_IUS 0x01 /* Bit 0: IUS */
/* Sense data */
+
/* Sense data response codes */
#define SCSIRESP_SENSEDATA_CURRENTFIXED 0x70 /* Byte 1 is always the response code */
@@ -705,7 +706,7 @@ struct scsiresp_inquiry_s
uint8_t version7[2]; /* 70-71: Version Descriptor 7 */
uint8_t version8[2]; /* 72-73: Version Descriptor 8 */
uint8_t reserved2[22]; /* 74-95: Reserved */
- /* 96-: Vendor-specific parameters may follow */
+ /* 96-: Vendor-specific parameters may follow */
};
#define SCSIRESP_INQUIRY_SIZEOF 36 /* Minimum size */
@@ -787,7 +788,7 @@ struct scsicmd_read6_s
uint8_t opcode; /* 0: 0x08 */
uint8_t mslba; /* 1: Bits 5-7: reserved; Bits 0-6: MS Logical Block Address (LBA) */
uint8_t lslba[2]; /* 2-3: LS Logical Block Address (LBA) */
- uint8_t xfrlen; /* 4: Transfer length (in contiguous logical blocks)*/
+ uint8_t xfrlen; /* 4: Transfer length (in contiguous logical blocks) */
uint8_t control; /* 5: Control */
};
#define SCSICMD_READ6_SIZEOF 6
@@ -994,7 +995,7 @@ struct scsicmd_verify12_s
#define SCSICMD_VERIFY12_SIZEOF 12
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
#undef EXTERN
diff --git a/include/nuttx/symtab.h b/include/nuttx/symtab.h
index e77adb8..04cfcef 100644
--- a/include/nuttx/symtab.h
+++ b/include/nuttx/symtab.h
@@ -51,7 +51,7 @@
****************************************************************************/
/* struct symbtab_s describes one entry in the symbol table. A symbol table
- * is a fixed size array of struct symtab_s. The information is intentionally
+ * is a fixed size array of struct symtab_s. The information is intentionally
* minimal and supports only:
*
* 1. Function pointers as sym_values. Of other kinds of values need to be
@@ -71,7 +71,7 @@ struct symtab_s
};
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
#undef EXTERN
@@ -123,9 +123,9 @@ symtab_findorderedbyname(FAR const struct symtab_s *symtab,
*
* Description:
* Find the symbol in the symbol table whose value closest (but not greater
- * than), the provided value. This version assumes that table is not ordered
- * with respect to symbol name and, hence, access time will be linear with
- * respect to nsyms.
+ * than), the provided value. This version assumes that table is not
+ * ordered with respect to symbol name and, hence, access time will be
+ * linear with respect to nsyms.
*
* Returned Value:
* A reference to the symbol table entry if an entry with the matching
diff --git a/include/nuttx/vt100.h b/include/nuttx/vt100.h
index 46f4c9e..f6f4e1a 100644
--- a/include/nuttx/vt100.h
+++ b/include/nuttx/vt100.h
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/vt100.h
* VT100 Escape Sequences
*
@@ -32,20 +32,20 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_VT100_H
#define __INCLUDE_NUTTX_VT100_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <nuttx/ascii.h>
-/********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ********************************************************************************************/
+ ****************************************************************************/
#define VT100_SETNL {ASCII_ESC, '[', '2', '0', 'h'} /* Set new line mode */
#define VT100_SETAPPL {ASCII_ESC, '[', '?', '1', 'h'} /* Set cursor key to application */
@@ -129,11 +129,14 @@
#define VT100_CURSORLF(n) {ASCII_ESC, '[', (n), 'D'} /* Move cursor left n lines */
#define VT100_CURSORHOME {ASCII_ESC, '[', 'H'} /* Move cursor to upper left corner */
#define VT100_CURSORHOME_ {ASCII_ESC, '[', ';', 'H'} /* Move cursor to upper left corner */
+
#define VT100_CURSORPOS(v,h) {ASCII_ESC, '[', (v), ';', (h), 'H'} /* Move cursor to screen location v,h */
#define VT100_HVHOME {ASCII_ESC, '[', 'f'} /* Move cursor to upper left corner */
#define VT100_HVHOME_ {ASCII_ESC, '[', ';', 'f'} /* Move cursor to upper left corner */
+
#define VT100_HVPOS(v,h) {ASCII_ESC, '[', (v), ';', (h), 'f'} /* Move cursor to screen location v,h */
+
#define VT100_INDEX {ASCII_ESC, 'D'} /* Move/scroll window up one line */
#define VT100_REVINDEX {ASCII_ESC, 'M'} /* Move/scroll window down one line */
#define VT100_NEXTLINE {ASCII_ESC, 'E'} /* Move to next line */
@@ -165,18 +168,22 @@
#define VT100_TERMNOK {ASCII_ESC, '[', '3', 'n'} /* Response: terminal is not OK */
#define VT100_GETCURSOR {ASCII_ESC, '[', '6', 'n'} /* Get cursor position */
+
#define VT100_CURSORPOSAT {ASCII_ESC, '[', (v), ';', (h), 'R'} /* Response: cursor is at v,h */
#define VT100_IDENT {ASCII_ESC, '[', 'c'} /* Identify what terminal type */
#define VT100_IDENT_ {ASCII_ESC, '[', '0', 'c'} /* Identify what terminal type */
+
#define VT100_GETTYPE {ASCII_ESC, '[', '?', '1', ';', (n), '0', 'c'} /* Response: terminal type code n */
#define VT100_RESET RIS {ASCII_ESC, 'c'} /* Reset terminal to initial state */
#define VT100_ALIGN {ASCII_ESC, '#', '8'} /* Screen alignment display */
+
#define VT100_TESTPU {ASCII_ESC, '[', '2', ';', '1', 'y'} /* Confidence power up test */
#define VT100_TESTLB {ASCII_ESC, '[', '2', ';', '2', 'y'} /* Confidence loopback test */
#define VT100_TESTPUREP {ASCII_ESC, '[', '2', ';', '9', 'y'} /* Repeat power up test */
+
#define VT100_TESTLBREP {ASCII_ESC, '[', '2', ';', '1', '0', 'y'} /* Repeat loopback test */
#define VT100_LEDSOFF {ASCII_ESC, '[', '0', 'q'} /* Turn off all four leds */
@@ -288,12 +295,12 @@
#define VT100_NUMERIC_ENTER {ASCII_CR}
#define VT100_ALT_ENTER {ASCII_ESC, 'O', 'M'}
-/********************************************************************************************
+/****************************************************************************
* Public Data
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
#endif /* __INCLUDE_NUTTX_VT100_H */
[incubator-nuttx] 08/08: include: nuttx: usb: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit b288986ccdc94f6af1c512b2d5aaa3287ddabdb1
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 19:21:44 2021 +0100
include: nuttx: usb: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/usb/audio.h | 148 ++++-----
include/nuttx/usb/cdcecm.h | 22 +-
include/nuttx/usb/composite.h | 8 +-
include/nuttx/usb/dfu.h | 10 +-
include/nuttx/usb/ehci.h | 235 ++++++++++----
include/nuttx/usb/fusb301.h | 10 +-
include/nuttx/usb/fusb303.h | 15 +
include/nuttx/usb/hid.h | 18 +-
include/nuttx/usb/hub.h | 16 +-
include/nuttx/usb/max3421e.h | 5 +-
include/nuttx/usb/ohci.h | 15 +-
include/nuttx/usb/pl2303.h | 33 +-
include/nuttx/usb/rndis.h | 39 +--
include/nuttx/usb/storage.h | 26 +-
include/nuttx/usb/usb.h | 73 +++--
include/nuttx/usb/usbdev.h | 106 ++++---
include/nuttx/usb/usbdev_trace.h | 17 +-
include/nuttx/usb/usbhost.h | 605 +++++++++++++++++++-----------------
include/nuttx/usb/usbhost_devaddr.h | 8 +-
include/nuttx/usb/usbhost_trace.h | 8 +-
include/nuttx/usb/usbmsc.h | 17 +-
21 files changed, 822 insertions(+), 612 deletions(-)
diff --git a/include/nuttx/usb/audio.h b/include/nuttx/usb/audio.h
index d7f695b..25fca69 100644
--- a/include/nuttx/usb/audio.h
+++ b/include/nuttx/usb/audio.h
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/usb/audio.h
* Audio Device Class (ADC) definitions
*
@@ -42,29 +42,31 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_AUDIO_H
#define __INCLUDE_NUTTX_USB_AUDIO_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/usb/usb.h>
-/********************************************************************************************
+/****************************************************************************
* Preprocessor definitions
- ********************************************************************************************/
+ ****************************************************************************/
+
/* Device Descriptor
*
- * Because audio functionality is always considered to reside at the interface level, this
- * class specification does not define a specific audio device descriptor. For both composite
- * devices and audio-only devices, the device descriptor must indicate that class information
- * is to be found at the interface level. Therefore, the bDeviceClass, bDeviceSubClass and
- * bDeviceProtocol fields of the device descriptor must contain the values 0xef, 0x02, and
- * 0x01 respectively.
+ * Because audio functionality is always considered to reside at the
+ * interface level, this class specification does not define a specific audio
+ * device descriptor. For both composite devices and audio-only devices, the
+ * device descriptor must indicate that class information is to be found at
+ * the interface level. Therefore, the bDeviceClass, bDeviceSubClass and
+ * bDeviceProtocol fields of the device descriptor must contain the values
+ * 0xef, 0x02, and 0x01 respectively.
*/
#define ADC_DEVICE_CLASS USB_CLASS_MISC
@@ -470,22 +472,23 @@
/* Encoder Error Codes */
- /* <0: Reserved for vendor extensions */
-#define ADC_ENCODER_SUCCESS 0 /* No Error */
-#define ADC_ENCODER_ERROR_NOMEM 1 /* Out of Memory */
-#define ADC_ENCODER_ERROR_BW 2 /* Out of Bandwidth */
-#define ADC_ENCODER_ERROR_CYCLE 3 /* Out of Processing Cycles */
-#define ADC_ENCODER_ERROR_FRAME 4 /* General Format Frame Error */
-#define ADC_ENCODER_ERROR_TOOSMALL 5 /* Format Frame Too Small */
-#define ADC_ENCODER_ERROR_TOOBIG 6 /* Format Frame Too Large */
-#define ADC_ENCODER_ERROR_BADFORMAT 7 /* Bad Data Format */
-#define ADC_ENCODER_ERROR_NCHAN 8 /* Incorrect Number of Channels */
-#define ADC_ENCODER_ERROR_RATE 9 /* Incorrect Sampling Rate */
-#define ADC_ENCODER_ERROR_BITRATE 10 /* Unable to Meet Target Bitrate */
-#define ADC_ENCODER_ERROR_PARMS 11 /* Inconsistent Set of Parameters */
-#define ADC_ENCODER_ERROR_NOTREADY 12 /* Not Ready */
-#define ADC_ENCODER_ERROR_BUSY 13 /* Busy */
- /* >13: Reserved */
+ /* <0: Reserved for vendor extensions */
+
+#define ADC_ENCODER_SUCCESS 0 /* No Error */
+#define ADC_ENCODER_ERROR_NOMEM 1 /* Out of Memory */
+#define ADC_ENCODER_ERROR_BW 2 /* Out of Bandwidth */
+#define ADC_ENCODER_ERROR_CYCLE 3 /* Out of Processing Cycles */
+#define ADC_ENCODER_ERROR_FRAME 4 /* General Format Frame Error */
+#define ADC_ENCODER_ERROR_TOOSMALL 5 /* Format Frame Too Small */
+#define ADC_ENCODER_ERROR_TOOBIG 6 /* Format Frame Too Large */
+#define ADC_ENCODER_ERROR_BADFORMAT 7 /* Bad Data Format */
+#define ADC_ENCODER_ERROR_NCHAN 8 /* Incorrect Number of Channels */
+#define ADC_ENCODER_ERROR_RATE 9 /* Incorrect Sampling Rate */
+#define ADC_ENCODER_ERROR_BITRATE 10 /* Unable to Meet Target Bitrate */
+#define ADC_ENCODER_ERROR_PARMS 11 /* Inconsistent Set of Parameters */
+#define ADC_ENCODER_ERROR_NOTREADY 12 /* Not Ready */
+#define ADC_ENCODER_ERROR_BUSY 13 /* Busy */
+ /* >13: Reserved */
/* Format Type Codes */
@@ -517,7 +520,6 @@
/* Audio Data Format Type III Bit Allocations */
-
#define ADC_FORMAT_TYPEIII_IEC61937_AC3 (1 << 0)
#define ADC_FORMAT_TYPEIII_IEC61937_MPEG1_L1 (1 << 1)
#define ADC_FORMAT_TYPEIII_IEC61937_MPEG1_L2_3 (1 << 1)
@@ -649,9 +651,10 @@
#define ADC_EMBEDTERM_PERCUSSON 0x0716 /* Percussion Instrument */
#define ADC_EMBEDTERM_INSTRUMENT 0x0717 /* Other Musical Instrument */
-/********************************************************************************************
+/****************************************************************************
* Public Types
- ********************************************************************************************/
+ ****************************************************************************/
+
/* Audio Channel Cluster Descriptor */
struct adc_cluster_desc_s
@@ -666,7 +669,7 @@ struct adc_cluster_desc_s
struct adc_ac_ifdesc_s
{
- uint8_t ac_len; /* 0: Descriptor length (9)*/
+ uint8_t ac_len; /* 0: Descriptor length (9) */
uint8_t ac_type; /* 1: Descriptor type (ADC_CS_INTERFACE) */
uint8_t ac_subtype; /* 2: Descriptor sub-type (ADC_AC_HEADER) */
uint8_t ac_adc[2]; /* 3: ADC spec version in BCD */
@@ -680,7 +683,7 @@ struct adc_ac_ifdesc_s
struct adc_clksrc_desc_s
{
- uint8_t cs_len; /* 0: Descriptor length (8)*/
+ uint8_t cs_len; /* 0: Descriptor length (8) */
uint8_t cs_type; /* 1: Descriptor type (ADC_CS_INTERFACE) */
uint8_t cs_subtype; /* 2: Descriptor sub-type (ADC_AC_CLOCK_SOURCE) */
uint8_t cs_clockid; /* 3: Identifies clock source entity */
@@ -695,7 +698,7 @@ struct adc_clksrc_desc_s
struct adc_clksel_desc_s
{
- uint8_t cl_len; /* 0: Descriptor length (7+npins)*/
+ uint8_t cl_len; /* 0: Descriptor length (7+npins) */
uint8_t cl_type; /* 1: Descriptor type (ADC_CS_INTERFACE) */
uint8_t cl_subtype; /* 2: Descriptor sub-type (ADC_AC_CLOCK_SELECTOR) */
uint8_t cl_clockid; /* 3: Identifies clock source entity */
@@ -723,7 +726,7 @@ struct adc_clkmult_desc_s
uint8_t cm_clockid; /* 3: Identifies clock source entity */
uint8_t cm_csrcid; /* 4: ID of clock input to list pin n */
uint8_t cm_controls; /* 5: Bits 0-1: Clock numerator control,
- * Bits 2-3: Clock denominator control */
+ * Bits 2-3: Clock denominator control */
uint8_t cm_clkmult; /* 6: Index of clock multiplier name string */
};
#define USB_SIZEOF_ADC_CLKMULT_DESC 7
@@ -779,7 +782,7 @@ struct adc_outterm_desc_s
struct adc_mixerunit_desc_s
{
- uint8_t mu_len; /* 0: Descriptor length (13+npins+nchan)*/
+ uint8_t mu_len; /* 0: Descriptor length (13+npins+nchan) */
uint8_t mu_type; /* 1: Descriptor type (ADC_CS_INTERFACE) */
uint8_t mu_subtype; /* 2: Descriptor sub-type (ADC_AC_MIXER_UNIT) */
uint8_t mu_unitid; /* 3: Identifies unit in audio function */
@@ -1105,7 +1108,7 @@ struct adc_extunit_desc_s
struct adc_as_ifdesc_s
{
- uint8_t as_len; /* 0: Descriptor length (9)*/
+ uint8_t as_len; /* 0: Descriptor length (9) */
uint8_t as_type; /* 1: Descriptor type (ADC_CS_INTERFACE) */
uint8_t as_subtype; /* 2: Descriptor sub-type (ADC_AS_GENERAL) */
uint8_t as_terminal; /* 3: ID of connected terminal */
@@ -1314,7 +1317,8 @@ struct adc_audio_epdesc_s
struct adc_l1_curparm_s
{
- uint8_t l1_cur; /* 0: Setting of the CUR attribute of the addressed control */
+ uint8_t l1_cur; /* 0: Setting of the CUR attribute of the
+ * addressed control */
};
#define USB_SIZEOF_ADC_LI_CURPARM 1
@@ -1323,15 +1327,15 @@ struct adc_l1_curparm_s
begin_packed_struct struct adc_l1_subrange_s
{
- uint8_t l1_min; /* 0: MIN attribute */
- uint8_t l1_max; /* 1: MAX attribute */
- uint8_t l1_res; /* 2: RES attribute */
+ uint8_t l1_min; /* 0: MIN attribute */
+ uint8_t l1_max; /* 1: MAX attribute */
+ uint8_t l1_res; /* 2: RES attribute */
} end_packed_struct;
begin_packed_struct struct adc_l1_rangeparm_s
{
- uint8_t l1_nranges; /* 0: Number of sub-ranges */
- struct adc_l1_subrange_s l1_subrange[1];
+ uint8_t l1_nranges; /* 0: Number of sub-ranges */
+ struct adc_l1_subrange_s l1_subrange[1];
} end_packed_struct;
#define USB_SIZEOF_ADC_LI_RANGEPARM(nranges) (1+3*(nranges))
@@ -1340,7 +1344,7 @@ begin_packed_struct struct adc_l1_rangeparm_s
struct adc_l2_curparm_s
{
- uint8_t l2_cur[2]; /* 0: Setting of the CUR attribute of the addressed control */
+ uint8_t l2_cur[2]; /* 0: Setting of the CUR attribute of the addressed control */
};
#define USB_SIZEOF_ADC_L2_CURPARM 2
@@ -1349,15 +1353,15 @@ struct adc_l2_curparm_s
struct adc_l2_subrange_s
{
- uint8_t l2_min[2]; /* 0: MIN attribute */
- uint8_t l2_max[2]; /* 2: MAX attribute */
- uint8_t l2_res[2]; /* 4: RES attribute */
+ uint8_t l2_min[2]; /* 0: MIN attribute */
+ uint8_t l2_max[2]; /* 2: MAX attribute */
+ uint8_t l2_res[2]; /* 4: RES attribute */
};
struct adc_l2_rangeparm_s
{
- uint8_t l2_nranges[2]; /* 0: Number of sub-ranges */
- struct adc_l2_subrange_s l2_subrange[1];
+ uint8_t l2_nranges[2]; /* 0: Number of sub-ranges */
+ struct adc_l2_subrange_s l2_subrange[1];
};
#define USB_SIZEOF_ADC_L2_RANGEPARM(nranges) (2+6*(nranges))
@@ -1366,7 +1370,7 @@ struct adc_l2_rangeparm_s
struct adc_l3_curparm_s
{
- uint8_t l3_cur[4]; /* 0: Setting of the CUR attribute of the addressed control */
+ uint8_t l3_cur[4]; /* 0: Setting of the CUR attribute of the addressed control */
};
#define USB_SIZEOF_ADC_L3_CURPARM 4
@@ -1375,15 +1379,15 @@ struct adc_l3_curparm_s
struct adc_l3_subrange_s
{
- uint8_t l3_min[4]; /* 0: MIN attribute */
- uint8_t l3_max[4]; /* 2: MAX attribute */
- uint8_t l3_res[4]; /* 4: RES attribute */
+ uint8_t l3_min[4]; /* 0: MIN attribute */
+ uint8_t l3_max[4]; /* 2: MAX attribute */
+ uint8_t l3_res[4]; /* 4: RES attribute */
};
struct adc_l3_rangeparm_s
{
- uint8_t l3_nranges[2]; /* 0: Number of sub-ranges */
- struct adc_l3_subrange_s l3_subrange[1];
+ uint8_t l3_nranges[2]; /* 0: Number of sub-ranges */
+ struct adc_l3_subrange_s l3_subrange[1];
};
#define USB_SIZEOF_ADC_L3_RANGEPARM(nranges) (2+12*(nranges))
@@ -1424,15 +1428,15 @@ struct adc_equalizer_curparm_s
begin_packed_struct struct adc_eq_subrange_s
{
- uint8_t eq_min; /* 0: MIN attribute */
- uint8_t eq_max; /* 1: MAX attribute */
- uint8_t eq_res; /* 2: RES attribute */
+ uint8_t eq_min; /* 0: MIN attribute */
+ uint8_t eq_max; /* 1: MAX attribute */
+ uint8_t eq_res; /* 2: RES attribute */
} end_packed_struct;
begin_packed_struct struct adc_equalizer_rangeparm_s
{
- uint8_t eq_nranges; /* 0: Number of sub-ranges */
- struct adc_eq_subrange_s eq_subrange[1];
+ uint8_t eq_nranges; /* 0: Number of sub-ranges */
+ struct adc_eq_subrange_s eq_subrange[1];
} end_packed_struct;
#define USB_SIZEOF_ADC_EQUALIZER_RANGEPARM(nranges) (1+3*(nranges))
@@ -1451,23 +1455,23 @@ struct adc_altsettings_curparm_s
struct adc_hilo_curparm_s
{
- uint8_t hl_lo; /* 0: CUR value of the low level scaling control */
- uint8_t hl_hi; /* 0: CUR value of the high level scaling control */
+ uint8_t hl_lo; /* 0: CUR value of the low level scaling control */
+ uint8_t hl_hi; /* 0: CUR value of the high level scaling control */
};
/* High/Low Scaling Control RANGE Parameter Block */
begin_packed_struct struct adc_hl_subrange_s
{
- uint8_t hl_min; /* 0: MIN attribute */
- uint8_t hl_max; /* 1: MAX attribute */
- uint8_t hl_res; /* 2: RES attribute */
+ uint8_t hl_min; /* 0: MIN attribute */
+ uint8_t hl_max; /* 1: MAX attribute */
+ uint8_t hl_res; /* 2: RES attribute */
} end_packed_struct;
begin_packed_struct struct adc_hilo_rangeparm_s
{
- uint8_t hl_nranges[2]; /* 0: Number of sub-ranges */
- struct adc_hl_subrange_s hl_subrange[1];
+ uint8_t hl_nranges[2]; /* 0: Number of sub-ranges */
+ struct adc_hl_subrange_s hl_subrange[1];
} end_packed_struct;
#define USB_SIZEOF_ADC_HILO_RANGEPARM(nranges) (2+3*(nranges))
@@ -1510,7 +1514,7 @@ struct adc_t2_format_desc_s
uint8_t t2_subtype; /* 2: Descriptor sub-type (ADC_AS_FORMAT_TYPE) */
uint8_t t2_fmttype; /* 3: Identifies the format type (ADC_FORMAT_TYPEII) */
uint8_t t2_bitrate[2]; /* 4 Maximum number of bits per second */
- uint8_t t2_slotsperframe[2]; /* 6: Number of PCM audio slots in one encoded audio frame*/
+ uint8_t t2_slotsperframe[2]; /* 6: Number of PCM audio slots in one encoded audio frame */
};
#define USB_SIZEOF_ADC_T2_FORMAT_DESC 8
@@ -1567,7 +1571,7 @@ struct adc_x2_format_desc_s
uint8_t x2_subtype; /* 2: Descriptor sub-type (ADC_AS_FORMAT_TYPE) */
uint8_t x2_fmttype; /* 3: Identifies the format type (ADC_FORMAT_TYPEII) */
uint8_t x2_bitrate[2]; /* 4 Maximum number of bits per second */
- uint8_t x2_samperframe[2]; /* 6: Number of PCM audio samples in one encoded audio frame*/
+ uint8_t x2_samperframe[2]; /* 6: Number of PCM audio samples in one encoded audio frame */
uint8_t x2_hdrlen; /* 8: Size of packet header (in bytes) */
uint8_t x2_sbproto; /* 9: Sideband protocol used in packet header and ctrl channel */
};
@@ -1590,7 +1594,7 @@ struct adc_x3_format_desc_s
#define USB_SIZEOF_ADC_X3_FORMAT_DESC 8
-/* Hi-Res Presentation TimeStamp Layout*/
+/* Hi-Res Presentation TimeStamp Layout */
struct adc_hires_timestamp_s
{
@@ -1598,9 +1602,9 @@ struct adc_hires_timestamp_s
uint8_t hr_nsec[8]; /* Offset in nanoseconds from the beginning of the stream */
};
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
diff --git a/include/nuttx/usb/cdcecm.h b/include/nuttx/usb/cdcecm.h
index e398fd5..7c93bf4 100644
--- a/include/nuttx/usb/cdcecm.h
+++ b/include/nuttx/usb/cdcecm.h
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/****************************************************************************
* include/nuttx/usb/cdcecm.h
*
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
@@ -31,14 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ******************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_CDCECM_H
#define __INCLUDE_NUTTX_USB_CDCECM_H
-/******************************************************************************
+/****************************************************************************
* Included Files
- ******************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -54,9 +54,9 @@
#define CDCECM_EP_BULKIN_IDX (1)
#define CDCECM_EP_BULKOUT_IDX (2)
-/******************************************************************************
+/****************************************************************************
* Public Data
- ******************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -67,16 +67,16 @@ extern "C"
# define EXTERN extern
#endif
-/******************************************************************************
- * Public Functions
- ******************************************************************************/
+/****************************************************************************
+ * Public Functions Definitions
+ ****************************************************************************/
/****************************************************************************
* Name: cdcecm_initialize
*
* Description:
- * Register CDC/ECM USB device interface. Register the corresponding network
- * driver to NuttX and bring up the network.
+ * Register CDC/ECM USB device interface. Register the corresponding
+ * network driver to NuttX and bring up the network.
*
* Input Parameters:
* minor - Device minor number.
diff --git a/include/nuttx/usb/composite.h b/include/nuttx/usb/composite.h
index ada5398..0ba2131 100644
--- a/include/nuttx/usb/composite.h
+++ b/include/nuttx/usb/composite.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/composite.h
*
* Copyright (C) 2008-2011, 2015, 2017 Gregory Nutt. All rights reserved.
@@ -50,6 +50,7 @@
****************************************************************************/
/* Configuration ************************************************************/
+
/* CONFIG_USBDEV_COMPOSITE
* Enables USB composite device support
*/
@@ -83,7 +84,7 @@ extern "C"
struct composite_devdesc_s;
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
/****************************************************************************
@@ -120,7 +121,8 @@ FAR void *composite_initialize(uint8_t ndevices,
* class objects for each of the members of the composite.
*
* Input Parameters:
- * handle - The handle returned by a previous call to composite_initialize().
+ * handle - The handle returned by a previous call to
+ * composite_initialize().
*
* Returned Value:
* None
diff --git a/include/nuttx/usb/dfu.h b/include/nuttx/usb/dfu.h
index b9c445d..e7c0eb6 100644
--- a/include/nuttx/usb/dfu.h
+++ b/include/nuttx/usb/dfu.h
@@ -36,16 +36,16 @@
#ifndef __INCLUDE_NUTTX_USB_DFU_H
#define __INCLUDE_NUTTX_USB_DFU_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/usb/usbdev.h>
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Defintions
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
diff --git a/include/nuttx/usb/ehci.h b/include/nuttx/usb/ehci.h
index c41240e..9b55316 100644
--- a/include/nuttx/usb/ehci.h
+++ b/include/nuttx/usb/ehci.h
@@ -1,12 +1,12 @@
-/********************************************************************************************
+/****************************************************************************
* include/nuttx/usb/ehci.h
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* References:
- * "Enhanced Host Controller Interface Specification for Universal Serial
- * Bus" Rev 1.0, March 12, 2002, Intel Corporation.
+ * "Enhanced Host Controller Interface Specification for Universal
+ * Serial Bus" Rev 1.0, March 12, 2002, Intel Corporation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,23 +35,25 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_EHCI_H
#define __INCLUDE_NUTTX_USB_EHCI_H
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <stdint.h>
-/********************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ********************************************************************************************/
-/* General definitions **********************************************************************/
-/* Endpoint speed values as used in endpoint characteristics field. NOTE: These values
- * are *NOT* the same as the SPEED definitions in usb.h.
+ ****************************************************************************/
+
+/* General definitions ******************************************************/
+
+/* Endpoint speed values as used in endpoint characteristics field.
+ * NOTE: These values are *NOT* the same as the SPEED definitions in usb.h.
*/
#define EHCI_FULL_SPEED (0) /* Full-Speed (12Mbs) */
@@ -61,7 +63,8 @@
#define EHCI_DIR_IN (1) /* Direction IN: Peripheral to host */
#define EHCI_DIR_OUT (0) /* Direction OUT: Host to peripheral */
-/* PCI Configuration Space Register Offsets *************************************************/
+/* PCI Configuration Space Register Offsets *********************************/
+
/* Paragraph 2.1 */
/* 0x0009-0x000b: Class Code */
@@ -94,7 +97,8 @@
#define EHCI_PCI_USBLEGCTLSTS_OFFSET 0x0004
-/* Host Controller Capability Register Offsets **********************************************/
+/* Host Controller Capability Register Offsets ******************************/
+
/* Paragraph 2.2 */
#define EHCI_CAPLENGTH_OFFSET 0x0000 /* Core Capability Register Length */
@@ -104,7 +108,8 @@
#define EHCI_HCCPARAMS_OFFSET 0x0008 /* Core Capability Parameters */
#define EHCI_HCSP_PORTROUTE_OFFSET 0x000c /* Core Companion Port Route Description */
-/* Host Controller Operational Register Offsets *********************************************/
+/* Host Controller Operational Register Offsets *****************************/
+
/* Paragraph 2.3 */
#define EHCI_USBCMD_OFFSET 0x0000 /* USB Command */
@@ -136,7 +141,8 @@
#define EHCI_PORTSC14_OFFSET 0x0078 /* Port Status/Control, Port 14 */
#define EHCI_PORTSC15_OFFSET 0x007c /* Port Status/Control, Port 15 */
-/* Debug Register Offsets *******************************************************************/
+/* Debug Register Offsets ***************************************************/
+
/* Paragraph C.3 */
#define EHCI_DEBUG_PCS_OFFSET 0x0000 /* Debug Port Control/Status Register */
@@ -145,7 +151,7 @@
#define EHCI_DEBUG_DATA1_OFFSET 0x000c /* Debug Data Buffer 1 Register [63:32] */
#define EHCI_DEBUG_DEVADDR_OFFSET 0x0010 /* Debug Device Address Register */
-/* PCI Configuration Space Register Bit Definitions *****************************************/
+/* PCI Configuration Space Register Bit Definitions *************************/
/* 0x0009-0x000b: Class Code. Paragraph 2.1.2 */
@@ -163,11 +169,14 @@
/* 0x0010-0x0013: Base Address to Memory-mapped Host Controller Register
* Space. Paragraph 2.1.3
*/
+
/* Bit 0: Reserved */
+
#define EHCI_PCIUSBBASE_TYPE_SHIFT (0) /* Bits 1-2: Type */
#define EHCI_PCIUSBBASE_TYPE_MASK (3 << EHCI_PCIUSBBASE_TYPE_SHIFT)
# define EHCI_PCIUSBBASE_TYPE_32BIT (3 << EHCI_PCIUSBBASE_TYPE_SHIFT) /* 32-bit addressing */
# define EHCI_PCIUSBBASE_TYPE_64BIT (3 << EHCI_PCIUSBBASE_TYPE_SHIFT) /* 64-bit addressing */
+
/* Bits 3-7: Reserved */
#define EHCI_PCIUSBBASE_BASE_SHIFT (8) /* Bits 8-31: Base address */
#define EHCI_PCIUSBBASE_BASE_MASK (0xffffff00)
@@ -182,11 +191,15 @@
#define EHCI_PCI_FLADJ_MASK (0x3f >> EHCI_PCI_FLADJ_SHIFT)
/* Bits 6-7: Reserved */
-/* 0x0062-0x0063: Port wake capabilities register (OPTIONAL). Paragraph 2.1.6 */
+/* 0x0062-0x0063: Port wake capabilities register (OPTIONAL).
+ * Paragraph 2.1.6
+ */
#define EHCI_PCI_PORTWAKECAP_MASK (0xffff)
-/* EECP+0x0000: USB Legacy Support EHCI Extended Capability Register. Paragraph 2.1.7 */
+/* EECP+0x0000: USB Legacy Support EHCI Extended Capability Register.
+ * Paragraph 2.1.7
+ */
#define EHCI_PCI_USBLEGSUP_CAPID_SHIFT (0) /* Bits 0-7 Capability ID */
#define EHCI_PCI_USBLEGSUP_CAPID_MASK (0xff << EHCI_PCI_USBLEGSUP_CAPID_SHIFT)
@@ -197,7 +210,9 @@
#define EHCI_PCI_USBLEGSUP_OSOWN (1 << 24) /* Bit 24: HC OS Owned Semaphore */
/* Bits 25-31: Reserved */
-/* EECP+0x0000: USB Legacy Support Control and Status Register. Paragraph 2.1.8 */
+/* EECP+0x0000: USB Legacy Support Control and Status Register.
+ * Paragraph 2.1.8
+ */
#define EHCI_PCI_USBLEGCTLSTS_USBCMPEN (1 << 0) /* Bit 0: USB SMI Enable */
#define EHCI_PCI_USBLEGCTLSTS_USBERREN (1 << 1) /* Bit 1: SMI on USB Error Enable */
@@ -220,11 +235,14 @@
#define EHCI_PCI_USBLEGCTLSTS_PC (1 << 30) /* Bit 30: SMI on PCI Command */
#define EHCI_PCI_USBLEGCTLSTS_BAR (1 << 31) /* Bit 31: SMI on BAR */
-/* Host Controller Capability Register Bit Definitions ***************************************/
+/* Host Controller Capability Register Bit Definitions **********************/
+
/* Paragraph 2.2 */
/* Core Capability Register Length. Paragraph 2.2.1. 8-bit length. */
+
/* Core Interface Version Number. Paragraph 2.2.2. Two byte BCD encoding */
+
/* Core Structural Parameters. Paragraph 2.2.3 */
#define EHCI_HCSPARAMS_NPORTS_SHIFT (0) /* Bit 0-3: Number of physical downstream ports */
@@ -254,9 +272,12 @@
#define EHCI_HCCPARAMS_EECP_MASK (0xff << EHCI_HCCPARAMS_EECP_SHIFT)
/* Bits 16-31: Reserved */
-/* Core Companion Port Route Description. Paragraph 2.2.5. 15 x 4-bit array (60 bits) */
+/* Core Companion Port Route Description.
+ * Paragraph 2.2.5. 15 x 4-bit array (60 bits)
+ */
+
+/* Host Controller Operational Register Bit Definitions *********************/
-/* Host Controller Operational Register Bit Definitions *************************************/
/* Paragraph 2.3 */
/* USB Command. Paragraph 2.3.1 */
@@ -268,6 +289,7 @@
# define EHCI_USBCMD_FLSIZE_1024 (0 << EHCI_USBCMD_FLSIZE_SHIFT) /* 1024 elements (4096 bytes) */
# define EHCI_USBCMD_FLSIZE_512 (1 << EHCI_USBCMD_FLSIZE_SHIFT) /* 512 elements (2048 bytes) */
# define EHCI_USBCMD_FLSIZE_256 (2 << EHCI_USBCMD_FLSIZE_SHIFT) /* 256 elements (1024 bytes) */
+
#define EHCI_USBCMD_PSEN (1 << 4) /* Bit 4: Periodic Schedule Enable */
#define EHCI_USBCMD_ASEN (1 << 5) /* Bit 5: Asynchronous Schedule Enable */
#define EHCI_USBCMD_IAADB (1 << 6) /* Bit 6: Interrupt on Async Advance Doorbell */
@@ -286,9 +308,11 @@
# define EHCI_USBCMD_ITHRE_16MF (0x10 << EHCI_USBCMD_ITHRE_SHIFT) /* 16 micro-frames (2 ms) */
# define EHCI_USBCMD_ITHRE_32MF (0x20 << EHCI_USBCMD_ITHRE_SHIFT) /* 32 micro-frames (4 ms) */
# define EHCI_USBCMD_ITHRE_64MF (0x40 << EHCI_USBCMD_ITHRE_SHIFT) /* 64 micro-frames (8 ms) */
+
/* Bits 24-31: Reserved */
/* USB Status. Paragraph 2.3.2 */
+
/* USB Interrupt Enable. Paragraph 2.3.3 */
#define EHCI_INT_USBINT (1 << 0) /* Bit 0: USB Interrupt */
@@ -310,7 +334,10 @@
#define EHCI_FRINDEX_MASK (0x1fff) /* Bits 0-13: Frame index */
/* Bits 14-31: Reserved */
-/* 4G Segment Selector. Paragraph 2.3.5, Bits[64:32] of data structure addresses */
+/* 4G Segment Selector.
+ * Paragraph 2.3.5, Bits[64:32] of data structure addresses
+ */
+
/* Frame List Base Address. Paragraph 2.3.6 */
/* Bits 0-11: Reserved */
@@ -323,8 +350,8 @@
/* Configured Flag Register. Paragraph 2.3.8 */
-#define EHCI_CONFIGFLAG (1 << 0) /* Bit 0: Configure Flag */
- /* Bits 1-31: Reserved */
+#define EHCI_CONFIGFLAG (1 << 0) /* Bit 0: Configure Flag */
+ /* Bits 1-31: Reserved */
/* Port Status/Control, Port 1-n. Paragraph 2.3.9 */
@@ -343,6 +370,7 @@
# define EHCI_PORTSC_LSTATUS_SE0 (0 << EHCI_PORTSC_LSTATUS_SHIFT) /* SE0 Not Low-speed device, perform EHCI reset */
# define EHCI_PORTSC_LSTATUS_KSTATE (1 << EHCI_PORTSC_LSTATUS_SHIFT) /* K-state Low-speed device, release ownership of port */
# define EHCI_PORTSC_LSTATUS_JSTATE (2 << EHCI_PORTSC_LSTATUS_SHIFT) /* J-state Not Low-speed device, perform EHCI reset */
+
#define EHCI_PORTSC_PP (1 << 12) /* Bit 12: Port Power */
#define EHCI_PORTSC_OWNER (1 << 13) /* Bit 13: Port Owner */
#define EHCI_PORTSC_PIC_SHIFT (14) /* Bits 14-15: Port Indicator Control */
@@ -350,6 +378,7 @@
# define EHCI_PORTSC_PIC_OFF (0 << EHCI_PORTSC_PIC_SHIFT) /* Port indicators are off */
# define EHCI_PORTSC_PIC_AMBER (1 << EHCI_PORTSC_PIC_SHIFT) /* Amber */
# define EHCI_PORTSC_PIC_GREEN (2 << EHCI_PORTSC_PIC_SHIFT) /* Green */
+
#define EHCI_PORTSC_PTC_SHIFT (16) /* Bits 16-19: Port Test Control */
#define EHCI_PORTSC_PTC_MASK (15 << EHCI_PORTSC_PTC_SHIFT)
# define EHCI_PORTSC_PTC_DISABLED (0 << EHCI_PORTSC_PTC_SHIFT) /* Test mode not enabled */
@@ -358,6 +387,7 @@
# define EHCI_PORTSC_PTC_SE0NAK (3 << EHCI_PORTSC_PTC_SHIFT) /* Test SE0_NAK */
# define EHCI_PORTSC_PTC_PACKET (4 << EHCI_PORTSC_PTC_SHIFT) /* Test Packet */
# define EHCI_PORTSC_PTC_ENABLE (5 << EHCI_PORTSC_PTC_SHIFT) /* Test FORCE_ENABLE */
+
#define EHCI_PORTSC_WKCCNTE (1 << 20) /* Bit 20: Wake on Connect Enable */
#define EHCI_PORTSC_WKDSCNNTE (1 << 21) /* Bit 21: Wake on Disconnect Enable */
#define EHCI_PORTSC_WKOCE (1 << 22) /* Bit 22: Wake on Over-current Enable */
@@ -366,7 +396,7 @@
#define EHCI_PORTSC_ALLINTS (EHCI_PORTSC_CSC | EHCI_PORTSC_PEC | \
EHCI_PORTSC_OCC | EHCI_PORTSC_RESUME)
-/* Debug Register Bit Definitions ***********************************************************/
+/* Debug Register Bit Definitions *******************************************/
/* Debug Port Control/Status Register. Paragraph C.3.1 */
@@ -396,7 +426,9 @@
#define EHCI_DEBUG_USBPIDS_RPID_MASK (0xff << EHCI_DEBUG_USBPIDS_RPID_SHIFT)
/* Bits 24-31: Reserved */
-/* Debug Data Buffer 0/1 Register [64:0]. Paragreph C.3.3. 64 bits of data. */
+/* Debug Data Buffer 0/1 Register [64:0].
+ * Paragreph C.3.3. 64 bits of data.
+ */
/* Debug Device Address Register. Paragraph C.3.4 */
@@ -407,7 +439,8 @@
#define EHCI_DEBUG_DEVADDR_ADDR_MASK (0x7f << EHCI_DEBUG_DEVADDR_ADDR_SHIFT)
/* Bits 15-31: Reserved */
-/* Data Structures **************************************************************************/
+/* Data Structures **********************************************************/
+
/* Paragraph 3 */
/* Periodic Frame List. Paragraph 3.1 */
@@ -419,12 +452,16 @@
# define PFL_TYP_QH (1 << PFL_TYP_SHIFT) /* Queue Head */
# define PFL_TYP_SITD (2 << PFL_TYP_SHIFT) /* Split Transaction Isochronous Transfer Descriptor */
# define PFL_TYP_FSTN (3 << PFL_TYP_SHIFT) /* Frame Span Traversal Node */
- /* Bits 3-4: zero */
+
+ /* Bits 3-4: zero */
#define PFL_MASK (0xffffffe0) /* Bits 5-31: Frame List Link Pointer */
-/* Aysnchronous List Queue Head Pointer. Paragraph 3.2. Circular list of queue heads */
+/* Aysnchronous List Queue Head Pointer.
+ * Paragraph 3.2. Circular list of queue heads
+ */
/* Isochronous (High-Speed) Transfer Descriptor (iTD). Paragraph 3.3 */
+
/* iTD Next Link Pointer. Paragraph 3.3.1 */
#define ITD_NLP_T (1 << 0) /* Bit 0: Terminate, Link pointer invalid */
@@ -434,7 +471,8 @@
# define ITD_NLP_TYP_QH (1 << ITD_NLP_TYP_SHIFT) /* Queue Head */
# define ITD_NLP_TYP_SITD (2 << ITD_NLP_TYP_SHIFT) /* Split Transaction Isochronous Transfer Descriptor */
# define ITD_NLP_TYP_FSTN (3 << ITD_NLP_TYP_SHIFT) /* Frame Span Traversal Node */
- /* Bits 3-4: zero */
+
+ /* Bits 3-4: zero */
#define ITD_NLP_MASK (0xffffffe0) /* Bits 5-31: Frame List Link Pointer */
/* iTD Transaction Status and Control List. Paragraph 3.3.2 */
@@ -454,6 +492,7 @@
# define ITD_TRAN_STATUS_ACTIVE (1 << 31) /* Bit 28: Transaction error */
/* iTD Buffer Page Pointer List. Paragraph 3.3.4 */
+
/* iTD Buffer Pointer Page 0. Table 3-4 */
#define ITD_BUFPTR0_DEVADDR_SHIFT (0) /* Bits 0-6: Device Address */
@@ -476,14 +515,21 @@
# define ITD_BUFPTR2_MULTI_1 (1 << ITD_BUFPTR2_MULTI_SHIFT) /* One transaction per micro-frame */
# define ITD_BUFPTR2_MULTI_2 (2 << ITD_BUFPTR2_MULTI_SHIFT) /* Two transactions per micro-frame */
# define ITD_BUFPTR2_MULTI_3 (3 << ITD_BUFPTR2_MULTI_SHIFT) /* Three transactions per micro-frame */
+
/* Bits 2-11: Reserved */
+
/* iTD Buffer Pointer Page 3-6. Table 3-7 */
+
/* Bits 0-11: Reserved */
+
/* iTD Buffer Pointer All Pages */
#define ITD_BUFPTR_MASK (0xfffff000) /* Bits 12-31: Buffer Pointer */
-/* Split Transaction Isochronous Transfer Descriptor (siTD). Paragraph 3.4 */
+/* Split Transaction Isochronous Transfer Descriptor (siTD).
+ * Paragraph 3.4
+ */
+
/* siTD Next Link Pointer. Paragraph 3.4.1 */
#define SITD_NLP_T (1 << 0) /* Bit 0: Terminate, Link pointer invalid */
@@ -493,10 +539,14 @@
# define SITD_NLP_TYP_QH (1 << SITD_NLP_TYP_SHIFT) /* Queue Head */
# define SITD_NLP_TYP_SITD (2 << SITD_NLP_TYP_SHIFT) /* Split Transaction Isochronous Transfer Descriptor */
# define SITD_NLP_TYP_FSTN (3 << SITD_NLP_TYP_SHIFT) /* Frame Span Traversal Node */
- /* Bits 3-4: zero */
+
+ /* Bits 3-4: zero */
#define SITD_NLP_MASK (0xffffffe0) /* Bits 5-31: Frame List Link Pointer */
-/* siTD Endpoint Capabilities/Characteristics. Paragraph 3.4.2 */
+/* siTD Endpoint Capabilities/Characteristics.
+ * Paragraph 3.4.2
+ */
+
/* Endpoint and Transaction Translator Characteristics. Table 3-9 */
#define SITD_EPCHAR_DEVADDR_SHIFT (0) /* Bitx 0-6: Device Address */
@@ -520,6 +570,7 @@
#define SITD_FMSCHED_SCMASK_MASK (0xff << SITD_FMSCHED_SCMASK_SHIFT)
# define SITD_FMSCHED_SCMASK(n) ((n) << SITD_FMSCHED_SCMASK_SHIFT)
/* Bits 16-31: Reserved */
+
/* siTD Transfer State. Paragraph 3.4.3 */
#define SITD_XFRSTATE_STATUS_SHIFT (0) /* Bits 0-7: Status */
@@ -532,7 +583,10 @@
#define SITD_XFRSTATE_P (1 << 30) /* Bit 30: Page Select */
#define SITD_XFRSTATE_IOC (1 << 31) /* Bit 31: Interrupt On Complete */
-/* siTD Buffer Pointer List. Paragraph 3.4.4 */
+/* siTD Buffer Pointer List.
+ * Paragraph 3.4.4
+ */
+
/* Page 0 */
#define SITD_BUFPTR0_OFFSET_SHIFT (0) /* Bits 0-11: Current Offset */
@@ -548,27 +602,38 @@
# define SITD_BUFPTR1_TP_BEGIN (1 << SITD_BUFPTR1_TP_SHIFT) /* This is the first data payload */
# define SITD_BUFPTR1_TP_MID (2 << SITD_BUFPTR1_TP_SHIFT) /* This the middle payload */
# define SITD_BUFPTR1_TP_END (3 << SITD_BUFPTR1_TP_SHIFT) /* This is the last payload */
+
/* Bits 5-11: Reserved */
+
/* All pages */
#define SITD_BUFPTR_MASK (0xfffff000) /* Bits 12-31: Buffer Pointer List */
-/* Queue Element Transfer Descriptor (qTD). Paragraph 3.5 */
-/* Next qTD Pointer. Paragraph 3.5.1 */
+/* Queue Element Transfer Descriptor (qTD).
+ * Paragraph 3.5
+ */
+
+/* Next qTD Pointer.
+ * Paragraph 3.5.1
+ */
#define QTD_NQP_T (1 << 0) /* Bit 0: Terminate */
/* Bits 1-4: Reserved */
#define QTD_NQP_NTEP_SHIFT (5) /* Bits 5-31: Next Transfer Element Pointer */
#define QTD_NQP_NTEP_MASK (0xffffffe0)
-/* Alternate Next qTD Pointer. Paragraph 3.5.2 */
+/* Alternate Next qTD Pointer.
+ * Paragraph 3.5.2
+ */
#define QTD_AQP_T (1 << 0) /* Bit 0: Terminate */
/* Bits 1-4: Reserved */
#define QTD_AQP_NTEP_SHIFT (5) /* Bits 5-31: Next Transfer Element Pointer */
#define QTD_AQP_NTEP_MASK (0xffffffe0)
-/* qTD Token. Paragraph 3.5.3 */
+/* qTD Token.
+ * Paragraph 3.5.3
+ */
#define QTD_TOKEN_STATUS_SHIFT (0) /* Bits 0-7: Status */
#define QTD_TOKEN_STATUS_MASK (0xff << QTD_TOKEN_STATUS_SHIFT)
@@ -587,6 +652,7 @@
# define QTD_TOKEN_PID_OUT (0 << QTD_TOKEN_PID_SHIFT) /* OUT Token generates token (E1H) */
# define QTD_TOKEN_PID_IN (1 << QTD_TOKEN_PID_SHIFT) /* IN Token generates token (69H) */
# define QTD_TOKEN_PID_SETUP (2 << QTD_TOKEN_PID_SHIFT) /* SETUP Token generates token (2DH) */
+
#define QTD_TOKEN_CERR_SHIFT (10) /* Bits 10-11: Error Counter */
#define QTD_TOKEN_CERR_MASK (3 << QTD_TOKEN_CERR_SHIFT)
#define QTD_TOKEN_CPAGE_SHIFT (12) /* Bits 12-14: Current Page */
@@ -597,21 +663,29 @@
#define QTD_TOKEN_TOGGLE_SHIFT (31) /* Bit 31: Data Toggle */
#define QTD_TOKEN_TOGGLE (1 << 31) /* Bit 31: Data Toggle */
-/* qTD Buffer Page Pointer List. Paragraph 3.5.4 */
+/* qTD Buffer Page Pointer List.
+ * Paragraph 3.5.4
+ */
+
/* Page 0 */
#define QTD_BUFPTR0_OFFFSET_SHIFT (0) /* Bits 0-11: Current Offset */
#define QTD_BUFPTR0_OFFFSET_MASK (0xfff << QTD_BUFPTR0_OFFFSET_SHIFT)
/* Other pages */
+
/* Bits 0-11: Reserved */
+
/* All pages */
#define QTD_BUFPTR_SHIFT (12) /* Bits 12-31: Buffer Pointer List */
#define QTD_BUFPTR_MASK (0xfffff000)
/* Queue Head. Paragraph 3.6 */
-/* Queue Head Horizontal Link Pointer. Paragraph 3.6.1 */
+
+/* Queue Head Horizontal Link Pointer.
+ * Paragraph 3.6.1
+ */
#define QH_HLP_T (1 << 0) /* Bit 0: Terminate, QH HL pointer invalid */
#define QH_HLP_TYP_SHIFT (1) /* Bits 1-2: Type */
@@ -620,10 +694,12 @@
# define QH_HLP_TYP_QH (1 << QH_HLP_TYP_SHIFT) /* Queue Head */
# define QH_HLP_TYP_SITD (2 << QH_HLP_TYP_SHIFT) /* Split Transaction Isochronous Transfer Descriptor */
# define QH_HLP_TYP_FSTN (3 << QH_HLP_TYP_SHIFT) /* Frame Span Traversal Node */
- /* Bits 3-4: Reserved */
+
+ /* Bits 3-4: Reserved */
#define QH_HLP_MASK (0xffffffe0) /* Bits 5-31: Queue Head Horizontal Link Pointer */
/* Endpoint Capabilities/Characteristics. Paragraph 3.6.2 */
+
/* Endpoint Characteristics: Queue Head DWord. Table 3-19 */
#define QH_EPCHAR_DEVADDR_SHIFT (0) /* Bitx 0-6: Device Address */
@@ -636,6 +712,7 @@
# define QH_EPCHAR_EPS_FULL (0 << QH_EPCHAR_EPS_SHIFT) /* Full-Speed (12Mbs) */
# define QH_EPCHAR_EPS_LOW (1 << QH_EPCHAR_EPS_SHIFT) /* Low-Speed (1.5Mbs) */
# define QH_EPCHAR_EPS_HIGH (2 << QH_EPCHAR_EPS_SHIFT) /* High-Speed (480 Mb/s) */
+
#define QH_EPCHAR_DTC (1 << 14) /* Bit 14: Data Toggle Control */
#define QH_EPCHAR_H (1 << 15) /* Bit 15: Head of Reclamation List Flag */
#define QH_EPCHAR_MAXPKT_SHIFT (16) /* Bitx 16-26: Maximum Packet Length */
@@ -671,8 +748,8 @@
*
* NOTES:
* 1. Same as the field of the same name in struct ehci_qtd_s
- * 2. Similar to the field of the same name in struct ehci_qtd_s, but with some
- * additional bitfields.
+ * 2. Similar to the field of the same name in struct ehci_qtd_s, but with
+ * some additional bitfields.
*/
/* Next qTD Pointer (NOTE 1) */
@@ -708,6 +785,7 @@
# define QH_TOKEN_PID_OUT (0 << QH_TOKEN_PID_SHIFT) /* OUT Token generates token (E1H) */
# define QH_TOKEN_PID_IN (1 << QH_TOKEN_PID_SHIFT) /* IN Token generates token (69H) */
# define QH_TOKEN_PID_SETUP (2 << QH_TOKEN_PID_SHIFT) /* SETUP Token generates token (2DH) */
+
#define QH_TOKEN_CERR_SHIFT (10) /* Bits 10-11: Error Counter */
#define QH_TOKEN_CERR_MASK (3 << QH_TOKEN_CERR_SHIFT)
#define QH_TOKEN_CPAGE_SHIFT (12) /* Bits 12-14: Current Page */
@@ -718,7 +796,8 @@
#define QH_TOKEN_TOGGLE_SHIFT (31) /* Bit 31: Data Toggle */
#define QH_TOKEN_TOGGLE (1 << 31) /* Bit 31: Data Toggle */
-/* Buffer Page Pointer List (NOTE 2)
+/* Buffer Page Pointer List (NOTE 2) */
+
/* Page 0 */
#define QH_BUFPTR0_OFFFSET_SHIFT (0) /* Bits 0-11: Current Offset */
@@ -729,6 +808,7 @@
#define QH_BUFPTR1_CPROGMASK_SHIFT (0) /* Bits 0-7: Split-transaction Complete-split Progress */
#define QH_BUFPTR1_CPROGMASK_MASK (0xff << QH_BUFPTR1_CPROGMASK_SHIFT)
/* Bits 8-11: Reserved */
+
/* Page 2. Table 3.22 */
#define QH_BUFPTR2_FRAMETAG_SHIFT (0) /* Bits 0-4: Split-transaction Frame Tag */
@@ -737,13 +817,16 @@
#define QH_BUFPTR2_SBYTES_MASK (0x7f << QH_BUFPTR2_SBYTES_SHIFT)
/* Other pages */
+
/* Bits 0-11: Reserved */
+
/* All pages */
#define QH_BUFPTR_SHIFT (12) /* Bits 12-31: Buffer Pointer List */
#define QH_BUFPTR_MASK (0xfffff000)
/* Periodic Frame Span Traversal Node (STN). Paragrap 3.7 */
+
/* FSTN Normal Path Pointer. Paragraph 3.7.1 */
#define FSTN_NPP_T (1 << 0) /* Bit 0: Terminate. 1=Link Pointer not valid */
@@ -753,6 +836,7 @@
# define FSTN_NPP_TYP_QH (1 << FSTN_NPP_TYP_SHIFT) /* Queue Head */
# define FSTN_NPP_TYP_SITD (2 << FSTN_NPP_TYP_SHIFT) /* Split Transaction Isochronous Transfer Descriptor */
# define FSTN_NPP_TYP_FSTN (3 << FSTN_NPP_TYP_SHIFT) /* Frame Span Traversal Node */
+
/* Bits 3-4: Reserved */
#define FSTN_NPP_NPLP_SHIFT (5) /* Bits 5-31: Normal Path Link Pointer */
#define FSTN_NPP_NPLP_MASK (0xffffffe0)
@@ -763,20 +847,24 @@
#define FSTN_BPP_TYP_SHIFT (1) /* Bits 1-2: Type */
#define FSTN_BPP_TYP_MASK (3 << FSTN_BPP_TYP_SHIFT)
# define FSTN_BPP_TYP_QH (1 << FSTN_BPP_TYP_SHIFT) /* Queue Head */
+
/* Bits 3-4: Reserved */
#define FSTN_BPP_BPLP_SHIFT (5) /* Bits 5-31: Back Path Link Pointer */
#define FSTN_BPP_BPLP_MASK (0xffffffe0)
-/********************************************************************************************
+/****************************************************************************
* Public Types
- ********************************************************************************************/
-/* Registers ********************************************************************************/
-/* Since the operational registers are not known a compile time, representing register blocks
- * with structures is more convenient than using individual register offsets.
+ ****************************************************************************/
+
+/* Registers ****************************************************************/
+
+/* Since the operational registers are not known a compile time, representing
+ * register blocks with structures is more convenient than using individual
+ * register offsets.
*/
-/* Host Controller Capability Registers. This register block must be positioned at a well
- * known address.
+/* Host Controller Capability Registers.
+ * This register block must be positioned at a well known address.
*/
struct ehci_hccr_s
@@ -789,8 +877,9 @@ struct ehci_hccr_s
uint8_t hcspportrt[8]; /* 0x0c: Companion Port Route Description */
};
-/* Host Controller Operational Registers. This register block is positioned at an offset
- * of 'caplength' from the beginning of the Host Controller Capability Registers.
+/* Host Controller Operational Registers.
+ * This register block is positioned at an offset of 'caplength' from the
+ * beginning of the Host Controller Capability Registers.
*/
struct ehci_hcor_s
@@ -807,9 +896,10 @@ struct ehci_hcor_s
uint32_t portsc[15]; /* 0x44: Port Status/Control */
};
-/* USB2 Debug Port Register Interface. This register block is normally found via the PCI
- * capabalities. In non-PCI implementions, you need apriori information about the location
- * of these registers.
+/* USB2 Debug Port Register Interface.
+ * This register block is normally found via the PCI capabalities.
+ * In non-PCI implementions, you need apriori information about the
+ * location of these registers.
*/
struct ehci_debug_s
@@ -820,14 +910,20 @@ struct ehci_debug_s
uint32_t addr; /* 0x10: Device Address Register */
};
-/* Data Structures **************************************************************************/
+/* Data Structures **********************************************************/
+
/* Paragraph 3 */
-/* Periodic Frame List. Paragraph 3.1. An array of pointers. */
-/* Aysnchronous List Queue Head Pointer. Paragraph 3.2. Circular list of queue heads */
+/* Periodic Frame List.
+ * Paragraph 3.1. An array of pointers.
+ */
+
+/* Aysnchronous List Queue Head Pointer.
+ * Paragraph 3.2. Circular list of queue heads
+ */
-/* Isochronous (High-Speed) Transfer Descriptor (iTD). Paragraph 3.3. Must be aligned to
- * 32-byte boundaries.
+/* Isochronous (High-Speed) Transfer Descriptor (iTD).
+ * Paragraph 3.3. Must be aligned to 32-byte boundaries.
*/
struct ehci_itd_s
@@ -854,6 +950,7 @@ struct ehci_sitd_s
#define SIZEOF_EHCI_SITD_S (28) /* 7*sizeof(uint32_t) */
/* Queue Element Transfer Descriptor (qTD). Paragraph 3.5 */
+
/* 32-bit version. See EHCI Appendix B for the 64-bit version. */
struct ehci_qtd_s
@@ -870,8 +967,8 @@ struct ehci_qtd_s
*
* NOTE:
* 1. Same as the field of the same name in struct ehci_qtd_s
- * 2. Similar to the field of the same name in struct ehci_qtd_s, but with some
- * additional bitfields.
+ * 2. Similar to the field of the same name in struct ehci_qtd_s,
+ * but with some additional bitfields.
*/
struct ehci_overlay_s
@@ -879,7 +976,7 @@ struct ehci_overlay_s
uint32_t nqp; /* 0x00-0x03: Next qTD Pointer (NOTE 1) */
uint32_t alt; /* 0x04-0x07: Alternate Next qTD Pointer (NOTE 2) */
uint32_t token; /* 0x08-0x0b: qTD Token (NOTE 1) */
- uint32_t bpl[5]; /* 0x0c-0x1c: Buffer Page Pointer List (NOTE 2)*/
+ uint32_t bpl[5]; /* 0x0c-0x1c: Buffer Page Pointer List (NOTE 2) */
};
#define SIZEOF_EHCI_OVERLAY (32) /* 8*sizeof(uint32_t) */
@@ -905,9 +1002,9 @@ struct ehci_fstn_s
#define SIZEOF_EHCI_FSTN_S (8) /* 2*sizeof(uint32_t) */
-/********************************************************************************************
+/****************************************************************************
* Public Data
- ********************************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
@@ -917,9 +1014,9 @@ extern "C"
#define EXTERN extern
#endif
-/********************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ********************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#ifdef __cplusplus
diff --git a/include/nuttx/usb/fusb301.h b/include/nuttx/usb/fusb301.h
index 12ca8f4..ea78686 100644
--- a/include/nuttx/usb/fusb301.h
+++ b/include/nuttx/usb/fusb301.h
@@ -37,6 +37,10 @@
#ifndef __INCLUDE_NUTTX_USB_FUSB301_H
#define __INCLUDE_NUTTX_USB_FUSB301_H
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
#include <nuttx/fs/ioctl.h>
/****************************************************************************
@@ -223,8 +227,10 @@ struct fusb301_config_s
*
* Input Parameters:
* devpath - The full path to the driver to register. E.g., "/dev/usbc0"
- * i2c - An instance of the I2C interface to use to communicate with FUSB301
- * addr - The I2C address of the FUSB301. The I2C address of the FUSB301 is 0x25.
+ * i2c - An instance of the I2C interface to use to communicate with
+ * FUSB301
+ * addr - The I2C address of the FUSB301.
+ * The I2C address of the FUSB301 is 0x25.
* config - Pointer to FUSB301 configuration
*
* Returned Value:
diff --git a/include/nuttx/usb/fusb303.h b/include/nuttx/usb/fusb303.h
index d6d8fe8..7b26b08 100644
--- a/include/nuttx/usb/fusb303.h
+++ b/include/nuttx/usb/fusb303.h
@@ -37,6 +37,10 @@
#ifndef __INCLUDE_NUTTX_USB_FUSB303_H
#define __INCLUDE_NUTTX_USB_FUSB303_H
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
#include <nuttx/fs/ioctl.h>
/****************************************************************************
@@ -115,6 +119,7 @@ enum fusb303_mode_e
MODE_TRY_SNK = (1 << 4), /* For DRP only */
MODE_TRY_SRC = (1 << 5), /* For DRP only */
MODE_ORIENTDEB = (1 << 6),
+
/* Bit 7 reserved */
};
@@ -169,6 +174,7 @@ enum fusb303_manual_e
MANUAL_UNATT_SNK = (1 << 3),
MANUAL_FORCE_SNK = (1 << 4),
MANUAL_FORCE_SRC = (1 << 5),
+
/* Bits 6:7 reserved */
};
@@ -190,6 +196,7 @@ enum fusb303_int_mask_e
INT_MASK_VBUS_CHG = (1 << 4),
INT_MASK_FAULT = (1 << 5),
INT_MASK_ORIENT = (1 << 6),
+
/* Bit 7 reserved */
};
@@ -200,10 +207,13 @@ enum fusb303_int_mask1_e
INT_MASK1_REMEDY = (1 << 0),
INT_MASK1_FRC_SUCC = (1 << 1),
INT_MASK1_FRC_FAIL = (1 << 2),
+
/* Bit 4 reserved */
+
INT_MASK1_REM_FAIL = (1 << 3),
INT_MASK1_REM_VBON = (1 << 5),
INT_MASK1_REM_VBOFF = (1 << 6),
+
/* Bit 7 reserved */
};
@@ -244,6 +254,7 @@ enum fusb303_type_e
TYPE_SINK = (1 << 4),
TYPE_DEBUGSNK = (1 << 5),
TYPE_DEBUGSRC = (1 << 6),
+
/* Bit 7 reserved */
};
@@ -258,6 +269,7 @@ enum fusb303_interrupt_e
INTERRUPT_VBUS_CHG = (1 << 4),
INTERRUPT_FAULT = (1 << 5),
INTERRUPT_ORIENT = (1 << 6),
+
/* Bit 7 reserved */
};
@@ -269,9 +281,12 @@ enum fusb303_interrupt1_e
INTERRUPT1_FRC_SUCC = (1 << 1),
INTERRUPT1_FRC_FAIL = (1 << 2),
INTERRUPT1_REM_FAIL = (1 << 3),
+
/* Bit 4 reserved */
+
INTERRUPT1_REM_VBON = (1 << 5),
INTERRUPT1_REM_VBOFF = (1 << 6),
+
/* Bit 7 reserved */
};
diff --git a/include/nuttx/usb/hid.h b/include/nuttx/usb/hid.h
index a635d7d..45088e8 100644
--- a/include/nuttx/usb/hid.h
+++ b/include/nuttx/usb/hid.h
@@ -56,6 +56,7 @@
****************************************************************************/
/* Subclass and Protocol ****************************************************/
+
/* Subclass codes (HID 4.2) */
#define USBHID_SUBCLASS_NONE 0 /* No subclass */
@@ -71,6 +72,7 @@
#define USBHID_PROTOCOL_MOUSE 2
/* Descriptor Requests ******************************************************/
+
/* "When a Get_Descriptor(Configuration) request is issued, it returns the
* Configuration descriptor, all Interface descriptors, all Endpoint
* descriptors, and the HID descriptor for each interface."
@@ -79,7 +81,8 @@
/* Standard Requests (HID 7.1)
* GET_DESCRIPTOR (HID 7.1.1):
*
- * bmRequestType (USB_REQ_DIR_IN | USB_REQ_TYPE_STANDARD | USB_REQ_RECIPIENT_INTERFACE)
+ * bmRequestType (USB_REQ_DIR_IN | USB_REQ_TYPE_STANDARD |
+ * USB_REQ_RECIPIENT_INTERFACE)
* bRequest (USB_REQ_GETDESCRIPTOR)
* wValue Descriptor Type (MS) and Descriptor Index (LS)
* wIndex Interface Number
@@ -104,8 +107,9 @@
/* Class-specific requests (HID 7.2)
*
- * bmRequestType ( USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) -or-
- * (USB_REQ_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE)
+ * bmRequestType (USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) -or-
+ * (USB_REQ_DIR_IN | USB_REQ_TYPE_CLASS |
+ * USB_REQ_RECIPIENT_INTERFACE)
* bRequest Class-specific request
* wValue Varies according to request
* wIndex Varies according to request
@@ -262,7 +266,7 @@
#define USBHID_LOCAL_STRINGIDX_PREFIX 0x78 /* String Index */
#define USBHID_LOCAL_STRINGMIN_PREFIX 0x88 /* String Minimum */
#define USBHID_LOCAL_STRINGMAX_PREFIX 0x98 /* xx */
-#define USBHID_LOCAL_DELIMITER_PREFIX 0xa8 /*Delimiter */
+#define USBHID_LOCAL_DELIMITER_PREFIX 0xa8 /* Delimiter */
/* Modifier Keys (HID 8.3) */
@@ -627,6 +631,7 @@
/****************************************************************************
* Public Types
****************************************************************************/
+
/* HID Descriptor (HID 6.2.1) ***********************************************/
struct usbhid_descriptor_s
@@ -652,6 +657,7 @@ struct usbhid_optdesc_s
};
/* Standard Reports *********************************************************/
+
/* Keyboard input report (8 bytes) (HID B.1) */
struct usbhid_kbdreport_s
@@ -661,7 +667,9 @@ struct usbhid_kbdreport_s
uint8_t key[6]; /* Keycode 1-6 */
};
-/* Keyboard output report (1 byte) (HID B.1), see USBHID_KBDOUT_* definitions */
+/* Keyboard output report (1 byte) (HID B.1),
+ * see USBHID_KBDOUT_* definitions
+ */
/* Mouse input report (HID B.2) */
diff --git a/include/nuttx/usb/hub.h b/include/nuttx/usb/hub.h
index de2d510..117b2c2 100644
--- a/include/nuttx/usb/hub.h
+++ b/include/nuttx/usb/hub.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/hub.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
@@ -31,21 +31,21 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_HUB_H
#define __INCLUDE_NUTTX_USB_HUB_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
/* Hub request types */
@@ -150,9 +150,9 @@
#define USBHUB_MAX_PORTS (7)
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
/* Hub descriptor */
diff --git a/include/nuttx/usb/max3421e.h b/include/nuttx/usb/max3421e.h
index 8bfab87..4680b66 100644
--- a/include/nuttx/usb/max3421e.h
+++ b/include/nuttx/usb/max3421e.h
@@ -55,7 +55,8 @@
* Pre-processor Definitions
****************************************************************************/
-/* Configuration ***************************************************************/
+/* Configuration ************************************************************/
+
/* MAX3421E USB Host Driver Support
*
* Pre-requisites
@@ -74,6 +75,7 @@
*/
/* Host Mode Register Addresses *********************************************/
+
/* The command byte contains the register address, a direction bit, and an
* ACKSTAT bit:
*
@@ -108,6 +110,7 @@
#define MAX3421E_USBHOST_HRSL (31 << 3)
/* Peripheral Mode Register Addresses ***************************************/
+
/* The command byte contains the register address, a direction bit, and an
* ACKSTAT bit:
*
diff --git a/include/nuttx/usb/ohci.h b/include/nuttx/usb/ohci.h
index fbac333..b65e80b 100644
--- a/include/nuttx/usb/ohci.h
+++ b/include/nuttx/usb/ohci.h
@@ -51,6 +51,7 @@
****************************************************************************/
/* Register offsets *********************************************************/
+
/* Control and status registers (section 7.1) */
#define OHCI_HCIREV_OFFSET 0x0000 /* HcRevision: Version of HCI specification */
@@ -154,6 +155,7 @@
#define OHCI_INT_OC (1 << 30) /* Bit 30: Ownership change */
#define OHCI_INT_MIE (1 << 31) /* Bit 31: Master interrupt enable
* (Enable/disable only) */
+
/* HcHCCA: HC communication area (7.2.1):
*
* 32-bits aligned to 256 byte boundary.
@@ -190,16 +192,19 @@
#define OHCI_FMNO_FI_SHIFT (0) /* Bits 0-15: Frame number */
#define OHCI_FMNO_FI_MASK (0xffff << OHCI_FMINT_FI_SHIFT)
/* Bits 16-31: Reserved */
+
/* HcPeriodicStart: Time to start processing periodic list (7.3.4) */
#define OHCI_PERSTART_SHIFT (0) /* Bits 0-13: Periodic start */
#define OHCI_PERSTART_MASK (0x3fff << OHCI_PERSTART_SHIFT)
/* Bits 14-31: Reserved */
+
/* HcLSThreshold: Commit to transfer threshold (7.3.5) */
#define OHCI_LSTHRES_SHIFT (0) /* Bits 0-11: LS threshold */
#define OHCI_LSTHRES_MASK (0x0fff << OHCI_PERSTART_SHIFT)
/* Bits 12-31: Reserved */
+
/* HcRhDescriptorN: Describes root hub (part A) (7.4.1) */
#define OHCI_RHDESCA_NDP_SHIFT (0) /* Bits 0-7: Number downstream ports */
@@ -254,6 +259,7 @@
/* Bits 21-31: Reserved */
/* Transfer Descriptors *****************************************************/
+
/* Endpoint Descriptor Offsets (4.2.1) */
#define ED_CONTROL_OFFSET (0x00) /* ED status/control bits */
@@ -273,6 +279,7 @@
# define ED_CONTROL_D_OUT (1 << ED_CONTROL_D_SHIFT) /* OUT */
# define ED_CONTROL_D_IN (2 << ED_CONTROL_D_SHIFT) /* IN */
# define ED_CONTROL_D_TD2 (3 << ED_CONTROL_D_SHIFT) /* Get direction from TD */
+
#define ED_CONTROL_S (1 << 13) /* Bit 13: Speed (low) */
#define ED_CONTROL_K (1 << 14) /* Bit 14: Skip */
#define ED_CONTROL_F (1 << 15) /* Bit 15: Format (isochronous) */
@@ -292,13 +299,16 @@
#define GTD_BE_OFFSET (0x0c) /* Buffer End (BE) */
/* General Transfer Descriptor Bit Definitions */
+
/* Bits 0-17: Reserved */
+
#define GTD_STATUS_R (1 << 18) /* Bit 18: Buffer rounding */
#define GTD_STATUS_DP_SHIFT (19) /* Bits 19-20: Direction/PID */
#define GTD_STATUS_DP_MASK (3 << GTD_STATUS_DP_SHIFT)
# define GTD_STATUS_DP_SETUP (0 << GTD_STATUS_DP_SHIFT) /* To endpoint */
# define GTD_STATUS_DP_OUT (1 << GTD_STATUS_DP_SHIFT) /* To endpoint */
# define GTD_STATUS_DP_IN (2 << GTD_STATUS_DP_SHIFT) /* From endpoint */
+
#define GTD_STATUS_DI_SHIFT (21) /* Bits 21-23: Delay input */
#define GTD_STATUS_DI_MASK (7 << GTD_STATUS_DI_SHIFT)
#define GTD_STATUS_T_SHIFT (24) /* Bits 24-25: Data Toggle */
@@ -434,8 +444,8 @@ struct ohci_hcca_s
volatile uint16_t pad1;
/* HccaDoneHead: When the HC reaches the end of a frame and its deferred
- * interrupt register is 0, it writes the current value of its HcDoneHead to
- * this location and generates an interrupt.
+ * interrupt register is 0, it writes the current value of its HcDoneHead
+ * to this location and generates an interrupt.
*/
volatile uint32_t donehead;
@@ -459,7 +469,6 @@ extern "C"
* Public Function Prototypes
****************************************************************************/
-
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/include/nuttx/usb/pl2303.h b/include/nuttx/usb/pl2303.h
index 2f4ef13..b7bbf6c 100644
--- a/include/nuttx/usb/pl2303.h
+++ b/include/nuttx/usb/pl2303.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/pl2303.h
*
* Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
@@ -37,28 +37,28 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_PL2303_H
#define __INCLUDE_NUTTX_USB_PL2303_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
- /************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -69,17 +69,18 @@ extern "C"
# define EXTERN extern
#endif
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Definitions
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: usbdev_serialinit
*
* Description:
- * Register PL2303 USB serial port (and USB serial console if so configured).
+ * Register PL2303 USB serial port
+ * (and USB serial console if so configured).
*
- ************************************************************************************/
+ ****************************************************************************/
int usbdev_serialinitialize(int minor);
diff --git a/include/nuttx/usb/rndis.h b/include/nuttx/usb/rndis.h
index e817f87..aa637fa 100644
--- a/include/nuttx/usb/rndis.h
+++ b/include/nuttx/usb/rndis.h
@@ -1,9 +1,9 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/rndis.h
*
* Copyright (C) 2011-2018 Gregory Nutt. All rights reserved.
* Authors: Sakari Kapanen <sa...@gmail.com>,
- Petteri Aimonen <jp...@git.mail.kapsi.fi>
+ * Petteri Aimonen <jp...@git.mail.kapsi.fi>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +32,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_RNDIS_H
#define __INCLUDE_NUTTX_USB_RNDIS_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/usb/usbdev.h>
@@ -48,13 +48,15 @@
* Preprocessor definitions
****************************************************************************/
-/* Indexes for devinfo.epno[] array. Used for composite device configuration. */
+/* Indexes for devinfo.epno[] array.
+ * Used for composite device configuration.
+ */
#define RNDIS_EP_INTIN_IDX (0)
#define RNDIS_EP_BULKIN_IDX (1)
#define RNDIS_EP_BULKOUT_IDX (2)
-/* Endpoint configuration ****************************************************/
+/* Endpoint configuration ***************************************************/
#define RNDIS_MKEPINTIN(desc) (USB_DIR_IN | (desc)->epno[RNDIS_EP_INTIN_IDX])
#define RNDIS_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT)
@@ -89,9 +91,9 @@
# define CONFIG_RNDIS_EPBULKOUT_HSSIZE 512
#endif
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -102,25 +104,26 @@ extern "C"
# define EXTERN extern
#endif
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Definitions
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: usbdev_rndis_initialize
*
* Description:
- * Register RNDIS USB device interface. Register the corresponding network driver
- * to NuttX and bring up the network.
+ * Register RNDIS USB device interface.
+ * Register the corresponding network driver to NuttX and bring up the
+ * network.
*
* Input Parameters:
- * mac_address: an array of 6 bytes which make the MAC address of the host side
- * of the network.
+ * mac_address: an array of 6 bytes which make the MAC address of the host
+ * side of the network.
*
* Returned Value:
* 0 on success; -errno on failure
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef CONFIG_RNDIS_COMPOSITE
int usbdev_rndis_initialize(FAR const uint8_t *mac_address);
diff --git a/include/nuttx/usb/storage.h b/include/nuttx/usb/storage.h
index 479301d..b36103a 100644
--- a/include/nuttx/usb/storage.h
+++ b/include/nuttx/usb/storage.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/storage.h
*
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
@@ -38,21 +38,21 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_STORAGE_H
#define __INCLUDE_NUTTX_USB_STORAGE_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
/* Mass storage requests */
@@ -93,9 +93,9 @@
#define USBMSC_CSWSTATUS_FAIL (1)
#define USBMSC_CSWSTATUS_PHASEERROR (2)
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
/* Command Block Wrapper (CBW) */
@@ -120,12 +120,12 @@ struct usbmsc_csw_s
uint8_t status; /* Status of transfer */
};
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Definitions
+ ****************************************************************************/
#endif /* __INCLUDE_NUTTX_USB_STORAGE_H */
diff --git a/include/nuttx/usb/usb.h b/include/nuttx/usb/usb.h
index c728c77..3df3b18 100644
--- a/include/nuttx/usb/usb.h
+++ b/include/nuttx/usb/usb.h
@@ -1,7 +1,8 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/usb.h
*
- * Copyright (C) 2008, 2009-2010, 2012, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009-2010, 2012, 2008 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -31,26 +32,27 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_USB_H
#define __INCLUDE_NUTTX_USB_USB_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/* A packet identifier (PID) immediately follows the SYNC field of every USB packet.
- * A PID consists of a four-bit packet type field followed by a four-bit check field
- * USB Tokens (See Table 8-1 in the USB specification)
+/* A packet identifier (PID) immediately follows the SYNC field of every USB
+ * packet.
+ * A PID consists of a four-bit packet type field followed by a four-bit
+ * check field USB Tokens (See Table 8-1 in the USB specification)
*/
#define USB_PID_OUT_TOKEN (0x01) /* Tokens */
@@ -267,9 +269,9 @@
#define MSFTOSDESC_INDEX_FUNCTION 4
#define MSFTOSDESC_INDEX_EXTPROP 5
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
/* This structure is used to send control requests to a USB device. */
@@ -412,12 +414,12 @@ struct usb_qualdesc_s
/* Interface association descriptor
*
- * The Universal Serial Bus Specification, revision 2.0, does not support grouping
- * more than one interface of a composite device within a single function. However,
- * the USB Device Working Group (DWG) created USB device classes that allow for
- * functions with multiple interfaces, and the USB Implementor's Forum issued an
- * Engineering Change Notification (ECN) that defines a mechanism for grouping
- * interfaces.
+ * The Universal Serial Bus Specification, revision 2.0, does not support
+ * grouping more than one interface of a composite device within a single
+ * function. However, the USB Device Working Group (DWG) created USB device
+ * classes that allow for functions with multiple interfaces, and the USB
+ * Implementor's Forum issued an Engineering Change Notification (ECN) that
+ * defines a mechanism for grouping interfaces.
*/
struct usb_iaddesc_s
@@ -435,15 +437,17 @@ struct usb_iaddesc_s
#define USB_SIZEOF_IADDESC 8
/* Microsoft OS function descriptor.
- * This can be used to request a specific driver (such as WINUSB) to be loaded
- * on Windows. Unlike other descriptors, it is requested by a special request
- * USB_REQ_GETMSFTOSDESCRIPTOR.
- * More details: https://msdn.microsoft.com/en-us/windows/hardware/gg463179
- * And excellent explanation: https://github.com/pbatard/libwdi/wiki/WCID-Devices
+ * This can be used to request a specific driver (such as WINUSB) to be
+ * loaded on Windows. Unlike other descriptors, it is requested by a special
+ * request USB_REQ_GETMSFTOSDESCRIPTOR.
+ * More details:
+ * https://msdn.microsoft.com/en-us/windows/hardware/gg463179
+ * And excellent explanation:
+ * https://github.com/pbatard/libwdi/wiki/WCID-Devices
*
* The device will have exactly one "Extended Compat ID Feature Descriptor",
- * which may contain multiple "Function Descriptors" associated with different
- * interfaces.
+ * which may contain multiple "Function Descriptors" associated with
+ * different interfaces.
*/
struct usb_msft_os_function_desc_s
@@ -466,11 +470,12 @@ struct usb_msft_os_feature_desc_s
};
/* Microsoft OS extended property descriptor.
- * This can be used to set specific registry values, such as interface GUID for
- * a device. It is requested per-interface by special request USB_REQ_GETMSFTOSDESCRIPTOR.
+ * This can be used to set specific registry values, such as interface GUID
+ * for a device. It is requested per-interface by special request
+ * USB_REQ_GETMSFTOSDESCRIPTOR.
*
- * The interface will have one extended properties descriptor, which may contain
- * multiple properties inside it.
+ * The interface will have one extended properties descriptor, which may
+ * contain multiple properties inside it.
*/
struct usb_msft_os_extprop_hdr_s
@@ -490,12 +495,12 @@ struct usb_msft_os_extprop_hdr_s
*/
};
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
+/****************************************************************************
+ * Public Functions Definitions
+ ****************************************************************************/
#endif /* __INCLUDE_NUTTX_USB_USB_H */
diff --git a/include/nuttx/usb/usbdev.h b/include/nuttx/usb/usbdev.h
index 96ebee0..c0a316e 100644
--- a/include/nuttx/usb/usbdev.h
+++ b/include/nuttx/usb/usbdev.h
@@ -1,7 +1,8 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/usbdev.h
*
- * Copyright (C) 2008-2010, 2012-2013, 2017 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2010, 2012-2013, 2017 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* NOTE: This interface was inspired by the Linux gadget interface by
@@ -37,14 +38,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_USB_USBDEV_H
#define __INCLUDE_NUTTX_USB_USBDEV_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -57,19 +58,21 @@
#include <nuttx/usb/usbmsc.h>
#include <nuttx/usb/composite.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/* Endpoint helpers *****************************************************************/
+/* Endpoint helpers *********************************************************/
-/* Configure endpoint, making it usable. The class driver may deallocate or re-use
- * the 'desc' structure after returning:
+/* Configure endpoint, making it usable.
+ * The class driver may deallocate or re-use the 'desc' structure after
+ * returning:
*
* ep - the struct usbdev_ep_s instance obtained from allocep()
* desc - A struct usb_epdesc_s instance describing the endpoint
- * last - true if this is the last endpoint to be configured. Some hardware needs
- * to take special action when all of the endpoints have been configured.
+ * last - true if this is the last endpoint to be configured. Some hardware
+ * needs to take special action when all of the endpoints have been
+ * configured.
*/
#define EP_CONFIGURE(ep,desc,last) (ep)->ops->configure(ep,desc,last)
@@ -78,12 +81,16 @@
#define EP_DISABLE(ep) (ep)->ops->disable(ep)
-/* Allocate/free I/O requests. Should not be called from interrupt processing! */
+/* Allocate/free I/O requests.
+ * Should not be called from interrupt processing!
+ */
#define EP_ALLOCREQ(ep) (ep)->ops->allocreq(ep)
#define EP_FREEREQ(ep,req) (ep)->ops->freereq(ep,req)
-/* Allocate/free an I/O buffer. Should not be called from interrupt processing! */
+/* Allocate/free an I/O buffer.
+ * Should not be called from interrupt processing!
+ */
#ifdef CONFIG_USBDEV_DMA
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
@@ -106,16 +113,17 @@
#define EP_STALL(ep) (ep)->ops->stall(ep,false)
#define EP_RESUME(ep) (ep)->ops->stall(ep,true)
-/* USB Device Driver Helpers ********************************************************/
+/* USB Device Driver Helpers ************************************************/
/* Allocate an endpoint:
*
- * ep - 7-bit logical endpoint number (direction bit ignored). Zero means
- * that any endpoint matching the other requirements will suffice. The
- * assigned endpoint can be found in the eplog field.
+ * ep - 7-bit logical endpoint number (direction bit ignored).
+ * Zero means that any endpoint matching the other requirements
+ * will suffice.
+ * The assigned endpoint can be found in the eplog field.
* in - true: IN (device-to-host) endpoint requested
- * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK,
- * USB_EP_ATTR_XFER_INT}
+ * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC,
+ * USB_EP_ATTR_XFER_BULK, USB_EP_ATTR_XFER_INT}
*/
#define DEV_ALLOCEP(dev,ep,in,type) (dev)->ops->allocep(dev,ep,in,type)
@@ -140,9 +148,9 @@
#define DEV_CLRSELFPOWERED(dev) (dev)->ops->selfpowered(dev, false)
-/* Software-controlled connect to USB host. All USB class drivers need to call
- * DEV_CONNECT() when they are ready to be enumerated. That is, (1) initially when
- * bound to the USB driver, and (2) after a USB reset.
+/* Software-controlled connect to USB host. All USB class drivers need to
+ * call DEV_CONNECT() when they are ready to be enumerated. That is, (1)
+ * initially when bound to the USB driver, and (2) after a USB reset.
*/
#define DEV_CONNECT(dev) (dev)->ops->pullup ? (dev)->ops->pullup(dev,true) : -EOPNOTSUPP
@@ -151,9 +159,11 @@
#define DEV_DISCONNECT(dev) (dev)->ops->pullup ? (dev)->ops->pullup(dev,false) : -EOPNOTSUPP
-/* USB Class Driver Helpers *********************************************************/
+/* USB Class Driver Helpers *************************************************/
-/* All may be called from interrupt handling logic except bind() and unbind() */
+/* All may be called from interrupt handling logic except bind() and
+ * unbind()
+ */
/* Invoked when the driver is bound to a USB device driver. */
@@ -163,7 +173,9 @@
#define CLASS_UNBIND(drvr,dev) (drvr)->ops->unbind(drvr,dev)
-/* Invoked after all transfers have been stopped, when the host is disconnected. */
+/* Invoked after all transfers have been stopped, when the host is
+ * disconnected.
+ */
#define CLASS_DISCONNECT(drvr,dev) (drvr)->ops->disconnect(drvr,dev)
@@ -191,11 +203,11 @@
#define USBDEV_REQFLAGS_NULLPKT 1 /* Bit 0: Terminate w/short packet; null packet if necessary */
/* Bits 1-7: Available */
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
-/* USB Controller Structures ********************************************************/
+/* USB Controller Structures ************************************************/
/* usbdev_devinfo_s - describes the low level bindings of an usb device */
@@ -257,7 +269,8 @@ struct usbdev_req_s
/* Callback when the transfer completes */
- CODE void (*callback)(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req);
+ CODE void (*callback)(FAR struct usbdev_ep_s *ep,
+ FAR struct usbdev_req_s *req);
FAR void *priv; /* Used only by callee */
};
@@ -341,7 +354,7 @@ struct usbdev_s
uint8_t dualspeed:1; /* 1:supports high and full speed operation */
};
-/* USB Device Class Implementations *************************************************/
+/* USB Device Class Implementations *****************************************/
struct usbdevclass_driver_s;
struct usbdevclass_driverops_s
@@ -367,9 +380,9 @@ struct usbdevclass_driver_s
uint8_t speed; /* Highest speed that the driver handles */
};
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -380,34 +393,35 @@ extern "C"
# define EXTERN extern
#endif
-/************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: usbdevclass_register
*
* Description:
- * Register a USB device class driver. The class driver's bind() method will be
- * called to bind it to a USB device driver.
+ * Register a USB device class driver. The class driver's bind() method
+ * will be called to bind it to a USB device driver.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbdev_register(FAR struct usbdevclass_driver_s *driver);
-/************************************************************************************
+/****************************************************************************
* Name: usbdev_unregister
*
* Description:
- * Un-register usbdev class driver.If the USB device is connected to a USB host,
- * it will first disconnect(). The driver is also requested to unbind() and clean
- * up any device state, before this procedure finally returns.
+ * Un-register usbdev class driver.If the USB device is connected to a USB
+ * host, it will first disconnect().
+ * The driver is also requested to unbind() and clean up any device state,
+ * before this procedure finally returns.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbdev_unregister(FAR struct usbdevclass_driver_s *driver);
-/************************************************************************************
+/****************************************************************************
* Name: usbdev_dma_alloc and usbdev_dma_free
*
* Description:
@@ -431,7 +445,7 @@ int usbdev_unregister(FAR struct usbdevclass_driver_s *driver);
* does require the size of the allocation to be freed; that would need
* to be managed in the board-specific logic.
*
- ************************************************************************************/
+ ****************************************************************************/
#if defined(CONFIG_USBDEV_DMA) && defined(CONFIG_USBDEV_DMAMEMORY)
FAR void *usbdev_dma_alloc(size_t size);
diff --git a/include/nuttx/usb/usbdev_trace.h b/include/nuttx/usb/usbdev_trace.h
index dc32b5e..cb977bc 100644
--- a/include/nuttx/usb/usbdev_trace.h
+++ b/include/nuttx/usb/usbdev_trace.h
@@ -1,7 +1,8 @@
/****************************************************************************
* include/nuttx/usb/usbdev_trace.h
*
- * Copyright (C) 2008, 2009-2010, 2012-2013, 2017 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009-2010, 2012-2013, 2017 Gregory Nutt.
+ * All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -54,7 +55,7 @@
#define TRACE_ID(event) ((event) & 0xff00)
#define TRACE_DATA(event) ((event) & 0x00ff)
-/* Events ******************************************************************/
+/* Events *******************************************************************/
/* Event class IDs */
@@ -144,7 +145,7 @@
#define TRACE_CLASSSTATE(id) TRACE_EVENT(TRACE_CLASSSTATE_ID, id)
-/* USB device controller interrupt events. The 'id' is specific to the driver.
+/* USB device controller interrupt events.The 'id' is specific to the driver.
* Particular values for 'id' are unique for a given implementation of a
* controller driver
*/
@@ -175,6 +176,7 @@
#define TRACE_CLSERROR(id) TRACE_EVENT(TRACE_CLSERROR_ID, id)
/* Event string descriptions ************************************************/
+
/* Macros for defining the string arrays for display of the traces. */
#ifdef CONFIG_USBDEV_TRACE_STRINGS
@@ -183,7 +185,9 @@
#endif
/* USB Serial driver class events *******************************************/
+
/* Used by both the CDC/ACM and the PL2303 serial class drivers */
+
/* UART interface API calls */
#define USBSER_TRACECLASSAPI_SETUP 0x0001
@@ -467,11 +471,12 @@ EXTERN const struct trace_msg_t g_usb_trace_strings_intdecode[];
* Name: usbtrace_enable
*
* Description:
- * Enable/disable tracing per trace ID. The initial state is all IDs enabled.
+ * Enable/disable tracing per trace ID.
+ * The initial state is all IDs enabled.
*
* Input Parameters:
- * idset - The bitset of IDs to be masked. TRACE_ALLIDS enables all IDS; zero
- * masks all IDs.
+ * idset - The bitset of IDs to be masked.
+ * TRACE_ALLIDS enables all IDS; zero masks all IDs.
*
* Returned Value:
* The previous idset value.
diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h
index 4a4e060..709e923 100644
--- a/include/nuttx/usb/usbhost.h
+++ b/include/nuttx/usb/usbhost.h
@@ -1,4 +1,4 @@
-/************************************************************************************
+/****************************************************************************
* include/nuttx/usb/usbhost.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -16,7 +16,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*
- ************************************************************************************/
+ ****************************************************************************/
/* References:
* "Universal Serial Bus Mass Storage Class, Specification Overview,"
@@ -29,9 +29,9 @@
#ifndef __INCLUDE_NUTTX_USB_USBHOST_H
#define __INCLUDE_NUTTX_USB_USBHOST_H
-/************************************************************************************
+/****************************************************************************
* Included Files
- ************************************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -45,17 +45,17 @@
#include <nuttx/usb/usbhost_devaddr.h>
-/************************************************************************************
+/****************************************************************************
* Pre-processor Definitions
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: ROOTHUB
*
* Description:
* Check if a hub instance is the root hub.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_USBHOST_HUB
# define ROOTHUB(hub) ((hub)->parent == NULL)
@@ -63,48 +63,49 @@
# define ROOTHUB(hub) true
#endif
-/************************************************************************************
+/****************************************************************************
* Name: CLASS_CREATE
*
* Description:
* This macro will call the create() method of struct usbhost_registry_s.
- * The create() method is a callback into the class implementation. It is used
- * to (1) create a new instance of the USB host class state and to (2) bind a
- * USB host driver "session" to the class instance. Use of this create() method
- * will support environments where there may be multiple USB ports and multiple
- * USB devices simultaneously connected.
+ * The create() method is a callback into the class implementation.
+ * It is used to (1) create a new instance of the USB host class state and
+ * to (2) bind a USB host driver "session" to the class instance.
+ * Use of this create() method will support environments where there may be
+ * multiple USB ports and multiple USB devices simultaneously connected.
*
* Input Parameters:
- * reg - The USB host class registry entry previously obtained from a call to
- * usbhost_findclass().
+ * reg - The USB host class registry entry previously obtained from a call
+ * to usbhost_findclass().
* hport - The hub hat manages the new class instance.
- * id - In the case where the device supports multiple base classes, subclasses, or
- * protocols, this specifies which to configure for.
+ * id - In the case where the device supports multiple base classes,
+ * subclasses, or protocols, this specifies which to configure for.
*
* Returned Value:
* On success, this function will return a non-NULL instance of struct
- * usbhost_class_s that can be used by the USB host driver to communicate with the
- * USB host class. NULL is returned on failure; this function will fail only if
- * the drvr input parameter is NULL or if there are insufficient resources to
- * create another USB host class instance.
+ * usbhost_class_s that can be used by the USB host driver to communicate
+ * with the USB host class. NULL is returned on failure; this function
+ * will fail only if the drvr input parameter is NULL or if there are
+ * insufficient resources to create another USB host class instance.
*
* Assumptions:
- * If this function is called from an interrupt handler, it will be unable to
- * allocate memory and CONFIG_USBHOST_NPREALLOC should be defined to be a value
- * greater than zero specify a number of pre-allocated class structures.
+ * If this function is called from an interrupt handler, it will be unable
+ * to allocate memory and CONFIG_USBHOST_NPREALLOC should be defined to be
+ * a value greater than zero specify a number of pre-allocated class
+ * structures.
*
- ************************************************************************************/
+ ****************************************************************************/
#define CLASS_CREATE(reg,hport,id) ((reg)->create(hport,id))
-/************************************************************************************
+/****************************************************************************
* Name: CLASS_CONNECT
*
* Description:
- * This macro will call the connect() method of struct usbhost_class_s. This
- * method is a callback into the devclass implementation. It is used to provide
- * the device's configuration descriptor to the devclass so that the devclass may
- * initialize properly.
+ * This macro will call the connect() method of struct usbhost_class_s.
+ * This method is a callback into the devclass implementation.
+ * It is used to providethe device's configuration descriptor to the
+ * devclass so that the devclass may initialize properly.
*
* Input Parameters:
* devclass - The USB host class entry previously obtained from a call
@@ -114,56 +115,59 @@
* desclen - The length in bytes of the configuration descriptor.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
- * NOTE that the class instance remains valid upon return with a failure. It is
- * the responsibility of the higher level enumeration logic to call
+ * NOTE that the class instance remains valid upon return with a failure.
+ * It is the responsibility of the higher level enumeration logic to call
* CLASS_DISCONNECTED to free up the class driver resources.
*
* Assumptions:
- * - This function is probably called on the same thread that called the driver
- * enumerate() method. This function will *not* be called from an interrupt
- * handler.
+ * - This function is probably called on the same thread that called the
+ * driver enumerate() method. This function will *not* be called from an
+ * interrupt handler.
* - If this function returns an error, the USB host controller driver
* must call to DISCONNECTED method to recover from the error
*
- ************************************************************************************/
+ ****************************************************************************/
#define CLASS_CONNECT(devclass,configdesc,desclen) \
((devclass)->connect(devclass,configdesc,desclen))
-/************************************************************************************
+/****************************************************************************
* Name: CLASS_DISCONNECTED
*
* Description:
- * This macro will call the disconnected() method of struct usbhost_class_s. This
- * method is a callback into the class implementation. It is used to inform the
- * class that the USB device has been disconnected.
+ * This macro will call the disconnected() method of struct
+ * usbhost_class_s.
+ * This method is a callback into the class implementation.
+ * It is used to inform the class that the USB device has been
+ * disconnected.
*
* Input Parameters:
- * devclass - The USB host class entry previously obtained from a call to create().
+ * devclass - The USB host class entry previously obtained from a call to
+ * create().
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define CLASS_DISCONNECTED(devclass) ((devclass)->disconnected(devclass))
-/************************************************************************************
+/****************************************************************************
* Name: CONN_WAIT
*
* Description:
* Wait for a device to be connected or disconnected to/from a hub port.
*
* Input Parameters:
- * conn - The USB host connection instance obtained as a parameter from the call to
- * the USB driver initialization logic.
+ * conn - The USB host connection instance obtained as a parameter from the
+ * call to the USB driver initialization logic.
* hport - The location to return the hub port descriptor that detected the
* connection related event.
*
@@ -178,11 +182,11 @@
* - Called from a single thread so no mutual exclusion is required.
* - Never called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define CONN_WAIT(conn,hport) ((conn)->wait(conn,hport))
-/************************************************************************************
+/****************************************************************************
* Name: CONN_ENUMERATE
*
* Description:
@@ -202,17 +206,17 @@
* device.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define CONN_ENUMERATE(conn,rhpndx) ((conn)->enumerate(conn,rhpndx))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_EP0CONFIGURE
*
* Description:
@@ -221,246 +225,256 @@
* an external implementation of the enumeration logic.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* ep0 - The (opaque) EP0 endpoint instance
- * funcaddr - The USB address of the function containing the endpoint that EP0
- * controls
+ * funcaddr - The USB address of the function containing the endpoint
+ * that EP0 controls
* speed - The speed of the port USB_SPEED_LOW, _FULL, or _HIGH
* mps (maxpacketsize) - The maximum number of bytes that can be sent to or
* received from the endpoint in a single data packet
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_EP0CONFIGURE(drvr,ep0,funcaddr,speed,mps) \
((drvr)->ep0configure(drvr,ep0,funcaddr,speed,mps))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_GETDEVINFO
*
* Description:
* Get information about the connected device.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * devinfo - A pointer to memory provided by the caller in which to return the
- * device information.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * devinfo - A pointer to memory provided by the caller in which to return
+ * the device information.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_GETDEVINFO(drvr,devinfo) ((drvr)->getdevinfo(drvr,devinfo))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_EPALLOC
*
* Description:
* Allocate and configure one endpoint.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* epdesc - Describes the endpoint to be allocated.
* ep - A memory location provided by the caller in which to receive the
* allocated endpoint descriptor.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_EPALLOC(drvr,epdesc,ep) ((drvr)->epalloc(drvr,epdesc,ep))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_EPFREE
*
* Description:
* Free and endpoint previously allocated by DRVR_EPALLOC.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* ep - The endpoint to be freed.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_EPFREE(drvr,ep) ((drvr)->epfree(drvr,ep))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_ALLOC
*
* Description:
- * Some hardware supports special memory in which request and descriptor data can
- * be accessed more efficiently. This method provides a mechanism to allocate
- * the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to kmm_malloc.
- *
- * This interface was optimized under a particular assumption. It was assumed
- * that the driver maintains a pool of small, pre-allocated buffers for descriptor
- * traffic. NOTE that size is not an input, but an output: The size of the
+ * Some hardware supports special memory in which request and descriptor
+ * data can be accessed more efficiently. This method provides a mechanism
+ * to allocate the request/descriptor memory. If the underlying hardware
+ * does not support such "special" memory, this functions may simply map to
+ * kmm_malloc.
+ *
+ * This interface was optimized under a particular assumption.
+ * It was assumed that the driver maintains a pool of small, pre-allocated
+ * buffers for descriptor traffic.
+ * NOTE that size is not an input, but an output: The size of the
* pre-allocated buffer is returned.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * buffer - The address of a memory location provided by the caller in which to
- * return the allocated buffer memory address.
- * maxlen - The address of a memory location provided by the caller in which to
- * return the maximum size of the allocated buffer memory.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * buffer - The address of a memory location provided by the caller in
+ * which to return the allocated buffer memory address.
+ * maxlen - The address of a memory location provided by the caller in
+ * which to return the maximum size of the allocated buffer memory.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_ALLOC(drvr,buffer,maxlen) ((drvr)->alloc(drvr,buffer,maxlen))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_FREE
*
* Description:
- * Some hardware supports special memory in which request and descriptor data can
- * be accessed more efficiently. This method provides a mechanism to free that
- * request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to kmm_free().
+ * Some hardware supports special memory in which request and descriptor
+ * data can be accessed more efficiently. This method provides a mechanism
+ * to free that request/descriptor memory. If the underlying hardware does
+ * not support such "special" memory, this functions may simply map to
+ * kmm_free().
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* buffer - The address of the allocated buffer memory to be freed.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_FREE(drvr,buffer) ((drvr)->free(drvr,buffer))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_IOALLOC
*
* Description:
* Some hardware supports special memory in which larger IO buffers can
- * be accessed more efficiently. This method provides a mechanism to allocate
- * the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to kmm_malloc.
+ * be accessed more efficiently.
+ * This method provides a mechanism to allocate the request/descriptor
+ * memory.
+ * If the underlying hardware does not support such "special" memory,
+ * this functions may simply map to kmm_malloc.
*
- * This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
+ * This interface differs from DRVR_ALLOC in that the buffers are
+ * variable-sized.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * buffer - The address of a memory location provided by the caller in which to
- * return the allocated buffer memory address.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * buffer - The address of a memory location provided by the caller in
+ * which to return the allocated buffer memory address.
* buflen - The size of the buffer required.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_IOALLOC(drvr,buffer,buflen) ((drvr)->ioalloc(drvr,buffer,buflen))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_IOFREE
*
* Description:
- * Some hardware supports special memory in which IO data can be accessed more
- * efficiently. This method provides a mechanism to free that IO buffer
- * memory. If the underlying hardware does not support such "special" memory,
+ * Some hardware supports special memory in which IO data can be accessed
+ * more efficiently.
+ * This method provides a mechanism to free that IO buffer memory.
+ * If the underlying hardware does not support such "special" memory,
* this functions may simply map to kmm_free().
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* buffer - The address of the allocated buffer memory to be freed.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno
+ * value is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_IOFREE(drvr,buffer) ((drvr)->iofree(drvr,buffer))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_CTRLIN and DRVR_CTRLOUT
*
* Description:
- * Process a IN or OUT request on the control endpoint. These methods
- * will enqueue the request and wait for it to complete. Only one transfer may be
- * queued; Neither these methods nor the transfer() method can be called again
- * until the control transfer functions returns.
+ * Process a IN or OUT request on the control endpoint.
+ * These methods will enqueue the request and wait for it to complete.
+ * Only one transfer may be queued; Neither these methods nor the
+ * transfer() method can be called again until the control transfer
+ * functions returns.
*
* These are blocking methods; these functions will not return until the
* control transfer has completed.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* ep0 - The control endpoint to send/receive the control request.
* req - Describes the request to be sent. This request must lie in memory
* created by DRVR_ALLOC.
* buffer - A buffer used for sending the request and for returning any
* responses. This buffer must be large enough to hold the length value
- * in the request description. buffer must have been allocated using DRVR_ALLOC.
+ * in the request description. buffer must have been allocated using
+ * DRVR_ALLOC.
+ *
+ * NOTE: On an IN transaction, req and buffer may refer to the same
+ * allocated memory.
*
- * NOTE: On an IN transaction, req and buffer may refer to the same allocated
- * memory.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_CTRLIN(drvr,ep0,req,buffer) ((drvr)->ctrlin(drvr,ep0,req,buffer))
#define DRVR_CTRLOUT(drvr,ep0,req,buffer) ((drvr)->ctrlout(drvr,ep0,req,buffer))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_TRANSFER
*
* Description:
@@ -473,18 +487,19 @@
* transfer has completed.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * ep - The IN or OUT endpoint descriptor for the device endpoint on which to
- * perform the transfer.
- * buffer - A buffer containing the data to be sent (OUT endpoint) or received
- * (IN endpoint). buffer must have been allocated using DRVR_ALLOC
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * ep - The IN or OUT endpoint descriptor for the device endpoint on
+ * which to perform the transfer.
+ * buffer - A buffer containing the data to be sent (OUT endpoint) or
+ * received (IN endpoint). Buffer must have been allocated using
+ * DRVR_ALLOC
* buflen - The length of the data to be sent or received.
*
* Returned Value:
* On success, a non-negative value is returned that indicates the number
- * of bytes successfully transferred. On a failure, a negated errno value is
- * returned that indicates the nature of the failure:
+ * of bytes successfully transferred. On a failure, a negated errno value
+ * is returned that indicates the nature of the failure:
*
* EAGAIN - If devices NAKs the transfer (or NYET or other error where
* it may be appropriate to restart the entire transaction).
@@ -495,12 +510,12 @@
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_TRANSFER(drvr,ep,buffer,buflen) \
((drvr)->transfer(drvr,ep,buffer,buflen))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_ASYNCH
*
* Description:
@@ -515,32 +530,33 @@
* infrequently.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * ep - The IN or OUT endpoint descriptor for the device endpoint on which to
- * perform the transfer.
- * buffer - A buffer containing the data to be sent (OUT endpoint) or received
- * (IN endpoint). buffer must have been allocated using DRVR_ALLOC
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * ep - The IN or OUT endpoint descriptor for the device endpoint on
+ * which to perform the transfer.
+ * buffer - A buffer containing the data to be sent (OUT endpoint) or
+ * received (IN endpoint). buffer must have been allocated using
+ * DRVR_ALLOC
* buflen - The length of the data to be sent or received.
* callback - This function will be called when the transfer completes.
- * arg - The arbitrary parameter that will be passed to the callback function
- * when the transfer completes.
+ * arg - The arbitrary parameter that will be passed to the callback
+ * function when the transfer completes.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure.
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure.
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_USBHOST_ASYNCH
# define DRVR_ASYNCH(drvr,ep,buffer,buflen,callback,arg) \
((drvr)->asynch(drvr,ep,buffer,buflen,callback,arg))
#endif
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_CANCEL
*
* Description:
@@ -548,20 +564,20 @@
* asynchronous transfer will complete normally with the error -ESHUTDOWN.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * ep - The IN or OUT endpoint descriptor for the device endpoint on which an
- * asynchronous transfer should be transferred.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * ep - The IN or OUT endpoint descriptor for the device endpoint on
+ * which an asynchronous transfer should be transferred.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure.
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_CANCEL(drvr,ep) ((drvr)->cancel(drvr,ep))
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_CONNECT
*
* Description:
@@ -570,38 +586,39 @@
* and port description to the system.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
* hport - The descriptor of the hub port that detected the connection
* related event
* connected - True: device connected; false: device disconnected
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure.
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure.
*
- ************************************************************************************/
+ ****************************************************************************/
#ifdef CONFIG_USBHOST_HUB
# define DRVR_CONNECT(drvr,hport,connected) \
((drvr)->connect(drvr,hport,connected))
#endif
-/************************************************************************************
+/****************************************************************************
* Name: DRVR_DISCONNECT
*
* Description:
- * Called by the class when an error occurs and driver has been disconnected.
- * The USB host driver should discard the handle to the class instance (it is
- * stale) and not attempt any further interaction with the class driver instance
- * (until a new instance is received from the create() method). The driver
- * should not called the class' disconnected() method.
+ * Called by the class when an error occurs and driver has been
+ * disconnected.
+ * The USB host driver should discard the handle to the class instance
+ * (it is stale) and not attempt any further interaction with the class
+ * driver instance (until a new instance is received from the create()
+ * method). The driver should not called the class' disconnected() method.
*
* Input Parameters:
- * drvr - The USB host driver instance obtained as a parameter from the call to
- * the class create() method.
- * hport - The port from which the device is being disconnected. Might be a port
- * on a hub.
+ * drvr - The USB host driver instance obtained as a parameter from the
+ * call to the class create() method.
+ * hport - The port from which the device is being disconnected.
+ * Might be a port on a hub.
*
* Returned Value:
* None
@@ -609,16 +626,16 @@
* Assumptions:
* This function will *not* be called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
#define DRVR_DISCONNECT(drvr, hport) ((drvr)->disconnect(drvr, hport))
-/************************************************************************************
+/****************************************************************************
* Public Types
- ************************************************************************************/
+ ****************************************************************************/
-/* This struct contains all of the information that is needed to associate a device
- * this is connected via a USB port to a class.
+/* This struct contains all of the information that is needed to associate a
+ * device this is connected via a USB port to a class.
*/
struct usbhost_id_s
@@ -630,35 +647,38 @@ struct usbhost_id_s
uint16_t pid; /* Product ID (for vendor/product specific devices) */
};
-/* The struct usbhost_registry_s type describes information that is kept in the
- * USB host registry. USB host class implementations register this information so
- * that USB host drivers can later find the class that matches the device that is
- * connected to the USB port.
+/* The struct usbhost_registry_s type describes information that is kept in
+ * the USB host registry. USB host class implementations register this
+ * information so that USB host drivers can later find the class that matches
+ * the device that is connected to the USB port.
*/
struct usbhost_hubport_s; /* Forward reference to the hub state structure */
struct usbhost_class_s; /* Forward reference to the class state structure */
struct usbhost_registry_s
{
- /* This field is used to implement a singly-link registry structure. Because of
- * the presence of this link, provides of struct usbhost_registry_s instances must
- * provide those instances in write-able memory (RAM).
+ /* This field is used to implement a singly-link registry structure.
+ * Because of the presence of this link, provides of struct
+ * usbhost_registry_s instances must provide those instances in write-able
+ * memory (RAM).
*/
FAR struct usbhost_registry_s *flink;
- /* This is a callback into the class implementation. It is used to (1) create
- * a new instance of the USB host class state and to (2) bind a USB host driver
- * "session" to the class instance. Use of this create() method will support
- * environments where there may be multiple USB ports and multiple USB devices
- * simultaneously connected (see the CLASS_CREATE() macro above).
+ /* This is a callback into the class implementation. It is used to (1)
+ * create a new instance of the USB host class state and to (2) bind a
+ * USB host driver "session" to the class instance. Use of this create()
+ * method will support environments where there may be multiple USB ports
+ * and multiple USB devices simultaneously connected
+ * (see the CLASS_CREATE() macro above).
*/
- CODE FAR struct usbhost_class_s *(*create)(FAR struct usbhost_hubport_s *hub,
- FAR const struct usbhost_id_s *id);
+ CODE FAR struct usbhost_class_s *(*create)
+ (FAR struct usbhost_hubport_s *hub,
+ FAR const struct usbhost_id_s *id);
- /* This information uniquely identifies the USB host class implementation that
- * goes with a specific USB device.
+ /* This information uniquely identifies the USB host class implementation
+ * that goes with a specific USB device.
*/
uint8_t nids; /* Number of IDs in the id[] array */
@@ -738,7 +758,9 @@ struct usbhost_class_s
FAR const uint8_t *configdesc,
int desclen);
- /* This method informs the class that the USB device has been disconnected. */
+ /* This method informs the class that the USB device has been
+ * disconnected.
+ */
CODE int (*disconnected)(FAR struct usbhost_class_s *devclass);
};
@@ -759,9 +781,9 @@ struct usbhost_epdesc_s
uint16_t mxpacketsize; /* Max packetsize */
};
-/* struct usbhost_connection_s provides as interface between platform-specific
- * connection monitoring and the USB host driver connection and enumeration
- * logic.
+/* struct usbhost_connection_s provides as interface between
+ * platform-specific connection monitoring and the USB host driver
+ * connection and enumeration logic.
*/
struct usbhost_connection_s
@@ -775,10 +797,10 @@ struct usbhost_connection_s
* enumeration process, the driver will (1) get the device's configuration
* descriptor, (2) extract the class ID info from the configuration
* descriptor, (3) call usbhost_findclass() to find the class that supports
- * this device, (4) call the create() method on the struct usbhost_registry_s
- * interface to get a class instance, and finally (5) call the connect()
- * method of the struct usbhost_class_s interface. After that, the class is
- * in charge of the sequence of operations.
+ * this device, (4) call the create() method on the struct
+ * usbhost_registry_s interface to get a class instance, and finally (5)
+ * call the connect() method of the struct usbhost_class_s interface.
+ * After that, the class is in charge of the sequence of operations.
*/
CODE int (*enumerate)(FAR struct usbhost_connection_s *conn,
@@ -822,22 +844,25 @@ struct usbhost_driver_s
* hardware does not support such "special" memory, these functions may
* simply map to kmm_malloc and kmm_free.
*
- * This interface was optimized under a particular assumption. It was assumed
- * that the driver maintains a pool of small, pre-allocated buffers for descriptor
- * traffic. NOTE that size is not an input, but an output: The size of the
- * pre-allocated buffer is returned.
+ * This interface was optimized under a particular assumption. It was
+ * assumed that the driver maintains a pool of small, pre-allocated buffers
+ * for descriptor traffic.
+ * NOTE that size is not an input, but an output:
+ * The size of the pre-allocated buffer is returned.
*/
CODE int (*alloc)(FAR struct usbhost_driver_s *drvr,
FAR uint8_t **buffer, FAR size_t *maxlen);
CODE int (*free)(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer);
- /* Some hardware supports special memory in which larger IO buffers can
- * be accessed more efficiently. This method provides a mechanism to allocate
- * the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to kmm_malloc.
+ /* Some hardware supports special memory in which larger IO buffers can
+ * be accessed more efficiently. This method provides a mechanism to
+ * allocate the request/descriptor memory. If the underlying hardware
+ * does not support such "special" memory, this functions may simply map
+ * to kmm_malloc.
*
- * This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
+ * This interface differs from DRVR_ALLOC in that the buffers are
+ * variable-sized.
*/
CODE int (*ioalloc)(FAR struct usbhost_driver_s *drvr,
@@ -846,9 +871,9 @@ struct usbhost_driver_s
FAR uint8_t *buffer);
/* Process a IN or OUT request on the control endpoint. These methods
- * will enqueue the request and wait for it to complete. Only one transfer may
- * be queued; Neither these methods nor the transfer() method can be called again
- * until the control transfer methods returns.
+ * will enqueue the request and wait for it to complete. Only one transfer
+ * may be queued; Neither these methods nor the transfer() method can be
+ * called again until the control transfer methods returns.
*
* These are blocking methods; these methods will not return until the
* control transfer has completed.
@@ -891,7 +916,9 @@ struct usbhost_driver_s
usbhost_asynch_t callback, FAR void *arg);
#endif
- /* Cancel any pending syncrhonous or asynchronous transfer on an endpoint */
+ /* Cancel any pending syncrhonous or asynchronous transfer on an
+ * endpoint
+ */
CODE int (*cancel)(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep);
@@ -906,19 +933,20 @@ struct usbhost_driver_s
bool connected);
#endif
- /* Called by the class when an error occurs and driver has been disconnected.
- * The USB host driver should discard the handle to the class instance (it is
- * stale) and not attempt any further interaction with the class driver instance
- * (until a new instance is received from the create() method).
+ /* Called by the class when an error occurs and driver has been
+ * disconnected. The USB host driver should discard the handle to the class
+ * instance (it is stale) and not attempt any further interaction with the
+ * class driver instance (until a new instance is received from the
+ * create() method).
*/
CODE void (*disconnect)(FAR struct usbhost_driver_s *drvr,
FAR struct usbhost_hubport_s *hport);
};
-/************************************************************************************
+/****************************************************************************
* Public Data
- ************************************************************************************/
+ ****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
@@ -929,57 +957,58 @@ extern "C"
#define EXTERN extern
#endif
-/************************************************************************************
+/****************************************************************************
* Public Function Prototypes
- ************************************************************************************/
+ ****************************************************************************/
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_registerclass
*
* Description:
- * Register a USB host class implementation. The caller provides an instance of
- * struct usbhost_registry_s that contains all of the information that will be
- * needed later to (1) associate the USB host class implementation with a connected
- * USB device, and (2) to obtain and bind a struct usbhost_class_s instance for
- * the device.
+ * Register a USB host class implementation. The caller provides an
+ * instance of struct usbhost_registry_s that contains all of the
+ * information that will be needed later to (1) associate the USB host
+ * class implementation with a connected USB device, and (2) to obtain and
+ * bind a struct usbhost_class_s instance for the device.
*
* Input Parameters:
- * devclass - An write-able instance of struct usbhost_registry_s that will be
- * maintained in a registry.
+ * devclass - An write-able instance of struct usbhost_registry_s that will
+ * be maintained in a registry.
*
* Returned Value:
- * On success, this function will return zero (OK). Otherwise, a negated errno
- * value is returned.
+ * On success, this function will return zero (OK). Otherwise, a negated
+ * errno value is returned.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_registerclass(FAR struct usbhost_registry_s *devclass);
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_findclass
*
* Description:
* Find a USB host class implementation previously registered by
- * usbhost_registerclass(). On success, an instance of struct usbhost_registry_s
- * will be returned. That instance will contain all of the information that will
- * be needed to obtain and bind a struct usbhost_class_s instance for the device.
+ * usbhost_registerclass(). On success, an instance of struct
+ * usbhost_registry_s will be returned. That instance will contain all of
+ * the information that will be needed to obtain and bind a struct
+ * usbhost_class_s instance for the device.
*
* Input Parameters:
* id - Identifies the USB device class that has connect to the USB host.
*
* Returned Value:
* On success this function will return a non-NULL instance of struct
- * usbhost_registry_s. NULL will be returned on failure. This function can only
- * fail if (1) id is NULL, or (2) no USB host class is registered that matches the
- * device class ID.
+ * usbhost_registry_s. NULL will be returned on failure. This function
+ * can only fail if (1) id is NULL, or (2) no USB host class is registered
+ * that matches the device class ID.
*
- ************************************************************************************/
+ ****************************************************************************/
const struct usbhost_registry_s *
usbhost_findclass(FAR const struct usbhost_id_s *id);
#ifdef CONFIG_USBHOST_HUB
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_hub_initialize
*
* Description:
@@ -994,13 +1023,13 @@ const struct usbhost_registry_s *
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_hub_initialize(void);
#endif
#ifdef CONFIG_USBHOST_MSC
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_msc_initialize
*
* Description:
@@ -1015,12 +1044,12 @@ int usbhost_hub_initialize(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_msc_initialize(void);
# ifdef CONFIG_USBHOST_MSC_NOTIFIER
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_msc_notifier_setup
*
* Description:
@@ -1044,12 +1073,12 @@ int usbhost_msc_initialize(void);
* returned value is a negated errno value that indicates the
* nature of the failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_msc_notifier_setup(worker_t worker, uint8_t event, char sdchar,
FAR void *arg);
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_msc_notifier_teardown
*
* Description:
@@ -1067,11 +1096,11 @@ int usbhost_msc_notifier_setup(worker_t worker, uint8_t event, char sdchar,
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_msc_notifier_teardown(int key);
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_msc_notifier_signal
*
* Description:
@@ -1085,7 +1114,7 @@ int usbhost_msc_notifier_teardown(int key);
* Returned Value:
* None.
*
- ************************************************************************************/
+ ****************************************************************************/
void usbhost_msc_notifier_signal(uint8_t event, char sdchar);
@@ -1093,7 +1122,7 @@ void usbhost_msc_notifier_signal(uint8_t event, char sdchar);
#endif
#ifdef CONFIG_USBHOST_CDCACM
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_cdcacm_initialize
*
* Description:
@@ -1108,13 +1137,13 @@ void usbhost_msc_notifier_signal(uint8_t event, char sdchar);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_cdcacm_initialize(void);
#endif
#ifdef CONFIG_USBHOST_FT232R
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_ft232r_initialize
*
* Description:
@@ -1129,13 +1158,13 @@ int usbhost_cdcacm_initialize(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_ft232r_initialize(void);
#endif
#ifdef CONFIG_USBHOST_HIDKBD
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_kbdinit
*
* Description:
@@ -1150,13 +1179,13 @@ int usbhost_ft232r_initialize(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_kbdinit(void);
#endif
#ifdef CONFIG_USBHOST_HIDMOUSE
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_mouse_init
*
* Description:
@@ -1171,13 +1200,13 @@ int usbhost_kbdinit(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_mouse_init(void);
#endif
#ifdef CONFIG_USBHOST_XBOXCONTROLLER
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_xboxcontroller_init
*
* Description:
@@ -1192,12 +1221,12 @@ int usbhost_mouse_init(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_xboxcontroller_init(void);
#endif
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_wlaninit
*
* Description:
@@ -1212,17 +1241,17 @@ int usbhost_xboxcontroller_init(void);
* On success this function will return zero (OK); A negated errno value
* will be returned on failure.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_wlaninit(void);
-/************************************************************************************
+/****************************************************************************
* Name: usbhost_enumerate
*
* Description:
* This is a share-able implementation of most of the logic required by the
- * driver enumerate() method. This logic within this method should be common
- * to all USB host drivers.
+ * driver enumerate() method. This logic within this method should be
+ * common to all USB host drivers.
*
* Enumerate the connected device. As part of this enumeration process,
* the driver will (1) get the device's configuration descriptor, (2)
@@ -1240,15 +1269,15 @@ int usbhost_wlaninit(void);
* this caller-provided memory location.
*
* Returned Value:
- * On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * On success, zero (OK) is returned. On a failure, a negated errno value
+ * is returned indicating the nature of the failure
*
* Assumptions:
* - Only a single class bound to a single device is supported.
* - Called from a single thread so no mutual exclusion is required.
* - Never called from an interrupt handler.
*
- ************************************************************************************/
+ ****************************************************************************/
int usbhost_enumerate(FAR struct usbhost_hubport_s *hub,
FAR struct usbhost_class_s **devclass);
diff --git a/include/nuttx/usb/usbhost_devaddr.h b/include/nuttx/usb/usbhost_devaddr.h
index 9909141..cda3928 100644
--- a/include/nuttx/usb/usbhost_devaddr.h
+++ b/include/nuttx/usb/usbhost_devaddr.h
@@ -87,7 +87,7 @@ extern "C"
#endif
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
struct usbhost_hubport_s; /* Forward reference */
@@ -133,12 +133,12 @@ int usbhost_devaddr_create(FAR struct usbhost_hubport_s *hport);
* Name: usbhost_devaddr_destroy
*
* Description:
- * Release a device address previously assigned by usbhost_devaddr_create().
+ * Release a device address previously assigned by usbhost_devaddr_create().
*
* Input Parameters:
- * hport - A reference to a hub port structure from which a device has been
+ * hport - A reference to a hub port structure from which a device has been
* disconnected and so no longer needs the function address.
- * devaddr - The address to be released.
+ * devaddr - The address to be released.
*
* Returned Value:
* None
diff --git a/include/nuttx/usb/usbhost_trace.h b/include/nuttx/usb/usbhost_trace.h
index 61db2d1..4116b5e 100644
--- a/include/nuttx/usb/usbhost_trace.h
+++ b/include/nuttx/usb/usbhost_trace.h
@@ -45,7 +45,9 @@
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
+
/* Configuration ************************************************************/
+
/* Debug/Trace-related definitions */
#ifndef CONFIG_DEBUG_FEATURES
@@ -57,7 +59,9 @@
# undef CONFIG_USBHOST_TRACE_VERBOSE
#endif
-/* Trace support is needed if either USB host tracing or USB debug output is enabled */
+/* Trace support is needed if either USB host tracing or USB debug output is
+ * enabled
+ */
#if defined(CONFIG_USBHOST_TRACE) || defined(CONFIG_DEBUG_USB)
# define HAVE_USBHOST_TRACE 1
@@ -101,7 +105,7 @@ extern "C"
#endif
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
/****************************************************************************
diff --git a/include/nuttx/usb/usbmsc.h b/include/nuttx/usb/usbmsc.h
index dd5796c..e96d6dd 100644
--- a/include/nuttx/usb/usbmsc.h
+++ b/include/nuttx/usb/usbmsc.h
@@ -85,7 +85,7 @@ extern "C"
#endif
/****************************************************************************
- * Public Functions
+ * Public Functions Definitions
****************************************************************************/
/****************************************************************************
@@ -133,8 +133,12 @@ int usbmsc_configure(unsigned int nluns, FAR void **handle);
*
****************************************************************************/
-int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath, unsigned int lunno,
- off_t startsector, size_t nsectors, bool readonly);
+int usbmsc_bindlun(FAR void *handle,
+ FAR const char *drvrpath,
+ unsigned int lunno,
+ off_t startsector,
+ size_t nsectors,
+ bool readonly);
/****************************************************************************
* Name: usbmsc_unbindlun
@@ -187,7 +191,8 @@ int usbmsc_exportluns(FAR void *handle);
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_USBMSC_COMPOSITE)
struct usbdevclass_driver_s;
-int usbmsc_classobject(FAR void *handle, FAR struct usbdev_devinfo_s *devinfo,
+int usbmsc_classobject(FAR void *handle,
+ FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev);
#endif
@@ -214,8 +219,8 @@ void usbmsc_uninitialize(FAR void *handle);
* Name: usbmsc_get_composite_devdesc
*
* Description:
- * Helper function to fill in some constants into the composite configuration
- * structure.
+ * Helper function to fill in some constants into the composite
+ * configuration structure.
*
* Input Parameters:
* dev - Pointer to the configuration struct we should fill
[incubator-nuttx] 06/08: include: nuttx: syslog: nxstyle error fix
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 3bdf98cc332165f67ba5276b5159acfd6ec18f61
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jan 28 17:27:46 2021 +0100
include: nuttx: syslog: nxstyle error fix
Nxstyle error fix to silence the CI.
Signed-off-by: Alin Jerpelea <al...@sony.com>
---
include/nuttx/syslog/syslog_console.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/nuttx/syslog/syslog_console.h b/include/nuttx/syslog/syslog_console.h
index af76585..8a97562 100644
--- a/include/nuttx/syslog/syslog_console.h
+++ b/include/nuttx/syslog/syslog_console.h
@@ -48,7 +48,9 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Configuration ************************************************************/
+
/* CONFIG_CONSOLE_SYSLOG - Use the syslog logging output as a system console.
* If this feature is enabled (along with CONFIG_DEV_CONSOLE), then all
* console output will be re-directed to the SYSLOG output channel. This