diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 42 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.h | 5 |
2 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 0c2ccc101176..4ee74f660443 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -1286,6 +1286,38 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) | |||
1286 | return 0; | 1286 | return 0; |
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | static int ath10k_mac_vif_disable_keepalive(struct ath10k_vif *arvif) | ||
1290 | { | ||
1291 | struct ath10k *ar = arvif->ar; | ||
1292 | struct wmi_sta_keepalive_arg arg = {}; | ||
1293 | int ret; | ||
1294 | |||
1295 | lockdep_assert_held(&arvif->ar->conf_mutex); | ||
1296 | |||
1297 | if (arvif->vdev_type != WMI_VDEV_TYPE_STA) | ||
1298 | return 0; | ||
1299 | |||
1300 | if (!test_bit(WMI_SERVICE_STA_KEEP_ALIVE, ar->wmi.svc_map)) | ||
1301 | return 0; | ||
1302 | |||
1303 | /* Some firmware revisions have a bug and ignore the `enabled` field. | ||
1304 | * Instead use the interval to disable the keepalive. | ||
1305 | */ | ||
1306 | arg.vdev_id = arvif->vdev_id; | ||
1307 | arg.enabled = 1; | ||
1308 | arg.method = WMI_STA_KEEPALIVE_METHOD_NULL_FRAME; | ||
1309 | arg.interval = WMI_STA_KEEPALIVE_INTERVAL_DISABLE; | ||
1310 | |||
1311 | ret = ath10k_wmi_sta_keepalive(ar, &arg); | ||
1312 | if (ret) { | ||
1313 | ath10k_warn(ar, "failed to submit keepalive on vdev %i: %d\n", | ||
1314 | arvif->vdev_id, ret); | ||
1315 | return ret; | ||
1316 | } | ||
1317 | |||
1318 | return 0; | ||
1319 | } | ||
1320 | |||
1289 | /**********************/ | 1321 | /**********************/ |
1290 | /* Station management */ | 1322 | /* Station management */ |
1291 | /**********************/ | 1323 | /**********************/ |
@@ -3180,6 +3212,16 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, | |||
3180 | ar->free_vdev_map &= ~(1LL << arvif->vdev_id); | 3212 | ar->free_vdev_map &= ~(1LL << arvif->vdev_id); |
3181 | list_add(&arvif->list, &ar->arvifs); | 3213 | list_add(&arvif->list, &ar->arvifs); |
3182 | 3214 | ||
3215 | /* It makes no sense to have firmware do keepalives. mac80211 already | ||
3216 | * takes care of this with idle connection polling. | ||
3217 | */ | ||
3218 | ret = ath10k_mac_vif_disable_keepalive(arvif); | ||
3219 | if (ret) { | ||
3220 | ath10k_warn(ar, "failed to disable keepalive on vdev %i: %d\n", | ||
3221 | arvif->vdev_id, ret); | ||
3222 | goto err_vdev_delete; | ||
3223 | } | ||
3224 | |||
3183 | vdev_param = ar->wmi.vdev_param->def_keyid; | 3225 | vdev_param = ar->wmi.vdev_param->def_keyid; |
3184 | ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param, | 3226 | ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param, |
3185 | arvif->def_wep_key_idx); | 3227 | arvif->def_wep_key_idx); |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 1a99a7dd0e95..4b654083b857 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h | |||
@@ -4665,6 +4665,11 @@ enum wmi_sta_keepalive_method { | |||
4665 | WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2, | 4665 | WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2, |
4666 | }; | 4666 | }; |
4667 | 4667 | ||
4668 | #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0 | ||
4669 | |||
4670 | /* Firmware crashes if keepalive interval exceeds this limit */ | ||
4671 | #define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff | ||
4672 | |||
4668 | /* note: ip4 addresses are in network byte order, i.e. big endian */ | 4673 | /* note: ip4 addresses are in network byte order, i.e. big endian */ |
4669 | struct wmi_sta_keepalive_arp_resp { | 4674 | struct wmi_sta_keepalive_arp_resp { |
4670 | __be32 src_ip4_addr; | 4675 | __be32 src_ip4_addr; |