[rtems commit] libchip: Check interrupt extension availability
Sebastian Huber
sebh at rtems.org
Thu Mar 13 15:40:44 UTC 2014
Module: rtems
Branch: master
Commit: 9a8bf95b3b485d48efafb345fb16b0b21a5fee67
Changeset: http://git.rtems.org/rtems/commit/?id=9a8bf95b3b485d48efafb345fb16b0b21a5fee67
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Mar 13 16:45:40 2014 +0100
libchip: Check interrupt extension availability
---
c/src/libchip/network/dwmac.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/c/src/libchip/network/dwmac.c b/c/src/libchip/network/dwmac.c
index a4373d2..3acf631 100644
--- a/c/src/libchip/network/dwmac.c
+++ b/c/src/libchip/network/dwmac.c
@@ -30,7 +30,10 @@
#include <rtems/endian.h>
#include "dwmac-common.h"
#include "dwmac-core.h"
+
+#ifdef BSP_FEATURE_IRQ_EXTENSION
#include <bsp/irq.h>
+#endif
/* PHY events which can be combined to an event set.
* The PHY can create an event for a corresponding status change */
@@ -1789,6 +1792,7 @@ static int dwmac_if_up_or_down(
/* Set up mmc counters */
dwmac_mmc_setup( self );
+#ifdef BSP_FEATURE_IRQ_EXTENSION
/* Install interrupt handler */
sc = rtems_interrupt_handler_install(
self->CFG->IRQ_EMAC,
@@ -1797,6 +1801,9 @@ static int dwmac_if_up_or_down(
dwmac_core_dma_interrupt,
self
);
+#else
+ sc = RTEMS_NOT_IMPLEMENTED;
+#endif
eno = rtems_status_code_to_errno( sc );
}
@@ -1828,11 +1835,13 @@ static int dwmac_if_up_or_down(
self, self->task_id_tx, DWMAC_COMMON_EVENT_TASK_STOP );
(void) dwmac_control_request(
self, self->task_id_rx, DWMAC_COMMON_EVENT_TASK_STOP );
+#ifdef BSP_FEATURE_IRQ_EXTENSION
(void) rtems_interrupt_handler_remove(
self->CFG->IRQ_EMAC,
dwmac_core_dma_interrupt,
self
);
+#endif
(void) ( CALLBACK->phy_stop )( self->arg );
(void) ( CALLBACK->phy_disable )( self->arg );
@@ -1855,11 +1864,15 @@ static int dwmac_if_up_or_down(
}
if ( eno == 0 ) {
+#ifdef BSP_FEATURE_IRQ_EXTENSION
sc = rtems_interrupt_handler_remove(
self->CFG->IRQ_EMAC,
dwmac_core_dma_interrupt,
self
);
+#else
+ sc = RTEMS_NOT_IMPLEMENTED;
+#endif
eno = rtems_status_code_to_errno( sc );
}
More information about the vc
mailing list