aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cs
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2008-06-06 04:56:27 +0000
committerWarner Losh <imp@FreeBSD.org>2008-06-06 04:56:27 +0000
commitb893c8d09d9b87826174856152098d8dd34ea1c2 (patch)
tree2e0fb9d17fff452a62a66f832c055b92bb9ccb28 /sys/dev/cs
parentb97195edcc8afb47bf56e9ced88bce83af879e54 (diff)
Notes
Diffstat (limited to 'sys/dev/cs')
-rw-r--r--sys/dev/cs/if_cs.c20
-rw-r--r--sys/dev/cs/if_cs_isa.c3
-rw-r--r--sys/dev/cs/if_csreg.h3
-rw-r--r--sys/dev/cs/if_csvar.h4
4 files changed, 3 insertions, 27 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c
index 469344dd5b55..f53d6b05cd59 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 d89baf75d2b8..bc2f889c0439 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 dc844c8cc810..34aed9c62f00 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 2fe1236de6dc..c4a3eaf0b513 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 */