Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 2020 19:00:17 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r365608 - in stable/12: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_...
Message-ID:  <202009101900.08AJ0Iql082480@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Sep 10 19:00:17 2020
New Revision: 365608
URL: https://svnweb.freebsd.org/changeset/base/365608

Log:
  MFC r344749-344750,344841-344843,345284,346405,346470,347140-347141,348331,
      349593,351868,353506-353507,353809,353853,353858,353860,356852,359063,
      359158,360819,360888,360950-360951,360953-360954,360998,361009,361025,
      361085,361087,361098,361106-361107,361115,361118,361319-361321,361486,
      361560,361566,361626,361636-361637,361687,361726,361737-361738,361768,
      361778,361811-361813,361819-361822,361825-361826,361834,361863-361864,
      361878,361885-361886,362016,362084-362085,362156-362157,362161-362162,
      362210-362213,362216,362256-362257,362671,362815-362816,363325,
      363327-363328,364011-364012,364299,364301,364303,364312,364315,
      364326-364327,364551,364553,364673,365097,365116,365125-365126,
      365130-365131,365198,365419
    by adrian(78), bcran(1), bz(13), cem(1), gavin(1), glebius(6),
       landonf(1), mjg(7)
  
  Merge WiFi net80211, drivers, and management in order to support better 11n
  and upcoming 11ac.
  
  This includes an ath(4) update, some run(4) 11n support, 11n for otus(4),
  A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options, scanning fixes,
  enahnced PRIV checks for jails, restored parent device name printing,
  improvements for upcoming VHT support, lots of under-the-hood infrastructure
  improvements, new device ID, debug tools updates, some whistespace changes
  (to make future MFCs easier).
  
  This does not include (nost) epoch(9) related changes as too much other
  infrastructure was not merged for that.
  
  Bump __FreeBSD_veresion as this changes the priv(9) names (not know to be
  used externally), and net80211 structures.
  
  Tested on:	some ath(4) AP, run(4) STA, and rtwn(4) STA
  Discussed with:	adrian (extremly briefly)
  Sponsored by:	Rubicon Communications, LLC (d/b/a "Netgate") [partially]
  Relnotes:	yes

Added:
  stable/12/tools/tools/ath/athani/
     - copied from r344842, head/tools/tools/ath/athani/
