summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-01-31 11:23:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-01-31 11:25:15 +0100
commit77c217850129ff0a84b65988339fa9ccbfdd4bac (patch)
tree5ee6065a6c119ccdfc214af82e933f9dca0085fd /c
parentRevert "Google C++ Testing Framework 1.6.0." (diff)
downloadrtems-77c217850129ff0a84b65988339fa9ccbfdd4bac.tar.bz2
Fixed race condition during startup.
Diffstat (limited to 'c')
-rw-r--r--c/src/libchip/network/if_fxp.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/c/src/libchip/network/if_fxp.c b/c/src/libchip/network/if_fxp.c
index 3b1b05dc32..c16ee77d7c 100644
--- a/c/src/libchip/network/if_fxp.c
+++ b/c/src/libchip/network/if_fxp.c
@@ -586,17 +586,6 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
DBGLVL_PRINTK(3,"fxp_attach: interrupt = 0x%x\n",interrupt);
sc->irqInfo.name = (rtems_irq_number)interrupt;
/*
- * Set up interrupts
- */
- sc->irqInfo.hdl = (rtems_irq_hdl)fxp_intr;
- sc->irqInfo.on = nopOn;
- sc->irqInfo.off = nopOn;
- sc->irqInfo.isOn = fxpIsOn;
- s = BSP_install_rtems_irq_handler (&sc->irqInfo);
- if (!s)
- rtems_panic ("Can't attach fxp interrupt handler for irq %d\n",
- sc->irqInfo.name);
- /*
* Reset to a stable state.
CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET);
*/
@@ -1671,7 +1660,7 @@ fxp_init(void *xsc)
struct fxp_cb_config *cbp;
struct fxp_cb_ias *cb_ias;
struct fxp_cb_tx *txp;
- int i, prm, s;
+ int i, prm, s, rv;
rtems_task_wake_after(100);
DBGLVL_PRINTK(2,"fxp_init called\n");
@@ -1897,7 +1886,20 @@ rtems_task_wake_after(100);
*/
sc->daemonTid = rtems_bsdnet_newproc ("FXPd", 4096, fxp_daemon, sc);
+ /*
+ * Set up interrupts
+ */
+ sc->irqInfo.hdl = (rtems_irq_hdl)fxp_intr;
+ sc->irqInfo.on = nopOn;
+ sc->irqInfo.off = nopOn;
+ sc->irqInfo.isOn = fxpIsOn;
+ rv = BSP_install_rtems_irq_handler (&sc->irqInfo);
+ if (rv != 1) {
+ rtems_panic ("Can't attach fxp interrupt handler for irq %d\n",
+ sc->irqInfo.name);
+ }
}
+
/*
* Enable interrupts.
*/