2013-06-12 20:52:10 +03:00
/*
* Copyright ( c ) 2005 - 2011 Atheros Communications Inc .
2017-12-22 18:31:13 +02:00
* Copyright ( c ) 2011 - 2017 Qualcomm Atheros , Inc .
2013-06-12 20:52:10 +03:00
*
* Permission to use , copy , modify , and / or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
* ACTION OF CONTRACT , NEGLIGENCE OR OTHER TORTIOUS ACTION , ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE .
*/
# ifndef _MAC_H_
# define _MAC_H_
# include <net/mac80211.h>
# include "core.h"
2014-11-25 11:46:58 +05:30
# define WEP_KEYID_SHIFT 6
2015-03-31 10:26:24 +00:00
enum wmi_tlv_tx_pause_id ;
enum wmi_tlv_tx_pause_action ;
2013-06-12 20:52:10 +03:00
struct ath10k_generic_iter {
struct ath10k * ar ;
int ret ;
} ;
2015-03-30 09:51:51 +03:00
struct rfc1042_hdr {
u8 llc_dsap ;
u8 llc_ssap ;
u8 llc_ctrl ;
u8 snap_oui [ 3 ] ;
__be16 snap_type ;
} __packed ;
2014-08-07 11:03:27 +02:00
struct ath10k * ath10k_mac_create ( size_t priv_size ) ;
2013-06-12 20:52:10 +03:00
void ath10k_mac_destroy ( struct ath10k * ar ) ;
int ath10k_mac_register ( struct ath10k * ar ) ;
void ath10k_mac_unregister ( struct ath10k * ar ) ;
struct ath10k_vif * ath10k_get_arvif ( struct ath10k * ar , u32 vdev_id ) ;
2014-08-05 14:54:44 +02:00
void __ath10k_scan_finish ( struct ath10k * ar ) ;
void ath10k_scan_finish ( struct ath10k * ar ) ;
void ath10k_scan_timeout_work ( struct work_struct * work ) ;
2013-06-12 20:52:10 +03:00
void ath10k_offchan_tx_purge ( struct ath10k * ar ) ;
void ath10k_offchan_tx_work ( struct work_struct * work ) ;
2013-09-26 17:47:12 +02:00
void ath10k_mgmt_over_wmi_tx_purge ( struct ath10k * ar ) ;
void ath10k_mgmt_over_wmi_tx_work ( struct work_struct * work ) ;
2013-07-16 09:54:35 +02:00
void ath10k_halt ( struct ath10k * ar ) ;
2014-09-18 11:18:02 +03:00
void ath10k_mac_vif_beacon_free ( struct ath10k_vif * arvif ) ;
2014-10-28 10:34:38 +01:00
void ath10k_drain_tx ( struct ath10k * ar ) ;
2014-11-25 11:46:58 +05:30
bool ath10k_mac_is_peer_wep_key_set ( struct ath10k * ar , const u8 * addr ,
u8 keyidx ) ;
2015-03-31 10:26:21 +00:00
int ath10k_mac_vif_chan ( struct ieee80211_vif * vif ,
struct cfg80211_chan_def * def ) ;
2015-03-31 10:26:24 +00:00
2015-03-10 16:22:01 +02:00
void ath10k_mac_handle_beacon ( struct ath10k * ar , struct sk_buff * skb ) ;
void ath10k_mac_handle_beacon_miss ( struct ath10k * ar , u32 vdev_id ) ;
2015-07-09 13:08:38 +02:00
void ath10k_mac_handle_tx_pause_vdev ( struct ath10k * ar , u32 vdev_id ,
enum wmi_tlv_tx_pause_id pause_id ,
enum wmi_tlv_tx_pause_action action ) ;
2015-03-30 09:51:56 +03:00
2015-03-30 09:51:56 +03:00
u8 ath10k_mac_hw_rate_to_idx ( const struct ieee80211_supported_band * sband ,
2015-11-12 10:36:10 -08:00
u8 hw_rate , bool cck ) ;
2015-03-30 09:51:56 +03:00
u8 ath10k_mac_bitrate_to_idx ( const struct ieee80211_supported_band * sband ,
u32 bitrate ) ;
2013-06-12 20:52:10 +03:00
2015-03-31 10:26:23 +00:00
void ath10k_mac_tx_lock ( struct ath10k * ar , int reason ) ;
void ath10k_mac_tx_unlock ( struct ath10k * ar , int reason ) ;
void ath10k_mac_vif_tx_lock ( struct ath10k_vif * arvif , int reason ) ;
void ath10k_mac_vif_tx_unlock ( struct ath10k_vif * arvif , int reason ) ;
2015-11-05 11:34:00 +05:30
bool ath10k_mac_tx_frm_has_freq ( struct ath10k * ar ) ;
2016-03-06 16:14:34 +02:00
void ath10k_mac_tx_push_pending ( struct ath10k * ar ) ;
2016-03-06 16:14:43 +02:00
int ath10k_mac_tx_push_txq ( struct ieee80211_hw * hw ,
struct ieee80211_txq * txq ) ;
struct ieee80211_txq * ath10k_mac_txq_lookup ( struct ath10k * ar ,
u16 peer_id ,
u8 tid ) ;
2016-04-12 20:15:53 +05:30
int ath10k_mac_ext_resource_config ( struct ath10k * ar , u32 val ) ;
2018-08-28 19:48:42 +03:00
void ath10k_mac_wait_tx_complete ( struct ath10k * ar ) ;
2015-03-31 10:26:23 +00:00
2014-07-21 21:03:09 +03:00
static inline void ath10k_tx_h_seq_no ( struct ieee80211_vif * vif ,
struct sk_buff * skb )
2013-06-12 20:52:10 +03:00
{
struct ieee80211_tx_info * info = IEEE80211_SKB_CB ( skb ) ;
struct ieee80211_hdr * hdr = ( struct ieee80211_hdr * ) skb - > data ;
2017-02-13 12:38:37 +02:00
struct ath10k_vif * arvif = ( void * ) vif - > drv_priv ;
2013-06-12 20:52:10 +03:00
if ( info - > flags & IEEE80211_TX_CTL_ASSIGN_SEQ ) {
if ( arvif - > tx_seq_no = = 0 )
arvif - > tx_seq_no = 0x1000 ;
if ( info - > flags & IEEE80211_TX_CTL_FIRST_FRAGMENT )
arvif - > tx_seq_no + = 0x10 ;
hdr - > seq_ctrl & = cpu_to_le16 ( IEEE80211_SCTL_FRAG ) ;
hdr - > seq_ctrl | = cpu_to_le16 ( arvif - > tx_seq_no ) ;
}
}
# endif /* _MAC_H_ */