Skip to content
Snippets Groups Projects
Forked from Librem5 / firmware-rs9116-nonfree
4 commits behind the upstream repository.
Guido Gunther's avatar
Guido Gunther authored
Guard defines in rsi_sdio.h

See merge request guido.gunther/firmware-rs9116-nonfree!2
61559da5
History
Description:
============

	This package contains Redpine open source driver (rsi) package for 9116 Chipset. 
	This file gives the instruction to load Firmware file to flash, build and install the driver. 
	For instructions on complete usage of the driver and module, 
	please refer RSI_OpenSource_Driver_TRM.pdf in documents folder.

Features Supported:
===================
	* Wi-Fi Station Mode
	* 802.11 Legacy Power save
       	* 802.11 UAPSD
	* Hardware connection monitor
	* Back ground scan and roaming
	* 802.11d Regulatory
	* Wi-Fi AP Mode
	* WoWLAN
	* Wi-Fi Direct mode
	* BT-EDR mode
	* BT-LE mode
	* Wi-Fi BT Coex mode
	* ZIGB end device mode
	* Wi-Fi ZIGB end device coex mode
	* ZIGB coordinator mode
	* ZIGB router mode

Package:
========
	Driver		: rsi [Source code]
	Firmware	: RS9116_NLINK_WLAN_BT_IMAGE.rps [Wi-Fi Station + BT Classic + BT LE or BT alone mode]
	Release Notes	: Change log of the releases 
	README		: Loading Firmware to Flash, Build, Install and Usage guide.

Build:
======
	* Copy relevant firmware file(*.rps) to /lib/firmware.
	* To build driver from kernel source:
		-> copy the driver to <kernel_source_path>/drivers/net/wireless
		-> Move Makefile to Makefile_local
		-> Move Makefile_ker to Makefile
		-> Give 'make menuconfig' from kernel source 

			$ make menuconfig

		-> Go to 'Device Drivers -> Network device support -> Wireless LAN'
		-> Select 'Redpine Signals Inc devices'
		-> Select required interface (SDIO/USB).
		-> Select CONFIG_RSI_COEX_MODE option for Wi-Fi + BT Coex mode. 
		-> Select CONFIG_RSI_PURISM to disable FW upgrade feature in driver.
		-> Build driver using below commands

			$ make SUBDIRS=drivers/net/wireless/rsi

	* To build driver locally:
		-> Edit Makefile and configure option as below:

		-> Uncomment 'CONFIG_HW_SCAN_OFFLOAD=y' to use Hardware scan offload feature.
		   By default this flag is enabled. It is recommened not to comment this flag
		   [Particularly if you want to use back ground scanning and roaming feature].

		-> Uncomment 'CONFIG_CARACALLA_BOARD=y' if you are working on Dell Caracalla
		   board. By default 'EXTRA_CFLAGS += -DPLATFORM_X86' is enabled. For embedded
		   platforms please comment this flag.

		-> Uncomment 'CONFIG_RSI_PURISM=y' if you want to stop FW upgrade feature.

		-> Uncomment 'CONFIG_RSI_WOW=y' if you want to use Wake-on-WLAN feature.

		-> Uncomment 'CONFIG_RSI_P2P=y' if you want to use Wi-Fi direct (p2p) mode.

		-> Uncomment 'CONFIG_RSI_BT_ALONE=y' in Makefile to run BT alone (classic/LE) mode.

		-> Uncomment 'CONFIG_RSI_MULTI_MODE=y' in Makefile to enable multiple opermodes support
											in driver.

		-> Uncomment 'CONFIG_RSI_COEX_MODE=y' in Makefile to run Wi-Fi + BT Coex mode or
								 Wi-Fi + ZigB end device coex mode.

		-> Uncomment 'CONFIG_RS9116_FLASH_MODE=y' in Makefile to enable FLASH based FW load for 9116 chip.

		-> Uncomment 'CONFIG_RSI_NO_SDIO_MULTIBLOCK=y' if your platform's SDIO host controller
		   does not support multiblock mode. Do not uncomment this if you use USB interface.

		-> Build driver using 'make'
			$ make

	* Binaries prepared: 
		rsi_91x.ko, rsi_usb.ko and rsi_sdio.ko

