From nobody Sun Feb 20 18:15:38 2022 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 A466819CF313; Sun, 20 Feb 2022 18:15:41 +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 4K1ts726QFz4XWx; Sun, 20 Feb 2022 18:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380941; 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=cDpgekaIjJC//IalmBJFITEY02M32HIXIFuHZ9rHFdQ=; b=ULdpP9DrWTrh9gLYUrzRu9lSNvX2kXIc2ZZe3J7L/axTa7enD4ljlwlXkeI+QyJF+7MDMH 6upa42rW+5p511rAg4LJOX+Ym0M5+mGavJDtPTVMnLFA128IfgEgZFpo2lLbsCDt8R9FHY 4+Hsc9JzBP9bXCaS8F1/Vc/3YuiR4jDcHgFzCSxxVH2pzH147bvqrnm/f0gIi9NkgqsgOe vgoN3465mzToJs0sxrGrJfE/932K6IxNCavERnvQT/Qf2nGahm09g6zN9EIrEN8xbYRWJF fEyrrV9xyyNPuUxXKWeuLo/iGEHCsjEN7+LZ8EYeBUcKtHW5n2ZYlDScZ64OwA== 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 A365D21480; Sun, 20 Feb 2022 18:15:38 +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 21KIFccT022952; Sun, 20 Feb 2022 18:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KIFcNB022951; Sun, 20 Feb 2022 18:15:38 GMT (envelope-from git) Date: Sun, 20 Feb 2022 18:15:38 GMT Message-Id: <202202201815.21KIFcNB022951@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: f2a66c84c972 - stable/13 - LinuxKPI: 802.11: get rid of lkpi_ic_getradiocaps warnings 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f2a66c84c972dbeae151d1432a894c64eb432eaf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380941; 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=cDpgekaIjJC//IalmBJFITEY02M32HIXIFuHZ9rHFdQ=; b=Uz+VLWMuL32XiaIUhfygsN6hHvoKu5bRKxFaH2uCX1Vk9q/qC48lZElnTLJQz07nVOmH1B d+BHIPdk4SC1WOYdoBeJHw2QBqda+8cfQTwZSJEF8emDZyCIJhbjJpJrXRVdw9mInWTz0h ei7EI++GX0dLFos1z4Hwn5uPIePVJ1xPXdoqa6RH2tSU6iFxVLAtQ79da5KJMfuV4YcrcL IgsMT/ScbtN4K6wp50TRUZBsICPn8orMi7mnvaJq+TDDRw/A3BRTnsYQePMpjeoBJ8L/Iy Ydr+DO+k01/nS335/VTanLdX2upS+RXf/EGvHmZLkWwThuotfyo76SkwGfMjPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645380941; a=rsa-sha256; cv=none; b=TgqUcARNucPk+4tjFZ4gxTbmXywPtWpHDdmwGutdFUGbQnmI490+RdyAszGMV4ShD5UNOL S1AKS9eeoUDn8mp6utzctddGBKHFrSmkSZevwdYcRTW4RzvHuUQ8k+rjOhv9HmWcxcXM3O TRANzajYHziz1x/bMrAS+z6L/b4UWVLYFMv9Q1gT4kQ4Cv7CQhAOeByE6oV7yoY1l/WvM6 6vx0ttDKFdPStkNfPZBuBGCPjTo0pFb/Kb2c2JEbeFFEjyr6ZPW7MvEHM6tXD0KFHAqHJU Efwz2EJJ2HfhB3k6Gl1NLJqQnLQp9kbKt+pTIOqRWw71AP+x+LrvitYdRN/gMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a66c84c972dbeae151d1432a894c64eb432eaf commit f2a66c84c972dbeae151d1432a894c64eb432eaf Author: Bjoern A. Zeeb AuthorDate: 2022-02-14 22:29:38 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-20 16:24:32 +0000 LinuxKPI: 802.11: get rid of lkpi_ic_getradiocaps warnings Users are seeing warnings about 2 channels (1 per band) triggered by an ioctl from wpa_supplicant usually: lkpi_ic_getradiocaps: Adding chan ... returned error 55 This was an early FAQ. Check the current number of channels against maxchans and the return code from net80211. In case net80211 reports that we reached the limit do not print the warning and do not try to add further channels. Sponsored by: The FreeBSD Foundation (cherry picked from commit cee56e77d77909df69624cc707a571647651c853) --- sys/compat/linuxkpi/common/src/linux_80211.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index beb2b03f0498..c69df86c3fa2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2579,7 +2579,7 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, #endif channels = hw->wiphy->bands[NL80211_BAND_2GHZ]->channels; - for (i = 0; i < nchans; i++) { + for (i = 0; i < nchans && *n < maxchan; i++) { uint32_t nflags = 0; int cflags = chan_flags; @@ -2606,14 +2606,15 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, channels[i].hw_value, channels[i].center_freq, channels[i].max_power, nflags, bands, chan_flags); - if (error != 0) { + /* net80211::ENOBUFS: *n >= maxchans */ + if (error != 0 && error != ENOBUFS) printf("%s: %s: Adding chan %u/%u/%#x/%#x/%#x/%#x " "returned error %d\n", ic->ic_name, __func__, channels[i].hw_value, channels[i].center_freq, channels[i].flags, nflags, chan_flags, cflags, error); + if (error != 0) break; - } } } @@ -2648,7 +2649,7 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, #endif channels = hw->wiphy->bands[NL80211_BAND_5GHZ]->channels; - for (i = 0; i < nchans; i++) { + for (i = 0; i < nchans && *n < maxchan; i++) { uint32_t nflags = 0; int cflags = chan_flags; @@ -2675,14 +2676,15 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, channels[i].hw_value, channels[i].center_freq, channels[i].max_power, nflags, bands, chan_flags); - if (error != 0) { + /* net80211::ENOBUFS: *n >= maxchans */ + if (error != 0 && error != ENOBUFS) printf("%s: %s: Adding chan %u/%u/%#x/%#x/%#x/%#x " "returned error %d\n", ic->ic_name, __func__, channels[i].hw_value, channels[i].center_freq, channels[i].flags, nflags, chan_flags, cflags, error); + if (error != 0) break; - } } } }