nuttx/wireless: fix nxstyle warning

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2020-09-17 17:38:05 +08:00 committed by Xiang Xiao
parent 9e45d6e88e
commit b2b7541d59

View File

@ -2,35 +2,20 @@
* include/nuttx/wireless/wireless.h * include/nuttx/wireless/wireless.h
* Wireless network IOCTL commands * Wireless network IOCTL commands
* *
* Copyright (C) 2011-2013, 2017-2018 Gregory Nutt. All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more
* Author: Gregory Nutt <gnutt@nuttx.org> * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* *
* Redistribution and use in source and binary forms, with or without * http://www.apache.org/licenses/LICENSE-2.0
* modification, are permitted provided that the following conditions
* are met:
* *
* 1. Redistributions of source code must retain the above copyright * Unless required by applicable law or agreed to in writing, software
* notice, this list of conditions and the following disclaimer. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* 2. Redistributions in binary form must reproduce the above copyright * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* notice, this list of conditions and the following disclaimer in * License for the specific language governing permissions and limitations
* the documentation and/or other materials provided with the * under the License.
* 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.
* *
************************************************************************************/ ************************************************************************************/
@ -58,6 +43,7 @@
************************************************************************************/ ************************************************************************************/
/* Network Driver IOCTL Commands ****************************************************/ /* Network Driver IOCTL Commands ****************************************************/
/* Use of these IOCTL commands requires a socket descriptor created by the socket() /* Use of these IOCTL commands requires a socket descriptor created by the socket()
* interface. * interface.
*/ */
@ -154,7 +140,7 @@
#define SIOCSIWPMKSA _WLIOC(0x0036) /* PMKSA cache operation */ #define SIOCSIWPMKSA _WLIOC(0x0036) /* PMKSA cache operation */
/* Device-specific network IOCTL commands ******************************************/ /* Device-specific network IOCTL commands *******************************************/
#define WL_NETFIRST 0x0000 /* First network command */ #define WL_NETFIRST 0x0000 /* First network command */
#define WL_NNETCMDS 0x0037 /* Number of network commands */ #define WL_NNETCMDS 0x0037 /* Number of network commands */
@ -186,48 +172,50 @@
_IOC_NR(cmd) >= WL_PKTRADIOFIRST && \ _IOC_NR(cmd) >= WL_PKTRADIOFIRST && \
_IOC_NR(cmd) < (WL_PKTRADIOFIRST + WL_NPKTRADIOCMDS)) _IOC_NR(cmd) < (WL_PKTRADIOFIRST + WL_NPKTRADIOCMDS))
/* ------------------------------ WIRELESS EVENTS -------------------------------- */ /* ------------------------------ WIRELESS EVENTS --------------------------------- */
/* Those are *NOT* ioctls, do not issue request on them !!! */ /* Those are *NOT* ioctls, do not issue request on them !!! */
/* Most events use the same identifier as ioctl requests */ /* Most events use the same identifier as ioctl requests */
#define IWEVTXDROP 0x8c00 /* Packet dropped to excessive retry */ #define IWEVTXDROP 0x8c00 /* Packet dropped to excessive retry */
#define IWEVQUAL 0x8c01 /* Quality part of statistics (scan) */ #define IWEVQUAL 0x8c01 /* Quality part of statistics (scan) */
#define IWEVCUSTOM 0x8c02 /* Driver specific ascii string */ #define IWEVCUSTOM 0x8c02 /* Driver specific ascii string */
#define IWEVREGISTERED 0x8c03 /* Discovered a new node (AP mode) */ #define IWEVREGISTERED 0x8c03 /* Discovered a new node (AP mode) */
#define IWEVEXPIRED 0x8c04 /* Expired a node (AP mode) */ #define IWEVEXPIRED 0x8c04 /* Expired a node (AP mode) */
#define IWEVGENIE 0x8c05 /* Generic IE (WPA, RSN, WMM, ..) #define IWEVGENIE 0x8c05 /* Generic IE (WPA, RSN, WMM, ..)
* (scan results); This includes id and * (scan results); This includes id and
* length fields. One IWEVGENIE may * length fields. One IWEVGENIE may
* contain more than one IE. Scan * contain more than one IE. Scan
* results may contain one or more * results may contain one or more
* IWEVGENIE events. */ * IWEVGENIE events. */
#define IWEVMICHAELMICFAILURE 0x8c06 /* Michael MIC failure #define IWEVMICHAELMICFAILURE 0x8c06 /* Michael MIC failure
* (struct iw_michaelmicfailure) * (struct iw_michaelmicfailure)
*/ */
#define IWEVASSOCREQIE 0x8c07 /* IEs used in (Re)Association Request. #define IWEVASSOCREQIE 0x8c07 /* IEs used in (Re)Association Request.
* The data includes id and length * The data includes id and length
* fields and may contain more than one * fields and may contain more than one
* IE. This event is required in * IE. This event is required in
* Managed mode if the driver * Managed mode if the driver
* generates its own WPA/RSN IE. This * generates its own WPA/RSN IE. This
* should be sent just before * should be sent just before
* IWEVREGISTERED event for the * IWEVREGISTERED event for the
* association. */ * association. */
#define IWEVASSOCRESPIE 0x8c08 /* IEs used in (Re)Association #define IWEVASSOCRESPIE 0x8c08 /* IEs used in (Re)Association
* Response. The data includes id and * Response. The data includes id and
* length fields and may contain more * length fields and may contain more
* than one IE. This may be sent * than one IE. This may be sent
* between IWEVASSOCREQIE and * between IWEVASSOCREQIE and
* IWEVREGISTERED events for the * IWEVREGISTERED events for the
* association. */ * association. */
#define IWEVPMKIDCAND 0x8c09 /* PMKID candidate for RSN #define IWEVPMKIDCAND 0x8c09 /* PMKID candidate for RSN
* pre-authentication * pre-authentication
* (struct iw_pmkid_cand) */ * (struct iw_pmkid_cand) */
#define IWEVFIRST 0x8c00 #define IWEVFIRST 0x8c00
#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) #define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
/* Other Common Wireless Definitions ***********************************************/ /* Other Common Wireless Definitions ************************************************/
/* Maximum size of the ESSID and NICKN strings */ /* Maximum size of the ESSID and NICKN strings */
@ -506,7 +494,7 @@ struct iw_range
struct iw_event struct iw_event
{ {
uint16_t len; /* Real length of ata */ uint16_t len; /* Real length of ata */
uint16_t cmd; /* Wireless IOCTL command*/ uint16_t cmd; /* Wireless IOCTL command */
union iwreq_data u; /* Fixed IOCTL payload */ union iwreq_data u; /* Fixed IOCTL payload */
}; };
@ -514,15 +502,16 @@ struct iw_event
struct iw_encode_ext struct iw_encode_ext
{ {
uint32_t ext_flags; /* IW_ENCODE_EXT_* */ uint32_t ext_flags; /* IW_ENCODE_EXT_* */
uint8_t tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */ uint8_t tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
uint8_t rx_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 struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for
* (group) keys or unicast address for * broadcast/multicast
* individual keys */ * (group) keys or unicast address
uint16_t alg; /* IW_ENCODE_ALG_* */ * for individual keys */
uint16_t key_len; uint16_t alg; /* IW_ENCODE_ALG_* */
uint8_t key[0]; uint16_t key_len;
uint8_t key[0];
}; };
/* Optional data for scan request /* Optional data for scan request
@ -538,15 +527,15 @@ struct iw_encode_ext
struct iw_scan_req struct iw_scan_req
{ {
uint8_t scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */ uint8_t scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
uint8_t essid_len; uint8_t essid_len;
uint8_t num_channels; /* num entries in channel_list; uint8_t num_channels; /* num entries in channel_list;
* 0 = scan all allowed channels */ * 0 = scan all allowed channels */
uint8_t flags; /* reserved as padding; use zero, this may uint8_t flags; /* reserved as padding; use zero, this may
* be used in the future for adding flags * be used in the future for adding flags
* to request different scan behavior */ * to request different scan behavior */
struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
* individual address of a specific BSS */ * individual address of a specific BSS */
/* Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using /* Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
* the current ESSID. This allows scan requests for specific ESSID * the current ESSID. This allows scan requests for specific ESSID
@ -572,8 +561,7 @@ struct iw_scan_req
struct iw_freq channel_list[IW_MAX_FREQUENCIES]; struct iw_freq channel_list[IW_MAX_FREQUENCIES];
}; };
/* /* A Wireless Event. Contains basically the same data as the ioctl...
* A Wireless Event. Contains basically the same data as the ioctl...
*/ */
#define IW_EV_LEN(field) \ #define IW_EV_LEN(field) \