diff options
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/dot11d.h | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 126 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 16 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib.h | 54 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_rx.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 389 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_wx.c | 2 |
9 files changed, 9 insertions, 591 deletions
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h index 623075cf0c05..7fa3c4d963c4 100644 --- a/drivers/staging/rtl8192e/dot11d.h +++ b/drivers/staging/rtl8192e/dot11d.h @@ -30,8 +30,8 @@ enum dot11d_state { }; /** - * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if @CountryIeBuf contains - * valid country information element. + * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if + * @CountryIeBuf contains valid country information element. * @channel_map: holds channel values * 0 - invalid, * 1 - valid (active scan), diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index a4d1bac4a844..aca52654825b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2275,131 +2275,6 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac) return 0; } -/* based on ipw2200 driver */ -static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct iwreq *wrq = (struct iwreq *)rq; - int ret = -1; - struct rtllib_device *ieee = priv->rtllib; - u32 key[4]; - const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - struct iw_point *p = &wrq->u.data; - struct ieee_param *ipw = NULL; - - mutex_lock(&priv->wx_mutex); - - switch (cmd) { - case RTL_IOCTL_WPA_SUPPLICANT: - if (p->length < sizeof(struct ieee_param) || !p->pointer) { - ret = -EINVAL; - goto out; - } - - ipw = memdup_user(p->pointer, p->length); - if (IS_ERR(ipw)) { - ret = PTR_ERR(ipw); - goto out; - } - - if (ipw->cmd == IEEE_CMD_SET_ENCRYPTION) { - if (ipw->u.crypt.set_tx) { - if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) - ieee->pairwise_key_type = KEY_TYPE_CCMP; - else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) - ieee->pairwise_key_type = KEY_TYPE_TKIP; - else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) { - if (ipw->u.crypt.key_len == 13) - ieee->pairwise_key_type = - KEY_TYPE_WEP104; - else if (ipw->u.crypt.key_len == 5) - ieee->pairwise_key_type = - KEY_TYPE_WEP40; - } else { - ieee->pairwise_key_type = KEY_TYPE_NA; - } - - if (ieee->pairwise_key_type) { - if (is_zero_ether_addr(ieee->ap_mac_addr)) - ieee->iw_mode = IW_MODE_ADHOC; - memcpy((u8 *)key, ipw->u.crypt.key, 16); - rtl92e_enable_hw_security_config(dev); - rtl92e_set_swcam(dev, 4, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key, 0); - rtl92e_set_key(dev, 4, ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key); - if (ieee->iw_mode == IW_MODE_ADHOC) { - rtl92e_set_swcam(dev, - ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key, 0); - rtl92e_set_key(dev, - ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key); - } - } - if ((ieee->pairwise_key_type == - KEY_TYPE_CCMP) && - ieee->pHTInfo->bCurrentHTSupport) { - rtl92e_writeb(dev, 0x173, 1); - } - - } else { - memcpy((u8 *)key, ipw->u.crypt.key, 16); - if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) - ieee->group_key_type = KEY_TYPE_CCMP; - else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) - ieee->group_key_type = KEY_TYPE_TKIP; - else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) { - if (ipw->u.crypt.key_len == 13) - ieee->group_key_type = - KEY_TYPE_WEP104; - else if (ipw->u.crypt.key_len == 5) - ieee->group_key_type = - KEY_TYPE_WEP40; - } else - ieee->group_key_type = KEY_TYPE_NA; - - if (ieee->group_key_type) { - rtl92e_set_swcam(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->group_key_type, - broadcast_addr, 0, key, - 0); - rtl92e_set_key(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->group_key_type, - broadcast_addr, 0, key); - } - } - } - - ret = rtllib_wpa_supplicant_ioctl(priv->rtllib, &wrq->u.data, - 0); - kfree(ipw); - break; - default: - ret = -EOPNOTSUPP; - break; - } - -out: - mutex_unlock(&priv->wx_mutex); - - return ret; -} - - static irqreturn_t _rtl92e_irq(int irq, void *netdev) { struct net_device *dev = netdev; @@ -2542,7 +2417,6 @@ static const struct net_device_ops rtl8192_netdev_ops = { .ndo_open = _rtl92e_open, .ndo_stop = _rtl92e_close, .ndo_tx_timeout = _rtl92e_tx_timeout, - .ndo_do_ioctl = _rtl92e_ioctl, .ndo_set_rx_mode = _rtl92e_set_multicast, .ndo_set_mac_address = _rtl92e_set_mac_adr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 0335823e2766..9d3089cb6a5a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -102,8 +102,6 @@ #define PHY_RSSI_SLID_WIN_MAX 100 -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) - #define TxBBGainTableLength 37 #define CCKTxBBGainTableLength 23 diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 1a43c684f9f3..b8205ebafd72 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -1693,22 +1693,6 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) if (priv->rtllib->pHTInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO) goto dm_CheckEdcaTurbo_EXIT; - { - u8 *peername[11] = { - "unknown", "realtek_90", "realtek_92se", "broadcom", - "ralink", "atheros", "cisco", "marvell", "92u_softap", - "self_softap" - }; - static int wb_tmp; - - if (wb_tmp == 0) { - netdev_info(dev, - "%s():iot peer is %s, bssid: %pM\n", - __func__, peername[pHTInfo->IOTPeer], - priv->rtllib->current_network.bssid); - wb_tmp = 1; - } - } if (!priv->rtllib->bis_any_nonbepkts) { curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 4ae1d382ac5c..f0e11726a72a 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -908,8 +908,8 @@ void HTSetConnectBwMode(struct rtllib_device *ieee, pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; } - pr_info("%s():pHTInfo->bCurBW40MHz:%x\n", __func__, - pHTInfo->bCurBW40MHz); + netdev_dbg(ieee->dev, "%s():pHTInfo->bCurBW40MHz:%x\n", __func__, + pHTInfo->bCurBW40MHz); pHTInfo->bSwBwInProgress = true; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 827651b62791..0042a0f6cf79 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -335,60 +335,8 @@ enum rt_op_mode { #define MGMT_QUEUE_NUM 5 -#define IEEE_CMD_SET_WPA_PARAM 1 -#define IEEE_CMD_SET_WPA_IE 2 -#define IEEE_CMD_SET_ENCRYPTION 3 -#define IEEE_CMD_MLME 4 - -#define IEEE_PARAM_WPA_ENABLED 1 -#define IEEE_PARAM_TKIP_COUNTERMEASURES 2 -#define IEEE_PARAM_DROP_UNENCRYPTED 3 -#define IEEE_PARAM_PRIVACY_INVOKED 4 -#define IEEE_PARAM_AUTH_ALGS 5 -#define IEEE_PARAM_IEEE_802_1X 6 -#define IEEE_PARAM_WPAX_SELECT 7 - -#define IEEE_MLME_STA_DEAUTH 1 -#define IEEE_MLME_STA_DISASSOC 2 - - -#define IEEE_CRYPT_ERR_UNKNOWN_ALG 2 -#define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED 4 -#define IEEE_CRYPT_ERR_KEY_SET_FAILED 5 -#define IEEE_CRYPT_ERR_CARD_CONF_FAILED 7 -#define IEEE_CRYPT_ALG_NAME_LEN 16 - #define MAX_IE_LEN 0xff -struct ieee_param { - u32 cmd; - u8 sta_addr[ETH_ALEN]; - union { - struct { - u8 name; - u32 value; - } wpa_param; - struct { - u32 len; - u8 reserved[32]; - u8 data[0]; - } wpa_ie; - struct { - int command; - int reason_code; - } mlme; - struct { - u8 alg[IEEE_CRYPT_ALG_NAME_LEN]; - u8 set_tx; - u32 err; - u8 idx; - u8 seq[8]; /* sequence counter (set: RX, get: TX) */ - u16 key_len; - u8 key[0]; - } crypt; - } u; -}; - #define msleep_interruptible_rsl msleep_interruptible /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section @@ -2066,8 +2014,6 @@ void rtllib_stop_all_queues(struct rtllib_device *ieee); struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee); void rtllib_start_send_beacons(struct rtllib_device *ieee); void rtllib_stop_send_beacons(struct rtllib_device *ieee); -int rtllib_wpa_supplicant_ioctl(struct rtllib_device *ieee, - struct iw_point *p, u8 is_mesh); void notify_wx_assoc_event(struct rtllib_device *ieee); void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success); diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 03a81ba136b2..7bc9cb131bcc 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1210,9 +1210,6 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb, return -1; } - if (rtllib_is_eapol_frame(ieee, skb, hdrlen)) - netdev_warn(ieee->dev, "RX: IEEE802.1X EAPOL frame!\n"); - return 0; } diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 09d2c8649171..e4be85af31e7 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -1515,7 +1515,8 @@ static void rtllib_associate_complete_wq(void *data) associate_complete_wq); struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); - netdev_info(ieee->dev, "Associated successfully\n"); + netdev_info(ieee->dev, "Associated successfully with %pM\n", + ieee->current_network.bssid); if (!ieee->is_silent_reset) { netdev_info(ieee->dev, "normal associate\n"); notify_wx_assoc_event(ieee); @@ -2299,7 +2300,8 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) if (errcode) { ieee->softmac_stats.rx_auth_rs_err++; netdev_info(ieee->dev, - "Authentication respose status code 0x%x", errcode); + "Authentication response status code 0x%x", + errcode); rtllib_associate_abort(ieee); return; } @@ -3066,333 +3068,6 @@ void rtllib_softmac_free(struct rtllib_device *ieee) tasklet_kill(&ieee->ps_task); } -/******************************************************** - * Start of WPA code. * - * this is stolen from the ipw2200 driver * - ********************************************************/ - - -static int rtllib_wpa_enable(struct rtllib_device *ieee, int value) -{ - /* This is called when wpa_supplicant loads and closes the driver - * interface. - */ - netdev_info(ieee->dev, "%s WPA\n", value ? "enabling" : "disabling"); - ieee->wpa_enabled = value; - eth_zero_addr(ieee->ap_mac_addr); - return 0; -} - - -static void rtllib_wpa_assoc_frame(struct rtllib_device *ieee, char *wpa_ie, - int wpa_ie_len) -{ - /* make sure WPA is enabled */ - rtllib_wpa_enable(ieee, 1); - - rtllib_disassociate(ieee); -} - - -static int rtllib_wpa_mlme(struct rtllib_device *ieee, int command, int reason) -{ - - int ret = 0; - - switch (command) { - case IEEE_MLME_STA_DEAUTH: - break; - - case IEEE_MLME_STA_DISASSOC: - rtllib_disassociate(ieee); - break; - - default: - netdev_info(ieee->dev, "Unknown MLME request: %d\n", command); - ret = -EOPNOTSUPP; - } - - return ret; -} - - -static int rtllib_wpa_set_wpa_ie(struct rtllib_device *ieee, - struct ieee_param *param, int plen) -{ - u8 *buf; - - if (param->u.wpa_ie.len > MAX_WPA_IE_LEN || - (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL)) - return -EINVAL; - - if (param->u.wpa_ie.len) { - buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len, - GFP_KERNEL); - if (buf == NULL) - return -ENOMEM; - - kfree(ieee->wpa_ie); - ieee->wpa_ie = buf; - ieee->wpa_ie_len = param->u.wpa_ie.len; - } else { - kfree(ieee->wpa_ie); - ieee->wpa_ie = NULL; - ieee->wpa_ie_len = 0; - } - - rtllib_wpa_assoc_frame(ieee, ieee->wpa_ie, ieee->wpa_ie_len); - return 0; -} - -#define AUTH_ALG_OPEN_SYSTEM 0x1 -#define AUTH_ALG_SHARED_KEY 0x2 -#define AUTH_ALG_LEAP 0x4 -static int rtllib_wpa_set_auth_algs(struct rtllib_device *ieee, int value) -{ - - struct rtllib_security sec = { - .flags = SEC_AUTH_MODE, - }; - - if (value & AUTH_ALG_SHARED_KEY) { - sec.auth_mode = WLAN_AUTH_SHARED_KEY; - ieee->open_wep = 0; - ieee->auth_mode = 1; - } else if (value & AUTH_ALG_OPEN_SYSTEM) { - sec.auth_mode = WLAN_AUTH_OPEN; - ieee->open_wep = 1; - ieee->auth_mode = 0; - } else if (value & AUTH_ALG_LEAP) { - sec.auth_mode = WLAN_AUTH_LEAP >> 6; - ieee->open_wep = 1; - ieee->auth_mode = 2; - } - - - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); - - return 0; -} - -static int rtllib_wpa_set_param(struct rtllib_device *ieee, u8 name, u32 value) -{ - int ret = 0; - unsigned long flags; - - switch (name) { - case IEEE_PARAM_WPA_ENABLED: - ret = rtllib_wpa_enable(ieee, value); - break; - - case IEEE_PARAM_TKIP_COUNTERMEASURES: - ieee->tkip_countermeasures = value; - break; - - case IEEE_PARAM_DROP_UNENCRYPTED: - { - /* HACK: - * - * wpa_supplicant calls set_wpa_enabled when the driver - * is loaded and unloaded, regardless of if WPA is being - * used. No other calls are made which can be used to - * determine if encryption will be used or not prior to - * association being expected. If encryption is not being - * used, drop_unencrypted is set to false, else true -- we - * can use this to determine if the CAP_PRIVACY_ON bit should - * be set. - */ - struct rtllib_security sec = { - .flags = SEC_ENABLED, - .enabled = value, - }; - ieee->drop_unencrypted = value; - /* We only change SEC_LEVEL for open mode. Others - * are set by ipw_wpa_set_encryption. - */ - if (!value) { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_0; - } else { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_1; - } - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); - break; - } - - case IEEE_PARAM_PRIVACY_INVOKED: - ieee->privacy_invoked = value; - break; - - case IEEE_PARAM_AUTH_ALGS: - ret = rtllib_wpa_set_auth_algs(ieee, value); - break; - - case IEEE_PARAM_IEEE_802_1X: - ieee->ieee802_1x = value; - break; - case IEEE_PARAM_WPAX_SELECT: - spin_lock_irqsave(&ieee->wpax_suitlist_lock, flags); - spin_unlock_irqrestore(&ieee->wpax_suitlist_lock, flags); - break; - - default: - netdev_info(ieee->dev, "Unknown WPA param: %d\n", name); - ret = -EOPNOTSUPP; - } - - return ret; -} - -/* implementation borrowed from hostap driver */ -static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, - struct ieee_param *param, int param_len, - u8 is_mesh) -{ - int ret = 0; - struct lib80211_crypto_ops *ops; - struct lib80211_crypt_data **crypt; - - struct rtllib_security sec = { - .flags = 0, - }; - - param->u.crypt.err = 0; - param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; - - if (param_len != - (int) ((char *) param->u.crypt.key - (char *) param) + - param->u.crypt.key_len) { - netdev_info(ieee->dev, "Len mismatch %d, %d\n", param_len, - param->u.crypt.key_len); - return -EINVAL; - } - if (is_broadcast_ether_addr(param->sta_addr)) { - if (param->u.crypt.idx >= NUM_WEP_KEYS) - return -EINVAL; - crypt = &ieee->crypt_info.crypt[param->u.crypt.idx]; - } else { - return -EINVAL; - } - - if (strcmp(param->u.crypt.alg, "none") == 0) { - if (crypt) { - sec.enabled = 0; - sec.level = SEC_LEVEL_0; - sec.flags |= SEC_ENABLED | SEC_LEVEL; - lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt); - } - goto done; - } - sec.enabled = 1; - sec.flags |= SEC_ENABLED; - - /* IPW HW cannot build TKIP MIC, host decryption still needed. */ - if (!(ieee->host_encrypt || ieee->host_decrypt) && - strcmp(param->u.crypt.alg, "R-TKIP")) - goto skip_host_crypt; - - ops = lib80211_get_crypto_ops(param->u.crypt.alg); - if (ops == NULL && strcmp(param->u.crypt.alg, "R-WEP") == 0) { - request_module("rtllib_crypt_wep"); - ops = lib80211_get_crypto_ops(param->u.crypt.alg); - } else if (ops == NULL && strcmp(param->u.crypt.alg, "R-TKIP") == 0) { - request_module("rtllib_crypt_tkip"); - ops = lib80211_get_crypto_ops(param->u.crypt.alg); - } else if (ops == NULL && strcmp(param->u.crypt.alg, "R-CCMP") == 0) { - request_module("rtllib_crypt_ccmp"); - ops = lib80211_get_crypto_ops(param->u.crypt.alg); - } - if (ops == NULL) { - netdev_info(ieee->dev, "unknown crypto alg '%s'\n", - param->u.crypt.alg); - param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; - ret = -EINVAL; - goto done; - } - if (*crypt == NULL || (*crypt)->ops != ops) { - struct lib80211_crypt_data *new_crypt; - - lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt); - - new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); - if (new_crypt == NULL) { - ret = -ENOMEM; - goto done; - } - new_crypt->ops = ops; - if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) - new_crypt->priv = - new_crypt->ops->init(param->u.crypt.idx); - - if (new_crypt->priv == NULL) { - kfree(new_crypt); - param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED; - ret = -EINVAL; - goto done; - } - - *crypt = new_crypt; - } - - if (param->u.crypt.key_len > 0 && (*crypt)->ops->set_key && - (*crypt)->ops->set_key(param->u.crypt.key, - param->u.crypt.key_len, param->u.crypt.seq, - (*crypt)->priv) < 0) { - netdev_info(ieee->dev, "key setting failed\n"); - param->u.crypt.err = IEEE_CRYPT_ERR_KEY_SET_FAILED; - ret = -EINVAL; - goto done; - } - - skip_host_crypt: - if (param->u.crypt.set_tx) { - ieee->crypt_info.tx_keyidx = param->u.crypt.idx; - sec.active_key = param->u.crypt.idx; - sec.flags |= SEC_ACTIVE_KEY; - } else - sec.flags &= ~SEC_ACTIVE_KEY; - - memcpy(sec.keys[param->u.crypt.idx], - param->u.crypt.key, - param->u.crypt.key_len); - sec.key_sizes[param->u.crypt.idx] = param->u.crypt.key_len; - sec.flags |= (1 << param->u.crypt.idx); - - if (strcmp(param->u.crypt.alg, "R-WEP") == 0) { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_1; - } else if (strcmp(param->u.crypt.alg, "R-TKIP") == 0) { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_2; - } else if (strcmp(param->u.crypt.alg, "R-CCMP") == 0) { - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_3; - } - done: - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); - - /* Do not reset port if card is in Managed mode since resetting will - * generate new IEEE 802.11 authentication which may end up in looping - * with IEEE 802.1X. If your hardware requires a reset after WEP - * configuration (for example... Prism2), implement the reset_port in - * the callbacks structures used to initialize the 802.11 stack. - */ - if (ieee->reset_on_keychange && - ieee->iw_mode != IW_MODE_INFRA && - ieee->reset_port && - ieee->reset_port(ieee->dev)) { - netdev_info(ieee->dev, "reset_port failed\n"); - param->u.crypt.err = IEEE_CRYPT_ERR_CARD_CONF_FAILED; - return -EINVAL; - } - - return ret; -} - static inline struct sk_buff * rtllib_disauth_skb(struct rtllib_network *beacon, struct rtllib_device *ieee, u16 asRsn) @@ -3489,62 +3164,6 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee) } } -int rtllib_wpa_supplicant_ioctl(struct rtllib_device *ieee, struct iw_point *p, - u8 is_mesh) -{ - struct ieee_param *param; - int ret = 0; - - mutex_lock(&ieee->wx_mutex); - - if (p->length < sizeof(struct ieee_param) || !p->pointer) { - ret = -EINVAL; - goto out; - } - - param = memdup_user(p->pointer, p->length); - if (IS_ERR(param)) { - ret = PTR_ERR(param); - goto out; - } - - switch (param->cmd) { - case IEEE_CMD_SET_WPA_PARAM: - ret = rtllib_wpa_set_param(ieee, param->u.wpa_param.name, - param->u.wpa_param.value); - break; - - case IEEE_CMD_SET_WPA_IE: - ret = rtllib_wpa_set_wpa_ie(ieee, param, p->length); - break; - - case IEEE_CMD_SET_ENCRYPTION: - ret = rtllib_wpa_set_encryption(ieee, param, p->length, 0); - break; - - case IEEE_CMD_MLME: - ret = rtllib_wpa_mlme(ieee, param->u.mlme.command, - param->u.mlme.reason_code); - break; - - default: - netdev_info(ieee->dev, "Unknown WPA supplicant request: %d\n", - param->cmd); - ret = -EOPNOTSUPP; - break; - } - - if (ret == 0 && copy_to_user(p->pointer, param, p->length)) - ret = -EFAULT; - - kfree(param); -out: - mutex_unlock(&ieee->wx_mutex); - - return ret; -} -EXPORT_SYMBOL(rtllib_wpa_supplicant_ioctl); - static void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib) { u8 OpMode; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index c5c0d9676dc8..f7eba01b5d15 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -595,7 +595,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, ret = -EINVAL; goto done; } - netdev_info(dev, "alg name:%s\n", alg); + netdev_dbg(dev, "alg name:%s\n", alg); ops = lib80211_get_crypto_ops(alg); if (ops == NULL) { |