}
}
-void
-BBvCalculateParameter(
- struct vnt_private *pDevice,
- unsigned int cbFrameLength,
- unsigned short wRate,
- unsigned char byPacketType,
- unsigned short *pwPhyLen,
- unsigned char *pbyPhySrv,
- unsigned char *pbyPhySgn
-)
-{
- unsigned int cbBitCount;
- unsigned int cbUsCount = 0;
- unsigned int cbTmp;
- bool bExtBit;
- unsigned char byPreambleType = pDevice->byPreambleType;
-
- cbBitCount = cbFrameLength * 8;
- bExtBit = false;
-
- switch (wRate) {
- case RATE_1M:
- cbUsCount = cbBitCount;
- *pbyPhySgn = 0x00;
- break;
-
- case RATE_2M:
- cbUsCount = cbBitCount / 2;
- if (byPreambleType == 1)
- *pbyPhySgn = 0x09;
- else /* long preamble */
- *pbyPhySgn = 0x01;
- break;
-
- case RATE_5M:
- cbUsCount = (cbBitCount * 10) / 55;
- cbTmp = (cbUsCount * 55) / 10;
- if (cbTmp != cbBitCount)
- cbUsCount++;
- if (byPreambleType == 1)
- *pbyPhySgn = 0x0a;
- else /* long preamble */
- *pbyPhySgn = 0x02;
- break;
-
- case RATE_11M:
- cbUsCount = cbBitCount / 11;
- cbTmp = cbUsCount * 11;
- if (cbTmp != cbBitCount) {
- cbUsCount++;
- if ((cbBitCount - cbTmp) <= 3)
- bExtBit = true;
- }
- if (byPreambleType == 1)
- *pbyPhySgn = 0x0b;
- else /* long preamble */
- *pbyPhySgn = 0x03;
- break;
-
- case RATE_6M:
- if (byPacketType == PK_TYPE_11A) { /*11a, 5GHZ */
- *pbyPhySgn = 0x9B; /* 1001 1011 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8B; /* 1000 1011 */
- }
- break;
-
- case RATE_9M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9F; /* 1001 1111 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8F; /* 1000 1111 */
- }
- break;
-
- case RATE_12M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9A; /* 1001 1010 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8A; /* 1000 1010 */
- }
- break;
-
- case RATE_18M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9E; /* 1001 1110 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8E; /* 1000 1110 */
- }
- break;
-
- case RATE_24M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x99; /* 1001 1001 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x89; /* 1000 1001 */
- }
- break;
-
- case RATE_36M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9D; /* 1001 1101 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8D; /* 1000 1101 */
- }
- break;
-
- case RATE_48M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x98; /* 1001 1000 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x88; /* 1000 1000 */
- }
- break;
-
- case RATE_54M:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9C; /* 1001 1100 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8C; /* 1000 1100 */
- }
- break;
-
- default:
- if (byPacketType == PK_TYPE_11A) {/* 11a, 5GHZ */
- *pbyPhySgn = 0x9C; /* 1001 1100 */
- } else {/* 11g, 2.4GHZ */
- *pbyPhySgn = 0x8C; /* 1000 1100 */
- }
- break;
- }
-
- if (byPacketType == PK_TYPE_11B) {
- *pbyPhySrv = 0x00;
- if (bExtBit)
- *pbyPhySrv = *pbyPhySrv | 0x80;
- *pwPhyLen = (unsigned short)cbUsCount;
- } else {
- *pbyPhySrv = 0x00;
- *pwPhyLen = (unsigned short)cbFrameLength;
- }
-}
-
/*
* Description: Read a byte from BASEBAND, by embedded programming
*
unsigned short wRate
);
-void
-BBvCalculateParameter(
- struct vnt_private *pDevice,
- unsigned int cbFrameLength,
- unsigned short wRate,
- unsigned char byPacketType,
- unsigned short *pwPhyLen,
- unsigned char *pbyPhySrv,
- unsigned char *pbyPhySgn
-);
-
void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
typedef struct tagSRTS_g {
struct vnt_phy_field b;
struct vnt_phy_field a;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
- unsigned char bySignalField_a;
- unsigned char byServiceField_a;
- unsigned short wTransmitLength_a;
unsigned short wDuration_ba;
unsigned short wDuration_aa;
unsigned short wDuration_bb;
typedef struct tagSRTS_g_FB {
struct vnt_phy_field b;
struct vnt_phy_field a;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
- unsigned char bySignalField_a;
- unsigned char byServiceField_a;
- unsigned short wTransmitLength_a;
unsigned short wDuration_ba;
unsigned short wDuration_aa;
unsigned short wDuration_bb;
typedef struct tagSRTS_ab {
struct vnt_phy_field ab;
- unsigned char bySignalField;
- unsigned char byServiceField;
- unsigned short wTransmitLength;
unsigned short wDuration;
unsigned short wReserved;
SRTSData Data;
typedef struct tagSRTS_a_FB {
struct vnt_phy_field a;
- unsigned char bySignalField;
- unsigned char byServiceField;
- unsigned short wTransmitLength;
unsigned short wDuration;
unsigned short wReserved;
unsigned short wRTSDuration_f0;
typedef struct tagSCTS {
struct vnt_phy_field b;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
unsigned short wDuration_ba;
unsigned short wReserved;
SCTSData Data;
typedef struct tagSCTS_FB {
struct vnt_phy_field b;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
unsigned short wDuration_ba;
unsigned short wReserved;
unsigned short wCTSDuration_ba_f0;
typedef struct tagSTxDataHead_g {
struct vnt_phy_field b;
struct vnt_phy_field a;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
- unsigned char bySignalField_a;
- unsigned char byServiceField_a;
- unsigned short wTransmitLength_a;
unsigned short wDuration_b;
unsigned short wDuration_a;
unsigned short wTimeStampOff_b;
typedef struct tagSTxDataHead_g_FB {
struct vnt_phy_field b;
struct vnt_phy_field a;
- unsigned char bySignalField_b;
- unsigned char byServiceField_b;
- unsigned short wTransmitLength_b;
- unsigned char bySignalField_a;
- unsigned char byServiceField_a;
- unsigned short wTransmitLength_a;
unsigned short wDuration_b;
unsigned short wDuration_a;
unsigned short wDuration_a_f0;
typedef struct tagSTxDataHead_ab {
struct vnt_phy_field ab;
- unsigned char bySignalField;
- unsigned char byServiceField;
- unsigned short wTransmitLength;
unsigned short wDuration;
unsigned short wTimeStampOff;
} __attribute__ ((__packed__))
typedef struct tagSTxDataHead_a_FB {
struct vnt_phy_field a;
- unsigned char bySignalField;
- unsigned char byServiceField;
- unsigned short wTransmitLength;
unsigned short wDuration;
unsigned short wTimeStampOff;
unsigned short wDuration_f0;