aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index dd1c639074c1..5bf82b9b523b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -407,13 +407,12 @@ int iwl_add_station_common(struct iwl_priv *priv, const u8 *addr,
407} 407}
408EXPORT_SYMBOL(iwl_add_station_common); 408EXPORT_SYMBOL(iwl_add_station_common);
409 409
410static struct iwl_link_quality_cmd *iwl_sta_init_lq(struct iwl_priv *priv, 410static struct iwl_link_quality_cmd *iwl_sta_alloc_lq(struct iwl_priv *priv,
411 u8 sta_id) 411 u8 sta_id)
412{ 412{
413 int i, r; 413 int i, r;
414 struct iwl_link_quality_cmd *link_cmd; 414 struct iwl_link_quality_cmd *link_cmd;
415 u32 rate_flags; 415 u32 rate_flags;
416 int ret = 0;
417 416
418 link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL); 417 link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL);
419 if (!link_cmd) { 418 if (!link_cmd) {
@@ -459,10 +458,6 @@ static struct iwl_link_quality_cmd *iwl_sta_init_lq(struct iwl_priv *priv,
459 458
460 link_cmd->sta_id = sta_id; 459 link_cmd->sta_id = sta_id;
461 460
462 ret = iwl_send_lq_cmd(priv, link_cmd, CMD_SYNC, true);
463 if (ret)
464 IWL_ERR(priv, "Link quality command failed (%d)\n", ret);
465
466 return link_cmd; 461 return link_cmd;
467} 462}
468 463
@@ -493,12 +488,17 @@ int iwl_add_local_station(struct iwl_priv *priv, const u8 *addr, bool init_rs)
493 488
494 if (init_rs) { 489 if (init_rs) {
495 /* Set up default rate scaling table in device's station table */ 490 /* Set up default rate scaling table in device's station table */
496 link_cmd = iwl_sta_init_lq(priv, sta_id); 491 link_cmd = iwl_sta_alloc_lq(priv, sta_id);
497 if (!link_cmd) { 492 if (!link_cmd) {
498 IWL_ERR(priv, "Unable to initialize rate scaling for station %pM.\n", 493 IWL_ERR(priv, "Unable to initialize rate scaling for station %pM.\n",
499 addr); 494 addr);
500 return -ENOMEM; 495 return -ENOMEM;
501 } 496 }
497
498 ret = iwl_send_lq_cmd(priv, link_cmd, CMD_SYNC, true);
499 if (ret)
500 IWL_ERR(priv, "Link quality command failed (%d)\n", ret);
501
502 spin_lock_irqsave(&priv->sta_lock, flags); 502 spin_lock_irqsave(&priv->sta_lock, flags);
503 priv->stations[sta_id].lq = link_cmd; 503 priv->stations[sta_id].lq = link_cmd;
504 spin_unlock_irqrestore(&priv->sta_lock, flags); 504 spin_unlock_irqrestore(&priv->sta_lock, flags);