summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-05-25 13:51:13 +0000
committerglebius <glebius@FreeBSD.org>2015-05-25 13:51:13 +0000
commitf67a4dcfd7b755e279a3eacad335e4b19f063aab (patch)
tree20c52d5b70928dbf070e0479f87a9ad4dd8df9e2 /sys/dev
parent9f7fffcc5b3bcf5932d21d2c7a6fe6ff3586ebb7 (diff)
downloadFreeBSD-src-f67a4dcfd7b755e279a3eacad335e4b19f063aab.zip
FreeBSD-src-f67a4dcfd7b755e279a3eacad335e4b19f063aab.tar.gz
Make net80211 drivers supply their device name to the net80211 layer, so
that the latter doesn't need to go through struct ifnet to get their name. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ath/if_ath.c1
-rw-r--r--sys/dev/bwi/if_bwi.c1
-rw-r--r--sys/dev/bwn/if_bwn.c1
-rw-r--r--sys/dev/if_ndis/if_ndis.c1
-rw-r--r--sys/dev/ipw/if_ipw.c1
-rw-r--r--sys/dev/iwi/if_iwi.c1
-rw-r--r--sys/dev/iwn/if_iwn.c1
-rw-r--r--sys/dev/malo/if_malo.c1
-rw-r--r--sys/dev/mwl/if_mwl.c1
-rw-r--r--sys/dev/ral/rt2560.c1
-rw-r--r--sys/dev/ral/rt2661.c1
-rw-r--r--sys/dev/ral/rt2860.c1
-rw-r--r--sys/dev/usb/wlan/if_rsu.c1
-rw-r--r--sys/dev/usb/wlan/if_rum.c1
-rw-r--r--sys/dev/usb/wlan/if_run.c1
-rw-r--r--sys/dev/usb/wlan/if_uath.c1
-rw-r--r--sys/dev/usb/wlan/if_upgt.c1
-rw-r--r--sys/dev/usb/wlan/if_ural.c1
-rw-r--r--sys/dev/usb/wlan/if_urtw.c1
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c1
-rw-r--r--sys/dev/usb/wlan/if_zyd.c1
-rw-r--r--sys/dev/wi/if_wi.c1
-rw-r--r--sys/dev/wpi/if_wpi.c1
-rw-r--r--sys/dev/wtap/if_wtap.c1
-rw-r--r--sys/dev/wtap/if_wtapvar.h1
-rw-r--r--sys/dev/wtap/wtap_hal/hal.c2
26 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 83d9bd2..037c6b5 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -592,6 +592,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
goto bad;
}
ic = ifp->if_l2com;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
/* set these up early for if_printf use */
if_initname(ifp, device_get_name(sc->sc_dev),
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c
index aa5369a..c8e6f63 100644
--- a/sys/dev/bwi/if_bwi.c
+++ b/sys/dev/bwi/if_bwi.c
@@ -507,6 +507,7 @@ bwi_attach(struct bwi_softc *sc)
ieee80211_init_channels(ic, NULL, &bands);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_caps = IEEE80211_C_STA |
IEEE80211_C_SHSLOT |
IEEE80211_C_SHPREAMBLE |
diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c
index 959d1f1..897f56f 100644
--- a/sys/dev/bwn/if_bwn.c
+++ b/sys/dev/bwn/if_bwn.c
@@ -1058,6 +1058,7 @@ bwn_attach_post(struct bwn_softc *sc)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 7ac1dea..8162bb9 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -738,6 +738,7 @@ ndis_attach(dev)
ifp->if_ioctl = ndis_ioctl_80211;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_caps = IEEE80211_C_8023ENCAP |
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index 04c3363..3f20745 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -286,6 +286,7 @@ ipw_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_DS;
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index b6de4b6..c33325d 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -364,6 +364,7 @@ iwi_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index ab98204..3bb2e39 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -556,6 +556,7 @@ iwn_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c
index a3aa04e..e998f74 100644
--- a/sys/dev/malo/if_malo.c
+++ b/sys/dev/malo/if_malo.c
@@ -276,6 +276,7 @@ malo_attach(uint16_t devid, struct malo_softc *sc)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(sc->malo_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c
index 5997dbc..f7e6cfe 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -413,6 +413,7 @@ mwl_attach(uint16_t devid, struct mwl_softc *sc)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index 02c9310..1d6b4f7 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -273,6 +273,7 @@ rt2560_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c
index 448ba57..4405478 100644
--- a/sys/dev/ral/rt2661.c
+++ b/sys/dev/ral/rt2661.c
@@ -274,6 +274,7 @@ rt2661_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c
index b29a0eb..7a60db9 100644
--- a/sys/dev/ral/rt2860.c
+++ b/sys/dev/ral/rt2860.c
@@ -315,6 +315,7 @@ rt2860_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c
index 677775c..70aa6f4 100644
--- a/sys/dev/usb/wlan/if_rsu.c
+++ b/sys/dev/usb/wlan/if_rsu.c
@@ -355,6 +355,7 @@ rsu_attach(device_t self)
ifp->if_hwassist = CSUM_TCP;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* Not only, but not used. */
ic->ic_opmode = IEEE80211_M_STA; /* Default to BSS mode. */
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c
index a3dc562..4ce42f9 100644
--- a/sys/dev/usb/wlan/if_rum.c
+++ b/sys/dev/usb/wlan/if_rum.c
@@ -488,6 +488,7 @@ rum_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
/* set device capabilities */
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index 22cc180..e318338 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -776,6 +776,7 @@ run_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 0796fbe..d6adf4c 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -442,6 +442,7 @@ uath_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c
index 242eb67..afd57cf 100644
--- a/sys/dev/usb/wlan/if_upgt.c
+++ b/sys/dev/usb/wlan/if_upgt.c
@@ -341,6 +341,7 @@ upgt_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA;
/* set device capabilities */
diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c
index c81b708..ad0871e 100644
--- a/sys/dev/usb/wlan/if_ural.c
+++ b/sys/dev/usb/wlan/if_ural.c
@@ -473,6 +473,7 @@ ural_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
/* set device capabilities */
diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index d2c6ef9..c94b099 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -881,6 +881,7 @@ urtw_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index 331f782..7d56e06 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -442,6 +442,7 @@ urtwn_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c
index ca1fb06..eb4c780 100644
--- a/sys/dev/usb/wlan/if_zyd.c
+++ b/sys/dev/usb/wlan/if_zyd.c
@@ -388,6 +388,7 @@ zyd_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA;
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 6801823..3978224 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -344,6 +344,7 @@ wi_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_caps = IEEE80211_C_STA
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index 7b438c7..164331f 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -452,6 +452,7 @@ wpi_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c
index 3c64085..b00585a 100644
--- a/sys/dev/wtap/if_wtap.c
+++ b/sys/dev/wtap/if_wtap.c
@@ -797,6 +797,7 @@ wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_name = sc->name;
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_opmode = IEEE80211_M_MBSS;
ic->ic_caps = IEEE80211_C_MBSS;
diff --git a/sys/dev/wtap/if_wtapvar.h b/sys/dev/wtap/if_wtapvar.h
index bb165b4..3bdc898 100644
--- a/sys/dev/wtap/if_wtapvar.h
+++ b/sys/dev/wtap/if_wtapvar.h
@@ -130,6 +130,7 @@ struct wtap_vap {
struct taskqueue;
struct wtap_softc {
+ char name[7]; /* wtapXX\0 */
int32_t id;
int32_t up;
struct ifnet *sc_ifp; /* interface common */
diff --git a/sys/dev/wtap/wtap_hal/hal.c b/sys/dev/wtap/wtap_hal/hal.c
index 9ec1ca8..6014e39 100644
--- a/sys/dev/wtap/wtap_hal/hal.c
+++ b/sys/dev/wtap/wtap_hal/hal.c
@@ -182,6 +182,8 @@ new_wtap(struct wtap_hal *hal, int32_t id)
bzero(hal->hal_devs[id], sizeof(struct wtap_softc));
hal->hal_devs[id]->sc_md = hal->hal_md;
hal->hal_devs[id]->id = id;
+ snprintf(hal->hal_devs[id]->name, sizeof(hal->hal_devs[id]->name),
+ "wlan%d", id);
mtx_init(&hal->hal_devs[id]->sc_mtx, "wtap_softc mtx", NULL,
MTX_DEF | MTX_RECURSE);
OpenPOWER on IntegriCloud