Modified:
  stable/12/lib/lib80211/lib80211_regdomain.c
  stable/12/lib/lib80211/lib80211_regdomain.h
  stable/12/lib/lib80211/regdomain.xml
  stable/12/sbin/ifconfig/ifieee80211.c
  stable/12/share/man/man4/ath.4
  stable/12/share/man/man4/net80211.4
  stable/12/share/man/man4/run.4
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h
  stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h
  stable/12/sys/dev/an/if_an.c
  stable/12/sys/dev/ath/ah_osdep.c
  stable/12/sys/dev/ath/ah_osdep_ar5210.c
  stable/12/sys/dev/ath/ah_osdep_ar5211.c
  stable/12/sys/dev/ath/ah_osdep_ar5212.c
  stable/12/sys/dev/ath/ah_osdep_ar5416.c
  stable/12/sys/dev/ath/ah_osdep_ar9300.c
  stable/12/sys/dev/ath/ath_dfs/null/dfs_null.c
  stable/12/sys/dev/ath/ath_hal/ah.c
  stable/12/sys/dev/ath/ath_hal/ah.h
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.c
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.h
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_v14.c
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.c
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.h
  stable/12/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
  stable/12/sys/dev/ath/ath_hal/ah_internal.h
  stable/12/sys/dev/ath/ath_hal/ah_regdomain.c
  stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h
  stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h
  stable/12/sys/dev/ath/ath_hal/ah_soc.h
  stable/12/sys/dev/ath/ath_hal/ar5210/ar5210.h
  stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
  stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211.h
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211phy.h
  stable/12/sys/dev/ath/ath_hal/ar5211/ar5211reg.h
  stable/12/sys/dev/ath/ath_hal/ar5212/ar2316.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar2317.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar2413.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar2425.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5111.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5112.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212.h
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5212phy.h
  stable/12/sys/dev/ath/ath_hal/ar5212/ar5413.c
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5312reg.h
  stable/12/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar2133.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416.h
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
  stable/12/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  stable/12/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
  stable/12/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9285.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c
  stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c
  stable/12/sys/dev/ath/ath_rate/amrr/amrr.c
  stable/12/sys/dev/ath/ath_rate/onoe/onoe.c
  stable/12/sys/dev/ath/ath_rate/sample/sample.c
  stable/12/sys/dev/ath/ath_rate/sample/sample.h
  stable/12/sys/dev/ath/ath_rate/sample/tx_schedules.h
  stable/12/sys/dev/ath/if_ath.c
  stable/12/sys/dev/ath/if_ath_ahb.c
  stable/12/sys/dev/ath/if_ath_beacon.c
  stable/12/sys/dev/ath/if_ath_beacon.h
  stable/12/sys/dev/ath/if_ath_btcoex.c
  stable/12/sys/dev/ath/if_ath_dfs.c
  stable/12/sys/dev/ath/if_ath_drv.c
  stable/12/sys/dev/ath/if_ath_ioctl.c
  stable/12/sys/dev/ath/if_ath_led.c
  stable/12/sys/dev/ath/if_ath_lna_div.c
  stable/12/sys/dev/ath/if_ath_misc.h
  stable/12/sys/dev/ath/if_ath_pci.c
  stable/12/sys/dev/ath/if_ath_pci_devlist.h
  stable/12/sys/dev/ath/if_ath_rate.c
  stable/12/sys/dev/ath/if_ath_rx.c
  stable/12/sys/dev/ath/if_ath_rx_edma.c
  stable/12/sys/dev/ath/if_ath_spectral.c
  stable/12/sys/dev/ath/if_ath_sysctl.c
  stable/12/sys/dev/ath/if_ath_tx.c
  stable/12/sys/dev/ath/if_ath_tx.h
  stable/12/sys/dev/ath/if_ath_tx_edma.c
  stable/12/sys/dev/ath/if_ath_tx_ht.c
  stable/12/sys/dev/ath/if_athioctl.h
  stable/12/sys/dev/ath/if_athrate.h
  stable/12/sys/dev/ath/if_athvar.h
  stable/12/sys/dev/bwi/bwimac.c
  stable/12/sys/dev/bwi/bwiphy.c
  stable/12/sys/dev/bwi/bwirf.c
  stable/12/sys/dev/bwi/if_bwi.c
  stable/12/sys/dev/bwi/if_bwi_pci.c
  stable/12/sys/dev/bwi/if_bwireg.h
  stable/12/sys/dev/bwn/if_bwn.c
  stable/12/sys/dev/bwn/if_bwn_pci.c
  stable/12/sys/dev/bwn/if_bwn_pcivar.h
  stable/12/sys/dev/bwn/if_bwn_phy_g.c
  stable/12/sys/dev/bwn/if_bwnvar.h
  stable/12/sys/dev/iwm/if_iwm.c
  stable/12/sys/dev/iwn/if_iwn.c
  stable/12/sys/dev/mwl/if_mwl.c
  stable/12/sys/dev/mwl/if_mwl_pci.c
  stable/12/sys/dev/mwl/mwlreg.h
  stable/12/sys/dev/otus/if_otus.c
  stable/12/sys/dev/otus/if_otusreg.h
  stable/12/sys/dev/rtwn/if_rtwn.c
  stable/12/sys/dev/rtwn/if_rtwn_beacon.c
  stable/12/sys/dev/rtwn/if_rtwn_calib.c
  stable/12/sys/dev/rtwn/if_rtwn_cam.c
  stable/12/sys/dev/rtwn/if_rtwn_efuse.c
  stable/12/sys/dev/rtwn/if_rtwn_fw.c
  stable/12/sys/dev/rtwn/if_rtwn_fw.h
  stable/12/sys/dev/rtwn/if_rtwn_ridx.h
  stable/12/sys/dev/rtwn/if_rtwn_rx.c
  stable/12/sys/dev/rtwn/if_rtwn_rx.h
  stable/12/sys/dev/rtwn/if_rtwn_task.c
  stable/12/sys/dev/rtwn/if_rtwn_tx.c
  stable/12/sys/dev/rtwn/if_rtwnreg.h
  stable/12/sys/dev/rtwn/if_rtwnvar.h
  stable/12/sys/dev/rtwn/pci/rtwn_pci_attach.c
  stable/12/sys/dev/rtwn/pci/rtwn_pci_reg.c
  stable/12/sys/dev/rtwn/pci/rtwn_pci_rx.c
  stable/12/sys/dev/rtwn/pci/rtwn_pci_tx.c
  stable/12/sys/dev/rtwn/pci/rtwn_pci_var.h
  stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee.h
  stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h
  stable/12/sys/dev/rtwn/rtl8188e/r88e.h
  stable/12/sys/dev/rtwn/rtl8188e/r88e_beacon.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_calib.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_chan.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_fw.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_init.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_led.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_priv.h
  stable/12/sys/dev/rtwn/rtl8188e/r88e_reg.h
  stable/12/sys/dev/rtwn/rtl8188e/r88e_rf.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_rx.c
  stable/12/sys/dev/rtwn/rtl8188e/r88e_tx.c
  stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu.h
  stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
  stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce.h
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_priv.h
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_reg.h
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_tx.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c.h
  stable/12/sys/dev/rtwn/rtl8192c/r92c_attach.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_beacon.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_calib.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_chan.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_fw.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_init.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_priv.h
  stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h
  stable/12/sys/dev/rtwn/rtl8192c/r92c_rf.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_rx.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu.h
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_led.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_priv.h
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_reg.h
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h
  stable/12/sys/dev/rtwn/rtl8192e/r92e.h
  stable/12/sys/dev/rtwn/rtl8192e/r92e_chan.c
  stable/12/sys/dev/rtwn/rtl8192e/r92e_priv.h
  stable/12/sys/dev/rtwn/rtl8192e/usb/r92eu.h
  stable/12/sys/dev/rtwn/rtl8812a/r12a.h
  stable/12/sys/dev/rtwn/rtl8812a/r12a_beacon.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_calib.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_caps.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_chan.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_fw.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_fw_cmd.h
  stable/12/sys/dev/rtwn/rtl8812a/r12a_init.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_led.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_priv.h
  stable/12/sys/dev/rtwn/rtl8812a/r12a_reg.h
  stable/12/sys/dev/rtwn/rtl8812a/r12a_rf.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_rom.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_rx.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c
  stable/12/sys/dev/rtwn/rtl8812a/r12a_tx_desc.h
  stable/12/sys/dev/rtwn/rtl8812a/usb/r12au.h
  stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c
  stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_init.c
  stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_rx.c
  stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_tx.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a.h
  stable/12/sys/dev/rtwn/rtl8821a/r21a_beacon.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_calib.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_chan.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_fw.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_init.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_led.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_priv.h
  stable/12/sys/dev/rtwn/rtl8821a/r21a_reg.h
  stable/12/sys/dev/rtwn/rtl8821a/r21a_rom.c
  stable/12/sys/dev/rtwn/rtl8821a/r21a_rx.c
  stable/12/sys/dev/rtwn/rtl8821a/usb/r21au.h
  stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
  stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c
  stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_init.c
  stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.c
  stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h
  stable/12/sys/dev/rtwn/usb/rtwn_usb_ep.c
  stable/12/sys/dev/rtwn/usb/rtwn_usb_reg.c
  stable/12/sys/dev/rtwn/usb/rtwn_usb_tx.c
  stable/12/sys/dev/usb/usbdevs
  stable/12/sys/dev/usb/wlan/if_rsu.c
  stable/12/sys/dev/usb/wlan/if_run.c
  stable/12/sys/dev/usb/wlan/if_runreg.h
  stable/12/sys/dev/usb/wlan/if_runvar.h
  stable/12/sys/dev/usb/wlan/if_zyd.c
  stable/12/sys/dev/wi/if_wavelan_ieee.h
  stable/12/sys/dev/wi/if_wi.c
  stable/12/sys/dev/wi/if_wi_macio.c
  stable/12/sys/dev/wi/if_wi_pccard.c
  stable/12/sys/dev/wi/if_wi_pci.c
  stable/12/sys/dev/wpi/if_wpireg.h
  stable/12/sys/dev/wtap/if_wtap.c
  stable/12/sys/kern/kern_jail.c
  stable/12/sys/net80211/_ieee80211.h
  stable/12/sys/net80211/ieee80211.c
  stable/12/sys/net80211/ieee80211.h
  stable/12/sys/net80211/ieee80211_adhoc.c
  stable/12/sys/net80211/ieee80211_amrr.c
  stable/12/sys/net80211/ieee80211_ddb.c
  stable/12/sys/net80211/ieee80211_freebsd.c
  stable/12/sys/net80211/ieee80211_freebsd.h
  stable/12/sys/net80211/ieee80211_hostap.c
  stable/12/sys/net80211/ieee80211_ht.c
  stable/12/sys/net80211/ieee80211_ht.h
  stable/12/sys/net80211/ieee80211_input.h
  stable/12/sys/net80211/ieee80211_ioctl.c
  stable/12/sys/net80211/ieee80211_ioctl.h
  stable/12/sys/net80211/ieee80211_node.c
  stable/12/sys/net80211/ieee80211_node.h
  stable/12/sys/net80211/ieee80211_output.c
  stable/12/sys/net80211/ieee80211_phy.h
  stable/12/sys/net80211/ieee80211_power.c
  stable/12/sys/net80211/ieee80211_proto.c
  stable/12/sys/net80211/ieee80211_proto.h
  stable/12/sys/net80211/ieee80211_regdomain.c
  stable/12/sys/net80211/ieee80211_scan_sta.c
  stable/12/sys/net80211/ieee80211_scan_sw.c
  stable/12/sys/net80211/ieee80211_sta.c
  stable/12/sys/net80211/ieee80211_sta.h
  stable/12/sys/net80211/ieee80211_var.h
  stable/12/sys/net80211/ieee80211_vht.c
  stable/12/sys/net80211/ieee80211_vht.h
  stable/12/sys/sys/param.h
  stable/12/sys/sys/priv.h
  stable/12/tools/tools/ath/Makefile
  stable/12/tools/tools/ath/ath_ee_9300_print/main.c
  stable/12/tools/tools/ath/athratestats/main.c
  stable/12/tools/tools/net80211/wlanstats/main.c
  stable/12/tools/tools/net80211/wlanstats/wlanstats.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/lib80211/lib80211_regdomain.c
