staging: vt6656: replace ControlvWriteByte with vnt_control_out_u8
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 26 May 2014 12:59:03 +0000 (13:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 May 2014 17:36:49 +0000 (10:36 -0700)
add new function in usbpipe.c to replace ControlvWriteByte

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

index 8a965bf821c5d52507656a8eabe7936c9851d630..3373812c80bcd5e42781a8493fa0ac02b8efb626 100644 (file)
@@ -1028,17 +1028,17 @@ int BBbVT3184Init(struct vnt_private *priv)
 
        if ((priv->byRFType == RF_VT3226) ||
                (priv->byRFType == RF_VT3342A0)) {
-               ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+               vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
                                                MAC_REG_ITRTMSET, 0x23);
                MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01);
        } else if (priv->byRFType == RF_VT3226D0) {
-               ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+               vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
                                                MAC_REG_ITRTMSET, 0x11);
                MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01);
        }
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f);
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
 
        RFbRFTableDownload(priv);
 
@@ -1081,13 +1081,13 @@ void BBvSetShortSlotTime(struct vnt_private *priv)
        if (bb_vga == priv->abyBBVGA[0])
                priv->byBBRxConf |= 0x20;
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
 }
 
 void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
 {
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
 
        /* patch for 3253B0 Baseband with Cardbus module */
        if (priv->bShortSlotTime)
@@ -1095,7 +1095,7 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
        else
                priv->byBBRxConf |= 0x20; /* 0010 0000 */
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
 }
 
 /*
@@ -1112,14 +1112,14 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
  */
 void BBvSetDeepSleep(struct vnt_private *priv)
 {
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
 }
 
 void BBvExitDeepSleep(struct vnt_private *priv)
 {
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
 }
 
 void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
@@ -1384,7 +1384,7 @@ void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
        if (!cr_201 && !cr_206)
                return;
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
-       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
 }
 
index 1f20e9adc9238a22583cae5da1df87f0c0bd690b..9313730117fc8c035e3870c1942f2dfb2d3b3f72 100644 (file)
@@ -111,7 +111,7 @@ void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel)
                        priv->abyCCKPwrTbl[connection_channel-1], RATE_1M);
        }
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
                (u8)(connection_channel|0x80));
 }
 
@@ -844,11 +844,11 @@ void CARDvSetBSSMode(struct vnt_private *priv)
        priv->byPacketType = CARDbyGetPktType(priv);
 
        if (priv->byBBType == BB_TYPE_11A)
-               ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
+               vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
        else if (priv->byBBType == BB_TYPE_11B)
-               ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
+               vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
        else if (priv->byBBType == BB_TYPE_11G)
-               ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
+               vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
 
        vUpdateIFS(priv);
        CARDvSetRSPINF(priv, (u8)priv->byBBType);
@@ -857,7 +857,7 @@ void CARDvSetBSSMode(struct vnt_private *priv)
                if (priv->byRFType == RF_AIROHA7230) {
                        priv->abyBBVGA[0] = 0x20;
 
-                       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+                       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
                                                0xe7, priv->abyBBVGA[0]);
                }
 
@@ -867,7 +867,7 @@ void CARDvSetBSSMode(struct vnt_private *priv)
                if (priv->byRFType == RF_AIROHA7230) {
                        priv->abyBBVGA[0] = 0x1c;
 
-                       ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+                       vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
                                                0xe7, priv->abyBBVGA[0]);
                }
 
index 0c59d6d13f9bb16e2f7eee960765ba0881c6a98a..14346a6b928eb5bb08f533f1060fd71ad640ee54 100644 (file)
@@ -27,7 +27,6 @@
  *
  * Functions:
  *      vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
- *      ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
  *      ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
  *      ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set
  *                             some bits in the same address
 /* static int          msglevel                =MSG_LEVEL_INFO;  */
 /* static int          msglevel                =MSG_LEVEL_DEBUG; */
 
