diff options
author | imp <imp@FreeBSD.org> | 2008-06-06 04:56:27 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-06-06 04:56:27 +0000 |
commit | 50f80e694a91c15bfc41256ebfe514ad8e6f9164 (patch) | |
tree | 2e0fb9d17fff452a62a66f832c055b92bb9ccb28 | |
parent | 0b0cad411e66581ed9af3237ccc481bf5103d94f (diff) | |
download | FreeBSD-src-50f80e694a91c15bfc41256ebfe514ad8e6f9164.zip FreeBSD-src-50f80e694a91c15bfc41256ebfe514ad8e6f9164.tar.gz |
Remove unused fields in softc. If they are ever really needed again,
they can re-added. Remove CS_NAME. Don't whine when there's an
ignored checksum error: User has said STFU, so we should S the FU.
(remove mandated properties).
-rw-r--r-- | sys/dev/cs/if_cs.c | 20 | ||||
-rw-r--r-- | sys/dev/cs/if_cs_isa.c | 3 | ||||
-rw-r--r-- | sys/dev/cs/if_csreg.h | 3 | ||||
-rw-r--r-- | sys/dev/cs/if_csvar.h | 4 |
4 files changed, 3 insertions, 27 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index 469344d..f53d6b0 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -137,7 +137,7 @@ get_eeprom_data(struct cs_softc *sc, int off, int len, uint16_t *buffer) int i; #ifdef CS_DEBUG - printf(CS_NAME":EEPROM data from %x for %x:\n", off, len); + device_printf(sc->sc_dev, "EEPROM data from %x for %x:\n", off, len); #endif for (i=0; i < len; i++) { @@ -150,8 +150,7 @@ get_eeprom_data(struct cs_softc *sc, int off, int len, uint16_t *buffer) buffer[i] = cs_readreg(sc, PP_EEData); #ifdef CS_DEBUG - printf("%02x %02x ",(unsigned char)buffer[i], - (unsigned char)buffer[i] >> 8); + printf("%04x ",buffer[i]); #endif } @@ -170,12 +169,8 @@ get_eeprom_cksum(int off, int len, uint16_t *buffer) for (i = 0; i < len; i++) cksum += buffer[i]; cksum &= 0xffff; - if (cksum==0) + if (cksum == 0 || cs_ignore_cksum_failure) return (0); - if (cs_ignore_cksum_failure) { - printf(CS_NAME": checksum mismatch, ignoring\n"); - return (0); - } return (-1); } @@ -475,7 +470,6 @@ cs_alloc_port(device_t dev, int rid, int size) return (ENOENT); sc->port_rid = rid; sc->port_res = res; - sc->port_used = size; return (0); } @@ -492,9 +486,6 @@ cs_alloc_memory(device_t dev, int rid, int size) 0ul, ~0ul, size, RF_ACTIVE); if (res == NULL) return (ENOENT); - sc->mem_rid = rid; - sc->mem_res = res; - sc->mem_used = size; return (0); } @@ -529,11 +520,6 @@ cs_release_resources(device_t dev) sc->port_rid, sc->port_res); sc->port_res = 0; } - if (sc->mem_res) { - bus_release_resource(dev, SYS_RES_MEMORY, - sc->mem_rid, sc->mem_res); - sc->mem_res = 0; - } if (sc->irq_res) { bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq_res); diff --git a/sys/dev/cs/if_cs_isa.c b/sys/dev/cs/if_cs_isa.c index d89baf7..bc2f889 100644 --- a/sys/dev/cs/if_cs_isa.c +++ b/sys/dev/cs/if_cs_isa.c @@ -92,9 +92,6 @@ cs_isa_attach(device_t dev) struct cs_softc *sc = device_get_softc(dev); cs_alloc_port(dev, 0, CS_89x0_IO_PORTS); - /* XXX mem appears to not be used at all */ - if (sc->mem_used) - cs_alloc_memory(dev, sc->mem_rid, sc->mem_used); cs_alloc_irq(dev, sc->irq_rid, 0); return (cs_attach(dev)); diff --git a/sys/dev/cs/if_csreg.h b/sys/dev/cs/if_csreg.h index dc844c8..34aed9c6 100644 --- a/sys/dev/cs/if_csreg.h +++ b/sys/dev/cs/if_csreg.h @@ -518,9 +518,6 @@ #define CS_DUPLEX_FULL 1 #define CS_DUPLEX_HALF 2 -/* Device name */ -#define CS_NAME "cs" - /* * It would appear that for pccards (well, the IBM EtherJet PCMCIA card) that * are connected to card bus bridges there's a problem. For reading the diff --git a/sys/dev/cs/if_csvar.h b/sys/dev/cs/if_csvar.h index 2fe1236..c4a3eaf 100644 --- a/sys/dev/cs/if_csvar.h +++ b/sys/dev/cs/if_csvar.h @@ -50,11 +50,7 @@ struct cs_softc { struct ifmedia media; /* Media information */ int port_rid; /* resource id for port range */ - int port_used; /* nonzero if ports used */ struct resource* port_res; /* resource for port range */ - int mem_rid; /* resource id for memory range */ - int mem_used; /* nonzero if memory used */ - struct resource* mem_res; /* resource for memory range */ int irq_rid; /* resource id for irq */ struct resource* irq_res; /* resource for irq */ void* irq_handle; /* handle for irq handler */ |