Index: sbin/ifconfig/ifieee80211.c =================================================================== --- sbin/ifconfig/ifieee80211.c +++ sbin/ifconfig/ifieee80211.c @@ -4779,6 +4779,23 @@ return 0; } +static int +getdevicename(int s, void *data, size_t len, int *plen) +{ + struct ieee80211req ireq; + + (void) memset(&ireq, 0, sizeof(ireq)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_IC_NAME; + ireq.i_val = -1; + ireq.i_data = data; + ireq.i_len = len; + if (ioctl(s, SIOCG80211, &ireq) < 0) + return (-1); + *plen = ireq.i_len; + return (0); +} + static void ieee80211_status(int s) { @@ -5503,6 +5520,12 @@ } LINE_BREAK(); + + if (getdevicename(s, data, sizeof(data), &len) < 0) + return; + LINE_CHECK("parent interface: %s", data); + + LINE_BREAK(); } static int Index: share/man/man4/net80211.4 =================================================================== --- share/man/man4/net80211.4 +++ share/man/man4/net80211.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2009 +.Dd July 27, 2020 .Dt NET80211 4 .Os .Sh NAME @@ -393,6 +393,16 @@ and .Dv IEEE80211_HWMP_ROOTMODE_RANN (send broadcast Root Announcement (RANN) frames). +.It Dv IEEE80211_IOC_IC_NAME +Return the underlying hardware +.Xr device 9 +name in the buffer pointed to by +.Va i_data +and the name length including terminating NUL character in +.Va i_len . +If the buffer length is too small to hold the full name +.Er EINVAL +will be returned. .It Dv IEEE80211_IOC_INACTIVITY Return whether or not the system handles inactivity processing in .Va i_val . Index: sys/net80211/ieee80211_ioctl.h =================================================================== --- sys/net80211/ieee80211_ioctl.h +++ sys/net80211/ieee80211_ioctl.h @@ -743,6 +743,9 @@ #define IEEE80211_IOC_QUIET_OFFSET 207 /* Quiet Offset */ #define IEEE80211_IOC_QUIET_DUR 208 /* Quiet Duration */ #define IEEE80211_IOC_QUIET_COUNT 209 /* Quiet Count */ + +#define IEEE80211_IOC_IC_NAME 210 /* HW devie name. */ + /* * Parameters for controlling a scan requested with * IEEE80211_IOC_SCAN_REQ. Index: sys/net80211/ieee80211_ioctl.c =================================================================== --- sys/net80211/ieee80211_ioctl.c +++ sys/net80211/ieee80211_ioctl.c @@ -785,6 +785,13 @@ int error = 0; switch (ireq->i_type) { + case IEEE80211_IOC_IC_NAME: + len = strlen(ic->ic_name) + 1; + if (len > ireq->i_len) + return (EINVAL); + ireq->i_len = len; + error = copyout(ic->ic_name, ireq->i_data, ireq->i_len); + break; case IEEE80211_IOC_SSID: switch (vap->iv_state) { case IEEE80211_S_INIT: