Commit Graph

313 Commits

Author SHA1 Message Date
SPRESENSE
7de8d0603f wireless/gs2200m: Fix handling of ioctl except SIOCDENYINETSOCK
When running a dual stack (usrsock daemon and kernel stack),
ioctl requests that should be handled by the kernel stack are being
processed by the usrsock daemon. This causes ifconfig and ifup to fail.
The usrsock daemon that receives an ioctl request that should be
handled by the kernel stack should reply with ENOTTY.
Replying with ENOTTY means that the ioctl request can fall back to the
kernel stack.
2023-10-13 08:48:25 +02:00
SPRESENSE
6a69f0e96f wireless/gs2200m: Add support SIOCDENYINETSOCK ioctl command
Support SIOCDENYINETSOCK ioctl command to set usrsock status.
If usock_enable is false, its means application wants to create
a socket with other network stack.
2023-09-21 01:13:39 +08:00
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
raiden00pl
dda21ad57e cmake: support for nimble 2023-07-20 01:44:39 +08:00
Petro Karashchenko
5dba460f5f wireless/bluetooth/nimble: increase number of ACL buffers available for controller
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
Petro Karashchenko
4ac830ef1e wireless/bluetooth/nimble: add option to configure stack size of NimBLE NPL callout thread
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
Petro Karashchenko
0c7788cf26 wireless/bluetooth/nimble: fix build issue with nimBLE example
The NimBLE source code is downloaded at the first pass of the
make system so some makefiles to include might be not in place
initially, but included after code is fetched

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
chao an
7cfcb49213 cmake/apps: add more applications into cmake support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-13 19:00:18 +02: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
raiden00pl
d8ea8e3d1f nimble: improve integration with NuttX
1. add Makefile.nimble that helps integrate NimBLE with custom applications
  To enable NimBLE for an custom application, user needs to include Makefile.nimble in the app's Makefile:
    include $(APPDIR)/wireless/bluetooth/nimble/Makefile.nimble

2. add NuttX specific syscfg.h
  - file based on nimble/porting/examples/nuttx/include/syscfg/syscfg.h
  - all unnecessary definitions was removed
  - definitions are configurable from Kconfig

3. add NuttX specific logcfg.h
  - bind NimBLE logging with debug.h macros
2023-06-27 22:28:32 +03:00
raiden00pl
93c8cb29ea nimble: make nimble porting example optional
Enabled by default for the moment to avoid CI errors
2023-06-27 22:28:32 +03:00
raiden00pl
caed582ea9 bluetooth/btsak: add dependency on WIRELESS_BLUETOOTH_HOST=y 2023-06-22 11:57:33 +08:00
Petro Karashchenko
f4d3e549b6 wireless/bluetooth/btsak: fix help messages
Currently the help messages use "private" string while code
expects "random".
Remove not needed (CODE void *) cast.
Use 'nitems' macro to calculate number of elements in array
Align output in `btsak_cmd_scanget` command.
Fix style issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 14:09:18 +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
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03: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
ef7e2a8636 apps/wireless/ieee802154/libutils/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -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
zhangyuan21
4454c8d02f apps: remove unnecessary sem_setprotocol code
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-17 11:58:03 -03:00
raiden00pl
832b160cb1 bluetooth/nimble: update to bc7828341226d860429c63994065f8f1b8b8d7b0
which fix https://github.com/apache/mynewt-nimble/pull/1472
2023-03-02 22:21:37 +08: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
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
Xiang Xiao
6a686ba93d bluetooth/nimble: Update to 17a8e61fdec48d579df3bc5af59a9cff5edee674
which contain the fix:
https://github.com/apache/mynewt-nimble/pull/1462
https://github.com/apache/mynewt-nimble/pull/1459
https://github.com/apache/mynewt-nimble/pull/1457
https://github.com/apache/mynewt-nimble/pull/1161

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-21 23:39:51 +02:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08:00
chao an
8ad4ae5508 net: fix compiler warning
sixlowpan_assocresp.c: In function ‘sixlowpan_assoc_resp’:
sixlowpan_assocresp.c:48:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
   48 |   strncpy(arg.ifr_name, ifname, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-08 00:35:39 +08:00
Xiang Xiao
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Gustavo Henrique Nihei
b0da60e498 apps: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-02 00:35:14 +02: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
SPRESENSE
2717ba4f88 wireless: gs2200m: Change usrsock xid from uint64_t to uint32_t
Fix the type to match usrsock.h has been changed.
2022-10-24 09:04:31 +02:00
zhanghongyu
31ad585611 gs2200m: fix usrsock_bind error in gs2200m module
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-21 08:33:50 +09:00
Xiang Xiao
b659f0fbdf Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 18:40:23 +02:00
Xiang Xiao
893387b2c5 Fix the minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Alan Carvalho de Assis
abbe022894 wapi: Verify if password size if valid 2022-10-11 14:35:43 +08:00
Xiang Xiao
9291d07a87 Fix the coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 12:20:32 +02:00
Xiang Xiao
0dc5e9f469 Replace #include <queue.h> with #include <nuttx/queue.h>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:51 +02:00
Masayuki Ishikawa
3837091582 wireless: gs2200m: Add SIOCGIFFLAGS support to gs2200m_main.c
Summary:
- I noticed that the latest ifconfig command shows nothing
- Finally, I found that gs2200m_main.c needs to handle SIOCGIFFLAGS
- This commit fixes this issue

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi
- NOTE: gs2200m driver needs to be updated as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-07 11:21:29 +08:00
Xiang Xiao
0d85084741 wireless/gs2200m: Rename usrsock_request to usrsock_handle_request
fix the conflict after usrsock reconstruct:
https://github.com/apache/incubator-nuttx/pull/6949

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-29 22:17:29 +09:00
Huang Qi
2e2630e838 Don't download tarballs if a local git repo found
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-28 17:20:47 +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