Commit 7387f438 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: clean up CARDbSetMediaChannel.

White space and commented out code.

Camel case clean up.
pDevice -> priv
uConnectionChannel -> connection_channel
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1363e4fb
...@@ -75,52 +75,48 @@ static const u16 cwRXBCNTSFOff[MAX_RATE] = ...@@ -75,52 +75,48 @@ static const u16 cwRXBCNTSFOff[MAX_RATE] =
* Parameters: * Parameters:
* In: * In:
* pDevice - The adapter to be set * pDevice - The adapter to be set
* uConnectionChannel - Channel to be set * connection_channel - Channel to be set
* Out: * Out:
* none * none
*/ */
void CARDbSetMediaChannel(struct vnt_private *pDevice, u32 uConnectionChannel) void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel)
{ {
if (pDevice->byBBType == BB_TYPE_11A) { // 15 ~ 38 if (priv->byBBType == BB_TYPE_11A) {
if ((uConnectionChannel < (CB_MAX_CHANNEL_24G+1)) || (uConnectionChannel > CB_MAX_CHANNEL)) if ((connection_channel < (CB_MAX_CHANNEL_24G + 1)) ||
uConnectionChannel = (CB_MAX_CHANNEL_24G+1); (connection_channel > CB_MAX_CHANNEL))
} else { connection_channel = (CB_MAX_CHANNEL_24G + 1);
if ((uConnectionChannel > CB_MAX_CHANNEL_24G) || (uConnectionChannel == 0)) // 1 ~ 14 } else {
uConnectionChannel = 1; if ((connection_channel > CB_MAX_CHANNEL_24G) ||
} (connection_channel == 0))
connection_channel = 1;
// clear NAV }
MACvRegBitsOn(pDevice, MAC_REG_MACCR, MACCR_CLRNAV);
// Set Channel[7] = 0 to tell H/W channel is changing now.
MACvRegBitsOff(pDevice, MAC_REG_CHANNEL, 0x80);
//if (pMgmt->uCurrChannel == uConnectionChannel)
// return bResult;
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_SELECT_CHANNLE,
(u16) uConnectionChannel,
0,
0,
NULL
);
//{{ RobertYu: 20041202 /* clear NAV */
//// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput MACvRegBitsOn(priv, MAC_REG_MACCR, MACCR_CLRNAV);
/* Set Channel[7] = 0 to tell H/W channel is changing now. */
MACvRegBitsOff(priv, MAC_REG_CHANNEL, 0xb0);
CONTROLnsRequestOut(priv, MESSAGE_TYPE_SELECT_CHANNLE,
connection_channel, 0, 0, NULL);
if (priv->byBBType == BB_TYPE_11A) {
priv->byCurPwr = 0xff;
RFbRawSetPower(priv,
priv->abyOFDMAPwrTbl[connection_channel-15], RATE_54M);
} else if (priv->byBBType == BB_TYPE_11G) {
priv->byCurPwr = 0xff;
RFbRawSetPower(priv,
priv->abyOFDMPwrTbl[connection_channel-1], RATE_54M);
} else {
priv->byCurPwr = 0xff;
RFbRawSetPower(priv,
priv->abyCCKPwrTbl[connection_channel-1], RATE_1M);
}
if (pDevice->byBBType == BB_TYPE_11A) { ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
pDevice->byCurPwr = 0xFF; (u8)(connection_channel|0x80));
RFbRawSetPower(pDevice, pDevice->abyOFDMAPwrTbl[uConnectionChannel-15], RATE_54M);
} else if (pDevice->byBBType == BB_TYPE_11G) {
pDevice->byCurPwr = 0xFF;
RFbRawSetPower(pDevice, pDevice->abyOFDMPwrTbl[uConnectionChannel-1], RATE_54M);
} else {
pDevice->byCurPwr = 0xFF;
RFbRawSetPower(pDevice, pDevice->abyCCKPwrTbl[uConnectionChannel-1], RATE_1M);
}
ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_CHANNEL,(u8)(uConnectionChannel|0x80));
} }
/* /*
......
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