diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-09-04 17:32:04 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-09-04 17:32:04 +1000 |
commit | 1a4072a95e8f79c2e52aed795e0e54428b0f31fc (patch) | |
tree | 6e7aa0663141156aa8fd57c8120a0aa76daf8d66 /drivers/staging/rtl8192su/r8192U_wx.c | |
parent | 111a3b94375ee87535ac985de4c94be5e5634881 (diff) | |
parent | c0e03fabb4f2a6e48f6e0b55729b26a599a2bd02 (diff) |
Merge branch 'quilt/staging'
Conflicts:
drivers/staging/at76_usb/at76_usb.c
drivers/staging/epl/VirtualEthernetLinux.c
Diffstat (limited to 'drivers/staging/rtl8192su/r8192U_wx.c')
-rw-r--r-- | drivers/staging/rtl8192su/r8192U_wx.c | 132 |
1 files changed, 6 insertions, 126 deletions
diff --git a/drivers/staging/rtl8192su/r8192U_wx.c b/drivers/staging/rtl8192su/r8192U_wx.c index f9eafb16dbb7..2208c9b1e726 100644 --- a/drivers/staging/rtl8192su/r8192U_wx.c +++ b/drivers/staging/rtl8192su/r8192U_wx.c @@ -17,19 +17,11 @@ project Authors. */ -#ifdef RTL8192SU #include <linux/string.h> #include "r8192U.h" #include "r8192S_hw.h" -#else -#include <linux/string.h> -#include "r8192U.h" -#include "r8192U_hw.h" -#endif -#ifdef ENABLE_DOT11D -#include "dot11d.h" -#endif +#include "ieee80211/dot11d.h" #define RATE_COUNT 12 u32 rtl8180_rates[] = {1000000,2000000,5500000,11000000, @@ -49,41 +41,6 @@ static int r8192_wx_get_freq(struct net_device *dev, return ieee80211_wx_get_freq(priv->ieee80211,a,wrqu,b); } - -#if 0 - -static int r8192_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa, - union iwreq_data *wrqu, char *b) -{ - int *parms = (int *)b; - int bi = parms[0]; - - struct r8192_priv *priv = ieee80211_priv(dev); - - down(&priv->wx_sem); - DMESG("setting beacon interval to %x",bi); - - priv->ieee80211->beacon_interval=bi; - rtl8180_commit(dev); - up(&priv->wx_sem); - - return 0; -} - - -static int r8192_wx_set_forceassociate(struct net_device *dev, struct iw_request_info *aa, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv=ieee80211_priv(dev); - int *parms = (int *)extra; - - priv->ieee80211->force_associate = (parms[0] > 0); - - - return 0; -} - -#endif static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { @@ -221,10 +178,6 @@ static int r8192_wx_read_bb(struct net_device *dev, { struct r8192_priv *priv = ieee80211_priv(dev); u8 databb; -#if 0 - int i; - for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) ); -#endif down(&priv->wx_sem); @@ -323,14 +276,6 @@ static int r8192_wx_get_ap_status(struct net_device *dev, #endif -#if 0 -static int r8192_wx_null(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - return 0; -} -#endif static int r8192_wx_force_reset(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -346,7 +291,6 @@ static int r8192_wx_force_reset(struct net_device *dev, } -#ifdef RTL8192SU static int r8191su_wx_get_firm_version(struct net_device *dev, struct iw_request_info *info, struct iw_param *wrqu, char *extra) @@ -362,7 +306,6 @@ static int r8191su_wx_get_firm_version(struct net_device *dev, up(&priv->wx_sem); return 0; } -#endif @@ -529,11 +472,7 @@ static int rtl8180_wx_get_range(struct net_device *dev, for (i = 0, val = 0; i < 14; i++) { // Include only legal frequencies for some countries -#ifdef ENABLE_DOT11D if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) { -#else - if ((priv->ieee80211->channel_map)[i+1]) { -#endif range->freq[val].i = i + 1; range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000; range->freq[val].e = 1; @@ -548,10 +487,8 @@ static int rtl8180_wx_get_range(struct net_device *dev, } range->num_frequency = val; range->num_channels = val; -#if WIRELESS_EXT > 17 range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2| IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP; -#endif tmp->scan_capa = 0x01; return 0; } @@ -568,7 +505,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a, if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true) return -EAGAIN; -#if WIRELESS_EXT > 17 + if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { struct iw_scan_req* req = (struct iw_scan_req*)b; @@ -580,7 +517,6 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a, //printk("=====>network ssid:%s\n", ieee->current_network.ssid); } } -#endif down(&priv->wx_sem); if(priv->ieee80211->state != IEEE80211_LINKED){ @@ -963,25 +899,12 @@ exit: return err; } -#if (WIRELESS_EXT >= 18) -#if 0 -static int r8192_wx_get_enc_ext(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = ieee80211_priv(dev); - int ret = 0; - ret = ieee80211_wx_get_encode_ext(priv->ieee80211, info, wrqu, extra); - return ret; -} -#endif //hw security need to reorganized. static int r8192_wx_set_enc_ext(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret=0; - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct r8192_priv *priv = ieee80211_priv(dev); struct ieee80211_device* ieee = priv->ieee80211; //printk("===>%s()\n", __FUNCTION__); @@ -996,13 +919,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, u32 key[4] = {0}; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_point *encoding = &wrqu->encoding; -#if 0 - static u8 CAM_CONST_ADDR[4][6] = { - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, - {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}; -#endif u8 idx = 0, alg = 0, group = 0; if ((encoding->flags & IW_ENCODE_DISABLED) || ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01 @@ -1065,22 +981,19 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, end_hw_sec: up(&priv->wx_sem); -#endif return ret; - } static int r8192_wx_set_auth(struct net_device *dev, struct iw_request_info *info, union iwreq_data *data, char *extra) { int ret=0; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + //printk("====>%s()\n", __FUNCTION__); struct r8192_priv *priv = ieee80211_priv(dev); down(&priv->wx_sem); ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra); up(&priv->wx_sem); -#endif return ret; } @@ -1091,23 +1004,19 @@ static int r8192_wx_set_mlme(struct net_device *dev, //printk("====>%s()\n", __FUNCTION__); int ret=0; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct r8192_priv *priv = ieee80211_priv(dev); down(&priv->wx_sem); ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra); - up(&priv->wx_sem); -#endif return ret; } -#endif + static int r8192_wx_set_gen_ie(struct net_device *dev, struct iw_request_info *info, union iwreq_data *data, char *extra) { //printk("====>%s(), len:%d\n", __FUNCTION__, data->length); int ret=0; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct r8192_priv *priv = ieee80211_priv(dev); down(&priv->wx_sem); #if 1 @@ -1115,7 +1024,6 @@ static int r8192_wx_set_gen_ie(struct net_device *dev, #endif up(&priv->wx_sem); //printk("<======%s(), ret:%d\n", __FUNCTION__, ret); -#endif return ret; @@ -1152,11 +1060,7 @@ static iw_handler r8192_wx_handlers[] = NULL, /* SIOCWIWTHRSPY */ r8192_wx_set_wap, /* SIOCSIWAP */ r8192_wx_get_wap, /* SIOCGIWAP */ -#if (WIRELESS_EXT >= 18) r8192_wx_set_mlme, /* MLME-- */ -#else - NULL, -#endif dummy, /* SIOCGIWAPLIST -- depricated */ r8192_wx_set_scan, /* SIOCSIWSCAN */ r8192_wx_get_scan, /* SIOCGIWSCAN */ @@ -1185,17 +1089,10 @@ static iw_handler r8192_wx_handlers[] = r8192_wx_set_gen_ie,//NULL, /* SIOCSIWGENIE */ NULL, /* SIOCSIWGENIE */ -#if (WIRELESS_EXT >= 18) r8192_wx_set_auth,//NULL, /* SIOCSIWAUTH */ NULL,//r8192_wx_get_auth,//NULL, /* SIOCSIWAUTH */ r8192_wx_set_enc_ext, /* SIOCSIWENCODEEXT */ NULL,//r8192_wx_get_enc_ext,//NULL, /* SIOCSIWENCODEEXT */ -#else - NULL, - NULL, - NULL, - NULL, -#endif NULL, /* SIOCSIWPMKSA */ NULL, /*---hole---*/ @@ -1262,14 +1159,12 @@ static const struct iw_priv_args r8192_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "forcereset" } -#ifdef RTL8192SU , { SIOCIWFIRSTPRIV + 0x5, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT|IW_PRIV_SIZE_FIXED|1, "firm_ver" } -#endif }; @@ -1292,12 +1187,9 @@ static iw_handler r8192_private_handler[] = { #endif r8192_wx_force_reset, (iw_handler)NULL, -#ifdef RTL8192SU (iw_handler)r8191su_wx_get_firm_version, -#endif }; -//#if WIRELESS_EXT >= 17 struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -1311,11 +1203,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) wstats->qual.qual = 0; wstats->qual.level = 0; wstats->qual.noise = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; -#else - wstats->qual.updated = 0x0f; -#endif return wstats; } @@ -1327,24 +1215,16 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) wstats->qual.level = tmp_level; wstats->qual.qual = tmp_qual; wstats->qual.noise = tmp_noise; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM; -#else - wstats->qual.updated = 0x0f; -#endif return wstats; } -//#endif - struct iw_handler_def r8192_wx_handlers_def={ .standard = r8192_wx_handlers, - .num_standard = sizeof(r8192_wx_handlers) / sizeof(iw_handler), + .num_standard = ARRAY_SIZE(r8192_wx_handlers), .private = r8192_private_handler, - .num_private = sizeof(r8192_private_handler) / sizeof(iw_handler), + .num_private = ARRAY_SIZE(r8192_private_handler), .num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args), -#if WIRELESS_EXT >= 17 .get_wireless_stats = r8192_get_wireless_stats, -#endif .private_args = (struct iw_priv_args *)r8192_private_args, }; |