qcacmn: Fix return type of auth type and akm

Currently api osif_nl_to_crypto_auth_type is trying to convert
the nl specific auth types to driver specific auth types but
it does not return the correct value, this api always returns
auth type as none as it never updates the return value after
the initialization.

While parsing WPA and WAPI, open authmode and cipher and akm are
set as none by default.

Thus return converted value of the auth type. Also fix the
return type of the akm conversion. Also avoid setting
open authmode and cipher and akm as none while parsing WPA
and WAPI ie.

Change-Id: I260e58a28ddbf6b20a290488e205586a624c9b46
CRs-Fixed: 2725323
This commit is contained in:
Ashish Kumar Dhanotiya
2020-07-03 20:17:41 +05:30
committed by nshrivas
parent 1fe461c320
commit eba983ed1e
3 changed files with 17 additions and 22 deletions

View File

@@ -276,7 +276,8 @@ static const struct osif_cipher_crypto_mapping
#endif
};
int osif_nl_to_crypto_auth_type(enum nl80211_auth_type auth_type)
wlan_crypto_auth_mode
osif_nl_to_crypto_auth_type(enum nl80211_auth_type auth_type)
{
wlan_crypto_auth_mode crypto_auth_type = WLAN_CRYPTO_AUTH_NONE;
@@ -284,15 +285,17 @@ int osif_nl_to_crypto_auth_type(enum nl80211_auth_type auth_type)
auth_type >= QDF_ARRAY_SIZE(osif_auth_type_crypto_mapping)) {
QDF_TRACE_ERROR(QDF_MODULE_ID_OS_IF, "Unknown type: %d",
auth_type);
return -EINVAL;
return crypto_auth_type;
}
crypto_auth_type = osif_auth_type_crypto_mapping[auth_type];
QDF_TRACE_DEBUG(QDF_MODULE_ID_OS_IF, "Auth type, NL: %d, crypto: %d",
auth_type, osif_auth_type_crypto_mapping[auth_type]);
auth_type, crypto_auth_type);
return crypto_auth_type;
}
int osif_nl_to_crypto_akm_type(u32 key_mgmt)
wlan_crypto_key_mgmt osif_nl_to_crypto_akm_type(u32 key_mgmt)
{
uint8_t index;
wlan_crypto_key_mgmt crypto_akm_type = WLAN_CRYPTO_KEY_MGMT_NONE;
@@ -307,13 +310,12 @@ int osif_nl_to_crypto_akm_type(u32 key_mgmt)
break;
}
}
if (!akm_type_crypto_exist) {
if (!akm_type_crypto_exist)
QDF_TRACE_ERROR(QDF_MODULE_ID_OS_IF, "Unknown type: %d",
key_mgmt);
return -EINVAL;
}
QDF_TRACE_DEBUG(QDF_MODULE_ID_OS_IF, "Akm suite, NL: %d, crypto: %d",
key_mgmt, crypto_akm_type);
else
QDF_TRACE_DEBUG(QDF_MODULE_ID_OS_IF, "Akm suite, NL: %d, crypto: %d",
key_mgmt, crypto_akm_type);
return crypto_akm_type;
}