20 #include <linux/string.h>
28 6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000};
148 data1 = read_rtl8225(dev, addr);
156 static int r8192_wx_write_regs(
struct net_device *dev,
160 struct r8192_priv *priv = ieee80211_priv(dev);
166 write_rtl8225(dev, addr, wrqu->
data.length);
176 static int r8192_wx_read_bb(
struct net_device *dev,
180 struct r8192_priv *priv = ieee80211_priv(dev);
185 databb = rtl8187_read_phy(dev, (
u8)wrqu->
data.length, 0x00000000);
186 wrqu->
data.length = databb;
193 static int r8192_wx_write_bb(
struct net_device *dev,
197 struct r8192_priv *priv = ieee80211_priv(dev);
211 static int r8192_wx_write_nicb(
struct net_device *dev,
215 struct r8192_priv *priv = ieee80211_priv(dev);
227 static int r8192_wx_read_nicb(
struct net_device *dev,
231 struct r8192_priv *priv = ieee80211_priv(dev);
245 static int r8192_wx_get_ap_status(
struct net_device *dev,
249 struct r8192_priv *priv = ieee80211_priv(dev);
257 for(name_len=0 ; ((
char*)wrqu->
data.pointer)[
name_len]!=
'\0' ; name_len++);
261 if ( (target->
ssid_len == name_len) &&
265 wrqu->
data.flags = 1;
266 else wrqu->
data.flags = 0;
280 static int r8192_wx_force_reset(
struct net_device *dev,
284 struct r8192_priv *priv = ieee80211_priv(dev);
296 static int r8192_wx_set_rawtx(
struct net_device *dev,
300 struct r8192_priv *priv = ieee80211_priv(dev);
313 static int r8192_wx_set_crcmon(
struct net_device *dev,
317 struct r8192_priv *priv = ieee80211_priv(dev);
318 int *
parms = (
int *)extra;
319 int enable = (parms[0] > 0);
329 DMESG(
"bad CRC in monitor mode are %s",
330 priv->
crcmon ?
"accepted" :
"rejected");
332 if(prev != priv->
crcmon && priv->
up){
345 struct r8192_priv *priv = ieee80211_priv(dev);
379 static int rtl8180_wx_get_range(
struct net_device *dev,
385 struct r8192_priv *priv = ieee80211_priv(dev);
389 wrqu->
data.length =
sizeof(*range);
390 memset(range, 0,
sizeof(*range));
456 for (i = 0, val = 0; i < 14; i++) {
474 #if WIRELESS_EXT > 17
486 struct r8192_priv *priv = ieee80211_priv(dev);
492 if (priv->
ieee80211->LinkDetectInfo.bBusyTraffic ==
true)
524 struct r8192_priv *priv = ieee80211_priv(dev);
537 static int r8192_wx_set_essid(
struct net_device *dev,
541 struct r8192_priv *priv = ieee80211_priv(dev);
555 static int r8192_wx_get_essid(
struct net_device *dev,
560 struct r8192_priv *priv = ieee80211_priv(dev);
576 struct r8192_priv *priv = ieee80211_priv(dev);
586 static int r8192_wx_get_name(
struct net_device *dev,
590 struct r8192_priv *priv = ieee80211_priv(dev);
595 static int r8192_wx_set_frag(
struct net_device *dev,
599 struct r8192_priv *priv = ieee80211_priv(dev);
601 if (wrqu->
frag.disabled)
615 static int r8192_wx_get_frag(
struct net_device *dev,
619 struct r8192_priv *priv = ieee80211_priv(dev);
622 wrqu->
frag.fixed = 0;
629 static int r8192_wx_set_wap(
struct net_device *dev,
636 struct r8192_priv *priv = ieee80211_priv(dev);
649 static int r8192_wx_get_wap(
struct net_device *dev,
653 struct r8192_priv *priv = ieee80211_priv(dev);
659 static int r8192_wx_get_enc(
struct net_device *dev,
663 struct r8192_priv *priv = ieee80211_priv(dev);
668 static int r8192_wx_set_enc(
struct net_device *dev,
672 struct r8192_priv *priv = ieee80211_priv(dev);
677 u32 hwkey[4]={0,0,0,0};
681 u8 zero_addr[4][6] ={ {0x00,0x00,0x00,0x00,0x00,0x00},
682 {0x00,0x00,0x00,0x00,0x00,0x01},
683 {0x00,0x00,0x00,0x00,0x00,0x02},
684 {0x00,0x00,0x00,0x00,0x00,0x03} };
701 for(i=0 ; i<4 ; i++){
702 hwkey[
i] |= key[4*i+0]&
mask;
703 if(i==1&&(4*i+1)==wrqu->
encoding.length) mask=0x00;
704 if(i==3&&(4*i+1)==wrqu->
encoding.length) mask=0x00;
705 hwkey[
i] |= (key[4*i+1]&
mask)<<8;
706 hwkey[
i] |= (key[4*i+2]&
mask)<<16;
707 hwkey[
i] |= (key[4*i+3]&
mask)<<24;
710 #define CONF_WEP40 0x4
711 #define CONF_WEP104 0x14
714 case 0: key_idx = ieee->
tx_keyidx;
break;
715 case 1: key_idx = 0;
break;
716 case 2: key_idx = 1;
break;
717 case 3: key_idx = 2;
break;
718 case 4: key_idx = 3;
break;
736 else if(wrqu->
encoding.length==0xd){
749 else printk(
"wrong type in WEP, not WEP40 and WEP104\n");
760 struct r8192_priv *priv = ieee80211_priv(dev);
771 static int r8192_wx_set_retry(
struct net_device *dev,
775 struct r8192_priv *priv = ieee80211_priv(dev);
781 wrqu->
retry.disabled){
796 DMESG(
"Setting retry for RTS/CTS data to %d", wrqu->
retry.value);
800 DMESG(
"Setting retry for non RTS/CTS data to %d", wrqu->
retry.value);
824 static int r8192_wx_get_retry(
struct net_device *dev,
828 struct r8192_priv *priv = ieee80211_priv(dev);
831 wrqu->
retry.disabled = 0;
850 static int r8192_wx_get_sens(
struct net_device *dev,
854 struct r8192_priv *priv = ieee80211_priv(dev);
862 static int r8192_wx_set_sens(
struct net_device *dev,
867 struct r8192_priv *priv = ieee80211_priv(dev);
887 #if (WIRELESS_EXT >= 18)
889 static int r8192_wx_set_enc_ext(
struct net_device *dev,
894 struct r8192_priv *priv = ieee80211_priv(dev);
903 u8 broadcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
970 static int r8192_wx_set_auth(
struct net_device *dev,
976 struct r8192_priv *priv = ieee80211_priv(dev);
983 static int r8192_wx_set_mlme(
struct net_device *dev,
990 struct r8192_priv *priv = ieee80211_priv(dev);
998 static int r8192_wx_set_gen_ie(
struct net_device *dev,
1004 struct r8192_priv *priv = ieee80211_priv(dev);
1034 rtl8180_wx_get_range,
1045 #if (WIRELESS_EXT >= 18)
1075 r8192_wx_set_gen_ie,
1078 #if (WIRELESS_EXT >= 18)
1081 r8192_wx_set_enc_ext,
1095 static const struct iw_priv_args r8192_private_args[] = {
1159 static iw_handler r8192_private_handler[] = {
1161 r8192_wx_set_crcmon,
1165 r8192_wx_set_scan_type,
1169 r8192_wx_write_regs,
1173 r8192_wx_write_nicb,
1174 r8192_wx_get_ap_status,
1177 r8192_wx_force_reset,
1183 struct r8192_priv *priv = ieee80211_priv(dev);
1191 wstats->
qual.qual = 0;
1192 wstats->
qual.level = 0;
1193 wstats->
qual.noise = 0;
1203 wstats->
qual.level = tmp_level;
1204 wstats->
qual.qual = tmp_qual;
1205 wstats->
qual.noise = tmp_noise;
1213 .standard = r8192_wx_handlers,
1214 .num_standard =
ARRAY_SIZE(r8192_wx_handlers),
1215 .private = r8192_private_handler,
1216 .num_private =
ARRAY_SIZE(r8192_private_handler),
1217 .num_private_args =
sizeof(r8192_private_args) /
sizeof(
struct iw_priv_args),
1218 #if WIRELESS_EXT >= 17
1221 .private_args = (
struct iw_priv_args *)r8192_private_args,