Commit Graph

23 Commits

Author SHA1 Message Date
Mark Johnston
e7065dd1e8 iwm(4): Remove _mvm from the namespace.
This was inherited from iwlwifi, which drives devices supported by both
iwn(4) and iwm(4) in FreeBSD.  In iwm(4) _mvm is meaningless, so remove
it.  OpenBSD made the same change a long time ago.  No functional change
intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-27 20:32:53 +00:00
Mark Johnston
666c8655f2 iwm: Implement support for scans with "adaptive" dwell time.
This is required by 9000-series firmware.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:04 +00:00
Mark Johnston
eff8a9793e iwm: Simplify fw_has_{api,capa}().
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:25 +00:00
Kyle Evans
f33c830939 iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.
* Rename some structs and struct members for firmware handling.

Submitted by:	Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from:	DragonFlyBSD (4b1006a6e4d0f61d48c67b46e1f791e30837db67)
2019-01-24 03:43:45 +00:00
Adrian Chadd
2aa3dbb059 [iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
* Limiting the channel list with "ifconfig wlan0 chanlist ..." now will
  actually set the list of channels scanned by iwm.

Tested:

* Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what
  it should!
2017-07-26 05:26:01 +00:00
Adrian Chadd
112d57f2ad [iwm] actually use the new rxon function now.
It turns out the /next/ dragonflybsd git actually uses the scan channel list,
so just kick this along to make the next commit easier.

Obtained from:	dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432
2017-07-17 21:32:35 +00:00
Adrian Chadd
fe845d8e27 [iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.
From the original commit:

==

* Actually look at the first channel in the list. If it's a 2.4GHz channel,
  set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we
  don't need to look further.

* While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check.

Taken-From: Linux iwlwifi
==

However, this only really does the latter.  The sc_ic channel list isn't the
scan channel list, it's the /whole list/ for the set of active channels,
so I don't know what the right thing to do is here.

So I'll commit this as an intermediary commit and we'll have to revisit whether
to finish the refactor as-is.

Tested:

* Intel 7260, STA mode

Obtained from:	dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432
2017-07-17 21:29:18 +00:00
Adrian Chadd
616201d1f7 [iwm] include opt_iwm.h and opt_wlan.h consistently in all files. 2017-05-09 02:38:23 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
Rui Paulo
49fdbf0a92 iwm: use the proper include path for iwm headers. 2015-08-08 21:08:35 +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