mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Merge remote-tracking branch 'origin/master' into ieee802154
This commit is contained in:
+36
-7
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/fixedmath.h
|
||||
*
|
||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -40,6 +40,7 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -124,7 +125,7 @@
|
||||
#define ub8toi(a) ((a) >> 8) /* Conversion to unsigned integer */
|
||||
#define itob8(i) (((b8_t)(i)) << 8) /* Conversion from integer */
|
||||
#define uitoub8(i) (((ub8_t)(i)) << 8) /* Conversion from unsigned integer */
|
||||
#define b8tof(b) (((float)b)/256.0) /* Conversion to float */
|
||||
#define b8tof(b) (((float)(b))/256.0) /* Conversion to float */
|
||||
#define ftob8(f) (b8_t)(((f)*256.0)) /* Conversion from float */
|
||||
#define b8trunc(a) ((a) & 0xff00) /* Truncate to integer b8 */
|
||||
#define b8round(a) (((a)+0x0080) & 0xff00) /* Round to integer b8 */
|
||||
@@ -138,13 +139,13 @@
|
||||
#define b8addi(a,i) ((a)+itob8(i)) /* Add integer from b16 */
|
||||
#define b8subb8(a,b) ((a)-(b)) /* Subtraction */
|
||||
#define b8subi(a,i) ((a)-itob8(i)) /* Subtract integer from b8 */
|
||||
#define b8mulb8(a,b) b16tob8((b16_t)(a)*(b16_t)(b) /* Muliplication */
|
||||
#define ub8mulub8(a,b) ub16toub8((ub16_t)(a)*(ub16_t)(b) /* Muliplication */
|
||||
#define b8mulb8(a,b) (b16tob8((b16_t)(a)*(b16_t)(b)) /* Muliplication */
|
||||
#define ub8mulub8(a,b) (ub16toub8((ub16_t)(a)*(ub16_t)(b)) /* Muliplication */
|
||||
#define b8muli(a,i) ((a)*(i)) /* Simple multiplication by integer */
|
||||
#define b8sqr(a) b8mulb8(a,a) /* Square */
|
||||
#define ub8sqr(a) ub8mulub8(a,a) /* Square */
|
||||
#define b8divb8(a,b) b8tob16(a)/(b16_t)(b) /* Division */
|
||||
#define ub8divub8(a,b) ub8toub16(a)/(ub16_t)(b) /* Division */
|
||||
#define b8divb8(a,b) (b8tob16(a)/(b16_t)(b)) /* Division */
|
||||
#define ub8divub8(a,b) (ub8toub16(a)/(ub16_t)(b)) /* Division */
|
||||
#define b8divi(a,i) ((a)/(i)) /* Simple division by integer */
|
||||
#define b8idiv(i,j) (((i)<<8)/j) /* Division of integer, b8 result */
|
||||
|
||||
@@ -156,7 +157,7 @@
|
||||
#define ub16toi(a) ((a) >> 16) /* Conversion to unsgined integer */
|
||||
#define itob16(i) (((b16_t)(i)) << 16) /* Conversion from integer */
|
||||
#define uitoub16(i) (((ub16_t)(i)) << 16) /* Conversion from unsigned integer */
|
||||
#define b16tof(b) (((float)b)/65536.0) /* Conversion to float */
|
||||
#define b16tof(b) (((float)(b))/65536.0) /* Conversion to float */
|
||||
#define ftob16(f) (b16_t)(((f)*65536.0)) /* Conversion from float */
|
||||
#define b16trunc(a) ((a) & 0xffff0000) /* Truncate to integer */
|
||||
#define b16round(a) (((a)+0x00008000) & 0xffff0000)
|
||||
@@ -189,6 +190,27 @@
|
||||
|
||||
# define b16divb16(a,b) (b16_t)(b16tob32(a)/(b32_t)(b))
|
||||
# define ub16divub16(a,b) (ub16_t)(ub16toub32(a)/(ub32_t)(b))
|
||||
|
||||
/* Square root operators */
|
||||
|
||||
# define ub16sqrtub16(a) ub32sqrtub16(ub16toub32(a))
|
||||
#else
|
||||
# define ub16sqrtub16(a) ub8toub16(ub16sqrtub8(a))
|
||||
#endif
|
||||
|
||||
/* 64-bit values with 32 bits of precision ********************************/
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
/* Conversions */
|
||||
|
||||
#define b32toi(a) ((a) >> 32) /* Conversion to integer */
|
||||
#define itob32(i) (((b32_t)(i)) << 32) /* Conversion from integer */
|
||||
#define uitoub32(i) (((ub32_t)(i)) << 32) /* Conversion from unsigned integer */
|
||||
#define b32tod(b) (((double)(b))/((long long)1 << 32)) /* Conversion to double */
|
||||
#define dtob32(f) (b32_t)(((f)*(double)((long long)1 << 32))) /* Conversion from double */
|
||||
#define b32trunc(a) ((a) & 0xffffffff00000000) /* Truncate to integer */
|
||||
#define b32round(a) (((a)+0x0000000080000000) & 0xffffffff00000000)
|
||||
#define b32frac(a) ((a) & 0x00000000ffffffff) /* Take fractional part */
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -240,6 +262,13 @@ b16_t b16sin(b16_t rad);
|
||||
b16_t b16cos(b16_t rad);
|
||||
b16_t b16atan2(b16_t y, b16_t x);
|
||||
|
||||
/* Square root operators */
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_LONG
|
||||
ub16_t ub32sqrtub16(ub32_t a);
|
||||
#endif
|
||||
ub8_t ub16sqrtub8(ub16_t a);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/************************************************************************************
|
||||
* include/nuttx/analog/opamp.h
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Mateusz Szafoni <raiden00@railab.me>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_ANALOG_OPAMP_H
|
||||
#define __INCLUDE_NUTTX_ANALOG_OPAMP_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <semaphore.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
struct opamp_dev_s;
|
||||
struct opamp_ops_s
|
||||
{
|
||||
/* Configure the OPAMP. This method is called the first time that the OPAMP
|
||||
* device is opened. This will occur when the port is first opened.
|
||||
* This setup includes configuring and attaching OPAMP interrupts. Interrupts
|
||||
* are all disabled upon return.
|
||||
*/
|
||||
|
||||
CODE int (*ao_setup)(FAR struct opamp_dev_s *dev);
|
||||
|
||||
/* Disable the OPAMP. This method is called when the OPAMP device is closed.
|
||||
* This method reverses the operation the setup method.
|
||||
* Works only if OPAMP device is not locked.
|
||||
*/
|
||||
|
||||
CODE void (*ao_shutdown)(FAR struct opamp_dev_s *dev);
|
||||
|
||||
/* All ioctl calls will be routed through this method */
|
||||
|
||||
CODE int (*ao_ioctl)(FAR struct opamp_dev_s *dev, int cmd, unsigned long arg);
|
||||
};
|
||||
|
||||
struct opamp_dev_s
|
||||
{
|
||||
#ifdef CONFIG_OPAMP
|
||||
/* Fields managed by common upper half OPAMP logic */
|
||||
|
||||
uint8_t ad_ocount; /* The number of times the device has been opened */
|
||||
sem_t ad_closesem; /* Locks out new opens while close is in progress */
|
||||
#endif
|
||||
|
||||
/* Fields provided by lower half OPAMP logic */
|
||||
|
||||
FAR const struct opamp_ops_s *ad_ops; /* Arch-specific operations */
|
||||
FAR void *ad_priv; /* Used by the arch-specific logic */
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
int opamp_register(FAR const char *path, FAR struct opamp_dev_s *dev);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_ANALOG_OPAMP_H */
|
||||
@@ -328,6 +328,44 @@
|
||||
#define SDIO_ACMD52 (SDIO_ACMDIDX52|MMCSD_R5_RESPONSE |MMCSD_NODATAXFR)
|
||||
#define SDIO_ACMD53 (SDIO_ACMDIDX53|MMCSD_R5_RESPONSE |MMCSD_NODATAXFR)
|
||||
|
||||
/* SDIO Card Common Control Registers definitions
|
||||
* see https://www.sdcard.org/developers/overview/sdio/
|
||||
* sdio_spec/Simplified_SDIO_Card_Spec.pdf */
|
||||
|
||||
#define SDIO_CCCR_REV 0x00 /* CCCR/SDIO Revision */
|
||||
#define SDIO_CCCR_SD_SPEC_REV 0x01 /* SD Specification Revision */
|
||||
#define SDIO_CCCR_IOEN 0x02 /* I/O Enable */
|
||||
#define SDIO_CCCR_IORDY 0x03 /* I/O Ready */
|
||||
#define SDIO_CCCR_INTEN 0x04 /* Int Enable */
|
||||
#define SDIO_CCCR_INTPEND 0x05 /* Int Pending */
|
||||
#define SDIO_CCCR_IOABORT 0x06 /* I/O Abort */
|
||||
#define SDIO_CCCR_BUS_IF 0x07 /* Bus Interface Control */
|
||||
#define SDIO_CCCR_CARD_CAP 0x08 /* Card Capabilitiy */
|
||||
#define SDIO_CCCR_CCP 0x09 /* Common CIS Pointer */
|
||||
#define SDIO_CCCR_BUS_SUSP 0x0C /* Bus Suspend */
|
||||
#define SDIO_CCCR_FUNCSEL 0x0D /* Function Select */
|
||||
#define SDIO_CCCR_EXEC_FLAGS 0x0E /* Exec Flags */
|
||||
#define SDIO_CCCR_RDY_FLAGS 0x0F /* Ready Flags */
|
||||
#define SDIO_CCCR_FN0_BLKSIZE_0 0x10 /* FN0 Block Size */
|
||||
#define SDIO_CCCR_FN0_BLKSIZE_1 0x11 /* FN0 Block Size */
|
||||
#define SDIO_CCCR_POWER 0x12 /* Power Control */
|
||||
#define SDIO_CCCR_HIGHSPEED 0x13 /* High-Speed */
|
||||
#define SDIO_CCCR_RFU 0x14 /* Reserved for future use */
|
||||
#define SDIO_CCCR_VENDOR 0xF0 /* Reserved for Vendors */
|
||||
|
||||
#define SDIO_CCCR_BUS_IF_WIDTH_MASK 0x03 /* Bus width configuration */
|
||||
#define SDIO_CCCR_BUS_IF_1_BIT 0x01 /* 1 bit bus width setting */
|
||||
#define SDIO_CCCR_BUS_IF_4_BITS 0x02 /* 4 bits bus width setting */
|
||||
|
||||
#define SDIO_FBR_SHIFT 8 /* FBR bit shift */
|
||||
#define SDIO_FN1_BR_BASE (1 << SDIO_FBR_SHIFT) /* Func 1 registers base */
|
||||
#define SDIO_FN2_BR_BASE (2 << SDIO_FBR_SHIFT) /* Func 2 registers base */
|
||||
#define SDIO_FN3_BR_BASE (3 << SDIO_FBR_SHIFT) /* Func 3 registers base */
|
||||
#define SDIO_FN4_BR_BASE (4 << SDIO_FBR_SHIFT) /* Func 4 registers base */
|
||||
#define SDIO_FN5_BR_BASE (5 << SDIO_FBR_SHIFT) /* Func 5 registers base */
|
||||
#define SDIO_FN6_BR_BASE (6 << SDIO_FBR_SHIFT) /* Func 6 registers base */
|
||||
#define SDIO_FN7_BR_BASE (7 << SDIO_FBR_SHIFT) /* Func 7 registers base */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: SDIO_LOCK
|
||||
*
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
@@ -102,6 +103,22 @@ void bcmf_board_power(int minor, bool power);
|
||||
|
||||
void bcmf_board_reset(int minor, bool reset);
|
||||
|
||||
/************************************************************************************
|
||||
* Function: bcmf_board_setup_oob_irq
|
||||
*
|
||||
* Description:
|
||||
* Board specific function called from Broadcom FullMAC driver
|
||||
* that must be implemented to use WLAN chip interrupt signal
|
||||
*
|
||||
* Parameters:
|
||||
* minor - zero based minor device number which is unique
|
||||
* for each wlan device.
|
||||
* func - WLAN chip callback function that must be called on gpio event
|
||||
* arg - WLAN chip internal structure that must be passed to callback
|
||||
************************************************************************************/
|
||||
|
||||
void bcmf_board_setup_oob_irq(int minor, xcpt_t func, void *arg);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/wireless/ieee80211/bcmf_netdev.h
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_WIRELESS_IEEE80211_BCMF_NETDEV_H
|
||||
#define __INCLUDE_NUTTX_WIRELESS_IEEE80211_BCMF_NETDEV_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/mmcsd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: bcmf_netdev_register
|
||||
*
|
||||
* Description:
|
||||
* Initialize the Broadcom 43362 controller and driver
|
||||
*
|
||||
* Parameters:
|
||||
* intf - In the case where there are multiple EMACs, this value
|
||||
* identifies which EMAC is to be initialized.
|
||||
*
|
||||
* Returned Value:
|
||||
* OK on success; Negated errno on failure.
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bcmf_netdev_register(int intf);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_WIRELESS_IEEE80211_BCMF_NETDEV_H */
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef caca
|
||||
#define caca
|
||||
#include <stdint.h>
|
||||
#include <nuttx/sdio.h>
|
||||
|
||||
int sdio_probe(FAR struct sdio_dev_s *dev);
|
||||
|
||||
int sdio_set_wide_bus(struct sdio_dev_s *dev);
|
||||
|
||||
int sdio_set_blocksize(FAR struct sdio_dev_s *dev, uint8_t function,
|
||||
uint16_t blocksize);
|
||||
|
||||
int sdio_enable_function(FAR struct sdio_dev_s *dev, uint8_t function);
|
||||
|
||||
int sdio_enable_interrupt(FAR struct sdio_dev_s *dev, uint8_t function);
|
||||
|
||||
int sdio_sendcmdpoll(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg);
|
||||
|
||||
int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write,
|
||||
uint8_t function, uint32_t address,
|
||||
uint8_t inb, uint8_t* outb);
|
||||
|
||||
int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write,
|
||||
uint8_t function, uint32_t address,
|
||||
bool inc_addr, uint8_t *buf,
|
||||
unsigned int blocklen, unsigned int nblocks);
|
||||
|
||||
#endif
|
||||
@@ -195,7 +195,98 @@
|
||||
|
||||
/* Scan-related */
|
||||
|
||||
#define IW_SCAN_MAX_DATA 4096 /* Maximum size of returned data */
|
||||
/* Scanning request flags */
|
||||
#define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */
|
||||
#define IW_SCAN_ALL_ESSID 0x0001 /* Scan all ESSIDs */
|
||||
#define IW_SCAN_THIS_ESSID 0x0002 /* Scan only this ESSID */
|
||||
#define IW_SCAN_ALL_FREQ 0x0004 /* Scan all Frequencies */
|
||||
#define IW_SCAN_THIS_FREQ 0x0008 /* Scan only this Frequency */
|
||||
#define IW_SCAN_ALL_MODE 0x0010 /* Scan all Modes */
|
||||
#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
|
||||
#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
|
||||
#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
|
||||
/* struct iw_scan_req scan_type */
|
||||
#define IW_SCAN_TYPE_ACTIVE 0
|
||||
#define IW_SCAN_TYPE_PASSIVE 1
|
||||
/* Maximum size of returned data */
|
||||
#define IW_SCAN_MAX_DATA 4096 /* In bytes */
|
||||
|
||||
/* Scan capability flags - in (struct iw_range *)->scan_capa */
|
||||
#define IW_SCAN_CAPA_NONE 0x00
|
||||
#define IW_SCAN_CAPA_ESSID 0x01
|
||||
#define IW_SCAN_CAPA_BSSID 0x02
|
||||
#define IW_SCAN_CAPA_CHANNEL 0x04
|
||||
#define IW_SCAN_CAPA_MODE 0x08
|
||||
#define IW_SCAN_CAPA_RATE 0x10
|
||||
#define IW_SCAN_CAPA_TYPE 0x20
|
||||
#define IW_SCAN_CAPA_TIME 0x40
|
||||
|
||||
#define IW_SCAN_MAX_DATA 4096 /* Maximum size of returned data */
|
||||
|
||||
/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
|
||||
|
||||
#define IW_AUTH_INDEX 0x0FFF
|
||||
#define IW_AUTH_FLAGS 0xF000
|
||||
|
||||
/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
|
||||
* (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
|
||||
* parameter that is being set/get to; value will be read/written to
|
||||
* struct iw_param value field)
|
||||
*/
|
||||
|
||||
#define IW_AUTH_WPA_VERSION 0
|
||||
#define IW_AUTH_CIPHER_PAIRWISE 1
|
||||
#define IW_AUTH_CIPHER_GROUP 2
|
||||
#define IW_AUTH_KEY_MGMT 3
|
||||
#define IW_AUTH_TKIP_COUNTERMEASURES 4
|
||||
#define IW_AUTH_DROP_UNENCRYPTED 5
|
||||
#define IW_AUTH_80211_AUTH_ALG 6
|
||||
#define IW_AUTH_WPA_ENABLED 7
|
||||
#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
|
||||
#define IW_AUTH_ROAMING_CONTROL 9
|
||||
#define IW_AUTH_PRIVACY_INVOKED 10
|
||||
|
||||
/* IW_AUTH_WPA_VERSION values (bit field) */
|
||||
|
||||
#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
|
||||
#define IW_AUTH_WPA_VERSION_WPA 0x00000002
|
||||
#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
|
||||
|
||||
/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
|
||||
|
||||
#define IW_AUTH_CIPHER_NONE 0x00000001
|
||||
#define IW_AUTH_CIPHER_WEP40 0x00000002
|
||||
#define IW_AUTH_CIPHER_TKIP 0x00000004
|
||||
#define IW_AUTH_CIPHER_CCMP 0x00000008
|
||||
#define IW_AUTH_CIPHER_WEP104 0x00000010
|
||||
|
||||
/* IW_AUTH_KEY_MGMT values (bit field) */
|
||||
|
||||
#define IW_AUTH_KEY_MGMT_802_1X 1
|
||||
#define IW_AUTH_KEY_MGMT_PSK 2
|
||||
|
||||
/* IW_AUTH_80211_AUTH_ALG values (bit field) */
|
||||
|
||||
#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
|
||||
#define IW_AUTH_ALG_SHARED_KEY 0x00000002
|
||||
#define IW_AUTH_ALG_LEAP 0x00000004
|
||||
|
||||
/* IW_AUTH_ROAMING_CONTROL values */
|
||||
|
||||
#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
|
||||
#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
|
||||
* control */
|
||||
|
||||
/* SIOCSIWENCODEEXT definitions */
|
||||
|
||||
#define IW_ENCODE_SEQ_MAX_SIZE 8
|
||||
|
||||
/* struct iw_encode_ext ->alg */
|
||||
|
||||
#define IW_ENCODE_ALG_NONE 0
|
||||
#define IW_ENCODE_ALG_WEP 1
|
||||
#define IW_ENCODE_ALG_TKIP 2
|
||||
#define IW_ENCODE_ALG_CCMP 3
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
@@ -318,5 +409,67 @@ struct iw_event
|
||||
union iwreq_data u; /* Fixed IOCTL payload */
|
||||
};
|
||||
|
||||
/* WPA support */
|
||||
|
||||
struct iw_encode_ext
|
||||
{
|
||||
uint32_t ext_flags; /* IW_ENCODE_EXT_* */
|
||||
uint8_t tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
|
||||
uint8_t rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
|
||||
struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
|
||||
* (group) keys or unicast address for
|
||||
* individual keys */
|
||||
uint16_t alg; /* IW_ENCODE_ALG_* */
|
||||
uint16_t key_len;
|
||||
uint8_t key[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* Optional data for scan request
|
||||
*
|
||||
* Note: these optional parameters are controlling parameters for the
|
||||
* scanning behavior, these do not apply to getting scan results
|
||||
* (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
|
||||
* provide a merged results with all BSSes even if the previous scan
|
||||
* request limited scanning to a subset, e.g., by specifying an SSID.
|
||||
* Especially, scan results are required to include an entry for the
|
||||
* current BSS if the driver is in Managed mode and associated with an AP.
|
||||
*/
|
||||
struct iw_scan_req
|
||||
{
|
||||
uint8_t scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
|
||||
uint8_t essid_len;
|
||||
uint8_t num_channels; /* num entries in channel_list;
|
||||
* 0 = scan all allowed channels */
|
||||
uint8_t flags; /* reserved as padding; use zero, this may
|
||||
* be used in the future for adding flags
|
||||
* to request different scan behavior */
|
||||
struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
|
||||
* individual address of a specific BSS */
|
||||
|
||||
/*
|
||||
* Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
|
||||
* the current ESSID. This allows scan requests for specific ESSID
|
||||
* without having to change the current ESSID and potentially breaking
|
||||
* the current association.
|
||||
*/
|
||||
uint8_t essid[IW_ESSID_MAX_SIZE];
|
||||
|
||||
/*
|
||||
* Optional parameters for changing the default scanning behavior.
|
||||
* These are based on the MLME-SCAN.request from IEEE Std 802.11.
|
||||
* TU is 1.024 ms. If these are set to 0, driver is expected to use
|
||||
* reasonable default values. min_channel_time defines the time that
|
||||
* will be used to wait for the first reply on each channel. If no
|
||||
* replies are received, next channel will be scanned after this. If
|
||||
* replies are received, total time waited on the channel is defined by
|
||||
* max_channel_time.
|
||||
*/
|
||||
uint32_t min_channel_time; /* in TU */
|
||||
uint32_t max_channel_time; /* in TU */
|
||||
|
||||
struct iw_freq channel_list[IW_MAX_FREQUENCIES];
|
||||
};
|
||||
|
||||
#endif /* CONFIG_DRIVERS_WIRELESS */
|
||||
#endif /* __INCLUDE_NUTTX_WIRELESS_WIRELESS_H */
|
||||
|
||||
Reference in New Issue
Block a user