|
@@ -19309,20 +19309,18 @@ disconnected:
|
|
|
* wlan_hdd_reassoc_bssid_hint() - Start reassociation if bssid is present
|
|
|
* @adapter: Pointer to the HDD adapter
|
|
|
* @req: Pointer to the structure cfg_connect_params receieved from user space
|
|
|
- * @status: out variable for status of reassoc request
|
|
|
*
|
|
|
* This function will start reassociation if prev_bssid is set and bssid/
|
|
|
* bssid_hint, channel/channel_hint parameters are present in connect request.
|
|
|
*
|
|
|
- * Return: true if connect was for ReAssociation, false otherwise
|
|
|
+ * Return: 0 if connect was for ReAssociation, non-zero error code otherwise
|
|
|
*/
|
|
|
#if defined(CFG80211_CONNECT_PREV_BSSID) || \
|
|
|
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
|
|
|
-static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
- struct cfg80211_connect_params *req,
|
|
|
- int *status)
|
|
|
+static int wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
- bool reassoc = false;
|
|
|
+ int status = -EINVAL;
|
|
|
const uint8_t *bssid = NULL;
|
|
|
uint16_t channel = 0;
|
|
|
struct hdd_station_ctx *sta_ctx;
|
|
@@ -19338,7 +19336,6 @@ static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
channel = req->channel_hint->hw_value;
|
|
|
|
|
|
if (bssid && channel && req->prev_bssid) {
|
|
|
- reassoc = true;
|
|
|
hdd_debug("REASSOC Attempt on channel %d to " MAC_ADDRESS_STR,
|
|
|
channel, MAC_ADDR_ARRAY(bssid));
|
|
|
/*
|
|
@@ -19351,18 +19348,17 @@ static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
qdf_mem_copy(sta_ctx->requested_bssid.bytes, bssid,
|
|
|
QDF_MAC_ADDR_SIZE);
|
|
|
|
|
|
- *status = hdd_reassoc(adapter, bssid, channel,
|
|
|
+ status = hdd_reassoc(adapter, bssid, channel,
|
|
|
CONNECT_CMD_USERSPACE);
|
|
|
- hdd_debug("hdd_reassoc: status: %d", *status);
|
|
|
+ hdd_debug("hdd_reassoc: status: %d", status);
|
|
|
}
|
|
|
- return reassoc;
|
|
|
+ return status;
|
|
|
}
|
|
|
#else
|
|
|
-static bool wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
- struct cfg80211_connect_params *req,
|
|
|
- int *status)
|
|
|
+static int wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
|
|
|
+ struct cfg80211_connect_params *req)
|
|
|
{
|
|
|
- return false;
|
|
|
+ return -ENOTSUPP;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -19488,7 +19484,11 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- if (true == wlan_hdd_reassoc_bssid_hint(adapter, req, &status))
|
|
|
+ /*
|
|
|
+ * Check if this is reassoc to same bssid, if reassoc is success, return
|
|
|
+ */
|
|
|
+ status = wlan_hdd_reassoc_bssid_hint(adapter, req);
|
|
|
+ if (!status)
|
|
|
return status;
|
|
|
|
|
|
/* Try disconnecting if already in connected state */
|