From patchwork Wed Mar 26 13:05:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 3893081 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 0B307BF540 for ; Wed, 26 Mar 2014 13:06:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E69FD2021A for ; Wed, 26 Mar 2014 13:06:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 319CB201E7 for ; Wed, 26 Mar 2014 13:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754699AbaCZNFu (ORCPT ); Wed, 26 Mar 2014 09:05:50 -0400 Received: from mail-bk0-f43.google.com ([209.85.214.43]:51989 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754693AbaCZNFr (ORCPT ); Wed, 26 Mar 2014 09:05:47 -0400 Received: by mail-bk0-f43.google.com with SMTP id v15so520854bkz.16 for ; Wed, 26 Mar 2014 06:05:45 -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:in-reply-to:references; bh=2kai/0X2DtqeRagBr/dv5L4JmxKYwY3RApDsMCLZyiU=; b=eHgbycjsHQdNJTuV9c1pQBZVD5wl1eaqr1z6wMYoAUdKnDChlQH1INlXR15qOh83Gd Q58oVaHJSZG+dQyXvCzeTMYcc1sEnqp9ycTcnJEilp+qc3FtJs6WTETN94QFMfpchAqd e2EbNLDOYNJzIBX/ZT4wji2Z/zVMAMNy+SAoc6bcPRzGq8I9I7RFpx9F9I6uAL6402Pc ZMZHFq9qzyDwJwIkPvTXy6T4taGfRTAOH4IX3jlItp8CDj8MFrllqIjG2kKNAQDHNDr7 zBnVoDjIyBdvnRnoqO/S93aJDYiSCSJICAcT/Ye1kKMQshhpW9toygFH5+HbZA8O6AQh FSzg== X-Received: by 10.204.175.196 with SMTP id bb4mr480058bkb.105.1395839145526; Wed, 26 Mar 2014 06:05:45 -0700 (PDT) Received: from david-tp.localdomain (stgt-5f7280a1.pool.mediaWays.net. [95.114.128.161]) by mx.google.com with ESMTPSA id xj2sm23082710bkb.15.2014.03.26.06.05.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Mar 2014 06:05:44 -0700 (PDT) From: David Herrmann To: netdev@vger.kernel.org Cc: "David S. Miller" , Tom Gundersen , Johannes berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Herrmann Subject: [PATCH v5 3/4] ath6kl: set NET_NAME_USER for P2P ifs Date: Wed, 26 Mar 2014 14:05:16 +0100 Message-Id: <1395839117-20090-4-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1395839117-20090-1-git-send-email-dh.herrmann@gmail.com> References: <1395839117-20090-1-git-send-email-dh.herrmann@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 P2P netdevs and other devices that are created via nl80211 from user-space have a name provided by user-space. Therefore, set NET_NAME_USER so this is correctly shown in sysfs. Signed-off-by: David Herrmann Acked-by: Kalle Valo Acked-by: Tom Gundersen --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 5 ++++- drivers/net/wireless/ath/ath6kl/cfg80211.h | 1 + drivers/net/wireless/ath/ath6kl/core.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index c2c6f46..131d8ab 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1512,7 +1512,8 @@ static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, return ERR_PTR(-EINVAL); } - wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type); + wdev = ath6kl_interface_add(ar, name, NET_NAME_USER, type, + if_idx, nw_type); if (!wdev) return ERR_PTR(-ENOMEM); @@ -3630,6 +3631,7 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif) } struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, + unsigned char name_assign_type, enum nl80211_iftype type, u8 fw_vif_idx, u8 nw_type) { @@ -3666,6 +3668,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, ndev->dev_addr[4] ^= 0x80; } + ndev->name_assign_type = name_assign_type; init_netdev(ndev); ath6kl_init_control_info(vif); diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h index b59becd..5aa57a7 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.h +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h @@ -25,6 +25,7 @@ enum ath6kl_cfg_suspend_mode { }; struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, + unsigned char name_assign_type, enum nl80211_iftype type, u8 fw_vif_idx, u8 nw_type); void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c index 4b46adb..3cc8145 100644 --- a/drivers/net/wireless/ath/ath6kl/core.c +++ b/drivers/net/wireless/ath/ath6kl/core.c @@ -195,8 +195,8 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) rtnl_lock(); /* Add an initial station interface */ - wdev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0, - INFRA_NETWORK); + wdev = ath6kl_interface_add(ar, "wlan%d", NET_NAME_ENUM, + NL80211_IFTYPE_STATION, 0, INFRA_NETWORK); rtnl_unlock();