Commit Graph

803 Commits

Author SHA1 Message Date
Jung-uk Kim
278f0de60d Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
Adrian Chadd
c788d9b010 [ath_hal_ar9300] Add some comments around the AR9300 ANI code.
I'm refamiliarising myself with the behaviour of the ANI code and I thought
I'd drop some comments to remind myself.
2019-03-19 00:07:12 +00:00
Ed Maste
cf3f5ed89e Remove radeonkmsfw firmware files
The drivers were removed in r344299 so there is no need to keep the
firmware files in the src tree.

Reviewed by:	imp, jhibbits, johalun
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19583
2019-03-14 17:05:46 +00:00
Ed Maste
30903c8283 Remove npe microcode
The driver was removed in r336436.
2019-03-14 13:28:21 +00:00
Adrian Chadd
34d5464b85 [ath_hal_ar9300] Add the missing bits from the previous HAL commit.
Noticed by: 75+ emails telling me I messed up.
2019-03-06 08:52:02 +00:00
Adrian Chadd
647915ff20 [ath_hal_ar9300] Add the extra ANI configuration fields for the AR93xx HAL.
Tested:

* Carambola2 (Ar9331), STA/AP modes
2019-03-04 06:43:00 +00:00
Jung-uk Kim
f10dc83806 MFV: r344447
Fix missing comma in array declaration.
2019-02-21 21:33:27 +00:00
Jung-uk Kim
cd6518c765 MFV: r344395
Import ACPICA 20190215.
2019-02-20 23:53:39 +00:00
Li-Wen Hsu
4f3128086b Remove empty files
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
2019-02-12 08:16:05 +00:00
Jung-uk Kim
e5e1f58a87 MFV: r342867
Merge ACPICA 20190108.
2019-01-09 00:31:10 +00:00
Andriy Voskoboinyk
b3f3786e5d rtwn_pci(4): add support for RTL8188EE chipset.
Initially based on https://reviews.freebsd.org/D15692;
later deduplicated and improved a bit (Tx reports, IQ calibration support).

Submitted by:	Farhan Khan <khanzf@gmail.com>
MFC after:	4 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D15692
2019-01-02 06:48:53 +00:00
Jung-uk Kim
90b566fde9 MFV: r342049
Merge ACPICA 20181213.
2018-12-14 00:40:38 +00:00
Jung-uk Kim
4a38ee6de7 MFV: r339981
Merge ACPICA 20181031.
2018-11-02 22:50:13 +00:00
Jung-uk Kim
6f1f1a6395 Update ACPICA to 20181003.
Approved by:	re (gjb)
2018-10-09 18:40:36 +00:00
Warner Losh
592ffb2175 Revert drm2 removal.
Revert r338177, r338176, r338175, r338174, r338172

After long consultations with re@, core members and mmacy, revert
these changes. Followup changes will be made to mark them as
deprecated and prent a message about where to find the up-to-date
driver.  Followup commits will be made to make this clear in the
installer. Followup commits to reduce POLA in ways we're still
exploring.

It's anticipated that after the freeze, this will be removed in
13-current (with the residual of the drm2 code copied to
sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or
radeon drivers).

Due to the impending freeze, there was no formal core vote for
this. I've been talking to different core members all day, as well as
Matt Macey and Glen Barber. Nobody is completely happy, all are
grudgingly going along with this. Work is in progress to mitigate
the negative effects as much as possible.

Requested by: re@ (gjb, rgrimes)
2018-08-24 00:02:00 +00:00
Matt Macy
92c151322b r338172 follow - remove firmwares 2018-08-22 02:53:35 +00:00
Jung-uk Kim
51f42bad71 Merge ACPICA 20180810. 2018-08-13 16:26:26 +00:00
Jung-uk Kim
da9b0901f6 MFV: r335802
Merge ACPICA 20180629.
2018-06-29 23:48:30 +00:00
Adrian Chadd
8a97beff98 [ath_hal] Return failure if noise floor calibration fails.
If we fail noise floor calibration then we may end up with a deaf NIC
which we can't recover without a full chip reset.

