void BSSvUpdateAPNode(struct vnt_private *pDevice, u16 *pwCapInfo,
PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates)
{
- struct vnt_manager *pMgmt = &(pDevice->sMgmtObj);
+ struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
u32 uRateLen = WLAN_RATES_MAXLEN;
memset(&pMgmt->sNodeDBTable[0], 0, sizeof(KnownNodeDB));
}
pDevice->uDIFS = C_SIFS_BG + 2*pDevice->uSlot;
- pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->sMgmtObj.abyCurrSuppRates;
+ pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->vnt_mgmt.abyCurrSuppRates;
for (ii = 0; ii < pItemRates->len; ii++) {
byRate = (BYTE)(pItemRates->abyRates[ii]&0x7F);
if (RATEwGetRateIdx(byRate) > RATE_11M) {
}
}
if (bOFDMRate == FALSE) {
- pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->sMgmtObj.abyCurrExtSuppRates;
+ pItemRates = (PWLAN_IE_SUPP_RATES)pDevice->vnt_mgmt
+ .abyCurrExtSuppRates;
for (ii = 0; ii < pItemRates->len; ii++) {
byRate = (BYTE)(pItemRates->abyRates[ii]&0x7F);
if (RATEwGetRateIdx(byRate) > RATE_11M) {
{
int bResult = TRUE;
- if (byCount == 0) {
- pDevice->sMgmtObj.uCurrChannel = byNewChannel;
- CARDbSetMediaChannel(pDevice, byNewChannel);
-
- return bResult;
- }
+ if (byCount == 0) {
+ pDevice->vnt_mgmt.uCurrChannel = byNewChannel;
+ CARDbSetMediaChannel(pDevice, byNewChannel);
+ return bResult;
+ }
pDevice->byChannelSwitchCount = byCount;
pDevice->byNewChannel = byNewChannel;
pDevice->bChannelSwitch = TRUE;
} OPTIONS, *POPTIONS;
-typedef struct vnt_private {
+struct vnt_private {
// netdev
struct usb_device* usb;
unsigned long RcvBuffersInUse;
- // 802.11 management
+ /* 802.11 management */
struct vnt_manager vnt_mgmt;
- SMgmtObject sMgmtObj;
u64 qwCurrTSF;
unsigned int cbBulkInMax;
struct iw_statistics wstats; // wireless stats
BOOL bCommit;
-} DEVICE_INFO, *PSDevice;
+};
RSC += wRxTSC15_0;
memcpy(&(pKey->KeyRSC), &RSC, sizeof(u64));
- if ( (pDevice->sMgmtObj.eCurrMode == WMAC_MODE_ESS_STA) &&
- (pDevice->sMgmtObj.eCurrState == WMAC_STATE_ASSOC)) {
- // check RSC
+ if (pDevice->vnt_mgmt.eCurrMode == WMAC_MODE_ESS_STA &&
+ pDevice->vnt_mgmt.eCurrState == WMAC_STATE_ASSOC) {
+ /* check RSC */
if ( (wRxTSC15_0 < wLocalTSC15_0) &&
(dwRxTSC47_16 <= dwLocalTSC47_16) &&
!((dwRxTSC47_16 == 0) && (dwLocalTSC47_16 == 0xFFFFFFFF))) {
static int s_bAPModeRxCtl(struct vnt_private *pDevice, u8 *pbyFrame,
s32 iSANodeIndex)
{
- struct vnt_manager *pMgmt = &(pDevice->sMgmtObj);
+ struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
PS802_11Header p802_11Header;
CMD_STATUS Status;
}
ASSERT(pRCB);// cannot be NULL
pRxPacket = &(pRCB->sMngPacket);
- vMgrRxManagePacket((void *) pDevice, &(pDevice->sMgmtObj), pRxPacket);
+ vMgrRxManagePacket(pDevice, &pDevice->vnt_mgmt, pRxPacket);
pRCB->Ref--;
if(pRCB->Ref == 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeMng %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList);
int ii;
u8 pbyData[24];
- if ( pDevice->byLocalID <= MAC_REVISION_A1 ) {
- if ( pDevice->sMgmtObj.byCSSPK == KEY_CTL_CCMP )
- return;
- }
+ if (pDevice->byLocalID <= MAC_REVISION_A1)
+ if (pDevice->vnt_mgmt.byCSSPK == KEY_CTL_CCMP)
+ return;
wOffset = MISCFIFO_KEYETRY0;
wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
spin_lock_init(&pDevice->lock);
pDevice->tx_80211 = device_dma0_tx_80211;
- pDevice->sMgmtObj.pAdapter = (void *) pDevice;
+ pDevice->vnt_mgmt.pAdapter = (void *) pDevice;
netdev->netdev_ops = &device_netdev_ops;
netdev->wireless_handlers =
// Init for Key Management
KeyvInitTable(pDevice,&pDevice->sKey);
- memcpy(pDevice->sMgmtObj.abyMACAddr, pDevice->abyCurrentNetAddr, ETH_ALEN);
+ memcpy(pDevice->vnt_mgmt.abyMACAddr,
+ pDevice->abyCurrentNetAddr, ETH_ALEN);
memcpy(pDevice->dev->dev_addr, pDevice->abyCurrentNetAddr, ETH_ALEN);
pDevice->bStopTx0Pkt = FALSE;
pDevice->bStopDataPkt = FALSE;
tasklet_init(&pDevice->RxMngWorkItem, (void *)RXvMngWorkItem, (unsigned long)pDevice);
tasklet_init(&pDevice->ReadWorkItem, (void *)RXvWorkItem, (unsigned long)pDevice);
tasklet_init(&pDevice->EventWorkItem, (void *)INTvWorkItem, (unsigned long)pDevice);
- add_timer(&(pDevice->sMgmtObj.sTimerSecondCallback));
+ add_timer(&pDevice->vnt_mgmt.sTimerSecondCallback);
pDevice->int_interval = 100; //Max 100 microframes.
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
}
- if (pDevice->sMgmtObj.eConfigMode == WMAC_CONFIG_AP) {
+ if (pDevice->vnt_mgmt.eConfigMode == WMAC_CONFIG_AP)
bScheduleCommand((void *) pDevice, WLAN_CMD_RUN_AP, NULL);
- }
- else {
- //mike:mark@2008-11-10
- bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
- /* bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL); */
- }
+ else
+ bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
netif_stop_queue(pDevice->dev);
bResult &= IFRFbWriteEmbedded(pDevice, dwVT3226Pwr);
bResult &= IFRFbWriteEmbedded(pDevice, 0x03C6A200+(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
- if (pDevice->sMgmtObj.eScanState != WMAC_NO_SCANNING) {
- // scanning, the channel number is pDevice->uScanChannel
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"@@@@ RFbRawSetPower> 11B mode uCurrChannel[%d]\n", pDevice->sMgmtObj.uScanChannel);
- bResult &= IFRFbWriteEmbedded(pDevice, dwVT3226D0LoCurrentTable[pDevice->sMgmtObj.uScanChannel-1]); //RobertYu:20060420, sometimes didn't change channel just set power with different rate
- } else {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"@@@@ RFbRawSetPower> 11B mode uCurrChannel[%d]\n", pDevice->sMgmtObj.uCurrChannel);
- bResult &= IFRFbWriteEmbedded(pDevice, dwVT3226D0LoCurrentTable[pDevice->sMgmtObj.uCurrChannel-1]); //RobertYu:20060420, sometimes didn't change channel just set power with different rate
- }
+ if (pDevice->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
+ /* scanning, channel number is pDevice->uScanChannel */
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ pDevice->vnt_mgmt.uScanChannel);
+ bResult &= IFRFbWriteEmbedded(pDevice,
+ dwVT3226D0LoCurrentTable[pDevice->
+ vnt_mgmt.uScanChannel - 1]);
+ } else {
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ pDevice->vnt_mgmt.uCurrChannel);
+ bResult &= IFRFbWriteEmbedded(pDevice,
+ dwVT3226D0LoCurrentTable[pDevice->
+ vnt_mgmt.uCurrChannel - 1]);
+ }
bResult &= IFRFbWriteEmbedded(pDevice, 0x015C0800+(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW); //RobertYu:20060420, ok now, new switching power (mini-pci can have bigger power consumption)
} else {
///////////////////////////////////////////////////////////////////
- if (pDevice->sMgmtObj.eAuthenMode == WMAC_AUTH_WPANONE) {
- dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]);
- dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]);
- }
+ if (pDevice->vnt_mgmt.eAuthenMode == WMAC_AUTH_WPANONE) {
+ dwMICKey0 = *(u32 *)(&pTransmitKey->abyKey[16]);
+ dwMICKey1 = *(u32 *)(&pTransmitKey->abyKey[20]);
+ }
else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) {
dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]);
dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]);
/* Tx Management Packet descriptor */
-typedef struct vnt_tx_mgmt {
+struct vnt_tx_mgmt {
PUWLAN_80211HDR p80211Header;
u32 cbMPDULen;
u32 cbPayloadLen;
-} STxMgmtPacket, *PSTxMgmtPacket;
+};
/* Rx Management Packet descriptor */
-typedef struct vnt_rx_mgmt {
+struct vnt_rx_mgmt {
PUWLAN_80211HDR p80211Header;
u64 qwLocalTSF;
u32 cbMPDULen;
u8 bySQ;
u8 byRxRate;
u8 byRxChannel;
-} SRxMgmtPacket, *PSRxMgmtPacket;
+};
-typedef struct vnt_manager {
+struct vnt_manager {
void *pAdapter;
// MAC address
BYTE abyMACAddr[WLAN_ADDR_LEN];
struct sk_buff skb;
-} SMgmtObject, *PSMgmtObject;
+};
/*--------------------- Export Macros ------------------------------*/