if_rl.c (164811) | if_rl.c (165311) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 164811 2006-12-01 21:52:07Z ru $"); | 34__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 165311 2006-12-18 01:38:10Z yongari $"); |
35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 1447 unchanged lines hidden (view full) --- 1490} 1491 1492static void 1493rl_init_locked(struct rl_softc *sc) 1494{ 1495 struct ifnet *ifp = sc->rl_ifp; 1496 struct mii_data *mii; 1497 uint32_t rxcfg = 0; | 35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 1447 unchanged lines hidden (view full) --- 1490} 1491 1492static void 1493rl_init_locked(struct rl_softc *sc) 1494{ 1495 struct ifnet *ifp = sc->rl_ifp; 1496 struct mii_data *mii; 1497 uint32_t rxcfg = 0; |
1498 uint32_t eaddr[2]; |
|
1498 1499 RL_LOCK_ASSERT(sc); 1500 1501 mii = device_get_softc(sc->rl_miibus); 1502 1503 /* 1504 * Cancel pending I/O and free all RX/TX buffers. 1505 */ 1506 rl_stop(sc); 1507 1508 /* 1509 * Init our MAC address. Even though the chipset 1510 * documentation doesn't mention it, we need to enter "Config 1511 * register write enable" mode to modify the ID registers. 1512 */ 1513 CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); | 1499 1500 RL_LOCK_ASSERT(sc); 1501 1502 mii = device_get_softc(sc->rl_miibus); 1503 1504 /* 1505 * Cancel pending I/O and free all RX/TX buffers. 1506 */ 1507 rl_stop(sc); 1508 1509 /* 1510 * Init our MAC address. Even though the chipset 1511 * documentation doesn't mention it, we need to enter "Config 1512 * register write enable" mode to modify the ID registers. 1513 */ 1514 CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); |
1514 CSR_WRITE_STREAM_4(sc, RL_IDR0, 1515 *(uint32_t *)(&IF_LLADDR(sc->rl_ifp)[0])); 1516 CSR_WRITE_STREAM_4(sc, RL_IDR4, 1517 *(uint32_t *)(&IF_LLADDR(sc->rl_ifp)[4])); | 1515 bzero(eaddr, sizeof(eaddr)); 1516 bcopy(IF_LLADDR(sc->rl_ifp), eaddr, ETHER_ADDR_LEN); 1517 CSR_WRITE_STREAM_4(sc, RL_IDR0, eaddr[0]); 1518 CSR_WRITE_STREAM_4(sc, RL_IDR4, eaddr[1]); |
1518 CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); 1519 1520 /* Init the RX buffer pointer register. */ 1521 bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, 1522 sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0); 1523 bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, 1524 BUS_DMASYNC_PREWRITE); 1525 --- 286 unchanged lines hidden --- | 1519 CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); 1520 1521 /* Init the RX buffer pointer register. */ 1522 bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, 1523 sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0); 1524 bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, 1525 BUS_DMASYNC_PREWRITE); 1526 --- 286 unchanged lines hidden --- |