* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: 80211hdr.h
*
- * Purpose: Defines the macros, types, and functions for dealing
- * with 802.11 MAC headers.
+ * Purpose: 802.11 MAC headers related pre-defines and macros.
+ *
*
* Author: Lyndon Chen
*
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- *
* File: 80211mgr.c
*
* Purpose: Handles the 802.11 management support functions
)
{
PWLAN_IE pItem;
-// BYTE byCheckEID = 0;
pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
+ WLAN_PROBERESP_OFF_SSID);
while( ((PBYTE)pItem) < (pFrame->pBuf + pFrame->len) ) {
- /*
- if (pItem->byElementID < byCheckEID)
- break;
- else
- byCheckEID = pItem->byElementID;
-*/
switch (pItem->byElementID) {
case WLAN_EID_SSID:
if (pFrame->pSSID == NULL)
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: 80211mgr.h
*
- * Purpose: Defines the macros, types, and functions for dealing
- * with 802.11 management frames.
+ * Purpose: 802.11 managment frames pre-defines.
+ *
*
* Author: Lyndon Chen
*
BYTE byHopIndex;
} WLAN_IE_FH_PARMS, *PWLAN_IE_FH_PARMS;
-
// DS Parameter Set
#pragma pack(1)
typedef struct tagWLAN_IE_DS_PARMS {
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: baseband.c
*
* Purpose: Implement functions to access baseband
* Add the comments.
* 09-01-2003 Bryan YC Fan: RF & BB tables updated.
* Modified BBvLoopbackOn & BBvLoopbackOff().
+ *
+ *
*/
+
#if !defined(__TMACRO_H__)
#include "tmacro.h"
#endif
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
+
/*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/
if (uRateIdx > RATE_54M) {
+ ASSERT(0);
return 0;
}
PSDevice pDevice = (PSDevice)hDeviceContext;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack...");
-
-
spin_lock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"3.[%08x][%08x], %d\n",(int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->uDiversityCnt);
add_timer(&pDevice->TimerSQ3Tmax3);
add_timer(&pDevice->TimerSQ3Tmax2);
- spin_unlock_irq(&pDevice->lock);
+ spin_unlock_irq(&pDevice->lock);
return;
}
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: baseband.h
*
* Purpose: Implement functions to access baseband
*
*/
-
#ifndef __BASEBAND_H__
#define __BASEBAND_H__
-
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#define TOP_RATE_2M 0x00200000
#define TOP_RATE_1M 0x00100000
+
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros ------------------------------*/
-
-
#define BBvClearFOE(dwIoBase) \
{ \
BBbWriteEmbeded(dwIoBase, 0xB1, 0); \
VOID BBvExitDeepSleep(DWORD_PTR dwIoBase, BYTE byLocalID);
// timer for antenna diversity
+
VOID
-TimerSQ3CallBack(
- IN HANDLE hDeviceContext
+TimerSQ3CallBack (
+ IN HANDLE hDeviceContext
);
+
VOID
TimerState1CallBack(
- IN HANDLE hDeviceContext
+ IN HANDLE hDeviceContext
);
void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
#ifdef __cplusplus
-} /* End of extern "C" { */
+} /* End of extern "C" { */
#endif /* __cplusplus */
#endif // __BASEBAND_H__
-
-
-
IN HANDLE hDeviceContext,
IN PBYTE pbyDesireBSSID,
IN PBYTE pbyDesireSSID,
- IN CARD_PHY_TYPE ePhyType
+ IN CARD_PHY_TYPE ePhyType
)
{
PSDevice pDevice = (PSDevice)hDeviceContext;
*pbyDesireBSSID,*(pbyDesireBSSID+1),*(pbyDesireBSSID+2),
*(pbyDesireBSSID+3),*(pbyDesireBSSID+4),*(pbyDesireBSSID+5));
if ((!IS_BROADCAST_ADDRESS(pbyDesireBSSID)) &&
- (memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)) {
+ (memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){
pbyBSSID = pbyDesireBSSID;
}
}
(pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) {
// SSID not match skip this BSS
continue;
- }
+ }
}
if (((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ||
((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo))
- ) {
+ ){
// Type not match skip this BSS
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSS type mismatch.... Config[%d] BSS[0x%04x]\n", pMgmt->eConfigMode, pCurrBSS->wCapInfo);
continue;
+
/*+
*
* Routine Description:
}
if (ii == MAX_BSS_NUM){
- DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Get free KnowBSS node failed.\n");
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get free KnowBSS node failed.\n");
return FALSE;
}
// save the BSS info
pIE_Country);
}
-
-
if ((bParsingQuiet == TRUE) && (pIE_Quiet != NULL)) {
if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) &&
(((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) {
if (pBSSList == NULL)
return FALSE;
+
HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp));
LODWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(LODWORD(qwTimestamp));
pBSSList->wBeaconInterval = cpu_to_le16(wBeaconInterval);
}
}
- WPA_ClearRSN(pBSSList); //mike update
+ WPA_ClearRSN(pBSSList); //mike update
if (pRSNWPA != NULL) {
UINT uLen = pRSNWPA->len + 2;
}
}
- WPA2_ClearRSN(pBSSList); //mike update
+ WPA2_ClearRSN(pBSSList); //mike update
if (pRSN != NULL) {
UINT uLen = pRSN->len + 2;
UINT uSleepySTACnt = 0;
UINT uNonShortSlotSTACnt = 0;
UINT uLongPreambleSTACnt = 0;
-viawget_wpa_header* wpahdr;
+ viawget_wpa_header* wpahdr; //DavidWang
spin_lock_irq(&pDevice->lock);
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof (wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- printk("wireless_send_event--->SIOCGIWAP(disassociated)\n");
+ PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) {
if (pMgmt->sNodeDBTable[ii].bActive) {
-
// Increase in-activity counter
pMgmt->sNodeDBTable[ii].uInActiveCount++;
if (ii > 0) {
if (pMgmt->sNodeDBTable[ii].uInActiveCount > MAX_INACTIVE_COUNT) {
BSSvRemoveOneNode(pDevice, ii);
- DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Inactive timeout [%d] sec, STA index = [%d] remove\n", MAX_INACTIVE_COUNT, ii);
continue;
}
}
// Rate fallback check
-
if (!pDevice->bFixRate) {
/*
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (ii == 0))
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyDesireSSID;
pCurrSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
-//printk("pCurrSSID=%s\n",pCurrSSID->abySSID);
+
if ((pMgmt->eCurrMode == WMAC_MODE_STANDBY) ||
(pMgmt->eCurrMode == WMAC_MODE_ESS_STA)) {
//if (pDevice->bUpdateBBVGA) {
// s_vCheckSensitivity((HANDLE) pDevice);
//}
+
if (pDevice->bUpdateBBVGA) {
// s_vCheckSensitivity((HANDLE) pDevice);
s_vCheckPreEDThreshold((HANDLE)pDevice);
}
+
if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) &&
(pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) ) {
pDevice->byBBVGANew = pDevice->abyBBVGA[0];
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL);
}
-
if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) {
pMgmt->sNodeDBTable[0].bActive = FALSE;
pMgmt->eCurrMode = WMAC_MODE_STANDBY;
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof (wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- printk("wireless_send_event--->SIOCGIWAP(disassociated)\n");
+ PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
- }
+ }
}
else if (pItemSSID->len != 0) {
if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++;
- #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
+ #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//network manager support need not do Roaming scan???
if(pDevice->bWPASuppWextEnabled ==TRUE)
pDevice->uAutoReConnectTime = 0;
#endif
-
}
else {
- //mike use old encryption status for wpa reauthen
+ //mike use old encryption status for wpa reauthen
if(pDevice->bWPADEVUp)
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
+
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n");
BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
- pMgmt->eScanType = WMAC_SCAN_ACTIVE;
+ pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0;
}
else {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scaning ...\n");
- pMgmt->eScanType = WMAC_SCAN_ACTIVE;
+ pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_SSID, NULL);
pDevice->uAutoReConnectTime = 0;
};
}
if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
+
if (pDevice->bUpdateBBVGA) {
//s_vCheckSensitivity((HANDLE) pDevice);
s_vCheckPreEDThreshold((HANDLE)pDevice);
return;
+
}
}
return;
}
+
//#if !defined(__DEVICE_H__)
//#include "device.h"
//#endif
+
#include <linux/skbuff.h>
+
#if !defined(__80211HDR_H__)
#include "80211hdr.h"
#endif
typedef struct tagSERPObject {
BOOL bERPExist;
BYTE byERP;
-} ERPObject, DEF* PERPObject;
+}ERPObject, DEF* PERPObject;
typedef struct tagSRSNCapObject {
BOOL bRSNCapExist;
WORD wRSNCap;
-} SRSNCapObject, DEF* PSRSNCapObject;
+}SRSNCapObject, DEF* PSRSNCapObject;
// BSS info(AP)
#pragma pack(1)
WORD wCapInfo;
BYTE abySSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
BYTE byRxRate;
+
// WORD wATIMWindow;
BYTE byRSSIStatCnt;
LONG ldBmMAX;
LONG ldBmAverage[RSSI_STAT_COUNT];
- LONG ldBmAverRange;
+ LONG ldBmAverRange;
//For any BSSID selection improvment
BOOL bSelected;
IN HANDLE hDeviceContext
);
+
VOID
BSSvUpdateNodeTxCounter(
IN HANDLE hDeviceContext,
#endif
+
+
+
/*--------------------- Export Definitions -------------------------*/
#define B_OWNED_BY_CHIP 1 //
#define CB_PROTOCOL_RESERVED_SECTION 16
+
// if retrys excess 15 times , tx will abort, and
// if tx fifo underflow, tx will fail
// we should try to resend it
//
-
-// device specific
//
+// device specific
+//
+
#if !defined(_KCOMPAT_H)
#include "kcompat.h"
#endif
#if !defined(__DESC_H__)
#include "desc.h"
#endif
-
#if !defined(__KEY_H__)
#include "key.h"
#endif
-
#if !defined(__MAC_H__)
#include "mac.h"
#endif
#define BB_VGA_CHANGE_THRESHOLD 16
+
#ifndef RUN_AT
#define RUN_AT(x) (jiffies+(x))
#endif
PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
} SPMKIDCandidateEvent, DEF* PSPMKIDCandidateEvent;
-
//--
//++ 802.11h related
BYTE abyAddr2[U_ETHER_ADDR_LEN];
} SCacheEntry, *PSCacheEntry;
-
typedef struct tagSCache{
/* The receive cache is updated circularly. The next entry to be written is
* indexed by the "InPtr".
-
//flags for options
#define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
typedef struct __device_opt {
- int nRxDescs0; //Number of RX descriptors0
- int nRxDescs1; //Number of RX descriptors1
- int nTxDescs[2]; //Number of TX descriptors 0, 1
- int int_works; //interrupt limits
- int rts_thresh; //rts threshold
+ int nRxDescs0; //Number of RX descriptors0
+ int nRxDescs1; //Number of RX descriptors1
+ int nTxDescs[2]; //Number of TX descriptors 0, 1
+ int int_works; //interrupt limits
+ int rts_thresh; //rts threshold
int frag_thresh;
int data_rate;
int channel_num;
BYTE byERPFlag;
WORD wUseProtectCntDown;
- BOOL bRadioControlOff;
- BOOL bRadioOff;
+ BOOL bRadioControlOff;
+ BOOL bRadioOff;
BOOL bEnablePSMode;
WORD wListenInterval;
BOOL bPWBitOn;
//2007-0925-01<Add>by MikeLiu
//mike add :save old Encryption
NDIS_802_11_WEP_STATUS eOldEncryptionStatus;
+
SKeyManagement sKey;
DWORD dwIVCounter;
RC4Ext SBox;
BYTE abyPRNG[WLAN_WEPMAX_KEYLEN+3];
-
BYTE byKeyIndex;
UINT uKeyLength;
BYTE abyKey[WLAN_WEP232_KEYLEN];
BYTE byBBPreEDRSSI;
BYTE byBBPreEDIndex;
+
BOOL bRadioCmd;
DWORD dwDiagRefCount;
/*
- * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- *
* File: device_cfg.h
*
* Purpose: Driver configuration header
#ifndef DEVICE_VERSION
#define DEVICE_VERSION "1.19.12"
#endif
+
//config file
#include <linux/fs.h>
#include <linux/fcntl.h>
);
+
static BOOL s_bAPModeRxData (
IN PSDevice pDevice,
IN struct sk_buff* skb,
return FALSE;
}
}
+
+
if (IS_FC_WEP(pbyFrame)) {
BOOL bRxDecryOK = FALSE;
}
return FALSE;
}
-
//mike add:station mode check eapol-key challenge--->
{
BYTE Protocol_Version; //802.1x Authentication
}
}
+
// Data frame Handle
+
if (pDevice->bEnablePSMode) {
if (IS_FC_MOREDATA((skb->data+4))) {
if (BITbIsBitOn(*pbyRsr, RSR_ADDROK)) {
pDevice->dev->name);
}
}
-
-//2008-0409-07, <Add> by Einsn Liu
+ //2008-0409-07, <Add> by Einsn Liu
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//send event to wpa_supplicant
//if(pDevice->bWPADevEnable == TRUE)
- {
+ {
union iwreq_data wrqu;
struct iw_michaelmicfailure ev;
int keyidx = pbyFrame[cbHeaderSize+3] >> 6; //top two-bits
}
#endif
+
+
if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) {
wpahdr = (viawget_wpa_header *)pDevice->skb->data;
if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) &&
}
return FALSE;
}
+
return TRUE;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TSC0_15: %x\n", *pwRxTSC15_0);
if (byDecMode == KEY_CTL_TKIP) {
+
if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || (bOnFly == FALSE)) {
// Software TKIP
// 1. 3253 A
-
-
static BOOL s_bAPModeRxData (
IN PSDevice pDevice,
IN struct sk_buff* skb,
BOOL bRelayOnly = FALSE;
BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
WORD wAID;
- struct sk_buff* skbcpy = NULL;
+ struct sk_buff* skbcpy = NULL;
if (FrameSize > CB_MAX_BUF_SIZE)
return FALSE;
if (pMgmt->sNodeDBTable[0].bPSEnable) {
skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz);
+
// if any node in PS mode, buffer packet until DTIM.
if (skbcpy == NULL) {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "relay multicast no skb available \n");
skbcpy->len = FrameSize;
memcpy(skbcpy->data, skb->data+cbHeaderOffset, FrameSize);
skb_queue_tail(&(pMgmt->sNodeDBTable[0].sTxPSQueue), skbcpy);
+
pMgmt->sNodeDBTable[0].wEnQueueCnt++;
// set tx map
pMgmt->abyPSTxMap[0] |= byMask[0];
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * File: whdr.h
+ * File: dpc.h
*
* Purpose:
*
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name);
- pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
+ pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
if (pDevice->apdev == NULL)
return -ENOMEM;
memset(pDevice->apdev, 0, sizeof(struct net_device));
*apdev_priv = *pDevice;
memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
- pDevice->apdev->netdev_ops = &apdev_netdev_ops;
+ pDevice->apdev->netdev_ops = &apdev_netdev_ops;
pDevice->apdev->type = ARPHRD_IEEE80211;
WLAN_GET_CAP_INFO_SHORTPREAMBLE(pMgmt->sNodeDBTable[uNodeIndex].wCapInfo);
pMgmt->sNodeDBTable[uNodeIndex].wAID = (WORD)param->u.add_sta.aid;
+
pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer = jiffies;
+
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Add STA AID= %d \n", pMgmt->sNodeDBTable[uNodeIndex].wAID);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MAC=%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X \n",
param->sta_addr[0],
if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) {
param->u.get_info_sta.inactive_sec =
(jiffies - pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer) / HZ;
+
//param->u.get_info_sta.txexc = pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts;
}
else {
/*
- * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
WLAN_CMD_SET_HOST_WEP,
WLAN_CMD_SET_WPA,
WLAN_CMD_GET_NODE_CNT,
- WLAN_CMD_ZONETYPE_SET,
+ WLAN_CMD_ZONETYPE_SET,
WLAN_CMD_GET_NODE_LIST
} WMAC_CMD, DEF* PWMAC_CMD;
- typedef enum tagWZONETYPE {
+typedef enum tagWZONETYPE {
ZoneType_USA=0,
ZoneType_Japan=1,
ZoneType_Europe=2
#define WEP_104BIT_LEN 13
#define WEP_232BIT_LEN 16
-
// Ioctl interface structure
// Command structure
//
U16 wCmdCode;
} SCmdRequest, *PSCmdRequest;
-
//
// Scan
//
} SCmdBSSJoin, *PSCmdBSSJoin;
+//
+// Zonetype Setting
+//
+
typedef struct tagSCmdZoneTypeSet {
BOOL bWrite;
} SWPAResult, *PSWPAResult;
#endif
-
typedef struct tagSCmdStartAP {
U16 wBSSType;
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
-/*--------------------- Static Functions --------------------------*/
-
#ifdef WPA_SM_Transtatus
SWPAResult wpa_Result;
#endif
+/*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/
BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
LONG ldBm;
-
pReq->wResult = 0;
switch(pReq->wCmdCode) {
break;
case WLAN_CMD_SET_WEP:
-
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_SET_WEP Key. \n");
memset(&sWEPCmd, 0 ,sizeof(SCmdSetWEP));
if (copy_from_user(&sWEPCmd, pReq->data, sizeof(SCmdSetWEP))) {
wpa_Result.key_mgmt = 0;
wpa_Result.eap_type = 0;
wpa_Result.authenticated = FALSE;
- pDevice->fWPA_Authened = FALSE;
+ pDevice->fWPA_Authened = FALSE;
if (copy_from_user(&wpa_Result, pReq->data, sizeof(wpa_Result))) {
result = -EFAULT;
break;
}
- if(wpa_Result.authenticated==TRUE) {
+if(wpa_Result.authenticated==TRUE) {
#ifdef SndEvt_ToAPI
{
union iwreq_data wrqu;
break;
#endif
-
default:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Private command not support..\n");
}
/*
- * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{
PSDevice pDevice = netdev_priv(dev);
long ldBm;
+
pDevice->wstats.status = pDevice->eOPMode;
#ifdef Calcu_LinkQual
#if 0
return 0;
}
-
/*
* Wireless Handler : get protocol name
*/
char *extra)
{
PSDevice pDevice = (PSDevice)netdev_priv(dev);
- struct iw_scan_req *req = (struct iw_scan_req *)extra;
- PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
+ PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
+ struct iw_scan_req *req = (struct iw_scan_req *)extra;
BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
PWLAN_IE_SSID pItemSSID=NULL;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWSCAN \n");
if(pDevice->byReAssocCount > 0) { //reject scan when re-associating!
//send scan event to wpa_Supplicant
union iwreq_data wrqu;
- printk("wireless_send_event--->SIOCGIWSCAN(scan done)\n");
+ PRINT_K("wireless_send_event--->SIOCGIWSCAN(scan done)\n");
memset(&wrqu, 0, sizeof(wrqu));
wireless_send_event(pDevice->dev, SIOCGIWSCAN, &wrqu, NULL);
return 0;
}
spin_lock_irq(&pDevice->lock);
- BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
+ BSSvClearBSSList((HANDLE)pDevice, pDevice->bLinkPass);
//mike add: active scan OR passive scan OR desire_ssid scan
if(wrq->length == sizeof(struct iw_scan_req)) {
else
pItemSSID->len = req->essid_len;
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
- printk("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",((PWLAN_IE_SSID)abyScanSSID)->abySSID,
+ PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",((PWLAN_IE_SSID)abyScanSSID)->abySSID,
((PWLAN_IE_SSID)abyScanSSID)->len);
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
spin_unlock_irq(&pDevice->lock);
}
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
+ //printk("SIOCSIWSCAN:WLAN_CMD_BSSID_SCAN\n");
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
spin_unlock_irq(&pDevice->lock);
break;
pBSS = &(pMgmt->sBSSList[jj]);
if (pBSS->bActive) {
+ //ADD mac address
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, pBSS->abyBSSID, WLAN_BSSID_LEN);
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
//ADD ssid
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWESSID;
pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
iwe.u.data.length = pItemSSID->len;
iwe.u.data.flags = 1;
- current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
+ current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
//ADD mode
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWMODE;
iwe.u.mode = IW_MODE_ADHOC;
}
iwe.len = IW_EV_UINT_LEN;
- current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
+ current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
//ADD frequency
pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates;
pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates;
iwe.u.freq.m = pBSS->uChannel;
iwe.u.freq.e = 0;
iwe.u.freq.i = 0;
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
-
-
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
//2008-0409-04, <Add> by Einsn Liu
{
int f = (int)pBSS->uChannel - 1;
iwe.u.freq.m = frequency_list[f] * 100000;
iwe.u.freq.e = 1;
}
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
//ADD quality
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000);
- current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
- }
+ current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
+ }
for (kk = 0 ; kk < 8 ; kk++) {
if (pExtSuppRates->abyRates[kk] == 0)
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000);
- current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
+ current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
}
if((current_val - current_ev) > IW_EV_LCP_LEN)
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);
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
- BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
+ BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWAP \n");
if (pMgmt->eScanState == WMAC_IS_SCANNING) {
//mike :add
if ((IS_BROADCAST_ADDRESS(pMgmt->abyDesireBSSID)) ||
(memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)){
- printk("SIOCSIWAP:invalid desired BSSID return!\n");
+ PRINT_K("SIOCSIWAP:invalid desired BSSID return!\n");
return rc;
}
//mike add: if desired AP is hidden ssid(there are two same BSSID in list),
}
}
if(uSameBssidNum >= 2) { //hit: desired AP is in hidden ssid mode!!!
- printk("SIOCSIWAP:ignore for desired AP in hidden mode\n");
+ PRINT_K("SIOCSIWAP:ignore for desired AP in hidden mode\n");
return rc;
}
}
+
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
pDevice->bCommit = TRUE;
}
}
// Check if we asked for `any'
if(wrq->flags == 0) {
- // Just send an empty SSID list
// Just send an empty SSID list
memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memset(pMgmt->abyDesireBSSID, 0xFF,6);
- printk("set essid to 'any' \n");
+ PRINT_K("set essid to 'any' \n");
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//Unknown desired AP,so here need not associate??
//if(pDevice->bWPASuppWextEnabled == TRUE) {
memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyDesireSSID;
pItemSSID->byElementID = WLAN_EID_SSID;
+
memcpy(pItemSSID->abySSID, extra, wrq->length);
- if (pItemSSID->abySSID[wrq->length - 1] == '\0') {
+ if (pItemSSID->abySSID[wrq->length - 1] == '\0') {
if(wrq->length>0)
pItemSSID->len = wrq->length - 1;
}
(memcmp(pItemSSID->abySSID,((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID,len)==0))
return 0;
- //mike:need clear desiredBSSID
+ //mike:need clear desiredBSSID
if(pItemSSID->len==0) {
memset(pMgmt->abyDesireBSSID, 0xFF,6);
return 0;
);
if (pCurr == NULL){
- printk("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
+ PRINT_K("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
vResetCommandTimer((HANDLE) pDevice);
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((HANDLE) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
#endif
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID);
-/*
- DBG_PRT(MSG_LEVEL_INFO, KERN_INFO " SIOCSIWESSID2 \n");
- pItemSSID->len = wrq->length;
- */
}
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
printk("Rate Fix\n");
pDevice->bFixRate = TRUE;
if ((pDevice->byBBType == BB_TYPE_11B)&& (brate > 3)) {
-
- pDevice->uConnectionRate = 3;
+ pDevice->uConnectionRate = 3;
}
else {
pDevice->uConnectionRate = brate;
pDevice->bFixRate = FALSE;
pDevice->uConnectionRate = 13;
printk("auto rate:connection_rate is 13\n");
-}
+ }
return rc;
}
//End Modify,Einsn
/*
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWENCODE \n");
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWENCODE \n");
// Check the size of the key
if (wrq->length > WLAN_WEP232_KEYLEN) {
return 0;
}
+
/*
* Wireless Handler : set power mode
*/
case IW_AUTH_WPA_VERSION:
wpa_version = wrq->value;
if(wrq->value == IW_AUTH_WPA_VERSION_DISABLED) {
- printk("iwctl_siwauth:set WPADEV to disable at 1??????\n");
+ PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n");
//pDevice->bWPADevEnable = FALSE;
}
else if(wrq->value == IW_AUTH_WPA_VERSION_WPA) {
- printk("iwctl_siwauth:set WPADEV to WPA1******\n");
+ PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n");
}
else {
- printk("iwctl_siwauth:set WPADEV to WPA2******\n");
+ PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n");
}
//pDevice->bWPASuppWextEnabled =TRUE;
break;
case IW_AUTH_CIPHER_PAIRWISE:
pairwise = wrq->value;
-
if(pairwise == IW_AUTH_CIPHER_CCMP){
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;
}else if(pairwise == IW_AUTH_CIPHER_TKIP){
//original member
wpa_alg alg_name;
u8 addr[6];
- int key_idx, set_tx;
+ int key_idx, set_tx=0;
u8 seq[IW_ENCODE_SEQ_MAX_SIZE];
u8 key[64];
- size_t seq_len,key_len=0;
+ size_t seq_len=0,key_len=0;
//
// int ii;
u8 *buf;
u8 key_array[64];
int ret=0;
-printk("SIOCSIWENCODEEXT...... \n");
+PRINT_K("SIOCSIWENCODEEXT...... \n");
blen = sizeof(*param);
buf = kmalloc((int)blen, (int)GFP_KERNEL);
alg_name = WPA_ALG_CCMP;
break;
default:
- printk("Unknown alg = %d\n",ext->alg);
+ PRINT_K("Unknown alg = %d\n",ext->alg);
ret= -ENOMEM;
goto error;
}
param->u.wpa_key.seq_len = seq_len;
#if 0
-int ii;
printk("param->u.wpa_key.alg_name =%d\n",param->u.wpa_key.alg_name);
printk("param->addr=%02x:%02x:%02x:%02x:%02x:%02x\n",
param->addr[0],param->addr[1],param->addr[2],
struct iw_point *wrq,
char *extra);
#endif // #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
+//End Add -- //2008-0409-07, <Add> by Einsn Liu
extern const struct iw_handler_def iwctl_handler_def;
/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
+ * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef IRQ_RETVAL
typedef void irqreturn_t;
+
#define IRQ_RETVAL(x)
#endif
#define MODULE_LICESEN(x)
#endif
-
#endif
(pTable->KeyTable[i].GroupKey[2].bKeyValid == FALSE) &&
(pTable->KeyTable[i].GroupKey[3].bKeyValid == FALSE)
) {
+
pTable->KeyTable[i].bInUse = FALSE;
pTable->KeyTable[i].wKeyCtl = 0;
pTable->KeyTable[i].bSoftWEP = FALSE;
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: mac.c
*
* Purpose: MAC routines
*
*/
+
+
#if !defined(__TMACRO_H__)
#include "tmacro.h"
#endif
/*--------------------- Export Functions --------------------------*/
+
+
+
+
/*
* Description:
* Read All MAC Registers to buffer
* Author: Tevin Chen
*
* Date: May 21, 1996
+ *
* Revision History:
* 07-01-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
* 08-25-2003 Kyle Hsu: Porting MAC functions from sim53.
* 09-03-2003 Bryan YC Fan: Add MACvDisableProtectMD & MACvEnableProtectMD
- *
*/
#ifndef __MAC_H__
#define __MAC_H__
-
-
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#define MAC_REG_IFREGCTL 0x70 //
#define MAC_REG_IFDATA 0x71 //
#define MAC_REG_ITRTMSET 0x74 //
-#define MAC_REG_PAPEDELAY 0x77 //
+#define MAC_REG_PAPEDELAY 0x77
#define MAC_REG_SOFTPWRCTL 0x78 //
#define MAC_REG_GPIOCTL0 0x7A //
#define MAC_REG_GPIOCTL1 0x7B //
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: power.c
*
* Purpose: Handles 802.11 power management functions
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- *
* File: power.h
*
* Purpose: Handles 802.11 power management functions
/*
- * File: rc4.c
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ * File: rc4.c
+ *
* Purpose:
*
* Functions:
* Revision History:
*
*/
+
#if !defined(__MAC_H__)
#include "mac.h"
#endif
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * File: whdr.h
+ * File: rxtx.h
*
* Purpose:
*
#endif
-/*--------------------- Export Definitions -------------------------*/
+/*--------------------- Export Definitions -------------------------*/
+
#define EEP_MAX_CONTEXT_SIZE 256
#define CB_EEPROM_READBYTE_WAIT 900 //us
//
// Contents in the EEPROM
//
-
#define EEP_OFS_PAR 0x00 // physical address
#define EEP_OFS_ANTENNA 0x16
#define EEP_OFS_RADIOCTL 0x17
#define EEP_RADIOCTL_ENABLE 0x80
#define EEP_RADIOCTL_INV 0x01
-
-
/*--------------------- Export Types ------------------------------*/
// AT24C02 eeprom contents
#endif // __EEPROM_H__
-
-
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
+
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
*
*
* File: tpci.h
/*
- * File: ttype.h
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ * File: ttype.h
+ *
* Purpose: define basic common types and macros
*
* Author: Tevin Chen
#if !defined(__CARD_H__)
#include "card.h"
#endif
+#include "wpa2.h"
/*--------------------- Export Definitions -------------------------*/
#define RATE_1M 0
#define MAX_BSS_NUM 42
-#define MAX_PMKID_CACHE 16
-
// Pre-configured Authenticaiton Mode (from XP)
typedef enum tagWMAC_AUTHENTICATION_MODE {
- /*
+/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- *
* File: wcmd.c
*
* Purpose: Handles the management command interface functions
IN PWLAN_IE_SUPP_RATES pCurrExtSuppRates
);
+
static
BOOL
s_bCommandComplete (
/*--------------------- Export Functions --------------------------*/
+
/*
* Description:
* Stop AdHoc beacon during scan process
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
}
-}
+} /* vAdHocBeaconStop */
+
/*
* Description:
+
+
/*+
*
* Routine Description:
+
VOID
vCommandTimerWait(
IN HANDLE hDeviceContext,
+
VOID
vCommandTimer (
IN HANDLE hDeviceContext
#define AUTHENTICATE_TIMEOUT 1000 //ms
#define ASSOCIATE_TIMEOUT 1000 //ms
+
// Command code
typedef enum tagCMD_CODE {
WLAN_CMD_BSSID_SCAN,
#define CMD_Q_SIZE 32
-
-// Command code
typedef enum tagCMD_STATUS {
- CMD_STATUS_SUCCESS,
+ CMD_STATUS_SUCCESS = 0,
CMD_STATUS_FAILURE,
CMD_STATUS_RESOURCES,
CMD_STATUS_TIMEOUT,
} CMD_STATE, DEF* PCMD_STATE;
+
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
-
VOID
vResetCommandTimer(
IN HANDLE hDeviceContext
IN HANDLE hDeviceContext
);
#endif
+
#endif //__WCMD_H__
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: wmgr.c
*
* Purpose: Handles the 802.11 management functions
IN PSDevice pDevice,
IN BYTE byCurrChannel
);
+
// Association/diassociation functions
static
PSTxMgmtPacket
OUT PBYTE pbyCCSGK
);
-
static VOID Encyption_Rebuild(
IN PSDevice pDevice,
IN PKnownBSS pCurr
);
-/*
-static
-VOID
-s_vProbeChannel(
- IN PSDevice pDevice
- );
-
-static
-VOID
-s_vListenChannel(
- IN PSDevice pDevice
- );
-
-static
-PSTxMgmtPacket
-s_MgrMakeProbeRequest(
- IN PSMgmtObject pMgmt,
- IN PBYTE pScanBSSID,
- IN PWLAN_IE_SSID pSSID,
- IN PWLAN_IE_SUPP_RATES pCurrRates
- );
-*/
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
-
}
/* else, ignore it */
pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
};
- #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
+ #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
// if(pDevice->bWPASuppWextEnabled == TRUE)
{
union iwreq_data wrqu;
memset(&wrqu, 0, sizeof (wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- printk("wireless_send_event--->SIOCGIWAP(disauthen)\n");
+ PRINT_K("wireless_send_event--->SIOCGIWAP(disauthen)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK;
if(pCurr->abyPKType[0] == WPA_TKIP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP
- printk("Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
+ PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
}
else if(pCurr->abyPKType[0] == WPA_AESCCMP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; //AES
- printk("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
+ PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
}
}
else if(pCurr->bWPA2Valid == TRUE) { //WPA2-PSK
pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK;
if(pCurr->abyCSSPK[0] == WLAN_11i_CSS_TKIP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP
- printk("Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
+ PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
}
else if(pCurr->abyCSSPK[0] == WLAN_11i_CSS_CCMP) {
pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled; //AES
- printk("Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
+ PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
}
}
}
*pbyRSN++=0x01;
*pbyRSN++=0x00;
*pbyRSN++=0x00;
+
*pbyRSN++=0x50;
*pbyRSN++=0xf2;
if (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) {
else {
*pbyRSN++=WPA_NONE;
}
+
sFrame.pRSNWPA->len +=6;
// RSN Capabilites
+
*pbyRSN++=0x00;
*pbyRSN++=0x00;
sFrame.pRSNWPA->len +=2;
+
sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
*pbyRSN++=0x01;
*pbyRSN++=0x00;
*pbyRSN++=0x00;
+
*pbyRSN++=0x50;
*pbyRSN++=0xf2;
if (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) {
} else {
*pbyRSN++=WPA_NONE;
}
+
sFrame.pRSNWPA->len +=6;
// RSN Capabilites
*pbyRSN++=0x00;
*pbyRSN++=0x00;
sFrame.pRSNWPA->len +=2;
+
sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
// copy to AssocInfo. for OID_802_11_ASSOCIATION_INFORMATION
pMgmt->sAssocInfo.AssocInfo.RequestIELength += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN;
case WLAN_FSTYPE_BEACON:
// Frame Clase = 0
- // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx beacon\n");
+ //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx beacon\n");
if (pMgmt->eScanState != WMAC_NO_SCANNING) {
bInScan = TRUE;
};
return FALSE;
// check cap. of BSS
-
if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) &&
(EncStatus == Ndis802_11Encryption1Enabled)) {
// default is WEP only
if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) &&
(pBSSNode->bWPA2Valid == TRUE) &&
+ //20080123-01,<Add> by Einsn Liu
((EncStatus == Ndis802_11Encryption3Enabled)||(EncStatus == Ndis802_11Encryption2Enabled))) {
-
//WPA2
// check Group Key Cipher
if ((pBSSNode->byCSSGK == WLAN_11i_CSS_WEP40) ||
i = pBSSNode->wCSSPKCount;
}
}
+
} else if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) &&
(pBSSNode->bWPAValid == TRUE) &&
- ((EncStatus == Ndis802_11Encryption3Enabled)||(EncStatus == Ndis802_11Encryption2Enabled))) {
-
+ ((EncStatus == Ndis802_11Encryption3Enabled) || (EncStatus == Ndis802_11Encryption2Enabled))) {
//WPA
// check Group Key Cipher
if ((pBSSNode->byGKType == WPA_WEP40) ||
// mask our cap. with BSS
if (EncStatus == Ndis802_11Encryption1Enabled) {
+
// For supporting Cisco migration mode, don't care pairwise key cipher
if ((byMulticastCipher == KEY_CTL_WEP) &&
(byCipherMask == 0)) {
#if !defined(__BSSDB_H__)
#include "bssdb.h"
#endif
-#if !defined(__VNTWIFI_H__)
-#include "vntwifi.h"
-#endif
+
/*--------------------- Export Definitions -------------------------*/
+#define MAX_PMKID_CACHE 16
typedef struct tagsPMKIDInfo {
BYTE abyBSSID[6];
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
+ *
* File: wpactl.c
*
* Purpose: handle wpa supplicant ioctl input/out functions
/*--------------------- Export Variables --------------------------*/
-
-
static void wpadev_setup(struct net_device *dev)
{
dev->type = ARPHRD_IEEE80211;
dev->flags = IFF_BROADCAST|IFF_MULTICAST;
}
-
-
/*
* Description:
* register netdev for wpa supplicant deamon
wpadev_priv = netdev_priv(pDevice->wpadev);
*wpadev_priv = *pDevice;
-
memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN);
pDevice->wpadev->base_addr = dev->base_addr;
pDevice->wpadev->irq = dev->irq;
static int wpa_release_wpadev(PSDevice pDevice)
{
-
if (pDevice->skb) {
dev_kfree_skb(pDevice->skb);
pDevice->skb = NULL;
int wpa_set_wpadev(PSDevice pDevice, int val)
{
-
-
if (val)
return wpa_init_wpadev(pDevice);
else
*
*/
-int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel)
+ int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel)
{
- struct viawget_wpa_param *param=ctx;
+ struct viawget_wpa_param *param=ctx;
PSMgmtObject pMgmt = pDevice->pMgmt;
DWORD dwKeyIndex = 0;
BYTE abyKey[MAX_KEY_LEN];
else {
spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.key &&
- copy_from_user(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len)){
- spin_lock_irq(&pDevice->lock);
+ copy_from_user(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len)) {
+ spin_lock_irq(&pDevice->lock);
return -EINVAL;
}
spin_lock_irq(&pDevice->lock);
else {
spin_unlock_irq(&pDevice->lock);
if (param->u.wpa_key.seq &&
- copy_from_user(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len)){
-
- spin_lock_irq(&pDevice->lock);
+ copy_from_user(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len)) {
+ spin_lock_irq(&pDevice->lock);
return -EINVAL;
}
spin_lock_irq(&pDevice->lock);
if (param->u.wpa_key.set_tx)
dwKeyIndex |= (1 << 31);
+
if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled)
byKeyDecMode = KEY_CTL_CCMP;
else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled)
byKeyDecMode = KEY_CTL_WEP;
}
-
// Check TKIP key length
if ((byKeyDecMode == KEY_CTL_TKIP) &&
(param->u.wpa_key.key_len != MAX_KEY_LEN)) {
#if !defined(__DEVICE_H__)
#include "device.h"
#endif
+
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
#if !defined(__IOWPA_H__)
#include "iowpa.h"