Changeset 275
- Timestamp:
- Feb 13, 2011, 3:01:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mos-driver/if_mos.c
r273 r275 128 128 #include <dev/usb/net/usb_ethernet.h> 129 129 130 // #include <dev/usb/net/if_mosreg.h>130 // #include <dev/usb/net/if_mosreg.h> 131 131 #include "if_mosreg.h" 132 132 133 133 #ifdef USB_DEBUG 134 static int mos_debug = 10;134 static int mos_debug = 0; 135 135 136 136 SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); … … 289 289 mos_reg_read_2(struct mos_softc *sc, int reg) 290 290 { 291 struct usb_device_request req;292 usb_error_t err;293 uWord val;294 295 USETW(val, 0);296 297 req.bmRequestType = UT_READ_VENDOR_DEVICE;298 req.bRequest = MOS_UR_READREG;299 USETW(req.wValue, 0);300 USETW(req.wIndex, reg);301 USETW(req.wLength, 2);302 303 err = uether_do_request(&sc->sc_ue, &req, &val, 1000);304 305 if (err) {306 MOS_DPRINTFN("mos_reg_read_2 error, reg: %d", reg);307 return (-1);308 }309 return (UGETW(val));291 struct usb_device_request req; 292 usb_error_t err; 293 uWord val; 294 295 USETW(val, 0); 296 297 req.bmRequestType = UT_READ_VENDOR_DEVICE; 298 req.bRequest = MOS_UR_READREG; 299 USETW(req.wValue, 0); 300 USETW(req.wIndex, reg); 301 USETW(req.wLength, 2); 302 303 err = uether_do_request(&sc->sc_ue, &req, &val, 1000); 304 305 if (err) { 306 MOS_DPRINTFN("mos_reg_read_2 error, reg: %d", reg); 307 return (-1); 308 } 309 return (UGETW(val)); 310 310 } 311 311 … … 473 473 break; 474 474 } 475 if (i == MOS_TIMEOUT) {475 if (i == MOS_TIMEOUT) 476 476 MOS_DPRINTFN("MII write timeout"); 477 } 477 478 478 if (!locked) 479 479 MOS_UNLOCK(sc); … … 681 681 return (ENXIO); 682 682 } 683 684 683 if (uaa->info.bConfigNum != MOS_CONFIG_NO) { 685 684 DPRINTFN(11, "mos: not MOS_CONFIG_NO %i vs %i\n", uaa->info.bConfigNum, MOS_CONFIG_NO); … … 761 760 int err = mos_readmac(sc, ue->ue_eaddr); 762 761 763 if (err) {764 765 } 762 if (err) 763 MOS_DPRINTFN("couldn't get MAC address"); 764 766 765 MOS_DPRINTFN("address: %s", ether_sprintf(ue->ue_eaddr)); 767 766
Note:
See TracChangeset
for help on using the changeset viewer.