From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 07:14:13 2015 Return-Path: Delivered-To: svn-src-head@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 D560BF48; Sun, 22 Feb 2015 07:14:13 +0000 (UTC) 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 A697884D; Sun, 22 Feb 2015 07:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1M7ED3A062512; Sun, 22 Feb 2015 07:14:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1M7EDNR062511; Sun, 22 Feb 2015 07:14:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502220714.t1M7EDNR062511@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 22 Feb 2015 07:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279143 - head/sys/dev/sfxge/common 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.18-1 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, 22 Feb 2015 07:14:13 -0000 Author: arybchik Date: Sun Feb 22 07:14:12 2015 New Revision: 279143 URL: https://svnweb.freebsd.org/changeset/base/279143 Log: sfxge: use common definitions of MC shared memory offsets and PDU length Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Sun Feb 22 07:11:55 2015 (r279142) +++ head/sys/dev/sfxge/common/efx_mcdi.c Sun Feb 22 07:14:12 2015 (r279143) @@ -35,15 +35,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_MCDI -/* Shared memory layout */ - -#define MCDI_P1_DBL_OFST 0x0 -#define MCDI_P2_DBL_OFST 0x1 -#define MCDI_P1_PDU_OFST 0x2 -#define MCDI_P2_PDU_OFST 0x42 -#define MCDI_P1_REBOOT_OFST 0x1fe -#define MCDI_P2_REBOOT_OFST 0x1ff - /* * A reboot/assertion causes the MCDI status word to be set after the * command word is set or a REBOOT event is sent. If we notice a reboot @@ -72,12 +63,12 @@ efx_mcdi_request_start( switch (emip->emi_port) { case 1: - pdur = MCDI_P1_PDU_OFST; - dbr = MCDI_P1_DBL_OFST; + pdur = MC_SMEM_P0_PDU_OFST >> 2; + dbr = MC_SMEM_P0_DOORBELL_OFST >> 2; break; case 2: - pdur = MCDI_P2_PDU_OFST; - dbr = MCDI_P2_DBL_OFST; + pdur = MC_SMEM_P1_PDU_OFST >> 2; + dbr = MC_SMEM_P1_DOORBELL_OFST >> 2; break; default: EFSYS_ASSERT(0); @@ -140,7 +131,9 @@ efx_mcdi_request_copyout( unsigned int pdur; efx_dword_t data; - pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST; + pdur = (emip->emi_port == 1) + ? MC_SMEM_P0_PDU_OFST >> 2 + : MC_SMEM_P1_PDU_OFST >> 2; /* Copy payload out if caller supplied buffer */ if (emrp->emr_out_buf != NULL) { @@ -227,8 +220,8 @@ efx_mcdi_poll_reboot( EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); rebootr = ((emip->emi_port == 1) - ? MCDI_P1_REBOOT_OFST - : MCDI_P2_REBOOT_OFST); + ? MC_SMEM_P0_STATUS_OFST >> 2 + : MC_SMEM_P1_STATUS_OFST >> 2); EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE); value = EFX_DWORD_FIELD(dword, EFX_DWORD_0); @@ -281,7 +274,9 @@ efx_mcdi_request_poll( } EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); - pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST; + pdur = (emip->emi_port == 1) + ? MC_SMEM_P0_PDU_OFST >> 2 + : MC_SMEM_P1_PDU_OFST >> 2; /* Read the command header */ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE);