OSDN Git Service

qtnfmac: do not report channel changes until wiphy is registered
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Thu, 21 Sep 2017 21:34:37 +0000 (14:34 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 25 Sep 2017 08:27:18 +0000 (11:27 +0300)
Wireless device may send "channel changed" event before driver
registered this device with wireless core, which will result in
warnings.
Once device is registered, higher layer will query channel info
manually using .get_channel callback.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/event.c

index b1acc24..7481d5b 100644 (file)
@@ -368,6 +368,9 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
                return -EINVAL;
        }
 
+       if (!wiphy->registered)
+               return 0;
+
        qlink_chandef_q2cfg(wiphy, &data->chan, &chandef);
 
        if (!cfg80211_chandef_valid(&chandef)) {