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/86f781c8c540
branches: trunk
changeset: 364821:86f781c8c540
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 a7b4a67e6b75 -r 86f781c8c540 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
@@ -958,24 +958,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! */
@@ -2202,7 +2196,6 @@
(IFF_UP | IFF_RUNNING)) {
iwn_stop(ifp, 0);
error = iwn_init(ifp);
- ieee80211_init(ifp);
}
return 0;
}
@@ -3780,7 +3773,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)
@@ -3803,9 +3795,8 @@
if (error == ENETRESET)
error = 0;
+ break;
#endif
- break;
-
default:
error = ieee80211_ioctl(ifp, cmd, data);
}
@@ -3816,7 +3807,6 @@
(IFF_UP | IFF_RUNNING)) {
// iwn_stop(ifp, 0);
iwn_init(ifp);
- ieee80211_init(ifp);
}
error = 0;
}
@@ -6942,6 +6932,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 a7b4a67e6b75 -r 86f781c8c540 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
@@ -1673,7 +1673,6 @@
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
(IFF_UP | IFF_RUNNING)) {
urtwn_init(ifp);
- ieee80211_init(ifp);
}
return 0;
}
@@ -3522,38 +3521,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;
}
@@ -3593,6 +3583,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
@@ -3656,6 +3649,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
@@ -3812,7 +3809,6 @@
break;
case IFF_UP:
urtwn_init(ifp);
- ieee80211_init(ifp);
break;
case IFF_RUNNING:
urtwn_stop(ifp, 1);
@@ -3855,7 +3851,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;
}
@@ -5786,7 +5781,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