Using the nl80211 header.
Using enum changes
OP_MODE_ADHOC -> NL80211_IFTYPE_ADHOC
OP_MODE_AP -> NL80211_IFTYPE_AP
OP_MODE_INFRASTRUCTURE -> NL80211_IFTYPE_STATION
OP_MODE_UNKNOWN -> NL80211_IFTYPE_UNSPECIFIED
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if ((pDevice->bStopBeacon == false) &&
(pDevice->bBeaconBufReady == true) &&
- (pDevice->eOPMode == OP_MODE_ADHOC)) {
+ (pDevice->op_mode == NL80211_IFTYPE_ADHOC)) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
}
*
*/
bool CARDbSetBSSID(struct vnt_private *pDevice,
- unsigned char *pbyBSSID, CARD_OP_MODE eOPMode)
+ unsigned char *pbyBSSID, enum nl80211_iftype op_mode)
{
MACvWriteBSSIDAddress(pDevice->PortOffset, pbyBSSID);
memcpy(pDevice->abyBSSID, pbyBSSID, WLAN_BSSID_LEN);
- if (eOPMode == OP_MODE_ADHOC)
+ if (op_mode == NL80211_IFTYPE_ADHOC)
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
else
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
- if (eOPMode == OP_MODE_AP)
+ if (op_mode == NL80211_IFTYPE_AP)
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_AP);
else
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_AP);
- if (eOPMode == OP_MODE_UNKNOWN) {
+ if (op_mode == NL80211_IFTYPE_UNSPECIFIED) {
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID);
pDevice->bBSSIDFilter = false;
pDevice->byRxMode &= ~RCR_BSSID;
pr_debug("wmgr: rx_mode = %x\n", pDevice->byRxMode);
}
// Adopt BSS state in Adapter Device Object
- pDevice->eOPMode = eOPMode;
+ pDevice->op_mode = op_mode;
return true;
}
#include "ttype.h"
#include <linux/types.h>
+#include <linux/nl80211.h>
//
// Loopback mode
CARD_STATUS_PMKID
} CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
-typedef enum _CARD_OP_MODE {
- OP_MODE_INFRASTRUCTURE,
- OP_MODE_ADHOC,
- OP_MODE_AP,
- OP_MODE_UNKNOWN
-} CARD_OP_MODE, *PCARD_OP_MODE;
-
struct vnt_private;
void CARDvSetRSPINF(struct vnt_private *, CARD_PHY_TYPE ePHYType);
bool CARDbStartTxPacket(struct vnt_private *, CARD_PKT_TYPE ePktType);
bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval);
bool CARDbSetBSSID(struct vnt_private *,
- unsigned char *pbyBSSID, CARD_OP_MODE eOPMode);
+ unsigned char *pbyBSSID, enum nl80211_iftype);
bool CARDbPowerDown(struct vnt_private *);
unsigned short wFragmentationThreshold;
unsigned char byShortRetryLimit;
unsigned char byLongRetryLimit;
- CARD_OP_MODE eOPMode;
+ enum nl80211_iftype op_mode;
unsigned char byOpMode;
bool bBSSIDFilter;
unsigned short wMaxTransmitMSDULifetime;
}
}
if (pDevice->bChannelSwitch &&
- (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)) {
+ (pDevice->op_mode == NL80211_IFTYPE_STATION)) {
pDevice->byChannelSwitchCount--;
if (pDevice->byChannelSwitchCount == 0) {
pDevice->bChannelSwitch = false;
}
}
- if (pDevice->eOPMode != OP_MODE_ADHOC) {
+ if (pDevice->op_mode != NL80211_IFTYPE_ADHOC) {
if ((pDevice->bUpdateBBVGA) && pDevice->bLinkPass && (pDevice->uCurrRSSI != 0)) {
long ldBm;
if (pDevice->bEnablePSMode)
PSbIsNextTBTTWakeUp((void *)pDevice);
- if ((pDevice->eOPMode == OP_MODE_AP) ||
- (pDevice->eOPMode == OP_MODE_ADHOC)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_AP) ||
+ (pDevice->op_mode == NL80211_IFTYPE_ADHOC)) {
MACvOneShotTimer1MicroSec(pDevice->PortOffset,
(pMgmt->wIBSSBeaconPeriod - MAKE_BEACON_RESERVED) << 10);
}
}
if (pDevice->dwIsr & ISR_BNTX) {
- if (pDevice->eOPMode == OP_MODE_ADHOC) {
+ if (pDevice->op_mode == NL80211_IFTYPE_ADHOC) {
pDevice->bIsBeaconBufReadySet = false;
pDevice->cbBeaconBufReadySetCnt = 0;
}
- if (pDevice->eOPMode == OP_MODE_AP) {
+ if (pDevice->op_mode == NL80211_IFTYPE_AP) {
if (pMgmt->byDTIMCount > 0) {
pMgmt->byDTIMCount--;
pMgmt->sNodeDBTable[0].bRxPSPoll = false;
max_count += device_tx_srv(pDevice, TYPE_AC0DMA);
if (pDevice->dwIsr & ISR_SOFTTIMER1) {
- if (pDevice->eOPMode == OP_MODE_AP) {
+ if (pDevice->op_mode == NL80211_IFTYPE_AP) {
if (pDevice->bShortSlotTime)
pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTSLOTTIME(1);
else
// Now it only supports 802.11g Infrastructure Mode, and support rate must up to 54 Mbps
if (pDevice->bDiversityEnable && (FrameSize > 50) &&
- (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) &&
+ (pDevice->op_mode == NL80211_IFTYPE_STATION) &&
pDevice->bLinkPass) {
BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0);
}
struct vnt_private *pDevice = netdev_priv(dev);
long ldBm;
- pDevice->wstats.status = pDevice->eOPMode;
+ pDevice->wstats.status = pDevice->op_mode;
#ifdef Calcu_LinkQual
if (pDevice->scStatistic.LinkQuality > 100)
pDevice->scStatistic.LinkQuality = 100;
// set period of power up before TBTT
VNSvOutPortW(pDevice->PortOffset + MAC_REG_PWBT, C_PWBT);
- if (pDevice->eOPMode != OP_MODE_ADHOC) {
+ if (pDevice->op_mode != NL80211_IFTYPE_ADHOC) {
// set AID
VNSvOutPortW(pDevice->PortOffset + MAC_REG_AIDATIM, wAID);
} else {
pDevice->bEnablePSMode = true;
/* We don't send null pkt in ad hoc mode since beacon will handle this. */
- if (pDevice->eOPMode != OP_MODE_ADHOC && pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)
+ if (pDevice->op_mode != NL80211_IFTYPE_ADHOC &&
+ pDevice->op_mode == NL80211_IFTYPE_STATION)
PSbSendNullPacket(pDevice);
pDevice->bPWBitOn = true;
pDevice->bEnablePSMode = false;
- if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)
+ if (pDevice->op_mode == NL80211_IFTYPE_STATION)
PSbSendNullPacket(pDevice);
pDevice->bPWBitOn = false;
IEEE80211_STYPE_RTS);
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else {
memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
}
- if (pDevice->eOPMode == OP_MODE_AP)
+ if (pDevice->op_mode == NL80211_IFTYPE_AP)
memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else
memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
IEEE80211_STYPE_RTS);
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else {
memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
}
- if (pDevice->eOPMode == OP_MODE_AP)
+ if (pDevice->op_mode == NL80211_IFTYPE_AP)
memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else
memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
IEEE80211_STYPE_RTS);
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else {
memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
}
- if (pDevice->eOPMode == OP_MODE_AP)
+ if (pDevice->op_mode == NL80211_IFTYPE_AP)
memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else
memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
cpu_to_le16(IEEE80211_FTYPE_CTL |
IEEE80211_STYPE_RTS);
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else {
memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
}
- if (pDevice->eOPMode == OP_MODE_AP)
+ if (pDevice->op_mode == NL80211_IFTYPE_AP)
memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else
memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
memcpy(&buf->data.ra, psEthHeader->abyDstAddr, ETH_ALEN);
} else {
memcpy(&buf->data.ra, pDevice->abyBSSID, ETH_ALEN);
}
- if (pDevice->eOPMode == OP_MODE_AP)
+ if (pDevice->op_mode == NL80211_IFTYPE_AP)
memcpy(&buf->data.ta, pDevice->abyBSSID, ETH_ALEN);
else
memcpy(&buf->data.ta, psEthHeader->abySrcAddr, ETH_ALEN);
pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
bNeedACK = false;
else
memset(pTxBufHead, 0, wTxBufSize);
//Set FIFOCTL_NEEDACK
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = false;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
else
pMACHeader->wFrameCtl = TYPE_802_11_DATA;
- if (pDevice->eOPMode == OP_MODE_AP) {
+ if (pDevice->op_mode == NL80211_IFTYPE_AP) {
memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
pMACHeader->wFrameCtl |= FC_FROMDS;
} else {
- if (pDevice->eOPMode == OP_MODE_ADHOC) {
+ if (pDevice->op_mode == NL80211_IFTYPE_ADHOC) {
memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
// S/W or H/W Encryption
//---------------------------
do {
- if ((pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) &&
+ if ((pDevice->op_mode == NL80211_IFTYPE_STATION) &&
(pDevice->bLinkPass == true)) {
pbyBSSID = pDevice->abyBSSID;
// get pairwise key
if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) {
pTransmitKey = NULL;
pr_debug("KEY is NULL. OP Mode[%d]\n",
- pDevice->eOPMode);
+ pDevice->op_mode);
} else {
pr_debug("Get GTK\n");
}
unsigned int uMACfragNum = 1;
bool bNeedACK;
- if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
- (pDevice->eOPMode == OP_MODE_AP)) {
+ if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
+ (pDevice->op_mode == NL80211_IFTYPE_AP)) {
if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
bNeedACK = false;
else
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
s_bCommandComplete(pDevice);
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_AP);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_AP);
spin_unlock_irq(&pDevice->lock);
return;
}
pr_debug("Scanning, set back to channel: [%d]\n",
pMgmt->uCurrChannel);
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_ADHOC);
else
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_STATION);
vAdHocBeaconRestart(pDevice);
s_bCommandComplete(pDevice);
pr_debug("SET SCAN Channel Fail: %d\n",
pMgmt->uScanChannel);
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_UNKNOWN);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_UNSPECIFIED);
pMgmt->uScanChannel++;
//2008-8-4 <modify> by chester
if (!is_channel_valid(pMgmt->uScanChannel) &&
pr_debug("Scanning, set back to channel: [%d]\n",
pMgmt->uCurrChannel);
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_ADHOC);
else
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_INFRASTRUCTURE);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_STATION);
pMgmt->eScanState = WMAC_NO_SCANNING;
vAdHocBeaconRestart(pDevice);
pMgmt->byERPContext = 0;
if (pMgmt->eConfigMode == WMAC_CONFIG_AP) {
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_AP);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_AP);
} else {
- CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC);
+ CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, NL80211_IFTYPE_ADHOC);
}
CARDbSetPhyParameter(pMgmt->pAdapter,
}
if (WLAN_GET_CAP_INFO_ESS(pCurr->wCapInfo)) {
- CARDbSetBSSID(pMgmt->pAdapter, pCurr->abyBSSID, OP_MODE_INFRASTRUCTURE);
+ CARDbSetBSSID(pMgmt->pAdapter, pCurr->abyBSSID, NL80211_IFTYPE_STATION);
// Add current BSS to Candidate list
// This should only works for WPA2 BSS, and WPA2 BSS check must be done before.
if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)
CARDbAdd_PMKID_Candidate(pMgmt->pAdapter, pMgmt->abyCurrBSSID, pCurr->sRSNCapObj.bRSNCapExist, pCurr->sRSNCapObj.wRSNCap);
} else {
- CARDbSetBSSID(pMgmt->pAdapter, pCurr->abyBSSID, OP_MODE_ADHOC);
+ CARDbSetBSSID(pMgmt->pAdapter, pCurr->abyBSSID, NL80211_IFTYPE_ADHOC);
}
if (!CARDbSetPhyParameter(pMgmt->pAdapter,