Intel Wi-Fi Init 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:`Init path ` .. _FreebsdDeviceDriver_wireless_fdd_wi-fi_chipset_wi-fi_init_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 init path .. _FreebsdDeviceDriver_wireless_fdd_wi-fi_chipset_wi-fi_init_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_init_path_step37: .. tab-set:: .. tab-item:: Init path .. tab-set:: .. tab-item:: Device structure * Abstract representation of a device * Defined in /usr/src/stand/kshim/bsd_kernel.h .. code-block:: c typedef struct device *device_t; struct device { TAILQ_HEAD(device_list, device) dev_children; TAILQ_ENTRY(device) dev_link; struct device *dev_parent; const struct module_data *dev_module; void *dev_sc; void *dev_aux; driver_filter_t *dev_irq_filter; driver_intr_t *dev_irq_fn; void *dev_irq_arg; uint16_t dev_unit; char dev_nameunit[64]; char dev_desc[64]; uint8_t dev_res_alloc:1; uint8_t dev_quiet:1; uint8_t dev_softc_set:1; uint8_t dev_softc_alloc:1; uint8_t dev_attached:1; uint8_t dev_fixed_class:1; uint8_t dev_unit_manual:1; }; * The device object represents a piece of hardware attached to the system. * Ex: expansion card, the bus which that card is plugged into, disk drives attached to the expansion card, … * The system defines one device, - root_bus. * All other devices are created dynamically during auto configuration. * device_probe_and_attach() * initialise a device * This function is called during autoconfiguration to initialise the devices in the system. * For each device, the DEVICE_PROBE method of each suitable driver is called and if a probe succeeds, a description of the device is printed and the DEVICE_ATTACH method is called * DEVICE_PROBE * Probe for device existence * Method should probe to see if the device is present. * DEVICE_ATTACH * Attach a device * Attach a device to the system after the DEVICE_PROBE() method has been called and has indicated that the device exists .. tab-set:: .. tab-item:: Driver structure * structure describing a device driver * Defined in /usr/src/stand/kshim/bsd_kernel.h .. code-block:: c test:~$ typedef struct driver driver_t; struct driver { const char * name; const struct device_method *methods; uint32_t size; }; * Driver is registered with the system by the DRIVER_MODULE macro * Each driver will implement one or more sets of methods called interfaces * Ex: methods from Device interface, methods from Bus interface .. tab-set:: .. tab-item:: Communication 1. wlan(net80211 driver) 2. linuxkpi(linux kernel functions and drivers to work on FreeBSD) 3. iwlwifi(enter intel driver) .. tab-set:: .. tab-item:: Init Path .. code-block:: shell device_probe_and_attach() device_probe() pci_probe() // pci controller device_attach() pci_attach() // pci controller