summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-06-26 04:19:45 +0000
committerimp <imp@FreeBSD.org>2005-06-26 04:19:45 +0000
commit77c5d7a36d189d1c4f1b1d55847443a0cc46a001 (patch)
tree5035c08dd3f927e7b0ee6df0b81b0ebc2a05b11e /sys/dev/ep/if_ep.c
parent991a0a96327d5811129df168ecd42872b043cd28 (diff)
downloadFreeBSD-src-77c5d7a36d189d1c4f1b1d55847443a0cc46a001.zip
FreeBSD-src-77c5d7a36d189d1c4f1b1d55847443a0cc46a001.tar.gz
o When calling ep_get_macaddr(), provide it a local buffer. Add a comment
that says why we do this (or rather, explains that it is some voodoo magic that's poorly understood). The local buffer fixes the crash on attach. o Rename get_e() to ep_get_e() to avoid namespace pollution. Submitted by: mux Approved by: re (scottl)
Diffstat (limited to 'sys/dev/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 3fa7dc9..ee1e946 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -129,7 +129,7 @@ eeprom_rdy(struct ep_softc *sc)
* before
*/
int
-get_e(struct ep_softc *sc, uint16_t offset, uint16_t *result)
+ep_get_e(struct ep_softc *sc, uint16_t offset, uint16_t *result)
{
if (eeprom_rdy(sc))
@@ -158,7 +158,7 @@ ep_get_macaddr(struct ep_softc *sc, u_char *addr)
GO_WINDOW(sc, 0);
for (i = EEPROM_NODE_ADDR_0; i <= EEPROM_NODE_ADDR_2; i++) {
- error = get_e(sc, i, &result);
+ error = ep_get_e(sc, i, &result);
if (error)
return (error);
macaddr[i] = htons(result);
@@ -203,12 +203,12 @@ ep_alloc(device_t dev)
GO_WINDOW(sc, 0);
sc->epb.cmd_off = 0;
- error = get_e(sc, EEPROM_PROD_ID, &result);
+ error = ep_get_e(sc, EEPROM_PROD_ID, &result);
if (error)
goto bad;
sc->epb.prod_id = result;
- error = get_e(sc, EEPROM_RESOURCE_CFG, &result);
+ error = ep_get_e(sc, EEPROM_RESOURCE_CFG, &result);
if (error)
goto bad;
sc->epb.res_cfg = result;
OpenPOWER on IntegriCloud