Intel Wi-Fi Control Path ====================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Version Info ` * :ref:`Control path ` .. _FreebsdDeviceDriver_wireless_fdd_wi-fi_chipset_wi-fi_control_path_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow * Wi-Fi Control Path .. _FreebsdDeviceDriver_wireless_fdd_wi-fi_chipset_wi-fi_control_path_step3: .. tab-set:: .. tab-item:: Version Info =============================== ======================================= # Version =============================== ======================================= Freebsd 14.1.0 wpa_supplicant 2.10 =============================== ======================================= .. _FreebsdDeviceDriver_wireless_fdd_wi-fi_chipset_wi-fi_control_path_step38: .. tab-set:: .. tab-item:: Control path .. tab-set:: .. tab-item:: wpa_supplicant to wlan entry point .. code-block:: c Ex: const struct wpa_driver_ops wpa_driver_bsd_ops = { .scan2 = wpa_driver_bsd_scan, }; * Defined in /usr/src/contrib/wpa/src/drivers/driver_bsd.c * The ‘struct wpa_driver_ops’ is a structure in wpa_supplicant (user-space daemon) that defines a set of function pointers for various operations that the driver needs to support to interact with the Wi-Fi hardware. * `wpa_driver_bsd_ops` It provides an interface between wpa_supplicant and the FreeBSD kernel's Wi-Fi driver. .. code-block :: c static int wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan_params *params) * Defined in /usr/src/contrib/wpa/src/drivers/driver_bsd.c * It is a driver interaction function responsible for sending scan requests to the kernel. This function issues an IOCTL system call/command. .. tab-set:: .. tab-item:: wlan entry * The WLAN (Wireless Local Area Network) functionality is handled primarily through the net80211 subsystem, which provides a comprehensive framework for wireless networking based on the IEEE 802.11 standard. * The net80211 framework is responsible for managing the core 802.11 wireless protocol stack in FreeBSD. It handles wireless-specific tasks such as scanning for networks, authentication, association, encryption, and managing wireless data traffic. .. code-block:: c int ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Defined in /usr/src/sys/net80211/ieee80211_ioctl.c * Once the ioctl request is received, it is handled by the FreeBSD 802.11 stack. This is the entry point in the kernel for ioctl calls related to 802.11 .. code-block:: c Struct ieee80211com { * scanning support */ void (*ic_scan_start)(struct ieee80211com *) }; * Defined in /usr/src/sys/net80211/ieee80211_var.h * The struct ieee80211com is a structure in the FreeBSD networking stack specifically within net80211 framework, which handles 802.11 (Wi-Fi) networking. * It provides an interact with actual Wi-Fi hardware * From ‘ic_scan_start’ as call back and called the linux_KPI functions .. tab-set:: .. tab-item:: wlan to iwlwifi entry point .. code-block:: c int linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) { ic->ic_scan_start = lkpi_ic_scan_start; } * Defined in sys/compat/linuxkpi/common/src/linux_80211.c * The LinuxKPI (Linux Kernel Programming Interface) in FreeBSD is a compatibility layer that allows certain Linux kernel functions and drivers to work on FreeBSD by providing equivalents or mappings to FreeBSD's own kernel APIs. * Many hardware vendors provide Linux drivers, but not FreeBSD drivers. The LinuxKPI layer enables FreeBSD to use Linux drivers by adapting Linux kernel function calls to FreeBSD equivalents. * In linuxkpi called the same ieee80211_ops call back functions and then enter intel driver(iwlwifi). .. code-block:: c struct ieee80211_ops { int (*hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_scan_request *); } * Defined in sys/compat/linuxkpi/common/include/net/mac80211.h .. code-block:: c struct ieee80211_ops iwl_mvm_hw_ops = { .hw_scan = iwl_mvm_mac_hw_scan, } * Defined in /usr/src/sys/contrib/dev/iwlwifi/mvm/mac80211.c * From the linuxkpi function finally calls the ieee80211 operation function. * ieee80211_ops define a set of operations (function pointers) for the 802.11 (Wi-Fi) hardware to handle various Wi-Fi tasks like scanning, association, and data transmission * iwl_mvm_hw_ops is the Intel-specific implementation for handling Wi-Fi hardware operations.