aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iwn/if_iwn.c
Commit message (Collapse)AuthorAgeFilesLines
* sys: convert ni->ni_txrate references use to the new net80211 APIAdrian Chadd2025-02-261-1/+1
| | | | | | | | | | | This just mechanically converts things. * For linuxkpi, it was just used for display. * For uath, it was just used for display, as firmware doesn't report it up. Differential Revision: https://reviews.freebsd.org/D48602 Reviewed by: bz, thj
* iwn: use ieee80211_ht_check_tx_ht()Adrian Chadd2024-12-031-2/+2
| | | | | | | | | ieee80211_ht_check_tx_ht() now implements the "is this a HT node with actual HT rates I can transmit to." Differential Revision: https://reviews.freebsd.org/D47755 Reviewed by: bz
* iwn: use ieee80211_ht_check_tx_shortgi_20() and ↵Adrian Chadd2024-12-031-10/+5
| | | | | | | | | | | | | ieee80211_ht_check_tx_shortgi_40() Use the new net80211 routines to check the node width and the local / node flags. This should be "more" correct than the previous code. Differential Revision: https://reviews.freebsd.org/D47750 Reviewed by: bz
* net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macrosAdrian Chadd2024-11-171-3/+1
| | | | | | | | | | | | | * Add macros for the management and control frame type checks that I've come across in the drivers. * Delete some now old code (eg ath's ieee80211_is_action()) as there's now a macro for it. Local testing: * not yet, I have a lot of wifi devices to find and test against Differential Revision: https://reviews.freebsd.org/D47500
* iwn(4): correct debug message: "not" to "no"Bjoern A. Zeeb2024-06-051-1/+1
| | | | | Sponosred by: The FreeBSD Foundation MFC after: 3 days
* Revert "Widen EPOCH(9) usage in PCI WLAN drivers."Bjoern A. Zeeb2023-12-011-3/+0
| | | | | | | | | This reverts commit b65f813c1ab99448278961c5ca80dc422b1eae29. As a side effect this also seems to fix wtap which seems to have lost the epoch over the input path in between. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Mechanically convert iwi(4) and iwn(4) to IfAPIJustin Hibbits2023-02-061-3/+3
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37849
* iwn(4): Correct a typo in a kernel error messageGordon Bergling2022-09-041-1/+1
| | | | | | - s/settting/setting/ MFC after: 5 days
* iwi/iwm/iwn: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-2/+1
|
* iwn: Remove write-only extra variable.John Baldwin2022-04-061-2/+5
| | | | | | | extra is used in a commented-out expression to compute scan_service_time. Use #if 0 instead of a comment for the disabled scan_service_time expression and move the unused computation of extra under the same #if.
* iwn: adjust EEPROM read timeout for Intel 4965AGN M2Radosław Chmielarz2021-06-061-2/+2
| | | | | | | | | Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic on system startup. PR: 255465 Reviewed by: markj MFC after: 1 week
* [iwn] Flip over to use VAP flags rather than ic flags for thingsAdrian Chadd2021-03-261-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net80211 changed a while back to support per-VAP config for things rather than it being global. This is to support firmware NICs that support per-VAP flags and configuration where the firmware will figure out how to combine them. However, it introduced a fun timing issue - those changes used to happen to the shared ic state before newstate() was called, but now they're also tasks and they can happen /after/. This isn't a problem for ath(4), but it exposed some interesting timing and config bugs here. Notably, I saw short slot NOT being configured in 5GHz mode during some associations, so 5GHz stuff would hang or behave poorly. Other times the follow-up auth has the right config, so it didn't hang. So for now, just flip this over to using the per-VAP flags which are correct when newstate() is called. net80211 should also have those flags synch'ed to the global ic state before newstate() runs and that can come in a subsequent commit. Whilst here also fix plcp to be consistently logged as a hex value. Tested: * iwn(4) Intel 6205, STA mode, both 2GHz and 5GHz Differential Revision: https://reviews.freebsd.org/D29379 Reviewed by: bz
* Provide MS() and SM() macros for 80211 and wireless drivers.Bjoern A. Zeeb2020-09-241-4/+2
| | | | | | | | | | | | | | | | | | | We have (two versions) of MS() and SM() macros which we use throughout the wireless code. Change all but three places (ath_hal, rtwn, and rsu) to the newly provided _IEEE80211_MASKSHIFT() and _IEEE80211_SHIFTMASK() macros. Also change one internal case using both _S and _M instead of just _S away from _M (one of the reasons rtwn and rsu were not changed). This was done semi-mechanically. No functional changes intended. Requested by: gnn (D26091) Reviewed by: adrian (pre line wrap) MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26539 Notes: svn path=/head/; revision=366112
* WiFi: fix ieee80211_media_change() callersBjoern A. Zeeb2020-09-071-13/+2
| | | | | | | | | | | | | | | | | | | | | In r178354 with the introduction of multi-bss ("vap") support factoring out started and with r193340 ieee80211_media_change() no longer returned ENETRESET but only 0 or error. As ieee80211(9) tells the ieee80211_media_change() function should not be called directly but is registered with ieee80211_vap_attach() instead. Some drivers have not been fully converted. After fixing the return checking some of these functions were simply wrappers between ieee80211_vap_attach() and ieee80211_media_change(), so remove the extra function, where possible as well. PR: 248955 Submitted by: Tong Zhang (ztong0001 gmail.com) (original) MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365419
* [iwn] Set default ampdu parameters.Adrian Chadd2020-06-051-0/+2
| | | | | | | | | | | | | | | These are from the linux iwlwifi driver ;the default use smaller maximum AMPDUs (8k) and a much smaller density (none.) The latter could cause stability issues. Tested: * Tested on Intel 6300, STA mode. Differential Revision: https://reviews.freebsd.org/D25113 Notes: svn path=/head/; revision=361820
* Widen EPOCH(9) usage in PCI WLAN drivers.Hans Petter Selasky2020-01-301-0/+3
| | | | | | | | | | | | | | Make sure all occurrences of ieee80211_input_xxx() in sys/dev are covered by a network epoch section. Do not depend on the interrupt handler nor any taskqueues being in a network epoch section. This patch should unbreak the PCI WLAN drivers after r357004. Pointy hat: glebius@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=357291
* Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk2019-03-111-6/+0
| | | | | | | | | | | | | | | | | | | | | | | - Alignment issues: * Add missing __packed attributes + padding across all drivers; in most places there was an assumption that padding will be always minimally 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 can contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so just drop the attribute here. Refresh ieee80211_radiotap(9) man page accordingly. - Since net80211 automatically updates channel frequency / flags in ieee80211_radiotap_chan_change() drop duplicate setup for these fields in drivers. Tested with Netgear WG111 v3 (urtw(4)), STA mode. MFC after: 2 weeks Notes: svn path=/head/; revision=344990
* iwn(4): plug initialization path vs interrupt handler racesAndriy Voskoboinyk2019-02-061-0/+16
| | | | | | | | | | | | There are few places in interrupt handler where the driver lock is dropped; ensure that device is still running before processing remaining ring entries. PR: 192641 MFC after: 5 days Notes: svn path=/head/; revision=343815
* iwn(4): drop i_seq field initialization for A-MPDU frames.Andriy Voskoboinyk2019-01-221-4/+0
| | | | | | | | | | It is done by net80211 since r319460. MFC after: 24 days X-MFC-With: 343094 Notes: svn path=/head/; revision=343292
* iwn(4): drop return code from iwn_*attach functions (they cannot fail)Andriy Voskoboinyk2019-01-211-14/+8
| | | | | | | | | While here, add missing trace 'end' marker in iwn5000_attach(). MFC after: 1 week Notes: svn path=/head/; revision=343235
* iwn(4): (partially) rewrite A-MPDU Tx pathAndriy Voskoboinyk2019-01-161-210/+412
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generic Tx stats fixes: - do not try to parse "aggregation status" for single frames; send them to iwn_tx_done() instead; - try to attach mbuf / node reference pair to reported BA events; allows to fix reported status for ieee80211_tx_complete() and ifnet counters (previously all A-MPDU frames were counted as failed - see PR 210211); requires few more firmware bug workarounds; - preserve short / long retry counters for wlan_amrr(4) (disabled for now - causes significant performance degradation). - Add new IWN_DEBUG_AMPDU debug category. - Add one more check into iwn_tx_data() to prevent aggregation ring overflow. - Workaround 'seqno % 256' != 'current Tx slot' case (until D9195 is not in the tree). - Improve watchdog timer updates (previously watchdog check was omitted when at least one frame was transmitted). - Stop Tx when memory leak in currently used ring was detected (unlikely to happen). - Few other minor fixes. Was previously tested with: - Intel 6205, STA mode (Tx aggregation behaves much better now). - Intel 4965AGN, STA mode (still unstable). PR: 192641, 210211 Reviewed by: adrian, dhw MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10728 Notes: svn path=/head/; revision=343094
* Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,Warner Losh2018-09-261-1/+2
| | | | | | | | | | | | | mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existing pci device tables, and has no probe / attach code changes. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Approved by: re (glen) Notes: svn path=/head/; revision=338949
* iwn: Add the missing IWN_SDID_6035_5 subdeviceEitan Adler2018-06-301-0/+1
| | | | | | | Obtained from: Haiku (da166fc6469b98397de98a7ccc13b82a3cd3b290) Notes: svn path=/head/; revision=335812
* [net80211] convert all of the WME use over to a temporary copy of WME info.Adrian Chadd2018-01-021-2/+4
| | | | | | | | | | | | | | | | | | | | This removes the direct WME info access in the ieee80211com struct and instead provides a method of fetching the data. Right now it's a no-op but eventually it'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 mode TODO: * 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. Notes: svn path=/head/; revision=327479
* iwn: use correct mask for queue ids (0xf -> 0x1f).Andriy Voskoboinyk2017-04-021-7/+7
| | | | Notes: svn path=/head/; revision=316415
* iwn: remove unneeded cast.Andriy Voskoboinyk2017-03-281-4/+4
| | | | Notes: svn path=/head/; revision=316116
* iwn: drop duplicate synchronization requests.Andriy Voskoboinyk2017-03-281-39/+12
| | | | | | | | | | Rx descriptor / payload is already synchronized in iwn_notif_intr() (before accessing desc->type / desc->qid fields). Tested with Intel 6205, STA mode. Notes: svn path=/head/; revision=316114
* iwn: fix debug messageAndriy Voskoboinyk2017-03-261-2/+2
| | | | Notes: svn path=/head/; revision=315996
* iwn: fix error handling for one well-known corner case.Andriy Voskoboinyk2017-03-261-2/+12
| | | | Notes: svn path=/head/; revision=315992
* iwn: drop unneeded bus_dmamap_sync() calls.Andriy Voskoboinyk2017-03-261-12/+2
| | | | | | | | | | | | 1) They are using wrong tag (Tx) + map (Rx) combination. 2) Rx descriptor is already synchronized in iwn_notif_intr() 3) It's not needed for transmitted data since device does not change mbuf contents. Tested with Intel 6205 (amd64), STA mode. Notes: svn path=/head/; revision=315988
* iwn: deduplicate code in iwn_tx_data() and iwn_tx_data_raw().Andriy Voskoboinyk2017-03-261-197/+111
| | | | | | | | | | | Some code was additionally moved for (future) lock splitting. Tested with Intel 6205, STA mode. Differential Revision: https://reviews.freebsd.org/D10106 Notes: svn path=/head/; revision=315982
* iwn: omit unneeded bus_dmamap_sync() calls when compiled withoutAndriy Voskoboinyk2017-03-261-4/+4
| | | | | | | 'options IWN_DEBUG' Notes: svn path=/head/; revision=315981
* iwn: fix return code conflict in iwn_init_locked()Andriy Voskoboinyk2017-03-251-4/+6
| | | | | | | | | | | Do not try to use errno(2) codes here; instead, just return unique value (1) when radio is disabled via hardware switch and another one (-1) for any other error in initialization path. Tested with Intel 6205, STA mode. Notes: svn path=/head/; revision=315966
* iwn: do not try to update node configuration when the node does not exist.Andriy Voskoboinyk2017-03-251-1/+19
| | | | | | | | Firmware will just respond with status '0x8' (node does not exist) or will hang -> cause 'device timeout's (sometimes). Notes: svn path=/head/; revision=315958
* iwn: add promiscuous mode support.Andriy Voskoboinyk2017-03-081-22/+126
| | | | | | | Tested with Intel 6205, STA / MONITOR modes. Notes: svn path=/head/; revision=314923
* iwn: deduplicate (RXON + txpower + broadcast node) command sequence.Andriy Voskoboinyk2017-03-071-63/+52
| | | | | | | | | Was previously applied to wpi(4) as a part of r278366. Tested with Intel 6205, STA / MONITOR modes. Notes: svn path=/head/; revision=314839
* iwn: drop 'channel' parameter from iwn*_set_txpower()Andriy Voskoboinyk2017-03-041-16/+12
| | | | | | | | | | For 4965 just extract 'is_chan_5ghz' flag from the RXON structure (like it was done in r281287); for others it was never used. Tested with Intel 6205, STA mode. Notes: svn path=/head/; revision=314687
* iwn: fix data rate parsing for Rx radiotap header.Andriy Voskoboinyk2017-03-011-18/+26
| | | | | | | Tested with Intel 6205, MONITOR mode + RTL8188EU, STA mode. Notes: svn path=/head/; revision=314443
* net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersAndriy Voskoboinyk2017-02-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | directly 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 cleanups Tested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9811 Notes: svn path=/head/; revision=314315
* iwn: stop all watchdogs on device shutdown.Andriy Voskoboinyk2017-02-261-0/+1
| | | | | | | | | Tested with Intel 6205, STA mode. MFC after: 5 days Notes: svn path=/head/; revision=314287
* iwn: some initialization / RF switch state change fixes.Andriy Voskoboinyk2017-02-251-83/+65
| | | | | | | | | | | | | | | - Check return code from initialization path; otherwise, vap state may be wrong after an error. - Do not try to run iwn_stop() / iwn_init() multiple times. - Merge iwn_radio_on/off() and move RFKILL bit check into the task. - Try to handle possible RF switch state change in S3 state (PR 181694). PR: 181694 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9797 Notes: svn path=/head/; revision=314234
* [net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and ↵Adrian Chadd2017-02-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 160MHz channels. * Migrate the rx_params stuff out from ieee80211_freebsd.h where it doesn't belong - this isn't freebsd specific anymore. * Don't use a hard-coded number of chains in the ioctl header; now we can shuffle MAX_CHAINS around so it can be used in the right spot. * Extend the signal/noisefloor levels in the mimo stats struct to userland to include the signal and noisefloor levels for each 20MHz slice of a 160MHz channel. * Bump the number of EVM pilots in preparation for 4x4 and 160MHz channels. Tested: * ath(4), STA mode * iwn(4), STA mode * local ath10k port, STA mode TODO: * 11ax chips will come with 5GHz 8x8 hardware for lots of MU-MIMO - I'll re-bump it at that point. Note: * This breaks the driver and ifconfig ABI; please recompile the kernel, ifconfig and wpa_supplicant/hostapd. Notes: svn path=/head/; revision=313977
* [iwn] Several fixes for DMA part of iwn(4)Oleksandr Tymoshenko2016-12-211-3/+8
| | | | | | | | | | | | - Perform DMS sync when accessing/initializing ICT table - Fix some DMA sync operations to use matching tags Reviewed by: avos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8804 Notes: svn path=/head/; revision=310375
* [iwn] Perform BUS_DMASYNC_PREREAD when initializing RX bufferOleksandr Tymoshenko2016-12-101-1/+9
| | | | | | | | | | | | | BUS_DMASYNC_PREREAD is required when setting up RX buffer, otherwise data provided by card can be overwritten by data evicted from cache Also use proper tag when setting up RX descriptor Reviewed by: adrian, avos, ivadasz Differential Revision: https://reviews.freebsd.org/D8717 Notes: svn path=/head/; revision=309822
* net80211: ieee80211_ratectl*: switch to reusable KPIAndriy Voskoboinyk2016-10-021-32/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace 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' registers to obtain statistics for some period of time (and those 'last period' values are used as arguments for tx_update()). If arguments are not big enough, 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: adrian Differential Revision: https://reviews.freebsd.org/D8037 Notes: svn path=/head/; revision=306591
* iwn: add watchdog for scanning.Andriy Voskoboinyk2016-05-261-0/+16
| | | | | | | | | | | | Restart device if scanning was not done in time. Tested by: david@catwhisker.org PR: 209198 Differential Revision: https://reviews.freebsd.org/D6176 Notes: svn path=/head/; revision=300732
* iwn: fix comments for iwn_read_eeprom_channels().Andriy Voskoboinyk2016-05-061-2/+2
| | | | | | | It's used for all channels (20MHz and 40MHz). Notes: svn path=/head/; revision=299189
* iwn: fix device reset after watchdog timeout.Andriy Voskoboinyk2016-05-041-17/+1
| | | | | | | | Simple device reset (stop/start) is not enough here; post-init state changes must be applied too. Notes: svn path=/head/; revision=299063
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955