Because of the way the loopback tester works, it needs much
bigger stack when sending packets in TX fiber.
Change-Id: I360f0cf1f35e654cb139565f19f24628fb5ab5ee
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When the 802.15.4 radio driver tells there was a TX collision,
we must resend the frame. The resent and failed network packets
were not freed properly which eventually eat all memory reserved
for this purpose. Now the resent frames are discarded after
resending has failed couple of times.
Change-Id: I421e680605a0d164272a786edf8e15fe4c712d03
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The earlier 1kb stack was too small.
Change-Id: Iaa0b6e375cc79a7066bee9ec3a114246fb2ed377
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We run event timers (etimers) checker every two ticks in order
not to loose events that are scheduled in very short intervals.
These events can come for example when network driver wants
to resend network packets.
Change-Id: Id48977f4de66583351551b5bf403d6e230d189c0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The ctimers are not run without this. Callback timers are
used for example when retransmitting network packets.
Change-Id: Iae55848e615814d89573df326a2c20bb8ca88230
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The 4kb stack was too big so setting the stack to 1536 bytes.
Change-Id: I648d826225dd6312bba15100acf79e3783609d7a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We need to export ctimer_process so that net_core.c can
call it and let it set the corresponding event timers.
Without this the timers would not be called properly.
Change-Id: I623b60420eacfe326f6b18d89f3e008cc56379fc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add a function that allows the code to busy wait usec timeout.
Change-Id: I6c0bbe33a98d45c58667e1400e0ebcdc59d28bad
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of using IP bufs for sending stuff, allocate
a separate buffer that is only used in dtls sub-system
to send the encrypted buffer. This way there is no
possibility to deadlock in the dtls write callback
if we run out of buffers.
Change-Id: I45a909a50b6a9c83bb77712d47e968656b980d88
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network tester tools are not really part of the
Zephyr kernel so remove them from this repo.
Currently the tools code can be found at
git://git-amr-4.devtools.intel.com/zephyr_os_net_tools-tools.git
Change-Id: I6f076d6b32537fe3674b132cccd6c476ee19f6b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The fifo get timeout functions must be called in proper execution
context. Because of this requirement, we must use correct fifo
get timeout function depending on whether the net_receive()
was called from a fiber or from a task.
Change-Id: Ibf4637d0e647a441de59a1cbb9fdf3c0abe0eb09
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the file contains networking core routines and not just
init functions, the file is renamed.
Change-Id: Id633bae49296dfb4b14f1dd3a5064059f0418475
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Real timer implementation in Contiki was always returning 0
which was incorrect.
Change-Id: I63d5f2b5914e1952a04addc200fe1f0f4a95a5ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This file should not be here as it is not used in Zephyr.
Change-Id: I4be96e5b03e4522af80e48da285a1509bccc60df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The loopback number test count should only be available when
we have network sanity tests enabled.
Change-Id: Ifd4fc1f6249dda62c195810cfef7dd8ff9d17f9c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Show ethernet debug option only when user has selected
ethernet driver.
Change-Id: I0bc34e4034d978cb6fb9dce0e5b2e8fd87e9dc3b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix the include paths in Contiki sources so that we do not
have to create links to include directories during compilation.
Change-Id: I9316f1e90474e0ee563557deadd0bdc321cbb0fa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the uart sending fails, then print more detailed info
so we can pin point the exact location where this sending failed.
Change-Id: I5548fb9af96455c60b58c7b956ebe01fe78da3ff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Because the L2 buffers are only used by 802.15.4 sub-system,
we must not compile and link them to the kernel.
Change-Id: Iab0352582ac1c57e0dd8f54ca8e757e47e4df3be
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In order to avoid memory corruption, the dummy 802.15.4 radio
must reset its internal state when there is an error when
reading packet data from UART.
Change-Id: Ifeba5181f014426b95d21e5726c638eae555b649
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
NET_15_4_LOOPBACK_NUM is Kconfig option for number of times
loopback runs. In a controllable way loopback runs. This will
be helpful in sanity tests.
Change-Id: I48392d7e0d0b793ddc1b2b0c1b8c1f22e1bb318a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Variable len is related uIP stack. datalen is actual variable which
needs to be set zero in net_buf_get_reserve.
Change-Id: I75273ef760d3cd4f90808b496b75f56f19bd2e2b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This patch adds support for Ethernet to the network stack, which
entails relying on the Ethernet device driver to set the MAC address,
invoking ARP routines at the appropriate points, configuring the
Contiki network stack to use the appropriate link-level header length,
etc.
Change-Id: I153a6f4c83c28ca7129ef5affa1e9a18b0f92913
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch fixes a potential issue in which the signed return value
from the network driver send routine is returned from a caller that
has an unsigned return type. The meaning of a negative return value
from the network driver send routine is that an error occurred. A
return value of 1 means that the packet was sent successfully. A
return value of 0 means that the packet could not be sent. Thus, this
patch converts negative return values from the network driver send
routine to a return value of 0 from the caller.
Change-Id: If5cbecb18e514fd976200ecc45782d2a9e1f300f
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
The ret variable in net_tx_fiber was declared as unsigned but assigned
larger signed values and treated as signed. This patch fixes that
issue.
Change-Id: I2e33f6115a3defe45f86b5f6c7dc13175ec26827
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Sanitycheck fails due to compile time warning.
Change-Id: I0b9e95d33e8298a15e09ea2532e335bdc0979d09
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The function that resolves the source IP address we need to
use when sending a test network IP packet in Linux host is
refactored a bit. No functionality changes here.
Change-Id: I0f9bc79a9a7f01b382116b969739d7ad3f671751
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Adding convenience scripts that help user when running socat,
radvd and tunslip6 processes. These helper scripts restart
corresponding processes when qemu stops. This way end user
does not need to manual restart the utility processes.
Change-Id: I2e8eb15ee0ffe2ac8f1cedf4431cf8b09fcbbee5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User can set the source IP address of the sent network packet
in dtls-client by using -b command line option. This helps if
the -i option picks up wrong address from network interface.
Change-Id: I8c26f1a14de2394085dea1d6008eb758a5ce7ad1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Change all the Intel and Wind River code license from BSD-3 to Apache 2.
Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Print current number of free MAC buf count when allocating
or freeing mbufs.
Change-Id: I3c434671b28ac4b4d8c8d968899e891391d849d9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If mbuf could not be allocated, then do not try to free it.
Change-Id: Idf48f9f2eda260b8560a5388c920a9d9a3ef8f16
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The stack usage was not printed often enough when receiving
and sending 802.15.4 packets.
Change-Id: I61a4b6acdc10cb1681e2aeb63cb6af7a35834dff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The TX stack usage data and statistics were only printed
if there was an error. This happened very seldom which was
not very helpful.
Change-Id: I059cf9ee3449e5b39d872ef6026df968d86d0209
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If IPv6 packet length is incorrect, then print the actual
length values for debugging aid.
Change-Id: I20d4d73efd1e0103f670e8e53ba6417a4795ab80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If one has 802.15.4 network and tries to compile without
6lowpan, then print warning as that combination is not a
usable network setup. It can be used for testing but not
for real live setup.
Change-Id: I3b540686c8556ed0306723834ca38633aff63165
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the fragmentation header is missing, then do not discard
the message but pass it to upper layers as is. The fragmentation
header might be missing if the packet fits into 128 bytes.
Change-Id: I39d29e7ad80be5531262a0ac413d8137da0c64f5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to compile sicslowmac.c if we do not have 6lowpan.
Change-Id: I8624089f4b360fb12ef1c4a6d7104f0b190f048c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This collects received statistics from layer 2 (MAC).
Change-Id: Ie869c1209bd06f0a5ccad5094b0cafe5fe74d787
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This collects byte counts from layer 2 (MAC).
Change-Id: I16c25f7ae8b9aa485e3c5f1573154cd2270cff93
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>