From 85010783c2cdfe90ae359de3f0e181aeec89ec17 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Thu, 9 May 2019 16:14:15 +0000 Subject: Correctly mask status bits in iwm's ADD_STA command response; remaining bits are used by firmware to return the BAID for a BA session. matches: Dragonfly 74d41163ddac72b0d7ea7b7873d53fe134723a12 Linux 837c4da98481d4e504b2aba077c8528fee1b6d13 ok kevlo mpi jmatthew --- sys/dev/pci/if_iwm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 981936fd3a5..a4e087dbb87 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.240 2019/05/09 16:13:34 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.241 2019/05/09 16:14:14 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -2566,7 +2566,7 @@ iwm_sta_rx_agg(struct iwm_softc *sc, struct ieee80211_node *ni, uint8_t tid, &status); s = splnet(); - if (err == 0 && status == IWM_ADD_STA_SUCCESS) { + if (!err && (status & IWM_ADD_STA_STATUS_MASK) == IWM_ADD_STA_SUCCESS) { if (start) { sc->sc_rx_ba_sessions++; ieee80211_addba_req_accept(ic, ni, tid); @@ -4675,7 +4675,7 @@ iwm_add_sta_cmd(struct iwm_softc *sc, struct iwm_node *in, int update) status = IWM_ADD_STA_SUCCESS; err = iwm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(add_sta_cmd), &add_sta_cmd, &status); - if (err == 0 && status != IWM_ADD_STA_SUCCESS) + if (!err && (status & IWM_ADD_STA_STATUS_MASK) != IWM_ADD_STA_SUCCESS) err = EIO; return err; @@ -4702,7 +4702,7 @@ iwm_add_aux_sta(struct iwm_softc *sc) status = IWM_ADD_STA_SUCCESS; err = iwm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(cmd), &cmd, &status); - if (err == 0 && status != IWM_ADD_STA_SUCCESS) + if (!err && (status & IWM_ADD_STA_STATUS_MASK) != IWM_ADD_STA_SUCCESS) err = EIO; return err; -- cgit v1.2.3