Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268357
b: refs/heads/master
c: db8cbbf
h: refs/heads/master
i:
  268355: 0213683
v: v3
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Sep 12, 2011
1 parent 6133097 commit 0569f82
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 178 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: e929821dee3ea88f5da20f889207bb0d8ad9bba9
refs/heads/master: db8cbbfd6d279b506813723e41d7f9c85891136e
45 changes: 2 additions & 43 deletions trunk/drivers/staging/brcm80211/brcmsmac/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,11 @@
#include "main.h"
#include "alloc.h"

static void brcms_c_pub_mfree(struct brcms_pub *pub)
{
if (pub == NULL)
return;

kfree(pub->multicast);
kfree(pub);
}

static struct brcms_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
{
struct brcms_pub *pub;

pub = kzalloc(sizeof(struct brcms_pub), GFP_ATOMIC);
if (pub == NULL) {
*err = 1001;
goto fail;
}

pub->multicast = kzalloc(ETH_ALEN * MAXMULTILIST, GFP_ATOMIC);
if (pub->multicast == NULL) {
*err = 1003;
goto fail;
}

return pub;

fail:
brcms_c_pub_mfree(pub);
return NULL;
}

static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg)
{
if (cfg == NULL)
return;

kfree(cfg->maclist);
kfree(cfg->current_bss);
kfree(cfg);
}
Expand All @@ -81,13 +48,6 @@ static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit)
return NULL;
}

static void brcms_c_bsscfg_ID_assign(struct brcms_c_info *wlc,
struct brcms_bss_cfg *bsscfg)
{
bsscfg->ID = wlc->next_bsscfg_ID;
wlc->next_bsscfg_ID++;
}

/*
* The common driver entry routine. Error codes should be unique
*/
Expand All @@ -102,7 +62,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
}

/* allocate struct brcms_c_pub state structure */
wlc->pub = brcms_c_pub_malloc(unit, err, devid);
wlc->pub = kzalloc(sizeof(struct brcms_pub), GFP_ATOMIC);
if (wlc->pub == NULL) {
*err = 1003;
goto fail;
Expand Down Expand Up @@ -150,7 +110,6 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
*err = 1011;
goto fail;
}
brcms_c_bsscfg_ID_assign(wlc, wlc->cfg);

wlc->protection = kzalloc(sizeof(struct brcms_protection),
GFP_ATOMIC);
Expand Down Expand Up @@ -205,7 +164,7 @@ void brcms_c_detach_mfree(struct brcms_c_info *wlc)
return;

brcms_c_bsscfg_mfree(wlc->cfg);
brcms_c_pub_mfree(wlc->pub);
kfree(wlc->pub);
kfree(wlc->modulecb);
kfree(wlc->default_bss);
kfree(wlc->protection);
Expand Down
68 changes: 7 additions & 61 deletions trunk/drivers/staging/brcm80211/brcmsmac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@

#define TBTT_ALIGN_LEEWAY_US 100 /* min leeway before first TBTT in us */

/* Software feature flag defines used by wlfeatureflag */
#define WL_SWFL_NOHWRADIO 0x0004
#define WL_SWFL_FLOWCONTROL 0x0008 /* Enable backpressure to OS stack */
#define WL_SWFL_WLBSSSORT 0x0010 /* Per-port supports sorting of BSS */

/* n-mode support capability */
/* 2x2 includes both 1x1 & 2x2 devices
* reserved #define 2 for future when we want to separate 1x1 & 2x2 and
Expand Down Expand Up @@ -2779,11 +2774,6 @@ void brcms_c_coredisable(struct brcms_hardware *wlc_hw)
/* turn off PHYPLL to save power */
brcms_b_core_phypll_ctl(wlc_hw, false);

/* No need to set wlc->pub->radio_active = OFF
* because this function needs down capability and
* radio_active is designed for BCMNODOWN.
*/

/* remove gpio controls */
if (wlc_hw->ucode_dbgsel)
ai_gpiocontrol(wlc_hw->sih, ~0, 0, GPIO_DRV_PRIORITY);
Expand Down Expand Up @@ -3744,9 +3734,6 @@ static void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw, bool shortslot)
*/
void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)
{
int idx;
struct brcms_bss_cfg *cfg;

/* use the override if it is set */
if (wlc->shortslot_override != BRCMS_SHORTSLOT_AUTO)
shortslot = (wlc->shortslot_override == BRCMS_SHORTSLOT_ON);
Expand All @@ -3756,17 +3743,6 @@ void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)

