Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195221
b: refs/heads/master
c: 3bce606
h: refs/heads/master
i:
  195219: d7e382c
v: v3
  • Loading branch information
Reinette Chatre committed May 10, 2010
1 parent 3e2eecf commit 3a7daf7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c810ccdbac434ae38f4ec5331d3f047dc90f98a
refs/heads/master: 3bce6066263efb5733ee2141ac8b56684fb3b0a7
38 changes: 37 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,39 @@ static inline void iwl_dump_lq_cmd(struct iwl_priv *priv,
}
#endif

/**
* is_lq_table_valid() - Test one aspect of LQ cmd for validity
*
* It sometimes happens when a HT rate has been in use and we
* loose connectivity with AP then mac80211 will first tell us that the
* current channel is not HT anymore before removing the station. In such a
* scenario the RXON flags will be updated to indicate we are not
* communicating HT anymore, but the LQ command may still contain HT rates.
* Test for this to prevent driver from sending LQ command between the time
* RXON flags are updated and when LQ command is updated.
*/
static bool is_lq_table_valid(struct iwl_priv *priv,
struct iwl_link_quality_cmd *lq)
{
int i;
struct iwl_ht_config *ht_conf = &priv->current_ht_config;

if (ht_conf->is_ht)
return true;

IWL_DEBUG_INFO(priv, "Channel %u is not an HT channel\n",
priv->active_rxon.channel);
for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) {
if (le32_to_cpu(lq->rs_table[i].rate_n_flags) & RATE_MCS_HT_MSK) {
IWL_DEBUG_INFO(priv,
"index %d of LQ expects HT channel\n",
i);
return false;
}
}
return true;
}

/**
* iwl_send_lq_cmd() - Send link quality command
* @init: This command is sent as part of station initialization right
Expand Down Expand Up @@ -1198,7 +1231,10 @@ int iwl_send_lq_cmd(struct iwl_priv *priv,
iwl_dump_lq_cmd(priv, lq);
BUG_ON(init && (cmd.flags & CMD_ASYNC));

ret = iwl_send_cmd(priv, &cmd);
if (is_lq_table_valid(priv, lq))
ret = iwl_send_cmd(priv, &cmd);
else
ret = -EINVAL;

if (cmd.flags & CMD_ASYNC)
return ret;
Expand Down

0 comments on commit 3a7daf7

Please sign in to comment.