Commit graph

42249 commits

Author SHA1 Message Date
Jukka Rissanen
272c8a62a1 net: yaip: Add IPv4 addresses to network interface
Allow user to assign IPv4 addresses to a network interface.

Change-Id: I77be4ed5eb0231eb12b4ad47cb6076c8f4238124
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:48 +00:00
Jukka Rissanen
eb87a36e44 net: tests: Add IPv6 address manipulation unit tests
Change-Id: Ide3bce35dcfd3ec31bfe3cd842a87ca3b639ba4f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:47 +00:00
Jukka Rissanen
208d558f68 net: yaip: Utilities to set and lookup interface IPv6 addresses
The caller is able to add and lookup network interface IPv6
addresses.

Change-Id: I7f43e18bd1fa69c7dcd2f6b46ad33043c28b92e9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:47 +00:00
Jukka Rissanen
a08376cc32 net: yaip: Add utility functions to check IPv6 addresses
IPv6 utility functions that check if a given IPv6 address
belongs to one of host network interfaces, and whether
the address is a given type.

Change-Id: If251534ae0af41963d45e305e7ba505a940d2fdc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:47 +00:00
Jukka Rissanen
644dc3ba81 net: yaip: Add utility func to return IP address type as a string
This is only used in debugging.

Change-Id: Ie8b1d2540813527131ff489e49975a826b84311c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:46 +00:00
Jukka Rissanen
3308e95b97 net: yaip: Add extension header and bitmap fields to nbuf
These are needed when parsing IPv6 packet.

Change-Id: I56ab93d45727c57f2d9db47baeb5b5a3725a0c46
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:46 +00:00
Jukka Rissanen
e54c565337 net: yaip: Drop received source mcast IPv6 packets
If the source address is multicast, then drop the IPv6 packet.

Change-Id: Ibe733161d67f047469a25a5955c41c335e472945
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:45 +00:00
Jukka Rissanen
d9c3552e00 net: yaip: Receive IPv6 packet
Check if we have received IPv6 packet and call a handler
function to process it.

Change-Id: I1226729685ae2a805128b587e2a37e0016d53ecc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:45 +00:00
Jukka Rissanen
cf673cf585 net: tests: Add unit test for IP and MAC address printing
Change-Id: Ida0901fa9687814932119d006459de12e6a229d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:45 +00:00
Jukka Rissanen
044f40b76c net: yaip: Add debug function to print IP address
Change-Id: I4464f1da6d602b1abba0f385e5afa92d2cb4afc8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:44 +00:00
Jukka Rissanen
abda6faa65 net: yaip: Add debug function to print MAC address
Change-Id: I32ca7a4f005d73be7c8d4d28a7a6fbd19c01dd2e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:44 +00:00
Jukka Rissanen
27dcfc3efd net: yaip: Add statistics gathering support
Collect network statistics if CONFIG_NET_STATISTICS is
defined.

Change-Id: Id217daa3e19142c95396dc391ba2dc4123b18b22
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:43 +00:00
Jukka Rissanen
c43212d63c net: yaip: Add net_context to compilation
Network context defines network endpoints a.k.a sockets.

Change-Id: Ib1fab03f0862b298a441a79a4f4173f18a8260cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:43 +00:00
Jukka Rissanen
5a3834915d net: yaip: Start to receive network packets
Currently all received packets are dropped as this is just
the initial patch enabling the receive support.

Change-Id: Ib06735f498a80edb8c9f7c5ec6f536a5ac1d362a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:42 +00:00
Andrew Boie
50131a3d0e altera_max10: support 'make flash' and 'make debug'
For both of these, we send the .elf binary over the JTAG and it gets
written directly into SRAM. The CPU boots the image from the entry
point (__start).

This does not provision the kernel onto device's User Flash Memory
(UFM). Implementation of this is still in progress see ZEP-273.

Change-Id: Iae8188a21e4a3eecfda0f4f0bb220c0607d719cb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:57 +00:00
Andrew Boie
4eee43d4d4 nios2-qemu: correct system.h
The emulator supports all the integer math instructions and has
the necessary registers for exception debugging.

Change-Id: I55938d9e3a4b9d219f6fee06fe070e860ca71d4b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:55 +00:00
Andrew Boie
0b6c4febf1 nios2: get CPU features from ALT_CPU_* namespace
NIOS2_* namespace is deprecated.

