20 #include <linux/string.h>
24 static u32 rtl8192_rates[] = {
25 1000000, 2000000, 5500000, 11000000, 6000000, 9000000, 12000000,
26 18000000, 24000000, 36000000, 48000000, 54000000
81 static int r8192_wx_set_rts(
struct net_device *dev,
100 static int r8192_wx_get_rts(
struct net_device *dev,
108 static int r8192_wx_set_power(
struct net_device *dev,
117 "Power,return\n", __func__);
129 static int r8192_wx_get_power(
struct net_device *dev,
137 static int r8192_wx_set_rawtx(
struct net_device *dev,
157 static int r8192_wx_force_reset(
struct net_device *dev,
173 static int r8192_wx_force_mic_error(
struct net_device *dev,
189 #define MAX_ADHOC_PEER_NUM 64
200 static int r8192_wx_get_adhoc_peers(
struct net_device *dev,
208 static int r8191se_wx_get_firm_version(
struct net_device *dev,
215 static int r8192_wx_adapter_power_status(
struct net_device *dev,
221 (&(priv->
rtllib->PowerSaveControl));
227 "DC power" :
"AC power");
245 static int r8192se_wx_set_radio(
struct net_device *dev,
254 if ((*extra != 0) && (*extra != 1)) {
256 "off) or 1(radio on)\n", __func__);
266 static int r8192se_wx_set_lps_awake_interval(
struct net_device *dev,
272 (&(priv->
rtllib->PowerSaveControl));
284 static int r8192se_wx_set_force_lps(
struct net_device *dev,
293 "close)\n", __func__, *extra);
300 static int r8192_wx_set_debugflag(
struct net_device *dev,
330 rtState = priv->
rtllib->eRFPowerState;
334 if (priv->
rtllib->PowerSaveControl.bInactivePs) {
336 if (priv->
rtllib->RfOffReason >
344 "IPSLeave\n", __func__);
380 static int rtl8192_wx_get_range(
struct net_device *dev,
389 wrqu->
data.length =
sizeof(*range);
390 memset(range, 0,
sizeof(*range));
413 range->
bitrate[i] = rtl8192_rates[i];
429 for (i = 0, val = 0; i < 14; i++) {
430 if ((priv->
rtllib->active_channel_map)[i+1]) {
465 (priv->
rtllib->CntAfterLink < 2))
474 rtState = priv->
rtllib->eRFPowerState;
477 if (priv->
rtllib->LinkDetectInfo.bBusyTraffic ==
true)
491 priv->
rtllib->FirstIe_InScan =
true;
494 if (priv->
rtllib->PowerSaveControl.bInactivePs) {
496 if (priv->
rtllib->RfOffReason >
504 "IPSLeave\n", __func__);
512 if (priv->
rtllib->LedControlHandler)
513 priv->
rtllib->LedControlHandler(dev,
517 priv->
rtllib->actscanning =
true;
531 priv->
rtllib->actscanning =
true;
563 static int r8192_wx_set_essid(
struct net_device *dev,
576 "eRfOff, return\n", __func__);
587 static int r8192_wx_get_essid(
struct net_device *dev,
603 static int r8192_wx_set_nick(
struct net_device *dev,
612 wrqu->
data.length =
min((
size_t) wrqu->
data.length,
sizeof(priv->
nick));
620 static int r8192_wx_get_nick(
struct net_device *dev,
629 wrqu->
data.flags = 1;
651 static int r8192_wx_get_name(
struct net_device *dev,
660 static int r8192_wx_set_frag(
struct net_device *dev,
669 if (wrqu->
frag.disabled)
683 static int r8192_wx_get_frag(
struct net_device *dev,
690 wrqu->
frag.fixed = 0;
697 static int r8192_wx_set_wap(
struct net_device *dev,
724 static int r8192_wx_get_wap(
struct net_device *dev,
734 static int r8192_wx_get_enc(
struct net_device *dev,
743 static int r8192_wx_set_enc(
struct net_device *dev,
751 u32 hwkey[4] = {0, 0, 0, 0};
754 u8 zero_addr[4][6] = {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
755 {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
756 {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
757 {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
769 priv->
rtllib->wx_set_enc = 1;
789 for (i = 0; i < 4; i++) {
790 hwkey[
i] |= key[4*i+0]&
mask;
791 if (i == 1 && (4 * i + 1) == wrqu->
encoding.length)
793 if (i == 3 && (4 * i + 1) == wrqu->
encoding.length)
795 hwkey[
i] |= (key[4 * i + 1] &
mask) << 8;
796 hwkey[
i] |= (key[4 * i + 2] &
mask) << 16;
797 hwkey[
i] |= (key[4 * i + 3] &
mask) << 24;
800 #define CONF_WEP40 0x4
801 #define CONF_WEP104 0x14
827 else if (wrqu->
encoding.length == 0xd) {
831 zero_addr[key_idx], 0, hwkey);
833 zero_addr[key_idx], 0, hwkey, 0);
840 priv->
rtllib->wx_set_enc = 0;
844 static int r8192_wx_set_scan_type(
struct net_device *dev,
849 int *
parms = (
int *)p;
862 #define R8192_MAX_RETRY 255
863 static int r8192_wx_set_retry(
struct net_device *dev,
876 wrqu->
retry.disabled) {
891 DMESG(
"Setting retry for RTS/CTS data to %d",
896 DMESG(
"Setting retry for non RTS/CTS data to %d",
908 static int r8192_wx_get_retry(
struct net_device *dev,
915 wrqu->
retry.disabled = 0;
931 static int r8192_wx_get_sens(
struct net_device *dev,
943 static int r8192_wx_set_sens(
struct net_device *dev,
971 static int r8192_wx_set_enc_ext(
struct net_device *dev,
984 priv->
rtllib->wx_set_enc = 1;
991 u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
1025 setKey(dev, idx, idx, alg, zero, 0, key);
1026 set_swcam(dev, idx, idx, alg, zero, 0, key, 0);
1029 setKey(dev, idx, idx, alg, broadcast_addr, 0, key);
1030 set_swcam(dev, idx, idx, alg, broadcast_addr, 0,
1034 ieee->
pHTInfo->bCurrentHTSupport)
1046 priv->
rtllib->wx_set_enc = 0;
1051 static int r8192_wx_set_auth(
struct net_device *dev,
1068 static int r8192_wx_set_mlme(
struct net_device *dev,
1086 static int r8192_wx_set_gen_ie(
struct net_device *dev,
1103 static int r8192_wx_get_gen_ie(
struct net_device *dev,
1112 data->
data.length = 0;
1124 #define OID_RT_INTEL_PROMISCUOUS_MODE 0xFF0101F6
1126 static int r8192_wx_set_PromiscuousMode(
struct net_device *dev,
1136 u32 bPromiscuousOn = info_buf[1];
1137 u32 bFilterSourceStationFrame = info_buf[2];
1141 (bPromiscuousOn) ? (
true) : (
false);
1143 (bFilterSourceStationFrame) ? (
true) : (
false);
1149 __func__, bPromiscuousOn, bFilterSourceStationFrame);
1158 static int r8192_wx_get_PromiscuousMode(
struct net_device *dev,
1167 snprintf(extra, 45,
"PromiscuousMode:%d, FilterSrcSTAFrame:%d",
1178 #define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT]
1220 static const struct iw_priv_args r8192_private_args[] = {
1269 static iw_handler r8192_private_handler[] = {
1280 (
iw_handler)r8192se_wx_set_lps_awake_interval,
1305 wstats->
qual.qual = 10;
1306 wstats->
qual.level = 0;
1307 wstats->
qual.noise = -100;
1316 wstats->
qual.level = tmp_level;
1317 wstats->
qual.qual = tmp_qual;
1318 wstats->
qual.noise = tmp_noise;
1324 .standard = r8192_wx_handlers,
1325 .num_standard =
ARRAY_SIZE(r8192_wx_handlers),
1326 .private = r8192_private_handler,
1327 .num_private =
ARRAY_SIZE(r8192_private_handler),
1328 .num_private_args =
sizeof(r8192_private_args) /
1330 .get_wireless_stats = r8192_get_wireless_stats,
1331 .private_args = (
struct iw_priv_args *)r8192_private_args,