Commit graph

19237 commits

Author SHA1 Message Date
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
Jukka Rissanen
30b07ad70a net: yaip: Process received ICMPv4 messages
Call ICMPv4 handler when receiving such a network packet.
Currently only echo-request is handled.

Change-Id: Ib59c65b38f13c484f1842485118dad32fb6a6f36
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:57 +00:00
Jukka Rissanen
b8e0b912c8 net: yaip: Process received ICMPv6 messages
Call ICMPv6 handler when receiving such a network packet.

Change-Id: I2ebe612bd4a4615e8cd1c8b323507c6a03f6008d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:57 +00:00
Jukka Rissanen
663ba2b7f0 net: yaip: Add unit tests for ICMPv6 handler
Change-Id: Ibdbe82ed56f110e2e0c6443700863632ee1ef56b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:56 +00:00
Jukka Rissanen
5cd47edca9 net: yaip: Add ICMPv6 handler
The host will be able to respond to ICMPv6 messages.
An echo-request handler is implemented and it will send
echo-reply when needed.

Change-Id: I08f4703bab5cf3e95d3ae722ebc7a386d22fe17e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:56 +00:00
Jukka Rissanen
441a054a07 net: tests: Unit tests for network utilities
Right now there are tests for IP packet checksum calculation.

Change-Id: I1e9e72d01d4690728269c4484f8628350cf95729
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:55 +00:00
Jukka Rissanen
c324d8a4f9 net: yaip: Add debugging option for network utilities
Various network utility routines can debug print after this.
The Kconfig option is called CONFIG_NETWORK_IP_STACK_DEBUG_UTILS

Change-Id: I8384f974bd3c4965a6ef401bff8060389fab51ad
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:55 +00:00
Jukka Rissanen
5834443a36 net: yaip: Add IP packet checksum calculation utilities
Added function that is used when calculating various IP
protocol checksums. The function works with fragmented
net_buf data.

Change-Id: Icaef707ba15ac2729608929e52e235e6e8a154dc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:54 +00:00
Jukka Rissanen
46f085d363 net: yaip: Add net_hexdump() utility to print network data
Only usable if network debugging is activated.

Change-Id: Id7d70d88b5ddca772603e5d2c567b8df23cf084e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:54 +00:00
Jukka Rissanen
4eb4ee49f5 net: yaip: Network interface needs own TX fiber stack
Each network interface needs its own stack for TX fiber.

Change-Id: I9647c2b945a3d36bc77c00dad11badb0d5f851e5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:53 +00:00
Jukka Rissanen
cada55f5be net: yaip: Add net_send_data() that sends data to network
This function is not meant to be used by applications as it
requires that the IP headers etc. are already in place.

Change-Id: I9099671111a029cdf630d131d7af09b147486f64
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:53 +00:00
Jukka Rissanen
de67431a43 net: yaip: Renamed network data receive function
Renamed net_recv() to net_recv_data() so that the more generic
name can be used by applications. The net_recv_data() is only
meant to be used when L2 layer feeds data into L3 (IP) layer.

Change-Id: Iba155d51f81e3b99964fa916fe87a05a8bf8766a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:52 +00:00
Jukka Rissanen
dbdd1e1d2a net: yaip: Network interface sets default IPv6 hop limit
A default hop limit can be configured via Kconfig.

Change-Id: I5cbd130882e043e24488c4501e86fce0f91d48df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:52 +00:00
Jukka Rissanen
6b2a002d06 net: yaip: Move IP address print funcs to separate file
Making all big IP address print functions inline will increase
the code space too much. So moving the big functions to utils.c
and just leaving the stubs to be inline. These functions are
available only when debugging is activated.

Change-Id: Ib76846d282a821e99885ec1801df4302bb0c9b42
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:51 +00:00
Jukka Rissanen
cb2191652e net: yaip: Add ICMP protocol header struct
Add a macro to get and cast the ICMP protocol header.

Change-Id: Ief3f69d1b3dbe9dd55bc0a032b3506c8e0370563
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:51 +00:00
Jukka Rissanen
1b2069c61c net: yaip: Fixed the IP/UDP/ICMP getter macros
The nbuf macros for getting the pointer to start of IP, UDP
and ICMP buffer were incorrect.

Change-Id: I6309bd50cdf2cbf0c6c23b4b349c7c084cfe928d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:51 +00:00
Jukka Rissanen
7150b0035c net: yaip: Added API documentation to IP address check functions
Some API functions that check IP addresses were not documented
properly.

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

Change-Id: I9f9e5f0888d2c3b91401c98f4925647ddce09962
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:50 +00:00
Jukka Rissanen
efd3f9ee63 net: yaip: Network interface code compiles ok for IPv4 and IPv6
Make sure that the net_if.c compiles correctly when IPv6 and IPv4
are activated in config file.

Change-Id: Icaeba2c2ac7003ffaba516afd476991bf150165d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:50 +00:00
Jukka Rissanen
cedd655cdb net: tests: Add more IPv6 address getters unit tests
Change-Id: I0ab22af76073c02c93eb205686472f69b58a1107
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:49 +00:00
Jukka Rissanen
d85fa3fe2d net: yaip: IPv6 address utility funcs for network interface
Added more functions to get proper IPv6 address from
a given network interface.

Change-Id: I5aecdb35eb549a0781949134ab4821dcb8ce9e7b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:49 +00:00
Jukka Rissanen
03294c3f75 net: tests: Add IPv4 address unit tests
These tests will check that caller is able to set IPv4 address
to a network interface and check if an address is one of the
assigned to a network interface.

Change-Id: I8aa748c40fbc02eef50ccf76d10a0057ef29021b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:48 +00:00
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