Commit graph

41120 commits

Author SHA1 Message Date
Tomasz Bursztyka
6b0732f632 net: drivers: Normalize ieee802154 Kconfig
Indent with tabs, no spaces.

Change-Id: Idee4167039964c253cf280cced787b05873f2780
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
73d8c7c443 net: drivers: cc2520 ieee802154 drivers select relevant options
If no IP stack is seleceted, selecting one of the 2 cc2520 driver will
automatically select the relevant stack.

Change-Id: Icca22da190dc790ce6d302e14c45732f902e02ae
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
becf74743b net: Split debug Kconfig options from legacy to new stack
- new stack options are renamed and placed in their respective menus
- new stack Kconfig gets normalized (tabs vs spaces, etc...)

Change-Id: Ia68f6589fed464bbdd76dc0812775684b2f94a58
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
03923eee88 net: Normalize Kconfig and fix it
- tabs are use to indent, no spaces.
- NET_TCP should be defined as an option, though non-promptable for now

Change-Id: I9c5e55e1ab5c82c906fb5650f5d1539c65de1194
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
252acf2ab5 net: Move IPv4 related Kconfig options to its own file
As option list will grow, it will be saner to put them there instead of
growing the base Kconfig.

Change-Id: I72199d1d452986ed7a08d9bb3d1139f49622ec59
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
9d872f43f9 net: Move IPv6 related Kconfig options to its own file
As option list will grow, it will be saner to put them there instead of
growing the base Kconfig.

Change-Id: I610c47540e4fd6784b70198986813b737a38165c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
145c78c4c5 net: Legacy IP stack Kconfig has nothing to do with new stack
Some old left over, was generating hard to spot errors on some other
places (mostly 'choice' related warnings).

Change-Id: I2ce2b27c8ab2703208a74dd852c0f0a7bcbeaa41
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
aaf5075372 net: Add a macro to create specific net if instances
This will be necessary for devices that require to instanciate more than
one network interface.

Change-Id: I01fd4eb220ed63a4fe073614fb2a132cd00c6bc8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
58a7ada44c net: Add network address length to user API
Add socklen_t addrlen parameter to net_context_bind(),
net_context_sendto() and accept callback.

Currently the address length option is not really mandatory
as we can figure out the length from the address family.
But if we are going to support other protocol address families
it might be needed.

Change-Id: I59206465c3259050c469c5b2150221646a9a08d7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
103a98d173 net: tests: Fix printf modifiers in new IP stack unit tests
Because of printk fixes in master, some of the networking
unit tests will fail in next merge.

Change-Id: I3e28aae72c0c10b402b78c0f406ecb3513b967a7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:23 +02:00
Tomasz Bursztyka
b283640f10 net: drivers: ieee802154: sys_log is needed on legacy driver
Or the build will not go through.

Change-Id: I48f5f8661c4100a76e4624ea64d383055327e2a7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:23 +02:00
Vinicius Costa Gomes
9d146adf9a drivers/slip: Fix warnings when TAP support is disabled
When only the dummy frame format is enabled, some variables are left
unused, causing some warnings.

Change-Id: Ic7bc5560a9fcb573e715c2cc29f308cec5214f64
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:23 +02:00
Vinicius Costa Gomes
87eafd5fd7 net: Fix listening on IPv6 ports
When an IPv6 adress is specified, the port specified in the local
address is ignored.

Change-Id: I1df865c00b9b052e353a9d6fab4bf1152567efd5
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:23 +02:00
Johan Hedberg
35c24140f8 net: buf: Fix minor typo in documentation
Change-Id: I19869683c5dde8ef88ddfdfb1e0656a8b824ffdd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-02 12:40:23 +02:00
Paul Sokolovsky
5d7be031f3 net: samples: Fix the echo-server IPv4 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv4 address to be 192.0.2.2. The host
IPv4 address should be set to 192.0.2.1 in this case. This change
is similar to IPv6 address change made earlier (now both IPv4 and
IPv6 addresses on device side end with "2", on host side, with "1").

Change-Id: I639b7be4403b4b2f38f01675d0ef56eaabf0f82c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
5b40f871ff net: Do not try to use net_if.h in legacy uIP stack
The net_if.h is only meant for new IP stack.

