iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 3 Dec 2009 10:40:17 +0000 (11:40 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Dec 2009 19:16:28 +0000 (14:16 -0500)
Wifi and wimax coexistence mode is set by wifi at boot time. There can be
several modes, defined by priority tables. User space components can decide
which one to select by writing to /sys/module/iwmc3200wifi/parameters/wiwi
with this patch, before bringing the interface up.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/commands.c
drivers/net/wireless/iwmc3200wifi/iwm.h
drivers/net/wireless/iwmc3200wifi/main.c

index f9dc4b58c499e7fbe1ad81fc8c350425f2bdf4ab..777584d76a8800f1c4750ea24a3fa4df360835f3 100644 (file)
@@ -99,6 +99,10 @@ int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size,
        return ret;
 }
 
+static int modparam_wiwi = COEX_MODE_CM;
+module_param_named(wiwi, modparam_wiwi, int, 0644);
+MODULE_PARM_DESC(wiwi, "Wifi-WiMAX coexistence: 1=SA, 2=XOR, 3=CM (default)");
+
 static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] =
 {
        {4, 3, 0, COEX_UNASSOC_IDLE_FLAGS},
@@ -148,7 +152,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm)
 
        coex_table_cmd.flags = COEX_FLAGS_STA_TABLE_VALID_MSK;
 
-       switch (iwm->conf.coexist_mode) {
+       switch (modparam_wiwi) {
        case COEX_MODE_XOR:
        case COEX_MODE_CM:
                coex_enabled = 1;
@@ -173,7 +177,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm)
                                        COEX_FLAGS_ASSOC_WAKEUP_UMASK_MSK |
                                        COEX_FLAGS_UNASSOC_WAKEUP_UMASK_MSK;
 
-               switch (iwm->conf.coexist_mode) {
+               switch (modparam_wiwi) {
                case COEX_MODE_XOR:
                        memcpy(coex_table_cmd.sta_prio, iwm_sta_xor_prio_tbl,
                               sizeof(iwm_sta_xor_prio_tbl));
@@ -184,7 +188,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm)
                        break;
                default:
                        IWM_ERR(iwm, "Invalid coex_mode 0x%x\n",
-                               iwm->conf.coexist_mode);
+                               modparam_wiwi);
                        break;
                }
        } else
@@ -396,7 +400,7 @@ int iwm_send_umac_config(struct iwm_priv *iwm, __le32 reset_flags)
                return ret;
 
        ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
-                                     CFG_COEX_MODE, iwm->conf.coexist_mode);
+                                     CFG_COEX_MODE, modparam_wiwi);
        if (ret < 0)
                return ret;
 
index 8d091f918f33a1b9b7d9d0da46a1c4ccae331543..5a26bb05a33ae8867f77179c5329053d9f258a11 100644 (file)
@@ -81,7 +81,6 @@ struct iwm_conf {
        u32 assoc_timeout;
        u32 roam_timeout;
        u32 wireless_mode;
-       u32 coexist_mode;
 
        u8 ibss_band;
        u8 ibss_channel;
index 087f04355c1b14bd7c4de936606cc922f2c91e63..0ffb04111a42c52b7a33053be20542598d01e4fc 100644 (file)
@@ -82,7 +82,6 @@ static struct iwm_conf def_iwm_conf = {
        .roam_timeout           = 10,
        .wireless_mode          = WIRELESS_MODE_11A | WIRELESS_MODE_11G |
                                  WIRELESS_MODE_11N,
-       .coexist_mode           = COEX_MODE_CM,
 
        /* IBSS */
        .ibss_band              = UMAC_BAND_2GHZ,