diff options
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/commands.c')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/commands.c | 77 |
1 files changed, 68 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index 7e12438551ba..777584d76a88 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c | |||
@@ -99,6 +99,10 @@ int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size, | |||
99 | return ret; | 99 | return ret; |
100 | } | 100 | } |
101 | 101 | ||
102 | static int modparam_wiwi = COEX_MODE_CM; | ||
103 | module_param_named(wiwi, modparam_wiwi, int, 0644); | ||
104 | MODULE_PARM_DESC(wiwi, "Wifi-WiMAX coexistence: 1=SA, 2=XOR, 3=CM (default)"); | ||
105 | |||
102 | static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] = | 106 | static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] = |
103 | { | 107 | { |
104 | {4, 3, 0, COEX_UNASSOC_IDLE_FLAGS}, | 108 | {4, 3, 0, COEX_UNASSOC_IDLE_FLAGS}, |
@@ -122,18 +126,18 @@ static struct coex_event iwm_sta_xor_prio_tbl[COEX_EVENTS_NUM] = | |||
122 | static struct coex_event iwm_sta_cm_prio_tbl[COEX_EVENTS_NUM] = | 126 | static struct coex_event iwm_sta_cm_prio_tbl[COEX_EVENTS_NUM] = |
123 | { | 127 | { |
124 | {1, 1, 0, COEX_UNASSOC_IDLE_FLAGS}, | 128 | {1, 1, 0, COEX_UNASSOC_IDLE_FLAGS}, |
125 | {4, 3, 0, COEX_UNASSOC_MANUAL_SCAN_FLAGS}, | 129 | {4, 4, 0, COEX_UNASSOC_MANUAL_SCAN_FLAGS}, |
126 | {3, 3, 0, COEX_UNASSOC_AUTO_SCAN_FLAGS}, | 130 | {3, 3, 0, COEX_UNASSOC_AUTO_SCAN_FLAGS}, |
127 | {5, 5, 0, COEX_CALIBRATION_FLAGS}, | 131 | {6, 6, 0, COEX_CALIBRATION_FLAGS}, |
128 | {3, 3, 0, COEX_PERIODIC_CALIBRATION_FLAGS}, | 132 | {3, 3, 0, COEX_PERIODIC_CALIBRATION_FLAGS}, |
129 | {5, 4, 0, COEX_CONNECTION_ESTAB_FLAGS}, | 133 | {6, 5, 0, COEX_CONNECTION_ESTAB_FLAGS}, |
130 | {4, 4, 0, COEX_ASSOCIATED_IDLE_FLAGS}, | 134 | {4, 4, 0, COEX_ASSOCIATED_IDLE_FLAGS}, |
131 | {4, 4, 0, COEX_ASSOC_MANUAL_SCAN_FLAGS}, | 135 | {4, 4, 0, COEX_ASSOC_MANUAL_SCAN_FLAGS}, |
132 | {4, 4, 0, COEX_ASSOC_AUTO_SCAN_FLAGS}, | 136 | {4, 4, 0, COEX_ASSOC_AUTO_SCAN_FLAGS}, |
133 | {4, 4, 0, COEX_ASSOC_ACTIVE_LEVEL_FLAGS}, | 137 | {4, 4, 0, COEX_ASSOC_ACTIVE_LEVEL_FLAGS}, |
134 | {1, 1, 0, COEX_RF_ON_FLAGS}, | 138 | {1, 1, 0, COEX_RF_ON_FLAGS}, |
135 | {1, 1, 0, COEX_RF_OFF_FLAGS}, | 139 | {1, 1, 0, COEX_RF_OFF_FLAGS}, |
136 | {6, 6, 0, COEX_STAND_ALONE_DEBUG_FLAGS}, | 140 | {7, 7, 0, COEX_STAND_ALONE_DEBUG_FLAGS}, |
137 | {5, 4, 0, COEX_IPAN_ASSOC_LEVEL_FLAGS}, | 141 | {5, 4, 0, COEX_IPAN_ASSOC_LEVEL_FLAGS}, |
138 | {1, 1, 0, COEX_RSRVD1_FLAGS}, | 142 | {1, 1, 0, COEX_RSRVD1_FLAGS}, |
139 | {1, 1, 0, COEX_RSRVD2_FLAGS} | 143 | {1, 1, 0, COEX_RSRVD2_FLAGS} |
@@ -148,7 +152,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm) | |||
148 | 152 | ||
149 | coex_table_cmd.flags = COEX_FLAGS_STA_TABLE_VALID_MSK; | 153 | coex_table_cmd.flags = COEX_FLAGS_STA_TABLE_VALID_MSK; |
150 | 154 | ||
151 | switch (iwm->conf.coexist_mode) { | 155 | switch (modparam_wiwi) { |
152 | case COEX_MODE_XOR: | 156 | case COEX_MODE_XOR: |
153 | case COEX_MODE_CM: | 157 | case COEX_MODE_CM: |
154 | coex_enabled = 1; | 158 | coex_enabled = 1; |
@@ -173,7 +177,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm) | |||
173 | COEX_FLAGS_ASSOC_WAKEUP_UMASK_MSK | | 177 | COEX_FLAGS_ASSOC_WAKEUP_UMASK_MSK | |
174 | COEX_FLAGS_UNASSOC_WAKEUP_UMASK_MSK; | 178 | COEX_FLAGS_UNASSOC_WAKEUP_UMASK_MSK; |
175 | 179 | ||
176 | switch (iwm->conf.coexist_mode) { | 180 | switch (modparam_wiwi) { |
177 | case COEX_MODE_XOR: | 181 | case COEX_MODE_XOR: |
178 | memcpy(coex_table_cmd.sta_prio, iwm_sta_xor_prio_tbl, | 182 | memcpy(coex_table_cmd.sta_prio, iwm_sta_xor_prio_tbl, |
179 | sizeof(iwm_sta_xor_prio_tbl)); | 183 | sizeof(iwm_sta_xor_prio_tbl)); |
@@ -184,7 +188,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm) | |||
184 | break; | 188 | break; |
185 | default: | 189 | default: |
186 | IWM_ERR(iwm, "Invalid coex_mode 0x%x\n", | 190 | IWM_ERR(iwm, "Invalid coex_mode 0x%x\n", |
187 | iwm->conf.coexist_mode); | 191 | modparam_wiwi); |
188 | break; | 192 | break; |
189 | } | 193 | } |
190 | } else | 194 | } else |
@@ -192,7 +196,7 @@ int iwm_send_prio_table(struct iwm_priv *iwm) | |||
192 | 196 | ||
193 | return iwm_send_lmac_ptrough_cmd(iwm, COEX_PRIORITY_TABLE_CMD, | 197 | return iwm_send_lmac_ptrough_cmd(iwm, COEX_PRIORITY_TABLE_CMD, |
194 | &coex_table_cmd, | 198 | &coex_table_cmd, |
195 | sizeof(struct iwm_coex_prio_table_cmd), 1); | 199 | sizeof(struct iwm_coex_prio_table_cmd), 0); |
196 | } | 200 | } |
197 | 201 | ||
198 | int iwm_send_init_calib_cfg(struct iwm_priv *iwm, u8 calib_requested) | 202 | int iwm_send_init_calib_cfg(struct iwm_priv *iwm, u8 calib_requested) |
@@ -396,7 +400,7 @@ int iwm_send_umac_config(struct iwm_priv *iwm, __le32 reset_flags) | |||
396 | return ret; | 400 | return ret; |
397 | 401 | ||
398 | ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, | 402 | ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, |
399 | CFG_COEX_MODE, iwm->conf.coexist_mode); | 403 | CFG_COEX_MODE, modparam_wiwi); |
400 | if (ret < 0) | 404 | if (ret < 0) |
401 | return ret; | 405 | return ret; |
402 | 406 | ||
@@ -929,3 +933,58 @@ int iwm_target_reset(struct iwm_priv *iwm) | |||
929 | 933 | ||
930 | return iwm_hal_send_target_cmd(iwm, &target_cmd, NULL); | 934 | return iwm_hal_send_target_cmd(iwm, &target_cmd, NULL); |
931 | } | 935 | } |
936 | |||
937 | int iwm_send_umac_stop_resume_tx(struct iwm_priv *iwm, | ||
938 | struct iwm_umac_notif_stop_resume_tx *ntf) | ||
939 | { | ||
940 | struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT; | ||
941 | struct iwm_umac_cmd umac_cmd; | ||
942 | struct iwm_umac_cmd_stop_resume_tx stp_res_cmd; | ||
943 | struct iwm_sta_info *sta_info; | ||
944 | u8 sta_id = STA_ID_N_COLOR_ID(ntf->sta_id); | ||
945 | int i; | ||
946 | |||
947 | sta_info = &iwm->sta_table[sta_id]; | ||
948 | if (!sta_info->valid) { | ||
949 | IWM_ERR(iwm, "Invalid STA: %d\n", sta_id); | ||
950 | return -EINVAL; | ||
951 | } | ||
952 | |||
953 | umac_cmd.id = UMAC_CMD_OPCODE_STOP_RESUME_STA_TX; | ||
954 | umac_cmd.resp = 0; | ||
955 | |||
956 | stp_res_cmd.flags = ntf->flags; | ||
957 | stp_res_cmd.sta_id = ntf->sta_id; | ||
958 | stp_res_cmd.stop_resume_tid_msk = ntf->stop_resume_tid_msk; | ||
959 | for (i = 0; i < IWM_UMAC_TID_NR; i++) | ||
960 | stp_res_cmd.last_seq_num[i] = | ||
961 | sta_info->tid_info[i].last_seq_num; | ||
962 | |||
963 | return iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd, &stp_res_cmd, | ||
964 | sizeof(struct iwm_umac_cmd_stop_resume_tx)); | ||
965 | |||
966 | } | ||
967 | |||
968 | int iwm_send_pmkid_update(struct iwm_priv *iwm, | ||
969 | struct cfg80211_pmksa *pmksa, u32 command) | ||
970 | { | ||
971 | struct iwm_umac_pmkid_update update; | ||
972 | int ret; | ||
973 | |||
974 | memset(&update, 0, sizeof(struct iwm_umac_pmkid_update)); | ||
975 | |||
976 | update.command = cpu_to_le32(command); | ||
977 | if (pmksa->bssid) | ||
978 | memcpy(&update.bssid, pmksa->bssid, ETH_ALEN); | ||
979 | if (pmksa->pmkid) | ||
980 | memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN); | ||
981 | |||
982 | ret = iwm_send_wifi_if_cmd(iwm, &update, | ||
983 | sizeof(struct iwm_umac_pmkid_update), 0); | ||
984 | if (ret) { | ||
985 | IWM_ERR(iwm, "PMKID update command failed\n"); | ||
986 | return ret; | ||
987 | } | ||
988 | |||
989 | return 0; | ||
990 | } | ||