diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2004-07-27 23:20:45 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2004-07-27 23:20:45 +0000 |
commit | af5e59bf2836dfa1c938ef8a4e0164fa75de13e9 (patch) | |
tree | 093e047a9b2b8e29f6989662ecc21cb54dc302a4 /sys/net/if.h | |
parent | 1985a3a39d71ccefe7241ea2d678dcb48ef529fb (diff) | |
download | src-af5e59bf2836dfa1c938ef8a4e0164fa75de13e9.tar.gz src-af5e59bf2836dfa1c938ef8a4e0164fa75de13e9.zip |
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.
Notes
Notes:
svn path=/head/; revision=132712
Diffstat (limited to 'sys/net/if.h')
-rw-r--r-- | sys/net/if.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index 1dab8c0ea3dc..084fc9dcb3e1 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -126,6 +126,7 @@ struct if_data { #define IFF_PPROMISC 0x20000 /* user-requested promisc mode */ #define IFF_MONITOR 0x40000 /* user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* static ARP */ +#define IFF_NEEDSGIANT 0x100000 /* hold Giant over if_start calls */ /* flags set internally only: */ #define IFF_CANTCHANGE \ |