mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
MFC r200519-200522
r200519: Remove register keyword. r200520: Prefer device_printf(9) to printf(9). r200521: Fix spelling in comment. r200522: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9).
This commit is contained in:
parent
6d2fb73028
commit
f2940816a8
1 changed files with 14 additions and 15 deletions
|
|
@ -233,7 +233,7 @@ vge_eeprom_getword(sc, addr, dest)
|
|||
int addr;
|
||||
u_int16_t *dest;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
u_int16_t word = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -536,7 +536,7 @@ fail:
|
|||
/*
|
||||
* Program the multicast filter. We use the 64-entry CAM filter
|
||||
* for perfect filtering. If there's more than 64 multicast addresses,
|
||||
* we use the hash filter insted.
|
||||
* we use the hash filter instead.
|
||||
*/
|
||||
static void
|
||||
vge_setmulti(sc)
|
||||
|
|
@ -602,7 +602,7 @@ static void
|
|||
vge_reset(sc)
|
||||
struct vge_softc *sc;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET);
|
||||
|
||||
|
|
@ -918,10 +918,9 @@ vge_attach(dev)
|
|||
u_char eaddr[ETHER_ADDR_LEN];
|
||||
struct vge_softc *sc;
|
||||
struct ifnet *ifp;
|
||||
int unit, error = 0, rid;
|
||||
int error = 0, rid;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
unit = device_get_unit(dev);
|
||||
sc->vge_dev = dev;
|
||||
|
||||
mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
|
|
@ -934,22 +933,22 @@ vge_attach(dev)
|
|||
pci_enable_busmaster(dev);
|
||||
|
||||
rid = VGE_PCI_LOMEM;
|
||||
sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
|
||||
RF_ACTIVE);
|
||||
|
||||
if (sc->vge_res == NULL) {
|
||||
printf ("vge%d: couldn't map ports/memory\n", unit);
|
||||
device_printf(dev, "couldn't map ports/memory\n");
|
||||
error = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate interrupt */
|
||||
rid = 0;
|
||||
sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
|
||||
0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
|
||||
sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||||
RF_SHAREABLE | RF_ACTIVE);
|
||||
|
||||
if (sc->vge_irq == NULL) {
|
||||
printf("vge%d: couldn't map interrupt\n", unit);
|
||||
device_printf(dev, "couldn't map interrupt\n");
|
||||
error = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -1027,7 +1026,7 @@ vge_attach(dev)
|
|||
NULL, vge_intr, sc, &sc->vge_intrhand);
|
||||
|
||||
if (error) {
|
||||
printf("vge%d: couldn't set up irq\n", unit);
|
||||
device_printf(dev, "couldn't set up irq\n");
|
||||
ether_ifdetach(ifp);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -1179,7 +1178,7 @@ vge_newbuf(sc, idx, m)
|
|||
|
||||
/*
|
||||
* Note: the manual fails to document the fact that for
|
||||
* proper opration, the driver needs to replentish the RX
|
||||
* proper operation, the driver needs to replenish the RX
|
||||
* DMA ring 4 descriptors at a time (rather than one at a
|
||||
* time, like most chips). We can allocate the new buffers
|
||||
* but we should not set the OWN bits until we're ready
|
||||
|
|
@ -1971,7 +1970,7 @@ vge_init_locked(struct vge_softc *sc)
|
|||
|
||||
/*
|
||||
* Configure one-shot timer for microsecond
|
||||
* resulution and load it for 500 usecs.
|
||||
* resolution and load it for 500 usecs.
|
||||
*/
|
||||
CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES);
|
||||
CSR_WRITE_2(sc, VGE_SSTIMER, 400);
|
||||
|
|
@ -2261,7 +2260,7 @@ static void
|
|||
vge_stop(sc)
|
||||
struct vge_softc *sc;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
struct ifnet *ifp;
|
||||
|
||||
VGE_LOCK_ASSERT(sc);
|
||||
|
|
|
|||
Loading…
Reference in a new issue