From patchwork Sun May 21 08:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Obukhov X-Patchwork-Id: 9738919 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 9E18C60326 for ; Sun, 21 May 2017 08:45:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ABB5286A7 for ; Sun, 21 May 2017 08:45:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D000286B2; Sun, 21 May 2017 08:45:14 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 1A4A8286A7 for ; Sun, 21 May 2017 08:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068AbdEUIpI (ORCPT ); Sun, 21 May 2017 04:45:08 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:36606 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbdEUIpH (ORCPT ); Sun, 21 May 2017 04:45:07 -0400 Received: by mail-pg0-f43.google.com with SMTP id x64so55021383pgd.3 for ; Sun, 21 May 2017 01:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=RGqH62GJdKtI6/Tk8Gc8b7u+c/xUX+W68OKmcjHdVIc=; b=KLFZKo18gEEpGf7bZJ7lXCMlNS2Cs6KS/qkDzlaj/ISkBujX8FZXqYJFSJyn/3L3Vu R+ZQuzdKtcRJ+uwskLTgJf99IeiRjJ1B6mMTzU6Ng1Q4dCIb5tnVueJ1kd2LzM5e27ay CAxrRZdp+ZObjXMVNuRNU0pJyjXpr+QsRMco5YM8Bl71vN4o15OSbpH4VrpHBULudmrJ POahEkGjwAoSN0UnlzNz6w0KvSv4MtLNACHrsZCTwlh8WiqEOcFTrNlq9bQcKUMPxwCK 89nElVMrp026xj8gPTlbD2dYJGFM0tH3iZB1wKu9o1cq+yWM9ZBaoxlg7IQMaPxQAu4p damw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=RGqH62GJdKtI6/Tk8Gc8b7u+c/xUX+W68OKmcjHdVIc=; b=doqQadE24gX0SSSUZHCivxMCHkWGIP5RCpanuOussKFjvjiFSaTspuJyM9vLU5Fr45 yrFtBZR69V4UDpT4wpFqMpO8R3MRTus1YN5tSEJkchB9JQ9YpHWZxq8waHEnVJHZYroK iqdYV0aydKnn/5fr7UiIAskzEHKNztcwCnfDCSrivl+Vg+HueLaoJOMcnASNrOles8DV OGGteEdAFPAaalafVp9Ivnu20WDMiol88ZEKxw8ktjMGQBaKD0imMdlYBtqyCH+a/MVZ QrvKYvLaxuvV4Tfs75WoB+Cp432gFe01++7VXRWzu9H3mrwLQAbs+Yqi5vL/8FnPLYcb +8Ow== X-Gm-Message-State: AODbwcALBhJF57H5P2KfMg29tn9i5SLDdxwhVTSoM/69jeJSAcJdCIRW 1vHftBntQuE6hRsfb94br4/5I+ppP5nE X-Received: by 10.99.94.66 with SMTP id s63mr18582213pgb.34.1495356306314; Sun, 21 May 2017 01:45:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.183.238 with HTTP; Sun, 21 May 2017 01:45:05 -0700 (PDT) From: Kirill Obukhov Date: Sun, 21 May 2017 11:45:05 +0300 Message-ID: Subject: [PATCH] nl80211: Add association id to station response To: Johannes Berg Cc: linux-wireless@vger.kernel.org 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 There are unique association id attribute must be passed in station add request. But we have no way to retrieve ids already in use. To solve issue association id attribute added to station response. diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b083e6c..3c270a5 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1098,6 +1098,7 @@ struct cfg80211_tid_stats { * * @filled: bitflag of flags using the bits of &enum nl80211_sta_info to * indicate the relevant values in this struct for them + * @aid: station association id * @connected_time: time(in secs) since a station is last connected * @inactive_time: time since last station activity (tx/rx) in milliseconds * @rx_bytes: bytes (size of MPDUs) received from this station @@ -1146,6 +1147,7 @@ struct cfg80211_tid_stats { */ struct station_info { u64 filled; + u16 aid; u32 connected_time; u32 inactive_time; u64 rx_bytes; diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7cdf7a8..ce41299 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2091,6 +2091,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) sinfo->filled |= BIT(NL80211_STA_INFO_BEACON_LOSS); } + sinfo->aid = sta->sta.aid; sinfo->connected_time = ktime_get_seconds() - sta->last_connected; sinfo->inactive_time = jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c3bc9da..b08df75 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4303,6 +4303,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || + nla_put_u16(msg, NL80211_ATTR_STA_AID, sinfo->aid) || nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation)) goto nla_put_failure;