Earlier chips seem to get less stuck in this condition versus AR9280/later
and AR9300/later, but whilst here just fix up the AR5212 era chips to also
return NF calibration failures.

This HAL routine would only return failure if the channel was not configured.

This is a no-op until the driver side code for doing resets and the HAL
code for being told about the reset type (and then handling it!) is
implemented.

Tested:

* AR9280, STA mode
* AR2425, STA mode
* AR9380, STA mode
2018-06-08 18:21:57 +00:00
Jung-uk Kim
3d90091d60 MFV: r334448
Import ACPICA 20180531.
2018-06-04 22:26:47 +00:00
Adrian Chadd
a861b06b97 [ath_hal] migrate the shared HAL_RESET_* pieces out into ath_hal.
I'm in the process of reworking how the reset path works with an eye
to better recovery when the chips hang and/or go RF/PHY deaf.
This is the first step in a lot of unification and API changes.
2018-05-25 01:27:39 +00:00
Sean Bruno
1696e1f2b8 Quiesce a couple pages of clang warnings with a cast. Duplicates
linux maintainer commit:

627871b71c (diff-8c6ddb4c3ad69a6fb9f289475821db56)

ar9300template_aphrodite.h:575:40: warning: implicit conversion from 'int'
  to 'u_int8_t' (aka 'unsigned char') changes value from 3495 to 167
  [-Wconstant-conversion]
            /* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)}
                                              ^~~~~~~~~~~~~~~~~~
ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN'
    (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5))

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15476
2018-05-18 17:23:23 +00:00
Jung-uk Kim
e7dfa7d8ab MFV: r333378
Import ACPICA 20180508.
2018-05-08 18:18:27 +00:00
Jung-uk Kim
835b56bfeb MFV: r333077
Merge ACPICA 20180427.
2018-05-01 19:17:38 +00:00
Eitan Adler
6472fa9a9d [iwm] Add support for iwm 3168 cards
```
iwm0@pci0:5:0:0:        class=0x028000 card=0x21108086 chip=0x24fb8086
rev=0x10 hdr=0x00
vendor     = 'Intel Corporation'
device     = 'Dual Band Wireless-AC 3168NGW [Stone Peak]'
class      = network
[94829] iwm0: <Intel(R) Dual Band Wireless AC 3168> mem
0xef700000-0xef701fff at device 0.0 on pci5
[94829] iwm0: hw rev 0x220, fw ver 22.361476.0, address
28:c6:3f:15:43:c5
```

MFC After:	2 weeks
Reviewed by:	ivadasz (over IRC)
PR:		224886
Differential Revision:	https://reviews.freebsd.org/D14865
2018-03-28 07:59:16 +00:00
Jung-uk Kim
8438a7a80a Merge ACPICA 20180313. 2018-03-14 23:45:48 +00:00
Anish Gupta
9363000dfe Move the new AMD-Vi IVHD [ACPI_IVRS_HARDWARE_NEW]definitions added in r329360 in contrib ACPI to local files till ACPI code adds new definitions reported by jkim.
Rename ACPI_IVRS_HARDWARE_NEW to ACPI_IVRS_HARDWARE_EFRSUP, since new definitions add Extended Feature Register support.  Use IvrsType to distinguish three types of IVHD - 0x10(legacy), 0x11 and 0x40(with EFR). IVHD 0x40 is also called mixed type since it supports HID device entries.
Fix 2 coverity bugs reported by cem.

Reported by:jkim, cem
Approved by:grehan
Differential Revision://reviews.freebsd.org/D14501
2018-03-05 02:28:25 +00:00
Anish Gupta
0b37d3d90e This change fixes duplicate detection of same IOMMU/AMD-Vi device for Ryzen with EFR support.
IVRS can have entry of type legacy and non-legacy present at same time for same AMD-Vi device. ivhd driver will ignore legacy if new IVHD type is present as specified in AMD-Vi specification. Earlier both of IVHD entries used and two ivhd devices were created.
Add support for new IVHD type 0x11 and 0x40 in ACPI. Create new struct of type acpi_ivrs_hardware_new for these new type of IVHDs. Legacy type 0x10 will continue to use acpi_ivrs_hardware.

Reviewed by:	avg
Approved by:	grehan
Differential Revision:https://reviews.freebsd.org/D13160
2018-02-16 05:17:00 +00:00
Jung-uk Kim
ff879b0799 MFV: r329072
Merge ACPICA 20180209.
2018-02-09 21:49:38 +00:00
Jung-uk Kim
6c30ff135c Fix a header inclusion missed in the previous commit.
Reported by:	Michael Butler (imb at protected-networks dot net)
2018-01-06 03:41:35 +00:00
Jung-uk Kim
32ac401671 Merge ACPICA 20180105. 2018-01-05 23:21:47 +00:00
Jung-uk Kim
f1db5ef7aa MFC: r326864
Merge ACPICA 20171214.
2017-12-14 23:21:31 +00:00
Nathan Whitehorn
32d122363f Switch the default firmware for npe(4) from the QOS_VLAN one to the
plain-vanilla ETH microcode. The QOS_VLAN firmware added support in microcode
for handling IEEE 802.1q tags, but the npe(4) driver did not actually
support the relevant signalling. As a result, it was impossible to use
VLANs with npe(4). Switching to the more basic microcode (same license)
removes the on-NIC promisisng and makes vlan(4) work on both NPE interfaces.

Ref: https://lists.freebsd.org/pipermail/freebsd-arm/2012-August/003826.html
2017-11-24 15:48:17 +00:00
Warner Losh
ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00
Jung-uk Kim
b7b7e71176 MFV: r325668
Merge ACPICA 20171110.
2017-11-10 18:46:34 +00:00
Jung-uk Kim
67d9aa4422 Merge ACPICA 20170929 (take 2). 2017-10-10 19:33:24 +00:00
George V. Neville-Neil
61fa6c0bd7 Add the firmware for the Intel 8265 WiFi device.
MFC after:	1 month
2017-10-09 15:54:57 +00:00
Jung-uk Kim
d7bbccdd82 Revert r324109. This commit broke a number of systems.
Reported by:	lwhsu, kib
Requested by:	ngie
2017-09-30 20:28:50 +00:00
Jung-uk Kim
c39c15e23f Merge ACPICA 20170929. 2017-09-29 23:02:49 +00:00
Sean Bruno
f173c2b77e The diff is the initial submission of Cavium Liquidio 2350/2360 10/25G
Intelligent NIC driver.

The submission conconsists of firmware binary file and driver sources.

Submitted by:	pkanneganti@cavium.com (Prasad V Kanneganti)
Relnotes:	Yes
Sponsored by:	Cavium Networks
Differential Revision:	https://reviews.freebsd.org/D11927
2017-09-12 23:36:58 +00:00
Jung-uk Kim
2f6a1a81bb Merge ACPICA 20170831. 2017-08-31 22:47:04 +00:00
Jung-uk Kim
5f9b24fa43 Merge ACPICA 20170728. 2017-07-28 22:23:29 +00:00
Adrian Chadd
13811c2677 [iwmfw] 8000C ver 22 firmware. 2017-06-04 21:27:39 +00:00
Adrian Chadd
ab5bad9ee3 [iwmfw] add 7265D-22 firmware 2017-06-04 21:26:31 +00:00
Adrian Chadd
f0949f0cc6 [ath_hal] add USB reset PLL work around for AR9331/AR9344 (Hornet/Wasp.)
It turns out that this is useful on hornet and wasp SoCs but it isn't
enabled in ye olde HAL /unless/ you were using a version from one of the
business units building USB targetted devices.  It eventually got fixed
for all of them as people started wanting to use the USB ports on their
SoCs (eg for flash storage, bluetooth, 4G/LTE widgets, etc.)

This is actually a fix from ath9k but I'm merging it with the available-but-
disabled code in the QCA reference HAL.

Tested:

* AR9331 SoC
2017-06-04 21:21:44 +00:00
Jung-uk Kim
af05116143 Merge ACPICA 20170531. 2017-06-01 00:01:19 +00:00
Jung-uk Kim
0d84335f99 Merge ACPICA 20170303. 2017-03-03 18:56:15 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Adrian Chadd
027d4da3e0 Add 7265D firmware. 2017-02-22 04:42:02 +00:00
Adrian Chadd
95b861f576 [iwm] add this 3 megabyte firmware image. 2017-02-08 07:03:09 +00:00
Adrian Chadd
e438d74cd5 [iwm] add version 17 firmware. 2017-02-08 07:02:09 +00:00
Adrian Chadd
df510c9beb [iwm] add version 17 firmware. 2017-02-08 07:01:58 +00:00
Adrian Chadd
738de8f5de [iwm] add version 17 firmware. 2017-02-08 07:01:31 +00:00
Adrian Chadd
ea319c839b [ath_hal] [ar9300] link in the CAC enable/diable methods and expose it via the HAL. 2017-02-03 05:15:35 +00:00
Adrian Chadd
c15fdc23c7 [ath_hal] [ar9300] initial radar decode for AR9380 and later chips. 2017-02-03 03:57:06 +00:00
Adrian Chadd
66c73f1d0a [ath_hal] [ar9300] initial radar detection glue.
* flesh out a "get default DFS parameters" routine
* remove the stub that returns NULL
* fix up the enable DFS method to do what FreeBSD does - specifically, allow pe_enabled
  to be set/cleared.

This allows the radar pulse reporting code to function, but it doesn't yet
do anything useful.
2017-02-02 09:19:57 +00:00
Adrian Chadd
be34efe2f3 [ath_hal] [ar9300] initial hacks to make spectral scan working on AR9380 and later NICs.
* add debugging
* disable the manual noise floor calibration and tracking done by the HAL;
  this interferes with the normal calibration path and will lock up the RX
  side
* don't program short report / priority if they're provided as NOVAL.
2017-02-02 05:29:22 +00:00
Baptiste Daroussin
b4b4b5304b Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
Baptiste Daroussin
814aaaa7da Revert r312923 a better approach will be taken later 2017-01-28 16:30:14 +00:00
Kevin Lo
60b9567d16 Add support for the Realtek RTL8192EU chipset.
Committed over the D-Link DWA-131 rev E1 on amd64 with WPA.

Reviewed by:	avos
2017-01-24 02:35:38 +00:00
Jung-uk Kim
61673a1f78 Merge ACPICA 20170119. 2017-01-19 22:07:21 +00:00
Conrad Meyer
e116c444a0 Revert r311843, r311667
As jkim@ points out, it isn't needed.
2017-01-11 00:02:51 +00:00
Conrad Meyer
cc2166783b Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
Suggested by:	jbeich@
2017-01-10 00:03:43 +00:00
Conrad Meyer
8436bcc87d Add some additional ACPI methods for DRM
Add AcpiGetDataFull and AcpiGetTableWithSize.

Submitted by:	Matt Macy
2017-01-08 06:26:33 +00:00
Jung-uk Kim
172ae88fec Remove '-vd' option to make iasl(8) reproducible.
PR:		215421
2017-01-06 18:08:53 +00:00
Jung-uk Kim
284829482e Merge ACPICA 20161222. 2017-01-05 21:28:25 +00:00
Jung-uk Kim
1cc50d6b6a Merge ACPICA 20161117. 2016-11-22 05:54:37 +00:00
Bryan Drewery
28323add09 Fix improper use of "its".
Sponsored by:	Dell EMC Isilon
2016-11-08 23:59:41 +00:00
Michal Meloun
ccf5e68e5b Add NVIDIA Tegra XHCI driver and coresponding firmware blob.
MFC after: 3 weeks
Approved by: core@ (NVIDIA license)
2016-11-07 05:37:10 +00:00
Andriy Voskoboinyk
7453645f2a rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices:
- add support for rate adaptation via ieee80211_amrr(9);
- use short preamble for transmitted frames when needed;
- multi-bss support:
 * for RTL8821AU: 2 VAPs at the same time;
 * other: 1 any VAP + 1 sta VAP.
RTL8188CE:
- fix IQ calibration bug (reason of significant speed degradation);
- add h/w crypto acceleration support.
USB:
- A-MPDU Tx support;
- short GI support;
Other:
- add support for RTL8812AU / RTL8821AU chipsets
(a/b/g/n only; no ac yet);
- split merged code into subparts:
 * bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*)
 * common (if_rtwn*)
 * chip-specific (rtl*/*)
