Changeset 6886a485 in rtems


Ignore:
Timestamp:
Jul 7, 2013, 1:00:45 PM (6 years ago)
Author:
Vipul Nayyar <nayyar_vipul@…>
Branches:
4.11, master
Children:
4fe3ad2
Parents:
ad83ea0
git-author:
Vipul Nayyar <nayyar_vipul@…> (07/07/13 13:00:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/07/13 13:02:02)
Message:

bsp/csb337: Use IRQ extensions API

Fix warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/csb337/network/network.c

    rad83ea0 r6886a485  
    2323#include <errno.h>
    2424#include <rtems/error.h>
     25#include <assert.h>
    2526
    2627#include <sys/param.h>
     
    8485
    8586static void at91rm9200_emac_isr (rtems_irq_hdl_param unused);
    86 static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused);
    87 static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused);
    88 static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq);
    89 
    90 /* Replace the first value with the clock's interrupt name. */
    91 rtems_irq_connect_data at91rm9200_emac_isr_data = {
    92     AT91RM9200_INT_EMAC,
    93     at91rm9200_emac_isr,
    94     NULL,
    95     at91rm9200_emac_isr_on,
    96     at91rm9200_emac_isr_off,
    97     at91rm9200_emac_isr_is_on
    98 };
    99 
     87static void at91rm9200_emac_isr_on(void);
    10088
    10189/* use the values defined in linkcmds for our use of SRAM */
     
    210198                                  caddr_t data);
    211199
    212 
     200#if csb637
    213201/*
    214202 * phyread(): Read the PHY
    215203 */
    216 uint32_t phyread(uint8_t reg)
     204static uint32_t phyread(uint8_t reg)
    217205{
    218206  EMAC_REG(EMAC_MAN) = (0x01 << 30  /* Start of Frame Delimiter */
     
    235223  return EMAC_REG(EMAC_MAN) & 0xffff;
    236224}
     225#endif
    237226
    238227/*
    239228 * phywrite(): Write the PHY
    240229 */
    241 void phywrite(uint8_t reg, uint16_t data)
     230static void phywrite(uint8_t reg, uint16_t data)
    242231{
    243232  EMAC_REG(EMAC_MAN) = (0x01 << 30 /* Start of Frame Delimiter */
     
    359348    at91rm9200_emac_softc_t     *sc = arg;
    360349    struct ifnet *ifp = &sc->arpcom.ac_if;
     350    rtems_status_code status = RTEMS_SUCCESSFUL;
    361351
    362352    /*
     
    383373
    384374    /* install the interrupt handler */
    385     BSP_install_rtems_irq_handler(&at91rm9200_emac_isr_data);
     375    status = rtems_interrupt_handler_install(
     376        AT91RM9200_INT_EMAC,
     377        "Network",
     378        RTEMS_INTERRUPT_UNIQUE,
     379        at91rm9200_emac_isr,
     380        NULL
     381    );
     382    assert(status == RTEMS_SUCCESSFUL);
     383    at91rm9200_emac_isr_on();
    386384
    387385    /* EMAC doesn't support promiscuous, so ignore requests */
     
    768766
    769767/* Enables at91rm9200_emac interrupts. */
    770 static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused)
     768static void at91rm9200_emac_isr_on(void)
    771769{
    772770    /* Enable various TX/RX interrupts */
     
    778776
    779777    return;
    780 }
    781 
    782 /* Disables at91rm9200_emac interrupts */
    783 static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused)
    784 {
    785     /* disable all various TX/RX interrupts */
    786     EMAC_REG(EMAC_IDR) = 0xffffffff;
    787     return;
    788 }
    789 
    790 /* Tests to see if at91rm9200_emac interrupts are enabled, and
    791  * returns non-0 if so.
    792  * If interrupt is not enabled, returns 0.
    793  */
    794 static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq)
    795 {
    796     return EMAC_REG(EMAC_IMR); /* any interrupts enabled? */
    797778}
    798779
Note: See TracChangeset for help on using the changeset viewer.