Commit graph

41120 commits

Author SHA1 Message Date
Tomasz Bursztyka
967f5b3145 net: yaip: Tiny comment fix
Change-Id: I9fff6651be90f74eaaccdc082b14997b8e55565d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:21 +00:00
Tomasz Bursztyka
5c64a078f4 net: yaip: Removing capabilities() from net_if api
As there is a L2 in the middle, there is no need for a net_if to provide
such information.

Change-Id: I58a35d4d124cd8a67026f32e71713ef06f43b7c5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:21 +00:00
Tomasz Bursztyka
7b52246eb9 net: yaip: Re-factor Kconfig and move ARP to a better place
ARP and its related Kconfig options now belong to l2.

Change-Id: Ie21ed3cc39a7c7c76d823587ec33fdd22b439fcd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:20 +00:00
Tomasz Bursztyka
d8f0b9ffed net: yaip: Add an L2 layer
Net core then does not know anything about l2 related logic.
For instance ARP is used in ethernet l2 API and nowhere else.
This will be helpful when adding different technologies altogether.

Currently, only SLIP driver is enabled to use relevant l2 layer.

Change-Id: I03c93326321028d04222733ca4083e3c6b785202
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:20 +00:00
Tomasz Bursztyka
bb1fe0c147 net: yaip: Make net_core.h include the least amount of necessary header
net_core.h is the ground brick of the IP stack, and thus should not
include other headers that might include net_core.h also: this would
create circular dependencies.

Change-Id: I70c17b736788528e4e0b4b5b2c478098b049c9b1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:19 +00:00
Tomasz Bursztyka
1f9f3e138b net: yaip: Add an helper to queue a buffer in a net_if instance
Makes code cleaner so it won't be necessary to access the net_if
internal queue directly.

Change-Id: I119a54e0639843093fa0da6f11e590e8990525d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:19 +00:00
Tomasz Bursztyka
cd14d27e8e slip: Fix compiler warnings
2 warnings happens when CONFIG_SLIP_DEBUG is set, thus fixing it.

Change-Id: I032d7481942e86911764da35cdd6f7b8e05cdeaa
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:18 +00:00
Tomasz Bursztyka
bbf7d35001 net: yaip: Shorten IPv4/6 config options
This is meant to stay in 80 chars line length limit.

Change-Id: Ib3b3b1cf5e05fec2407e470ae3600ff5a4c6a505
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:18 +00:00
Tomasz Bursztyka
389e4ee70d net: yaip: The core initialize ARP layer relevantly
Up to the core to initialize what's required to get all things working.
Introducing a NET_ARP configuration option, in future this one will be
set if only some hardware requires it along IPv4.

In order to differentiate ARP and actualy hardware drivers supporting
ethernet frames, adding a NET_ETHERNET config option. Which option, if
enabled along NET_SLIP, will be used later on to fully simulate ethernet
over slip TAP driver. Such option will also be used to unlock ethernet
hardware devices in drivers in future.

Change-Id: I10ed151b96256ea3f265c3926bf9a35e49692e1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:18 +00:00
Tomasz Bursztyka
fdc93e6202 net: debug: Indent properly some config options.
Change-Id: I3500081592a983e97e3e5407ac441b4ece58634d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:17 +00:00
Tomasz Bursztyka
514f184350 net: yaip: Include toolchain related header for aliases
__packed is an alias for __attribute__(packed) and is declared in
toochain's headers.

Change-Id: Ib9d136a1a2dd401194988d6573bf7778f07dbfb6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:17 +00:00
Tomasz Bursztyka
c02d2fdfd0 net: yaip: Use generic wrapper for semaphore give operation
No need to recreate an convenient context wise wrapper since one already
exists.

Change-Id: Ie1bfc0e203281485acb36e0e844b2bad384c2af6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:16 +00:00
Ravi kumar Veeramally
4450a41532 net: yaip: Fix __packed attribute, use shorter alias
Change-Id: I5bee3f1a9cf8629151734fc85b2c3e6097232cc0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-13 14:06:15 +00:00
Ravi kumar Veeramally
7789df23d1 net: yaip: Add UDP header
Change-Id: I2f3bba1014cf598bed7606d5d43b3653052b1f7f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-13 14:06:15 +00:00
Ravi kumar Veeramally
2cdbb932df net: yaip: Trivial comment fixes in header files
Change-Id: I2f3bba1014cf598bed7606d5d43b3653052b1f88
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-13 14:06:14 +00:00
Ravi kumar Veeramally
3ef38a6e05 net: yaip: Provide separate header file for ethernet
Change-Id: I2f3bba1014cf598cdd7606d5d43b3653052b1f7f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-13 14:06:14 +00:00
Jukka Rissanen
1145bd43a1 net: yaip: Setting static IP addresses for echo-server
Makes it possible to test things between qemu and host when
using slip.

