From: Oleksij Rempel Date: Sat, 26 Nov 2016 12:18:42 +0000 (+0100) Subject: af_ath: don't use trash to configure interrupts X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=83dd3bf0aae9da59ecb39852500f5e25adddef27;p=open-ath9k-htc-firmware.git af_ath: don't use trash to configure interrupts The WMI_ENABLE_INTR_CMDID can some time send empty package to set interrupt to default value. The problem is that ath_enable_intr_tgt is testing the data pointer instead of dataleng variable. We have never data == NULL case, even on zero size package. (which is probably a bug too) As result, FW was using some part of memory with undefined value to configure interrupts. In most cases it was enabling SWBA interrupt even if driver was trying to disable it. In my tests, this issue was not really affecting STA or AP mode. The only measurable difference i got on AP+STA mode. In this case the FW was sending SWBA event to host at the channel switch in the bgscan. Possible effects of this issue: - slow bgscan. EP3/EP4 have perfomance issue, extra traffic on will make is slower. - spreading our AP beacons on other channels. - more ??? Signed-off-by: Oleksij Rempel --- diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index d762989..b31fbdb 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1098,9 +1098,9 @@ static void ath_enable_intr_tgt(void *Context, A_UINT16 Command, { struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context; struct ath_hal *ah = sc->sc_ah; - a_uint32_t intr; + a_uint32_t intr = 0; - if (data) + if (datalen == 4) intr = (*(a_uint32_t *)data); intr = adf_os_ntohl(intr);