1 --- a/drivers/net/wireless/ath/ath9k/init.c
2 +++ b/drivers/net/wireless/ath/ath9k/init.c
4 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7 +#include "linux/ath9k_platform.h"
10 static char *dev_info = "ath9k";
11 @@ -546,6 +547,8 @@ static int ath9k_init_softc(u16 devid, s
12 pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
14 ah->ah_flags |= AH_USE_EEPROM;
16 + sc->quirk_wndr3700 = pdata->quirk_wndr3700;
18 common = ath9k_hw_common(ah);
19 common->ops = &ath9k_common_ops;
20 @@ -671,6 +674,24 @@ void ath9k_set_hw_capab(struct ath_softc
21 SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
24 +#ifdef CONFIG_ATHEROS_AR71XX
25 +static void wndr3700_init_antenna(struct ath_hw *ah)
27 + ath9k_hw_cfg_output(ah, 6, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
28 + ath9k_hw_cfg_output(ah, 7, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
29 + ath9k_hw_cfg_output(ah, 8, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
30 + ath9k_hw_cfg_output(ah, 9, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
32 + /* select the first antenna group */
33 + ath9k_hw_set_gpio(ah, 6, 0);
34 + ath9k_hw_set_gpio(ah, 7, 1);
35 + ath9k_hw_set_gpio(ah, 8, 0);
36 + ath9k_hw_set_gpio(ah, 9, 1);
39 +static inline void wndr3700_init_antenna(struct ath_hw *ah) {}
40 +#endif /* CONFIG_ATHEROS_AR71XX */
42 int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
43 const struct ath_bus_ops *bus_ops)
45 @@ -689,6 +710,9 @@ int ath9k_init_device(u16 devid, struct
46 common = ath9k_hw_common(ah);
47 ath9k_set_hw_capab(sc, hw);
49 + if (sc->quirk_wndr3700)
50 + wndr3700_init_antenna(ah);
52 /* Initialize regulatory */
53 error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
55 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
56 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
57 @@ -511,6 +511,8 @@ struct ath_softc {
58 struct ath_beacon_config cur_beacon_conf;
59 struct delayed_work tx_complete_work;
60 struct ath_btcoex btcoex;
62 + unsigned long quirk_wndr3700:1;
66 --- a/include/linux/ath9k_platform.h
67 +++ b/include/linux/ath9k_platform.h
69 struct ath9k_platform_data {
70 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
73 + unsigned long quirk_wndr3700:1;
76 #endif /* _LINUX_ATH9K_PLATFORM_H */