diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-19 19:15:05 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-07-19 19:15:05 +0000 |
commit | 08057e727fdcdb6c6ba50d195bf395de08620a67 (patch) | |
tree | 1cd35d824a7f63aad74c9dea5d9dac56212e93ea /sys/dev/usb/if_rum.c | |
parent | 38ae4a776beb6e5150d1491a543cfa9f9ac83c52 (diff) |
define rum_read() as rum_read_multi().
change the prototype to take a uin16_t instead of a uint32_t (register
offsets are 16bit).
Diffstat (limited to 'sys/dev/usb/if_rum.c')
-rw-r--r-- | sys/dev/usb/if_rum.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index e7b0d8a4345..17e409522fc 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.16 2006/07/19 19:10:52 damien Exp $ */ +/* $OpenBSD: if_rum.c,v 1.17 2006/07/19 19:15:04 damien Exp $ */ /*- * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org> @@ -122,7 +122,7 @@ void rum_watchdog(struct ifnet *); int rum_ioctl(struct ifnet *, u_long, caddr_t); void rum_eeprom_read(struct rum_softc *, uint16_t, void *, int); -uint32_t rum_read(struct rum_softc *, uint32_t); +uint32_t rum_read(struct rum_softc *, uint16_t); void rum_read_multi(struct rum_softc *, uint16_t, void *, int); void rum_write(struct rum_softc *, uint16_t, uint32_t); @@ -1405,24 +1405,11 @@ rum_eeprom_read(struct rum_softc *sc, uint16_t addr, void *buf, int len) } uint32_t -rum_read(struct rum_softc *sc, uint32_t reg) +rum_read(struct rum_softc *sc, uint16_t reg) { - usb_device_request_t req; - usbd_status error; uint32_t val; - req.bmRequestType = UT_READ_VENDOR_DEVICE; - req.bRequest = RT2573_READ_MAC; - USETW(req.wValue, 0); - USETW(req.wIndex, reg); - USETW(req.wLength, sizeof (uint32_t)); - - error = usbd_do_request(sc->sc_udev, &req, &val); - if (error != 0) { - printf("%s: could not read MAC register: %s\n", - USBDEVNAME(sc->sc_dev), usbd_errstr(error)); - return 0; - } + rum_read_multi(sc, reg, &val, sizeof val); return le32toh(val); } |