From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:31:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 217D5DD4; Thu, 8 Nov 2012 16:31:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E09178FC0A; Thu, 8 Nov 2012 16:31:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GVDvX011603; Thu, 8 Nov 2012 16:31:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GVDlG011602; Thu, 8 Nov 2012 16:31:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081631.qA8GVDlG011602@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242777 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:31:14 -0000 Author: hselasky Date: Thu Nov 8 16:31:13 2012 New Revision: 242777 URL: http://svnweb.freebsd.org/changeset/base/242777 Log: Make the USB ethernet methods constant again in if_udav.c, so that both adapter variants can be attached at the same time. MFC after: 0 days Modified: head/sys/dev/usb/net/if_udav.c Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Nov 8 16:17:52 2012 (r242776) +++ head/sys/dev/usb/net/if_udav.c Thu Nov 8 16:31:13 2012 (r242777) @@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); -static struct usb_ether_methods udav_ue_methods = { +static const struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, .ue_start = udav_start, .ue_init = udav_init, @@ -181,6 +181,15 @@ static struct usb_ether_methods udav_ue_ .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -264,17 +273,16 @@ udav_attach(device_t dev) * 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; + ue->ue_methods = &udav_ue_methods_nophy; sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; } ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) {