Commit Graph

231 Commits

Author SHA1 Message Date
Gregory Nutt
68584aa6eb arch/arm/src/tiva/hardware: Add ADI 3 REFSYS header file. 2019-01-13 10:10:00 -06:00
Anthony Merlino
f4ae71be70 Merged in antmerlino/nuttx/sixlowpan-input-fix (pull request #812)
net/sixlowpan: sixlowpan_input should always return 0 if the incoming frame was consumed.

Approved-by: GregoryN <gnutt@nuttx.org>
2019-01-13 14:26:00 +00:00
Gregory Nutt
c4dfb76b0d Fix some warnings found in build testing. 2018-12-30 16:05:28 -06:00
Anthony Merlino
5e1055dbfa Merged in antmerlino/nuttx/sixlowpan-d_buf-fix (pull request #795)
net/sixlowpan: Record and restore d_buf on entry/exit of sixlowpan_input. This avoids an issue where d_buf gets set to NULL by sixlowpan, and then is used by forwarding logic from another network interface before getting set back to the drivers internal b

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-26 16:33:44 +00:00
Anthony Merlino
33a4ec969a Merged in antmerlino/nuttx/avoid-double-context-lookup (pull request #788)
sixlowpan: Address comment regarding avoiding double lookup of address context.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-19 18:41:27 +00:00
Anthony Merlino
c897790e55 Merged in antmerlino/nuttx/sixlowpan-ieee802154-address-endianness (pull request #790)
sixlowpan/ieee802154: IEEE802.15.4 stores and uses addresses in little endian order.

# Conflicts:
#	drivers/wireless/ieee802154/xbee/xbee_netdev.c

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-18 15:06:41 +00:00
Anthony Merlino
b48a62a7d4 Merged in antmerlino/nuttx/sixlowpan-ul-bit (pull request #787)
sixlowpan: Fixes logic surrounding the Universal/Local bit. This bit represents whether the IID is locally/globally administered. The U/L bit is bit 1 of the MSB of the EUI-64. It should only be inverted in cases where there is a full EUI-64. In cases whe

* sixlowpan: Fixes logic surrounding the Universal/Local bit. This bit represents whether the IID is locally/globally administered. The U/L bit is bit 1 of the MSB of the EUI-64. It should only be inverted in cases where there is a full EUI-64. In cases where the IID is derived from say, a short address, this bit should be forced to 0, indicating that it is locally administered.

    See:

    https://tools.ietf.org/html/rfc4291#section-2.5.1
    https://tools.ietf.org/html/rfc4944#section-6
    https://tools.ietf.org/html/rfc2464#section-4

* sixlowpan: Account for endianness with U/L bit.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-18 13:34:41 +00:00
Anthony Merlino
35232d4997 Merged in antmerlino/nuttx/uncompress-addr-fix (pull request #786)
net/sixlowpan: Fixes decompression of ipaddr from MAC address. The logic used to populate the IP from the radio address should match sixlowpan_ipfromsaddr/sixlowpan_ipfromeaddr

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-16 21:39:40 +00:00
Anthony Merlino
67c609e343 Merged in antmerlino/nuttx/big-endian (pull request #784)
Fixes usage of CONFIG_BIG_ENDIAN; should be CONFIG_ENDIAN_BIG

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-16 20:33:54 +00:00
Gregory Nutt
88130a996a net/: Fixes for more coding standard issues detected by nxstyle. 2018-10-29 18:00:30 -06:00
Gregory Nutt
7d2b250cbc net/netdev: All utility functions that lookup network devices should begin with netdev_findby_. Also correct some comments and the name of a formal parameter. 2018-10-29 12:21:22 -06:00
Anthony Merlino
ad887ec34c Merged in antmerlino/nuttx/sixlowpan-warning (pull request #744)
net/sixlowpan/sixlowpan_hc06.c: Fixes warning introduced by recent changes to uncompress_addr.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-10-29 15:05:58 +00:00
Anthony Merlino
1adfef8113 Merged in antmerlino/nuttx/sixlowpan-mcast-uncompress (pull request #738)
net/sixlowpan: Fixes bug in uncompress_addr handling of odd postfix.

This affected multicast compress/uncompress since it's the only logic that used an odd postfix. The odd byte needs to be handled first, not last.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-10-27 18:07:47 +00:00
Gregory Nutt
9546481054 Fix some typographical errors. 2018-09-14 06:55:45 -06:00
Alan Carvalho de Assis
283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt
427b3b8fcb Squashed commit of the following:
net/utils:  return from net_breaklock() was being clobbered.
    net/:  Replace all calls to iob_alloc() with calls to net_ioballoc() which will release the network lock, if necessary.
    net/utils, tcp, include/net:  Separate out the special IOB allocation logic and place it in its own function.  Prototype is available in a public header file where it can also be used by network drivers.
    net/utils: net_timedwait() now uses new net_breaklock() and net_restorelock().
2018-07-07 08:26:13 -06:00
Gregory Nutt
e1f8b3ff3b Update some help comments in two Kconfig files. 2018-07-04 15:36:31 -06:00
Gregory Nutt
22cd0d47fa This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile.  People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header).  A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length.  Instead, we define the packet buffer size then derive the MTU.

The MTU is not common currency in networking.  On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP).  Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes.  So we should be all good and without the recurring 14 byte error in MTU's and MSS's.

Squashed commit of the following:

    Trivial update to fix some spacing issues.
    net/: Rename several macros containing _MTU to _PKTSIZE.
    net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE.  This is not the MTU which does not include the size of the link layer header.  This is the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename the file d_mtu in the network driver structure to d_pktsize.  That value saved there is not the MTU.  The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header.  The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt
3e9ba72441 net/sixlowpan: Fix typo uint16->uint16_t. Also picks up some cosmetic USB host changes. 2018-07-01 10:05:15 -06:00
Gregory Nutt
e59b26370d Squashed commit of the following:
Fix a few typo/compilation problems.
    net/:  Remove all CONFIG_NET_xxx_TCP_RECVWNDO configuration variables.  They were used only to initialize the d_recwndo of the network device structure which no longer exists.
    net/:  Remove the device TCP receive window field (d_recvwndo) from the device structure.  That value is no longer retained, but is calculated dynamically.
    Remove some dangling references to CONFIG_NET_TCP_RWND_CONTROL.
    net/tcp:  Take read-ahead throttling into account when calculating the TCP receive window size.
    net/tcp: tcp_get_recvwindow() now returns the receive window size directly (vs. indirectly via the device structure).
    net/tcp:  Remove CONFIG_NET_TCP_RWND_CONTROL.  TCP window algorithm is now trigged only by CONFIG_NET_TCP_READAHEAD.
2018-07-01 07:59:33 -06:00
Gregory Nutt
b32d8b1714 net/tcp and sixlowpan: Separate the the TCP receive window calculations to a separate header file. It must also be used by the special 6LoWPAN TCP logic. 2018-06-30 20:50:07 -06:00
Gregory Nutt
1acfac3eb6 net/: More fixes to wrong comments from old change from the interrupt driven network to the work-queue driven network. 2018-06-23 15:03:01 -06:00
Gregory Nutt
aabdc00e8c net/: Fix some incorrect comments that go back for years (but have also been cloned in newer files). The network was once interrupt driver, but now runs on the work queue with a semaphore to enforce mutual exclusion. 2018-06-23 14:09:06 -06:00
Gregory Nutt
a0e169ad7b net/: Fix a sixlowpan typo bug recently introduced; Rename g_ipv6_allzeroaddre with the more meaning g_ipv6_unspecaddr since the all-zero address is the IPv6 unspecified address (sometime IN6_ADDR_ANY). Remove more inline tests for IPv6 multicast with tcommint net_is_addr_mcast() macro. Update some comments. 2018-06-23 12:53:27 -06:00
Gregory Nutt
5bb216fb90 net/: There are many different checks for IPv6 multicast addresses. Most of the checks are different. RFC 3513 clearly specifies how to detect an IPv6 multilcast address: they should begin with 0xffxx. I did not change some of the checks in ipv6_input.c, however. In that file, the comments indicate that the code should only pick of certain mulicast address that begin withi 0xff02. 2018-06-23 10:13:38 -06:00
Gregory Nutt
8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Anthony Merlino
5e2d7c227d net/sixlowpan: TCP send should have PSH and ACK flags set when sending. This matches the standard network (Ethernet) TCP send logic. 2018-05-17 06:45:46 -06:00
Anthony Merlino
19ebdb4ef9 Merged in antmerlino/nuttx/sixlowpan_hc06_fix (pull request #644)
sixlowpan: Preserve big-endian (network order) when uncompressing address.

This change is the counterpart to another recent endianness fix that occurred on compression of the ip address.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-15 17:32:40 +00:00
Gregory Nutt
d93b22d042 net/sixlowpan: Fix a nasty, byte-ordering/endian-ness problem. The root cause has been found and corrected. And a half dozen or so bandaid fixes were reverted. 2018-04-17 15:34:12 -06:00
Gregory Nutt
5fc2f7a36c net/sixlowpan: Simplify redundant check in the previous commit. If fullmac == true, then we must also have usemac == true and so checking usemac in that context is redundant. 2018-04-16 10:33:35 -06:00
Gregory Nutt
9ddce0b324 net/sixlowpan: Grrr.. got conditional logic reversed in the last commit 2018-04-16 08:02:42 -06:00
Gregory Nutt
12002d1604 net/sixlowpan: When uncompressing link local addresses, the source of the address matters. Apparently address by byte reversed in IP addresses. But if the source of the address is the locally assigned address, bytes are not reversed. 2018-04-16 07:34:02 -06:00
Gregory Nutt
06aee06a8d Revert "net/sixlowpan: Fix a constant value used in IPv6 address decompression. The 0x0200 value used in the address modification should be in network order."
This reverts commit e8832be8f1.
2018-04-16 06:40:10 -06:00
Gregory Nutt
e8832be8f1 net/sixlowpan: Fix a constant value used in IPv6 address decompression. The 0x0200 value used in the address modification should be in network order. 2018-04-13 08:17:25 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Anthony Merlino
cc536ba606 Merged in antmerlino/nuttx/sixlowpan-address-context (pull request #553)
sixlowpan: Completes configuration options for specifying preloaded address contexts for compression

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-07 19:42:40 +00:00
Anthony Merlino
919841a383 sixlowpan: Fixes build error introduced by recent PR when routing table is enabled. 2017-11-22 17:16:54 -05:00
Anthony Merlino
827fa6796e Merged in antmerlino/nuttx/sixlowpan-route (pull request #537)
sixlowpan: Support sending to a router that is on-link and may be able to forward the packet for us if the destination is not reachable directly

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-22 18:10:39 +00:00
Anthony Merlino
a645b18860 net/sixlowpan: Add htohs() in arguments to debug statements that print IP addresses so that they are all shown in friendlier host order 2017-11-21 11:01:11 -06:00
Anthony Merlino
35a54d7a1e net/sixlowpan: The logic that extracts interface identifier from the IP address needs to be generalized to handle cases where the address is not a link local address. 2017-11-20 14:36:21 -06:00
Anthony Merlino
003a37e37f net/sixlowpan: Fix an endian-ness problem in 6LoWPAN address decompression. 2017-11-20 14:31:57 -06:00
Anthony Merlino
14fb37c995 Merged in antmerlino/nuttx/sixlowpan-mac802154 (pull request #526)
ieee802154: Simplifies notify() and rxframe() calls to a single notify() call. dataind's and all other "notifs" are now "primitives" which aligns with standard terminology

* mac802154: Adds missing breaks from case statement

* sixlowpan: Fixes bad logic where ACK is not requested if address is not a broadcast

* ieee802154: Simplification of "notifs" and "datainds" to generic primitives passed via a single notify call to the layer above the MAC

* Directories.mk should reference CONFIG_WIRELESS instead of CONFIG_DRIVERS_WIRELESS

* xbee_netdev: Network must be locked when calling sixlowpan_input

* sixlowpan: Reassembly buffer can't be freed if provided by radio driver

* sixlowpan: Don't free IOB if there is an error processing it as the MAC will try to pass it along to another receiver

* ieee802154: Adds basic logging to ieee802154_primitive.c

* Minor fixes after rebase

* xbee: Adds AT query timeout to retry if XBee doesn't respond to request

* same70-xplained: Adds Xbee support. Makes mikroBus slot Kconfig 'choice'

* mac802154: Removes unused function declaration

* drivers/mrf24j40: Fixes compilation error using . operator rather than -> operator

* mac802154_device: Changes a few mac802154_primtive_free's to ieee802154_primitive_free() and changes notif to primitive in a couple places.

* mac802154: Adds promiscous mode logic to bypass parsing of incoming frames. MAC char device also checks for promiscous mode and passes whole frames including header and FCS to the application if promiscous mode is enabled.

* sixlowpan: Fixes logic to correctly check if packet is large enough to include header.  This would cause packets to be considered too small when they are sufficiently sized.

* sixlowpan: Fixes forwarding logic to use forwarding device rather than received device to look up destination link layer address

* net/ipforward: Fixes typo that caused build error when IP forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well.

* configs/same70-xplained: Simple spelling fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-01 20:15:21 +00:00
Gregory Nutt
9e73216bf2 net/tcp: Same change to tcp_send_buffered.c probably also applies to sixlowpan_tcpsend.c and inet_recvfrom.c 2017-10-19 16:45:00 -06:00
Gregory Nutt
5907d3c6b6 The nx example no longer supports single user mode. 2017-10-14 10:54:38 -06:00
Gregory Nutt
2dab490cee 6LoWPAN: Fix a whole in the logic of the previous commit. It turns out that g_uncomp_hdrlen has other usages so it cannot be modified as I was doing. Instead, I needed to add a separate localt variable, protosize, to keep track of the two usages of g_uncomp_hdrlen. 2017-10-13 13:31:53 -06:00
Gregory Nutt
53c0938b53 6LoWPAN: Correct a bug in handling uncompressed frames (IPv6 dispatch) 2017-10-13 11:07:43 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt
6a6bf1b62f :Remove CONFIG_NET_6LOWPAN_FRAMELEN. In this case where multiple radios are support3d, this may not be a constant. 6LoWPAN now always queries the driver to get the maximum frame length. 2017-09-10 11:40:54 -06:00
Gregory Nutt
c217c663ae 6LoWPAN: Remove the option to disable fragmentation support. Two reasons: (1) First fragementation is always required becaues IPv6 requires an MTU of 1280 bytes. The is no application use case that can work without fragmentation support. And (2) it greatly reduces the complexity of the code. 2017-09-10 10:49:27 -06:00