MFC r350630, r350657: static analysis fixes from Haikur350630:oce(4): potential out of bounds access before vector validationr350657:ral: rt2860: fix wcid2ni access/size issueRT2860_WCID_MAX
MFC r350630, r350657: static analysis fixes from Haikur350630:oce(4): potential out of bounds access before vector validationr350657:ral: rt2860: fix wcid2ni access/size issueRT2860_WCID_MAX is supposed to describe the max STA index for wcid2ni, andwas instead being used as the size -- off-by-one.rt2860_drain_stats_fifo was range-checking wcid only after accessingout-of-bounds potentially.
show more ...
MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that pad
MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that padding will be alwaysminimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -padding was just missing. * Add __aligned(8) attribute for all Rx radiotap headers since they cancontain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, sojust drop the attribute here. Refresh ieee80211_radiotap(9) man pageaccordingly.- Since net80211 automatically updates channel frequency / flags inieee80211_radiotap_chan_change() drop duplicate setup for these fieldsin drivers.
MFC r343474:Remove 2GHz channel list copies from wireless drivers.Wrap ieee80211_add_channel_list_2ghz into another functionwhich supplies default (1-14) channel list to it and dropits copies fr
MFC r343474:Remove 2GHz channel list copies from wireless drivers.Wrap ieee80211_add_channel_list_2ghz into another functionwhich supplies default (1-14) channel list to it and dropits copies from drivers.
Remove bogus spaces.Spaces aren't allowed in these strings.Approved by: re@ (glen)
Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existingpci device tables, and has no probe / attach code changes.Rev
Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existingpci device tables, and has no probe / attach code changes.Reviewed by: imp, chuckSubmitted by: Lakhan Shiva Kamireddy <[email protected]>Sponsored by: Google, Inc. (GSoC 2018)Approved by: re (glen)
net80211: wrap protection frame allocation into ieee80211_alloc_prot()Move copy-pasted code for RTS/CTS frame allocation into net80211.While here, add stat / debug message for allocation failures
net80211: wrap protection frame allocation into ieee80211_alloc_prot()Move copy-pasted code for RTS/CTS frame allocation into net80211.While here, add stat / debug message for allocation failures(copied from run(4)) + return error here in bwn(4).Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D14628
Revert r327828, r327949, r327953, r328016-r328026, r328041:Uses of mallocarray(9).The use of mallocarray(9) has rocketed the required swap to build FreeBSD.This is likely caused by the allocation
Revert r327828, r327949, r327953, r328016-r328026, r328041:Uses of mallocarray(9).The use of mallocarray(9) has rocketed the required swap to build FreeBSD.This is likely caused by the allocation size attributes which put extra pressureon the compiler.Given that most of these checks are superfluous we have to choose betterwhere to use mallocarray(9). We still have more uses of mallocarray(9) buthopefully this is enough to bring swap usage to a reasonable level.Reported by: woschPR: 225197
dev: make some use of mallocarray(9).Focus on code where we are doing multiplications within malloc(9). None ofthese is likely to overflow, however the change is still useful as somestatic checke
dev: make some use of mallocarray(9).Focus on code where we are doing multiplications within malloc(9). None ofthese is likely to overflow, however the change is still useful as somestatic checkers can benefit from the allocation attributes we use formallocarray.This initial sweep only covers malloc(9) calls with M_NOWAIT. No goodreason but I started doing the changes before r327796 and at that time itwas convenient to make sure the sorrounding code could handle NULL values.
[net80211] convert all of the WME use over to a temporary copy of WME info.This removes the direct WME info access in the ieee80211com struct and insteadprovides a method of fetching the data. Ri
[net80211] convert all of the WME use over to a temporary copy of WME info.This removes the direct WME info access in the ieee80211com struct and insteadprovides a method of fetching the data. Right now it's a no-op but eventuallyit'll turn into a per-VAP method for drivers that support it (eg iwn, iwm,upcoming ath10k work) as things like p2p support require this kind of behaviour.Tested:* ath(4), STA and AP modeTODO:* yes, this is slightly stack size-y, but it is an important first step to get drivers migrated over to a sensible WME API. A lot of per-phy things need to be converted to per-VAP before P2P, 11ac firmware, etc stuff shows up.
net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersdirectly from the node.- Use ni_txparms directly instead of calculating them manually every time- Move M_EAPOL flag check up
net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersdirectly from the node.- Use ni_txparms directly instead of calculating them manually every time- Move M_EAPOL flag check upper; otherwise it may be skipped due to'ucastrate' / 'mcastrate' check- Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter)- Add few more M_EAPOL checks where it was missing (zyd(4), ural(4),urtw(4))- Few unrelated cleanupsTested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode.Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D9811
iwi, ral, zyd: fix possible use-after-free.MFC after: 5 days
net80211: ieee80211_ratectl*: switch to reusable KPIReplace various void * / int argument combinations with common structures:- ieee80211_ratectl_tx_status for *_tx_complete();- ieee80211_ratectl
net80211: ieee80211_ratectl*: switch to reusable KPIReplace various void * / int argument combinations with common structures:- ieee80211_ratectl_tx_status for *_tx_complete();- ieee80211_ratectl_tx_stats for *_tx_update();While here, improve amrr_tx_update() for a bit:1. In case, if receiver is not known (typical for Ralink USB drivers),refresh Tx rate for all nodes on the interface.2. There was a misuse:- otus(4) sends non-decreasing counters (as originally intended);- but ural(4), rum(4) and run(4) are using 'read & clear' registersto obtain statistics for some period of time (and those 'last period'values are used as arguments for tx_update()). If arguments are not bigenough, they are just discarded after the next call.Fix: move counting into *_tx_update()(now otus(4) will zero out all node counters after every tx_update() call)Tested with:- Intel 3945BG (wpi(4)), STA mode.- WUSB54GC (rum(4)), STA / HOSTAP mode.- RTL8188EU (urtwn(4)), STA mode.Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D8037
ral (rt2860): eliminate duplicate ieee80211_process_callback() call(left after r287197)MFC after: 1 week
- Replace the magic numbers with something more readable.- Reset DMA indexes after disabling DMA.
ral: add missing ic_getradiocaps() assignment.
ral: switch to ieee80211_add_channel_list_*()- Use device's channel list instead of default one (fromieee80211_init_channels()).- Add ic_getradiocaps() method.Added channels:- 2GHz (all): 12,
ral: switch to ieee80211_add_channel_list_*()- Use device's channel list instead of default one (fromieee80211_init_channels()).- Add ic_getradiocaps() method.Added channels:- 2GHz (all): 12, 13, 14.- 5GHz: * rt2661: 165 * rt2860: 38, 46, 54, 62, 102, 110, 118, 126, 134, 151, 159, 165, 167,169, 171, 173.Differential Revision: https://reviews.freebsd.org/D6182
Align radiotap structures in ral(4)Currently all radiotap structures in ral(4) are packed, but are notaligned, which causes ral based devices to crash when one does'ifconfig wlan0 up' for a wlan
Align radiotap structures in ral(4)Currently all radiotap structures in ral(4) are packed, but are notaligned, which causes ral based devices to crash when one does'ifconfig wlan0 up' for a wlan interface with a ral wlandev on archesthat care about structure alignment (e.g., MIPS).Adding an aligned attribute helps fix this problem and ral devicescan be properly brought up.Reviewed by: adrianSponsored by: Smartcom - Bulgaria AD
The EEPROM is lying about antennas. Don't hardcode things based on the chipversion which is not what the vendor driver happens to do.
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
net80211 + drivers: hide size of 'bands' array behind a macro.Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.No functional changes.
sys/dev: extend use of the howmany() macro when available.We have a howmany() macro in the <sys/param.h> header that isconvenient to re-use as it makes things easier to read.
Cleanup unnecessary semicolons from the kernel.Found with devel/coccinelle.
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with: * RTL8188EU, STA mode. * RTL8188CUS, STA mode. * WUSB54GC, HOSTAP mode.Approved by: adrian (mentor)MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D4818
net80211: remove hardcoded slot time durations from drivers- Add IEEE80211_GET_SLOTTIME(ic) macro.- Use predefined macroses to set slot time.Approved by: adrian (mentor)Differential Revision: h
net80211: remove hardcoded slot time durations from drivers- Add IEEE80211_GET_SLOTTIME(ic) macro.- Use predefined macroses to set slot time.Approved by: adrian (mentor)Differential Revision: https://reviews.freebsd.org/D4044
Remove the static function declaration.
12345