1. separate command catagory of bt/pktradio from wireless ioctl
2. Remove commoand count limit to support vendor command
Signed-off-by: chao an <anchao@xiaomi.com>
* net/netdev/netdev_ioctl.c:
(netdev_ifr_ioctl): The ioctl SIOCGIFHWADDR provides the hardware
address (e.g., Ethernet MAC, etc.) of a network interface. It is
based on Linux. (BSD-based systems don't have this ioctl.) The Linux
implementation sets sa_family to ARPHRD_ETHER for Ethernet and IEEE
802.11 interfaces [1]. NuttX was setting it to NET_SOCK_FAMILY for
these interface types as well as 6LoWPAN and PKTRADIO; this was
incorrect and also the value of NET_SOCK_FAMILY varies based on
Kconfig settings. Correcting this to ARPHRD_ETHER for Ethernet and
IEEE 802.11 and ARPHRD_IEEE802154 for 6LoWPAN and PKTRADIO.
References:
[1] 'man 7 netdevice' on Linux.
* net/netdev/netdev_ioctl.c:
(netdev_ifr_ioctl): The ioctl SIOCSIFHWADDR sets the hardware address
(e.g., Ethernet MAC, etc.) of a network interface. Radio devices may
have different lengths of hardware addresses, such as
NET_6LOWPAN_EADDRSIZE (8), NET_6LOWPAN_SADDRSIZE (2), or
RADIO_MAX_ADDRLEN (8). Also, Kconfig CONFIG_PKTRADIO_ADDRLEN allows
the user to set any arbitrary size. Note that while the sister ioctl
SIOCGIFHWADDR "get hardware address" copies
`dev->d_mac.radio.nv_addrlen` bytes, SIOCSIFHWADDR was copying
NET_6LOWPAN_ADDRSIZE bytes unconditionally. Depending on which radio
is used, this could be incorrect. Fixing it to use
`dev->d_mac.radio.nv_addrlen` for SIOCSIFHWADDR as well. Also adding
DEBUGASSERT to ensure this is within bounds of source and
destination of the copy.
Seperate usrsock device driver with usrsock core function layer
to make it more flexiable to adopt other kind of usrsock interface driver
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
In file included from route/net_del_ramroute.c:30:
route/net_del_ramroute.c: In function ‘net_match_ipv4’:
route/net_del_ramroute.c:93:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
93 | ninfo(" target=%08lx netmask=%08lx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
route/net_del_ramroute.c:93:23: note: format string is defined here
93 | ninfo(" target=%08lx netmask=%08lx\n",
| ~~~~^
| |
| long unsigned int
| %08x
mld/mld_timer.c: In function ‘mld_gendog_work’:
mld/mld_timer.c:118:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
118 | ifindex = (int)arg;
| ^
mld/mld_timer.c: In function ‘mld_v1dog_work’:
mld/mld_timer.c:237:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
237 | ifindex = (int)arg;
| ^
Signed-off-by: chao an <anchao@xiaomi.com>
allow usrsock USRSOCK_MESSAGE_RESPONSE_DATA_ACK with no-preload data
so addrlen could be updated to valuelen_nontrunc of usrsock_message_datareq_ack_s
nsh> usrsocktest
...
Testing group "basic_getsockname" =>
[TEST ASSERT FAILED!]
In function "basic_getsockname_open":
line 170: Assertion `(ssize_t)((ret)) == (ssize_t)((0))' failed.
got value: -1
should be: 0
Group "basic_getsockname": [FAILED]
Signed-off-by: chao an <anchao@xiaomi.com>
fix usrsock remote_disconnect fail:
nsh> usrsocktest
...
Testing group "remote_disconnect" =>
[TEST ASSERT FAILED!]
In function "receive":
line 497: Assertion `(ssize_t)((ret)) == (ssize_t)((0))' failed.
got value: -1
should be: 0
Group "remote_disconnect": [FAILED]
...
Reference:
RECV(2)
NAME
recv, recvfrom, recvmsg - receive a message from a socket
...
RETURN VALUE
...
When a stream socket peer has performed an orderly shutdown,
the return value will be 0 (the traditional "end-of-file" return).
Datagram sockets in various domains (e.g., the UNIX and Internet domains)
permit zero-length datagrams. When such a datagram is received, the return value is 0.
Signed-off-by: chao an <anchao@xiaomi.com>
fix usrsock getsockname fail
nsh> usrsocktest
...
Testing group "basic_getsockname" =>
[TEST ASSERT FAILED!]
In function "basic_getsockname_open":
line 170: Assertion `(ssize_t)((ret)) == (ssize_t)((0))' failed.
got value: -1
should be: 0
Group "basic_getsockname": [FAILED]
...
Reference:
GETSOCKNAME(2)
NAME
getsockname - get socket name
...
DESCRIPTION
...
The returned address is truncated if the buffer provided is too small;
in this case, addrlen will return a value greater than was supplied to the call.
Signed-off-by: chao an <anchao@xiaomi.com>
follow the below change:
-----------------------------------------------
commit 0334819742
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon Aug 22 05:10:47 2022 +0800
net/usrsock: Change xid from uint64_t to uint32_t
by generating the new xid for each transaction
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
Do not use 'pvconn' argument to get the connection pointer since
pvconn is normally NULL for some events like NETDEV_DOWN.
Instead, the connection pointer can be reliably obtained from the
corresponding private pointer.
Signed-off-by: chao.an <anchao@xiaomi.com>
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements
Signed-off-by: chao.an <anchao@xiaomi.com>
Otherwise, when a long test triggers multiple timeout retransmissions,
the late timeout retransmissions are always delayed between 24 and 48 seconds
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
since it is impossible to track producer and consumer
correctly if TCP/IP stack pass IOB directly to netdev
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>