### Starting wpa_supplicant in Debug Mode (Shell) Source: https://context7_llms Command to start wpa_supplicant with verbose debugging output. Logs are redirected to a file named 'log'. ```shell wpa_supplicant -i wifi0 -D nl80211 -c sta_settings.conf -ddddt > log & ``` -------------------------------- ### Starting wpa_supplicant Process Source: https://context7_llms Command to start the wpa_supplicant process. It requires specifying the interface name, driver, configuration file, and logs output to 'supp.log'. The '&' runs it in the background. ```bash wpa_supplicant -i -D nl80211 –c sta_settings.conf –dddt > supp.log & ``` -------------------------------- ### Install FREERADIUS Server 3.0.9 Source: https://context7_llms Steps to download, configure, compile, and install the FREERADIUS server version 3.0.9 from a tarball. Requires development packages for libtalloc and openssl. ```bash # tar zxvf freeradius-server-3.0.9.tar.gz # cd freeradius_3.09 # ./configure # make # make install ``` -------------------------------- ### Install hostapd Package Source: https://context7_llms This command installs the hostapd software, which is necessary for creating and managing Wi-Fi access points. It uses the apt-get package manager to download and install the package and its dependencies. ```c # apt-get install hostapd ``` -------------------------------- ### Starting hostapd as RADIUS Server (Shell) Source: https://context7_llms Command to start the hostapd service in a new terminal, acting as a RADIUS server. Verbose debugging is enabled with '-ddddd'. ```shell hostapd hostapd_server.conf -ddddd ``` -------------------------------- ### Start FREERADIUS Server Source: https://context7_llms Command to launch the FREERADIUS server in debugging mode (-X). This is used to start the server after configuration. ```bash # radiusd -X ``` -------------------------------- ### Install nLink Driver Dependencies (Shell) Source: https://context7_llms This snippet shows the commands required to install the necessary kernel modules (dependencies) before installing the nLink driver itself. These modules are essential for the driver's functionality. ```shell #modprobe mac80211 ``` ```shell #modprobe cfg80211 ``` ```shell #modprobe bluetooth ``` -------------------------------- ### Start hostapd Application Source: https://context7_llms This command starts the hostapd application in the background, using the specified configuration file ('ap.conf'). It also enables debug logging to a file ('log_file') for troubleshooting. ```c # hostapd ap.conf –dddt > log_file & ``` -------------------------------- ### Starting hostapd in AP Mode (Shell) Source: https://context7_llms Command to start the device in Access Point (AP) mode using hostapd with the specified configuration file. Logs are redirected to 'log', and DHCP server is started on the 'wifi1' interface. ```shell # hostapd hostapd_eap.conf -ddddt >log & # sh dhcp_server.sh wifi1 where wifi1 is the interface name ``` -------------------------------- ### Start FreeRADIUS Server Source: https://context7_llms Launch the RADIUS server in debug mode with the -X flag to display verbose logging output for monitoring authentication requests and troubleshooting. ```bash radiusd -X ``` -------------------------------- ### Install RSI Driver with ULP GPIO Handshake Source: https://context7_llms This command installs the rsi_91x.ko driver, enabling ULP GPIO handshake. It requires specifying sleep type, handshake mode, and the GPIO pins for reading and writing. ```bash # insmod rsi_91x.ko ps_sleep_type= ulp_handshake_mode=1 ulp_gpio_read=X ulp_gpio_write=Y ``` -------------------------------- ### Bluetooth Device Pairing and Connection using bluetoothctl Source: https://context7_llms This snippet demonstrates how to pair, trust, and connect a Bluetooth device using the `bluetoothctl` command-line utility. It covers essential commands for managing Bluetooth connections and provides an example of the output after a successful connection. ```bash # bluetoothctl -a [bluetooth]# power on [bluetooth]# scan on [bluetooth]# pair 64:CC:2E:9C:23:BA [bluetooth]# connect 64:CC:2E:9C:23:BA Attempting to connect to 64:CC:2E:9C:23:BA [bluetooth]# disconnect CC:2E:9C:23:BA Attempting to connect to 64:CC:2E:9C:23:BA [CHG] Device 64:CC:2E:9C:23:BA Connected: yes [CHG] Device 64:CC:2E:9C:23:BA Modalias: bluetooth:v001Dp1200d1436 [CHG] Device 64:CC:2E:9C:23:BA UUIDs: 00001103-0000-1000-8000-00805f9b34fb [CHG] Device 64:CC:2E:9C:23:BA UUIDs: 00001105-0000-1000-8000-00805f9b34fb [CHG] Device 64:CC:2E:9C:23:BA UUIDs: 00001106-0000-1000-8000-00805f9b34fb [CHG] Device 64:CC:2E:9C:23:BA UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Device 64:CC:2E:9C:23:BA UUIDs: 0000110c-0000-1000-8000-00805f9b34fb** ``` -------------------------------- ### Load Wi-Fi Driver Modules and Start Interface Source: https://context7_llms Loads the necessary Wi-Fi driver modules (rsi_91x, rsi_usb/rsi_sdio) and configures a network interface in station mode using iw. It also stops the NetworkManager service. ```bash # insmod rsi_91x.ko and insmod rsi_usb.ko or insmod rsi_sdio.ko as per the instructions mentioned in Section # service NetworkManager stop # iw phy phyX interface add wifi0 type managed X is the phy number it will vary, following command can be used to find the X value. $ iw list |grep phy ``` -------------------------------- ### Build nLink Driver with Cross-Compilation (Shell) Source: https://context7_llms This section demonstrates how to build the nLink driver using the 'make' command. It provides examples for cross-compilation on embedded platforms like iMX6 and ARM, specifying the kernel path and toolchain path. ```shell # make ``` ```shell KERNELDIR=home/test/Wand/armv7-multiplatform/KERNEL ``` ```shell make ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi- ``` -------------------------------- ### Start Bluetooth Inquiry - hcitool HCI Command Source: https://context7_llms Initiates the Bluetooth inquiry process to discover nearby devices. Requires LAP (3 bytes, range 0x9E8B00-0x9E8B3F), inquiry duration (0x01-0x30 for 1.28-61.44 seconds), and number of responses (0x01-0xFF). ```bash hcitool -i cmd 0x01 0x01 ``` -------------------------------- ### Configure ULP Device Power Save (SDIO) Source: https://context7_llms This command installs the driver to enable Ultra Low Power (ULP) device power save mode, specifically for the SDIO interface. The `ps_sleep_type=2` parameter enables ULP mode, and `ulp_handshake_mode` configures the handshake protocol for ULP operations. ```bash # insmod rsi_91x.ko rsi_zone_enabled=1 dev_oper_mode= ps_sleep_type=2 ulp_handshake_mode= # For No handshake : ulp_handshake_mode = 0 # For GPIO based handshake : ulp_handshake_mode = 1 # For Packet based handshake : ulp_handshake_mode = 2 (Default) # insmod rsi_sdio.ko ``` -------------------------------- ### Start WPA Supplicant with nl80211 Driver Source: https://context7_llms Initiates the WPA supplicant daemon for Wi-Fi interface management using the nl80211 driver. The command specifies the interface name, driver type, configuration file, and logging verbosity. Logs are redirected to a file for debugging purposes. ```bash wpa_supplicant -i wifi0 -D nl80211 -c sta_settings.conf -dddt > supp.log & ``` -------------------------------- ### Configure LP Device Power Save (SDIO/USB) Source: https://context7_llms This command installs the driver to enable Low Power (LP) device power save mode. The `ps_sleep_type=1` parameter specifically enables LP mode. Separate commands are used for USB and SDIO interfaces. ```bash # insmod rsi_91x.ko rsi_zone_enabled=1 dev_oper_mode= ps_sleep_type=1 # For USB interface : # insmod rsi_usb.ko # For SDIO interface : # insmod rsi_sdio.ko ``` -------------------------------- ### Check Driver and LMAC Version Source: https://context7_llms Retrieves the installed RS911X driver version and LMAC (Link MAC) firmware version from the kernel debug interface. Returns formatted version strings for both driver and firmware components. ```bash # cat /sys/kernel/debug/phy/version # Sample output: # Driver : RS911X.NB0.NL.GNU.LNX.OSD.2.0.1 # LMAC : 1610.2.0.0.0009 ``` -------------------------------- ### Prepare and Build nLink Driver from Kernel Source (Shell) Source: https://context7_llms This demonstrates the process of building the nLink driver directly from the kernel source. It involves copying the driver to the kernel's wireless directory, renaming Makefiles, configuring options via 'make menuconfig', and finally building the driver. ```shell # mv Makefile Makefile_local ``` ```shell # mv Makefile_ker Makefile ``` ```shell # make menuconfig ``` ```shell # make M=drivers/net/wireless/rsi ``` -------------------------------- ### Configure and Build FreeRADIUS Server Source: https://context7_llms Navigate to the extracted FreeRADIUS directory and run the configure script to check prerequisites and prepare the build environment. This step verifies dependencies like libtalloc before compilation. ```bash cd freeradius-server-release_x_x_x/ ./configure ``` -------------------------------- ### Install Missing FreeRADIUS Dependencies Source: https://context7_llms Install required system packages for FreeRADIUS compilation. Use dnf package manager to resolve dependency errors encountered during configuration. ```bash dnf install libtalloc* ``` -------------------------------- ### Configure Build Flags for nLink Driver (C) Source: https://context7_llms This snippet shows how to navigate to the driver's source directory and set KERNELDIR for building the driver. It highlights the importance of build flags for optimizing binary size, especially on embedded systems. ```c # cd rsi ``` ```c KERNELRELEASE=$(Shell uname -r) KERNELDIR=/lib/modules/$(KERNELRELEASE)/build ``` -------------------------------- ### Extract FreeRADIUS Server Archive Source: https://context7_llms Untar the downloaded FreeRADIUS server release archive to extract source files for compilation and installation. ```bash tar -xvf freeradius-server-release_x_x_x.tar.gz ``` -------------------------------- ### Configure FREERADIUS Users File Source: https://context7_llms Instructions to edit the FREERADIUS users file to define identities and passwords for authentication. An example entry is provided for testing. ```bash ### vim /usr/local/etc/raddb/users # Add the following line at the starting in the users file test Cleartext-Password := "password" ``` -------------------------------- ### HCI Commands for OGF 0x01 - Connection and Link Management Source: https://context7_llms This snippet lists HCI commands related to connection establishment, management, and link key operations for OGF 0x01. It specifies whether each command is supported and provides the corresponding macro defined in the source code. ```text HCI_Inquiry | HCI_OP_INQUIRY HCI_Inquiry_Cancel | HCI_OP_INQUIRY_CANCEL HCI_Periodic_Inquiry_Mode | HCI_OP_PERIODIC_INQUIRY_MODE HCI_Exit_Periodic_Inquiry_Mode | HCI_OP_EXIT_PERIODIC_INQUIRY HCI_Create_Connection | HCI_OP_CREATE_CON HCI_Disconnect | HCI_OP_DISCONNECT HCI_Create_Connection_Cancel | HCI_OP_CREATE_CON_CANCEL HCI_Accept_Connection_Request | HCI_OP_ACCEPT_CONN_REQ HCI_Reject_Connection_Request | HCI_OP_REJECT_CONN_REQ HCI_Link_Key_Request_Reply | HCI_OP_LINK_KEY_REQ_RPLY HCI_Link_Key_Request_Negative_Reply | HCI_OP_LINK_KEY_REQ_NEGATIVE_RPLY HCI_PIN_Code_Request_Reply | HCI_OP_PIN_CODE_REQUEST_RPLY HCI_PIN_Code_Request_Negative_Reply | HCI_OP_PIN_CODE_REQUEST_NEGATIVE_RPLY HCI_Change_Connection_Packet_Type | HCI_OP_CHANGE_CONN_PKT_TYPE HCI_Authentication_Requested | HCI_OP_AUTH_REQ HCI_Set_Connection_Encryption | HCI_OP_SET_CONN_ENCRYPTION HCI_Change_Connection_Link_Key | HCI_OP_CHANGE_CONN_LINK_KEY HCI_Master_Link_Key | HCI_OP_MASTER_LINK_KEY HCI_Remote_Name_Request | HCI_OP_REMOTE_NAME_REQ HCI_Remote_Name_Request_Cancel | HCI_OP_REMOTE_NAME_REQ_CANCEL HCI_Read_Remote_Supported_Features | HCI_OP_READ_REMOTE_SUPP_FEATURES HCI_Read_Remote_Extended_Features | HCI_OP_READ_REMOTE_EXT_SUPP_FEATURES HCI_Read_Remote_Version_Information | HCI_OP_READ_REMOTE_VERS_INFO HCI_Read_Clock_Offset | HCI_OP_READ_REMOTE_CLK_OFFSET HCI_Read_LMP_Handle | HCI_OP_READ_LMP_HANDLE HCI_Setup_Synchronous_Connection | HCI_OP_SETUP_SYNCHRONOUS_CONN HCI_Accept_Synchronous_Connection_Request | HCI_OP_ACCEPT_SYNCHRONOUS_CONN HCI_Reject_Synchronous_Connection_Request | HCI_OP_REJECT_SYNCHRONOUS_CONN HCI_IO_Capability_Request_Reply | HCI_OP_IO_CAP_REQ_RPLY HCI_User_Confirmation_Request_Reply | HCI_OP_USER_CONFIRM_REQ_RPLY HCI_User_Confirmation_Request_Negative_Rep | HCI_OP_USER_CONFIRM_REQ_NEGATIVE_RPLY HCI_User_Passkey_Request_Reply | HCI_OP_USER_PASS_KEY_REQ_RPLY HCI_User_Passkey_Request_Negative_Reply | HCI_OP_USER_PASS_KEY_REQ_NEGATIVE_RPLY HCI_Remote_OOB_Data_Request_Reply | HCI_OP_REMOTE_OOB_DATA_REQ_RPLY HCI_Remote_OOB_Data_Request_Negative_Reply | HCI_OP_REMOTE_OOB_DATA_REQ_NEGATIVE_RPLY HCI_IO_Capability_Request_Negative_Reply | HCI_OP_IO_CAP_REQ_NEGATIVE_RPLY HCI_Create_Physical_Link | HCI_OP_CREATE_PHYSICAL_LINK HCI_Accept_Physical_Link | HCI_OP_ACCEPT_PHYSICAL_LINK HCI_Disconnect_Physical_Link | HCI_OP_DISCONNECT_PHYSICAL_LINK HCI_Create_Logical_Link | HCI_OP_CREATE_LOGICAL_LINK HCI_Accept_Logical_Link | HCI_OP_ACCEPT_LOGICAL_LINK HCI_Disconnect_Logical_Link | HCI_OP_DISCONNECT_LOGICAL_LINK HCI_Logical_Link_Cance | HCI_OP_LOGICAL_LINK_CANCEL HCI_Flow_Spec_Modify | HCI_OP_FLOW_SPEC_MODIFY ``` -------------------------------- ### Get Bluetooth Local BD Address - hcitool HCI Command Source: https://context7_llms Retrieves the 6-byte Bluetooth Device (BD) address of the local device. No input parameters required. ```bash hcitool -i cmd 0x04 0x09 ``` -------------------------------- ### Get PHY MAC Address Source: https://context7_llms Retrieves the MAC address for a specific physical wireless device (phy). This is useful for identifying the correct wireless interface when multiple are present. ```bash cat /sys/class/ieee80211/phyX/macaddress ``` -------------------------------- ### Hostapd Configuration: Basic AP Settings Source: https://context7_llms This snippet demonstrates essential parameters for a hostapd configuration file (ap.conf) to set up a Wi-Fi AP. It includes interface name, driver type, country code, SSID, hardware mode, beacon interval, and channel. ```c interface= driver=nl80211 country_code=IN ssid=Test_AP hw_mode=g beacon_int=100 channel=6 ``` -------------------------------- ### Configure SDIO Clock Speed Source: https://context7_llms Sets SDIO interface clock frequency during driver installation. Applicable only for SDIO interface. Valid range is 1-50MHz with default value of 50MHz. ```c sdio_clock range: 1 - 50MHz Default value: 50MHz ``` -------------------------------- ### Kill Existing wpa_supplicant Process Source: https://context7_llms Before starting hostapd, this command ensures that no other Wi-Fi supplicant process is running in the background, preventing conflicts. It targets and terminates all processes named 'wpa_supplicant'. ```c # killall wpa_supplicant ``` -------------------------------- ### Configure BT Classic Only Mode (C) Source: https://context7_llms Sets the device operational mode to 4 for Bluetooth Classic only. Ensures the BT interface is detected after installation. This mode supports only one connection. ```c dev_oper_mode = 4 ``` -------------------------------- ### WPA_supplicant Configuration: Basic Settings Source: https://context7_llms Defines the control interface and update configuration for wpa_supplicant. These are fundamental settings for managing the supplicant process. ```c ctrl_interface=/var/run/wpa_supplicant update_config=1 ``` -------------------------------- ### Configure BLE Only Mode (C) Source: https://context7_llms Sets the device operational mode to 8 for Bluetooth Low Energy (BLE) only. This mode supports up to 3 connections. Ensure the BLE interface is detected after installation. ```c dev_oper_mode = 8 ``` -------------------------------- ### Copy Certificates for Station Configuration Source: https://context7_llms Copies the 'certs' folder, containing necessary certificates, from the driver directory to the '/etc/' directory on the system. This is a prerequisite for configuring the station to connect to an EAP-enabled AP. ```bash # cp -rvf certs /etc/ ``` -------------------------------- ### Get Regulatory Domain Information Source: https://context7_llms Retrieves the current regulatory domain settings for the wireless interface, including allowed frequency ranges and channel configurations. This is useful for understanding regional wireless compliance. ```bash iw reg get ``` -------------------------------- ### Enable Driver Debug Zone via Debugfs Source: https://context7_llms Enables specific debug zones after driver installation through the debugfs interface. Allows runtime modification of debug output without reloading the driver module. ```bash # echo > /sys/kernel/debug/phy/debug_zone ``` -------------------------------- ### WPA_supplicant Configuration: Open Network Source: https://context7_llms Configures connection to an open, non-secure Wi-Fi network. Requires only the SSID and sets the management key to NONE. ```c network={ ssid="" key_mgmt=NONE priority=3 } ``` -------------------------------- ### Configure Wi-Fi + BT STA Mode (C) Source: https://context7_llms Sets the device operational mode to 5 for Wi-Fi Station (STA) and Bluetooth Classic coexistence. Follow separate instructions for Wi-Fi and Bluetooth installations. ```c dev_oper_mode = 5 (Wi-Fi STA + BT) ``` -------------------------------- ### List and Control RFkill Wireless Interfaces Source: https://context7_llms Manages wireless device states using the RFKill framework. It allows listing all wireless interfaces and blocking or unblocking them by their interface number. Requires the 'rfkill' package to be installed. ```bash # rfkill list ``` ```bash # rfkill block ``` ```bash # rfkill unblock ``` -------------------------------- ### Verify AP Mode Status (Success) Source: https://context7_llms This command checks the status of network interfaces. A successful AP mode startup is indicated by the presence of 'type AP' and details like SSID and channel information for the interface. ```c # iw dev # Expected output for successful AP mode: phy#10 Interface wlan0 ifindex 13 wdev 0xa00000001 addr 88:da:1a:78:06:e4 ssid rsi_ap_wpa type AP channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz ``` -------------------------------- ### Configure Wi-Fi + BT AP Mode (C) Source: https://context7_llms Sets the device operational mode to 6 for Wi-Fi Access Point (AP) and Bluetooth Classic coexistence. Follow separate instructions for Wi-Fi and Bluetooth installations. ```c dev_oper_mode = 6 (Wi-Fi AP + BT) ``` -------------------------------- ### Bring up HCI Interface (Shell) Source: https://context7_llms Brings the hci0 interface up. This command is used in both Bluetooth Classic and Bluetooth LE configurations to activate the Bluetooth interface. ```shell # hciconfig -a hci0 up ``` -------------------------------- ### Insert rsi_91x.ko module with parameters Source: https://context7_llms Inserts the rsi_91x.ko kernel module with optional parameters for driver configuration. Module parameters control initial settings like debug print enablement and operating modes. If not provided, default values are used. ```bash #insmod rsi_91x.ko dev_oper_mode= rsi_zone_enabled= ... ``` -------------------------------- ### Verify AP Mode Status (Failure) Source: https://context7_llms This command checks the status of network interfaces. A failed AP mode startup is indicated by the absence of 'type AP' and relevant details, showing a different interface type (e.g., 'type managed'). ```c # iw dev # Sample output for failed AP mode: phy#10 Interface wlan0 ifindex 13 wdev 0xa00000001 addr 88:da:1a:78:06:e4 type managed ``` -------------------------------- ### HCI Commands for OGF 0x02 - Link Policy and Role Management Source: https://context7_llms This snippet details HCI commands for link policy management, role discovery, and switching within OGF 0x02. It indicates support status and provides the corresponding macro definitions from the source code. ```text HCI_Hold_Mode | /* HCI link policy command OCF types */HCI_OP_HOLD_MODE HCI_Sniff_Mode | HCI_OP_SNIFF_MODE HCI_Exit_Sniff_Mode | HCI_OP_EXIT_SNIFF_MODE HCI_QoS_Setup | HCI_OP_QOS_SETUP HCI_Role_Discovery | HCI_OP_ROLE_DISCOVERY HCI_Switch_Role | HCI_OP_SWITCH_ROLE HCI_Read_Link_Policy_Settings | HCI_OP_READ_LINK_POLICY HCI_Write_Link_Policy_Settings | HCI_OP_WRITE_LINK_POLICY HCI_Read_Default_Link_Policy_Settings | HCI_OP_READ_DEF_LINK_POLICY HCI_Write_Default_Link_Policy_Settings | HCI_OP_WRITE_DEF_LINK_POLICY HCI_Flow_Specification | HCI_OP_FLOW_SPECIFICATION HCI_Sniff_Subrating | HCI_OP_SNIFF_SUBRATING ``` -------------------------------- ### Enable Driver Debug Zone with Module Parameter Source: https://context7_llms Enables specific debug zones during driver installation using bitmap values. The rsi_zone_enabled parameter controls which debugging information is printed to kernel logs (dmesg). Useful for troubleshooting driver behavior. ```bash # insmod rsi_91x.ko rsi_zone_enabled=2 ```