- various other bugfixes.

Due to code reorganization, module names / requirements were changed too:
urtwn urtwnfw -> rtwn rtwn_usb rtwnfw
rtwn  rtwnfw  -> rtwn rtwn_pci rtwnfw

Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.

Tested by:	kevlo, garga,
		Peter Garshtja <peter.garshtja@ambient-md.com>,
		Kevin McAleavey <kevin.mcaleavey@knosproject.com>,
		Ilias-Dimitrios Vrachnis <id@vrachnis.com>,
		<otacilio.neto@bsd.com.br>
Relnotes:	yes
2016-10-17 20:38:24 +00:00
Jung-uk Kim
493deb390b Merge ACPICA 20160930. 2016-10-04 20:27:15 +00:00
Adrian Chadd
b60cfea4fd [ath_hal] quieten a bit of the boot messages - this stuff has been working for a while. 2016-09-12 04:58:59 +00:00
Adrian Chadd
aebcd3034e [ath_hal] add USB PHY control registers for hornet/AR9330.
Obtained from:	linux ath9k
2016-08-28 05:42:03 +00:00
Adrian Chadd
603e05dbcb [ar9300] don't program a negative readytime. 2016-08-09 01:05:29 +00:00
Sean Bruno
e4ff429714 Update iwmfw(4) to include support for 8260 series units and update
f/w for the other devices supported by this driver.

Patch linked in https://reviews.freebsd.org/D6967 but not actually
a part of the review.

Obtained from DragonflyBSD.

Submitted by:   Kevin Bowling <kev009@kev009.com>
MFC after:      2 weeks
Relnotes:       yes
2016-07-25 23:05:25 +00:00
Adrian Chadd
e6df5ff544 [ath_hal] add in locationing timer support and capabilities.
* add support to read the timer and capability
* add support to enable/disable the location timer.

On AR9380 at least, enabling the location timer is required to make
the timer tick, otherwise location packets return a timestamp of 0.
However, it then makes /all/ RX packets use the RX location timestamp
instead of the TSF timestamp.

So, unless I find another magical way to do location timestamping,
we will have to dynamically switch things on/off and ensure the
TX/RX path handles the "different" timestamps correctly.

Tested:

* AR9380, STA mode
2016-07-08 22:59:15 +00:00
Adrian Chadd
b10add4ea4 [ath_hal] add locationing / tx-beamforming RX status descriptor decoding.
* LOC_INFO is mostly just "did this packet come with a locationing
  timestamp instead of TSF";
* Decode not-sounding, uploaded-data, data-valid, data type and
  number of extension spatial streams.
2016-07-08 22:39:37 +00:00
Adrian Chadd
ada3f60304 [ath_hal] Add setting positioning bit and clear sounding-disable bit.
* If fast_ts is set then the TX timestamp is the fast timestamp, not
  normal TSF.
* If the TX descriptor has the position bit set then request locationing
  and clear sounding-disable.  This way we (a) get the response with
  the TX timestamp from the location side of things, and (b) we get
  a CSI dump of the response ACK, which we will eventually use in the
  locationing path.
2016-07-08 22:37:52 +00:00
Adrian Chadd
515582436a [ath_hal] retire a "long RX desc" flag, store/use the TX/RX timestamp length.
* the code already stored the length of the RX desc, which I never used.
  So, use that and retire the new flag I introduced a while ago.
* Introduce a TX timestamp length field and capability.
2016-07-08 21:34:39 +00:00
Adrian Chadd
d304f3093a [ath] implement TX queue configuration extensions for the AR9380 HAL.
Among other things, this introduces the idea of DBA-gated queues that
aren't the CABQ.  The TDMA support requires this.

Tested:

* AR9580 (hostap mode)
* AR9380 (sta mode)

Approved by:	re (gjb)
2016-06-20 16:12:27 +00:00
Adrian Chadd
3648197a1b [ath_hal] modify the xmit code to use temporary variables for setting qmisc/dmisc.
This is in preparation for some other TDMA fixes which will hopefully
end with having working TDMA.

But, it does avoid lots of read/modify/writes in the txq setup path.
2016-06-08 16:26:44 +00:00
Adrian Chadd
dd77085237 [ath_hal] add a _S so FSP (frame scheduling policy) can be set/read via SM/MS macros. 2016-06-08 16:21:38 +00:00
Adrian Chadd
e4eb838ce1 [ath_hal] correctly initialise the CAB queue default value
* Allow readyTime to just be programmed in directly
* The beacon interval and all of the beacon timing sysctl's are in TU,
  not TSF.  So, we were doing the wrong math on the CAB programming
  in the first place.
