summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-06-22 11:30:01 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-06-22 11:30:01 +0000
commit6a2da0d5345127e2a27f3d36b627a027a7f7d0f9 (patch)
tree85cba1d770c35fdad2b1bdf6f3005af3a1c30f27 /sys
parent44e27ae5140b2a2640c4aab188d84dc77355d59b (diff)
Remove code from iwm(4) which sends DTIM and TSF information to the
firmware based on information from the wireless stack. Letting the firmware deal with these details by itself seems to work better. Fixes association issues with 8260 hardware for me and Bryan Vyhmeister. Also tested by jcs@.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_iwm.c52
1 files changed, 4 insertions, 48 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 062cd748e50..8296bcec95e 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.90 2016/06/22 11:28:27 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.91 2016/06/22 11:30:00 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -5725,58 +5725,14 @@ iwm_mvm_mac_ctxt_cmd_fill_sta(struct iwm_softc *sc, struct iwm_node *in,
struct iwm_mac_data_sta *ctxt_sta, int force_assoc_off)
{
struct ieee80211_node *ni = &in->in_ni;
- unsigned dtim_period, dtim_count;
struct ieee80211com *ic = &sc->sc_ic;
- /* will this work? */
- dtim_period = ic->ic_dtim_period;
- dtim_count = ic->ic_dtim_count;
- DPRINTF(("dtim %d %d\n", dtim_period, dtim_count));
-
- /* We need the dtim_period to set the MAC as associated */
- if (in->in_assoc && dtim_period && !force_assoc_off) {
- uint64_t tsf;
- uint32_t dtim_offs;
-
- /*
- * The DTIM count counts down, so when it is N that means N
- * more beacon intervals happen until the DTIM TBTT. Therefore
- * add this to the current time. If that ends up being in the
- * future, the firmware will handle it.
- *
- * Also note that the system_timestamp (which we get here as
- * "sync_device_ts") and TSF timestamp aren't at exactly the
- * same offset in the frame -- the TSF is at the first symbol
- * of the TSF, the system timestamp is at signal acquisition
- * time. This means there's an offset between them of at most
- * a few hundred microseconds (24 * 8 bits + PLCP time gives
- * 384us in the longest case), this is currently not relevant
- * as the firmware wakes up around 2ms before the TBTT.
- */
- dtim_offs = dtim_count * ni->ni_intval;
- /* convert TU to usecs */
- dtim_offs *= 1024;
-
- /* XXX: byte order? */
- memcpy(&tsf, ni->ni_tstamp, sizeof(tsf));
-
- ctxt_sta->dtim_tsf = htole64(tsf + dtim_offs);
- ctxt_sta->dtim_time = htole64(ni->ni_rstamp + dtim_offs);
-
- DPRINTF(("DTIM TBTT is 0x%llx/0x%x, offset %d\n",
- (long long)le64toh(ctxt_sta->dtim_tsf),
- le32toh(ctxt_sta->dtim_time), dtim_offs));
-
- ctxt_sta->is_assoc = htole32(1);
- } else {
- ctxt_sta->is_assoc = htole32(0);
- }
-
+ ctxt_sta->is_assoc = htole32(0);
ctxt_sta->bi = htole32(ni->ni_intval);
ctxt_sta->bi_reciprocal = htole32(iwm_mvm_reciprocal(ni->ni_intval));
- ctxt_sta->dtim_interval = htole32(ni->ni_intval * dtim_period);
+ ctxt_sta->dtim_interval = htole32(ni->ni_intval * ic->ic_dtim_period);
ctxt_sta->dtim_reciprocal =
- htole32(iwm_mvm_reciprocal(ni->ni_intval * dtim_period));
+ htole32(iwm_mvm_reciprocal(ni->ni_intval * ic->ic_dtim_period));
/* 10 = CONN_MAX_LISTEN_INTERVAL */
ctxt_sta->listen_interval = htole32(10);