Commit Graph

945 Commits

Author SHA1 Message Date
Gregory Nutt
39a37d6aa8 Separate out psock_listen() and psock_accept() for internal use by the OS 2016-04-14 08:39:48 -06:00
Gregory Nutt
03a77c1d18 Remove most unused references to CONFIG_NET_MULTICAST. Rename other uses of CONFIG_NET_MULTICAST to avoid naming comflicts. 2016-03-20 13:16:17 -06:00
Gregory Nutt
2dd9777c7e Fix a backward conditional test introduced with the last commit 2016-03-20 09:58:07 -06:00
Gregory Nutt
00b44959ea TCP poll: TCP poll events can really only being processed when the poll from the correct device is received. 2016-03-20 08:39:15 -06:00
Gregory Nutt
4639cdd894 TCP timeouts: Fix some logic when there are multiple network interfaces. In this case, TCP timeout events can really only being processed when the poll from the correct device is received. 2016-03-20 08:19:00 -06:00
Gregory Nutt
fdddebbffd net/: Finish IEEE802154->6LOWPAN renaming; remove PF_IEEE804154; Move 6LoWPAN menu to inside Internet Protocol Menu 2016-02-27 07:26:20 -06:00
Gregory Nutt
309beae2cd Move drivers/ieee802154 to drivers/wireless/ieee802154; rename include/nuttx/net ieee802154 to 6lowpan.h 2016-02-26 15:03:16 -06:00
Gregory Nutt
2f28ca86c2 Clean up some naming; rename net/ieee802154 to net/6lowpan 2016-02-26 10:08:36 -06:00
Gregory Nutt
2c95fef501 Remove some empty code section comments 2016-02-26 07:35:55 -06:00
Gregory Nutt
8db55f6493 Back out most of previous commit 2016-02-26 06:45:37 -06:00
Gregory Nutt
b0ea870bcc Remove some empty code section comments 2016-02-25 18:34:36 -06:00
Gregory Nutt
9ff645a298 drivers/ieee802154: Add a skeleton IEEE802154 driver 2016-02-25 15:11:30 -06:00
Gregory Nutt
0b441ff1f4 net/: Add basic IEEE 802.15-4 socket support 2016-02-25 14:01:22 -06:00
Gregory Nutt
e4e6181098 net/: IEEE 802.15-4 basic build build structure. 2016-02-25 10:43:51 -06:00
Gregory Nutt
bcbd8ee964 Networking: Cosmetic change 2016-02-24 19:02:51 -06:00
Gregory Nutt
d19e9cc448 networking: cosmetic changes 2016-02-24 16:10:20 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt
aa3e778dc6 nuttx/net: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:38:44 -06:00
Gregory Nutt
68ee9bcaed Refresh modules + plus minor clean-up from previous commits 2016-02-08 15:13:14 -06:00
Gregory Nutt
166ad58849 DHCPD no longer calls directly into the OS, but uses network IOCTL commands to modify the ARP table. Plus, fix a warning. 2016-02-08 12:08:18 -06:00
Gregory Nutt
0af9a197ac ARP: Add IOCTL commands to manage the ARP table 2016-02-08 11:17:22 -06:00
Gregory Nutt
0554de6c50 Networking: Simply devif_timer; Consolidate duplicated devif_poll logic 2016-02-05 07:36:07 -06:00
Gregory Nutt
b5024263e9 Networking: Add a trivial cast 2016-02-03 18:12:19 -06:00
Gregory Nutt
41164740a5 Network: Improve half-second conversion 2016-02-03 13:08:19 -06:00
Gregory Nutt
dea24c503a Networking: Remove the HSEC argument from devif_timer. 2016-02-03 12:12:41 -06:00
Gregory Nutt
7fb7bef2d2 Fix an error introduced with last IOB fix 2016-01-26 09:55:17 -06:00
Gregory Nutt
365e015010 iob_alloc_qentry() has the same issue that was recently fixed in iob_alloc() 2016-01-25 17:46:59 -06:00
Gregory Nutt
91b762aa86 Networking: Fix an error that I introduced with my last review changes 2016-01-22 17:35:06 -06:00
Andrew Webster
5c589e5b9c Net: use nlldbg since an iob can be added from an interrupt 2016-01-22 16:23:31 -06:00
Andrew Webster
49e5cc5a6f TCP: check for an active connection before cleaning it up
If there is no active connection (e.g. it is waiting in accept), then
the connection object, which doesn't yet exist, should not be cleaned
up when the socket is closed.
2016-01-22 16:22:09 -06:00
Andrew Webster
5e3023bef1 TCP: return from write when there is no buffer space
During a write, if there is no more buffer space for the user data,
return the amount that was written instead of waiting until there
is free space.  If nothing has been written yet, then block as before.

This solves a deadlock that occurs if the user data is too large to
fit in the available buffer:  the write thread will block before any
data is added to the write queue, leaving no possibility that more
buffers will free up when they are ACKed (since they have not yet been
sent).  The write thread will then block forever and hold all of the
buffers.
2016-01-22 16:19:20 -06:00
Andrew Webster
e221777a7a TCP: post buffer semaphore before re-acquiring both
TCP uses two semaphores for buffers, one for the entire buffer pool,
and one for the number of allowed buffers for readahead.  To avoid
double taking a semaphore under heavy load, release the semaphore
after waiting before trying to acquire both again.
2016-01-22 16:15:10 -06:00
Andrew Webster
4875c6bbe3 TCP: check for connection before deleting it
It is possible for a socket to have no connection, for example if a TCP
socket is waiting in accept.  This checks for this condition in case the
socket is closed from a different thread.
2016-01-22 15:59:15 -06:00
Andrew Webster
f1ef2c6cde TCP: attempt to flush the write buffers before closing
When a socket is closed, it should make sure that any pending write
data is sent before the FIN is sent.  It already would wait for all
sent data to be acked, however it would discard any pending write
data that had not been sent at least once.

This change adds a check for pending write data in addition to unacked
data.  However, to be able to actually send any new data, the send
callback must be left.  The callback should be freed later when the socket
is actually destroyed.
2016-01-22 15:58:02 -06:00
Andrew Webster
cdd187a7f3 TCP: check for sndcb before using it 2016-01-22 15:54:45 -06:00
Andrew Webster
df211ee46a TCP: add writable check during poll
When a poll requesting POLLOUT happens, the poll should return
immediately if a write will not block.  This change adds that, as
opposed to the old behaviour of blocking until a timer from the
Ethernet driver eventually triggers the poll to complete.

