summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2019-11-04 13:05:23 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2019-11-04 13:05:23 +0000
commitbf185f28b3caa1102744c930fc9f84da95f701fb (patch)
treebe7f28c828269e7cdbc1452673f961e2b348bf29 /sys/dev
parentfe3965000442e67fa80008ea55edd36f94e27550 (diff)
Make iwm send the DQA command later, as Linux does. We were sending it to
the init firmware which does not need it. The main runtime firmware needs it. This actually enables DQA mode, and two further problems showed up: 1) Correctly configure the AUX station queue in the DQA case. 2) Always transmit our own frames via the AP's station. The AUX station is meant to be used for firmware-generated frames only. Tested on 7260, 7265, and 8265 with standard -current firmware images. Required for newer firmware versions. ok patrick@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_iwm.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index c5267bef3ae..63324a7c386 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.274 2019/11/04 12:20:40 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.275 2019/11/04 13:05:22 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -3372,12 +3372,6 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm)
return 0;
}
- if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DQA_SUPPORT)) {
- err = iwm_send_dqa_cmd(sc);
- if (err)
- return err;
- }
-
err = iwm_sf_config(sc, IWM_SF_INIT_OFF);
if (err)
return err;
@@ -4402,11 +4396,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
(ic->ic_flags & IEEE80211_F_USEPROT)))
flags |= IWM_TX_CMD_FLG_PROT_REQUIRE;
- if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
- type != IEEE80211_FC0_TYPE_DATA)
- tx->sta_id = IWM_AUX_STA_ID;
- else
- tx->sta_id = IWM_STATION_ID;
+ tx->sta_id = IWM_STATION_ID;
if (type == IEEE80211_FC0_TYPE_MGT) {
uint8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
@@ -4786,10 +4776,17 @@ int
iwm_add_aux_sta(struct iwm_softc *sc)
{
struct iwm_add_sta_cmd_v7 cmd;
- int err;
+ int err, qid;
uint32_t status;
- err = iwm_enable_ac_txq(sc, IWM_AUX_QUEUE, IWM_TX_FIFO_MCAST);
+ if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DQA_SUPPORT)) {
+ qid = IWM_DQA_AUX_QUEUE;
+ err = iwm_enable_txq(sc, IWM_AUX_STA_ID, qid,
+ IWM_TX_FIFO_MCAST);
+ } else {
+ qid = IWM_AUX_QUEUE;
+ err = iwm_enable_ac_txq(sc, qid, IWM_TX_FIFO_MCAST);
+ }
if (err)
return err;
@@ -4797,7 +4794,7 @@ iwm_add_aux_sta(struct iwm_softc *sc)
cmd.sta_id = IWM_AUX_STA_ID;
cmd.mac_id_n_color =
htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_MAC_INDEX_AUX, 0));
- cmd.tfd_queue_msk = htole32(1 << IWM_AUX_QUEUE);
+ cmd.tfd_queue_msk = htole32(1 << qid);
cmd.tid_disable_tx = htole16(0xffff);
status = IWM_ADD_STA_SUCCESS;
@@ -6730,6 +6727,12 @@ iwm_init_hw(struct iwm_softc *sc)
return err;
}
+ if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DQA_SUPPORT)) {
+ err = iwm_send_dqa_cmd(sc);
+ if (err)
+ return err;
+ }
+
/* Add auxiliary station for scanning */
err = iwm_add_aux_sta(sc);
if (err) {