#endif
#endif
-#if WIRELESS_EXT > 12
#include <net/iw_handler.h>
-#endif
extern WORD TxRate_iwconfig;//2008-5-8 <add> by chester
/*--------------------- Static Definitions -------------------------*/
#ifdef WIRELESS_EXT
-#if WIRELESS_EXT > 12
-
struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
{
PSDevice pDevice = netdev_priv(dev);
return &pDevice->wstats;
}
-#endif
-
/*------------------------------------------------------------------*/
//return 0;
return -EOPNOTSUPP;
}
-#if WIRELESS_EXT > 13
/*
* Wireless Handler : set scan
char *current_val = NULL;
struct iw_event iwe;
long ldBm;
-#if WIRELESS_EXT > 14
char buf[MAX_WPA_IE_LEN * 2 + 30];
-#endif /* WIRELESS_EXT > 14 */
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSCAN \n");
if((current_val - current_ev) > IW_EV_LCP_LEN)
current_ev = current_val;
-#if WIRELESS_EXT > 14
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVCUSTOM;
sprintf(buf, "bcn_int=%d", pBSS->wBeaconInterval);
iwe.u.data.length = strlen(buf);
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
-#if WIRELESS_EXT > 17
if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVGENIE;
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE);
}
-#else // WIRELESS_EXT > 17
- if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) {
- u8 *p = buf;
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- p += sprintf(p, "wpa_ie=");
- for (ii = 0; ii < pBSS->wWPALen; ii++) {
- p += sprintf(p, "%02x", pBSS->byWPAIE[ii]);
- }
- iwe.u.data.length = strlen(buf);
- current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
- }
-
-
- if ((pBSS->wRSNLen > 0) && (pBSS->wRSNLen <= MAX_WPA_IE_LEN)) {
- u8 *p = buf;
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVCUSTOM;
- p += sprintf(p, "rsn_ie=");
- for (ii = 0; ii < pBSS->wRSNLen; ii++) {
- p += sprintf(p, "%02x", pBSS->byRSNIE[ii]);
- }
- iwe.u.data.length = strlen(buf);
- current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
- }
-#endif
-#endif
}
}// for
}
-#endif /* WIRELESS_EXT > 13 */
-
/*
* Wireless Handler : set frequence or channel
// 4 keys are allowed
range->max_encoding_tokens = 4;
-#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
-#if WIRELESS_EXT > 9
range->min_pmp = 0;
range->max_pmp = 1000000;// 1 secs
range->min_pmt = 0;
range->txpower[0] = 100;
range->num_txpower = 1;
range->txpower_capa = IW_TXPOW_MWATT;
-#endif // WIRELESS_EXT > 9
-#if WIRELESS_EXT > 10
range->we_version_source = SUPPORTED_WIRELESS_EXT;
range->we_version_compiled = WIRELESS_EXT;
range->retry_capa = IW_RETRY_LIMIT | IW_RETRY_LIFETIME;
range->max_retry = 65535;
range->min_r_time = 1024;
range->max_r_time = 65535 * 1024;
-#endif // WIRELESS_EXT > 10
-#if WIRELESS_EXT > 11
// Experimental measurements - boundary 11/5.5 Mb/s
// Note : with or without the (local->rssi), results
// are somewhat different. - Jean II
range->avg_qual.qual = 6;
range->avg_qual.level = 176; // -80 dBm
range->avg_qual.noise = 0;
-#endif // WIRELESS_EXT > 11
}
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID);
/*
- #if WIRELESS_EXT < 21
- DEVICE_PRT(MSG_LEVEL_INFO, KERN_INFO " SIOCSIWESSID1 \n");
- pItemSSID->len = wrq->length - 1;
- #else
DEVICE_PRT(MSG_LEVEL_INFO, KERN_INFO " SIOCSIWESSID2 \n");
pItemSSID->len = wrq->length;
- #endif
*/
}
extra[pItemSSID->len] = '\0';
wrq->length = pItemSSID->len + 1;
//2008-0409-03, <Add> by Einsn Liu
- #if WIRELESS_EXT < 21
- wrq->length = pItemSSID->len + 1;
- #else
wrq->length = pItemSSID->len;
- #endif
wrq->flags = 1; // active
*/
-#if WIRELESS_EXT > 12
-
/*
static const iw_handler iwctl_handler[] =
{
(iw_handler) iwctl_giwap, // SIOCGIWAP
(iw_handler) NULL, // -- hole -- 0x16
(iw_handler) iwctl_giwaplist, // SIOCGIWAPLIST
-#if WIRELESS_EXT > 13
(iw_handler) iwctl_siwscan, // SIOCSIWSCAN
(iw_handler) iwctl_giwscan, // SIOCGIWSCAN
-#else
- (iw_handler) NULL,
- (iw_handler) NULL,
-#endif
(iw_handler) iwctl_siwessid, // SIOCSIWESSID
(iw_handler) iwctl_giwessid, // SIOCGIWESSID
(iw_handler) NULL, // SIOCSIWNICKN
(iw_handler) iwctl_giwencode, // SIOCGIWENCODE
(iw_handler) iwctl_siwpower, // SIOCSIWPOWER
(iw_handler) iwctl_giwpower, // SIOCGIWPOWER
-#if WIRELESS_EXT > 17
(iw_handler) NULL, // -- hole --
(iw_handler) NULL, // -- hole --
(iw_handler) iwctl_siwgenie, // SIOCSIWGENIE
(iw_handler) iwctl_giwencodeext, // SIOCGIWENCODEEXT
(iw_handler) NULL, // SIOCSIWPMKSA
(iw_handler) NULL, // -- hole --
-#endif // WIRELESS_EXT > 17
};
*/
(iw_handler) NULL, // SIOCGIWAP
(iw_handler) NULL, // -- hole -- 0x16
(iw_handler) NULL, // SIOCGIWAPLIST
-#if WIRELESS_EXT > 13
(iw_handler) iwctl_siwscan, // SIOCSIWSCAN
(iw_handler) iwctl_giwscan, // SIOCGIWSCAN
-#else
- (iw_handler) NULL,
- (iw_handler) NULL,
-#endif
(iw_handler) NULL, // SIOCSIWESSID
(iw_handler) NULL, // SIOCGIWESSID
(iw_handler) NULL, // SIOCSIWNICKN
(iw_handler) NULL, // SIOCGIWPOWER
//2008-0409-07, <Add> by Einsn Liu
-#if WIRELESS_EXT > 17
(iw_handler) NULL, // -- hole --
(iw_handler) NULL, // -- hole --
(iw_handler) NULL, // SIOCSIWGENIE
(iw_handler) NULL, // SIOCGIWENCODEEXT
(iw_handler) NULL, // SIOCSIWPMKSA
(iw_handler) NULL, // -- hole --
-#endif // WIRELESS_EXT > 17
};
const struct iw_handler_def iwctl_handler_def =
{
-#if WIRELESS_EXT > 16
.get_wireless_stats = &iwctl_get_wireless_stats,
-#endif
.num_standard = sizeof(iwctl_handler)/sizeof(iw_handler),
// .num_private = sizeof(iwctl_private_handler)/sizeof(iw_handler),
// .num_private_args = sizeof(iwctl_private_args)/sizeof(struct iw_priv_args),
};
-#endif // WIRELESS_EXT > 12
-
#endif // WIRELESS_EXT
#endif /* __cplusplus */
-#if WIRELESS_EXT < 18
-
-
-#define SIOCSIWMLME 0x8B16
-#define SIOCSIWGENIE 0x8B30
-
-// WPA : Authentication mode parameters
-#define SIOCSIWAUTH 0x8B32
-#define SIOCGIWAUTH 0x8B33
-
-// WPA : Extended version of encoding configuration
-#define SIOCSIWENCODEEXT 0x8B34
-#define SIOCGIWENCODEEXT 0x8B35
-
-#define IW_AUTH_WPA_VERSION 0
-#define IW_AUTH_CIPHER_PAIRWISE 1
-#define IW_AUTH_CIPHER_GROUP 2
-#define IW_AUTH_KEY_MGMT 3
-#define IW_AUTH_TKIP_COUNTERMEASURES 4
-#define IW_AUTH_DROP_UNENCRYPTED 5
-#define IW_AUTH_80211_AUTH_ALG 6
-#define IW_AUTH_WPA_ENABLED 7
-#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
-#define IW_AUTH_ROAMING_CONTROL 9
-#define IW_AUTH_PRIVACY_INVOKED 10
-
-#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
-#define IW_AUTH_WPA_VERSION_WPA 0x00000002
-#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
-
-#define IW_AUTH_CIPHER_NONE 0x00000001
-#define IW_AUTH_CIPHER_WEP40 0x00000002
-#define IW_AUTH_CIPHER_TKIP 0x00000004
-#define IW_AUTH_CIPHER_CCMP 0x00000008
-#define IW_AUTH_CIPHER_WEP104 0x00000010
-
-#define IW_AUTH_KEY_MGMT_802_1X 1
-#define IW_AUTH_KEY_MGMT_PSK 2
-
-#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
-#define IW_AUTH_ALG_SHARED_KEY 0x00000002
-#define IW_AUTH_ALG_LEAP 0x00000004
-
-#define IW_AUTH_ROAMING_ENABLE 0
-#define IW_AUTH_ROAMING_DISABLE 1
-
-#define IW_ENCODE_SEQ_MAX_SIZE 8
-
-#define IW_ENCODE_ALG_NONE 0
-#define IW_ENCODE_ALG_WEP 1
-#define IW_ENCODE_ALG_TKIP 2
-#define IW_ENCODE_ALG_CCMP 3
-
-
-struct iw_encode_ext
-{
- __u32 ext_flags; // IW_ENCODE_EXT_*
- __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; // LSB first
- __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; // LSB first
- struct sockaddr addr; // ff:ff:ff:ff:ff:ff for broadcast/multicast
- // (group) keys or unicast address for
- // individual keys
- __u16 alg; // IW_ENCODE_ALG_*
- __u16 key_len;
- __u8 key[0];
-};
-
-
-struct iw_mlme
-{
- __u16 cmd; /* IW_MLME_* */
- __u16 reason_code;
- struct sockaddr addr;
-};
-
-#endif // WIRELESS_EXT < 18
-
-
-
#ifdef WIRELESS_EXT
struct iw_statistics *iwctl_get_wireless_stats (struct net_device *dev);
#endif
-#if WIRELESS_EXT > 12
extern const struct iw_handler_def iwctl_handler_def;
extern const struct iw_priv_args iwctl_private_args;
-#else
-struct iw_request_info {};
-#endif //WIRELESS_EXT > 12
#ifdef __cplusplus
} /* End of extern "C" { */