From patchwork Sun Mar 16 17:21:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 3839771 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 CE180BF540 for ; Sun, 16 Mar 2014 17:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02B9C200E3 for ; Sun, 16 Mar 2014 17:24:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1155C2017D for ; Sun, 16 Mar 2014 17:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755682AbaCPRWx (ORCPT ); Sun, 16 Mar 2014 13:22:53 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:44773 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754648AbaCPRV4 (ORCPT ); Sun, 16 Mar 2014 13:21:56 -0400 Received: by mail-bk0-f54.google.com with SMTP id 6so335981bkj.27 for ; Sun, 16 Mar 2014 10:21:55 -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=TANrjfziq9wgw4lGPf7zVumruE7NWomuRhX/U+655GA=; b=y98aT7l+3BdOwQqe2MohsGEkV+XlQSZHvR0B5Mxt6sNBfTXdDod3mIqObyTlMJBWUZ iiaYF1pCHLzPHraujIu2+ooAP+99SC/DQeuONsKnxQx/8cB+OMfa30KJmLPspe8KmDGQ yiFW39nKQbhDaEamzkV4YVzd4TfI/G6xA5WjJgbEHNkFgx7C+sugIT2GvD/UD8wutxdj 8wpveqDI13c86xUoQOz28S+QrQLLRzLnrssU5KfXQoh0y+RpsP+YM4KcUS+XhXKjLOK6 6QLP9eNP+voteCVdgyjRl6o1v7Oxn3x0XBdc9QEpO3ZMj2DTFM/fFFZ1ouJXAA/N0qlu FIjg== X-Received: by 10.204.168.206 with SMTP id v14mr10268389bky.26.1394990515106; Sun, 16 Mar 2014 10:21:55 -0700 (PDT) Received: from david-tp.localdomain (stgt-5f71837b.pool.mediaWays.net. [95.113.131.123]) by mx.google.com with ESMTPSA id ci7sm11314777bkc.0.2014.03.16.10.21.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Mar 2014 10:21:54 -0700 (PDT) From: David Herrmann To: netdev@vger.kernel.org Cc: "David S. Miller" , Tom Gundersen , Johannes berg , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, David Herrmann Subject: [PATCH v2 3/4] ath6kl: set NET_NAME_USER for P2P ifs Date: Sun, 16 Mar 2014 18:21:29 +0100 Message-Id: <1394990490-1076-4-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394990490-1076-1-git-send-email-dh.herrmann@gmail.com> References: <1394990490-1076-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=-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 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();