Add external facing methods to control TX A-MPDU negotiaton.

Some fullmac devices may rely on the stack starting it but not doing it.

Whilst here, remove a duplicate LE_* macro definition, thanks to
Andriy Voskoboinyk <s3erios@gmail.com>.
This commit is contained in:
Adrian Chadd 2015-09-22 02:25:29 +00:00
parent 5779122880
commit 163f8705a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288085
2 changed files with 52 additions and 6 deletions

View File

@ -1415,12 +1415,6 @@ ieee80211_ht_timeout(struct ieee80211com *ic)
}
}
/* unalligned little endian access */
#define LE_READ_2(p) \
((uint16_t) \
((((const uint8_t *)(p))[0] ) | \
(((const uint8_t *)(p))[1] << 8)))
/*
* Process an 802.11n HT capabilities ie.
*/
@ -1832,6 +1826,55 @@ ieee80211_addba_request(struct ieee80211_node *ni,
return 1;
}
/*
* Called by drivers that wish to request an ADDBA session be
* setup. This brings it up and starts the request timer.
*/
int
ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid)
{
struct ieee80211_tx_ampdu *tap;
if (tid < 0 || tid > 15)
return (0);
tap = &ni->ni_tx_ampdu[tid];
/* XXX locking */
if ((tap->txa_flags & IEEE80211_AGGR_SETUP) == 0) {
/* do deferred setup of state */
ampdu_tx_setup(tap);
}
/* XXX hack for not doing proper locking */
tap->txa_flags &= ~IEEE80211_AGGR_NAK;
addba_start_timeout(tap);
return (1);
}
/*
* Called by drivers that have marked a session as active.
*/
int
ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid,
int status)
{
struct ieee80211_tx_ampdu *tap;
if (tid < 0 || tid > 15)
return (0);
tap = &ni->ni_tx_ampdu[tid];
/* XXX locking */
addba_stop_timeout(tap);
if (status == 1) {
tap->txa_flags |= IEEE80211_AGGR_RUNNING;
tap->txa_attempts = 0;
} else {
/* mark tid so we don't try again */
tap->txa_flags |= IEEE80211_AGGR_NAK;
}
return (1);
}
/*
* Default method for processing an A-MPDU tx aggregation
* response. We shutdown any pending timer and update the

View File

@ -202,5 +202,8 @@ void ieee80211_ht_update_beacon(struct ieee80211vap *,
struct ieee80211_beacon_offsets *);
int ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid,
int seq, int baw);
int ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid);
int ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni,
int tid, int status);
#endif /* _NET80211_IEEE80211_HT_H_ */