==============================================================================
--- stable/12/lib/lib80211/lib80211_regdomain.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/lib/lib80211/lib80211_regdomain.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -192,7 +192,7 @@ decode_flag(struct mystate *mt, const char *p, int len
 		FLAG(IEEE80211_CHAN_VHT40),
 		FLAG(IEEE80211_CHAN_VHT80),
 		/*
-		 * XXX VHT80_80? This likely should be done by
+		 * XXX VHT80P80? This likely should be done by
 		 * 80MHz chan logic in net80211 / ifconfig.
 		 */
 		FLAG(IEEE80211_CHAN_VHT160),

Modified: stable/12/lib/lib80211/lib80211_regdomain.h
==============================================================================
--- stable/12/lib/lib80211/lib80211_regdomain.h	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/lib/lib80211/lib80211_regdomain.h	Thu Sep 10 19:00:17 2020	(r365608)
@@ -73,10 +73,10 @@ struct regdomain {
 	netband_head	 bands_11b;	/* 11b operation */
 	netband_head	 bands_11g;	/* 11g operation */
 	netband_head	 bands_11a;	/* 11a operation */
-	netband_head	 bands_11ng;/* 11ng operation */
-	netband_head	 bands_11na;/* 11na operation */
-	netband_head	 bands_11ac;/* 11ac 5GHz operation */
-	netband_head	 bands_11acg;/* 11ac 2GHz operation */
+	netband_head	 bands_11ng;	/* 11ng operation */
+	netband_head	 bands_11na;	/* 11na operation */
+	netband_head	 bands_11ac;	/* 11ac 5GHz operation */
+	netband_head	 bands_11acg;	/* 11ac 2GHz operation */
 
 	LIST_ENTRY(regdomain)	next;
 };

Modified: stable/12/lib/lib80211/regdomain.xml
==============================================================================
--- stable/12/lib/lib80211/regdomain.xml	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/lib/lib80211/regdomain.xml	Thu Sep 10 19:00:17 2020	(r365608)
@@ -111,6 +111,44 @@
       <flags>IEEE80211_CHAN_HT40</flags>
     </band>
   </netband>
+  <netband mode="11ac">
+    <band>
+      <freqband ref="AC1_5180_5240_20"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT20</flags>
+      <flags>IEEE80211_CHAN_VHT20</flags>
+    </band>
+    <band>
+      <freqband ref="AC1_5180_5240_40"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT40</flags>
+      <flags>IEEE80211_CHAN_VHT40</flags>
+    </band>
+    <band>
+      <freqband ref="AC1_5180_5240_80"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT40</flags>
+      <flags>IEEE80211_CHAN_VHT80</flags>
+    </band>
+    <band>
+      <freqband ref="AC1_5745_5805_20"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT20</flags>
+      <flags>IEEE80211_CHAN_VHT20</flags>
+    </band>
+    <band>
+      <freqband ref="AC1_5745_5805_40"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT40</flags>
+      <flags>IEEE80211_CHAN_VHT40</flags>
+    </band>
+    <band>
+      <freqband ref="AC1_5745_5805_80"/>
+      <maxpower>17</maxpower>
+      <flags>IEEE80211_CHAN_HT40</flags>
+      <flags>IEEE80211_CHAN_VHT80</flags>
+    </band>
+  </netband>
 </rd>
 
 <!-- FCC3 is FCC w/ DFS on Upper-UNI -->
@@ -1735,6 +1773,21 @@
   <chanwidth>20</chanwidth> <chansep>20</chansep>
   <flags>IEEE80211_CHAN_A</flags>
 </freqband>
+<freqband id="AC1_5180_5240_20">
+  <freqstart>5180</freqstart> <freqend>5240</freqend>
+  <chanwidth>20</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC1_5180_5240_40">
+  <freqstart>5180</freqstart> <freqend>5240</freqend>
+  <chanwidth>40</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC1_5180_5240_80">
+  <freqstart>5180</freqstart> <freqend>5240</freqend>
+  <chanwidth>80</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
 <freqband id="H4_5180_5240">
   <freqstart>5180</freqstart> <freqend>5240</freqend>
   <chanwidth>40</chanwidth> <chansep>20</chansep>
@@ -1823,6 +1876,21 @@
 <freqband id="F1_5745_5805">
   <freqstart>5745</freqstart> <freqend>5805</freqend>
   <chanwidth>20</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC1_5745_5805_20">
+  <freqstart>5745</freqstart> <freqend>5805</freqend>
+  <chanwidth>20</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC1_5745_5805_40">
+  <freqstart>5745</freqstart> <freqend>5805</freqend>
+  <chanwidth>40</chanwidth> <chansep>20</chansep>
+  <flags>IEEE80211_CHAN_A</flags>
+</freqband>
+<freqband id="AC1_5745_5805_80">
+  <freqstart>5745</freqstart> <freqend>5805</freqend>
+  <chanwidth>80</chanwidth> <chansep>20</chansep>
   <flags>IEEE80211_CHAN_A</flags>
 </freqband>
 <freqband id="H4_5745_5805">

Modified: stable/12/sbin/ifconfig/ifieee80211.c
==============================================================================
--- stable/12/sbin/ifconfig/ifieee80211.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sbin/ifconfig/ifieee80211.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -125,8 +125,19 @@
 #define	IEEE80211_NODE_AMSDU_RX	0x040000	/* AMSDU rx enabled */
 #define	IEEE80211_NODE_AMSDU_TX	0x080000	/* AMSDU tx enabled */
 #define	IEEE80211_NODE_VHT	0x100000	/* VHT enabled */
+#define	IEEE80211_NODE_LDPC	0x200000	/* LDPC enabled */
+#define	IEEE80211_NODE_UAPSD	0x400000	/* UAPSD enabled */
 #endif
 
+/* XXX should also figure out where to put these for k/u-space sharing. */
+#ifndef IEEE80211_FVHT_VHT
+#define	IEEE80211_FVHT_VHT	0x000000001	/* CONF: VHT supported */
+#define	IEEE80211_FVHT_USEVHT40	0x000000002	/* CONF: Use VHT40 */
+#define	IEEE80211_FVHT_USEVHT80	0x000000004	/* CONF: Use VHT80 */
+#define	IEEE80211_FVHT_USEVHT160 0x000000008	/* CONF: Use VHT160 */
+#define	IEEE80211_FVHT_USEVHT80P80 0x000000010	/* CONF: Use VHT 80+80 */
+#endif
+
 #define	MAXCHAN	1536		/* max 1.5K channels */
 
 #define	MAXCOL	78
@@ -1804,6 +1815,12 @@ set80211ldpc(const char *val, int d, int s, const stru
         set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL);
 }
 
