From nobody Tue Dec 21 01:06:36 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 EE7B71904752; Tue, 21 Dec 2021 01:06:36 +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 4JHyvw55NYz4Txm; Tue, 21 Dec 2021 01:06:36 +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 90A54205DD; Tue, 21 Dec 2021 01:06:36 +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 1BL16an8025079; Tue, 21 Dec 2021 01:06:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BL16a33025078; Tue, 21 Dec 2021 01:06:36 GMT (envelope-from git) Date: Tue, 21 Dec 2021 01:06:36 GMT Message-Id: <202112210106.1BL16a33025078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: dd8d32c66972 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dd8d32c669724b1e47107204afef2ef5e9e42d48 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640048796; 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=EzoVK7DdbBvT153y/PSEnQQibC5fZZK8MThF3+DX3aQ=; b=jOa3PNQrjMestFeQaJRZAetoS+sQOQ20qkFPFInd286lxIpQLWAopuWZZXVbchEfbkaGk5 h7fQ1I9WKZs9i/A4ZIvy+dCAm/8uWuesmWLdsAFTo4if7Ou67z0SdOOJ3X11Ljxms43OPB BbURGCaLWiALseMobj7eYQ6b+pChGuEYhZMgKFCjP/9jQNARvK+1XDZEqI2k0gTqK3NWa/ AxQHmyNMMfbsl9GeZ4L5TdaUIVVxHzgXyTOphnvwacqLntFyymCc6ZdGzGNp4e4qQzJNR4 Jlmrl2F256UYyr0SMZZ8mI2CJWbFimxVH6DP7MNgVAlfU2lk+5sWSolN2t1u7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640048796; a=rsa-sha256; cv=none; b=lIv3MufiZhw9frpSckSRfNYhtUK79CjRIVPI1JWiVlytGz40zMqpQImghzI2a8sDLKdNYD OqqUirfLhsQCl5VWFP6+Le5INHTfR3L09zX5wOmicUzH2yBQsaoV63LSAnUY7HtV85IsCQ EvJlCywyG73hrsNVGRh6Pu+sTqrIuUs2ZKS38tk1Gpd4KzyfCjwAtmBlnfq4mCGpvJYiD0 wocmEKmKmeEGtoxHLZCfIjecTA3OfXEpMzZFSwJ9nZPQa1YhVOWgUw51SBNu6vbkqbbsYt /knKRFsacStxp3CkOA0LRf3+FDxwEQZrg4FVaN0s04CwWy7ewjTLF1owvyRYZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=dd8d32c669724b1e47107204afef2ef5e9e42d48 commit dd8d32c669724b1e47107204afef2ef5e9e42d48 Author: Alexander Motin AuthorDate: 2021-12-14 18:20:14 +0000 Commit: Alexander Motin CommitDate: 2021-12-21 01:06:32 +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. (cherry picked from commit 483e464ed4325a0710485925ecfbe0e1c8d6bb02) --- 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))