Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4387665rwl; Sat, 7 Jan 2023 17:35:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsW9bSeNsbVR/CeAs2DL1iMgLXgK0OWARnEQvM+fvO6n++oYYFXfWJOwlj+SEG2SIjuA5j8 X-Received: by 2002:a17:90a:2b0d:b0:226:e59a:f86a with SMTP id x13-20020a17090a2b0d00b00226e59af86amr6463089pjc.10.1673141720305; Sat, 07 Jan 2023 17:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673141720; cv=none; d=google.com; s=arc-20160816; b=QGjoW/LNQCaE9NX/X56A0c63SjAPJBPfzO4nAKNYGiHbxbogldBnP9q4W90PSzdh5U xvNoDi2ltDtDg26kinE+sh4xLFgybDTM+5ZdP+vjpSDEsUkdIiQCdvtfYS5LLVIaWkxg NWokHGdTa5nJhb0O5VZptkR7rfkEYJ9c9FK4O8tRUsdzkVCsctDwLgGjl3Eo6JxOvEyR nhzlzwb0IRuMVsSlh9YlXO/RIzkf76T42ziUrqDYkkoFNstiW7VwHKoCph6yoG2VGosT QkVqOGbcNYkF1ioXxmaoU0v14hmYEefE8zwaRD9JlG7J0m+4W/GTWABY6n4W7nevn0gg MD+w== 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=aukUG7G4mJzk2l5eLMtMhDac84dRtZO/NL0wRxvV5bk=; b=sjXoizKa7KMyFT+5QbbQDP1h+SES777bkwmHaiPg5P3FuUj7hpTCRc7TkPMOz0lj76 fppds14IKn4WRhELg6pxFtDIKTnhpoeHQRGdLxLHf3O43hXH5LvGKBtE/QECDwL4ACYe DG/HmM14NQxyA260ahXfn38o2upPvyTBMq7PmmFJwLOQClah4bOxhgqCZJlu8QB2DdIG YKxGkvSDY1R7pSd3bQAsb4uJGPyea41bNTuHCJTuVR4e0z3PxIJXPOrEa2nTlAWuNaTj Heu5IaaQvUm2HzVUYO04Dnn2d30PEe1WM5mtTbMDazpKrvyJtTph+L2oPFA3vPJkWYWs 2hpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@schmorgal.com header.s=google header.b="Ijxb/24I"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=schmorgal.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi4-20020a17090b1e4400b00223770a1235si5548890pjb.138.2023.01.07.17.35.06; Sat, 07 Jan 2023 17:35:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@schmorgal.com header.s=google header.b="Ijxb/24I"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=schmorgal.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231671AbjAHBax (ORCPT + 65 others); Sat, 7 Jan 2023 20:30:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231533AbjAHBaw (ORCPT ); Sat, 7 Jan 2023 20:30:52 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D957E1000 for ; Sat, 7 Jan 2023 17:30:50 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id c9so3749166pfj.5 for ; Sat, 07 Jan 2023 17:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schmorgal.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aukUG7G4mJzk2l5eLMtMhDac84dRtZO/NL0wRxvV5bk=; b=Ijxb/24IC1QEwcFPwKJk4vJx2f6a8zMHcCVr/IsNjIGR2KzZbwDO35AJaWgi1jyKrW WSM+WXH6JOT9P065y2RaXl8S4f3Qn50st7OBaUbdPoRUy8Up0tjjEOEUM70mE9Wezpwo w36HUDl/gULXddw8GGTNXSf5mmaJjmgRY+6BM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aukUG7G4mJzk2l5eLMtMhDac84dRtZO/NL0wRxvV5bk=; b=m0LI6P1dcBz/lpx5+Bx9ELUcM0RM+Sx2YQT9DDL1WDqLCUqrZLf7uKEM4wyNfHHuNS HWhHJZR1FQ1+K1CR6nuxSdZtfjh8nm8w6jZypSCzWOgNMNUxGo1fauaH8DUugkiuspBK l/MV6rvwCldmvHEnb2FcOKsrWaGKbO5shulVhhdibus28DVzlzZFw/VEVz8CGNhN1iin N9byOl4lhd7l0RcKe7WSSu9eQf05wfvIQgM2492/Aa/4gHAxz8Jy0nP0KtVW6gTEJP5b iU62XyNZ927HZbE4fltUl+lLqh0MGge+kdq10t/gio5zXh3+Pwl4AXWMgB5D94awsMpD BddA== X-Gm-Message-State: AFqh2krAUR1+KGwjjQFiNsue02WSn6KuQ6A29YCyMNillN7CFl2psqDY e4mmy6qaleveAgeLRUoDnT+2xw== X-Received: by 2002:a05:6a00:d4e:b0:581:a2b6:df19 with SMTP id n14-20020a056a000d4e00b00581a2b6df19mr34548691pfv.14.1673141450142; Sat, 07 Jan 2023 17:30:50 -0800 (PST) Received: from doug-ryzen-5700G.. ([192.183.212.197]) by smtp.gmail.com with ESMTPSA id x14-20020aa79a4e000000b005811c421e6csm3323714pfj.162.2023.01.07.17.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 17:30:49 -0800 (PST) From: Doug Brown To: Dan Williams , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Doug Brown Subject: [PATCH v2 0/4] wifi: libertas: IE handling fixes Date: Sat, 7 Jan 2023 17:30:12 -0800 Message-Id: <20230108013016.222494-1-doug@schmorgal.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This series implements two fixes for the libertas driver that restore compatibility with modern wpa_supplicant versions, and adds support for WPS in the process. 1) Better handling of the RSN/WPA IE in association requests: The previous logic was always just grabbing the first one, and didn't handle multiple IEs properly, which wpa_supplicant adds nowadays. 2) Support for IEs in scan requests: Modern wpa_supplicant always adds an "extended capabilities" IE, which violates max_scan_ie_len in this driver. Go ahead and allow scan IEs, and handle WPS based on the info that Dan provided. These changes have been tested on a Marvell PXA168-based device with a Marvell 88W8686 Wi-Fi chipset. I've confirmed that with these changes applied, modern wpa_supplicant versions connect properly and WPS also works correctly (tested with "wpa_cli -i wlan0 wps_pbc any"). Dan, I wanted to point out that based on my packet sniffing, I determined that the 0x011B TLV automatically wraps its contents in a vendor-specific IE header. I may have misunderstood and you were already saying that, but I wanted to clarify just to be sure. If I explicitly included the WPS IE's 2-byte 0xDD/length header inside of the TLV data, I ended up with a duplicate 0xDD, with the outer one having a length that was 2 more than the inner/original. Wireshark barfed on it. Changes since V1 (which was a single patch linked here [1]): - Switch to cfg80211_find_*_elem when looking for specific IEs, resulting in cleaner/safer code. - Use mrvl_ie_data struct for cleaner manipulation of TLV buffer, and fix capitalization of the "data" member to avoid checkpatch warnings. - Implement idea suggested by Dan to change max_scan_ie_len to be nonzero and enable WPS support in probe requests while we're at it. - Remove "Fixes:" tag; I'm not sure if it's still appropriate or not with it depending on the capitalization fix. - Clarify comments. [1] https://lore.kernel.org/all/20230102234714.169831-1-doug@schmorgal.com/ Doug Brown (4): wifi: libertas: fix capitalization in mrvl_ie_data struct wifi: libertas: only add RSN/WPA IE in lbs_add_wpa_tlv wifi: libertas: add new TLV type for WPS enrollee IE wifi: libertas: add support for WPS enrollee IE in probe requests drivers/net/wireless/marvell/libertas/cfg.c | 76 +++++++++++++++---- drivers/net/wireless/marvell/libertas/types.h | 3 +- 2 files changed, 65 insertions(+), 14 deletions(-) -- 2.34.1