+static void
+set80211uapsd(const char *val, int d, int s, const struct afswtch *rafp)
+{
+	set80211(s, IEEE80211_IOC_UAPSD, d, 0, NULL);
+}
+
 static
 DECL_CMD_FUNC(set80211ampdulimit, val, d)
 {
@@ -2159,8 +2176,6 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci,
 
 			/*
 			 * VHT first - HT is a subset.
-			 *
-			 * XXX TODO: VHT80p80, VHT160 is not yet done.
 			 */
 			if (flags & IEEE80211_CHAN_VHT) {
 				if ((chanFlags & IEEE80211_CHAN_VHT20) &&
@@ -2184,7 +2199,20 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci,
 						    "VHT80 channel\n", freq);
 					continue;
 				}
-
+				if ((chanFlags & IEEE80211_CHAN_VHT160) &&
+				    (flags & IEEE80211_CHAN_VHT160) == 0) {
+					if (verbose)
+						printf("%u: skip, not a "
+						    "VHT160 channel\n", freq);
+					continue;
+				}
+				if ((chanFlags & IEEE80211_CHAN_VHT80P80) &&
+				    (flags & IEEE80211_CHAN_VHT80P80) == 0) {
+					if (verbose)
+						printf("%u: skip, not a "
+						    "VHT80+80 channel\n", freq);
+					continue;
+				}
 				flags &= ~IEEE80211_CHAN_VHT;
 				flags |= chanFlags & IEEE80211_CHAN_VHT;
 			}
@@ -2370,7 +2398,7 @@ regdomain_makechannels(
 				    &dc->dc_chaninfo);
 			}
 
-			/* XXX TODO: VHT80_80, VHT160 */
+			/* XXX TODO: VHT80P80, VHT160 */
 		}
 
 		if (!LIST_EMPTY(&rd->bands_11ng) && dc->dc_htcaps != 0) {
@@ -2631,6 +2659,10 @@ getflags(int flags)
 		*cp++ = 't';
 	if (flags & IEEE80211_NODE_AMSDU_RX)
 		*cp++ = 'r';
+	if (flags & IEEE80211_NODE_UAPSD)
+		*cp++ = 'U';
+	if (flags & IEEE80211_NODE_LDPC)
+		*cp++ = 'L';
 	*cp = '\0';
 	return flagstring;
 }
@@ -3840,8 +3872,8 @@ list_stations(int s)
 			, "TXSEQ"
 			, "RXSEQ"
 		);
-	else 
-		printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n"
+	else
+		printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n"
 			, "ADDR"
 			, "AID"
 			, "CHAN"
@@ -3875,8 +3907,8 @@ list_stations(int s)
 				, gettxseq(si)
 				, getrxseq(si)
 			);
-		else 
-			printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s"
+		else
+			printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-12.12s"
 				, ether_ntoa((const struct ether_addr*)
 				    si->isi_macaddr)
 				, IEEE80211_AID(si->isi_associd)
