Commit ef96b5c9 authored by David Kilroy's avatar David Kilroy Committed by John W. Linville

airport: store irq in card private structure

... instead of relying on the net_device fields.
Signed-off-by: default avatarDavid Kilroy <kilroyd@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5381956b
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
struct airport { struct airport {
struct macio_dev *mdev; struct macio_dev *mdev;
void __iomem *vaddr; void __iomem *vaddr;
unsigned int irq;
int irq_requested; int irq_requested;
int ndev_registered; int ndev_registered;
}; };
...@@ -36,6 +37,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state) ...@@ -36,6 +37,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
{ {
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct net_device *dev = priv->ndev; struct net_device *dev = priv->ndev;
struct airport *card = priv->card;
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -59,7 +61,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state) ...@@ -59,7 +61,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
orinoco_unlock(priv, &flags); orinoco_unlock(priv, &flags);
disable_irq(dev->irq); disable_irq(card->irq);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(mdev), 0, 0); macio_get_of_node(mdev), 0, 0);
...@@ -71,6 +73,7 @@ airport_resume(struct macio_dev *mdev) ...@@ -71,6 +73,7 @@ airport_resume(struct macio_dev *mdev)
{ {
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct net_device *dev = priv->ndev; struct net_device *dev = priv->ndev;
struct airport *card = priv->card;
unsigned long flags; unsigned long flags;
int err; int err;
...@@ -80,7 +83,7 @@ airport_resume(struct macio_dev *mdev) ...@@ -80,7 +83,7 @@ airport_resume(struct macio_dev *mdev)
macio_get_of_node(mdev), 0, 1); macio_get_of_node(mdev), 0, 1);
msleep(200); msleep(200);
enable_irq(dev->irq); enable_irq(card->irq);
err = orinoco_reinit_firmware(priv); err = orinoco_reinit_firmware(priv);
if (err) { if (err) {
...@@ -112,7 +115,6 @@ static int ...@@ -112,7 +115,6 @@ static int
airport_detach(struct macio_dev *mdev) airport_detach(struct macio_dev *mdev)
{ {
struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev);
struct net_device *dev = priv->ndev;
struct airport *card = priv->card; struct airport *card = priv->card;
if (card->ndev_registered) if (card->ndev_registered)
...@@ -120,7 +122,7 @@ airport_detach(struct macio_dev *mdev) ...@@ -120,7 +122,7 @@ airport_detach(struct macio_dev *mdev)
card->ndev_registered = 0; card->ndev_registered = 0;
if (card->irq_requested) if (card->irq_requested)
free_irq(dev->irq, priv); free_irq(card->irq, priv);
card->irq_requested = 0; card->irq_requested = 0;
if (card->vaddr) if (card->vaddr)
...@@ -146,7 +148,6 @@ static int airport_hard_reset(struct orinoco_private *priv) ...@@ -146,7 +148,6 @@ static int airport_hard_reset(struct orinoco_private *priv)
* re-initialize properly, it falls in a screaming heap * re-initialize properly, it falls in a screaming heap
* shortly afterwards. */ * shortly afterwards. */
#if 0 #if 0
struct net_device *dev = priv->ndev;
struct airport *card = priv->card; struct airport *card = priv->card;
/* Vitally important. If we don't do this it seems we get an /* 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,7 +155,7 @@ static int airport_hard_reset(struct orinoco_private *priv)
* hw_unavailable is already set it doesn't get ACKed, we get * hw_unavailable is already set it doesn't get ACKed, we get
* into an interrupt loop and the PMU decides to turn us * into an interrupt loop and the PMU decides to turn us
* off. */ * off. */
disable_irq(dev->irq); disable_irq(card->irq);
pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
macio_get_of_node(card->mdev), 0, 0); macio_get_of_node(card->mdev), 0, 0);
...@@ -163,7 +164,7 @@ static int airport_hard_reset(struct orinoco_private *priv) ...@@ -163,7 +164,7 @@ static int airport_hard_reset(struct orinoco_private *priv)
macio_get_of_node(card->mdev), 0, 1); macio_get_of_node(card->mdev), 0, 1);
ssleep(1); ssleep(1);
enable_irq(dev->irq); enable_irq(card->irq);
ssleep(1); ssleep(1);
#endif #endif
...@@ -176,7 +177,6 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) ...@@ -176,7 +177,6 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
struct orinoco_private *priv; struct orinoco_private *priv;
struct airport *card; struct airport *card;
unsigned long phys_addr; unsigned long phys_addr;
unsigned int irq;
hermes_t *hw; hermes_t *hw;
if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) { 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,7 +205,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
macio_set_drvdata(mdev, priv); macio_set_drvdata(mdev, priv);
/* Setup interrupts & base address */ /* Setup interrupts & base address */
irq = macio_irq(mdev, 0); card->irq = macio_irq(mdev, 0);
phys_addr = macio_resource_start(mdev, 0); /* Physical address */ phys_addr = macio_resource_start(mdev, 0); /* Physical address */
printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr); printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr);
card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN); 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,8 +224,8 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
/* Reset it before we get the interrupt */ /* Reset it before we get the interrupt */
hermes_init(hw); hermes_init(hw);
if (request_irq(irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) { if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) {
printk(KERN_ERR PFX "Couldn't get IRQ %d\n", irq); printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq);
goto failed; goto failed;
} }
card->irq_requested = 1; card->irq_requested = 1;
...@@ -237,7 +237,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) ...@@ -237,7 +237,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
} }
/* Register an interface with the stack */ /* Register an interface with the stack */
if (orinoco_if_add(priv, phys_addr, irq) != 0) { if (orinoco_if_add(priv, phys_addr, card->irq) != 0) {
printk(KERN_ERR PFX "orinoco_if_add() failed\n"); printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed; goto failed;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment