Page MenuHomeFreeBSD

D25832.diff
No OneTemporary

D25832.diff

Index: head/sbin/ifconfig/ifieee80211.c
===================================================================
--- head/sbin/ifconfig/ifieee80211.c
+++ head/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)
{
@@ -5501,6 +5518,12 @@
LINE_CHECK("hwmpmaxhops %u", val);
}
}
+
+ LINE_BREAK();
+
+ if (getdevicename(s, data, sizeof(data), &len) < 0)
+ return;
+ LINE_CHECK("parent interface: %s", data);
LINE_BREAK();
}
Index: head/share/man/man4/net80211.4
===================================================================
--- head/share/man/man4/net80211.4
+++ head/share/man/man4/net80211.4
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 10, 2009
+.Dd August 7, 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: head/sys/net80211/ieee80211_ioctl.h
===================================================================
--- head/sys/net80211/ieee80211_ioctl.h
+++ head/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 device name. */
+
/*
* Parameters for controlling a scan requested with
* IEEE80211_IOC_SCAN_REQ.
Index: head/sys/net80211/ieee80211_ioctl.c
===================================================================
--- head/sys/net80211/ieee80211_ioctl.c
+++ head/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:

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 9, 12:35 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16553392
Default Alt Text
D25832.diff (2 KB)

Event Timeline