Commit Graph

218 Commits

Author SHA1 Message Date
Andriy Voskoboinyk
7beeab43a1 iwm: fix build without IWM_DEBUG.
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D10146
2017-03-27 07:02:27 +00:00
Adrian Chadd
6c3c52590e [iwm] Add the BSS's basic rates to iwm's LQ command, not all the rates.
Makes the firmware use appropriate Tx rates for ACKs.

Obtained from: dragonflybsd.git ab1d3efc208e797c1e09759cd506c95c0aeaa06e
2017-03-25 02:55:13 +00:00
Adrian Chadd
cd20383e4a [iwm] Enable Energy Based Scan (EBS).
This can significantly reduce scan duration thus saving time and power.
EBS failure reported by FW disables EBS for current connection. It is
re-enabled upon new connection attempt on any WLAN interface.

Obtained from:	dragonflybsd.git 89f579e9823a5c446ca172cf82bbc210d6a054a4
2017-03-25 02:49:20 +00:00
Adrian Chadd
5f00681c7d [iwm] GC unused code from if_iwm_scan.c, copyied from iwn or iwlwifi/dvm.
Obtained from:	dragonflybsd.git 10881df269b93c26e5ee6af629c36db5672e6e52
2017-03-25 02:44:25 +00:00
Adrian Chadd
8d3bbea007 [iwm] Tiny cleanup in iwm_rx_addbuf().
Obtained from:	dragonflybsd.git 3370bc5504ebb3c1b9bb960a185cd0c8052a2845
2017-03-25 02:42:52 +00:00
Adrian Chadd
a00bfbb19d [iwm] Make ucode capabilities and api flags handling more like iwlwifi.
Obtained from:	dragonflybsd.git 757eecf0e6c92745aa2eee95811e573c8300850e
2017-03-23 04:50:38 +00:00
Adrian Chadd
d045c744f1 [iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.
* All the supported firmwares have these flags set.

* This removes the following flags:
  IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT,
  IWM_UCODE_TLV_FLAGS_NEWBT_COEX,
  IWM_UCODE_TLV_FLAGS_BF_UPDATED,
  IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API,
  IWM_UCODE_TLV_FLAGS_STA_KEY_CMD,
  IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD,
  IWM_UCODE_TLV_FLAGS_SCHED_SCAN,
  IWM_UCODE_TLV_FLAGS_RX_ENERGY_API,
  IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2

* Also remove definitions and code for dealing with the v1 time-event api.

* Remove unneeded calc_rssi() function.

Obtained from:	dragonflybsd.git d078c812418d0e2c3392e99fa25fc776d07bdfad
2017-03-23 04:43:04 +00:00
Adrian Chadd
51c2814518 [iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().
* This avoids leaving the mbuf in a weird state, when dropping a packet.

Obtained from:	dragonflybsd.git 96eaecf93d9f731459a0df8efc72cfad034320bd
2017-03-23 04:34:25 +00:00
Adrian Chadd
6d218ca4c9 [iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.
Obtained from:	dragonflybsd.git b5cdd8067951dc90271ab104ef555b3b5a4d5d5a
2017-03-23 04:33:15 +00:00
Andriy Voskoboinyk
f631357540 net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parameters
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
2017-02-26 20:49:35 +00:00
Adrian Chadd
9c8efa1dfb [iwm] add if_iwm_fw.c. 2017-02-24 15:17:43 +00:00
Adrian Chadd
ad35d47138 [iwm] Add support for Firmware paging, needed for newer 8000C firmware.
* Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
  what memory ranges to use for paging.

Obtained from:	dragonflybsd.git 8a5b199964f8e7bdb00039f0b48817a01b402f18
2017-02-24 07:07:58 +00:00
Adrian Chadd
b28a6ab3bd [iwm] Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c.
Obtained from:	dragonflybsd.git 83a1185edeede081051a6c00417d4c5a8f5988eb
2017-02-22 05:11:24 +00:00
Adrian Chadd
2fd963796d [iwm] Switch 7265D and 3165 devices to 7265D firmware.
Obtained from:	dragonflybsd.git 0cb0a810cb4e04b30937cb4260e779f717a86492
2017-02-22 04:53:33 +00:00
Adrian Chadd
6c2c3bd86d [iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c
* This is more similar to how code/definitions are distributed in
  Linux's iwlwifi.

* This should make recognizing new chipset variants, and adding additional
  flags from the Linux iwlwifi code easier, without blowing up if_iwm.c

Obtained from:	dragonflybsd.git 27d11320e707d2c41424efc1983762f6799941d6
2017-02-22 04:35:53 +00:00
Adrian Chadd
10e7a12c26 [iwm] Simplify device id matching code a bit.
* Just add the struct iwm_cfg pointers to the iwm_devices array, to get
  rid of the large switch clause.

Obtained from:	dragonflybsd.git 35f0e6c86c1654323d6b19f7a077f4ab8ac85868
2017-02-22 04:28:10 +00:00
Adrian Chadd
e5beb03bc6 [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses.
Obtained from:	dragonflybsd.git 710fdd011c30a1bd9f53b87c843fb8907c4a6cfd
2017-02-22 04:27:07 +00:00
Adrian Chadd
0a68d61092 [iwm] Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91.
* The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table,
  and not sc->umac_error_event_table.

Obtained from:	dragonflybsd.git 612855b1a8c321ec9ba34f63edf913e7ecff8363
2017-02-22 02:51:30 +00:00
Adrian Chadd
dfdbaed494 [iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants
* We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory.

Obtained from:	dragonflybsd.git f414b8da30816705e32573cc58097cacac34f161
2017-02-22 02:49:57 +00:00
Adrian Chadd
dae82c37b0 [iwm] With the previous commits, this DELAY no longer seems to be needed.
Obtained from:	dragonflybsd.git 516272d3d02c821ace16a91cfdeb28540ac74ecc
2017-02-22 02:24:42 +00:00
Adrian Chadd
9df5244309 [iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.
* Use the notification wait API, like it's done in the Linux iwlwifi code,
  to wait for the IWM_MVM_ALIVE notification.

* This also should fix some firmware load interrupt issues, and errors
  in the nic lock using.

Tested:

* (adrian) Intel 7260, STA mode

Obtained from:	dragonflybsd.git a7697ea01c11fd493aec52260a02f31df680eb91
2017-02-22 02:23:14 +00:00
Adrian Chadd
e97a1048d1 [iwm] Synchronize firmware loading code with Linux iwlwifi.
* While there, rename some functions to match the names and functionality
  of the similarly named functions in Linux iwlwifi.

Obtained from:	dragonflybsd.git e98ee77a816bfd8b4912047b93dfb2c560788f24
2017-02-22 02:18:04 +00:00
Adrian Chadd
20724b17b4 [iwm] Remove 1s delay after fw loading. Can't reproduce issues on AC8260.
The 1s delay was added in the update to version 16 fw, where Family 8000
support was added.

Obtained from:	DragonflyBSD commit bb480ca679a7ea530bdca6e41082d5755e9751dc
2017-02-08 07:09:10 +00:00
Adrian Chadd
4b7f1242ad [iwm] SCAN_ABORT_UMAC response doesn't use a wide id
Obtained from:	DragonflyBSD commit cef47a9cbb0a3ce5f18369fed9403d2764884bc2
2017-02-08 07:08:13 +00:00
Adrian Chadd
00da819945 [iwm] Recognize the IWM_UCODE_TLV_FW_MEM_SEG firmware section type.
* Will be needed for loading version 22 of 7265D firmware.

Obtained from:	DragonflyBSD commit 1d244c8133cf15d00d46836bc48958188cf9f510
2017-02-08 07:05:56 +00:00
Adrian Chadd
4329ac6227 [iwm] Recognize IWM_DTS_MEASUREMENT_NOTIF_WIDE notification.
* Add the command groups enum, and the iwm_phy_ops_subcmd_ids enum
  to if_iwmreg.h definitions.

* The IWM_DTS_MEASUREMENT_NOTIF_WIDE notification will be generated by
  version 17 firmware.

Taken-From: Linux iwlwifi

Obtained from:	DragonflyBSD commit 4d8d6f9def2ffb60aaf2d88f72f069a96c0b4e3f
2017-02-08 06:57:21 +00:00
Adrian Chadd
a717dd3a7f [iwm] Very basic DTS thermal sensor support (prints temp as debug msg).
* Adds IWM_DEBUG_TEMP debug message type, for printing messages related
  to temperature sensors and thermal/TDP infos.

* The firmware regularly sends us DTS measurement notifications, so just
  print the temperature value as a debugging message.

(Adrian's addition):

* Eventually this can be used by the driver to limit transmit rate / power to
  try and do some thermal throttling.

Obtained from:	DragonflyBSD commit efb7d4eb5c3140889a8880e12fd83c7bbfd0059d
2017-02-08 06:56:28 +00:00
Adrian Chadd
d5722aae84 [iwm] Only for family 7000 power-down busmaster DMA clocks when stopping.
Taken-From: Linux iwlwifi

Obtained from:	DragonflyBSD commit 4c45994fcc77373ae2fb0901db15368c9731f641
2017-02-08 06:54:08 +00:00
Adrian Chadd
99baf303e7 [iwm] Implement apmg_wake_up_wa workaround properly for 7000 family.
* Add iwm_pcie_set_cmd_in_flight() and iwm_pcie_clear_cmd_in_flight()
  helper methods.

* Use ring->queued tracking in the command queue to set/clear the
  cmd_hold_nic_awake bit at the right points.

Taken-From: Linux iwlwifi

Obtained from:	DragonflyBSD commit ce43f57f5308b579ea21e8a5a29969114ba2247d
2017-02-08 06:53:23 +00:00
Adrian Chadd
82ba706cba [iwm] Use iwm_mvm_scan_stop_wait to properly abort scans.
* Add IWM_FLAG_SCAN_RUNNING to sc->sc_flags to track whether the firmware
  is currently running a scan, in order to decide wheter iwm_scan_end
  needs to abort a running scan.

* In iwm_scan_end, if the scan is still running, we now abort it, in order
  to keep the firmware scanning state in sync.

* Try to make things a bit simpler, by reacting on the
  IWM_SCAN_OFFLOAD_COMPLETE and IWM_SCAN_COMPLETE_UMAC notifications,
  instead of IWM_SCAN_ITERATION_COMPLETE and
  IWM_SCAN_ITERATION_COMPLETE_UMAC. This should be fine since we always
  only tell the firmware to do a single scan iteration anyway.

Obtained from:	DragonflyBSD commit 1f249c981c4e89e7cde1836a75b61cac36dc7ac5
2017-02-08 06:50:59 +00:00
Adrian Chadd
4b17c18882 [iwm] Add scan abort functions, to properly cancel a running scan.
* Uses the notification wait api to wait for the corresponding scan
  complete notification after sending the abort command.

Taken-From: Linux iwlwifi

Obtained from:	DragonflyBSD commit b484d09d54301740f036ddf02008117f563960c2
2017-02-08 06:44:50 +00:00
Adrian Chadd
760f56b7b8 [iwm] Get rid of iwm_disable_rx_dma, just use iwm_pcie_rx_stop directly.
* This also fixes one of many small nic lock handling bugs, and matches
  iwlwifi's code.

Obtained from:	DragonflyBSD git 50787d03cd0a0366c9cc4a055bb6977e5f65c85d
2017-02-08 06:43:02 +00:00
Adrian Chadd
31f7edff40 [iwm] Use notification wait API to wait for calibration to complete.
Tested:

* 7260, STA mode (2g, 5g)

Obtained from:	DragonflyBSD commit 1e0cf8ec6fcd77978f5336297ece61a415790f84
2017-02-06 05:35:11 +00:00
Adrian Chadd
6e39c65025 [iwm] Add implementation of the notification wait api from iwlwifi.
Obtained from:	Linux iwlwifi
Obtained from:	DragonflyBSD commit 94dc1dadceb57b688036211262d678bc6bbdde37
2017-02-06 05:27:07 +00:00
Adrian Chadd
42155115c3 [iwm] Change 2nd arg of iwm_phy_db_set_section() to struct iwm_rx_packet.
* This matches the function declaration in Linux's iwlwifi.

Obtained from:	DragonflyBSD commit de7995a5e0ebf2d0016a87a0142a98c75db58fb4
2017-02-06 05:09:42 +00:00
Adrian Chadd
48f3dc7b64 [iwm] Store paging_mem_size field in firmware image information struct.
Obtained from:	DragonflyBSD commit a8524cc6c440e5ce9490ba2b0507c99ff6777c6d
2017-02-06 05:08:21 +00:00
Adrian Chadd
e89710f85f [iwm] Get rid of some gratuitous constant renaming wrt. Linux iwlwifi.
* IWM_UCODE_SECT_MAX -> IWM_UCODE_SECTION_MAX

* IWM_UCODE_TYPE_* -> IWM_UCODE_* (except for IWM_UCODE_TYPE_MAX which
  stays).

Obtained from:	DragonflyBSD commit ff4d1fc3ed002c9fb362423da6c45d711b65658a
2017-02-06 05:07:15 +00:00
Adrian Chadd
2a2476b30b [iwm] Sync valid_tx_ant and valid_rx_ant mask handling with iwlwifi.
* This fixes the phy_cfg field sent in the iwm_send_phy_cfg_cmd()
  command, which wasn't taking into account the valid_rx_ant and
  valid_tx_ant masks from nvm_data before.

Tested:

* 7260, STA mode, 2G and 5G

Obtained from:	DragonflyBSD commit cbb82693c18fd71b4eb86855b82d03995f352d65
2017-02-06 05:03:41 +00:00
Adrian Chadd
8c03b09087 [iwm] Use chipset configuration structs like iwlwifi does.
* This makes it a bit easier to factor out common parts for e.g. the
  7000 chipset family.

* Add iwm7265d config, and recognize the 7265D chipset variant via the
  hardware revision.

Tested:

* 7260, STA mode (2ghz)

Obtained from:	Dragonflybsd commit cc8d6ccf5583fd45964f3bde9b057ee4f834c0e0
2017-02-06 03:29:50 +00:00
Adrian Chadd
6349bdb30d [iwm] Sync nvm parsing code with Linux iwlwifi.
* sc->sc_nvm becomes sc->nvm_data and is now a pointer instead of an
  inlined struct.

* Add sc->eeprom_size and sc->nvm_hw_section_num configuration values to
  struct iwm_softc.

* For now continue to avoid negative error return-values, and use pointer
  variables for some return values, as before.

* Continue to omit LAR (location aware regulatory) related code as well.

Tested:

* Intel 7260, STA mode (2GHz)

Obtained from:	dragonflybsd commit 39f8331b1a6f295291e08c377da12a8e7a5436c0
2017-02-06 03:06:11 +00:00
Adrian Chadd
59e6427fbf [iwm] make sure we call iwm_detach_local() only once.
Obtained from:	DragonflyBSD git ebd4ceab76a6f161362029cbfd08efaedaab0519
2017-02-06 02:20:05 +00:00
Adrian Chadd
30a0fd92c9 [iwm] Sync if_iwm_phy_db code with Linux iwlwifi.
Obtained from:	Dragonflybsd commit c1019b6bfff36c856f7b4fccbdf3bb13ac27750c
2017-02-06 02:14:34 +00:00
Adrian Chadd
a994fb3be1 [iwm] The HW Revision stepping constants should be in if_iwmreg.h.
Obtained from:	dragonflybsd 84292f0c38594c462c719c0e59da5908b93aba5f
2017-02-06 02:01:22 +00:00
Adrian Chadd
0d3a15011a [iwm] TODO for QOS support. 2017-02-06 01:57:59 +00:00
Adrian Chadd
e8bb2e7961 [iwm] free node reference if rxparams addition fails. 2017-02-06 01:57:41 +00:00
Imre Vadász
b22fe30db1 [iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi.
This fixes an error handling detail in iwm_nvm_read_chunk(), where an
error response from the firmware for an NVM read shouldn't be fatal if
the offset was non-zero.

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD git 250a1c33fca1725121fe499f9cebc90267d209f9
Differential Revision:	https://reviews.freebsd.org/D8542
2016-11-17 20:00:20 +00:00
Gavin Atkinson
bfcd23a946 iwm: If firmware load fails during init via iwm_preinit() we bail out
before calling ieee80211_ifattach() so the taskqueue hasn't been
initialized. Don't try to drain it, we'll panic.
Looks like this issue was introduced in r303326.

Reviewed by:	avos, sbruno, adrian
Differential Revision:	https://reviews.freebsd.org/D8499
2016-11-12 18:33:56 +00:00
Imre Vadász
06d706238b [iwm] Set full-offload scan flag. Fixes fw panic when already associated.
* Starting a scan from wpa_supplicant or via ifconfig while associated,
  should no longer cause firmware panics or abort early.

Tested:

* AC7260, STA mode

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D8412
2016-11-01 22:47:58 +00:00
Imre Vadász
6dc2f84316 [iwm] Get rid of SYNC_RESP_STRUCT and SYNC_RESP_PTR macros.
* SYNC_RESP_STRUCT and SYNC_RESP_PTR originate from the OpenBSD version of
  iwm, and they weren't serving any real purpose in the FreeBSD port.

* We just do a single bus_dmamap_sync for syncing the complete received frame,
  instead of explicitly bus_dmamap_sync-ing subranges of the frame like in
  the OpenBSD iwm code.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7939
2016-11-01 22:38:26 +00:00
Andriy Voskoboinyk
bdc7291ec9 net80211: convert all ieee80211_input_mimo*() consumers
to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter

Note: there is an additional check for ieee80211_get_rx_params()
return value (which does not exist in the original diff).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8207
2016-10-12 20:50:13 +00:00
Andriy Voskoboinyk
4623c73135 iwm: add missing 'Rx errors' counter incrementation. 2016-10-09 10:21:28 +00:00
Adrian Chadd
e97796e2b6 [net80211] extend the ieee80211_rx_stats struct to include more information.
There are a variety of more interesting RX statistics that we should
keep track of but we don't.  This is a starting point for adding more
information.

Specifically:

* now the RX rate information and some of the packet status is
  passed up;
* The 32 bit or 64 bit TSF is passed up;
* the PHY mode is passed up;
* the "I'm decap'ed AMSDU!" state is passed up;
* number of RX chains is bumped to 4.

This is all mostly a placeholder for getting the data into the RX status
before we pass it up to net80211 - unfortunately we don't yet enforce
that drivers provide it, nor do we pass the provided info back up the
stack so anyone can use the data.

We're going to need to use some of this data moving forward.
Notably, now that some hardware can do AMSDU decap for us (the intel iwm
driver can do it when we flip it on; the ath10k port I'm doing does
it for us) then we need to pass it up through the stack so the duplicate
RX sequence numbers and crypto/IV details don't cause the packet to
be dropped and/or counted against a replay counter.

It's also the beginning of being able to do more interesting node
accounting in net80211.  Specifically, once drivers start populating
per-packet rate information, AMPDU information, timestamps, etc,
we can start providing histograms of rate-versus-RSSI, account
for receive time spent per node and other such interesting things.

(Note: I'm also hoping to include ranging and RTT information for
future chipset support; and it's likely going to include it in
this kind of fashion.)
2016-10-08 01:12:29 +00:00
Andriy Voskoboinyk
f6930bec33 net80211: ieee80211_ratectl*: switch to reusable KPI
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
2016-10-02 20:35:55 +00:00
Adrian Chadd
6f87599bdf [iwm] fix default antenna selection a bit; fix 5GHz rate control handling.
* Don't do the antenna switching when setting up the rate table - we don't
  take into account whether it's an active antenna or not (eg shared with BT.)
  I'll look into this a bit more later.

* The default antenna is still 1, I'll look into that a bit more later.
  (So no, this doesn't fix it for Larry who needs ANT_B to be active, not
  ANT_A.)

* My changes to the rate control setup used the wrong method for finding
  a suitable rate, which led to 1M CCK frames being queued for 11a operation.
  This is .. sub-optimal.  Change the rate control lookup path to use
  the global table instead of the per-node table, which won't be setup
  until the node rate table is setup (which happens way too late in this
  game.)

Tested:

* Intel 7260, 2G and 5G operation.
2016-09-24 01:21:42 +00:00
Adrian Chadd
cf4f71f1e5 [iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames
This changes the transmit rate control code to do a few things:

* use fixed rates (mcast, ucast, mgmt) where required.
* Don't use a hard-coded 11a or 11bg rate for non-data frames -
  use what net80211 says we should use.
* use mgmtrate for EAPOL frames.

Reviewed by:	avos
Differential Revision:	https://reviews.freebsd.org/D7994
2016-09-21 20:56:10 +00:00
Imre Vadász
bff11ce594 [iwm] Improve reliability of iwm_release on disassociation a bit.
* We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc
  mgmt frame, then flush the tx queue, before actually calling
  iwm_release().

* cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by
  issuing disconnect and reconnect commandos works quite well.
  (There is still an issue when disconnecting/reconnecting too quickly)

* Reassociating or roaming via wpa_supplicant is still broken.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7943
2016-09-19 22:36:30 +00:00
Imre Vadász
e4dc86e060 [iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.
* No functional change, none of these values were ever read.

* The values removed from struct iwm_nvm_data are only used for old dvm
  devices in Linux iwlwifi, and irrelevant to iwm hence.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7945
2016-09-19 22:26:37 +00:00
Imre Vadász
0ba35431ee [iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.
Approved by:	adrian (mentor)
Obtained from:	Linux iwlwifi
Differential Revision:	https://reviews.freebsd.org/D7938
2016-09-19 22:23:46 +00:00
Imre Vadász
22359652af [iwm] Remove deprecated scan API definitions.
* This removes deprecated scan API definitions, which have been unused
  since the upgrade to version 16 firmware in change r303327.

* Part of this change matches the header-file changes in Linux git commit
  1f9403863c080478ad78247c89b018e95bdfb027.

* No functional change.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7937
2016-09-19 22:20:46 +00:00
Imre Vadász
fbb27a30bf [iwm] Remove wrappers around iwm_dma_contig_free() calls.
No functional changes.

Inspired by:	OpenBSD
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7933
2016-09-19 22:16:03 +00:00
Imre Vadász
0cd7fa558e [iwm] Fix iwm_poll_bit() error value check in iwm_attach().
The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure,
whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure.

So the (ret < 0) check ended up ignoring any error returned by
iwm_poll_bit().

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7932
2016-09-19 22:13:08 +00:00
Imre Vadász
739e99ba69 [iwm] Fix off-by-one check in iwm_read_firmware().
This fixes a potential buffer overrun in the firmware parsing code.

Reported by:	Coverity
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7931
2016-09-19 22:11:34 +00:00
Imre Vadász
ef81578c9f [iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.
The wantresp field in struct iwm_rx_data has never been used for anything,
so we can just delete it.

Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit
value to represent the enum), but it still seems like a very bad idea to use
an enum type in a __packed struct.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7930
2016-09-19 22:08:47 +00:00
Imre Vadász
b47237ce60 [iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.
The htole32 was working fine for little-endian machines, but would have
been broken on big-endian.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7929
2016-09-19 22:06:00 +00:00
Adrian Chadd
4083793433 [iwm] fix up RSSI calculations for both scan results and normal RX operations.
* hard code a noise floor of -96 for now. The noise floor update code returns
  some "interesting" values that I can't map to anything useful right now.
* Ensure a default noise floor is set - otherwise the initial scan results
  have a noise floor of '0'.
* Fix up the RSSI calculation to be correctly relative to the noise floor.
  The RSSI routines return an absolute value in dBm - so fix this up.
* Cap RSSI values appropriately.
* Ensure we pass in a 1/2 dB unit value in to net80211.

Tested:

* Intel 7260, STA mode

iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2
iwm0: hw rev 0x140, fw ver 16.242414.0, address xx:xx:xx:xx:xx:xx
2016-09-18 05:07:18 +00:00
Andriy Voskoboinyk
9afea60f98 iwm: fix scanning for hidden SSIDs.
Setup SSIDs in scan command so firmware will send direct probe request(s)
while scanning.

Tested by:	dbkirk@gmail.com

PR:		211519
MFC after:	1 week
2016-09-06 10:08:32 +00:00
Andriy Voskoboinyk
e796f68455 iwm: fix few comment typos. 2016-08-27 10:04:48 +00:00
Andriy Voskoboinyk
d845f44fb1 iwm: add 'command accepted' debug notification (copied from wpi(4)).
Now it should be easier to find out which command causes firmware
panics when few commands are sent in a short period of time.
2016-08-27 08:34:20 +00:00
Imre Vadász
a3c0e7f2fb [iwm] Fix iwm_poll_bit() usage in iwm_stop_device(), fixup r303418.
* iwm_poll_bit() returns 1 on success and 0 on failure, whereas
  iwl_poll_bit() in Linux's iwlwifi returns >= 0 on success and < 0 on
  failure.

* Because of the wrong iwm_poll_bit return code check, no warning was
  printed if tx DMA stopping failed.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7371
2016-07-30 19:03:32 +00:00
Imre Vadász
34938c3085 [iwm] When stopping TX DMA, wait for all channels at once.
* Makes the TX DMA stopping more similar to Linux code, and potentially
      a bit faster. Also, output an error message when TX DMA idling fails.

    Taken-From: Linux iwlwifi

Tested:

* AC3165, STA mode

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD git 2ee486ddff973ac552ff787c17e8d83e8ae0f24c
Differential Revision:	https://reviews.freebsd.org/D7325
2016-07-27 20:51:31 +00:00
Imre Vadász
2b8cf46a68 [iwm] Set different pm_timeout for action frames.
When building a Tx Command for management frames, we are lacking
    a check for action frames, for which we should set a different
    pm_timeout.  This cause the fw to stay awake for 100TU after each
    such frame is transmitted, resulting an excessive power consumption.

    Taken-From: Linux iwlwifi (git b084a35663c3f1f7)

Approved by:	adrian (mentor)
Obtained from:	Linux git b084a35663c3f1f7de1c45c4ae3006864c940fe7
Obtained from:	DragonFlyBSD git ba00f0e3ae873d6f0d5743e22c3ebc49c44dfdac
Differential Revision:	https://reviews.freebsd.org/D7324
2016-07-27 20:46:51 +00:00
Imre Vadász
74adf80539 [iwm] Fix inverted logic in iwm_tx().
The PROT_REQUIRE flag in should be set for data frames above a certain
    length, but we were setting it for !data frames above a certain length,
    which makes no sense at all.

    Taken-From: OpenBSD, Linux iwlwifi

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD git 8cc03924a36c572c2908e659e624f44636dc2b33
Differential Revision:	https://reviews.freebsd.org/D7323
2016-07-27 20:43:08 +00:00
Sean Bruno
6a5bc1d1ee iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.
Submitted by:	Kevin Bowling (kevin.bowling@kev009.com)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6967
2016-07-26 00:02:17 +00:00
Sean Bruno
33c7715f9b iwm(4): switch to ieee80211_runtask()
Submitted by:	Andiry Voskoboinyk (s3erios@gmail.com)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D5054
2016-07-25 23:44:44 +00:00
Adrian Chadd
1eccf20376 [iwm] Use mbuf for large firmware commands, like OpenBSD does.
We also need to consider the size of large firmware commands in iwm_alloc_tx_ring(),
in the dma tag creation, when qid == IWM_MVM_CMD_QUEUE. The old code apparently
only allocated a 2KB (MCLBYTES) sized buffer when it actually expected 4KB.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D6824
2016-06-23 01:13:30 +00:00
Adrian Chadd
8a1660e16a [iwm] Add and use iwm_phy_db_free(), to plug phy_db memory leak.
(Together with other iwm(4) memory leak fixes) Memory leakage in M_DEVBUF
is now at ca. 2KB for each iwm(4) module load/unload cycle.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Approved by:	re (gjb)
Obtained from:	DragonflyBSD git eaf551a1d464c643e98ce5781971dd32124e9af1
Differential Revision:	https://reviews.freebsd.org/D6819
2016-06-23 01:11:52 +00:00
Adrian Chadd
f6ea76fb7e [iwm] Fix iwm_dma_contig_free(). dma->map is always NULL here.
* When bus_dmamem_alloc is used, the bus_dmamap_t is usually set to NULL, so
  we were never actually freeing any dma memory allocations done via
  iwm_dma_contig_alloc(). So we should check dma->vaddr instead of dma->map here.

* Also, the dmamap is actually supposed to be invalidated as part of
  bus_dmamem_free(), so bus_dmamap_destroy() is never needed here.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Approved by:	re (gjb)
Obtained from:	DragonflyBSD git ef2b29a7ba6ca8a9d2c82ab591c0622227ff84cb
2016-06-23 01:00:13 +00:00
Adrian Chadd
bc6cd01d38 [iwm] Use vap->iv_myaddr instead of ic->ic_macaddr when vap != NULL.
ic_macaddr is only used for the initial mac address provided by NVM. We should
rather use vap->iv_myaddr when vap != NULL, to allow the MAC address
to be changed later with ifconfig(8).

Submitted by:	Imre Vadasz <imre@vdsz.com>
Reviewed by:	avos
Approved by:	re (gjb)
Obtained from:	DragonflyBSD git 4aee7a78275676d22d14c04177bd0c9377d91478
Differential Revision:	https://reviews.freebsd.org/D6743
2016-06-23 00:56:54 +00:00
Adrian Chadd
5b4dc397af [iwm] free RX ring / NVM memory after they're used.
* Free RX ring during detach
* Free NVM memory after parsing

Tested:

* 7260, STA mode

Submitted by:	Imre Vadasz <imre@vdsz.com>
Approved by:	re (gjb)
Obtained from:	dragonflybsd
Differential Revision:	https://reviews.freebsd.org/D6817
2016-06-16 17:59:15 +00:00
Adrian Chadd
5799c2bce7 [iwm] Fix up busdma use in the RX path
When allocating a new mbuf or bus_dmamap_load()-ing it fails,
we can just keep the old mbuf since we are dropping that packet anyway.
Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time,
create an extra bus_dmamap_t which we can use to safely try
bus_dmamap_load()-ing the new mbuf. On success we just swap the spare
bus_dmamap_t with the data->map of that ring entry.

Tested:

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Approved by:	re@
Obtained from:	DragonflyBSD.git cc440b26818b5dfdd9af504d71c1b0e6522b53ef
Differential Revision:	https://reviews.freebsd.org/D6742
2016-06-13 00:13:20 +00:00
Adrian Chadd
0e92cf939f [iwm] valid_{tx,rx}_ant from radio_cfg is only needed for 8000 family.
* The "if (!data->valid_tx_ant || !data->valid_rx_ant) {" check was getting
  triggered with a 3165 chipset.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD 3655dfb6fc311fc83e5ce8370dd91b4cd4a37991
2016-06-02 06:22:59 +00:00
Adrian Chadd
88b6e4f33a [iwm] Fix several nitpicks in iwm(4).
Move some declarations to if_iwmreg.h.
    Remove iwm_fw_alive(); just call iwm_post_alive() directly.
    Simplify iwm_mvm_add_sta().
    Return timeout error from iwm_apm_init().
    Print a message when init (i.e. boot) firmware fails to load.
    Remove some commented-out code which wouldn't compile anyway.
    Move iwm_mvm_tx_fifo to if_iwmreg.h to match better where Linux puts it.

    Taken-From: OpenBSD (if_iwm.c r1.80 and if_iwmreg.h r1.11)

Submitted by:	 Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD 29fcb331e5620ae145a6ab9cdda830e22fff626a
2016-06-02 05:43:16 +00:00
Adrian Chadd
3028d11c3e [iwm] Add bit-polling in Rx-DMA init code path.
Taken-From: OpenBSD (if_iwm.c r1.80)

Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD ed35558754288911048cb607e57c688273ebd8d4
2016-06-02 05:00:52 +00:00
Adrian Chadd
ebb6ea5662 [iwm] Clean up iwm(4) scanning logic a bit.
Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD 8f3ffab9136e33263d424275ec28f57ad2096437
2016-06-02 04:54:56 +00:00
Adrian Chadd
7a8b94e1d2 [iwm] Use IWM_MAX_CMD_PAYLOAD_SIZE to improve command length checks.
Taken-From: OpenBSD (parts of if_iwm.c r1.57 and if_iwmreg.h r1.10)

Obtained from:	DragonflyBSD b70c1eaad06257c5c7f4d8110d21642ebec14f42
2016-06-02 04:53:28 +00:00
Adrian Chadd
ee55925e29 [iwm] add LED blinking for iwm hardware that supports it.
Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD, Linux iwlwifi/mvm
2016-06-02 04:42:28 +00:00
Adrian Chadd
63b3f62ab3 [iwm] remove dead code.
if_iwm - GC some dead code, left by a partially applied OpenBSD change.

Taken-From: OpenBSD (if_iwm.c r1.69)

Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD git 07dfed32ea39b980b0b80d27ff938e7c3ca4c0b5
2016-05-27 07:10:11 +00:00
Andriy Voskoboinyk
b789292fd8 iwm: add 'opt_wlan.h' include into source files.
Include net80211 options file, so IEEE80211_DEBUG_REFCNT option will be
handled correctly.
2016-05-19 23:31:00 +00:00
Andriy Voskoboinyk
ace1dfdd0b iwm: restart device after watchdog timeouts. 2016-05-19 22:43:21 +00:00
Eitan Adler
cef367e6a1 Don't repeat the the word 'the'
(one manual change to fix grammar)

Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)
2016-05-17 12:52:31 +00:00
Kevin Lo
cbb62fa6aa Follow-up r298818: hide size of 'bands' array behind a macro. 2016-05-16 02:27:28 +00:00
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Andriy Voskoboinyk
d35192e513 iwm: fix parameters for iwm_add_channel_band()
It accepts <first index, max index + 1>, not
<first index, number of entries>.

Reported by:	adrian
2016-05-02 19:07:44 +00:00
Andriy Voskoboinyk
5c1f6e21a5 iwm: switch to ieee80211_add_channel()
- Switch to ieee80211_add_channel().
- Parse/set more channel flags (DFS, NOADHOC).
- Add ic_getradiocaps() method.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D6150
2016-05-01 14:27:27 +00:00
Adrian Chadd
82f860283c [iwn] fill in the TX command rate info flags consistently.
The Linux driver sets the rate_n_flags regardless of whether it's being
sent using firmware rate control or local rate control.  This includes
the antenna configuration.

Thanks to Kyle Evans <kevans91@ksu.edu> for pointing this out to me
and doing some investigation/testing on his end.

Tested:

* Intel 7260 STA, 2G and 5G networks
2016-05-01 05:01:10 +00:00
Dmitry Chagin
e27428fd1c The iwm_nic_error() defined if IWM_DEBUG is defined. 2016-04-29 19:10:22 +00:00
Conrad Meyer
2cb2bed294 iwm(4): Don't dereference potentially NULL pointer before NULL check
Introduced in r298594.  There is no path before the 'vap == NULL' check where
vap is not already dereferenced.

Reported by:	Coverity
CID:		1354979
Sponsored by:	EMC / Isilon Storage Division
2016-04-26 19:06:28 +00:00
Adrian Chadd
125b570110 [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all
This allows wifi to associate correctly after a suspend/resume cycle.

Yes, I'm using this now day to day.

Tested:

* Intel 7260AC, STA mode
2016-04-26 04:40:59 +00:00
Adrian Chadd
5a4e447647 [iwm] add extra transmit setup/completion logging so I can see what's going on.
I'm seeing 5GHz association work but data not work until the rate drops,
so I need way more information about what's being programmed into the
transmit descriptors.

Tested:

* 7260AC, STA mode
2016-04-26 03:24:28 +00:00
Adrian Chadd
cc418e44a0 [iwm] restart the VAP if there's a firmware panic.
Always print out the firmware panic info before restarting; don't
put it behind IWM_DEBUG.

Submitted by:	bapt
Differential Revision:	https://reviews.freebsd.org/D6081
2016-04-25 22:00:05 +00:00
Adrian Chadd
8d170e6ac1 [iwn] fix firmware command use in iwm_auth().
The iwm firmware has separate commands for add, modify and delete for
various things (mac, phy context, etc.)  The openbsd driver has a habit
of just completely resetting the NIC each time, which is technically
mostly okay (as long as the reset doesn't actually fail!) but it means
a lot of the code is doing ADD when it should do MODIFY.

The firmware responds in kind - it just asserts.

This fixes auth attempts that occur after the NIC has been already
configured.

(I'm sure there are more instances of this!)

Tested:

iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2
iwm0: revision: 0x140, firmware 25.228 (API ver. 9)

.. STA mode.

Submitted by:	Masachika ISHIZUKA <ish@amail.plala.or.jp>
2016-04-25 16:13:04 +00:00
Adrian Chadd
88ecff8b96 [iwm] fix up the rate control setup code to initialise rates in the order
we want to use it.

The rate table was being initialised in low->high, but the link quality
table was being initialised high->low. So, when we did a lookup, we
would get the indexes wrong.

This started by a patch from dragonflybsd which reversed how the ni->in_ridx[]
array is being used; I'd rather it all be consistent.  So, this is consistent.

Inspired by: what I did to iwn(4) a while ago
Inspired by: DragonflyBSD; <imre@vdsz.com>
2016-01-18 05:43:34 +00:00
Andriy Voskoboinyk
430384523d iwm: revert r293178
This optimization is not proper (and causes kernel panic),
since driver checks fw_status to optimize away parsing stage
if it was already done.

Reported by:	dchagin
2016-01-05 20:09:26 +00:00
Andriy Voskoboinyk
e8d24c2011 iwm: free firmware related resources after uploading it to the hardware
iwn(4) / wpi(4) works in the same way
(read_firmware() -> hw_init() -> firmware_put())

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4766
2016-01-04 21:07:08 +00:00
Andriy Voskoboinyk
1b3ae3ba63 iwm: store pointer for 'struct firmware' instead of
'size_t' and 'void *' pair.

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD
Differential Revision:	https://reviews.freebsd.org/D4765
2016-01-04 21:03:01 +00:00
Andriy Voskoboinyk
dd693ac6da iwm: use m_collapse() to defragment a mbuf chain
- Simplify defragmentation code.
- Use proper number of dma segments for data.

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4754
2016-01-03 21:32:47 +00:00
Andriy Voskoboinyk
92d95dfd76 iwm: convert to ieee80211_tx_complete()
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4755
2016-01-03 10:10:11 +00:00
Andriy Voskoboinyk
612d1816a8 iwm: reorganize if_iwmvar.h
- Change order of data in if_iwmvar.h
(like it is in other drivers: defines, data structures,
vap/node structures, softc struct and locks); use indentation.
- Fix IWM_LOCK(_sc) / IWM_UNLOCK(_sc) macro.
- Add IWM_LOCK_INIT / DESTROY(sc) + fix mtx_init() usage.
- Wrap iwm_node casts into IWM_NODE() macro.
- Drop some fields:
 * wt_hwqueue from Tx radiotap header;
 * macaddr[6] from iwm_vap;

Approved by:	adrian
Differential Revision:	https://reviews.freebsd.org/D4753
2016-01-03 10:06:10 +00:00
Kevin Lo
92619f554a Fix IEEE80211_ADDR_COPY() usage.
Reviewed by:	adrian
2015-10-22 01:36:16 +00:00
Kevin Lo
b020e15ebd Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's
no valid flag there.
2015-10-21 06:23:57 +00:00
Adrian Chadd
4f4a7a03ce net80211 drivers: eliminate any references to sc_rxtap_len/sc_txtap_len (never used here)
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3776
2015-10-12 05:21:51 +00:00
Adrian Chadd
d957a93abe net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().
This doesn't free the mbuf upon error; the driver ic_raw_xmit method is still
doing that.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3774
2015-10-12 04:55:20 +00:00
Adrian Chadd
413bae20bb Ensure the ring state is also blanked upon reset, otherwise
duplicate rx events get handled during reset paths.

Submitted by:	Matthew Dillion <dillon@apollo.backplane.com>
Obtained from:	DragonflyBSD
2015-09-18 17:39:31 +00:00
Gleb Smirnoff
7a79cebfba Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by:	adrian
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-08-27 08:56:39 +00:00
Adrian Chadd
2cb71df183 Convert more ifp->if_softc -> ic->ic_softc.
These should be a big no-op.

Tested:

* make universe
2015-08-17 23:44:38 +00:00
Rui Paulo
49fdbf0a92 iwm: use the proper include path for iwm headers. 2015-08-08 21:08:35 +00:00
Rui Paulo
2e7b8b8b51 iwm: fix a KASSERT: s/ds_size/ds_len/. 2015-08-08 20:07:25 +00:00
Rui Paulo
d4886179cb Import OpenBSD's iwm WiFi driver for Intel 3160/7260/7265.
There are still several bugs, but I've been using it for a while now.
Thanks to all the testers and to Adrian for his help with this
driver.

This driver isn't connected to the build yet, but it will be soon.

There's no MFC planned because the driver isn't very stable yet.

Reviewed by:	adrian
Obtained from:	https://github.com/rpaulo/iwm
Tested by:	adrian, gjb, dumbbell (others that I forgot).
Relnotes:	yes
2015-08-08 06:06:48 +00:00