summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorVipul Nayyar <nayyar_vipul@yahoo.com>2013-07-12 22:33:57 +0530
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-12 21:58:13 +0200
commit163e88a8c36815dad65a0342a2d6f851f1f5ed9f (patch)
treebc088c3e7bc014ceca2aff138f28eb685d7f1d34 /c
parentUpdated Legacy code in arm gba (diff)
downloadrtems-163e88a8c36815dad65a0342a2d6f851f1f5ed9f.tar.bz2
bsp/gumstix: Fix warnings
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c68
1 files changed, 14 insertions, 54 deletions
diff --git a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
index ef8ae4e8ed..dd513eec82 100644
--- a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
+++ b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
@@ -332,9 +332,9 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
/* Handle an NE2000 interrupt. */
static void
-ne_interrupt_handler (rtems_irq_hdl_param handle)
+ne_interrupt_handler (void *arg)
{
- struct ne_softc *sc = handle;
+ struct ne_softc *sc = arg;
if (sc == NULL)
return;
@@ -350,10 +350,8 @@ ne_interrupt_handler (rtems_irq_hdl_param handle)
/* Turn NE2000 interrupts on. */
static void
-ne_interrupt_on (const void * handle)
+ne_interrupt_on (struct ne_softc *sc)
{
- struct ne_softc *sc = handle;
-
#ifdef DEBUG_NE
printk ("ne_interrupt_on()\n");
#endif
@@ -361,44 +359,6 @@ ne_interrupt_on (const void * handle)
outport_byte (sc->port + IMR, NE_INTERRUPTS);
}
-/* Turn NE2000 interrupts off. See ne_interrupt_on. */
-
-static void
-ne_interrupt_off (const void * handle)
-{
- struct ne_softc *sc = handle;
-
-#ifdef DEBUG_NE
- printk ("ne_interrupt_off()\n");
-#endif
- if (sc != NULL)
- outport_byte (sc->port + IMR, 0);
-}
-
-/*
- *Return whether NE2000 interrupts are on.
- *If it is eanbled, return 1
-*/
-static int
-ne_interrupt_is_on (const void * handle)
-{
- struct ne_softc *sc = handle;
- unsigned char imr;
-#ifdef DEBUG_NE
- printk("ne_interrupt_is_on()\n");
-#endif
- if(sc != NULL){
- /*Read IMR in Page2*/
- outport_byte (sc->port + CMDR, MSK_PG2 | MSK_RD2 | MSK_STP);
- inport_byte(sc->port + IMR, imr);
- /*Back Page 0*/
- outport_byte (sc->port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STP);
- if(imr == NE_INTERRUPTS)
- return 1;
- }
- return 0;
-}
-
/* Initialize the NE2000 hardware. */
static void
@@ -484,15 +444,17 @@ ne_init_irq_handler(struct ne_softc *sc)
#ifdef DEBUG_NE
printk("ne_init_irq_handler(%d)\n", sc->irno);
#endif
+
status = rtems_interrupt_handler_install(
- sc->irno,
- "RTL8019",
- RTEMS_INTERRUPT_UNIQUE,
- ne_interrupt_handler,
- sc
- );
- assert(status == RTEMS_SUCCESSFUL);
- ne_interrupt_on(sc);
+ sc->irno,
+ "RTL8019",
+ RTEMS_INTERRUPT_UNIQUE,
+ ne_interrupt_handler,
+ sc
+ );
+ assert(status == RTEMS_SUCCESSFUL);
+ ne_interrupt_on(sc);
+}
/* The NE2000 packet receive daemon. This task is started when the
NE2000 driver is initialized. */
@@ -526,7 +488,7 @@ ne_rx_daemon (void *arg)
{
unsigned char startpage, currpage;
unsigned short len;
- unsigned char next, stat, cnt1, cnt2;
+ unsigned char next, cnt1, cnt2;
struct mbuf *m = NULL;
unsigned char *p;
int startaddr;
@@ -614,8 +576,6 @@ ne_rx_daemon (void *arg)
goto Next;
}
- stat = hdr.rsr;
-
/* The first four bytes of the length are the buffer header
* Just decrease them by 2 since in ARM, we have to make sure
* 4bytes memory access align on 4bytes