Install:
========
	* insmod rsi_91x.ko rsi_zone_enabled=0x1f dev_oper_mode=13
	where
     	bit 0 - error zone
      	bit 1 - info zone (generic debug messages)
      	bit 2 - init zone
      	bit 3 - mgmt tx zone
      	bit 4 - mgmt rx zone
      	bit 5 - data tx zone
      	bit 6 - data rx zone
      	bit 7 - fsm zone
      	bit 8 - isr zone

      To enable error and info zone use below command:
      $ insmod rsi_91x.ko rsi_zone_enabled=0x3 dev_oper_mode=<val> 
		or
      To use multiple modules with multiple opermodes, use below command:
      $ insmod rsi_91x.ko rsi_zone_enabled=0x3 dev_oper_mode=<val1>,<val2>,<val3>,<val4>,<val5>		# Max support for mulltiple dev_oper_modes for multiple modules are 5.

	  where val:
	  13 - Wi-Fi station + BT dual mode
	  14 - Wi-Fi AP + BT dual mode

	* device operating mode value can be found in the below 'sysfs' entries:
		
		$ cat /sys/module/rsi_sdio/parameters/dev_oper_mode
		  13

		$ cat /sys/module/rsi_usb/parameters/dev_oper_mode
		  14

	* If any invalid mode is given, the default mode 13 (Wi-Fi sta + BT dual mode) is used.

	* insmod rsi_usb.ko
		or
	* insmod rsi_sdio.ko

      While using SDIO interface, To change SDIO clock, User can give their board specific SDIO clock using below command
      $ insmod rsi_91x.ko rsi_zone_enabled=0x3 dev_oper_mode=13
      $ insmod rsi_sdio.ko sdio_clock=25     # sdio_clock is in the range from 1 to 50.

      For wlan_disable(Flight mode), user can enable through module_param while inserting modules. It will be disabled by default.
      $ insmod rsi_91x.ko rsi_zone_enabled=0x1 dev_oper_mode=13 feature_bitmap_9116=1
      $ insmod rsi_sdio.ko

Remove:
=======
	* rmmod rsi_usb 
		or 
	* rmmod rsi_sdio
	* rmmod rsi_91x

Station Mode
============
	* Use wpa_supplicant version 2.6 or above to verify the station connnectivity
	* To use stand-alone station mode, add below line in wpa_supplicant configuration
	  file
		p2p_disabled=1

AP Mode
=======
	* Run start_ap.sh script in scripts folder to start AP

Configure:
==========
	* Use iwconfig or iw to configure different parameters in device.
	* Check below sections for individual commands usage

Powersave configuration
=======================
* Powersave can be enabled or disable from command line using iwconfig / iw.

* Use below commad to enable power save
	$> iwconfig <intf_name> power on

* Use below command to disable power save
	$> iwconfig <intf_name> power off


Background scanning:
====================
Background scanning is not directly supported in mac80211. Hence this feature
is supported in rsi driver through debugfs.
Firmware bgcan alone does not work for roaming. Hence it should be enable with
supplicant bgscan.

	* To verify the bgscan status and parameters

		$> cat /sys/kernel/debug/phy<X>/bgscan

	* To enable back ground scan and configure its parameters from debugfs:

		$> echo 1 10 10 20 20 100 1 3 1 6 11 > /sys/kernel/debug/phy<X>/bgscan

		1	- Enable background scan. 
		10	- BGscan threshold (in dBM). This is the upper RSSI threshold.
			  If the signal strength of connected beacon is less than this 
			  threshold at bgscan interval bgscan will be performed otherwise 
			  not performed. To always do bgscan this value can be given 0.
		10	- RSSI tolerence threshold used in roaming. If the difference between 
			  the current RSSI value of the connected Access Point and the RSSI 
			  value of the Access Point from the previous background scan is greater 
			  than the RSSI Tolerance Threshold, then the module performs a 
			  background scan. Assigning a large value to this field will eliminate 
			  this method of triggering background scans.
		20	- Periodicity (in seconds). This is the back ground scan interval.
			  Setting this value to 0 will disable the background scan
		20	- active scan duraiton (in msecs). Active scan duration in each channel.
			  Max value is 255ms.
		100	- passive scan duration (in msecs). Passive scan duration in DFS channels.
			  Max value is 255ms.
		1	- two probe enable (directed and undirected probe alternates). 0 indicates 
			  sending only broadcast probe.
		3	- number of background scan channels. Max channels supported are 24.
		1,6,11	- list of channels

	* To enable all valid channels in the current regulatory domain, configure 0 in num of channel field
		$> echo 1 10 10 20 20 100 0 > /sys/kernel/debug/phy<X>/bgscan

	* To disable back ground scan from debugs:

		$> echo 0 > /sys/kernel/debug/phy<X>/bgscan

	* For checking the list of bgscan channels configured to device use below command
		
		$> cat /sys/kernel/debug/phy<X>/bgscan

	  This will display the list of bgscan channels configured to device with DFS indication also


Antenna Selection
=================
To select external antenna use the below command

	$> iw phy <phyX> set antenna 1 0

To move back to internal antenna

	$> iw phy <phyX> set antenna 0 0

Note: Make sure you put interface down before setting antenna and interface up after setting the antenna.

Country Setting
===============
To set a country use below command

	$> iw reg set <country_code>
	
	Eg: iw reg set IN (For India)

To check the current regulatory domain

	$> iw reg get

Software RF-Kill verification
=============================
* rfkill package needs to be installed to verify software rfkill

* Use below command to list the wireless interfaces in the system
	$> rfkill list

* Use below command to block an interface
	$> rfkill block <interface_number_listed_in_rfkill_list>

* Use below command to unblock an interface
	$> rfkill unblock <interface_number_listed_in_rfkill_list>