pDevice->wstats.discard.retries = pDevice->scStatistic.dwTsrErr;
pDevice->wstats.discard.misc = 0;
pDevice->wstats.miss.beacon = 0;
-
return &pDevice->wstats;
}
/*
* Wireless Handler : get protocol name
*/
-
int iwctl_giwname(struct net_device *dev,
struct iw_request_info *info,
char *wrq,
/*
* Wireless Handler : set scan
*/
-
int iwctl_siwscan(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
/*
* Wireless Handler : get scan results
*/
-
int iwctl_giwscan(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
}
}// for
-
wrq->length = current_ev - extra;
return 0;
-
}
-
/*
* Wireless Handler : set frequence or channel
*/
-
int iwctl_siwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *wrq,
/*
* Wireless Handler : get frequence or channel
*/
-
int iwctl_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *wrq,
wrq->e = 1;
}
#endif
-
return 0;
}
/*
* Wireless Handler : set operation mode
*/
-
int iwctl_siwmode(struct net_device *dev,
struct iw_request_info *info,
__u32 *wmode,
/*
* Wireless Handler : get operation mode
*/
-
void iwctl_giwmode(struct net_device *dev,
struct iw_request_info *info,
__u32 *wmode,
}
}
-
/*
* Wireless Handler : get capability range
*/
-
void iwctl_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
range->min_frag = 256;
range->max_frag = 2312;
-
// the encoding capabilities
range->num_encoding_sizes = 3;
// 64(40) bits WEP
range->pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT | IW_POWER_ALL_R;
// Transmit Power - values are in mW
-
range->txpower[0] = 100;
range->num_txpower = 1;
range->txpower_capa = IW_TXPOW_MWATT;
}
}
-
/*
* Wireless Handler : set ap mac address
*/
-
int iwctl_siwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *wrq,
rc = -EINVAL;
else {
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
-
//mike :add
if ((is_broadcast_ether_addr(pMgmt->abyDesireBSSID)) ||
(memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)){
/*
* Wireless Handler : get ap mac address
*/
-
int iwctl_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *wrq,
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWAP \n");
memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6);
}
wrq->sa_family = ARPHRD_ETHER;
-
return 0;
-
}
-
/*
* Wireless Handler : get ap list
*/
-
int iwctl_giwaplist(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWAPLIST \n");
// Only super-user can see AP list
}
if (wrq->pointer) {
-
PKnownBSS pBSS = &(pMgmt->sBSSList[0]);
for (ii = 0, jj= 0; ii < MAX_BSS_NUM; ii++) {
memcpy(extra, sock, sizeof(struct sockaddr)*jj);
memcpy(extra + sizeof(struct sockaddr)*jj, qual, sizeof(struct iw_quality)*jj);
}
-
return rc;
}
-
/*
* Wireless Handler : set essid
*/
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
pDevice->bCommit = TRUE;
}
-
-
return 0;
}
-
/*
* Wireless Handler : get essid
*/
struct iw_point *wrq,
char *extra)
{
-
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PWLAN_IE_SSID pItemSSID;
/*
* Wireless Handler : set data rate
*/
-
int iwctl_siwrate(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *wrq,
}
}
-
-
/*
* Wireless Handler : set rts threshold
*/
else if (wrq->disabled)
pDevice->wRTSThreshold = 2312;
-
else
pDevice->wRTSThreshold = wrq->value;
/*
* Wireless Handler : get rts
*/
-
int iwctl_giwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *wrq,
/*
* Wireless Handler : set fragment threshold
*/
-
int iwctl_siwfrag(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *wrq,
int rc = 0;
int fthr = wrq->value;
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFRAG \n");
-
if (wrq->disabled)
fthr = 2312;
if((fthr < 256) || (fthr > 2312)) {
fthr &= ~0x1; // Get an even value
pDevice->wFragmentationThreshold = (u16)fthr;
}
-
return rc;
}
return 0;
}
-
-
/*
* Wireless Handler : set retry threshold
*/
PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRETRY \n");
if (wrq->disabled) {
if (wrq->flags & IW_RETRY_LIFETIME) {
pDevice->wMaxTransmitMSDULifetime = wrq->value;
}
-
-
return rc;
}
wrq->flags |= IW_RETRY_MIN;
}
-
return 0;
}
-
/*
* Wireless Handler : set encode mode
*/
int ii,uu, rc = 0;
int index = (wrq->flags & IW_ENCODE_INDEX);
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWENCODE \n");
// Check the size of the key
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
memset(pMgmt->abyDesireBSSID, 0xFF,6);
#endif
-
return rc;
}
}
wrq->flags |= index+1;
-
return 0;
}
-
/*
* Wireless Handler : set power mode
*/
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int mode = pDevice->ePSMode;
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWPOWER \n");
-
if ((wrq->disabled = (mode == WMAC_POWER_CAM)))
return 0;
wrq->flags = IW_POWER_PERIOD;
}
wrq->flags |= IW_POWER_ALL_R;
-
return 0;
}
-
/*
* Wireless Handler : get Sensitivity
*/
};
wrq->disabled = (wrq->value == 0);
wrq->fixed = 1;
-
-
return 0;
}
pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK;
else pMgmt->eAuthenMode = WMAC_AUTH_WPA;
}
-
break;
case IW_AUTH_TKIP_COUNTERMEASURES:
break; /* FIXME */
pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
PRINT_K("iwctl_siwauth:set WPADEV to disaable at 2?????\n");
}
-
break;
default:
ret = -EOPNOTSUPP;
return ret;
}
-
int iwctl_giwauth(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *wrq,
return -EOPNOTSUPP;
}
-
-
int iwctl_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
}else
ret = -E2BIG;
}
-
return ret;
}
-
int iwctl_siwencodeext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
key_len=ext->key_len;
memcpy(key, &ext->key[0], key_len);
}
-
memset(key_array, 0, 64);
if ( key_len > 0) {
memcpy(key_array, key, key_len);
KeyvInitTable(pDevice,&pDevice->sKey);
}
//******
-
spin_lock_irq(&pDevice->lock);
ret = wpa_set_keys(pDevice, param, TRUE);
spin_unlock_irq(&pDevice->lock);
return ret;
}
-
-
int iwctl_giwencodeext(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
default:
ret = -EOPNOTSUPP;
}
-
return ret;
-
}
#endif
(iw_handler) NULL, // -- hole --
};
-
static const iw_handler iwctl_private_handler[] =
{
NULL, // SIOCIWFIRSTPRIV
};
-
struct iw_priv_args iwctl_private_args[] = {
{ IOCTL_CMD_SET,
IW_PRIV_TYPE_CHAR | 1024, 0,
"set"},
};
-
-
const struct iw_handler_def iwctl_handler_def =
{
.get_wireless_stats = &iwctl_get_wireless_stats,