|
@@ -222,6 +222,35 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|
|
return errno;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * wlan_hdd_validate_and_override_offchan() - To validate and override offchan
|
|
|
+ * @adapter: hdd adapter of vdev
|
|
|
+ * @chan: channel info of mgmt to be sent
|
|
|
+ * @offchan: off channel flag to check and override
|
|
|
+ *
|
|
|
+ * This function is to validate the channel info against adapter current state
|
|
|
+ * and home channel, if off channel not needed, override offchan flag.
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static void
|
|
|
+wlan_hdd_validate_and_override_offchan(struct hdd_adapter *adapter,
|
|
|
+ struct ieee80211_channel *chan,
|
|
|
+ bool *offchan)
|
|
|
+{
|
|
|
+ uint8_t home_ch;
|
|
|
+
|
|
|
+ if (!offchan || !chan || !(*offchan))
|
|
|
+ return;
|
|
|
+
|
|
|
+ home_ch = hdd_get_adapter_home_channel(adapter);
|
|
|
+
|
|
|
+ if (ieee80211_frequency_to_channel(chan->center_freq) == home_ch) {
|
|
|
+ hdd_debug("override offchan to 0 at home channel %d", home_ch);
|
|
|
+ *offchan = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|
|
struct ieee80211_channel *chan, bool offchan,
|
|
|
unsigned int wait,
|
|
@@ -278,6 +307,14 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ hdd_debug("device_mode:%d type:%d sub_type:%d chan:%d",
|
|
|
+ adapter->device_mode, type, sub_type,
|
|
|
+ chan ? chan->center_freq : 0);
|
|
|
+ hdd_debug("wait:%d offchan:%d do_not_wait_ack:%d",
|
|
|
+ wait, offchan, dont_wait_for_ack);
|
|
|
+
|
|
|
+ wlan_hdd_validate_and_override_offchan(adapter, chan, &offchan);
|
|
|
+
|
|
|
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_OS_IF,
|
|
|
TRACE_CODE_HDD_SEND_MGMT_TX,
|
|
|
wlan_vdev_get_id(adapter->vdev), 0);
|