Commit graph

19237 commits

Author SHA1 Message Date
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
Tomasz Bursztyka
257379d0ff net: Add header file for generic link address
It only describes the structure for now, but will then provide helpers.

Change-Id: I7ac7717a3289086dac50d90e25b2a1ce7d7abc91
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-12 07:20:40 +00:00
Jukka Rissanen
ca2f26999a net: yaip: Compile new stack if enabled
Change-Id: Ifb9c1b49e253af0428187898c6c3e6aa7f4851cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:20:31 +00:00
Jukka Rissanen
d53c56fff4 net: yaip: Use same prefix in new IP stack Kconfig
Use CONFIG_NET_... prefix for Kconfig options.

Change-Id: I3e882845e7c09ba910f108179208fcaf33360f21
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:20:19 +00:00
Jukka Rissanen
8e7007c26f net: yaip: Add ntohl() and related macros
Change-Id: Ia329a63644eab8ca1ce6debb8f7e7b97b8de711d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:19:51 +00:00
Jukka Rissanen
7db376cfec net: yaip: Add defines for various IP protocol header lengths
Change-Id: I05dcb7a26f50cd0c8d544c5d829e1154ed3f8119
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:18:45 +00:00
Jukka Rissanen
75ae39518c net: yaip: Initial commit for new IP stack
This is a placeholder that just compiles but does nothing else.

Change-Id: I9689fa26eb13bc23d29940938f7b3c11f32b2ff1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:18:06 +00:00
Arkadiusz Lichwa
ca57a7816d Bluetooth: L2CAP: Start servicing configuration request from remote
To make channel operational in basic mode a process of BR/EDR CoC
channel configuration needs to be performed in both directions. Remote
peer is mandated as well to inform local about its segmentation
requirements. Here is added such request handler focused on grabbing
remote MTU which is mandatory in channel setup.

> ACL Data RX: Handle 12 flags 0x02 dlen 12  [hci1] 12.133539
      L2CAP: Connection Request (0x02) ident 3 len 4
        PSM: 1 (0x0001)
        Source CID: 64
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.133631
        Num handles: 1
        Handle: 12
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5  [hci1] 12.133792
        Num handles: 1
        Handle: 12
        Count: 2
< ACL Data TX: Handle 12 flags 0x00 dlen 16  [hci1] 12.141644
      L2CAP: Connection Response (0x03) ident 3 len 8
        Destination CID: 64
        Source CID: 64
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.142054
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 16  [hci1] 12.143276
      L2CAP: Configure Request (0x04) ident 6 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
> HCI Event: Number of Completed Packets (0x13) plen 5  [hci1] 12.150945
        Num handles: 1
        Handle: 12
        Count: 2
> ACL Data RX: Handle 12 flags 0x02 dlen 16  [hci1] 12.150959
      L2CAP: Configure Request (0x04) ident 4 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 128
> ACL Data RX: Handle 12 flags 0x02 dlen 18  [hci1] 12.152160
      L2CAP: Configure Response (0x05) ident 6 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.158806
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 14  [hci1] 12.161822
      L2CAP: Configure Response (0x05) ident 4 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.163197
        Num handles: 1
        Handle: 12
        Count: 1

Change-Id: I7919fe180cf1d761023bb1478d8e1fb2d21a94d9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-11 19:34:17 +00:00
Jukka Rissanen
83707d5675 net: buf: Calculate amount of bytes in fragments
Utility function net_buf_frags_len() calculates amount of data
stored in the fragments.

Change-Id: I89ebc8dac4f216ff9e77b5c44002082398957f7b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:06:24 +00:00
Jukka Rissanen
95f5cd2b9a net: buf: Add tests for net_buf fragmentation
More realistic IPv6 packet creation tests created.
One test creates one big IPv6 packet and manipulates that.
Second test creates a list of IPv6 header + data fragments
and sets some user data in those fragment buffers.

Change-Id: Ic8309ff115e1d735e98c30b3c8292b0d6ffc5f42
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:06:11 +00:00
Jukka Rissanen
7d6197cf94 net: buf: Add fragmentation API tests
Add tests for checking that the net_buf fragmentation works ok.

Change-Id: I778f79bae971314b6f19c1bf00ed42e1c2128e99
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:05:41 +00:00
Andrew Boie
8a80ce5c6f Revert "REVERTME: test_pool disable due to memory corruption bug"
Allan fixed the underlying issue, re-enable.

This reverts commit 19fa82ab91.

Change-Id: I6e517f76a6650a3e9ba5a09118187e6c965a147a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-11 17:53:45 +00:00
Luiz Augusto von Dentz
d98068be94 Bluetooth: L2CAP: Fix not canceling RTX work
If the channel is being destroyed the RTX work should be cancelled as
it may cause destroy to be called again.

Change-Id: I49c10d64a2108719d28e456fb5b4bfb50ef8a140
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-11 15:40:39 +00:00