Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2913939pxb; Sun, 3 Oct 2021 09:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFw3yKEqnoR0la4omyu+pT6P73yw9SsCHB2957b3dZZPhmYDDwMJRQgJS9VnTpfA9QSUAy X-Received: by 2002:a62:dd84:0:b0:44b:b54a:c2a5 with SMTP id w126-20020a62dd84000000b0044bb54ac2a5mr21741669pff.11.1633277425381; Sun, 03 Oct 2021 09:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633277425; cv=none; d=google.com; s=arc-20160816; b=g3fBtpFa2KUwNei7wwrfpSOyYpjZuQ7TIGRiCzeA672UxwG75Sl+9q+Ojl0vwifAuM ZYH0DFaRgoYxIezP0aFN5a+8NuMq0k5ba5uEGmtKaikhwx+apAvJFLTj4KvegU+zKLsW lXzq+u7l4qD7RhzcaBxbRzGuU1/47OXFC7VoSER4QuZp4eGVTYVMXrj0Wkv35+KkDnVV 4ORjqFlMydiQUdXF11/QTAtvBCRSg3QmjEviLyuMV5bkrYSfUxATpyMXJmCp2DMqF+IK nhmOFuKnXsM0z19CBFrFVyKOVEwN/vtWrYzukYvp3oa0zuLqauF2AhM7O6KnONYemuhr hrUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mKlqbnV68ucu/9jGoGO5InU05AHLqBboI/a+lod6Kwo=; b=mD8eGUr5tfexzvGk/AJ0D/vu2ukPDcNOmFlSrZaT96MbQyMyrsvBSyvRD34nDRZL4e okqCdPskA3HRYfyOs9sa7L3GYADOauU9Zs5byBreVcDJRuUc37vQNh70x/f/LwMhbzYy B6G3hqUlOFGxWeg29inqVjY+BJ7ALHja7r4SQz659Ur0TZgzQsCmLy/xDzE/IAZ2ozy8 Aq9PTpYHU0zLvavl3IdctT8VYsto80mWrWpg1SGx4eYtDJro2ar7H6O5gzPv3PVf1t2f iQ3ea9AMliDh7KWy1YgOzwqLjrwuOAsp34VbB4uCWHVicbRVPWqY0h/MWbF4heGabMAn 95FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="HU+YO/x8"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si15980768pgr.18.2021.10.03.09.10.08; Sun, 03 Oct 2021 09:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="HU+YO/x8"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231158AbhJCQFT (ORCPT + 75 others); Sun, 3 Oct 2021 12:05:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38602 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230426AbhJCQFT (ORCPT ); Sun, 3 Oct 2021 12:05:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633277011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=mKlqbnV68ucu/9jGoGO5InU05AHLqBboI/a+lod6Kwo=; b=HU+YO/x8kfPr+aff/likY6a36NlZ1xLEWKpkWtqcl/PaTkjJ6qHOjVMkN8xybYTOOhxwbn xMqr1rxIxy6onA5Hmjnd4kP0xTzfADKOR70PPB/2DdA3iBsqTPMBDJfQCiCUlGfobXmu5a BcDeTNFOIvTPKvlNRK+e1NsJoC2n9s8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-k7omOiuhN9-aw4Syjc8ycw-1; Sun, 03 Oct 2021 12:03:30 -0400 X-MC-Unique: k7omOiuhN9-aw4Syjc8ycw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDC77362F8; Sun, 3 Oct 2021 16:03:28 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0AD8608BA; Sun, 3 Oct 2021 16:03:26 +0000 (UTC) From: Hans de Goede To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Chi-Hsien Lin , Chung-hsien Hsu , Wright Feng Cc: Hans de Goede , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com Subject: [PATCH] brcmfmac: firmware: Treat EFI nvram ccode=XT the same as ccode=XV Date: Sun, 3 Oct 2021 18:03:25 +0200 Message-Id: <20211003160325.119696-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In some cases the EFI-var stored nvram contains "ccode=ALL", "ccode=XV" or "ccode=XT", to specify "worldwide" compatible settings, but these ccode-s do not work properly. "ccode=ALL" causes channels 12 and 13 to not be available, "ccode=XV" / "ccode=XT" may cause all 5GHz channels to not be available. ccode="ALL" and ccode="XV" where already being replaced with ccode="X2" with a bit of special handling for nvram settings coming from an EFI variable. Extend this handling to also deal with nvram settings from EFI variables which contain "ccode=XT", which has similar issues to "ccode=XV". This fixes 5GHz wifi not working on the HP ElitePad 1000 G2. This was also tested on a Lenovo Thinkpad 8 tablet which also uses "ccode=XT" and this causes no adverse effects there. Signed-off-by: Hans de Goede --- .../wireless/broadcom/brcm80211/brcmfmac/firmware.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index 0eb13e5df517..f150af8ede21 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -432,10 +432,10 @@ struct brcmf_fw { }; #ifdef CONFIG_EFI -/* In some cases the EFI-var stored nvram contains "ccode=ALL" or "ccode=XV" - * to specify "worldwide" compatible settings, but these 2 ccode-s do not work - * properly. "ccode=ALL" causes channels 12 and 13 to not be available, - * "ccode=XV" causes all 5GHz channels to not be available. So we replace both +/* In some cases the EFI-var stored nvram contains "ccode=ALL", "ccode=XV" or "ccode=XT", + * to specify "worldwide" compatible settings, but these ccode-s do not work properly. + * "ccode=ALL" causes channels 12 and 13 to not be available, "ccode=XV" / "ccode=XT" + * may cause all 5GHz channels to not be available. So we replace these * with "ccode=X2" which allows channels 12+13 and 5Ghz channels in * no-Initiate-Radiation mode. This means that we will never send on these * channels without first having received valid wifi traffic on the channel. @@ -447,6 +447,8 @@ static void brcmf_fw_fix_efi_nvram_ccode(char *data, unsigned long data_len) ccode = strnstr((char *)data, "ccode=ALL", data_len); if (!ccode) ccode = strnstr((char *)data, "ccode=XV\r", data_len); + if (!ccode) + ccode = strnstr((char *)data, "ccode=XT\r", data_len); if (!ccode) return; -- 2.31.1