Change-Id: I27e17de9f0d8c2c8406f0afdd66c295e827f87a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:14 +00:00
Jukka Rissanen
01af51d71f net: yaip: Handle ARP messages
Catch ARP messages when processing incoming messages and call
ARP input for parsing.

Change-Id: I88ea4699dfb8e7e35d3cecbce32d50aa485c307c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:13 +00:00
Jukka Rissanen
19dc87ea7d net: tests: Additional tests for ICMPv4 checksum verification
Change-Id: I21566c9365b8abc5753f6bedba55a3fb494745b9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:12 +00:00
Jukka Rissanen
ab91d99dc1 net: yaip: ICMPv4 checksum calculation fixed
The checksum for IPv4 ICMP was incorrect, the pseudo header
is not to be taken into account here.

Change-Id: I2a2a7e6eace24aba009574bf0021417257c8198a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:12 +00:00
Jukka Rissanen
11df6a01cd net: yaip: IP checksum calculation should ignore ll header
Link layer header was incorrectly taken into account when
calculating the checksum.

Change-Id: If09612145b87ed266998341d380eb6d5ecdde7cf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:12 +00:00
Jukka Rissanen
93cf2a7d9f net: yaip: Clarified the debug print about packet length
The print about packet length is the data part of the length
and does not include the ll header.

Change-Id: Ia66eb830796a572ffa416df1e6d0badcbe9f9aac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:11 +00:00
Jukka Rissanen
99fd48acdd net: tests: Fixed the ARP test
Now uses net_nbuf_ll() to point to link layer header.
Also the ARP req test passes properly.

Change-Id: If649ff19a064490bff33d03b4ce70ef11bfa7cd5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:11 +00:00
Jukka Rissanen
ca7ee4e66c net: yaip: Use net_nbuf_ll() macro to get into arp header
This is shorter to write and less error prone.

Change-Id: I67d3b75e0b39f58a4ea655e91530dff6f9fcc6e0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:10 +00:00
Jukka Rissanen
6fd8c1750d net: yaip: Add helper to get pointer to link local header
Change-Id: I079fb35e26499797f14f233b69a152ab1c86f9d0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:10 +00:00
Jukka Rissanen
8a9f8d17b9 net: yaip: Make echo-server to use documentation IPv4 addresses
Use 192.0.2.0/24 address space specified in RFC 5737.

Change-Id: Iff2545f5b0f4817c99813c986d57801e166967a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:09 +00:00
Jukka Rissanen
055d4db6cc net: yaip: Only accept ARP reply if we requested data
This helps to avoid ARP cache poisoning.

Change-Id: I3cc2adcc3d06520fecfdccc3b415575bb714e27b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:09 +00:00
Jukka Rissanen
f8ac1962a8 net: yaip: Setting preferred status to manually added IPv4 address
If user is setting the IPv4 address to a given network interface
manually and when lifetime is set to infinite, then set the
state of the address to preferred.

Change-Id: If6e331ac5655d0df0d3b67bb07bcf8cd06351e3d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:08 +00:00
Jukka Rissanen
2ee0d7bff7 slip: Support TAP functionality
If CONFIG_SLIP_TAP is defined, then ethernet link layer header is
used before the packet.

Change-Id: I3d266017f85683999d3c67de49b75b60686d7ba7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:08 +00:00
Jukka Rissanen
a5b96021a7 net: tests: Unit tests for IPv4 ARP code
Change-Id: I607ffdbffc7348fae70272c7add57456fcaf79af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:08 +00:00
Jukka Rissanen
fabdce2899 net: yaip: Added IPv4 ARP support
Small IPv4 ARP cache that is used in Ethernet networks.

Change-Id: I9ab38ee14a799f8573f4d4e0eade1be107d42f1a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:07 +00:00
Jukka Rissanen
9924b41297 net: tests: Add tests for IPv4 netmask, gw and subnet compare
Unit tests added for checking network interface netmask, gateway
and IPv4 subnet compare utility functions.

Change-Id: I5b4a07d6a064097ab41ad6552d14181b1631eb53
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:07 +00:00
Jukka Rissanen
9de396cfb9 net: yaip: Add capabilities flag to net_if API
The network device driver can specify what kind of functionality
it supports. Currently there exists one flag that can be used
in ethernet devices that tells that ARP should be enabled.

Change-Id: Ieaaefcfc7cdd65f44190248f507ac3cb512a323e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:07 +00:00
Jukka Rissanen
892a76745f net: yaip: Add util to check if IPv4 address is part of subnet
Change-Id: I6005861a4c4085b6c17ded03fda38a567a4e504a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:06 +00:00
Jukka Rissanen
575ad92ffd net: yaip: Add utils to set IPv4 netmask and gateway in net_if
Change-Id: I52bcea3749aa5fb4e12b18fd9fd9a3907842bf01
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:06 +00:00
Jukka Rissanen
554c83f1de net: yaip: Macro to compare two IPv4 addresses
Change-Id: I2af022d8a8df4c174e044d033a23d5912297e495
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:05 +00:00
Jukka Rissanen
630339064c net: yaip: net_ipaddr_copy() macro was too fragile
Making sure we are doing the IP address assignment correctly.

