aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 18:21:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:45 -0400
commitef96b5c9ed6ba4b45fd4cf45810c34978bb8d8bb (patch)
tree92c3251f0085df2274af58dc210044bf0c383098 /drivers/net/wireless/orinoco
parent5381956b780e82805247c2ec8e32c4c665309394 (diff)
airport: store irq in card private structure
... instead of relying on the net_device fields. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r--drivers/net/wireless/orinoco/airport.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/wireless/orinoco/airport.c b/drivers/net/wireless/orinoco/airport.c
index e46e0d7c36f6..70f1331512bd 100644
--- a/drivers/net/wireless/orinoco/airport.c
+++ b/drivers/net/wireless/orinoco/airport.c
@@ -27,6 +27,7 @@
27struct airport { 27struct airport {
28 struct macio_dev *mdev; 28 struct macio_dev *mdev;
29 void __iomem *vaddr; 29 void __iomem *vaddr;
30 unsigned int irq;
30 int irq_requested; 31 int irq_requested;
31 int ndev_registered; 32 int ndev_registered;
32}; 33};
@@ -36,6 +37,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
36{ 37{
37 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); 38 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
38 struct net_device *dev = priv->ndev; 39 struct net_device *dev = priv->ndev;
40 struct airport *card = priv->card;
39 unsigned long flags; 41 unsigned long flags;
40 int err; 42 int err;
41 43
@@ -59,7 +61,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
59 61
60 orinoco_unlock(priv, &flags); 62 orinoco_unlock(priv, &flags);
61 63
62 disable_irq(dev->irq); 64 disable_irq(card->irq);
63 pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, 65 pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
64 macio_get_of_node(mdev), 0, 0); 66 macio_get_of_node(mdev), 0, 0);
65 67
@@ -71,6 +73,7 @@ airport_resume(struct macio_dev *mdev)
71{ 73{
72 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); 74 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
73 struct net_device *dev = priv->ndev; 75 struct net_device *dev = priv->ndev;
76 struct airport *card = priv->card;
74 unsigned long flags; 77 unsigned long flags;
75 int err; 78 int err;
76 79
@@ -80,7 +83,7 @@ airport_resume(struct macio_dev *mdev)
80 macio_get_of_node(mdev), 0, 1); 83 macio_get_of_node(mdev), 0, 1);
81 msleep(200); 84 msleep(200);
82 85
83 enable_irq(dev->irq); 86 enable_irq(card->irq);
84 87
85 err = orinoco_reinit_firmware(priv); 88 err = orinoco_reinit_firmware(priv);
86 if (err) { 89 if (err) {
@@ -112,7 +115,6 @@ static int
112airport_detach(struct macio_dev *mdev) 115airport_detach(struct macio_dev *mdev)
113{ 116{
114 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); 117 struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
115 struct net_device *dev = priv->ndev;
116 struct airport *card = priv->card; 118 struct airport *card = priv->card;
117 119
118 if (card->ndev_registered) 120 if (card->ndev_registered)
@@ -120,7 +122,7 @@ airport_detach(struct macio_dev *mdev)
120 card->ndev_registered = 0; 122 card->ndev_registered = 0;
121 123
122 if (card->irq_requested) 124 if (card->irq_requested)
123 free_irq(dev->irq, priv); 125 free_irq(card->irq, priv);
124 card->irq_requested = 0; 126 card->irq_requested = 0;
125 127
126 if (card->vaddr) 128 if (card->vaddr)
@@ -146,7 +148,6 @@ static int airport_hard_reset(struct orinoco_private *priv)
146 * re-initialize properly, it falls in a screaming heap 148 * re-initialize properly, it falls in a screaming heap
147 * shortly afterwards. */ 149 * shortly afterwards. */
148#if 0 150#if 0
149 struct net_device *dev = priv->ndev;
150 struct airport *card = priv->card; 151 struct airport *card = priv->card;
151 152
152 /* Vitally important. If we don't do this it seems we get an 153 /* Vitally important. If we don't do this it seems we get an
@@ -154,7 +155,7 @@ static int airport_hard_reset(struct orinoco_private *priv)
154 * hw_unavailable is already set it doesn't get ACKed, we get 155 * hw_unavailable is already set it doesn't get ACKed, we get
155 * into an interrupt loop and the PMU decides to turn us 156 * into an interrupt loop and the PMU decides to turn us
156 * off. */ 157 * off. */
157 disable_irq(dev->irq); 158 disable_irq(card->irq);
158 159
159 pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, 160 pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
160 macio_get_of_node(card->mdev), 0, 0); 161 macio_get_of_node(card->mdev), 0, 0);
@@ -163,7 +164,7 @@ static int airport_hard_reset(struct orinoco_private *priv)
163 macio_get_of_node(card->mdev), 0, 1); 164 macio_get_of_node(card->mdev), 0, 1);
164 ssleep(1); 165 ssleep(1);
165 166
166 enable_irq(dev->irq); 167 enable_irq(card->irq);
167 ssleep(1); 168 ssleep(1);
168#endif 169#endif
169 170
@@ -176,7 +177,6 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
176 struct orinoco_private *priv; 177 struct orinoco_private *priv;
177 struct airport *card; 178 struct airport *card;
178 unsigned long phys_addr; 179 unsigned long phys_addr;
179 unsigned int irq;
180 hermes_t *hw; 180 hermes_t *hw;
181 181
182 if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) { 182 if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) {
@@ -205,7 +205,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
205 macio_set_drvdata(mdev, priv); 205 macio_set_drvdata(mdev, priv);
206 206
207 /* Setup interrupts & base address */ 207 /* Setup interrupts & base address */
208 irq = macio_irq(mdev, 0); 208 card->irq = macio_irq(mdev, 0);
209 phys_addr = macio_resource_start(mdev, 0); /* Physical address */ 209 phys_addr = macio_resource_start(mdev, 0); /* Physical address */
210 printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr); 210 printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr);
211 card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN); 211 card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN);
@@ -224,8 +224,8 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
224 /* Reset it before we get the interrupt */ 224 /* Reset it before we get the interrupt */
225 hermes_init(hw); 225 hermes_init(hw);
226 226
227 if (request_irq(irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) { 227 if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) {
228 printk(KERN_ERR PFX "Couldn't get IRQ %d\n", irq); 228 printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq);
229 goto failed; 229 goto failed;
230 } 230 }
231 card->irq_requested = 1; 231 card->irq_requested = 1;
@@ -237,7 +237,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
237 } 237 }
238 238
239 /* Register an interface with the stack */ 239 /* Register an interface with the stack */
240 if (orinoco_if_add(priv, phys_addr, irq) != 0) { 240 if (orinoco_if_add(priv, phys_addr, card->irq) != 0) {
241 printk(KERN_ERR PFX "orinoco_if_add() failed\n"); 241 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
242 goto failed; 242 goto failed;
243 } 243 }