From owner-svn-src-stable-10@FreeBSD.ORG Fri May 29 05:58:22 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04C9562A; Fri, 29 May 2015 05:58:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5DC11368; Fri, 29 May 2015 05:58:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4T5wL96027203; Fri, 29 May 2015 05:58:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4T5wL8q027202; Fri, 29 May 2015 05:58:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201505290558.t4T5wL8q027202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 29 May 2015 05:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283682 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 05:58:22 -0000 Author: arybchik Date: Fri May 29 05:58:21 2015 New Revision: 283682 URL: https://svnweb.freebsd.org/changeset/base/283682 Log: MFC: r283599 sfxge: mask ifmedia options (pauses) when looking for matching mode Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_port.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Fri May 29 05:50:33 2015 (r283681) +++ stable/10/sys/dev/sfxge/sfxge_port.c Fri May 29 05:58:21 2015 (r283682) @@ -710,6 +710,8 @@ sfxge_link_mode_to_phy_cap(efx_link_mode static int sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask) { + /* Get global options (duplex), type and subtype bits */ + int ifmedia_masked = ifmedia & (IFM_GMASK | IFM_NMASK | IFM_TMASK); efx_phy_media_type_t medium_type; boolean_t mode_found = B_FALSE; uint32_t cap_mask, mode_cap_mask; @@ -725,7 +727,7 @@ sfxge_phy_cap_mask(struct sfxge_softc *s efx_phy_adv_cap_get(sc->enp, EFX_PHY_CAP_PERM, &cap_mask); for (mode = EFX_LINK_10HDX; mode < EFX_LINK_NMODES; mode++) { - if (ifmedia == sfxge_link_mode[medium_type][mode]) { + if (ifmedia_masked == sfxge_link_mode[medium_type][mode]) { mode_found = B_TRUE; break; } @@ -736,8 +738,8 @@ sfxge_phy_cap_mask(struct sfxge_softc *s * If media is not in the table, it must be IFM_AUTO. */ KASSERT((cap_mask & (1 << EFX_PHY_CAP_AN)) && - ifmedia == (IFM_ETHER | IFM_AUTO), - ("%s: no mode for media %d", __func__, ifmedia)); + ifmedia_masked == (IFM_ETHER | IFM_AUTO), + ("%s: no mode for media %#x", __func__, ifmedia)); *phy_cap_mask = (cap_mask & ~(1 << EFX_PHY_CAP_ASYM)); return (0); }