Commit Graph

12 Commits

Author SHA1 Message Date
thorpej
7a9a30c5e7 Define and implement a locking protocol for the ifmedia / mii layers:
- MP-safe drivers provide a mutex to ifmedia that is used to serialize
  access to media-related structures / hardware regsiters.  Converted
  drivers use the new ifmedia_init_with_lock() function for this.  The
  new name is provided to ease the transition.
- Un-converted drivers continue to call ifmedia_init(), which will supply
  a compatibility lock to be used instead.  Several media-related entry
  points must be aware of this compatibility lock, and are able to acquire
  it recursively a limited number of times, if needed.  This is a SPIN
  mutex with priority IPL_NET.
- This same lock is used to serialize access to PHY registers and other
  MII-related data structures.

The PHY drivers are modified to acquire and release the lock, as needed,
and assert the lock is held as a diagnostic aid.

The "usbnet" framework has had an overhaul of its internal locking
protocols to fit in with the media / mii changes, and the drivers adapted.

USB wifi drivers have been changed to provide their own adaptive mutex
to the ifmedia later via a new ieee80211_media_init_with_lock() function.
This is required because the USB drivers need an adaptive mutex.

Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv.

mcx also now calls ifmedia_init_with_lock() because it needs to also use
an adaptive mutex.  The mcx driver still needs to be fully converted to
NET_MPSAFE.
2020-03-15 23:04:50 +00:00
skrll
c6828b08e2 Use modern interfaces and kill tsleep/wakeup. From nick-nhusb branch. 2020-01-15 08:20:13 +00:00
mrg
49e1839354 remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned.  codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.
2019-10-05 23:27:20 +00:00
msaitoh
70b25bc928 if_flags is neither int nor short. It's unsigned short. 2019-09-13 07:55:05 +00:00
skrll
4e8e66439e Merge nick-nhusb
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
    - kern/48308
    - uhub status notification improvements
    - umass(4) probe fix (applied to HEAD already)
    - ohci(4) short transfer fix
2016-04-23 10:15:27 +00:00
christos
35e9d85235 Use the EDCA and QOS stuff from net80211 instead of a home grown copy.
(now that more than one driver needs it, duplicating would be gross)
2013-03-30 01:10:00 +00:00
christos
83d6b56506 1) Use ic_curchan consistently
2) Ignore frames shorter than sizeof(struct ieee80211_frame).
3) Remove useless/dead code accidentally committed.
2013-01-29 13:54:26 +00:00
christos
f2c1b6f8ac remove trailing line 2013-01-21 16:48:23 +00:00
christos
69a30ad192 Locking fixes and more for otus. 2013-01-20 21:50:41 +00:00
christos
eadcae412c remove duplicated QoS definitions 2012-08-20 07:32:49 +00:00
christos
e728756ae9 add missing rcsid and multiple include protection. 2012-08-19 07:55:54 +00:00
christos
958efcff99 From Anon Ymous:
Port of the otus driver from OpenBSD.  This driver supports USB 2.0
wireless network devices based on Atheros Communications AR9001U
chipset.  It claims to support several AR9001U based adapters, but has
only been tested with a NetGear WNDA3100 adapter (0x0846/0x9010).

XXX: The EDCA support is currently missing from our network stack
(hopefully coming soon), but the driver hooks for it are there.
2010-11-03 20:03:02 +00:00