From patchwork Mon Apr 15 15:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13630209 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE37922094 for ; Mon, 15 Apr 2024 15:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193897; cv=none; b=dUakAdpL4M6XxJn9cARtlSEJEqCvBYa44j3HagW0wjCi9kScufdqZ7R7q+eKqsVR8d27sNLTrYCTA/QhbYDJxOpDKoJJ5ijriOZWOkAYojsjuWZdfwbOWxZmlJSvcG3pbtSSs7SDvRWWiHEPc4JmSBEymMsbMNBlTWuh0hP2ofk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193897; c=relaxed/simple; bh=FXvvhYhgglFTGA/MTtoW8EKoVYfIQsLOWcOuVXhQusE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=A5AwM32hBMI0gcRsHPwymtkHleLLfdfQ2SbNZz1Ir7EaOztmg1Nw0EH22LR83Y8b4/f1S71stFHMhZfc5iO17cv16/I2frnjhDyxrSgVL2GxJ8+YtI6IWQ7NpqWdO4zcHS76C22Cn+Thl4a+4QEvfw2LB8eiIeXNre/r4HMPKtM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jf8SHFo/; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jf8SHFo/" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-78d743f3654so320314685a.0 for ; Mon, 15 Apr 2024 08:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713193894; x=1713798694; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qg/HtKrlYTuKM8FzDskV4+DY6wEwleiSsG5Gy/6Ktew=; b=Jf8SHFo/8DW/9CE8h4g495WtM3im97BYX3gtMnckDoMZMP9ibWPSkiiD47sAH0ayjM TQCc9JorFpelHxBtM1z+WLFHRLqtGp4Gu69eUEAm2BwpeM3cMvafTOA2FDLfx9a/4vzV 1snpRmUgzJZ8BJayRdFS2KSbpdm7ea+kBxxp3lIYGQGwJ0AFhYttKdsvqLoI5n2Z3106 Ei4UtMGoLV2jgXkQojVWVjycm9OXEpY+jB3+E90haNz1cJJjZ7Cuxge1QSUyt9CFi3rX 6t43tjqinMrRRO5pgHoXqrV5onAKRaOJdOQqzqUiiJfSie4d5G/fa/BTRlv7E1kG6KHT XZ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713193894; x=1713798694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qg/HtKrlYTuKM8FzDskV4+DY6wEwleiSsG5Gy/6Ktew=; b=o1Ew9egDSqYec8ydd6jx9dvfFs+J94ZNnYBb2y3t2VhAk4ReB6xJxfD/ZSpNqT7xBt YRb93Ki2/BHhsFrf7F4XOCl95ncdTvOmnmQXTi9/86GQ+4ebPbhc8cQ7jy/nNe/vKtcu FskXE0SGdNqnCeBT5Kl+h+2kmH9kINpgYJN5vNhotmTb54ZttkvXIykjkqY9G7e/p7Z6 y5EbLaYX3BIKyo1JbzXA0QSMBD/ljNX6SM+tbtIYfhE3JFjXLzDKUtNFrz/9nucj1Zod gDtvlPoxlrwSEiz0mv7xV0f8SW25/zDvra8Ga/cA9hKmtfrvqKsryFEjT5OSUkzVVhIc FbMA== X-Gm-Message-State: AOJu0YwGZwdBVWsE89NkbKzE04o58QcqOd525GrKoxrcKGGHsnO0ojcN j11jc2ii0xKUm7Wcd+GI3t0tnji4LcQqPSV7BH8t/ZPAOgAYaJL8Ft2h6w== X-Google-Smtp-Source: AGHT+IGwtz+8s7P+f6uWoBm1+mu5ZtblTSTqXnbI53TdzwtBYiEZtPjLsuWnVdg/xPIC3dIhAYaC+g== X-Received: by 2002:a05:620a:8323:b0:78e:d537:2407 with SMTP id pa35-20020a05620a832300b0078ed5372407mr7184732qkn.7.1713193894385; Mon, 15 Apr 2024 08:11:34 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id h23-20020a05620a13f700b0078ede2e9125sm2596549qkl.57.2024.04.15.08.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:11:34 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/3] band: return -ENOTSUP when RSSI is too low for rate estimation Date: Mon, 15 Apr 2024 08:11:28 -0700 Message-Id: <20240415151130.40389-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This was overlooked in a prior patch and causes the rate estimation to return -ENETUNREACH if the RSSI is too low to support the various capabilities. This return was unhandled and was treated as if the IE was invalid which then printed a warning. The low RSSI case should just be ignored, similar to if the IE was not provided at all. In this case return -ENOTSUP so the caller moves on to the next capability set. Note: this does result in most of the estimation functions only returning 0 or -ENOTSUP as they do little to no validation on the frame, but rather just test bits. Additional validation could be added in the future which would be handled by this patch. --- src/band.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/band.c b/src/band.c index 11cd965e..d71380ae 100644 --- a/src/band.c +++ b/src/band.c @@ -121,7 +121,7 @@ int band_estimate_nonht_rate(const struct band *band, } if (!max_rate) - return -ENETUNREACH; + return -ENOTSUP; *out_data_rate = max_rate * 500000; return 0; @@ -319,7 +319,7 @@ int band_estimate_ht_rx_rate(const struct band *band, rssi, sgi, out_data_rate)) return 0; - return -ENETUNREACH; + return -ENOTSUP; } static bool find_best_mcs_vht(uint8_t max_index, enum ofdm_channel_width width, @@ -502,7 +502,7 @@ try_vht80: rssi, nss, sgi, out_data_rate)) return 0; - return -ENETUNREACH; + return -ENOTSUP; } /* @@ -678,7 +678,7 @@ int band_estimate_he_rx_rate(const struct band *band, const uint8_t *hec, } if (!rate) - return -EBADMSG; + return -ENOTSUP; *out_data_rate = rate; From patchwork Mon Apr 15 15:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13630210 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 277397603F for ; Mon, 15 Apr 2024 15:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193898; cv=none; b=D3CxsAt9LjlF7+OeB5E1w333j17akbNKpC64JX5G7tMA+Fp7u6i5eAGUDhXq4i8AqyS1QnjoFHNdBTi9TxqgwoZpMj+VzuI0Utk9NF/5AamYbgHp9NSZ3rXpol8ntj8SLu5CjYOzkAEQszmNACbq431n4e3jywfLE++7MkQMOmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193898; c=relaxed/simple; bh=VTgaw65HvwKGSurjTpbMuTxVKF1obCgKYABcc0bnJVQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vt7qp55jaFDr3dRPUuR5G+j4CENjlAiqt1SqjPOIhaGForvN4AtoqT0YTHO+tY4s+2smnv8Ddw5k5CjF3Cy7B7a9ldpJz5btmuhZflmJqwv2fQrTFxcBtLWV4574kYcoWAAatD+ryaiW7iUETh89mqlX4Nhqm7NzOqNd28HiZxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WhZ6/tkz; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WhZ6/tkz" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-78d543db3a4so252040185a.0 for ; Mon, 15 Apr 2024 08:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713193896; x=1713798696; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Lrr3vgwpdRQh7vXRPL8MOUarMcr8vipoNmgP5njNXc=; b=WhZ6/tkzgUT4EyaittlNW8Qjb8LmQ+Qk0nx1KAGpRhJwySwnjAvhsf5aafGL7F8cAa Nhqcx2UxuTCOpBxWrqT4sx6FNXLf+zxP0KsA1Zv6EcD2y+0+2N9zGjkLZ7znX4PM0DKR jAic0hTBzgLz5paQp1Hg2BSjAYpc1S8gwmZ5T67GzjLlrY1Iq2vRGQI1nG7fi+tllswu yxGOIr/4aaG6IcB+1KkZHya1vNUumKWXeP1S/lXcnPO7k+tWpNtHxRszoG0clGhHotzB rOQPPltDXQiO7QI23ajeenzUSvXe1PCEVkZAsFl1taEguhdhRNL2MZi1esSuf7AdxLmO 2Eng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713193896; x=1713798696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Lrr3vgwpdRQh7vXRPL8MOUarMcr8vipoNmgP5njNXc=; b=NLnOKsi8JB8/H6whE5mxOd3iMnsG7+V/pp+DJPiwJxQGLyHQyv0NscggCqj6uCgttb tW/YVSsf5x3Q+4+TpZ9OENzzmIVm/dIpBPg4sxD/hHNL4Lbzstg1WZoiqOL8TncEOUCP uoN/8HnZsHtiGBkZagLf4JLenuBvNzkvMRFtOxItynz8bUf5NUxIl2zCHB6YMIweyfPz LD+ljk6Vk4xp6IWNMqfQ65ZnbyMJ11TKSKsRBaRszbPKi27e74jmlXUvYJaja6W/dWPj vb4Vd89ZLzS0k8AoWMZLWDzYKYtY6PAi03YV2N1Sq63OQxf8dVi1oIktidClnRmLLpbP 4Lww== X-Gm-Message-State: AOJu0Yye9cLVRrtC99leR3tb/9j2VEZ/3q92VV8G+3We1398VgoUZK1y eO+heaQkF3M+LzYemiIApODFtgE8XdjHASw7kidtNM1RacGbreFe1cMz8w== X-Google-Smtp-Source: AGHT+IHArMygy8AuVNTULaiQD/GAKF68VmIo3bmWVtZ7/LQcW+i0yGW0leQHf8RwzZS8NgYGSqwT8A== X-Received: by 2002:a05:620a:663:b0:78d:63d5:7325 with SMTP id a3-20020a05620a066300b0078d63d57325mr11558752qkh.43.1713193895736; Mon, 15 Apr 2024 08:11:35 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id h23-20020a05620a13f700b0078ede2e9125sm2596549qkl.57.2024.04.15.08.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:11:35 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/3] scan: replace -ENETUNREACH with -ENOTSUP for rate estimation return Date: Mon, 15 Apr 2024 08:11:29 -0700 Message-Id: <20240415151130.40389-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415151130.40389-1-prestwoj@gmail.com> References: <20240415151130.40389-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The rate estimation functions now just return 0 or -ENOTSUP for success or if no estimation could be made due to missing IEs. Only in the case of other errors (such as malformed IEs) should a warning be printed. --- src/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan.c b/src/scan.c index f48ffdef..a22cc27a 100644 --- a/src/scan.c +++ b/src/scan.c @@ -1608,7 +1608,7 @@ static struct scan_bss *scan_parse_attr_bss(struct l_genl_attr *attr, ret = wiphy_estimate_data_rate(wiphy, ies, ies_len, bss, &bss->data_rate); - if (ret < 0 && ret != -ENETUNREACH) + if (ret < 0 && ret != -ENOTSUP) l_warn("wiphy_estimate_data_rate() failed"); } From patchwork Mon Apr 15 15:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13630211 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83C147604F for ; Mon, 15 Apr 2024 15:11:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193899; cv=none; b=CHfA4izswA9H8+OSC6N1jCOL6dQxHMf/ywm1ZB5ritprv2HuRQh1MXM3e7RUPIkWLlvnVhqwJXmwpjv7kgrTWbkVpCWlyfTq4/9oT4zqu2wBAkvMqGEiRdOMNmRBDD3RLe+b/hSsUAtq6eaIXTT/Jp64fsCAvl3VjgwpSm2oPv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713193899; c=relaxed/simple; bh=/6+gEvNcTE7SbxKKsTVvfWqKZSR8OlnWEFQeuvx1/oE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=A4R0EiimEmPO+L7GImT8/zcoBNb2oOJE29AL9yoKr+wYBDsGFy53fUz/nQ1bup0GXWqTwCMiDdWRX9Tc0lu+5RjcqagJIQ/FG6AF//lhrS14cjV2/yQwgcCUcMjMg8zabUVPs9ydU6MJpQipoTDnMZCxcASWEKKBMdO0LRJFNwU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CKOoZr6p; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CKOoZr6p" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-78d543db3a4so252042285a.0 for ; Mon, 15 Apr 2024 08:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713193897; x=1713798697; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nt9JLXtm+7jau8EIXdcris+h8YoBcqJmy42aFkfDLu4=; b=CKOoZr6pm8YRtxtcWO+AbiACEDFrxaaUZKEXAFBiNSV5pRENPx+kfwCRHRX7hc08YM mNy2l9GZs10PR5myo7LGTn1Cl2fzur+sdalr5GcNwpzpyf+9QOcCNIBpGGL9RIfGAavp d+UKKoT6hOCiNrUWNa8FbWzjJZkJciX9i7YCX8IzFd/OBP6/k/Y3NLFAqHFDbG/opq76 NKTUcAUOSDr6tmxaUtblxj4INPr1N0cre/KCoAvzy7unbGxkDSOw4d4NXK660D6I1cOA MzkneQesiKAaTCXEWk5I1NMhA/tKhZs2kfEunfgIG/voaUHb7Xq+5zVe0mETWg0OQE20 MNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713193897; x=1713798697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nt9JLXtm+7jau8EIXdcris+h8YoBcqJmy42aFkfDLu4=; b=oiNpYogTrTpNh8kbJIgX9+XU9C6rZeK1Sa8eV2E8vLzbbdWakNJkeTQB1E1nGjFSmO 0Rw7hyMbzKOsooctpFcImmNpCuKhkSorKWSfnYmNMe7f4QF9nh4su4PJ542I8Tq13QVy VFKpiBIFSgBoiq3iJHDZJgbaM59nRMivQasK07PD98s7SR7qFdgB2PlUdk1oaiJy83Hp HdnfKrU0lT/JOiz1YZtF1Bugnvt43HSwDXc3Gg8N667qXG4DREWYcYO3XafR2apqxgjT IYaSntSNFCpW5huNWge1Stkez4OahQWbyGVcq5J/hvJ7qGUB9inDN63h/aOr/Yxppvix EPdQ== X-Gm-Message-State: AOJu0YzeLimuRusRRpGGm7xOiUjTE/DeLVMXgk4oE2N7ILECEahHKWZv 51iU51/7y9aXAMuIG+8/RlFZLySsLz6/IxWkgoLVz4nl2UD77Ol01DQ58g== X-Google-Smtp-Source: AGHT+IF0su5F8S492qAKjJ/uYltxamnu9TEO2rnCZcRFxSaWl/ecG6HTXu/s2qjQUrvaYLm2Z5nMNA== X-Received: by 2002:a37:db11:0:b0:78a:68c3:dceb with SMTP id e17-20020a37db11000000b0078a68c3dcebmr11356457qki.32.1713193897314; Mon, 15 Apr 2024 08:11:37 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id h23-20020a05620a13f700b0078ede2e9125sm2596549qkl.57.2024.04.15.08.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:11:36 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/3] wiphy: include MAC of BSS with invalid HE capabilities Date: Mon, 15 Apr 2024 08:11:30 -0700 Message-Id: <20240415151130.40389-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415151130.40389-1-prestwoj@gmail.com> References: <20240415151130.40389-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The prior print was not very descriptive, and now will log the MAC of the offending BSS. --- src/wiphy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wiphy.c b/src/wiphy.c index 712d20cf..8f5e46bf 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1039,7 +1039,8 @@ int wiphy_estimate_data_rate(struct wiphy *wiphy, break; case IE_TYPE_HE_CAPABILITIES: if (!ie_validate_he_capabilities(iter.data, iter.len)) { - l_warn("invalid HE capabilities"); + l_warn("invalid HE capabilities for "MAC, + MAC_STR(bss->addr)); continue; }