Commit e8e8f87e authored by Eddie Kovsky's avatar Eddie Kovsky Committed by Greg Kroah-Hartman

staging: Clean up whitespace warnings in staging/winbond

Reduced checkpatch.pl warnings from 46 to 17
Long strings on lines over 80 characters remain untouched
Signed-off-by: default avatarEddie Kovsky <ewk@edkovsky.org>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6fafecb9
...@@ -56,7 +56,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -56,7 +56,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
RTS_on = true; /* Using RTS */ RTS_on = true; /* Using RTS */
else { else {
if (pT01->T01_modulation_type) { /* Is using OFDM */ if (pT01->T01_modulation_type) { /* Is using OFDM */
if (CURRENT_PROTECT_MECHANISM) /* Is using protect */ /* Is using protect */
if (CURRENT_PROTECT_MECHANISM)
CTS_on = true; /* Using CTS */ CTS_on = true; /* Using CTS */
} }
} }
...@@ -69,9 +70,9 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -69,9 +70,9 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
* ACK Rate : 24 Mega bps * ACK Rate : 24 Mega bps
* ACK frame length = 14 bytes */ * ACK frame length = 14 bytes */
Duration = 2*DEFAULT_SIFSTIME + Duration = 2*DEFAULT_SIFSTIME +
2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym +
((112 + 22 + 95)/96)*Tsym; ((112 + 22 + 95)/96)*Tsym;
} else { /* DSSS */ } else { /* DSSS */
/* CTS duration /* CTS duration
* 2 SIFS + DATA transmit time + 1 ACK * 2 SIFS + DATA transmit time + 1 ACK
...@@ -92,13 +93,15 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -92,13 +93,15 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
* CTS Rate : 24 Mega bps * CTS Rate : 24 Mega bps
* CTS frame length = 14 bytes */ * CTS frame length = 14 bytes */
Duration += (DEFAULT_SIFSTIME + Duration += (DEFAULT_SIFSTIME +
PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
((112 + 22 + 95)/96)*Tsym); ((112 + 22 + 95)/96)*Tsym);
} else { } else {
/* CTS + 1 SIFS + CTS duration /* CTS + 1 SIFS + CTS duration
* CTS Rate : ?? Mega bps * CTS Rate : ?? Mega bps
* CTS frame length = 14 bytes */ * CTS frame length = 14 bytes
if (pT01->T01_plcp_header_length) /* long preamble */ */
/* long preamble */
if (pT01->T01_plcp_header_length)
Duration += LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; Duration += LONG_PREAMBLE_PLUS_PLCPHEADER_TIME;
else else
Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME;
...@@ -149,8 +152,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -149,8 +152,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
+ Rate-1) / Rate + + Rate-1) / Rate +
DEFAULT_SIFSTIME*3); DEFAULT_SIFSTIME*3);
} }
/* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */
((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ ((u16 *)buffer)[5] = cpu_to_le16(Duration);
/* ----20061009 add by anson's endian */ /* ----20061009 add by anson's endian */
pNextT00->value = cpu_to_le32(pNextT00->value); pNextT00->value = cpu_to_le32(pNextT00->value);
...@@ -159,7 +162,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -159,7 +162,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
buffer += OffsetSize; buffer += OffsetSize;
pT01 = (struct T01_descriptor *)(buffer+4); pT01 = (struct T01_descriptor *)(buffer+4);
if (i != 1) /* The last fragment will not have the next fragment */ /* The last fragment will not have the next fragment */
if (i != 1)
pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize); pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize);
} }
...@@ -189,7 +193,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, ...@@ -189,7 +193,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,
} }
} }
((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */
((u16 *)buffer)[5] = cpu_to_le16(Duration);
pT00->value = cpu_to_le32(pT00->value); pT00->value = cpu_to_le32(pT00->value);
pT01->value = cpu_to_le32(pT01->value); pT01->value = cpu_to_le32(pT01->value);
/* --end 20061009 add */ /* --end 20061009 add */
...@@ -221,9 +226,10 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, ...@@ -221,9 +226,10 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter,
CopySize = SizeLeft; CopySize = SizeLeft;
if (SizeLeft > pDes->FragmentThreshold) { if (SizeLeft > pDes->FragmentThreshold) {
CopySize = pDes->FragmentThreshold; CopySize = pDes->FragmentThreshold;
pT00->T00_frame_length = 24 + CopySize; /* Set USB length */ /* Set USB length */
} else pT00->T00_frame_length = 24 + CopySize;
pT00->T00_frame_length = 24 + SizeLeft; /* Set USB length */ } else /* Set USB length */
pT00->T00_frame_length = 24 + SizeLeft;
SizeLeft -= CopySize; SizeLeft -= CopySize;
...@@ -267,21 +273,27 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, ...@@ -267,21 +273,27 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter,
/* 931130.5.n */ /* 931130.5.n */
if (pMds->MicAdd) { if (pMds->MicAdd) {
if (!SizeLeft) { if (!SizeLeft) {
pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - pMds->MicAdd; pMds->MicWriteAddress[pMds->MicWriteIndex] =
pMds->MicWriteSize[pMds->MicWriteIndex] = pMds->MicAdd; buffer - pMds->MicAdd;
pMds->MicWriteSize[pMds->MicWriteIndex] =
pMds->MicAdd;
pMds->MicAdd = 0; pMds->MicAdd = 0;
} else if (SizeLeft < 8) { /* 931130.5.p */ } else if (SizeLeft < 8) { /* 931130.5.p */
pMds->MicAdd = SizeLeft; pMds->MicAdd = SizeLeft;
pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - (8 - SizeLeft); pMds->MicWriteAddress[pMds->MicWriteIndex] =
pMds->MicWriteSize[pMds->MicWriteIndex] = 8 - SizeLeft; buffer - (8 - SizeLeft);
pMds->MicWriteSize[pMds->MicWriteIndex] =
8 - SizeLeft;
pMds->MicWriteIndex++; pMds->MicWriteIndex++;
} }
} }
/* Does it need to generate the new header for next mpdu? */ /* Does it need to generate the new header for next mpdu? */
if (SizeLeft) { if (SizeLeft) {
buffer = TargetBuffer + Size; /* Get the next 4n start address */ /* Get the next 4n start address */
memcpy(buffer, TargetBuffer, 32); /* Copy 8B USB +24B 802.11 */ buffer = TargetBuffer + Size;
/* Copy 8B USB +24B 802.11 */
memcpy(buffer, TargetBuffer, 32);
pT00 = (struct T00_descriptor *)buffer; pT00 = (struct T00_descriptor *)buffer;
pT00->T00_first_mpdu = 0; pT00->T00_first_mpdu = 0;
} }
...@@ -293,7 +305,8 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, ...@@ -293,7 +305,8 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter,
pT00->T00_IsLastMpdu = 1; pT00->T00_IsLastMpdu = 1;
buffer = (u8 *)pT00 + 8; /* +8 for USB hdr */ buffer = (u8 *)pT00 + 8; /* +8 for USB hdr */
buffer[1] &= ~0x04; /* Clear more frag bit of 802.11 frame control */ buffer[1] &= ~0x04; /* Clear more frag bit of 802.11 frame control */
pDes->FragmentCount = FragmentCount; /* Update the correct fragment number */ /* Update the correct fragment number */
pDes->FragmentCount = FragmentCount;
return Size; return Size;
} }
...@@ -330,7 +343,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, ...@@ -330,7 +343,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter,
FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */ FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */
/* Copy full data, the 1'st buffer contain all the data 931130.5.j */ /* Copy full data, the 1'st buffer contain all the data 931130.5.j */
memcpy(TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE); /* Copy header */ /* Copy header */
memcpy(TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE);
pDes->buffer_address[0] = src_buffer + DOT_11_MAC_HEADER_SIZE; pDes->buffer_address[0] = src_buffer + DOT_11_MAC_HEADER_SIZE;
pDes->buffer_total_size -= DOT_11_MAC_HEADER_SIZE; pDes->buffer_total_size -= DOT_11_MAC_HEADER_SIZE;
pDes->buffer_size[0] = pDes->buffer_total_size; pDes->buffer_size[0] = pDes->buffer_total_size;
...@@ -358,8 +372,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, ...@@ -358,8 +372,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter,
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (i == 1) if (i == 1)
ctmp1 = ctmpf; ctmp1 = ctmpf;
/* backup the ta rate and fall back rate */
pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */ pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1;
if (ctmp1 == 108) if (ctmp1 == 108)
ctmp2 = 7; ctmp2 = 7;
...@@ -395,7 +409,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, ...@@ -395,7 +409,8 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter,
/* /*
* Set preamble type * Set preamble type
*/ */
if ((pT01->T01_modulation_type == 0) && (pT01->T01_transmit_rate == 0)) /* RATE_1M */ /* RATE_1M */
if ((pT01->T01_modulation_type == 0) && (pT01->T01_transmit_rate == 0))
pDes->PreambleMode = WLAN_PREAMBLE_TYPE_LONG; pDes->PreambleMode = WLAN_PREAMBLE_TYPE_LONG;
else else
pDes->PreambleMode = CURRENT_PREAMBLE_MODE; pDes->PreambleMode = CURRENT_PREAMBLE_MODE;
...@@ -468,12 +483,14 @@ Mds_Tx(struct wbsoft_priv *adapter) ...@@ -468,12 +483,14 @@ Mds_Tx(struct wbsoft_priv *adapter)
/* Start to fill the data */ /* Start to fill the data */
do { do {
FillIndex = pMds->TxFillIndex; FillIndex = pMds->TxFillIndex;
if (pMds->TxOwner[FillIndex]) { /* Is owned by software 0:Yes 1:No */ /* Is owned by software 0:Yes 1:No */
if (pMds->TxOwner[FillIndex]) {
pr_debug("[Mds_Tx] Tx Owner is H/W.\n"); pr_debug("[Mds_Tx] Tx Owner is H/W.\n");
break; break;
} }
XmitBufAddress = pMds->pTxBuffer + (MAX_USB_TX_BUFFER * FillIndex); /* Get buffer */ /* Get buffer */
XmitBufAddress = pMds->pTxBuffer + (MAX_USB_TX_BUFFER * FillIndex);
XmitBufSize = 0; XmitBufSize = 0;
FillCount = 0; FillCount = 0;
do { do {
...@@ -485,7 +502,8 @@ Mds_Tx(struct wbsoft_priv *adapter) ...@@ -485,7 +502,8 @@ Mds_Tx(struct wbsoft_priv *adapter)
FragmentThreshold = CURRENT_FRAGMENT_THRESHOLD; FragmentThreshold = CURRENT_FRAGMENT_THRESHOLD;
/* 931130.5.b */ /* 931130.5.b */
FragmentCount = PacketSize/FragmentThreshold + 1; FragmentCount = PacketSize/FragmentThreshold + 1;
stmp = PacketSize + FragmentCount*32 + 8; /* 931130.5.c 8:MIC */ /* 931130.5.c 8:MIC */
stmp = PacketSize + FragmentCount*32 + 8;
if ((XmitBufSize + stmp) >= MAX_USB_TX_BUFFER) if ((XmitBufSize + stmp) >= MAX_USB_TX_BUFFER)
break; /* buffer is not enough */ break; /* buffer is not enough */
...@@ -499,18 +517,23 @@ Mds_Tx(struct wbsoft_priv *adapter) ...@@ -499,18 +517,23 @@ Mds_Tx(struct wbsoft_priv *adapter)
TxDesIndex = pMds->TxDesIndex; /* Get the current ID */ TxDesIndex = pMds->TxDesIndex; /* Get the current ID */
pTxDes->Descriptor_ID = TxDesIndex; pTxDes->Descriptor_ID = TxDesIndex;
pMds->TxDesFrom[TxDesIndex] = 2; /* Storing the information of source coming from */ /* Storing the information of source coming from */
pMds->TxDesFrom[TxDesIndex] = 2;
pMds->TxDesIndex++; pMds->TxDesIndex++;
pMds->TxDesIndex %= MAX_USB_TX_DESCRIPTOR; pMds->TxDesIndex %= MAX_USB_TX_DESCRIPTOR;
MLME_GetNextPacket(adapter, pTxDes); MLME_GetNextPacket(adapter, pTxDes);
/* Copy header. 8byte USB + 24byte 802.11Hdr. Set TxRate, Preamble type */ /*
* Copy header. 8byte USB + 24byte 802.11Hdr.
* Set TxRate, Preamble type
*/
Mds_HeaderCopy(adapter, pTxDes, XmitBufAddress); Mds_HeaderCopy(adapter, pTxDes, XmitBufAddress);
/* For speed up Key setting */ /* For speed up Key setting */
if (pTxDes->EapFix) { if (pTxDes->EapFix) {
pr_debug("35: EPA 4th frame detected. Size = %d\n", PacketSize); pr_debug("35: EPA 4th frame detected. Size = %d\n",
PacketSize);
pHwData->IsKeyPreSet = 1; pHwData->IsKeyPreSet = 1;
} }
...@@ -524,7 +547,9 @@ Mds_Tx(struct wbsoft_priv *adapter) ...@@ -524,7 +547,9 @@ Mds_Tx(struct wbsoft_priv *adapter)
XmitBufSize += CurrentSize; XmitBufSize += CurrentSize;
XmitBufAddress += CurrentSize; XmitBufAddress += CurrentSize;
/* Get packet to transmit completed, 1:TESTSTA 2:MLME 3: Ndis data */ /* Get packet to transmit completed,
* 1:TESTSTA 2:MLME 3: Ndis data
*/
MLME_SendComplete(adapter, 0, true); MLME_SendComplete(adapter, 0, true);
/* Software TSC count 20060214 */ /* Software TSC count 20060214 */
...@@ -533,7 +558,12 @@ Mds_Tx(struct wbsoft_priv *adapter) ...@@ -533,7 +558,12 @@ Mds_Tx(struct wbsoft_priv *adapter)
pMds->TxTsc_2++; pMds->TxTsc_2++;
FillCount++; /* 20060928 */ FillCount++; /* 20060928 */
} while (HAL_USB_MODE_BURST(pHwData)); /* End of multiple MSDU copy loop. false = single true = multiple sending */ /*
* End of multiple MSDU copy loop.
* false = single
* true = multiple sending
*/
} while (HAL_USB_MODE_BURST(pHwData));
/* Move to the next one, if necessary */ /* Move to the next one, if necessary */
if (BufferFilled) { if (BufferFilled) {
...@@ -594,7 +624,8 @@ Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02) ...@@ -594,7 +624,8 @@ Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02)
pHwData->tx_retry_count[RetryCount] += RetryCount; pHwData->tx_retry_count[RetryCount] += RetryCount;
else else
pHwData->tx_retry_count[7] += RetryCount; pHwData->tx_retry_count[7] += RetryCount;
pr_debug("dto_tx_retry_count =%d\n", pHwData->dto_tx_retry_count); pr_debug("dto_tx_retry_count =%d\n",
pHwData->dto_tx_retry_count);
MTO_SetTxCount(adapter, TxRate, RetryCount); MTO_SetTxCount(adapter, TxRate, RetryCount);
} }
pHwData->dto_tx_frag_count += (RetryCount+1); pHwData->dto_tx_frag_count += (RetryCount+1);
......
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