Commit graph

99014 commits

Author SHA1 Message Date
Tomasz Bursztyka
ab32634b51 net: ieee802154: Add debug output to radio strategy drivers
Change-Id: Iffd628c0ae8b472f93f2f24a187b3fc6e563c6e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
d4b429d176 net: ieee802154: Limit MAC command frame generation to RFD
ORFD level does not need it.

Change-Id: Ie70d0df56b9c7365e265cce7cbe53807132ea4cc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
8e3750a07d net: ieee802154: MAC command frames needs a buffer from tx pool
Such frame is going to be sent.

Change-Id: Ia5dd8b1427ebb609633522e7c94933c1a0be5b61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
476d1d33dc net: ieee802154: Fix a small indentation issue
Change-Id: Ief85662c4355f0cd03b08f23bfcea535a70a101d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Tomasz Bursztyka
3e23b2b824 samples: ieee802154: L2 debug Kconfig option has changed
Change-Id: I81e23038947e9423b38391943298b67c83a7a221
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Paul Sokolovsky
ad064e1434 eth: ksdk: Protect Ethernet frame buffer operations with IRQ lock.
As there's a single intermediate frame buffer used by both RX and TX
routines, protect operations on it with irq_lock() to avoid possibility
that it will be concurrently modified.

Change-Id: Ibbaf882a15fbb193054dbb13ae848becf9deef3f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:41:01 +02:00
Sergio Rodriguez
0b56b4066f samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app on Arduino 101.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using mbedTLS,
native IP stack and the enc28j60 SPI Ethernet Driver

Change-Id: I658c3d9a54cfdd164a4147903125400f223c6e0a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:01 +02:00
Paul Sokolovsky
8b1769a923 eth: ksdk: Update driver for native IP stack.
This updates driver for Kinetis SDK Ethernet device (used for example
by BOARD=frdm_k64f) to work with native Zephyr IP stack driver model.
The conversion is done based on the template of eth_enc28j60.c.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ifb0c7d3f921d663d00a2ded89ecdf2336b6e3783
2016-12-02 12:41:01 +02:00
Jukka Rissanen
750a93df40 net: Fix IPv6 address debug print
The allocated space for IPv6 string was too short by 10 chars
which meant that full IPv6 address was not printed correctly.

Change-Id: I9c7f3f118f486f88e769aaadf09d100a1d4fd6bc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
d6540e8517 net: rpl: Add IPv6 RPL option handling
If the RPL is not compiled in, then skip all the RPL IPv6
options that are unknown. This way it is possible to have
non-RPL device in the network even if the IPv6 packets contain
RPL options.

Change-Id: Iff24078f48cd9fe5803355974fac0beb0a7a9e15
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
c15b467d42 net: tests: Send IPv6 hop-by-hop option to IP stack
Added a test to send HBH option to IP stack. Currently
the test will always pass, activate some more debugging
to see what the IP stack is doing with the option.

Change-Id: Id0ab1590eb8216f5f67c4d43ce2e882186334198
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:01 +02:00
Jukka Rissanen
bc5bcdd843 net: Add HBHO IPv6 extension handling support
Add IPv6 Hop-by-hop option handling.

Change-Id: Iaf28666df18f733e8f475b90e002b86cd3b4e7e4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
010b7c8eda net: Add extra parameter to ICMPv6 error API
Some errors need extra data to be sent to peer.

Change-Id: I142e86d0b21141498148b59f285152fbb51a84ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
057331971c net: Add IPv6 extension option defines
Change-Id: I74c2e60e73a20c283434e94a39e2676045a23275
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
5c79f01181 net: nbuf: Add function to add stuff to IPv6 extension map
Utility function that can add option bits to IPv6 option bitmap.

Change-Id: Ia10d27c201556fb960a736590788b791a7e3c018
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
b9765cc43e net: Add more ICMPv6 option definitions
Change-Id: Iae4abd6b9ddcf6a862d772c9b58554bb5b7b2cd3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
cd4365de9a net: Add IPv6 routing support
Route IPv6 packets properly.

Change-Id: I349d4fcbae5624baa912a77da59d6814eb2ab6b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
dffafbd290 net: tests: Unit tests for RPL
Change-Id: I5c2c4dd4eb8a8af77bd0d8db06b09a25871893b3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
de43aaca54 net: rpl: Objective Function Zero support
Support for Objective Function Zero,
see RFC 6552 for details.

Change-Id: I5e976fdc7e087b3b65005884e05a28fb3e35c257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
47b535c2ee net: rpl: MRH Objective Function support
Support for Minimum Rank with Hysteresis,
see RFC 6719 for details.

Change-Id: Ie3019e8516bba516d3bc55f6325288d738e26588
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
98404b175c net: rpl: Initial commit
RPL implementation taken from net/ip/contiki/rpl and
ported to use the new stack.

Origin: Contiki

Change-Id: I479d9dd143b763f90cb7915806fd7e9faea0300c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
13dd72a593 net: Add helpers to get network interface IPv6 addresses
Add utilities to return network interface link local and
global IPv6 addresses.

Change-Id: I54d0ec28410b9ad4ad7068a887bfa6706453159c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
d4c910ec9f net: Add IPv6 extension header type values to net_ip.h
Change-Id: I1925d4a894675b503b033b78e7b717a8993ec331
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
fa801d5b19 net: Add helper to find default IPv6 router
Go through the router list and return the default router
where to send the network packet.

Change-Id: I87e5118b03352b7d11e1fde800d1530e5929ebab
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
865d82dfe1 net: Add helper to check if the IPv6 address is part out subnet
Helper checks if the IPv6 address belongs to one of the subnets
defined for network interfaces.

Change-Id: I0e88ebe5014a514404b589e32cc71590950a39c7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:00 +02:00
Jukka Rissanen
29e9621c50 net: Add utility to go through all network interfaces
Change-Id: I0a9dabf3585fb3813b806238f6e5049c2646890d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
a679403888 net: Get IPv6 neighbor by using index
Add utility function to return IPv6 neighbor from
link layer index.

Change-Id: Icb3c6400c0bc115a10fec278878957d398676cb3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
5ca1df30d2 net: Neighbor cache did not link ll address properly
If the neighbor cache already contains neighbor with the same
link layer address, then just increase ref count instead of
creating a new entry.

Change-Id: I00d9b6febc126973f658051d7aaa6036d37e9fdd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
039bcc3d65 net: Add function to traverse through IPv6 routes
Needed in RPL.

Change-Id: Iee3fd71de5aec4f64d76ef70563708531696829b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
abca88b63f net: IPv6 neighbor debug prints enhanced
Printing now the neighbor lladdr index when applicable.

Change-Id: I9d6bd0557636fe09d7ef894cc08c793bce9ccf06
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
fa76b6a1fa net: Add multicast route API support
Change-Id: I8e05aa534f6b6d6586ffee4878217db35668adba
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
41fa0c02df net: Add func that checks if address is global multicast one
Change-Id: If40e8833f8b08c0b066650a2c680771ad0cdc252
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
8420709a7c net: route: Add function to remove route by nexthop
This net_route_del_by_nexthop_data() variant will also match
routing protocol specific data.

Change-Id: I608b27ede3a95c7048b16278209072f0b21a260d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
88ae57f5cc net: Add utility function to return neighbor by index
Added net_ipv6_get_nbr_by_index(uint8_t idx) function which
will return IPv6 neighbor entry according to given link
layer index.

Change-Id: I36d61730815d9077ae74d282d686397db1d7cc6b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
4e70771a9d net: Call context send cb when packet has been really sent
If the L2 layer discards the network packet, we call context
send callback. If the L2 accepts the packet, then this callback
should not be called yet. After the packet is really sent by
the network driver, we inform the final status to network
context handler.

Change-Id: I63c734b8506aae198b62616e8f6f0dbb430f6bcd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
8aac3ed390 net: Add support for link cb in net_if
The other part of the stack can register a handler that is
called after the network packet has been sent. This callback
is used by RPL routing code.

Change-Id: I6b76c5f01d1f6706b0c0a56980ad50e1b85fc427
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
b6022564fa net: Moved IPv6 neighbor information struct to ipv6.h file
The IPv6 neighbor information is needed in RPL so we need to
make the neighbor struct public in order to access is from
RPL code.

Change-Id: I71c7144af912209405de2b4457f3be63ab9aea68
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
857b79f55e net: Add API to set the IPv6 reachable timer
Change-Id: I3879aff078904535f18edb7f9db32b8a9882a557
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
b145ba1e83 net: Make neighbor add function available
The neighbor add function is needed in RPL.

Change-Id: Id20a6650b838d1ac4b0c1f3572f232eff4c2f18b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:59 +02:00
Jukka Rissanen
ade71827ff net: Add utility function to routing to return neighbor entry
We need a way to get neighbor entry (nbr) from routing entry.