Change-Id: I133d576d7c070dd4a2291544bd0b0401bda942b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:23 +02:00
Andrei Emeltchenko
295b68d90c net: Fix documentation errors in net_if header file
Change-Id: I66ae70040e7ea65b6b72b9736fe384db02f23581
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
2ed5f4d6d9 net: Add more items to TODO
Adding IP services support entries, documentation enhancements,
testing entries and IPv6 basic support entries.

Change-Id: If443ecaabf6bc8ca92f17eff67da9d9e8f7c797f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:23 +02:00
Ravi kumar Veeramally
c3852b65e6 net: Add TODO items for 6LoWPAN
Change-Id: I6f95f57a4578bd12cf3822f957727b04358669d9
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:23 +02:00
Ravi kumar Veeramally
0d76826a0d net: tests: Extented 6lo unit tests
Earlier all unit tests are with IPv6 and UDP as next header.
Modified tests with IPv6 only, IPv6 + UDP and IPv6 + IPHC next
headers.

Change-Id: Ie02cecb37e07ceae8a06a0653e2ccdfe0db91239
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:23 +02:00
Tomasz Bursztyka
b56c4df869 sanitycheck: Add support for section net_l2_data
We missed that section, so sanitycheck was failing.
Also putting the right section in the relevant array.

Change-Id: I361ffa1707c01f0d3c870a7bc36a86ada66af1d2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:23 +02:00
Tomasz Bursztyka
1975c1d1e7 net: Add TODO items for L2 and 802.15.4
Change-Id: Ie02cecb37e06cfae8a06a0653e2ccdfe0db9fd89
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
5665dac4de net: TODO file for networking
Please collect things to do into this document.

Change-Id: I763cd0e3f6ec6b447b5d9efbebcb56f7b50cecc6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
2eb01fe191 net: tests: Enable unit tests for the new IP stack
We are not just checking the test build but this time
the tests are also run.

Change-Id: I7b0b24c51dfc2dc58f290cca7a593be431b8077f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
9231f41f52 net: samples: Fix the echo-server IPv6 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv6 address to be 2001:db8::2.
The host IPv6 address should be set to 2001:db8::1 in this case.

Change-Id: Ia967cecabece4b06a2f5a12b11c68a9de4aeb2af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
0be446ba5f net: samples: Fix slip config for echo-server and echo-client
The prj_slip.conf file should be used for qemu-to-host
communication only. It is not usable for testing between
two qemus.

Change-Id: Id06813a1b36f33f585e06df3f29479891ea3d2d8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
a7ef4702f4 net: Clarify the CONFIG_NET_TESTING setting
As the CONFIG_NET_TESTING option should be only enabled
if we have Qemu-to-Qemu communication, clearly tell this
in the Kconfig help for that option.

Change-Id: Id1c65d17fb9859ead767294b2f43dd7b57b007ac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
6258dc8e87 net: samples: Fix the location of net-tools project files
Fix the correct location of net-tools project files to
samples/net/README file so that the user can test the
echo-server and echo-client apps using SLIP and Qemu.

Change-Id: Ic34fa6e67da916c63e4f138e1e0def5d7632c80c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
3e0c1ff876 drivers: cc2520: Raise Rx stack size
640 bytes seems too short, raising to 800 bytes.

Change-Id: I8c3418787939369e24fe47c23b0558c36f05af2c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
b84e62f269 samples: Build ieee802154 sample with 6lo support
Debugging messages in 6lo are enabled as well.

Change-Id: I8fea044216e3c4e60d742ebc7256489832ae09ac
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
6e1fc655a2 net: Add packet display in ieee802154 l2 stack
Only meant to be used while debugging deeply. Thus needs to be enabled
by hand in the source code.

Change-Id: Idf4e33154fee0e3d7e1da64708e1c7b4d790d790
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
ddbc7165f6 net: Integrate 6lo compression support in IEEE 802.15.4 L2 stack
Packet is compressed after its ll part has been computed when sending.
And it is then decompressed after the ll part has been validated when
receiving.

Change-Id: Ifebbd5727623e94f1c2273f2211ba0f109ac4a8f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
f961ad6a49 net: ieee802154: Handle plain/compressed ll addr
Buf ll addr need to point to the right place, depending whether it's a
plain address field (thus with the pan ID) or not.

