Commit Graph

57 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
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
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
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
9291d07a87 Fix the coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 12:20:32 +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
Takayoshi Koizumi
cfa5af51cd wireless/gs2200m: Release all blocking socket
When dis-associtaion happens, the socket is destroyed. And all blocking
sockets are released for that error handling can be performed.
2022-08-02 16:54:35 +09:00
Masayuki Ishikawa
7663f993f7 wireless: gs2200m: Fix recvfrom_request() in gs2200m_main.c
Summary:
- I noticed that wget causes ASSERT in gs2200m_main.c recently.
- Finally, I found that it sends a wrong ack message in
  recvfrom_request() when the socket is closed passively
- This commit fixes this issue.

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-04-15 10:36:52 +03:00
zhanghongyu
16c1fec99d usrsock: Move event field to usrsock_message_common_s
Zero the events field for all response message

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-04-03 11:39:19 +09:00
Petro Karashchenko
566be8c7b1 definitions: unify MAX and MIN macro definitions
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:20:17 +08:00
chao.an
a1857b9258 wireless/gs2200m: replace the preamble scratch to union
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 19:08:43 +09:00
chao.an
df53de1d68 net/usrsock: replace usrsock xid type to uint64_t
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-05 13:25:21 +08:00
Petro Karashchenko
5ac15130db apps: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 20:52:08 -06:00
Masayuki Ishikawa
21f48846dd wireless: gs2200m: Fix error handling in sendto_request()
Summary:
- This commit returns -errno to the caller

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi_smp
- NOTE: need to update the gs2200m driver in NuttX

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-28 21:49:21 -05:00
Xiang Xiao
e9104dbbef Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-01 06:36:44 +09:00
Masatoshi Ueno
0f4ad7dc5f gs2200m: Add function to get IWNWID / IWFREQ / IWSENS information
Summary:
- This commit enables gs2200m application to get IWNWID/IWFREQ/IWSENS information

Impact:
- Affects gs2200m only

Testing:
- Tested with spresense:wifi
2020-11-02 19:59:09 +09:00
Masayuki Ishikawa
909eff540d wireless: gs2200m: Add support for ioctl(fd, SIOCGIFADDR, ...)
Summary:
- This commit adds support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m_main.c

Impact:
- Only affects ioctl(fd, SIOCGIFADDR, ...) with gs2200m
- Need to update nuttx as well

Testing:
- Tested with spresense:wifi
- Tested with dhcpc

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 12:42:03 +01:00
Masayuki Ishikawa
b71c5f8cb1 wireless: gs2200m: Implement getpeername_request()
Summary:
- This commit adds getperrname_request() to gs2200m_main.c

Impact:
- Affects gs2200m only
- Need to update nuttx as well

Testing:
- Tested with spresense:wifi
- Modify telnetd and add getpeername() to show a client address

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 12:42:03 +01:00
Masayuki Ishikawa
0e9594e107 wireless: gs2200m: Fix to handle address info in accept()
Summary:
- This commit fixes to handle address info in accept()

Impact:
- All use cases which use accept() with gs2200m
- Need to update nuttx as well

Testing:
- Tested with spresene:wifi
- Tested with telnet daemon

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 12:42:03 +01:00
Masayuki Ishikawa
196b1f06df wireless: gs2200m: Fix to handle UDP connect() with bind()
Summary:
- This commit fixes to handle UDP connect() with bind() to local port
- NOTE: GS2200M does not support TCP connect() with bind to local port

Impact:
- All UDP cases which use connect() with gs2200m
- Need to update nuttx as well

Testing:
- Tested with spresense:wifi
- Create a UDP socket and bind() to local port.
- Then connect() to remote address with port and send()

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 12:42:03 +01:00
Masayuki Ishikawa
f4b0f9e290 wireless: gs2200m: Fix recvfrom_reques() in gs2200m_main.c
Summary:
- During Wi-Fi stress test, I noticed ASSERT happens in gs2200m_main.c
- Actually, req->max_buflen was 0 but the case was not handled correctly
- This commit fixes this issue

Impact:
- Affects read/recvfrom with len=0 cases

Testing:
- Tested with spresense:wifi_smp
- Run nxplayer for audio streaming
- Run ps/free/ifconfig commands via telnet
- Run smp command via telnet

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-09 08:47:14 +02:00
SPRESENSE
4e1a22428a wireless/gs2200m/gs2200m_main.c: Add passing MSG flags
Add passing MSG_* flags for gs2200m driver.
2020-08-06 20:52:09 +09:00
Masayuki Ishikawa
faec1f8614 wireless: gs2200m: Replace license header with Apache License 2.0
Summary:
- This commit replaces license headers under wireleass/gs2200m.

Impact:
- No impact

