Commit Graph

1970 Commits

Author SHA1 Message Date
chao.an e7f2dc8173 net/sockopt: change the socket option style from Linux to BSD
Linux Programmer's Manual
...
IP(7)
...
NOTES
...
    Using the SOL_IP socket options level isn't portable;
    BSD-based stacks use the IPPROTO_IP level.

Change-Id: I63ea5ec7714481b5201608ec4449e522e2be3da2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 18:49:58 -03:00
chao.an d6a0da41d5 net/vfcntl: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-24 13:48:41 +01:00
chao.an f56e0e004b fs/setfd: correct the return value
Change-Id: I766f3760e7167a579b73673c44b70847ee06850b
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-24 13:48:41 +01:00
Peter van der Perk ba5fe5cee3 SocketCAN: Fixed dropping timestamped frames when running in CAN2.0B 2020-06-17 15:17:38 -07:00
Peter van der Perk 4eecf8561f FlexCAN interrupt fixes, old compiler fixes
SocketCAN old compiler fix
2020-06-16 15:35:43 -03:00
Xiang Xiao fdb7e6e460 net/igmp: Fix the compiler warning on 64bit platform
igmp/igmp_timer.c: In function ‘igmp_timeout’:
igmp/igmp_timer.c:163:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  163 |   group = (FAR struct igmp_group_s *)arg;
      |           ^
igmp/igmp_timer.c: In function ‘igmp_startticks’:
igmp/igmp_timer.c:200:55: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  200 |   ret = wd_start(group->wdog, ticks, igmp_timeout, 1, (uint32_t)group);
      |                                                       ^
igmp/igmp_timer.c:200:38: warning: passing argument 3 of ‘wd_start’ from incompatible pointer type [-Wincompatible-pointer-types]
  200 |   ret = wd_start(group->wdog, ticks, igmp_timeout, 1, (uint32_t)group);
      |                                      ^~~~~~~~~~~~
      |                                      |
      |                                      void (*)(int,  uint32_t, ...) {aka void (*)(int,  unsigned int, ...)}
In file included from igmp/igmp_timer.c:50:
/home/xiaoxiang/mirtos/nuttx/include/nuttx/wdog.h:233:53: note: expected ‘wdentry_t’ {aka ‘void (*)(int,  long unsigned int, ...)’} but argument is of type ‘void (*)(int,  uint32_t, ...)’ {aka ‘void (*)(int,  unsigned int, ...)’}
  233 | int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...);

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I153355f85f583f5441d97a0b1278bce167eb3fd0
2020-06-15 21:21:42 +01:00
Ouss4 c8d83e0a88 net/can/can_setsockopt&can_getsockopt.c: Initialiaze ret variable to
eliminate any warning.
2020-06-15 12:20:32 -06:00
Ouss4 155903fc54 net/can/can.h: Add can_setsockopt and can_getsockopt prototypes. 2020-06-15 12:20:32 -06:00
Gregory Nutt 5e6d9944d7 net/socket/getsockopt.c: Eliminate warning
##[error]socket/getsockopt.c:362:7: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       int ret;
           ^~~
2020-06-15 16:10:47 +01:00
Peter van der Perk b5c5948e1c NXStyle fixes 2020-06-15 08:07:19 -06:00
Peter van der Perk 55d9e5f7af net: Add SocketCAN support 2020-06-15 08:07:19 -06:00
Alan C. Assis 089a633c76 Fix wrong space instead of TAB 2020-06-15 07:13:21 -06:00
Alan C. Assis 7609b67496 Fix issues reported on PR #1233 2020-06-15 07:13:21 -06:00
Alan C. Assis 6ff18a7f3b Rename NETDEV_WBIM_FORMAT with NETDEV_WWAM_FORMAT 2020-06-15 07:13:21 -06:00
Alan C. Assis e1be7ace4b Fix netdev and add Apache license to the file 2020-06-15 07:13:21 -06:00
Adam Porter 07c0faff59 Add support to CDC-MBIM USB host driver
This driver was created by Adam Porter and posted on NuttX
mailing list at Google Group on Nov 14 2019
2020-06-15 07:13:21 -06:00
Jukka Laitinen 17e45820c6 net/inet/inet_sockif.c: Fix long lines
Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
2020-06-01 21:54:06 +08:00
Jukka Laitinen 1f8de344dd net/inet/inet_sockif.c: Fix debugassert compilation
Should derefer addrlen pointer, instead of comparing whether
the pointer itself is > 0

Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
2020-06-01 21:54:06 +08:00
Xiang Xiao 7e5b0f81e9 build: Replace -I with INCDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Gregory Nutt 154a87993f fs/vfs/fd_open.c: fs_fdopen() must not set errno
Functions within the OS must never set the errno value.  fs_fdopen() was setting the errno value.  Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
2020-05-23 15:22:09 +08:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Masayuki Ishikawa c7500c5c9d net: tcp: Fix port info in warning message in tcp_input.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-19 13:36:45 +08:00
Gregory Nutt 57bc329aac Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
Gregory Nutt a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
Gregory Nutt 35efcee5c9 net/netdev/netdev_register.c: Add some comments.
This commit adds some short comments to explain some perplexing logic of PR #1047.
2020-05-15 15:48:00 +01:00
chao.an 87af256ad6 net/udp: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-15 07:27:01 -06:00
chao.an 7a62a59dec net/conn: generate port base dynamically
In some extreme scenarios(eg. crash, reboot, reset, etc...),
an established connection cannot guarantee that the port can be
closed properly, if we try to reconnect quickly after reset, the
connection will fail since the current port is same as the
previous one, the previous port connection has been hold on server side.

