qcacld-3.0: Add error handling support while sending roam invoke cmd to fw

Fix is to allow driver to send roam invoke command to firmware only when
roaming is allowed by both driver as well as supplicant for current vdev.

Change-Id: I76331c7c73672dd4c73b2cfaaba1e5c01652b982
CRs-Fixed: 2277523
This commit is contained in:
Abhinav Kumar 2018-07-13 11:48:43 +05:30 committed by nshrivas
parent 91e834de48
commit eab259362d
3 changed files with 36 additions and 11 deletions

View File

@ -359,8 +359,9 @@ void hdd_delete_peer(struct hdd_station_ctx *sta_ctx, uint8_t sta_id);
QDF_STATUS hdd_roam_deregister_sta(struct hdd_adapter *adapter, uint8_t sta_id);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
void hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid, int channel);
QDF_STATUS
hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid, int channel);
/**
* hdd_save_gtk_params() - Save GTK offload params
* @adapter: HDD adapter
@ -372,9 +373,11 @@ void hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
void hdd_save_gtk_params(struct hdd_adapter *adapter,
struct csr_roam_info *csr_roam_info, bool is_reassoc);
#else
static inline void hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid, int channel)
static inline QDF_STATUS
hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid, int channel)
{
return QDF_STATUS_SUCCESS;
}
static inline void hdd_save_gtk_params(struct hdd_adapter *adapter,
struct csr_roam_info *csr_roam_info,

View File

@ -793,8 +793,9 @@ static int hdd_parse_reassoc_command_v1_data(const uint8_t *pValue,
}
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
void hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid, int channel)
QDF_STATUS hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
const tSirMacAddr bssid,
int channel)
{
struct hdd_station_ctx *hdd_sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
@ -804,9 +805,9 @@ void hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
roam_profile = hdd_roam_profile(adapter);
qdf_mem_copy(connected_bssid, hdd_sta_ctx->conn_info.bssId.bytes,
ETH_ALEN);
sme_fast_reassoc(adapter->hdd_ctx->mac_handle, roam_profile,
bssid, channel, adapter->session_id,
connected_bssid);
return sme_fast_reassoc(adapter->hdd_ctx->mac_handle,
roam_profile, bssid, channel,
adapter->session_id, connected_bssid);
}
#endif
@ -827,6 +828,7 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
struct hdd_station_ctx *sta_ctx;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
int ret = 0;
QDF_STATUS status;
if (hdd_ctx == NULL) {
hdd_err("Invalid hdd ctx");
@ -869,8 +871,12 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
/* Proceed with reassoc */
if (roaming_offload_enabled(hdd_ctx)) {
hdd_wma_send_fastreassoc_cmd(adapter,
bssid, (int)channel);
status = hdd_wma_send_fastreassoc_cmd(adapter,
bssid, (int)channel);
if (status != QDF_STATUS_SUCCESS) {
hdd_err("Failed to send fast reassoc cmd");
ret = -EINVAL;
}
} else {
tCsrHandoffRequest handoff;

View File

@ -15008,7 +15008,23 @@ QDF_STATUS sme_fast_reassoc(tHalHandle hal, struct csr_roam_profile *profile,
struct wma_roam_invoke_cmd *fastreassoc;
struct scheduler_msg msg = {0};
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
struct csr_roam_session *session;
struct csr_roam_profile *roam_profile;
session = CSR_GET_SESSION(mac_ctx, vdev_id);
if (!session || !session->pCurRoamProfile) {
sme_err("session %d not found", vdev_id);
return QDF_STATUS_E_FAILURE;
}
roam_profile = session->pCurRoamProfile;
if (roam_profile->supplicant_disabled_roaming ||
roam_profile->driver_disabled_roaming) {
sme_debug("roaming status in Supplicant %d and in driver %d",
roam_profile->supplicant_disabled_roaming,
roam_profile->driver_disabled_roaming);
return QDF_STATUS_E_FAILURE;
}
fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc));
if (NULL == fastreassoc) {
sme_err("qdf_mem_malloc failed for fastreassoc");