From patchwork Thu Sep 25 23:59:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 4977991 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 28601BEEA6 for ; Thu, 25 Sep 2014 23:59:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 414E12027D for ; Thu, 25 Sep 2014 23:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BFC6201DD for ; Thu, 25 Sep 2014 23:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752457AbaIYX7q (ORCPT ); Thu, 25 Sep 2014 19:59:46 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:48203 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbaIYX7q (ORCPT ); Thu, 25 Sep 2014 19:59:46 -0400 Received: from ben-dt2.candelatech.com. (firewall.candelatech.com [70.89.124.249]) by mail2.candelatech.com (Postfix) with ESMTP id A3C5340CF8C; Thu, 25 Sep 2014 16:59:45 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH 1/2] wireless: expose set-wiphy-name method to other modules. Date: Thu, 25 Sep 2014 16:59:43 -0700 Message-Id: <1411689584-16136-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.11.7 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Ben Greear This will let hw-sim create wiphy objects with a specific name. Signed-off-by: Ben Greear --- include/net/cfg80211.h | 6 ++++++ net/wireless/core.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3a13aab..68aabfa 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -4854,6 +4854,11 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, gfp_t gfp); +/* + * Attempt to rename a device. Acquire RTNL before calling. + */ +int cfg80211_dev_rename_wiphy(struct wiphy* wiphy, char *newname); + /** * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy * @wiphy: the wiphy to shut down @@ -4869,6 +4874,7 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); + /* ethtool helper */ void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); diff --git a/net/wireless/core.c b/net/wireless/core.c index f52a4cd..03e4715 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -86,6 +86,15 @@ struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx) return &rdev->wiphy; } +int cfg80211_dev_rename_wiphy(struct wiphy* wiphy, char *newname) +{ + struct cfg80211_registered_device *rdev; + + rdev = wiphy_to_rdev(wiphy); + return cfg80211_dev_rename(rdev, newname); +} +EXPORT_SYMBOL_GPL(cfg80211_dev_rename_wiphy); + int cfg80211_dev_rename(struct cfg80211_registered_device *rdev, char *newname) {