diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-09-21 13:29:12 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-09-21 13:29:12 +0000 |
commit | 28147bb22f2713fdb412e3434641dd71fe6f8039 (patch) | |
tree | 20a6c85d7e94e03e8e8644cb730aac21c41dc5f0 /sys/dev/pci/if_iwm.c | |
parent | d94ddfde701b98f4d1d14f60b3c018e261733f4b (diff) |
Make iwm return EBUSY from its ic_ampdu_rx_start() handler and
call the functions provided by the wireless stack to accept or
refuse BA agreements depending on the status returned by firmware.
ok sthen@
Diffstat (limited to 'sys/dev/pci/if_iwm.c')
-rw-r--r-- | sys/dev/pci/if_iwm.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index f0a9e1cd743..cfa244ac24c 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.135 2016/09/21 13:22:40 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.136 2016/09/21 13:29:11 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -2379,13 +2379,16 @@ void iwm_sta_rx_agg(struct iwm_softc *sc, struct ieee80211_node *ni, uint8_t tid, uint16_t ssn, int start) { + struct ieee80211com *ic = &sc->sc_ic; struct iwm_add_sta_cmd_v7 cmd; struct iwm_node *in = (void *)ni; int err, s; uint32_t status; - if (start && sc->sc_rx_ba_sessions >= IWM_MAX_RX_BA_SESSIONS) + if (start && sc->sc_rx_ba_sessions >= IWM_MAX_RX_BA_SESSIONS) { + ieee80211_addba_req_refuse(ic, ni, tid); return; + } memset(&cmd, 0, sizeof(cmd)); @@ -2406,17 +2409,18 @@ iwm_sta_rx_agg(struct iwm_softc *sc, struct ieee80211_node *ni, uint8_t tid, status = IWM_ADD_STA_SUCCESS; err = iwm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(cmd), &cmd, &status); - if (err) - return; - if (status == IWM_ADD_STA_SUCCESS) { - s = splnet(); - if (start) + s = splnet(); + if (err == 0 && status == IWM_ADD_STA_SUCCESS) { + if (start) { sc->sc_rx_ba_sessions++; - else if (sc->sc_rx_ba_sessions > 0) + ieee80211_addba_req_accept(ic, ni, tid); + } else if (sc->sc_rx_ba_sessions > 0) sc->sc_rx_ba_sessions--; - splx(s); - } + } else if (start) + ieee80211_addba_req_refuse(ic, ni, tid); + + splx(s); } void @@ -2479,7 +2483,7 @@ iwm_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, sc->ba_ssn = htole16(ba->ba_winstart); task_add(systq, &sc->ba_task); - return 0; /* XXX firmware may still fail to add BA agreement... */ + return EBUSY; } /* |