Loading drivers/staging/winbond/mds.c +82 −91 Original line number Diff line number Diff line Loading @@ -49,8 +49,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor /****************************************** * Set RTS/CTS mechanism ******************************************/ if (!boGroupAddr) { if (!boGroupAddr) { /* NOTE : If the protection mode is enabled and the MSDU will be fragmented, * the tx rates of MPDUs will all be DSSS rates. So it will not use * CTS-to-self in this case. CTS-To-self will only be used when without Loading @@ -60,20 +59,16 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor if (BodyLen >= CURRENT_RTS_THRESHOLD) RTS_on = true; /* Using RTS */ else { if( pT01->T01_modulation_type ) /* Is using OFDM */ { else { if (pT01->T01_modulation_type) { /* Is using OFDM */ if (CURRENT_PROTECT_MECHANISM) /* Is using protect */ CTS_on = true; /* Using CTS */ } } } if( RTS_on || CTS_on ) { if( pT01->T01_modulation_type) /* Is using OFDM */ { if (RTS_on || CTS_on) { if (pT01->T01_modulation_type) { /* Is using OFDM */ /* CTS duration * 2 SIFS + DATA transmit time + 1 ACK * ACK Rate : 24 Mega bps Loading @@ -82,9 +77,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + ((112 + 22 + 95)/96)*Tsym; } else /* DSSS */ { } else { /* DSSS */ /* CTS duration * 2 SIFS + DATA transmit time + 1 ACK * Rate : ?? Mega bps Loading @@ -98,19 +91,15 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor DEFAULT_SIFSTIME*2); } if( RTS_on ) { if( pT01->T01_modulation_type ) /* Is using OFDM */ { if (RTS_on) { if (pT01->T01_modulation_type) { /* Is using OFDM */ /* CTS + 1 SIFS + CTS duration * CTS Rate : 24 Mega bps * CTS frame length = 14 bytes */ Duration += (DEFAULT_SIFSTIME + PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + ((112 + 22 + 95)/96)*Tsym); } else { } else { /* CTS + 1 SIFS + CTS duration * CTS Rate : ?? Mega bps * CTS frame length = 14 bytes */ Loading @@ -134,15 +123,12 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor ******************************************/ if (boGroupAddr) Duration = 0; else { for( i=pDes->FragmentCount-1; i>0; i-- ) { else { for (i = pDes->FragmentCount-1; i > 0; i--) { NextBodyLen = (u16)pNextT00->T00_frame_length; NextBodyLen += 4; /* CRC */ if( pT01->T01_modulation_type ) { if (pT01->T01_modulation_type) { /* OFDM * data transmit time + 3 SIFS + 2 ACK * Rate : ??Mega bps Loading @@ -151,9 +137,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym + (((2*14)*8 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME*3); } else { } else { /* DSSS * data transmit time + 2 ACK + 3 SIFS * Rate : ??Mega bps Loading Loading @@ -184,8 +168,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor /******************************************* * Fill the last fragment descriptor *******************************************/ if( pT01->T01_modulation_type ) { if (pT01->T01_modulation_type) { /* OFDM * 1 SIFS + 1 ACK * Rate : 24 Mega bps Loading @@ -193,9 +176,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION; /* The Tx rate of ACK use 24M */ Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME); } else { } else { /* DSSS * 1 ACK + 1 SIFS * Rate : ?? Mega bps Loading Loading @@ -289,9 +270,7 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - pMds->MicAdd; pMds->MicWriteSize[pMds->MicWriteIndex] = pMds->MicAdd; pMds->MicAdd = 0; } else if( SizeLeft < 8 ) /* 931130.5.p */ { } else if (SizeLeft < 8) { /* 931130.5.p */ pMds->MicAdd = SizeLeft; pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - (8 - SizeLeft); pMds->MicWriteSize[pMds->MicWriteIndex] = 8 - SizeLeft; Loading Loading @@ -383,18 +362,30 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor * pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */ if( ctmp1 == 108) ctmp2 = 7; else if( ctmp1 == 96 ) ctmp2 = 6; /* Rate convert for USB */ else if( ctmp1 == 72 ) ctmp2 = 5; else if( ctmp1 == 48 ) ctmp2 = 4; else if( ctmp1 == 36 ) ctmp2 = 3; else if( ctmp1 == 24 ) ctmp2 = 2; else if( ctmp1 == 18 ) ctmp2 = 1; else if( ctmp1 == 12 ) ctmp2 = 0; else if( ctmp1 == 22 ) ctmp2 = 3; else if( ctmp1 == 11 ) ctmp2 = 2; else if( ctmp1 == 4 ) ctmp2 = 1; else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ if (ctmp1 == 108) ctmp2 = 7; else if (ctmp1 == 96) ctmp2 = 6; /* Rate convert for USB */ else if (ctmp1 == 72) ctmp2 = 5; else if (ctmp1 == 48) ctmp2 = 4; else if (ctmp1 == 36) ctmp2 = 3; else if (ctmp1 == 24) ctmp2 = 2; else if (ctmp1 == 18) ctmp2 = 1; else if (ctmp1 == 12) ctmp2 = 0; else if (ctmp1 == 22) ctmp2 = 3; else if (ctmp1 == 11) ctmp2 = 2; else if (ctmp1 == 4) ctmp2 = 1; else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ if (i == 0) pT01->T01_transmit_rate = ctmp2; Loading Loading
drivers/staging/winbond/mds.c +82 −91 Original line number Diff line number Diff line Loading @@ -49,8 +49,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor /****************************************** * Set RTS/CTS mechanism ******************************************/ if (!boGroupAddr) { if (!boGroupAddr) { /* NOTE : If the protection mode is enabled and the MSDU will be fragmented, * the tx rates of MPDUs will all be DSSS rates. So it will not use * CTS-to-self in this case. CTS-To-self will only be used when without Loading @@ -60,20 +59,16 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor if (BodyLen >= CURRENT_RTS_THRESHOLD) RTS_on = true; /* Using RTS */ else { if( pT01->T01_modulation_type ) /* Is using OFDM */ { else { if (pT01->T01_modulation_type) { /* Is using OFDM */ if (CURRENT_PROTECT_MECHANISM) /* Is using protect */ CTS_on = true; /* Using CTS */ } } } if( RTS_on || CTS_on ) { if( pT01->T01_modulation_type) /* Is using OFDM */ { if (RTS_on || CTS_on) { if (pT01->T01_modulation_type) { /* Is using OFDM */ /* CTS duration * 2 SIFS + DATA transmit time + 1 ACK * ACK Rate : 24 Mega bps Loading @@ -82,9 +77,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + ((112 + 22 + 95)/96)*Tsym; } else /* DSSS */ { } else { /* DSSS */ /* CTS duration * 2 SIFS + DATA transmit time + 1 ACK * Rate : ?? Mega bps Loading @@ -98,19 +91,15 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor DEFAULT_SIFSTIME*2); } if( RTS_on ) { if( pT01->T01_modulation_type ) /* Is using OFDM */ { if (RTS_on) { if (pT01->T01_modulation_type) { /* Is using OFDM */ /* CTS + 1 SIFS + CTS duration * CTS Rate : 24 Mega bps * CTS frame length = 14 bytes */ Duration += (DEFAULT_SIFSTIME + PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + ((112 + 22 + 95)/96)*Tsym); } else { } else { /* CTS + 1 SIFS + CTS duration * CTS Rate : ?? Mega bps * CTS frame length = 14 bytes */ Loading @@ -134,15 +123,12 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor ******************************************/ if (boGroupAddr) Duration = 0; else { for( i=pDes->FragmentCount-1; i>0; i-- ) { else { for (i = pDes->FragmentCount-1; i > 0; i--) { NextBodyLen = (u16)pNextT00->T00_frame_length; NextBodyLen += 4; /* CRC */ if( pT01->T01_modulation_type ) { if (pT01->T01_modulation_type) { /* OFDM * data transmit time + 3 SIFS + 2 ACK * Rate : ??Mega bps Loading @@ -151,9 +137,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym + (((2*14)*8 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME*3); } else { } else { /* DSSS * data transmit time + 2 ACK + 3 SIFS * Rate : ??Mega bps Loading Loading @@ -184,8 +168,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor /******************************************* * Fill the last fragment descriptor *******************************************/ if( pT01->T01_modulation_type ) { if (pT01->T01_modulation_type) { /* OFDM * 1 SIFS + 1 ACK * Rate : 24 Mega bps Loading @@ -193,9 +176,7 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION; /* The Tx rate of ACK use 24M */ Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME); } else { } else { /* DSSS * 1 ACK + 1 SIFS * Rate : ?? Mega bps Loading Loading @@ -289,9 +270,7 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - pMds->MicAdd; pMds->MicWriteSize[pMds->MicWriteIndex] = pMds->MicAdd; pMds->MicAdd = 0; } else if( SizeLeft < 8 ) /* 931130.5.p */ { } else if (SizeLeft < 8) { /* 931130.5.p */ pMds->MicAdd = SizeLeft; pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - (8 - SizeLeft); pMds->MicWriteSize[pMds->MicWriteIndex] = 8 - SizeLeft; Loading Loading @@ -383,18 +362,30 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor * pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */ if( ctmp1 == 108) ctmp2 = 7; else if( ctmp1 == 96 ) ctmp2 = 6; /* Rate convert for USB */ else if( ctmp1 == 72 ) ctmp2 = 5; else if( ctmp1 == 48 ) ctmp2 = 4; else if( ctmp1 == 36 ) ctmp2 = 3; else if( ctmp1 == 24 ) ctmp2 = 2; else if( ctmp1 == 18 ) ctmp2 = 1; else if( ctmp1 == 12 ) ctmp2 = 0; else if( ctmp1 == 22 ) ctmp2 = 3; else if( ctmp1 == 11 ) ctmp2 = 2; else if( ctmp1 == 4 ) ctmp2 = 1; else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ if (ctmp1 == 108) ctmp2 = 7; else if (ctmp1 == 96) ctmp2 = 6; /* Rate convert for USB */ else if (ctmp1 == 72) ctmp2 = 5; else if (ctmp1 == 48) ctmp2 = 4; else if (ctmp1 == 36) ctmp2 = 3; else if (ctmp1 == 24) ctmp2 = 2; else if (ctmp1 == 18) ctmp2 = 1; else if (ctmp1 == 12) ctmp2 = 0; else if (ctmp1 == 22) ctmp2 = 3; else if (ctmp1 == 11) ctmp2 = 2; else if (ctmp1 == 4) ctmp2 = 1; else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ if (i == 0) pT01->T01_transmit_rate = ctmp2; Loading