Redpine Signals M7DB6 User Manual

Redpine Signals, Inc. Proprietary and Confidential
RS9116 n-Link Linux and Android
TTeecchhnniiccaall RReeffeerreennccee MMaannuuaall
VVeerrssiioonn 22..00
January 2019
Redpine Signals, Inc.
2107 North First Street, #540
San Jose, CA 95131. Tel: (408) 748-3385 Fax: (408) 705-2019
Email: sales@redpinesignals.com
Website: www.redpinesignals.com
Redpine Signals, Inc. Proprietary and Confidential Page 2
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Disclaimer:
The information in this document pertains to information related to Redpine Signals, Inc. products. This information is provided as a service to our customers, and may be used for information purposes only. Redpine assumes no liabilities or responsibilities for errors or omissions in this document. This document may be changed at any time at Redpine’s sole discretion without any prior notice to anyone. Redpine is not committed to updating this document in the future. Copyright © 2018 Redpine Signals, Inc. All rights reserved.
Redpine Signals, Inc. Proprietary and Confidential Page 3
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
About this Document
This document is a preliminary version of RS9116 n-Link Technical Reference Manual for Linux and Android, provided to customers under a Non-Disclosure Agreement (NDA).
src-23903865_BluetoothhcitoolandhciconfigUsage-_Toc174878560
Redpine Signals, Inc. Proprietary and Confidential Page 4
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Table Of Contents
1 Introduction to RS9116 ........................................................................................................... 11
2 Getting Started with RS9116 ................................................................................................... 12
2.1 Hardware Requirements .............................................................................................................. 12
2.2 Software Requirements ............................................................................................................... 12
2.3 Software Package Contents .......................................................................................................... 12
3 Compiling the Driver ............................................................................................................... 13
4 Installing the Driver ................................................................................................................ 18
4.1 Installation of Modules ................................................................................................................ 18
4.2 Enabling a Protocol ...................................................................................................................... 18
4.3 Disabling a Protocol ..................................................................................................................... 19
4.4 OneBox-Mobile in Wi-Fi Only Mode ............................................................................................. 19
4.4.1 Installation in Wi-Fi Client Mode (with BSD interface support) ...................................................................... 19
4.4.2 Installation in Access Point Mode (with BSD interface support) ..................................................................... 23
4.4.3 Installation in Wi-Fi Client Mode (with NL80211 support).............................................................................. 24
4.4.4 Installation in Wi-Fi AP mode (with NL80211 support) ................................................................................... 26
4.4.5 Installation in Wi-Fi Direct Mode (With BSD Interface Support) ..................................................................... 28
4.4.5.1 Autonomous GO Mode ............................................................................................................................... 28
4.4.6 Installation in Wi-Fi Direct Mode (With NL80211 Support only for Kernel v3.8 or higher) ............................ 29
4.4.6.1 Autonomous GO Mode ............................................................................................................................... 29
4.5 OneBox-Mobile in Wi-Fi + Bluetooth Classic Coexistence Mode ..................................................... 30
4.6 OneBox-Mobile in Wi-Fi + Bluetooth LE Coexistence Mode ........................................................... 31
4.6.1 Advertise, Scan, Connect Commands .............................................................................................................. 31
4.7 OneBox-Mobile in Wi-Fi + Bluetooth Classic + Bluetooth LE Coexistence Mode .............................. 32
4.8 OneBox-Mobile in Wi-Fi + ZigBee Coexistence Mode ..................................................................... 34
4.8.1 Building and Running the Sample Home Automation Switch Application ...................................................... 34
4.8.1.1 About the Sample Application..................................................................................................................... 35
4.8.1.2 Host API Folder Structure ............................................................................................................................ 35
4.8.1.3 Building and Running the Home Automation Sample Application ............................................................. 35
4.9 Driver Uninstallation Procedure ................................................................................................... 35
4.10 Driver Information .................................................................................................................... 35
4.10.1 Driver Statistics ............................................................................................................................................... 35
4.10.2 Disabling Driver Debug Prints .......................................................................................................................... 36
5 Wi-Fi ioctl Usage Guide ........................................................................................................... 37
5.1 Configuring using Wireless Extensions .......................................................................................... 37
5.2 Private (Driver-Specific) Commands for Access Point and Client Modes ......................................... 39
5.3 Private (Driver- Specific) Commands for Access Point Mode .......................................................... 41
5.4 Private (Driver- Specific) Commands for Client Mode .................................................................... 45
5.5 Configuring Using onebox_util ...................................................................................................... 45
5.5.1 WPS Configuration .......................................................................................................................................... 56
5.5.1.1 Access Point Mode ...................................................................................................................................... 57
5.5.1.2 Client Mode ................................................................................................................................................. 58
6 Configuration Using CFG80211 ................................................................................................ 59
6.1 Using iw Wireless Tool ................................................................................................................. 59
7 Enterprise security using CFG80211 ........................................................................................ 62
7.1 Installation and configuration of FREERADIUS Server .................................................................... 62
Redpine Signals, Inc. Proprietary and Confidential Page 5
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
7.2 Configuration of AP and RADIUS server to use EAP methods ......................................................... 63
7.2.1 Configuration of the AP ................................................................................................................................... 64
7.2.2 Configuring hostapd as RADIUS server ........................................................................................................... 65
7.2.3 Configuring Station to connect to an EAP enabled AP. ................................................................................... 66
8 HOSTAPD and Wi-Fi Protected Setup (WPS) ............................................................................ 69
8.1 Hostapd Configuration before Compilation ................................................................................... 69
8.2 Configuration in hostapd_ccmp.conf ............................................................................................ 69
8.3 WPS ............................................................................................................................................. 70
8.3.1 AP-mode for WPS -push button method ........................................................................................................ 70
8.3.2 AP-mode for WPS Enter-pin method .............................................................................................................. 70
8.3.3 AP-mode for WPS-Generate pin- method ....................................................................................................... 71
8.3.4 Disable AP pin .................................................................................................................................................. 71
8.3.5 Get the AP pin ................................................................................................................................................. 71
8.3.6 Set the AP pin .................................................................................................................................................. 72
8.3.7 Get the current configuration ......................................................................................................................... 72
9 ACS with Hostapd ................................................................................................................... 73
10 Antenna Diversity ................................................................................................................ 74
10.1 Introduction ............................................................................................................................. 74
10.2 Configuration ........................................................................................................................... 74
11 Sniffer Mode ....................................................................................................................... 75
12 Monitor Mode ..................................................................................................................... 76
13 Concurrent Mode ................................................................................................................ 77
13.1 Installation Procedure .............................................................................................................. 77
13.1.1 Creating VAP in Client Mode ........................................................................................................................... 77
13.1.2 Creating VAP in AP mode ................................................................................................................................ 78
13.1.3 State of the Station ......................................................................................................................................... 79
14 Background Scan Parameters .............................................................................................. 82
15 Power save Modes, Profiles and Parameters ........................................................................ 83
15.1 Power save Modes ................................................................................................................... 83
15.2 Power save Profiles .................................................................................................................. 83
15.3 Wakeup Procedures and Data Retrieval .................................................................................... 83
15.4 Power save Parameters ............................................................................................................ 84
15.5 Procedure to enable device power save for USB interface.......................................................... 85
16 Compliance and Certification ............................................................................................... 87
16.1 Federal Communication Commission Statement ........................................................................ 87
16.1.1 Labeling and User Information This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. RF exposure
statements 1. This Transmitter must not be co‐located or operating in conjunction with any other antenna or
transmitter. 2. This equipment complies with FCC RF radiation exposure limits set forth for an uncontrolled environment. This equipment should be installed and operated with a minimum distance of 20 centimeters between the radiator and your body or nearby persons. For a host using a certified modular with a standard fixed label, if
(1) the module’s FCC ID is not visible when installed in the host, or (2) if the host is marketed so that end users do not
have straightforward commonly used methods for access to remove the module so that the FCC ID of the module is visible; then an additional permanent label referring to the enclosed module:“Contains Transmitter Module FCC ID: XF6-M7DB6” or “Contains FCC ID: XF6-M7DB6” must be used. The host OEM user manual must also contain clear
instructions on how end users can find and/or access the module and the FCC ID. ...................................................... 87
16.2 Industry Canada / ISED Statement............................................................................................. 88
Redpine Signals, Inc. Proprietary and Confidential Page 6
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
16.2.1 Labeling and User Information ........................................................................................................................ 89
17 Wi-Fi Performance Test ioctl usage ...................................................................................... 90
17.1 WiFi Transmit Tests .................................................................................................................. 90
17.1.1 Transmit Command Usage .............................................................................................................................. 90
17.2 Wi-Fi Receive Tests ................................................................................................................... 94
17.2.1 Receive Command Usage ................................................................................................................................ 94
17.3 Continuous Wave (CW) mode ................................................................................................... 95
17.3.1 Command Usage ............................................................................................................................................. 95
18 Wake-On-Wireless LAN ....................................................................................................... 97
18.1 WoWLAN through onebox_util ................................................................................................. 97
18.2 WoWLAN using Linux power state machine ............................................................................... 97
18.2.1 Overview ......................................................................................................................................................... 97
18.2.2 Configure WoWLAN ........................................................................................................................................ 98
18.3 Suspend system ........................................................................................................................ 99
18.4 Trigger wakeup ......................................................................................................................... 99
19 PUF [ Physical Unclonable Functions ] ................................................................................ 100
19.1 Introduction ............................................................................................................................ 100
19.2 Configuration .......................................................................................................................... 100
19.3 PUF Operations and IOCTL Usage ............................................................................................. 100
19.3.1 PUF Enroll ...................................................................................................................................................... 100
19.3.2 PUF Start ....................................................................................................................................................... 100
19.3.3 PUF Set Key ................................................................................................................................................... 100
19.3.4 PUF Set Intrinsic Key ...................................................................................................................................... 100
19.3.5 PUF Get Key ................................................................................................................................................... 100
19.3.6 PUF Load Key ................................................................................................................................................. 101
19.3.7 PUF AES Encryption ....................................................................................................................................... 101
19.3.8 PUF AES Decryption....................................................................................................................................... 101
19.3.9 PUF AES MAC Generation ............................................................................................................................. 101
19.3.10 PUF Block Enroll ........................................................................................................................................ 101
19.3.11 PUF Block Set Key ...................................................................................................................................... 101
19.3.12 PUF Block Get Key ..................................................................................................................................... 102
20 GTK Offload ....................................................................................................................... 103
20.1 Configuration .......................................................................................................................... 103
21 Steps to connect 802.11R client to AP ................................................................................ 104
22 Steps to configure 802.11W ............................................................................................... 105
22.1 Configuring and Compiling Driver for PMF in client mode: ........................................................ 105
22.2 Configuring and Compiling Driver for PMF in AP mode:............................................................. 105
23 Bluetooth hcitool and hciconfig Usage ............................................................................... 106
23.1 Bluetooth Power Save Commands ........................................................................................... 107
23.2 Bluetooth Performance Test ioctl Usage ................................................................................... 107
23.3 BT CLASSIC Transmit ................................................................................................................ 108
23.3.1 IOCTL ............................................................................................................................................................. 108
23.3.2 Description .................................................................................................................................................... 108
23.3.3 Appendix ....................................................................................................................................................... 109
23.4 BT Classic Receive .................................................................................................................... 112
23.4.1 Introduction .................................................................................................................................................. 112
23.4.2 IOCTL ............................................................................................................................................................. 112
23.4.3 Description .................................................................................................................................................... 113
Redpine Signals, Inc. Proprietary and Confidential Page 7
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
23.4.4 Appendix ....................................................................................................................................................... 113
23.5 BLE/BLR Transmit .................................................................................................................... 114
23.5.1 Introduction .................................................................................................................................................. 114
23.5.2 IOCTL ............................................................................................................................................................. 114
23.5.3 Description .................................................................................................................................................... 114
23.5.4 Appendix ....................................................................................................................................................... 115
23.6 BLE/BLR Receive ...................................................................................................................... 116
23.6.1 Introduction .................................................................................................................................................. 116
23.6.2 IOCTL ............................................................................................................................................................. 117
23.6.3 Description .................................................................................................................................................... 117
23.6.4 Appendix ....................................................................................................................................................... 117
23.7 Hopping .................................................................................................................................. 118
23.7.1 Introduction .................................................................................................................................................. 118
23.7.2 IOCTL ............................................................................................................................................................. 118
23.7.3 Description .................................................................................................................................................... 118
23.7.4 Appendix ....................................................................................................................................................... 118
24 ZigBee Performance Test Application Usage ...................................................................... 120
24.1 ZigBee Transmit Tests .............................................................................................................. 120
24.2 Receive Tests ........................................................................................................................... 120
24.3 Continuous Wave Transmit Mode ............................................................................................ 121
25 Android support for RS9116............................................................................................... 123
26 Appendix A: Configuration of Kernels from 3.13 and above ................................................ 124
26.1 SDIO Stack Options .................................................................................................................. 124
26.2 Wireless Extension Tools.......................................................................................................... 125
26.3 Bluetooth Stack Options .......................................................................................................... 126
26.4 Kernel Compilation .................................................................................................................. 127
27 Appendix B: Binary Files for Embedded Platforms .............................................................. 128
27.1 Common Hardware Requirements for Embedded Platforms ..................................................... 128
27.2 Freescale i.MX6 ....................................................................................................................... 128
27.2.1 Hardware Requirements ............................................................................................................................... 128
27.2.2 Software Requirements ................................................................................................................................ 128
27.2.3 Hardware Setup ............................................................................................................................................ 128
27.2.4 Cross Compile and Copy OneBox-Mobile Software ...................................................................................... 128
27.3 Freescale i.MX53 ..................................................................................................................... 129
27.3.1 Hardware Requirements ............................................................................................................................... 129
27.3.2 Software Requirements ................................................................................................................................ 129
27.3.3 Hardware Setup ............................................................................................................................................ 129
27.3.4 Cross Compile and Copy OneBox-Mobile Software ...................................................................................... 130
27.4 Atmel AT91SAM9G45 and AT91SAM9M10 ............................................................................... 130
27.4.1 Hardware Requirements ............................................................................................................................... 130
27.4.2 Software Requirements ................................................................................................................................ 130
27.4.3 Hardware Setup ............................................................................................................................................ 130
27.4.4 Cross Compile and Copy OneBox-Mobile Software ...................................................................................... 131
28 Appendix C: Using the Bluetooth Manager ......................................................................... 132
29 Appendix D: Common Configuration Parameters ............................................................... 135
29.1 RF Power Mode parameter ...................................................................................................... 135
29.2 Country selection..................................................................................................................... 135
29.3 Antenna selection .................................................................................................................... 135
29.3.1 COEX Mode selection .................................................................................................................................... 136
Redpine Signals, Inc. Proprietary and Confidential Page 8
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
29.3.2 BT RF Type ..................................................................................................................................................... 137
29.3.3 BLE_TX_PWR_INX.......................................................................................................................................... 137
29.3.4 BLE_PWR_SAVE_OPTIONS ............................................................................................................................ 137
30 Appendix E: Installation of Missing Generic Netlink Libraries ............................................. 138
31 Appendix F: Procedure to use latest supplicant with NL80211 interface ............................. 139
31.1 Bgscan and Roaming ................................................................................................................ 139
31.1.1 Description .................................................................................................................................................... 139
31.1.2 Configure Connection quality monitoring (cqm ) rssi and hysteresis using iw command ............................ 140
32 Appendix G: Considerations need to be made during hostapd usage .................................. 141
32.1 Parameters updated from hostapd.conf file ............................................................................. 141
32.2 Paramaeters that will not get updated from hostapd.conf file .................................................. 141
33 RS9116 n-Link Software TRM Revision History ................................................................... 142
Redpine Signals, Inc. Proprietary and Confidential Page 9
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Table of Figures
No table of figures entries found.
Redpine Signals, Inc. Proprietary and Confidential Page 10
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Table of Tables
No table of figures entries found.
Redpine Signals, Inc. Proprietary and Confidential Page 11
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
1 Introduction to RS9116
The OneBox-Mobile(refers to single software providing combo of all the features supported) software supports the following modes. They are outlined below:
Wi-Fi (Access Point, Client, Wi-Fi-Direct (P2P), Sniffer and Monitor modes)
Bluetooth Classic
Bluetooth Low Energy
ZigBee (Coordinator, Router and End device modes).
The OneBox-Mobile Coexistence software supports the following combination of modes. They are as follows:
WLAN STATION /WIFI-Direct/WLAN PER
WLAN ACCESS POINT(including muliple APs on different vaps)
WLAN ACCESS POINT + STATION MODE(on multiple vaps)
WAKE ON WIRELESS(WOWLAN)
BT CLASSIC MODE/BT CLASSIC PER MODE
WLAN STATION + BT CLASSIC MODE
WLAN ACCESS POINT + BT CLASSIC MODE
BT LE MODE /BT LE PER MODE
WLAN STATION + BT LE MODE
BT CLASSIC + BT LE MODE
WLAN STATION + BT CLASSIC MODE + BT LE MODE
WLAN ACCESS POINT + BT CLASSIC MODE+ BT LE MODE
ZIGBEE MODE/ ZIGBEE PER MODE
WLAN STATION + ZIGBEE
ZIGBEE COORDINATOR MODE
ZIGBEE ROUTER MODE
The subsequent sections explain the use of OneBox-Mobile software . The installation and operation of the driver on specific representative processor platforms have been explained in the Appendix sections.
Redpine Signals, Inc. Proprietary and Confidential Page 12
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
2 Getting Started with RS9116
This section lists the hardware and software requirements for the installation of the software and also describes the steps to be followed to initialize and run the software.
2.1 Hardware Requirements
The Hardware requirements are as follows:
RS9116N n-Link® Module
Laptop/PC with SDIO or USB interface or any embedded platform with Linux Board support package.
If the Laptop/PC does not have an SDIO slot, a SDHC/SD/MMC to CardBus Adapter like the one available at
http://www.hwtools.net/cardreader/SDCBA_C01.html can be used.
2.2 Software Requirements
The Software requirements are as follows:
Linux with kernel version from 2.6.38 to 4.18.5 – should enable the open source SDIO and USB stacks.
DHCP Server (for Wi-Fi Access Point mode)
Bluetooth supported commands bluetoothctl and bluetoothd must be present.
Compatible Bluetooth Host Stack, e.g., the Open Source BlueZ Stack v4.101
ncurses and ncurses-devel libraries
For kernel versions 3.13 and above, refer to the section on Appendix A: Configuration of Kernels from 3.13 and
above to ensure correct kernel configuration.
2.3 Software Package Contents
The OneBox-Mobile Software is delivered as a tarball with a filename in the format: RS9116.NXX.NL.GEN.LNX.x.y.z.tgz, where the naming convention is as follows: NXX defines whether the package supports only Wi-Fi (N00) or Bluetooth Classic/Low Energy along with Wi-Fi (NB0) or ZigBee along with Wi-Fi (N0Z) or Bluetooth Classic/Low Energy and ZigBee along with Wi-Fi (NBZ). x.y.z identifies the software package.
Redpine driver comes in proprietary and open source form.The Linux driver package contains the following files/folders:
Readme_nLink.txt
Releasenotes_nLink.txt
Documents
Binary_files (optional)
source (optional)
Based on the Software License Agreement, driver source code will be available for the users from "https://www.redpinenetworks.us/OpenKM/login.jsp"
Redpine Signals, Inc. Proprietary and Confidential Page 13
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
3 Compiling the Driver
This section describes the steps to be followed in order to compile the OneBox-Mobile Linux software for different platforms. The steps are outlined below:
1. Save the required configuration of Driver using the menuconfig utility. Following are the options available in menuconfig:
Host Interface: SDIO or USB.
Operating system: Linux or Android
Nl80211 support
Hostapd Support
WIFI
BLUETOOTH
ZIGBEE
2. To open menuconfig utility, untar the tar ball, go to source->host folder & enter the given below command.
make menuconfig
The following images show the menuconfig utility options.
Figure 1: Main Page of menuconfig
Redpine Signals, Inc. Proprietary and Confidential Page 14
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Figure 2: Selecting Operating System
By default, the driver package includes "BSD" support. In case the user needs "Nl80211" support for Access point and Station modes, select the menuconfig accordingly. For Nl80211, the "Hostapd" application is used as a configuration utility.
Figure 3: Selection of
NL80211 and Hostapd Support
Redpine Signals, Inc. Proprietary and Confidential Page 15
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
If NL80211 support is enabled in the driver, make sure that the following modules are loaded in the kernel before running the driver in order to avoid module dependencies. This can be verified by using the commands.
# lsmod | grep cfg80211 # lsmod | grep bluetooth
If they are not installed, can be installed by using the commands below :
# modprobe cfg80211 # modprobe bluetooth
By default the configuration is enabled with Wi-Fi, Bluetooth and ZigBee. If the user wants to compile the driver for a particular protocol, he can disable the unwanted protocols in Menuconfig utility. In case of coex mode, the Wi-Fi must always be enabled in conjunction with BT / ZigBee protocols, even if Wi-Fi will not be used. For example, if the user wants to compile the driver only for Bluetooth only, the Wi-Fi and Bluetooth mode must be enabled. Refer to the following images of Menuconfig utility for more information:
Figure 4: Selection of WIFI
Only Mode
3. After selecting the configuration, exit the menuconfig and save the configuration. Please refer the given below image of saving the configuration.
Redpine Signals, Inc. Proprietary and Confidential Page 16
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Figure 5: Save the changes
before exiting
4. Now to compile the driver, enter the following command:
make
The code is compiled and the binaries are generated in the source/host/release folder. For embedded platforms, modify the path assigned to the "DEF_KERNEL_DIR" variable in the Makefile:
cd RS9116.NXX.NL.GEN.LNX.x.y.z/source/host
vim Makefile
The DEF_KERNEL_DIR variable has to be assigned along with the compiled kernel path. For an x86 based Linux platform, the path is usually "/lib/modules/<kernel_version>/build" and this is the path assigned in the Makefile provided in the package. Example:
DEF_KERNEL_DIR:= /lib/modules/3.4.66/build
Next, use the "make" command to start compiling the driver. For embedded platforms, add the target platform and toolchain path as cross compilation option to the "make" command.
Redpine Signals, Inc. Proprietary and Confidential Page 17
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
For example, if the target platform is ARM and tool chain path is "/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1­multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-", then the command is issued as:
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-
Before installing the Onebox RS9116 Driver modules, make sure that the RSI opensource modules are uninstalled. This has been taken care in the onebox_insert.sh script.
In order to un-install the RSI opensource driver, use the following commands:
# rmmod rsi_usb # rmmod rsi_sdo # rmmod rsi_91x
Redpine Signals, Inc. Proprietary and Confidential Page 18
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
4 Installing the Driver
4.1 Installation of Modules
After completion of compilation, the driver generates the following modules in the release folder. They are outlined below:
onebox_common_gpl.ko
onebox_gpl.ko
onebox_nongpl.ko
onebox_wlan_gpl.ko
onebox_wlan_nongpl.ko
onebox_bt_gpl.ko
onebox_bt_nongpl.ko
onebox_zb_gpl.ko
onebox_zb_nongpl.ko
wlan.ko
wlan_wep.ko
wlan_ccmp.ko
wlan_tkip.ko
wlan_acl.ko
wlan_scan_sta.ko
wlan_xauth.ko
Load various modules in the following order: Load onebox common gpl module
# insmod onebox_common_gpl.ko
Load protocol related Modules (Wi-Fi, BT, ZigBee) Load common Hal Modules (onebox_nongpl.ko and onebox_gpl.ko).
4.2 Enabling a Protocol
Execute following command to enable required protocol(s):
# ./onebox_util rpine0 enable_protocol $protocol_value
Below are the possible values of protocol.
1 Enables Wi-Fi only
2 Enables Bluetooth only
4 Enables ZigBee only
3 Enables both Wi-Fi+Bluetooth
5 Enables both Wi-Fi+ZigBee
Note:
If user selects only Wi-Fi in Menuconfig during the compilation of Driver, use the command below : sh wlan_enable.sh
If user selects only Bluetooth in Menuconfig during the compilation of Driver, use the command below : sh bt_enable.sh
Redpine Signals, Inc. Proprietary and Confidential Page 19
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
If user selects only ZigBee in Menuconfig during the compilation of Driver, use the command below: sh zigb_enable.sh
If user selects both Wi-Fi and Bluetooth in Menuconfig during the compilation of Driver, use the command below : sh wlan_bt_insert.sh
If user selects both Wi-Fi and ZigBee in Menuconfig during the compilation of Driver, use the command below : sh wlan_zigb_insert.sh
If user selects all the protocols in Menuconfig during the compilation of Driver, use the command below : sh onebox_insert.sh and need to run individual protocol enable scripts.
4.3 Disabling a Protocol
Execute he following command to disable required protocol(s):
# ./onebox_util rpine0 disable_protocol $protocol_value
the possible values of protocol is same as mentioned in Enabling a Protocol. Note:
If user wants to disable only WLAN, use the command below : sh wlan_disable.sh
If user wants to disable only Bluetooth, use the command below : sh bt_disable.sh
If user wants to disable only ZigBee, use the command below : sh zigb_disable.sh
If user wants to disable both WLAN and Bluetooth or both WLAN and ZigBee , use the command below : sh remove_all.sh
Disabling of protocol is not recommended when Wi-Fi is operating in AccessPoint mode.
4.4 OneBox-Mobile in Wi-Fi Only Mode
The steps for starting the Wi-Fi Only mode in Client, AccessPoint and Wi-Fi Direct modes are as follows:
1. Open the common_insert.sh file present in the "release" folder.
2. Ensure DRIVER_MODE and COEX_MODE are set as below:
DRIVER_MODE = 1
COEX_MODE = 1 (For Station Mode only/WIFI-Direct)
COEX_MODE = 2 (For Access Point Mode)
COEX_MODE = 3 (For Both Access Point and Station Modes)
For SDIO mode, ensure that the SDIO stack related modules are already inserted in the kernel refer Appendix A:
Configuration of Kernels from 3.13 and above section to install sdio stack modules .
4.4.1 Installation in Wi-Fi Client Mode (with BSD interface support)
The steps for installing OneBox-Mobile software in Wi-Fi Client Mode are as follows:
1. Edit the "sta_settings.conf" file in the "release" folder and enter the parameters of the Wi-Fi network as given below: For Open (non-Secure) mode
network={
Redpine Signals, Inc. Proprietary and Confidential Page 20
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
ssid="<SSID of Access Point>" key_mgmt=NONE }
For WPA-PSK (TKIP) mode
network={ ssid="<SSID of Access Point>" key_mgmt=WPA-PSK psk=<passphrase specified in the Access Point> proto=WPA pairwise=TKIP group=TKIP }
For WPA2-PSK (CCMP) mode
network={ ssid="<SSID of Access Point>" key_mgmt=WPA-PSK psk=<passphrase specified in the Access Point> proto=WPA2 pairwise=CCMP group=CCMP }
For WEP-64 mode
network={ ssid="<SSID of Access Point>" key_mgmt=NONE wep_key0=XXXXXXXXXX wep_tx_keyidx=X }
The key can be input either in ASCII or Hexadecimal formats:
ASCII Format: wep_key0="12345" Hexadecimal Format: wep_key0=1234567890
The key index can vary between 0 and 3.
For WEP-128 mode
network={ ssid="<SSID of Access Point>" key_mgmt=NONE
Redpine Signals, Inc. Proprietary and Confidential Page 21
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
wep_key0=XXXXXXXXXXXXXXXXXXXXXXXXXX wep_tx_keyidx=X }
The key can be input either in ASCII or Hexadecimal formats:
ASCII Format: wep_key0="1234567890123" Hexadecimal Format: wep_key0=12345678901234567890123456
The key index can vary between 0 and 3.
For WEP-Shared (64-bit) mode
network={ ssid="<SSID of Access Point>" key_mgmt=NONE wep_key0=XXXXXXXXXX wep_tx_keyidx=X auth_alg=SHARED }
The key can be input either in ASCII or Hexadecimal formats:
ASCII Format: wep_key0="12345" Hexadecimal Format: wep_key0=1234567890
The key index can vary between 0 and 3. To connect to an Access Point whose SSID is not broadcast (Hidden), add the following line to the network block.
scan_ssid=1
For example
network={ ssid="<SSID of Access Point>" scan_ssid=1 key_mgmt=NONE }
Next, run the "start_sta.sh" script in the "release" folder to load the driver modules and the supplicant and also connect to the Access Point specified in the "sta_settings.conf" file.
sh start_sta.sh
Redpine Signals, Inc. Proprietary and Confidential Page 22
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
User needs to make sure of the module detection w.r.t interface being used. If the module is not detected, user will end up with errors displayed on the console !
After issuing the above command, a virtual interface with the name "wifi0" will be created. You can view the list of interfaces by entering the following command:
ifconfig a
You can check whether the connection to the Access Point is successful or not, by running the following command:
iwconfig wifi0
The sample output of this command is
wifi0 IEEE 802.11bgn ESSID:"Range" Nickname:"" Mode:Managed Frequency:2.412 GHz Access Point: 38:A4:ED:DE:BB:06 Bit Rate:39 Mb/s Tx-Power=16 dBm Sensitivity=1/0 RTS thr:off Fragment thr:off Encryption key:****-**** Security mode:restricted Power Management:off Link Quality=80/80 Signal level=-28 dBm Noise level:0 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
This command gives the status of the device. If the connection is successful, then the connected Access point SSID along with the MAC address is displayed. If it is not connected to an Access point, a message "Not Associated" is displayed. To view the list of Access Points scanned in each channel, you can run the following command in the "release" folder.
./wpa_cli i wifi0 scan_results
To obtain an IP address using DHCP, start the DHCP client by entering below commands. (1st command to remove entry for existing dhcp and 2nd to create a new entry).
$ dhclient -r wifi0 $ dhclient -v wifi0
The sample output of dhclient command is given below
Listening on LPF/wifi0/88:da:1a:1e:b2:58 Sending on LPF/wifi0/88:da:1a:1e:b2:58 Sending on Socket/fallback DHCPDISCOVER on wifi0 to 255.255.255.255 port 67 interval 4 (xid=0x133cec16)
Redpine Signals, Inc. Proprietary and Confidential Page 23
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
DHCPREQUEST on wifi0 to 255.255.255.255 port 67 (xid=0x133cec16) DHCPOFFER from 192.168.43.1 DHCPACK from 192.168.43.1 (xid=0x133cec16) bound to 192.168.43.167 -- renewal in 1783 seconds
4.4.2 Installation in Access Point Mode (with BSD interface support)
The steps for installing OneBox-Mobile software in Access Point Mode are as follows:
1. The "start_ap.sh" script present in the "release" folder needs to be run with the different configuration files present
in the same folder in order to install an Access Point in different security modes.
# sh start_ap.sh <conf_file>
For example : sh start_ap.sh wpa_supplicant_open.conf The different configuration files (.conf files) present in the "release" folder are as follows: For Access Point in Open Mode, wpa_supplicant_open.conf configuration file is used, and this starts an Access Point with the following parameters:
SSID: REDPINE_AP
Channel 1 of 2.4GHz Band (2412 MHz)
Open (non-Secure) mode
For Access Point in WEP-64 Mode, wpa_supplicant_wep64.conf configuration file is used, and this starts an Access Point with the following parameters:
SSID: onebox_wep
Channel 1 of 2.4GHz Band (2412 MHz)
Security Mode: WEP-64
WEP Key: 1234567890
Key Index: 0
For Access Point in WEP-128 Mode, wpa_supplicant_wep128.conf configuration file is used, and this starts an Access Point with the following parameters:
SSID: onebox_wep
Channel 1 of 2.4GHz Band (2412 MHz)
Security Mode: WEP-128
WEP Key: 12345678901234567890123456
Key Index: 0
For Access Point in WPA-PSK (TKIP) Mode, wpa_supplicant_tkip.conf configuration file is used, and this starts an Access Point with the following parameters:
SSID: onebox_tkip
Channel 1 of 2.4GHz Band (2412 MHz)
Security Mode: WPA-PSK (TKIP)
Passphrase: "12345678"
For Access Point in WPA2-PSK (CCMP) Mode, wpa_supplicant_ccmp.conf configuration file is used, and this starts an Access Point with the following parameters:
SSID: onebox_ccmp
Channel 1 of 2.4GHz Band (2412 MHz)
Security Mode: WPA2-PSK (CCMP)
Passphrase: "12345678"
Redpine Signals, Inc. Proprietary and Confidential Page 24
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
All the above mentioned parameters can be modified in the respective configuration files by the user. The values provided in the above mentioned parameters are only for reference.
The Access Point does not support WEP-Shared algorithm in the current release.
2. After running the "start_ap.sh" script a virtual interface with the name "wifi1" will be created. You can view the list of interfaces using the following command:
ifconfig a
You can check whether the Access Point has been started successfully or not, by running the following command:
iwconfig wifi1
The sample output of this command is
wifi1 IEEE 802.11bgn ESSID:"test" Nickname:"" Mode:Master Frequency:2.432 GHz Access Point: 88:DA:1A:16:E5:5D Bit Rate:6 Mb/s Tx-Power=30 dBm Sensitivity=1/0 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality=80/80 Noise level:0 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
This command gives the status of the device. It displays the Access Point's SSID along with the MAC address and channel frequency. If the Access Point does not start, a message saying "Exiting: Driver Initialization not completed even after waiting for xxms" is displayed. To start a DHCP server, use the commands below.
sh dhcp_server.sh wifi1
Note: If DHCP server is not present , we can also assign IP statically by using following command. Also it should be noted that dhclient at connected clients will not work as dhcp server is not started at AP. We should assign IP statically at client side also.
ifconfig <interface> <IP> Example : ifconfig wifi1 192.168.2.1
4.4.3 Installation in Wi-Fi Client Mode (with NL80211 support)
The steps for installing Wi-Fi Only mode in Client are as follows:
1. Open the common_insert.sh file present in the "release" folder.
2. Ensure that the DRIVER_MODE and COEX_MODE are set as below:
Redpine Signals, Inc. Proprietary and Confidential Page 25
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
DRIVER_MODE = 1
COEX_MODE = 1 (For Station Mode only/WIFI-Direct)
or
COEX_MODE = 3 (For Both Access Point and Station Modes)
For SDIO mode, ensure that the SDIO stack related modules are already inserted in the kernel refer Appendix A:
Configuration of Kernels from 3.13 and above section to install sdio stack modules .
Ensure that in menuconfig, NL80211 support is enabled as mentioned in Figure 4.
3. Compile the driver.
Make sure the following parameters are enabled in the supplicant configuration file (wlan/supplicant/linux/wpa_supplicant/.config) CONFIG_DRIVER_NL80211=y CONFIG_LIBNL32=y
$ make
4. Go to the release folder and start the device in station mode.
$ cd release
$ sh wlan_enable.sh
5. Issue the following command to get physical interfaces on which we can add wifi0 interface
$iw phy | grep phy
The output of the command will be phyX (X can be 1,2,3,… eg:phy1,phy2 etc)
In case of multiple phy's to identify the appropriate phy on which to run the command, enter the following command.
iw dev
The sample output of this command is
phy#3 Interface wlp0s26u1u2
Redpine Signals, Inc. Proprietary and Confidential Page 26
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
ifindex 10 wdev 0x300000001 addr 00:23:a7:65:2a:ac type managed phy#0 Interface wlo1 ifindex 3 wdev 0x1 addr a4:17:31:a7:82:a3 type managed
In the above example "Phy3" is Redpine's interface. Assuming the physical interface is detected as phy1, refer the below steps to create a virtual interface.
6. Add the wireless interface to the phy.
$service NetworkManager stop
$iw phy phy1 interface add wifi0 type managed
Instead of following the above 2 steps i.e. step 5 and step 6, we can directly create vap by using "onebox_util" binary present in the release folder.
cd release
./onebox_util rpine0 create_vap wifi0 sta sw_bmiss
Run the supplicant after configuring sta_settings.conf with required AP settings as mentioned in the section Installation in Wi-Fi Client Mode (with BSD interface support)
In the sta_settings.conf file, in addition to the above all configurations as mentioned for BSD case, NL80211 mode required country input in the global fields which need to be set as specified below.
country=US
Now run supplicant as given below.
$ ./wpa_supplicant -i wifi0 -D nl802ll -c sta_settings.conf -ddddt > log &
4.4.4 Installation in Wi-Fi AP mode (with NL80211 support)
The steps for installing Wi-Fi Only mode in AP are as follows:
1. Open the common_insert.sh file present in the "release" folder.
2. Ensure that the DRIVER_MODE and COEX_MODE are set as below
DRIVER_MODE = 1
COEX_MODE = 2 (For Access Point Mode)
(Or)
Redpine Signals, Inc. Proprietary and Confidential Page 27
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
COEX_MODE = 3 (For Both Access Point and Station Modes)
3. Ensure that in menuconfig, NL80211 and HOSTAPD support is enabled.
4. Compile the driver.
Make sure the following parameters are enabled in the hostapd configuration file (wlan/hostapd-
2.4/hostapd/.config) CONFIG_LIBNL32=y
$ make
Compilation of NL80211 requires libnl library files. Please refer to page Appendix F: Installation of Missing Generic
Netlink Libraries for configuration of hoapd.conf file for libnl and installing libnl drivers if they are not available.
5. Go to the release folder and start the device in Access Point mode.
$ cd release
$ sh wlan_enable.sh
6. Issue the following command to get physical interfaces on which we can add wifi0 interface
$iw phy | grep phy
The output of the command will be phyX (X can be 1,2,3,… eg:phy1,phy2 etc)
Now add wifi0 interface to phyX.
$service NetworkManager stop
$iw phy phy1 interface add wifi0 type __ap
Instead of following the above steps in step 6, we can directly create vap by using "onebox_util" binary present in the release folder
$ ./onebox_util rpine0 create_vap wifi0 ap
Configure the SSID Settings of the AP in the hostapd_open.conf file (say if you are starting AP in open mode). In order to start AP in a particular band and channels, configure variables hw_mode, channel and country in hostapd_open.conf (present in release folder) file as follows :
hw_mode=a ('a'-5GHz and 'g'-2.4GHz)
channel=36
country_code=US
Note: Channel selection in the hostapd_open.conf file should be appropriate as per the band selected.
Redpine Signals, Inc. Proprietary and Confidential Page 28
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
Make sure in hostapd_open.conf file, the AP netdevice name is set to wifi0 or wifi1 according to the interface obtained by following the above steps. For eg:
Interface = wifi0 Note: Refer section Appendix G: Considerations need to be made during hostapd usage for description of other configurable parameters of hostapd.conf file(s).
7. Run hostapd with following command
$ ./hostapd hostapd_open.conf ddddt> log &
In the same way, we can also configure required SSID and Passphrase and key management settings in hostapd_ccmp.conf, hostapd_wep.conf, hostapd_tkip.conf files accordingly. If you want to use Auto Channel Selection using hostapd refer ACS with Hostapd section.
4.4.5 Installation in Wi-Fi Direct Mode (With BSD Interface Support)
The steps for installing OneBox-Mobile software in Wi-Fi Direct Mode are as follows: The "start_p2p.sh" script present in the "release" folder needs to be run in order to start the supplicant and also for installing the Wi-Fi Direct mode. The configurable parameters in the p2p.conf file are outlined below:
listen channel
operating channel
GO Intent
After starting the supplicant, the p2p_commands mentioned below should be executed.
To find other P2P networks
#. /wpa_cli –i wifi0 p2p_find
To find other P2P devices in range
#. /wpa_cli –i wifi0 p2p_peers
To connect to a P2P network
#. /wpa_cli –i wifi0 p2p_connect <BSS ID> pbc go_intent=<intent value>
Here the intent value range is between 0 and 15 (Putting intent value to 0 makes p2p device as client and 15 makes p2p device as group owner).
4.4.5.1 Autonomous GO Mode
The given below command is used to start the device in Autonomous GO mode:
# ./wpa_cli i wifi0 p2p_group_add freq=<channel_freq>
The "channel_freq" input mentioned in the above command is the center frequency of the Wi-Fi channel in which the GO needs to be started The OneBox-Mobile software supports DFS slave mode. However, DFS Channels need to be avoided till the module is certified for DFS.. If this parameter is not provided, then the GO will start in the channel specified in the p2p.conf file. Legacy Wi-Fi clients (non P2P clients) need a passphrase to connect to the p2p group. The command given below generates the passphrase for legacy Wi-Fi clients.
#. /wpa_cli i wifi0 p2p_get_passphrase
Redpine Signals, Inc. Proprietary and Confidential Page 29
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
4.4.6 Installation in Wi-Fi Direct Mode (With NL80211 Support only for Kernel v3.8 or higher)
The steps for installing OneBox-Mobile software in Wi-Fi Direct Mode are as follows: The "start_p2p_nl80211.sh" script present in the "release" folder needs to be run in order to start the supplicant and also for installing the Wi-Fi Direct mode. The configurable parameters in the p2p_nl80211.conf file are outlined below:
listen channel
operating channel
GO Intent
wpa_supplicant version used should be latest one (2.6 or higher). Please check the start_p2p_nl80211.sh script for better understanding and update it accordingly. After starting the supplicant, the p2p_commands mentioned below should be executed.
To find other P2P networks
#. /wpa_cli i wifi0 p2p_find
To find other P2P devices in range
#. /wpa_cli i wifi0 p2p_peers
To connect to a P2P network
#. /wpa_cli i wifi0 p2p_connect <BSS ID> pbc go_intent=<intent value>
Here the intent value range is between 0 and 15 (Putting intent value to 0 makes p2p device as client and 15 makes p2p device as group owner). If you are becoming GO, dhcp server should be running on GO Interface.
4.4.6.1 Autonomous GO Mode
The steps for installing OneBox-Mobile software in Wi-Fi Direct Mode are as follows: The "start_p2pgo.sh" script present in the "release" folder needs to be run in order to start the supplicant and also for installing the Wi-Fi Direct mode. The configurable parameters in the p2p_nl80211.conf file are outlined below:
listen channel
operating channel
GO Intent
wpa_supplicant version used should be latest one (2.6 or higher). Please check the start_p2pgo.sh script for better understanding and update it accordingly. The given below command is used to start the device in Autonomous GO mode:
# ./wpa_cli i wifi0 p2p_group_add freq=<channel_freq>
The "channel_freq" input mentioned in the above command is the center frequency of the Wi-Fi channel in which the GO needs to be started The OneBox-Mobile software supports DFS slave mode. However, DFS Channels need to be avoided till the module is certified for DFS.. If this parameter is not provided, then the GO will start in the channel specified in the p2p_nl80211.conf file.
Redpine Signals, Inc. Proprietary and Confidential Page 30
RS9116 n-Link Linux and Android
Technical Reference Manual
Version 2.0
P2P Devices can scan this Group Owner and can connect directly. Run following command to start receiving connect
calls from P2P devices
#. /wpa_cli –i wifi0
- > wps_pbc You will start getting ENROLEE detect calls from other P2P Devices in the vicinity. You can see the running logs on wpa_cli prompt for the device getting connected.
Legacy Wi-Fi clients (non P2P clients) need a passphrase to connect to the p2p group. The command given below
generates the passphrase for legacy Wi-Fi clients.
#. /wpa_cli –i wifi0 p2p_get_passphrase
Run DHCP Server on GO Interface before connecting P2P or Legacy devices.
4.5 OneBox-Mobile in Wi-Fi + Bluetooth Classic Coexistence Mode
This section explains about the installation of Wi-Fi and BT Classic modes. Please note that in case of using Coexistence mode, each protocol should be loaded individually one after the other.
Open the common_insert.sh file present in the "release" folder.
Ensure that the DRIVER_MODE and COEX_MODE are set as below:
- DRIVER_MODE = 1
- COEX_MODE = 5(For WLAN Station and BT Classic Mode)
- COEX_MODE = 6 (For WLAN Access Point and BT Classic Mode)
For SDIO mode, ensure that the SDIO stack related modules are already inserted in the kernel refer Appendix A:
Configuration of Kernels from 3.13 and above section to install sdio stack modules .
1. Follow the instructions mentioned in the section 4.4.1 Installation in Wi-Fi Client Mode inorder to install the Wi-Fi
Client mode.
2. Run the "bt_enable.sh" or wlan_bt_insert.sh or onebox_insert.sh script present in the "release" folder as per the
instructions given in the Installing the Driver in order to start the Bluetooth Classic mode. This script inserts Bluetooth modules and common HAL modules, provided if it is not already inserted.
3. You can check whether the BT Classic mode has been started successfully or not, by running the following command:
hciconfig
If the driver is loaded correctly, the above command displays a network adaptor named "hciX". An example output is given below:
hci0:Type: BR/EDR Bus: SDIO BD Address: 00:23:A7:00:05:68 ACL MTU: 1021:8 SCO MTU: 30:8 UP RUNNING PSCAN RX bytes:478 acl:0 sco:0 events:20 errors:0 TX bytes:331 acl:0 sco:0 commands:19 errors:0
4. After the device is up, we can pair it with the other devices using the Bluetooth Manager application. The files can also be sent and received using Bluetooth Manager. Instead of Bluetooth Manager, the device can be configured using
"hcitool" or "hciconfig". The procedure for using Bluetooth Manager is explained in the section Appendix C: Using the
Bluetooth Manager
Loading...
+ 112 hidden pages