2016-06-08 16:10:34 +00:00
Adrian Chadd
78b812de40 [ath_hal] initialise ah_beaconInterval when the AP/IBSS/TDMA beacon is setup. 2016-06-08 16:08:05 +00:00
Adrian Chadd
09ff344bba [ath_hal] add AR9462 (jupiter) RX gain / XLNA programming.
This seems to make 5G work better.

It doesn't fix powersave handling though, that still sees the PHY get
stuck during initial calibration and everything goes pear shaped.
I'll look into that later.

Tested:

* QCAFN222 NIC, STA mode, 5GHz

Obtained from:	Linux ath9k
2016-06-05 05:55:27 +00:00
Adrian Chadd
fa63ec5349 [ath_hal] Add Jupiter 2.1 (AR9462 mac 640.3) support.
Turns out I wasn't even initialising or programming a lot of stuff
for the AR9462 2.1 chip.  Oops.

This mostly gets it working. powersave scan results in some pretty
hilarious NFcal hangs and I don't see beacons reliably.
There are still some xlna gain tables missing that ath9k has; I'll
follow up with some fixes and then see if the QCAFN222 NIC I have
tests this path.

Tested:

* QCAFN222 NIC, STA mode, 2GHz and 5GHz
2016-06-05 02:17:51 +00:00
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
Jung-uk Kim
3920312eeb Merge ACPICA 20160527.
Relnotes:	yes
2016-05-27 22:16:46 +00:00
Jung-uk Kim
4cf287c011 Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
now.  The following upstream commits are reverted from hwregs.c:

https://github.com/acpica/acpica/commit/96ece05
https://github.com/acpica/acpica/commit/3d8583a
https://github.com/acpica/acpica/commit/48eea5e
https://github.com/acpica/acpica/commit/0a212c3
https://github.com/acpica/acpica/commit/41f6aef
https://github.com/acpica/acpica/commit/26434b9
https://github.com/acpica/acpica/commit/c23034a
https://github.com/acpica/acpica/commit/c49a751

