Commit a884847a authored by Jim Lieb's avatar Jim Lieb Committed by Greg Kroah-Hartman

Staging: vt665x: Typedef and macro cleanup Part 2

Clean up unused typedefs and macros to remove Win32'isms and
misc non-linux constructs.  Text edits to referencing
source for less frequently used macros.
Signed-off-by: default avatarJim Lieb <lieb@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 193a823c
......@@ -398,8 +398,6 @@ BSSpAddrIsInBSSList(
/*+
*
* Routine Description:
......
......@@ -105,13 +105,13 @@ typedef enum _NDIS_802_11_NETWORK_TYPE
typedef struct tagSERPObject {
BOOL bERPExist;
BYTE byERP;
}ERPObject, DEF* PERPObject;
}ERPObject, *PERPObject;
typedef struct tagSRSNCapObject {
BOOL bRSNCapExist;
WORD wRSNCap;
}SRSNCapObject, DEF* PSRSNCapObject;
}SRSNCapObject, *PSRSNCapObject;
// BSS info(AP)
#pragma pack(1)
......@@ -177,7 +177,7 @@ typedef struct tagKnownBSS {
BYTE abyIEs[1024]; // don't move this field !!
}__attribute__ ((__packed__))
KnownBSS , DEF* PKnownBSS;
KnownBSS , *PKnownBSS;
//2006-1116-01,<Add> by NomadZhao
#pragma pack()
......@@ -248,7 +248,7 @@ typedef struct tagKnownNodeDB {
UINT uTxFail[MAX_RATE+1];
UINT uTimeCount;
} KnownNodeDB, DEF* PKnownNodeDB;
} KnownNodeDB, *PKnownNodeDB;
/*--------------------- Export Functions --------------------------*/
......
......@@ -115,7 +115,7 @@ typedef struct tagSChannelTblElement {
UINT uFrequency;
BOOL bValid;
BYTE byMAP;
}SChannelTblElement, DEF* PSChannelTblElement;
}SChannelTblElement, *PSChannelTblElement;
//1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M
static BYTE abyDefaultSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C};
......
......@@ -168,7 +168,7 @@ typedef struct tagSCountryTable
CHAR chCountryCode[2];
BYTE bChannelIdxList[CB_MAX_CHANNEL]; /* Available channels Index */
BYTE byPower[CB_MAX_CHANNEL];
} SCountryTable, DEF* PSCountryTable;
} SCountryTable, *PSCountryTable;
/*--------------------- Export Classes ----------------------------*/
......
......@@ -306,8 +306,8 @@ typedef struct tagSRxDesc {
volatile PDEVICE_RD_INFO pRDInfo;//4 bytes
volatile U32 Reserved[2];//8 bytes
} __attribute__ ((__packed__))
SRxDesc, DEF* PSRxDesc;
typedef const SRxDesc DEF* PCSRxDesc;
SRxDesc, *PSRxDesc;
typedef const SRxDesc *PCSRxDesc;
#ifdef __BIG_ENDIAN
......@@ -392,8 +392,8 @@ typedef struct tagSTxDesc {
volatile PDEVICE_TD_INFO pTDInfo;//4 bytes
volatile U32 Reserved[2];//8 bytes
} __attribute__ ((__packed__))
STxDesc, DEF* PSTxDesc;
typedef const STxDesc DEF* PCSTxDesc;
STxDesc, *PSTxDesc;
typedef const STxDesc *PCSTxDesc;
typedef struct tagSTxSyncDesc {
......@@ -407,8 +407,8 @@ typedef struct tagSTxSyncDesc {
volatile PDEVICE_TD_INFO pTDInfo;//4 bytes
volatile DWORD m_dwReserved2;
} __attribute__ ((__packed__))
STxSyncDesc, DEF* PSTxSyncDesc;
typedef const STxSyncDesc DEF* PCSTxSyncDesc;
STxSyncDesc, *PSTxSyncDesc;
typedef const STxSyncDesc *PCSTxSyncDesc;
//
......@@ -422,8 +422,8 @@ typedef struct tagSRrvTime_gRTS {
WORD wTxRrvTime_b;
WORD wTxRrvTime_a;
}__attribute__ ((__packed__))
SRrvTime_gRTS, DEF* PSRrvTime_gRTS;
typedef const SRrvTime_gRTS DEF* PCSRrvTime_gRTS;
SRrvTime_gRTS, *PSRrvTime_gRTS;
typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
typedef struct tagSRrvTime_gCTS {
WORD wCTSTxRrvTime_ba;
......@@ -431,22 +431,22 @@ typedef struct tagSRrvTime_gCTS {
WORD wTxRrvTime_b;
WORD wTxRrvTime_a;
}__attribute__ ((__packed__))
SRrvTime_gCTS, DEF* PSRrvTime_gCTS;
typedef const SRrvTime_gCTS DEF* PCSRrvTime_gCTS;
SRrvTime_gCTS, *PSRrvTime_gCTS;
typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
typedef struct tagSRrvTime_ab {
WORD wRTSTxRrvTime;
WORD wTxRrvTime;
}__attribute__ ((__packed__))
SRrvTime_ab, DEF* PSRrvTime_ab;
typedef const SRrvTime_ab DEF* PCSRrvTime_ab;
SRrvTime_ab, *PSRrvTime_ab;
typedef const SRrvTime_ab *PCSRrvTime_ab;
typedef struct tagSRrvTime_atim {
WORD wCTSTxRrvTime_ba;
WORD wTxRrvTime_a;
}__attribute__ ((__packed__))
SRrvTime_atim, DEF* PSRrvTime_atim;
typedef const SRrvTime_atim DEF* PCSRrvTime_atim;
SRrvTime_atim, *PSRrvTime_atim;
typedef const SRrvTime_atim *PCSRrvTime_atim;
//
// RTS buffer header
......@@ -457,8 +457,8 @@ typedef struct tagSRTSData {
BYTE abyRA[U_ETHER_ADDR_LEN];
BYTE abyTA[U_ETHER_ADDR_LEN];
}__attribute__ ((__packed__))
SRTSData, DEF* PSRTSData;
typedef const SRTSData DEF* PCSRTSData;
SRTSData, *PSRTSData;
typedef const SRTSData *PCSRTSData;
typedef struct tagSRTS_g {
BYTE bySignalField_b;
......@@ -473,8 +473,8 @@ typedef struct tagSRTS_g {
WORD wReserved;
SRTSData Data;
}__attribute__ ((__packed__))
SRTS_g, DEF* PSRTS_g;
typedef const SRTS_g DEF* PCSRTS_g;
SRTS_g, *PSRTS_g;
typedef const SRTS_g *PCSRTS_g;
typedef struct tagSRTS_g_FB {
......@@ -494,8 +494,8 @@ typedef struct tagSRTS_g_FB {
WORD wRTSDuration_aa_f1;
SRTSData Data;
}__attribute__ ((__packed__))
SRTS_g_FB, DEF* PSRTS_g_FB;
typedef const SRTS_g_FB DEF* PCSRTS_g_FB;
SRTS_g_FB, *PSRTS_g_FB;
typedef const SRTS_g_FB *PCSRTS_g_FB;
typedef struct tagSRTS_ab {
......@@ -506,8 +506,8 @@ typedef struct tagSRTS_ab {
WORD wReserved;
SRTSData Data;
}__attribute__ ((__packed__))
SRTS_ab, DEF* PSRTS_ab;
typedef const SRTS_ab DEF* PCSRTS_ab;
SRTS_ab, *PSRTS_ab;
typedef const SRTS_ab *PCSRTS_ab;
typedef struct tagSRTS_a_FB {
......@@ -520,8 +520,8 @@ typedef struct tagSRTS_a_FB {
WORD wRTSDuration_f1;
SRTSData Data;
}__attribute__ ((__packed__))
SRTS_a_FB, DEF* PSRTS_a_FB;
typedef const SRTS_a_FB DEF* PCSRTS_a_FB;
SRTS_a_FB, *PSRTS_a_FB;
typedef const SRTS_a_FB *PCSRTS_a_FB;
//
......@@ -533,7 +533,7 @@ typedef struct tagSCTSData {
BYTE abyRA[U_ETHER_ADDR_LEN];
WORD wReserved;
}__attribute__ ((__packed__))
SCTSData, DEF* PSCTSData;
SCTSData, *PSCTSData;
typedef struct tagSCTS {
BYTE bySignalField_b;
......@@ -543,8 +543,8 @@ typedef struct tagSCTS {
WORD wReserved;
SCTSData Data;
}__attribute__ ((__packed__))
SCTS, DEF* PSCTS;
typedef const SCTS DEF* PCSCTS;
SCTS, *PSCTS;
typedef const SCTS *PCSCTS;
typedef struct tagSCTS_FB {
BYTE bySignalField_b;
......@@ -556,8 +556,8 @@ typedef struct tagSCTS_FB {
WORD wCTSDuration_ba_f1;
SCTSData Data;
}__attribute__ ((__packed__))
SCTS_FB, DEF* PSCTS_FB;
typedef const SCTS_FB DEF* PCSCTS_FB;
SCTS_FB, *PSCTS_FB;
typedef const SCTS_FB *PCSCTS_FB;
//
......@@ -571,15 +571,15 @@ typedef struct tagSTxBufHead {
BYTE byTxPower;
BYTE wReserved;
}__attribute__ ((__packed__))
STxBufHead, DEF* PSTxBufHead;
typedef const STxBufHead DEF* PCSTxBufHead;
STxBufHead, *PSTxBufHead;
typedef const STxBufHead *PCSTxBufHead;
typedef struct tagSTxShortBufHead {
WORD wFIFOCtl;
WORD wTimeStamp;
}__attribute__ ((__packed__))
STxShortBufHead, DEF* PSTxShortBufHead;
typedef const STxShortBufHead DEF* PCSTxShortBufHead;
STxShortBufHead, *PSTxShortBufHead;
typedef const STxShortBufHead *PCSTxShortBufHead;
//
// Tx data header
......@@ -596,8 +596,8 @@ typedef struct tagSTxDataHead_g {
WORD wTimeStampOff_b;
WORD wTimeStampOff_a;
}__attribute__ ((__packed__))
STxDataHead_g, DEF* PSTxDataHead_g;
typedef const STxDataHead_g DEF* PCSTxDataHead_g;
STxDataHead_g, *PSTxDataHead_g;
typedef const STxDataHead_g *PCSTxDataHead_g;
typedef struct tagSTxDataHead_g_FB {
BYTE bySignalField_b;
......@@ -613,8 +613,8 @@ typedef struct tagSTxDataHead_g_FB {
WORD wTimeStampOff_b;
WORD wTimeStampOff_a;
}__attribute__ ((__packed__))
STxDataHead_g_FB, DEF* PSTxDataHead_g_FB;
typedef const STxDataHead_g_FB DEF* PCSTxDataHead_g_FB;
STxDataHead_g_FB, *PSTxDataHead_g_FB;
typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB;
typedef struct tagSTxDataHead_ab {
......@@ -624,8 +624,8 @@ typedef struct tagSTxDataHead_ab {
WORD wDuration;
WORD wTimeStampOff;
}__attribute__ ((__packed__))
STxDataHead_ab, DEF* PSTxDataHead_ab;
typedef const STxDataHead_ab DEF* PCSTxDataHead_ab;
STxDataHead_ab, *PSTxDataHead_ab;
typedef const STxDataHead_ab *PCSTxDataHead_ab;
typedef struct tagSTxDataHead_a_FB {
......@@ -637,8 +637,8 @@ typedef struct tagSTxDataHead_a_FB {
WORD wDuration_f0;
WORD wDuration_f1;
}__attribute__ ((__packed__))
STxDataHead_a_FB, DEF* PSTxDataHead_a_FB;
typedef const STxDataHead_a_FB DEF* PCSTxDataHead_a_FB;
STxDataHead_a_FB, *PSTxDataHead_a_FB;
typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB;
//
// MICHDR data header
......@@ -648,8 +648,8 @@ typedef struct tagSMICHDRHead {
DWORD adwHDR1[4];
DWORD adwHDR2[4];
}__attribute__ ((__packed__))
SMICHDRHead, DEF* PSMICHDRHead;
typedef const SMICHDRHead DEF* PCSMICHDRHead;
SMICHDRHead, *PSMICHDRHead;
typedef const SMICHDRHead *PCSMICHDRHead;
typedef struct tagSBEACONCtl {
DWORD BufReady : 1;
......
......@@ -310,7 +310,7 @@ typedef struct tagSPMKIDCandidateEvent {
ULONG Version; // Version of the structure
ULONG NumCandidates; // No. of pmkid candidates
PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
} SPMKIDCandidateEvent, DEF* PSPMKIDCandidateEvent;
} SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
//--
......@@ -322,7 +322,7 @@ typedef struct tagSQuietControl {
DWORD dwStartTime;
BYTE byPeriod;
WORD wDuration;
} SQuietControl, DEF* PSQuietControl;
} SQuietControl, *PSQuietControl;
//--
typedef struct __chip_info_tbl{
......@@ -366,7 +366,7 @@ typedef struct tagSDeFragControlBlock
PBYTE pbyRxBuffer;
UINT cbFrameLength;
BOOL bInUse;
} SDeFragControlBlock, DEF* PSDeFragControlBlock;
} SDeFragControlBlock, *PSDeFragControlBlock;
......
......@@ -30,46 +30,13 @@
//#include <linux/config.h>
#include <linux/types.h>
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
typedef __u8 UINT8, *PUINT8;
typedef __u16 UINT16, *PUINT16;
typedef __u32 UINT32, *PUINT32;
#ifndef VOID
#define VOID void
#endif
#ifndef CONST
#define CONST const
#endif
#ifndef STATIC
#define STATIC static
#endif
#ifndef DEF
#define DEF
#endif
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
typedef
struct _version {
UINT8 major;
UINT8 minor;
UINT8 build;
unsigned char major;
unsigned char minor;
unsigned char build;
} version_t, *pversion_t;
#ifndef FALSE
......@@ -112,8 +79,6 @@ struct _version {
#define PKT_BUF_SZ 2390
#define MALLOC(x,y) kmalloc((x),(y))
#define FREE(x) kfree((x))
#define MAX_UINTS 8
#define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1}
......
......@@ -432,7 +432,7 @@ device_set_int_opt(int *opt, int val, int min, int max, int def,char* name,char*
}
static void
device_set_bool_opt(PU32 opt, int val,BOOL def,U32 flag, char* name,char* devname) {
device_set_bool_opt(unsigned int *opt, int val,BOOL def,U32 flag, char* name,char* devname) {
(*opt)&=(~flag);
if (val==-1)
*opt|=(def ? flag : 0);
......@@ -1680,7 +1680,7 @@ static BOOL device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) {
pRDInfo->skb->dev = pDevice->dev;
pRDInfo->skb_dma = pci_map_single(pDevice->pcid, skb_tail_pointer(pRDInfo->skb),
pDevice->rx_buf_sz, PCI_DMA_FROMDEVICE);
*((PU32) &(pRD->m_rd0RD0)) = 0;
*((unsigned int *) &(pRD->m_rd0RD0)) = 0; /* FIX cast */
pRD->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
......
......@@ -162,7 +162,7 @@ static BOOL s_bHandleRxEncryption(
IN PBYTE pbyRsr,
OUT PBYTE pbyNewRsr,
OUT PSKeyItem *pKeyOut,
OUT PBOOL pbExtIV,
int * pbExtIV,
OUT PWORD pwRxTSC15_0,
OUT PDWORD pdwRxTSC47_16
);
......@@ -176,7 +176,7 @@ static BOOL s_bHostWepRxEncryption(
IN BOOL bOnFly,
IN PSKeyItem pKey,
OUT PBYTE pbyNewRsr,
OUT PBOOL pbExtIV,
int * pbExtIV,
OUT PWORD pwRxTSC15_0,
OUT PDWORD pdwRxTSC47_16
......@@ -1208,7 +1208,7 @@ static BOOL s_bHandleRxEncryption (
IN PBYTE pbyRsr,
OUT PBYTE pbyNewRsr,
OUT PSKeyItem *pKeyOut,
OUT PBOOL pbExtIV,
int * pbExtIV,
OUT PWORD pwRxTSC15_0,
OUT PDWORD pdwRxTSC47_16
)
......@@ -1355,7 +1355,7 @@ static BOOL s_bHostWepRxEncryption (
IN BOOL bOnFly,
IN PSKeyItem pKey,
OUT PBYTE pbyNewRsr,
OUT PBOOL pbExtIV,
int * pbExtIV,
OUT PWORD pwRxTSC15_0,
OUT PDWORD pdwRxTSC47_16
)
......
......@@ -77,7 +77,7 @@ typedef enum tagWMAC_CMD {
WLAN_CMD_ZONETYPE_SET,
WLAN_CMD_GET_NODE_LIST
} WMAC_CMD, DEF* PWMAC_CMD;
} WMAC_CMD, *PWMAC_CMD;
typedef enum tagWZONETYPE {
ZoneType_USA=0,
......@@ -244,7 +244,7 @@ typedef struct tagSDot11MIBCount {
U32 ReceivedFragmentCount;
U32 MulticastReceivedFrameCount;
U32 FCSErrorCount;
} SDot11MIBCount, DEF* PSDot11MIBCount;
} SDot11MIBCount, *PSDot11MIBCount;
......@@ -351,7 +351,7 @@ typedef struct tagSStatMIBCount {
U32 ullTxBroadcastBytes[2];
U32 ullTxMulticastBytes[2];
U32 ullTxDirectedBytes[2];
} SStatMIBCount, DEF* PSStatMIBCount;
} SStatMIBCount, *PSStatMIBCount;
typedef struct tagSNodeItem {
......
......@@ -30,50 +30,9 @@
#include <linux/version.h>
#ifndef __init
#define __init
#endif
#ifndef __exit
#define __exit
#endif
#ifndef __devexit
#define __devexit
#endif
#ifndef __devinitdata
#define __devinitdata
#endif
#ifndef MODULE_LICENSE
#define MODULE_LICENSE(license)
#endif
#ifndef MOD_INC_USE_COUNT
#define MOD_INC_USE_COUNT do {} while (0)
#endif
#ifndef MOD_DEC_USE_COUNT
#define MOD_DEC_USE_COUNT do {} while (0)
#endif
#ifndef HAVE_NETDEV_PRIV
#define netdev_priv(dev) (dev->priv)
#endif
#ifndef IRQ_RETVAL
typedef void irqreturn_t;
#define IRQ_RETVAL(x)
#endif
#ifndef MODULE_LICESEN
#define MODULE_LICESEN(x)
#endif
#endif
......@@ -76,7 +76,7 @@ typedef struct tagSKeyItem
BYTE byReserved0;
DWORD dwKeyIndex;
PVOID pvKeyTable;
} SKeyItem, DEF* PSKeyItem; //64
} SKeyItem, *PSKeyItem; //64
typedef struct tagSKeyTable
{
......@@ -93,12 +93,12 @@ typedef struct tagSKeyTable
WORD wKeyCtl; // for address of wKeyCtl at align 4
BYTE byReserved1[6];
} SKeyTable, DEF* PSKeyTable; //348
} SKeyTable, *PSKeyTable; //348
typedef struct tagSKeyManagement
{
SKeyTable KeyTable[MAX_KEY_TABLE];
} SKeyManagement, DEF* PSKeyManagement;
} SKeyManagement, * PSKeyManagement;
/*--------------------- Export Types ------------------------------*/
......
......@@ -75,7 +75,7 @@ typedef struct tagSDot11Counters {
// ULONGLONG WEPICVErrorCount;
// ULONGLONG DecryptSuccessCount;
// ULONGLONG DecryptFailureCount;
} SDot11Counters, DEF* PSDot11Counters;
} SDot11Counters, *PSDot11Counters;
//
......@@ -83,7 +83,7 @@ typedef struct tagSDot11Counters {
//
typedef struct tagSMib2Counter {
LONG ifIndex;
TCHAR ifDescr[256]; // max size 255 plus zero ending
char ifDescr[256]; // max size 255 plus zero ending
// e.g. "interface 1"
LONG ifType;
LONG ifMtu;
......@@ -105,7 +105,7 @@ typedef struct tagSMib2Counter {
DWORD ifOutErrors;
DWORD ifOutQLen;
DWORD ifSpecific;
} SMib2Counter, DEF* PSMib2Counter;
} SMib2Counter, *PSMib2Counter;
// Value in the ifType entry
//#define ETHERNETCSMACD 6 //
......@@ -142,7 +142,7 @@ typedef struct tagSRmonCounter {
DWORD etherStatsPkt1024to1518Octets;
DWORD etherStatsOwners;
DWORD etherStatsStatus;
} SRmonCounter, DEF* PSRmonCounter;
} SRmonCounter, *PSRmonCounter;
//
// Custom counter
......@@ -180,7 +180,7 @@ typedef struct tagSCustomCounters {
ULONGLONG ullRsr9MCRCOk;
ULONGLONG ullRsr6MCRCOk;
} SCustomCounters, DEF* PSCustomCounters;
} SCustomCounters, *PSCustomCounters;
//
......@@ -211,7 +211,7 @@ typedef struct tagSISRCounters {
DWORD dwIsrSYNCFlushOK;
DWORD dwIsrSTIMER1Int;
/////////////////////////////////////
} SISRCounters, DEF* PSISRCounters;
} SISRCounters, *PSISRCounters;
// Value in the etherStatsStatus entry
......@@ -344,7 +344,7 @@ typedef struct tagSStatCounter {
ULONG SignalStren;
ULONG LinkQuality;
#endif
} SStatCounter, DEF* PSStatCounter;
} SStatCounter, *PSStatCounter;
/*--------------------- Export Classes ----------------------------*/
......
......@@ -42,7 +42,7 @@ typedef struct {
UINT ux;
UINT uy;
BYTE abystate[256];
} RC4Ext, DEF* PRC4Ext;
} RC4Ext, *PRC4Ext;
VOID rc4_init(PRC4Ext pRC4, PBYTE pbyKey, UINT cbKey_len);
UINT rc4_byte(PRC4Ext pRC4);
......
......@@ -1216,7 +1216,7 @@ VOID
RFvRSSITodBm (
IN PSDevice pDevice,
IN BYTE byCurrRSSI,
OUT PLONG pldBm
long * pldBm
)
{
BYTE byIdx = (((byCurrRSSI & 0xC0) >> 6) & 0x03);
......
......@@ -100,7 +100,7 @@ VOID
RFvRSSITodBm(
IN PSDevice pDevice,
IN BYTE byCurrRSSI,
OUT PLONG pldBm
long *pldBm
);
//{{ RobertYu: 20050104
......
......@@ -902,9 +902,6 @@ s_vFillRTSHead (
UINT uRTSFrameLen = 20;
WORD wLen = 0x0000;
// dummy code, only to avoid compiler warning message
UNREFERENCED_PARAMETER(bNeedAck);
if (pvRTS == NULL)
return;
......
......@@ -131,7 +131,7 @@ typedef struct tagSSromReg {
BYTE abyReserved0[96]; // 0x10 (WORD)
BYTE abyCIS[128]; // 0x80 (WORD)
} SSromReg, DEF* PSSromReg;
} SSromReg, *PSSromReg;
/*--------------------- Export Macros ------------------------------*/
......
......@@ -179,7 +179,7 @@ typedef struct tagSEthernetHeader {
BYTE abySrcAddr[U_ETHER_ADDR_LEN];
WORD wType;
}__attribute__ ((__packed__))
SEthernetHeader, DEF* PSEthernetHeader;
SEthernetHeader, *PSEthernetHeader;
//
......@@ -190,7 +190,7 @@ typedef struct tagS802_3Header {
BYTE abySrcAddr[U_ETHER_ADDR_LEN];
WORD wLen;
}__attribute__ ((__packed__))
S802_3Header, DEF* PS802_3Header;
S802_3Header, *PS802_3Header;
//
// 802_11 packet
......@@ -204,7 +204,7 @@ typedef struct tagS802_11Header {
WORD wSeqCtl;
BYTE abyAddr4[U_ETHER_ADDR_LEN];
}__attribute__ ((__packed__))
S802_11Header, DEF* PS802_11Header;
S802_11Header, *PS802_11Header;
/*--------------------- Export Macros ------------------------------*/
// Frame type macro
......
......@@ -30,23 +30,10 @@
#ifndef __TMACRO_H__
#define __TMACRO_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/****** Common helper macros ***********************************************/
#if !defined(LONIBBLE)
#define LONIBBLE(b) ((BYTE)(b) & 0x0F)
#endif
#if !defined(HINIBBLE)
#define HINIBBLE(b) ((BYTE)(((WORD)(b) >> 4) & 0x0F))
#endif
#if !defined(LOBYTE)
#define LOBYTE(w) ((BYTE)(w))
#endif
......@@ -64,84 +51,12 @@
#define LODWORD(q) ((q).u.dwLowDword)
#define HIDWORD(q) ((q).u.dwHighDword)
#if !defined(MAKEBYTE)
#define MAKEBYTE(ln, hn) ((BYTE)(((BYTE)(ln) & 0x0F) | ((BYTE)(hn) << 4)))
#endif
#if !defined(MAKEWORD)
#define MAKEWORD(lb, hb) ((WORD)(((BYTE)(lb)) | (((WORD)((BYTE)(hb))) << 8)))
#endif
#if !defined(MAKEDWORD)
#define MAKEDWORD(lw, hw) ((DWORD)(((WORD)(lw)) | (((DWORD)((WORD)(hw))) << 16)))
#endif
#if !defined(MAKEQWORD)
#define MAKEQWORD(ld, hd, pq) {pq->u.dwLowDword = ld; pq->u.dwHighDword = hd;}
#endif
#if !defined(MAKELONG)
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
#endif
// Bytes Reverse: big endian to little endian convert
#if !defined(REVWORD)
#define REVWORD(w) ((WORD)( ((WORD)(w) >> 8) | ((WORD)(w) << 8) ))
#endif
#if !defined(REVDWORD)
#define REVDWORD(d) (MAKEDWORD(MAKEWORD(HIBYTE(HIWORD(d)),LOBYTE(HIWORD(d))),MAKEWORD(HIBYTE(LOWORD(d)),LOBYTE(LOWORD(d)))))
#endif
/* map to known network names */
/*
#define ntohs(x) REVWORD(x)
#define ntohl(x) REVDWORD(x)
#define htons(x) REVWORD(x)
#define htonl(x) REVDWORD(x)
*/
/*
#ifndef NOMINMAX
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif // NOMINMAX
*/
/****** Misc macros ********************************************************/
/* string equality shorthand */
#define STR_EQ(x, y) (strcmp(x, y) == 0)
#define STR_NE(x, y) (strcmp(x, y) != 0)
// calculate element # of array
#define ELEMENT_NUM(array) (sizeof(array) / sizeof(array[0]))
//#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
// null statement
#define NULL_FUNC()
/* Since not all compilers support structure assignment, the ASSIGN()
* macro is used. This controls how it's actually implemented.
*/
#ifdef NOSTRUCTASSIGN /* Version for old compilers that don't support it */
#define ASSIGN(a,b) memcpy((char *)&(a),(char *)&(b),sizeof(b);
#else /* Version for compilers that do */
#define ASSIGN(a,b) ((a) = (b))
#endif
#endif // __TMACRO_H__
......
......@@ -37,14 +37,6 @@
#define VOID void
#endif
#ifndef CONST
#define CONST const
#endif
#ifndef STATIC
#define STATIC static
#endif
#ifndef IN
#define IN
#endif
......@@ -56,11 +48,8 @@
#ifndef TxInSleep
#define TxInSleep
#endif
#if! defined(__CPU8051)
typedef int BOOL;
#else // __CPU8051
#define BOOL int
#endif // __CPU8051
#if !defined(TRUE)
#define TRUE 1
......@@ -73,9 +62,6 @@ typedef int BOOL;
#if !defined(SUCCESS)
#define SUCCESS 0
#endif
#if !defined(FAILED)
#define FAILED -1
#endif
//2007-0809-01<Add>by MikeLiu
#ifndef update_BssList
......@@ -98,28 +84,18 @@ typedef int BOOL;
/****** Simple typedefs ***************************************************/
#if! defined(__CPU8051)
/* These lines assume that your compiler's longs are 32 bits and
* shorts are 16 bits. It is already assumed that chars are 8 bits,
* but it doesn't matter if they're signed or unsigned.
*/
typedef signed char I8; /* 8-bit signed integer */
typedef signed short I16; /* 16-bit signed integer */
typedef signed long I32; /* 32-bit signed integer */
typedef unsigned char U8; /* 8-bit unsigned integer */
typedef unsigned short U16; /* 16-bit unsigned integer */
typedef unsigned long U32; /* 32-bit unsigned integer */
#if defined(__WIN32)
typedef signed __int64 I64; /* 64-bit signed integer */
typedef unsigned __int64 U64; /* 64-bit unsigned integer */
#endif // __WIN32
typedef char CHAR;
typedef signed short SHORT;
typedef signed int INT;
......@@ -130,7 +106,6 @@ typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef unsigned long long ULONGLONG; //64 bit
typedef unsigned long long ULONGULONG;
......@@ -150,170 +125,23 @@ typedef union tagUQuadWord {
} UQuadWord;
typedef UQuadWord QWORD; // 64-bit
#ifndef _TCHAR_DEFINED
typedef char TCHAR;
typedef char* PTCHAR;
typedef unsigned char TBYTE;
typedef unsigned char* PTBYTE;
#define _TCHAR_DEFINED
#endif
#else // __CPU8051
#define U8 unsigned char
#define U16 unsigned short
#define U32 unsigned long
#define USHORT unsigned short
#define UINT unsigned int
#define BYTE unsigned char
#define WORD unsigned short
#define DWORD unsigned long
#endif // __CPU8051
// maybe this should be defined in <limits.h>
#define U8_MAX 0xFFU
#define U16_MAX 0xFFFFU
#define U32_MAX 0xFFFFFFFFUL
#define BYTE_MAX 0xFFU
#define WORD_MAX 0xFFFFU
#define DWORD_MAX 0xFFFFFFFFUL
/******* 32-bit vs. 16-bit definitions and typedefs ************************/
#if !defined(NULL)
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif // __cplusplus
#endif // !NULL
#if defined(__WIN32) || defined(__CPU8051)
#if !defined(FAR)
#define FAR
#endif
#if !defined(NEAR)
#define NEAR
#endif
#if !defined(DEF)
#define DEF
#endif
#if !defined(CALLBACK)
#define CALLBACK
#endif
#else // !__WIN32__
#if !defined(FAR)
#define FAR
#endif
#if !defined(NEAR)
#define NEAR
#endif
#if !defined(DEF)
// default pointer type is FAR, if you want near pointer just redefine it to NEAR
#define DEF
#endif
#if !defined(CALLBACK)
#define CALLBACK
#endif
#endif // !__WIN32__
/****** Common pointer types ***********************************************/
#if! defined(__CPU8051)
typedef unsigned long ULONG_PTR; // 32-bit
typedef unsigned long DWORD_PTR; // 32-bit
typedef signed char DEF* PI8;
typedef signed short DEF* PI16;
typedef signed long DEF* PI32;
// boolean pointer
typedef unsigned int * PUINT;
typedef unsigned char DEF* PU8;
typedef unsigned short DEF* PU16;
typedef unsigned long DEF* PU32;
typedef BYTE * PBYTE;
#if defined(__WIN32)
typedef signed __int64 DEF* PI64;
typedef unsigned __int64 DEF* PU64;
#endif // __WIN32
typedef WORD * PWORD;
#if !defined(_WIN64)
typedef unsigned long ULONG_PTR; // 32-bit
typedef unsigned long DWORD_PTR; // 32-bit
#endif // _WIN64
typedef DWORD * PDWORD;
typedef QWORD * PQWORD;
// boolean pointer
typedef int DEF* PBOOL;
typedef int NEAR* NPBOOL;
typedef int FAR* LPBOOL;
typedef int DEF* PINT;
typedef int NEAR* NPINT;
typedef int FAR* LPINT;
typedef const int DEF* PCINT;
typedef const int NEAR* NPCINT;
typedef const int FAR* LPCINT;
typedef unsigned int DEF* PUINT;
typedef const unsigned int DEF* PCUINT;
typedef long DEF* PLONG;
typedef long NEAR* NPLONG;
typedef long FAR* LPLONG;
//typedef const long DEF* PCLONG;
typedef const long NEAR* NPCLONG;
typedef const long FAR* LPCLONG;
typedef BYTE DEF* PBYTE;
typedef BYTE NEAR* NPBYTE;
typedef BYTE FAR* LPBYTE;
typedef const BYTE DEF* PCBYTE;
typedef const BYTE NEAR* NPCBYTE;
typedef const BYTE FAR* LPCBYTE;
typedef WORD DEF* PWORD;
typedef WORD NEAR* NPWORD;
typedef WORD FAR* LPWORD;
typedef const WORD DEF* PCWORD;
typedef const WORD NEAR* NPCWORD;
typedef const WORD FAR* LPCWORD;
typedef DWORD DEF* PDWORD;
typedef DWORD NEAR* NPDWORD;
typedef DWORD FAR* LPDWORD;
typedef const DWORD DEF* PCDWORD;
typedef const DWORD NEAR* NPCDWORD;
typedef const DWORD FAR* LPCDWORD;
typedef QWORD DEF* PQWORD;
typedef QWORD NEAR* NPQWORD;
typedef QWORD FAR* LPQWORD;
typedef const QWORD DEF* PCQWORD;
typedef const QWORD NEAR* NPCQWORD;
typedef const QWORD FAR* LPCQWORD;
typedef void DEF* PVOID;
typedef void NEAR* NPVOID;
typedef void FAR* LPVOID;
typedef void * PVOID;
// handle declaration
#ifdef STRICT
......@@ -322,68 +150,4 @@ typedef void *HANDLE;
typedef PVOID HANDLE;
#endif
//
// ANSI (Single-byte Character) types
//
typedef char DEF* PCH;
typedef char NEAR* NPCH;
typedef char FAR* LPCH;
typedef const char DEF* PCCH;
typedef const char NEAR* NPCCH;
typedef const char FAR* LPCCH;
typedef char DEF* PSTR;
typedef char NEAR* NPSTR;
typedef char FAR* LPSTR;
typedef const char DEF* PCSTR;
typedef const char NEAR* NPCSTR;
typedef const char FAR* LPCSTR;
#endif // !__CPU8051
/****** Misc definitions, types ********************************************/
// parameter prefix
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
// unreferenced parameter macro to avoid warning message in MS C
#if defined(__TURBOC__)
//you should use "#pragma argsused" to avoid warning message in Borland C
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x)
#endif
#else
#ifndef UNREFERENCED_PARAMETER
//#define UNREFERENCED_PARAMETER(x) x
#define UNREFERENCED_PARAMETER(x)
#endif
#endif
// in-line assembly prefix
#if defined(__TURBOC__)
#define ASM asm
#else // !__TURBOC__
#define ASM _asm
#endif // !__TURBOC__
#endif // __TTYPE_H__
......@@ -1048,7 +1048,7 @@ BOOL bScheduleCommand (
break;
case WLAN_CMD_DISASSOCIATE:
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bNeedRadioOFF = *((PBOOL)pbyItem0);
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bNeedRadioOFF = *((int *)pbyItem0);
break;
/*
case WLAN_CMD_DEAUTH:
......@@ -1060,7 +1060,7 @@ BOOL bScheduleCommand (
break;
case WLAN_CMD_RADIO:
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bRadioCmd = *((PBOOL)pbyItem0);
pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bRadioCmd = *((int *)pbyItem0);
break;
case WLAN_CMD_CHANGE_BBSENSITIVITY:
......
......@@ -64,7 +64,7 @@ typedef enum tagCMD_CODE {
WLAN_CMD_MAC_DISPOWERSAVING,
WLAN_CMD_11H_CHSW,
WLAN_CMD_RUN_AP
} CMD_CODE, DEF* PCMD_CODE;
} CMD_CODE, *PCMD_CODE;
#define CMD_Q_SIZE 32
......@@ -76,7 +76,7 @@ typedef enum tagCMD_STATUS {
CMD_STATUS_TIMEOUT,
CMD_STATUS_PENDING
} CMD_STATUS, DEF* PCMD_STATUS;
} CMD_STATUS, *PCMD_STATUS;
typedef struct tagCMD_ITEM {
......@@ -86,7 +86,7 @@ typedef struct tagCMD_ITEM {
WORD wDeAuthenReason;
BOOL bRadioCmd;
BOOL bForceSCAN;
} CMD_ITEM, DEF* PCMD_ITEM;
} CMD_ITEM, *PCMD_ITEM;
// Command state
typedef enum tagCMD_STATE {
......@@ -102,7 +102,7 @@ typedef enum tagCMD_STATE {
WLAN_CMD_RADIO_START,
WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE,
WLAN_CMD_IDLE
} CMD_STATE, DEF* PCMD_STATE;
} CMD_STATE, *PCMD_STATE;
......
......@@ -143,7 +143,7 @@ typedef struct tagSAssocInfo {
// store ReqIEs set by OID_802_11_ASSOCIATION_INFORMATION
ULONG RequestIELength;
BYTE abyReqIEs[WLAN_BEACON_FR_MAXLEN];
} SAssocInfo, DEF* PSAssocInfo;
} SAssocInfo, *PSAssocInfo;
//---
......@@ -246,7 +246,7 @@ typedef struct tagSTxMgmtPacket {
UINT cbMPDULen;
UINT cbPayloadLen;
} STxMgmtPacket, DEF* PSTxMgmtPacket;
} STxMgmtPacket, *PSTxMgmtPacket;
// Rx Managment Packet descriptor
......@@ -261,7 +261,7 @@ typedef struct tagSRxMgmtPacket {
BYTE byRxRate;
BYTE byRxChannel;
} SRxMgmtPacket, DEF* PSRxMgmtPacket;
} SRxMgmtPacket, *PSRxMgmtPacket;
......@@ -409,7 +409,7 @@ typedef struct tagSMgmtObject
struct sk_buff skb;
} SMgmtObject, DEF *PSMgmtObject;
} SMgmtObject, *PSMgmtObject;
/*--------------------- Export Macros ------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment