Commit Graph

82 Commits

Author SHA1 Message Date
Adrian Chadd
615a867ff2 [ath_hal] teach the reset path(s) about Jupiter 2.1.
This was just .. not programming in things, and thus large chunks
of the radio wouldn't work.  Notably, 5GHz didn't work.
2016-06-05 02:16:16 +00:00
Adrian Chadd
507fc9d5c4 [ath_hal] convert the MCI code over to work on Jupiter 2.1.
(Note: jupiter 1.0 was emulation / test silicon, and was never released
in production.  So, yes, AR_SREV_JUPITER() would really be fine.)
2016-06-05 02:15:29 +00:00
Adrian Chadd
79d0939e3c [ath_hal] Make the AR9462 2.0 initvals from ath9k compile.
The (upcoming) semi-working AR9462 2.1 support uses the 2.0 initvals
where appropriate, and those need to at least compile under freebsd.
2016-06-05 01:42:37 +00:00
Adrian Chadd
8cfcd74fa1 [ath_hal] add STOMP_AUDIO for AR9462/QCA9565.
Obtained from:	Linux ath9k
2016-06-04 07:29:10 +00:00
Adrian Chadd
83e80fe84a [ath_hal] add azimuth timestamp payload marking for AR9380 and later chips. 2016-06-01 15:56:07 +00:00
Adrian Chadd
8e0feaeafa [ath_hal] implement shared PA handling checks, based on ath9k.
These are apparently conditional on there being a shared PA/LNA, which
at least on AR9462/QCA9535 devices I have isn't a thing.

I'm .. not yet sure which devices it /is/ a thing, so I'll come back
to that.

Tested:

* QCA9565 STA + bluetooth

Obtained from:	Linux ath9k
2016-06-01 03:49:22 +00:00
Adrian Chadd
193232716d [ath_hal] add MCI bits from ath9k for QCA9565
* Add extra debugging - the weights debugging is really useful to ensure
  things are programmed into the wlan coexistence table.  The weights are
  what traffic priority each of the various modes get (tx, tx-high-priority,
  rx-beacon, etc) if they're all zero, things work very poorly.

* Add in coex init routines from ath9k for AR9462 and QCA9565 1ANT and 2ANT.
  This control things like beacon stomping, ACK handling, antennas, PA/LNA
  shared, etc.

* Some ancillary bits.

TODO:

* There's some conditional stuff around MCI_ANT_ARCH_PA_LNA_SHARED() in ath9k
  which doesn't always enable force-on LNA.  That'll have to be examined
  and merged in as appropriate.

Obtained from:	linux ath9k
2016-06-01 03:27:33 +00:00
Adrian Chadd
3091d36445 [ath_hal] add support for QCA9565 for configuring the bluetooth antenna LNA diversity.
Notably, this also sets AR_BTCOEX_WL_LNADIV to FORCE_ON, so LNA diversity
is always enabled and under control of the wifi chip.

Tested:

* QCA9565, STA + bluetooth mode

Obtained from:	Linux ath9k
2016-06-01 03:24:53 +00:00
Adrian Chadd
b8a74db325 [ath_hal] Allow the BT antenna diversity option to be enabled for QCA9565.
Obtained from:	Linux ath9k
2016-06-01 03:21:23 +00:00
Adrian Chadd
eb800a94c3 [ath_hal] add QCA9565 bluteooth antenna control.
This configures the LNA antenna diversity control, which should be on
if wlan owns the LNA for bluetooth coexistence.  Otherwise, make sure
it's off.

I think this is eventually intended to allow 1-antenna bluetooth +
wifi setups for QCA9565, but I'm not sure where that's actually configured
in ath9k.

Obtained from:	Linux ath9k
2016-06-01 03:20:55 +00:00
Adrian Chadd
ab3b48eaa2 [ath_hal] add extra debugging for MCI interrupts. 2016-06-01 03:17:36 +00:00
Adrian Chadd
d24161cb2a [ath_hal] rename the MCI state info routine.
It's not /really/ "get state".
2016-05-31 16:08:06 +00:00
Adrian Chadd
6bf5e38106 [ath_hal] add QCA9565 and MCI related registers.
This is required for upcoming MCI fixes.

Obtained from:	Linux ath9k
2016-05-31 04:59:00 +00:00
Adrian Chadd
023efcf136 [ath_hal] migrate the bluetooth definitions out from ah.h / ar9300_freebsd_inc.h.
The eventual MCI driver side of things needs the MCI bits to live
in the HAL API so we can get to them.

Tested:

* QCA9565, STA mode + bluetooth
2016-05-31 04:44:00 +00:00
Adrian Chadd
fea8a20d19 [ath] ensure the right methods / options get overridden for MCI bluetooth coex
It turns out that the srev checks can't be done in the early attach
in ar9300_freebsd.c, because the poweron and srev check hasn't yet
happened.

So:

* Re-add the MCI overrides in attach
* Add QCA9565 (Aphrodite) check for the LNA diversity stuff.

Tested:

* QCA9565, STA mode + bluetooth
2016-05-31 04:17:17 +00:00
Adrian Chadd
204c8e00de Add initial ar9300 HAL support for the spectral scan mode. 2015-12-02 05:36:45 +00:00
Adrian Chadd
af4c1f0c95 Adjust a comment; we now support these embedded boards! 2015-12-01 06:11:09 +00:00
Enji Cooper
2451d4dd33 Fix the build
ichan is only used if AH_DEBUG_ALQ if defined

Pointyhat to: adrian
2015-11-30 08:02:52 +00:00
Adrian Chadd
ff066b54ec fix ht/40 configuration for ar9331 (hornet).
The synth programming here requires the real centre frequency,
which for HT20 channels is the normal channel, but HT40 is
/not/ the primary channel.  Everything else was using 'freq',
which is the correct centre frequency, but the hornet config
was using 'ichan' to do the lookup which was also the primary
channel.

So, modify the HAL call that does the mapping to take a frequency
in MHz and return the channel number.

Tested:

* Carambola 2, AR9331, tested both HT/20 and HT/40 operation.
2015-11-30 06:26:59 +00:00
Adrian Chadd
0bc93f5ad7 add missing initvals.
Sorry y'all.
2015-11-29 18:14:18 +00:00
Adrian Chadd
27e2ad4687 Add initial support for the QCA953x SoC (honeybee) wifi.
This is a 2x2 2GHz 802.11n part.  It works enough at the moment to
bring up, scan and associate.  I haven't started using this as
a day to day AP.

The specifics:

* add honeybee initvals
* add in changes; a mix from the QCA HAL and ath9k;
* fix a bug in AR_SREV_AR9580_10_OR_LATER(), which is only used
  for one capability check and we don't even implement it - so it's
  a big no-op.

Shady things:

* ath9k has the "platform data" define the 25/40MHz clock.
  This HAL .. doesn't.  Honeybee gets hard-coded to 25MHz which
  it likely shouldn't be.  I'll have to go and identify/fix those.

Tested:

* Qualcomm Atheros AP143 reference design board.

Obtained from:	Qualcomm Atheros; Linux ath9k
2015-11-29 05:47:52 +00:00
Adrian Chadd
c56cfc9553 u32 -> uint32_t. 2015-11-29 05:42:18 +00:00
Adrian Chadd
f647fde2e8 [ath_hal] add AR9461 (jupiter) 2.1 support.
Obtained from:	Linux ath9k
2015-11-29 05:34:00 +00:00
Adrian Chadd
f50e4ebf6a ath(4): begin fleshing out a "reset type" extension to force cold/warn resets.
Right now the only way to force a cold reset is:

* The HAL itself detects it's needed, or
* The sysctl, setting all resets to be cold.

Trouble is, cold resets take quite a bit longer than warm resets.

However, there are situations where a cold reset would be nice.
Specifically, after a stuck beacon, BB/MAC hang, stuck calibration results,
etc.

The vendor HAL has a separate method to set the reset reason (which is
how HAL_RESET_BBPANIC gets set) which informs the HAL during the reset path
why it occured.  This is almost but not quite the same; I may eventually
unify both approaches in the future.

This commit just extends HAL_RESET_TYPE to include both status (eg BBPANIC)
and type (eg do COLD.)  None of the HAL code uses it yet though;  that'll
come later.

It also is a big no-op in each HAL - I need to go teach each of the HALs
about cold/warm reset through this path.
2015-11-09 15:59:42 +00:00
Adrian Chadd
dc809fc15f Flip on fast frames support for AR5416 and AR9300 series NICs.
This was off because the net80211 aggregation code was using the same
state pointers for both fast frames and ampdu tx support which led to some
pretty unfortunate panic-y behaviour.

Now that net80211 doesn't panic, let's flip this back on.

It doesn't (yet) do the horrific sounding thing of A-MPDU aggregates
of fast frames; that'll come next.  It's a pre-requisite to supporting
AMSDU + AMPDU anyway, which actually speeds things up quite considerably
(think packing lots of little ACK frames into a single AMSDU.)

Tested:

* QCA955x SoC, AP mode
* AR5416, STA mode
* AR9170, STA mode (with local fast frame patches)
2015-10-10 00:13:45 +00:00
Adrian Chadd
9b11ed5f9d Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
logical negation when used in this fashion.

Tested:

* compile only
2015-08-30 08:46:50 +00:00
Adrian Chadd
66b870f3cb Add a missing method - ath_hal_settsf64().
This is required for TDMA slave mode.
2015-08-05 21:16:12 +00:00
Adrian Chadd
711b0fa045 Add TXOP enforce support to the AR9300 HAL.
This is required for (more) correct TDMA support.  Without it, the
code tries to calculate the required guard interval based on the
current rate, and since this is an 11n NIC and people try using
11n, it calls ath_hal_computetxtime() on an 11n rate which then
panics.

This doesn't fix TDMA slave mode on AR9300 - it just makes it
have one less bug.

Reported by:	Berislav Purgar <bpurgar@gmail.com>
2015-08-05 19:32:35 +00:00
Adrian Chadd
3e307100f6 Quieten the scorpion SoC/WMAC reset path. Stuff the non-error stuff
under HALDEBUG().
2015-07-04 03:15:42 +00:00
Adrian Chadd
967e8d3778 Add support for the tuning cap for Hornet/AR9331 boards.
This dramatically improves RX sensitivity and behaviour on the
AR9331 hardware I have, including the Carambola 2.

Tested:

* AR9331, Carambola 2 board

Submitted by:	Zilvinas Valinskas <zilvinas.valinskas@gmail.com>
2015-05-23 08:02:54 +00:00
Adrian Chadd
d5c3e61afb Expose the ANI state / statistics using the public ANI function, rather than
the ar9300_* definitions.

.. which of course don't match, and athstats was reading garbage ANI
data.
2015-04-01 04:56:10 +00:00
Adrian Chadd
9778bf377b Add initial support for the HAL channel survey support to the AR9300 HAL.
This is used by the 'athsurvey' command to print out channel survey
statistics - % busy times transmit, receive and airtime.

It's as buggy and incomplete as the rest of the HAL survey support -
notably, tying into the ANI code to read channel stats and occasionally
getting garbage counters isn't very nice.  It also doesn't (yet!) get
channel survey information during a scan.  But it's good enough for
basic air-time debugging, which is why I'm committing it in this state.

Tested:

* AR9380, STA mode
2015-03-29 21:53:08 +00:00
Adrian Chadd
f5ab408ee9 Quieten some of the log spam from AR9300 sysctl tree walk and chip setup/reset
path.

* For now there's no exposed control over classic / LNA antenna diversity,
  so just stub them out.  Adding this will take quite a bit of time.

* Add a function to fetch the CTS timeout.

PR:		kern/198558
2015-03-21 23:12:46 +00:00
Adrian Chadd
b8871f0823 Add initial support to the AR9300 HAL to support FreeBSD's intmit API.
I don't like having it in this function; I may migrate it to ar9300_freebsd.c
at some point to keep the HAL code pollution down.

This allows ANI to be disabled via a sysctl.

Tested:

* AR9331, STA/TDMA modes
2015-02-15 21:15:09 +00:00
Adrian Chadd
caa918bd3b Add ath_hal_setbeacontimers() to the AR9300 HAL.
This is a custom FreeBSD HAL method that is used by the TDMA code
to program the beacon timers directly without any guesswork/assumptions
by the HAL.

This brings up basic TDMA master/slave support on the AR9380 HAL,
however there are other issues preventing it from being stable.
(I'm seeing beacon interval instability, which may be due to
busy 2GHz air, but also may be due to some HAL configuration
issues with regards to ANI, or hardware timer programming, etc.)

Tested:

* AR9331 (Carambola2), STA, AP, adhoc and TDMA master mode.
2015-02-15 19:56:31 +00:00
Adrian Chadd
3876533b14 Comment out a double declaration of this particular function name.
It trips up gcc builds.

Pointy-hat-from:	jenkins, kib
2015-02-14 17:44:24 +00:00
Adrian Chadd
cb2f5d5ddb Quieten a clang warning. 2015-02-14 17:43:54 +00:00
Adrian Chadd
06f874e1f9 Remove the reserved pin 11 from the HAL check.
The QCA9565 can have RFKILL on GPIO Pin 11, and thus we need to configure
it up correctly or the NIC may not function.

I'm not sure why the AR9382 can't use GPIO 8 / GPIO 11 ; it's likely
hooked up to some external LNA or filter.  The real solution is to
make it only block pin 8 / pin 11 for AR9382, but the AR9382 probes
like an AR9380.  Sigh.

Submitted by:	Anthony Jenkins <scoobi_doo@yahoo.com>
2015-02-14 16:23:04 +00:00
Adrian Chadd
899d1cacac Update the AR9300 HAL to the latest public available HAL from QCA.
I've been sitting on this for a year or so now; I've finally
tested it on enough devices to be reasonably sure it won't
cause too much drama.  But, if you see issues, please email me.

Tested (all STA mode):

PCIe:

* AR9380
* AR9390
* AR9580
* AR9462
* AR9485

SoC:

* QCA9550
* AR9331
* AR9342
2015-02-14 04:28:51 +00:00
Dimitry Andric
772400696c Fix a number of -Wcast-qual warnings in ath's ar9300_attach.c, by making
the ia_array field of struct ar9300_ini_array const, and removing the
const-dropping casts.  No functional change.

Reviewed by:	adrian
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1725
2015-02-07 12:20:33 +00:00
Adrian Chadd
6ae52b27b6 Oops - use the correct argument order for ar9300_set_beacon().
(It's only an issue in AP/adhoc modes. But, still. Grr.)
2015-01-18 17:43:00 +00:00
Adrian Chadd
f590185223 Correct the descriptor length for AR9462/AR9565 and set the final field
to zero - TX drops are otherwise reported.

Tested:

* AR9462 (WB222), STA mode

Obtained from:	Linux ath9k
2015-01-17 17:37:08 +00:00
Adrian Chadd
091855cd9e Skip the OFDM weak signal threshold detection programming for
AR9462/AR9565.

This and some upcoming changes to the HAL for these chips should
address some of the signal sensitivity reported by users.

Tested:

* AR9462 (WB222), STA mode

Obtained from:	Linux ath9k
2015-01-17 17:31:47 +00:00
Adrian Chadd
e5acc52d45 Override the bt enable/disable methods for AR9462 (jupiter) and
AR9565 (Aphrodite.)  These need to use the MCI routines, not
the legacy 2-wire / 3-wire bluetooth coexistence methods.

Tested:

* AR9462 (WB222); STA mode
2015-01-17 06:43:30 +00:00
Adrian Chadd
38878c6343 Tie in the MCI bluetooth coexistence functions into the HAL.
Tested:

* AR9462 (WB222)
2015-01-16 23:48:28 +00:00
Adrian Chadd
bc6ee3cc93 Glue to suck in the QCA9550 HAL support if AH_SUPPORT_QCA9550 is defined. 2015-01-06 07:52:19 +00:00
Sean Bruno
7d25e50fdf Repair build of tools/ath/athalq and define missing value len.
Reviewed by:	adrian
2014-10-13 16:48:01 +00:00
Adrian Chadd
7093d16e92 Remove this stuff - it's no longer needed here. 2014-09-30 03:29:46 +00:00
Adrian Chadd
9389d5a95e Add initial support for the AR9485 CUS198 / CUS230 variants.
These variants have a few differences from the default AR9485 NIC,
namely:

* a non-default antenna switch config;
* slightly different RX gain table setup;
* an external XLNA hooked up to a GPIO pin;
* (and not yet done) RSSI threshold differences when
  doing slow diversity.

To make this possible:

* Add the PCI device list from Linux ath9k, complete with vendor and
  sub-vendor IDs for various things to be enabled;
* .. and until FreeBSD learns about a PCI device list like this,
  write a search function inspired by the USB device enumeration code;
* add HAL_OPS_CONFIG to the HAL attach methods; the HAL can use this
  to initialise its local driver parameters upon attach;
* copy these parameters over in the AR9300 HAL;
* don't default to override the antenna switch - only do it for
  the chips that require it;
* I brought over ar9300_attenuation_apply() from ath9k which is cleaner
  and easier to read for this particular NIC.

This is a work in progress.  I'm worried that there's some post-AR9380
NIC out there which doesn't work without the antenna override set as
I currently haven't implemented bluetooth coexistence for the AR9380
and later HAL.  But I'd rather have this code in the tree and fix it
up before 11.0-RELEASE happens versus having a set of newer NICs
in laptops be effectively RX deaf.

Tested:

* AR9380 (STA)
* AR9485 CUS198 (STA)

Obtained from:	Qualcomm Atheros, Linux ath9k
2014-09-30 03:19:29 +00:00
Adrian Chadd
88c0971a31 Quieten the AR9300 HAL attach a little - the setupXTxDesc method
is only called during attach now.

The EDMA TX path never calls this - only the legacy TX path does.
2014-09-20 01:18:36 +00:00