Change-Id: I9897b1f9bec0f7cecd01517c69c3bdefe2bc204b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
bf479b326e net: Add more debugging messages to 6lo
Change-Id: I8c5d19a0ecd23235e9d936340cfde2cf0edd98b0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
9dae18a11b net: 6lo: Grab uncompressed header type relevantly
When there is no compressed header following IPv6 one,
the type of such header is set after tc/flow information.
Using it relevantly to set IPv6 nexthdr field.

Change-Id: I78d5ae8b8377f9bed6b682fa070f2b5fe28dd3ee
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
62aa5bece0 net: 6lo uncompression should continue to proceed after src addr
This is a minor fix where it has to continue decompressing the
header instead of ending it after getting src address.

Change-Id: Ice46ec62b8de07927624b275c2a98158d37316fb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
1896f017d7 net: Add debug print on IPv6 preliminary check
Change-Id: I13ff6a43b26397b7f84cc45ff48de1bb1d097bc9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
55714129cd net: Add debug messages when dropping packets
Also removing a superfluous label.

Change-Id: Ie27e868fe3328162bb3f42312dd2cfcc230aa509
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
11dba2a129 net: Handle ll part in 6lo logic when relevant
The given buffer might have an ll part already filled in, so handling
its content if any.

Also reordering the local variable declaration according to Zephyr's
style.

Change-Id: Iaf9c117d39c90d5f71ca3aad02a52ea9d9b34223
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
b7bb5bd944 net: Built IEEE 802.15.4 fragmentation logic if requested
Fixing as well minor Kconfig issues related to IEEE 802.15.4
fragmentation.

Change-Id: I4edd3db4501563a473b7cdf15da8262b8443c0ac
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
9c62543f62 net: Follow file naming in ieee802154 l2 stack
For consistency as well as for helping when grepping etc.

Change-Id: Ib5e6b3369e510dd2b996f735d801c2b80291ad7f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
78aa33a875 net: Giving uncompressed buffer to 6lo is not an error
If compression header watermark is not found, it will successfully
return as it's not an error. It just means there is not uncompression
work to do.

Using NET_ASSERT() to check the argument validity as well.

Change-Id: I907f3f197d59d7ddb546860d232d6ca20a4445e3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
ba4dda1703 samples: ieee802154: Debugging needs new Kconfig option
Change-Id: Iad9e5b9a2fda5b2c26697239d5437ff8ae75743a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
434ba9311c net: ieee802154: Logging header should be loaded first
net_core.h is loading sys_log.h as well, so we need to be
first in order to setup some local definitions.

Change-Id: Ife482bd21e314aa5a5e88433eb8f9a560f9d53a6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Tomasz Bursztyka
6f7343a154 net: SYS_INIT() routines are never ran twice
No need to control the state of this routine, as this
will be ran only once.

Change-Id: I2f9f04012d793787ba56ef6403f8a92e8e1b073e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Jukka Rissanen
c03028f1f1 net: tests: Test Trickle algorithm
This is only meant for the new IP stack.

Change-Id: I643b0556f87423f09555274749db93397ef66c59
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:21 +02:00
Jukka Rissanen
17d2ab05c8 net: Trickle algorithm implementation
See RFC 6206 for Trickle details.

Change-Id: I709d81eb182f068293cf4b1f1474b2911febc5d4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
a84c40e1ed net: Change NET6LO_ defines to NET_6LO
Change-Id: I2e03cae1e6b785e985cc985c187ccf6cb6ff23c6
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
ae1ce83dd1 net: tests: Add fragmentation unit tests for 802.15.4
Change-Id: I5722f86c00c76921e94f6f2a8e9add8960498107
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00
Ravi kumar Veeramally
fe4a4efe78 net: Add support for IEEE 802.15.4 re-assembly
Reassembly IEEE 802.15.4 fragments as per it's datagram size
and datagram tag. Uncompress IP header fragment as soon as it
arrives. Size matches only after uncompression of IP header with
total length.

Support added for multiple IP packet reception. Default is one full
IP packet at a time. Cache size can be modified via Kconfig option
(NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE).

Note: If you increase the size by 1 means, you should have N number
of data buffers available at max.
e.g. One full IP packet (1280 MTU) needs 15~16 data fragments means,
multiply size by same number of fragments. It requires more memory.

Offset based reassembly yet to be done (fragments can come in any order
[e.g. mesh]). Now assuming that fragments are in right order.

Change-Id: I17baee30a1087eb9ec6dc25f03ed64bbe0df2917
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:21 +02:00