Use correct number of network buffers when sending and receiving
maximum size IPv6 frames (1280 bytes).
Change-Id: Iec4978fc97fb16f279a409f4f04d8a679d7cadc7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The queuebuf count defines how many fragments we are able to
receive. Value 13 means that we can receive full IPv6 data
(1280 bytes), we need also some extra buffers for temp use.
Change-Id: Ie16d37ae61e15ded4355b5f54136722fc6317022
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Stress test the IP stack by always sending max number of bytes.
Change-Id: I830a92cca4efbc2aa00dd1bec75972884359621c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To make it easy to periodically verify that we have sane stack sizes
it's helpful to have some code to evaluate how much of the stacks are
used. There's already a CONFIG_INIT_STACKS option which pre-fills the
stacks with 0xaa bytes, so we make use of it and in case the option is
enabled run the extra code to evaluate how much of each stack was
used. The trigger for the evaluation is a disconnection event.
Copied from Bluetooth sub-system.
Change-Id: I5539156d98abd361254088f775765f7a72890ed5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Easier to debug the beast if the IP fibers are not called
the same as 15.4 fibers.
Change-Id: Iaa15b5e359c7dc2fd9af298445d6abe59a26ddd0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we receive wrong fragments, then we start all over. In this
case we also need to release the net_buf that is used to collect
the earlier fragments.
Change-Id: I121d6a4031a375a0208441e110ebede58320c153
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_buf is used to collect the received data. We clear the
buf pointer after all the data has been received or if we dropped
the packet. This way we know if the buf pointer was used or not.
Change-Id: I5d41b61fbc468262e8097719ddbc85ca90a73b98
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the udp packet was successfully delivered to the application,
and if the application did not want to send anything back to
sender, then then uip_slen(buf) will be 0.
In this case we MUST NOT set uip_len(buf) to 0 as that would
cause the net_buf to be released by RX fiber. In this case it is
application responsibility to release the buffer.
Change-Id: I43cf9b147a45294288dc3c631908b034e1a4ab6a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We must make sure that the UDP socket can be registered only once.
Change-Id: I90e0dac2b1b234fd7f899a0e41442c13f0c8bdd7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The test_15_4 test application now works with microkernel also.
Change-Id: I041a917be599936089af9ffaba9c27b9aeb5a481
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Enable 802.15.4 driver that receives the IPv6 packet, does header
compression on it and writes it to the 15.4 stack Tx FIFO.
The 15.4 Tx fiber will pick up the header compressed IPv6
6LoWPAN packet and fragment it into suitable chunks ready
to be sent to the 15.4 hw driver. The 15.4 stack Rx fiber picks
15.4 frames from 15.4 Rx FIFO (which are fed by 15.4 driver)
and reassembles the all fragmented packets and uncompress the
header and writes to the IP Rx FIFO.
The 15.4 loopback radio driver receives the 15.4 frames and
put it back to 15.4 Rx Fifo.
Change-Id: I68d1c7ff6de0e8770616e574206c2091c69a28e6
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Set the loopback IPv6 address and an all-zero MAC address as the
loopback device really does not have a defined MAC address.
Clean up the code so that the loopback driver's IPv6 addresses are
not reused in other parts by mistake.
Change-Id: I07cc8bc5ad3a2ec5997bb313dd0ecaca4d9742f7
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
RPL (ripple) is IPv6 routing protocol for low power and lossy
networks. See RFC 6550 for details.
Change-Id: I60ca9e66be46741ebcc173ca3b581afd6876e9dc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit uses the simple UART driver to pass slip data between
qemu and host.
User needs to create a network device (tun) in host that is
connected to qemu via slip protocol. The tunslip6 process
acts as a gateway and passes packets between qemu and host.
See net/ip/contiki/tools/README file for details how to use and
configure the slip in host.
This is meant for testing the uIP stack.
Change-Id: I82bb87a76485a07ddf5de9ae91fe3d49a0e20658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Now that bt_conn is public using it directly is much more convenient
and in some cases save a lookup by address.
Change-Id: Ia489948634984fe4f1a430da553f8a2a740fb531
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Enables in sync call get feedback from controller about status command
that HCI create LE link command transaction reach the controller stack.
Change-Id: I9755f6911971a5d82898bb0e13a50060a30fd86b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This makes sure the bigger members are always list first in non-packed
struct to minimize the use of padding for alignment by the compiler.
Change-Id: I64419e9b27f4e7d3abb4eeb0ef2a88beda5b22e3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Look up the local IPv6 address if none is given by the application.
If no address is present, return a NULL context.
Change-Id: I7d4ef306944f65bc40799865dc6520b977636f6b
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add the user specified local address to the list of addresses
that the uIP stack knows.
Change-Id: I53dede27fa1717119a8bad6d7eee574ad3e924f1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make tcpip_input() to return 0 if there is an error when
processing the packet. Value != 0 indicates a successfull
packet processing and in this case the application will
free the packet.
Change-Id: I4aaeb5f0039cfbe25f7238a144964e31a8204148
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Rather than checking whether the remote port is zero, use the IP protocol
field. The remote port might be zero if all incoming connections will be
accepted.
Change-Id: Ia1f24ae94fab27c561267c7bbc0f709fe98ee7e8
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Assign local UDP port number if not explicitely set by the caller. Use
the timer as a source of uniqueness as there is no random function
available.
If the local UDP port number has been set, verify that it is available
and not already assigned.
Change-Id: I18baac0cbec300cc2a5b7a62dff830d9fafcf2c9
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When read from the Rx FIFO, pass the network buffer to the uIP IPv6
stack using the tcpip_input() function. As the event is handled, not
all cases where the buffer is to be discarded can be detected.
Thus, if ICMPv6 errors will not be sent, indicate that the packet is
to be dropped by setting its length to zero.
Change-Id: I49f69011685e39759ba25ebb07670308382a5ca8
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To make it easy to periodically verify that we have sane stack sizes
it's helpful to have some code to evaluate how much of the stacks are
used. There's already a CONFIG_INIT_STACKS option which pre-fills the
stacks with 0xaa bytes, so we make use of it and in case the option is
enabled run the extra code to evaluate how much of each stack was
used. The trigger for the evaluation is a disconnection event.
Copied from Bluetooth sub-system.
Change-Id: Ic04ff83f682dc9b57afb69e164b972ffd9b860ea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to waste CPU cycles initializing the stack variables.
Change-Id: I0c517125ef37f7d0de4fd0040c4b4700536cd7c7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move packetbuf from net_buf to net_mbuf, update 802.15.4 stack
with net_mbuf (which is smaller in size, and mostly wrapper for
packetbuf) and split sicslowpan(ipv6/sicslowpan.c|h) functionality
to compression and fragmentataion. This patch contains
null_compression and null_fragmentation which is exactly what
uip_driver.c|h does.
Change-Id: Ifee359e20aa57a50fb00c9ce049d9476b2ac67e3
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
For commands that generate an intermediate zero status (e.g.
HCI_LE_Create_Connection) we should allow for successful
bt_cmd_send_sync() completion at this point. Since the code treats a
NULL return buffer as failure we must provide an actual buffer to
indicate success. There's not really any useful information in the buf
for a cmd_status but passing it to the caller lets us notify of the
successful completion.
Change-Id: I38c70bfce95a1cc5383dfa0a49903731705772d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Set the uIP output function in order to call the send function in the
registered driver. Do driver initialization and checking cleanups.
Change-Id: I18c9b551320d15fa2619a077d1224f5e521c53ed
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
After an IP packet has been (reassembled and) received, the driver
submits the IP packet to the IP stack.
Change-Id: Icbd1e7740ce59db16bc1d61002420e86ab101d2d
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We do not need large 1280 bytes long buffers in lower IP stack
layers. After long packet has been fragmented to smaller chunks
it depends on the radio technology how long buffers we need
to use. For 802.15.4 we can use 128 bytes long buffers.
Change-Id: I8cd6085944d78fa26a4aa1a93c58fc436856541b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fixed the compiler warning about not returning correct value to
caller. Now we return correct value if neighbor solicitation was
sent properly.
Change-Id: Ie28a2ee417bcdf3eb9b24ab91a49c688992e7420
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the return value of the sender is 0, then packet is/was
discarded and we release the net_buf. If the value is 1, then
packet was sent properly and the driver has already freed
the net_buf.
Change-Id: Icd93602225e14f7210fe9ef33603a7451d834a80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The system library does not know how to print length with %x
modifier.
Change-Id: I9a2b0ec138a8da4a001379fe818cd8694cc78bc8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Helps to monitor what is going on in the stack.
Change-Id: I1707ea07c09082e4f74b1d6c4fa78a9e646485d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Important to release the net_buf if we discard the packet.
In the future it might be easier if input() would return
status and caller could discard the net_buf if needed.
Change-Id: I533a37ef7f2e80d99ad62301562228189a5e0308
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Created a kconf variable that is used to enable/disable 6LoWPAN
support.
Change-Id: Iaccfe01696ec7226d9a114924c1162fa35959ff9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
bt_conn_lookup_addr_le shouldn't look for the state of the connection.
bt_conn_lookup_handle should return bt_conn only if there is a handle
so if connection is in state BT_CONN_CONNECTED or BT_CONN_DISCONNECT.
Change-Id: Id88361990913d17bdaffc686e5aa3edaeaaecc0a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Delegates connection object to new connection when there exists
in pool of available connections an object with zeroed destination
LE address.
When there's no reference to the active connection object resets its
peer LE address member.
Replaces routine's input connection handle parameter with LE address.
Moves to the caller setting connection state, connection handle and
call to bt_l2cap_update_conn_param() since connection handle needs
to be valid when such update going to be made.
Change-Id: I81743a915da6cb008f9593dd1940c186a357be6b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Now we properly register UDP listener and specify callback to be
called when UDP packet is received.
Change-Id: Ia9fded780d53ba2fbfad6a34927dcbd92e42a9e8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We need to know if we have registered a socket listener, otherwise
we try to register UDP handler too many times.
Change-Id: I060150d01eb149f2a2a6a332d18e0142e5cb7a5e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>