Change-Id: I5a9b07ee33b20aa18509e9d789837f48199ab25d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:53 +00:00
Andrew Boie
865843fe79 qemu_nios2: remove debug options from defconfig
Change-Id: I91f495b5bf12986e4dc16191405e161b1bbc88ba
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:51 +00:00
Andrew Boie
80826decfc nios2: enable XIP by default
Change-Id: I930cbb61cf72de7c68b9a4289554004b4b2f8e21
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:49 +00:00
Andrew Boie
1b6e493bc1 altera_max10: cleanup defconfig
Remove unused defines and turn off debug options.

Change-Id: I21e6b54a81505783396991e165a8087372d4986b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:46 +00:00
Johan Hedberg
08ff2f67a2 net: Fix Kconfig warning
The double include of Kconfig.debug causes the following warning:

scripts/kconfig/conf --silentoldconfig Kconfig
/home/jh/src/zephyr/net/ip/Kconfig.debug:45:warning: choice value used outside its choice group
/home/jh/src/zephyr/net/ip/Kconfig.debug:47:warning: choice value used outside its choice group
/home/jh/src/zephyr/net/ip/Kconfig.debug:49:warning: choice value used outside its choice group

Change-Id: I3f59587eed656b67e1f69e2a8151288f41b50769
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-12 19:26:42 +03:00
Szymon Janc
832b808177 Bluetooth: ATT: Fix using non-ASCII characters
Some non-ASCII characters were used in code comments.

Change-Id: I77f13ca1648f34dc5dbd9ea78ccd2964a73a1712
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-12 15:13:23 +00:00
Johan Hedberg
ce88b0528f net: buf: Add basic documentation for net_buf struct
Change-Id: I93404bcafb72c174a216d3e441c5434a7302c128
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-12 11:39:23 +00:00
Johan Hedberg
40d83b28e6 net: buf: Fix documentation of fragment related API
Ensure that all parameters and return values are properly documented.

Change-Id: I04b19701355e994ba45cbc98167386c01d0f607b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-12 11:35:49 +00:00
Jukka Rissanen
2d7d86bdde net: tests: Temporarily remove nbuf unit test
Tests have issues right now so these will be activated later.

Change-Id: Ib5549f9ed5600a20b2cfddbddcde8e7f7b297eef
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 11:23:04 +00:00
Jaakko Hannikainen
5c657752da net: Yield before sending packets
Using net_receive with long timeouts breaks net_reply. Sending a lot of
packets in a row without yielding causes failures since the network
stack can't send them. Add yield code for both net_reply and net_send.

Jira: ZEP-469
Jira: ZEP-497

Change-Id: Ic59769462e0575da0898d35745d49647f7e43edd
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-07-12 10:48:55 +00:00
Jaakko Hannikainen
8b6be8d773 net: Update ip_buf_len for TCP packets
When handling TCP packets, ip_buf_len is set 4 bytes too big.
Recalculate the value when handling it.

Change-Id: I6502bd58d3860f6318dca668b7b1d6b556d34c2a
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-07-12 10:45:19 +00:00
Jukka Rissanen
26e768cc57 net: yaip: Enable compilation of net_if.c
Change-Id: Icae9d7222b7b41539ff6e4e7d3c8916c5a3ec5f5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:24:13 +00:00
Jukka Rissanen
d7cf956c07 net: yaip: Refactor debug printing in net_if
There is now Kconfig option to enable net_if debugging.
Also use NET_DBG() instead of directly calling syslog macros
so that we can print fiber id automatically.

Change-Id: I150d363006e4be358c38308a93771ba444b0835e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:24:00 +00:00
Jukka Rissanen
6bd7430a34 net: yaip: Start to use logging macros from sys_log.h
Instead of directly calling printk/printf, the network printing
macros will use syslog macros defined in sys_log.h

Change-Id: I3f12f81557f50b24ca47a43f345162f9ffbd574c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:49 +00:00
Jukka Rissanen
b133b01d67 net: yaip: Add send() to net_if API
The send() function is called from IP stack and it is used
when the network packet needs to be send via a specific
network interface.

Change-Id: Id6ce86b1748915fee73b62366dee13fcb7cf11a1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:41 +00:00
Jukka Rissanen
5f8c18fc1b net: yaip: Add Kconfig option for compiling IPv4 support
The YAIP stack uses CONFIG_NET_IPV4 to compile IPv4 support.

Change-Id: Ia4a579591d6d2050e168c35e68546281043d53a8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:33 +00:00
Jukka Rissanen
17ddda8721 net: yaip: Add net_if_get_by_link_addr() util function
This will return the network interface that has some specific
link address.

