staging: rtl8192e: remove dead private call to _rtl92e_ioctl.
PATCH 1/2 staging: rtl8192e: remove dead private call to _rtl92e_ioctl.
A RTL_IOCTL_WPA_SUPPLICANT call is a proprietary version of wpa supplicant.
All kernel calls use SIOCSIWENCODEEXT call via wireless handlers already used in this driver.
Remove dead code.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 126 --------------------------- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 - 2 files changed, 128 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -126
@@ -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,
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -2
@@ -102,8 +102,6 @@#define PHY_RSSI_SLID_WIN_MAX 100 -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) -#define TxBBGainTableLength 37#define CCKTxBBGainTableLength 23
Signature · 1 line
2.11.0
PATCH 2/2 staging: rtl8192e: remove dead code rtllib_wpa_supplicant_ioctl
Following removal of _rtl92e_ioctl this function along with associated macros, structure ieee_param and functions become dead code.
Remove functions rtllib_wpa_enable, rtllib_wpa_assoc_frame, rtllib_wpa_mlme, rtllib_wpa_set_wpa_ie, rtllib_wpa_set_auth_algs, rtllib_wpa_set_param, rtllib_wpa_set_encryption and rtllib_wpa_supplicant_ioctl.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/rtl8192e/rtllib.h | 54 ----- drivers/staging/rtl8192e/rtllib_softmac.c | 383 ------------------------------ 2 files changed, 437 deletions(-)
drivers/staging/rtl8192e/rtllib.h +0 -54
@@ -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);
drivers/staging/rtl8192e/rtllib_softmac.c +0 -383
395 lines not on this page · raw message
Signature · 1 line
2.11.0