Standardize the width of all comment boxes in C files

This commit is contained in:
Gregory Nutt
2015-10-03 07:25:53 -06:00
parent 0f90500f72
commit 16b32bbadd
38 changed files with 658 additions and 658 deletions
+1 -1
Submodule arch updated: 277302f14a...5fa7ebb25b
+1 -1
Submodule configs updated: 55aaa32ed3...d074eda220
+2 -2
View File
@@ -54,9 +54,9 @@
#include "testmngr.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+48 -48
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* drivers/lcd/ili9341.c
*
* LCD driver for the ILI9341 LCD Single Chip Driver
@@ -37,11 +37,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -58,9 +58,9 @@
#include <arch/irq.h>
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/*
* This is the generic lcd driver interface for the ili9341 Single Chip LCD
@@ -383,9 +383,9 @@
# define lcdvdbg(x...)
#endif
/******************************************************************************
/****************************************************************************
* Private Type Definition
******************************************************************************/
****************************************************************************/
/*
* Each single connected ili9341 LCD driver needs an own driver instance
@@ -436,9 +436,9 @@ struct ili9341_dev_s
};
/******************************************************************************
/****************************************************************************
* Private Function Protototypes
******************************************************************************/
****************************************************************************/
/* Internal low level helpers */
@@ -492,9 +492,9 @@ static int ili9341_setpower(struct lcd_dev_s *dev, int power);
static int ili9341_getcontrast(struct lcd_dev_s *dev);
static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
/******************************************************************************
/****************************************************************************
* Private Data
******************************************************************************/
****************************************************************************/
/* Initialize driver instance 1 < LCD_ILI9341_NINTERFACES */
@@ -537,11 +537,11 @@ static struct ili9341_dev_s g_lcddev[CONFIG_LCD_ILI9341_NINTERFACES] =
#endif
};
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: ili9341_getxres
*
* Description:
@@ -555,7 +555,7 @@ static struct ili9341_dev_s g_lcddev[CONFIG_LCD_ILI9341_NINTERFACES] =
*
* Horicontal resolution
*
******************************************************************************/
****************************************************************************/
static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
{
@@ -569,7 +569,7 @@ static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getyres
*
* Description:
@@ -583,7 +583,7 @@ static inline uint16_t ili9341_getxres(FAR struct ili9341_dev_s *dev)
*
* Vertical resolution
*
******************************************************************************/
****************************************************************************/
static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
{
@@ -597,7 +597,7 @@ static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_selectarea
*
* Description:
@@ -610,7 +610,7 @@ static inline uint16_t ili9341_getyres(FAR struct ili9341_dev_s *dev)
* x1 - End x position
* y1 - End y position
*
******************************************************************************/
****************************************************************************/
static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
@@ -633,7 +633,7 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_putrun
*
* Description:
@@ -652,7 +652,7 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
FAR const uint8_t * buffer, size_t npixels)
@@ -693,7 +693,7 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getrun
*
* Description:
@@ -712,7 +712,7 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
# ifndef CONFIG_LCD_NOGETRUN
static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col,
@@ -754,7 +754,7 @@ static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col,
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: ili9341_hwinitialize
*
* Description:
@@ -768,7 +768,7 @@ static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col,
* On success - OK
* On error - EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
{
@@ -846,11 +846,11 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
}
/*******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: ili9341_putrunx
*
* Description:
@@ -868,7 +868,7 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev)
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_LCD_ILI9341_IFACE0
static int ili9341_putrun0(fb_coord_t row, fb_coord_t col,
@@ -887,7 +887,7 @@ static int ili9341_putrun1(fb_coord_t row, fb_coord_t col,
#endif
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getrunx
*
* Description:
@@ -905,7 +905,7 @@ static int ili9341_putrun1(fb_coord_t row, fb_coord_t col,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
#ifndef CONFIG_LCD_NOGETRUN
# ifdef CONFIG_LCD_ILI9341_IFACE0
@@ -926,7 +926,7 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
#endif
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getvideoinfo
*
* Description:
@@ -941,7 +941,7 @@ static int ili9341_getrun1(fb_coord_t row, fb_coord_t col,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo)
@@ -964,7 +964,7 @@ static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
return -EINVAL;
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getplaneinfo
*
* Description:
@@ -980,7 +980,7 @@ static int ili9341_getvideoinfo(FAR struct lcd_dev_s *dev,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo)
@@ -1004,7 +1004,7 @@ static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
return -EINVAL;
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getpower
*
* Description:
@@ -1019,7 +1019,7 @@ static int ili9341_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_getpower(FAR struct lcd_dev_s *dev)
{
@@ -1035,7 +1035,7 @@ static int ili9341_getpower(FAR struct lcd_dev_s *dev)
return -EINVAL;
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_setpower
*
* Description:
@@ -1051,7 +1051,7 @@ static int ili9341_getpower(FAR struct lcd_dev_s *dev)
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
static int ili9341_setpower(FAR struct lcd_dev_s *dev, int power)
{
@@ -1092,7 +1092,7 @@ static int ili9341_setpower(FAR struct lcd_dev_s *dev, int power)
return -EINVAL;
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_getcontrast
*
* Description:
@@ -1106,7 +1106,7 @@ static int ili9341_setpower(FAR struct lcd_dev_s *dev, int power)
* On success - current contrast value
* On error - -ENOSYS, not supported by the ili9341.
*
******************************************************************************/
****************************************************************************/
static int ili9341_getcontrast(struct lcd_dev_s *dev)
{
@@ -1114,7 +1114,7 @@ static int ili9341_getcontrast(struct lcd_dev_s *dev)
return -ENOSYS;
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_setcontrast
*
* Description:
@@ -1128,7 +1128,7 @@ static int ili9341_getcontrast(struct lcd_dev_s *dev)
* On success - OK
* On error - -ENOSYS, not supported by the ili9341.
*
******************************************************************************/
****************************************************************************/
static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
{
@@ -1137,7 +1137,7 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
}
/*******************************************************************************
/****************************************************************************
* Name: ili9341_initialize
*
* Description:
@@ -1158,7 +1158,7 @@ static int ili9341_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
* On success, this function returns a reference to the LCD driver object for
* the specified LCD driver. NULL is returned on any failure.
*
******************************************************************************/
****************************************************************************/
FAR struct lcd_dev_s *ili9341_initialize(
FAR struct ili9341_lcd_s *lcd, int devno)
@@ -1201,7 +1201,7 @@ FAR struct lcd_dev_s *ili9341_initialize(
}
/******************************************************************************
/****************************************************************************
* Name: ili9341_clear
*
* Description:
@@ -1219,7 +1219,7 @@ FAR struct lcd_dev_s *ili9341_initialize(
* On success - OK
* On error - -EINVAL
*
******************************************************************************/
****************************************************************************/
int ili9341_clear(FAR struct lcd_dev_s *dev, uint16_t color)
{
+46 -46
View File
@@ -1,4 +1,4 @@
/******************************************************************************
/****************************************************************************
* drivers/lcd/memlcd.c
* Driver for Sharp Memory LCD.
*
@@ -33,11 +33,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -55,9 +55,9 @@
#include <arch/irq.h>
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
/* Configuration */
@@ -119,9 +119,9 @@
# define lcdvdbg(x...)
#endif
/******************************************************************************
/****************************************************************************
* Private Type Definition
******************************************************************************/
****************************************************************************/
struct memlcd_dev_s
{
@@ -144,9 +144,9 @@ struct memlcd_dev_s
uint8_t fb[MEMLCD_FBSIZE];
};
/******************************************************************************
/****************************************************************************
* Private Function Protototypes
******************************************************************************/
****************************************************************************/
/* Low-level spi helpers */
@@ -180,9 +180,9 @@ static int memlcd_setpower(struct lcd_dev_s *dev, int power);
static int memlcd_getcontrast(struct lcd_dev_s *dev);
static int memlcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
/******************************************************************************
/****************************************************************************
* Private Data
******************************************************************************/
****************************************************************************/
static uint8_t g_runbuffer[MEMLCD_BPP * MEMLCD_XRES / 8];
@@ -226,11 +226,11 @@ static struct memlcd_dev_s g_memlcddev =
},
};
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* __set_bit - Set a bit in memory
*
* @nr: the bit to set
@@ -240,7 +240,7 @@ static struct memlcd_dev_s g_memlcddev =
* If it's called on the same region of memory simultaneously, the effect
* may be that only one operation succeeds.
*
******************************************************************************/
****************************************************************************/
#define BIT(nr) (1 << (nr))
#define BITS_PER_BYTE 8
@@ -266,7 +266,7 @@ static inline int __test_bit(int nr, const volatile uint8_t * addr)
return 1 & (addr[BIT_BYTE(nr)] >> (nr & (BITS_PER_BYTE - 1)));
}
/******************************************************************************
/****************************************************************************
* Name: memlcd_configspi
*
* Description:
@@ -280,7 +280,7 @@ static inline int __test_bit(int nr, const volatile uint8_t * addr)
*
* Assumptions:
*
******************************************************************************/
****************************************************************************/
static inline void memlcd_configspi(FAR struct spi_dev_s *spi)
{
@@ -307,7 +307,7 @@ static inline void memlcd_configspi(FAR struct spi_dev_s *spi)
#endif
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_select
*
* Description:
@@ -321,7 +321,7 @@ static inline void memlcd_configspi(FAR struct spi_dev_s *spi)
*
* Assumptions:
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SPI_OWNBUS
static inline void memlcd_select(FAR struct spi_dev_s *spi)
@@ -354,7 +354,7 @@ static void memlcd_select(FAR struct spi_dev_s *spi)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: memlcd_deselect
*
* Description:
@@ -368,7 +368,7 @@ static void memlcd_select(FAR struct spi_dev_s *spi)
*
* Assumptions:
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_SPI_OWNBUS
static inline void memlcd_deselect(FAR struct spi_dev_s *spi)
@@ -385,7 +385,7 @@ static void memlcd_deselect(FAR struct spi_dev_s *spi)
}
#endif
/*******************************************************************************
/****************************************************************************
* Name: memlcd_clear
*
* Description:
@@ -396,7 +396,7 @@ static void memlcd_deselect(FAR struct spi_dev_s *spi)
*
* Assumptions:
*
******************************************************************************/
****************************************************************************/
static inline void memlcd_clear(FAR struct memlcd_dev_s *mlcd)
{
@@ -409,7 +409,7 @@ static inline void memlcd_clear(FAR struct memlcd_dev_s *mlcd)
memlcd_deselect(mlcd->spi);
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_extcominisr
*
* Description:
@@ -427,7 +427,7 @@ static inline void memlcd_clear(FAR struct memlcd_dev_s *mlcd)
* Assumptions:
* Board specific logic needs to be provided to support it.
*
******************************************************************************/
****************************************************************************/
static int memlcd_extcominisr(int irq, FAR void *context)
{
@@ -445,7 +445,7 @@ static int memlcd_extcominisr(int irq, FAR void *context)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_putrun
*
* Description:
@@ -458,7 +458,7 @@ static int memlcd_extcominisr(int irq, FAR void *context)
* npixels - The number of pixels to write to the LCD
* (range: 0 < npixels <= xres-col)
*
******************************************************************************/
****************************************************************************/
static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
FAR const uint8_t * buffer, size_t npixels)
@@ -538,7 +538,7 @@ static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_getrun
*
* Description:
@@ -550,7 +550,7 @@ static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
* npixels - The number of pixels to read from the LCD
* (range: 0 < npixels <= xres-col)
*
******************************************************************************/
****************************************************************************/
static int memlcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
size_t npixels)
@@ -609,13 +609,13 @@ static int memlcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t * buffer,
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_getvideoinfo
*
* Description:
* Get information about the LCD video controller configuration.
*
******************************************************************************/
****************************************************************************/
static int memlcd_getvideoinfo(FAR struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo)
{
@@ -627,13 +627,13 @@ static int memlcd_getvideoinfo(FAR struct lcd_dev_s *dev,
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_getplaneinfo
*
* Description:
* Get information about the configuration of each LCD color plane.
*
******************************************************************************/
****************************************************************************/
static int memlcd_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo)
@@ -644,14 +644,14 @@ static int memlcd_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_getpower
*
* Description:
* Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: full on.
* On backlit LCDs, this setting may correspond to the backlight setting.
*
******************************************************************************/
****************************************************************************/
static int memlcd_getpower(FAR struct lcd_dev_s *dev)
{
@@ -661,14 +661,14 @@ static int memlcd_getpower(FAR struct lcd_dev_s *dev)
return mlcd->power;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_setpower
*
* Description:
* Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: full on).
* On backlit LCDs, this setting may correspond to the backlight setting.
*
******************************************************************************/
****************************************************************************/
static int memlcd_setpower(FAR struct lcd_dev_s *dev, int power)
{
@@ -690,13 +690,13 @@ static int memlcd_setpower(FAR struct lcd_dev_s *dev, int power)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_getcontrast
*
* Description:
* Get the current contrast setting (0-CONFIG_LCD_MAXCONTRAST).
*
******************************************************************************/
****************************************************************************/
static int memlcd_getcontrast(struct lcd_dev_s *dev)
{
@@ -706,13 +706,13 @@ static int memlcd_getcontrast(struct lcd_dev_s *dev)
return mlcd->contrast;
}
/*******************************************************************************
/****************************************************************************
* Name: memlcd_setcontrast
*
* Description:
* Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST).
*
******************************************************************************/
****************************************************************************/
static int memlcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
{
@@ -734,11 +734,11 @@ static int memlcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return OK;
}
/*******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: memlcd_initialize
*
* Description:
@@ -757,7 +757,7 @@ static int memlcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
* On success, this function returns a reference to the LCD object for
* the specified LCD. NULL is returned on any failure.
*
******************************************************************************/
****************************************************************************/
FAR struct lcd_dev_s *memlcd_initialize(FAR struct spi_dev_s *spi,
FAR struct memlcd_priv_s *priv,
unsigned int devno)
+6 -6
View File
@@ -113,7 +113,7 @@ static int usbtrace_syslog(const char *fmt, ...)
* Public Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: usbtrace_enable
*
* Description:
@@ -129,7 +129,7 @@ static int usbtrace_syslog(const char *fmt, ...)
* Assumptions:
* - May be called from an interrupt handler
*
*******************************************************************************/
****************************************************************************/
#if defined(CONFIG_USBDEV_TRACE) || \
(defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
@@ -148,7 +148,7 @@ usbtrace_idset_t usbtrace_enable(usbtrace_idset_t idset)
}
#endif /* CONFIG_USBDEV_TRACE || CONFIG_DEBUG && CONFIG_DEBUG_USB */
/*******************************************************************************
/****************************************************************************
* Name: usbtrace
*
* Description:
@@ -157,7 +157,7 @@ usbtrace_idset_t usbtrace_enable(usbtrace_idset_t idset)
* Assumptions:
* May be called from an interrupt handler
*
*******************************************************************************/
****************************************************************************/
#if defined(CONFIG_USBDEV_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
void usbtrace(uint16_t event, uint16_t value)
@@ -200,7 +200,7 @@ void usbtrace(uint16_t event, uint16_t value)
}
#endif /* CONFIG_USBDEV_TRACE || CONFIG_DEBUG && CONFIG_DEBUG_USB */
/*******************************************************************************
/****************************************************************************
* Name: usbtrace_enumerate
*
* Description:
@@ -209,7 +209,7 @@ void usbtrace(uint16_t event, uint16_t value)
* Assumptions:
* NEVER called from an interrupt handler
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_USBDEV_TRACE
int usbtrace_enumerate(trace_callback_t callback, void *arg)
+4 -4
View File
@@ -65,13 +65,13 @@
* Private Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: get_trstring
*
* Description:
* Search the driver string data to find the string matching the provided ID.
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_USBDEV_TRACE_STRINGS
static FAR const char *get_trstring(FAR const struct trace_msg_t *array,
@@ -95,13 +95,13 @@ static FAR const char *get_trstring(FAR const struct trace_msg_t *array,
* Public Functions
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: usbtrace_trprintf
*
* Description:
* Print the trace record using the supplied printing function
*
*******************************************************************************/
****************************************************************************/
void usbtrace_trprintf(trprintf_t trprintf, uint16_t event, uint16_t value)
{
+25 -25
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* drivers/usbhost/usbhost_devaddr.c
* Manage USB device addresses
*
@@ -32,11 +32,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -48,13 +48,13 @@
#include <nuttx/usb/usbhost.h>
#include <nuttx/usb/usbhost_devaddr.h>
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Private Functions
*******************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: usbhost_takesem and usbhost_givesem
@@ -63,7 +63,7 @@
* This is just a wrapper to handle the annoying behavior of semaphore
* waits that return due to the receipt of a signal.
*
*******************************************************************************/
****************************************************************************/
static void usbhost_takesem(FAR struct usbhost_devaddr_s *devgen)
{
@@ -81,7 +81,7 @@ static void usbhost_takesem(FAR struct usbhost_devaddr_s *devgen)
#define usbhost_givesem(devgen) sem_post(&devgen->exclsem)
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_allocate
*
* Description:
@@ -90,7 +90,7 @@ static void usbhost_takesem(FAR struct usbhost_devaddr_s *devgen)
* Assumptions:
* Caller hold the exclsem
*
*******************************************************************************/
****************************************************************************/
static int usbhost_devaddr_allocate(FAR struct usbhost_devaddr_s *devgen)
{
@@ -140,7 +140,7 @@ static int usbhost_devaddr_allocate(FAR struct usbhost_devaddr_s *devgen)
}
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_free
*
* Description:
@@ -149,7 +149,7 @@ static int usbhost_devaddr_allocate(FAR struct usbhost_devaddr_s *devgen)
* Assumptions:
* Caller hold the exclsem
*
*******************************************************************************/
****************************************************************************/
static void usbhost_devaddr_free(FAR struct usbhost_devaddr_s *devgen,
uint8_t devaddr)
@@ -173,13 +173,13 @@ static void usbhost_devaddr_free(FAR struct usbhost_devaddr_s *devgen,
}
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_roothubport
*
* Description:
* Find and return a reference the root hub port.
*
*******************************************************************************/
****************************************************************************/
static inline FAR struct usbhost_roothubport_s *
usbhost_roothubport(FAR struct usbhost_hubport_s *hport)
@@ -203,14 +203,14 @@ usbhost_roothubport(FAR struct usbhost_hubport_s *hport)
return (FAR struct usbhost_roothubport_s *)hport;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_gen
*
* Description:
* Find root hub port and return a reference to the device function address
* data set.
*
*******************************************************************************/
****************************************************************************/
static FAR struct usbhost_devaddr_s *
usbhost_devaddr_gen(FAR struct usbhost_hubport_s *hport)
@@ -226,11 +226,11 @@ usbhost_devaddr_gen(FAR struct usbhost_hubport_s *hport)
return NULL;
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_initialize
*
* Description:
@@ -244,7 +244,7 @@ usbhost_devaddr_gen(FAR struct usbhost_hubport_s *hport)
* Returned Value:
* None
*
*******************************************************************************/
****************************************************************************/
void usbhost_devaddr_initialize(FAR struct usbhost_roothubport_s *rhport)
{
@@ -258,7 +258,7 @@ void usbhost_devaddr_initialize(FAR struct usbhost_roothubport_s *rhport)
devgen->next = 1;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_create
*
* Description:
@@ -272,7 +272,7 @@ void usbhost_devaddr_initialize(FAR struct usbhost_roothubport_s *rhport)
* On success, a new device function address in the the range 0x01 to 0x7f
* is returned. On failure, a negated errno value is returned.
*
*******************************************************************************/
****************************************************************************/
int usbhost_devaddr_create(FAR struct usbhost_hubport_s *hport)
{
@@ -302,7 +302,7 @@ int usbhost_devaddr_create(FAR struct usbhost_hubport_s *hport)
return devaddr;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devaddr_destroy
*
* Description:
@@ -316,7 +316,7 @@ int usbhost_devaddr_create(FAR struct usbhost_hubport_s *hport)
* Returned Value:
* None
*
*******************************************************************************/
****************************************************************************/
void usbhost_devaddr_destroy(FAR struct usbhost_hubport_s *hport, uint8_t devaddr)
{
+28 -28
View File
@@ -1,4 +1,4 @@
/*******************************************************************************
/****************************************************************************
* drivers/usbhost/usbhost_enumerate.c
*
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Included Files
*******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -53,17 +53,17 @@
#include <nuttx/usb/hub.h>
#include <nuttx/usb/usbhost_devaddr.h>
/*******************************************************************************
/****************************************************************************
* Pre-processor Definitions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Private Types
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Private Function Prototypes
*******************************************************************************/
****************************************************************************/
static inline uint16_t usbhost_getle16(const uint8_t *val);
static void usbhost_putle16(uint8_t *dest, uint16_t val);
@@ -77,17 +77,17 @@ static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport,
FAR struct usbhost_id_s *id,
FAR struct usbhost_class_s **devclass);
/*******************************************************************************
/****************************************************************************
* Private Data
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Public Data
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Private Functions
*******************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: usbhost_getle16
@@ -95,7 +95,7 @@ static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport,
* Description:
* Get a (possibly unaligned) 16-bit little endian value.
*
*******************************************************************************/
****************************************************************************/
static inline uint16_t usbhost_getle16(const uint8_t *val)
{
@@ -108,7 +108,7 @@ static inline uint16_t usbhost_getle16(const uint8_t *val)
* Description:
* Put a (possibly unaligned) 16-bit little endian value.
*
*******************************************************************************/
****************************************************************************/
static void usbhost_putle16(uint8_t *dest, uint16_t val)
{
@@ -116,14 +116,14 @@ static void usbhost_putle16(uint8_t *dest, uint16_t val)
dest[1] = val >> 8;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_devdesc
*
* Description:
* A configuration descriptor has been obtained from the device. Find the
* ID information for the class that supports this device.
*
*******************************************************************************/
****************************************************************************/
static inline int usbhost_devdesc(FAR const struct usb_devdesc_s *devdesc,
FAR struct usbhost_id_s *id)
@@ -148,14 +148,14 @@ static inline int usbhost_devdesc(FAR const struct usb_devdesc_s *devdesc,
return OK;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_configdesc
*
* Description:
* A configuration descriptor has been obtained from the device. Find the
* ID information for the class that supports this device.
*
*******************************************************************************/
****************************************************************************/
static inline int usbhost_configdesc(const uint8_t *configdesc, int cfglen,
struct usbhost_id_s *id)
@@ -214,14 +214,14 @@ static inline int usbhost_configdesc(const uint8_t *configdesc, int cfglen,
return -ENOENT;
}
/*******************************************************************************
/****************************************************************************
* Name: usbhost_classbind
*
* Description:
* A configuration descriptor has been obtained from the device. Try to
* bind this configuration descriptor with a supported class.
*
*******************************************************************************/
****************************************************************************/
static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport,
const uint8_t *configdesc, int desclen,
@@ -270,11 +270,11 @@ static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport,
return ret;
}
/*******************************************************************************
/****************************************************************************
* Public Functions
*******************************************************************************/
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: usbhost_enumerate
*
* Description:
@@ -302,7 +302,7 @@ static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport,
* - 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 *hport,
FAR struct usbhost_class_s **devclass)
+2 -2
View File
@@ -230,7 +230,7 @@ void usbhost_trace2(uint16_t id, uint8_t u7, uint16_t u16)
#endif /* CONFIG_USBHOST_TRACE || CONFIG_DEBUG && CONFIG_DEBUG_USB */
/*******************************************************************************
/****************************************************************************
* Name: usbtrace_enumerate
*
* Description:
@@ -239,7 +239,7 @@ void usbhost_trace2(uint16_t id, uint8_t u7, uint16_t u16)
* Assumptions:
* NEVER called from an interrupt handler
*
*******************************************************************************/
****************************************************************************/
#ifdef CONFIG_USBHOST_TRACE
int usbhost_trenumerate(usbhost_trcallback_t callback, FAR void *arg)
+14 -14
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* cc3000_common.c.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,15 +30,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Included files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
/*****************************************************************************
/****************************************************************************
* Name:__error__
*
* Description:
@@ -51,9 +51,9 @@
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: UINT32_TO_STREAM_f
*
* Description:
@@ -67,7 +67,7 @@
* Returned Value:
* Pointer to the new stream
*
*****************************************************************************/
****************************************************************************/
uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
{
@@ -78,7 +78,7 @@ uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
return p;
}
/*****************************************************************************
/****************************************************************************
* Name: UINT16_TO_STREAM_f
*
* Description:
@@ -92,7 +92,7 @@ uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
* Returned Value:
* Pointer to the new stream
*
*****************************************************************************/
****************************************************************************/
uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
{
@@ -101,7 +101,7 @@ uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
return p;
}
/*****************************************************************************
/****************************************************************************
* Name: STREAM_TO_UINT16_f
*
* Description:
@@ -115,7 +115,7 @@ uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
* Returned Value:
* Pointer to the new 16 bit
*
*****************************************************************************/
****************************************************************************/
uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
{
@@ -123,7 +123,7 @@ uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
(*(p + offset + 1)) << 8) + (uint16_t)(*(p + offset)));
}
/*****************************************************************************
/****************************************************************************
* Name: STREAM_TO_UINT32_f
*
* Description:
@@ -137,7 +137,7 @@ uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset)
* Returned Value:
* Pointer to the new 32 bit
*
*****************************************************************************/
****************************************************************************/
unsigned long STREAM_TO_UINT32_f(char* p, uint16_t offset)
{
+23 -23
View File
@@ -33,11 +33,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
@@ -57,9 +57,9 @@
#include <nuttx/wireless/cc3000.h>
#include <nuttx/wireless/cc3000/cc3000_common.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#undef SPI_DEBUG /* Define to enable debug */
#undef SPI_VERBOSE /* Define to enable verbose debug */
@@ -77,9 +77,9 @@
# define spivdbg(x...)
#endif
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
static struct
{
@@ -96,11 +96,11 @@ static struct
-1,
};
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: cc3000_resume
*
* Description:
@@ -112,7 +112,7 @@ static struct
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_resume(void)
{
@@ -121,7 +121,7 @@ void cc3000_resume(void)
nllvdbg("Done\n");
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_write
*
* Description:
@@ -133,7 +133,7 @@ void cc3000_resume(void)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
{
@@ -141,7 +141,7 @@ long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
return write(spiconf.cc3000fd,pUserBuffer,usLength) == usLength ? 0 : -errno;
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_read
*
* Description:
@@ -154,7 +154,7 @@ long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
{
@@ -162,7 +162,7 @@ long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
return read(spiconf.cc3000fd,pUserBuffer,usLength);
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_wait
*
* Description:
@@ -173,7 +173,7 @@ long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
uint8_t *cc3000_wait(void)
{
@@ -184,7 +184,7 @@ uint8_t *cc3000_wait(void)
return spiconf.rx_buffer.pbuffer;
}
/*****************************************************************************
/****************************************************************************
* Name: unsoliced_thread_func
*
* Description:
@@ -196,7 +196,7 @@ uint8_t *cc3000_wait(void)
*
* Returned Value:
*
*****************************************************************************/
****************************************************************************/
static void *unsoliced_thread_func(void *parameter)
{
@@ -234,7 +234,7 @@ static void *unsoliced_thread_func(void *parameter)
return (pthread_addr_t)status;
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_open
*
* Description:
@@ -246,7 +246,7 @@ static void *unsoliced_thread_func(void *parameter)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_open(gcSpiHandleRx pfRxHandler)
{
@@ -286,7 +286,7 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
DEBUGASSERT(spiconf.cc3000fd >= 0);
}
/*****************************************************************************
/****************************************************************************
* Name: cc3000_close
*
* Description:
@@ -298,7 +298,7 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void cc3000_close(void)
{
+32 -32
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* evnt_handler.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,9 +51,9 @@
#include "cc3000drv.h"
#include <nuttx/wireless/cc3000/netapp.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#define FLOW_CONTROL_EVENT_HANDLE_OFFSET (0)
#define FLOW_CONTROL_EVENT_BLOCK_MODE_OFFSET (1)
@@ -103,23 +103,23 @@
#define GET_SCAN_RESULTS_FRAME_TIME_OFFSET (10)
#define GET_SCAN_RESULTS_SSID_MAC_LENGTH (38)
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
unsigned long socket_active_status = SOCKET_STATUS_INIT_VAL;
/*****************************************************************************
/****************************************************************************
* Private Function Prototypes
*****************************************************************************/
****************************************************************************/
static long hci_event_unsol_flowcontrol_handler(char *pEvent);
static void update_socket_active_status(char *resp_params);
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: hci_unsol_handle_patch_request
*
* Description:
@@ -131,7 +131,7 @@ static void update_socket_active_status(char *resp_params);
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_unsol_handle_patch_request(char *event_hdr)
{
@@ -208,7 +208,7 @@ void hci_unsol_handle_patch_request(char *event_hdr)
}
}
/*****************************************************************************
/****************************************************************************
* Name: hci_event_handler
*
* Description:
@@ -223,7 +223,7 @@ void hci_unsol_handle_patch_request(char *event_hdr)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
{
@@ -552,7 +552,7 @@ uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
return NULL;
}
/*****************************************************************************
/****************************************************************************
* Name: hci_unsol_event_handler
*
* Description:
@@ -565,7 +565,7 @@ uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
* 1 if event supported and handled
* 0 if event is not supported
*
*****************************************************************************/
****************************************************************************/
long hci_unsol_event_handler(char *event_hdr)
{
@@ -737,7 +737,7 @@ long hci_unsol_event_handler(char *event_hdr)
return 0;
}
/*****************************************************************************
/****************************************************************************
* Name: hci_unsolicited_event_handler
*
* Description:
@@ -750,7 +750,7 @@ long hci_unsol_event_handler(char *event_hdr)
* Returned Value:
* ESUCCESS if successful, EFAIL if an error occurred
*
*****************************************************************************/
****************************************************************************/
long hci_unsolicited_event_handler(void)
{
@@ -782,7 +782,7 @@ long hci_unsolicited_event_handler(void)
return res;
}
/*****************************************************************************
/****************************************************************************
* Name: set_socket_active_status
*
* Description:
@@ -796,7 +796,7 @@ long hci_unsolicited_event_handler(void)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void set_socket_active_status(long Sd, long Status)
{
@@ -807,7 +807,7 @@ void set_socket_active_status(long Sd, long Status)
}
}
/*****************************************************************************
/****************************************************************************
* Name: hci_event_unsol_flowcontrol_handler
*
* Description:
@@ -821,7 +821,7 @@ void set_socket_active_status(long Sd, long Status)
* Returned Value:
* ESUCCESS if successful, EFAIL if an error occurred
*
*****************************************************************************/
****************************************************************************/
long hci_event_unsol_flowcontrol_handler(char *pEvent)
{
@@ -848,7 +848,7 @@ long hci_event_unsol_flowcontrol_handler(char *pEvent)
return(ESUCCESS);
}
/*****************************************************************************
/****************************************************************************
* Name: get_socket_active_status
*
* Description:
@@ -860,7 +860,7 @@ long hci_event_unsol_flowcontrol_handler(char *pEvent)
* Returned Value:
* Current status of the socket.
*
*****************************************************************************/
****************************************************************************/
long get_socket_active_status(long Sd)
{
@@ -873,7 +873,7 @@ long get_socket_active_status(long Sd)
return SOCKET_STATUS_INACTIVE;
}
/*****************************************************************************
/****************************************************************************
* Name: update_socket_active_status
*
* Description:
@@ -885,7 +885,7 @@ long get_socket_active_status(long Sd)
* Returned Value:
* Current status of the socket.
*
*****************************************************************************/
****************************************************************************/
void update_socket_active_status(char *resp_params)
{
@@ -900,7 +900,7 @@ void update_socket_active_status(char *resp_params)
}
}
/*****************************************************************************
/****************************************************************************
* Name: SimpleLinkWaitEvent
*
* Description:
@@ -914,7 +914,7 @@ void update_socket_active_status(char *resp_params)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
{
@@ -956,7 +956,7 @@ void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
nllvdbg("Done for opcode 0x%x\n",opcode);
}
/*****************************************************************************
/****************************************************************************
* Name: SimpleLinkWaitData
*
* Description:
@@ -971,7 +971,7 @@ void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
{
+16 -16
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* hci.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -47,16 +47,16 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include <nuttx/wireless/cc3000/wlan.h>
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define SL_PATCH_PORTION_SIZE (1000)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Name: hci_command_send
*
* Description:
@@ -70,7 +70,7 @@
* Returned Value:
* Zero
*
*****************************************************************************/
****************************************************************************/
uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
uint8_t ucArgsLength)
@@ -92,7 +92,7 @@ uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
return 0;
}
/******************************************************************************
/****************************************************************************
* Name: hci_data_send
*
* Description:
@@ -108,7 +108,7 @@ uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
uint16_t usDataLength, const uint8_t *ucTail,
@@ -132,7 +132,7 @@ long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
return ESUCCESS;
}
/******************************************************************************
/****************************************************************************
* Name: hci_data_command_send
*
* Description:
@@ -147,7 +147,7 @@ long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
uint8_t ucArgsLength,uint16_t ucDataLength)
@@ -166,7 +166,7 @@ void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
SIMPLE_LINK_HCI_DATA_CMND_HEADER_SIZE);
}
/******************************************************************************
/****************************************************************************
* Name: hci_patch_send
*
* Description:
@@ -181,7 +181,7 @@ void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void hci_patch_send(uint8_t ucOpcode, uint8_t *pucBuff, char *patch,
uint16_t usDataLength)
+26 -26
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* netapp.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <string.h>
@@ -46,9 +46,9 @@
#include "cc3000.h"
#include "cc3000_socket.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define MIN_TIMER_VAL_SECONDS 20
#define MIN_TIMER_SET(t) if ((0 != t) && (t < MIN_TIMER_VAL_SECONDS)) \
@@ -62,11 +62,11 @@
#define NETAPP_SET_DEBUG_LEVEL_PARAMS_LEN (4)
#define NETAPP_PING_SEND_PARAMS_LEN (16)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: netapp_config_mac_adrress
*
* Description:
@@ -80,14 +80,14 @@
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
long netapp_config_mac_adrress(uint8_t *mac)
{
return nvmem_set_mac_address(mac);
}
/******************************************************************************
/****************************************************************************
* Name: netapp_dhcp
*
* Description:
@@ -112,7 +112,7 @@ long netapp_config_mac_adrress(uint8_t *mac)
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
unsigned long *aucDefaultGateway, unsigned long *aucDNSServer)
@@ -148,7 +148,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
return(scRet);
}
/******************************************************************************
/****************************************************************************
* Name: netapp_timeout_values
*
* Description:
@@ -196,7 +196,7 @@ long netapp_dhcp(unsigned long *aucIP, unsigned long *aucSubnetMask,
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
@@ -241,7 +241,7 @@ long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_send
*
* Description:
@@ -263,7 +263,7 @@ long netapp_timeout_values(unsigned long *aucDHCP, unsigned long *aucARP,
* Returned Value:
* Return on success 0, otherwise error.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
@@ -299,7 +299,7 @@ long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_report
*
* Description:
@@ -324,7 +324,7 @@ long netapp_ping_send(unsigned long *ip, unsigned long ulPingAttempts,
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
void netapp_ping_report(void)
@@ -349,7 +349,7 @@ void netapp_ping_report(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ping_stop
*
* Description:
@@ -361,7 +361,7 @@ void netapp_ping_report(void)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_ping_stop(void)
@@ -388,7 +388,7 @@ long netapp_ping_stop(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_ipconfig
*
* Description:
@@ -416,7 +416,7 @@ long netapp_ping_stop(void)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
@@ -443,7 +443,7 @@ void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_arp_flush
*
* Description:
@@ -455,7 +455,7 @@ void netapp_ipconfig(tNetappIpconfigRetArgs * ipconfig)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_arp_flush(void)
@@ -483,7 +483,7 @@ long netapp_arp_flush(void)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: netapp_set_debug_level
*
* Description:
@@ -507,7 +507,7 @@ long netapp_arp_flush(void)
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long netapp_set_debug_level(unsigned long ulLevel)
+22 -22
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* nvmem.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Included Files
******************************************************************************/
****************************************************************************/
#include <stdio.h>
#include <string.h>
@@ -44,18 +44,18 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include "cc3000.h"
/******************************************************************************
/****************************************************************************
* Pre-processor Definitions
******************************************************************************/
****************************************************************************/
#define NVMEM_READ_PARAMS_LEN (12)
#define NVMEM_CREATE_PARAMS_LEN (8)
#define NVMEM_WRITE_PARAMS_LEN (16)
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
/******************************************************************************
****************************************************************************/
/****************************************************************************
* Name: nvmem_read
*
* Description:
@@ -79,7 +79,7 @@
* Returned Value:
* Number of bytes read, otherwise error.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
unsigned long ulOffset, uint8_t *buff)
@@ -120,7 +120,7 @@ signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
return ucStatus;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_write
*
* Description:
@@ -141,7 +141,7 @@ signed long nvmem_read(unsigned long ulFileId, unsigned long ulLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
unsigned long ulEntryOffset, uint8_t *buff)
@@ -179,7 +179,7 @@ signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
return iRes;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_set_mac_address
*
* Description:
@@ -192,14 +192,14 @@ signed long nvmem_write(unsigned long ulFileId, unsigned long ulLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_set_mac_address(uint8_t *mac)
{
return nvmem_write(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_get_mac_address
*
* Description:
@@ -212,14 +212,14 @@ uint8_t nvmem_set_mac_address(uint8_t *mac)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_get_mac_address(uint8_t *mac)
{
return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_write_patch
*
* Description:
@@ -236,7 +236,7 @@ uint8_t nvmem_get_mac_address(uint8_t *mac)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
const uint8_t *spData)
@@ -270,7 +270,7 @@ uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
return status;
}
/******************************************************************************
/****************************************************************************
* Name: nvmem_read_sp_version
*
* Description:
@@ -284,7 +284,7 @@ uint8_t nvmem_write_patch(unsigned long ulFileId, unsigned long spLength,
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
uint8_t nvmem_read_sp_version(uint8_t *patchVer)
@@ -316,7 +316,7 @@ uint8_t nvmem_read_sp_version(uint8_t *patchVer)
}
#endif
/******************************************************************************
/****************************************************************************
* Name: nvmem_create_entry
*
* Description:
@@ -336,7 +336,7 @@ uint8_t nvmem_read_sp_version(uint8_t *patchVer)
* Returned Value:
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long nvmem_create_entry(unsigned long ulFileId, unsigned long ulNewLen)
{
+16 -16
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* security.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,19 +30,19 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/wireless/cc3000/security.h>
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
// foreward sbox
@@ -98,9 +98,9 @@ const uint8_t Rcon[11] =
uint8_t aexpandedKey[176];
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
//*****************************************************************************
//
//! expandKey
@@ -443,7 +443,7 @@ void aes_decr(uint8_t *state, uint8_t *expandedKey)
}
/*****************************************************************************
/****************************************************************************
* Name: aes_encrypt
*
* Description:
@@ -458,7 +458,7 @@ void aes_decr(uint8_t *state, uint8_t *expandedKey)
* Returned Value
* None
*
*****************************************************************************/
****************************************************************************/
void aes_encrypt(uint8_t *state, uint8_t *key)
{
@@ -467,7 +467,7 @@ void aes_encrypt(uint8_t *state, uint8_t *key)
aes_encr(state, aexpandedKey);
}
/*****************************************************************************
/****************************************************************************
* Name: aes_decrypt
*
* Description:
@@ -482,7 +482,7 @@ void aes_encrypt(uint8_t *state, uint8_t *key)
* Returned Value
* None
*
*****************************************************************************/
****************************************************************************/
void aes_decrypt(uint8_t *state, uint8_t *key)
{
@@ -490,7 +490,7 @@ void aes_decrypt(uint8_t *state, uint8_t *key)
aes_decr(state, aexpandedKey);
}
/*****************************************************************************
/****************************************************************************
* Name: aes_read_key
*
* Description:
@@ -503,7 +503,7 @@ void aes_decrypt(uint8_t *state, uint8_t *key)
* Returned Value
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long aes_read_key(uint8_t *key)
{
@@ -514,7 +514,7 @@ signed long aes_read_key(uint8_t *key)
return returnValue;
}
/*****************************************************************************
/****************************************************************************
* Name: aes_write_key
*
* Description:
@@ -527,7 +527,7 @@ signed long aes_read_key(uint8_t *key)
* Returned Value
* On success 0, error otherwise.
*
*****************************************************************************/
****************************************************************************/
signed long aes_write_key(uint8_t *key)
{
+36 -36
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* socket.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <sys/types.h>
#include <sys/select.h>
@@ -54,9 +54,9 @@
#include "cc3000drv.h"
#include "cc3000.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -99,7 +99,7 @@ static const int bsd2ti_types[] =
* Public Functions
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: socket
*
* Description:
@@ -120,7 +120,7 @@ static const int bsd2ti_types[] =
* On success, socket handle that is used for consequent socket
* operations. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_socket(int domain, int type, int protocol)
{
@@ -175,7 +175,7 @@ int cc3000_socket(int domain, int type, int protocol)
return sd;
}
/*****************************************************************************
/****************************************************************************
* Name: closesocket
*
* Description:
@@ -187,7 +187,7 @@ int cc3000_socket(int domain, int type, int protocol)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_closesocket(int sockfd)
{
@@ -205,7 +205,7 @@ int cc3000_closesocket(int sockfd)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: accept, cc3000_do_accept
*
* Description:
@@ -248,7 +248,7 @@ int cc3000_closesocket(int sockfd)
* - On connection pending, SOC_IN_PROGRESS (-2)
* - On failure, SOC_ERROR (-1)
*
*****************************************************************************/
****************************************************************************/
int cc3000_do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
{
@@ -290,7 +290,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: bind
*
* Description:
@@ -311,7 +311,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
{
@@ -323,7 +323,7 @@ int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: listen
*
* Description:
@@ -345,7 +345,7 @@ int cc3000_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_listen(int sockfd, int backlog)
{
@@ -357,7 +357,7 @@ int cc3000_listen(int sockfd, int backlog)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: connect
*
* Description:
@@ -385,7 +385,7 @@ int cc3000_listen(int sockfd, int backlog)
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
{
@@ -397,7 +397,7 @@ int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrle
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: select
*
* Description:
@@ -434,7 +434,7 @@ int cc3000_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrle
* will return without delay.
* *exceptfds - return the sockets which closed recently.
*
*****************************************************************************/
****************************************************************************/
int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
struct timeval *timeout)
@@ -450,7 +450,7 @@ int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
}
#ifndef CC3000_TINY_DRIVER
/*****************************************************************************
/****************************************************************************
* Name: setsockopt
*
* Description:
@@ -496,7 +496,7 @@ int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds,
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_setsockopt(int sockfd, int level, int option,
FAR const void *value, socklen_t value_len)
@@ -510,7 +510,7 @@ int cc3000_setsockopt(int sockfd, int level, int option,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: getsockopt
*
* Description:
@@ -556,7 +556,7 @@ int cc3000_setsockopt(int sockfd, int level, int option,
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
FAR socklen_t *value_len)
@@ -569,7 +569,7 @@ int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: recv
*
* Description:
@@ -589,7 +589,7 @@ int cc3000_getsockopt(int sockfd, int level, int option, FAR void *value,
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
{
@@ -619,7 +619,7 @@ ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: recvfrom
*
* Description:
@@ -646,7 +646,7 @@ ssize_t cc3000_recv(int sockfd, FAR void *buf, size_t len, int flags)
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
FAR struct sockaddr *from, FAR socklen_t *fromlen)
@@ -672,7 +672,7 @@ ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: send
*
* Description:
@@ -692,7 +692,7 @@ ssize_t cc3000_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
{
@@ -704,7 +704,7 @@ ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: sendto
*
* Description:
@@ -728,7 +728,7 @@ ssize_t cc3000_send(int sockfd, FAR const void *buf, size_t len, int flags)
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
FAR const struct sockaddr *to, socklen_t tolen)
@@ -741,7 +741,7 @@ ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: gethostbyname
*
* Description:
@@ -762,7 +762,7 @@ ssize_t cc3000_sendto(int sockfd, FAR const void *buf, size_t len, int flags,
* Returned Value:
* On success, positive is returned. On error, negative is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
// TODO: Standard is struct hostent *gethostbyname(const char *name);
@@ -777,7 +777,7 @@ int cc3000_gethostbyname(char * hostname, uint16_t usNameLen, unsigned long* out
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: mdnsAdvertiser
*
* Description:
@@ -793,7 +793,7 @@ int cc3000_gethostbyname(char * hostname, uint16_t usNameLen, unsigned long* out
* On success, zero is returned, return SOC_ERROR if socket was not
* opened successfully, or if an error occurred.
*
*****************************************************************************/
****************************************************************************/
int cc3000_mdnsadvertiser(uint16_t mdnsEnabled, char *deviceServiceName,
uint16_t deviceServiceNameLength)
+43 -43
View File
@@ -33,11 +33,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <sys/time.h>
#include <stdio.h>
@@ -51,9 +51,9 @@
#include <nuttx/wireless/cc3000/evnt_handler.h>
#include <nuttx/wireless/cc3000/netapp.h>
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/* Enable this flag if and only if you must comply with BSD socket close()
* function
@@ -101,10 +101,10 @@
#define MDNS_DEVICE_SERVICE_MAX_LENGTH (32)
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: HostFlowControlConsumeBuff
*
* Input Parameters:
@@ -121,7 +121,7 @@
* becomes available, else return immediately with correct status
* regarding the buffers available.
*
*****************************************************************************/
****************************************************************************/
int HostFlowControlConsumeBuff(int sd)
{
@@ -197,7 +197,7 @@ int HostFlowControlConsumeBuff(int sd)
#endif
}
/*****************************************************************************
/****************************************************************************
* Name: socket
*
* Decription:
@@ -218,7 +218,7 @@ int HostFlowControlConsumeBuff(int sd)
* On success, socket handle that is used for consequent socket
* operations. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
int cc3000_socket_impl(long domain, long type, long protocol)
{
@@ -250,7 +250,7 @@ int cc3000_socket_impl(long domain, long type, long protocol)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: closesocket
*
* Decription:
@@ -262,7 +262,7 @@ int cc3000_socket_impl(long domain, long type, long protocol)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_closesocket_impl(long sd)
{
@@ -296,7 +296,7 @@ long cc3000_closesocket_impl(long sd)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: accept
*
* Decription:
@@ -339,7 +339,7 @@ long cc3000_closesocket_impl(long sd)
* - On connection pending, SOC_IN_PROGRESS (-2)
* - On failure, SOC_ERROR (-1)
*
*****************************************************************************/
****************************************************************************/
long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
{
@@ -385,7 +385,7 @@ long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: bind
*
* Decription:
@@ -406,7 +406,7 @@ long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
{
@@ -439,7 +439,7 @@ long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: listen
*
* Decription:
@@ -461,7 +461,7 @@ long cc3000_bind_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
* Returned Value:
* On success, zero is returned. On error, -1 is returned.
*
*****************************************************************************/
****************************************************************************/
long cc3000_listen_impl(long sd, long backlog)
{
@@ -490,7 +490,7 @@ long cc3000_listen_impl(long sd, long backlog)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: gethostbyname
*
* Decription:
@@ -511,7 +511,7 @@ long cc3000_listen_impl(long sd, long backlog)
* Returned Value:
* On success, positive is returned. On error, negative is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long* out_ip_addr)
@@ -552,7 +552,7 @@ int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: connect
*
* Decription:
@@ -580,7 +580,7 @@ int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen)
{
@@ -612,7 +612,7 @@ long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen
return (long)ret;
}
/*****************************************************************************
/****************************************************************************
* Name: select
*
* Decription:
@@ -649,7 +649,7 @@ long cc3000_connect_impl(long sd, const struct sockaddr *addr, socklen_t addrlen
* will return without delay.
* *exceptsds - return the sockets which closed recently.
*
*****************************************************************************/
****************************************************************************/
int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *writesds,
TICC3000fd_set *exceptsds, struct timeval *timeout)
@@ -732,7 +732,7 @@ int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *write
}
}
/*****************************************************************************
/****************************************************************************
* Name: setsockopt
*
* Decription:
@@ -778,7 +778,7 @@ int cc3000_select_impl(long nfds, TICC3000fd_set *readsds, TICC3000fd_set *write
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval, socklen_t optlen)
@@ -819,7 +819,7 @@ int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: getsockopt
*
* Decription:
@@ -865,7 +865,7 @@ int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval
* Returned Value:
* On success, zero is returned. On error, -1 is returned
*
*****************************************************************************/
****************************************************************************/
int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, socklen_t *optlen)
{
@@ -903,7 +903,7 @@ int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, sock
}
}
/*****************************************************************************
/****************************************************************************
* Name: simple_link_recv
*
* Input Parameters:
@@ -925,7 +925,7 @@ int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, sock
* excess bytes may be discarded depending on the type of
* socket the message is received from
*
*****************************************************************************/
****************************************************************************/
int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *from,
socklen_t *fromlen, long opcode)
@@ -965,7 +965,7 @@ int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *
return tSocketReadEvent.iNumberOfBytes;
}
/*****************************************************************************
/****************************************************************************
* Name: recv
*
* Decription:
@@ -985,14 +985,14 @@ int simple_link_recv(long sd, void *buf, long len, long flags, struct sockaddr *
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_recv_impl(long sd, void *buf, long len, long flags)
{
return(simple_link_recv(sd, buf, len, flags, NULL, NULL, HCI_CMND_RECV));
}
/*****************************************************************************
/****************************************************************************
* Name: recvfrom
*
* Decription:
@@ -1019,7 +1019,7 @@ int cc3000_recv_impl(long sd, void *buf, long len, long flags)
* Return the number of bytes received, or -1 if an error
* occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockaddr *from,
socklen_t *fromlen)
@@ -1028,7 +1028,7 @@ int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockad
HCI_CMND_RECVFROM));
}
/*****************************************************************************
/****************************************************************************
* Name: simple_link_send
*
* Input Parameters:
@@ -1049,7 +1049,7 @@ int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags, struct sockad
* This function is used to transmit a message to another
* socket
*
*****************************************************************************/
****************************************************************************/
int simple_link_send(long sd, const void *buf, long len, long flags,
const struct sockaddr *to, long tolen, long opcode)
@@ -1144,7 +1144,7 @@ int simple_link_send(long sd, const void *buf, long len, long flags,
return len;
}
/*****************************************************************************
/****************************************************************************
* Name: send
*
* Decription:
@@ -1164,14 +1164,14 @@ int simple_link_send(long sd, const void *buf, long len, long flags,
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_send_impl(long sd, const void *buf, long len, long flags)
{
return(simple_link_send(sd, buf, len, flags, NULL, 0, HCI_CMND_SEND));
}
/*****************************************************************************
/****************************************************************************
* Name: sendto
*
* Decription:
@@ -1195,7 +1195,7 @@ int cc3000_send_impl(long sd, const void *buf, long len, long flags)
* Return the number of bytes transmitted, or -1 if an
* error occurred
*
*****************************************************************************/
****************************************************************************/
int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const struct sockaddr *to,
socklen_t tolen)
@@ -1203,7 +1203,7 @@ int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const str
return(simple_link_send(sd, buf, len, flags, to, tolen, HCI_CMND_SENDTO));
}
/*****************************************************************************
/****************************************************************************
* Name: mdnsAdvertiser
*
* Decription:
@@ -1219,7 +1219,7 @@ int cc3000_sendto_impl(long sd, const void *buf, long len, long flags, const str
* On success, zero is returned, return SOC_ERROR if socket was not
* opened successfully, or if an error occurred.
*
*****************************************************************************/
****************************************************************************/
int cc3000_mdnsadvertiser_impl(uint16_t mdnsEnabled, char * deviceServiceName,
uint16_t deviceServiceNameLength)
+48 -48
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* wlan.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
@@ -30,11 +30,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
@@ -53,9 +53,9 @@
#include "cc3000.h"
#include "cc3000drv.h"
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
#define SMART_CONFIG_PROFILE_SIZE 67 /* 67 = 32 (max ssid) + 32 (max key) +
* 1 (SSID length) + 1 (security type) +
@@ -102,9 +102,9 @@
* Private Variables
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
volatile sSimplLinkInformation tSLInformation;
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
@@ -112,10 +112,10 @@ uint8_t akey[AES128_KEY_SIZE];
uint8_t profileArray[SMART_CONFIG_PROFILE_SIZE];
#endif /* CC3000_UNENCRYPTED_SMART_CONFIG */
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
/*****************************************************************************
****************************************************************************/
/****************************************************************************
* Name: SimpleLink_Init_Start
*
* Input Parameters:
@@ -132,7 +132,7 @@ uint8_t profileArray[SMART_CONFIG_PROFILE_SIZE];
* Description:
* Send HCI_CMND_SIMPLE_LINK_START to CC3000
*
*****************************************************************************/
****************************************************************************/
static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
{
@@ -157,7 +157,7 @@ static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_init
*
* Input Parameters:
@@ -193,7 +193,7 @@ static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
*
* WARNING: This function must be called before ANY other wlan driver function
*
*****************************************************************************/
****************************************************************************/
void wlan_init(size_t max_tx_len,
tWlanCB sWlanCB,
@@ -235,7 +235,7 @@ void wlan_init(size_t max_tx_len,
}
}
/*****************************************************************************
/****************************************************************************
* Name: SpiReceiveHandler
*
* Input Parameters:
@@ -248,7 +248,7 @@ void wlan_init(size_t max_tx_len,
* The function triggers Received event/data processing. It is
* called from the SPI library to receive the data
*
*****************************************************************************/
****************************************************************************/
void SpiReceiveHandler(void *pvBuffer)
{
@@ -266,7 +266,7 @@ void SpiReceiveHandler(void *pvBuffer)
hci_unsolicited_event_handler();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_start
*
* Input Parameters:
@@ -291,7 +291,7 @@ void SpiReceiveHandler(void *pvBuffer)
* WARNING: This function must be called after wlan_init and before any
* other wlan API
*
*****************************************************************************/
****************************************************************************/
void wlan_start(uint16_t usPatchesAvailableAtHost)
{
@@ -321,7 +321,7 @@ void wlan_start(uint16_t usPatchesAvailableAtHost)
cc3000_lib_unlock();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_get_buffer
*
* Input Parameters:
@@ -330,14 +330,14 @@ void wlan_start(uint16_t usPatchesAvailableAtHost)
* Returned Value:
* None
*
*****************************************************************************/
****************************************************************************/
void wlan_get_buffer(wlan_buffer_desc *pdes)
{
*pdes = tSLInformation.usrBuffer;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_stop
*
* Input Parameters:
@@ -349,7 +349,7 @@ void wlan_get_buffer(wlan_buffer_desc *pdes)
* Description:
* Stop WLAN device by putting it into reset state.
*
*****************************************************************************/
****************************************************************************/
void wlan_stop(void)
{
@@ -358,7 +358,7 @@ void wlan_stop(void)
cc3000_lib_unlock();
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_connect
*
* Input Parameters:
@@ -388,7 +388,7 @@ void wlan_stop(void)
* type WEP, please confirm that the key is set as ASCII and not
* as HEX.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_connect(unsigned long ulSecType, FAR const char *ssid,
@@ -489,7 +489,7 @@ long wlan_connect(FAR const char *ssid, long ssid_len)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_disconnect
*
* Input Parameters:
@@ -501,7 +501,7 @@ long wlan_connect(FAR const char *ssid, long ssid_len)
* Description:
* Disconnect connection from AP.
*
*****************************************************************************/
****************************************************************************/
long wlan_disconnect(void)
{
@@ -525,7 +525,7 @@ long wlan_disconnect(void)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_set_connection_policy
*
* Input Parameters:
@@ -555,7 +555,7 @@ long wlan_disconnect(void)
* enabled, the device will try to connect to any AP.
* * Note that the policy settings are stored in the CC3000 NVMEM.
*
*****************************************************************************/
****************************************************************************/
long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
unsigned long ulShouldUseFastConnect,
@@ -590,7 +590,7 @@ long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_add_profile
*
* Input Parameters:
@@ -616,7 +616,7 @@ long wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
* profile based on security policy, signal strength, etc
* parameters. All the profiles are stored in CC3000 NVMEM.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_add_profile(unsigned long ulSecType, uint8_t *ucSsid,
@@ -756,7 +756,7 @@ long wlan_add_profile(unsigned long ulSecType, uint8_t * ucSsid, uint8_t ulSsidL
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_del_profile
*
* Input Parameters:
@@ -770,7 +770,7 @@ long wlan_add_profile(unsigned long ulSecType, uint8_t * ucSsid, uint8_t ulSsidL
*
* @Note In order to delete all stored profile, set index to 255.
*
*****************************************************************************/
****************************************************************************/
long wlan_ioctl_del_profile(unsigned long ulIndex)
{
@@ -802,7 +802,7 @@ long wlan_ioctl_del_profile(unsigned long ulIndex)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_get_scan_results
*
* Input Parameters:
@@ -833,7 +833,7 @@ long wlan_ioctl_del_profile(unsigned long ulIndex)
*
* NOTE: scan_timeout, is not supported on this version.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults)
@@ -865,7 +865,7 @@ long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_set_scan_params
*
* Input Parameters:
@@ -900,7 +900,7 @@ long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout, uint8_t *ucResults
*
* @Note uiDefaultTxPower, is not supported on this version.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_set_scan_params(unsigned long uiEnable,
@@ -950,7 +950,7 @@ long wlan_ioctl_set_scan_params(unsigned long uiEnable,
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_set_event_mask
*
* Input Parameters:
@@ -972,7 +972,7 @@ long wlan_ioctl_set_scan_params(unsigned long uiEnable,
* Mask event according to bit mask. In case that event is
* masked (1), the device will not send the masked event to host.
*
*****************************************************************************/
****************************************************************************/
long wlan_set_event_mask(unsigned long ulMask)
{
@@ -1025,7 +1025,7 @@ long wlan_set_event_mask(unsigned long ulMask)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_ioctl_statusget
*
* Input Parameters:
@@ -1038,7 +1038,7 @@ long wlan_set_event_mask(unsigned long ulMask)
* Description:
* get wlan status: disconnected, scanning, connecting or connected
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_TINY_DRIVER
long wlan_ioctl_statusget(void)
@@ -1064,7 +1064,7 @@ long wlan_ioctl_statusget(void)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_start
*
* Input Parameters:
@@ -1083,7 +1083,7 @@ long wlan_ioctl_statusget(void)
* @Note An asynchronous event - Smart Config Done will be generated as soon
* as the process finishes successfully.
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_start(unsigned long algoEncryptedFlag)
{
@@ -1112,7 +1112,7 @@ long wlan_smart_config_start(unsigned long algoEncryptedFlag)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_stop
*
* Input Parameters:
@@ -1124,7 +1124,7 @@ long wlan_smart_config_start(unsigned long algoEncryptedFlag)
* Description:
* Stop the acquire profile procedure
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_stop(void)
{
@@ -1146,7 +1146,7 @@ long wlan_smart_config_stop(void)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_set_prefix
*
* Input Parameters:
@@ -1161,7 +1161,7 @@ long wlan_smart_config_stop(void)
*
* @Note The prefix is stored in CC3000 NVMEM
*
*****************************************************************************/
****************************************************************************/
long wlan_smart_config_set_prefix(char* cNewPrefix)
{
@@ -1203,7 +1203,7 @@ long wlan_smart_config_set_prefix(char* cNewPrefix)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: wlan_smart_config_process
*
* Input Parameters:
@@ -1218,7 +1218,7 @@ long wlan_smart_config_set_prefix(char* cNewPrefix)
* The encrypted data is decrypted and stored as a profile.
* behavior is as defined by connection policy.
*
*****************************************************************************/
****************************************************************************/
#ifndef CC3000_UNENCRYPTED_SMART_CONFIG
long wlan_smart_config_process()
+8 -8
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* libc/stdlib/lib_bsearch.c
*
* Copyright (c) 1990, 1993
@@ -32,20 +32,20 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <stdlib.h>
#include <assert.h>
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: bsearch
*
* Description:
@@ -101,7 +101,7 @@
* when 'lim' is 4, we still looked at item 2, so we have to make 'lim'
* 3, then halve, obtaining 1, so that we will only look at item 3.
*
*****************************************************************************/
****************************************************************************/
FAR void *bsearch(FAR const void *key, FAR const void *base, size_t nel,
size_t width, CODE int (*compar)(FAR const void *,
+3 -3
View File
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -44,7 +44,7 @@
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
#ifndef CONFIG_ARCH_STRCMP
int strcasecmp(const char *cs, const char *ct)
+3 -3
View File
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -43,7 +43,7 @@
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
#ifndef CONFIG_ARCH_STRCMP
int strcmp(const char *cs, const char *ct)
+4 -4
View File
@@ -31,15 +31,15 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Compilation Switches
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -49,7 +49,7 @@
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
#ifndef CONFIG_ARCH_STRNCASECMP
int strncasecmp(const char *cs, const char *ct, size_t nb)
+4 -4
View File
@@ -31,15 +31,15 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Compilation Switches
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
@@ -47,7 +47,7 @@
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
#ifndef CONFIG_ARCH_STRNCMP
int strncmp(const char *cs, const char *ct, size_t nb)
+32 -32
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_childstatus.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -48,9 +48,9 @@
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/* Note that there cannot be more that CONFIG_MAX_TASKS tasks in total.
* However, the number of child status structures may need to be significantly
* larger because this number includes the maximum number of tasks that are
@@ -70,9 +70,9 @@
# undef CONFIG_DEBUG_CHILDSTATUS
#endif
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/* Globals are maintained in a structure to minimize name collisions. */
struct child_pool_s
@@ -81,17 +81,17 @@ struct child_pool_s
FAR struct child_status_s *freelist;
};
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
static struct child_pool_s g_child_pool;
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_dumpchildren
*
* Description:
@@ -106,7 +106,7 @@ static struct child_pool_s g_child_pool;
* Assumptions:
* Called early in initialization. No special precautions are required.
*
*****************************************************************************/
****************************************************************************/
#ifdef CONFIG_DEBUG_CHILDSTATUS
static void group_dumpchildren(FAR struct task_group_s *group,
@@ -126,11 +126,11 @@ static void group_dumpchildren(FAR struct task_group_s *group,
# define group_dumpchildren(t,m)
#endif
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: task_initialize
*
* Description:
@@ -146,7 +146,7 @@ static void group_dumpchildren(FAR struct task_group_s *group,
* Assumptions:
* Called early in initialization. No special precautions are required.
*
*****************************************************************************/
****************************************************************************/
void task_initialize(void)
{
@@ -166,7 +166,7 @@ void task_initialize(void)
}
}
/*****************************************************************************
/****************************************************************************
* Name: group_allocchild
*
* Description:
@@ -184,7 +184,7 @@ void task_initialize(void)
* Called during task creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
FAR struct child_status_s *group_allocchild(void)
{
@@ -202,7 +202,7 @@ FAR struct child_status_s *group_allocchild(void)
return ret;
}
/*****************************************************************************
/****************************************************************************
* Name: group_freechild
*
* Description:
@@ -218,7 +218,7 @@ FAR struct child_status_s *group_allocchild(void)
* Called during task creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
void group_freechild(FAR struct child_status_s *child)
{
@@ -231,7 +231,7 @@ void group_freechild(FAR struct child_status_s *child)
}
}
/*****************************************************************************
/****************************************************************************
* Name: group_addchild
*
* Description:
@@ -248,7 +248,7 @@ void group_freechild(FAR struct child_status_s *child)
* Called during task creation processing in a safe context. No special
* precautions are required here.
*
*****************************************************************************/
****************************************************************************/
void group_addchild(FAR struct task_group_s *group,
FAR struct child_status_s *child)
@@ -261,7 +261,7 @@ void group_addchild(FAR struct task_group_s *group,
group_dumpchildren(group, "group_addchild");
}
/*****************************************************************************
/****************************************************************************
* Name: group_findchild
*
* Description:
@@ -281,7 +281,7 @@ void group_addchild(FAR struct task_group_s *group,
* Called during SIGCHLD processing in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
FAR struct child_status_s *group_findchild(FAR struct task_group_s *group,
pid_t pid)
@@ -303,7 +303,7 @@ FAR struct child_status_s *group_findchild(FAR struct task_group_s *group,
return NULL;
}
/*****************************************************************************
/****************************************************************************
* Name: group_exitchild
*
* Description:
@@ -320,7 +320,7 @@ FAR struct child_status_s *group_findchild(FAR struct task_group_s *group,
* Called during SIGCHLD processing in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
FAR struct child_status_s *group_exitchild(FAR struct task_group_s *group)
{
@@ -339,7 +339,7 @@ FAR struct child_status_s *group_exitchild(FAR struct task_group_s *group)
return NULL;
}
/*****************************************************************************
/****************************************************************************
* Name: group_removechild
*
* Description:
@@ -359,7 +359,7 @@ FAR struct child_status_s *group_exitchild(FAR struct task_group_s *group)
* Called during SIGCHLD processing in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
FAR struct child_status_s *group_removechild(FAR struct task_group_s *group,
pid_t pid)
@@ -403,7 +403,7 @@ FAR struct child_status_s *group_removechild(FAR struct task_group_s *group,
return curr;
}
/*****************************************************************************
/****************************************************************************
* Name: group_removechildren
*
* Description:
@@ -419,7 +419,7 @@ FAR struct child_status_s *group_removechild(FAR struct task_group_s *group,
* Called during task exit processing in a safe context. No special
* precautions are required here.
*
*****************************************************************************/
****************************************************************************/
void group_removechildren(FAR struct task_group_s *group)
{
+22 -22
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_create.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,29 +51,29 @@
#ifdef HAVE_TASK_GROUP
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/* Is this worth making a configuration option? */
#define GROUP_INITIAL_MEMBERS 4
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/* This is counter that is used to generate unique task group IDs */
#if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_ARCH_ADDRENV)
static gid_t g_gidcounter;
#endif
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_ARCH_ADDRENV)
/* This is the head of a list of all group members */
@@ -81,11 +81,11 @@ static gid_t g_gidcounter;
FAR struct task_group_s *g_grouphead;
#endif
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_assigngid
*
* Description:
@@ -101,7 +101,7 @@ FAR struct task_group_s *g_grouphead;
* Called during task creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_ARCH_ADDRENV)
static void group_assigngid(FAR struct task_group_s *group)
@@ -147,11 +147,11 @@ static void group_assigngid(FAR struct task_group_s *group)
}
#endif /* HAVE_GROUP_MEMBERS */
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_allocate
*
* Description:
@@ -174,7 +174,7 @@ static void group_assigngid(FAR struct task_group_s *group)
* Called during task creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
{
@@ -253,7 +253,7 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
return OK;
}
/*****************************************************************************
/****************************************************************************
* Name: group_initialize
*
* Description:
@@ -272,7 +272,7 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
* Called during task creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
int group_initialize(FAR struct task_tcb_s *tcb)
{
+20 -20
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_find.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,31 +51,31 @@
#ifdef HAVE_TASK_GROUP
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_findbygid
*
* Description:
@@ -97,7 +97,7 @@
* precautions should be required here. However, extra care is taken when
* accessing the global g_grouphead list.
*
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_ARCH_ADDRENV)
FAR struct task_group_s *group_findbygid(gid_t gid)
@@ -122,7 +122,7 @@ FAR struct task_group_s *group_findbygid(gid_t gid)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: group_findbypid
*
* Description:
@@ -143,7 +143,7 @@ FAR struct task_group_s *group_findbygid(gid_t gid)
* precautions should be required here. However, extra care is taken when
* accessing the global g_grouphead list.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
FAR struct task_group_s *group_findbypid(pid_t pid)
+20 -20
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_join.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -52,26 +52,26 @@
#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD)
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/* Is this worth making a configuration option? */
#define GROUP_REALLOC_MEMBERS 4
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_addmember
*
* Description:
@@ -88,7 +88,7 @@
* Called during thread creation and during reparenting in a safe context.
* No special precautions are required here.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
static inline int group_addmember(FAR struct task_group_s *group, pid_t pid)
@@ -141,11 +141,11 @@ static inline int group_addmember(FAR struct task_group_s *group, pid_t pid)
}
#endif /* HAVE_GROUP_MEMBERS */
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_bind
*
* Description:
@@ -168,7 +168,7 @@ static inline int group_addmember(FAR struct task_group_s *group, pid_t pid)
* - Called during thread creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
int group_bind(FAR struct pthread_tcb_s *tcb)
{
@@ -182,7 +182,7 @@ int group_bind(FAR struct pthread_tcb_s *tcb)
return OK;
}
/*****************************************************************************
/****************************************************************************
* Name: group_join
*
* Description:
@@ -205,7 +205,7 @@ int group_bind(FAR struct pthread_tcb_s *tcb)
* - Called during thread creation in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
int group_join(FAR struct pthread_tcb_s *tcb)
{
+2 -2
View File
@@ -49,7 +49,7 @@
* Private Functions
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_killchildren_handler
*
* Description:
@@ -62,7 +62,7 @@
* Return Value:
* 0 (OK) on success; a negated errno value on failure.
*
*****************************************************************************/
****************************************************************************/
static int group_killchildren_handler(pid_t pid, FAR void *arg)
{
+22 -22
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_leave.c
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -56,23 +56,23 @@
#ifdef HAVE_TASK_GROUP
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_remove
*
* Description:
@@ -88,7 +88,7 @@
* Called during task deletion in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
#if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_ARCH_ADDRENV)
static void group_remove(FAR struct task_group_s *group)
@@ -131,7 +131,7 @@ static void group_remove(FAR struct task_group_s *group)
}
#endif
/*****************************************************************************
/****************************************************************************
* Name: group_release
*
* Description:
@@ -147,7 +147,7 @@ static void group_remove(FAR struct task_group_s *group)
* Called during task deletion in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
static inline void group_release(FAR struct task_group_s *group)
{
@@ -276,7 +276,7 @@ static inline void group_release(FAR struct task_group_s *group)
sched_kfree(group);
}
/*****************************************************************************
/****************************************************************************
* Name: group_removemember
*
* Description:
@@ -295,7 +295,7 @@ static inline void group_release(FAR struct task_group_s *group)
* Called during task deletion and also from the reparenting logic, both
* in a safe context. No special precautions are required here.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
static inline void group_removemember(FAR struct task_group_s *group, pid_t pid)
@@ -327,11 +327,11 @@ static inline void group_removemember(FAR struct task_group_s *group, pid_t pid)
}
#endif /* HAVE_GROUP_MEMBERS */
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_leave
*
* Description:
@@ -350,7 +350,7 @@ static inline void group_removemember(FAR struct task_group_s *group, pid_t pid)
* Called during task deletion in a safe context. No special precautions
* are required here.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
void group_leave(FAR struct tcb_s *tcb)
+18 -18
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/group/group_signal.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,13 +51,13 @@
#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_SIGNALS)
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
struct group_signal_s
@@ -70,15 +70,15 @@ struct group_signal_s
};
#endif
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_signal_handler
*
* Description:
@@ -91,7 +91,7 @@ struct group_signal_s
* Return Value:
* 0 (OK) on success; a negated errno value on failure.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
static int group_signal_handler(pid_t pid, FAR void *arg)
@@ -191,11 +191,11 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
}
#endif
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: group_signal
*
* Description:
@@ -213,7 +213,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
* this function may be called indirectly in the context of an interrupt
* handler.
*
*****************************************************************************/
****************************************************************************/
int group_signal(FAR struct task_group_s *group, FAR siginfo_t *siginfo)
{
+1 -1
View File
@@ -66,7 +66,7 @@
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: pthread_getschedparam
+10 -10
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/sched/sched_wait.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -49,15 +49,15 @@
#if defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: wait
*
* Description:
@@ -80,7 +80,7 @@
* Returned Value:
* See waitpid();
*
*****************************************************************************/
****************************************************************************/
pid_t wait(FAR int *stat_loc)
{
+12 -12
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/sched/sched_waitid.c
*
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -50,18 +50,18 @@
#if defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: exited_child
*
* Description:
* Handle the case where a child exited properlay was we (apparently) lost
* the detch of child signal.
*
*****************************************************************************/
****************************************************************************/
#ifdef CONFIG_SCHED_CHILD_STATUS
static void exited_child(FAR struct tcb_s *rtcb, FAR struct child_status_s *child,
@@ -85,11 +85,11 @@ static void exited_child(FAR struct tcb_s *rtcb, FAR struct child_status_s *chil
}
#endif
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: waitid
*
* Description:
@@ -150,7 +150,7 @@ static void exited_child(FAR struct tcb_s *rtcb, FAR struct child_status_s *chil
* EINVAL - An invalid value was specified for options, or idtype and id
* specify an invalid set of processes.
*
*****************************************************************************/
****************************************************************************/
int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options)
{
+10 -10
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/sched/sched_waitpid.c
*
* Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -51,15 +51,15 @@
#ifdef CONFIG_SCHED_WAITPID
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: waitpid
*
* Description:
@@ -176,7 +176,7 @@
* defined), then waitpid() is still available, but does not obey the
* restriction that the pid be a child of the caller.
*
*****************************************************************************/
****************************************************************************/
#ifndef CONFIG_SCHED_HAVE_PARENT
pid_t waitpid(pid_t pid, int *stat_loc, int options)
+18 -18
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/task/task_getgroup.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -47,31 +47,31 @@
#ifdef HAVE_TASK_GROUP
/*****************************************************************************
/****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Types
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Data
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: task_getgroup
*
* Description:
@@ -90,7 +90,7 @@
* precautions should be required here. However, extra care is taken when
* accessing the global g_grouphead list.
*
*****************************************************************************/
****************************************************************************/
FAR struct task_group_s *task_getgroup(pid_t pid)
{
+10 -10
View File
@@ -1,4 +1,4 @@
/*****************************************************************************
/****************************************************************************
* sched/task/task_reparent.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Included Files
*****************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@@ -47,15 +47,15 @@
#ifdef CONFIG_SCHED_HAVE_PARENT
/*****************************************************************************
/****************************************************************************
* Private Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Public Functions
*****************************************************************************/
****************************************************************************/
/*****************************************************************************
/****************************************************************************
* Name: task_reparent
*
* Description:
@@ -69,7 +69,7 @@
* Return Value:
* 0 (OK) on success; A negated errno value on failure.
*
*****************************************************************************/
****************************************************************************/
#ifdef HAVE_GROUP_MEMBERS
int task_reparent(pid_t ppid, pid_t chpid)