staging: vt6656: clean up CARDbSetMediaChannel.
authorMalcolm Priestley <tvboxspy@gmail.com>
Thu, 12 Dec 2013 23:33:08 +0000 (23:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 21:10:40 +0000 (13:10 -0800)
White space and commented out code.

Camel case clean up.
pDevice -> priv
uConnectionChannel -> connection_channel

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/card.c

index 662cfea7527e2ef321c53c538c972513a7fd00d7..bb91ffadbf5dfea466cecc69902a446321eb2a35 100644 (file)
@@ -75,52 +75,48 @@ static const u16 cwRXBCNTSFOff[MAX_RATE] =
  * Parameters:
  *  In:
  *      pDevice             - The adapter to be set
- *      uConnectionChannel  - Channel to be set
+ *      connection_channel  - Channel to be set
  *  Out:
  *      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 ((uConnectionChannel < (CB_MAX_CHANNEL_24G+1)) || (uConnectionChannel > CB_MAX_CHANNEL))
-            uConnectionChannel = (CB_MAX_CHANNEL_24G+1);
-    } else {
-        if ((uConnectionChannel > CB_MAX_CHANNEL_24G) || (uConnectionChannel == 0)) // 1 ~ 14
-            uConnectionChannel = 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
-                        );
+       if (priv->byBBType == BB_TYPE_11A) {
+               if ((connection_channel < (CB_MAX_CHANNEL_24G + 1)) ||
+                                       (connection_channel > CB_MAX_CHANNEL))
+                       connection_channel = (CB_MAX_CHANNEL_24G + 1);
+       } else {
+               if ((connection_channel > CB_MAX_CHANNEL_24G) ||
+                                               (connection_channel == 0))
+                       connection_channel = 1;
+       }
 
-    //{{ RobertYu: 20041202
-    //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput
+       /* clear NAV */
+       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) {
-        pDevice->byCurPwr = 0xFF;
-        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));
+       ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
+               (u8)(connection_channel|0x80));
 }
 
 /*