d89b9847a3861af0c6a697e0472744e97a4c1c17
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 860-brcmsmac-use-bcma-PCIe-up-and-down-functions.patch
1 brcmsmac: use bcma PCIe up and down functions
2
3 replace the calls to bcma_core_pci_extend_L1timer() by calls to the
4 newly introduced bcma_core_pci_ip() and bcma_core_pci_down()
5
6 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7
8 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
9 +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
10 @@ -679,27 +679,6 @@ bool ai_clkctl_cc(struct si_pub *sih, en
11 return mode == BCMA_CLKMODE_FAST;
12 }
13
14 -void ai_pci_up(struct si_pub *sih)
15 -{
16 - struct si_info *sii;
17 -
18 - sii = container_of(sih, struct si_info, pub);
19 -
20 - if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
21 - bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], true);
22 -}
23 -
24 -/* Unconfigure and/or apply various WARs when going down */
25 -void ai_pci_down(struct si_pub *sih)
26 -{
27 - struct si_info *sii;
28 -
29 - sii = container_of(sih, struct si_info, pub);
30 -
31 - if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
32 - bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], false);
33 -}
34 -
35 /* Enable BT-COEX & Ex-PA for 4313 */
36 void ai_epa_4313war(struct si_pub *sih)
37 {
38 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
39 +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
40 @@ -183,9 +183,6 @@ extern u16 ai_clkctl_fast_pwrup_delay(st
41 extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
42 extern bool ai_deviceremoved(struct si_pub *sih);
43
44 -extern void ai_pci_down(struct si_pub *sih);
45 -extern void ai_pci_up(struct si_pub *sih);
46 -
47 /* Enable Ex-PA for 4313 */
48 extern void ai_epa_4313war(struct si_pub *sih);
49
50 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
51 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
52 @@ -4667,7 +4667,7 @@ static int brcms_b_attach(struct brcms_c
53 brcms_c_coredisable(wlc_hw);
54
55 /* Match driver "down" state */
56 - ai_pci_down(wlc_hw->sih);
57 + bcma_core_pci_down(wlc_hw->d11core->bus);
58
59 /* turn off pll and xtal to match driver "down" state */
60 brcms_b_xtal(wlc_hw, OFF);
61 @@ -5010,12 +5010,12 @@ static int brcms_b_up_prep(struct brcms_
62 */
63 if (brcms_b_radio_read_hwdisabled(wlc_hw)) {
64 /* put SB PCI in down state again */
65 - ai_pci_down(wlc_hw->sih);
66 + bcma_core_pci_down(wlc_hw->d11core->bus);
67 brcms_b_xtal(wlc_hw, OFF);
68 return -ENOMEDIUM;
69 }
70
71 - ai_pci_up(wlc_hw->sih);
72 + bcma_core_pci_up(wlc_hw->d11core->bus);
73
74 /* reset the d11 core */
75 brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);
76 @@ -5212,7 +5212,7 @@ static int brcms_b_down_finish(struct br
77
78 /* turn off primary xtal and pll */
79 if (!wlc_hw->noreset) {
80 - ai_pci_down(wlc_hw->sih);
81 + bcma_core_pci_down(wlc_hw->d11core->bus);
82 brcms_b_xtal(wlc_hw, OFF);
83 }
84 }