From owner-svn-src-head@FreeBSD.ORG Sun Jul 15 05:49:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C64106566B; Sun, 15 Jul 2012 05:49:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353E68FC0A; Sun, 15 Jul 2012 05:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5n3hD029231; Sun, 15 Jul 2012 05:49:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5n2jg029228; Sun, 15 Jul 2012 05:49:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201207150549.q6F5n2jg029228@svn.freebsd.org> From: Rui Paulo Date: Sun, 15 Jul 2012 05:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238466 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:49:03 -0000 Author: rpaulo Date: Sun Jul 15 05:49:02 2012 New Revision: 238466 URL: http://svn.freebsd.org/changeset/base/238466 Log: 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. Modified: head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_udavreg.h Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Sun Jul 15 05:41:43 2012 (r238465) +++ head/sys/dev/usb/net/if_udav.c Sun Jul 15 05:49:02 2012 (r238466) @@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); -static const struct usb_ether_methods udav_ue_methods = { +static struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, .ue_start = udav_start, .ue_init = udav_init, @@ -206,7 +206,8 @@ static const STRUCT_USB_HOST_ID udav_dev {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, }; static void @@ -259,6 +260,16 @@ udav_attach(device_t dev) goto detach; } + /* + * The JP1082 has an unusable PHY and provides no link information. + */ + if (sc->sc_flags & UDAV_FLAG_NO_PHY) { + udav_ue_methods.ue_tick = NULL; + udav_ue_methods.ue_mii_upd = NULL; + udav_ue_methods.ue_mii_sts = NULL; + sc->sc_flags |= UDAV_FLAG_LINK; + } + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; @@ -712,7 +723,8 @@ udav_stop(struct usb_ether *ue) UDAV_LOCK_ASSERT(sc, MA_OWNED); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_flags &= ~UDAV_FLAG_LINK; + if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) + sc->sc_flags &= ~UDAV_FLAG_LINK; /* * stop all the transfers, if not already stopped: Modified: head/sys/dev/usb/net/if_udavreg.h ============================================================================== --- head/sys/dev/usb/net/if_udavreg.h Sun Jul 15 05:41:43 2012 (r238465) +++ head/sys/dev/usb/net/if_udavreg.h Sun Jul 15 05:49:02 2012 (r238466) @@ -159,6 +159,7 @@ struct udav_softc { int sc_flags; #define UDAV_FLAG_LINK 0x0001 #define UDAV_FLAG_EXT_PHY 0x0040 +#define UDAV_FLAG_NO_PHY 0x0080 }; #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)