Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src-draft/trunk]: src/sys/dev Ipf is initalized in vap_setup, so don't initi...
details: https://anonhg.NetBSD.org/src-all/rev/b4aa370b92ef
branches: trunk
changeset: 933448:b4aa370b92ef
user: Nathanial Sloss <nat%netbsd.org@localhost>
date: Fri May 22 23:27:36 2020 +1000
description:
Ipf is initalized in vap_setup, so don't initialize twice.
Don't overload variables set in vap/setup attach. The exeption being the dev
name for now.
Scan improvements for urtwn from iwn, always force a full scan.
Only call ieee80211_init from device specific init as this is what is
used in the ifp structure.
diffstat:
sys/dev/pci/if_iwn.c | 17 ++++-------------
sys/dev/usb/if_urtwn.c | 29 ++++++++++++-----------------
2 files changed, 16 insertions(+), 30 deletions(-)
diffs (173 lines):
diff -r f8b6c202b058 -r b4aa370b92ef sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c Fri May 22 23:22:50 2020 +1000
+++ b/sys/dev/pci/if_iwn.c Fri May 22 23:27:36 2020 +1000
@@ -885,24 +885,18 @@
/* Local setup */
vap->iv_reset = iwn_reset;
- vap->iv_ic = ic;
-
- ifp = vap->iv_ifp;// = &sc->sc_ec.ec_if;
- if_initialize(ifp);
- ifp->if_softc = vap;
-// ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+
+ ifp = vap->iv_ifp;
ifp->if_init = iwn_init;
ifp->if_ioctl = iwn_ioctl;
ifp->if_start = iwn_start;
// ifp->if_watchdog = i_watchdog; NNN
ifp->if_extflags |= IFEF_MPSAFE;
- // IFQ_SET_READY(&ifp->if_snd);
memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
/* Finish setup */
ieee80211_vap_attach(vap, iwn_media_change,
ieee80211_media_status, macaddr);
- ic->ic_opmode = opmode;
/* Override state transition machine. */
/* NNN --- many possible newstate machines ... issue! */
@@ -2129,7 +2123,6 @@
(IFF_UP | IFF_RUNNING)) {
iwn_stop(ifp, 0);
error = iwn_init(ifp);
- ieee80211_init(ifp);
}
return 0;
}
@@ -3707,7 +3700,6 @@
if (ifp->if_flags & IFF_UP) {
if (!(ifp->if_flags & IFF_RUNNING)) {
error = iwn_init(ifp);
- ieee80211_init(ifp);
}
} else {
if (ifp->if_flags & IFF_RUNNING)
@@ -3730,9 +3722,8 @@
if (error == ENETRESET)
error = 0;
+ break;
#endif
- break;
-
default:
error = ieee80211_ioctl(ifp, cmd, data);
}
@@ -3743,7 +3734,6 @@
(IFF_UP | IFF_RUNNING)) {
// iwn_stop(ifp, 0);
iwn_init(ifp);
- ieee80211_init(ifp);
}
error = 0;
}
@@ -6869,6 +6859,7 @@
sc->sc_flags |= IWN_FLAG_HW_INITED;
out:
mutex_exit(&sc->sc_mtx);
+ ieee80211_init(ifp);
return 0;
fail: mutex_exit(&sc->sc_mtx);
diff -r f8b6c202b058 -r b4aa370b92ef sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Fri May 22 23:22:50 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c Fri May 22 23:27:36 2020 +1000
@@ -1668,7 +1668,6 @@
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
(IFF_UP | IFF_RUNNING)) {
urtwn_init(ifp);
- ieee80211_init(ifp);
}
return 0;
}
@@ -3492,38 +3491,29 @@
/* Local setup */
vap->iv_reset = urtwn_reset;
- vap->iv_ic = ic;
ifp = vap->iv_ifp;
- if_initialize(ifp);
- ifp->if_softc = vap;
ifp->if_init = urtwn_init;
ifp->if_ioctl = urtwn_ioctl;
ifp->if_start = urtwn_start;
// ifp->if_watchdog = urtwn_watchdog; NNN
ifp->if_extflags |= IFEF_MPSAFE;
- // IFQ_SET_READY(&ifp->if_snd);
memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
- //ifp->if_percpuq = if_percpuq_create(ifp);
-
- /* Finish setup */
- ieee80211_vap_attach(vap, urtwn_media_change,
- ieee80211_media_status, macaddr);
- ic->ic_opmode = opmode;
-
/* Override state transition machine. */
/* NNN --- many possible newstate machines ... issue! */
sc->sc_newstate = vap->iv_newstate;
vap->iv_newstate = urtwn_newstate;
+ /* Finish setup */
+ ieee80211_vap_attach(vap, urtwn_media_change,
+ ieee80211_media_status, macaddr);
+
/* Attach the packet filter */
bpf_attach2(vap->iv_ifp, DLT_IEEE802_11_RADIO,
sizeof(struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN,
&sc->sc_drvbpf);
- ieee80211_init(ifp);
-
return vap;
}
@@ -3563,6 +3553,9 @@
DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__));
+ IEEE80211_LOCK(ic);
+ ic->ic_flags |= IEEE80211_F_SCAN;
+ IEEE80211_UNLOCK(ic);
/*
* Not sure what to do here yet. Try #1: do what was in the
* state machine. NNN
@@ -3626,6 +3619,10 @@
DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__));
+ IEEE80211_LOCK(ic);
+ ic->ic_flags &= ~IEEE80211_F_SCAN;
+ IEEE80211_UNLOCK(ic);
+
#ifdef NOTWITHSTATEMACHINEOVERRIDE
/*
* End of scanning
@@ -3782,7 +3779,6 @@
break;
case IFF_UP:
urtwn_init(ifp);
- ieee80211_init(ifp);
break;
case IFF_RUNNING:
urtwn_stop(ifp, 1);
@@ -3825,7 +3821,6 @@
(IFF_UP | IFF_RUNNING) /* && NNN need a vap for next line
ic->ic_roaming != IEEE80211_ROAMING_MANUAL*/) {
urtwn_init(ifp);
- ieee80211_init(ifp);
}
error = 0;
}
@@ -5756,7 +5751,7 @@
ifmedia_set(&vap->iv_media, imr.ifm_active);
/* Init the rest of the 802.11 stuff */
- //ieee80211_init(ifp);
+ ieee80211_init(ifp);
return 0;
Home |
Main Index |
Thread Index |
Old Index