source:
hybrid/branches/releng-9/nanobsd/patches/udav-broken-phy.patch@
12219
Last change on this file since 12219 was 12219, checked in by , 12 years ago | |
---|---|
File size: 2.3 KB |
-
sys/dev/usb/net/if_udav.c
#------------------------------------------------------------------------ #r238466 | rpaulo | 2012-07-15 07:49:02 +0200 (Sun, 15 Jul 2012) | 4 lines # #The JP1082 device doesn't respond to the MII_BMSR command and it turns #out that it has an unusable PHY. It still works, although very slowly, #without a PHY, so I implemented non-PHY support in the udav driver. # #------------------------------------------------------------------------
169 169 MODULE_DEPEND(udav, miibus, 1, 1, 1); 170 170 MODULE_VERSION(udav, 1); 171 171 172 static conststruct usb_ether_methods udav_ue_methods = {172 static struct usb_ether_methods udav_ue_methods = { 173 173 .ue_attach_post = udav_attach_post, 174 174 .ue_start = udav_start, 175 175 .ue_init = udav_init, … … 206 206 {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, 207 207 /* Kontron AG USB Ethernet */ 208 208 {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, 209 {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, 209 {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 210 UDAV_FLAG_NO_PHY)}, 210 211 }; 211 212 212 213 static void … … 259 260 goto detach; 260 261 } 261 262 263 /* 264 * The JP1082 has an unusable PHY and provides no link information. 265 */ 266 if (sc->sc_flags & UDAV_FLAG_NO_PHY) { 267 udav_ue_methods.ue_tick = NULL; 268 udav_ue_methods.ue_mii_upd = NULL; 269 udav_ue_methods.ue_mii_sts = NULL; 270 sc->sc_flags |= UDAV_FLAG_LINK; 271 } 272 262 273 ue->ue_sc = sc; 263 274 ue->ue_dev = dev; 264 275 ue->ue_udev = uaa->device; … … 712 723 UDAV_LOCK_ASSERT(sc, MA_OWNED); 713 724 714 725 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; 715 sc->sc_flags &= ~UDAV_FLAG_LINK; 726 if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) 727 sc->sc_flags &= ~UDAV_FLAG_LINK; 716 728 717 729 /* 718 730 * stop all the transfers, if not already stopped: -
sys/dev/usb/net/if_udavreg.h
159 159 int sc_flags; 160 160 #define UDAV_FLAG_LINK 0x0001 161 161 #define UDAV_FLAG_EXT_PHY 0x0040 162 #define UDAV_FLAG_NO_PHY 0x0080 162 163 }; 163 164 164 165 #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
Note:
See TracBrowser
for help on using the repository browser.