ath9k|ath9k_htc: move dups to common-beacon
cover ath9k|ath9k_htc: move dups to common-beacon
Next patch set. It removes only easy duplicats of beacon code. Other parts of need deeper rework to make it compatible with ath9k.
Oleksij Rempel (23):
ath9k: move struct ath_beacon_config to common
ath9k_htc: use common ath_beacon_config
ath9k_htc: move beaconq to struct htc_beacon
ath9k_htc: use ath_beacon_conf.enable_beacon
ath9k: move sc_flags to ath_common
ath9k_htc: use common->op_flags
ath9k_htc: add ATH_OP_PRIM_STA_VIF
ath9k: remove unused bc_tstamp
ath9k_htc: sync beacon slot code with ath9k
ath9k: remove unused beacon_qi
ath9k|ath9k_htc: move IEEE80211_MS_TO_TU to common
ath9k-common: add nexttbtt and intval to ath_beacon_config
ath9k: move ath9k_beacon_config_sta to common-beacon
ath9k_htc: use ath9k_cmn_beacon_config_sta
ath9k: move ath9k_beacon_config_adhoc to common
ath9k_htc: add ath9k_htc_beacon_init (but not use it)
ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_ap
ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_adhoc
ath9k_htc: use ath9k_cmn_beacon_config_adhoc
ath9k: move ath9k_beacon_config_ap common
ath9k: remove unused ath9k_get_next_tbtt
ath9k_htc: use ath9k_cmn_beacon_config_ap
ath9k_htc: move DEFAULT_SWBA_RESPONSE check to ath9k_htc_beacon_init
drivers/net/wireless/ath/ath.h | 10 + drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ahb.c | 7 +- drivers/net/wireless/ath/ath9k/ath9k.h | 22 --- drivers/net/wireless/ath/ath9k/beacon.c | 165 ++-------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 180 +++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 26 +++ drivers/net/wireless/ath/ath9k/common.h | 14 ++ drivers/net/wireless/ath/ath9k/debug.c | 2 +- drivers/net/wireless/ath/ath9k/htc.h | 25 +-- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 252 ++++++------------------ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 10 +- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 53 +++-- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 3 +- drivers/net/wireless/ath/ath9k/link.c | 16 +- drivers/net/wireless/ath/ath9k/main.c | 45 +++-- drivers/net/wireless/ath/ath9k/mci.c | 2 +- drivers/net/wireless/ath/ath9k/pci.c | 8 +- drivers/net/wireless/ath/ath9k/xmit.c | 9 +- 19 files changed, 413 insertions(+), 439 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.c create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.h
Signature · 1 line
1.9.0
PATCH 1/23 ath9k: move struct ath_beacon_config to common
--- drivers/net/wireless/ath/ath9k/ath9k.h | 9 --------- drivers/net/wireless/ath/ath9k/common.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -9
@@ -408,15 +408,6 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,#define TSF_TO_TU (_h,_l) \ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) -struct ath_beacon_config { -int beacon_interval; -u16 dtim_period; -u16 bmiss_timeout; -u8 dtim_count; -bool enable_beacon; -bool ibss_creator; -}; - struct ath_beacon { enum { OK, /* no change needed */
drivers/net/wireless/ath/ath9k/common.h +9 -0
@@ -44,6 +44,15 @@#define ATH_EP_RND (x, mul) \ (((x) + ((mul)/2)) / (mul)) +struct ath_beacon_config { +int beacon_interval; +u16 dtim_period; +u16 bmiss_timeout; +u8 dtim_count; +bool enable_beacon; +bool ibss_creator; +}; + bool ath9k_cmn_rx_accept(struct ath_common *common, struct ieee80211_hdr *hdr, struct ieee80211_rx_status *rxs,
Signature · 1 line
1.9.0
PATCH 2/23 ath9k_htc: use common ath_beacon_config
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc.h | 10 +++---- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 40 ++++++++++++------------- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- 3 files changed, 25 insertions(+), 27 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +4 -6
@@ -406,12 +406,9 @@ static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,#define DEFAULT_SWBA_RESPONSE 40/* in TUs */ #define MIN_SWBA_RESPONSE 10/* in TUs */ -struct htc_beacon_config { +struct htc_beacon {struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF ]; -u16 beacon_interval; -u16 dtim_period; -u16 bmiss_timeout; -u32 bmiss_cnt; +u32 bmisscnt; };struct ath_btcoex {
@@ -489,7 +486,8 @@ struct ath9k_htc_priv {struct ath9k_hw_cal_data caldata;spinlock_t beacon_lock; -struct htc_beacon_config cur_beacon_conf; +struct ath_beacon_config cur_beacon_conf; +struct htc_beacon beacon;struct ath9k_htc_rx rx;struct ath9k_htc_tx tx;
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +20 -20
@@ -64,7 +64,7 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)static void ath9k_htc_beacon_config_sta (struct ath9k_htc_priv *priv, -struct htc_beacon_config *bss_conf) +struct ath_beacon_config *bss_conf) {struct ath_common *common =ath9k_hw_common (priv->ah);struct ath9k_beacon_state bs;
@@ -162,7 +162,7 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, }static void ath9k_htc_beacon_config_ap (struct ath9k_htc_priv *priv, -struct htc_beacon_config *bss_conf) +struct ath_beacon_config *bss_conf) {struct ath_common *common =ath9k_hw_common (priv->ah);enum ath9k_int imask =0 ;
@@ -211,13 +211,13 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,WMI_CMD (WMI_DISABLE_INTR_CMDID );ath9k_hw_beaconinit (priv->ah,TU_TO_USEC (nexttbtt),TU_TO_USEC (intval)); - priv->cur_beacon_conf.bmiss_cnt =0 ; + priv->beacon.bmisscnt =0 ; htc_imask =cpu_to_be32 (imask);WMI_CMD_BUF (WMI_ENABLE_INTR_CMDID , &htc_imask); }static void ath9k_htc_beacon_config_adhoc (struct ath9k_htc_priv *priv, -struct htc_beacon_config *bss_conf) +struct ath_beacon_config *bss_conf) {struct ath_common *common =ath9k_hw_common (priv->ah);enum ath9k_int imask =0 ;
@@ -257,7 +257,7 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,WMI_CMD (WMI_DISABLE_INTR_CMDID );ath9k_hw_beaconinit (priv->ah,TU_TO_USEC (nexttbtt),TU_TO_USEC (intval)); - priv->cur_beacon_conf.bmiss_cnt =0 ; + priv->beacon.bmisscnt =0 ; htc_imask =cpu_to_be32 (imask);WMI_CMD_BUF (WMI_ENABLE_INTR_CMDID , &htc_imask); }
@@ -279,7 +279,7 @@ static void ath9k_htc_send_buffered(struct ath9k_htc_priv *priv,spin_lock_bh (&priv->beacon_lock); - vif = priv->cur_beacon_conf.bslot[slot]; + vif = priv->beacon.bslot[slot]; skb =ieee80211_get_buffered_bc (priv->hw, vif);
@@ -340,7 +340,7 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,spin_lock_bh (&priv->beacon_lock); - vif = priv->cur_beacon_conf.bslot[slot]; + vif = priv->beacon.bslot[slot]; avp = (struct ath9k_htc_vif *)vif->drv_priv;if (unlikely (test_bit (OP_SCANNING , &priv->op_flags))) {
@@ -423,8 +423,8 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv,int slot;if (swba->beacon_pending !=0 ) { - priv->cur_beacon_conf.bmiss_cnt++; -if (priv->cur_beacon_conf.bmiss_cnt >BSTUCK_THRESHOLD ) { + priv->beacon.bmisscnt++; +if (priv->beacon.bmisscnt >BSTUCK_THRESHOLD ) {ath_dbg (common,BSTUCK ,"Beacon stuck, HW reset\n" );ieee80211_queue_work (priv->hw, &priv->fatal_work);
@@ -432,16 +432,16 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv,return ; } -if (priv->cur_beacon_conf.bmiss_cnt) { +if (priv->beacon.bmisscnt) {ath_dbg (common,BSTUCK ,"Resuming beacon xmit after %u misses\n" , - priv->cur_beacon_conf.bmiss_cnt); - priv->cur_beacon_conf.bmiss_cnt =0 ; + priv->beacon.bmisscnt); + priv->beacon.bmisscnt =0 ; } slot =ath9k_htc_choose_bslot (priv, swba);spin_lock_bh (&priv->beacon_lock); -if (priv->cur_beacon_conf.bslot[slot] ==NULL ) { +if (priv->beacon.bslot[slot] ==NULL ) {spin_unlock_bh (&priv->beacon_lock);return ; }
@@ -460,13 +460,13 @@ void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,spin_lock_bh (&priv->beacon_lock);for (i =0 ; i <ATH9K_HTC_MAX_BCN_VIF ; i++) { -if (priv->cur_beacon_conf.bslot[i] ==NULL ) { +if (priv->beacon.bslot[i] ==NULL ) { avp->bslot = i;break ; } } - priv->cur_beacon_conf.bslot[avp->bslot] = vif; + priv->beacon.bslot[avp->bslot] = vif;spin_unlock_bh (&priv->beacon_lock); ath_dbg(common, CONFIG, "Added interface at beacon slot: %d\n",
@@ -480,7 +480,7 @@ void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv;spin_lock_bh (&priv->beacon_lock); - priv->cur_beacon_conf.bslot[avp->bslot] =NULL ; + priv->beacon.bslot[avp->bslot] =NULL ;spin_unlock_bh (&priv->beacon_lock); ath_dbg(common, CONFIG, "Removed interface at beacon slot: %d\n",
@@ -496,7 +496,7 @@ void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv, {struct ath_common *common =ath9k_hw_common (priv->ah);struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv; -struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf; +struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf;u64 tsfadjust;if (avp->bslot ==0 )
@@ -528,7 +528,7 @@ static bool ath9k_htc_check_beacon_config(struct ath9k_htc_priv *priv, struct ieee80211_vif *vif) {struct ath_common *common =ath9k_hw_common (priv->ah); -struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf; +struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf;struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;bool beacon_configured;
@@ -583,7 +583,7 @@ void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, struct ieee80211_vif *vif) {struct ath_common *common =ath9k_hw_common (priv->ah); -struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf; +struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf;struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *) vif->drv_priv;
@@ -619,7 +619,7 @@ void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,void ath9k_htc_beacon_reconfig (struct ath9k_htc_priv *priv) {struct ath_common *common =ath9k_hw_common (priv->ah); -struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf; +struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf;switch (priv->ah->opmode) {case NL80211_IFTYPE_STATION :
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -1
@@ -520,7 +520,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, goto err_queues;for (i =0 ; i <ATH9K_HTC_MAX_BCN_VIF ; i++) - priv->cur_beacon_conf.bslot[i] =NULL ; + priv->beacon.bslot[i] =NULL ;ath9k_cmn_init_channels_rates (common);ath9k_cmn_init_crypto (ah);
Signature · 1 line
1.9.0
PATCH 3/23 ath9k_htc: move beaconq to struct htc_beacon
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 8 ++++---- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +1 -1
@@ -409,6 +409,7 @@ static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,struct htc_beacon {struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF ];u32 bmisscnt; +u32 beaconq; };struct ath_btcoex {
@@ -512,7 +513,6 @@ struct ath9k_htc_priv {struct work_struct led_work;#endif -int beaconq;int cabq;int hwq_map[IEEE80211_NUM_ACS ];
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +4 -4
@@ -26,7 +26,7 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)memset (&qi,0 ,sizeof (struct ath9k_tx_queue_info ));memset (&qi_be,0 ,sizeof (struct ath9k_tx_queue_info )); -ath9k_hw_get_txq_props (ah, priv->beaconq, &qi); +ath9k_hw_get_txq_props (ah, priv->beacon.beaconq, &qi);if (priv->ah->opmode ==NL80211_IFTYPE_AP || priv->ah->opmode ==NL80211_IFTYPE_MESH_POINT ) {
@@ -54,11 +54,11 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) } -if (!ath9k_hw_set_txq_props (ah, priv->beaconq, &qi)) { +if (!ath9k_hw_set_txq_props (ah, priv->beacon.beaconq, &qi)) {ath_err (ath9k_hw_common (ah), -"Unable to update beacon queue %u!\n" , priv->beaconq); +"Unable to update beacon queue %u!\n" , priv->beacon.beaconq); }else { -ath9k_hw_resettxqueue (ah, priv->beaconq); +ath9k_hw_resettxqueue (ah, priv->beacon.beaconq); } }
drivers/net/wireless/ath/ath9k/htc_drv_init.c +2 -2
@@ -405,8 +405,8 @@ static int ath9k_init_queues(struct ath9k_htc_priv *priv)for (i =0 ; i <ARRAY_SIZE (priv->hwq_map); i++) priv->hwq_map[i] =-1 ; - priv->beaconq =ath9k_hw_beaconq_setup (priv->ah); -if (priv->beaconq ==-1 ) { + priv->beacon.beaconq =ath9k_hw_beaconq_setup (priv->ah); +if (priv->beacon.beaconq ==-1 ) {ath_err (common,"Unable to setup BEACON xmit queue\n" ); goto err; }
Signature · 1 line
1.9.0
PATCH 4/23 ath9k_htc: use ath_beacon_conf.enable_beacon
In reply to Oleksij Rempelto reduce difference between ath9k and ath9k_htc
--- drivers/net/wireless/ath/ath9k/htc.h | 1 - drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 4 ++-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +0 -1
@@ -439,7 +439,6 @@ static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)#define OP_INVALID BIT(0)#define OP_SCANNING BIT(1) -#define OP_ENABLE_BEACON BIT(2)#define OP_BT_PRIORITY_DETECTED BIT(3)#define OP_BT_SCAN BIT(4)#define OP_ANI_RUNNING BIT(5)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +2 -2
@@ -199,7 +199,7 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, }while (nexttbtt < tsftu); } -if (test_bit (OP_ENABLE_BEACON , &priv->op_flags)) +if (bss_conf->enable_beacon) imask |=ATH9K_INT_SWBA ; ath_dbg(common, CONFIG,
@@ -247,7 +247,7 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,else priv->ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; -if (test_bit (OP_ENABLE_BEACON , &priv->op_flags)) +if (bss_conf->enable_beacon) imask |=ATH9K_INT_SWBA ; ath_dbg(common, CONFIG,
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2 -2
@@ -1529,7 +1529,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,ath_dbg (common,CONFIG ,"Beacon enabled for BSS: %pM\n" , bss_conf->bssid);ath9k_htc_set_tsfadjust (priv, vif); -set_bit (OP_ENABLE_BEACON , &priv->op_flags); + priv->cur_beacon_conf.enable_beacon =1 ;ath9k_htc_beacon_config (priv, vif); }
@@ -1543,7 +1543,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,ath_dbg (common,CONFIG ,"Beacon disabled for BSS: %pM\n" , bss_conf->bssid); -clear_bit (OP_ENABLE_BEACON , &priv->op_flags); + priv->cur_beacon_conf.enable_beacon =0 ;ath9k_htc_beacon_config (priv, vif); } }
Signature · 1 line
1.9.0
PATCH 5/23 ath9k: move sc_flags to ath_common
In reply to Oleksij Rempelwe will need it for ath9k_htc, may be other drivers too
--- drivers/net/wireless/ath/ath.h | 10 ++++++++ drivers/net/wireless/ath/ath9k/ahb.c | 7 ++--- drivers/net/wireless/ath/ath9k/ath9k.h | 10 -------- drivers/net/wireless/ath/ath9k/beacon.c | 18 +++++++------ drivers/net/wireless/ath/ath9k/debug.c | 2 +- drivers/net/wireless/ath/ath9k/link.c | 16 +++++++----- drivers/net/wireless/ath/ath9k/main.c | 45 ++++++++++++++++++--------------- drivers/net/wireless/ath/ath9k/mci.c | 2 +- drivers/net/wireless/ath/ath9k/pci.c | 8 +++--- drivers/net/wireless/ath/ath9k/xmit.c | 9 ++++--- 10 files changed, 70 insertions(+), 57 deletions(-)
drivers/net/wireless/ath/ath.h +10 -0
@@ -56,6 +56,15 @@ enum ath_device_state { ATH_HW_INITIALIZED, }; +enum ath_op_flags { +ATH_OP_INVALID , +ATH_OP_BEACONS , +ATH_OP_ANI_RUN , +ATH_OP_PRIM_STA_VIF , +ATH_OP_HW_RESET , +ATH_OP_SCANNING , +}; +enum ath_bus_type {ATH_PCI ,ATH_AHB ,
@@ -130,6 +139,7 @@ struct ath_common {struct ieee80211_hw *hw;int debug_mask;enum ath_device_state state; +unsigned long op_flags;struct ath_ani ani;
drivers/net/wireless/ath/ath9k/ahb.c +4 -3
@@ -82,6 +82,7 @@ static int ath_ahb_probe(struct platform_device *pdev)int irq;int ret =0 ;struct ath_hw *ah; +struct ath_common *common;char hw_name[64 ];if (!dev_get_platdata (&pdev->dev)) {
@@ -124,9 +125,6 @@ static int ath_ahb_probe(struct platform_device *pdev) sc->mem = mem; sc->irq = irq; -/* Will be cleared in ath9k_start() */ -set_bit (SC_OP_INVALID , &sc->sc_flags); - ret =request_irq (irq, ath_isr,IRQF_SHARED ,"ath9k" , sc);if (ret) {dev_err (&pdev->dev,"request_irq failed\n" );
@@ -144,6 +142,9 @@ static int ath_ahb_probe(struct platform_device *pdev)wiphy_info (hw->wiphy,"%s mem=0x%lx, irq=%d\n" , hw_name, (unsigned long )mem, irq); + common =ath9k_hw_common (sc->sc_ah); +/* Will be cleared in ath9k_start() */ +set_bit (ATH_OP_INVALID , &common->op_flags);return 0 ; err_irq:
drivers/net/wireless/ath/ath9k/ath9k.h +0 -10
@@ -688,15 +688,6 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs);#define ATH_TXPOWER_MAX 100/* .5 dBm units */ #define MAX_GTT_CNT 5 -enum sc_op_flags { -SC_OP_INVALID , -SC_OP_BEACONS , -SC_OP_ANI_RUN , -SC_OP_PRIM_STA_VIF , -SC_OP_HW_RESET , -SC_OP_SCANNING , -}; -/* Powersave flags */ #define PS_WAIT_FOR_BEACON BIT(0)#define PS_WAIT_FOR_CAB BIT(1)
@@ -726,7 +717,6 @@ struct ath_softc {struct completion paprd_complete;wait_queue_head_t tx_wait; -unsigned long sc_flags;unsigned long driver_data;u8 gtt_cnt;
drivers/net/wireless/ath/ath9k/beacon.c +10 -8
@@ -328,7 +328,7 @@ void ath9k_beacon_tasklet(unsigned long data)bool edma = !!(ah->caps.hw_caps &ATH9K_HW_CAP_EDMA );int slot; -if (test_bit (SC_OP_HW_RESET , &sc->sc_flags)) { +if (test_bit (ATH_OP_HW_RESET , &common->op_flags)) {ath_dbg (common,RESET ,"reset work is pending, skip beaconing now\n" );return ;
@@ -524,7 +524,7 @@ static void ath9k_beacon_config_sta(struct ath_softc *sc,u64 tsf;/* No need to configure beacon if we are not associated */ -if (!test_bit (SC_OP_PRIM_STA_VIF , &sc->sc_flags)) { +if (!test_bit (ATH_OP_PRIM_STA_VIF , &common->op_flags)) {ath_dbg (common,BEACON ,"STA is not yet associated..skipping beacon config\n" );return ;
@@ -629,7 +629,7 @@ static void ath9k_beacon_config_adhoc(struct ath_softc *sc,* joiner case in IBSS mode. */ if (!conf->ibss_creator && conf->enable_beacon) -set_bit (SC_OP_BEACONS , &sc->sc_flags); +set_bit (ATH_OP_BEACONS , &common->op_flags); } static bool ath9k_allow_beacon_config(struct ath_softc *sc,
@@ -649,7 +649,7 @@ static bool ath9k_allow_beacon_config(struct ath_softc *sc,if (sc->sc_ah->opmode ==NL80211_IFTYPE_STATION ) {if ((vif->type ==NL80211_IFTYPE_STATION ) && -test_bit (SC_OP_BEACONS , &sc->sc_flags) && +test_bit (ATH_OP_BEACONS , &common->op_flags) && !avp->primary_sta_vif) {ath_dbg (common,CONFIG ,"Beacon already configured for a station interface\n" );
@@ -700,6 +700,8 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, {struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf; +struct ath_hw *ah = sc->sc_ah; +struct ath_common *common =ath9k_hw_common (ah);unsigned long flags;bool skip_beacon = false;
@@ -712,7 +714,7 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,if (sc->sc_ah->opmode ==NL80211_IFTYPE_STATION ) {ath9k_cache_beacon_config (sc, bss_conf);ath9k_set_beacon (sc); -set_bit (SC_OP_BEACONS , &sc->sc_flags); +set_bit (ATH_OP_BEACONS , &common->op_flags);return ; }
@@ -751,13 +753,13 @@ void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif, }/* -* Do not set the SC_OP_BEACONS flag for IBSS joiner mode +* Do not set the ATH_OP_BEACONS flag for IBSS joiner mode * here, it is done in ath9k_beacon_config_adhoc(). */ if (cur_conf->enable_beacon && !skip_beacon) -set_bit (SC_OP_BEACONS , &sc->sc_flags); +set_bit (ATH_OP_BEACONS , &common->op_flags);else -clear_bit (SC_OP_BEACONS , &sc->sc_flags); +clear_bit (ATH_OP_BEACONS , &common->op_flags); } }
drivers/net/wireless/ath/ath9k/debug.c +1 -1
@@ -209,7 +209,7 @@ static ssize_t write_file_ani(struct file *file, common->disable_ani = !ani;if (common->disable_ani) { -clear_bit (SC_OP_ANI_RUN , &sc->sc_flags); +clear_bit (ATH_OP_ANI_RUN , &common->op_flags);ath_stop_ani (sc); }else {ath_check_ani (sc);
drivers/net/wireless/ath/ath9k/link.c +9 -7
@@ -115,13 +115,14 @@ void ath_hw_pll_work(struct work_struct *work)u32 pll_sqsum; struct ath_softc *sc = container_of(work, struct ath_softc, hw_pll_work.work); +struct ath_common *common =ath9k_hw_common (sc->sc_ah);/* * ensure that the PLL WAR is executed only * after the STA is associated (or) if the * beaconing had started in interfaces that * uses beacons. */ -if (!test_bit (SC_OP_BEACONS , &sc->sc_flags)) +if (!test_bit (ATH_OP_BEACONS , &common->op_flags))return ;if (sc->tx99_state)
@@ -414,7 +415,7 @@ void ath_start_ani(struct ath_softc *sc)unsigned long timestamp =jiffies_to_msecs (jiffies);if (common->disable_ani || - !test_bit (SC_OP_ANI_RUN , &sc->sc_flags) || + !test_bit (ATH_OP_ANI_RUN , &common->op_flags) || (sc->hw->conf.flags &IEEE80211_CONF_OFFCHANNEL ))return ;
@@ -438,6 +439,7 @@ void ath_stop_ani(struct ath_softc *sc)void ath_check_ani (struct ath_softc *sc) {struct ath_hw *ah = sc->sc_ah; +struct ath_common *common =ath9k_hw_common (sc->sc_ah);struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;/*
@@ -453,23 +455,23 @@ void ath_check_ani(struct ath_softc *sc)* Disable ANI only when there are no * associated stations. */ -if (!test_bit (SC_OP_PRIM_STA_VIF , &sc->sc_flags)) +if (!test_bit (ATH_OP_PRIM_STA_VIF , &common->op_flags)) goto stop_ani; } }else if (ah->opmode ==NL80211_IFTYPE_STATION ) { -if (!test_bit (SC_OP_PRIM_STA_VIF , &sc->sc_flags)) +if (!test_bit (ATH_OP_PRIM_STA_VIF , &common->op_flags)) goto stop_ani; } -if (!test_bit (SC_OP_ANI_RUN , &sc->sc_flags)) { -set_bit (SC_OP_ANI_RUN , &sc->sc_flags); +if (!test_bit (ATH_OP_ANI_RUN , &common->op_flags)) { +set_bit (ATH_OP_ANI_RUN , &common->op_flags);ath_start_ani (sc); }return ; stop_ani: -clear_bit (SC_OP_ANI_RUN , &sc->sc_flags); +clear_bit (ATH_OP_ANI_RUN , &common->op_flags);ath_stop_ani (sc); }
drivers/net/wireless/ath/ath9k/main.c +25 -20
166 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/mci.c +1 -1
@@ -555,7 +555,7 @@ void ath_mci_intr(struct ath_softc *sc) mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_GPM ;while (more_data ==MCI_GPM_MORE ) { -if (test_bit (SC_OP_HW_RESET , &sc->sc_flags)) +if (test_bit (ATH_OP_HW_RESET , &common->op_flags))return ; pgpm = mci->gpm_buf.bf_addr;
drivers/net/wireless/ath/ath9k/pci.c +5 -3
@@ -784,6 +784,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) {struct ath_softc *sc;struct ieee80211_hw *hw; +struct ath_common *common;u8 csz;u32 val;int ret =0 ;
@@ -858,9 +859,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) sc->mem =pcim_iomap_table (pdev)[0 ]; sc->driver_data = id->driver_data; -/* Will be cleared in ath9k_start() */ -set_bit (SC_OP_INVALID , &sc->sc_flags); - ret =request_irq (pdev->irq, ath_isr,IRQF_SHARED ,"ath9k" , sc);if (ret) {dev_err (&pdev->dev,"request_irq failed\n" );
@@ -879,6 +877,10 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)wiphy_info (hw->wiphy,"%s mem=0x%lx, irq=%d\n" , hw_name, (unsigned long )sc->mem, pdev->irq); +/* Will be cleared in ath9k_start() */ + common =ath9k_hw_common (sc->sc_ah); +set_bit (ATH_OP_INVALID , &common->op_flags); +return 0 ; err_init:
drivers/net/wireless/ath/ath9k/xmit.c +5 -4
@@ -1769,7 +1769,7 @@ bool ath_drain_all_txq(struct ath_softc *sc)int i;u32 npend =0 ; -if (test_bit (SC_OP_INVALID , &sc->sc_flags)) +if (test_bit (ATH_OP_INVALID , &common->op_flags))return true;ath9k_hw_abort_tx_dma (ah);
@@ -1817,11 +1817,12 @@ void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)*/ void ath_txq_schedule (struct ath_softc *sc,struct ath_txq *txq) { +struct ath_common *common =ath9k_hw_common (sc->sc_ah);struct ath_atx_ac *ac, *last_ac;struct ath_atx_tid *tid, *last_tid;bool sent = false; -if (test_bit (SC_OP_HW_RESET , &sc->sc_flags) || +if (test_bit (ATH_OP_HW_RESET , &common->op_flags) ||list_empty (&txq->axq_acq))return ;
@@ -2470,7 +2471,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)ath_txq_lock (sc, txq);for (;;) { -if (test_bit (SC_OP_HW_RESET , &sc->sc_flags)) +if (test_bit (ATH_OP_HW_RESET , &common->op_flags))break ;if (list_empty (&txq->axq_q)) {
@@ -2553,7 +2554,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)int status;for (;;) { -if (test_bit (SC_OP_HW_RESET , &sc->sc_flags)) +if (test_bit (ATH_OP_HW_RESET , &common->op_flags))break ; status =ath9k_hw_txprocdesc (ah,NULL , (void *)&ts);
Signature · 1 line
1.9.0
PATCH 6/23 ath9k_htc: use common->op_flags
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc.h | 3 --- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 +-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 26 ++++++++++++++----------- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 3 ++- 5 files changed, 19 insertions(+), 18 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +0 -3
@@ -437,11 +437,8 @@ static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv) }#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ -#define OP_INVALID BIT(0) -#define OP_SCANNING BIT(1)#define OP_BT_PRIORITY_DETECTED BIT(3)#define OP_BT_SCAN BIT(4) -#define OP_ANI_RUNNING BIT(5)#define OP_TSF_RESET BIT(6)struct ath9k_htc_priv {
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +1 -1
@@ -343,7 +343,7 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv, vif = priv->beacon.bslot[slot]; avp = (struct ath9k_htc_vif *)vif->drv_priv; -if (unlikely (test_bit (OP_SCANNING , &priv->op_flags))) { +if (unlikely (test_bit (ATH_OP_SCANNING , &common->op_flags))) {spin_unlock_bh (&priv->beacon_lock);return ; }
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -2
@@ -459,8 +459,6 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,struct ath_common *common;int i, ret =0 , csz =0 ; -set_bit (OP_INVALID , &priv->op_flags); - ah =kzalloc (sizeof (struct ath_hw ),GFP_KERNEL );if (!ah)return -ENOMEM ;
@@ -485,6 +483,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, common->priv = priv; common->debug_mask = ath9k_debug; common->btcoex_enabled = ath9k_htc_btcoex_enable ==1 ; +set_bit (ATH_OP_INVALID , &common->op_flags);spin_lock_init (&priv->beacon_lock);spin_lock_init (&priv->tx.tx_lock);
drivers/net/wireless/ath/ath9k/htc_drv_main.c +15 -11
@@ -250,7 +250,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,u8 cmd_rsp;int ret; -if (test_bit (OP_INVALID , &priv->op_flags)) +if (test_bit (ATH_OP_INVALID , &common->op_flags))return -EIO ; fastcc = !!(hw->conf.flags &IEEE80211_CONF_OFFCHANNEL );
@@ -304,7 +304,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,htc_start (priv->htc); -if (!test_bit (OP_SCANNING , &priv->op_flags) && +if (!test_bit (ATH_OP_SCANNING , &common->op_flags) && !(hw->conf.flags &IEEE80211_CONF_OFFCHANNEL ))ath9k_htc_vif_reconfig (priv);
@@ -748,7 +748,7 @@ void ath9k_htc_start_ani(struct ath9k_htc_priv *priv) common->ani.shortcal_timer = timestamp; common->ani.checkani_timer = timestamp; -set_bit (OP_ANI_RUNNING , &priv->op_flags); +set_bit (ATH_OP_ANI_RUN , &common->op_flags);ieee80211_queue_delayed_work (common->hw, &priv->ani_work,msecs_to_jiffies (ATH_ANI_POLLINTERVAL ));
@@ -756,8 +756,9 @@ void ath9k_htc_start_ani(struct ath9k_htc_priv *priv)void ath9k_htc_stop_ani (struct ath9k_htc_priv *priv) { +struct ath_common *common =ath9k_hw_common (priv->ah);cancel_delayed_work_sync (&priv->ani_work); -clear_bit (OP_ANI_RUNNING , &priv->op_flags); +clear_bit (ATH_OP_ANI_RUN , &common->op_flags); }void ath9k_htc_ani_work (struct work_struct *work)
@@ -942,7 +943,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)ath_dbg (common,CONFIG ,"Failed to update capability in target\n" ); -clear_bit (OP_INVALID , &priv->op_flags); +clear_bit (ATH_OP_INVALID , &common->op_flags);htc_start (priv->htc);spin_lock_bh (&priv->tx.tx_lock);
@@ -971,7 +972,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)mutex_lock (&priv->mutex); -if (test_bit (OP_INVALID , &priv->op_flags)) { +if (test_bit (ATH_OP_INVALID , &common->op_flags)) {ath_dbg (common,ANY ,"Device not present\n" );mutex_unlock (&priv->mutex);return ;
@@ -1013,7 +1014,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)ath9k_htc_ps_restore (priv);ath9k_htc_setpower (priv,ATH9K_PM_FULL_SLEEP ); -set_bit (OP_INVALID , &priv->op_flags); +set_bit (ATH_OP_INVALID , &common->op_flags);ath_dbg (common,CONFIG ,"Driver halt\n" );mutex_unlock (&priv->mutex);
@@ -1087,7 +1088,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,ath9k_htc_set_opmode (priv);if ((priv->ah->opmode ==NL80211_IFTYPE_AP ) && - !test_bit (OP_ANI_RUNNING , &priv->op_flags)) { + !test_bit (ATH_OP_ANI_RUN , &common->op_flags)) {ath9k_hw_set_tsfadjust (priv->ah, true);ath9k_htc_start_ani (priv); }
@@ -1245,13 +1246,14 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw, u64 multicast) {struct ath9k_htc_priv *priv = hw->priv; +struct ath_common *common =ath9k_hw_common (priv->ah);u32 rfilt;mutex_lock (&priv->mutex); changed_flags &=SUPPORTED_FILTERS ; *total_flags &=SUPPORTED_FILTERS ; -if (test_bit (OP_INVALID , &priv->op_flags)) { +if (test_bit (ATH_OP_INVALID , &common->op_flags)) {ath_dbg (ath9k_hw_common (priv->ah),ANY ,"Unable to configure filter on invalid state\n" );mutex_unlock (&priv->mutex);
@@ -1670,10 +1672,11 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,static void ath9k_htc_sw_scan_start (struct ieee80211_hw *hw) {struct ath9k_htc_priv *priv = hw->priv; +struct ath_common *common =ath9k_hw_common (priv->ah);mutex_lock (&priv->mutex);spin_lock_bh (&priv->beacon_lock); -set_bit (OP_SCANNING , &priv->op_flags); +set_bit (ATH_OP_SCANNING , &common->op_flags);spin_unlock_bh (&priv->beacon_lock);cancel_work_sync (&priv->ps_work);ath9k_htc_stop_ani (priv);
@@ -1683,10 +1686,11 @@ static void ath9k_htc_sw_scan_start(struct ieee80211_hw *hw)static void ath9k_htc_sw_scan_complete (struct ieee80211_hw *hw) {struct ath9k_htc_priv *priv = hw->priv; +struct ath_common *common =ath9k_hw_common (priv->ah);mutex_lock (&priv->mutex);spin_lock_bh (&priv->beacon_lock); -clear_bit (OP_SCANNING , &priv->op_flags); +clear_bit (ATH_OP_SCANNING , &common->op_flags);spin_unlock_bh (&priv->beacon_lock);ath9k_htc_ps_wakeup (priv);ath9k_htc_vif_reconfig (priv);
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +2 -1
@@ -924,9 +924,10 @@ static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)void ath9k_host_rx_init (struct ath9k_htc_priv *priv) { +struct ath_common *common =ath9k_hw_common (priv->ah);ath9k_hw_rxena (priv->ah);ath9k_htc_opmode_init (priv); -ath9k_hw_startpcureceive (priv->ah,test_bit (OP_SCANNING , &priv->op_flags)); +ath9k_hw_startpcureceive (priv->ah,test_bit (ATH_OP_SCANNING , &common->op_flags)); } static inline void convert_htc_flag(struct ath_rx_status *rx_stats,
Signature · 1 line
1.9.0
PATCH 7/23 ath9k_htc: add ATH_OP_PRIM_STA_VIF
In reply to Oleksij Rempelwe will need it to make common-beacon code work.
--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +4 -0
@@ -1478,6 +1478,7 @@ static void ath9k_htc_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif) common->curaid = bss_conf->aid; common->last_rssi =ATH_RSSI_DUMMY_MARKER ;memcpy (common->curbssid, bss_conf->bssid,ETH_ALEN ); +set_bit (ATH_OP_PRIM_STA_VIF , &common->op_flags); } }
@@ -1510,6 +1511,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, bss_conf->assoc ? priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; +if (!bss_conf->assoc) +clear_bit (ATH_OP_PRIM_STA_VIF , &common->op_flags); +if (priv->ah->opmode ==NL80211_IFTYPE_STATION ) {ath9k_htc_choose_set_bssid (priv);if (bss_conf->assoc && (priv->num_sta_assoc_vif ==1 ))
Signature · 1 line
1.9.0
PATCH 8/23 ath9k: remove unused bc_tstamp
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -1
@@ -417,7 +417,6 @@ struct ath_beacon {u32 beaconq;u32 bmisscnt; -u32 bc_tstamp;struct ieee80211_vif *bslot[ATH_BCBUF ];int slottime;int slotupdate;
Signature · 1 line
1.9.0
PATCH 9/23 ath9k_htc: sync beacon slot code with ath9k
In reply to Oleksij Rempelwe will need it for common-beacon
--- drivers/net/wireless/ath/ath9k/htc.h | 8 ++++++++ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 19 +++++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +8 -0
@@ -407,9 +407,17 @@ static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,#define MIN_SWBA_RESPONSE 10/* in TUs */ struct htc_beacon { +enum { +OK ,/* no change needed */ +UPDATE ,/* update pending */ +COMMIT /* beacon sent, commit change */ + } updateslot;/* slot time update fsm */ +struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF ];u32 bmisscnt;u32 beaconq; +int slottime; +int slotupdate; };struct ath_btcoex {
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -0
@@ -520,6 +520,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,for (i =0 ; i <ATH9K_HTC_MAX_BCN_VIF ; i++) priv->beacon.bslot[i] =NULL ; + priv->beacon.slottime =ATH9K_SLOT_TIME_9 ;ath9k_cmn_init_channels_rates (common);ath9k_cmn_init_crypto (ah);
drivers/net/wireless/ath/ath9k/htc_drv_main.c +15 -4
@@ -1500,6 +1500,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,struct ath9k_htc_priv *priv = hw->priv;struct ath_hw *ah = priv->ah;struct ath_common *common =ath9k_hw_common (ah); +int slottime;mutex_lock (&priv->mutex);ath9k_htc_ps_wakeup (priv);
@@ -1575,11 +1576,21 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,if (changed &BSS_CHANGED_ERP_SLOT ) {if (bss_conf->use_short_slot) - ah->slottime =9 ; + slottime =9 ;else - ah->slottime =20 ; - -ath9k_hw_init_global_settings (ah); + slottime =20 ; +if (vif->type ==NL80211_IFTYPE_AP ) { +/* +* Defer update, so that connected stations can adjust +* their settings at the same time. +* See beacon.c for more details +*/ + priv->beacon.slottime = slottime; + priv->beacon.updateslot =UPDATE ; + }else { + ah->slottime = slottime; +ath9k_hw_init_global_settings (ah); + } }if (changed &BSS_CHANGED_HT )
Signature · 1 line
1.9.0
PATCH 10/23 ath9k: remove unused beacon_qi
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -1
@@ -420,7 +420,6 @@ struct ath_beacon {struct ieee80211_vif *bslot[ATH_BCBUF ];int slottime;int slotupdate; -struct ath9k_tx_queue_info beacon_qi;struct ath_descdma bdma;struct ath_txq *cabq;struct list_head bbuf;
Signature · 1 line
1.9.0
PATCH 11/23 ath9k|ath9k_htc: move IEEE80211_MS_TO_TU to common
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 - drivers/net/wireless/ath/ath9k/common.h | 2 ++ drivers/net/wireless/ath/ath9k/htc.h | 1 - 3 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -1
@@ -403,7 +403,6 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,#define ATH_BCBUF 8#define ATH_DEFAULT_BINTVAL 100/* TU */ #define ATH_DEFAULT_BMISS_LIMIT 10 -#define IEEE80211_MS_TO_TU (x) (((x) * 1000) / 1024)#define TSF_TO_TU (_h,_l) \ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
drivers/net/wireless/ath/ath9k/common.h +2 -0
@@ -44,6 +44,8 @@#define ATH_EP_RND (x, mul) \ (((x) + ((mul)/2)) / (mul)) +#define IEEE80211_MS_TO_TU (x) (((x) * 1000) / 1024) +struct ath_beacon_config {int beacon_interval;u16 dtim_period;
drivers/net/wireless/ath/ath9k/htc.h +0 -1
@@ -39,7 +39,6 @@#define ATH_RESTART_CALINTERVAL 1200000/* 20 minutes */ #define ATH_DEFAULT_BMISS_LIMIT 10 -#define IEEE80211_MS_TO_TU (x) (((x) * 1000) / 1024)#define TSF_TO_TU (_h, _l) \ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
Signature · 1 line
1.9.0
PATCH 12/23 ath9k-common: add nexttbtt and intval to ath_beacon_config
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/common.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath9k/common.h +2 -0
@@ -53,6 +53,8 @@ struct ath_beacon_config {u8 dtim_count;bool enable_beacon;bool ibss_creator; +u32 nexttbtt; +u32 intval; }; bool ath9k_cmn_rx_accept(struct ath_common *common,
Signature · 1 line
1.9.0
PATCH 13/23 ath9k: move ath9k_beacon_config_sta to common-beacon
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/beacon.c | 80 +--------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 126 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 21 +++++ drivers/net/wireless/ath/ath9k/common.h | 1 + 5 files changed, 153 insertions(+), 78 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.c create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.h
drivers/net/wireless/ath/ath9k/Makefile +2 -1
@@ -52,7 +52,8 @@ obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o ath9k_common-y:= common.o \ - common-init.o + common-init.o \ + common-beacon.o ath9k_htc-y += htc_hst.o \ hif_usb.o \
drivers/net/wireless/ath/ath9k/beacon.c +3 -77
97 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/common-beacon.c new file +126 -0
126 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/common-beacon.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Copyright (c) 2009-2011 Atheros Communications Inc. +* +* 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. +*/ + +struct ath_beacon_config ; + +int ath9k_cmn_beacon_config_sta (struct ath_hw *ah, +struct ath_beacon_config *conf, +struct ath9k_beacon_state *bs);
drivers/net/wireless/ath/ath9k/common.h +1 -0
@@ -22,6 +22,7 @@#include "hw-ops.h" #include "common-init.h" +#include "common-beacon.h" /* Common header for Atheros 802.11n base driver cores */
Signature · 1 line
1.9.0
PATCH 14/23 ath9k_htc: use ath9k_cmn_beacon_config_sta
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 84 +------------------------ 1 file changed, 2 insertions(+), 82 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +2 -82
@@ -62,97 +62,17 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) } } -static void ath9k_htc_beacon_config_sta (struct ath9k_htc_priv *priv,struct ath_beacon_config *bss_conf) { -struct ath_common *common =ath9k_hw_common (priv->ah);struct ath9k_beacon_state bs;enum ath9k_int imask =0 ; -int dtimperiod, dtimcount; -int bmiss_timeout; -u32 nexttbtt =0 , intval, tsftu;__be32 htc_imask =0 ; -u64 tsf; -int num_beacons, offset, dtim_dec_count; int ret __attribute__ ((unused));u8 cmd_rsp; -memset (&bs,0 ,sizeof (bs)); - - intval = bss_conf->beacon_interval; - bmiss_timeout = (ATH_DEFAULT_BMISS_LIMIT * bss_conf->beacon_interval); - -/* -* Setup dtim parameters according to -* last beacon we received (which may be none). -*/ - dtimperiod = bss_conf->dtim_period; -if (dtimperiod <=0 )/* NB: 0 if not known */ - dtimperiod =1 ; - dtimcount =1 ; -if (dtimcount >= dtimperiod)/* NB: sanity check */ - dtimcount =0 ; - -/* -* Pull nexttbtt forward to reflect the current -* TSF and calculate dtim state for the result. -*/ - tsf =ath9k_hw_gettsf64 (priv->ah); - tsftu =TSF_TO_TU (tsf>>32 , tsf) +FUDGE ; - - num_beacons = tsftu / intval +1 ; - offset = tsftu % intval; - nexttbtt = tsftu - offset; -if (offset) - nexttbtt += intval; - -/* DTIM Beacon every dtimperiod Beacon */ - dtim_dec_count = num_beacons % dtimperiod; - dtimcount -= dtim_dec_count; -if (dtimcount <0 ) - dtimcount += dtimperiod; - - bs.bs_intval =TU_TO_USEC (intval); - bs.bs_nexttbtt =TU_TO_USEC (nexttbtt); - bs.bs_dtimperiod = dtimperiod * bs.bs_intval; - bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount * bs.bs_intval; - -/* -* Calculate the number of consecutive beacons to miss* before taking -* a BMISS interrupt. The configuration is specified in TU so we only -* need calculate based on the beacon interval. Note that we clamp the -* result to at most 15 beacons. -*/ - bs.bs_bmissthreshold =DIV_ROUND_UP (bmiss_timeout, intval); -if (bs.bs_bmissthreshold >15 ) - bs.bs_bmissthreshold =15 ; -else if (bs.bs_bmissthreshold <=0 ) - bs.bs_bmissthreshold =1 ; - -/* -* Calculate sleep duration. The configuration is given in ms. -* We ensure a multiple of the beacon period is used. Also, if the sleep -* duration is greater than the DTIM period then it makes senses -* to make it a multiple of that. -* -* XXX fixed at 100ms -*/ - - bs.bs_sleepduration =TU_TO_USEC (roundup (IEEE80211_MS_TO_TU (100 ), - intval)); -if (bs.bs_sleepduration > bs.bs_dtimperiod) - bs.bs_sleepduration = bs.bs_dtimperiod; - -/* TSF out of range threshold fixed at 1 second */ - bs.bs_tsfoor_threshold =ATH9K_TSFOOR_THRESHOLD ; - -ath_dbg (common,CONFIG ,"intval: %u tsf: %llu tsftu: %u\n" , - intval, tsf, tsftu); -ath_dbg (common,CONFIG ,"bmiss: %u sleep: %u\n" , - bs.bs_bmissthreshold, bs.bs_sleepduration); - -/* Set the computed STA beacon timers */ +if (ath9k_cmn_beacon_config_sta (priv->ah, bss_conf, &bs) == -EPERM ) +return ;WMI_CMD (WMI_DISABLE_INTR_CMDID );ath9k_hw_set_sta_beacon_timers (priv->ah, &bs);
Signature · 1 line
1.9.0
PATCH 15/23 ath9k: move ath9k_beacon_config_adhoc to common
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/beacon.c | 21 ++------------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 25 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 2 ++ 3 files changed, 29 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +2 -19
@@ -526,29 +526,12 @@ static void ath9k_beacon_config_adhoc(struct ath_softc *sc, {struct ath_hw *ah = sc->sc_ah;struct ath_common *common =ath9k_hw_common (ah); -u32 intval, nexttbtt;ath9k_reset_beacon_status (sc); - intval =TU_TO_USEC (conf->beacon_interval); - -if (conf->ibss_creator) - nexttbtt = intval; -else - nexttbtt =ath9k_get_next_tbtt (sc,ath9k_hw_gettsf64 (ah), - conf->beacon_interval); - -if (conf->enable_beacon) - ah->imask |=ATH9K_INT_SWBA ; -else - ah->imask &= ~ATH9K_INT_SWBA ; - -ath_dbg (common,BEACON , -"IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n" , - (conf->enable_beacon) ?"Enable" :"Disable" , - nexttbtt, intval, conf->beacon_interval); +ath9k_cmn_beacon_config_adhoc (ah, conf); -ath9k_beacon_init (sc, nexttbtt, intval, conf->ibss_creator); +ath9k_beacon_init (sc, conf->nexttbtt, conf->intval, conf->ibss_creator);/* * Set the global 'beacon has been configured' flag for the
drivers/net/wireless/ath/ath9k/common-beacon.c +25 -0
@@ -124,3 +124,28 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,return 0 ; }EXPORT_SYMBOL (ath9k_cmn_beacon_config_sta); + +void ath9k_cmn_beacon_config_adhoc (struct ath_hw *ah, +struct ath_beacon_config *conf) +{ +struct ath_common *common =ath9k_hw_common (ah); + + conf->intval =TU_TO_USEC (conf->beacon_interval); + +if (conf->ibss_creator) + conf->nexttbtt = conf->intval; +else + conf->nexttbtt =ath9k_get_next_tbtt (ah,ath9k_hw_gettsf64 (ah), + conf->beacon_interval); + +if (conf->enable_beacon) + ah->imask |=ATH9K_INT_SWBA ; +else + ah->imask &= ~ATH9K_INT_SWBA ; + +ath_dbg (common,BEACON , +"IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n" , + (conf->enable_beacon) ?"Enable" :"Disable" , + conf->nexttbtt, conf->intval, conf->beacon_interval); +} +EXPORT_SYMBOL (ath9k_cmn_beacon_config_adhoc);
drivers/net/wireless/ath/ath9k/common-beacon.h +2 -0
@@ -19,3 +19,5 @@ struct ath_beacon_config;int ath9k_cmn_beacon_config_sta (struct ath_hw *ah,struct ath_beacon_config *conf,struct ath9k_beacon_state *bs); +void ath9k_cmn_beacon_config_adhoc (struct ath_hw *ah, +struct ath_beacon_config *conf);
Signature · 1 line
1.9.0
PATCH 16/23 ath9k_htc: add ath9k_htc_beacon_init (but not use it)
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +22 -0
@@ -62,6 +62,28 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) } } +/* +* Both nexttbtt and intval have to be in usecs. +*/ +static void ath9k_htc_beacon_init (struct ath9k_htc_priv *priv, +struct ath_beacon_config *conf, +bool reset_tsf) +{ +struct ath_hw *ah = priv->ah; + int ret __attribute__ ((unused)); +__be32 htc_imask =0 ; +u8 cmd_rsp; + +WMI_CMD (WMI_DISABLE_INTR_CMDID ); +if (reset_tsf) +ath9k_hw_reset_tsf (ah); +ath9k_htc_beaconq_config (priv); +ath9k_hw_beaconinit (ah, conf->nexttbtt, conf->intval); + priv->beacon.bmisscnt =0 ; + htc_imask =cpu_to_be32 (ah->imask); +WMI_CMD_BUF (WMI_ENABLE_INTR_CMDID , &htc_imask); +} +static void ath9k_htc_beacon_config_sta (struct ath9k_htc_priv *priv,struct ath_beacon_config *bss_conf) {
Signature · 1 line
1.9.0
PATCH 17/23 ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_ap
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 31 +++++++++---------------- 1 file changed, 11 insertions(+), 20 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +11 -20
@@ -107,22 +107,19 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, struct ath_beacon_config *bss_conf) {struct ath_common *common =ath9k_hw_common (priv->ah); -enum ath9k_int imask =0 ; -u32 nexttbtt, intval, tsftu; -__be32 htc_imask =0 ; +u32 tsftu; int ret __attribute__ ((unused)); -u8 cmd_rsp;u64 tsf; - intval = bss_conf->beacon_interval; - intval /=ATH9K_HTC_MAX_BCN_VIF ; - nexttbtt = intval; + bss_conf->intval = bss_conf->beacon_interval; + bss_conf->intval /=ATH9K_HTC_MAX_BCN_VIF ; + bss_conf->nexttbtt = bss_conf->intval;/* * To reduce beacon misses under heavy TX load, * set the beacon response time to a larger value. */ -if (intval >DEFAULT_SWBA_RESPONSE ) +if (bss_conf->intval >DEFAULT_SWBA_RESPONSE ) priv->ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ;else priv->ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ;
@@ -137,25 +134,19 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, tsf =ath9k_hw_gettsf64 (priv->ah); tsftu =TSF_TO_TU (tsf >>32 , tsf) +FUDGE ;do { - nexttbtt += intval; - }while (nexttbtt < tsftu); + bss_conf->nexttbtt += bss_conf->intval; + }while (bss_conf->nexttbtt < tsftu); }if (bss_conf->enable_beacon) - imask |=ATH9K_INT_SWBA ; + priv->ah->imask =ATH9K_INT_SWBA ;ath_dbg (common,CONFIG ,"AP Beacon config, intval: %d, nexttbtt: %u, resp_time: %d imask: 0x%x\n" , - bss_conf->beacon_interval, nexttbtt, - priv->ah->config.sw_beacon_response_time, imask); + bss_conf->beacon_interval, bss_conf->nexttbtt, + priv->ah->config.sw_beacon_response_time, priv->ah->imask); -ath9k_htc_beaconq_config (priv); - -WMI_CMD (WMI_DISABLE_INTR_CMDID ); -ath9k_hw_beaconinit (priv->ah,TU_TO_USEC (nexttbtt),TU_TO_USEC (intval)); - priv->beacon.bmisscnt =0 ; - htc_imask =cpu_to_be32 (imask); -WMI_CMD_BUF (WMI_ENABLE_INTR_CMDID , &htc_imask); +ath9k_htc_beacon_init (priv, bss_conf, false); } static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
Signature · 1 line
1.9.0
PATCH 18/23 ath9k_htc: use ath9k_htc_beacon_init in ath9k_htc_beacon_config_adhoc
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 31 ++++++++++--------------- 1 file changed, 12 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +12 -19
@@ -152,16 +152,13 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,static void ath9k_htc_beacon_config_adhoc (struct ath9k_htc_priv *priv,struct ath_beacon_config *bss_conf) { -struct ath_common *common =ath9k_hw_common (priv->ah); -enum ath9k_int imask =0 ; -u32 nexttbtt, intval, tsftu; -__be32 htc_imask =0 ; - int ret __attribute__ ((unused)); -u8 cmd_rsp; +struct ath_hw *ah = priv->ah; +struct ath_common *common =ath9k_hw_common (ah); +u32 tsftu;u64 tsf; - intval = bss_conf->beacon_interval; - nexttbtt = intval; + bss_conf->intval = bss_conf->beacon_interval; + bss_conf->nexttbtt = bss_conf->intval;/* * Pull nexttbtt forward to reflect the current TSF.
@@ -169,30 +166,26 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, tsf =ath9k_hw_gettsf64 (priv->ah); tsftu =TSF_TO_TU (tsf >>32 , tsf) +FUDGE ;do { - nexttbtt += intval; - }while (nexttbtt < tsftu); + bss_conf->nexttbtt += bss_conf->intval; + }while (bss_conf->nexttbtt < tsftu);/* * Only one IBSS interfce is allowed. */ -if (intval >DEFAULT_SWBA_RESPONSE ) +if (bss_conf->intval >DEFAULT_SWBA_RESPONSE ) priv->ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ;else priv->ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ;if (bss_conf->enable_beacon) - imask |=ATH9K_INT_SWBA ; + ah->imask =ATH9K_INT_SWBA ;ath_dbg (common,CONFIG ,"IBSS Beacon config, intval: %d, nexttbtt: %u, resp_time: %d, imask: 0x%x\n" , - bss_conf->beacon_interval, nexttbtt, - priv->ah->config.sw_beacon_response_time, imask); + bss_conf->beacon_interval, bss_conf->nexttbtt, + priv->ah->config.sw_beacon_response_time, ah->imask); -WMI_CMD (WMI_DISABLE_INTR_CMDID ); -ath9k_hw_beaconinit (priv->ah,TU_TO_USEC (nexttbtt),TU_TO_USEC (intval)); - priv->beacon.bmisscnt =0 ; - htc_imask =cpu_to_be32 (imask); -WMI_CMD_BUF (WMI_ENABLE_INTR_CMDID , &htc_imask); +ath9k_htc_beacon_init (priv, bss_conf, bss_conf->ibss_creator); } void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
Signature · 1 line
1.9.0
PATCH 19/23 ath9k_htc: use ath9k_cmn_beacon_config_adhoc
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 35 +++++-------------------- 1 file changed, 7 insertions(+), 28 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +7 -28
@@ -150,42 +150,21 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, }static void ath9k_htc_beacon_config_adhoc (struct ath9k_htc_priv *priv, -struct ath_beacon_config *bss_conf) +struct ath_beacon_config *conf) {struct ath_hw *ah = priv->ah; -struct ath_common *common =ath9k_hw_common (ah); -u32 tsftu; -u64 tsf; - - bss_conf->intval = bss_conf->beacon_interval; - bss_conf->nexttbtt = bss_conf->intval; - -/* -* Pull nexttbtt forward to reflect the current TSF. -*/ - tsf =ath9k_hw_gettsf64 (priv->ah); - tsftu =TSF_TO_TU (tsf >>32 , tsf) +FUDGE ; -do { - bss_conf->nexttbtt += bss_conf->intval; - }while (bss_conf->nexttbtt < tsftu); + ah->imask =0 ; +ath9k_cmn_beacon_config_adhoc (ah, conf);/* * Only one IBSS interfce is allowed. */ -if (bss_conf->intval >DEFAULT_SWBA_RESPONSE ) - priv->ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ; +if (conf->intval >=TU_TO_USEC (DEFAULT_SWBA_RESPONSE )) + ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ;else - priv->ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; - -if (bss_conf->enable_beacon) - ah->imask =ATH9K_INT_SWBA ; - -ath_dbg (common,CONFIG , -"IBSS Beacon config, intval: %d, nexttbtt: %u, resp_time: %d, imask: 0x%x\n" , - bss_conf->beacon_interval, bss_conf->nexttbtt, - priv->ah->config.sw_beacon_response_time, ah->imask); + ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; -ath9k_htc_beacon_init (priv, bss_conf, bss_conf->ibss_creator); +ath9k_htc_beacon_init (priv, conf, conf->ibss_creator); } void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
Signature · 1 line
1.9.0
PATCH 20/23 ath9k: move ath9k_beacon_config_ap common
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/beacon.c | 21 ++----------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 29 ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 3 +++ 3 files changed, 34 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +2 -19
@@ -483,26 +483,9 @@ static void ath9k_beacon_config_ap(struct ath_softc *sc, struct ath_beacon_config *conf) {struct ath_hw *ah = sc->sc_ah; -struct ath_common *common =ath9k_hw_common (ah); -u32 nexttbtt, intval; - -/* NB: the beacon interval is kept internally in TU's */ - intval =TU_TO_USEC (conf->beacon_interval); - intval /=ATH_BCBUF ; - nexttbtt =ath9k_get_next_tbtt (sc,ath9k_hw_gettsf64 (ah), - conf->beacon_interval); - -if (conf->enable_beacon) - ah->imask |=ATH9K_INT_SWBA ; -else - ah->imask &= ~ATH9K_INT_SWBA ; - -ath_dbg (common,BEACON , -"AP (%s) nexttbtt: %u intval: %u conf_intval: %u\n" , - (conf->enable_beacon) ?"Enable" :"Disable" , - nexttbtt, intval, conf->beacon_interval); -ath9k_beacon_init (sc, nexttbtt, intval, false); +ath9k_cmn_beacon_config_ap (ah, conf,ATH_BCBUF ); +ath9k_beacon_init (sc, conf->nexttbtt, conf->intval, false); } static void ath9k_beacon_config_sta(struct ath_hw *ah,
drivers/net/wireless/ath/ath9k/common-beacon.c +29 -0
@@ -149,3 +149,32 @@ void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah, conf->nexttbtt, conf->intval, conf->beacon_interval); }EXPORT_SYMBOL (ath9k_cmn_beacon_config_adhoc); + +/* +* For multi-bss ap support beacons are either staggered evenly over N slots or +* burst together. For the former arrange for the SWBA to be delivered for each +* slot. Slots that are not occupied will generate nothing. +*/ +void ath9k_cmn_beacon_config_ap (struct ath_hw *ah, +struct ath_beacon_config *conf, +unsigned int bc_buf) +{ +struct ath_common *common =ath9k_hw_common (ah); + +/* NB: the beacon interval is kept internally in TU's */ + conf->intval =TU_TO_USEC (conf->beacon_interval); + conf->intval /= bc_buf; + conf->nexttbtt =ath9k_get_next_tbtt (ah,ath9k_hw_gettsf64 (ah), + conf->beacon_interval); + +if (conf->enable_beacon) + ah->imask |=ATH9K_INT_SWBA ; +else + ah->imask &= ~ATH9K_INT_SWBA ; + +ath_dbg (common,BEACON , +"AP (%s) nexttbtt: %u intval: %u conf_intval: %u\n" , + (conf->enable_beacon) ?"Enable" :"Disable" , + conf->nexttbtt, conf->intval, conf->beacon_interval); +} +EXPORT_SYMBOL (ath9k_cmn_beacon_config_ap);
drivers/net/wireless/ath/ath9k/common-beacon.h +3 -0
@@ -21,3 +21,6 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, struct ath9k_beacon_state *bs);void ath9k_cmn_beacon_config_adhoc (struct ath_hw *ah,struct ath_beacon_config *conf); +void ath9k_cmn_beacon_config_ap (struct ath_hw *ah, +struct ath_beacon_config *conf, +unsigned int bc_buf);
Signature · 1 line
1.9.0
PATCH 21/23 ath9k: remove unused ath9k_get_next_tbtt
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/beacon.c | 27 --------------------------- 1 file changed, 27 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +0 -27
@@ -447,33 +447,6 @@ static void ath9k_beacon_init(struct ath_softc *sc, u32 nexttbtt,ath9k_hw_enable_interrupts (ah); } -/* Calculate the modulo of a 64 bit TSF snapshot with a TU divisor */ -static u32 ath9k_mod_tsf64_tu (u64 tsf,u32 div_tu) -{ -u32 tsf_mod, tsf_hi, tsf_lo, mod_hi, mod_lo; - - tsf_mod = tsf & (BIT (10 ) -1 ); - tsf_hi = tsf >>32 ; - tsf_lo = ((u32 ) tsf) >>10 ; - - mod_hi = tsf_hi % div_tu; - mod_lo = ((mod_hi <<22 ) + tsf_lo) % div_tu; - -return (mod_lo <<10 ) | tsf_mod; -} - -static u32 ath9k_get_next_tbtt (struct ath_softc *sc,u64 tsf, -unsigned int interval) -{ -struct ath_hw *ah = sc->sc_ah; -unsigned int offset; - - tsf +=TU_TO_USEC (FUDGE + ah->config.sw_beacon_response_time); - offset =ath9k_mod_tsf64_tu (tsf, interval); - -return (u32 ) tsf +TU_TO_USEC (interval) - offset; -} -/* * For multi-bss ap support beacons are either staggered evenly over N slots or * burst together. For the former arrange for the SWBA to be delivered for each
Signature · 1 line
1.9.0
PATCH 22/23 ath9k_htc: use ath9k_cmn_beacon_config_ap
In reply to Oleksij Rempel--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 43 +++++-------------------- 1 file changed, 8 insertions(+), 35 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +8 -35
@@ -104,49 +104,22 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, }static void ath9k_htc_beacon_config_ap (struct ath9k_htc_priv *priv, -struct ath_beacon_config *bss_conf) +struct ath_beacon_config *conf) { -struct ath_common *common =ath9k_hw_common (priv->ah); -u32 tsftu; - int ret __attribute__ ((unused)); -u64 tsf; - - bss_conf->intval = bss_conf->beacon_interval; - bss_conf->intval /=ATH9K_HTC_MAX_BCN_VIF ; - bss_conf->nexttbtt = bss_conf->intval; +struct ath_hw *ah = priv->ah; + ah->imask =0 ; +ath9k_cmn_beacon_config_ap (ah, conf,ATH9K_HTC_MAX_BCN_VIF );/* * To reduce beacon misses under heavy TX load, * set the beacon response time to a larger value. */ -if (bss_conf->intval >DEFAULT_SWBA_RESPONSE ) - priv->ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ; +if (conf->intval >=TU_TO_USEC (DEFAULT_SWBA_RESPONSE )) + ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ;else - priv->ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; - -if (test_bit (OP_TSF_RESET , &priv->op_flags)) { -ath9k_hw_reset_tsf (priv->ah); -clear_bit (OP_TSF_RESET , &priv->op_flags); - }else { -/* -* Pull nexttbtt forward to reflect the current TSF. -*/ - tsf =ath9k_hw_gettsf64 (priv->ah); - tsftu =TSF_TO_TU (tsf >>32 , tsf) +FUDGE ; -do { - bss_conf->nexttbtt += bss_conf->intval; - }while (bss_conf->nexttbtt < tsftu); - } - -if (bss_conf->enable_beacon) - priv->ah->imask =ATH9K_INT_SWBA ; - -ath_dbg (common,CONFIG , -"AP Beacon config, intval: %d, nexttbtt: %u, resp_time: %d imask: 0x%x\n" , - bss_conf->beacon_interval, bss_conf->nexttbtt, - priv->ah->config.sw_beacon_response_time, priv->ah->imask); + ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; -ath9k_htc_beacon_init (priv, bss_conf, false); +ath9k_htc_beacon_init (priv, conf, false); } static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
Signature · 1 line
1.9.0
PATCH 23/23 ath9k_htc: move DEFAULT_SWBA_RESPONSE check to ath9k_htc_beacon_init
In reply to Oleksij Rempel... to remove some more dups.
--- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +5 -17
@@ -74,6 +74,11 @@ static void ath9k_htc_beacon_init(struct ath9k_htc_priv *priv,__be32 htc_imask =0 ;u8 cmd_rsp; +if (conf->intval >=TU_TO_USEC (DEFAULT_SWBA_RESPONSE )) + ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ; +else + ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; +WMI_CMD (WMI_DISABLE_INTR_CMDID );if (reset_tsf)ath9k_hw_reset_tsf (ah);
@@ -110,15 +115,6 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, ah->imask =0 ;ath9k_cmn_beacon_config_ap (ah, conf,ATH9K_HTC_MAX_BCN_VIF ); -/* -* To reduce beacon misses under heavy TX load, -* set the beacon response time to a larger value. -*/ -if (conf->intval >=TU_TO_USEC (DEFAULT_SWBA_RESPONSE )) - ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ; -else - ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; -ath9k_htc_beacon_init (priv, conf, false); }
@@ -129,14 +125,6 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, ah->imask =0 ;ath9k_cmn_beacon_config_adhoc (ah, conf); -/* -* Only one IBSS interfce is allowed. -*/ -if (conf->intval >=TU_TO_USEC (DEFAULT_SWBA_RESPONSE )) - ah->config.sw_beacon_response_time =DEFAULT_SWBA_RESPONSE ; -else - ah->config.sw_beacon_response_time =MIN_SWBA_RESPONSE ; -ath9k_htc_beacon_init (priv, conf, conf->ibss_creator); }
Signature · 1 line
1.9.0
Hi,
Lots of code churn. :)
Maybe reusing ath9k entirely and just writing a USB layer can be a better approach ?
Sujith
Quoted 54 lines · Oleksij Rempel
Next patch set. It removes only easy duplicats of beacon code. Other parts of need deeper rework to make it compatible with ath9k.
Oleksij Rempel (23):
ath9k: move structath_beacon_configto common
ath9k_htc: use commonath_beacon_config
ath9k_htc: move beaconq to structhtc_beacon
ath9k_htc: use ath_beacon_conf.enable_beacon
ath9k: movesc_flagstoath_common
ath9k_htc: usecommon->op_flags
ath9k_htc: addATH_OP_PRIM_STA_VIF
ath9k: remove unusedbc_tstamp
ath9k_htc: sync beacon slot code with ath9k
ath9k: remove unusedbeacon_qi
ath9k|ath9k_htc: moveIEEE80211_MS_TO_TUto common
ath9k-common: add nexttbtt and intval toath_beacon_config
ath9k: moveath9k_beacon_config_stato common-beacon
ath9k_htc: useath9k_cmn_beacon_config_sta
ath9k: moveath9k_beacon_config_adhocto common
ath9k_htc: addath9k_htc_beacon_init(but not use it)
ath9k_htc: useath9k_htc_beacon_initinath9k_htc_beacon_config_ap
ath9k_htc: useath9k_htc_beacon_initinath9k_htc_beacon_config_adhoc
ath9k_htc: useath9k_cmn_beacon_config_adhoc
ath9k: moveath9k_beacon_config_apcommon
ath9k: remove unusedath9k_get_next_tbtt
ath9k_htc: useath9k_cmn_beacon_config_ap
ath9k_htc: moveDEFAULT_SWBA_RESPONSEcheck toath9k_htc_beacon_initdrivers/net/wireless/ath/ath.h | 10 + drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ahb.c | 7 +- drivers/net/wireless/ath/ath9k/ath9k.h | 22 --- drivers/net/wireless/ath/ath9k/beacon.c | 165 ++-------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 180 +++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 26 +++ drivers/net/wireless/ath/ath9k/common.h | 14 ++ drivers/net/wireless/ath/ath9k/debug.c | 2 +- drivers/net/wireless/ath/ath9k/htc.h | 25 +-- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 252 ++++++------------------ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 10 +- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 53 +++-- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 3 +- drivers/net/wireless/ath/ath9k/link.c | 16 +- drivers/net/wireless/ath/ath9k/main.c | 45 +++-- drivers/net/wireless/ath/ath9k/mci.c | 2 +- drivers/net/wireless/ath/ath9k/pci.c | 8 +- drivers/net/wireless/ath/ath9k/xmit.c | 9 +- 19 files changed, 413 insertions(+), 439 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.c create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.hSignature · 1 line
1.9.0
cover ath9k|ath9k_htc: move dups to common-beacon
Am 02.03.2014 03:14, schrieb Sujith Manoharan:
Quoted 6 lines
Hi,
Lots of code churn. :)
Maybe reusing ath9k entirely and just writing a USB layer can be a better approach ?
I was thinking about it too, but suddenly i don't have enough time and experience to do it. Beside, there is no need to write usb layer. It is clean and separate from other part of the driver. But the HTC/WMI interface is not completely separate.
In this case ath9k driver will need some rework too. For example beacon.c code works directly with DMA queues, see "struct ath_beacon". May be it is still better to add needed changes in ath9k by keeping ath9k_htc functional.
Now about bigger picture. Right now i work only on ath9k<>ath9k_htc dups. But there are lots of dup code in ath9k itself. For example *_phy.c, *_initvals.h. Here are some examples:
[-] 281 lines matched in 2 locations
ath/ath9k/ar9002_initvals.h(954)
ath/ath9k/ar9002_initvals.h(2486)
[-] 214 lines matched in 2 locations
ath/ath9k/ar9565_1p0_initvals.h(495)
ath/ath9k/ar9565_1p0_initvals.h(775)
[-] 164 lines matched in 2 locations
ath/ath10k/wmi.h(1205)
ath/ath10k/wmi.h(1390)
[-] 163 lines matched in 5 locations
ath/ath9k/ar9003_eeprom.c(462)
ath/ath9k/ar9003_eeprom.c(1040)
ath/ath9k/ar9003_eeprom.c(1619)
ath/ath9k/ar9003_eeprom.c(2198)
ath/ath9k/ar9003_eeprom.c(2776)
[-] 132 lines matched in 2 locations
ath/ath9k/ar9462_2p0_initvals.h(809)
ath/ath9k/ar9462_2p1_initvals.h(63)
[-] 129 lines matched in 2 locations
ath/ath9k/ar9002_phy.c(291)
ath/ath9k/ar5008_phy.c(327)
[-] 79 lines matched in 2 locations
ath/ath6kl/target.h(220)
ath/ath10k/targaddrs.h(107)
[-] 41 lines matched in 2 locations
ath/ath9k/ar9003_phy.c(889)
ath/ath9k/ar5008_phy.c(818)
[-] 36 lines matched in 2 locations
ath/ath9k/eeprom.c(191)
ath/ath9k/eeprom.c(245)
[-] 28 lines matched in 2 locations
ath/ath9k/init.c(246)
ath/ath9k/init.c(277)
[-] 28 lines matched in 2 locations
ath/ath9k/eeprom_4k.c(498)
ath/ath9k/eeprom_def.c(1030)
[-] 26 lines matched in 2 locations
ath/ath9k/ar9003_phy.c(1338)
ath/ath9k/ar5008_phy.c(1257)
[-] 23 lines matched in 3 locations
ath/ath9k/eeprom_4k.c(248)
ath/ath9k/eeprom_def.c(324)
ath/ath9k/eeprom_9287.c(235)
[-] 23 lines matched in 2 locations
ath/ath9k/htc_drv_debug.c(465)
ath/ath9k/debug.c(103)and so on...
If some one can take care of it, it will be great :)
The programm i use (scitools Understand), found 14851 lines of Duplicated code in wireless/ath. Probably there are some false positive and code which was not found because of some cosmetic changes.
I assume that usb code can be reused can be same on ar5523, carl9170, ath9k_htc. And some WMI code at least on ath10k and ath9k_htc.
Quoted 57 lines
Sujith
Quoted 54 lines · Oleksij Rempel
Next patch set. It removes only easy duplicats of beacon code. Other parts of need deeper rework to make it compatible with ath9k.
Oleksij Rempel (23):
ath9k: move structath_beacon_configto common
ath9k_htc: use commonath_beacon_config
ath9k_htc: move beaconq to structhtc_beacon
ath9k_htc: use ath_beacon_conf.enable_beacon
ath9k: movesc_flagstoath_common
ath9k_htc: usecommon->op_flags
ath9k_htc: addATH_OP_PRIM_STA_VIF
ath9k: remove unusedbc_tstamp
ath9k_htc: sync beacon slot code with ath9k
ath9k: remove unusedbeacon_qi
ath9k|ath9k_htc: moveIEEE80211_MS_TO_TUto common
ath9k-common: add nexttbtt and intval toath_beacon_config
ath9k: moveath9k_beacon_config_stato common-beacon
ath9k_htc: useath9k_cmn_beacon_config_sta
ath9k: moveath9k_beacon_config_adhocto common
ath9k_htc: addath9k_htc_beacon_init(but not use it)
ath9k_htc: useath9k_htc_beacon_initinath9k_htc_beacon_config_ap
ath9k_htc: useath9k_htc_beacon_initinath9k_htc_beacon_config_adhoc
ath9k_htc: useath9k_cmn_beacon_config_adhoc
ath9k: moveath9k_beacon_config_apcommon
ath9k: remove unusedath9k_get_next_tbtt
ath9k_htc: useath9k_cmn_beacon_config_ap
ath9k_htc: moveDEFAULT_SWBA_RESPONSEcheck toath9k_htc_beacon_initdrivers/net/wireless/ath/ath.h | 10 + drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ahb.c | 7 +- drivers/net/wireless/ath/ath9k/ath9k.h | 22 --- drivers/net/wireless/ath/ath9k/beacon.c | 165 ++-------------- drivers/net/wireless/ath/ath9k/common-beacon.c | 180 +++++++++++++++++ drivers/net/wireless/ath/ath9k/common-beacon.h | 26 +++ drivers/net/wireless/ath/ath9k/common.h | 14 ++ drivers/net/wireless/ath/ath9k/debug.c | 2 +- drivers/net/wireless/ath/ath9k/htc.h | 25 +-- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 252 ++++++------------------ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 10 +- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 53 +++-- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 3 +- drivers/net/wireless/ath/ath9k/link.c | 16 +- drivers/net/wireless/ath/ath9k/main.c | 45 +++-- drivers/net/wireless/ath/ath9k/mci.c | 2 +- drivers/net/wireless/ath/ath9k/pci.c | 8 +- drivers/net/wireless/ath/ath9k/xmit.c | 9 +- 19 files changed, 413 insertions(+), 439 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.c create mode 100644 drivers/net/wireless/ath/ath9k/common-beacon.hSignature · 1 line
1.9.0
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140302/f86c0024/attachment.pgp
cover ath9k|ath9k_htc: move dups to common-beacon
Quoted 4 lines · Oleksij Rempel
I was thinking about it too, but suddenly i don't have enough time and experience to do it. Beside, there is no need to write usb layer. It is clean and separate from other part of the driver. But the HTC/WMI interface is not completely separate.
Sure. It is just another option to consider.
Quoted 3 lines
Now about bigger picture. Right now i work only on ath9k<>ath9k_htc dups. But there are lots of dup code in ath9k itself. For example *_phy.c, *_initvals.h. Here are some examples:
We already have duplicate detection for initvals. It is part of the initvals tool in qca-swiss-army-knife.
Sujith
cover ath9k|ath9k_htc: move dups to common-beacon
Quoted 6 lines · Sujith Manoharan
Quoted 4 lines · Oleksij Rempel
I was thinking about it too, but suddenly i don't have enough time and experience to do it. Beside, there is no need to write usb layer. It is clean and separate from other part of the driver. But the HTC/WMI interface is not completely separate.
Quoted 8 lines
Sure. It is just another option to consider.
Quoted 3 lines
Now about bigger picture. Right now i work only on ath9k<>ath9k_htc dups. But there are lots of dup code in ath9k itself. For example *_phy.c, *_initvals.h. Here are some examples:
We already have duplicate detection for initvals. It is part of the initvals tool in qca-swiss-army-knife.
So, where does this leave us? Should this series be merged? Or not?
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.
cover ath9k|ath9k_htc: move dups to common-beacon
Am 06.03.2014 19:42, schrieb John W. Linville:
Quoted 9 lines · Sujith Manoharan
Quoted 8 lines
Quoted 4 lines · Oleksij Rempel
I was thinking about it too, but suddenly i don't have enough time and experience to do it. Beside, there is no need to write usb layer. It is clean and separate from other part of the driver. But the HTC/WMI interface is not completely separate.
Sure. It is just another option to consider.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Now about bigger picture. Right now i work only on ath9k<>ath9k_htc dups. But there are lots of dup code in ath9k itself. For example *_phy.c, *_initvals.h. Here are some examples:
We already have duplicate detection for initvals. It is part of the initvals tool in qca-swiss-army-knife.
So, where does this leave us? Should this series be merged? Or not?
Last response was about initvals, my patch set affect only beacon code. Since i don't plan to rewrite ath9k_htc from scratch, i would assume it will be better to continue this periodic clean work.
Sujith, are you agree? :) We need your Ack for this patch set.
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140307/5cd7dc56/attachment.pgp
cover ath9k|ath9k_htc: move dups to common-beacon
Quoted 3 lines · Oleksij Rempel
Last response was about initvals, my patch set affect only beacon code. Since i don't plan to rewrite
ath9k_htcfrom scratch, i would assume it will be better to continue this periodic clean work.
I didn't review the patches, but someone else needs to make sure that nothing is broken in ath9k.
Sujith
cover ath9k|ath9k_htc: move dups to common-beacon
Am 07.03.2014 11:18, schrieb Sujith Manoharan:
Quoted 7 lines
Quoted 3 lines · Oleksij Rempel
Last response was about initvals, my patch set affect only beacon code. Since i don't plan to rewrite
ath9k_htcfrom scratch, i would assume it will be better to continue this periodic clean work.I didn't review the patches, but someone else needs to make sure that nothing is broken in ath9k.
I use this code one week ind STA mode. But if you need more directed alternate testing, who is good candidate for this work?
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140310/eefb87b1/attachment.pgp
cover ath9k|ath9k_htc: move dups to common-beacon
Quoted 11 lines · Oleksij Rempel
Am 07.03.2014 11:18, schrieb Sujith Manoharan:
Quoted 7 lines
Quoted 3 lines · Oleksij Rempel
Last response was about initvals, my patch set affect only beacon code. Since i don't plan to rewrite
ath9k_htcfrom scratch, i would assume it will be better to continue this periodic clean work.I didn't review the patches, but someone else needs to make sure that nothing is broken in ath9k.
I use this code one week ind STA mode. But if you need more directed alternate testing, who is good candidate for this work?
I applied the series and attempted a build. But...
CC drivers/net/wireless/ath/ath9k/tx99.o
In file included from include/linux/bitops.h:33:0,
from include/linux/kernel.h:10,
from include/linux/skbuff.h:17,
from include/linux/if_ether.h:23,
from include/linux/etherdevice.h:25,
from drivers/net/wireless/ath/ath9k/ath9k.h:20,
from drivers/net/wireless/ath/ath9k/tx99.c:17:
drivers/net/wireless/ath/ath9k/tx99.c: In function ?ath9k_tx99_init?:
drivers/net/wireless/ath/ath9k/tx99.c:111:15: error: ?SC_OP_INVALID? undeclared (first use in this function)
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
^
/home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:338:25: note: in definition of macro ?test_bit?
(__builtin_constant_p((nr)) \
^
drivers/net/wireless/ath/ath9k/tx99.c:111:15: note: each undeclared identifier is reported only once for each function it appears in
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
^
/home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:338:25: note: in definition of macro ?test_bit?
(__builtin_constant_p((nr)) \
^
drivers/net/wireless/ath/ath9k/tx99.c:111:33: error: ?struct ath_softc? has no member named ?sc_flags?
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
^
/home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:339:30: note: in definition of macro ?test_bit?
? constant_test_bit((nr), (addr)) \
^
drivers/net/wireless/ath/ath9k/tx99.c:111:33: error: ?struct ath_softc? has no member named ?sc_flags?
if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
^
/home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:340:30: note: in definition of macro ?test_bit?
: variable_test_bit((nr), (addr)))
^make[3]: *** [drivers/net/wireless/ath/ath9k/tx99.o] Error 1 make[2]: *** [drivers/net/wireless/ath/ath9k] Error 2 make[1]: *** [drivers/net/wireless/ath] Error 2
make: *** [drivers/net/wireless/] Error 2
I'll be backing this out for now...
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.
cover ath9k|ath9k_htc: move dups to common-beacon
Am 14.03.2014 20:22, schrieb John W. Linville:
Quoted 48 lines · Oleksij Rempel
Quoted 11 lines
Am 07.03.2014 11:18, schrieb Sujith Manoharan:
Quoted 7 lines
Quoted 3 lines · Oleksij Rempel
Last response was about initvals, my patch set affect only beacon code. Since i don't plan to rewrite
ath9k_htcfrom scratch, i would assume it will be better to continue this periodic clean work.I didn't review the patches, but someone else needs to make sure that nothing is broken in ath9k.
I use this code one week ind STA mode. But if you need more directed alternate testing, who is good candidate for this work?
I applied the series and attempted a build. But...
CC
drivers/net/wireless/ath/ath9k/tx99.o
In file included frominclude/linux/bitops.h:33:0,from include/linux/kernel.h:10, from include/linux/skbuff.h:17, from include/linux/if_ether.h:23, from include/linux/etherdevice.h:25, from drivers/net/wireless/ath/ath9k/ath9k.h:20, from drivers/net/wireless/ath/ath9k/tx99.c:17: drivers/net/wireless/ath/ath9k/tx99.c: In function ?ath9k_tx99_init?: drivers/net/wireless/ath/ath9k/tx99.c:111:15: error: ?SC_OP_INVALID? undeclared (first use in this function) if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { ^ /home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:338:25: note: in definition of macro ?test_bit? (__builtin_constant_p((nr)) \ ^ drivers/net/wireless/ath/ath9k/tx99.c:111:15: note: each undeclared identifier is reported only once for each function it appears in if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { ^ /home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:338:25: note: in definition of macro ?test_bit? (__builtin_constant_p((nr)) \ ^ drivers/net/wireless/ath/ath9k/tx99.c:111:33: error: ?struct ath_softc? has no member named ?sc_flags? if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { ^ /home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:339:30: note: in definition of macro ?test_bit? ? constant_test_bit((nr), (addr)) \ ^ drivers/net/wireless/ath/ath9k/tx99.c:111:33: error: ?struct ath_softc? has no member named ?sc_flags? if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { ^ /home/linville/git/wireless-next/arch/x86/include/asm/bitops.h:340:30: note: in definition of macro ?test_bit? : variable_test_bit((nr), (addr))) ^
Quoted 6 lines
make[3]: *** [
drivers/net/wireless/ath/ath9k/tx99.o] Error 1 make[2]: *** [drivers/net/wireless/ath/ath9k] Error 2 make[1]: *** [drivers/net/wireless/ath] Error 2
make: *** [drivers/net/wireless/] Error 2I'll be backing this out for now...
thank you. I missed CONFIG_EXPERT :/
in attachment is second version of affected patch.
Signature · 9 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-ath9k-move-sc_flags-to-ath_common.patch Type: text/x-patch Size: 20132 bytes Desc: not available Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140315/18cd76cb/attachment-0001.bin