Commit graph

28 commits

Author SHA1 Message Date
Jordan Yates ef21569ac9 wifi: conn_mgr connectivity bindings
Bind WiFi network devices to the generic WiFi connectivity backend if
the appropriate option is set.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-30 18:51:46 -05:00
Chaitanya Tata a132487fec net: wifi: Move Wi-Fi ops to a separate struct
Decouple interface and Wi-Fi APIs, Wi-Fi APIs are common independent of
Wi-Fi offload or implemented natively (This is preparation for
introducing Native Wi-Fi).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-11 14:55:30 +02:00
Ajay Parida 69fead1998 net: mgmt: Support for forced Passive scan
Default scan mode is Active. User can force the scan mode to passive
through Kconfig option or using 'passive' option from shell.
Using either of this option will override regulatory settings and
forces all scan channels to be passive only.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-06-29 21:05:41 +02:00
Chaitanya Tata 7987098497 drivers: wifi: Register Wi-Fi architecture type
Identify the Wi-Fi capability to the networking stack and also the type
of Wi-Fi (Native vs Offloaded), this helps identifying Wi-Fi interfaces
that can be used by applications.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-06-26 16:12:32 +02:00
Georges Oates_Larsen 3c6b7dc35a net: dummy L2 for offloaded ifaces
Adds dummy link layer for offloaded ifaces, allowing
ifaces to directly receive l2_enable calls

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-03-20 09:53:25 +01:00
Sylvio Alves 20c3256016 net: wifi: Allow to use offloaded wifi_mgmt API with native stack
wifi drivers that depends on native ethernet stack cannot perform
wifi API calls missing availability. This changes adds the ethernet_api
interface in wifi_mgmt so that it becomes possible.

Naming "offload" in "struct net_wifi_mgmt_offload" is kept because
Zephyr still has no supplicant to handle a full non-offloaded driver.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-08-29 17:31:17 +02:00
Gerard Marull-Paretas fd2052d524 drivers: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Robert Lubos fa8ba73833 net: if: Connect interface with offloaded socket implementation
Instead of keeping a boolean informing whether a network interface is
offloaded at socket layer or not, keep a pointer to a function which
allows to create an offloaded socket. Native interfaces keep this as
NULL, while for offloaded interfaces it allows to connect an offloaded
socket implementation with an interface.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-04-20 11:27:05 +02:00
Nazar Kazakov 9713f0d47c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-14 20:22:24 -04:00
Gerard Marull-Paretas 0efc185018 drivers: wifi: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:25:39 -04:00
Peter Bigot 9fcd75160e drivers: wifi: rote conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Be aware that this does not address architectural errors in the use
of the work API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-14 07:07:40 -04:00
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Vincent Wan 53f408afe8 drivers: wifi: simplelink: enable IPv6 support
IPv6 support was not fully implemented in the driver and was disabled.
This commit completes the implementation and enables it when
configured.

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-07-21 15:08:56 +02:00
Marcin Niestroj 967f485f38 drivers: wifi: simplelink: fix typo in logged option name
Fix typo in logged Kconfig option name that is missing in used
configuration. This one was mostly problematic for developers wanting to
find such option in source tree using grep - NET_SOCKET_OFFLOAD was not
found in Kconfig files.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-16 07:19:56 -05:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Carles Cufi c61faf6c55 drivers: wifi: Port the simplelink wifi to the new timeouts API
Port the code so it uses the new timeouts API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Tomasz Bursztyka 4ae72db135 net: Enable PM settings on network devices
By changing the various *NET_DEVICE* macros. It is up to the device
drivers to either set a proper PM function or, if not supported or PM
disabled, to use device_pm_control_nop relevantly.

All existing macro calls are updated. Since no PM support was added so
far, device_pm_control_nop is used as the default everywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Robert Lubos ece552c644 drivers: wifi: simplelink: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Including the following fixes from the review:

* The fd returned by the socket accept call needs to be finalized,
  similar to how it is done for socket creation.

