From nobody Tue Dec 14 18:26:59 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D258518D6488; Tue, 14 Dec 2021 18:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JD6Kb1w2nz4f7j; Tue, 14 Dec 2021 18:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F71355C3; Tue, 14 Dec 2021 18:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BEIQxrl028489; Tue, 14 Dec 2021 18:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BEIQxex028488; Tue, 14 Dec 2021 18:26:59 GMT (envelope-from git) Date: Tue, 14 Dec 2021 18:26:59 GMT Message-Id: <202112141826.1BEIQxex028488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 483e464ed432 - main - isp(4): Allow more than 2 ports to read WWNs from NVRAM. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 483e464ed4325a0710485925ecfbe0e1c8d6bb02 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639506419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jpl8eAwAASegP6bKJj+Urro44jVaWkq4At0RjlD0Qq8=; b=mX0gXMcVxehC5lTv7kQ4rQo0E/kPPtmmDayNg+ivJnJHBRH9WJrP5Priyjr/94KY0G+awS n/dcjHAbfhmAuvcpCtnSRHi4qGu8Nkh2PrJSI/P5gATfgg4tWRrGg7kjgFmIq251DyGz3Q 38PuYjVnLboh/Mwl27mHaAa6w1CoHU0gdQl693SywiiJnl+BJFwtCLUxqevgvCarr8/VCB 7N6fzCVE899MeTXJxPYwdiCCaW0CM4OYLfXKIbKX6yHBvN8pwoglhvV/p+kxo3G7v6MJoJ ogmzEAay4gi3ufUlDvWPxhhsvP7Q3HDUE9Wq6vgBpspqF5ob2HjM2FC/HAL8Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639506419; a=rsa-sha256; cv=none; b=pssWTB1Qztey2YAt0yB6LVrQy+MqhWuVwm32wsocxRdTQjfp4UubKsI1Aqg/7qs1cOXjYs HmMGlSY3Uzn4MVTzoVPZsk8CBqxtgYQ9zO26sn6IVYmQmKzk51s6iXwiBmW29z/TTPzG8i Y2PRKUge5Y+q01Read/8AeeoB2j4LWacXp2iyz8ECqKKI8aLS8bbxitFwahmbgLzxxQE9P t13ec0Dxlz0XKKw40not6TQZYUtT+75tm1e8u3tAX+jxs20gK7GdOkY7HErS3LoUBORfzu 6Uaal+RmAjm45YEKrzES9KCckQVfIhbbmjmq9QmcZwmU+PVcqwzc3NDEEBvtlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=483e464ed4325a0710485925ecfbe0e1c8d6bb02 commit 483e464ed4325a0710485925ecfbe0e1c8d6bb02 Author: Alexander Motin AuthorDate: 2021-12-14 18:20:14 +0000 Commit: Alexander Motin CommitDate: 2021-12-14 18:26:44 +0000 isp(4): Allow more than 2 ports to read WWNs from NVRAM. It appears at least on QLE2694L cards 3rd and 4th ports follow the same NVRAM addressing logic as the first two. In lack of proper documentation this guess is as good as it can be. MFC after: 1 week Sponsored by: iXsystems, Inc. --- sys/dev/isp/isp.c | 7 +------ sys/dev/isp/ispreg.h | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index 5d1c824deff4..c3470529657e 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -4333,12 +4333,7 @@ isp_read_nvram_2400(ispsoftc_t *isp) uint32_t addr, csum, lwrds, *dptr; uint8_t nvram_data[ISP2400_NVRAM_SIZE]; - if (isp->isp_port) { - addr = ISP2400_NVRAM_PORT1_ADDR; - } else { - addr = ISP2400_NVRAM_PORT0_ADDR; - } - + addr = ISP2400_NVRAM_PORT_ADDR(isp->isp_port); dptr = (uint32_t *) nvram_data; for (lwrds = 0; lwrds < ISP2400_NVRAM_SIZE >> 2; lwrds++) { isp_rd_2400_nvram(isp, addr++, dptr++); diff --git a/sys/dev/isp/ispreg.h b/sys/dev/isp/ispreg.h index 5d04ad2b4400..98b9a6c0bf0d 100644 --- a/sys/dev/isp/ispreg.h +++ b/sys/dev/isp/ispreg.h @@ -213,8 +213,7 @@ typedef struct { /* * Qlogic 2400 NVRAM is an array of 512 bytes with a 32 bit checksum. */ -#define ISP2400_NVRAM_PORT0_ADDR 0x80 -#define ISP2400_NVRAM_PORT1_ADDR 0x180 +#define ISP2400_NVRAM_PORT_ADDR(c) (0x100 * (c) + 0x80) #define ISP2400_NVRAM_SIZE 512 #define ISP2400_NVRAM_VERSION(c) ((c)[4] | ((c)[5] << 8))