From nobody Mon Feb 24 20:27:20 2025 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 4Z1sjS3WGYz5pprQ; Mon, 24 Feb 2025 20:27:24 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjR2SzYz3p6g; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428843; 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=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=uEKGaO83MxSGPfTtYA5/5IgN0eS6QJJvM310z7Xceej/S4wK5ntDR6FRtuPpy6ovyPPkyg ZYnRr6cR2b/L/5GFYTeaEUcBB6g6CybjugD0MRAu7s+URq809JHA2X6/V0YaAlmM9q8WYk ibQ+RbqZeF4WpfRKo1xp5r5Vd+dHVOU01HkvEfawXgSq2HG7qR76B+ieAcHCnN/8RN6534 XUnGm7tdAeb0Uok8oyETLUGZnojNMFNAULz5h002SMMLUClF1W09zWKPK4diV47UTZY4Gw Ri+RobCx1Z22qVuD03pQEYO31mvJOCXXfGNb6OtJll+2b/PKlpl1mpsF61Ontg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428843; a=rsa-sha256; cv=none; b=owQk8ycSRLdPJ9J70pgia4L5f3PoXvDRs1nQ5dWJ4nUO77BZ1t3v4E5tZ2ZckGoDvyYrwV nkdiUgmCjQDmVj6ubHsFK9bELsWEQWwrecVarYJwMvJwjLiGJFD2MODf5KZByf/PIFy18s ND6YPhYuEoEcHr0ARnv2YC0zdHpiueQcAQc6xef3BGsr6AWF9bItHDhT1tWYyPKzJiqH5N HF2CjRWpDKirXnGDuYs9EKa+49+2PElYPp/gLj+AcGIVm3QZPtp6t59PrgXSJReMIrA9Vb 9nJvXw4VF/UT0W8/HbFl6v7IM3VImEJZDP5o/UcO4yZhCUVQprJoSjoXQLA9MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428843; 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=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=PwKHyHOyQnYg92HRiwIsaZ3dl6ISChHcUG97h+p/dS0n/odUHiOlS6JbDxWOS4cJPDd/f3 4/J9Dc/zt7qYXaCUqICun/NS1aS3fwzWcbDuvMANQ4+CrCQdWxWMI7Ieke3maSflWA6m5L 2pCH8/Ug/l3ObNeWWkyhoo5ugmFgXxAiD8hG59in/xGs84RDuyXzkLRmNiN+b6U9bbHpTj cJGNK7jLYl5u5nXWYBhiJoIEgTXovzlQ9FHBZ/1sztJoiw/SWxTm6zFVj/AmGgcnYDAU3x 7jGFcqhz9C2GMSr7zdrQdc6Sg6pGfhb763agJ7uKD7xVPjCw7o0XkGmEoFtmEA== 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 4Z1sjP0DHKzwMZ; Mon, 24 Feb 2025 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRKa0027605; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRKwf027602; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:20 GMT Message-Id: <202502242027.51OKRKwf027602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eaa2fca952b3 - stable/14 - LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f commit eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 12:04:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly Rather than just printing the cipher suite as uint32_t hex (or split into OUI and number) also print a short name. iwlwifi(4), for example, now prints on startup with HW_CRYPTO on: unsupported WLAN Cipher Suite 0x000fac | 8 (GCMP) unsupported WLAN Cipher Suite 0x000fac | 9 (GCMP_256) unsupported WLAN Cipher Suite 0x000fac | 6 (AES_CMAC) unsupported WLAN Cipher Suite 0x000fac | 11 (BIP_GMAC_128) unsupported WLAN Cipher Suite 0x000fac | 12 (BIP_GMAC_256) Likewise _lkpi_iv_key_set() would now print: iwlwifi0: _lkpi_iv_key_set: CIPHER SUITE 0xfac02 (TKIP) not supported Sponsored by: The FreeBSD Foundation (cherry picked from commit 12a511c844706917e49e24c8d1daa861288aea23) --- sys/compat/linuxkpi/common/src/linux_80211.c | 47 +++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 683de6e0d474..9de81f3f9b28 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -750,6 +750,38 @@ lkpi_opmode_to_vif_type(enum ieee80211_opmode opmode) } #ifdef LKPI_80211_HW_CRYPTO +static const char * +lkpi_cipher_suite_to_name(uint32_t wlan_cipher_suite) +{ + + switch (wlan_cipher_suite) { + case WLAN_CIPHER_SUITE_WEP40: + return ("WEP40"); + case WLAN_CIPHER_SUITE_TKIP: + return ("TKIP"); + case WLAN_CIPHER_SUITE_CCMP: + return ("CCMP"); + case WLAN_CIPHER_SUITE_WEP104: + return ("WEP104"); + case WLAN_CIPHER_SUITE_AES_CMAC: + return ("AES_CMAC"); + case WLAN_CIPHER_SUITE_GCMP: + return ("GCMP"); + case WLAN_CIPHER_SUITE_GCMP_256: + return ("GCMP_256"); + case WLAN_CIPHER_SUITE_CCMP_256: + return ("CCMP_256"); + case WLAN_CIPHER_SUITE_BIP_GMAC_128: + return ("BIP_GMAC_128"); + case WLAN_CIPHER_SUITE_BIP_GMAC_256: + return ("BIP_GMAC_256"); + case WLAN_CIPHER_SUITE_BIP_CMAC_256: + return ("BIP_CMAC_256"); + default: + return ("??"); + } +} + static uint32_t lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) { @@ -770,12 +802,16 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: case WLAN_CIPHER_SUITE_BIP_CMAC_256: - printf("%s: unsupported WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unsupported WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); break; default: - printf("%s: unknown WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unknown WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); } return (0); @@ -1127,7 +1163,8 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) break; case WLAN_CIPHER_SUITE_TKIP: default: - ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", + __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); IMPROVE(); wiphy_unlock(hw->wiphy); ieee80211_free_node(ni);