Commit c24f0817 authored by Kolekar, Abhijeet's avatar Kolekar, Abhijeet Committed by John W. Linville

iwl3945 : Simplify iwl3945_send_beacon_cmd

Moved rate_msk calculation to iwl3945_rate_get_lowest_plcp.
Signed-off-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cb299bae
...@@ -1418,9 +1418,16 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv, ...@@ -1418,9 +1418,16 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv,
return priv->ibss_beacon->len; return priv->ibss_beacon->len;
} }
static u8 iwl3945_rate_get_lowest_plcp(int rate_mask) static u8 iwl3945_rate_get_lowest_plcp(struct iwl3945_priv *priv)
{ {
u8 i; u8 i;
int rate_mask;
/* Set rate mask*/
if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
rate_mask = priv->active_rate_basic & 0xF;
else
rate_mask = priv->active_rate_basic & 0xFF0;
for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID; for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID;
i = iwl3945_rates[i].next_ieee) { i = iwl3945_rates[i].next_ieee) {
...@@ -1428,7 +1435,11 @@ static u8 iwl3945_rate_get_lowest_plcp(int rate_mask) ...@@ -1428,7 +1435,11 @@ static u8 iwl3945_rate_get_lowest_plcp(int rate_mask)
return iwl3945_rates[i].plcp; return iwl3945_rates[i].plcp;
} }
return IWL_RATE_INVALID; /* No valid rate was found. Assign the lowest one */
if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)
return IWL_RATE_1M_PLCP;
else
return IWL_RATE_6M_PLCP;
} }
static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv) static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv)
...@@ -1446,16 +1457,7 @@ static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv) ...@@ -1446,16 +1457,7 @@ static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv)
return -ENOMEM; return -ENOMEM;
} }
if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) { rate = iwl3945_rate_get_lowest_plcp(priv);
rate = iwl3945_rate_get_lowest_plcp(priv->active_rate_basic &
0xFF0);
if (rate == IWL_INVALID_RATE)
rate = IWL_RATE_6M_PLCP;
} else {
rate = iwl3945_rate_get_lowest_plcp(priv->active_rate_basic & 0xF);
if (rate == IWL_INVALID_RATE)
rate = IWL_RATE_1M_PLCP;
}
frame_size = iwl3945_hw_get_beacon_cmd(priv, frame, rate); frame_size = iwl3945_hw_get_beacon_cmd(priv, frame, rate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment