Commit Graph

149 Commits

Author SHA1 Message Date
Adrian Chadd
4030a4b2a3 Cap the number of streams supported to two for now.
I haven't yet reviewed the Intel driver(s) in more depth to see if
there are 1x1 NICs that report they support 2 transmit/receive chains..
if so then we'll have to update this.

Tested:

* Intel 4965, which is a 2x2 device with 3 RX and 2 TX chains.

PR:		kern/181132
2013-08-08 05:52:41 +00:00
Hiren Panchasara
c29173eb94 Fixing a typo.
Approved by:	sbruno (mentor, implicit)
2013-08-04 19:54:47 +00:00
Adrian Chadd
f86392791f Add in some definitions required for later iwn(4) device support.
This also clarifies a few existing fields.

Tested:

* Intel 5100

Submitted by:	Cedric GROSS <cg@gross.info>
2013-08-02 21:28:36 +00:00
Adrian Chadd
a5582fae07 Break out the iwn(4) device IDs into if_iwn_devid.h, as well as add
IDs for new devices.

* Add new device IDs
* Extend the ID probe code to include the newer range of bits used
  by later model devices

Tested:

* Intel 5100, STA mode

TODO:

* Test on Intel 4965, just to be sure

Submitted by:	Cedric GROSS <cg@gross.info>
2013-08-02 21:23:28 +00:00
Adrian Chadd
21f8dc458a Now that conf/options knows about if_iwn.h, add it to if_iwn.c.
This allows for IWN_DEBUG (and maybe more stuff later) to be a build
time configure option.
2013-08-01 21:50:50 +00:00
Adrian Chadd
38b1a25dfd iwn(4) debugging improvements.
* Add in some new register debugging under IWN_DEBUG_REGISTER
* Make IWN_DEBUG an option now for building.  I'll chase this up
  with a commit to 'options' soon.

Submitted by:	Cedric GROSS <cg@cgross.info>
2013-08-01 21:45:30 +00:00
Adrian Chadd
af4791e31f Implement some function tracing.
Submitted by:	Cedric GROSS <cg@cgross.info>
2013-07-27 14:58:23 +00:00
Adrian Chadd
98161e5ceb Support setting up the iwn debug flags during probe/attach by
checking "hint.iwn.X.debug".

Submitted by:	Cedric GROSS <cg@cgross.info>
2013-07-24 13:31:31 +00:00
Adrian Chadd
87459bff75 Add new IDs for The Intel 2230 wireless NIC.
Submitted by:	Cedric GROSS <cg@cgross.info>
2013-07-24 13:20:45 +00:00
Adrian Chadd
f8bf74f232 Implement basic 802.11n awareness in the PHY and AMRR rate control code.
* Add 802.11n 2ghz and 5ghz tables, including legacy rates and up to
  MCS23 rates (3x3.)

* Populate the rate code -> rate index lookup table with MCS _and_
  normal rates, but _not_ the basic rate flag.  Since the basic rate flag
  is the same as the MCS flag, we can only use one.

* Introduce some accessor inlines that do PLCP and rate table lookup/access
  and enforce that it doesn't set the basic rate bit.  They're not
  designed for MCS rates, so it will panic.

* Start converting drivers that use the rate table stuff to use the
  accessor inlines and strip the basic flag.

* Teach AMRR about basic 11n - it's still as crap for MCS as it is
  being used by iwn, so it's not a step _backwardS_.

* Convert iwn over to accept 11n MCS rates rather than 'translate' legacy
  to MCS rates.  It doesn't use a lookup table any longer; instead it's a
  function which takes the current node (for HT parameters) and the
  rate code, and returns the hardware PLCP code to use.

Tested:

* ath - it's a no-op, and it works that way
* iwn - both 11n and non-11n
2013-07-04 21:16:49 +00:00
Adrian Chadd
2fc5db16ed Enable the station-side power management flag.
It's not enabled by default in net80211 so this is a no-op unless
if you enable it (ifconfig wlan0 powersave).

Tested:

* iwn0: <Intel WiFi Link 5100> mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3

TODO:

* .. test on all the other NICs
* See if I have to disable it during scan and such
* Make it configurable live, rather than only after it's done its initial
  receive calibration.
2013-07-04 19:45:34 +00:00
Hiren Panchasara
50c5badfaa Fixing incorrect id for Intel Centrino Wireless-N 130.
PR:             kern/180094
Submitted by:   Cedric <cg@cgross.info>
Approved by:    sbruno (mentor)
MFC after:      3 weeks
2013-06-30 01:05:24 +00:00
Gleb Smirnoff
c6499eccad Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
2012-12-04 09:32:43 +00:00
Adrian Chadd
6ef131b446 Include opt_wlan.h so the net80211 RX debug API compiles correctly. 2012-11-30 03:14:11 +00:00
Bernhard Schmidt
b29bf00c95 fix a panic resulting from a stray '&'
MFC after:	1 week
2012-11-27 19:09:36 +00:00
Bernhard Schmidt
7a7a0b8301 We need to defer passing the DELBA request to the firmware until the aggr
queue is empty or the firmware will go nuts.

PR:		kern/167806
Tested by:	osa@, Brandon Gooch (earlier version),
		    Bojan Petrovic (earlier version)
MFC after:	3 days
2012-06-27 16:07:01 +00:00
Bernhard Schmidt
547ea37a96 Fix a TX aggregation issue, if after the last compressed BA notification
the TX queue is empty, there won't be a TX done notification, effectly
resulting in an mbuf leak. The correct way to handle this is to free
up mbufs on both BA and TX done notifications up to the last sent seqno.

Tested by:	osa@
MFC after:	3 days
2012-06-27 15:55:34 +00:00
Marius Strobl
f3a4392048 Remove nitems() now that it lives in <sys/param.h> since r236486. 2012-06-02 20:00:52 +00:00
Bernhard Schmidt
149daddbd1 remove unused vap variable
MFC after:	1 week
2012-05-20 10:02:24 +00:00
Bernhard Schmidt
f5546f8dd8 Discard frames after a DELBA which where queued during an active BA
session.

MFC after:	1 week
2012-05-20 10:00:36 +00:00
Bernhard Schmidt
c22cec03cd Add some more 100/130 series device IDs.
MFC after:	3 days
2012-05-20 09:29:14 +00:00
Adrian Chadd
2aa563dfeb Migrate the net80211 TX aggregation state to be from per-AC to per-TID.
TODO:

* Test mwl(4) more thoroughly!

Reviewed by:	bschmidt (for iwn)
2012-04-15 20:29:39 +00:00
Bernhard Schmidt
5ea748f578 Use the M_AMPDU_MPDU flag to determine when to manually set the seqno and
use a BA queue.
2012-04-15 18:25:17 +00:00
Bernhard Schmidt
d3287f9a2e strip (R) to match manpage and pci_vendors
MFC after:	1 week
2012-03-27 18:27:45 +00:00
Bernhard Schmidt
5465c7a0d4 Add support for 6150 series devices.
Tested by:	Shane Riddle <sh4neriddle at yahoo dot com>
MFC after:	1 week
2012-03-27 17:45:50 +00:00
Bernhard Schmidt
ada977b103 Use suspend/resume methods provided by net80211. This ensures that the
appropriate state handling takes place, not doing so results in the
device doing nothing until manual intervention.

Reviewed by:	iwasaki
Tested by:	iwasaki (iwi)
MFC after:	4 weeks
2012-03-23 19:32:30 +00:00
Bernhard Schmidt
0f7a9c77e3 On state changes from RUN to anything else the AGGR sessions are
cleared/dropped leading to qid2tap[n] being NULL as there no longer
is a tap. Now, if there have been lots of frames queued the firmware
processes and returns those after the tap is gone.

Tested by:	osa
MFC after:	1 week
2012-01-27 17:39:02 +00:00
Bernhard Schmidt
3e51210689 Don't rely on MCS7 being at index 7 while determining the amount
of antennas to use. Not all APs enable all MCS rates.

Poked by:	Lucius Windschuh <lwindschuh at googlemail dot com>
MFC after:	1 week
2012-01-03 09:42:31 +00:00
Bernhard Schmidt
fcd9500f91 Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by:	arundel@
2011-12-17 10:23:17 +00:00
Bernhard Schmidt
26ddc9835a The DC calibration result obtained during initialization can't be
passed over to the runtime firmware on 6050 devices. Instead let
the runtime firmware do the calibration itself. This fixes support
for the 6050 series devices.

Obtained from:	OpenBSD
Submitted by:	kevlo
Tested by:	lx, Tz-Huan Huang(earlier version)
2011-11-21 22:19:12 +00:00
Bernhard Schmidt
80abcbf807 Let net80211 also know about stopped BA sessions. This fixes some issues
where the driver assumed that BA resources are still available due to
net80211 saying so.

PR:		161407, 159768
Tested by:	cperciva, rene
MFC after:	3 days
2011-10-24 07:37:01 +00:00
Bernhard Schmidt
a7978bab76 Fix bmiss notifications, events should be sent when NOT scanning.
MFC after:	3 days
2011-10-13 18:17:03 +00:00
Marius Strobl
a131219c6e Recognize the Intel(R) Centrino(R) Wireless-N 130.
PR:	161162
2011-10-09 21:36:14 +00:00
Adrian Chadd
f3536faf94 Manually set the channel when using monitor mode - the firmware
doesn't select it automatically.

Submitted by:	nox
Reviewed by:	bschmidt
Approved by:	re
PR:		kern/160815
2011-09-20 04:30:23 +00:00
Bernhard Schmidt
19da774130 Make sure to drop the IEEE80211_RATE_BASIC flag even for MCS rates.
Reported by:	Maciej Milewski <milu at dat dot pl>
Tested by:	Maciej Milewski <milu at dat dot pl>
2011-06-10 17:06:25 +00:00
Bernhard Schmidt
de9358edc6 Enable HT40 (40MHz channel width) support. 2011-06-04 15:22:01 +00:00
Bernhard Schmidt
98b4acc4c3 Only consider QoS frames for TX packet aggregation. 2011-06-04 11:56:20 +00:00
Bernhard Schmidt
bf6998c568 The firmware of 4965 series adapters seems to die while trying to send
probe requests at 1Mbps while being associated on a 5GHz channel. Sending
those at 6Mbps does work, so use that instead during a background scan.
This workaround allows us to re-enable background scan support for the
4965 adapters.

Also, just enabling one antenna on 5GHz results in better reception of
beacons:
test            00:26:5a:c6:14:1a   40   54M -71:-95  200 E    WME HTCAP ATH
vs
test            00:26:5a:c6:14:1a   40   54M -92:-95  200 E    WME HTCAP ATH
Due to roam:rssi thresholds set to 7 by default it might have been
impossible to associate to that network. While here use
IEEE80211_IS_CHAN_5GHZ() to determine the band.
2011-06-04 11:43:09 +00:00
Bernhard Schmidt
129145a426 Add module version to iwi/ipw/wpi and iwn.
The version is used to check if a module is already preset, not setting
it results in:

can't re-use a leaf (ipw)!
module_register: module pci/ipw already exists!
Module pci/ipw failed to register: 17

while trying to load the module due to an entry in loader.conf. With this
commit we get the expected:

module ipw already present!

Reported by:	Dru Lavigne, bz
Tested by:	bz
MFC after:	1 week
2011-05-31 19:08:25 +00:00
Bernhard Schmidt
4f6760821e Only update the scheduler's byte count table for aggregation queues.
The other queues, especially the command queue, uses the FIFO mode
which doesn't require the byte count table because queued entries are
processed in order.

Pointed out by:	Lucius Windschuh <lwindschuh at googlemail dot com>
2011-05-15 08:09:36 +00:00
Bernhard Schmidt
7d3ddebe0a Enable 11n (sans HT40) support. 2011-05-08 12:23:01 +00:00
Bernhard Schmidt
b5d2f6bf26 Notify firmware about various HT parameters once associated. 2011-05-08 12:11:20 +00:00
Bernhard Schmidt
97fadf57df Add support for TX packet aggregation. 2011-05-08 12:06:12 +00:00
Bernhard Schmidt
b2ad04c708 Add support for RX packet aggregation. 2011-05-08 11:58:23 +00:00
Bernhard Schmidt
fa818eae51 Add support for transmitting frames at MCS rates. 2011-05-08 11:54:38 +00:00
Bernhard Schmidt
1647639a26 Prepare for transmitting frames at MCS rates:
- instead of calling iwn_plcp_signal() for every frame, map the expected
  value directly within wn->ridx
- concat plcp, rflags and xrflags, there is no clean byte boundary within
  the flags, for example the antenna setting uses bit 6, 7 and 8
- there is still need for a custom rate to plcp mapping, as those expected
  by the hardware are not conform to the std
2011-05-08 11:49:50 +00:00
Bernhard Schmidt
e9823bf8c9 Read chainmask information before announcing it. 2011-05-08 11:05:03 +00:00
Bernhard Schmidt
d86e3b2227 Add HT capabilities to probe requests. 2011-05-08 11:03:16 +00:00
Bernhard Schmidt
c9ce626212 Disable background scan support for 4965 adapters.
On legacy channels every once in a while the firmware throws a SYSASSERT
on line 208. On HT channels though this does always happen and I'm not
aware of any workaround currently.
2011-05-08 11:01:53 +00:00
Bernhard Schmidt
b648a23887 RX aggregation is slightly different then the legacy path, we will only
receive one RX_PHY for each aggregate and not one RX_PHY per frame.
2011-05-08 10:57:44 +00:00