2010-02-09 16:27:35 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/init.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
2010-04-14 00:09:26 +00:00
|
|
|
@@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
#include <linux/slab.h>
|
2010-02-09 16:27:35 +00:00
|
|
|
|
|
|
|
+#include "linux/ath9k_platform.h"
|
|
|
|
#include "ath9k.h"
|
|
|
|
|
|
|
|
static char *dev_info = "ath9k";
|
2010-09-14 22:53:54 +00:00
|
|
|
@@ -555,6 +556,8 @@ static int ath9k_init_softc(u16 devid, s
|
2010-02-09 16:27:35 +00:00
|
|
|
pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
|
|
|
|
if (!pdata)
|
|
|
|
ah->ah_flags |= AH_USE_EEPROM;
|
|
|
|
+ else
|
|
|
|
+ sc->quirk_wndr3700 = pdata->quirk_wndr3700;
|
|
|
|
|
|
|
|
common = ath9k_hw_common(ah);
|
|
|
|
common->ops = &ath9k_common_ops;
|
2010-09-29 13:13:16 +00:00
|
|
|
@@ -680,6 +683,24 @@ void ath9k_set_hw_capab(struct ath_softc
|
2010-02-09 16:27:35 +00:00
|
|
|
SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_ATHEROS_AR71XX
|
|
|
|
+static void wndr3700_init_antenna(struct ath_hw *ah)
|
|
|
|
+{
|
|
|
|
+ ath9k_hw_cfg_output(ah, 6, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
|
+ ath9k_hw_cfg_output(ah, 7, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
|
+ ath9k_hw_cfg_output(ah, 8, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
|
+ ath9k_hw_cfg_output(ah, 9, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
|
+
|
|
|
|
+ /* select the first antenna group */
|
|
|
|
+ ath9k_hw_set_gpio(ah, 6, 0);
|
|
|
|
+ ath9k_hw_set_gpio(ah, 7, 1);
|
|
|
|
+ ath9k_hw_set_gpio(ah, 8, 0);
|
|
|
|
+ ath9k_hw_set_gpio(ah, 9, 1);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static inline void wndr3700_init_antenna(struct ath_hw *ah) {}
|
|
|
|
+#endif /* CONFIG_ATHEROS_AR71XX */
|
|
|
|
+
|
|
|
|
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
|
|
|
|
const struct ath_bus_ops *bus_ops)
|
|
|
|
{
|
2010-09-29 13:13:16 +00:00
|
|
|
@@ -698,6 +719,9 @@ int ath9k_init_device(u16 devid, struct
|
2010-02-09 16:27:35 +00:00
|
|
|
common = ath9k_hw_common(ah);
|
|
|
|
ath9k_set_hw_capab(sc, hw);
|
|
|
|
|
|
|
|
+ if (sc->quirk_wndr3700)
|
|
|
|
+ wndr3700_init_antenna(ah);
|
|
|
|
+
|
|
|
|
/* Initialize regulatory */
|
|
|
|
error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
|
|
|
|
ath9k_reg_notifier);
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
2010-09-29 13:13:16 +00:00
|
|
|
@@ -641,6 +641,8 @@ struct ath_softc {
|
2010-02-09 16:27:35 +00:00
|
|
|
|
2010-04-10 16:50:15 +00:00
|
|
|
int beacon_interval;
|
|
|
|
|
|
|
|
+ bool quirk_wndr3700;
|
|
|
|
+
|
|
|
|
#ifdef CONFIG_ATH9K_DEBUGFS
|
|
|
|
struct ath9k_debug debug;
|
|
|
|
#endif
|
2010-02-09 16:27:35 +00:00
|
|
|
--- a/include/linux/ath9k_platform.h
|
|
|
|
+++ b/include/linux/ath9k_platform.h
|
|
|
|
@@ -24,6 +24,8 @@
|
|
|
|
struct ath9k_platform_data {
|
|
|
|
u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
|
|
|
|
u8 *macaddr;
|
|
|
|
+
|
2010-04-10 16:50:15 +00:00
|
|
|
+ bool quirk_wndr3700;
|
2010-02-09 16:27:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _LINUX_ATH9K_PLATFORM_H */
|