diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-07-27 23:20:45 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-07-27 23:20:45 +0000 |
commit | b463bc6c336f88c5c53b54a13c72ffd11be29e4e (patch) | |
tree | 093e047a9b2b8e29f6989662ecc21cb54dc302a4 /sys/net80211 | |
parent | 858cb94e23c67389d48ae321fdd98dc21b3655e1 (diff) | |
download | FreeBSD-src-b463bc6c336f88c5c53b54a13c72ffd11be29e4e.zip FreeBSD-src-b463bc6c336f88c5c53b54a13c72ffd11be29e4e.tar.gz |
Add a new network interface flag, IFF_NEEDSGIANT, which will allow
device drivers to declare that the ifp->if_start() method implemented
by the driver requires Giant in order to operate correctly.
Add a 'struct task' to 'struct ifnet' that can be used to execute a
deferred ifp->if_start() in the event that if_start needs to be called
in a Giant-free environment. To do this, introduce if_start(), a
wrapper function for ifp->if_start(). If the interface can run MPSAFE,
it directly dispatches into the interface start routine. If it can't
run MPSAFE, we're running with debug.mpsafenet != 0, and Giant isn't
currently held, the task is queued to execute in a swi holding Giant
via if_start_deferred().
Modify if_handoff() to use if_start() instead of direct dispatch.
Modify 802.11 to use if_start() instead of direct dispatch.
This is intended to provide increased compatibility for non-MPSAFE
network device drivers in the presence of Giant-free operation via
asynchronous dispatch. However, this commit does not mark any network
interfaces as IFF_NEEDSGIANT.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 3e144458..b08fff0 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -130,7 +130,7 @@ ieee80211_mgmt_output(struct ifnet *ifp, struct ieee80211_node *ni, IF_ENQUEUE(&ic->ic_mgtq, m); ifp->if_timer = 1; - (*ifp->if_start)(ifp); + if_start(ifp); return 0; } diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 899fded..1f4301a 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -513,7 +513,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt IEEE80211_RATE2MBS(ni->ni_rates.rs_rates[ni->ni_txrate])); } ic->ic_mgt_timer = 0; - (*ifp->if_start)(ifp); + if_start(ifp); break; } break; |