Commit Graph

107 Commits

Author SHA1 Message Date
wangyingdong
21e7a9dc9e Fixed the error that when the driver scan result is empty, iwe_stream->len is a random number because the user data buf is not initialized.
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-05 12:34:13 +08:00
simbit18
17a497492a Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Add comments
2023-09-01 01:21:54 +08:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Xiang Xiao
c45a7c8ccd wireless/wapi: Return -errno in all fail path
to avoid some return -1, otheer return -errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-31 10:41:09 +02:00
Tiago Medicci Serrano
3516a5d2ee wireless/wapi: support WPA3 on wapi psk command
Similarly to the alg_flag (which can be set by text), the ver_flag
is able to select the WPA version which will be sent to the Wi-Fi
driver through the `IW_AUTH_WPA_VERSION` command. A new bit field
(IW_AUTH_WPA_VERSION_WPA3) was created to indicate WPA3 is set.

It's up to the arch's Wi-Fi driver to implement handling of this
new bit field and config the underlying driver to handle WPA3 on
AP and/or STA mode.

This implementation doesn't interfere with commonly used commands.

`wapi psk wlan0 mypasswd 3` still selects CCMP algorithm and WPA2
and is equivalent to `wapi psk wlan0 mypasswd 3 WPA_VER_2`.

One can use `wapi psk wlan0 mypasswd 3 WPA_VER_3` to set WPA3.
2023-04-29 10:02:52 -03:00
Tiago Medicci Serrano
fe8232fba0 wireless/wapi: change wapi_psk_cmd error code for invalid alg 2023-04-29 10:02:52 -03:00
Tiago Medicci Serrano
f1557dafd3 wireless/wapi: add textual flag of WAPI_ESSID_DELAY_ON
Add the `WAPI_ESSID_DELAY_ON` member of the `wapi_essid_flag_e`
enum to its textual counterpart in `g_wapi_essid_flags`. This
enables `wapi`'s usage to describe it properly.
2023-04-29 10:02:52 -03:00
simbit18
6766327cde apps/wireless/wapi/src/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -03:00
chao.an
ba030e5843 wireless/wapi: correct check of return value
VELAPLATFO-2999

----------------------
 * Name: ioctl
...
 * Returned Value:
 *   >=0 on success (positive non-zero values are cmd-specific)
 *   -1 on failure with errno set properly:

Signed-off-by: chao.an <anchao@xiaomi.com>
2023-02-23 12:56:11 -03:00
田昕
b1e6583246 wireless/wapi:rework wapi error print in util.h
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-01-14 14:01:28 +08:00
Xiang Xiao
cfc005a460 arp: Remove the unnecessary inclusion of nuttx/net/arp
and change the remain inclusion to netinet/arp.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:11:10 +02:00
zhanghongyu
dc90c52413 wapi: fix passphrase can not update if prefix is same
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-11-20 07:45:15 +01:00
Xiang Xiao
bf03439d1b Fix Error: src/wapi.c:1050:14: error: implicit conversion from enumeration type 'enum wapi_mode_e' to different enumeration type 'enum wapi_pta_prio_e' [-Werror,-Wenum-conversion]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
yinshengkai
ee4d8b738f Makefile: replace INCDIR to INCDIR_PREFIX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-10 02:38:58 +08:00
Alan Carvalho de Assis
abbe022894 wapi: Verify if password size if valid 2022-10-11 14:35:43 +08:00
zhanghongyu
8fe295de32 wireless: Add ioctl cmd to setting PTA prio
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-18 11:48:23 +08:00
zhanghongyu
a25f640e54 wapi: Make the initial scan buffer configurable through Kconfig
The default value is 4KB which is same as IW_SCAN_MAX_DATA

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
zhanghongyu
a755cb72da wapi: correct scan return value
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
zhanghongyu
8c8ebf4503 wapi: fix coverity warning
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
chao.an
451f528bbb wireless/wapi: correct check of return value
1. correct check of return value
----------------------
 * Name: ioctl
...
 * Returned Value:
 *   >=0 on success (positive non-zero values are cmd-specific)
 *   -1 on failure with errno set properly:

2. country code length should contain LF

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-15 10:51:55 +03:00
Peter van der Perk
dcd60a2abe Use thread-safe ntoa functions
NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Use thread-safe ntoa functions

NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-04 23:18:06 +08:00
chao.an
61250d5516 wireless/wapi: add get country code support
Country command with no args to get the ccode:

Get country code:
cp> wapi country wlan0
CN

Set country code:
cp> wapi country wlan0 JP

