Commit | Line | Data |
---|---|---|
f0553ca9 | 1 | /* SPDX-License-Identifier: ISC */ |
5e3dd157 KV |
2 | /* |
3 | * Copyright (c) 2005-2011 Atheros Communications Inc. | |
8b1083d6 | 4 | * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. |
5e3dd157 KV |
5 | */ |
6 | ||
7 | #ifndef _MAC_H_ | |
8 | #define _MAC_H_ | |
9 | ||
10 | #include <net/mac80211.h> | |
11 | #include "core.h" | |
12 | ||
504f6cdf SM |
13 | #define WEP_KEYID_SHIFT 6 |
14 | ||
b4aa539d MK |
15 | enum wmi_tlv_tx_pause_id; |
16 | enum wmi_tlv_tx_pause_action; | |
17 | ||
5e3dd157 KV |
18 | struct ath10k_generic_iter { |
19 | struct ath10k *ar; | |
20 | int ret; | |
21 | }; | |
22 | ||
d740d8fd MK |
23 | struct rfc1042_hdr { |
24 | u8 llc_dsap; | |
25 | u8 llc_ssap; | |
26 | u8 llc_ctrl; | |
27 | u8 snap_oui[3]; | |
28 | __be16 snap_type; | |
29 | } __packed; | |
30 | ||
e7b54194 | 31 | struct ath10k *ath10k_mac_create(size_t priv_size); |
5e3dd157 KV |
32 | void ath10k_mac_destroy(struct ath10k *ar); |
33 | int ath10k_mac_register(struct ath10k *ar); | |
34 | void ath10k_mac_unregister(struct ath10k *ar); | |
35 | struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id); | |
5c81c7fd MK |
36 | void __ath10k_scan_finish(struct ath10k *ar); |
37 | void ath10k_scan_finish(struct ath10k *ar); | |
38 | void ath10k_scan_timeout_work(struct work_struct *work); | |
5e3dd157 KV |
39 | void ath10k_offchan_tx_purge(struct ath10k *ar); |
40 | void ath10k_offchan_tx_work(struct work_struct *work); | |
5e00d31a BM |
41 | void ath10k_mgmt_over_wmi_tx_purge(struct ath10k *ar); |
42 | void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work); | |
affd3217 | 43 | void ath10k_halt(struct ath10k *ar); |
64badcb6 | 44 | void ath10k_mac_vif_beacon_free(struct ath10k_vif *arvif); |
7962b0d8 | 45 | void ath10k_drain_tx(struct ath10k *ar); |
504f6cdf SM |
46 | bool ath10k_mac_is_peer_wep_key_set(struct ath10k *ar, const u8 *addr, |
47 | u8 keyidx); | |
500ff9f9 MK |
48 | int ath10k_mac_vif_chan(struct ieee80211_vif *vif, |
49 | struct cfg80211_chan_def *def); | |
b4aa539d | 50 | |
cc9904e6 MK |
51 | void ath10k_mac_handle_beacon(struct ath10k *ar, struct sk_buff *skb); |
52 | void ath10k_mac_handle_beacon_miss(struct ath10k *ar, u32 vdev_id); | |
acd0b27b MK |
53 | void ath10k_mac_handle_tx_pause_vdev(struct ath10k *ar, u32 vdev_id, |
54 | enum wmi_tlv_tx_pause_id pause_id, | |
55 | enum wmi_tlv_tx_pause_action action); | |
01cebe1c | 56 | |
5528e032 | 57 | u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband, |
4b7f353b | 58 | u8 hw_rate, bool cck); |
01cebe1c MK |
59 | u8 ath10k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband, |
60 | u32 bitrate); | |
5e3dd157 | 61 | |
96d828d4 MK |
62 | void ath10k_mac_tx_lock(struct ath10k *ar, int reason); |
63 | void ath10k_mac_tx_unlock(struct ath10k *ar, int reason); | |
64 | void ath10k_mac_vif_tx_lock(struct ath10k_vif *arvif, int reason); | |
65 | void ath10k_mac_vif_tx_unlock(struct ath10k_vif *arvif, int reason); | |
d39de991 | 66 | bool ath10k_mac_tx_frm_has_freq(struct ath10k *ar); |
29946878 | 67 | void ath10k_mac_tx_push_pending(struct ath10k *ar); |
426e10ea MK |
68 | int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, |
69 | struct ieee80211_txq *txq); | |
70 | struct ieee80211_txq *ath10k_mac_txq_lookup(struct ath10k *ar, | |
71 | u16 peer_id, | |
72 | u8 tid); | |
7e247a9e | 73 | int ath10k_mac_ext_resource_config(struct ath10k *ar, u32 val); |
828853ac | 74 | void ath10k_mac_wait_tx_complete(struct ath10k *ar); |
1382993f | 75 | int ath10k_mac_rfkill_enable_radio(struct ath10k *ar, bool enable); |
96d828d4 | 76 | |
4b604558 MK |
77 | static inline void ath10k_tx_h_seq_no(struct ieee80211_vif *vif, |
78 | struct sk_buff *skb) | |
5e3dd157 KV |
79 | { |
80 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | |
81 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | |
56ac13bf | 82 | struct ath10k_vif *arvif = (void *)vif->drv_priv; |
5e3dd157 KV |
83 | |
84 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | |
85 | if (arvif->tx_seq_no == 0) | |
86 | arvif->tx_seq_no = 0x1000; | |
87 | ||
88 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | |
89 | arvif->tx_seq_no += 0x10; | |
90 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | |
91 | hdr->seq_ctrl |= cpu_to_le16(arvif->tx_seq_no); | |
92 | } | |
93 | } | |
94 | ||
95 | #endif /* _MAC_H_ */ |