Changeset f780417 in rtems


Ignore:
Timestamp:
May 20, 2010, 2:19:41 PM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10, 4.11, master
Children:
ef6f1d0c
Parents:
4c4974e
Message:

2010-05-20 Sebastian Huber <sebastian.huber@…>

  • network/smsc9218i.c: Removed superfluous macros.
Location:
c/src/lib/libbsp/powerpc/mpc55xxevb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog

    r4c4974e rf780417  
     12010-05-20      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * network/smsc9218i.c: Removed superfluous macros.
     4
    152010-05-10      Joel Sherrill <joel.sherrilL@OARcorp.com>
    26
  • c/src/lib/libbsp/powerpc/mpc55xxevb/network/smsc9218i.c

    r4c4974e rf780417  
    198198static void smsc9218i_mac_wait(volatile smsc9218i_registers *regs)
    199199{
    200   while (IS_FLAG_SET(regs->mac_csr_cmd, SMSC9218I_MAC_CSR_CMD_BUSY)) {
     200  while ((regs->mac_csr_cmd & SMSC9218I_MAC_CSR_CMD_BUSY) != 0) {
    201201    /* Wait */
    202202  }
     
    239239  do {
    240240    mac_mii_acc = smsc9218i_mac_read(regs, SMSC9218I_MAC_MII_ACC);
    241   } while (IS_FLAG_SET(mac_mii_acc, SMSC9218I_MAC_MII_ACC_BUSY));
     241  } while ((mac_mii_acc & SMSC9218I_MAC_MII_ACC_BUSY) != 0);
    242242}
    243243
     
    287287
    288288  if (enable) {
    289     mac_cr = SET_FLAGS(mac_cr, flags);
     289    mac_cr |= flags;
    290290  } else {
    291     mac_cr = CLEAR_FLAGS(mac_cr, flags);
     291    mac_cr &= ~flags;
    292292  }
    293293
     
    437437
    438438  /* Check receive interrupts */
    439   if (IS_FLAG_SET(int_sts, SMSC9218I_INT_STS_RSFL)) {
    440     int_en = CLEAR_FLAG(int_en, SMSC9218I_INT_EN_RSFL);
     439  if ((int_sts & SMSC9218I_INT_STS_RSFL) != 0) {
     440    int_en &= ~SMSC9218I_INT_EN_RSFL;
    441441    re = SMSC9218I_EVENT_RX;
    442442  }
    443443
    444444  /* Check PHY interrupts */
    445   if (IS_FLAG_SET(int_sts, SMSC9218I_INT_STS_PHY)) {
    446     int_en = CLEAR_FLAG(int_en, SMSC9218I_INT_EN_PHY);
    447     re = SET_FLAG(re, SMSC9218I_EVENT_PHY);
     445  if ((int_sts & SMSC9218I_INT_STS_PHY) != 0) {
     446    int_en &= ~SMSC9218I_INT_EN_PHY;
     447    re |= SMSC9218I_EVENT_PHY;
    448448  }
    449449
     
    456456
    457457  /* Check transmit interrupts */
    458   if (IS_FLAG_SET(int_sts, SMSC9218I_INT_STS_TDFA)) {
    459     int_en = CLEAR_FLAG(int_en, SMSC9218I_INT_EN_TDFA);
     458  if ((int_sts & SMSC9218I_INT_STS_TDFA) != 0) {
     459    int_en &= ~SMSC9218I_INT_EN_TDFA;
    460460    te = SMSC9218I_EVENT_TX;
    461461  }
     
    482482
    483483  rtems_interrupt_disable(level);
    484   regs->int_en = SET_FLAG(regs->int_en, SMSC9218I_INT_EN_RSFL);
     484  regs->int_en |= SMSC9218I_INT_EN_RSFL;
    485485  rtems_interrupt_enable(level);
    486486}
     
    493493
    494494  rtems_interrupt_disable(level);
    495   regs->int_en = SET_FLAG(regs->int_en, SMSC9218I_INT_EN_TDFA);
     495  regs->int_en |= SMSC9218I_INT_EN_TDFA;
    496496  rtems_interrupt_enable(level);
    497497}
     
    504504
    505505  rtems_interrupt_disable(level);
    506   regs->int_en = SET_FLAG(regs->int_en, SMSC9218I_INT_EN_PHY);
     506  regs->int_en |= SMSC9218I_INT_EN_PHY;
    507507  rtems_interrupt_enable(level);
    508508}
     
    516516  if (m != NULL) {
    517517    MCLGET(m, mw);
    518     if (IS_FLAG_SET(m->m_flags, M_EXT)) {
     518    if ((m->m_flags & M_EXT) != 0) {
    519519      /* Set receive interface */
    520520      m->m_pkthdr.rcvif = ifp;
     
    592592    RTEMS_CLEANUP_SC(sc, cleanup, "wait for events");
    593593
    594     if (IS_FLAG_SET(events, SMSC9218I_EVENT_PHY)) {
     594    if ((events & SMSC9218I_EVENT_PHY) != 0) {
    595595      uint32_t phy_isr = smsc9218i_phy_read(regs, SMSC9218I_PHY_ISR);
    596596
     
    631631      );
    632632
    633       if (IS_FLAG_CLEARED(rx_fifo_status, SMSC9218I_RX_STS_ERROR)) {
     633      if ((rx_fifo_status & SMSC9218I_RX_STS_ERROR) == 0) {
    634634        struct mbuf *m = smsc9218i_new_mbuf(ifp, true);
    635635        struct ether_header *eh = (struct ether_header *)
     
    661661        RTEMS_CHECK_SC_TASK(sc, "wait for eDMA events");
    662662
    663         if (IS_FLAG_CLEARED(events, SMSC9218I_EVENT_EDMA_ERROR)) {
     663        if ((events & SMSC9218I_EVENT_EDMA_ERROR) == 0) {
    664664          /* Hand over */
    665665          ether_input(ifp, eh, m);
     
    677677
    678678        /* Update error counters */
    679         if (IS_FLAG_SET(rx_fifo_status, SMSC9218I_RX_STS_ERROR_TOO_LONG)) {
     679        if ((rx_fifo_status & SMSC9218I_RX_STS_ERROR_TOO_LONG) != 0) {
    680680          ++e->receive_too_long_errors;
    681681        }
    682         if (IS_FLAG_SET(rx_fifo_status, SMSC9218I_RX_STS_ERROR_COLLISION)) {
     682        if ((rx_fifo_status & SMSC9218I_RX_STS_ERROR_COLLISION) != 0) {
    683683          ++e->receive_collision_errors;
    684684        }
    685         if (IS_FLAG_SET(rx_fifo_status, SMSC9218I_RX_STS_ERROR_CRC)) {
     685        if ((rx_fifo_status & SMSC9218I_RX_STS_ERROR_CRC) != 0) {
    686686          ++e->receive_crc_errors;
    687687        }
     
    692692          regs->rx_dp_ctl = SMSC9218I_RX_DP_CTRL_FFWD;
    693693
    694           while (IS_FLAG_SET(regs->rx_dp_ctl, SMSC9218I_RX_DP_CTRL_FFWD)) {
     694          while ((regs->rx_dp_ctl & SMSC9218I_RX_DP_CTRL_FFWD) != 0) {
    695695            /* Wait */
    696696          }
     
    870870
    871871      /* Interface is now inactive */
    872       ifp->if_flags = CLEAR_FLAG(ifp->if_flags, IFF_OACTIVE);
     872      ifp->if_flags &= ~IFF_OACTIVE;
    873873
    874874      /* Transmit task may wait for events */
     
    10861086    uint32_t tx_fifo_status = regs->tx_fifo_status;
    10871087
    1088     if (IS_FLAG_CLEARED(tx_fifo_status, SMSC9218I_TX_STS_ERROR)) {
     1088    if ((tx_fifo_status & SMSC9218I_TX_STS_ERROR) == 0) {
    10891089      ++e->transmitted_frames;
    10901090    } else {
     
    11001100
    11011101  if (
    1102     IS_ANY_FLAG_SET(events, SMSC9218I_EVENT_EDMA | SMSC9218I_EVENT_EDMA_ERROR)
     1102    (events & (SMSC9218I_EVENT_EDMA | SMSC9218I_EVENT_EDMA_ERROR)) != 0
    11031103      && n > 0
    11041104  ) {
     
    11101110    #endif
    11111111
    1112     if (IS_FLAG_SET(events, SMSC9218I_EVENT_EDMA_ERROR)) {
     1112    if ((events & SMSC9218I_EVENT_EDMA_ERROR) != 0) {
    11131113      ++e->transmit_edma_errors;
    11141114    }
     
    15091509    smsc9218i_enable_promiscous_mode(
    15101510      regs,
    1511       IS_FLAG_SET(ifp->if_flags, IFF_PROMISC)
     1511      (ifp->if_flags & IFF_PROMISC) != 0
    15121512    );
    15131513
    15141514    /* Set interface to running state */
    1515     ifp->if_flags = SET_FLAG(ifp->if_flags, IFF_RUNNING);
     1515    ifp->if_flags |= IFF_RUNNING;
    15161516
    15171517    /* Change state */
     
    15581558      }
    15591559      if (ifp->if_flags & IFF_UP) {
    1560         ifp->if_flags = SET_FLAG(ifp->if_flags, IFF_RUNNING);
     1560        ifp->if_flags |= IFF_RUNNING;
    15611561        /* TODO: init */
    15621562      }
     
    15791579
    15801580  /* Interface is now active */
    1581   ifp->if_flags = SET_FLAG(ifp->if_flags, IFF_OACTIVE);
     1581  ifp->if_flags |= IFF_OACTIVE;
    15821582
    15831583  sc = rtems_event_send(e->transmit_task, SMSC9218I_EVENT_TX_START);
Note: See TracChangeset for help on using the changeset viewer.