Change-Id: I8438e61c7e63db26056b046bd05401beca9731e0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:58 +02:00
Jukka Rissanen
cac9d1b3cf net: Add support for embedding extra data to routing entries
This can be used to store routing protocol specific data
into neighbor entry. By default no extra data is allocated.

Change-Id: Iabff0a1df676398a47b86adbc398c4f566dcc40a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:58 +02:00
Jukka Rissanen
14e73e73c3 net: Make DEBUG config option naming consistent
Some of the DEBUG config options had _DEBUG string at the
end of the config option. This is inconsistent with the
rest of the networking stack debug options where the _DEBUG
is located in the middle of the option like this
CONFIG_NET_DEBUG_....

Change-Id: I8542079f9a88631e98b417fd6c62d2db48aa9bdf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:58 +02:00
Andy Ross
3604b2c954 net: tcp: Properly ACK received TCP data
Parse and validate the sequence number and send the ACK synchronously
in the tcp_established() callback.  No attempt is made to unify the
packet with any queued data (which isn't queued yet, but might be
someday).

Note that this requires that an accepted context clone over the
sequence numbers from the listening context (which received them
during the SYN).

(Note also that this exposes a bug in the current SYN handling:
there's only space for one set of sequence numbers on that listening
context, so if we get two SYNs before the round trip ACK arrives we'll
"accept" the wrong connection with garbage sequence numbers and both
connections will fail).

Change-Id: I129e2a4cd926385511a1d22eea6d4f19ff185501
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-12-02 12:40:58 +02:00
Andy Ross
c0a48102b5 net: tcp: Fix flag goof in net_tcp_alloc()
My previous race cleanup missed the fact that the memset would end up
clearing the IN_USE flag!  So we were always allocating the same
struct net_tcp (which, because the typical use is to listen on one
socket and then transfer on an accepted socket, almost kinda worked
for a lot of stuff, making this hard to find).

Change-Id: I8ca0c7f835ebd72271df10d03004f38f8b8efbd5
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-12-02 12:40:58 +02:00
Sergio Rodriguez
20424d5cc6 enc28j60: Fixes change to proper register bank
The register being set before checking the count of the remaining
packets is incorrect, so this code fixes it by setting the proper
register bank before access

Jira: ZEP-1138

Change-Id: Id49ee8439665ff69786f22e13e0d94a2148e4ae7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz
9f1a656511 enc28j60: Fixes an issue with concurrent tx and rx
The ENC28J60 hardware module does not support concurrent
transmission and reception.
This fix adds a control semaphore to exclude the execution
of both processes.

Applies the equivalent changes to the legacy driver.

Jira: ZEP-1097

Change-Id: I9602195d5a97f8d4bf652753c284d61f192357fe
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz
d0cf3deb96 enc28j60: Improves interface with native IP stack
Tranmission:  Consider that fragments are no adjacent.

Reception:    Consider receiving data in more than one fragment.

SPI routines: Align SPI fragment size with default buffer fragment
              size (128 bytes) for better performance.

Change-Id: I51fc25d8540c36f3719e617a6f33cdea3f63032c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz
39779184ad enc28j60: Fixes a reception issue for big frames.
Everytime the devices receives a frame with odd length it will
add an extra byte of padding to the reception buffer.

This was causing and issue when receiving frames above 64 bytes
length and with odd length.

This commit pops the extra padding byte everytime the received
frame has an odd length.

The equivalent fix is applied to the legacy driver.

Jira: ZEP-1098

Change-Id: Ib93cbcdcf11f3812961b6702f1b7fa621590aab2
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz
a8bb46f0ec enc28j60: Fixes an issue reading/writing from spi
When the driver receives or transmits a frames with a length
that is multiple of MAX_BUFFER_LENGTH the last block would be
read/sent twice to spi because a missed calculation on
num_remaining.

The issue is fixed by controling when the remaining bytes are
written/read into the spi device and by setting the spi command
on each spi write/read attempt.

The fix is applied to the legacy driver as well.

Jira: ZEP-1098

Change-Id: Icb2195d74e34dcbcf0c70531da9886ca315bd78b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz
f63f2f4b97 enc28j60: The MAX_BUFFER_LENGTH is now declared in header.
The MAX_BUFFER_LENGTH symbols is now declared in the
eth_ecn28j60_priv.h file.

The legacy driver does not need this declaration here anymore.

Change-Id: I396fe92dbf5679c64183e25fa8b8d342c7f30dae
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00