diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-10-20 21:03:08 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-10-20 21:03:08 +0300 |
commit | bcf24348ed32c2f9b24cc575c32f83db3dc9cba1 (patch) | |
tree | 6a224d6f0c9149197409de74a3f6d08db727a90b /src/drivers/driver_hostap.c | |
parent | 7a25f29d890f56c4df81143f8b5eb42fb5eeeb07 (diff) | |
download | external_wpa_supplicant_8_ti-bcf24348ed32c2f9b24cc575c32f83db3dc9cba1.zip external_wpa_supplicant_8_ti-bcf24348ed32c2f9b24cc575c32f83db3dc9cba1.tar.gz external_wpa_supplicant_8_ti-bcf24348ed32c2f9b24cc575c32f83db3dc9cba1.tar.bz2 |
AP: Do station poll in driver wrapper
This offloads the station polling to driver wrappers, which may offload
it again to the driver. The hostap driver wrapper uses "real" data
frames while nl80211 uses null data frames.
Also add a specific event to indicate that a poll was successful for
future use with the nl80211 driver.
Diffstat (limited to 'src/drivers/driver_hostap.c')
-rw-r--r-- | src/drivers/driver_hostap.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c index ad9a022..7a97ed5 100644 --- a/src/drivers/driver_hostap.c +++ b/src/drivers/driver_hostap.c @@ -1143,6 +1143,33 @@ static struct hostapd_hw_modes * hostap_get_hw_feature_data(void *priv, return mode; } + +static void wpa_driver_hostap_poll_client(void *priv, const u8 *own_addr, + const u8 *addr, int qos) +{ + struct ieee80211_hdr hdr; + + os_memset(&hdr, 0, sizeof(hdr)); + + /* + * WLAN_FC_STYPE_NULLFUNC would be more appropriate, + * but it is apparently not retried so TX Exc events + * are not received for it. + * This is the reason the driver overrides the default + * handling. + */ + hdr.frame_control = IEEE80211_FC(WLAN_FC_TYPE_DATA, + WLAN_FC_STYPE_DATA); + + hdr.frame_control |= + host_to_le16(WLAN_FC_FROMDS); + os_memcpy(hdr.IEEE80211_DA_FROMDS, addr, ETH_ALEN); + os_memcpy(hdr.IEEE80211_BSSID_FROMDS, own_addr, ETH_ALEN); + os_memcpy(hdr.IEEE80211_SA_FROMDS, own_addr, ETH_ALEN); + + hostap_send_mlme(priv, (u8 *)&hdr, sizeof(hdr)); +} + #else /* HOSTAPD */ struct wpa_driver_hostap_data { @@ -1650,6 +1677,7 @@ const struct wpa_driver_ops wpa_driver_hostap_ops = { .get_hw_feature_data = hostap_get_hw_feature_data, .set_ap_wps_ie = hostap_set_ap_wps_ie, .set_freq = hostap_set_freq, + .poll_client = wpa_driver_hostap_poll_client, #else /* HOSTAPD */ .get_bssid = wpa_driver_hostap_get_bssid, .get_ssid = wpa_driver_hostap_get_ssid, |