Root/
Source at commit 99c6c73 created 13 years 10 months ago. By Lars-Peter Clausen, reset to backfire. | |
---|---|
1 | --- a/drivers/net/wireless/ath/ath9k/init.c |
2 | +++ b/drivers/net/wireless/ath/ath9k/init.c |
3 | @@ -14,6 +14,7 @@ |
4 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
5 | */ |
6 | |
7 | +#include "linux/ath9k_platform.h" |
8 | #include "ath9k.h" |
9 | |
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; |
13 | if (!pdata) |
14 | ah->ah_flags |= AH_USE_EEPROM; |
15 | + else |
16 | + sc->quirk_wndr3700 = pdata->quirk_wndr3700; |
17 | |
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); |
22 | } |
23 | |
24 | +#ifdef CONFIG_ATHEROS_AR71XX |
25 | +static void wndr3700_init_antenna(struct ath_hw *ah) |
26 | +{ |
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); |
31 | + |
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); |
37 | +} |
38 | +#else |
39 | +static inline void wndr3700_init_antenna(struct ath_hw *ah) {} |
40 | +#endif /* CONFIG_ATHEROS_AR71XX */ |
41 | + |
42 | int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, |
43 | const struct ath_bus_ops *bus_ops) |
44 | { |
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); |
48 | |
49 | + if (sc->quirk_wndr3700) |
50 | + wndr3700_init_antenna(ah); |
51 | + |
52 | /* Initialize regulatory */ |
53 | error = ath_regd_init(&common->regulatory, sc->hw->wiphy, |
54 | ath9k_reg_notifier); |
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; |
61 | + |
62 | + unsigned long quirk_wndr3700:1; |
63 | }; |
64 | |
65 | struct ath_wiphy { |
66 | --- a/include/linux/ath9k_platform.h |
67 | +++ b/include/linux/ath9k_platform.h |
68 | @@ -24,6 +24,8 @@ |
69 | struct ath9k_platform_data { |
70 | u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; |
71 | u8 *macaddr; |
72 | + |
73 | + unsigned long quirk_wndr3700:1; |
74 | }; |
75 | |
76 | #endif /* _LINUX_ATH9K_PLATFORM_H */ |
77 |