Re: [PATCH 7/8] rsi: add module parameter operating mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/15/2017 8:20 AM, Amitkumar Karwar wrote:
From: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx>

Operating mode determines the support for other protocols.
This is made as module parameter for better usage.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@xxxxxxxxx>
Signed-off-by: Siva Rebbagondla <siva.rebbagondla@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Amitkumar Karwar <amit.karwar@xxxxxxxxxxxxxxxxxx>
---

[...]

-struct rsi_hw *rsi_91x_init(void)
+struct rsi_hw *rsi_91x_init(u16 oper_mode)
  {
  	struct rsi_hw *adapter = NULL;
  	struct rsi_common *common = NULL;
@@ -320,11 +336,34 @@ struct rsi_hw *rsi_91x_init(void)
  	spin_lock_init(&adapter->ps_lock);
  	timer_setup(&common->roc_timer, rsi_roc_timeout, 0);
  	init_completion(&common->wlan_init_completion);
+	common->oper_mode = oper_mode;
  	common->init_done = true;
-
-	common->coex_mode = RSI_DEV_COEX_MODE_WIFI_ALONE;
-	common->oper_mode = RSI_DEV_OPMODE_WIFI_ALONE;
  	adapter->device_model = RSI_DEV_9113;

Seems there are definitions for coex_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;

... why use magic values here ?

+		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);
+
  	if (common->coex_mode > 1) {
  		if (rsi_coex_attach(common)) {
  			rsi_dbg(ERR_ZONE, "Failed to init coex module\n");
@@ -359,10 +398,13 @@ void rsi_91x_deinit(struct rsi_hw *adapter)
  	for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
  		skb_queue_purge(&common->tx_queue[ii]);

-	common->init_done = false;
-
-	if (common->coex_mode > 1)
+	if (common->coex_mode > 1) {
  		rsi_coex_detach(common);
+		if (g_proto_ops.bt_ops->detach)
+			g_proto_ops.bt_ops->detach(common->bt_adapter);
+	}
+
+	common->init_done = false;

Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux