6lowpan context options(CO) are supplied in RA (Router Advertisement)
message. Added support for parsing and cache it. This information
will be used in context based compression and uncompression.
Change-Id: I6e9b5bf02aab3a574ba6a1454232e2d56e855bb0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Neighbor discovery options length is inclusive of type and length.
It's in multiple of 8 bytes. So actual length is length * 8 - 2.
Change-Id: I628d6b8c0a0b5a4e8b5f6d48cebed3856cb8e4b7
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Enum names are colliding with defines, which is bad.
Change-Id: Ia8c003983ddeb1ebed8a9210e682bcb21abfa687
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The memcmp() could reach after the buffer that is used for verification
ends, which was causing this test to fail on the qemu_cortex_m3 board.
Change-Id: Ia05df823f201d9017acb35c7634fa506389ae9f1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
linearize() expects the amount of room available in the buffer.
Change-Id: I1062912f76951758177b7dd6588e7e0ae280dc03
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Quark D2000 doesn't not have enough RAM for these tests.
Change-Id: Iba79eaadb15eb8f1eae4bfdbc6865985d3da3fd3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
In case of invalid parameters return false than NET_ASSERT.
This way we can continue calling net_nbuf_write() and the
function will will cause no ill effects to the net_buf.
Change-Id: I008a044069d26cb8b5971524dd3e1f23f0786926
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Previously the code was using the size of the user data part
to determine whether the buf was a data fragment or RX/TX
buf. This is not enough as we might have a buffer that has
user data but is still allocated from data pool.
This commit changes the detection logic. Now the pool free
pointer is checked against the data pool fifo pointer. If
those match then the buf was allocated from data pool.
Change-Id: I627a960fd2e9cbb7ac8a2e06a914a3ab9596985d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Re-ordering fields in struct net_nbuf in order to avoid
holes because of memory alignment.
Change-Id: I5a3ab31a0232003c161fd65848f70d83e07a75c9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Let's set ll_reserve only when the ethernet header has been verified.
Change-Id: Icd369cd3a84a6d8c98b4df5ca95227d177b12c3d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If PTYPE is unknown, let's drop the packet.
Change-Id: I2fcdd99b01a875e21b2a1952d556f09e40829d2b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Code is actually meant to identify the part in the layer from which the
events originates. Adding or removing an address is a command.
Change-Id: I42b4823d2585b15851c4fdd91802a13d2a5759c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Buffer leaks are fixed in 6lowpan compression and ieee802154
fragmentation. So lower the count in tests.
Change-Id: Ic9581f898156fedc20a3e445be8b7a466ee15d99
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Unref the buffer after net_buf_frag_del() call. net_buf_frag_del()
doesn't unref the buffer.
Change-Id: I06833e059bb46f6d3e63a22b6cce7dce0ccff14d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Uncompressed (original) header fragment deleted but not unreffed.
So leaking buffer here.
Change-Id: Iaefef1e8578cf3b290ae5a00141132cae36332a6
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
checkpatch warns about some indentation issues found in Kconfig files.
So, this patch fixes those issues. No new information is added by
this commit.
Change-Id: I251add0359be3fd9152df0f6d58c1207488464a6
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
LQI is actually not provided as is, but should be computed from an
abstract correlation factor. See Section 20.6.
LQI is provided the same way as Linux does, so it can push it everytime
into the buffer.
Change-Id: I5de318db2c2581d7482cc16e41dc601130753a62
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This avoids bloating the radio API by adding a function to get current
LQI and it optimizes the usage of the fragment as its minimal size is
128. Knowing that 802.15.4 frame cannot be bigger than 127 bytes, it
thus finds a usage for the tail byte.
Change-Id: I213ae226f84527fe7b6d761f738e3924651f81e5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fixing 80 chars limit by removing length computation:
We can count the FCS as part of the received length, even if AUTOCRC is
on. L2 layer is able to parse this out.
Change-Id: I3c824ed95d177570a07d04784798e14f5979c96b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A fake network device and interface are setup. Test implies add and
removing an IPv6 address which should trigger the related notification.
Change-Id: I6035cfbfaf80c8f4352b5d31b47ca1445434d926
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
These notifications will be forwarded to any relevant net management
event listener.
CONFIG_NET_MGMT and CONFIG_NET_MGMT_EVENT need to be set.
Change-Id: I5de72aed4db06f1d384effde6cf4f003bead3b31
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Currently, only address related changes are handled.
Change-Id: I2aa366518dae2725e58cbede4ccbe2ef19cd8b16
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will be useful when creating request and/or event codes.
Change-Id: Ibc117b476c52d72c77924a245e1f263f583061f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The network interface naming macro is ignoring the
dev_name parameter. This can bring issues if having
more than one network interface in the system.
Change-Id: I7e975be61e82bd04bd865b0c4078607cbdef2230
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
As the function does not modify the IPv6 address,
it can be const.
Change-Id: I2af58a4954d8b6f0d71bc7d0d14ddf0f62f8ca7c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
While doing some documentation for it, I realized names were not all
good and it missed some stuff:
- what belongs to event should contain "event" in it
- we have a structur as callback so let's type the handler as a handler
- let's add the request handler signature
Change-Id: I18822cbcdc3c10e33600d6db38abab5ca73a228c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
In some cases the BT header files are missing and the compilation
will fail when done by sanitycheck script.
Change-Id: I484e1f0c23975053e947bc57ff3c9f4042fad71e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use ?= for the CONF_FILE variable to match the default assignement for
BOARD ?= qemu_x86.
Change-Id: I0b6cf1e967eeb437d99aa7286cf560426d48fbf9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
Export ieee802154 radio over USB to be used in other Operation Systems
like Linux. In this scenario Linux SoftMAC driver would be used
implementing ieee802154 stack inside Linux.
Currently tested to work with Raspberry Pi and addon ieee802154 board.
Change-Id: Iabcbbfcaad8e3935a63faca50a19fb624e78a351
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
L2 RAW channel allows to use some functions of IP stack for RAW access
of network drivers. It is hidden from user and is selected by 2520 raw
driver.
Change-Id: I91dd09803052072dfddb7989d9d67c3a5840f89e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add TI CC2520 driver allowing RAW access to radio interface similar
way Bluetooth user channel works. This makes possible to handle radio
channel inside external 802.15.4 stacks, for example export it over USB
and handle in Linux.
Change-Id: I61bb4c8b998ff1e47dc65427ac471f04ec8fea63
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
It mimics how event could be thrown through a dedicated thrower (a
fiber). The amount and event it can throw is gived through parameters.
Change-Id: I484bc72bdb730a77ce976b0b2998411d9918b7fc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This adds the capability to raise an event, and for anybody to listen to
it.
Change-Id: I2287b43d678930c29391efa2ddf7b12652cc1bb6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Define the ground mechanism to interact with the network stack.
Change-Id: Id2af76188967fa66e0f0d755a2c1dc8a85985540
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Basic unit tests for Router Advertisement message handler.
Change-Id: Ia99cd160632972a12e2099a3ff6e41e6ea48ff9b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add multi fragment parsing support for Router Advertisement
packet.
Change-Id: Ie2730156c96759ee720f406f9d034b350643322e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Get the last fragment only once instead of searching it for
every byte written.
Change-Id: Iebeed21671b12bc081d7a1291f91d2c897a7a1d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The buf parameter cannot point to a data fragment in
net_nbuf_write() because we need to use user data inside
that function and the fragments do not have that information.
Change-Id: I45b9c23869df08a0852bd99c0b453210ad2300b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the caller did not allocate first data fragment, then allocate
it automatically.
Change-Id: Ice0f3bf65b1f9cd838738549ba15117d925b37b7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This way we do not access invalid pointer if user passes NULL
pointer to this function. Also we can avoid extra error checks
when calling net_nbuf_read() function.
Change-Id: Ie124cbe8a7915fa07decedd48c0c274138cfd0aa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Two utility functions net_nbuf_read_be16() and net_nbuf_read_be32()
added which return either 16 or 32 bit big endian value.
Change-Id: I3401dde75669b429160c602a820359c800671afb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Source contiki headers only for legacy driver
Change-Id: I356fd65ce9a4ee144c29eed1b51f2f0175315c1c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>