Message ID | 1411773856-25042-1-git-send-email-greearb@candelatech.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Fri, 2014-09-26 at 16:24 -0700, greearb@candelatech.com wrote: > +/* > + * Attempt to rename a device. Acquire RTNL before calling. > + */ please add kernel-doc > +int cfg80211_dev_rename_wiphy(struct wiphy *wiphy, char *newname); Should also be const char * And should probably be called cfg80211_rename_wiphy() only? What's the dev doing there? > > +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); You could just inlin ethe wiphy_to_rdev() and get rid of the variable. Anyhow - if the intent is to do this at creation, why do you do it after the fact? Couldn't you just specify the name when creating it? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 10/06/2014 07:27 AM, Johannes Berg wrote: > On Fri, 2014-09-26 at 16:24 -0700, greearb@candelatech.com wrote: > >> +/* >> + * Attempt to rename a device. Acquire RTNL before calling. >> + */ > > please add kernel-doc > >> +int cfg80211_dev_rename_wiphy(struct wiphy *wiphy, char *newname); > > Should also be const char * > > And should probably be called cfg80211_rename_wiphy() only? What's the > dev doing there? >> >> +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); > > You could just inlin ethe wiphy_to_rdev() and get rid of the variable. > > Anyhow - if the intent is to do this at creation, why do you do it after > the fact? Couldn't you just specify the name when creating it? That would be fine with me..I thought it might be more invasive and thus less welcome. I'll see what it takes to implement it like that when I get a chance. On the road this week, so might be a bit... Thanks, Ben > > johannes >
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3a13aab..e1641e6 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 diff --git a/net/wireless/core.c b/net/wireless/core.c index f52a4cd..4d7e17c 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) {