@@ -3937,8 +3969,11 @@ get_chaninfo(const struct ieee80211_channel *c, int pr
 	if (IEEE80211_IS_CHAN_TURBO(c))
 		strlcat(buf, " Turbo", bsize);
 	if (precise) {
-		/* XXX should make VHT80U, VHT80D */
-		if (IEEE80211_IS_CHAN_VHT80(c) &&
+		if (IEEE80211_IS_CHAN_VHT80P80(c))
+			strlcat(buf, " vht/80p80", bsize);
+		else if (IEEE80211_IS_CHAN_VHT160(c))
+			strlcat(buf, " vht/160", bsize);
+		else if (IEEE80211_IS_CHAN_VHT80(c) &&
 		    IEEE80211_IS_CHAN_HT40D(c))
 			strlcat(buf, " vht/80-", bsize);
 		else if (IEEE80211_IS_CHAN_VHT80(c) &&
@@ -3992,10 +4027,11 @@ print_chaninfo(const struct ieee80211_channel *c, int 
 static int
 chanpref(const struct ieee80211_channel *c)
 {
+
+	if (IEEE80211_IS_CHAN_VHT80P80(c))
+		return 90;
 	if (IEEE80211_IS_CHAN_VHT160(c))
 		return 80;
-	if (IEEE80211_IS_CHAN_VHT80_80(c))
-		return 75;
 	if (IEEE80211_IS_CHAN_VHT80(c))
 		return 70;
 	if (IEEE80211_IS_CHAN_VHT40(c))
@@ -4767,6 +4803,23 @@ getid(int s, int ix, void *data, size_t len, int *plen
 	return 0;
 }
 
+static int
+getdevicename(int s, void *data, size_t len, int *plen)
+{
+	struct ieee80211req ireq;
+
+	(void) memset(&ireq, 0, sizeof(ireq));
+	(void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name));
+	ireq.i_type = IEEE80211_IOC_IC_NAME;
+	ireq.i_val = -1;
+	ireq.i_data = data;
+	ireq.i_len = len;
+	if (ioctl(s, SIOCG80211, &ireq) < 0)
+		return (-1);
+	*plen = ireq.i_len;
+	return (0);
+}
+
 static void
 ieee80211_status(int s)
 {
@@ -5288,30 +5341,40 @@ end:
 				break;
 			}
 		}
+		if (get80211val(s, IEEE80211_IOC_UAPSD, &val) != -1) {
+			switch (val) {
+			case 0:
+				LINE_CHECK("-uapsd");
+				break;
+			case 1:
+				LINE_CHECK("uapsd");
+				break;
+			}
+		}
 	}
 
 	if (IEEE80211_IS_CHAN_VHT(c) || verbose) {
 		getvhtconf(s);
-		if (vhtconf & 0x1)
+		if (vhtconf & IEEE80211_FVHT_VHT)
 			LINE_CHECK("vht");
 		else
 			LINE_CHECK("-vht");
-		if (vhtconf & 0x2)
+		if (vhtconf & IEEE80211_FVHT_USEVHT40)
 			LINE_CHECK("vht40");
 		else
 			LINE_CHECK("-vht40");
-		if (vhtconf & 0x4)
+		if (vhtconf & IEEE80211_FVHT_USEVHT80)
 			LINE_CHECK("vht80");
 		else
 			LINE_CHECK("-vht80");
-		if (vhtconf & 0x8)
-			LINE_CHECK("vht80p80");
-		else
-			LINE_CHECK("-vht80p80");
-		if (vhtconf & 0x10)
+		if (vhtconf & IEEE80211_FVHT_USEVHT160)
 			LINE_CHECK("vht160");
 		else
 			LINE_CHECK("-vht160");
+		if (vhtconf & IEEE80211_FVHT_USEVHT80P80)
+			LINE_CHECK("vht80p80");
+		else
+			LINE_CHECK("-vht80p80");
 	}
 
 	if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) {
@@ -5481,6 +5544,12 @@ end:
 	}
 
 	LINE_BREAK();
+
+	if (getdevicename(s, data, sizeof(data), &len) < 0)
+		return;
+	LINE_CHECK("parent interface: %s", data);
+
+	LINE_BREAK();
 }
 
 static int
@@ -5872,6 +5941,8 @@ static struct cmd ieee80211_cmds[] = {
 	DEF_CMD("-ldpctx",	-1,	set80211ldpc),
 	DEF_CMD("ldpc",		3,	set80211ldpc),		/* NB: tx+rx */
 	DEF_CMD("-ldpc",	-3,	set80211ldpc),
+	DEF_CMD("uapsd",	1,	set80211uapsd),
+	DEF_CMD("-uapsd",	0,	set80211uapsd),
 	DEF_CMD("puren",	1,	set80211puren),
 	DEF_CMD("-puren",	0,	set80211puren),
 	DEF_CMD("doth",		1,	set80211doth),
@@ -5904,16 +5975,16 @@ static struct cmd ieee80211_cmds[] = {
 	DEF_CMD("-ht40",	0,	set80211htconf),
 	DEF_CMD("ht",		3,	set80211htconf),	/* NB: 20+40 */
 	DEF_CMD("-ht",		0,	set80211htconf),
-	DEF_CMD("vht",		1,	set80211vhtconf),
-	DEF_CMD("-vht",		0,	set80211vhtconf),
-	DEF_CMD("vht40",		2,	set80211vhtconf),
-	DEF_CMD("-vht40",		-2,	set80211vhtconf),
-	DEF_CMD("vht80",		4,	set80211vhtconf),
-	DEF_CMD("-vht80",		-4,	set80211vhtconf),
-	DEF_CMD("vht80p80",		8,	set80211vhtconf),
-	DEF_CMD("-vht80p80",		-8,	set80211vhtconf),
-	DEF_CMD("vht160",		16,	set80211vhtconf),
-	DEF_CMD("-vht160",		-16,	set80211vhtconf),
+	DEF_CMD("vht",		IEEE80211_FVHT_VHT,		set80211vhtconf),
+	DEF_CMD("-vht",		0,				set80211vhtconf),
+	DEF_CMD("vht40",	IEEE80211_FVHT_USEVHT40,	set80211vhtconf),
+	DEF_CMD("-vht40",	-IEEE80211_FVHT_USEVHT40,	set80211vhtconf),
+	DEF_CMD("vht80",	IEEE80211_FVHT_USEVHT80,	set80211vhtconf),
+	DEF_CMD("-vht80",	-IEEE80211_FVHT_USEVHT80,	set80211vhtconf),
+	DEF_CMD("vht160",	IEEE80211_FVHT_USEVHT160,	set80211vhtconf),
+	DEF_CMD("-vht160",	-IEEE80211_FVHT_USEVHT160,	set80211vhtconf),
+	DEF_CMD("vht80p80",	IEEE80211_FVHT_USEVHT80P80,	set80211vhtconf),
+	DEF_CMD("-vht80p80",	-IEEE80211_FVHT_USEVHT80P80,	set80211vhtconf),
 	DEF_CMD("rifs",		1,	set80211rifs),
 	DEF_CMD("-rifs",	0,	set80211rifs),
 	DEF_CMD("smps",		IEEE80211_HTCAP_SMPS_ENA,	set80211smps),

Modified: stable/12/share/man/man4/ath.4
==============================================================================
--- stable/12/share/man/man4/ath.4	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/share/man/man4/ath.4	Thu Sep 10 19:00:17 2020	(r365608)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd April 14, 2014
+.Dd June 16, 2020
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -60,10 +60,10 @@ The
 driver provides support for wireless network adapters based on
 the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs.
 These APIs are used by a wide variety of chips; most all chips with
-a PCI and/or CardBus interface are supported.
+a PCI, PCIe and/or CardBus interface are supported.
 .Pp
 Supported features include 802.11 and 802.3 frames, power management, BSS,
-IBSS, MBSS, TDMA, and host-based access point operation modes.
+IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes.
 All host/device interaction is via DMA.
 .Pp
 Please note that from FreeBSD-9.0, the
@@ -148,12 +148,13 @@ For more information on configuring this device, see
 .Pp
 Devices supported by the
 .Nm
-driver come in either Cardbus or mini-PCI packages.
-Wireless cards in Cardbus slots may be inserted and ejected on the fly.
+driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages.
+Wireless cards in Cardbus and ExpressCard slots may be inserted and
+ejected on the fly.
 .Sh HARDWARE
 The
 .Nm
-driver supports all Atheros Cardbus and PCI cards,
+driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards,
 except those that are based on the AR5005VL chipset.
 .Sh EXAMPLES
 Join a specific BSS network with WEP encryption:
@@ -293,8 +294,7 @@ device driver first appeared in
 Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an
 Intersil PrismGT chip and are not supported by this driver.
 .Sh BUGS
-The driver does not fully enable power-save operation of the chip
-in station mode; consequently power use is suboptimal (e.g. on a laptop).
+The driver does supports optional station mode power-save operation.
 .Pp
 The AR5210 can only do WEP in hardware; consequently hardware assisted WEP
 is disabled in order to allow software implementations of TKIP and CCMP to

Modified: stable/12/share/man/man4/net80211.4
==============================================================================
--- stable/12/share/man/man4/net80211.4	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/share/man/man4/net80211.4	Thu Sep 10 19:00:17 2020	(r365608)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 10, 2009
+.Dd August 7, 2020
 .Dt NET80211 4
 .Os
 .Sh NAME
@@ -393,6 +393,16 @@ Valid values are:
 and
 .Dv IEEE80211_HWMP_ROOTMODE_RANN
 (send broadcast Root Announcement (RANN) frames).
+.It Dv IEEE80211_IOC_IC_NAME
+Return the underlying hardware
+.Xr device 9
+name in the buffer pointed to by
+.Va i_data
+and the name length including terminating NUL character in
+.Va i_len .
+If the buffer length is too small to hold the full name
+.Er EINVAL
+will be returned.
 .It Dv IEEE80211_IOC_INACTIVITY
 Return whether or not the system handles inactivity processing in
 .Va i_val .

Modified: stable/12/share/man/man4/run.4
==============================================================================
--- stable/12/share/man/man4/run.4	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/share/man/man4/run.4	Thu Sep 10 19:00:17 2020	(r365608)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2018
+.Dd June 16, 2020
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -251,5 +251,5 @@ driver was written by
 .Sh CAVEATS
 The
 .Nm
-driver does not support any of the 802.11n capabilities offered by the
+driver supports some of the 11n capabilities found in the
 RT2800, RT3000 and RT3900 chipsets.

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h	Thu Sep 10 19:00:17 2020	(r365608)
@@ -19,18 +19,14 @@
 
 #include "ar9300_freebsd_inc.h"
 
-#define	AH_BIG_ENDIAN		4321
-#define	AH_LITTLE_ENDIAN	1234
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-#define	AH_BYTE_ORDER	AH_BIG_ENDIAN
-#else
-#define	AH_BYTE_ORDER	AH_LITTLE_ENDIAN
-#endif
-
 /* XXX doesn't belong here */
 #define	AR_EEPROM_MODAL_SPURS	5
 
+/* Ensure that AH_BYTE_ORDER is defined */
+#ifndef AH_BYTE_ORDER
+#error AH_BYTE_ORDER needs to be defined!
+#endif
+
 /*
  * (a) this should be N(a),
  * (b) FreeBSD does define nitems,
@@ -43,10 +39,8 @@
 #include "ah_devid.h"
 #include "ar9300eep.h"  /* For Eeprom definitions */
 
-
 #define AR9300_MAGIC    0x19741014
 
-
 /* MAC register values */
 
 #define INIT_CONFIG_STATUS  0x00000000
@@ -1396,7 +1390,7 @@ extern  void ar9300_wowoffload_download_ns_info(struct
 extern  HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode,
         struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask,
         u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing,
-        HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan);
+        HAL_BOOL b_channel_change, HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan);
 extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan,
         HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask);
 extern  HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type);
