Changeset 8287eb7 in libbsdport


Ignore:
Timestamp:
Oct 20, 2009, 11:39:38 PM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
master
Children:
a4635d8
Parents:
908739e
Message:

2009-10-20 Till Straumann <Till.Straumann@…>

  • if_pcn/if_pcn.c: fixed 'type-punned pointer' warning. Use 'memcpy' to copy 2 bytes to a short. This requires another #ifdef rtems, however.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsd_eth_drivers/if_pcn/if_pcn.c

    r908739e r8287eb7  
    15101510        mii = device_get_softc(sc->pcn_miibus);
    15111511        ife = mii->mii_media.ifm_cur;
    1512 #endif
    15131512
    15141513        /* Set MAC address */
     
    15221521        pcn_csr_write(sc, PCN_CSR_PAR2, tmp);
    15231522        }
     1523#else
     1524        /* Set MAC address */
     1525        { unsigned tmp;
     1526        u_int16_t  s;
     1527        /* fix endinanness; LLADDR gets swapped on a BE machine */
     1528        memcpy(&s, IF_LLADDR(sc->pcn_ifp) + 0, sizeof(s));
     1529        tmp = htole16(s);
     1530        pcn_csr_write(sc, PCN_CSR_PAR0, tmp);
     1531        memcpy(&s, IF_LLADDR(sc->pcn_ifp) + 2, sizeof(s));
     1532        tmp = htole16(s);
     1533        pcn_csr_write(sc, PCN_CSR_PAR1, tmp);
     1534        memcpy(&s, IF_LLADDR(sc->pcn_ifp) + 4, sizeof(s));
     1535        tmp = htole16(s);
     1536        pcn_csr_write(sc, PCN_CSR_PAR2, tmp);
     1537        }
     1538#endif
    15241539
    15251540        /* Init circular RX list. */
Note: See TracChangeset for help on using the changeset viewer.