Testing:
- Buid check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-29 01:05:31 -05:00
SPRESENSE
f8354b0c03 wireless/gs2200m: Fix freeing uninitialized memory
Add initialize local variable and check the buffer is allocated before free().
2020-07-28 09:46:09 +02:00
Xiang Xiao
deaa6c5b7b build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
and move NUTTXLIB defintion to the common place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 15:17:37 -03:00
Xiang Xiao
69f013e74e build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 15:56:35 +01:00
Masayuki Ishikawa
13479e0a8c wireless: gs2200m: Update help messages in gs2200m_main.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-22 10:30:16 +02:00
Xiang Xiao
ead498a788 build: Remove the workaround for the inexistence of .config/Make.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-21 17:43:42 +01:00
Masayuki Ishikawa
e2414cd731 wireless: gs2200m: Fix to receive a big packet
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-18 09:44:37 +02:00
Masayuki Ishikawa
f3934ec6d8 wireless: gs2200m: Add support for getsockname() to gs2200m
NOTE: need to update nuttx repo as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-14 07:50:16 -06:00
Masayuki Ishikawa
06e74202b5 wireless: gs2200m: Fix to release a bound socket
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-30 20:17:26 +08:00
Masayuki Ishikawa
efcbd2d842 wireless: gs2200m: Fix nxstyle warnings in gs2200m_main.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-14 11:22:10 +02:00
Masayuki Ishikawa
c126732799 wireless: gs2200m: Add support for UDP connect in gs2200m_main.c
NOTE: gs2200m driver needs to be updated as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-14 11:22:10 +02:00
YAMAMOTO Takashi
e7156be066 Change the defaults of stack size configs to DEFAULT_TASK_STACKSIZE
This commit changes only ones with the default 2048 and
leaves the others.
E.g. this leaves SYSTEM_RAMTEST_STACKSIZE, whose default is 1024.
I guess those need to be inspected one-by-one.
2020-03-27 02:43:11 -05:00
Xiang Xiao
1511403fdf Revert "Don't generate .depend anymore"
This reverts commit cc5ad09caa.
2020-03-22 23:09:40 -05:00
Xiang Xiao
cc5ad09caa
Don't generate .depend anymore 2020-03-22 18:15:21 +00:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Masayuki Ishikawa
de4d52d465 wireless: gs2200m: Add support for setsockopt_request()
NOTE: Just check parameters and do nothing special

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-14 15:01:28 +08:00
Gregory Nutt
d2e1c8a4f3 apps/wireless/gs2200m/gs2200m_main.c: Eliminate a warning
Eliminate warning:

    gs2200m_main.c:  In function 'gs2200m_loop':
    gs2200m_main.c:1416:1:  warning: label 'errout' defined but not used [-Wunused-label]
2020-02-09 00:32:25 +01:00
Miguel Herranz
a5dff52a71 Change unimplemented requests behaviour in gs2200m
The ASSERT is too strong, as it cannot be disabled, so changing to
DEBUGASSERT, as calling these functions should not be a problem as
long as the application logic handle the error correctly.

The error code is changed to ENOSYS, as it seems to better reflect
the fact that the call itself would be valid, but the functionality
is not implemented (see [1] or `man errno`).

[1] https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
2020-02-06 23:43:37 +01:00
YAMAMOTO Takashi
2f4b309b1b gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure
Author: Alan Carvalho de Assis <engenharia03@siam.ind.br>

    Run nxstyle again gs2200m_main.c file and fix issues

Author: YAMAMOTO Takashi <yamamoto@midokura.com>

    gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure

    The ioctl doesn't return why it failed.
    It might or might not be a transient failure.

    In my environment, gs2200m often returns the following for AT+WA.
    It usually works after a few retries.

    [   12.110000] _parse_pkt_in_s1: +++++ 0:(msize=19, msg=WLAN CONNECT ERROR|)
    [   12.110000] _parse_pkt_in_s1: +++++ 1:(msize=6, msg=ERROR|)
2020-02-05 18:45:43 -03:00
Masayuki Ishikawa
e4af73ec56 wireless: gs2200m: Fix sendto_request() in gs2200m_main.c
Signed-off-by: Masayuki Ishikawa <<Masayuki.Ishikawa@jp.sony.com>
2020-01-28 10:35:50 +01:00
Masayuki Ishikawa
ebf666100a apps: gs2200m: Remove unnecessary usleep() to improve throughput
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-01-21 16:03:41 +09:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Xiang Xiao
7808eb62d2 apps/: In all Make.def files, append to CONFIGURED_APPS patch with the absolute path. 2019-10-17 11:33:59 -06:00
Gregory Nutt
3a23523147 Makefiles: This reverts part of commit cf0365ea9. It restores 'conditional' inclusion of TOPDIR/Make.defs. Otherwise all make targets fail if the board has not been configured. That is okay most of the time, but not for things like clean and distclean which should not depend on being configured. 2019-10-15 09:25:48 +08:00
Xiang Xiao
e806097c70 Application.mk and main.c files: Change builtin's entry point from main to xxx_main by macro expansion. This change make the entry point fully compliant with POSIX/ANSI standard. 2019-10-06 06:14:56 -06:00