@@ -1406,7 +1400,7 @@ extern  u_int16_t ar9300_is_single_ant_power_save_poss
 extern  void ar9300_set_operating_mode(struct ath_hal *ah, int opmode);
 extern  HAL_BOOL ar9300_phy_disable(struct ath_hal *ah);
 extern  HAL_BOOL ar9300_disable(struct ath_hal *ah);
-extern  HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *);
+extern  HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *, HAL_RESET_TYPE type);
 extern  HAL_BOOL ar9300_calibration(struct ath_hal *ah,  struct ieee80211_channel *chan,
         u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals);
 extern  void ar9300_reset_cal_valid(struct ath_hal *ah,

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -462,13 +462,55 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd
     u_int level = param;
     u_int is_on;
 
+    HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd=%d, param=%d, chan=%p, funcmask=0x%08x\n",
+      __func__,
+      cmd,
+      param,
+      chan,
+      ahp->ah_ani_function);
+
+
     if (chan == NULL && cmd != HAL_ANI_MODE) {
         HALDEBUG(ah, HAL_DEBUG_UNMASKABLE,
             "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd);
         return AH_FALSE;
     }
 
-    switch (cmd & ahp->ah_ani_function) {
+    /*
+     * These two control the top-level cck/ofdm immunity levels and will
+     * program the rest of the values.
+     */
+    if (cmd == HAL_ANI_NOISE_IMMUNITY_LEVEL) {
+        if (param > HAL_ANI_OFDM_NUM_LEVEL)
+          return AH_FALSE;
+        ar9300_ani_set_odfm_noise_immunity_level(ah, param);
+        return AH_TRUE;
+    }
+
+    if (cmd == HAL_ANI_CCK_NOISE_IMMUNITY_LEVEL) {
+        if (param > HAL_ANI_CCK_NUM_LEVEL)
+          return AH_FALSE;
+        ar9300_ani_set_cck_noise_immunity_level(ah, param);
+        return AH_TRUE;
+    }
+
+    /*
+     * Check to see if this command is available in the
+     * current operating mode.
+     */
+    if (((1 << cmd) & ahp->ah_ani_function) == 0) {
+        HALDEBUG(ah, HAL_DEBUG_ANI,
+            "%s: early check: invalid cmd 0x%02x (allowed=0x%02x)\n",
+            __func__, cmd, ahp->ah_ani_function);
+        return AH_FALSE;
+    }
+
+    /*
+     * The rest of these program in the requested parameter values
+     * into the PHY.
+     */
+    switch (cmd) {
+
     case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: 
         {
             int m1_thresh_low, m2_thresh_low;
@@ -887,13 +929,16 @@ ar9300_ani_reset(struct ath_hal *ah, HAL_BOOL is_scann
     /* only allow a subset of functions in AP mode */
     if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) {
         if (IS_CHAN_2GHZ(ichan)) {
-            ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL |
-                                    HAL_ANI_FIRSTEP_LEVEL |
-                                    HAL_ANI_MRC_CCK);
+            ahp->ah_ani_function = (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL) |
+                                   (1 << HAL_ANI_FIRSTEP_LEVEL) |
+                                   (1 << HAL_ANI_MRC_CCK);
         } else {
             ahp->ah_ani_function = 0;
         }
+    } else {
+      ahp->ah_ani_function = HAL_ANI_ALL;
     }
+
     /* always allow mode (on/off) to be controlled */
     ahp->ah_ani_function |= HAL_ANI_MODE;
 
@@ -1172,6 +1217,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_
     cck_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_2);
 
     /* Populate HAL_ANISTATS */
+    /* XXX TODO: are these correct? */
     if (ani_stats) {
             ani_stats->cckphyerr_cnt =
                cck_phy_err_cnt - ani_state->cck_phy_err_count;
@@ -1212,18 +1258,32 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_
         return;
     }
 
+    /*
+     * Calculate the OFDM/CCK phy error rate over the listen time interval.
+     * This is used in subsequent math to see if the OFDM/CCK phy error rate
+     * is above or below the threshold checks.
+     */
+
     ofdm_phy_err_rate =
         ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time;
     cck_phy_err_rate =
         ani_state->cck_phy_err_count * 1000 / ani_state->listen_time;
 
     HALDEBUG(ah, HAL_DEBUG_ANI,
-        "%s: listen_time=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n",
+        "%s: listen_time=%d (total: %d) OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n",
         __func__, listen_time,
+        ani_state->listen_time,
         ani_state->ofdm_noise_immunity_level, ofdm_phy_err_rate,
         ani_state->cck_noise_immunity_level, cck_phy_err_rate,
         ani_state->ofdms_turn);
 
+    /*
+     * Check for temporary noise spurs.  This is intended to be used by
+     * rate control to check if we should try higher packet rates or not.
+     * If the noise period is short enough then we shouldn't avoid trying
+     * higher rates but if the noise is high/sustained then it's likely
+     * not a great idea to try the higher MCS rates.
+     */
     if (ani_state->listen_time >= HAL_NOISE_DETECT_PERIOD) {
         old_phy_noise_spur = ani_state->phy_noise_spur;
         if (ofdm_phy_err_rate <= ani_state->ofdm_trig_low &&
@@ -1236,7 +1296,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_
         }
         if (old_phy_noise_spur != ani_state->phy_noise_spur) {
             HALDEBUG(ah, HAL_DEBUG_ANI,
-                     "%s: enviroment change from %d to %d\n",
+                     "%s: environment change from %d to %d\n",
                      __func__, old_phy_noise_spur, ani_state->phy_noise_spur);
         }
     }
@@ -1259,6 +1319,10 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_
             ar9300_ani_lower_immunity(ah);
             ani_state->ofdms_turn = !ani_state->ofdms_turn;
         }
+        /*
+         * Force an ANI restart regardless of whether the lower immunity
+         * level was met.
+         */
         HALDEBUG(ah, HAL_DEBUG_ANI,
             "%s: 1 listen_time=%d ofdm=%d/s cck=%d/s - "
             "calling ar9300_ani_restart\n",
@@ -1292,6 +1356,13 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_
             ani_state->ofdms_turn = AH_TRUE;
         }
     }
