aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-07-08 11:46:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 15:02:03 -0400
commite419d62d72b23392e7f9a5da047fb17d70edc54a (patch)
tree6b6608a26d9cb88f176b530e85d3e8b607927856 /drivers
parent06f491ef4b659fa6f6850f31d05a4a03db0d9d96 (diff)
iwlagn: consolidate the API that sends host commands and move to transport
Now, there are only two functions to send a host command: * send_cmd that receives a iwl_host_cmd * send_cmd_pdu that builds the iwl_host_cmd itself and received flags The flags CMD_ASYNC / CMD_SYNC / CMD_WANT_SKB are not changed by the API functions. Kill the unused flags CMD_SIZE_NORMAL / CMD_NO_SKB on the way. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-calib.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sv-open.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c4
19 files changed, 100 insertions, 92 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index c55cec853f50..82093344b9b5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -316,7 +316,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
316 return -EFAULT; 316 return -EFAULT;
317 } 317 }
318 318
319 return iwl_send_cmd_sync(priv, &hcmd); 319 return priv->trans.ops->send_cmd(priv, &hcmd);
320} 320}
321 321
322static struct iwl_lib_ops iwl5000_lib = { 322static struct iwl_lib_ops iwl5000_lib = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 965d010794b4..2134514a40d1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -255,7 +255,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
255 return -EFAULT; 255 return -EFAULT;
256 } 256 }
257 257
258 return iwl_send_cmd_sync(priv, &hcmd); 258 return priv->trans.ops->send_cmd(priv, &hcmd);
259} 259}
260 260
261static struct iwl_lib_ops iwl6000_lib = { 261static struct iwl_lib_ops iwl6000_lib = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index c9255def1080..e7c74fcb55c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -87,6 +87,7 @@ int iwl_send_calib_results(struct iwl_priv *priv)
87 87
88 struct iwl_host_cmd hcmd = { 88 struct iwl_host_cmd hcmd = {
89 .id = REPLY_PHY_CALIBRATION_CMD, 89 .id = REPLY_PHY_CALIBRATION_CMD,
90 .flags = CMD_SYNC,
90 }; 91 };
91 92
92 for (i = 0; i < IWL_CALIB_MAX; i++) { 93 for (i = 0; i < IWL_CALIB_MAX; i++) {
@@ -95,7 +96,7 @@ int iwl_send_calib_results(struct iwl_priv *priv)
95 hcmd.len[0] = priv->calib_results[i].buf_len; 96 hcmd.len[0] = priv->calib_results[i].buf_len;
96 hcmd.data[0] = priv->calib_results[i].buf; 97 hcmd.data[0] = priv->calib_results[i].buf;
97 hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY; 98 hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
98 ret = iwl_send_cmd_sync(priv, &hcmd); 99 ret = priv->trans.ops->send_cmd(priv, &hcmd);
99 if (ret) { 100 if (ret) {
100 IWL_ERR(priv, "Error %d iteration %d\n", 101 IWL_ERR(priv, "Error %d iteration %d\n",
101 ret, i); 102 ret, i);
@@ -481,7 +482,7 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
481 memcpy(&(priv->sensitivity_tbl[0]), &(cmd.table[0]), 482 memcpy(&(priv->sensitivity_tbl[0]), &(cmd.table[0]),
482 sizeof(u16)*HD_TABLE_SIZE); 483 sizeof(u16)*HD_TABLE_SIZE);
483 484
484 return iwl_send_cmd(priv, &cmd_out); 485 return priv->trans.ops->send_cmd(priv, &cmd_out);
485} 486}
486 487
487/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */ 488/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
@@ -545,7 +546,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv)
545 &(cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX]), 546 &(cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX]),
546 sizeof(u16)*ENHANCE_HD_TABLE_ENTRIES); 547 sizeof(u16)*ENHANCE_HD_TABLE_ENTRIES);
547 548
548 return iwl_send_cmd(priv, &cmd_out); 549 return priv->trans.ops->send_cmd(priv, &cmd_out);
549} 550}
550 551
551void iwl_init_sensitivity(struct iwl_priv *priv) 552void iwl_init_sensitivity(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index ce7d4b56d9b2..406bf59bd441 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -45,7 +45,9 @@ int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)
45 45
46 if (IWL_UCODE_API(priv->ucode_ver) > 1) { 46 if (IWL_UCODE_API(priv->ucode_ver) > 1) {
47 IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant); 47 IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant);
48 return iwl_send_cmd_pdu(priv, TX_ANT_CONFIGURATION_CMD, 48 return priv->trans.ops->send_cmd_pdu(priv,
49 TX_ANT_CONFIGURATION_CMD,
50 CMD_SYNC,
49 sizeof(struct iwl_tx_ant_config_cmd), 51 sizeof(struct iwl_tx_ant_config_cmd),
50 &tx_ant_cmd); 52 &tx_ant_cmd);
51 } else { 53 } else {
@@ -115,8 +117,8 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
115 priv->_agn.phy_calib_chain_noise_gain_cmd); 117 priv->_agn.phy_calib_chain_noise_gain_cmd);
116 cmd.delta_gain_1 = data->delta_gain_code[1]; 118 cmd.delta_gain_1 = data->delta_gain_code[1];
117 cmd.delta_gain_2 = data->delta_gain_code[2]; 119 cmd.delta_gain_2 = data->delta_gain_code[2];
118 iwl_send_cmd_pdu_async(priv, REPLY_PHY_CALIBRATION_CMD, 120 priv->trans.ops->send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
119 sizeof(cmd), &cmd, NULL); 121 CMD_ASYNC, sizeof(cmd), &cmd);
120 122
121 data->radio_write = 1; 123 data->radio_write = 1;
122 data->state = IWL_CHAIN_NOISE_CALIBRATED; 124 data->state = IWL_CHAIN_NOISE_CALIBRATED;
@@ -144,8 +146,9 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
144 memset(&cmd, 0, sizeof(cmd)); 146 memset(&cmd, 0, sizeof(cmd));
145 iwl_set_calib_hdr(&cmd.hdr, 147 iwl_set_calib_hdr(&cmd.hdr,
146 priv->_agn.phy_calib_chain_noise_reset_cmd); 148 priv->_agn.phy_calib_chain_noise_reset_cmd);
147 ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD, 149 ret = priv->trans.ops->send_cmd_pdu(priv,
148 sizeof(cmd), &cmd); 150 REPLY_PHY_CALIBRATION_CMD,
151 CMD_SYNC, sizeof(cmd), &cmd);
149 if (ret) 152 if (ret)
150 IWL_ERR(priv, 153 IWL_ERR(priv,
151 "Could not send REPLY_PHY_CALIBRATION_CMD\n"); 154 "Could not send REPLY_PHY_CALIBRATION_CMD\n");
@@ -290,7 +293,8 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
290 cmd.slots[0].width = cpu_to_le16(slot0); 293 cmd.slots[0].width = cpu_to_le16(slot0);
291 cmd.slots[1].width = cpu_to_le16(slot1); 294 cmd.slots[1].width = cpu_to_le16(slot1);
292 295
293 ret = iwl_send_cmd_pdu(priv, REPLY_WIPAN_PARAMS, sizeof(cmd), &cmd); 296 ret = priv->trans.ops->send_cmd_pdu(priv, REPLY_WIPAN_PARAMS, CMD_SYNC,
297 sizeof(cmd), &cmd);
294 if (ret) 298 if (ret)
295 IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret); 299 IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret);
296 300
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index a926142f470f..39664c9bbff7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -540,8 +540,8 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
540 else 540 else
541 tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD; 541 tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
542 542
543 return iwl_send_cmd_pdu(priv, tx_ant_cfg_cmd, sizeof(tx_power_cmd), 543 return priv->trans.ops->send_cmd_pdu(priv, tx_ant_cfg_cmd, CMD_SYNC,
544 &tx_power_cmd); 544 sizeof(tx_power_cmd), &tx_power_cmd);
545} 545}
546 546
547void iwlagn_temperature(struct iwl_priv *priv) 547void iwlagn_temperature(struct iwl_priv *priv)
@@ -1063,6 +1063,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1063 struct iwl_host_cmd cmd = { 1063 struct iwl_host_cmd cmd = {
1064 .id = REPLY_SCAN_CMD, 1064 .id = REPLY_SCAN_CMD,
1065 .len = { sizeof(struct iwl_scan_cmd), }, 1065 .len = { sizeof(struct iwl_scan_cmd), },
1066 .flags = CMD_SYNC,
1066 }; 1067 };
1067 struct iwl_scan_cmd *scan; 1068 struct iwl_scan_cmd *scan;
1068 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 1069 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
@@ -1359,7 +1360,7 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1359 if (ret) 1360 if (ret)
1360 return ret; 1361 return ret;
1361 1362
1362 ret = iwl_send_cmd_sync(priv, &cmd); 1363 ret = priv->trans.ops->send_cmd(priv, &cmd);
1363 if (ret) { 1364 if (ret) {
1364 clear_bit(STATUS_SCAN_HW, &priv->status); 1365 clear_bit(STATUS_SCAN_HW, &priv->status);
1365 iwlagn_set_pan_params(priv); 1366 iwlagn_set_pan_params(priv);
@@ -1465,7 +1466,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
1465 flush_cmd.fifo_control); 1466 flush_cmd.fifo_control);
1466 flush_cmd.flush_control = cpu_to_le16(flush_control); 1467 flush_cmd.flush_control = cpu_to_le16(flush_control);
1467 1468
1468 return iwl_send_cmd(priv, &cmd); 1469 return priv->trans.ops->send_cmd(priv, &cmd);
1469} 1470}
1470 1471
1471void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control) 1472void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
@@ -1657,13 +1658,13 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
1657 if (priv->cfg->bt_params->bt_session_2) { 1658 if (priv->cfg->bt_params->bt_session_2) {
1658 memcpy(&bt_cmd_2000.basic, &basic, 1659 memcpy(&bt_cmd_2000.basic, &basic,
1659 sizeof(basic)); 1660 sizeof(basic));
1660 ret = iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, 1661 ret = priv->trans.ops->send_cmd_pdu(priv, REPLY_BT_CONFIG,
1661 sizeof(bt_cmd_2000), &bt_cmd_2000); 1662 CMD_SYNC, sizeof(bt_cmd_2000), &bt_cmd_2000);
1662 } else { 1663 } else {
1663 memcpy(&bt_cmd_6000.basic, &basic, 1664 memcpy(&bt_cmd_6000.basic, &basic,
1664 sizeof(basic)); 1665 sizeof(basic));
1665 ret = iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, 1666 ret = priv->trans.ops->send_cmd_pdu(priv, REPLY_BT_CONFIG,
1666 sizeof(bt_cmd_6000), &bt_cmd_6000); 1667 CMD_SYNC, sizeof(bt_cmd_6000), &bt_cmd_6000);
1667 } 1668 }
1668 if (ret) 1669 if (ret)
1669 IWL_ERR(priv, "failed to send BT Coex Config\n"); 1670 IWL_ERR(priv, "failed to send BT Coex Config\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index c6bb73a66d9f..c365295cc59f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -39,7 +39,8 @@ static int iwlagn_disable_bss(struct iwl_priv *priv,
39 int ret; 39 int ret;
40 40
41 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 41 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
42 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send); 42 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_cmd,
43 CMD_SYNC, sizeof(*send), send);
43 44
44 send->filter_flags = old_filter; 45 send->filter_flags = old_filter;
45 46
@@ -64,7 +65,8 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
64 65
65 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 66 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
66 send->dev_type = RXON_DEV_TYPE_P2P; 67 send->dev_type = RXON_DEV_TYPE_P2P;
67 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send); 68 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_cmd,
69 CMD_SYNC, sizeof(*send), send);
68 70
69 send->filter_flags = old_filter; 71 send->filter_flags = old_filter;
70 send->dev_type = old_dev_type; 72 send->dev_type = old_dev_type;
@@ -89,7 +91,8 @@ static int iwlagn_disconn_pan(struct iwl_priv *priv,
89 int ret; 91 int ret;
90 92
91 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 93 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
92 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send); 94 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
95 sizeof(*send), send);
93 96
94 send->filter_flags = old_filter; 97 send->filter_flags = old_filter;
95 98
@@ -117,7 +120,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
117 ctx->qos_data.qos_active, 120 ctx->qos_data.qos_active,
118 ctx->qos_data.def_qos_parm.qos_flags); 121 ctx->qos_data.def_qos_parm.qos_flags);
119 122
120 ret = iwl_send_cmd_pdu(priv, ctx->qos_cmd, 123 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->qos_cmd, CMD_SYNC,
121 sizeof(struct iwl_qosparam_cmd), 124 sizeof(struct iwl_qosparam_cmd),
122 &ctx->qos_data.def_qos_parm); 125 &ctx->qos_data.def_qos_parm);
123 if (ret) 126 if (ret)
@@ -176,8 +179,8 @@ static int iwlagn_send_rxon_assoc(struct iwl_priv *priv,
176 ctx->staging.ofdm_ht_triple_stream_basic_rates; 179 ctx->staging.ofdm_ht_triple_stream_basic_rates;
177 rxon_assoc.acquisition_data = ctx->staging.acquisition_data; 180 rxon_assoc.acquisition_data = ctx->staging.acquisition_data;
178 181
179 ret = iwl_send_cmd_pdu_async(priv, ctx->rxon_assoc_cmd, 182 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_assoc_cmd,
180 sizeof(rxon_assoc), &rxon_assoc, NULL); 183 CMD_ASYNC, sizeof(rxon_assoc), &rxon_assoc);
181 return ret; 184 return ret;
182} 185}
183 186
@@ -262,7 +265,7 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,
262 * Associated RXON doesn't clear the station table in uCode, 265 * Associated RXON doesn't clear the station table in uCode,
263 * so we don't need to restore stations etc. after this. 266 * so we don't need to restore stations etc. after this.
264 */ 267 */
265 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, 268 ret = priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
266 sizeof(struct iwl_rxon_cmd), &ctx->staging); 269 sizeof(struct iwl_rxon_cmd), &ctx->staging);
267 if (ret) { 270 if (ret) {
268 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); 271 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 9b32f83f0b7f..b0e54c915c78 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -180,7 +180,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv,
180 cmd.len[0] = cmd_size; 180 cmd.len[0] = cmd_size;
181 181
182 if (not_empty || send_if_empty) 182 if (not_empty || send_if_empty)
183 return iwl_send_cmd(priv, &cmd); 183 return priv->trans.ops->send_cmd(priv, &cmd);
184 else 184 else
185 return 0; 185 return 0;
186} 186}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index 2043c8b3139b..1976582df241 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -223,7 +223,7 @@ static int iwlagn_send_calib_cfg(struct iwl_priv *priv)
223 calib_cfg_cmd.ucd_calib_cfg.once.send_res = IWL_CALIB_INIT_CFG_ALL; 223 calib_cfg_cmd.ucd_calib_cfg.once.send_res = IWL_CALIB_INIT_CFG_ALL;
224 calib_cfg_cmd.ucd_calib_cfg.flags = IWL_CALIB_INIT_CFG_ALL; 224 calib_cfg_cmd.ucd_calib_cfg.flags = IWL_CALIB_INIT_CFG_ALL;
225 225
226 return iwl_send_cmd(priv, &cmd); 226 return priv->trans.ops->send_cmd(priv, &cmd);
227} 227}
228 228
229void iwlagn_rx_calib_result(struct iwl_priv *priv, 229void iwlagn_rx_calib_result(struct iwl_priv *priv,
@@ -321,7 +321,8 @@ static int iwlagn_send_wimax_coex(struct iwl_priv *priv)
321 /* coexistence is disabled */ 321 /* coexistence is disabled */
322 memset(&coex_cmd, 0, sizeof(coex_cmd)); 322 memset(&coex_cmd, 0, sizeof(coex_cmd));
323 } 323 }
324 return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD, 324 return priv->trans.ops->send_cmd_pdu(priv,
325 COEX_PRIORITY_TABLE_CMD, CMD_SYNC,
325 sizeof(coex_cmd), &coex_cmd); 326 sizeof(coex_cmd), &coex_cmd);
326} 327}
327 328
@@ -353,7 +354,8 @@ void iwlagn_send_prio_tbl(struct iwl_priv *priv)
353 354
354 memcpy(prio_tbl_cmd.prio_tbl, iwlagn_bt_prio_tbl, 355 memcpy(prio_tbl_cmd.prio_tbl, iwlagn_bt_prio_tbl,
355 sizeof(iwlagn_bt_prio_tbl)); 356 sizeof(iwlagn_bt_prio_tbl));
356 if (iwl_send_cmd_pdu(priv, REPLY_BT_COEX_PRIO_TABLE, 357 if (priv->trans.ops->send_cmd_pdu(priv,
358 REPLY_BT_COEX_PRIO_TABLE, CMD_SYNC,
357 sizeof(prio_tbl_cmd), &prio_tbl_cmd)) 359 sizeof(prio_tbl_cmd), &prio_tbl_cmd))
358 IWL_ERR(priv, "failed to send BT prio tbl command\n"); 360 IWL_ERR(priv, "failed to send BT prio tbl command\n");
359} 361}
@@ -365,7 +367,8 @@ int iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type)
365 367
366 env_cmd.action = action; 368 env_cmd.action = action;
367 env_cmd.type = type; 369 env_cmd.type = type;
368 ret = iwl_send_cmd_pdu(priv, REPLY_BT_COEX_PROT_ENV, 370 ret = priv->trans.ops->send_cmd_pdu(priv,
371 REPLY_BT_COEX_PROT_ENV, CMD_SYNC,
369 sizeof(env_cmd), &env_cmd); 372 sizeof(env_cmd), &env_cmd);
370 if (ret) 373 if (ret)
371 IWL_ERR(priv, "failed to send BT env command\n"); 374 IWL_ERR(priv, "failed to send BT env command\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 4d5b7cc33946..d56d17c59de7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -129,6 +129,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
129 struct iwl_tx_beacon_cmd *tx_beacon_cmd; 129 struct iwl_tx_beacon_cmd *tx_beacon_cmd;
130 struct iwl_host_cmd cmd = { 130 struct iwl_host_cmd cmd = {
131 .id = REPLY_TX_BEACON, 131 .id = REPLY_TX_BEACON,
132 .flags = CMD_SYNC,
132 }; 133 };
133 struct ieee80211_tx_info *info; 134 struct ieee80211_tx_info *info;
134 u32 frame_size; 135 u32 frame_size;
@@ -205,7 +206,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
205 cmd.data[1] = priv->beacon_skb->data; 206 cmd.data[1] = priv->beacon_skb->data;
206 cmd.dataflags[1] = IWL_HCMD_DFL_NOCOPY; 207 cmd.dataflags[1] = IWL_HCMD_DFL_NOCOPY;
207 208
208 return iwl_send_cmd_sync(priv, &cmd); 209 return priv->trans.ops->send_cmd(priv, &cmd);
209} 210}
210 211
211static void iwl_bg_beacon_update(struct work_struct *work) 212static void iwl_bg_beacon_update(struct work_struct *work)
@@ -578,7 +579,8 @@ static void iwl_rx_handle(struct iwl_priv *priv)
578 579
579 if (reclaim) { 580 if (reclaim) {
580 /* Invoke any callbacks, transfer the buffer to caller, 581 /* Invoke any callbacks, transfer the buffer to caller,
581 * and fire off the (possibly) blocking iwl_send_cmd() 582 * and fire off the (possibly) blocking
583 * priv->trans.ops->send_cmd()
582 * as we reclaim the driver command queue */ 584 * as we reclaim the driver command queue */
583 if (rxb->page) 585 if (rxb->page)
584 iwl_tx_cmd_complete(priv, rxb); 586 iwl_tx_cmd_complete(priv, rxb);
@@ -1940,8 +1942,9 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1940 adv_cmd.critical_temperature_exit = 1942 adv_cmd.critical_temperature_exit =
1941 cpu_to_le32(priv->hw_params.ct_kill_exit_threshold); 1943 cpu_to_le32(priv->hw_params.ct_kill_exit_threshold);
1942 1944
1943 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, 1945 ret = priv->trans.ops->send_cmd_pdu(priv,
1944 sizeof(adv_cmd), &adv_cmd); 1946 REPLY_CT_KILL_CONFIG_CMD,
1947 CMD_SYNC, sizeof(adv_cmd), &adv_cmd);
1945 if (ret) 1948 if (ret)
1946 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n"); 1949 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n");
1947 else 1950 else
@@ -1955,8 +1958,9 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1955 cmd.critical_temperature_R = 1958 cmd.critical_temperature_R =
1956 cpu_to_le32(priv->hw_params.ct_kill_threshold); 1959 cpu_to_le32(priv->hw_params.ct_kill_threshold);
1957 1960
1958 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, 1961 ret = priv->trans.ops->send_cmd_pdu(priv,
1959 sizeof(cmd), &cmd); 1962 REPLY_CT_KILL_CONFIG_CMD,
1963 CMD_SYNC, sizeof(cmd), &cmd);
1960 if (ret) 1964 if (ret)
1961 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n"); 1965 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n");
1962 else 1966 else
@@ -1980,7 +1984,7 @@ static int iwlagn_send_calib_cfg_rt(struct iwl_priv *priv, u32 cfg)
1980 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL; 1984 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL;
1981 calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg); 1985 calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg);
1982 1986
1983 return iwl_send_cmd(priv, &cmd); 1987 return priv->trans.ops->send_cmd(priv, &cmd);
1984} 1988}
1985 1989
1986 1990
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 9bf46864f0d1..78e031e25481 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -375,8 +375,8 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
375 le32_to_cpu(ctx->timing.beacon_init_val), 375 le32_to_cpu(ctx->timing.beacon_init_val),
376 le16_to_cpu(ctx->timing.atim_window)); 376 le16_to_cpu(ctx->timing.atim_window));
377 377
378 return iwl_send_cmd_pdu(priv, ctx->rxon_timing_cmd, 378 return priv->trans.ops->send_cmd_pdu(priv, ctx->rxon_timing_cmd,
379 sizeof(ctx->timing), &ctx->timing); 379 CMD_SYNC, sizeof(ctx->timing), &ctx->timing);
380} 380}
381 381
382void iwl_set_rxon_hwcrypto(struct iwl_priv *priv, struct iwl_rxon_context *ctx, 382void iwl_set_rxon_hwcrypto(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
@@ -1131,8 +1131,8 @@ void iwl_send_bt_config(struct iwl_priv *priv)
1131 IWL_DEBUG_INFO(priv, "BT coex %s\n", 1131 IWL_DEBUG_INFO(priv, "BT coex %s\n",
1132 (bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active"); 1132 (bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active");
1133 1133
1134 if (iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, 1134 if (priv->trans.ops->send_cmd_pdu(priv, REPLY_BT_CONFIG,
1135 sizeof(struct iwl_bt_cmd), &bt_cmd)) 1135 CMD_SYNC, sizeof(struct iwl_bt_cmd), &bt_cmd))
1136 IWL_ERR(priv, "failed to send BT Coex Config\n"); 1136 IWL_ERR(priv, "failed to send BT Coex Config\n");
1137} 1137}
1138 1138
@@ -1144,11 +1144,13 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags, bool clear)
1144 }; 1144 };
1145 1145
1146 if (flags & CMD_ASYNC) 1146 if (flags & CMD_ASYNC)
1147 return iwl_send_cmd_pdu_async(priv, REPLY_STATISTICS_CMD, 1147 return priv->trans.ops->send_cmd_pdu(priv, REPLY_STATISTICS_CMD,
1148 CMD_ASYNC,
1148 sizeof(struct iwl_statistics_cmd), 1149 sizeof(struct iwl_statistics_cmd),
1149 &statistics_cmd, NULL); 1150 &statistics_cmd);
1150 else 1151 else
1151 return iwl_send_cmd_pdu(priv, REPLY_STATISTICS_CMD, 1152 return priv->trans.ops->send_cmd_pdu(priv, REPLY_STATISTICS_CMD,
1153 CMD_SYNC,
1152 sizeof(struct iwl_statistics_cmd), 1154 sizeof(struct iwl_statistics_cmd),
1153 &statistics_cmd); 1155 &statistics_cmd);
1154} 1156}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 76f65350ebc3..3f7b921922ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -434,16 +434,9 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv,
434 *****************************************************/ 434 *****************************************************/
435 435
436const char *get_cmd_string(u8 cmd); 436const char *get_cmd_string(u8 cmd);
437int __must_check iwl_send_cmd_sync(struct iwl_priv *priv,
438 struct iwl_host_cmd *cmd);
439int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd); 437int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
440int __must_check iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, 438int __must_check iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u32 flags,
441 u16 len, const void *data); 439 u16 len, const void *data);
442int iwl_send_cmd_pdu_async(struct iwl_priv *priv, u8 id, u16 len,
443 const void *data,
444 void (*callback)(struct iwl_priv *priv,
445 struct iwl_device_cmd *cmd,
446 struct iwl_rx_packet *pkt));
447 440
448int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd); 441int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
449 442
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 85e4fa350371..975ad79a5f77 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -259,10 +259,8 @@ struct iwl_channel_info {
259 259
260enum { 260enum {
261 CMD_SYNC = 0, 261 CMD_SYNC = 0,
262 CMD_SIZE_NORMAL = 0, 262 CMD_ASYNC = BIT(0),
263 CMD_NO_SKB = 0, 263 CMD_WANT_SKB = BIT(1),
264 CMD_ASYNC = (1 << 1),
265 CMD_WANT_SKB = (1 << 2),
266}; 264};
267 265
268#define DEF_CMD_PAYLOAD_SIZE 320 266#define DEF_CMD_PAYLOAD_SIZE 320
@@ -295,6 +293,16 @@ enum iwl_hcmd_dataflag {
295 IWL_HCMD_DFL_NOCOPY = BIT(0), 293 IWL_HCMD_DFL_NOCOPY = BIT(0),
296}; 294};
297 295
296/**
297 * struct iwl_host_cmd - Host command to the uCode
298 * @data: array of chunks that composes the data of the host command
299 * @reply_page: pointer to the page that holds the response to the host command
300 * @callback:
301 * @flags: can be CMD_* note CMD_WANT_SKB is incompatible withe CMD_ASYNC
302 * @len: array of the lenths of the chunks in data
303 * @dataflags:
304 * @id: id of the host command
305 */
298struct iwl_host_cmd { 306struct iwl_host_cmd {
299 const void *data[IWL_MAX_CMD_TFDS]; 307 const void *data[IWL_MAX_CMD_TFDS];
300 unsigned long reply_page; 308 unsigned long reply_page;
@@ -1234,6 +1242,8 @@ struct iwl_trans;
1234 * @tx_init:inits the tx memory, allocate if needed 1242 * @tx_init:inits the tx memory, allocate if needed
1235 * @tx_stop: stop the tx 1243 * @tx_stop: stop the tx
1236 * @tx_free: frees the tx memory 1244 * @tx_free: frees the tx memory
1245 * @send_cmd:send a host command
1246 * @send_cmd_pdu:send a host command: flags can be CMD_*
1237 */ 1247 */
1238struct iwl_trans_ops { 1248struct iwl_trans_ops {
1239 int (*rx_init)(struct iwl_priv *priv); 1249 int (*rx_init)(struct iwl_priv *priv);
@@ -1243,6 +1253,11 @@ struct iwl_trans_ops {
1243 int (*tx_init)(struct iwl_priv *priv); 1253 int (*tx_init)(struct iwl_priv *priv);
1244 int (*tx_stop)(struct iwl_priv *priv); 1254 int (*tx_stop)(struct iwl_priv *priv);
1245 void (*tx_free)(struct iwl_priv *priv); 1255 void (*tx_free)(struct iwl_priv *priv);
1256
1257 int (*send_cmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
1258
1259 int (*send_cmd_pdu)(struct iwl_priv *priv, u8 id, u32 flags, u16 len,
1260 const void *data);
1246}; 1261};
1247 1262
1248struct iwl_trans { 1263struct iwl_trans {
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index 107b38e2ee93..6cff8c165ce9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -143,9 +143,6 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
143{ 143{
144 int ret; 144 int ret;
145 145
146 if (WARN_ON(!(cmd->flags & CMD_ASYNC)))
147 return -EINVAL;
148
149 /* An asynchronous command can not expect an SKB to be set. */ 146 /* An asynchronous command can not expect an SKB to be set. */
150 if (WARN_ON(cmd->flags & CMD_WANT_SKB)) 147 if (WARN_ON(cmd->flags & CMD_WANT_SKB))
151 return -EINVAL; 148 return -EINVAL;
@@ -166,16 +163,13 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
166 return 0; 163 return 0;
167} 164}
168 165
169int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) 166static int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
170{ 167{
171 int cmd_idx; 168 int cmd_idx;
172 int ret; 169 int ret;
173 170
174 lockdep_assert_held(&priv->mutex); 171 lockdep_assert_held(&priv->mutex);
175 172
176 if (WARN_ON(cmd->flags & CMD_ASYNC))
177 return -EINVAL;
178
179 /* A synchronous command can not have a callback set. */ 173 /* A synchronous command can not have a callback set. */
180 if (WARN_ON(cmd->callback)) 174 if (WARN_ON(cmd->callback))
181 return -EINVAL; 175 return -EINVAL;
@@ -263,31 +257,15 @@ int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
263 return iwl_send_cmd_sync(priv, cmd); 257 return iwl_send_cmd_sync(priv, cmd);
264} 258}
265 259
266int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data) 260int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u32 flags, u16 len,
267{ 261 const void *data)
268 struct iwl_host_cmd cmd = {
269 .id = id,
270 .len = { len, },
271 .data = { data, },
272 };
273
274 return iwl_send_cmd_sync(priv, &cmd);
275}
276
277int iwl_send_cmd_pdu_async(struct iwl_priv *priv,
278 u8 id, u16 len, const void *data,
279 void (*callback)(struct iwl_priv *priv,
280 struct iwl_device_cmd *cmd,
281 struct iwl_rx_packet *pkt))
282{ 262{
283 struct iwl_host_cmd cmd = { 263 struct iwl_host_cmd cmd = {
284 .id = id, 264 .id = id,
285 .len = { len, }, 265 .len = { len, },
286 .data = { data, }, 266 .data = { data, },
267 .flags = flags,
287 }; 268 };
288 269
289 cmd.flags |= CMD_ASYNC; 270 return iwl_send_cmd(priv, &cmd);
290 cmd.callback = callback;
291
292 return iwl_send_cmd_async(priv, &cmd);
293} 271}
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index ff08da099754..d5bc3e09a92f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -111,7 +111,7 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)
111 if (reg != (reg & CSR_LED_BSM_CTRL_MSK)) 111 if (reg != (reg & CSR_LED_BSM_CTRL_MSK))
112 iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK); 112 iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK);
113 113
114 return iwl_send_cmd(priv, &cmd); 114 return priv->trans.ops->send_cmd(priv, &cmd);
115} 115}
116 116
117/* Set led pattern command */ 117/* Set led pattern command */
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 565e57e48be8..0c08dfd40dd8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -334,7 +334,7 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)
334 le32_to_cpu(cmd->sleep_interval[3]), 334 le32_to_cpu(cmd->sleep_interval[3]),
335 le32_to_cpu(cmd->sleep_interval[4])); 335 le32_to_cpu(cmd->sleep_interval[4]));
336 336
337 return iwl_send_cmd_pdu(priv, POWER_TABLE_CMD, 337 return priv->trans.ops->send_cmd_pdu(priv, POWER_TABLE_CMD, CMD_SYNC,
338 sizeof(struct iwl_powertable_cmd), cmd); 338 sizeof(struct iwl_powertable_cmd), cmd);
339} 339}
340 340
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 438eecd87335..4c809bf9aacc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -61,7 +61,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
61 struct iwl_rx_packet *pkt; 61 struct iwl_rx_packet *pkt;
62 struct iwl_host_cmd cmd = { 62 struct iwl_host_cmd cmd = {
63 .id = REPLY_SCAN_ABORT_CMD, 63 .id = REPLY_SCAN_ABORT_CMD,
64 .flags = CMD_WANT_SKB, 64 .flags = CMD_SYNC | CMD_WANT_SKB,
65 }; 65 };
66 66
67 /* Exit instantly with error when device is not ready 67 /* Exit instantly with error when device is not ready
@@ -74,7 +74,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
74 test_bit(STATUS_EXIT_PENDING, &priv->status)) 74 test_bit(STATUS_EXIT_PENDING, &priv->status))
75 return -EIO; 75 return -EIO;
76 76
77 ret = iwl_send_cmd_sync(priv, &cmd); 77 ret = priv->trans.ops->send_cmd(priv, &cmd);
78 if (ret) 78 if (ret)
79 return ret; 79 return ret;
80 80
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 7df2814fd4f8..06faa1e2237d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -156,7 +156,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
156 } 156 }
157 157
158 cmd.len[0] = priv->cfg->ops->utils->build_addsta_hcmd(sta, data); 158 cmd.len[0] = priv->cfg->ops->utils->build_addsta_hcmd(sta, data);
159 ret = iwl_send_cmd(priv, &cmd); 159 ret = priv->trans.ops->send_cmd(priv, &cmd);
160 160
161 if (ret || (flags & CMD_ASYNC)) 161 if (ret || (flags & CMD_ASYNC))
162 return ret; 162 return ret;
@@ -412,7 +412,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv,
412 412
413 cmd.flags |= CMD_WANT_SKB; 413 cmd.flags |= CMD_WANT_SKB;
414 414
415 ret = iwl_send_cmd(priv, &cmd); 415 ret = priv->trans.ops->send_cmd(priv, &cmd);
416 416
417 if (ret) 417 if (ret)
418 return ret; 418 return ret;
@@ -781,7 +781,7 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
781 return -EINVAL; 781 return -EINVAL;
782 782
783 if (is_lq_table_valid(priv, ctx, lq)) 783 if (is_lq_table_valid(priv, ctx, lq))
784 ret = iwl_send_cmd(priv, &cmd); 784 ret = priv->trans.ops->send_cmd(priv, &cmd);
785 else 785 else
786 ret = -EINVAL; 786 ret = -EINVAL;
787 787
diff --git a/drivers/net/wireless/iwlwifi/iwl-sv-open.c b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
index c00aa5a1b8b8..6f92d22d07e3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sv-open.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
@@ -239,7 +239,7 @@ static int iwl_testmode_ucode(struct ieee80211_hw *hw, struct nlattr **tb)
239 IWL_INFO(priv, "testmode ucode command ID 0x%x, flags 0x%x," 239 IWL_INFO(priv, "testmode ucode command ID 0x%x, flags 0x%x,"
240 " len %d\n", cmd.id, cmd.flags, cmd.len[0]); 240 " len %d\n", cmd.id, cmd.flags, cmd.len[0]);
241 /* ok, let's submit the command to ucode */ 241 /* ok, let's submit the command to ucode */
242 return iwl_send_cmd(priv, &cmd); 242 return priv->trans.ops->send_cmd(priv, &cmd);
243} 243}
244 244
245 245
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index de627f9ae10a..5c5a489a21fb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -66,6 +66,7 @@
66#include "iwl-helpers.h" 66#include "iwl-helpers.h"
67/*TODO remove uneeded includes when the transport layer tx_free will be here */ 67/*TODO remove uneeded includes when the transport layer tx_free will be here */
68#include "iwl-agn.h" 68#include "iwl-agn.h"
69#include "iwl-core.h"
69 70
70static int iwl_trans_rx_alloc(struct iwl_priv *priv) 71static int iwl_trans_rx_alloc(struct iwl_priv *priv)
71{ 72{
@@ -559,6 +560,9 @@ static const struct iwl_trans_ops trans_ops = {
559 .tx_init = iwl_trans_tx_init, 560 .tx_init = iwl_trans_tx_init,
560 .tx_stop = iwl_trans_tx_stop, 561 .tx_stop = iwl_trans_tx_stop,
561 .tx_free = iwl_trans_tx_free, 562 .tx_free = iwl_trans_tx_free,
563
564 .send_cmd = iwl_send_cmd,
565 .send_cmd_pdu = iwl_send_cmd_pdu,
562}; 566};
563 567
564void iwl_trans_register(struct iwl_trans *trans) 568void iwl_trans_register(struct iwl_trans *trans)