Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35101
b: refs/heads/master
c: d7712ac
h: refs/heads/master
i:
  35099: d19f2dc
v: v3
  • Loading branch information
Daniel Drake authored and John W. Linville committed Jul 27, 2006
1 parent deab1b0 commit d90cda7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 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: 5acd0c4153be25269d7cb9a4b09fd6db571c5cc1
refs/heads/master: d7712ac254a4ae2e9c927e29e37b8c7ac334e6ad
8 changes: 8 additions & 0 deletions trunk/include/net/ieee80211softmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ extern void ieee80211softmac_fragment_lost(struct net_device *dev,
* Note that the rates need to be sorted. */
extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates);

/* Finds the highest rate which is:
* 1. Present in ri (optionally a basic rate)
* 2. Supported by the device
* 3. Less than or equal to the user-defined rate
*/
extern u8 ieee80211softmac_highest_supported_rate(struct ieee80211softmac_device *mac,
struct ieee80211softmac_ratesinfo *ri, int basic_only);

/* Helper function which advises you the rate at which a frame should be
* transmitted at. */
static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac,
Expand Down
16 changes: 5 additions & 11 deletions trunk/net/ieee80211/softmac/ieee80211softmac_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,14 @@ int ieee80211softmac_ratesinfo_rate_supported(struct ieee80211softmac_ratesinfo
return 0;
}

/* Finds the highest rate which is:
* 1. Present in ri (optionally a basic rate)
* 2. Supported by the device
* 3. Less than or equal to the user-defined rate
*/
static u8 highest_supported_rate(struct ieee80211softmac_device *mac,
u8 ieee80211softmac_highest_supported_rate(struct ieee80211softmac_device *mac,
struct ieee80211softmac_ratesinfo *ri, int basic_only)
{
u8 user_rate = mac->txrates.user_rate;
int i;

if (ri->count == 0) {
dprintk(KERN_ERR PFX "empty ratesinfo?\n");
if (ri->count == 0)
return IEEE80211_CCK_RATE_1MB;
}

for (i = ri->count - 1; i >= 0; i--) {
u8 rate = ri->rates[i];
Expand All @@ -209,6 +202,7 @@ static u8 highest_supported_rate(struct ieee80211softmac_device *mac,
/* If we haven't found a suitable rate by now, just trust the user */
return user_rate;
}
EXPORT_SYMBOL_GPL(ieee80211softmac_highest_supported_rate);

void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac,
u8 erp_value)
Expand Down Expand Up @@ -244,13 +238,13 @@ void ieee80211softmac_recalc_txrates(struct ieee80211softmac_device *mac)
u32 change = 0;

change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT;
txrates->default_rate = highest_supported_rate(mac, &mac->bssinfo.supported_rates, 0);
txrates->default_rate = ieee80211softmac_highest_supported_rate(mac, &mac->bssinfo.supported_rates, 0);

change |= IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK;
txrates->default_fallback = lower_rate(mac, txrates->default_rate);

change |= IEEE80211SOFTMAC_TXRATECHG_MCAST;
txrates->mcast_rate = highest_supported_rate(mac, &mac->bssinfo.supported_rates, 1);
txrates->mcast_rate = ieee80211softmac_highest_supported_rate(mac, &mac->bssinfo.supported_rates, 1);

if (mac->txrates_change)
mac->txrates_change(mac->dev, change);
Expand Down

0 comments on commit d90cda7

Please sign in to comment.