wlc->shortslot = shortslot;

/* update the capability based on current shortslot mode */
FOREACH_BSS(wlc, idx, cfg)
if (!cfg->associated)
continue;
cfg->current_bss->capability &=
~WLAN_CAPABILITY_SHORT_SLOT_TIME;
if (wlc->shortslot)
cfg->current_bss->capability |=
WLAN_CAPABILITY_SHORT_SLOT_TIME;
END_FOREACH_BSS()

brcms_b_set_shortslot(wlc->hw, shortslot);
}

Expand Down Expand Up @@ -4193,7 +4169,7 @@ static void brcms_c_down_led_upd(struct brcms_c_info *wlc)
static bool brcms_c_radio_monitor_start(struct brcms_c_info *wlc)
{
/* Don't start the timer if HWRADIO feature is disabled */
if (wlc->radio_monitor || (wlc->pub->wlfeatureflag & WL_SWFL_NOHWRADIO))
if (wlc->radio_monitor)
return true;

wlc->radio_monitor = true;
Expand Down Expand Up @@ -4238,7 +4214,7 @@ bool brcms_c_radio_monitor_stop(struct brcms_c_info *wlc)
/* read hwdisable state and propagate to wlc flag */
static void brcms_c_radio_hwdisable_upd(struct brcms_c_info *wlc)
{
if (wlc->pub->wlfeatureflag & WL_SWFL_NOHWRADIO || wlc->pub->hw_off)
if (wlc->pub->hw_off)
return;

if (brcms_b_radio_read_hwdisabled(wlc->hw))
Expand Down Expand Up @@ -4360,7 +4336,7 @@ static void brcms_c_watchdog(void *arg)
if ((wlc->pub->now % SW_TIMER_MAC_STAT_UPD) == 0)
brcms_c_statsupd(wlc);

if (BRCMS_ISNPHY(wlc->band) && !wlc->pub->tempsense_disable &&
if (BRCMS_ISNPHY(wlc->band) &&
((wlc->pub->now - wlc->tempsense_lasttime) >=
BRCMS_TEMPSENSE_PERIOD)) {
wlc->tempsense_lasttime = wlc->pub->now;
Expand Down Expand Up @@ -4453,7 +4429,6 @@ void brcms_c_info_init(struct brcms_c_info *wlc, int unit)
wlc->pub->_wme = AUTO;
wlc->pub->_ampdu = AMPDU_AGG_HOST;
wlc->pub->bcmerror = 0;
wlc->pub->_coex = ON;

/* initialize mpc delay */
wlc->mpc_delay_off = wlc->mpc_dlycnt = BRCMS_MPC_MIN_DELAYCNT;
Expand Down Expand Up @@ -4940,7 +4915,6 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
/* init default and target BSS with some sane initial values */
memset((char *)(bi), 0, sizeof(struct brcms_bss_info));
bi->beacon_period = BEACON_INTERVAL_DEFAULT;
bi->dtim_period = DTIM_INTERVAL_DEFAULT;

/* fill the default channel as the first valid channel
* starting from the 2G channels
Expand Down Expand Up @@ -4977,8 +4951,7 @@ static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
* will remain the same
*/
brcmu_pktq_init(&qi->q, BRCMS_PREC_COUNT,
2 * BRCMS_DATAHIWAT + PKTQ_LEN_DEFAULT
+ wlc->pub->psq_pkts_total);
2 * BRCMS_DATAHIWAT + PKTQ_LEN_DEFAULT);

/* add this queue to the the global list */
p = wlc->tx_queues;
Expand Down Expand Up @@ -5220,7 +5193,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
wlc->bsscfg[0] = wlc->cfg;
wlc->cfg->_idx = 0;
wlc->cfg->wlc = wlc;
pub->txmaxpkts = MAXTXPKTS;

brcms_c_wme_initparams_sta(wlc, &wlc->wme_param_ie);

Expand Down Expand Up @@ -5953,18 +5925,6 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)

wlc->shortslot_override = shortslot;

if (preamble == BRCMS_PLCP_SHORT)
wlc->default_bss->capability |= WLAN_CAPABILITY_SHORT_PREAMBLE;
else
wlc->default_bss->capability &= ~WLAN_CAPABILITY_SHORT_PREAMBLE;

/* Update shortslot capability bit for AP and IBSS */
if (shortslot == BRCMS_SHORTSLOT_ON)
wlc->default_bss->capability |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
else
wlc->default_bss->capability &=
~WLAN_CAPABILITY_SHORT_SLOT_TIME;

/* Use the default 11g rateset */
if (!rs.count)
brcms_c_rateset_copy(&cck_ofdm_rates, &rs);
Expand Down Expand Up @@ -6792,8 +6752,7 @@ void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb,
prio = sdu->priority;

if (!brcms_c_prec_enq(wlc, q, sdu, prec)) {
if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL))
if (!EDCF_ENAB(wlc->pub))
wiphy_err(wlc->wiphy, "wl%d: txq_enq: txq overflow"
"\n", wlc->pub->unit);

Expand All @@ -6810,13 +6769,9 @@ void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb,
* would make the decision on what to drop instead of relying on
* stack to make the right decision
*/
if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) {
if (!EDCF_ENAB(wlc->pub)) {
if (pktq_len(q) >= BRCMS_DATAHIWAT)
brcms_c_txflowcontrol(wlc, qi, ON, ALLPRIO);
} else if (wlc->pub->_priofc) {
if (pktq_plen(q, wlc_prio2prec_map[prio]) >= BRCMS_DATAHIWAT)
brcms_c_txflowcontrol(wlc, qi, ON, prio);
}
}

