From patchwork Sun Dec 7 00:04:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Kochan X-Patchwork-Id: 5450941 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 47D0BBEEA8 for ; Sun, 7 Dec 2014 00:14:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66DE720138 for ; Sun, 7 Dec 2014 00:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D9EB200F4 for ; Sun, 7 Dec 2014 00:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751726AbaLGAOm (ORCPT ); Sat, 6 Dec 2014 19:14:42 -0500 Received: from mail-la0-f49.google.com ([209.85.215.49]:64710 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbaLGAOl (ORCPT ); Sat, 6 Dec 2014 19:14:41 -0500 Received: by mail-la0-f49.google.com with SMTP id hs14so2398945lab.36 for ; Sat, 06 Dec 2014 16:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=R1+KyGA5MABYdnYwVgtg9jUEVdAGfyUXamVy3HIru7k=; b=Q9fcok+a+NF01gs7s9DKjNHtxoBuNe5n/f5vR2bQ2hZHjRxrjrroEE7GWH1krfehcO tPnKmh0kcPN90IELKrHQ/rpi18XwKYW6kubnG9VztoM+JTJm5AGnhKmDfIf0r4J3rOCC xxnrWcCnimB7qq6cUkmfvXoNoVVQ+69J5RXtNA6ZrXr9UKyUbvc2NjFMCTFm5PO8ZWLB Dnr5uEukla+OwvGl6ECoYS1ViCTt79O3jeWk/mtcXUmTSATIkqZSj8f7F2pf1q8x1imi KiKO8X+rk0Dp7sqdXSXHMBN86ksq/JFqs6PouICqd1I5lTNuJIZafFmZfBa7nf5nzr4m bwEA== X-Received: by 10.112.199.233 with SMTP id jn9mr9576305lbc.18.1417911279347; Sat, 06 Dec 2014 16:14:39 -0800 (PST) Received: from localhost.localdomain (121-43-207-82.ip.ukrtel.net. [82.207.43.121]) by mx.google.com with ESMTPSA id jj7sm9566679lbc.5.2014.12.06.16.14.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Dec 2014 16:14:38 -0800 (PST) From: Vadim Kochan To: johannes@sipsolutions.net, linville@tuxdriver.com, davem@davemloft.net, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Vadim Kochan Subject: [PATCH] mac80211: Supporting of IFLA_INFO_KIND rtnl attribute Date: Sun, 7 Dec 2014 02:04:50 +0200 Message-Id: <1417910690-2021-1-git-send-email-vadim4j@gmail.com> X-Mailer: git-send-email 2.1.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It allows to identify the wireless kind of device for the user application, e.g.: # ip -d link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 2: enp0s25: mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0 3: wlp3s0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0 wireless 4: wlp0s26u1u2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0 wireless Signed-off-by: Vadim Kochan --- net/mac80211/iface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 653f5eb..b993c7d 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "ieee80211_i.h" #include "sta_info.h" #include "debugfs_netdev.h" @@ -1624,6 +1625,10 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local, mutex_unlock(&local->iflist_mtx); } +static struct rtnl_link_ops wireless_link_ops __read_mostly = { + .kind = "wireless", +}; + int ieee80211_if_add(struct ieee80211_local *local, const char *name, struct wireless_dev **new_wdev, enum nl80211_iftype type, struct vif_params *params) @@ -1684,6 +1689,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, memcpy(sdata->vif.addr, ndev->dev_addr, ETH_ALEN); memcpy(sdata->name, ndev->name, IFNAMSIZ); + ndev->rtnl_link_ops = &wireless_link_ops; + sdata->dev = ndev; }