We must use the data fragment to remove the lqi value.
The old code used the head of the buffer chain (RX buf) to
remove the lqi value, which caused the length value to go
from 0 -> 0xffff. This then caused then weird errors if
net_buf_frags_len() was used to calculate the length of all
the fragments.
Change-Id: I07ac42051e6773528b770b94a69c5bc76ae069af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The helper, depending ot the MAC Command Information Field (CIF), will:
- allocate the buffer and the data fragment
- create the MHR part of the header
- set ll reserve and buffer length, in order to ease the later fill-in
of the MAC command itself (a tiny helper ieee802154_mac_command() is
provided).
Change-Id: I594196892906cd65e9d21e37d5757d289e6f9b3f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Accept and validate MAC command frames.
Change-Id: I5acff998d1d0d1f53c9d6188f6c2fb0bc82697af
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
These descriptors will be used to parse and create IEEE 8022.15.4 MAC
Command frames.
Change-Id: Ic9eb17fe50ae1a9e8460ca62a05cea02cfb14f8a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is meant if only one needs reliability when sending non-TCP packets
(as TCP would make is redundant).
Change-Id: I7dc605094b422a750424c3498d18f32d809d23a8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This level will support the basic features any 15.4 device needs to
have. Unlike ORFD, RFD is spec compliant.
(This choice is introduced now for clearer history)
Change-Id: I70cdd9fcd9cdf224207478f7a76f75ee8da8a31b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Indentation in Kconfig is as follows:
- 1 tab for config attributes but for help content
- 1 tab + 2 spaces for help content
Change-Id: I026adb56fd8046d6bb8767857fcc7224a6248a97
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
fragment is only about testing 15.4 6lo fragmentation, so let's put it
in dedicated tests/net/ieee802154/ directory.
Change-Id: Ib838600e571753ab976c74dac78ee774f628c2ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
So reordering files in order to put more specific tests in it.
Change-Id: I000bc5efb8442d02e9a50e1b85cb45e0bec12789
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Relevantly provide ieee802154_fragment() to the 6lo library.
Change-Id: I77d4ff9e6d37a17ee30354a3026c295f8dfaa25c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No reassembly logic is changed besides removing the final reassembled
pointer. Instead of requiring such pointer, let's just use the frag one.
Such changes will ease the usage of ieee802154_reassemble():
the given frag buffer, in case it finally got reassembled and thus
provided a NET_CONTINUE verdict, will directly be handled by net_core.
This makes things consistent as well with verdicts:
- in case of NET_OK, buf has been consumed and thus unrefed
- in case of NET_DROP, buf needs to be unrefed by caller
- in case of NET_CONTINUE, buf is updated with reassembled and
decompressed data packet, up to net_core to handel it accordingly.
Change-Id: Ibd1588debd22a7f4571b36713dd46bf8b1d88329
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As soon as fragment is put into the cache and as long as it is not
identified to be the last one: let's return NET_OK to notifiy the
fragment has been consumed by ieee802154 L2.
That way, net_core will not try to interpret it - and fail - unnecessary
increasing the drop statistics.
On the contrary, once the buffer is fully reassemble, let's return
NET_CONTINUE in order to let net_core consume the buffer relevantly.
Change-Id: I715b687e451f4643656e122b0d119f114696340b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Such tag is meant for fragmented buffers only, so let's update it only
when:
- given buffer is valid
- given buffer needs to be fragmented
Change-Id: Ic3f41a9194ea11cd129fb0903bcd242facea7197
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A buffer can be made of multiple fragments, so let's generate the 15.4
header for all of them.
Change-Id: I41fd8c939964da1ea6cdd3e00f16bb7297da509d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This debug print is heavy and disabled by default (hardcoded, no Kconfig
option). But it's anyway useful in some cases so let's update it to
handle multi-fragment buffers properly.
Change-Id: Ic20a9d4056bb91cc9816c129d78aa3fe80fc9fef
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
For each fragment it should transmit it, handle the error, retry if
possible, wait for the ack if necessary, all along the current
transmission strategy.
Change-Id: I28a01553e28d9bb51024321ce7d22372ad6a1335
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will be necessary to handle multi-frag buffers. As each frag needs
a unique sequence number, incrementing the sequence at every call.
Change-Id: I4e002dd42e89a1ef3f65e7591157d3e9d346ceff
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Buffer sent by 802.15.4 L2 might have more than one fragment, thus
handling it properly.
Change-Id: I12fef8a9c5de56615c3a084c57f438e71b320fcf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's not count the whole buffer length but only the very first frag's.
Up to L2 radio strategy to loop on every fragments and call tx for each.
(once sent, it deletes the fragment, so next fragment is always
buf->frags).
Change-Id: I94130fedfbecffdf62286bcb7f10563c776a255e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The given buffer can come with many fragments, but it's not up to the
hardware driver to send all of these but only the first in the list.
The overall fragments send procedure is handled in l2 level where the
radio transmission strategy loops over the list of framents and send
them one by one relevantly.
Change-Id: Ia7ae42ab4e9f8efb83bf07de6791918059b1e1c9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is meant to generalize how these are computed, for future usage
like in MAC command frames.
Change-Id: I6b1cea93666f6df46a76b920077af5b0e413342e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
For future purpose, let's not occupy a full byte for a unique boolean.
Change-Id: I36f2824cca4806eb90640a71ed3cea37a353b276
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to use goto, validate_addr() is going to set dst addr to NULL as
expected.
Change-Id: I804a51307d9d8e5e21dbb4e6a794e23c7bbe2762
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
These routines are generic and not ALOHA specific.
Change-Id: I431e2f4a135d321a428e2ea98e41440cdc128a61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Including net_if.h can makes things looping, as this one will include
net_l2.h, which one might include a technology that will in turn include
net_mgmt.h again.
Change-Id: I514720875937414167f0396edb9147ed29dd6d69
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Up to the part declaring mgmt request to define such handler. This is
meant to avoid such warning:
warning: implicit declaration of function ...
Change-Id: Ide6e9abf886169c26d81fe6b5c7bc280e1ac4e4d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since "22e919872206b1d net: Adapt to new behavior of net_buf_frag_add"
net_buf_frag_add() takes onwership of the fragment, so this _unref()
after a net_buf_frag_add() is wrong.
Change-Id: I1559c2978cf8d800891d6e752478537fbee7c02b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This enables the tests for the observer feature to be run using the
native IP stack.
Change-Id: I325dcd1f5d9fffe3821eed1bd950a717e5f17b67
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
As we use STXONCCA, RX will be stopped and reinstated afterwards.
We would be using STXON, since FRMCTRL1_SET_RXENMASK_ON_TX bit is set,
behavior would be the same.
Recalibrating the RX will uselessly abort any received frames before TX
or right after RX got reinstated. So, let's not do that and trust that
RX is anyway properly calibrated after TX.
Change-Id: Iac4fa03a175f8d139c1fc821de01caab1ec86e6b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Print TCP flags in a similar fashion to tcpdump, where uppercase
characters mean a particular flag is set, and lowercase characters mean
a particular flag is unset.
Supported flags by net_tcp_trace() remain the same: FIN, SYN, RST, PSH,
ACK, and URG, respectively represented by the letters 'f', 's', 'r',
'p', 'a', and 'u'.
Change-Id: Iaeb0b5c4fa5b4ab2b877d523b155dc431e9fc909
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This fixes the following build warning:
net/yaip/ipv6.c:333:9: warning: 'nexthdr' is used unin-
itialized in this function [-Wuninitialized]
This relies on net_context_get_ip_proto() providing the correct
protocol given a certain context. Currently, it only returns either
TCP or UDP, which is sufficient for net_ipv6_create(). However, enum
net_ip_protocol contains other unhandled protocols (ICMP and ICMPv6,
respectively), which might or might not need to be handled in the
future.
Change-Id: I1f7af54612c3e1c978e734fc0e6b2ff1a61089f8
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
When a connection is being established, the ack sequence number in the
SYN+ACK segment must be the sequence number from the SYN packet + 1.
Change-Id: I91df986f1f1b7cf8eaff0171921ab4c8cf1ddf93
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The fragment count value was incorrectly printed. All
the values > 9 had their last digit chopped off.
Change-Id: I8304b8047baa97995c3927809e4616653c87928b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This change is related to patch called
"net: Adapt to new behavior of net_buf_frag_add"
This version removes extra net_nbuf_unref() from
the code. The unref was done because net_buf_frag_del()
did not remove the double ref from the list element.
Because of the other patch, the list does not have
double ref any more, so we need to remove the extra
unref in couple of extra places.
Change-Id: If90e01c24b9b4e68afbfa283850d2a1ecb3065ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
net_buf_frag_add takes the ownership of the reference passed to it so it
is no longer needed to unref when deleting fragments.
Change-Id: I73f44ba313819a176b6a64b7644c80a83d86000e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Earlier test results was updated as soon as test server ACK client
dhcpv4 request. But update results on IPv4 address add event on
interface.
Change-Id: I212309a4d1d2eae88f73470e00754db1d6fecda5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Change definition name suffix to WPANUSB
Change-Id: I3456ebff061866a67b7a07b33f6ff83a31a2d7a8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
It should go to LISTEN state as soon as possible, to service another
connection. The client connection, though, should be in the
ESTABLISHED state.
Change-Id: I98708e67bd969f09b84e60ac2fecc284bf82a79f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
When an incoming TCP connection is accepted, a net_context for the
client is allocated. However, some steps prior to calling the
user-defined accept callback can fail, without freeing the
newly-allocated client context.
Change-Id: I94ed03d2f3b69eb3edd23c990da5842fa4605a29
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>