^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Portions of this file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright(c) 2016 Intel Deutschland GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2018 - 2019 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef __MAC80211_DRIVER_OPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define __MAC80211_DRIVER_OPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <net/mac80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "ieee80211_i.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "trace.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define check_sdata_in_driver(sdata) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) !WARN_ONCE(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) static inline struct ieee80211_sub_if_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) get_bss_sdata(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) u.ap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) return sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static inline void drv_tx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct ieee80211_tx_control *control,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct sk_buff *skb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) local->ops->tx(&local->hw, control, skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) static inline void drv_sync_rx_queues(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct sta_info *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) if (local->ops->sync_rx_queues) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) trace_drv_sync_rx_queues(local, sta->sdata, &sta->sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) local->ops->sync_rx_queues(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static inline void drv_get_et_strings(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) u32 sset, u8 *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) if (local->ops->get_et_strings) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) trace_drv_get_et_strings(local, sset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) local->ops->get_et_strings(&local->hw, &sdata->vif, sset, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) static inline void drv_get_et_stats(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) struct ethtool_stats *stats,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) u64 *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) if (local->ops->get_et_stats) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) trace_drv_get_et_stats(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) local->ops->get_et_stats(&local->hw, &sdata->vif, stats, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) static inline int drv_get_et_sset_count(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) int sset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) int rv = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) if (local->ops->get_et_sset_count) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) trace_drv_get_et_sset_count(local, sset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) rv = local->ops->get_et_sset_count(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) sset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) trace_drv_return_int(local, rv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) return rv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) int drv_start(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) void drv_stop(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #ifdef CONFIG_PM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) static inline int drv_suspend(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) struct cfg80211_wowlan *wowlan)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) trace_drv_suspend(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) ret = local->ops->suspend(&local->hw, wowlan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) static inline int drv_resume(struct ieee80211_local *local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) trace_drv_resume(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ret = local->ops->resume(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) static inline void drv_set_wakeup(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) bool enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) if (!local->ops->set_wakeup)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) trace_drv_set_wakeup(local, enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) local->ops->set_wakeup(&local->hw, enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) int drv_add_interface(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) int drv_change_interface(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) enum nl80211_iftype type, bool p2p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) void drv_remove_interface(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) static inline int drv_config(struct ieee80211_local *local, u32 changed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) trace_drv_config(local, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ret = local->ops->config(&local->hw, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) static inline void drv_bss_info_changed(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) struct ieee80211_bss_conf *info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) u32 changed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) if (WARN_ON_ONCE(changed & (BSS_CHANGED_BEACON |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) BSS_CHANGED_BEACON_ENABLED) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) sdata->vif.type != NL80211_IFTYPE_AP &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) sdata->vif.type != NL80211_IFTYPE_ADHOC &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) sdata->vif.type != NL80211_IFTYPE_OCB))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) sdata->vif.type == NL80211_IFTYPE_NAN ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) !sdata->vif.mu_mimo_owner &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) !(changed & BSS_CHANGED_TXPOWER))))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) trace_drv_bss_info_changed(local, sdata, info, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) if (local->ops->bss_info_changed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) struct netdev_hw_addr_list *mc_list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) u64 ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) trace_drv_prepare_multicast(local, mc_list->count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) if (local->ops->prepare_multicast)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) ret = local->ops->prepare_multicast(&local->hw, mc_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) trace_drv_return_u64(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) static inline void drv_configure_filter(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) unsigned int changed_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) unsigned int *total_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) u64 multicast)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) trace_drv_configure_filter(local, changed_flags, total_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) multicast);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) local->ops->configure_filter(&local->hw, changed_flags, total_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) multicast);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static inline void drv_config_iface_filter(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) unsigned int filter_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) unsigned int changed_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) trace_drv_config_iface_filter(local, sdata, filter_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) changed_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) if (local->ops->config_iface_filter)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) local->ops->config_iface_filter(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) filter_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) changed_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) static inline int drv_set_tim(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct ieee80211_sta *sta, bool set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) trace_drv_set_tim(local, sta, set);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) if (local->ops->set_tim)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) ret = local->ops->set_tim(&local->hw, sta, set);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) static inline int drv_set_key(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) enum set_key_cmd cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) struct ieee80211_sta *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) struct ieee80211_key_conf *key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) trace_drv_set_key(local, cmd, sdata, sta, key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) static inline void drv_update_tkip_key(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) struct ieee80211_key_conf *conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) struct sta_info *sta, u32 iv32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) u16 *phase1key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) struct ieee80211_sta *ista = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) if (sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) ista = &sta->sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) trace_drv_update_tkip_key(local, sdata, conf, ista, iv32);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) if (local->ops->update_tkip_key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) local->ops->update_tkip_key(&local->hw, &sdata->vif, conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) ista, iv32, phase1key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) static inline int drv_hw_scan(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) struct ieee80211_scan_request *req)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) trace_drv_hw_scan(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) static inline void drv_cancel_hw_scan(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) trace_drv_cancel_hw_scan(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) local->ops->cancel_hw_scan(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) drv_sched_scan_start(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) struct cfg80211_sched_scan_request *req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) struct ieee80211_scan_ies *ies)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) trace_drv_sched_scan_start(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) ret = local->ops->sched_scan_start(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) req, ies);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) static inline int drv_sched_scan_stop(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) trace_drv_sched_scan_stop(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) ret = local->ops->sched_scan_stop(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) static inline void drv_sw_scan_start(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) const u8 *mac_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) trace_drv_sw_scan_start(local, sdata, mac_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) if (local->ops->sw_scan_start)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) local->ops->sw_scan_start(&local->hw, &sdata->vif, mac_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) static inline void drv_sw_scan_complete(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) trace_drv_sw_scan_complete(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) if (local->ops->sw_scan_complete)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) local->ops->sw_scan_complete(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) static inline int drv_get_stats(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) struct ieee80211_low_level_stats *stats)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) if (local->ops->get_stats)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) ret = local->ops->get_stats(&local->hw, stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) trace_drv_get_stats(local, stats, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) static inline void drv_get_key_seq(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) struct ieee80211_key *key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) struct ieee80211_key_seq *seq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) if (local->ops->get_key_seq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) local->ops->get_key_seq(&local->hw, &key->conf, seq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) trace_drv_get_key_seq(local, &key->conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) static inline int drv_set_frag_threshold(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) u32 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) trace_drv_set_frag_threshold(local, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) if (local->ops->set_frag_threshold)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) ret = local->ops->set_frag_threshold(&local->hw, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) static inline int drv_set_rts_threshold(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) u32 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) trace_drv_set_rts_threshold(local, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) if (local->ops->set_rts_threshold)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) ret = local->ops->set_rts_threshold(&local->hw, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) static inline int drv_set_coverage_class(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) s16 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) trace_drv_set_coverage_class(local, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) if (local->ops->set_coverage_class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) local->ops->set_coverage_class(&local->hw, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) static inline void drv_sta_notify(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) enum sta_notify_cmd cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) struct ieee80211_sta *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) trace_drv_sta_notify(local, sdata, cmd, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) if (local->ops->sta_notify)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) local->ops->sta_notify(&local->hw, &sdata->vif, cmd, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) static inline int drv_sta_add(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) struct ieee80211_sta *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) trace_drv_sta_add(local, sdata, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) if (local->ops->sta_add)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) ret = local->ops->sta_add(&local->hw, &sdata->vif, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) static inline void drv_sta_remove(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) struct ieee80211_sta *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) trace_drv_sta_remove(local, sdata, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) if (local->ops->sta_remove)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) local->ops->sta_remove(&local->hw, &sdata->vif, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) #ifdef CONFIG_MAC80211_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) static inline void drv_sta_add_debugfs(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) struct ieee80211_sta *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) struct dentry *dir)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) if (local->ops->sta_add_debugfs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) local->ops->sta_add_debugfs(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) sta, dir);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) static inline void drv_sta_pre_rcu_remove(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) struct sta_info *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) trace_drv_sta_pre_rcu_remove(local, sdata, &sta->sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) if (local->ops->sta_pre_rcu_remove)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) local->ops->sta_pre_rcu_remove(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) &sta->sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) int drv_sta_state(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) enum ieee80211_sta_state old_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) enum ieee80211_sta_state new_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) int drv_sta_set_txpwr(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) void drv_sta_rc_update(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) struct ieee80211_sta *sta, u32 changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) struct ieee80211_sta *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) trace_drv_sta_rate_tbl_update(local, sdata, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) if (local->ops->sta_rate_tbl_update)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) local->ops->sta_rate_tbl_update(&local->hw, &sdata->vif, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) static inline void drv_sta_statistics(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) struct ieee80211_sta *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) struct station_info *sinfo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) trace_drv_sta_statistics(local, sdata, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) if (local->ops->sta_statistics)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) local->ops->sta_statistics(&local->hw, &sdata->vif, sta, sinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) int drv_conf_tx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) struct ieee80211_sub_if_data *sdata, u16 ac,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) const struct ieee80211_tx_queue_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) u64 drv_get_tsf(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) void drv_set_tsf(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) u64 tsf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) void drv_offset_tsf(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) s64 offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) void drv_reset_tsf(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) static inline int drv_tx_last_beacon(struct ieee80211_local *local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) int ret = 0; /* default unsupported op for less congestion */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) trace_drv_tx_last_beacon(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) if (local->ops->tx_last_beacon)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) ret = local->ops->tx_last_beacon(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) int drv_ampdu_action(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) struct ieee80211_ampdu_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) static inline int drv_get_survey(struct ieee80211_local *local, int idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) struct survey_info *survey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) trace_drv_get_survey(local, idx, survey);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) if (local->ops->get_survey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) ret = local->ops->get_survey(&local->hw, idx, survey);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) static inline void drv_rfkill_poll(struct ieee80211_local *local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) if (local->ops->rfkill_poll)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) local->ops->rfkill_poll(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) static inline void drv_flush(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) u32 queues, bool drop)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) if (sdata && !check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) trace_drv_flush(local, queues, drop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) if (local->ops->flush)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) local->ops->flush(&local->hw, vif, queues, drop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) static inline void drv_channel_switch(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) struct ieee80211_channel_switch *ch_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) trace_drv_channel_switch(local, sdata, ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) local->ops->channel_switch(&local->hw, &sdata->vif, ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) static inline int drv_set_antenna(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) u32 tx_ant, u32 rx_ant)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) if (local->ops->set_antenna)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) trace_drv_set_antenna(local, tx_ant, rx_ant, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) static inline int drv_get_antenna(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) u32 *tx_ant, u32 *rx_ant)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) if (local->ops->get_antenna)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) trace_drv_get_antenna(local, *tx_ant, *rx_ant, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) static inline int drv_remain_on_channel(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) unsigned int duration,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) enum ieee80211_roc_type type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) trace_drv_remain_on_channel(local, sdata, chan, duration, type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) chan, duration, type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) drv_cancel_remain_on_channel(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) trace_drv_cancel_remain_on_channel(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) ret = local->ops->cancel_remain_on_channel(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) static inline int drv_set_ringparam(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) u32 tx, u32 rx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) int ret = -ENOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) trace_drv_set_ringparam(local, tx, rx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) if (local->ops->set_ringparam)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) ret = local->ops->set_ringparam(&local->hw, tx, rx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) static inline void drv_get_ringparam(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) trace_drv_get_ringparam(local, tx, tx_max, rx, rx_max);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) if (local->ops->get_ringparam)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) local->ops->get_ringparam(&local->hw, tx, tx_max, rx, rx_max);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) static inline bool drv_tx_frames_pending(struct ieee80211_local *local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) bool ret = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) trace_drv_tx_frames_pending(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) if (local->ops->tx_frames_pending)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) ret = local->ops->tx_frames_pending(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) trace_drv_return_bool(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) static inline int drv_set_bitrate_mask(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) const struct cfg80211_bitrate_mask *mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) trace_drv_set_bitrate_mask(local, sdata, mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) if (local->ops->set_bitrate_mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) ret = local->ops->set_bitrate_mask(&local->hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) &sdata->vif, mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) static inline void drv_set_rekey_data(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) struct cfg80211_gtk_rekey_data *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) trace_drv_set_rekey_data(local, sdata, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) if (local->ops->set_rekey_data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) local->ops->set_rekey_data(&local->hw, &sdata->vif, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) static inline void drv_event_callback(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) const struct ieee80211_event *event)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) trace_drv_event_callback(local, sdata, event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) if (local->ops->event_callback)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) local->ops->event_callback(&local->hw, &sdata->vif, event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) drv_release_buffered_frames(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) struct sta_info *sta, u16 tids, int num_frames,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) enum ieee80211_frame_release_type reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) bool more_data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) trace_drv_release_buffered_frames(local, &sta->sta, tids, num_frames,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) reason, more_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) if (local->ops->release_buffered_frames)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) local->ops->release_buffered_frames(&local->hw, &sta->sta, tids,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) num_frames, reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) more_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) drv_allow_buffered_frames(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) struct sta_info *sta, u16 tids, int num_frames,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) enum ieee80211_frame_release_type reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) bool more_data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) trace_drv_allow_buffered_frames(local, &sta->sta, tids, num_frames,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) reason, more_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) if (local->ops->allow_buffered_frames)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) local->ops->allow_buffered_frames(&local->hw, &sta->sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) tids, num_frames, reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) more_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822) static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) u16 duration)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) trace_drv_mgd_prepare_tx(local, sdata, duration);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) if (local->ops->mgd_prepare_tx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) local->ops->mgd_prepare_tx(&local->hw, &sdata->vif, duration);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839) drv_mgd_protect_tdls_discover(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) trace_drv_mgd_protect_tdls_discover(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) if (local->ops->mgd_protect_tdls_discover)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) local->ops->mgd_protect_tdls_discover(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) static inline int drv_add_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) struct ieee80211_chanctx *ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) trace_drv_add_chanctx(local, ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) if (local->ops->add_chanctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) ret = local->ops->add_chanctx(&local->hw, &ctx->conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865) if (!ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) ctx->driver_present = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) static inline void drv_remove_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) struct ieee80211_chanctx *ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) if (WARN_ON(!ctx->driver_present))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) trace_drv_remove_chanctx(local, ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) if (local->ops->remove_chanctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) local->ops->remove_chanctx(&local->hw, &ctx->conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) ctx->driver_present = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886) static inline void drv_change_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) struct ieee80211_chanctx *ctx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) u32 changed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) trace_drv_change_chanctx(local, ctx, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) if (local->ops->change_chanctx) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) WARN_ON_ONCE(!ctx->driver_present);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) local->ops->change_chanctx(&local->hw, &ctx->conf, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) static inline int drv_assign_vif_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902) struct ieee80211_chanctx *ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909) trace_drv_assign_vif_chanctx(local, sdata, ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) if (local->ops->assign_vif_chanctx) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) WARN_ON_ONCE(!ctx->driver_present);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912) ret = local->ops->assign_vif_chanctx(&local->hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) &ctx->conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921) static inline void drv_unassign_vif_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) struct ieee80211_chanctx *ctx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) trace_drv_unassign_vif_chanctx(local, sdata, ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) if (local->ops->unassign_vif_chanctx) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) WARN_ON_ONCE(!ctx->driver_present);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) local->ops->unassign_vif_chanctx(&local->hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) &ctx->conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) int drv_switch_vif_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) struct ieee80211_vif_chanctx_switch *vifs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) int n_vifs, enum ieee80211_chanctx_switch_mode mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) static inline int drv_start_ap(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) trace_drv_start_ap(local, sdata, &sdata->vif.bss_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) if (local->ops->start_ap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956) ret = local->ops->start_ap(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961) static inline void drv_stop_ap(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) trace_drv_stop_ap(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) if (local->ops->stop_ap)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969) local->ops->stop_ap(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) drv_reconfig_complete(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) enum ieee80211_reconfig_type reconfig_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979) trace_drv_reconfig_complete(local, reconfig_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) if (local->ops->reconfig_complete)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) local->ops->reconfig_complete(&local->hw, reconfig_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) drv_set_default_unicast_key(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988) int key_idx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993) WARN_ON_ONCE(key_idx < -1 || key_idx > 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) trace_drv_set_default_unicast_key(local, sdata, key_idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996) if (local->ops->set_default_unicast_key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997) local->ops->set_default_unicast_key(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998) key_idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) #if IS_ENABLED(CONFIG_IPV6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) static inline void drv_ipv6_addr_change(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) struct inet6_dev *idev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) trace_drv_ipv6_addr_change(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) if (local->ops->ipv6_addr_change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) local->ops->ipv6_addr_change(&local->hw, &sdata->vif, idev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) drv_channel_switch_beacon(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) if (local->ops->channel_switch_beacon) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) trace_drv_channel_switch_beacon(local, sdata, chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) local->ops->channel_switch_beacon(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) drv_pre_channel_switch(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) struct ieee80211_channel_switch *ch_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) trace_drv_pre_channel_switch(local, sdata, ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) if (local->ops->pre_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) ret = local->ops->pre_channel_switch(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) drv_post_channel_switch(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) trace_drv_post_channel_switch(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) if (local->ops->post_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) ret = local->ops->post_channel_switch(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) drv_abort_channel_switch(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) trace_drv_abort_channel_switch(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) if (local->ops->abort_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) local->ops->abort_channel_switch(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) drv_channel_switch_rx_beacon(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) struct ieee80211_channel_switch *ch_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) trace_drv_channel_switch_rx_beacon(local, sdata, ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) if (local->ops->channel_switch_rx_beacon)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) local->ops->channel_switch_rx_beacon(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) ch_switch);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) static inline int drv_join_ibss(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) trace_drv_join_ibss(local, sdata, &sdata->vif.bss_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) if (local->ops->join_ibss)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) ret = local->ops->join_ibss(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) static inline void drv_leave_ibss(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) trace_drv_leave_ibss(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) if (local->ops->leave_ibss)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) local->ops->leave_ibss(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) struct sta_info *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) u32 ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) trace_drv_get_expected_throughput(&sta->sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) if (local->ops->get_expected_throughput && sta->uploaded)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) ret = local->ops->get_expected_throughput(&local->hw, &sta->sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) trace_drv_return_u32(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) static inline int drv_get_txpower(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) struct ieee80211_sub_if_data *sdata, int *dbm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) if (!local->ops->get_txpower)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) return -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) ret = local->ops->get_txpower(&local->hw, &sdata->vif, dbm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) trace_drv_get_txpower(local, sdata, *dbm, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) drv_tdls_channel_switch(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) struct ieee80211_sta *sta, u8 oper_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) struct sk_buff *tmpl_skb, u32 ch_sw_tm_ie)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) if (!local->ops->tdls_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) return -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) trace_drv_tdls_channel_switch(local, sdata, sta, oper_class, chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) ret = local->ops->tdls_channel_switch(&local->hw, &sdata->vif, sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) oper_class, chandef, tmpl_skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) ch_sw_tm_ie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) drv_tdls_cancel_channel_switch(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) struct ieee80211_sta *sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) if (!local->ops->tdls_cancel_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) trace_drv_tdls_cancel_channel_switch(local, sdata, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) local->ops->tdls_cancel_channel_switch(&local->hw, &sdata->vif, sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) drv_tdls_recv_channel_switch(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) struct ieee80211_tdls_ch_sw_params *params)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) trace_drv_tdls_recv_channel_switch(local, sdata, params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) if (local->ops->tdls_recv_channel_switch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) local->ops->tdls_recv_channel_switch(&local->hw, &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) static inline void drv_wake_tx_queue(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) struct txq_info *txq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) /* In reconfig don't transmit now, but mark for waking later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) if (local->in_reconfig) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txq->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) trace_drv_wake_tx_queue(local, sdata, txq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) local->ops->wake_tx_queue(&local->hw, &txq->txq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) static inline void schedule_and_wake_txq(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) struct txq_info *txqi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) ieee80211_schedule_txq(&local->hw, &txqi->txq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) drv_wake_tx_queue(local, txqi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) static inline int drv_can_aggregate_in_amsdu(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) struct sk_buff *head,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) struct sk_buff *skb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) if (!local->ops->can_aggregate_in_amsdu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) return local->ops->can_aggregate_in_amsdu(&local->hw, head, skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) drv_get_ftm_responder_stats(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) struct cfg80211_ftm_responder_stats *ftm_stats)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) u32 ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) if (local->ops->get_ftm_responder_stats)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) ret = local->ops->get_ftm_responder_stats(&local->hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) &sdata->vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) ftm_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) trace_drv_get_ftm_responder_stats(local, sdata, ftm_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) static inline int drv_start_pmsr(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) struct cfg80211_pmsr_request *request)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) int ret = -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) trace_drv_start_pmsr(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) if (local->ops->start_pmsr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) ret = local->ops->start_pmsr(&local->hw, &sdata->vif, request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) static inline void drv_abort_pmsr(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) struct cfg80211_pmsr_request *request)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) trace_drv_abort_pmsr(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) if (local->ops->abort_pmsr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) local->ops->abort_pmsr(&local->hw, &sdata->vif, request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) static inline int drv_start_nan(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) struct cfg80211_nan_conf *conf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) trace_drv_start_nan(local, sdata, conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) ret = local->ops->start_nan(&local->hw, &sdata->vif, conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) static inline void drv_stop_nan(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) trace_drv_stop_nan(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) local->ops->stop_nan(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) static inline int drv_nan_change_conf(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) struct cfg80211_nan_conf *conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) u32 changes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) if (!local->ops->nan_change_conf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) return -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) trace_drv_nan_change_conf(local, sdata, conf, changes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) ret = local->ops->nan_change_conf(&local->hw, &sdata->vif, conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325) changes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) static inline int drv_add_nan_func(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) const struct cfg80211_nan_func *nan_func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) if (!local->ops->add_nan_func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) return -EOPNOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) trace_drv_add_nan_func(local, sdata, nan_func);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344) ret = local->ops->add_nan_func(&local->hw, &sdata->vif, nan_func);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) static inline void drv_del_nan_func(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) u8 instance_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) trace_drv_del_nan_func(local, sdata, instance_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) if (local->ops->del_nan_func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) local->ops->del_nan_func(&local->hw, &sdata->vif, instance_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) static inline int drv_set_tid_config(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) struct ieee80211_sta *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366) struct cfg80211_tid_config *tid_conf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) ret = local->ops->set_tid_config(&local->hw, &sdata->vif, sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372) tid_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378) static inline int drv_reset_tid_config(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380) struct ieee80211_sta *sta, u8 tids)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) ret = local->ops->reset_tid_config(&local->hw, &sdata->vif, sta, tids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386) trace_drv_return_int(local, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391) static inline void drv_update_vif_offload(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) might_sleep();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) check_sdata_in_driver(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) if (!local->ops->update_vif_offload)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) trace_drv_update_vif_offload(local, sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) local->ops->update_vif_offload(&local->hw, &sdata->vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) static inline void drv_sta_set_4addr(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407) struct ieee80211_sta *sta, bool enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) sdata = get_bss_sdata(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410) if (!check_sdata_in_driver(sdata))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413) trace_drv_sta_set_4addr(local, sdata, sta, enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) if (local->ops->sta_set_4addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) local->ops->sta_set_4addr(&local->hw, &sdata->vif, sta, enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416) trace_drv_return_void(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) #endif /* __MAC80211_DRIVER_OPS */