Skip to content

Commit 94f9bf6

Browse files
committed
Add comment for 'wiphy_get_vwifi_vif'
Adjust position of function 'wiphy_get_vwifi_vif', and add a comment for it.
1 parent 9d0a168 commit 94f9bf6

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

vwifi.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,20 @@ static inline struct vwifi_vif *wdev_get_vwifi_vif(struct wireless_dev *wdev)
390390
return container_of(wdev, struct vwifi_vif, wdev);
391391
}
392392

393+
/* helper function to retrieve vif from wiphy */
394+
static struct vwifi_vif *wiphy_get_vwifi_vif(struct wiphy *wiphy)
395+
{
396+
struct wireless_dev *wdev;
397+
struct vwifi_vif *vif = NULL;
398+
399+
list_for_each_entry (wdev, &wiphy->wdev_list, list) {
400+
vif = container_of(wdev, struct vwifi_vif, wdev);
401+
break; /* Assuming only one virtual interface is present */
402+
}
403+
404+
return vif;
405+
}
406+
393407
static inline u32 vwifi_mac_to_32(const u8 *mac)
394408
{
395409
u32 h = 3323198485U;
@@ -1843,19 +1857,6 @@ static int vwifi_delete_interface(struct vwifi_vif *vif)
18431857
return 0;
18441858
}
18451859

1846-
static struct vwifi_vif *wiphy_get_vwifi_vif(struct wiphy *wiphy)
1847-
{
1848-
struct wireless_dev *wdev;
1849-
struct vwifi_vif *vif = NULL;
1850-
1851-
list_for_each_entry (wdev, &wiphy->wdev_list, list) {
1852-
vif = container_of(wdev, struct vwifi_vif, wdev);
1853-
break; /* Assuming only one virtual interface is present */
1854-
}
1855-
1856-
return vif;
1857-
}
1858-
18591860
/* Set transmit power for the virtual interface */
18601861
static int vwifi_set_tx_power(struct wiphy *wiphy,
18611862
struct wireless_dev *wdev,

0 commit comments

Comments
 (0)