Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp508677imw; Wed, 13 Jul 2022 02:48:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdWB2QdjuX4+zl2j+YMCzHouchOiw0SickFAbEv4dCYEEcgwaHxHFjkJixxt2idAQyEdm4 X-Received: by 2002:a63:e055:0:b0:412:77a8:4fe2 with SMTP id n21-20020a63e055000000b0041277a84fe2mr2183654pgj.429.1657705727822; Wed, 13 Jul 2022 02:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657705727; cv=none; d=google.com; s=arc-20160816; b=ZtvY5ldhX0Gi55M3jSAquqvetiksvtzEExtflupunqoMVcqR7QSk2ncrtamNDte4/I zGH/DaZUFTFJQR7ql0s4cEcUYqO4DrV0S6sMB6K0DRSdQa4qF80mNtXyMbx/rsmN7fRg cBpq7UPOoMxMN/bGzAoaOMCWDVbX35fP22EEuQvQAGG/fVq+HGZWydXQiT1dVlA61xJj oxqJQA5S7pDjMzCTxI4CdWpm8zdZBBE8kT17GiE+yxtUw2uO0JP5B/7XNFYp2Bt0KCFp yasXrWWdlr9ZW2yseleBXTCWdWZHIgmD+ZKpyn0AUJIYe8YCwgvEUgODeZkC2/jT/pf4 6R5g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wEdpcr1F/ACTecWeaMzahrcUrWtOeR1lwC5w2QHRhic=; b=GwWCTWIqZuFFL5s0BiXWGvLWLzGZYwFdIwi/fCCw3NACRY9msDRNrdIQc/96sZaJaB FAlyzBGkIW1FVnDpHB3v61MNtzo9jmcv090A3vNtGI9JAlLpPS7WGRfqWByUrGWrO84l R4rvlueQ2QtHFPAHCYqOEskb3c2cbJ2lJdXFzAAU8SCmkXPYkbAA9dtorQ3p1qSxpU6Y V1digoy0CRtY0o84G/snr1sRCE+xgUvq5wnwpFAIk5iaWhZ77M4ZEFgp/6MrjeQhtUpP SUtIqs4eVEZ+c8km72fPbdhdRQV82l3BYWWx+2Ky5QbSY/oP8M6lMbGhjH0jScHzpvUH 3yXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=yKYBUdDs; 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=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c123-20020a633581000000b0040cbcf5f997si18963795pga.209.2022.07.13.02.48.39; Wed, 13 Jul 2022 02:48:47 -0700 (PDT) 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=@sipsolutions.net header.s=mail header.b=yKYBUdDs; 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=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbiGMJqu (ORCPT + 65 others); Wed, 13 Jul 2022 05:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235328AbiGMJpj (ORCPT ); Wed, 13 Jul 2022 05:45:39 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2089F78AF for ; Wed, 13 Jul 2022 02:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=wEdpcr1F/ACTecWeaMzahrcUrWtOeR1lwC5w2QHRhic=; t=1657705529; x=1658915129; b=yKYBUdDseXa8DpK5R7EMc+KByCBma9+ZSyGJtLlZhgxkekN OnXgKE0B7IcoWJWTXeRt+BD7g1aP7vL0B2Z+kYc+myHwmo+Yyoq25hzfc7xpKfAcwFblHM0PQnMMB jevQ7qtO93wX7Y3HsPF2q5aOxSaRfTt323+YA+TuuCmBKa/yDh33G12sG4vCkaxYLIRdjssz6Pz8P 3E88R684rJOc2jO2Kkxw6nH/c6qxssK9iD7ngAR8wA4k2rO6h20oKmiFB/96s92fG24gG96fiQ+8i aiTZLj4pqv7rbghNY4mepDJCxWQZjUcRnUMkLrzVLpq8AfnR1H0wiSWyopjNp9tQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1oBYvv-00EgvB-K4; Wed, 13 Jul 2022 11:45:27 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Andrei Otcheretianski Subject: [PATCH 66/76] wifi: nl80211: Support MLD parameters in nl80211_set_station() Date: Wed, 13 Jul 2022 11:44:52 +0200 Message-Id: <20220713114426.5e05616288de.I1f8376fb2e7f79b4131ed0f138478d2490ddaf4f@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713094502.163926-1-johannes@sipsolutions.net> References: <20220713094502.163926-1-johannes@sipsolutions.net> 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,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 From: Andrei Otcheretianski Set the MLD parameters in NL80211_CMD_SET_STATION handling to be able to change an MLD station. Signed-off-by: Andrei Otcheretianski Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index ee3826e8e52b..35fcf36bbaad 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6894,7 +6894,28 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) if (!info->attrs[NL80211_ATTR_MAC]) return -EINVAL; - mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); + params.link_sta_params.link_id = + nl80211_link_id_or_invalid(info->attrs); + + if (info->attrs[NL80211_ATTR_MLD_ADDR]) { + /* If MLD_ADDR attribute is set then this is an MLD station + * and the MLD_ADDR attribute holds the MLD address and the + * MAC attribute holds for the LINK address. + * In that case, the link_id is also expected to be valid. + */ + if (params.link_sta_params.link_id < 0) + return -EINVAL; + + mac_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); + params.link_sta_params.mld_mac = mac_addr; + params.link_sta_params.link_mac = + nla_data(info->attrs[NL80211_ATTR_MAC]); + if (!is_valid_ether_addr(params.link_sta_params.link_mac)) + return -EINVAL; + } else { + mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); + } + if (info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) { params.link_sta_params.supported_rates = -- 2.36.1