Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 246850
b: refs/heads/master
c: 2493a54
h: refs/heads/master
v: v3
  • Loading branch information
Sujith Manoharan authored and John W. Linville committed Apr 13, 2011
1 parent 8690958 commit 24b97d8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 32 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: 9b674a0207c9b75ddcdcdb07e46843fac8267507
refs/heads/master: 2493a547ee81e6daca812d5dd7cf9357aebc379b
77 changes: 46 additions & 31 deletions trunk/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,50 @@

#define FUDGE 2

void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
struct ath9k_tx_queue_info qi, qi_be;

memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info));

ath9k_hw_get_txq_props(ah, priv->beaconq, &qi);

if (priv->ah->opmode == NL80211_IFTYPE_AP) {
qi.tqi_aifs = 1;
qi.tqi_cwmin = 0;
qi.tqi_cwmax = 0;
} else if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) {
int qnum = priv->hwq_map[WME_AC_BE];

ath9k_hw_get_txq_props(ah, qnum, &qi_be);

qi.tqi_aifs = qi_be.tqi_aifs;

/*
* For WIFI Beacon Distribution
* Long slot time : 2x cwmin
* Short slot time : 4x cwmin
*/
if (ah->slottime == ATH9K_SLOT_TIME_20)
qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
else
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;

qi.tqi_cwmax = qi_be.tqi_cwmax;

}

if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
ath_err(ath9k_hw_common(ah),
"Unable to update beacon queue %u!\n", priv->beaconq);
} else {
ath9k_hw_resettxqueue(ah, priv->beaconq);
}
}


static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv,
struct htc_beacon_config *bss_conf)
{
Expand Down Expand Up @@ -176,6 +220,8 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,
"imask: 0x%x\n",
bss_conf->beacon_interval, nexttbtt, imask);

ath9k_htc_beaconq_config(priv);

WMI_CMD(WMI_DISABLE_INTR_CMDID);
ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval));
priv->cur_beacon_conf.bmiss_cnt = 0;
Expand Down Expand Up @@ -347,37 +393,6 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv)
ath9k_htc_send_beacon(priv, slot);
}

/* Currently, only for IBSS */
void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
struct ath9k_tx_queue_info qi, qi_be;
int qnum = priv->hwq_map[WME_AC_BE];

memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info));

ath9k_hw_get_txq_props(ah, qnum, &qi_be);

qi.tqi_aifs = qi_be.tqi_aifs;
/* For WIFI Beacon Distribution
* Long slot time : 2x cwmin
* Short slot time : 4x cwmin
*/
if (ah->slottime == ATH9K_SLOT_TIME_20)
qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
else
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
qi.tqi_cwmax = qi_be.tqi_cwmax;

if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
ath_err(ath9k_hw_common(ah),
"Unable to update beacon queue %u!\n", qnum);
} else {
ath9k_hw_resettxqueue(ah, priv->beaconq);
}
}

void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
struct ieee80211_vif *vif)
{
Expand Down

0 comments on commit 24b97d8

Please sign in to comment.