|
@@ -6207,196 +6207,6 @@ static int iw_get_nick(struct net_device *dev,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * __iw_set_encode() - SIOCSIWENCODE ioctl handler
|
|
|
- * @dev: device upon which the ioctl was received
|
|
|
- * @info: ioctl request information
|
|
|
- * @wrqu: ioctl request data
|
|
|
- * @extra: ioctl extra data
|
|
|
- *
|
|
|
- * Return: 0 on success, non-zero on error
|
|
|
- */
|
|
|
-static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info,
|
|
|
- union iwreq_data *wrqu, char *extra)
|
|
|
-{
|
|
|
- struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
- struct hdd_station_ctx *sta_ctx =
|
|
|
- WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
|
|
- struct hdd_wext_state *pWextState =
|
|
|
- WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
|
|
|
- struct hdd_context *hdd_ctx;
|
|
|
- struct iw_point *encoderq = &(wrqu->encoding);
|
|
|
- uint32_t keyId;
|
|
|
- uint8_t key_length;
|
|
|
- eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE;
|
|
|
- bool fKeyPresent = 0;
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
- int ret;
|
|
|
-
|
|
|
- ENTER_DEV(dev);
|
|
|
-
|
|
|
- hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
- ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (0 != ret)
|
|
|
- return ret;
|
|
|
-
|
|
|
- ret = hdd_check_standard_wext_control(hdd_ctx, info);
|
|
|
- if (0 != ret)
|
|
|
- return ret;
|
|
|
-
|
|
|
- keyId = encoderq->flags & IW_ENCODE_INDEX;
|
|
|
-
|
|
|
- if (keyId) {
|
|
|
- if (keyId > MAX_WEP_KEYS)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- fKeyPresent = 1;
|
|
|
- keyId--;
|
|
|
- } else {
|
|
|
- fKeyPresent = 0;
|
|
|
- }
|
|
|
-
|
|
|
- if (wrqu->data.flags & IW_ENCODE_DISABLED) {
|
|
|
- hdd_debug("****iwconfig wlan0 key off*****");
|
|
|
- if (!fKeyPresent) {
|
|
|
- qdf_mem_zero(pWextState->roamProfile.Keys.KeyLength,
|
|
|
- CSR_MAX_NUM_KEY);
|
|
|
- }
|
|
|
- sta_ctx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
|
|
|
- sta_ctx->wpa_versions = 0;
|
|
|
- pWextState->roamProfile.EncryptionType.encryptionType[0] =
|
|
|
- eCSR_ENCRYPT_TYPE_NONE;
|
|
|
- pWextState->roamProfile.mcEncryptionType.encryptionType[0] =
|
|
|
- eCSR_ENCRYPT_TYPE_NONE;
|
|
|
-
|
|
|
- sta_ctx->conn_info.ucEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
|
|
|
- sta_ctx->conn_info.mcEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
|
|
|
-
|
|
|
- if (eConnectionState_Associated ==
|
|
|
- sta_ctx->conn_info.connState) {
|
|
|
- INIT_COMPLETION(adapter->disconnect_comp_var);
|
|
|
- status =
|
|
|
- sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(adapter),
|
|
|
- adapter->sessionId,
|
|
|
- eCSR_DISCONNECT_REASON_UNSPECIFIED);
|
|
|
- if (QDF_STATUS_SUCCESS == status) {
|
|
|
- unsigned long rc;
|
|
|
-
|
|
|
- rc = wait_for_completion_timeout(&adapter->
|
|
|
- disconnect_comp_var,
|
|
|
- msecs_to_jiffies
|
|
|
- (WLAN_WAIT_TIME_DISCONNECT));
|
|
|
- if (!rc)
|
|
|
- hdd_err("disconnect_comp_var failed");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return status;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (wrqu->data.flags & (IW_ENCODE_OPEN | IW_ENCODE_RESTRICTED)) {
|
|
|
- hdd_debug("iwconfig wlan0 key on");
|
|
|
-
|
|
|
- sta_ctx->conn_info.authType =
|
|
|
- (encoderq->flags & IW_ENCODE_RESTRICTED) ?
|
|
|
- eCSR_AUTH_TYPE_SHARED_KEY :
|
|
|
- eCSR_AUTH_TYPE_OPEN_SYSTEM;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (wrqu->data.length > 0) {
|
|
|
- hdd_debug("wrqu->data.length : %d", wrqu->data.length);
|
|
|
-
|
|
|
- key_length = wrqu->data.length;
|
|
|
-
|
|
|
- /* IW_ENCODING_TOKEN_MAX is the value that is set
|
|
|
- * for wrqu->data.length by iwconfig.c
|
|
|
- * when 'iwconfig wlan0 key on' is issued.
|
|
|
- */
|
|
|
-
|
|
|
- if (5 == key_length) {
|
|
|
- hdd_debug("Call with WEP40,key_len=%d",
|
|
|
- key_length);
|
|
|
-
|
|
|
- if ((IW_AUTH_KEY_MGMT_802_1X == pWextState->authKeyMgmt)
|
|
|
- && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
|
|
|
- sta_ctx->conn_info.authType)) {
|
|
|
- encryptionType = eCSR_ENCRYPT_TYPE_WEP40;
|
|
|
- } else {
|
|
|
- encryptionType =
|
|
|
- eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
|
|
|
- }
|
|
|
- } else if (13 == key_length) {
|
|
|
- hdd_debug("Call with WEP104,key_len:%d",
|
|
|
- key_length);
|
|
|
-
|
|
|
- if ((IW_AUTH_KEY_MGMT_802_1X == pWextState->authKeyMgmt)
|
|
|
- && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
|
|
|
- sta_ctx->conn_info.authType)) {
|
|
|
- encryptionType = eCSR_ENCRYPT_TYPE_WEP104;
|
|
|
- } else {
|
|
|
- encryptionType =
|
|
|
- eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
|
|
|
- }
|
|
|
- } else {
|
|
|
- hdd_err("Invalid WEP key length :%d", key_length);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- sta_ctx->conn_info.ucEncryptionType = encryptionType;
|
|
|
- sta_ctx->conn_info.mcEncryptionType = encryptionType;
|
|
|
- pWextState->roamProfile.EncryptionType.numEntries = 1;
|
|
|
- pWextState->roamProfile.EncryptionType.encryptionType[0] =
|
|
|
- encryptionType;
|
|
|
- pWextState->roamProfile.mcEncryptionType.numEntries = 1;
|
|
|
- pWextState->roamProfile.mcEncryptionType.encryptionType[0] =
|
|
|
- encryptionType;
|
|
|
-
|
|
|
- if ((eConnectionState_NotConnected ==
|
|
|
- sta_ctx->conn_info.connState)
|
|
|
- &&
|
|
|
- ((eCSR_AUTH_TYPE_OPEN_SYSTEM ==
|
|
|
- sta_ctx->conn_info.authType)
|
|
|
- || (eCSR_AUTH_TYPE_SHARED_KEY ==
|
|
|
- sta_ctx->conn_info.authType))) {
|
|
|
-
|
|
|
- qdf_mem_copy(&pWextState->roamProfile.Keys.
|
|
|
- KeyMaterial[keyId][0], extra, key_length);
|
|
|
-
|
|
|
- pWextState->roamProfile.Keys.KeyLength[keyId] =
|
|
|
- (uint8_t) key_length;
|
|
|
- pWextState->roamProfile.Keys.defaultIndex =
|
|
|
- (uint8_t) keyId;
|
|
|
-
|
|
|
- return status;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * iw_set_encode() - SSR wrapper for __iw_set_encode()
|
|
|
- * @dev: pointer to net_device
|
|
|
- * @info: pointer to iw_request_info
|
|
|
- * @wrqu: pointer to iwreq_data
|
|
|
- * @extra: pointer to extra ioctl payload
|
|
|
- *
|
|
|
- * Return: 0 on success, error number otherwise
|
|
|
- */
|
|
|
-static int iw_set_encode(struct net_device *dev, struct iw_request_info *info,
|
|
|
- union iwreq_data *wrqu, char *extra)
|
|
|
-{
|
|
|
- int ret;
|
|
|
-
|
|
|
- cds_ssr_protect(__func__);
|
|
|
- ret = __iw_set_encode(dev, info, wrqu, extra);
|
|
|
- cds_ssr_unprotect(__func__);
|
|
|
-
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* __iw_set_retry() - SIOCSIWRETRY ioctl handler
|
|
|
* @dev: device upon which the ioctl was received
|
|
@@ -12415,7 +12225,7 @@ static const iw_handler we_handler[] = {
|
|
|
(iw_handler) iw_get_tx_power, /* SIOCGIWTXPOW */
|
|
|
(iw_handler) iw_set_retry, /* SIOCSIWRETRY */
|
|
|
(iw_handler) iw_get_retry, /* SIOCGIWRETRY */
|
|
|
- (iw_handler) iw_set_encode, /* SIOCSIWENCODE */
|
|
|
+ (iw_handler) NULL, /* SIOCSIWENCODE */
|
|
|
(iw_handler) NULL, /* SIOCGIWENCODE */
|
|
|
(iw_handler) NULL, /* SIOCSIWPOWER */
|
|
|
(iw_handler) NULL, /* SIOCGIWPOWER */
|