Change-Id: Iaebcf6e769d4f91f3cda6d3a0779324f89603b54
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:24 +00:00
Jukka Rissanen
9291f82cd9 net: yaip: Execute net_init() automatically
User does not need to call net_init() as it is automatically
called when system is brought up.

Change-Id: I2cb10f4402088a0ca4feff226b65341f337194ea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:16 +00:00
Jukka Rissanen
f2f7bc1c13 net: yaip: Add Kconfig option for compiling IPv6 support
The YAIP stack uses CONFIG_NET_IPV6 to compile IPv6 support.

Change-Id: I25c3b2d6775ed610fca43960a569ddab0ec470aa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:23:05 +00:00
Jukka Rissanen
99a04e263d net: Show only uIP debug options when needed
uIP specific debug options are shown only when uIP is
being compiled.

Change-Id: Ieea5db021227a2b3cbe625a9c774e7c1f99b5e83
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:56 +00:00
Jukka Rissanen
a8aabd8571 net: yaip: Add net_analyze_stack() macro
This macro can be used to check stack usage. It should only
be used when debugging is activated.

Change-Id: I99fe6f9db1f3e955152a91f3a18d031126172cfd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:48 +00:00
Jukka Rissanen
bc24ec86fe net: yaip: Fix compilation error in net_if.h
The NET_IF_INIT() macro used parameter pasting incorrectly.

Change-Id: I40a988ffb06ce135731cd69f18931b7507cd71cc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:40 +00:00
Jukka Rissanen
184e251fdb slip: Add driver for host to qemu connectivity
The SLIP driver is using UART pipe driver to communicate with
host when Zephyr is running in Qemu. Currently this is only
used by networking sub-system when testing the networking
stack.

Change-Id: I432b4136670766a7fc190f146057924c266f9bea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:31 +00:00
Jukka Rissanen
b7bc53ece9 net: yaip: Add nbuf buffer API
User should use the net_nbuf API that is supporting a concept
of RX, TX and DATA buffers, instead of using directly the net_buf
low level API.

Change-Id: I3b8f5f13cd37d42d2322a58b35573e117d520c54
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:24 +00:00
Jukka Rissanen
c630347683 net: yaip: Compile IPv6 and IPv4 address conditionally
Save 12 bytes per IP address if IPv4 is active and IPv6 is not.

Change-Id: Ia01d2feb83e6ba80b2775f9eed3065c956932632
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:14 +00:00
Jukka Rissanen
6c6a3856bc net: yaip: Add function that feeds data to RX fifo
Network drivers should call this when new data has been
received from network.

Change-Id: Ife78fa0683b8c410c38358300a6a18e9325f0ef8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:22:05 +00:00
Jukka Rissanen
5bd0d378f5 net: yaip: Refactored RX fiber init
Change-Id: I2f8a43ac63162844d0df0c1b69dc93837479a91d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:57 +00:00
Jukka Rissanen
5a90d28a72 net: yaip: Add TX fifo to network interface
Network packets to be sent are placed to correct fifo that
is allocated to certain network interface.

Change-Id: Idd5eded42758c5bed2c18769122c38d9d03dc419
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:47 +00:00
Jukka Rissanen
8e3defbe73 net: yaip: Let new IP stack know the debug Kconfig options
Change-Id: I1a549317b3072536a6eddf59fb5912aa3795e02e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:38 +00:00
Jukka Rissanen
61aae6ab27 net: yaip: Add IPv6 prefixes to network interface
Change-Id: I34c75eec6068abbd6af1eac2e178e42ce382b128
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:30 +00:00
Jukka Rissanen
daf4871e36 net: yaip: Add multicast address to network interface
Change-Id: Ifc09d2e1d3ac44ab0f5980ee17299119fbe2a867
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:21 +00:00
Jukka Rissanen
d4e0025eb7 net: yaip: Add network address information to interface
Change-Id: I14b9257362a1e6f4144900c7acde6a125ecf6a02
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:12 +00:00
Jukka Rissanen
cba9d3096c net: yaip: apps: Create a skeleton echo-server for new IP stack
This echo-server does not yet do anything useful.

Change-Id: I317051b3a2bfb0a80584ad385c2f308978a243cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:03 +00:00
Tomasz Bursztyka
5f165e743f net: Add generic network interface header
This will be used by the new network stack to relate a device to actual
network context, and used in the different layers (mac, ip ...).

Change-Id: I30c08fa975314544c36b71636fd9653d562891b3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-12 07:20:51 +00:00