Add a set of modem shell commands to support modem development.
Start with:
modem list: Lists all registered modems and related information
modem send <modem receiver index> <command>: Send command to modem
Signed-off-by: Michael Scott <mike@foundries.io>
The WNC-M14A2A (LTE / LTE-M) modem is presented as an Arduino-
compatible shield via AT&T's IoT Starter Kit v1.0. It was
originally intended to work with the FRDM-K64F board, but
in theory as long as the right pins are configured it can
work with any board that supports Arduino-compatible headers.
The driver utilizes the CONFIG_NET_OFFLOAD setting to avoid the
normal handling of IP packets, and instead uses a socket-like
UART interface to handle incoming and outgoing data.
Signed-off-by: Michael Scott <mike@foundries.io>
Modem drivers need a fast buffer-based receiver for passing data
back and forth from the UART to the driver. This provides an
efficient configuarable driver which merely sends and receives
but doesn't process the data, that's left up to the modem driver.
Signed-off-by: Michael Scott <mike@foundries.io>
This change moves the logic for linearize and append_bytes from
the net_pkt sources into the net_buf sources where it can be
made available to layers which to not depend on net_pkt. It also,
adds a new net_buf_skip() function which can be used to iterated
through a list of net_buf (freeing the buffers as it goes).
For the append_bytes function to be generic in nature, a net_buf
allocator callback was created. Callers of append_bytes pass in
the callback which determines where the resulting net_buf is
allocated from.
Also, the dst buffer in linearize is now cleared prior to copy
(this was an addition from the code moved from net_pkt).
In order to preserve existing callers, the original functions are
left in the net_pkt layer, but now merely act as wrappers.
Signed-off-by: Michael Scott <mike@foundries.io>
This is a finishing commit in 802.1Qav support for SAM GMAC. It adds a
possibility to get and set all parameters required by the standard.
Note that to be fully compliant it requires a proper system
configuration, but the prioritizing mechanisms will work just fine
without it so it is not enforced in any way.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
If the application is using TC configuration compatible with HW
configuration (equal number of traffic classes and hardware queues)
setup the screening registers and chose queues based on the chosen TC
mapping.
Use the VLAN priority and hard-coded mappings only as a fallback.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Updating Qav params made it implicitly enable the Qav support itself.
Since we can now control the on/off status with a management request,
this is not a desired behavior.
Make it read the original register value before updating params and then
writing back what it was before.
Additionally we now have to explicitly enable Qav support in init.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The standard (and therefore the upper layer) is using bits per second,
the registers in SAM GMAC uses bytes per second - do the conversion
before writing the reg.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
With this commit all Qav parameters are tested and the fake driver
properly stores and recalculates info about all the Qav parameters to
make them available for read-back.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
This are all the parameters defined by the standard (12.21.1).
Additionally the parameters that are read-only are validated in the
ethernet_set_config callback.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Best Effort is the default priority with the assigned value of 0, but
Background is the lowest priority with the assigned value of 1.
Ref: IEEE 802.1Q, Chapter I.4, Table I-2.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The new mappings require at least two traffic classes so there are fewer
tests than there are for the strict mapping.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
This commits adds new priority to traffic class mappings and allows
users to choose which mapping to use through menuconfig.
The new mappings are recommended in 802.1 (chapter 34.5) for
time-sensitive applications supporting the credit-based sharper
algorithm.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Due to a misspelling in the existence check for the stored checksum
file, zephyr/.config was always regenerated from the config fragments
(e.g. prj.conf), overwriting any custom zephyr/.config configuration
done in e.g. menuconfig.
This bug was introduced by commit 5402662dd9 ("cmake: kconfig: Fix
rerunning cmake after Kconfig warnings").
Fixes: #9270
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Split out the arch specific syscall code to reduce include pollution
from other arch related headers. For example on ARM its possible to get
errno.h included via SoC specific headers. Which created an interesting
compile issue because of the order of syscall & errno/errno syscall
inclusion.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
In coap module previous test cases are modified as well as
new test functions are added to increase the code coverage
Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
Zephyr UART drivers offer very low-level functionality. Oftentimes,
it would be useful to provide higher-level wrappers around UART
device which would offer additional functionality. However, UART
driver irq callback routine receives just a pointer to (low-level)
UART device, and it's not possible to get to a wrapper structure
(without introducing expensive external mapping structures). This
is an indirect reason why the current UARt wrappers - uart_pipe,
console - are instantiated statically just for one underlying UART
device and cannot be reused for multiple devices.
Solve this by allowing to pass an arbitrary user data to irq
callback, set by new uart_irq_callback_user_data_set() function.
Existing uart_irq_callback_set() keeps setting a callback which
will receive pointer to the device.
While public API maintains compatibility, drivers themselves need
to be updated to support arbitrary user data storage/passing (as
legacy uart_irq_callback_set() functionality is now implemented in
terms of it).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Input length was accounting TC_AES_BLOCK_SIZE twice and consequently
not considering the whole cipher.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
do_cbc_decrypt() was not accounting IV's size in the input buffer.
Note that tinycrypt expects that IV and cipher text to be contiguous,
but input length must consider only the cipher text.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Update tinycrypt to latest revision, two commits after 0.2.8 release.
These commits are only bug fixes and one of them is fixing incorrect
buffer size in decryption with CBC mode.
This algorithm is being used by tinycrypt shim and is tested in
samples/drivers/crypto/.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The runtime filters (both aggregated and per-backend) are all getting
initialized to the default level CONFIG_LOG_DEFAULT_LEVEL. This is not
correct behavior: the initial runtime setting for each source ID
should match its compile-time level setting.
Otherwise, setting CONFIG_LOG_RUNTIME_FILTERING=y changes the logging
behavior for messages that pass the compile time filter check, but not
the runtime check (this currently happens when LOG_LEVEL=4, since
CONFIG_LOG_DEFAULT_LEVEL=3).
Fix this by initializing all filters to their module's compile time
settings. Also make sure that filters are set up before backends are
activated, to avoid race conditions.
Fix a stray documentation typo while we are here.
Signed-off-by: Marti Bolivar <marti@foundries.io>
The documentation says a module can be split up over multiple files,
but there's no good way to do that. In the file with the
LOG_MODULE_REGISTER() call, the definitions of the module's state
variables serve as declarations that LOG_DBG(), etc. can use. But in
other files making up the module, no such declarations are available,
and the macro expansion bombs out spectacularly and confusingly.
Fix this by adding a LOG_MODULE_DECLARE() macro which other files in
the module can use to declare the internal state used by the log
module, so that LOG_DBG() etc. work properly.
Keep the documentation up to date.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Settings consider the character space the end of the value, so instead
encode the name using settings_str_from_bytes and restore it with
settings_bytes_from_str.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Modified the web page to make it direct and easier to understand.
Major changes being the selection of the directory in the Zephyr SDK
Installation and a Note added for the '.zephyrrc' to include the SDK
installation location if not default.
Minor changes involving the elimination of repeated use of same sentence
with different Host OS and indentation correction in the Fedora section
since it showed up in 'white text' rather than code block.
SDK's '.zephyrrc' documentation needed to have the default location and
the user defined location
Signed-off-by: Arjun Warty <arjun.warty@nxp.com>
Commit b3d165f ("scripts: kconfig: Handle warnings generated
during evaluation") made it common for kconfig.py to fail after writing
zephyr/.config. This confuses the configuration fragment checksum logic
in cmake/kconfig.cmake, because it expects the saved checksum file to
exist if zephyr/.config exists.
The end result is a CMake error when rerunning the configuration after
non-whitelisted Kconfig warnings.
Fix it by only writing zephyr/.config (and zephyr/include/autoconf.h) in
kconfig.py if there are no warnings-turned-errors.
Also check if the saved checksum file exists in kconfig.cmake before
trying to open it. Normally this shouldn't happen though.
Move the writing of the checksum file to before writing zephyr/.config
as well. That way, zephyr/.config only gets written if the other
operations succeed.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Initially missing function prototypes warnings and undefined macro
warnings were disabled to quickly prototype the posix arch and
native_posix board.
But there is no excuse anymore to have this warnings disabled.
=> enable them.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
unistd.h was missing (used by read, close..)
printk header was also missing, but replace it's use
with posix_print_trace: It is faster and does not require
any Zephyr functionality to work.
fflush is not needed in this case.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The native_posix random driver uses random() and srandom()
whicha are old XOPEN POSIX extension (part of POSIX 2001).
To avoid compiler warnings due to the host libC headers
not including this prototypes otherwise, let's define
this 2 macros.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
A few function prototypes were missing in the native_posix
board and its drivers.
Let's add them.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
When compiling with the native_posix console, the prototype
for posix_flush_stdout() was missing => added.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
- Get rid of duplicate I2C dependencies, which show up in the
documentation as e.g. 'I2C && I2C'. The 'source's in
drivers/i2c/Kconfig are already within an 'if I2C' block.
- Factor out I2C_GPIO_<n> dependencies in drivers/i2c/Kconfig.gpio into
'if I2C_GPIO_<n>' blocks.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add a Getting Started section in the README.rst for quick and easy
access to what is arguably the most read page of our doc website.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Replace the current title with an image containing the Zephyr logo for
the root README.rst, in order to make the GitHub landing page more
attractive.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The dummy L2 does not setup the link layer address. Do not check the
source and destination link layer addresses when routing packets
otherwise packet routing will not work when using a dummy L2.
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the test is testing neighbor discovery which needs to know
link addresses, we must run the test using Ethernet L2.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Unspecified address 0.0.0.0 was used as a requested IPv4 address
because the ARP message was generated second time. So for IPv4
autoconf ARP message, generate the message only once.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allows ethernet drivers to provide vendor specific statistics
and details in the form of key-value pairs with the name of
the staticstic and its value.
The new string tables will be behind a new config:
NET_STATISTICS_ETHERNET_VENDOR
Suggested-by: Jukka Rissanen <jukka.rissanen@intel.com>
Signed-off-by: Jonathan Yong <jonathan.yong@intel.com>
If a disconnection callback was registered, it is not called
as the check done in net_app is reversed. The disconnection callback
is not called if there are any inactive contexts.
The check should be on any active context.
Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
Normally App Keys are identified using the AppKey Index value (a 12
bit value in practice), whereas the stack-internal array index has
very little relevance.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When we receive a security request we need to make sure that any
existing keys contain an LTK to encrypt with. Otherwise there's a risk
of trying to encrypt with an all-zeroes LTK.
Fixes#3221
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>