Get country code:
cp> wapi country wlan0
JP

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-23 23:40:20 +08:00
chao.an
92c001bbc0 wapi/utils: add SIOCGIWSENS into string name list
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 16:44:01 +08:00
chao.an
be516e4c5e wireless/wapi: authentication parameters should update before key set
set authentication parameters before key set on command mode

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 08:34:51 +03:00
Xiang Xiao
2fc7c67031 wireless/wapi: Fix warning: 'strncpy' specified bound 16 equals destination size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-22 08:35:58 +02:00
zhanghongyu
e0e41c5d7f feature: wapi add encode parse when scan
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
Petro Karashchenko
f9baa422c1 style: unify path to files in comment section
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-09 10:37:33 +08:00
Xiang Xiao
66dbaa4539 Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
liuyang34
ab3cca4ae1 wapi: add 5g channel map in wapi
Signed-off-by: liuyang34 <liuyang34@xiaomi.com>
2021-09-24 13:48:47 +08:00
zhanghu
4808fb4d0d apps warning: add ether_h because Wimplicit-function-declaration
Change-Id: Ic3b86ef2d8f83a80e0cc7badba22006a8fd8b2ee
2021-06-14 14:31:40 -03:00
Alin Jerpelea
ec339bc49a Makefiles: Gregory Nutt: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-07 21:35:33 -05:00
Nathan Hartman
6d3782c961 Licensing: Move wireless/wapi/LICENSE into top-level LICENSE 2021-05-06 19:14:13 -07:00
Abdelatif Guettouche
fbf5290401 wireless/wapi/src/wapi.c: When executing a command return it's error code on failure.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-04-12 22:29:01 -05:00
chenwen
39c5fa812d wireless/wapi: Fix issue of getting the operating frequency 2021-04-12 03:56:11 -05:00
chao.an
623a668baa wapi: Extend "WAPI_ESSID_DELAY_ON" flag to support customized connection behavior
The current essid setting(SIOCSIWESSID) are not satisfactory in case
of specified bssid connection, if there are multiple essids with same name,
we need additional bssid information to connect to the specified softap.
The extended flag "WAPI_ESSID_DELAY_ON" instructs the driver to delay the
connection behavior of essid, so that which can accept more accurate
information before generating a connection.

About flow of wapi command, drivers that support WAPI_ESSID_DELAY_ON semantics
will have the following behavior changes:

1. Station mode without bssid set:

$ ifup wlan0
$ wapi mode wlan0 2
$ wapi psk wlan0 12345678 3
$ wapi essid wlan0 archer 1
$ renew wlan0

2. Station mode with bssid set:

$ ifup wlan0
$ wapi mode wlan0 2
$ wapi psk wlan0 12345678 3
$ wapi essid wlan0 archer 2       <----- WAPI_ESSID_DELAY_ON will indicate the driver delay
$                                        the connection event late to bssid set (SIOCSIWAP).
$ wapi ap wlan0 ec:41:18:e0:76:7e
$ renew wlan0

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-30 20:19:10 -08:00
chao.an
a53f2ad270 wireless/wapi: add get sensitivity command
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-29 07:59:48 +00:00
chao.an
bd9174a3b6 wireless/wapi: add set country code support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-05 08:00:29 +01:00
YAMAMOTO Takashi
e44268c484 wireless/wapi: Fix the usage message 2020-12-21 23:27:26 -06:00
chao.an
e4cddb169a wapi/conf: convert mac address
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-12 00:24:22 -06:00
chao.an
c014504a93 wireless/wapi: do not associate with essid/bssid at same time
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-30 05:47:19 -06:00
YAMAMOTO Takashi
aea1ba9f5f wireless/wapi/src/driver_wext.c: Fix a syslog format 2020-11-20 22:24:29 -08:00
chao.an
937b67bfa0 wapi/wireless: add get sensitivity support
Change-Id: I9906810466edaad59edf3d63b534959541609aab
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-10 19:37:29 -08:00
chao.an
3959f7535e wireless/wapi: add channel frequency set during associate
Therefore, the associate can support the connection of specified
channel if the scan results contain the multiple AP with same essids.

Change-Id: I4e657c52e638693e7ae19aea2a4fe8a431885547
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-10 19:36:17 -08:00
Xiang Xiao
8375a2177e Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-18 22:27:57 -07:00
Xiang Xiao
8a63e58936 Change all 'Nuttx' to 'NuttX'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-18 22:27:57 -07:00
chao.an
3061dbf2f8 wireless/wapi: add option to associate with bssid
Change-Id: I68ef42edfc50ef5baf0f02a570d0e7f79669659f
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:20:43 -07:00
chao.an
a0f6b14c0d wireless/wapi: add scan partial channel support
Change-Id: I2279406a9ca0cc3a9535ce79fbf651dbaf14ad4c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 01:14:45 -07:00
chao.an
40f559bffc wireless/wapi: ignore the fail case
do not break the show process if some cases failure

Change-Id: I5d5768ba116a9e8a8ea62ae9455d773838328bd5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 01:12:04 -07:00
Maciej Wójcik
21049ece6e Rewritten READMEs to Markdown 2020-07-25 01:01:51 -07:00