Expand Down Expand Up @@ -7816,19 +7771,10 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
* Check if flow control needs to be turned off after
* sending the packet
*/
if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) {
if (!EDCF_ENAB(wlc->pub)) {
if (brcms_c_txflowcontrol_prio_isset(wlc, qi, ALLPRIO)
&& (pktq_len(q) < BRCMS_DATAHIWAT / 2))
brcms_c_txflowcontrol(wlc, qi, OFF, ALLPRIO);
} else if (wlc->pub->_priofc) {
int prio;
for (prio = MAXPRIO; prio >= 0; prio--) {
if (brcms_c_txflowcontrol_prio_isset(wlc, qi, prio) &&
q->q[wlc_prio2prec_map[prio]].len <
BRCMS_DATAHIWAT / 2)
brcms_c_txflowcontrol(wlc, qi, OFF, prio);
}
}
in_send_q = false;
}
Expand Down
11 changes: 0 additions & 11 deletions trunk/drivers/staging/brcm80211/brcmsmac/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ struct brcms_txq_info {
* tempsense_lasttime;
* tx_duty_cycle_ofdm: maximum allowed duty cycle for OFDM.
* tx_duty_cycle_cck: maximum allowed duty cycle for CCK.
* next_bsscfg_ID;
* pkt_queue: txq for transmit packets.
* mpc_dur: total time (ms) in mpc mode except for the portion since
* radio is turned off last time.
Expand Down Expand Up @@ -722,8 +721,6 @@ struct brcms_c_info {
u16 tx_duty_cycle_ofdm;
u16 tx_duty_cycle_cck;

u16 next_bsscfg_ID;

struct brcms_txq_info *pkt_queue;
u32 mpc_dur;
u32 mpc_laston_ts;
Expand Down Expand Up @@ -757,11 +754,6 @@ struct antsel_info {
* bcmc_scb: one bcmc_scb per band
* _idx: the index of this bsscfg, assigned at wlc_bsscfg_alloc()
*
* MAC filter
* ----------
* nmac: # of entries on maclist array
* macmode: allow/deny stations on maclist array
* maclist: list of source MAC addrs to match
*
* BSSID: BSSID (associated)
* cur_etheraddr: h/w address
Expand Down Expand Up @@ -797,9 +789,6 @@ struct brcms_bss_cfg {
u8 SSID[IEEE80211_MAX_SSID_LEN];
struct scb *bcmc_scb[MAXBANDS];
s8 _idx;
uint nmac;
int macmode;
struct ether_addr *maclist;
u8 BSSID[ETH_ALEN];
u8 cur_etheraddr[ETH_ALEN];
u16 bcmc_fid;
Expand Down
Loading

0 comments on commit 0569f82

Please sign in to comment.