aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath9k/pci.c')
-rw-r--r--drivers/net/wireless/ath9k/pci.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath9k/pci.c b/drivers/net/wireless/ath9k/pci.c
index eea9d3a9d43c..9a58baabb9ca 100644
--- a/drivers/net/wireless/ath9k/pci.c
+++ b/drivers/net/wireless/ath9k/pci.c
@@ -83,6 +83,7 @@ static struct ath_bus_ops ath_pci_bus_ops = {
83static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 83static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
84{ 84{
85 void __iomem *mem; 85 void __iomem *mem;
86 struct ath_wiphy *aphy;
86 struct ath_softc *sc; 87 struct ath_softc *sc;
87 struct ieee80211_hw *hw; 88 struct ieee80211_hw *hw;
88 u8 csz; 89 u8 csz;
@@ -155,7 +156,8 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
155 goto bad1; 156 goto bad1;
156 } 157 }
157 158
158 hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); 159 hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) +
160 sizeof(struct ath_softc), &ath9k_ops);
159 if (hw == NULL) { 161 if (hw == NULL) {
160 printk(KERN_ERR "ath_pci: no memory for ieee80211_hw\n"); 162 printk(KERN_ERR "ath_pci: no memory for ieee80211_hw\n");
161 goto bad2; 163 goto bad2;
@@ -164,7 +166,11 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
164 SET_IEEE80211_DEV(hw, &pdev->dev); 166 SET_IEEE80211_DEV(hw, &pdev->dev);
165 pci_set_drvdata(pdev, hw); 167 pci_set_drvdata(pdev, hw);
166 168
167 sc = hw->priv; 169 aphy = hw->priv;
170 sc = (struct ath_softc *) (aphy + 1);
171 aphy->sc = sc;
172 aphy->hw = hw;
173 sc->pri_wiphy = aphy;
168 sc->hw = hw; 174 sc->hw = hw;
169 sc->dev = &pdev->dev; 175 sc->dev = &pdev->dev;
170 sc->mem = mem; 176 sc->mem = mem;
@@ -214,7 +220,8 @@ bad:
214static void ath_pci_remove(struct pci_dev *pdev) 220static void ath_pci_remove(struct pci_dev *pdev)
215{ 221{
216 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 222 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
217 struct ath_softc *sc = hw->priv; 223 struct ath_wiphy *aphy = hw->priv;
224 struct ath_softc *sc = aphy->sc;
218 225
219 ath_cleanup(sc); 226 ath_cleanup(sc);
220} 227}
@@ -224,7 +231,8 @@ static void ath_pci_remove(struct pci_dev *pdev)
224static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state) 231static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state)
225{ 232{
226 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 233 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
227 struct ath_softc *sc = hw->priv; 234 struct ath_wiphy *aphy = hw->priv;
235 struct ath_softc *sc = aphy->sc;
228 236
229 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); 237 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1);
230 238
@@ -243,7 +251,8 @@ static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state)
243static int ath_pci_resume(struct pci_dev *pdev) 251static int ath_pci_resume(struct pci_dev *pdev)
244{ 252{
245 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 253 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
246 struct ath_softc *sc = hw->priv; 254 struct ath_wiphy *aphy = hw->priv;
255 struct ath_softc *sc = aphy->sc;
247 u32 val; 256 u32 val;
248 int err; 257 int err;
249 258