From patchwork Thu Jun 30 09:00:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 9207035 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B75216075A for ; Thu, 30 Jun 2016 09:01:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A377D28161 for ; Thu, 30 Jun 2016 09:01:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9647328658; Thu, 30 Jun 2016 09:01:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 332D428161 for ; Thu, 30 Jun 2016 09:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbcF3JBS (ORCPT ); Thu, 30 Jun 2016 05:01:18 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33884 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbcF3JBP (ORCPT ); Thu, 30 Jun 2016 05:01:15 -0400 Received: by mail-pf0-f194.google.com with SMTP id 66so6855094pfy.1 for ; Thu, 30 Jun 2016 02:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=kH8C9gdzdSxdkU+7rDUPB78b1rngGmPtOIdIvkqgSNM=; b=cswUx0un1gOxRST4Bg4Xt4SZvythsSU9R3wd4qS3/kJHRtM96u8RIfOXcdS6rlVht4 SN4pf1egHoAfOFN2HLQDF15fHaXRNKuQpgUSVGMdq1SQM7vMjyBCncgpMExhpeI/er1i JsXUo1MaiP2bxQRLUZihosPErjl0ev4+RhyxEPIzH2B7S6pLDgWwVmX8QZAEgVWDx8un Hbe6oMtTFLobA8oHbT3cJihQgud6yEA1KCHvaUJ/l4TVkEFaIUkHqN9VBdHqJmBWip9e KJ2Tu3Lg9K7bZ71cUSrVVz4oy8kTpaYplEEG79zoxuMqR3ExZQAVE0Qbpei8OrMS751o QzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kH8C9gdzdSxdkU+7rDUPB78b1rngGmPtOIdIvkqgSNM=; b=KaIjFYjEaumeC+Boytx+MwKDP9bAA8V37JemM93eagASJlA/WO2Jce8yKz11GOqr2z fcngeZzWahbK0ZbsNnzh4k1hWyFxevB+7chcSi2XUnV0LUrZRjJPpmbFQO6x+G53Ic+U 4kQW90Eu2odGcyJxd8qigK+8JHBcoJPdlO6uoh3UBN9hVEayCrGJXbc6BEMIlOaL9PtO 38GIyicztxgm9pV7mcaIlwwUEAfys+Y0JXjI9dNilPGZ0FtpCQ9xgTea3nJWjbSgkuZ6 PBMnpDSz3zB4L8y6YXU20Fhx/9Cv2W67yR5wjdzJ8NsJWUN5Z27r/EbsKiCVShawZdaE MgoQ== X-Gm-Message-State: ALyK8tKJ99ZEs42dalrTV2A6ldi8eI/bjG60+GfSA9mPhWhOG0WYWjKXPBSmLOysYzOl/Q== X-Received: by 10.98.73.69 with SMTP id w66mr19618600pfa.104.1467277274853; Thu, 30 Jun 2016 02:01:14 -0700 (PDT) Received: from localhost.localdomain (pd28b854f.kngwnt01.ap.so-net.ne.jp. [210.139.133.79]) by smtp.gmail.com with ESMTPSA id f2sm3772969pfb.76.2016.06.30.02.01.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 02:01:14 -0700 (PDT) From: Masashi Honma To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, j@w1.fi, me@bobcopeland.com, Masashi Honma Subject: [PATCH] cfg80211: Add mesh peer AID setting API Date: Thu, 30 Jun 2016 18:00:58 +0900 Message-Id: <1467277258-2331-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously, mesh peer AID is not reported to kernel when local mesh STA is created without iw command. The mesh peer AID is needed by mesh peer power management functionality to identify a AID in a TIM element. This patch creates mesh peer AID setting API. Signed-off-by: Masashi Honma --- include/net/cfg80211.h | 1 + include/uapi/linux/nl80211.h | 5 +++++ net/mac80211/cfg.c | 1 + net/wireless/nl80211.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7bbb00d..2fa5896 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -805,6 +805,7 @@ struct station_parameters { u32 sta_modify_mask; int listen_interval; u16 aid; + u16 mesh_aid; u8 supported_rates_len; u8 plink_action; u8 plink_state; diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 53c8278..f8c454e 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -1829,6 +1829,9 @@ enum nl80211_commands { * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per * interface type. * + * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is + * used to pull the stored data for mesh peer in power save state. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -2213,6 +2216,8 @@ enum nl80211_attrs { NL80211_ATTR_IFTYPE_EXT_CAPA, + NL80211_ATTR_MESH_PEER_AID, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0c12e40..08802f7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -997,6 +997,7 @@ static void sta_apply_mesh_params(struct ieee80211_local *local, if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) changed = mesh_plink_inc_estab_count(sdata); sta->mesh->plink_state = params->plink_state; + sta->mesh->aid = params->mesh_aid; ieee80211_mps_sta_status_update(sta); changed |= ieee80211_mps_set_sta_local_pm(sta, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c503e96..f41fb61 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4410,6 +4410,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_STATE]); if (params.plink_state >= NUM_NL80211_PLINK_STATES) return -EINVAL; + if (info->attrs[NL80211_ATTR_MESH_PEER_AID]) + params.mesh_aid = nla_get_u16( + info->attrs[NL80211_ATTR_MESH_PEER_AID]); params.sta_modify_mask |= STATION_PARAM_APPLY_PLINK_STATE; }