Commit Graph

397 Commits

Author SHA1 Message Date
Xiang Xiao
0159726da5 drivers/net/slip.c: It's enough to only hold the net lock in SLIP driver 2020-02-02 08:27:33 -06:00
Xiang Xiao
ca8191ad41 drivers/net/slip.c: Don't use fd related operation in SLIP kernel thread 2020-02-02 08:26:30 -06:00
Xiang Xiao
c5b1554d84 Remove NETDEV_LOOPBACK option, NET_LOOPBACK is enough 2020-02-02 08:25:06 -06:00
Xiang Xiao
2d7c072723 Remove duplicated NET_SLIP option from drivers/net/Kconfig 2020-02-02 08:24:50 -06:00
Xiang Xiao
e9bc32cdbc Improve tun (#198)
* Remove the code duplication in tun_net_receive_tap and remove the unused filep field
  * Shouldn't return -EBUSY in tun_write.  Let the caller wait until the write buffer free
  * Handle that write buffer is ready first correctly in tun_read
  * Remove the unused tun_ipv6multicast
2020-02-02 08:02:17 -06:00
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao
0b860726db Ensure psock_socket and psock_accept initialize s_crefs to 1
This simplifies the caller usage
2020-01-31 13:45:14 -06:00
Xiang Xiao
9f9566c0eb Rename net_clone/net_dupsd[2] to psock_dup2/net_dup[2] like vfs 2020-01-31 13:45:14 -06:00
Xiang Xiao
80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao
6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* 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
2020-01-02 10:54:43 -06:00
Xiang Xiao
87cf5c58ae Correct some problems with network timed events when there are multiple network devices in the configuration.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    Ran nxstyle against many of the affected files.  But this job was too big for today.  Many of the network drivers under arch are highly non-compiant and generate many, many faults from nxstyle.  Those will have to be visited again another day.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    This effects all network drivers as well as timing related portions of net/: devif_poll_tcp_timer shouldn't be skipped in the multiple card case.  devif_timer will be called multiple time in one period if the multiple card exist, the elapsed time calculated for the first callback is right, but the flowing callback in the same period is wrong(very short) because the global variable g_polltimer is used in the calculation.  So let's pass the delay time to devif_timer and remove g_polltimer.
2019-12-24 10:37:30 -06:00
Nathan Hartman
9655730ef8 Fix various typos and spelling errors. 2019-12-12 07:41:51 -06:00
Gregory Nutt
2a83c0808c drivers/net: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 14:54:50 -06:00
Guiding Li
8b92305265 This commit brings in the drivers needed to support OpenAMP. These changes were ported from https://github.com/FishsemiCode/nuttx. The current state: Most drivers do now compile but are not yet verfied.
This port was effort of a number of people, I rather arbitrarily gave authorship to Guiding Li because he has the largest number of fundamental quashed commits from the Xiamoi repository.

Squashed commit of the following:

Author: Xiang Xiao <xiaoxiang@pinecone.net>
    include/nuttx/b2c.h and libx/libc/string:  Add non-standard string functions to deal with cases where there are more than 8-bits in a type char.

Author: Gregory Nutt <gnutt@nuttx.org>
    Fix several build issues/missing definitiona needed for OpenAMP build in drivers/.
    Add OpenAMP code has been reviewed and ran through tools/nxstyle (with all reports accounted for).

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
    tools/:  Fix the minor issue in Makefile

Author: Gregory Nutt <gnutt@nuttx.org>
    drivers/rptun/rptun.c:  Review for coding standard.  Run against tools/nxstyle.
    tools/LibTargets.mk:  Fix some TABs that were turned into spaces by a copy-paste.
    fs/hostfs:  Add configure and build support for hostfs RPC.
    drivers/timer:  Add configure and build support for syslog RTC.
    drivers/syslog:  Add configure and build support for syslog RPC.
    drivers/serial:  Add configure and build support for serial RPC.
    Kconfig, tools/*.mk. openamp/:  Add basic OpenAMP build support.
    drivers/rptun:  Add configure and build support for OpenAMP tunnel drivers.
    drivers/net:  Update Make.defs and Kconfig for OpenSDA support.
    Remove drivers/clk/clk-rpmsg.c drivers/power/rpmsg_regulator.c.  These depend on upstreaming support for a new subsystem based on the clk/regulator is model from Linux.  Removed because we want to separate the activities.  We will just try to get the basic OpenAMP support in place for now.
    Remove drivers/misc/misc_rpmsg.c and include/nuttx/misc/misc_rpmsg.h.  These are specific to the Xiaomi application.

Author: zhuyanlin <zhuyanlin@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Jianli Dong <dongjianli@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Guiding Li <liguiding@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.
2019-11-02 11:30:33 -06:00
David Sidrane
43a3a0f400 Merged in david_s5/nuttx/master_k66_ethernet (pull request #1064)
NXP k66 Ethernet

* Kinetis:Add TJA1100 Phy

* Kinetis:enet.c formated with nxstyle

* net:mii Cleanup TJA1100 Support

      Formating and adding mask and shifts

* net:Kconfig Cleanup formatting

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-10-30 18:29:54 +00:00
Xiang Xiao
3bc62f1ccc Change space to tab and help to ---help--- in Kconfig files. 2019-10-05 21:39:12 -06:00
Nathan Hartman
46aaec7ba0 Fix minor typos in docs and comments. 2019-09-29 12:52:20 -06:00
Bernd Walter
338f09acfc drivers/net and net/: Use ntoh() when printing IPv6 addresses so that the addresses appear in friendlier host order vs. network order. 2019-09-24 10:06:42 -06:00
Juha Niskanen
e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Nathan Hartman
be5a40c656 Fix typos in comments. 2019-08-21 09:32:59 -06:00
Gregory Nutt
7a0481d2a9 drivers/net/telnet.c: Fix a C89 non-compliance that was breaking the ez80 build. 2019-06-03 08:20:21 -06:00
Valmantas Palikša
4e56c577fe drivers/net/telnet.c: I/O thread now offloads reading from socket from client thread to the I/O thread. 2019-05-22 07:46:40 -06:00
Gregory Nutt
b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Valmantas Paliksa
de05dd6e67 drivers/net/telnet.c: Handle ctrl events (SIGINT, SIGSTP). 2019-05-21 09:57:46 -06:00
Jukka Laitinen
d1c9cf2e93 drivers/net/phy_notify.c: Change sprintf to strncpy in phy_notify. On some platforms, the sprintf doesn't accept a const char* as a format argument. 2019-04-30 06:24:43 -06:00
Gregory Nutt
4653260388 drivers/net: Run tools/detab, rmcr, lowhex, and nstyle against all files. 2019-02-24 11:51:25 -06:00
Gregory Nutt
7c2aa26486 drivers/net/tun.c: Costmetic changes from review for coding style compliance. 2019-02-24 10:10:38 -06:00
Gregory Nutt
3502425221 drivers/net/tun.c: Packet buffer size should include the configured GUARD_SIZE. And, given how the buffers are allocated, the allocation size must be an even number of 16-bit values to preserve alignment. 2019-02-24 09:52:18 -06:00
Gregory Nutt
4d3dd73e57 drivers/net/tun.c: Re-order all TUN/TAP driver state data. Not only was was with wasting memory due to alignement requirements, it was also causing network packet buffers to be improperly aligned causing problems because the network requires 16-bit packet buffer alignment for uint16_t accesses. This alignment problem was discovered by Alan Carvalho de Assis. 2019-02-24 09:43:30 -06:00
Xiang Xiao
fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Xiang Xiao
d105dc9b5e drivers/net/phy_notify.c and all network drivers that support PHY notifications: Support the signal notification through SIGEV_THREAD 2019-01-27 08:57:23 -06:00
Masayuki Ishikawa
69652bf9f2 Merged in masayuki2009/nuttx.nuttx/fix_telnet_driver (pull request #819)
drivers/net/telnet.c: Add config to avoid a garbage character when not supported.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2019-01-19 12:43:21 +00:00
Gregory Nutt
1e2209348f drivers/net/telnet.c: Eliminate some newly introduced warnings found in build testing. 2019-01-13 14:04:20 -06:00
Ken Pettit
92104149e8 drivers/net/telnet.c: Add missing logic to set read event flags in poll() method. 2019-01-08 08:16:43 -06:00
Daniel Agar
efb42f4e25 Merged in dagar/nuttx/pr-net_telnet_unused (pull request #807)
drivers telnet common_ioctl() - inode only used with CONFIG_TELNET_SUPPORT_NAWS

Approved-by: GregoryN <gnutt@nuttx.org>
2019-01-07 14:19:48 +00:00
Daniel Agar
62fe15e87c Merged in dagar/nuttx/pr-telnet_unused_priv (pull request #803)
telnet.c priv only used if CONFIG_TELNET_SUPPORT_NAWS

Approved-by: GregoryN <gnutt@nuttx.org>
2019-01-06 16:15:56 +00:00
Ken Pettit
a97c4d8644 drivers/net/telnet.c: Add NAWS and poll interface to telnet for screen size negotation used with termcurses.
arch/arm/src/samv7/sam_serial.c: Fix case where TTYS0 is not defined.
2019-01-05 12:14:05 -06:00
Lwazi Dube
53ce088a54 arch/arm/include/tiva and src/tiva: Improve GPIO interrupt support by removing unnecessary, hard-coded per-MCU defines and using the existing Kconfig configuration options instead. 2018-12-31 07:19:30 -06:00
Xiang Xiao
fc9964f6b6 drivers/net/tun.c: Fixes a problem reported by Masayuki Ishikwawa: Recently I noticed that ARP response packet is corrupted when I tried to run bluekitchen with the latest tun.c in TAP mode. If I revert commit 8193c28e91, then it works again. 2018-12-30 17:54:03 -06:00
Gregory Nutt
09f4dee6bc All network drivers! Change pre-processor logic that selects the high priority work queue or gives preferential treatment to the high priority work. All network logic must run on the low priority work queue! Or suffer the consequences. 2018-11-21 07:57:26 -06:00
Xiang Xiao
77098f8736 Move NETDEV_LATEINIT from drivers/net/Kconfig to net/Kconfig so that we can select NETDEV_LATEINIT without enabling NETDEVICES since the net driver in arch folder may need to initialize later too. 2018-11-12 06:36:26 -06:00
Xiang Xiao
8193c28e91 drivers/net/tun.c: Call ipv[4|6]_input dynamically by checking packet header and remove the code duplication 2018-11-09 09:50:10 -06:00
Xiang Xiao
3f1b6543db drivers/net/slip.c: Add IPv6 support and fix minor issue 2018-11-09 09:41:24 -06:00
Xiang Xiao
f65e7a4097 drivers/net/lan91c111.c: Reuse lan91c111_reply for ARP case 2018-11-09 09:38:59 -06:00
Gregory Nutt
6d93658ff8 Add new configuratin CONFIG_NET_MCASTGROUP. This option is selected automatically if either CONFIG_NET_IGMP or CONFIG_NET_MLD are selected. Most conditional logic based on CONFIG_NET_IGMP replaced with conditioning on CONFIG_NET_MCASTGROUP. 2018-10-31 15:03:51 -06:00
Harri Luhtala
2d750d461b drivers/net/enc28j60.c: Adjust debug trace levels. Correct typos in some comments. 2018-09-25 07:07:04 -06:00
Gregory Nutt
a7fd58c4db Squashed commit of the following:
many locations:  Change occurences of open() followed by file_detach() to file_open().  Change most non-controversion calls to open() to nx_open().

    fs/inode/fs_fileopen.c:  Flesh out file_open() with some interim, placeholder logic.

    fs/inode/fs_fileopen.c:  Add a framework for a file_open() implementation (no real logic in place yet).

    fs/vfs/fs_open.c:  Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
2018-09-15 10:49:41 -06:00
liuzhuang
8343f0f55a drivers/net/lan91c111.c: Change MAX_NETDEV_MTU to MAX_NETDEV_PKTSIZE 2018-08-28 15:24:02 -06:00
Xiang Xiao
49548da297 net/Kconfig: Uncomment the prompt of NET_SLIP_PKTSIZE 2018-08-26 14:28:35 -06:00