Unicast RX stats
It represents total number of unicast (any type data, action or
any other unicast frames) frames received at firmware level.
The actual frames passed to host will be different as firmware
may drop packets or some packets may be dropped because of
errors.
Unicast TX stats
Transmission side the unicast packets count states the packets
handed over to firmware. The stats taken at firmware level.
Actual packets transmission may vary depending upon various factors.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
We were missing a helper function that can be used to check
whether the given function is the virtual VLAN interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use lock while accessing nm data.
One of the use case is while setting regulatory, it accesses nm data,
while from some other place also it can be accessed same time.
Protected the nm data processing.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
Even though we are passing mandatory args from the shell registration,
due to use of getopt the check can be bypassed without the hyphenated
options.
So, enforce and fail if mandatory parameters aren't passed through
getopt.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Updates the linker script fragments under 'subsys' to use
Z_LINK_ITERABLE_SUBALIGN for the subalignment instead of
a hardcoded value of 4.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Applications need to run a scan to identify the security
mode before attempting the connection which adds to the time
taken for connection to be established.
To avoid the initial scan, support auto security mode which will
enable STA to choose between WPA, WPA2 and WPA3, based on the
network configuration.
Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Since `NONE` is a valid option for key management in `connect`
command, we should remove the part in help text which says:
"valid only for secure SSIDs".
Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
The commit 8256d02d3a introduced
getopt parsing for the wifi connect command
This needs to be updated for the wifi ap enable since ap
enable also uses the same parsing as connect.
The use of getopt removes the parameter ordering restrictions
Signed-off-by: Brad Kemp <brad@beechwoods.com>
The network interface parameter for net_eth_get_vlan_tag() should
be the VLAN interface so use the search loop properly.
Earlier the main interface could be checked.
Add also test cases for this so that we can catch that the func
works properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Remove IPSP support from the tree.
It has no maintainers, and is regularly broken. The fact that it's
nontrivial to set-up in linux makes it hard to fix reported issues.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
There is no limitations for dwell time. Just add
valid condition for positive value. So , it's better
to remove those constraints.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Add support for capturing arbitrary data via the cooked mode (sll)
capture API. The actual packet capture is done using net_capture_data()
function, the packet capture infrastructure does not need any changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to create a kitchen sink pseudo a.k.a any network
interface that one is only able to write to. This might seem
unnecessary, but it is possible to attach virtual network
interfaces on top of this pseudo interface. These virtual
interfaces could then process the data for example for
packet capture purposes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add a recv callback to dummy API. After this it is possible to
receive data by a dummy network interface. This is only useful
if one attaches a virtual interface on top of the dummy one.
One such example is the cooked mode capture interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
eth_stats.h is using ethernet api but not including the header,
it must be working by luck in files that include it after
something else that includes ethernet.h, fix by just including it.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There should be a particular defines which clarify the
use of that number. So, replacing numbers with defines
in wifi shell.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Once Wi-Fi is associated few parameters like listen interval and
power-save mode cannot be changed. The state for association is
"ASSOCIATED" and not completed. Even after state transitions to
COMPLETE, it can still go back to other states, e.g., PTK/GTK renewal.
Fix the state check.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The gPTP is not suppose to be run on top of VLAN and the
earlier support was just for testing purposes. Remove VLAN
support now after the VLAN overhaul.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print also network interface index together with the pointer value
in order to get more useful information what is going on in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Re-implement the VLAN support inside the network stack.
All the user facing APIs stay as is but internally the VLANs
are implemented using the L2 virtual interfaces.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some compilers have trouble parsing variables directly after a case
statement.
Fixes: #70792
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
By using `getopt_state` to access `optarg`, offering a better alternative
to direct global `optarg` access.
This approach mitigates the risks associated with concurrent access to
the global variable.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change marks each instance of the `struct option` as `static const`.
The rationale is that `struct option` is a read-only variable.
By using `static const`, we ensure immutability, leading to usage of only
the `.rodata` section and a reduction in the `.data` area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit simplifies the access to structure members and omits
unnecessary variable initializations.
Specific adjustments include:
- Moving from pointer-based access (`(®d)->chan_info`) to
direct structure member access (`regd.chan_info`).
- Removing explicit initializations where not required.
- Removing excess backslashes '\' before '%' in the format string.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Refactor the IP tunneling support as the input callback was removed
in previous commit. The data will flow through the recv callback now
as expected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The input callback was an unfortunate idea which just complicated
how the packet flows through virtual interfaces so removing it.
The data is passed normally through the recv callback from now on.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The function needs to loop through the virtual interfaces
tied to this physical interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Channel is mandatory for AP mode. It is processed only
if its less than or equal to three characters. Otherwise
we need to throw error for channel in AP mode.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Dwell time Active or Passive is optional in wifi scan.
If user don't set the Dwell time value, it will be set
as 0. We are adding a range check in scan extensions
for dwell time. So need to set default values.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
During stress test with WiFi connect, disconnect, ping and throughput
traffic, ARP table updating failed issue may occur.
In arp_prepare(), if packet allocate failed, should add the arp
entry back to arp_free_entries, to avoid this entry is leak forever.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Convert various networking subsystem files to use ARRAY_FOR_EACH
macro to make the looping more robust.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The netmask should be tied to the IPv4 address instead of being
global for the network interface.
If there is only one IPv4 address specified to the network interface,
nothing changes from user point of view. But if there are more than
one IPv4 address / network interface, the netmask must be specified
to each address separately.
This means that net_if_ipv4_get_netmask() and net_if_ipv4_set_netmask()
functions should not be used as they only work reliably if there is
only one IPv4 address in the network interface.
The new net_if_ipv4_get_netmask_by_addr() and
net_if_ipv4_set_netmask_by_addr() functions should be used as they make
sure that the netmask is tied to correct IPv4 address in the network
interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This ensures that the configured link address is
at least as big as the part of it that is used.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Since PR, PR_SHELL, PR_ERROR, PR_INFO, and PR_WARNING already have
an embedded `sh` NULL check, we can remove the change from PR #68809.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change reduces the memory footprint by changing the data type of
`valid_5g_chans_20mhz` from `uint16_t` to `uint8_t`.
Additionally, since the maximum channel number for 5GHz Wi-Fi is 177,
it can fit within the `uint8_t` range.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>