### Simple example: load module and run hostapd/wpa_supplicant Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/mac80211_hwsim.rst.txt Commands to build mac80211_hwsim into the kernel, load the module with modprobe, start hostapd on wlan0 as the access point, and start wpa_supplicant on wlan1 as the station. This sets up a two-radio simulation with WPA2-PSK authentication. ```shell # Build mac80211_hwsim as part of kernel configuration # Load the module modprobe mac80211_hwsim # Run hostapd (AP) for wlan0 hostapd hostapd.conf # Run wpa_supplicant (station) for wlan1 wpa_supplicant -Dnl80211 -iwlan1 -c wpa_supplicant.conf ``` -------------------------------- ### Wireless Environment Setup Example Source: https://wireless.docs.kernel.org/en/latest/en/users/documentation/hostapd.html Example hostapd configuration for SSID, hardware mode, and channel selection, with channel 1 chosen for minimal overlap. ```plaintext ssid=MyNetwork hw_mode=g channel=1 ``` -------------------------------- ### Install sparse with make Source: https://wireless.docs.kernel.org/en/latest/_sources/en/developers/documentation/using-sparse.rst.txt Build and install sparse by running 'make' followed by 'make install'. ```bash make make install ``` -------------------------------- ### Monitor interface creation example Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/documentation/iw/vif.rst.txt Example command to create a monitor interface. ```text iw phy phy0 interface add mon0 type monitor ``` -------------------------------- ### Example /etc/ssmtp/ssmtp.conf Source: https://wireless.docs.kernel.org/en/latest/_sources/en/developers/documentation/git-guide.rst.txt Example ssmtp configuration for an Exchange server. Adjust values to match your environment. ```bash root=hacker@company.com mailhub=smtp.company.com hostname=smtp.company.com FromLineOverride=YES UseSTARTTLS=YES AuthUser=hacker AuthPass=my-uber-secret-password ``` -------------------------------- ### Install compat-wireless-old Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/download/compat-wireless-old.rst.txt Install the built modules into the updates/ directory, leaving distribution drivers intact. ```bash sudo make install ``` -------------------------------- ### Set channel example Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/documentation/iw/vif.rst.txt Example command to set the channel of a monitor interface. ```text iw dev mon0 set channel 7 ``` -------------------------------- ### Mesh point interface creation example Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/documentation/iw/vif.rst.txt Example command to create a mesh point interface. ```text iw phy phy0 interface add mp0 type mp mesh_id MeshNetwork ``` -------------------------------- ### Frequency Range Example Source: https://wireless.docs.kernel.org/en/latest/en/developers/regulatory/processing_rules.html Extracts the frequency range portion of a regulatory rule, showing the start and end frequencies in MHz and the maximum allowed bandwidth. This example allows up to 40 MHz in the 2402-2482 MHz range. ```plaintext (2402 - 2482 @ 40) ``` -------------------------------- ### Add init script to PRODUCT_COPY_FILES Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/wcn36xx.rst.txt Edit device/lge/mako/device.mk to add init.mako.wcn36xx.sh to PRODUCT_COPY_FILES. ```makefile PRODUCT_COPY_FILES += \ device/lge/mako/init.mako.bt.sh:system/etc/init.mako.bt.sh \ device/lge/mako/init.mako.wcn36xx.sh:system/etc/init.mako.wcn36xx.sh ``` -------------------------------- ### Debug message examples Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/ath10k/codingstyle.rst.txt Shows the format for ath10k_dbg() messages: start with debug level, then command/event name, then parameters, all lowercase and no commas/colons/periods. ```c ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot suspend complete\n"); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %pK len %d ftype %02x stype %02x\n", msdu, skb->len, fc & IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE); ath10k_dbg(ar, ATH10K_DBG_MAC, "mac update sta %pM peer bw %d\n", sta->addr, bw); ``` -------------------------------- ### Mint on CM 10.1 build instructions Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/wcn36xx.rst.txt Instructions for building CM for Mint, including a workaround for a missing RPM.bin file. ```text * * - Follow instructions ([[http://wiki.cyanogenmod.org/w/Build_for_mint|http://wiki.cyanogenmod.org/w/Build_for_mint]]) do download and build CM sources. * * - In case of build error "No such file or directory: 'vendor/sony/blue-common/proprietary/boot/RPM.bin'" download file RPM.bin from [[https://github.com/TheMuppets/proprietary_vendor_sony|https://github.com/TheMuppets/proprietary_vendor_sony]] and put it to the folder 'vendor/sony/blue-common/proprietary/boot' * * - Flash built image to the phone as described here [[http://www.xperiablog.net/2012/12/04/how-to-install-cyanogenmod-10-on-your-sony-xperia-t-guide/|http://www.xperiablog.net/2012/12/04/how-to-install-cyanogenmod-10-on-your-sony-xperia-t-guide/]] ``` -------------------------------- ### Patch tag example with Signed-off-by and --- separator Source: https://wireless.docs.kernel.org/en/latest/en/developers/documentation/submittingpatches.html Shows the required format for patch tags when submitting patches inline. After the Signed-off-by lines, you must include '---' (three dashes) before the diffstat. The example includes a Signed-off-by line and the start of a diffstat. ```diff ... Signed-off-by: Luis R. Rodriguez --- include/net/ieee80211_regdomains.h | 196 ++++++++ ... ``` -------------------------------- ### Start hostapd with minimal configuration Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/documentation/hostapd.rst.txt Command to start hostapd with a minimal configuration file, followed by the expected output showing the configuration file and interface details. ```text hostapd # ./hostapd ./hostapd-minimal.conf Configuration file: ./hostapd-minimal.conf Using interface wlan1 with hwaddr 00:0d:0b:cf:04:40 and ssid 'test' ``` -------------------------------- ### Example hostapd config for 11ac VHT80 mode Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/ath10k/configuration.rst.txt Example hostapd configuration to use 11ac VHT80 mode with ath10k. The vht_oper_centr_freq_seg0_idx is calculated for VHT80 with channel + 6. If you get 'set channel failed to set in kernel', your regulatory database likely doesn't support 80 MHz channels. ```text interface=wlan0 driver=nl80211 ssid=ath10k-test hw_mode=a channel=36 ht_capab=[HT40+] ieee80211n=1 ieee80211ac=1 vht_oper_chwidth=1 vht_oper_centr_freq_seg0_idx=42 ``` -------------------------------- ### Context variable naming example Source: https://wireless.docs.kernel.org/en/latest/_sources/en/users/drivers/ath6kl/codingstyle.rst.txt Name context variables either "ar" or "ar_". Use ath6kl__priv() to get access to hif specific context. ```c struct ath6kl *ar = ptr; struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); ``` -------------------------------- ### Patch subject lines with version numbers Source: https://wireless.docs.kernel.org/en/latest/_sources/en/developers/documentation/submittingpatches.rst.txt Examples of patch subject lines showing the required version numbering starting from the second version. The first version does not need a version number, but subsequent versions must include it. ```text [PATCH] wifi: ath10k: fix DMA allocation [PATCH v2] wifi: ath10k: fix DMA allocation [PATCH v3] wifi: ath10k: fix DMA allocation ... [PATCH v11] wifi: ath10k: fix DMA allocation ``` -------------------------------- ### Mint on CM 10.1 build instructions Source: https://wireless.docs.kernel.org/en/latest/en/users/drivers/wcn36xx.html Instructions for building CM 10.1 for Mint, including a workaround for a missing RPM.bin build error. ```text * * - Follow instructions ([[http://wiki.cyanogenmod.org/w/Build_for_mint|http://wiki.cyanogenmod.org/w/Build_for_mint]]) do download and build CM sources. * * - In case of build error "No such file or directory: 'vendor/sony/blue-common/proprietary/boot/RPM.bin'" download file RPM.bin from [[https://github.com/TheMuppets/proprietary_vendor_sony|https://github.com/TheMuppets/proprietary_vendor_sony]] and put it to the folder 'vendor/sony/blue-common/proprietary/boot' * * - Flash built image to the phone as described here [[http://www.xperiablog.net/2012/12/04/how-to-install-cyanogenmod-10-on-your-sony-xperia-t-guide/|http://www.xperiablog.net/2012/12/04/how-to-install-cyanogenmod-10-on-your-sony-xperia-t-guide/]] ``` -------------------------------- ### Start transmitting Source: https://wireless.docs.kernel.org/en/latest/_sources/en/developers/pktgen.rst.txt Starts the pktgen transmission by writing 'start' to the pgctrl file. ```bash echo "start" > pgctrl ``` -------------------------------- ### Startup output: print_detector_specs and dfs_handler_init Source: https://wireless.docs.kernel.org/en/latest/_sources/en/developers/dfs/detectordesignnt.rst.txt Expected console output at boot, showing the detector's valid ranges and successful initialization. ```text [...] INIT: print_detector_specs: valid ranges: width=[0, 30], pri=[240, 5010], dur=112950 INIT: dfs_handler_init: ok ```