include: Fix nxstyle errors

error: Long line found
This commit is contained in:
simbit18 2023-05-03 16:11:05 +02:00 committed by Xiang Xiao
parent e7df243a4a
commit b1404f486e
15 changed files with 363 additions and 322 deletions

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/fcntl.h * include/fcntl.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,23 +16,23 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_FCNTL_H #ifndef __INCLUDE_FCNTL_H
#define __INCLUDE_FCNTL_H #define __INCLUDE_FCNTL_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* open flag settings for open() (and related APIs) */ /* open flag settings for open() (and related APIs) */
@ -162,9 +162,9 @@
# define posix_fallocate64 posix_fallocate # define posix_fallocate64 posix_fallocate
#endif #endif
/******************************************************************************** /****************************************************************************
* Public Type Definitions * Public Type Definitions
********************************************************************************/ ****************************************************************************/
/* struct flock is the third argument for F_GETLK, F_SETLK and F_SETLKW */ /* struct flock is the third argument for F_GETLK, F_SETLK and F_SETLKW */
@ -177,9 +177,9 @@ struct flock
pid_t l_pid; /* PID of process blocking our lock (F_GETLK only) */ pid_t l_pid; /* PID of process blocking our lock (F_GETLK only) */
}; };
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@ -190,9 +190,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/******************************************************************************** /****************************************************************************
* Public Data * Public Data
********************************************************************************/ ****************************************************************************/
/* POSIX-like File System Interfaces */ /* POSIX-like File System Interfaces */

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/limits.h * include/limits.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_LIMITS_H #ifndef __INCLUDE_LIMITS_H
#define __INCLUDE_LIMITS_H #define __INCLUDE_LIMITS_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -31,11 +31,11 @@
#include <arch/limits.h> #include <arch/limits.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* Default values for user configurable limits **********************************/ /* Default values for user configurable limits ******************************/
/* Maximum number of bytes in a filename (not including terminating null). */ /* Maximum number of bytes in a filename (not including terminating null). */
@ -62,7 +62,7 @@
#define MB_LEN_MAX 4 #define MB_LEN_MAX 4
/* Configurable limits required by POSIX **************************************** /* Configurable limits required by POSIX ************************************
* *
* Required for all implementations: * Required for all implementations:
* *
@ -74,15 +74,18 @@
* _POSIX_NAME_MAX Number of bytes in a file or pathname component * _POSIX_NAME_MAX Number of bytes in a file or pathname component
* _POSIX_NGROUPS_MAX Number supplementary group IDs * _POSIX_NGROUPS_MAX Number supplementary group IDs
* _POSIX_OPEN_MAX Number of files a task can have open at once * _POSIX_OPEN_MAX Number of files a task can have open at once
* _POSIX_PATH_MAX Number of bytes in a full pathname (including NULL) * _POSIX_PATH_MAX Number of bytes in a full pathname
* (including NULL)
* _POSIX_PIPE_BUF Number of bytes for atomic write into pipe * _POSIX_PIPE_BUF Number of bytes for atomic write into pipe
* _POSIX_SSIZE_MAX Largest filesystem write; also max value of ssize_t * _POSIX_SSIZE_MAX Largest filesystem write; also max value
* of ssize_t
* _POSIX_STREAM_MAX Number of std I/O streams open at once * _POSIX_STREAM_MAX Number of std I/O streams open at once
* _POSIX_TZNAME_MAX Max number of bytes of a timezone name * _POSIX_TZNAME_MAX Max number of bytes of a timezone name
* *
* Required for sigqueue * Required for sigqueue
* *
* _POSIX_RTSIG_MAX Number of realtime signals reserved for application * _POSIX_RTSIG_MAX Number of realtime signals reserved
* for application
* _POSIX_SIGQUEUE_MAX Max number signals a task can queue * _POSIX_SIGQUEUE_MAX Max number signals a task can queue
* *
* Required for POSIX timers * Required for POSIX timers
@ -107,9 +110,9 @@
* _POSIX_SEM_VALUE_MAX Max value a semaphore may have * _POSIX_SEM_VALUE_MAX Max value a semaphore may have
* *
* Required for symbolic links * Required for symbolic links
* _POSIX_SYMLOOP_MAX Maximum number of symbolic links that can be * _POSIX_SYMLOOP_MAX Maximum number of symbolic links that can be
* reliably traversed in the resolution of a pathname * reliably traversed in the resolution of a pathname
* in the absence of a loop. * in the absence of a loop.
* *
*/ */

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/mqueue.h * include/mqueue.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,27 +16,27 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_MQUEUE_H #ifndef __INCLUDE_MQUEUE_H
#define __INCLUDE_MQUEUE_H #define __INCLUDE_MQUEUE_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
#define MQ_NONBLOCK O_NONBLOCK #define MQ_NONBLOCK O_NONBLOCK
/******************************************************************************** /****************************************************************************
* Public Type Declarations * Public Type Declarations
********************************************************************************/ ****************************************************************************/
/* Message queue attributes */ /* Message queue attributes */
@ -52,9 +52,9 @@ struct mq_attr
typedef int mqd_t; typedef int mqd_t;
/******************************************************************************** /****************************************************************************
* Public Data * Public Data
********************************************************************************/ ****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN extern "C" #define EXTERN extern "C"
@ -64,9 +64,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
mqd_t mq_open(FAR const char *mq_name, int oflags, ...); mqd_t mq_open(FAR const char *mq_name, int oflags, ...);
int mq_close(mqd_t mqdes); int mq_close(mqd_t mqdes);

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/analog/comp.h * include/nuttx/analog/comp.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_ANALOG_COMP_H #ifndef __INCLUDE_NUTTX_ANALOG_COMP_H
#define __INCLUDE_NUTTX_ANALOG_COMP_H #define __INCLUDE_NUTTX_ANALOG_COMP_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -40,15 +40,15 @@
# define CONFIG_DEV_COMP_NPOLLWAITERS 2 # define CONFIG_DEV_COMP_NPOLLWAITERS 2
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
struct comp_dev_s; struct comp_dev_s;
struct comp_callback_s struct comp_callback_s
{ {
/* This method is called from the lower half, platform-specific COMP logic when /* This method is called from the lower half, platform-specific COMP logic
* comparator output state changes. * when comparator output state changes.
* *
* Input Parameters: * Input Parameters:
* dev - The COMP device structure that was previously registered by * dev - The COMP device structure that was previously registered by
@ -64,8 +64,8 @@ struct comp_callback_s
struct comp_ops_s struct comp_ops_s
{ {
/* Bind the upper-half driver callbacks to the lower-half implementation. This /* Bind the upper-half driver callbacks to the lower-half implementation.
* must be called early in order to receive COMP event notifications. * This must be called early in order to receive COMP event notifications.
*/ */
CODE int (*ao_bind)(FAR struct comp_dev_s *dev, CODE int (*ao_bind)(FAR struct comp_dev_s *dev,
@ -73,8 +73,8 @@ struct comp_ops_s
/* Configure the COMP. This method is called the first time that the COMP /* Configure the COMP. This method is called the first time that the COMP
* device is opened. This will occur when the port is first opened. * device is opened. This will occur when the port is first opened.
* This setup includes configuring and attaching COMP interrupts. Interrupts * This setup includes configuring and attaching COMP interrupts.
* are all disabled upon return. * Interrupts are all disabled upon return.
*/ */
CODE int (*ao_setup)(FAR struct comp_dev_s *dev); CODE int (*ao_setup)(FAR struct comp_dev_s *dev);
@ -92,7 +92,8 @@ struct comp_ops_s
/* All ioctl calls will be routed through this method */ /* All ioctl calls will be routed through this method */
CODE int (*ao_ioctl)(FAR struct comp_dev_s *dev, int cmd, unsigned long arg); CODE int (*ao_ioctl)(FAR struct comp_dev_s *dev,
int cmd, unsigned long arg);
}; };
struct comp_dev_s struct comp_dev_s
@ -116,9 +117,9 @@ struct comp_dev_s
FAR void *ad_priv; /* Used by the arch-specific logic */ FAR void *ad_priv; /* Used by the arch-specific logic */
}; };
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" extern "C"

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/analog/opamp.h * include/nuttx/analog/opamp.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_ANALOG_OPAMP_H #ifndef __INCLUDE_NUTTX_ANALOG_OPAMP_H
#define __INCLUDE_NUTTX_ANALOG_OPAMP_H #define __INCLUDE_NUTTX_ANALOG_OPAMP_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -35,22 +35,23 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/mutex.h> #include <nuttx/mutex.h>
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
struct opamp_dev_s; struct opamp_dev_s;
struct opamp_ops_s struct opamp_ops_s
{ {
/* Configure the OPAMP. This method is called the first time that the OPAMP /* Configure the OPAMP. This method is called the first time that the OPAMP
* device is opened. This will occur when the port is first opened. * device is opened. This will occur when the port is first opened.
* This setup includes configuring and attaching OPAMP interrupts. Interrupts * This setup includes configuring and attaching OPAMP interrupts.
* are all disabled upon return. * Interruptsare all disabled upon return.
*/ */
CODE int (*ao_setup)(FAR struct opamp_dev_s *dev); CODE int (*ao_setup)(FAR struct opamp_dev_s *dev);
/* Disable the OPAMP. This method is called when the OPAMP device is closed. /* Disable the OPAMP. This method is called when the OPAMP device
* is closed.
* This method reverses the operation of the setup method. * This method reverses the operation of the setup method.
* Works only if OPAMP device is not locked. * Works only if OPAMP device is not locked.
*/ */
@ -59,7 +60,8 @@ struct opamp_ops_s
/* All ioctl calls will be routed through this method */ /* All ioctl calls will be routed through this method */
CODE int (*ao_ioctl)(FAR struct opamp_dev_s *dev, int cmd, unsigned long arg); CODE int (*ao_ioctl)(FAR struct opamp_dev_s *dev,
int cmd, unsigned long arg);
}; };
struct opamp_dev_s struct opamp_dev_s
@ -77,9 +79,9 @@ struct opamp_dev_s
FAR void *ad_priv; /* Used by the arch-specific logic */ FAR void *ad_priv; /* Used by the arch-specific logic */
}; };
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" extern "C"

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/binfmt/ieee695.h * include/nuttx/binfmt/ieee695.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,24 +16,24 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_BINFMT_IEEE695_H #ifndef __INCLUDE_NUTTX_BINFMT_IEEE695_H
#define __INCLUDE_NUTTX_BINFMT_IEEE695_H #define __INCLUDE_NUTTX_BINFMT_IEEE695_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdint.h> #include <stdint.h>
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* IEEE695 Record Types *************************************************************/ /* IEEE695 Record Types *****************************************************/
#define IEEE695_RECTYPE_THEADR 0x80 /* Translator Header Record */ #define IEEE695_RECTYPE_THEADR 0x80 /* Translator Header Record */
#define IEEE695_RECTYPE_LHEADR 0x82 /* Library Module Header Record */ #define IEEE695_RECTYPE_LHEADR 0x82 /* Library Module Header Record */
@ -130,8 +130,8 @@
#define IEEE695_COMENT_CMDLINE 0xff /* Command line (Microsoft QuickC) */ #define IEEE695_COMENT_CMDLINE 0xff /* Command line (Microsoft QuickC) */
/* 0xc0-0xff Reserved for user-defined comment classes */ /* 0xc0-0xff Reserved for user-defined comment classes */
/* OMF extensions to the comment class. This class consists of a set of records, /* OMF extensions to the comment class. This class consists of a set
* identified by subtype (first byte of commentary string). * of records, identified by subtype (first byte of commentary string).
*/ */
#define IEEE695_OMFEXT_IMPDEF 0x01 /* Import definition record */ #define IEEE695_OMFEXT_IMPDEF 0x01 /* Import definition record */
@ -143,16 +143,18 @@
#define IEEE695_OMFEXT_PRECOMP 0x07 #define IEEE695_OMFEXT_PRECOMP 0x07
/* 0x08-0xff Reserved */ /* 0x08-0xff Reserved */
/* Link pass separator. This record conveys information to the linker about the /* Link pass separator. This record conveys information to the linker about
* organization of the file. The value of the first byte of the commentary string * the organization of the file. The value of the first byte of the
* specifies the comment subtype. Currently, a single subtype is defined: * commentary string specifies the comment subtype.
* Currently, a single subtype is defined:
* *
* Note: This comment class may become obsolete with the advent of COMDAT records. * Note: This comment class may become obsolete with the advent of
* COMDAT records.
*/ */
#define IEEE695_COMENT_PASS2 0x01 /* Records generated from Pass 2 of the linker */ #define IEEE695_COMENT_PASS2 0x01 /* Records generated from Pass 2 of the linker */
/* Standard Functions, Identifiers and Commands *************************************/ /* Standard Functions, Identifiers and Commands *****************************/
/* Standard functions */ /* Standard functions */
@ -316,7 +318,8 @@
#define IEEE695_SYMATTR_CONSTANT 16 /* Constant (see additional attributes below */ #define IEEE695_SYMATTR_CONSTANT 16 /* Constant (see additional attributes below */
#define IEEE695_SYMATTR_STATIC 19 /* Static symbol generated by assembler */ #define IEEE695_SYMATTR_STATIC 19 /* Static symbol generated by assembler */
/* Constant Symbol Attributes. Constant symbols have four additional arguments: /* Constant Symbol Attributes.
* Constant symbols have four additional arguments:
* *
* 1. Symbol class * 1. Symbol class
* 2. Public/local indicator (optional). One means public. * 2. Public/local indicator (optional). One means public.
@ -332,9 +335,11 @@
#define IEEE695_SYMCLASS_PASCAL 3 /* Pascal CONST constant */ #define IEEE695_SYMCLASS_PASCAL 3 /* Pascal CONST constant */
#define IEEE695_SYMCLASS_DEFINE 4 /* C #define constant */ #define IEEE695_SYMCLASS_DEFINE 4 /* C #define constant */
/* Helper Macros ********************************************************************/ /* Helper Macros ************************************************************/
/* These macros extract un-aligned, little-endian values from the object file */ /* These macros extract un-aligned, little-endian values
* from the object file
*/
#define IEEE695_GETUINT16(p) \ #define IEEE695_GETUINT16(p) \
(((uint16_t)(*(FAR uint8_t *)(p)) << 8) | \ (((uint16_t)(*(FAR uint8_t *)(p)) << 8) | \
@ -355,9 +360,9 @@
#define IEEE695_MAX_RECLEN 1024 #define IEEE695_MAX_RECLEN 1024
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/* This structure describes one IEEE 605 record. The actual size of the /* This structure describes one IEEE 605 record. The actual size of the
* data[] array is the value of the 'len' field plus one to account to a * data[] array is the value of the 'len' field plus one to account to a
@ -415,9 +420,9 @@ struct ieee695_modend_s
uint8_t mdata[1]; /* Module data begins here */ uint8_t mdata[1]; /* Module data begins here */
}; };
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
@ -427,9 +432,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Functions Definitions * Public Functions Definitions
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/can/can.h * include/nuttx/can/can.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_CAN_CAN_H #ifndef __INCLUDE_NUTTX_CAN_CAN_H
#define __INCLUDE_NUTTX_CAN_CAN_H #define __INCLUDE_NUTTX_CAN_CAN_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -44,39 +44,41 @@
#ifdef CONFIG_CAN #ifdef CONFIG_CAN
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* Configuration ********************************************************************/ /* Configuration ************************************************************/
/* CONFIG_CAN - Enables CAN support (MCU-specific selections are also required. For /* CONFIG_CAN - Enables CAN support
* STM32, as an example, one or both of CONFIG_STM32_CAN1 or CONFIG_STM32_CAN2 * (MCU-specific selections are also required. For STM32, as an example,
* must also be defined) * one or both of CONFIG_STM32_CAN1 or CONFIG_STM32_CAN2
* must also be defined).
* CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default * CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default
* Standard 11-bit IDs. * Standard 11-bit IDs.
* CONFIG_CAN_FD - Enable support for CAN FD mode. For the upper half driver, this * CONFIG_CAN_FD - Enable support for CAN FD mode.
* just means handling encoded DLC values (for values of DLC > 9). * For the upper half driver, this just means handling encoded DLC values
* (for values of DLC > 9).
* CONFIG_CAN_FIFOSIZE - The size of the circular buffer of CAN messages. * CONFIG_CAN_FIFOSIZE - The size of the circular buffer of CAN messages.
* Default: 8 * Default: 8
* CONFIG_CAN_NPENDINGRTR - The size of the list of pending RTR requests. * CONFIG_CAN_NPENDINGRTR - The size of the list of pending RTR requests.
* Default: 4 * Default: 4
* CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback * CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback
* mode for testing. If the driver does support loopback mode, the setting * mode for testing. If the driver does support loopback mode, the setting
* will enable it. (If the driver does not, this setting will have no effect). * will enable it. (If the driver does not, this setting will have
* The loopback mode may be changed later by ioctl() if the driver supports the * no effect). The loopback mode may be changed later by ioctl()
* CANIOC_SET_CONNMODES ioctl command. * if the driver supports the CANIOC_SET_CONNMODES ioctl command.
* CONFIG_CAN_TXREADY - Add support for the can_txready() callback. This is needed * CONFIG_CAN_TXREADY - Add support for the can_txready() callback.
* only for CAN hardware the supports an separate H/W TX message FIFO. The call * This is needed only for CAN hardware the supports an separate
* back is needed to keep the S/W FIFO and the H/W FIFO in sync. Work queue * H/W TX message FIFO. The call back is needed to keep the S/W FIFO and
* support is needed for this feature. * the H/W FIFO in sync. Work queue support is needed for this feature.
* CONFIG_CAN_TXREADY_HIPRI or CONFIG_CAN_TXREADY_LOPRI - Selects which work queue * CONFIG_CAN_TXREADY_HIPRI or CONFIG_CAN_TXREADY_LOPRI - Selects which
* will be used for the can_txready() processing. * work queue will be used for the can_txready() processing.
*/ */
/* Default configuration settings that may be overridden in the NuttX configuration /* Default configuration settings that may be overridden in the NuttX
* file or in the board configuration file. The configured size is limited to 255 * configuration file or in the board configuration file.
* to fit into a uint8_t. * The configured size is limited to 255 to fit into a uint8_t.
*/ */
#if !defined(CONFIG_CAN_FIFOSIZE) #if !defined(CONFIG_CAN_FIFOSIZE)
@ -93,18 +95,19 @@
# define CONFIG_CAN_NPENDINGRTR 255 # define CONFIG_CAN_NPENDINGRTR 255
#endif #endif
/* Ioctl Commands *******************************************************************/ /* Ioctl Commands ***********************************************************/
/* Ioctl commands supported by the upper half CAN driver. /* Ioctl commands supported by the upper half CAN driver.
* *
* CANIOC_RTR: * CANIOC_RTR:
* Description: Send the given message as a remote request. On successful * Description: Send the given message as a remote request.
* return, the passed message structure is updated with * On successful return, the passed message structure
* the contents of the received message; i.e. the message * is updated with the contents of the received message;
* ID and the standard/extended ID indication bit stay the * i.e. the message ID and the standard/extended
* same, but the DLC and data bits are updated with the * ID indication bit stay the same, but the DLC and data
* contents of the received message. If no response is * bits are updated with the contents of the
* received after the specified timeout, ioctl will return. * received message. If no response is received after
* the specified timeout, ioctl will return.
* *
* Note: Lower-half drivers that do not implement * Note: Lower-half drivers that do not implement
* CONFIG_CAN_USE_RTR and implement co_remoterequest * CONFIG_CAN_USE_RTR and implement co_remoterequest
@ -116,7 +119,8 @@
* is returned with the errno variable set to indicate the * is returned with the errno variable set to indicate the
* nature of the error (for example, ETIMEDOUT) * nature of the error (for example, ETIMEDOUT)
* *
* 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: * CANIOC_ADD_STDFILTER:
* Description: Add an address filter for a standard 11 bit address. * Description: Add an address filter for a standard 11 bit address.
@ -175,7 +179,8 @@
* CANIOC_GET_CONNMODES: * CANIOC_GET_CONNMODES:
* Description: Get the current bus connection modes * Description: Get the current bus connection modes
* Argument: A pointer to a write-able instance of struct * 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) * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the * is returned with the errno variable set to indicate the
* nature of the error. * nature of the error.
@ -184,7 +189,8 @@
* CANIOC_SET_CONNMODES: * CANIOC_SET_CONNMODES:
* Description: Set new bus connection modes values * Description: Set new bus connection modes values
* Argument: A pointer to a read-able instance of struct * 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) * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the * is returned with the errno variable set to indicate the
* nature of the error. * nature of the error.
@ -234,32 +240,33 @@
#define CAN_NCMDS 12 /* Ten common commands */ #define CAN_NCMDS 12 /* Ten common commands */
/* User defined ioctl commands are also supported. These will be forwarded /* 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() * by the upper-half CAN driver to the lower-half CAN driver via the
* method of the CAN lower-half interface. However, the lower-half driver * co_ioctl() method of the CAN lower-half interface.
* must reserve a block of commands as follows in order prevent IOCTL * However, the lower-half driver must reserve a block of commands
* command numbers from overlapping. * as follows in order prevent IOCTL command numbers from overlapping.
* *
* This is generally done as follows. The first reservation for CAN driver A would * This is generally done as follows. The first reservation for CAN driver A
* look like: * would look like:
* *
* CAN_A_FIRST (CAN_FIRST + CAN_NCMDS) <- First command * CAN_A_FIRST (CAN_FIRST + CAN_NCMDS) <- First command
* CAN_A_NCMDS 42 <- Number of commands * 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_CMD1 _CANIOC(CAN_A_FIRST+0)
* CANIOC_A_CMD2 _CANIOC(CAN_A_FIRST+1) * CANIOC_A_CMD2 _CANIOC(CAN_A_FIRST+1)
* CANIOC_A_CMD3 _CANIOC(CAN_A_FIRST+2) * 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: * The next reservation would look like:
* *
* CAN_B_FIRST (CAN_A_FIRST + CAN_A_NCMDS) <- Next command * CAN_B_FIRST (CAN_A_FIRST + CAN_A_NCMDS) <- Next command
* CAN_B_NCMDS 77 <- Number of commands * CAN_B_NCMDS 77 <- Number of commands
*/ */
/* Convenience macros ***************************************************************/ /* Convenience macros *******************************************************/
#define dev_reset(dev) dev->cd_ops->co_reset(dev) #define dev_reset(dev) dev->cd_ops->co_reset(dev)
#define dev_setup(dev) dev->cd_ops->co_setup(dev) #define dev_setup(dev) dev->cd_ops->co_setup(dev)
@ -272,7 +279,7 @@
#define dev_txready(dev) dev->cd_ops->co_txready(dev) #define dev_txready(dev) dev->cd_ops->co_txready(dev)
#define dev_txempty(dev) dev->cd_ops->co_txempty(dev) #define dev_txempty(dev) dev->cd_ops->co_txempty(dev)
/* CAN message support **************************************************************/ /* CAN message support ******************************************************/
#ifdef CONFIG_CAN_FD #ifdef CONFIG_CAN_FD
# define CAN_MAXDATALEN 64 # define CAN_MAXDATALEN 64
@ -285,10 +292,12 @@
#define CAN_MSGLEN(nbytes) (sizeof(struct can_msg_s) - CAN_MAXDATALEN + (nbytes)) #define CAN_MSGLEN(nbytes) (sizeof(struct can_msg_s) - CAN_MAXDATALEN + (nbytes))
/* CAN Error Indications ************************************************************/ /* CAN Error Indications ****************************************************/
#ifdef CONFIG_CAN_ERRORS #ifdef CONFIG_CAN_ERRORS
/* Bit settings in the ch_id field of the CAN error message (when ch_error is set) */ /* Bit settings in the ch_id field of the CAN error message
* (when ch_error is set)
*/
# define CAN_ERROR_TXTIMEOUT (1 << 0) /* Bit 0: TX timeout */ # define CAN_ERROR_TXTIMEOUT (1 << 0) /* Bit 0: TX timeout */
# define CAN_ERROR_LOSTARB (1 << 1) /* Bit 1: Lost arbitration (See CAN_ERROR0_* definitions) */ # define CAN_ERROR_LOSTARB (1 << 1) /* Bit 1: Lost arbitration (See CAN_ERROR0_* definitions) */
@ -302,8 +311,8 @@
# define CAN_ERROR_INTERNAL (1 << 9) /* Bit 9: Stack internal error (See CAN_ERROR5_* definitions) */ # define CAN_ERROR_INTERNAL (1 << 9) /* Bit 9: Stack internal error (See CAN_ERROR5_* definitions) */
/* Bit 10: Available */ /* Bit 10: Available */
/* The remaining definitions described the error report payload that follows the /* The remaining definitions described the error report payload that follows
* CAN header. * the CAN header.
*/ */
# define CAN_ERROR_DLC (8) /* DLC of error report */ # define CAN_ERROR_DLC (8) /* DLC of error report */
@ -336,7 +345,9 @@
# define CAN_ERROR2_ACTIVE (1 << 6) /* Bit 6: Active error announcement */ # define CAN_ERROR2_ACTIVE (1 << 6) /* Bit 6: Active error announcement */
# define CAN_ERROR2_TX (1 << 7) /* Bit 7: Error occurred on transmission */ # define CAN_ERROR2_TX (1 << 7) /* Bit 7: Error occurred on transmission */
/* Data[3]: Error in CAN protocol. This provides the loation of the error. */ /* Data[3]: Error in CAN protocol.
* This provides the loation of the error.
*/
# define CAN_ERROR3_UNSPEC 0x00 /* Unspecified error */ # define CAN_ERROR3_UNSPEC 0x00 /* Unspecified error */
# define CAN_ERROR3_SOF 0x01 /* start of frame */ # define CAN_ERROR3_SOF 0x01 /* start of frame */
@ -383,11 +394,11 @@
#endif /* CONFIG_CAN_ERRORS */ #endif /* CONFIG_CAN_ERRORS */
/* CAN filter support ***************************************************************/ /* CAN filter support *******************************************************/
/* Some CAN hardware supports a notion of prioritizing messages that match filters. /* Some CAN hardware supports a notion of prioritizing messages
* Only two priority levels are currently supported and are encoded as defined * that match filters. Only two priority levels are currently supported
* below: * and are encoded as defined below:
*/ */
#define CAN_MSGPRIO_LOW 0 #define CAN_MSGPRIO_LOW 0
@ -399,50 +410,56 @@
#define CAN_FILTER_DUAL 1 /* Dual address match */ #define CAN_FILTER_DUAL 1 /* Dual address match */
#define CAN_FILTER_RANGE 2 /* Match a range of addresses */ #define CAN_FILTER_RANGE 2 /* Match a range of addresses */
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/* CAN-message Format (without Extended ID support) /* CAN-message Format (without Extended ID support)
* *
* One based CAN-message is represented with a maximum of 10 bytes. A message is * One based CAN-message is represented with a maximum of 10 bytes.
* composed of at least the first 2 bytes (when there are no data bytes present). * A message is composed of at least the first 2 bytes
* (when there are no data bytes present).
* *
* Bytes 0-1: Bits 0-3: Data Length Code (DLC) * Bytes 0-1: Bits 0-3: Data Length Code (DLC)
* Bit 4: Remote Transmission Request (RTR) * Bit 4: Remote Transmission Request (RTR)
* Bit 5: 1=Message ID is a bit-encoded error report (See NOTE) * Bit 5: 1=Message ID is a bit-encoded error report
* (See NOTE)
* Bits 6-7: Unused * Bits 6-7: Unused
* Bytes 1-2: Bits 0-10: The 11-bit CAN identifier This message ID is a bit * Bytes 1-2: Bits 0-10: The 11-bit CAN identifier This message ID
* encoded error set if ch_error is set (See NOTE). * is a bit encoded error set if ch_error is set
* (See NOTE).
* Bits 11-15: Unused * Bits 11-15: Unused
* Bytes 3-10: CAN data * Bytes 3-10: CAN data
* *
* CAN-message Format (with Extended ID support) * CAN-message Format (with Extended ID support)
* *
* One CAN-message consists of a maximum of 13 bytes. A message is composed of at * One CAN-message consists of a maximum of 13 bytes. A message is
* least the first 5 bytes (when there are no data bytes). * composed of at least the first 5 bytes (when there are no data bytes).
* *
* Bytes 0-3: Bits 0-28: Hold 11- or 29-bit CAN ID in host byte order. This * Bytes 0-3: Bits 0-28: Hold 11- or 29-bit CAN ID in host byte order.
* message ID is a bit encoded error set if ch_error * This message ID is a bit encoded error
* is set (See NOTE). * set if ch_error is set (See NOTE).
* Bits 29-31: Unused * Bits 29-31: Unused
* Byte 4: Bits 0-3: Data Length Code (DLC) * Byte 4: Bits 0-3: Data Length Code (DLC)
* Bit 4: Remote Transmission Request (RTR) * Bit 4: Remote Transmission Request (RTR)
* Bit 5: 1=Message ID is a bit-encoded error report (See NOTE) * Bit 5: 1=Message ID is a bit-encoded error report
* (See NOTE)
* Bit 6: Extended ID indication * Bit 6: Extended ID indication
* Bit 7: Unused * Bit 7: Unused
* Bytes 5-12: CAN data Size determined by DLC * Bytes 5-12: CAN data Size determined by DLC
* *
* NOTE: The error indication if valid only on message reports received from the * NOTE: The error indication if valid only on message reports received from
* CAN driver; it is ignored on transmission. When the error bit is set, the * the CAN driver; it is ignored on transmission. When the error bit is set,
* message ID is an encoded set of error indications (see CAN_ERROR_* definitions). * the message ID is an encoded set of error indications
* (see CAN_ERROR_* definitions).
* A more detailed report of certain errors then follows in message payload. * A more detailed report of certain errors then follows in message payload.
* CONFIG_CAN_ERRORS=y is required in order to receive error reports. * CONFIG_CAN_ERRORS=y is required in order to receive error reports.
* *
* The struct can_msg_s holds this information in a user-friendly, unpacked form. * The struct can_msg_s holds this information in a user-friendly,
* This is the form that is used at the read() and write() driver interfaces. The * unpacked form.
* message structure is actually variable length -- the true length is given by * This is the form that is used at the read() and write() driver interfaces.
* the CAN_MSGLEN macro. * The message structure is actually variable length the true length
* is given by the CAN_MSGLEN macro.
*/ */
#ifdef CONFIG_CAN_EXTID #ifdef CONFIG_CAN_EXTID
@ -517,7 +534,9 @@ struct can_txfifo_s
struct can_msg_s tx_buffer[CONFIG_CAN_FIFOSIZE]; struct can_msg_s tx_buffer[CONFIG_CAN_FIFOSIZE];
}; };
/* The following structure define the logic to handle one RTR message transaction */ /* The following structure define the logic to handle
* one RTR message transaction
*/
struct can_rtrwait_s struct can_rtrwait_s
{ {
@ -525,9 +544,9 @@ struct can_rtrwait_s
FAR struct can_msg_s *cr_msg; /* This is where the RTR response goes */ FAR struct can_msg_s *cr_msg; /* This is where the RTR response goes */
}; };
/* This structure defines all of the operations provided by the architecture specific /* This structure defines all of the operations provided by the architecture
* logic. All fields must be provided with non-NULL function pointers by the * specific logic. All fields must be provided with non-NULL
* caller of can_register(). * function pointers by the caller of can_register().
*/ */
struct can_dev_s; struct can_dev_s;
@ -563,7 +582,8 @@ struct can_ops_s
/* All ioctl calls will be routed through this method */ /* All ioctl calls will be routed through this method */
CODE int (*co_ioctl)(FAR struct can_dev_s *dev, int cmd, unsigned long arg); CODE int (*co_ioctl)(FAR struct can_dev_s *dev,
int cmd, unsigned long arg);
/* Send a remote request. Lower-half drivers should NOT implement this if /* Send a remote request. Lower-half drivers should NOT implement this if
* they support sending RTR messages with the regular send function * they support sending RTR messages with the regular send function
@ -586,7 +606,8 @@ struct can_ops_s
/* Return true if all message have been sent. If for example, the CAN /* Return true if all message have been sent. If for example, the CAN
* hardware implements FIFOs, then this would mean the transmit FIFO is * hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that * empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware before calling co_shutdown(). * all characters are "drained" from the TX hardware before
* calling co_shutdown().
*/ */
CODE bool (*co_txempty)(FAR struct can_dev_s *dev); CODE bool (*co_txempty)(FAR struct can_dev_s *dev);
@ -710,9 +731,9 @@ struct canioc_stdfilter_s
uint8_t sf_prio; /* See CAN_MSGPRIO_* definitions */ uint8_t sf_prio; /* See CAN_MSGPRIO_* definitions */
}; };
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@ -723,17 +744,17 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: can_register * Name: can_register
* *
* Description: * Description:
* Register a CAN driver. * Register a CAN driver.
* *
************************************************************************************/ ****************************************************************************/
int can_register(FAR const char *path, FAR struct can_dev_s *dev); int can_register(FAR const char *path, FAR struct can_dev_s *dev);
/************************************************************************************ /****************************************************************************
* Name: can_receive * Name: can_receive
* *
* Description: * Description:
@ -747,12 +768,12 @@ int can_register(FAR const char *path, FAR struct can_dev_s *dev);
* Returned Value: * Returned Value:
* OK on success; a negated errno on failure. * OK on success; a negated errno on failure.
* *
************************************************************************************/ ****************************************************************************/
int can_receive(FAR struct can_dev_s *dev, FAR struct can_hdr_s *hdr, int can_receive(FAR struct can_dev_s *dev, FAR struct can_hdr_s *hdr,
FAR uint8_t *data); FAR uint8_t *data);
/************************************************************************************ /****************************************************************************
* Name: can_txdone * Name: can_txdone
* *
* Description: * Description:
@ -822,11 +843,11 @@ int can_receive(FAR struct can_dev_s *dev, FAR struct can_hdr_s *hdr,
* through can_write(). Interrupts are expected be disabled when called * through can_write(). Interrupts are expected be disabled when called
* from the CAN interrupt handler. * from the CAN interrupt handler.
* *
************************************************************************************/ ****************************************************************************/
int can_txdone(FAR struct can_dev_s *dev); int can_txdone(FAR struct can_dev_s *dev);
/************************************************************************************ /****************************************************************************
* Name: can_txready * Name: can_txready
* *
* Description: * Description:
@ -855,8 +876,9 @@ int can_txdone(FAR struct can_dev_s *dev);
* *
* If the CAN hardware supports a H/W FIFO, can_txdone() is not called * If the CAN hardware supports a H/W FIFO, can_txdone() is not called
* when the transfer is complete, but rather when the transfer is queued in * when the transfer is complete, but rather when the transfer is queued in
* the H/W FIFO. When the H/W FIFO becomes full, then dev_txready() will * the H/W FIFO. When the H/W FIFO becomes full, then dev_txready()
* report false and the number of queued messages in the S/W FIFO will grow. * will report false and the number of queued messages in the
* S/W FIFO will grow.
* *
* There is no mechanism in this case to inform the upper half driver when * There is no mechanism in this case to inform the upper half driver when
* the hardware is again available, when there is again space in the H/W * the hardware is again available, when there is again space in the H/W
@ -880,7 +902,7 @@ int can_txdone(FAR struct can_dev_s *dev);
* Interrupts are disabled. This function may execute in the context of * Interrupts are disabled. This function may execute in the context of
* and interrupt handler. * and interrupt handler.
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_CAN_TXREADY #ifdef CONFIG_CAN_TXREADY
int can_txready(FAR struct can_dev_s *dev); int can_txready(FAR struct can_dev_s *dev);

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/input/mouse.h * include/nuttx/input/mouse.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,7 +16,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
/* The mouse driver exports a standard character driver interface. By /* The mouse driver exports a standard character driver interface. By
* convention, the mouse driver is registered as an input device at * convention, the mouse driver is registered as an input device at
@ -30,15 +30,15 @@
#ifndef __INCLUDE_NUTTX_INPUT_MOUSE_H #ifndef __INCLUDE_NUTTX_INPUT_MOUSE_H
#define __INCLUDE_NUTTX_INPUT_MOUSE_H #define __INCLUDE_NUTTX_INPUT_MOUSE_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* These definitions provide the meaning of all of the bits that may be /* These definitions provide the meaning of all of the bits that may be
* reported in the struct mouse_report_s buttons. * reported in the struct mouse_report_s buttons.
@ -48,13 +48,13 @@
#define MOUSE_BUTTON_2 (1 << 1) /* True: Right mouse button pressed */ #define MOUSE_BUTTON_2 (1 << 1) /* True: Right mouse button pressed */
#define MOUSE_BUTTON_3 (1 << 2) /* True: Middle mouse button pressed */ #define MOUSE_BUTTON_3 (1 << 2) /* True: Middle mouse button pressed */
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/* This structure contains information about the current mouse button states and /* This structure contains information about the current mouse button states
* mouse position. Positional units are device specific and determined by mouse * and mouse position. Positional units are device specific and determined
* configuration settings. * by mouse configuration settings.
*/ */
struct mouse_report_s struct mouse_report_s
@ -68,9 +68,9 @@ struct mouse_report_s
#endif #endif
}; };
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN extern "C" #define EXTERN extern "C"
@ -80,9 +80,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/wireless/cellular/cellular.h * include/nuttx/wireless/cellular/cellular.h
* Cellular network device commands * Cellular network device commands
* *
@ -17,14 +17,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_WIRELESS_CELLULAR_CELLULAR_H #ifndef __INCLUDE_NUTTX_WIRELESS_CELLULAR_CELLULAR_H
#define __INCLUDE_NUTTX_WIRELESS_CELLULAR_CELLULAR_H #define __INCLUDE_NUTTX_WIRELESS_CELLULAR_CELLULAR_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -34,18 +34,18 @@
#include <net/if.h> #include <net/if.h>
#include <nuttx/fs/ioctl.h> #include <nuttx/fs/ioctl.h>
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* Sizing parameters */ /* Sizing parameters */
#define IFCELLDEVPARAMSIZ 136 /* Big enough to store cellelur net paramters */ #define IFCELLDEVPARAMSIZ 136 /* Big enough to store cellular net paramters */
/* Network Driver IOCTL Commands ****************************************************/ /* Network Driver IOCTL Commands ********************************************/
/* Use of these IOCTL commands requires a socket descriptor created by the socket() /* Use of these IOCTL commands requires a socket descriptor created
* interface. * by the socket() interface.
*/ */
#define SIOCSCELLNETDEV _CELLIOC(0x0000) /* Set info in dev */ #define SIOCSCELLNETDEV _CELLIOC(0x0000) /* Set info in dev */
@ -56,9 +56,9 @@
#define ifr_cellinfo icellr_ifru.icellru_info; #define ifr_cellinfo icellr_ifru.icellru_info;
#define ifr_celldata icellr_ifru.ioctl_param; #define ifr_celldata icellr_ifru.ioctl_param;
/************************************************************************************ /****************************************************************************
* Public Type Definitions * Public Type Definitions
************************************************************************************/ ****************************************************************************/
struct cellnetinfo_s struct cellnetinfo_s
{ {

View File

@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* include/nuttx/wireless/wireless.h * include/nuttx/wireless/wireless.h
* Wireless network IOCTL commands * Wireless network IOCTL commands
* *
@ -17,18 +17,18 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
/* This file includes common definitions to be used in all wireless network drivers /* This file includes common definitions to be used in all
* (when applicable). * wireless network drivers (when applicable).
*/ */
#ifndef __INCLUDE_NUTTX_WIRELESS_WIRELESS_H #ifndef __INCLUDE_NUTTX_WIRELESS_WIRELESS_H
#define __INCLUDE_NUTTX_WIRELESS_WIRELESS_H #define __INCLUDE_NUTTX_WIRELESS_WIRELESS_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -38,14 +38,14 @@
#include <net/if.h> #include <net/if.h>
#include <nuttx/fs/ioctl.h> #include <nuttx/fs/ioctl.h>
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* Network Driver IOCTL Commands ****************************************************/ /* Network Driver IOCTL Commands ********************************************/
/* Use of these IOCTL commands requires a socket descriptor created by the socket() /* Use of these IOCTL commands requires a socket descriptor created
* interface. * by the socket() interface.
*/ */
/* Wireless identification */ /* Wireless identification */
@ -185,7 +185,7 @@
(cmd) == SIOCGIWESSID || \ (cmd) == SIOCGIWESSID || \
(cmd) == SIOCSIWESSID) (cmd) == SIOCSIWESSID)
/* ------------------------------ WIRELESS EVENTS --------------------------------- */ /* --------------------------- WIRELESS EVENTS --------------------------- */
/* Those are *NOT* ioctls, do not issue request on them !!! */ /* Those are *NOT* ioctls, do not issue request on them !!! */
@ -228,7 +228,7 @@
#define IWEVFIRST 0x8c00 #define IWEVFIRST 0x8c00
#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) #define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
/* Other Common Wireless Definitions ************************************************/ /* Other Common Wireless Definitions ****************************************/
/* Maximum size of the ESSID and NICKN strings */ /* Maximum size of the ESSID and NICKN strings */
@ -404,21 +404,22 @@
#define IW_PTA_PRIORITY_WLAN_HIGH 3 #define IW_PTA_PRIORITY_WLAN_HIGH 3
#define IW_PTA_PRIORITY_WLAN_MAXIMIZED 4 #define IW_PTA_PRIORITY_WLAN_MAXIMIZED 4
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/* TODO: /* TODO:
* *
* - Add struct iw_range for use with IOCTL commands that need exchange mode data * - Add struct iw_range for use with IOCTL commands that need exchange
* that could not fit in iwreq. * mode data that could not fit in iwreq.
* - Private IOCTL data support (struct iw_priv_arg) * - Private IOCTL data support (struct iw_priv_arg)
* - Quality * - Quality
* - WPA support. * - WPA support.
* - Wireless events. * - Wireless events.
* - Various flag definitions. * - Various flag definitions.
* *
* These future additions will all need to be compatible with BSD/Linux definitions. * These future additions will all need to be compatible
* with BSD/Linux definitions.
*/ */
/* Generic format for most parameters that fit in a int32_t */ /* Generic format for most parameters that fit in a int32_t */
@ -431,8 +432,8 @@ struct iw_param
uint16_t flags; /* Optional flags */ uint16_t flags; /* Optional flags */
}; };
/* Large data reference. For all data larger than 16 octets, we need to use a /* Large data reference. For all data larger than 16 octets,
* pointer to memory allocated in user space. * we need to use a pointer to memory allocated in user space.
*/ */
struct iw_point struct iw_point
@ -492,8 +493,8 @@ struct iw_missed
uint32_t beacon; /* Missed beacons/superframe */ uint32_t beacon; /* Missed beacons/superframe */
}; };
/* This union defines the data payload of an ioctl, and is used in struct iwreq /* This union defines the data payload of an ioctl
* below. * and is used in struct iwreq below.
*/ */
union iwreq_data union iwreq_data
@ -523,8 +524,9 @@ union iwreq_data
struct iw_point data; /* Other large parameters */ struct iw_point data; /* Other large parameters */
}; };
/* This is the structure used to exchange data in wireless IOCTLs. This structure /* This is the structure used to exchange data in wireless IOCTLs.
* is the same as 'struct ifreq', but defined for use with wireless IOCTLs. * This structure is the same as 'struct ifreq', but defined for
* use with wireless IOCTLs.
*/ */
struct iwreq struct iwreq

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/pthread.h * include/pthread.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_PTHREAD_H #ifndef __INCLUDE_PTHREAD_H
#define __INCLUDE_PTHREAD_H #define __INCLUDE_PTHREAD_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> /* Default settings */ #include <nuttx/config.h> /* Default settings */
#include <nuttx/compiler.h> /* Compiler settings, noreturn_function */ #include <nuttx/compiler.h> /* Compiler settings, noreturn_function */
@ -50,9 +50,9 @@
# include <arch/spinlock.h> # include <arch/spinlock.h>
#endif #endif
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* Standard POSIX switches */ /* Standard POSIX switches */
@ -71,25 +71,26 @@
/* Values for the mutext type attribute: /* Values for the mutext type attribute:
* *
* PTHREAD_MUTEX_NORMAL: This type of mutex does not detect deadlock. A thread * PTHREAD_MUTEX_NORMAL: This type of mutex does not detect deadlock.
* attempting to relock this mutex without first unlocking it will deadlock. * A thread attempting to relock this mutex without first unlocking
* Attempting to unlock a mutex locked by a different thread results in * it will deadlock. Attempting to unlock a mutex locked by a different
* undefined behavior. Attempting to unlock an unlocked mutex results in * thread results in undefined behavior. Attempting to unlock an unlocked
* undefined behavior. * mutex results in undefined behavior.
* PTHREAD_MUTEX_ERRORCHECK * PTHREAD_MUTEX_ERRORCHECK
* This type of mutex provides error checking. A thread attempting to relock * This type of mutex provides error checking. A thread attempting
* this mutex without first unlocking it will return with an error. A thread * to relock this mutex without first unlocking it will return with
* attempting to unlock a mutex which another thread has locked will return * an error. A thread attempting to unlock a mutex which another thread
* with an error. A thread attempting to unlock an unlocked mutex will return * has locked will return with an error. A thread attempting to unlock
* with an error. * an unlocked mutex will return with an error.
* PTHREAD_MUTEX_RECURSIVE * PTHREAD_MUTEX_RECURSIVE
* A thread attempting to relock this mutex without first unlocking it will * A thread attempting to relock this mutex without first unlocking it will
* succeed in locking the mutex. The relocking deadlock which can occur with * succeed in locking the mutex. The relocking deadlock which can occur
* mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex. * with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type
* Multiple locks of this mutex require the same number of unlocks to release * of mutex. Multiple locks of this mutex require the same number
* the mutex before another thread can acquire the mutex. A thread attempting * of unlocks to release the mutex before another thread can acquire
* to unlock a mutex which another thread has locked will return with an error. * the mutex. A thread attempting to unlock a mutex which another thread
* A thread attempting to unlock an unlocked mutex will return with an error. * has locked will return with an error. A thread attempting to unlock
* an unlocked mutex will return with an error.
* PTHREAD_MUTEX_DEFAULT * PTHREAD_MUTEX_DEFAULT
* An implementation is allowed to map this mutex to one of the other mutex * An implementation is allowed to map this mutex to one of the other mutex
* types. * types.
@ -186,9 +187,9 @@
#define _PTHREAD_MFLAGS_INCONSISTENT (1 << 1) /* Mutex is in an inconsistent state */ #define _PTHREAD_MFLAGS_INCONSISTENT (1 << 1) /* Mutex is in an inconsistent state */
#define _PTHREAD_MFLAGS_NRECOVERABLE (1 << 2) /* Inconsistent mutex has been unlocked */ #define _PTHREAD_MFLAGS_NRECOVERABLE (1 << 2) /* Inconsistent mutex has been unlocked */
/******************************************************************************** /****************************************************************************
* Public Type Definitions * Public Type Definitions
********************************************************************************/ ****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
@ -426,12 +427,12 @@ typedef CODE void (*pthread_cleanup_t)(FAR void *arg);
struct sched_param; /* Defined in sched.h */ struct sched_param; /* Defined in sched.h */
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
/* Initializes a thread attributes object (attr) with default values for all of /* Initializes a thread attributes object (attr) with default values
* the individual attributes used by a given implementation. * for all of the individual attributes used by a given implementation.
*/ */
int pthread_attr_init(FAR pthread_attr_t *attr); int pthread_attr_init(FAR pthread_attr_t *attr);
@ -443,7 +444,8 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr);
/* Set or obtain the default scheduling algorithm */ /* Set or obtain the default scheduling algorithm */
int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy); int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy);
int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, FAR int *policy); int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr,
FAR int *policy);
int pthread_attr_setschedparam(FAR pthread_attr_t *attr, int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
FAR const struct sched_param *param); FAR const struct sched_param *param);
int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, int pthread_attr_getschedparam(FAR const pthread_attr_t *attr,
@ -537,7 +539,9 @@ void pthread_cleanup_push(pthread_cleanup_t routine, FAR void *arg);
int pthread_join(pthread_t thread, FAR pthread_addr_t *value); int pthread_join(pthread_t thread, FAR pthread_addr_t *value);
/* A thread may tell the scheduler that its processor can be made available. */ /* A thread may tell the scheduler that its processor
* can be made available.
*/
void pthread_yield(void); void pthread_yield(void);
@ -725,22 +729,22 @@ int pthread_atfork(CODE void (*prepare)(void),
} }
#endif #endif
/******************************************************************************** /****************************************************************************
* Minimal Type Definitions * Minimal Type Definitions
********************************************************************************/ ****************************************************************************/
#else /* __INCLUDE_PTHREAD_H */ #else /* __INCLUDE_PTHREAD_H */
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <stdbool.h> #include <stdbool.h>
/******************************************************************************** /****************************************************************************
* Public Type Definitions * Public Type Definitions
********************************************************************************/ ****************************************************************************/
/* Avoid circular dependencies by assuring that simple type definitions are /* Avoid circular dependencies by assuring that simple type definitions are
* available in any inclusion ordering. * available in any inclusion ordering.

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/sched.h * include/sched.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_SCHED_H #ifndef __INCLUDE_SCHED_H
#define __INCLUDE_SCHED_H #define __INCLUDE_SCHED_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
@ -33,11 +33,11 @@
#include <strings.h> #include <strings.h>
#include <time.h> #include <time.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* Task Management Definitions **************************************************/ /* Task Management Definitions **********************************************/
/* POSIX-like scheduling policies */ /* POSIX-like scheduling policies */
@ -51,7 +51,7 @@
#define SS_REPL_MAX CONFIG_SCHED_SPORADIC_MAXREPL #define SS_REPL_MAX CONFIG_SCHED_SPORADIC_MAXREPL
/* Cancellation definitions *****************************************************/ /* Cancellation definitions *************************************************/
/* Cancellation states used by task_setcancelstate() */ /* Cancellation states used by task_setcancelstate() */
@ -63,11 +63,11 @@
#define TASK_CANCEL_DEFERRED (0) #define TASK_CANCEL_DEFERRED (0)
#define TASK_CANCEL_ASYNCHRONOUS (1) #define TASK_CANCEL_ASYNCHRONOUS (1)
/* Pthread definitions **********************************************************/ /* Pthread definitions ******************************************************/
#define PTHREAD_KEYS_MAX CONFIG_TLS_NELEM #define PTHREAD_KEYS_MAX CONFIG_TLS_NELEM
/* CPU affinity mask helpers ****************************************************/ /* CPU affinity mask helpers ************************************************/
/* These are not standard but are defined for Linux compatibility */ /* These are not standard but are defined for Linux compatibility */
@ -178,9 +178,9 @@
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
/******************************************************************************** /****************************************************************************
* Public Type Definitions * Public Type Definitions
********************************************************************************/ ****************************************************************************/
/* This is the POSIX-like scheduling parameter structure */ /* This is the POSIX-like scheduling parameter structure */
@ -199,9 +199,9 @@ struct sched_param
#endif #endif
}; };
/******************************************************************************** /****************************************************************************
* Public Data * Public Data
********************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#undef EXTERN #undef EXTERN
@ -213,9 +213,9 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
/* Task Control Interfaces (non-standard) */ /* Task Control Interfaces (non-standard) */

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/signal.h * include/signal.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_SIGNAL_H #ifndef __INCLUDE_SIGNAL_H
#define __INCLUDE_SIGNAL_H #define __INCLUDE_SIGNAL_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -31,9 +31,9 @@
#include <stdint.h> #include <stdint.h>
#include <time.h> #include <time.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* Signal set management definitions and macros. */ /* Signal set management definitions and macros. */
@ -170,7 +170,9 @@
#define SIGSYS 31 #define SIGSYS 31
/* sigprocmask() "how" definitions. Only one of the following can be specified: */ /* sigprocmask() "how" definitions.
* Only one of the following can be specified:
*/
#define SIG_BLOCK 1 /* Block the given signals */ #define SIG_BLOCK 1 /* Block the given signals */
#define SIG_UNBLOCK 2 /* Unblock the given signals */ #define SIG_UNBLOCK 2 /* Unblock the given signals */
@ -236,9 +238,9 @@
#define tkill(tid, signo) tgkill((pid_t)-1, tid, signo) #define tkill(tid, signo) tgkill((pid_t)-1, tid, signo)
/******************************************************************************** /****************************************************************************
* Public Types * Public Types
********************************************************************************/ ****************************************************************************/
/* This defines a set of 32 signals (numbered 0 through 31). /* This defines a set of 32 signals (numbered 0 through 31).
* REVISIT: Signal 0 is, however, not generally usable since that value has * REVISIT: Signal 0 is, however, not generally usable since that value has
@ -266,9 +268,9 @@ union sigval
FAR void *sival_ptr; /* Pointer value */ FAR void *sival_ptr; /* Pointer value */
}; };
/* This structure contains elements that define a queue signal. The following is /* This structure contains elements that define a queue signal.
* used to attach a signal to a message queue to notify a task when a message is * The following is used to attach a signal to a message queue
* available on a queue * to notify a task when a message is available on a queue.
*/ */
typedef CODE void (*sigev_notify_function_t)(union sigval value); typedef CODE void (*sigev_notify_function_t)(union sigval value);
@ -336,9 +338,9 @@ struct sigaction
#define sa_handler sa_u._sa_handler #define sa_handler sa_u._sa_handler
#define sa_sigaction sa_u._sa_sigaction #define sa_sigaction sa_u._sa_sigaction
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN extern "C" #define EXTERN extern "C"

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/sys/file.h * include/sys/file.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_SYS_FILE_H #ifndef __INCLUDE_SYS_FILE_H
#define __INCLUDE_SYS_FILE_H #define __INCLUDE_SYS_FILE_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,4 +1,4 @@
/******************************************************************************** /****************************************************************************
* include/time.h * include/time.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
********************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_TIME_H #ifndef __INCLUDE_TIME_H
#define __INCLUDE_TIME_H #define __INCLUDE_TIME_H
/******************************************************************************** /****************************************************************************
* Included Files * Included Files
********************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -31,14 +31,14 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
/******************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
********************************************************************************/ ****************************************************************************/
/* Clock tick of the system (frequency Hz). /* Clock tick of the system (frequency Hz).
* *
* NOTE: This symbolic name CLK_TCK has been removed from the standard. It is * NOTE: This symbolic name CLK_TCK has been removed from the standard.
* replaced with CLOCKS_PER_SEC. Both are defined here. * It is replaced with CLOCKS_PER_SEC. Both are defined here.
* *
* The default value is 100Hz, but this default setting can be overridden by * The default value is 100Hz, but this default setting can be overridden by
* defining the clock interval in microseconds as CONFIG_USEC_PER_TICK in the * defining the clock interval in microseconds as CONFIG_USEC_PER_TICK in the
@ -102,9 +102,9 @@
#define timelocal mktime #define timelocal mktime
#define strftime_l(s, m, f, t, l) strftime(s, m, f, t) #define strftime_l(s, m, f, t, l) strftime(s, m, f, t)
/******************************************************************************** /****************************************************************************
* Public Types * Public Types
********************************************************************************/ ****************************************************************************/
/* Scalar types */ /* Scalar types */
@ -162,9 +162,9 @@ struct itimerspec
struct sigevent; struct sigevent;
/******************************************************************************** /****************************************************************************
* Public Data * Public Data
********************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@ -192,9 +192,9 @@ extern "C"
EXTERN FAR char *tzname[2]; EXTERN FAR char *tzname[2];
#endif #endif
/******************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
********************************************************************************/ ****************************************************************************/
clock_t clock(void); clock_t clock(void);