+
+    /*
+     * Note that currently this poll function doesn't reset the listen
+     * time after it accumulates a second worth of error samples.
+     * It will continue to accumulate samples until a counter overflows,
+     * or a raise threshold is met, or 5 seconds passes.
+     */
 }
 
 /*

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah,
     ahp->reg_dmn = ath_hal_getctl(ah, chan);
 
     /*
+     * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11
+     * MIMO devices employing cyclic delay diversity) and looking at what
+     * ath9k does, let's disable the CDD check until it's clearer exactly
+     * how the maximum cap should be applied here.
+     *
+     * Right now the CDD check is simply unconditionally reducing the
+     * gain of legacy and 1/2 stream rates depending upon the chainmask.
+     * (CDD is used when transmitting rates that don't already use up the
+     * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.)
+     *
+     * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet"
+     * power spectral density requirements but it's not currently taking
+     * into account how close to the regulatory limit the hardware/antenna
+     * system is already at.  It doesn't help that the conductive testing
+     * limits have the array gain at 0dB for all AR9300/derivative
+     * configurations.
+     *
+     * It also doesn't let us do single chain transmit at the full allowed
+     * power for the regulatory/CTL limits as it subtracts it from what's
+     * programmed into the hardware.
+     *
+     * ath9k doesn't factor any of the CDD stuff into account, so I'm going
+     * to disable it here and in the TPC path until I get a better idea
+     * of what to really do here.
+     */
+#if 0
+    /*
      * Always use CDD/direct per rate power table for register based approach.
      * For FCC, CDD calculations should factor in the array gain, hence 
      * this adjust call. ETSI and MKK does not have this requirement.
@@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah,
             __func__);
         ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2);
     }
+#endif
 
     if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) {
         for (i = 0;  i < ar9300_rate_size; i++) {

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -355,7 +355,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah)
 	ah->ah_setRxDP		= ar9300_set_rx_dp;
 	ah->ah_enableReceive	= ar9300_enable_receive;
 	ah->ah_stopDmaReceive	= ar9300_stop_dma_receive_freebsd;
-	ah->ah_startPcuReceive	= ar9300_start_pcu_receive_freebsd;
+	ah->ah_startPcuReceive	= ar9300_start_pcu_receive;
 	ah->ah_stopPcuReceive	= ar9300_stop_pcu_receive;
 	ah->ah_setMulticastFilter	= ar9300_set_multicast_filter;
 	ah->ah_setMulticastFilterIndex = ar9300SetMulticastFilterIndex;
@@ -543,6 +543,7 @@ ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE op
 	    HAL_HT_EXTPROTSPACING_20, /* always 20Mhz channel spacing */
 	    bChannelChange,
 	    status,
+	    resetType,
 	    AH_FALSE);       /* XXX should really extend ath_hal_reset() */
 
 	return (r);
@@ -678,14 +679,6 @@ ar9300_reset_cal_valid_freebsd(struct ath_hal *ah,
 	return (is_cal_done);
 }
 
-
-void
-ar9300_start_pcu_receive_freebsd(struct ath_hal *ah)
-{
-
-	/* is_scanning flag == NULL */
-	ar9300_start_pcu_receive(ah, AH_FALSE);
-}
 
 /*
  * FreeBSD will just pass in the descriptor value as 'pa'.

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -1263,15 +1263,13 @@ ar9300_get_diag_state(struct ath_hal *ah, int request,
         if (ani == AH_NULL)
             return AH_FALSE;
         /* Convert ar9300 HAL to FreeBSD HAL ANI state */
-        /* XXX TODO: add all of these to the HAL ANI state structure */
         bzero(&ahp->ext_ani_state, sizeof(ahp->ext_ani_state));
-        /* XXX should this be OFDM or CCK noise immunity level? */
         ahp->ext_ani_state.noiseImmunityLevel = ani->ofdm_noise_immunity_level;
         ahp->ext_ani_state.spurImmunityLevel = ani->spur_immunity_level;
         ahp->ext_ani_state.firstepLevel = ani->firstep_level;
         ahp->ext_ani_state.ofdmWeakSigDetectOff = ani->ofdm_weak_sig_detect_off;
-        /* mrc_cck_off */
-        /* cck_noise_immunity_level */
+        ahp->ext_ani_state.mrcCck = !! ani->mrc_cck_off;
+        ahp->ext_ani_state.cckNoiseImmunityLevel = ani->cck_noise_immunity_level;
 
         ahp->ext_ani_state.listenTime = ani->listen_time;
 
@@ -1289,12 +1287,18 @@ ar9300_get_diag_state(struct ath_hal *ah, int request,
             0 : sizeof(HAL_ANI_STATS);
         return AH_TRUE;
     case HAL_DIAG_ANI_CMD:
+    {
+        HAL_ANI_CMD savefunc = ahp->ah_ani_function;
         if (argsize != 2*sizeof(u_int32_t)) {
             return AH_FALSE;
         }
+        /* temporarly allow all functions so we can override */
+        ahp->ah_ani_function = HAL_ANI_ALL;
         ar9300_ani_control(
             ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]);
+        ahp->ah_ani_function = savefunc;
         return AH_TRUE;
+    }
 #if 0
     case HAL_DIAG_TXCONT:
         /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc
        const HAL_RATE_TABLE *rt, HAL_BOOL is40,
        int rt_ss_offset, int rt_ds_offset,
        int rt_ts_offset, u_int8_t chainmask);
+#if 0
 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah,
        const HAL_RATE_TABLE *rt, HAL_BOOL is40,
        int rt_ss_offset, int rt_ds_offset,
        int rt_ts_offset, u_int8_t chainmask);
