Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122302
b: refs/heads/master
c: fe60594
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Nov 26, 2008
1 parent d87ad32 commit 014a079
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 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: 256b77593f3ec07f58cd1f0d573ffe9ccd941b5b
refs/heads/master: fe60594a76d04b4fdea597bf93e4186a03d8d60c
48 changes: 7 additions & 41 deletions trunk/drivers/net/wireless/ath9k/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,29 +780,6 @@ struct ath_rate_softc *ath_rate_attach(struct ath_hal *ah)
return asc;
}

static struct ath_rate_node *ath_rate_node_alloc(struct ath_vap *avp,
struct ath_rate_softc *rsc,
gfp_t gfp)
{
struct ath_rate_node *anode;

anode = kzalloc(sizeof(struct ath_rate_node), gfp);
if (anode == NULL)
return NULL;

anode->avp = avp;
anode->asc = rsc;
avp->rc_node = anode;

return anode;
}

static void ath_rate_node_free(struct ath_rate_node *anode)
{
if (anode != NULL)
kfree(anode);
}

void ath_rate_detach(struct ath_rate_softc *asc)
{
if (asc != NULL)
Expand Down Expand Up @@ -1778,17 +1755,6 @@ static int ath_rate_newassoc(struct ath_softc *sc,
return 0;
}

/*
* This routine is called to initialize the rate control parameters
* in the SIB. It is called initially during system initialization
* or when a station is associated with the AP.
*/
static void ath_rc_sib_init(struct ath_rate_node *ath_rc_priv)
{
ath_rc_priv->rssi_down_time = jiffies_to_msecs(jiffies);
}


static void ath_setup_rates(struct ath_softc *sc,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta,
Expand Down Expand Up @@ -1964,21 +1930,23 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp
struct ath_vap *avp;
struct ath_rate_node *rate_priv;

DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__);

vif = sc->sc_vaps[0];
ASSERT(vif);

avp = (void *)vif->drv_priv;

rate_priv = ath_rate_node_alloc(avp, sc->sc_rc, gfp);
rate_priv = kzalloc(sizeof(struct ath_rate_node), gfp);
if (!rate_priv) {
DPRINTF(sc, ATH_DBG_FATAL,
"%s: Unable to allocate private rc structure\n",
__func__);
return NULL;
}
ath_rc_sib_init(rate_priv);

rate_priv->avp = avp;
rate_priv->asc = sc->sc_rc;
avp->rc_node = rate_priv;
rate_priv->rssi_down_time = jiffies_to_msecs(jiffies);

return rate_priv;
}
Expand All @@ -1987,10 +1955,8 @@ static void ath_rate_free_sta(void *priv, struct ieee80211_sta *sta,
void *priv_sta)
{
struct ath_rate_node *rate_priv = priv_sta;
struct ath_softc *sc = priv;

DPRINTF(sc, ATH_DBG_RATE, "%s", __func__);
ath_rate_node_free(rate_priv);
kfree(rate_priv);
}

static struct rate_control_ops ath_rate_ops = {
Expand Down

0 comments on commit 014a079

Please sign in to comment.