static void s_vGenerateTxParameter(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime,
void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx,
- PSEthernetHeader psEthHeader);
+ struct ethhdr *psEthHeader);
static u32 s_uFillDataHead(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength,
static void s_vGenerateMACHeader(struct vnt_private *pDevice,
- u8 *pbyBufferAddr, u16 wDuration, PSEthernetHeader psEthHeader,
+ u8 *pbyBufferAddr, u16 wDuration, struct ethhdr *psEthHeader,
int bNeedEncrypt, u16 wFragType, u32 uDMAIdx, u32 uFragIdx);
static void s_vFillTxKey(struct vnt_private *pDevice, u8 *pbyBuf,
static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
void *pvRTS, u32 cbFrameLength, int bNeedAck, int bDisCRC,
- PSEthernetHeader psEthHeader, u16 wCurrentRate, u8 byFBOption);
+ struct ethhdr *psEthHeader, u16 wCurrentRate, u8 byFBOption);
static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
u32 cbFrameLength, u8 byPktType, u16 wRate, int bNeedAck,
static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
void *pvRTS, u32 cbFrameLength, int bNeedAck, int bDisCRC,
- PSEthernetHeader psEthHeader, u16 wCurrentRate, u8 byFBOption)
+ struct ethhdr *psEthHeader, u16 wCurrentRate, u8 byFBOption)
{
u32 uRTSFrameLen = 20;
u16 wLen = 0;
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
}
else {
}
else {
memcpy(&(pBuf->Data.abyTA[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
}
}
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
}
else {
}
else {
memcpy(&(pBuf->Data.abyTA[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
}
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
} else {
memcpy(&(pBuf->Data.abyRA[0]),
ETH_ALEN);
} else {
memcpy(&(pBuf->Data.abyTA[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
}
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
} else {
memcpy(&(pBuf->Data.abyRA[0]),
ETH_ALEN);
} else {
memcpy(&(pBuf->Data.abyTA[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
}
}
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
memcpy(&(pBuf->Data.abyRA[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
}
else {
ETH_ALEN);
} else {
memcpy(&(pBuf->Data.abyTA[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
}
}
static void s_vGenerateTxParameter(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxBufHead, void *pvRrvTime,
void *pvRTS, void *pvCTS, u32 cbFrameSize, int bNeedACK, u32 uDMAIdx,
- PSEthernetHeader psEthHeader)
+ struct ethhdr *psEthHeader)
{
u32 cbMACHdLen = WLAN_HDR_ADDR3_LEN; /* 24 */
u16 wFifoCtl;
static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
u8 *usbPacketBuf, int bNeedEncryption, u32 uSkbPacketLen, u32 uDMAIdx,
- PSEthernetHeader psEthHeader, u8 *pPacket, PSKeyItem pTransmitKey,
+ struct ethhdr *psEthHeader, u8 *pPacket, PSKeyItem pTransmitKey,
u32 uNodeIndex, u16 wCurrentRate, u32 *pcbHeaderLen, u32 *pcbTotalLen)
{
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
memset(pTxBufHead, 0, sizeof(TX_BUFFER));
// Get pkt type
- if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) {
+ if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) {
if (pDevice->dwDiagRefCount == 0) {
cb802_1_H_len = 8;
} else {
} else { //if (pDevice->dwDiagRefCount != 0) {
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(psEthHeader->abyDstAddr)) {
+ if (is_multicast_ether_addr(psEthHeader->h_dest)) {
bNeedACK = false;
pTxBufHead->wFIFOCtl =
pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
}
// 802.1H
- if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) {
+ if (ntohs(psEthHeader->h_proto) > ETH_DATA_LEN) {
if (pDevice->dwDiagRefCount == 0) {
- if ((psEthHeader->wType == cpu_to_be16(ETH_P_IPX)) ||
- (psEthHeader->wType == cpu_to_le16(0xF380))) {
+ if ((psEthHeader->h_proto == cpu_to_be16(ETH_P_IPX)) ||
+ (psEthHeader->h_proto == cpu_to_le16(0xF380))) {
memcpy((u8 *) (pbyPayloadHead),
abySNAP_Bridgetunnel, 6);
} else {
memcpy((u8 *) (pbyPayloadHead), &abySNAP_RFC1042[0], 6);
}
pbyType = (u8 *) (pbyPayloadHead + 6);
- memcpy(pbyType, &(psEthHeader->wType), sizeof(u16));
+ memcpy(pbyType, &(psEthHeader->h_proto), sizeof(u16));
} else {
- memcpy((u8 *) (pbyPayloadHead), &(psEthHeader->wType), sizeof(u16));
+ memcpy((u8 *) (pbyPayloadHead), &(psEthHeader->h_proto), sizeof(u16));
}
}
// DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1);
- MIC_vAppend((u8 *)&(psEthHeader->abyDstAddr[0]), 12);
+ MIC_vAppend((u8 *)&(psEthHeader->h_dest[0]), 12);
dwMIC_Priority = 0;
MIC_vAppend((u8 *)&dwMIC_Priority, 4);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %X, %X\n",
-*/
static void s_vGenerateMACHeader(struct vnt_private *pDevice,
- u8 *pbyBufferAddr, u16 wDuration, PSEthernetHeader psEthHeader,
+ u8 *pbyBufferAddr, u16 wDuration, struct ethhdr *psEthHeader,
int bNeedEncrypt, u16 wFragType, u32 uDMAIdx, u32 uFragIdx)
{
PS802_11Header pMACHeader = (PS802_11Header)pbyBufferAddr;
if (pDevice->eOPMode == OP_MODE_AP) {
memcpy(&(pMACHeader->abyAddr1[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
pMACHeader->wFrameCtl |= FC_FROMDS;
} else {
if (pDevice->eOPMode == OP_MODE_ADHOC) {
memcpy(&(pMACHeader->abyAddr1[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
memcpy(&(pMACHeader->abyAddr3[0]),
&(pDevice->abyBSSID[0]),
ETH_ALEN);
} else {
memcpy(&(pMACHeader->abyAddr3[0]),
- &(psEthHeader->abyDstAddr[0]),
+ &(psEthHeader->h_dest[0]),
ETH_ALEN);
memcpy(&(pMACHeader->abyAddr2[0]),
- &(psEthHeader->abySrcAddr[0]),
+ &(psEthHeader->h_source[0]),
ETH_ALEN);
memcpy(&(pMACHeader->abyAddr1[0]),
&(pDevice->abyBSSID[0]),
PUSB_SEND_CONTEXT pContext;
PS802_11Header pMACHeader;
PSCTS pCTS;
- SEthernetHeader sEthHeader;
+ struct ethhdr sEthHeader;
u8 byPktType, *pbyTxBufferAddr;
void *pvRTS, *pvTxDataHd, *pvRrvTime, *pMICHDR;
u32 uDuration, cbReqCount, cbHeaderSize, cbFrameBodySize, cbFrameSize;
memset((void *)(pbyTxBufferAddr + wTxBufSize), 0,
(cbHeaderSize - wTxBufSize));
- memcpy(&(sEthHeader.abyDstAddr[0]),
+ memcpy(&(sEthHeader.h_dest[0]),
&(pPacket->p80211Header->sA3.abyAddr1[0]),
ETH_ALEN);
- memcpy(&(sEthHeader.abySrcAddr[0]),
+ memcpy(&(sEthHeader.h_source[0]),
&(pPacket->p80211Header->sA3.abyAddr2[0]),
ETH_ALEN);
//=========================
u32 *pdwMIC_L, *pdwMIC_R;
u16 wTxBufSize;
u32 cbMacHdLen;
- SEthernetHeader sEthHeader;
+ struct ethhdr sEthHeader;
void *pvRrvTime, *pMICHDR;
u32 wCurrentRate = RATE_1M;
PUWLAN_80211HDR p80211Header;
}
memset((void *)(pbyTxBufferAddr + wTxBufSize), 0,
(cbHeaderSize - wTxBufSize));
- memcpy(&(sEthHeader.abyDstAddr[0]),
+ memcpy(&(sEthHeader.h_dest[0]),
&(p80211Header->sA3.abyAddr1[0]),
ETH_ALEN);
- memcpy(&(sEthHeader.abySrcAddr[0]),
+ memcpy(&(sEthHeader.h_source[0]),
&(p80211Header->sA3.abyAddr2[0]),
ETH_ALEN);
//=========================
// DO Software Michael
MIC_vInit(dwMICKey0, dwMICKey1);
- MIC_vAppend((u8 *)&(sEthHeader.abyDstAddr[0]), 12);
+ MIC_vAppend((u8 *)&(sEthHeader.h_dest[0]), 12);
dwMIC_Priority = 0;
MIC_vAppend((u8 *)&dwMIC_Priority, 4);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY:"\
return STATUS_RESOURCES;
}
- memcpy(pDevice->sTxEthHeader.abyDstAddr, (u8 *)(skb->data), ETH_HLEN);
+ memcpy(pDevice->sTxEthHeader.h_dest, (u8 *)(skb->data), ETH_HLEN);
//mike add:station mode check eapol-key challenge--->
{
Packet_Type = skb->data[ETH_HLEN+1];
Descriptor_type = skb->data[ETH_HLEN+1+1+2];
Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]);
- if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) {
+ if (pDevice->sTxEthHeader.h_proto == cpu_to_be16(ETH_P_PAE)) {
/* 802.1x OR eapol-key challenge frame transfer */
if (((Protocol_Version == 1) || (Protocol_Version == 2)) &&
(Packet_Type == 3)) {
break;
}
}else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
-
- pbyBSSID = pDevice->sTxEthHeader.abyDstAddr; //TO_DS = 0 and FROM_DS = 0 --> 802.11 MAC Address1
+ /* TO_DS = 0 and FROM_DS = 0 --> 802.11 MAC Address1 */
+ pbyBSSID = pDevice->sTxEthHeader.h_dest;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"IBSS Serach Key: \n");
for (ii = 0; ii< 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"%x \n", *(pbyBSSID+ii));
else {
if (pDevice->eOPMode == OP_MODE_ADHOC) {
// Adhoc Tx rate decided from node DB
- if (is_multicast_ether_addr(pDevice->sTxEthHeader.abyDstAddr)) {
+ if (is_multicast_ether_addr(pDevice->sTxEthHeader.h_dest)) {
// Multicast use highest data rate
pDevice->wCurrentRate = pMgmt->sNodeDBTable[0].wTxDataRate;
// preamble type
pDevice->byPreambleType = pDevice->byShortPreamble;
}
else {
- if(BSSbIsSTAInNodeDB(pDevice, &(pDevice->sTxEthHeader.abyDstAddr[0]), &uNodeIndex)) {
+ if (BSSbIsSTAInNodeDB(pDevice, &(pDevice->sTxEthHeader.h_dest[0]), &uNodeIndex)) {
pDevice->wCurrentRate = pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble) {
pDevice->byPreambleType = pDevice->byShortPreamble;
}
}
- if (pDevice->sTxEthHeader.wType == cpu_to_be16(ETH_P_PAE)) {
+ if (pDevice->sTxEthHeader.h_proto == cpu_to_be16(ETH_P_PAE)) {
if (pDevice->byBBType != BB_TYPE_11A) {
pDevice->wCurrentRate = RATE_1M;
pDevice->byACKRate = RATE_1M;
}
if (bNeedEncryption == true) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType));
- if ((pDevice->sTxEthHeader.wType) == cpu_to_be16(ETH_P_PAE)) {
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.h_proto));
+ if ((pDevice->sTxEthHeader.h_proto) == cpu_to_be16(ETH_P_PAE)) {
bNeedEncryption = false;
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType));
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.h_proto));
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
if (pTransmitKey == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Don't Find TX KEY\n");
pContext->Type = CONTEXT_DATA_PACKET;
pContext->uBufLen = (u16)BytesToWrite + 4 ; //USB header
- s_vSaveTxPktInfo(pDevice, (u8) (pTX_Buffer->byPKTNO & 0x0F), &(pContext->sEthHeader.abyDstAddr[0]),(u16) (BytesToWrite-uHeaderLen),pTX_Buffer->wFIFOCtl);
+ s_vSaveTxPktInfo(pDevice, (u8) (pTX_Buffer->byPKTNO & 0x0F), &(pContext->sEthHeader.h_dest[0]), (u16) (BytesToWrite-uHeaderLen), pTX_Buffer->wFIFOCtl);
status = PIPEnsSendBulkOut(pDevice,pContext);
return false;
}
- memcpy(pDevice->sTxEthHeader.abyDstAddr, (u8 *)pbySkbData, ETH_HLEN);
+ memcpy(pDevice->sTxEthHeader.h_dest, (u8 *)pbySkbData, ETH_HLEN);
if (pDevice->bEncryptionEnable == true) {
bNeedEncryption = true;
pContext->Type = CONTEXT_DATA_PACKET;
pContext->uBufLen = (u16)BytesToWrite + 4 ; //USB header
- s_vSaveTxPktInfo(pDevice, (u8) (pTX_Buffer->byPKTNO & 0x0F), &(pContext->sEthHeader.abyDstAddr[0]),(u16) (BytesToWrite-uHeaderLen),pTX_Buffer->wFIFOCtl);
+ s_vSaveTxPktInfo(pDevice, (u8) (pTX_Buffer->byPKTNO & 0x0F), &(pContext->sEthHeader.h_dest[0]), (u16) (BytesToWrite-uHeaderLen), pTX_Buffer->wFIFOCtl);
status = PIPEnsSendBulkOut(pDevice,pContext);