dynamically apply for the port base to avoid duplication.

Change-Id: I0089244b2707ea61f553a4dae09c7af3649c70bd
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-15 07:27:01 -06:00
YAMAMOTO Takashi 573f02791f netdev_ioctl: Update a comment 2020-05-14 11:26:03 -06:00
chao.an a5868864bc net: remove unnecessary spaces
minor style fix

Change-Id: I06b6fe48628440490090b89a39baf01481f79b79
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:54:57 -06:00
chao.an 9cc2f50405 netdev/register: configurable net packet size
Change-Id: I2af571a0273e67a06c1b4543eac3ded7cfdd8060
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:54:57 -06:00
chao.an 03f462c5cd net/sockopt: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:53:15 -06:00
chao.an 608436a75f net/sockopt: do not set the errno to SO_ERROR
SO_ERROR is used to report asynchronous errors that are the result
of events within the network stack and not synchronous errors that
are the result of a library call(send/recv/connect)

Synchronous results are reported via errno.

Linux Programmer's Manual
...
NAME
       getsockopt, setsockopt - get and set options on sockets
...
RETURN VALUE
...
       On error, -1 is returned, and errno is set appropriately

Change-Id: I1a1a05a684dff8672aaf47eabee157ac0d275c2d
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:53:15 -06:00
Xiang Xiao 63e3054ced Don't need monitor IOB buffer empty event for POLLOUT implementation
It's enough to check the buffer available in the net event handler

Change-Id: I2d7c7a03675cf6eff6ffb42a81b7c7245253e92c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-13 06:50:07 -06:00
Xiang Xiao 517974787f Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
follow up the new naming convention:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-10 14:35:50 -06:00
Gregory Nutt 4b44b628ea Run nxstyle against all .c and .h files modified by this PR.
All complaints fixed except for those that were not possible to fix:

- Used of Mixed case identifier in ESP32 files.  These are references to Expressif ROM functions which are outside of the scope of NuttX.
2020-05-09 14:19:08 -03:00
Gregory Nutt a4218e2144 include/nuttx/sched.h: Make naming of all internal names consistent:
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
chao.an 0887203c57 tcp/conn: request arp before the 3-way handshake
Since the request address was not properly resolved before the handshake,
every time of connection, the handshake data will be overwitten into
arp packet and retransmitted until the next tcp timer.
Request the arp address before the handshake to avoid the retransmission.

Change-Id: I80118b9a8096c126c8e16cdf2f7b3d98fca92437
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-09 07:25:03 -06:00
Masayuki Ishikawa 75a8883f07 net: netdev: Fix netdev_vioctl()
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-09 02:10:23 +01:00
Xiang Xiao b7d922960f Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 07:20:49 -06:00
Xiang Xiao d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao 6604cdb3f2 fs: Remove all LIBC_IOCTL_VARIADIC related stuff
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao 390f9a5fb7 fs/vfs: Add nx_dup and nx_dup2 function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Xiang Xiao 5b839061f9 net/usrsock: fix error: variable 'pos' is used uninitialized
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-29 07:10:44 -06:00
Gregory Nutt 9400cf2cd1 sched/group: On task creation, do not clone uninitialized descriptors.
Sockets are created in two steps:

1. The socket is allocated, then
2. The socket is initialized.

In SMP mode, there is a possibility that a pthread executing one CPU may create a new task while a pthread on another CPU has allocated the socket but not yet initialized it.  This commit updates the socket clone test to assure that the socket is both allocated and initailized.

Without the change, it is possible that uninitialized sockets could be cloned, leading to errors later in the newly started task.
2020-04-28 21:27:05 +01:00
Xiang Xiao b432ae5598 Fix nxstyle warning 2020-04-16 11:50:18 -06:00
chao.an 9131ae1f1f netdev/carrier: monitor the driver status 2020-04-16 11:50:04 -06:00
chao.an 10acadb64b netlink: add netlink route notify support 2020-04-16 11:49:53 -06:00
Xiang Xiao 6f1c86d934 netlink: Fix the compiler warning in netlink_add_broadcast
netlink/netlink_conn.c: In function 'netlink_add_broadcast':
netlink/netlink_conn.c:319:45: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
  319 |       if (conn->groups & (1 << (group - 1)) == 0)
      |                          ~~~~~~~~~~~~~~~~~~~^~~~
2020-04-16 11:49:40 -06:00