Commit eefa01dd authored by Oleksij Rempel's avatar Oleksij Rempel Committed by John W. Linville
Browse files

ath9k: move sc_flags to ath_common



we will need it for ath9k_htc, may be other drivers too

Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 88a4f56e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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;

+4 −3
Original line number Diff line number Diff line
@@ -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:
+0 −10
Original line number Diff line number Diff line
@@ -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;
+10 −8
Original line number Diff line number Diff line
@@ -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);
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,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);
Loading