From patchwork Tue Dec 9 22:21:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Kochan X-Patchwork-Id: 5465391 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 CBF6EBEEA8 for ; Tue, 9 Dec 2014 22:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC4C7201C8 for ; Tue, 9 Dec 2014 22:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CDC8201C7 for ; Tue, 9 Dec 2014 22:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753708AbaLIWa5 (ORCPT ); Tue, 9 Dec 2014 17:30:57 -0500 Received: from mail-la0-f42.google.com ([209.85.215.42]:41901 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753513AbaLIWa4 (ORCPT ); Tue, 9 Dec 2014 17:30:56 -0500 Received: by mail-la0-f42.google.com with SMTP id gd6so1425376lab.15 for ; Tue, 09 Dec 2014 14:30:55 -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=xYC5YdX+efWXM5KOHIBp00HK4PJShB9cfcB7IsZJGLk=; b=E4jsvK1AGuXTB7jW9Z01pw6jf4YNHJU7rRYpX/pePHPfzrwjON84TRRvY3Z7qqwIoe 6ocjQcmq4Jq8NmKNPrSLNGw/DLUQuUh7urA16sDCZhVKeo5m4H8PZwL4CFx6uwY/nr8f QiXtQf8FyJEeoBn8ZSf1xL4VAlbJBBKspBrju2hak++b57+BW8F5RJGiyj14CbIji17D do3AHxBTFsLKdUmeDwVQXbMuCOGo9KwuXyrmHTdpuZ1IM+epnXxgPasrJ4KBqRH/30z3 aFUsytmcShRhC6uhTHtrc6Aw4Y5vBTGGmCvlc40oZDWU95zyfqhoBY3d1cTn9qJcEsoC cgdg== X-Received: by 10.152.88.69 with SMTP id be5mr844571lab.36.1418164255463; Tue, 09 Dec 2014 14:30:55 -0800 (PST) Received: from localhost.localdomain (121-43-207-82.ip.ukrtel.net. [82.207.43.121]) by mx.google.com with ESMTPSA id j19sm698918lbl.23.2014.12.09.14.30.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Dec 2014 14:30:54 -0800 (PST) From: Vadim Kochan To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, Vadim Kochan Subject: [PATCH v3] wireless: Supporting of IFLA_INFO_KIND rtnl attribute Date: Wed, 10 Dec 2014 00:21:06 +0200 Message-Id: <1418163666-9206-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=ham 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 wlan 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 wlan Signed-off-by: Vadim Kochan Acked-by: Marcel Holtmann --- net/wireless/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index f52a4cd..eb7c088 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "nl80211.h" #include "core.h" #include "sysfs.h" @@ -866,6 +867,10 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, } EXPORT_SYMBOL(cfg80211_stop_iface); +static struct rtnl_link_ops wireless_link_ops __read_mostly = { + .kind = "wlan", +}; + static int cfg80211_netdev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr) { @@ -883,6 +888,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, switch (state) { case NETDEV_POST_INIT: SET_NETDEV_DEVTYPE(dev, &wiphy_type); + dev->rtnl_link_ops = &wireless_link_ops; break; case NETDEV_REGISTER: /*