From owner-svn-src-head@freebsd.org Thu May 31 02:22:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECCC0EF66F1; Thu, 31 May 2018 02:22:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90CC168ACC; Thu, 31 May 2018 02:22:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7209113E01; Thu, 31 May 2018 02:22:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4V2MeOI057891; Thu, 31 May 2018 02:22:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4V2Mefr057890; Thu, 31 May 2018 02:22:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805310222.w4V2Mefr057890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 31 May 2018 02:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334410 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 334410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Thu, 31 May 2018 02:22:41 -0000 Author: np Date: Thu May 31 02:22:40 2018 New Revision: 334410 URL: https://svnweb.freebsd.org/changeset/base/334410 Log: cxgbe(4): Use ifm for ifmedia just like the rest of the kernel. No functional change. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 31 02:10:50 2018 (r334409) +++ head/sys/dev/cxgbe/t4_main.c Thu May 31 02:22:40 2018 (r334410) @@ -4167,17 +4167,17 @@ t4_set_desc(struct adapter *sc) } static inline void -ifmedia_add4(struct ifmedia *media, int m) +ifmedia_add4(struct ifmedia *ifm, int m) { - ifmedia_add(media, m, 0, NULL); - ifmedia_add(media, m | IFM_ETH_TXPAUSE, 0, NULL); - ifmedia_add(media, m | IFM_ETH_RXPAUSE, 0, NULL); - ifmedia_add(media, m | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE, 0, NULL); + ifmedia_add(ifm, m, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_TXPAUSE, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_RXPAUSE, 0, NULL); + ifmedia_add(ifm, m | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE, 0, NULL); } static void -set_current_media(struct port_info *pi, struct ifmedia *media) +set_current_media(struct port_info *pi, struct ifmedia *ifm) { struct link_config *lc; int mword; @@ -4185,15 +4185,15 @@ set_current_media(struct port_info *pi, struct ifmedia PORT_LOCK_ASSERT_OWNED(pi); /* Leave current media alone if it's already set to IFM_NONE. */ - if (media->ifm_cur != NULL && - IFM_SUBTYPE(media->ifm_cur->ifm_media) == IFM_NONE) + if (ifm->ifm_cur != NULL && + IFM_SUBTYPE(ifm->ifm_cur->ifm_media) == IFM_NONE) return; mword = IFM_ETHER; lc = &pi->link_cfg; if (lc->requested_aneg == AUTONEG_ENABLE && lc->supported & FW_PORT_CAP_ANEG) { - ifmedia_set(media, mword | IFM_AUTO); + ifmedia_set(ifm, mword | IFM_AUTO); return; } if (lc->requested_fc & PAUSE_TX) @@ -4201,11 +4201,11 @@ set_current_media(struct port_info *pi, struct ifmedia if (lc->requested_fc & PAUSE_RX) mword |= IFM_ETH_RXPAUSE; mword |= port_mword(pi, speed_to_fwspeed(lc->requested_speed)); - ifmedia_set(media, mword); + ifmedia_set(ifm, mword); } static void -build_medialist(struct port_info *pi, struct ifmedia *media) +build_medialist(struct port_info *pi, struct ifmedia *ifm) { uint16_t ss, speed; int unknown, mword, bit; @@ -4226,15 +4226,15 @@ build_medialist(struct port_info *pi, struct ifmedia * /* * Now (re)build the ifmedia list. */ - ifmedia_removeall(media); + ifmedia_removeall(ifm); lc = &pi->link_cfg; ss = G_FW_PORT_CAP_SPEED(lc->supported); /* Supported Speeds */ if (__predict_false(ss == 0)) { /* not supposed to happen. */ MPASS(ss != 0); no_media: - MPASS(LIST_EMPTY(&media->ifm_list)); - ifmedia_add(media, IFM_ETHER | IFM_NONE, 0, NULL); - ifmedia_set(media, IFM_ETHER | IFM_NONE); + MPASS(LIST_EMPTY(&ifm->ifm_list)); + ifmedia_add(ifm, IFM_ETHER | IFM_NONE, 0, NULL); + ifmedia_set(ifm, IFM_ETHER | IFM_NONE); return; } @@ -4249,15 +4249,15 @@ no_media: } else if (mword == IFM_UNKNOWN) unknown++; else - ifmedia_add4(media, IFM_ETHER | mword); + ifmedia_add4(ifm, IFM_ETHER | mword); } } if (unknown > 0) /* Add one unknown for all unknown media types. */ - ifmedia_add4(media, IFM_ETHER | IFM_UNKNOWN); + ifmedia_add4(ifm, IFM_ETHER | IFM_UNKNOWN); if (lc->supported & FW_PORT_CAP_ANEG) - ifmedia_add(media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_add(ifm, IFM_ETHER | IFM_AUTO, 0, NULL); - set_current_media(pi, media); + set_current_media(pi, ifm); } /*