Moved TX status processing for STA entries away from driver_*.c
Driver wrappers should not need to know about this level of core hostapd details.
This commit is contained in:
parent
76e2592190
commit
8607f4c31f
6 changed files with 24 additions and 25 deletions
|
@ -213,5 +213,7 @@ struct wpa_driver_ops {
|
|||
|
||||
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
int reassoc);
|
||||
void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
|
||||
const u8 *buf, size_t len, int ack);
|
||||
|
||||
#endif /* DRIVER_H */
|
||||
|
|
|
@ -143,7 +143,6 @@ static void handle_tx_callback(struct hostap_driver_data *drv, u8 *buf,
|
|||
{
|
||||
struct ieee80211_hdr *hdr;
|
||||
u16 fc, type, stype;
|
||||
struct sta_info *sta;
|
||||
|
||||
hdr = (struct ieee80211_hdr *) buf;
|
||||
fc = le_to_host16(hdr->frame_control);
|
||||
|
@ -164,17 +163,7 @@ static void handle_tx_callback(struct hostap_driver_data *drv, u8 *buf,
|
|||
case WLAN_FC_TYPE_DATA:
|
||||
wpa_printf(MSG_DEBUG, "DATA (TX callback) %s",
|
||||
ok ? "ACK" : "fail");
|
||||
sta = ap_get_sta(drv->hapd, hdr->addr1);
|
||||
if (sta && sta->flags & WLAN_STA_PENDING_POLL) {
|
||||
wpa_printf(MSG_DEBUG, "STA " MACSTR
|
||||
" %s pending activity poll",
|
||||
MAC2STR(sta->addr),
|
||||
ok ? "ACKed" : "did not ACK");
|
||||
if (ok)
|
||||
sta->flags &= ~WLAN_STA_PENDING_POLL;
|
||||
}
|
||||
if (sta)
|
||||
ieee802_1x_tx_status(drv->hapd, sta, buf, len, ok);
|
||||
hostapd_tx_status(drv->hapd, hdr->addr1, buf, len, ok);
|
||||
break;
|
||||
default:
|
||||
printf("unknown TX callback frame type %d\n", type);
|
||||
|
|
|
@ -1661,7 +1661,6 @@ static void handle_tx_callback(struct hostapd_data *hapd, u8 *buf, size_t len,
|
|||
{
|
||||
struct ieee80211_hdr *hdr;
|
||||
u16 fc, type, stype;
|
||||
struct sta_info *sta;
|
||||
|
||||
hdr = (struct ieee80211_hdr *) buf;
|
||||
fc = le_to_host16(hdr->frame_control);
|
||||
|
@ -1682,16 +1681,7 @@ static void handle_tx_callback(struct hostapd_data *hapd, u8 *buf, size_t len,
|
|||
case WLAN_FC_TYPE_DATA:
|
||||
wpa_printf(MSG_DEBUG, "DATA (TX callback) %s",
|
||||
ok ? "ACK" : "fail");
|
||||
sta = ap_get_sta(hapd, hdr->addr1);
|
||||
if (sta && sta->flags & WLAN_STA_PENDING_POLL) {
|
||||
wpa_printf(MSG_DEBUG, "STA " MACSTR " %s pending "
|
||||
"activity poll", MAC2STR(sta->addr),
|
||||
ok ? "ACKed" : "did not ACK");
|
||||
if (ok)
|
||||
sta->flags &= ~WLAN_STA_PENDING_POLL;
|
||||
}
|
||||
if (sta)
|
||||
ieee802_1x_tx_status(hapd, sta, buf, len, ok);
|
||||
hostapd_tx_status(hapd, hdr->addr1, buf, len, ok);
|
||||
break;
|
||||
default:
|
||||
printf("unknown TX callback frame type %d\n", type);
|
||||
|
|
|
@ -260,6 +260,24 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
}
|
||||
|
||||
|
||||
void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr,
|
||||
const u8 *buf, size_t len, int ack)
|
||||
{
|
||||
struct sta_info *sta;
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (sta && sta->flags & WLAN_STA_PENDING_POLL) {
|
||||
wpa_printf(MSG_DEBUG, "STA " MACSTR " %s pending "
|
||||
"activity poll", MAC2STR(sta->addr),
|
||||
ack ? "ACKed" : "did not ACK");
|
||||
if (ack)
|
||||
sta->flags &= ~WLAN_STA_PENDING_POLL;
|
||||
}
|
||||
if (sta)
|
||||
ieee802_1x_tx_status(hapd, sta, buf, len, ack);
|
||||
}
|
||||
|
||||
|
||||
#ifdef EAP_SERVER
|
||||
static int hostapd_sim_db_cb_sta(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, void *ctx)
|
||||
|
|
|
@ -1754,7 +1754,7 @@ int ieee802_1x_reconfig(struct hostapd_data *hapd,
|
|||
|
||||
|
||||
int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
u8 *buf, size_t len, int ack)
|
||||
const u8 *buf, size_t len, int ack)
|
||||
{
|
||||
struct ieee80211_hdr *hdr;
|
||||
struct ieee802_1x_hdr *xhdr;
|
||||
|
|
|
@ -62,7 +62,7 @@ int ieee802_1x_reconfig(struct hostapd_data *hapd,
|
|||
struct hostapd_config *oldconf,
|
||||
struct hostapd_bss_config *oldbss);
|
||||
int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
u8 *buf, size_t len, int ack);
|
||||
const u8 *buf, size_t len, int ack);
|
||||
u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
|
||||
u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
|
||||
int idx);
|
||||
|
|
Loading…
Reference in a new issue