Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122018
b: refs/heads/master
c: c24f081
h: refs/heads/master
v: v3
  • Loading branch information
Kolekar, Abhijeet authored and John W. Linville committed Nov 21, 2008
1 parent b91cb77 commit 2b98728
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 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: cb299bae8929705bf025fdbd6ce0ffcc62f5b3d0
refs/heads/master: c24f0817458464fc9c54489dba19cd94787e5eaf
26 changes: 14 additions & 12 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,17 +1418,28 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv,
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;
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;
i = iwl3945_rates[i].next_ieee) {
if (rate_mask & (1 << i))
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)
Expand All @@ -1446,16 +1457,7 @@ static int iwl3945_send_beacon_cmd(struct iwl3945_priv *priv)
return -ENOMEM;
}

if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) {
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;
}
rate = iwl3945_rate_get_lowest_plcp(priv);

frame_size = iwl3945_hw_get_beacon_cmd(priv, frame, rate);

Expand Down

0 comments on commit 2b98728

Please sign in to comment.