From owner-svn-src-head@freebsd.org Thu Sep 22 18:47:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7155ABE5455; Thu, 22 Sep 2016 18:47:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 41BC19A4; Thu, 22 Sep 2016 18:47:08 +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 u8MIl7LM041316; Thu, 22 Sep 2016 18:47:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MIl7Tb041315; Thu, 22 Sep 2016 18:47:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609221847.u8MIl7Tb041315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 22 Sep 2016 18:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306206 - head/sys/dev/cxgbe X-SVN-Group: head 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.23 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, 22 Sep 2016 18:47:08 -0000 Author: np Date: Thu Sep 22 18:47:07 2016 New Revision: 306206 URL: https://svnweb.freebsd.org/changeset/base/306206 Log: cxgbe(4): Catch up with the different layout of WHOAMI in T6. Note that the code moved below t4_prep_adapter() as part of this change because now it needs a working chip_id(). Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Sep 22 18:45:25 2016 (r306205) +++ head/sys/dev/cxgbe/t4_main.c Thu Sep 22 18:47:07 2016 (r306206) @@ -812,15 +812,6 @@ t4_attach(device_t dev) if (rc != 0) goto done; /* error message displayed already */ - /* - * This is the real PF# to which we're attaching. Works from within PCI - * passthrough environments too, where pci_get_function() could return a - * different PF# depending on the passthrough configuration. We need to - * use the real PF# in all our communication with the firmware. - */ - sc->pf = G_SOURCEPF(t4_read_reg(sc, A_PL_WHOAMI)); - sc->mbox = sc->pf; - memset(sc->chan_map, 0xff, sizeof(sc->chan_map)); /* Prepare the adapter for operation. */ @@ -832,6 +823,16 @@ t4_attach(device_t dev) goto done; } + /* + * This is the real PF# to which we're attaching. Works from within PCI + * passthrough environments too, where pci_get_function() could return a + * different PF# depending on the passthrough configuration. We need to + * use the real PF# in all our communication with the firmware. + */ + j = t4_read_reg(sc, A_PL_WHOAMI); + sc->pf = chip_id(sc) <= CHELSIO_T5 ? G_SOURCEPF(j) : G_T6_SOURCEPF(j); + sc->mbox = sc->pf; + t4_init_devnames(sc); if (sc->names == NULL) { rc = ENOTSUP;