1 /* 2 * sta interfaces for XRadio drivers 3 * 4 * Copyright (c) 2013 5 * Xradio Technology Co., Ltd. <www.xradiotech.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. 10 */ 11 #ifndef STA_H_INCLUDED 12 #define STA_H_INCLUDED 13 14 15 #ifdef XRADIO_USE_LONG_KEEP_ALIVE_PERIOD 16 #define XRADIO_KEEP_ALIVE_PERIOD (28) 17 #else 18 /*For Samsung, it is defined as 4*/ 19 #define XRADIO_KEEP_ALIVE_PERIOD (4) 20 #endif 21 22 #define XRADIO_BSS_LOSS_THOLD_DEF 30 /* better than 20 */ 23 #define XRADIO_LINK_LOSS_THOLD_DEF 50 /* better than 40 */ 24 25 /* ******************************************************************** */ 26 /* mac80211 API */ 27 28 int xradio_start(struct ieee80211_hw *dev); 29 void xradio_stop(struct ieee80211_hw *dev); 30 int xradio_add_interface(struct ieee80211_hw *dev, struct ieee80211_vif *vif); 31 void xradio_remove_interface(struct ieee80211_hw *dev, 32 struct ieee80211_vif *vif); 33 int xradio_change_interface(struct ieee80211_hw *dev, 34 struct ieee80211_vif *vif, 35 enum nl80211_iftype new_type, 36 bool p2p); 37 int xradio_config(struct ieee80211_hw *dev, u32 changed); 38 int xradio_change_interface(struct ieee80211_hw *dev, 39 struct ieee80211_vif *vif, 40 enum nl80211_iftype new_type, 41 bool p2p); 42 void xradio_configure_filter(struct ieee80211_hw *dev, 43 struct ieee80211_vif *vif, 44 unsigned int changed_flags, 45 unsigned int *total_flags, 46 u64 multicast); 47 48 int xradio_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif, 49 u16 queue, const struct ieee80211_tx_queue_params *params); 50 int xradio_get_stats(struct ieee80211_hw *dev, 51 struct ieee80211_low_level_stats *stats); 52 /* Not more a part of interface? 53 int xradio_get_tx_stats(struct ieee80211_hw *dev, 54 struct ieee80211_tx_queue_stats *stats); 55 */ 56 int xradio_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, 57 struct ieee80211_vif *vif, struct ieee80211_sta *sta, 58 struct ieee80211_key_conf *key); 59 int xradio_set_rts_thresholds(struct ieee80211_hw *hw, u32 value); 60 void xradio_flush(struct ieee80211_hw *hw, 61 struct ieee80211_vif *vif, 62 u32 queues, 63 bool drop); 64 int xradio_remain_on_channel(struct ieee80211_hw *hw, 65 struct ieee80211_vif *vif, 66 struct ieee80211_channel *chan, 67 int duration, enum ieee80211_roc_type type); 68 int xradio_cancel_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 69 int xradio_set_arpreply(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 70 u64 xradio_prepare_multicast(struct ieee80211_hw *hw, 71 struct ieee80211_vif *vif, 72 struct netdev_hw_addr_list *mc_list); 73 int xradio_set_pm(struct xradio_vif *priv, const struct wsm_set_pm *arg); 74 void xradio_set_data_filter(struct ieee80211_hw *hw, 75 struct ieee80211_vif *vif, 76 void *data, 77 int len); 78 int xradio_change_mac(struct ieee80211_hw *hw, 79 struct ieee80211_vif *vif, struct sockaddr *sa); 80 81 82 /* ******************************************************************** */ 83 /* WSM callbacks */ 84 85 /* void xradio_set_pm_complete_cb(struct xradio_common *hw_priv, 86 struct wsm_set_pm_complete *arg); */ 87 void xradio_channel_switch_cb(struct xradio_common *hw_priv); 88 89 /* ******************************************************************** */ 90 /* WSM events */ 91 92 void xradio_free_event_queue(struct xradio_common *hw_priv); 93 void xradio_event_handler(struct work_struct *work); 94 void xradio_bss_loss_work(struct work_struct *work); 95 void xradio_connection_loss_work(struct work_struct *work); 96 void xradio_keep_alive_work(struct work_struct *work); 97 void xradio_tx_failure_work(struct work_struct *work); 98 99 /* ******************************************************************** */ 100 /* Internal API */ 101 102 int xradio_setup_mac(struct xradio_common *hw_priv); 103 void xradio_join_work(struct work_struct *work); 104 void xradio_join_timeout(struct work_struct *work); 105 void xradio_unjoin_work(struct work_struct *work); 106 void xradio_offchannel_work(struct work_struct *work); 107 void xradio_wep_key_work(struct work_struct *work); 108 void xradio_update_filtering(struct xradio_vif *priv); 109 void xradio_update_filtering_work(struct work_struct *work); 110 int __xradio_flush(struct xradio_common *hw_priv, bool drop, int if_id); 111 void xradio_set_beacon_wakeup_period_work(struct work_struct *work); 112 int xradio_enable_listening(struct xradio_vif *priv, 113 struct ieee80211_channel *chan); 114 int xradio_disable_listening(struct xradio_vif *priv); 115 int xradio_set_uapsd_param(struct xradio_vif *priv, 116 const struct wsm_edca_params *arg); 117 void xradio_ba_work(struct work_struct *work); 118 void xradio_ba_timer(struct timer_list *t); 119 const u8 *xradio_get_ie(u8 *start, size_t len, u8 ie); 120 int xradio_vif_setup(struct xradio_vif *priv); 121 int xradio_setup_mac_pvif(struct xradio_vif *priv); 122 void xradio_iterate_vifs(void *data, u8 *mac, struct ieee80211_vif *vif); 123 void xradio_rem_chan_timeout(struct work_struct *work); 124 int xradio_set_macaddrfilter(struct xradio_common *hw_priv, 125 struct xradio_vif *priv, u8 *data); 126 127 /* BT */ 128 void xradio_bt_timer(struct timer_list *t); 129 130 #ifdef MONITOR_MODE 131 void xradio_channel_switch(struct xradio_common *hw_priv, 132 struct ieee80211_channel *chan); 133 int xradio_enable_monitoring(struct xradio_vif *priv, 134 struct ieee80211_channel *chan); 135 int xradio_disable_monitoring(struct xradio_vif *priv); 136 #endif 137 #ifdef ROAM_OFFLOAD 138 int xradio_testmode_event(struct wiphy *wiphy, const u32 msg_id, 139 const void *data, int len, gfp_t gfp); 140 #endif /*ROAM_OFFLOAD*/ 141 #ifdef IPV6_FILTERING 142 int xradio_set_na(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 143 #endif /*IPV6_FILTERING*/ 144 #ifdef CONFIG_XRADIO_TESTMODE 145 void xradio_device_power_calc(struct xradio_common *priv, 146 s16 max_output_power, s16 fe_cor, u32 band); 147 int xradio_testmode_cmd(struct ieee80211_hw *hw, void *data, int len); 148 int xradio_tesmode_event(struct wiphy *wiphy, const u32 msg_id, 149 const void *data, int len, gfp_t gfp); 150 int xradio_get_tx_power_range(struct ieee80211_hw *hw); 151 int xradio_get_tx_power_level(struct ieee80211_hw *hw); 152 #endif /* CONFIG_XRADIO_TESTMODE */ 153 #endif 154