-void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
-                       u8 data)
-{
-
-       vnt_control_out(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
-               sizeof(u8), &data);
-
-       return;
-}
-
 void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
                        u8 *data)
 {
index db9dd54c7623589127ccba6bc77154a1d2ee4032..e4e252ecbc28380834dfd8f7fec285bb712cd55a 100644 (file)
@@ -33,9 +33,6 @@
 #include "device.h"
 #include "usbpipe.h"
 
-void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
-                       u8 data);
-
 void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
                        u8 *data);
 
index 01dd0680c012475951c6e7bc7d200c55e8c7eebe..6cc056d07a222718a182089cdcac6797962857ef 100644 (file)
@@ -468,28 +468,28 @@ static int device_init_registers(struct vnt_private *pDevice)
                        byCalibRXIQ = pDevice->abyEEPROM[EEP_OFS_CALIB_RX_IQ];
                        if (byCalibTXIQ || byCalibTXDC || byCalibRXIQ) {
                        /* CR255, enable TX/RX IQ and DC compensation mode */
-                               ControlvWriteByte(pDevice,
+                               vnt_control_out_u8(pDevice,
                                        MESSAGE_REQUEST_BBREG,
                                        0xff,
                                        0x03);
                        /* CR251, TX I/Q Imbalance Calibration */
-                               ControlvWriteByte(pDevice,
+                               vnt_control_out_u8(pDevice,
                                        MESSAGE_REQUEST_BBREG,
                                        0xfb,
                                        byCalibTXIQ);
                        /* CR252, TX DC-Offset Calibration */
-                               ControlvWriteByte(pDevice,
+                               vnt_control_out_u8(pDevice,
                                        MESSAGE_REQUEST_BBREG,
                                        0xfC,
                                        byCalibTXDC);
                        /* CR253, RX I/Q Imbalance Calibration */
-                               ControlvWriteByte(pDevice,
+                               vnt_control_out_u8(pDevice,
                                        MESSAGE_REQUEST_BBREG,
                                        0xfd,
                                        byCalibRXIQ);
                        } else {
                        /* CR255, turn off BB Calibration compensation */
-                               ControlvWriteByte(pDevice,
+                               vnt_control_out_u8(pDevice,
                                        MESSAGE_REQUEST_BBREG,
                                        0xff,
                                        0x0);
@@ -1310,7 +1310,7 @@ void vnt_configure_filter(struct vnt_private *priv)
                priv->byRxMode &= ~(RCR_UNICAST);
        }
 
-       ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+       vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
                                        MAC_REG_RCR, priv->byRxMode);
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
index 7d4e131303de43b7ed5ab06078bfcf9963465c02..2264c8c7ec7ee8a4813c004e03a2c9de8c29b564 100644 (file)
@@ -28,7 +28,7 @@
  * Functions:
  *     vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
  *     vnt_control_in - Read variable length bytes from MEM/BB/MAC/EEPROM
- *      ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
+ *     vnt_control_out_u8 - Write one byte to MEM/BB/MAC/EEPROM
  *      ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
  *      ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set some bits in the same address
  *
@@ -83,6 +83,12 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
        return STATUS_SUCCESS;
 }
 
+void vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 data)
+{
+       vnt_control_out(priv, MESSAGE_TYPE_WRITE,
+                                       reg_off, reg, sizeof(u8), &data);
+}
+
 int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
                u16 index, u16 length, u8 *buffer)
 {
index f04e30bfbfae7d83f6c497bcac5d58977da1e945..a3d3bacd4d66025487fae0146b5c59e4376f23a7 100644 (file)
@@ -35,6 +35,8 @@
 int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *);
 int vnt_control_in(struct vnt_private *, u8, u16, u16, u16,  u8 *);
 
+void vnt_control_out_u8(struct vnt_private *, u8, u8, u8);
+
 int PIPEnsInterruptRead(struct vnt_private *);
 int PIPEnsBulkInUsbRead(struct vnt_private *, struct vnt_rcb *pRCB);
 int PIPEnsSendBulkOut(struct vnt_private *,