* sl_RecvFrom() in TI SimpleLink Host driver does not support NULL
  pointers for 'from' address and address length, and sl_SendTo() does
  not ignore the destination address when in connection mode, so passing
  NULL would cause a failure. These issues have been reported to TI
  (CC3X20SDK-1970, CC3X20SDK-1971).

  Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case
  of NULL addresses.

* simplelink_poll() should not process negative file descriptors in the
  fds array after sl_Selecti() returns. A negative fd value indicates
  that the entry is invalid and should be ignored.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Vincent Wan 7bcaf3696d drivers: wifi: simplelink: fixes to support CONFIG_NET_NATIVE=n
Remove unnecessary calls to net_if_ipv4_addr_add() and
net_if_ipv4_set_gw(), to prevent link errors when CONFIG_NET_NATIVE
is set to n.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 12:45:38 +03:00
Patrik Flykt 97b3bd11a7 drivers: Rename reserved function names
Rename reserved function names in drivers/ subdirectory. Update
function macros concatenatenating function names with '##'. As
there is a conflict between the existing gpio_sch_manage_callback()
and _gpio_sch_manage_callback() names, leave the latter unmodified.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Gil Pitney 7f956a9353 drivers: wifi: simplelink: add timeout for fast connect feature
The SimpleLink wifi driver enables the Fast Connect method of
WiFi provisioning, which allows the network coprocessor to
reconnect to a previously connected Access Point (AP) on
startup.

Previously, if Fast Connect failed to connect, any network
socket applications would inevitably fail, as there would have
been no wifi connection.

This patch adds a configurable timeout for the Fast Connect
feature, after which timeout, an error is logged informing
the user to manually reconnect to an AP.

Reconnection is typically accomplished by separately running the
wifi sample shell program.

Fixes: #11889

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2019-01-18 12:32:59 +02:00
Gil Pitney 1022b85c0f drivers: wifi: simplelink: Implement offloaded getaddrinfo()
This offloads the getaddrinfo() socket operation to the
simplelink WiFi driver, via a socket_offload hook.

This was validated using http_get on cc3220sf_launchxl.

Also implements freeaddrinfo().

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-12 13:06:53 +03:00
Gil Pitney c2cdbbafd7 net: sockets: Get socket offload to build after net logging overhaul.
Also, defines one LOG_MODULE_NAME for the simplelink WiFi driver, and
uses the same name for all files in this driver (module).

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 15:51:57 +03:00
Gil Pitney 7520bb21bc drivers: wifi: simplelink: Move NWP configuration to iface_init
Previously, the NWP (Network Coprocessor) was configured during
simplelink_init().

Since the SimpleLink "FastConnect" feature was added,
meaning an automatic reconnect can occur at this time, this
results in early callbacks into the network stack
before it was fully initialized, resulting in a NULL iface
ptr being sent in as argument.

Now, for safety, the NWP startup is moved later to iface_init,
where it more logically belongs.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 14:32:48 +03:00
Jukka Rissanen 69eeddd8a9 drivers: wifi: Convert to use new logging
Convert the wifi drivers to use the new logging system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-05 10:08:32 -04:00
Gil Pitney 71182cb294 driver: wifi: simplelink: Register socket offload operations.
If the SimpleLink WiFi driver is configured, and socket offload
enabled, this revectors the Zephyr BSD socket APIs to the SimpleLink
WiFi host driver BSD socket APIs, providing a
direct offload of the TCP/IP stack to the CC3220SF network
coprocessor.

Fixes #3706

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-09-11 18:42:34 +03:00
Gil Pitney c90170c5c5 drivers: wifi: simplelink: move files into a dedicated subdir
Place simplelink driver files into a subdirectory on par with
winc1500 subdirectory, to effect a better file organization.

No functional change in this patch.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-07-12 19:17:45 -05:00
Renamed from drivers/wifi/simplelink.c (Browse further)