Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249297
b: refs/heads/master
c: 94da409
h: refs/heads/master
i:
  249295: ea648fd
v: v3
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed May 3, 2011
1 parent 68ff0a0 commit 2e3545d
Show file tree
Hide file tree
Showing 5 changed files with 64 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: 78e1914dc977e1a1c970be7d4afd110735c92882
refs/heads/master: 94da409ef37c66aba3e4639f49d3696b141a090e
50 changes: 48 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ static int __devinit wl_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent);
static void wl_remove(struct pci_dev *pdev);
static void wl_free(struct wl_info *wl);
static void wl_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br);

MODULE_AUTHOR("Broadcom Corporation");
MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
Expand Down Expand Up @@ -367,9 +368,37 @@ wl_ops_bss_info_changed(struct ieee80211_hw *hw,
mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT);
}
if (changed & BSS_CHANGED_BASIC_RATES) {
struct ieee80211_supported_band *bi;
u32 br_mask, i;
u16 rate;
struct wl_rateset rs;
int error;

/* Basic rateset changed */
wiphy_err(wiphy, "%s: Need to change Basic Rates: 0x%x"
" (implement)\n", __func__, (u32) info->basic_rates);
no_printk("%s: change basic rates: 0x%x\n",
__func__, (u32) info->basic_rates);

/* retrieve the current rates */
error = wlc_ioctl(wl->wlc, WLC_GET_CURR_RATESET,
&rs, sizeof(rs), NULL);
if (error) {
wiphy_err(wiphy, "%s: retrieve rateset failed: %d\n",
__func__, error);
return;
}
br_mask = info->basic_rates;
bi = hw->wiphy->bands[wlc_get_curband(wl->wlc)];
for (i = 0; i < bi->n_bitrates; i++) {
/* convert to internal rate value */
rate = (bi->bitrates[i].bitrate << 1) / 10;

/* set/clear basic rate flag */
wl_set_basic_rate(&rs, rate, br_mask & 1);
br_mask >>= 1;
}

/* update the rate set */
wlc_ioctl(wl->wlc, WLC_SET_RATESET, &rs, sizeof(rs), NULL);
}
if (changed & BSS_CHANGED_BEACON_INT) {
/* Beacon interval changed */
Expand Down Expand Up @@ -1355,6 +1384,23 @@ static void wl_free(struct wl_info *wl)
wl->regsva = NULL;
}

/* flags the given rate in rateset as requested */
static void wl_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br)
{
u32 i;

for (i = 0; i < rs->count; i++) {
if (rate != (rs->rates[i] & 0x7f))
continue;

if (is_br)
rs->rates[i] |= WLC_RATE_FLAG;
else
rs->rates[i] &= WLC_RATE_MASK;
return;
}
}

/*
* precondition: perimeter lock has been acquired
*/
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/staging/brcm80211/brcmsmac/wlc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3006,8 +3006,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wlc_bss_info_t *current_bss;

/* update bsscfg pointer */
bsscfg = NULL; /* XXX: Hack bsscfg to be size one and use this globally */
current_bss = NULL;
bsscfg = wlc->cfg;
current_bss = bsscfg->current_bss;

/* initialize the following to get rid of compiler warning */
nextscb = NULL;
Expand Down Expand Up @@ -3582,7 +3582,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
wl_rateset_t *ret_rs = (wl_rateset_t *) arg;
wlc_rateset_t *rs;

if (bsscfg->associated)
if (wlc->pub->associated)
rs = &current_bss->rateset;
else
rs = &wlc->default_bss->rateset;
Expand Down Expand Up @@ -8451,3 +8451,8 @@ void wlc_inval_dma_pkts(struct wlc_hw_info *hw,
dma_walk_packets(dmah, dma_callback_fn, sta);
}
}

int wlc_get_curband(struct wlc_info *wlc)
{
return wlc->band->bandunit;
}
5 changes: 5 additions & 0 deletions trunk/drivers/staging/brcm80211/brcmsmac/wlc_pub.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
*/
#define WLC_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */

/* rate related definitions */
#define WLC_RATE_FLAG 0x80 /* Flag to indicate it is a basic rate */
#define WLC_RATE_MASK 0x7f /* Rate value mask w/o basic rate flag */

/* legacy rx Antenna diversity for SISO rates */
#define ANT_RX_DIV_FORCE_0 0 /* Use antenna 0 */
#define ANT_RX_DIV_FORCE_1 1 /* Use antenna 1 */
Expand Down Expand Up @@ -564,6 +568,7 @@ extern void wlc_enable_mac(struct wlc_info *wlc);
extern void wlc_associate_upd(struct wlc_info *wlc, bool state);
extern void wlc_scan_start(struct wlc_info *wlc);
extern void wlc_scan_stop(struct wlc_info *wlc);
extern int wlc_get_curband(struct wlc_info *wlc);

static inline int wlc_iovar_getuint(struct wlc_info *wlc, const char *name,
uint *arg)
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/staging/brcm80211/brcmsmac/wlc_rate.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ extern const mcs_info_t mcs_table[];
(_is40 ? mcs_table[_mcs].phy_rate_40 : mcs_table[_mcs].phy_rate_20))
#define VALID_MCS(_mcs) ((_mcs < MCS_TABLE_SIZE))

/* rate related definitions */
#define WLC_RATE_FLAG 0x80 /* Rate flag to indicate it is a basic rate */
#define WLC_RATE_MASK 0x7f /* Rate value mask w/o basic rate flag */

/* Macro to use in the rate_info table */
#define WLC_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */
/* Macro to use the rate_info table */
#define WLC_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */

#define WLC_RATE_500K_TO_BPS(rate) ((rate) * 500000) /* convert 500kbps to bps */

Expand Down

0 comments on commit 2e3545d

Please sign in to comment.