Change-Id: I8bf9233b932321a14df99ce49a39581f1343d004
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:05 +00:00
Jukka Rissanen
b826212ed7 net: yaip: Add utility function returning IPv4 broadcast address
Change-Id: Ibe4f5ad530f6a0f50137ef2cd8e64dbc9de6cba1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:05 +00:00
Jukka Rissanen
d35264f34c net: yaip: Do not remove fragments if main buffer is not removed
The fix prevents the net_nbuf_unref() from removing fragment
list if the top level net_buf is not removed.

Change-Id: Ice580c25bd74f3239c01321f2b9d61cc8c0c9c1d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:04 +00:00
Jukka Rissanen
dd42617b2f net: tests: Tweak the IP address test to use new net_if API
Instead of using hard coded net_if, get the default network
interface using net_if_get_default() function.

Change-Id: I6248555ce57ae5196adea7baa9db325660a71255
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:04 +00:00
Johan Hedberg
497268503e net: buf: Add complete net_buf_simple implementation
This just renames the existing net_buf helper APIs to corresponding
net_buf_simple APIs and then defines the old net_buf API names as
macros mapping to the new net_buf_simple helpers.

Change-Id: I3c2b35683c0fde66f5f697be2c34c01172af8e31
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-13 14:05:32 +03:00
Johan Hedberg
2d5bfe2f1f net: buf: Introduce net_buf_simple object
The object has the same layout as the last fields of the existing
net_buf. To maintain backwards compatibility net_buf receives a union
so that the old data, len and size members can be accessed as before,
however they are located in the same memory as the actual
net_buf_simple members.

Change-Id: I22d208faba30fe41c5ada17e6d13e641f528729a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-13 09:34:42 +00:00
Johan Hedberg
4e833a6522 net: buf: Group the data, size and len members at the end of net_buf
This is in preparation of introducing a new net_buf_simple object &
API.

Change-Id: I624b86e5d2c9f4e9d3647b2fe21ce8b89750256f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-13 09:34:22 +00:00
Jaakko Hannikainen
cf3fe37962 net: Add documentation about yielding
Now that net_send and net_reply yield, this behaviour should be
documented.

Jira: ZEP-469
Jira: ZEP-497

Change-Id: I8c3cf7bda009aa6e89f880447fd3b6a491f5d9ef
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-07-13 09:20:11 +00:00
Mariusz Skamra
f41072f3f1 build: Update Bluetooth known_issues whitelist
Update whitelist to filter out unnamed structure warning
while building documentation.

Change-Id: I7f983bc125589800c5118a745ebf7b6849f44833
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-07-13 07:39:35 +00:00
Szymon Janc
48eee87a39 Bluetooth: Fix using NRPA for connectable advertising
If privacy is disabled and static random address is used for identity
we need to restore static address before enabling advertising.
Otherwise NRPA used for any previous active scan could be used instead.

Change-Id: Ifea0d2863d78060c84e61d89ef384a94e86895b6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-13 04:53:22 +00:00
Baohong Liu
a3488d13e0 sensor: add driver for MAX44009 light sensor
Add device driver for MAX44009 light sensor

Datasheet:
https://datasheets.maximintegrated.com/en/ds/MAX44009.pdf

Jira: ZEP-357

Origin: Original
Change-Id: I6b5c8e0afc36c22de0a6432d01cd5b7eb2e12f1b
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-12 19:31:09 +00:00
Andrei Emeltchenko
bdb62b8934 QMSI/uart: Use IOAPIC_EDGE instead of IOAPIC_LEVEL
Use IOAPIC_EDGE instead of IOAPIC_LEVEL to fix missing interrupts.
During tests it was found that using IOAPIC_LEVEL interrupts for UART at
some points are lost.
Proposed by Calando, Antoine <antoine.calando@intel.com>

Change-Id: I18b20217c4d73fdeaa424bf59d00f6be1ec6ef1b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-07-12 19:30:31 +00:00
Andrew Boie
dd2273146c test_pool: exclude on olimexino_stm32 and nucleo_f103rb
These two boards don't have enough RAM to effectively run this
test case without making the stacks so small they don't work
on other platforms. ARM is sill covered by other boards.

Change-Id: Ibf20eefaf29f989cbb6da6cd3a8eeed2faa1950b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 19:29:19 +00:00
Jukka Rissanen
ebfa17eebe net: yaip: Add utility function to return default network interface
Change-Id: Ia64d263831e2842883404d25b7ea429bea80ca1d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:58 +00:00