Commit 935477ed authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath9k_hw: make support for PC-OEM cards optional



The initvals use up quite a bit of space, and PC-OEM support is
typically not needed on embedded systems

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6424b036
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ config ATH9K_CHANNEL_CONTEXT
	 for multi-channel concurrency. Enable this if P2P PowerSave support
	 is required.

config ATH9K_PCOEM
	bool "Atheros ath9k support for PC OEM cards" if EXPERT
	depends on ATH9K
	default y

config ATH9K_HTC
       tristate "Atheros HTC based wireless cards support"
       depends on USB && MAC80211
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ ath9k_hw-y:= \
		ar5008_phy.o \
		ar9002_calib.o \
		ar9003_calib.o \
		ar9003_rtt.o \
		calib.o \
		eeprom.o \
		eeprom_def.o \
@@ -50,6 +49,8 @@ ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o
ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
					   ar9003_mci.o

ath9k_hw-$(CONFIG_ATH9K_PCOEM) += ar9003_rtt.o

ath9k_hw-$(CONFIG_ATH9K_DYNACK) += dynack.o

obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o
+36 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#ifndef AR9003_RTT_H
#define AR9003_RTT_H

#ifdef CONFIG_ATH9K_PCOEM
void ar9003_hw_rtt_enable(struct ath_hw *ah);
void ar9003_hw_rtt_disable(struct ath_hw *ah);
void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask);
@@ -25,5 +26,40 @@ void ar9003_hw_rtt_load_hist(struct ath_hw *ah);
void ar9003_hw_rtt_fill_hist(struct ath_hw *ah);
void ar9003_hw_rtt_clear_hist(struct ath_hw *ah);
bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan);
#else
static inline void ar9003_hw_rtt_enable(struct ath_hw *ah)
{
}

static inline void ar9003_hw_rtt_disable(struct ath_hw *ah)
{
}

static inline void ar9003_hw_rtt_set_mask(struct ath_hw *ah, u32 rtt_mask)
{
}

static inline bool ar9003_hw_rtt_force_restore(struct ath_hw *ah)
{
	return false;
}

static inline void ar9003_hw_rtt_load_hist(struct ath_hw *ah)
{
}

static inline void ar9003_hw_rtt_fill_hist(struct ath_hw *ah)
{
}

static inline void ar9003_hw_rtt_clear_hist(struct ath_hw *ah)
{
}

static inline bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan)
{
	return false;
}
#endif

#endif
+12 −5
Original line number Diff line number Diff line
@@ -244,13 +244,20 @@ enum ath9k_hw_caps {
	ATH9K_HW_CAP_2GHZ			= BIT(11),
	ATH9K_HW_CAP_5GHZ			= BIT(12),
	ATH9K_HW_CAP_APM			= BIT(13),
#ifdef CONFIG_ATH9K_PCOEM
	ATH9K_HW_CAP_RTT			= BIT(14),
	ATH9K_HW_CAP_MCI			= BIT(15),
	ATH9K_HW_CAP_DFS			= BIT(16),
	ATH9K_HW_WOW_DEVICE_CAPABLE		= BIT(17),
	ATH9K_HW_CAP_PAPRD			= BIT(18),
	ATH9K_HW_CAP_FCC_BAND_SWITCH		= BIT(19),
	ATH9K_HW_CAP_BT_ANT_DIV			= BIT(20),
	ATH9K_HW_WOW_DEVICE_CAPABLE		= BIT(16),
	ATH9K_HW_CAP_BT_ANT_DIV			= BIT(17),
#else
	ATH9K_HW_CAP_RTT			= 0,
	ATH9K_HW_CAP_MCI			= 0,
	ATH9K_HW_WOW_DEVICE_CAPABLE		= 0,
	ATH9K_HW_CAP_BT_ANT_DIV			= 0,
#endif
	ATH9K_HW_CAP_DFS			= BIT(18),
	ATH9K_HW_CAP_PAPRD			= BIT(19),
	ATH9K_HW_CAP_FCC_BAND_SWITCH		= BIT(20),
};

/*
+3 −0
Original line number Diff line number Diff line
@@ -362,6 +362,9 @@ static void ath9k_init_pcoem_platform(struct ath_softc *sc)
	struct ath9k_hw_capabilities *pCap = &ah->caps;
	struct ath_common *common = ath9k_hw_common(ah);

	if (!IS_ENABLED(CONFIG_ATH9K_PCOEM))
		return;

	if (common->bus_ops->ath_bus_type != ATH_PCI)
		return;

Loading