+#endif
 
 #define AR9300_11A_RT_OFDM_OFFSET    0
 HAL_RATE_TABLE ar9300_11a_table = {
@@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, 
            ((int16_t)AH_MIN((ahp->twice_antenna_reduction -
            (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0));
         cdd_power = ahp->upper_limit[1] + twice_array_gain;
+
+        HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power);
         /* Adjust OFDM legacy rates as well */
         for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) {
             if (power_per_rate[i] > cdd_power) {
@@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, 
             ((int16_t)AH_MIN((ahp->twice_antenna_reduction -
             (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0));
         cdd_power = ahp->upper_limit[2] + twice_array_gain;
+        HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power);
         /* Adjust OFDM legacy rates as well */
         for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) {
             if (power_per_rate[i] > cdd_power) {
@@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod
                             AR9300_11NA_RT_HT_SS_OFFSET,
                             AR9300_11NA_RT_HT_DS_OFFSET,
                             AR9300_11NA_RT_HT_TS_OFFSET, chainmask);
+#if 0
         /* For FCC the array gain has to be factored for CDD mode */
         if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) {
             ar9300_adjust_rate_txpower_cdd(ah, rt, is40, 
@@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod
                             AR9300_11NA_RT_HT_DS_OFFSET,
                             AR9300_11NA_RT_HT_TS_OFFSET, chainmask);
         }
+#endif
         break;
     case HAL_MODE_11G:
         ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask);
@@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod
                             AR9300_11NG_RT_HT_SS_OFFSET,
                             AR9300_11NG_RT_HT_DS_OFFSET,
                             AR9300_11NG_RT_HT_TS_OFFSET, chainmask);
+#if 0
         /* For FCC the array gain needs to be factored for CDD mode */
         if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) {
             ar9300_adjust_rate_txpower_cdd(ah, rt, is40, 
@@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod
                             AR9300_11NG_RT_HT_DS_OFFSET,
                             AR9300_11NG_RT_HT_TS_OFFSET, chainmask);
         }
+#endif
         break;
     default:
         HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n",
@@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons
     return;
 }
 
+/*
+ * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003.
+ */
+#if 0
 static inline void
 ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt,
                         HAL_BOOL is40,
@@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con
     return;
 
 }
+#endif
 
 void ar9300_disp_tpc_tables(struct ath_hal *ah)
 {

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -2064,7 +2064,7 @@ ar9300_set_rf_mode(struct ath_hal *ah, struct ieee8021
  * Places the hardware into reset and then pulls it out of reset
  */
 HAL_BOOL
-ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan)
+ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_RESET_TYPE reset_type)
 {
     struct ath_hal_9300     *ahp = AH9300(ah);
     int type = HAL_RESET_WARM;
@@ -2080,8 +2080,13 @@ ar9300_chip_reset(struct ath_hal *ah, struct ieee80211
      */
     if (ahp->ah_chip_full_sleep ||
         (ah->ah_config.ah_force_full_reset == 1) ||
+        (reset_type == HAL_RESET_FORCE_COLD) ||
+        (reset_type == HAL_RESET_BBPANIC) ||
         OS_REG_READ(ah, AR_Q_TXE) ||
         (OS_REG_READ(ah, AR_CR) & AR_CR_RXE)) {
+            HALDEBUG(ah, HAL_DEBUG_RESET,
+              "%s: full reset; reset_type=%d, full_sleep=%d\n",
+              __func__, reset_type, ahp->ah_chip_full_sleep);
             type = HAL_RESET_COLD;
     }
 
@@ -4510,7 +4515,7 @@ HAL_BOOL
 ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan,
     HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask,
     HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change,
-    HAL_STATUS *status, int is_scan)
+    HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan)
 {
 #define FAIL(_code)     do { ecode = _code; goto bad; } while (0)
     u_int32_t               save_led_state;
@@ -4864,7 +4869,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, st
     /* Mark PHY inactive prior to reset, to be undone in ar9300_init_bb () */
     ar9300_mark_phy_inactive(ah);
 
-    if (!ar9300_chip_reset(ah, chan)) {
+    if (!ar9300_chip_reset(ah, chan, reset_type)) {
         HALDEBUG(ah, HAL_DEBUG_RESET, "%s: chip reset failed\n", __func__);
         FAIL(HAL_EIO);
     }

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c	Thu Sep 10 19:00:17 2020	(r365608)
@@ -691,7 +691,7 @@ ar9300_Stub_StopDmaReceive(struct ath_hal *ah)
 }
 
 void
-ar9300_Stub_StartPcuReceive(struct ath_hal *ah)
+ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning)
 {
 
 	ath_hal_printf(ah, "%s: called\n", __func__);

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h	Thu Sep 10 19:00:17 2020	(r365608)
@@ -112,7 +112,7 @@ extern	void ar9300_Stub_SetRxDP(struct ath_hal *ah, ui
 	    HAL_RX_QUEUE);
 extern	void ar9300_Stub_EnableReceive(struct ath_hal *ah);
 extern	HAL_BOOL ar9300_Stub_StopDmaReceive(struct ath_hal *ah);
-extern	void ar9300_Stub_StartPcuReceive(struct ath_hal *ah);
+extern	void ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL);
 extern	void ar9300_Stub_StopPcuReceive(struct ath_hal *ah);
 extern	void ar9300_Stub_SetMulticastFilter(struct ath_hal *ah,
 		uint32_t filter0, uint32_t filter1);

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h	Thu Sep 10 19:00:17 2020	(r365608)
@@ -18,13 +18,17 @@
 #define _ATH_AR9300_EEP_H_
 
 #include "opt_ah.h"
-
 #include "ah.h"
 
 #if defined(WIN32) || defined(WIN64)
 #pragma pack (push, ar9300, 1)
 #endif
 
+/* Ensure that AH_BYTE_ORDER is defined */
+#ifndef AH_BYTE_ORDER
+#error AH_BYTE_ORDER needs to be defined!
+#endif
+
 /* FreeBSD extras - should be in ah_eeprom.h ? */
 #define AR_EEPROM_EEPCAP_COMPRESS_DIS   0x0001
 #define AR_EEPROM_EEPCAP_AES_DIS        0x0002
@@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr {
     u_int8_t  flag  :2,
               t_power :6;
 } __packed CAL_CTL_EDGE_PWR;
-#else
+#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN
 typedef struct CalCtlEdgePwr {
     u_int8_t  t_power :6,
              flag   :2;
 } __packed CAL_CTL_EDGE_PWR;
+#else
+#error AH_BYTE_ORDER undefined!
 #endif
 
 typedef struct ospCalCtlData_5G {

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h	Thu Sep 10 18:41:15 2020	(r365607)
+++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h	Thu Sep 10 19:00:17 2020	(r365608)
@@ -25,6 +25,11 @@
 #ifndef __ar9300templateAP121_h__
 #define __ar9300templateAP121_h__
 
+/* Ensure that AH_BYTE_ORDER is defined */
+#ifndef AH_BYTE_ORDER
+#error AH_BYTE_ORDER needs to be defined!
+#endif
+
 static ar9300_eeprom_t ar9300_template_ap121=
 {
 

Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h
==============================================================================
--- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h	Thu Sep 10 18:41:15 2020	(r365607)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009101900.08AJ0Iql082480>