Note this commit will be reverted when the upstream fixes the code properly.
2016-04-30 06:48:48 +00:00
Jung-uk Kim
f8628d5bf2 Fix build without ACPI_DEBUG. 2016-04-27 20:24:48 +00:00
Jung-uk Kim
f8146b882b Merge ACPICA 20160422. 2016-04-27 19:09:21 +00:00
Adrian Chadd
5198e5ef55 [rtwn] add rtwn firmware.
Submitted by:	kevlo
2015-12-31 22:31:43 +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
a9fcb51fbb Add an initial driver for the AR9170 series draft-11n hardware from
Atheros.

Thanks to OpenBSD for providing a driver based on the original
Atheros open source driver circa 2008.  This uses the early, pre-carl9170
atheros provided firmware.

It only supports 11bg at the moment.  I've not tested it with 11a
(and so the TX rate control logic may be slightly wrong!) so if
you do have the dual-band version of this hardware please do let me know.

Tested:

* AR9170, TP-Link WN821N 2GHz.

TODO:

* Hook this up to a non-module build.
2015-09-26 07:08:35 +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
Jung-uk Kim
70e6ab8f6b Merge ACPICA 20150818. 2015-08-26 17:13:47 +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
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
Jung-uk Kim
fe0f0bbb19 Merge ACPICA 20150717. 2015-07-22 16:25:07 +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
Jung-uk Kim
5ef5072350 Merge ACPICA 20150619. 2015-06-18 23:14:45 +00:00
Jung-uk Kim
5836df80a2 MFV: r283965
- Update GUIDs for new NFIT tables.
- Fix ill-formed GUID strings for NFIT tables.
- Fix a possible fault when performing a UUID search.
2015-06-03 19:39:59 +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
Jung-uk Kim
a371a5fd85 Merge ACPICA 20150515. 2015-05-18 23:46:11 +00:00
Jung-uk Kim
7cf3e94a41 Merge ACPICA 20150410. 2015-04-11 03:23:41 +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
Jung-uk Kim
1c0e1b6da9 Merge ACPICA 20141107 and 20150204. 2015-02-18 20:33:00 +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
Kevin Lo
6fc44dab19 Add preliminary support for the Ralink RT5390 and RT5392 chipsets.
Committed over the D-Link DWA-525 rev A2 on amd64 with WPA.
2015-02-11 05:25:23 +00:00
Konstantin Belousov
4c918926cd Add x2APIC support. Enable it by default if CPU is capable. The
hw.x2apic_enable tunable allows disabling it from the loader prompt.

To closely repeat effects of the uncached memory ops when accessing
registers in the xAPIC mode, the x2APIC writes to MSRs are preceeded
by mfence, except for the EOI notifications.  This is probably too
strict, only ICR writes to send IPI require serialization to ensure
that other CPUs see the previous actions when IPI is delivered.  This
may be changed later.

In vmm justreturn IPI handler, call doreti_iret instead of doing iretd
inline, to handle corner conditions.

Note that the patch only switches LAPICs into x2APIC mode. It does not
enables FreeBSD to support > 255 CPUs, which requires parsing x2APIC
MADT entries and doing interrupts remapping, but is the required step
on the way.

Reviewed by:	neel
Tested by:	pho (real hardware), neel (on bhyve)
Discussed with:	jhb, grehan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
2015-02-09 21:00:56 +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
Marius Strobl
182600f180 Use the same 6000 series g2{a,b} firmware versions when embedding these
images into the kernel as currently included into iwn6000g2{a,b}fw.ko
and delete the old files, missed in r254199 and r259135 respectively.

MFC after:	3 days
2014-12-27 17:10:35 +00:00
Kevin Lo
f386f04f11 Add missing headers needed by write(). 2014-11-25 02:58:38 +00:00