summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-01-07 04:21:37 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-01-07 04:21:37 +0000
commit2b353dd59306d8f2b67904368fa6dbb36ea55d36 (patch)
treeb1d3fd3a1832c4e144b54d3401346edd6fbdc304 /sys
parent123675a59db858f699178da64e6d40ac20f4c13d (diff)
rename em_softc sc_dv to sc_dev. like ALL OUR OTHER DRIVERS.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_em.c60
-rw-r--r--sys/dev/pci/if_em.h4
-rw-r--r--sys/dev/pci/if_em_soc.c8
3 files changed, 36 insertions, 36 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index d12eb80f04c..3eb2a04da42 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.315 2016/01/07 03:56:03 dlg Exp $ */
+/* $OpenBSD: if_em.c,v 1.316 2016/01/07 04:21:36 dlg Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -300,7 +300,7 @@ em_defer_attach(struct device *self)
if ((gcu = em_lookup_gcu(self)) == 0) {
printf("%s: No GCU found, defered attachment failed\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
if (sc->sc_intrhand)
pci_intr_disestablish(pc, sc->sc_intrhand);
@@ -465,7 +465,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Allocate Transmit Descriptor ring */
if (em_dma_malloc(sc, tsize, &sc->txdma, BUS_DMA_NOWAIT)) {
printf("%s: Unable to allocate tx_desc memory\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
goto err_tx_desc;
}
sc->tx_desc_base = (struct em_tx_desc *)sc->txdma.dma_vaddr;
@@ -481,7 +481,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Allocate Receive Descriptor ring */
if (em_dma_malloc(sc, rsize, &sc->rxdma, BUS_DMA_NOWAIT)) {
printf("%s: Unable to allocate rx_desc memory\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
goto err_rx_desc;
}
sc->rx_desc_base = (struct em_rx_desc *) sc->rxdma.dma_vaddr;
@@ -492,7 +492,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
config_defer(self, em_defer_attach);
else {
printf("%s: Unable to initialize the hardware\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
goto err_hw_init;
}
}
@@ -525,7 +525,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Copy the permanent MAC address out of the EEPROM */
if (em_read_mac_addr(&sc->hw) < 0) {
printf("%s: EEPROM read error while reading mac address\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
goto err_mac_addr;
}
@@ -550,7 +550,7 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Indicate SOL/IDER usage */
if (em_check_phy_reset_block(&sc->hw))
printf("%s: PHY reset is blocked due to SOL/IDER session.\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
/* Identify 82544 on PCI-X */
em_get_bus_info(&sc->hw);
@@ -691,7 +691,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* Check SOL/IDER usage */
if (em_check_phy_reset_block(&sc->hw)) {
printf("%s: Media change is blocked due to SOL/IDER session.\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
break;
}
case SIOCGIFMEDIA:
@@ -743,7 +743,7 @@ em_watchdog(struct ifnet *ifp)
return;
}
printf("%s: watchdog: cons %u prod %u free %u TDH %u TDT %u\n",
- sc->sc_dv.dv_xname, sc->next_tx_to_clean,
+ sc->sc_dev.dv_xname, sc->next_tx_to_clean,
sc->next_avail_tx_desc, sc->num_tx_desc_avail,
E1000_READ_REG(&sc->hw, TDH), E1000_READ_REG(&sc->hw, TDT));
@@ -849,7 +849,7 @@ em_init(void *arg)
/* Initialize the hardware */
if (em_hardware_init(sc)) {
printf("%s: Unable to initialize the hardware\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
splx(s);
return;
}
@@ -862,7 +862,7 @@ em_init(void *arg)
/* Prepare transmit descriptors and buffers */
if (em_setup_transmit_structures(sc)) {
printf("%s: Could not setup transmit structures\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
em_stop(sc, 0);
splx(s);
return;
@@ -872,7 +872,7 @@ em_init(void *arg)
/* Prepare receive descriptors and buffers */
if (em_setup_receive_structures(sc)) {
printf("%s: Could not setup receive structures\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
em_stop(sc, 0);
splx(s);
return;
@@ -1044,7 +1044,7 @@ em_media_change(struct ifnet *ifp)
sc->hw.forced_speed_duplex = em_10_half;
break;
default:
- printf("%s: Unsupported media type\n", sc->sc_dv.dv_xname);
+ printf("%s: Unsupported media type\n", sc->sc_dev.dv_xname);
}
/*
@@ -1569,7 +1569,7 @@ em_identify_hardware(struct em_softc *sc)
/* Identify the MAC */
if (em_set_mac_type(&sc->hw))
- printf("%s: Unknown MAC Type\n", sc->sc_dv.dv_xname);
+ printf("%s: Unknown MAC Type\n", sc->sc_dev.dv_xname);
if (sc->hw.mac_type == em_pchlan)
sc->hw.revision_id = PCI_PRODUCT(pa->pa_id) & 0x0f;
@@ -1661,7 +1661,7 @@ em_allocate_pci_resources(struct em_softc *sc)
intrstr = pci_intr_string(pc, ih);
sc->sc_intrhand = pci_intr_establish(pc, ih, IPL_NET | IPL_MPSAFE,
- em_intr, sc, sc->sc_dv.dv_xname);
+ em_intr, sc, sc->sc_dev.dv_xname);
if (sc->sc_intrhand == NULL) {
printf(": couldn't establish interrupt");
if (intrstr != NULL)
@@ -1751,7 +1751,7 @@ em_hardware_init(struct em_softc *sc)
*/
if (em_validate_eeprom_checksum(&sc->hw) < 0) {
printf("%s: The EEPROM Checksum Is Not Valid\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
return (EIO);
}
}
@@ -1759,7 +1759,7 @@ em_hardware_init(struct em_softc *sc)
if (em_get_flash_presence_i210(&sc->hw) &&
em_read_part_num(&sc->hw, &(sc->part_num)) < 0) {
printf("%s: EEPROM read error while reading part number\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
return (EIO);
}
@@ -1813,7 +1813,7 @@ em_hardware_init(struct em_softc *sc)
return (EAGAIN);
}
printf("\n%s: Hardware Initialization Failed\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
return (EIO);
}
@@ -1836,7 +1836,7 @@ em_setup_interface(struct em_softc *sc)
INIT_DEBUGOUT("em_setup_interface: begin");
ifp = &sc->interface_data.ac_if;
- strlcpy(ifp->if_xname, sc->sc_dv.dv_xname, IFNAMSIZ);
+ strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_xflags = IFXF_MPSAFE;
@@ -2018,7 +2018,7 @@ em_dma_malloc(struct em_softc *sc, bus_size_t size,
size, 0, BUS_DMA_NOWAIT, &dma->dma_map);
if (r != 0) {
printf("%s: em_dma_malloc: bus_dmamap_create failed; "
- "error %u\n", sc->sc_dv.dv_xname, r);
+ "error %u\n", sc->sc_dev.dv_xname, r);
goto fail_0;
}
@@ -2026,7 +2026,7 @@ em_dma_malloc(struct em_softc *sc, bus_size_t size,
1, &dma->dma_nseg, BUS_DMA_NOWAIT);
if (r != 0) {
printf("%s: em_dma_malloc: bus_dmammem_alloc failed; "
- "size %lu, error %d\n", sc->sc_dv.dv_xname,
+ "size %lu, error %d\n", sc->sc_dev.dv_xname,
(unsigned long)size, r);
goto fail_1;
}
@@ -2035,7 +2035,7 @@ em_dma_malloc(struct em_softc *sc, bus_size_t size,
&dma->dma_vaddr, BUS_DMA_NOWAIT);
if (r != 0) {
printf("%s: em_dma_malloc: bus_dmammem_map failed; "
- "size %lu, error %d\n", sc->sc_dv.dv_xname,
+ "size %lu, error %d\n", sc->sc_dev.dv_xname,
(unsigned long)size, r);
goto fail_2;
}
@@ -2045,7 +2045,7 @@ em_dma_malloc(struct em_softc *sc, bus_size_t size,
mapflags | BUS_DMA_NOWAIT);
if (r != 0) {
printf("%s: em_dma_malloc: bus_dmamap_load failed; "
- "error %u\n", sc->sc_dv.dv_xname, r);
+ "error %u\n", sc->sc_dev.dv_xname, r);
goto fail_3;
}
@@ -2095,7 +2095,7 @@ em_allocate_transmit_structures(struct em_softc *sc)
if (!(sc->tx_buffer_area = mallocarray(sc->num_tx_desc,
sizeof(struct em_buffer), M_DEVBUF, M_NOWAIT | M_ZERO))) {
printf("%s: Unable to allocate tx_buffer memory\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
return (ENOMEM);
}
@@ -2128,7 +2128,7 @@ em_setup_transmit_structures(struct em_softc *sc)
MAX_JUMBO_FRAME_SIZE, 0, BUS_DMA_NOWAIT, &tx_buffer->map);
if (error != 0) {
printf("%s: Unable to create TX DMA map\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
goto fail;
}
tx_buffer++;
@@ -2466,7 +2466,7 @@ em_get_buf(struct em_softc *sc, int i)
if (pkt->m_head != NULL) {
printf("%s: em_get_buf: slot %d already has an mbuf\n",
- sc->sc_dv.dv_xname, i);
+ sc->sc_dev.dv_xname, i);
return (ENOBUFS);
}
@@ -2519,7 +2519,7 @@ em_allocate_receive_structures(struct em_softc *sc)
if (!(sc->rx_buffer_area = mallocarray(sc->num_rx_desc,
sizeof(struct em_buffer), M_DEVBUF, M_NOWAIT | M_ZERO))) {
printf("%s: Unable to allocate rx_buffer memory\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
return (ENOMEM);
}
@@ -2532,7 +2532,7 @@ em_allocate_receive_structures(struct em_softc *sc)
if (error != 0) {
printf("%s: em_allocate_receive_structures: "
"bus_dmamap_create failed; error %u\n",
- sc->sc_dv.dv_xname, error);
+ sc->sc_dev.dv_xname, error);
goto fail;
}
rx_buffer->m_head = NULL;
@@ -2574,7 +2574,7 @@ em_setup_receive_structures(struct em_softc *sc)
if (em_rxfill(sc) == 0) {
printf("%s: unable to fill any rx descriptors\n",
- sc->sc_dv.dv_xname);
+ sc->sc_dev.dv_xname);
}
return (0);
@@ -3274,7 +3274,7 @@ em_update_stats_counters(struct em_softc *sc)
void
em_print_hw_stats(struct em_softc *sc)
{
- const char * const unit = sc->sc_dv.dv_xname;
+ const char * const unit = sc->sc_dev.dv_xname;
printf("%s: Excessive collisions = %lld\n", unit,
(long long)sc->stats.ecol);
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index 40a8ef4d47f..1761affe25a 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.62 2016/01/07 03:56:03 dlg Exp $ */
+/* $OpenBSD: if_em.h,v 1.63 2016/01/07 04:21:36 dlg Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -310,7 +310,7 @@ typedef struct _DESCRIPTOR_PAIR
/* Our adapter structure */
struct em_softc {
- struct device sc_dv;
+ struct device sc_dev;
struct arpcom interface_data;
struct em_hw hw;
diff --git a/sys/dev/pci/if_em_soc.c b/sys/dev/pci/if_em_soc.c
index 5191bee0456..e9b575b2b6f 100644
--- a/sys/dev/pci/if_em_soc.c
+++ b/sys/dev/pci/if_em_soc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_em_soc.c,v 1.3 2015/03/18 12:04:26 dlg Exp $ */
+/* $OpenBSD: if_em_soc.c,v 1.4 2016/01/07 04:21:36 dlg Exp $ */
/*
* Copyright (c) 2009 Dariusz Swiderski <sfires@sfires.net>
@@ -77,7 +77,7 @@ gcu_miibus_readreg(struct em_hw *hw, int phy, int reg)
if (i >= GCU_MAX_ATTEMPTS) {
printf("%s: phy read timeout: phy %d, reg %d\n",
- sc->sc_dv.dv_xname, phy, reg);
+ sc->sc_dev.dv_xname, phy, reg);
return (0);
}
@@ -87,7 +87,7 @@ gcu_miibus_readreg(struct em_hw *hw, int phy, int reg)
if((data & MDIO_STATUS_STATUS_MASK) != 0) {
printf("%s: unable to read phy %d reg %d\n",
- sc->sc_dv.dv_xname, phy, reg);
+ sc->sc_dev.dv_xname, phy, reg);
return (0);
}
return (uint16_t) (data & MDIO_STATUS_READ_DATA_MASK);
@@ -125,7 +125,7 @@ gcu_miibus_writereg(struct em_hw *hw, int phy, int reg, int val)
if (i >= GCU_MAX_ATTEMPTS) {
printf("%s: phy read timeout: phy %d, reg %d\n",
- sc->sc_dv.dv_xname, phy, reg);
+ sc->sc_dev.dv_xname, phy, reg);
return;
}
}