This is only implemented for buffered TCP.  Unbuffered TCP should
behave as before.
2016-01-22 15:52:14 -06:00
Andrew Webster
99f5fcda70 iTCP: use lowlevel syslog to avoid infinte recursion
If stdout is a socket (e.g. telnet), then the debug message will cause
more TCP data to be sent, which generates another message, and so on
2016-01-22 15:41:48 -06:00
Gregory Nutt
f348e68069 Update to use 64-bit timer when available 2016-01-21 11:54:26 -06:00
Gregory Nutt
8e9f884eb7 Step 1 in /etc/resolv.conf support 2016-01-13 15:06:44 -06:00
Gregory Nutt
f87358faf9 correct some conditional compilation; update some comments 2016-01-12 07:05:50 -06:00
Gregory Nutt
1608b7c33f Some networking logic was used helpers from apps/netutils. Not good. Quick fix is to duplicate logic 2016-01-09 15:56:08 -06:00
Gregory Nutt
795ddd7e80 OS modules: Add basic procfs support. A module registry that will eventually be used to support lsmod 2015-12-12 17:42:25 -06:00
Gregory Nutt
59b912477e Fix some warnings: Mismatched prototypes 2015-12-05 10:36:00 -06:00
Gregory Nutt
c16648b3fd Most cosmetic but also includes a fix for a compile problem from Ken Pettit 2015-12-01 12:54:57 -06:00
Gregory Nutt
6af3ba78b9 Remove CONFIG_NET_PINGADDRCONF. This was a uIP way of assigning IP addresses, but is not standard and not a appropriate feature in general. 2015-12-01 07:48:56 -06:00
Gregory Nutt
eb8668b0f7 net/: Add procfs support for network device status 2015-11-27 16:39:14 -06:00
Gregory Nutt
9d8462aa23 net/: Move net_procfs.c to net/procfs/. Partition logic a little better to make space to support net device procfs as well 2015-11-27 13:53:33 -06:00
Gregory Nutt
e4236941c6 net/net_procfs.c: Add basic support for networking procfs entries 2015-11-27 12:33:58 -06:00
Gregory Nutt
2a93c66948 include/nuttx/net/netdev.h and several Ethernet drivers in arch/: Most network drivers to not support statistics. Those that do only support them when DEBUG is enabled. Each driver collects an architecture specific set of statistics and there is no mechanism in place to view those statistics. Thus, the driver feature was mostly useless. This change standardizes the driver statistics and puts the definition in the common network device structure defined in netdev.h where they can be accessed by network applications. All Ethernet drivers that collect statistics have been adapted to use these common statistics. 2015-11-26 12:08:09 -06:00
Gregory Nutt
6209c51206 net/: More clean-up of spacing/alignment issues 2015-10-08 15:10:04 -06:00
Gregory Nutt
af086c40ff Remove dangling whitespace 2015-10-04 15:28:54 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt
cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt
fec3d2cf62 recvfrom: Fixes for compilation with only raw, packet sockets 2015-09-14 09:06:08 -06:00
Gregory Nutt
a7e43c7fdb Eliminate some warnings 2015-09-08 09:20:18 -06:00
Gregory Nutt
d700793077 Fix a compile error when IPv6 is enabled 2015-09-07 16:34:25 -06:00
Alan Carvalho de Assis
f10a103108 Fix tcp_send_unbuffered when NET_ETHERNET is not defined. 2015-09-07 13:31:35 -06:00
Gregory Nutt
9c66bde5b0 Fix typo in pre-processor command noted by Pierre-noel Bouteville. Also move # of pre-processior command to column 1 2015-09-05 09:10:48 -06:00
Gregory Nutt
14297afb83 Cosmetic fix to break up long line 2015-09-03 07:33:50 -06:00
Gregory Nutt
36f4d0e9fc Fix a error in some comments 2015-09-02 20:03:28 -06:00
Gregory Nutt
0e2986f131 net/tcp: The logic that binds a specific networkd device to a connection was faulty for the case of multiple network devices. On bind(), the local address should be used to associate a device with the connection (if the local address is not INADDR_ANY); On connect(), the remote address should be used (in case the local address is INADDR_ANY). On accept(), it does not matter but the remote address is the one guarenteed to be available. 2015-09-02 19:48:31 -06:00
Gregory Nutt
9fcad39a45 Trivial typo fix 2015-09-02 10:09:33 -06:00
Paul A. Patience
3b89eabd50 Correct #if to #ifdef when the macro can be undefined. Fix bug in AT24XX driver: it should compare AT24XX_ADDRSIZE to 2. 2015-09-01 13:52:29 -04:00
Gregory Nutt
63071a563a Costmetic changes 2015-08-27 10:38:43 -06:00
Gregory Nutt
b1e09d4847 net/socket and net/tcp: Fix a problem in whent there are multiple network devices. Polls were being sent to all TCP sockets before. This is not good because it means that packets may sometimes be sent out on the wrong device. That is inefficient because it will cause retransmissions and bad performance. But, worse, when one of the devices is not Ethernet, it will have a different MSS and, as a result, incorrect data transfers can cause crashes. The fix is to lock into a single device once the MSS is locked locked down. 2015-08-27 09:06:46 -06:00
Gregory Nutt
3bcdb218ff Networking: Get rid of the tcp_mss macro. It is confusing and only obfuscates what is really going on 2015-08-27 08:39:17 -06:00
Gregory Nutt
007aabc46f Fix a badly formatted comment 2015-08-26 19:18:04 -06:00
SaeHie Park
a268e0aeb9 Fix a typo from an earlier commit 2015-08-26 18:12:58 -06:00
Saehie ParK
e6dbd3d903 Networking: Fix network device name assignment logic for the case of the local loopback device. There is only one local loopback network device and it is unnumbered 2015-08-25 20:03:25 -06:00
Anton D. Kachalov
b125c36849 Field `d_sndlen' is unsigned. It is always >= 0.
Signed-off-by: Anton D. Kachalov <mouse@yandex-team.ru>
2015-08-26 00:16:52 +03:00
SaeHie Park
e983e547e1 Networking: Correct return value from psock_tcp_accept(). From SaeHie Park 2015-08-25 07:15:21 -06:00
Gregory Nutt
79aa3d40b0 Kconfig: CONFIG_NET_MULTILINK and CONFIG_NET_MULTINIC must be support if the loopback device and any real network device are selected 2015-08-25 06:51:15 -06:00
Gregory Nutt
3c5f817513 Networking: Local loopback is basically functional and is no longer EXPERIMENTAL 2015-08-24 13:58:57 -06:00
Gregory Nutt
933d74e5c1 Networking: With these changes, I can ping the local loopback device from the simulator 2015-08-24 13:49:12 -06:00
Gregory Nutt
0b012c7978 Fix some initial loop back device compilation errors; mark configuration as EXPERIMENTAL 2015-08-24 11:29:54 -06:00
Gregory Nutt
07bdff9ef7 Networking: Add NetDB support for the local loopback device 2015-08-24 10:08:26 -06:00
Gregory Nutt
e21501c699 Merge remote-tracking branch 'origin/master' into localhost 2015-08-24 08:29:36 -06:00
Gregory Nutt
569ff602ea Networking: Remove bogus references to PPP as a link layer protocol 2015-08-24 08:29:07 -06:00
Gregory Nutt
ea2fafb024 Add definitions to support a local loopback link layer 2015-08-24 08:25:08 -06:00
Gregory Nutt
89b5ef8d35 wdogs: Fix counting of free, pre-allocated wdog timers. The could could get decremented below zero in some situations 2015-08-21 11:30:22 -06:00
Pavel Pisa
12b1c04508 recvfrom(): Correct wait for new data when NET_UDP_READAHEAD is enabled. Fix size accounting when recvfrom_udpreadahead() sets state.rf_recvlen == -1. I have not checked if data are accumulated to the right position in the buffer however.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2015-08-21 09:15:06 -06:00
Gregory Nutt
4c4868c69f More cosmetic changes: Fix some errors in comments and some indentation problems 2015-08-11 19:23:51 -06:00
Gregory Nutt
850225223d Costmetic fix to a comment 2015-08-11 19:21:15 -06:00
Gregory Nutt
530d229361 net/udp: Add support for send() with connected UDP sockets 2015-08-11 19:17:55 -06:00
Max Neklyudov
7d04104485 Networking: Allow receipt of empty UDP packets. From Max Neklyudov 2015-08-11 08:34:16 -06:00
Gregory Nutt
f94fe747ae Undo part of a previous change. Move get/sethostname back from net/netdb to libc/unistd 2015-07-08 11:11:52 -06:00
Gregory Nutt
fca919f3d2 Networking: Fix some compilation issues noted with network is build with CONFIG_BUILD_KERNEL 2015-07-05 11:18:56 -06:00
Gregory Nutt
6380832ab7 Move the header of set/sethostname from libc/unisted to net/netdb. This is OS internal stuff 2015-07-05 10:43:37 -06:00
Stavros Polymenis
701509f9bd Add implementations of uname() and gethost(). From Stavros Polymenis. 2015-07-03 07:50:27 -06:00
Gregory Nutt
09c7373f24 Fix misc. compilation error/warning detected by tools/testbuild.sh 2015-07-01 14:33:37 -06:00
Gregory Nutt
342f5fe33d Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:08:57 -06:00
Gregory Nutt
0ad53183e1 Networking: Fix a compile problem introduced in NuttX-7.6 when CONFIG_NET_SENDFILE=y 2015-06-24 14:52:57 -06:00
Gregory Nutt
ed9c45bcef Networking: Fix compilation error if IPv6 is enabled 2015-06-17 15:00:04 -06:00
Gregory Nutt
8f7752d956 Networking: Modify how callback structures are stored to avoid another potential use of a stal pointer. 2015-06-03 08:11:57 -06:00
Gregory Nutt
edbb5d0840 networking: Correct a typo introduced with recent networking changes 2015-06-02 15:04:02 -06:00
Gregory Nutt
e22deff1ab TCP connect. Move the location where the socket is marked as connected in order to avoid a potential race condition 2015-05-31 12:24:24 -06:00
Gregory Nutt
b493dde4cf TCP networking: In the TCP connection operation, it was trying to setup the network monitor BEFORE the socket was successfully connected. This, of course, has ALWAYS failed because the socket is not yet connected and the TCP state is not yet correct for a connected socket. However, because of other changes net_startmonitor(0 no returns a failure condition that causes worse problems when trying to connect. The fix is to move the logic that starts the network monitor to AFTER the socket has been successfully connected. 2015-05-31 11:35:28 -06:00
Gregory Nutt
a47a0d237c Costmetic changes to networking logic 2015-05-31 10:29:53 -06:00
Gregory Nutt
33085cb309 Networking: The network device list was protected by a re-entrant semaphore. With the recent change to support network device callback, the network stack needs to access the network device list too. Some drivers, however, run the network stack from the interrupt level -- this is bad but a fact in the current state. Of course,those drivers are unable to take the semaphore and will assert.
The solution here is to eliminate the device devices semaphore altogether.  This eliminates netdev_semtake() and netdev_semgive() and replaces them with net_lock() and net_unlock() which have larger scope as needed for this purpose.
2015-05-31 08:34:03 -06:00
Gregory Nutt
6687e156e6 Revamp last change. IFF_UP only required when allocating callback, not freeing. 2015-05-30 21:13:58 -06:00