From patchwork Thu Feb 27 14:47:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 3733871 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CA429F2F7 for ; Thu, 27 Feb 2014 14:49:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 314D7201DC for ; Thu, 27 Feb 2014 14:49:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DA5820122 for ; Thu, 27 Feb 2014 14:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbaB0Osm (ORCPT ); Thu, 27 Feb 2014 09:48:42 -0500 Received: from mail-ea0-f181.google.com ([209.85.215.181]:62196 "EHLO mail-ea0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbaB0Orb (ORCPT ); Thu, 27 Feb 2014 09:47:31 -0500 Received: by mail-ea0-f181.google.com with SMTP id k10so1868791eaj.40 for ; Thu, 27 Feb 2014 06:47:29 -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:in-reply-to:references; bh=FJAHLRseSe+XIRtksU2sioCjzW8HVeNX1qhygCRPJMg=; b=lhc1JtvLj3H/vk7eGu0hMcQ5ED2hsCExXrQTzE1q7Hfv72g1IFz/1rwUkGG+dd6Ry5 9KjHiusM7v7JuXo2F0/mRfz1Hp8hBzrf/wmPe1PDiH7HAogp7WEN5Ef4fEWgimAwMFG1 JhErivGnwZxRkXPUVOPU4jgF1gpXo2qMSlvwjckw6yASpzbQeWc2aEwSqUe5iMDFLIUc PsHazBdacZPl9KVd8S6RiI8rXnsMg1kvuRGiK8Ox3hSVScjvqzrUAL2HUz90TSXmM4fp f8eiA/23wYNcsEU+FUFO/AT/WE3zveQUsjPZdevq5mmzgPu2iMv1nI3urrJ4EVjvKycN GjvQ== X-Received: by 10.14.176.66 with SMTP id a42mr10083336eem.101.1393512449546; Thu, 27 Feb 2014 06:47:29 -0800 (PST) Received: from david-tp.localdomain (stgt-5f72aa4f.pool.mediaWays.net. [95.114.170.79]) by mx.google.com with ESMTPSA id 43sm17691835eeh.13.2014.02.27.06.47.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Feb 2014 06:47:28 -0800 (PST) From: David Herrmann To: netdev@vger.kernel.org Cc: "David S. Miller" , Kay Sievers , Tom Gundersen , Johannes berg , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, David Herrmann , Kalle Valo Subject: [PATCH 3/4] ath6kl: set NET_NAME_USER for P2P ifs Date: Thu, 27 Feb 2014 15:47:13 +0100 Message-Id: <1393512434-1325-4-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393512434-1325-1-git-send-email-dh.herrmann@gmail.com> References: <1393512434-1325-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, 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. Cc: Kalle Valo Signed-off-by: David Herrmann Acked-by: Kalle Valo --- 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 fd4c89d..74598ed 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1516,7 +1516,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); @@ -3625,6 +3626,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) { @@ -3661,6 +3663,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();