@@ -37,12 +37,13 @@ DEFINE_MUTEX(cfg80211_drv_mutex);
3737static struct dentry * ieee80211_debugfs_dir ;
3838
3939/* requires cfg80211_drv_mutex to be held! */
40- static struct cfg80211_registered_device * cfg80211_drv_by_wiphy (int wiphy )
40+ static struct cfg80211_registered_device *
41+ cfg80211_drv_by_wiphy_idx (int wiphy_idx )
4142{
4243 struct cfg80211_registered_device * result = NULL , * drv ;
4344
4445 list_for_each_entry (drv , & cfg80211_drv_list , list ) {
45- if (drv -> idx == wiphy ) {
46+ if (drv -> wiphy_idx == wiphy_idx ) {
4647 result = drv ;
4748 break ;
4849 }
@@ -56,12 +57,12 @@ static struct cfg80211_registered_device *
5657__cfg80211_drv_from_info (struct genl_info * info )
5758{
5859 int ifindex ;
59- struct cfg80211_registered_device * bywiphy = NULL , * byifidx = NULL ;
60+ struct cfg80211_registered_device * bywiphyidx = NULL , * byifidx = NULL ;
6061 struct net_device * dev ;
6162 int err = - EINVAL ;
6263
6364 if (info -> attrs [NL80211_ATTR_WIPHY ]) {
64- bywiphy = cfg80211_drv_by_wiphy (
65+ bywiphyidx = cfg80211_drv_by_wiphy_idx (
6566 nla_get_u32 (info -> attrs [NL80211_ATTR_WIPHY ]));
6667 err = - ENODEV ;
6768 }
@@ -78,14 +79,14 @@ __cfg80211_drv_from_info(struct genl_info *info)
7879 err = - ENODEV ;
7980 }
8081
81- if (bywiphy && byifidx ) {
82- if (bywiphy != byifidx )
82+ if (bywiphyidx && byifidx ) {
83+ if (bywiphyidx != byifidx )
8384 return ERR_PTR (- EINVAL );
8485 else
85- return bywiphy ; /* == byifidx */
86+ return bywiphyidx ; /* == byifidx */
8687 }
87- if (bywiphy )
88- return bywiphy ;
88+ if (bywiphyidx )
89+ return bywiphyidx ;
8990
9091 if (byifidx )
9192 return byifidx ;
@@ -143,16 +144,16 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
143144 char * newname )
144145{
145146 struct cfg80211_registered_device * drv ;
146- int idx , taken = -1 , result , digits ;
147+ int wiphy_idx , taken = -1 , result , digits ;
147148
148149 mutex_lock (& cfg80211_drv_mutex );
149150
150151 /* prohibit calling the thing phy%d when %d is not its number */
151- sscanf (newname , PHY_NAME "%d%n" , & idx , & taken );
152- if (taken == strlen (newname ) && idx != rdev -> idx ) {
153- /* count number of places needed to print idx */
152+ sscanf (newname , PHY_NAME "%d%n" , & wiphy_idx , & taken );
153+ if (taken == strlen (newname ) && wiphy_idx != rdev -> wiphy_idx ) {
154+ /* count number of places needed to print wiphy_idx */
154155 digits = 1 ;
155- while (idx /= 10 )
156+ while (wiphy_idx /= 10 )
156157 digits ++ ;
157158 /*
158159 * deny the name if it is phy<idx> where <idx> is printed
@@ -222,9 +223,9 @@ struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
222223
223224 mutex_lock (& cfg80211_drv_mutex );
224225
225- drv -> idx = wiphy_counter ++ ;
226+ drv -> wiphy_idx = wiphy_counter ++ ;
226227
227- if (unlikely (drv -> idx < 0 )) {
228+ if (unlikely (drv -> wiphy_idx < 0 )) {
228229 wiphy_counter -- ;
229230 mutex_unlock (& cfg80211_drv_mutex );
230231 /* ugh, wrapped! */
@@ -235,7 +236,7 @@ struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
235236 mutex_unlock (& cfg80211_drv_mutex );
236237
237238 /* give it a proper name */
238- dev_set_name (& drv -> wiphy .dev , PHY_NAME "%d" , drv -> idx );
239+ dev_set_name (& drv -> wiphy .dev , PHY_NAME "%d" , drv -> wiphy_idx );
239240
240241 mutex_init (& drv -> mtx );
241242 mutex_init (& drv -> devlist_mtx );
0 commit comments