Commit 898b2553 authored by Prameela Rani Garnepudi's avatar Prameela Rani Garnepudi Committed by Kalle Valo

rsi: add module parameter operating mode

Operating mode determines the support for other protocols.
This is made as module parameter for better usage.
Signed-off-by: default avatarPrameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: default avatarSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 716b840c
...@@ -70,8 +70,24 @@ EXPORT_SYMBOL_GPL(rsi_dbg); ...@@ -70,8 +70,24 @@ EXPORT_SYMBOL_GPL(rsi_dbg);
static char *opmode_str(int oper_mode) static char *opmode_str(int oper_mode)
{ {
switch (oper_mode) { switch (oper_mode) {
case RSI_DEV_OPMODE_WIFI_ALONE: case DEV_OPMODE_WIFI_ALONE:
return "Wi-Fi alone"; return "Wi-Fi alone";
case DEV_OPMODE_BT_ALONE:
return "BT EDR alone";
case DEV_OPMODE_BT_LE_ALONE:
return "BT LE alone";
case DEV_OPMODE_BT_DUAL:
return "BT Dual";
case DEV_OPMODE_STA_BT:
return "Wi-Fi STA + BT EDR";
case DEV_OPMODE_STA_BT_LE:
return "Wi-Fi STA + BT LE";
case DEV_OPMODE_STA_BT_DUAL:
return "Wi-Fi STA + BT DUAL";
case DEV_OPMODE_AP_BT:
return "Wi-Fi AP + BT EDR";
case DEV_OPMODE_AP_BT_DUAL:
return "Wi-Fi AP + BT DUAL";
} }
return "Unknown"; return "Unknown";
...@@ -278,7 +294,7 @@ void rsi_set_bt_context(void *priv, void *bt_context) ...@@ -278,7 +294,7 @@ void rsi_set_bt_context(void *priv, void *bt_context)
* *
* Return: Pointer to the adapter structure on success, NULL on failure . * Return: Pointer to the adapter structure on success, NULL on failure .
*/ */
struct rsi_hw *rsi_91x_init(void) struct rsi_hw *rsi_91x_init(u16 oper_mode)
{ {
struct rsi_hw *adapter = NULL; struct rsi_hw *adapter = NULL;
struct rsi_common *common = NULL; struct rsi_common *common = NULL;
...@@ -321,9 +337,33 @@ struct rsi_hw *rsi_91x_init(void) ...@@ -321,9 +337,33 @@ struct rsi_hw *rsi_91x_init(void)
timer_setup(&common->roc_timer, rsi_roc_timeout, 0); timer_setup(&common->roc_timer, rsi_roc_timeout, 0);
init_completion(&common->wlan_init_completion); init_completion(&common->wlan_init_completion);
common->init_done = true; common->init_done = true;
adapter->device_model = RSI_DEV_9113;
common->oper_mode = oper_mode;
/* Determine coex mode */
switch (common->oper_mode) {
case DEV_OPMODE_STA_BT_DUAL:
case DEV_OPMODE_STA_BT:
case DEV_OPMODE_STA_BT_LE:
case DEV_OPMODE_BT_ALONE:
case DEV_OPMODE_BT_LE_ALONE:
case DEV_OPMODE_BT_DUAL:
common->coex_mode = 2;
break;
case DEV_OPMODE_AP_BT_DUAL:
case DEV_OPMODE_AP_BT:
common->coex_mode = 4;
break;
case DEV_OPMODE_WIFI_ALONE:
common->coex_mode = 1;
break;
default:
common->oper_mode = 1;
common->coex_mode = 1;
}
rsi_dbg(INFO_ZONE, "%s: oper_mode = %d, coex_mode = %d\n",
__func__, common->oper_mode, common->coex_mode);
common->coex_mode = RSI_DEV_COEX_MODE_WIFI_ALONE;
common->oper_mode = RSI_DEV_OPMODE_WIFI_ALONE;
adapter->device_model = RSI_DEV_9113; adapter->device_model = RSI_DEV_9113;
#ifdef CONFIG_RSI_COEX #ifdef CONFIG_RSI_COEX
if (common->coex_mode > 1) { if (common->coex_mode > 1) {
......
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
#include "rsi_coex.h" #include "rsi_coex.h"
#include "rsi_hal.h" #include "rsi_hal.h"
/* Default operating mode is wlan STA + BT */
static u16 dev_oper_mode = DEV_OPMODE_STA_BT_DUAL;
module_param(dev_oper_mode, ushort, 0444);
MODULE_PARM_DESC(dev_oper_mode,
"1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
"9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
"6[AP + BT classic], 14[AP + BT classic + BT LE]");
/** /**
* rsi_sdio_set_cmd52_arg() - This function prepares cmd 52 read/write arg. * rsi_sdio_set_cmd52_arg() - This function prepares cmd 52 read/write arg.
* @rw: Read/write * @rw: Read/write
...@@ -926,7 +934,7 @@ static int rsi_probe(struct sdio_func *pfunction, ...@@ -926,7 +934,7 @@ static int rsi_probe(struct sdio_func *pfunction,
rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__); rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__);
adapter = rsi_91x_init(); adapter = rsi_91x_init(dev_oper_mode);
if (!adapter) { if (!adapter) {
rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n", rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n",
__func__); __func__);
......
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
#include "rsi_hal.h" #include "rsi_hal.h"
#include "rsi_coex.h" #include "rsi_coex.h"
/* Default operating mode is wlan STA + BT */
static u16 dev_oper_mode = DEV_OPMODE_STA_BT_DUAL;
module_param(dev_oper_mode, ushort, 0444);
MODULE_PARM_DESC(dev_oper_mode,
"1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
"9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
"6[AP + BT classic], 14[AP + BT classic + BT LE]");
/** /**
* rsi_usb_card_write() - This function writes to the USB Card. * rsi_usb_card_write() - This function writes to the USB Card.
* @adapter: Pointer to the adapter structure. * @adapter: Pointer to the adapter structure.
...@@ -708,7 +716,7 @@ static int rsi_probe(struct usb_interface *pfunction, ...@@ -708,7 +716,7 @@ static int rsi_probe(struct usb_interface *pfunction,
rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__); rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__);
adapter = rsi_91x_init(); adapter = rsi_91x_init(dev_oper_mode);
if (!adapter) { if (!adapter) {
rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n", rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n",
__func__); __func__);
......
...@@ -81,7 +81,7 @@ static inline int rsi_kill_thread(struct rsi_thread *handle) ...@@ -81,7 +81,7 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
void rsi_mac80211_detach(struct rsi_hw *hw); void rsi_mac80211_detach(struct rsi_hw *hw);
u16 rsi_get_connected_channel(struct ieee80211_vif *vif); u16 rsi_get_connected_channel(struct ieee80211_vif *vif);
struct rsi_hw *rsi_91x_init(void); struct rsi_hw *rsi_91x_init(u16 oper_mode);
void rsi_91x_deinit(struct rsi_hw *adapter); void rsi_91x_deinit(struct rsi_hw *adapter);
int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len); int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len);
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -17,6 +17,17 @@ ...@@ -17,6 +17,17 @@
#ifndef __RSI_HAL_H__ #ifndef __RSI_HAL_H__
#define __RSI_HAL_H__ #define __RSI_HAL_H__
/* Device Operating modes */
#define DEV_OPMODE_WIFI_ALONE 1
#define DEV_OPMODE_BT_ALONE 4
#define DEV_OPMODE_BT_LE_ALONE 8
#define DEV_OPMODE_BT_DUAL 12
#define DEV_OPMODE_STA_BT 5
#define DEV_OPMODE_STA_BT_LE 9
#define DEV_OPMODE_STA_BT_DUAL 13
#define DEV_OPMODE_AP_BT 6
#define DEV_OPMODE_AP_BT_DUAL 14
#define FLASH_WRITE_CHUNK_SIZE (4 * 1024) #define FLASH_WRITE_CHUNK_SIZE (4 * 1024)
#define FLASH_SECTOR_SIZE (4 * 1024) #define FLASH_SECTOR_SIZE (4 * 1024)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment