2014-11-12 21:11:52

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 1/8] staging: vt6655: card Remove function vUpdateIFS

vUpdateIFS does the same operations of CARDbSetPhyParameter there
is not need to call this function.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 65 ------------------------------------
drivers/staging/vt6655/card.h | 1 -
drivers/staging/vt6655/device_main.c | 1 -
3 files changed, 67 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 532c3c8..a93ca16 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -21,7 +21,6 @@
* Functions:
* s_vSafeResetTx - Rest Tx
* CARDvSetRSPINF - Set RSPINF
- * vUpdateIFS - Update slotTime,SIFS,DIFS, and EIFS
* CARDvUpdateBasicTopRate - Update BasicTopRate
* CARDbAddBasicRate - Add to BasicRateSet
* CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet
@@ -770,70 +769,6 @@ void CARDvSetRSPINF(struct vnt_private *pDevice, u8 bb_type)
MACvSelectPage0(pDevice->PortOffset);
}

-/*
- * Description: Update IFS
- *
- * Parameters:
- * In:
- * pDevice - The adapter to be set
- * Out:
- * none
- *
- * Return Value: None.
- */
-void vUpdateIFS(struct vnt_private *pDevice)
-{
- /* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
-
- unsigned char byMaxMin = 0;
-
- if (pDevice->byPacketType == PK_TYPE_11A) { /*0000 0000 0000 0000,11a*/
- pDevice->uSlot = C_SLOT_SHORT;
- pDevice->uSIFS = C_SIFS_A;
- pDevice->uDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
- pDevice->uCwMin = C_CWMIN_A;
- byMaxMin = 4;
- } else if (pDevice->byPacketType == PK_TYPE_11B) {
- /* 0000 0001 0000 0000,11b */
- pDevice->uSlot = C_SLOT_LONG;
- pDevice->uSIFS = C_SIFS_BG;
- pDevice->uDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
- pDevice->uCwMin = C_CWMIN_B;
- byMaxMin = 5;
- } else { /* PK_TYPE_11GA & PK_TYPE_11GB */
- pDevice->uSIFS = C_SIFS_BG;
- if (pDevice->bShortSlotTime)
- pDevice->uSlot = C_SLOT_SHORT;
- else
- pDevice->uSlot = C_SLOT_LONG;
-
- pDevice->uDIFS = C_SIFS_BG + 2*pDevice->uSlot;
- if (pDevice->wBasicRate & 0x0150) {
- /* 0000 0001 0101 0000,24M,12M,6M */
- pDevice->uCwMin = C_CWMIN_A;
- byMaxMin = 4;
- } else {
- pDevice->uCwMin = C_CWMIN_B;
- byMaxMin = 5;
- }
- }
-
- pDevice->uCwMax = C_CWMAX;
- pDevice->uEIFS = C_EIFS;
- if (pDevice->byRFType == RF_RFMD2959) {
- /* bcs TX_PE will reserve 3 us */
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (unsigned char)(pDevice->uSIFS - 3));
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (unsigned char)(pDevice->uDIFS - 3));
- } else {
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (unsigned char)pDevice->uSIFS);
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (unsigned char)pDevice->uDIFS);
- }
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_EIFS, (unsigned char)pDevice->uEIFS);
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_SLOT, (unsigned char)pDevice->uSlot);
- byMaxMin |= 0xA0; /* 1010 1111,C_CWMAX = 1023 */
- VNSvOutPortB(pDevice->PortOffset + MAC_REG_CWMAXMIN0, (unsigned char)byMaxMin);
-}
-
void CARDvUpdateBasicTopRate(struct vnt_private *pDevice)
{
unsigned char byTopOFDM = RATE_24M, byTopCCK = RATE_1M;
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 605d8a8..2e56710 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -67,7 +67,6 @@ typedef enum _CARD_STATUS_TYPE {
struct vnt_private;

void CARDvSetRSPINF(struct vnt_private *, u8);
-void vUpdateIFS(struct vnt_private *);
void CARDvUpdateBasicTopRate(struct vnt_private *);
bool CARDbIsOFDMinBasicRate(struct vnt_private *);
void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 2e31784..1392332 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1485,7 +1485,6 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
else
priv->bShortSlotTime = false;

- vUpdateIFS(priv);
CARDbSetPhyParameter(priv, priv->byBBType);
BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
}
--
2.1.0



2014-11-12 21:11:58

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 4/8] staging: vt6655: IFRFbWriteEmbedded replace __iomem with vnt_private

Fixing callers to vnt_private

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/rf.c | 85 +++++++++++++++++++++++----------------------
drivers/staging/vt6655/rf.h | 2 +-
2 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index da2c5e6..3b7ad49 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -440,18 +440,21 @@ static bool s_bAL7230Init(struct vnt_private *priv)
BBvPowerSaveModeOFF(priv); /* RobertYu:20050106, have DC value for Calibration */

for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[ii]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[ii]);

// PLL On
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

//Calibration
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
- bResult &= IFRFbWriteEmbedded(dwIoBase, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:active, RCK:disable
+ /* TXDCOC:active, RCK:disable */
+ bResult &= IFRFbWriteEmbedded(priv, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbedded(dwIoBase, (0x3ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:disable, RCK:active
+ /* TXDCOC:disable, RCK:active */
+ bResult &= IFRFbWriteEmbedded(priv, (0x3ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]); //TXDCOC:disable, RCK:disable
+ /* TXDCOC:disable, RCK:disable */
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]);

MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3 |
SOFTPWRCTL_SWPE2 |
@@ -478,9 +481,9 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha
// PLLON Off
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable0[byChannel - 1]); //Reg0
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable1[byChannel - 1]); //Reg1
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable2[byChannel - 1]); //Reg4
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable0[byChannel - 1]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable1[byChannel - 1]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable2[byChannel - 1]);

// PLLOn On
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
@@ -569,8 +572,9 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha
* Return Value: true if succeeded; false if failed.
*
*/
-bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData)
+bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)
{
+ void __iomem *dwIoBase = priv->PortOffset;
unsigned short ww;
unsigned long dwValue;

@@ -648,10 +652,10 @@ static bool RFbAL2230Init(struct vnt_private *priv)

//patch abnormal AL2230 frequency output
//2008-8-21 chester <add>
- IFRFbWriteEmbedded(dwIoBase, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
+ IFRFbWriteEmbedded(priv, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));

for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[ii]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230InitTable[ii]);
//2008-8-21 chester <add>
MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us

@@ -659,11 +663,11 @@ static bool RFbAL2230Init(struct vnt_private *priv)
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

MACvTimer0MicroSDelay(dwIoBase, 150);//150us
- bResult &= IFRFbWriteEmbedded(dwIoBase, (0x00d80f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
+ bResult &= IFRFbWriteEmbedded(priv, (0x00d80f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbedded(dwIoBase, (0x00780f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
+ bResult &= IFRFbWriteEmbedded(priv, (0x00780f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[CB_AL2230_INIT_SEQ-1]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230InitTable[CB_AL2230_INIT_SEQ-1]);

MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3 |
SOFTPWRCTL_SWPE2 |
@@ -683,8 +687,8 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha

bResult = true;

- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230ChannelTable0[byChannel - 1]);
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230ChannelTable1[byChannel - 1]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230ChannelTable0[byChannel - 1]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230ChannelTable1[byChannel - 1]);

// Set Channel[7] = 0 to tell H/W channel is changing now.
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel & 0x7F));
@@ -996,22 +1000,22 @@ bool RFbRawSetPower(

switch (pDevice->byRFType) {
case RF_AIROHA:
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
+ bResult &= IFRFbWriteEmbedded(pDevice, dwAL2230PowerTable[byPwr]);
if (uRATE <= RATE_11M)
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
else
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);

break;

case RF_AL2230S:
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
+ bResult &= IFRFbWriteEmbedded(pDevice, dwAL2230PowerTable[byPwr]);
if (uRATE <= RATE_11M) {
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
} else {
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(pDevice, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
}

break;
@@ -1021,7 +1025,7 @@ bool RFbRawSetPower(
dwMax7230Pwr = 0x080C0B00 | ((byPwr) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;

- bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwMax7230Pwr);
+ bResult &= IFRFbWriteEmbedded(pDevice, dwMax7230Pwr);
break;

default:
@@ -1079,7 +1083,6 @@ bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,
unsigned char byOldChannel,
unsigned char byNewChannel)
{
- void __iomem *dwIoBase = priv->PortOffset;
bool bResult;

bResult = true;
@@ -1088,23 +1091,23 @@ bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,
// Channel Index 1~14

if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G)) {
- // Change from 2.4G to 5G
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[2]); //Reg2
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[3]); //Reg3
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[5]); //Reg5
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[7]); //Reg7
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[10]);//Reg10
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[12]);//Reg12
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[15]);//Reg15
+ /* Change from 2.4G to 5G [Reg] */
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[2]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[3]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[5]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[7]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[10]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[12]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[15]);
} else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G)) {
- // change from 5G to 2.4G
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[2]); //Reg2
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[3]); //Reg3
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[5]); //Reg5
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[7]); //Reg7
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[10]);//Reg10
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[12]);//Reg12
- bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[15]);//Reg15
+ /* Change from 5G to 2.4G [Reg] */
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[2]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[3]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[5]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[7]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[10]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[12]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[15]);
}

return bResult;
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index 98c2326..8a6e2cf 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -73,7 +73,7 @@

/*--------------------- Export Functions --------------------------*/

-bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData);
+bool IFRFbWriteEmbedded(struct vnt_private *, unsigned long dwData);
bool RFbSelectChannel(struct vnt_private *, unsigned char byRFType, unsigned char byChannel);
bool RFbInit(
struct vnt_private *
--
2.1.0


2014-11-12 21:12:01

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 6/8] staging: vt6655: rf.c: Remove author comments

Moving names to file header comment

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/rf.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 798dfb7..87d97da 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -29,6 +29,8 @@
* IFRFbWriteEmbedded - Embedded write RF register via MAC
*
* Revision History:
+ * RobertYu 2005
+ * chester 2008
*
*/

@@ -172,7 +174,6 @@ static unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = {
0x0407F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW
};

-//{{ RobertYu:20050104
// 40MHz reference frequency
// Need to Pull PLLON(PE3) low when writing channel registers through 3-wire.
static const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = {
@@ -408,7 +409,6 @@ static const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 161, Tf = 5805MHz (55)
0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56)
};
-//}} RobertYu

/*--------------------- Static Functions --------------------------*/

@@ -511,7 +511,6 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha
*
*/

-//{{ RobertYu: 20041210
/*
* Description: UW2452 IFRF chip init function
*
@@ -525,9 +524,6 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha
*
*/

-//}} RobertYu
-////////////////////////////////////////////////////////////////////////////////
-
/*
* Description: VT3226 IFRF chip init function
*
@@ -645,18 +641,15 @@ static bool RFbAL2230Init(struct vnt_private *priv)

MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI |
SOFTPWRCTL_TXPEINV));
-//2008-8-21 chester <add>
// PLL Off

MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

//patch abnormal AL2230 frequency output
-//2008-8-21 chester <add>
IFRFbWriteEmbedded(priv, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));

for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
bResult &= IFRFbWriteEmbedded(priv, dwAL2230InitTable[ii]);
-//2008-8-21 chester <add>
MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us

// PLL On
@@ -856,7 +849,6 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsig
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]);
break;

- //{{ RobertYu: 20050104
// Need to check, PLLON need to be low for channel setting
case RF_AIROHA7230:
byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3)
@@ -878,7 +870,6 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsig
ii++;
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable2[uChannel-1]);
break;
- //}} RobertYu

case RF_NOTHING:
return true;
@@ -1064,7 +1055,7 @@ RFvRSSITodBm(
switch (priv->byRFType) {
case RF_AIROHA:
case RF_AL2230S:
- case RF_AIROHA7230: //RobertYu: 20040104
+ case RF_AIROHA7230:
a = abyAIROHARF[byIdx];
break;
default:
@@ -1074,9 +1065,6 @@ RFvRSSITodBm(
*pldBm = -1 * (a + b * 2);
}

-////////////////////////////////////////////////////////////////////////////////
-//{{ RobertYu: 20050104
-
// Post processing for the 11b/g and 11a.
// for save time on changing Reg2,3,5,7,10,12,15
bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,
@@ -1112,6 +1100,3 @@ bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,

return bResult;
}
-
-//}} RobertYu
-////////////////////////////////////////////////////////////////////////////////
--
2.1.0


2014-11-12 21:11:56

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 3/8] staging: vt6655: rf remove __iomem *dwIoBase from functions

replacing with vnt_private and removing dereferencing from callers

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/channel.c | 8 +++++---
drivers/staging/vt6655/rf.c | 25 ++++++++++++++++---------
drivers/staging/vt6655/rf.h | 6 +++---
3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index cc1bc94..c8f739d 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -188,14 +188,16 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
/* TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput */

if (pDevice->byRFType == RF_AIROHA7230)
- RFbAL7230SelectChannelPostProcess(pDevice->PortOffset, pDevice->byCurrentCh, (unsigned char)uConnectionChannel);
+ RFbAL7230SelectChannelPostProcess(pDevice, pDevice->byCurrentCh,
+ (unsigned char)uConnectionChannel);

pDevice->byCurrentCh = (unsigned char)uConnectionChannel;
- bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel);
+ bResult &= RFbSelectChannel(pDevice, pDevice->byRFType,
+ (unsigned char)uConnectionChannel);

/* Init Synthesizer Table */
if (pDevice->bEnablePSMode)
- RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel);
+ RFvWriteWakeProgSyn(pDevice, pDevice->byRFType, uConnectionChannel);

BBvSoftwareReset(pDevice);

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 2b1e7a0..da2c5e6 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -468,8 +468,9 @@ static bool s_bAL7230Init(struct vnt_private *priv)
}

// Need to Pull PLLON low when writing channel registers through 3-wire interface
-static bool s_bAL7230SelectChannel(void __iomem *dwIoBase, unsigned char byChannel)
+static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byChannel)
{
+ void __iomem *dwIoBase = priv->PortOffset;
bool bResult;

bResult = true;
@@ -627,8 +628,9 @@ bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData)
* Return Value: true if succeeded; false if failed.
*
*/
-static bool RFbAL2230Init(void __iomem *dwIoBase)
+static bool RFbAL2230Init(struct vnt_private *priv)
{
+ void __iomem *dwIoBase = priv->PortOffset;
int ii;
bool bResult;

@@ -674,8 +676,9 @@ static bool RFbAL2230Init(void __iomem *dwIoBase)
return bResult;
}

-static bool RFbAL2230SelectChannel(void __iomem *dwIoBase, unsigned char byChannel)
+static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byChannel)
{
+ void __iomem *dwIoBase = priv->PortOffset;
bool bResult;

bResult = true;
@@ -756,7 +759,7 @@ bool RFbInit(
case RF_AIROHA:
case RF_AL2230S:
pDevice->byMaxPwrLevel = AL2230_PWR_IDX_LEN;
- bResult = RFbAL2230Init(pDevice->PortOffset);
+ bResult = RFbAL2230Init(pDevice);
break;
case RF_AIROHA7230:
pDevice->byMaxPwrLevel = AL7230_PWR_IDX_LEN;
@@ -785,18 +788,18 @@ bool RFbInit(
* Return Value: true if succeeded; false if failed.
*
*/
-bool RFbSelectChannel(void __iomem *dwIoBase, unsigned char byRFType, unsigned char byChannel)
+bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, unsigned char byChannel)
{
bool bResult = true;

switch (byRFType) {
case RF_AIROHA:
case RF_AL2230S:
- bResult = RFbAL2230SelectChannel(dwIoBase, byChannel);
+ bResult = RFbAL2230SelectChannel(priv, byChannel);
break;
//{{ RobertYu: 20050104
case RF_AIROHA7230:
- bResult = s_bAL7230SelectChannel(dwIoBase, byChannel);
+ bResult = s_bAL7230SelectChannel(priv, byChannel);
break;
//}} RobertYu
case RF_NOTHING:
@@ -821,8 +824,9 @@ bool RFbSelectChannel(void __iomem *dwIoBase, unsigned char byRFType, unsigned c
* Return Value: None.
*
*/
-bool RFvWriteWakeProgSyn(void __iomem *dwIoBase, unsigned char byRFType, unsigned int uChannel)
+bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsigned int uChannel)
{
+ void __iomem *dwIoBase = priv->PortOffset;
int ii;
unsigned char byInitCount = 0;
unsigned char bySleepCount = 0;
@@ -1071,8 +1075,11 @@ RFvRSSITodBm(

// Post processing for the 11b/g and 11a.
// for save time on changing Reg2,3,5,7,10,12,15
-bool RFbAL7230SelectChannelPostProcess(void __iomem *dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel)
+bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,
+ unsigned char byOldChannel,
+ unsigned char byNewChannel)
{
+ void __iomem *dwIoBase = priv->PortOffset;
bool bResult;

bResult = true;
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index e8a7372..98c2326 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -74,11 +74,11 @@
/*--------------------- Export Functions --------------------------*/

bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData);
-bool RFbSelectChannel(void __iomem *dwIoBase, unsigned char byRFType, unsigned char byChannel);
+bool RFbSelectChannel(struct vnt_private *, unsigned char byRFType, unsigned char byChannel);
bool RFbInit(
struct vnt_private *
);
-bool RFvWriteWakeProgSyn(void __iomem *dwIoBase, unsigned char byRFType, unsigned int uChannel);
+bool RFvWriteWakeProgSyn(struct vnt_private *, unsigned char byRFType, unsigned int uChannel);
bool RFbSetPower(struct vnt_private *, unsigned int uRATE, unsigned int uCH);
bool RFbRawSetPower(
struct vnt_private *,
@@ -94,7 +94,7 @@ RFvRSSITodBm(
);

//{{ RobertYu: 20050104
-bool RFbAL7230SelectChannelPostProcess(void __iomem *dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel);
+bool RFbAL7230SelectChannelPostProcess(struct vnt_private *, unsigned char byOldChannel, unsigned char byNewChannel);
//}} RobertYu

#endif // __RF_H__
--
2.1.0


2014-11-12 21:12:04

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 8/8] staging: vt6655: rf.c clean up function comments

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/rf.c | 59 ++++++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 0b16ebf..32ef993 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -424,7 +424,7 @@ static bool s_bAL7230Init(struct vnt_private *priv)

bResult = true;

- //3-wire control for normal mode
+ /* 3-wire control for normal mode */
VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);

MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI |
@@ -434,10 +434,10 @@ static bool s_bAL7230Init(struct vnt_private *priv)
for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTable[ii]);

- // PLL On
+ /* PLL On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

- //Calibration
+ /* Calibration */
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
/* TXDCOC:active, RCK:disable */
bResult &= IFRFbWriteEmbedded(priv, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW));
@@ -455,14 +455,15 @@ static bool s_bAL7230Init(struct vnt_private *priv)

BBvPowerSaveModeON(priv); /* RobertYu:20050106 */

- // PE1: TX_ON, PE2: RX_ON, PE3: PLLON
- //3-wire control for power saving mode
+ /* PE1: TX_ON, PE2: RX_ON, PE3: PLLON */
+ /* 3-wire control for power saving mode */
VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); //1100 0000

return bResult;
}

-// Need to Pull PLLON low when writing channel registers through 3-wire interface
+/* Need to Pull PLLON low when writing channel registers through
+ * 3-wire interface */
static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byChannel)
{
void __iomem *dwIoBase = priv->PortOffset;
@@ -470,20 +471,20 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha

bResult = true;

- // PLLON Off
+ /* PLLON Off */
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable0[byChannel - 1]);
bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable1[byChannel - 1]);
bResult &= IFRFbWriteEmbedded(priv, dwAL7230ChannelTable2[byChannel - 1]);

- // PLLOn On
+ /* PLLOn On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

- // Set Channel[7] = 0 to tell H/W channel is changing now.
+ /* Set Channel[7] = 0 to tell H/W channel is changing now. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel & 0x7F));
MACvTimer0MicroSDelay(dwIoBase, SWITCH_CHANNEL_DELAY_AL7230);
- // Set Channel[7] = 1 to tell H/W channel change is done.
+ /* Set Channel[7] = 1 to tell H/W channel change is done. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel | 0x80));

return bResult;
@@ -510,7 +511,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)

VNSvOutPortD(dwIoBase + MAC_REG_IFREGCTL, dwData);

- // W_MAX_TIMEOUT is the timeout period
+ /* W_MAX_TIMEOUT is the timeout period */
for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_IFREGCTL, &dwValue);
if (dwValue & IFREGCTL_DONE)
@@ -543,23 +544,22 @@ static bool RFbAL2230Init(struct vnt_private *priv)

bResult = true;

- //3-wire control for normal mode
+ /* 3-wire control for normal mode */
VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);

MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI |
SOFTPWRCTL_TXPEINV));
- // PLL Off
-
+ /* PLL Off */
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

- //patch abnormal AL2230 frequency output
+ /* patch abnormal AL2230 frequency output */
IFRFbWriteEmbedded(priv, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));

for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
bResult &= IFRFbWriteEmbedded(priv, dwAL2230InitTable[ii]);
MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us

- // PLL On
+ /* PLL On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);

MACvTimer0MicroSDelay(dwIoBase, 150);//150us
@@ -574,7 +574,7 @@ static bool RFbAL2230Init(struct vnt_private *priv)
SOFTPWRCTL_SWPECTI |
SOFTPWRCTL_TXPEINV));

- //3-wire control for power saving mode
+ /* 3-wire control for power saving mode */
VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); //1100 0000

return bResult;
@@ -590,10 +590,10 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha
bResult &= IFRFbWriteEmbedded(priv, dwAL2230ChannelTable0[byChannel - 1]);
bResult &= IFRFbWriteEmbedded(priv, dwAL2230ChannelTable1[byChannel - 1]);

- // Set Channel[7] = 0 to tell H/W channel is changing now.
+ /* Set Channel[7] = 0 to tell H/W channel is changing now. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel & 0x7F));
MACvTimer0MicroSDelay(dwIoBase, SWITCH_CHANNEL_DELAY_AL2230);
- // Set Channel[7] = 1 to tell H/W channel change is done.
+ /* Set Channel[7] = 1 to tell H/W channel change is done. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel | 0x80));

return bResult;
@@ -702,7 +702,8 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsig
if (uChannel > CB_MAX_CHANNEL_24G)
return false;

- byInitCount = CB_AL2230_INIT_SEQ + 2; // Init Reg + Channel Reg (2)
+ /* Init Reg + Channel Reg (2) */
+ byInitCount = CB_AL2230_INIT_SEQ + 2;
bySleepCount = 0;
if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
return false;
@@ -715,9 +716,10 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsig
MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]);
break;

- // Need to check, PLLON need to be low for channel setting
+ /* Need to check, PLLON need to be low for channel setting */
case RF_AIROHA7230:
- byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3)
+ /* Init Reg + Channel Reg (3) */
+ byInitCount = CB_AL7230_INIT_SEQ + 3;
bySleepCount = 0;
if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
return false;
@@ -878,7 +880,8 @@ bool RFbRawSetPower(
break;

case RF_AIROHA7230:
- // 0x080F1B00 for 3 wire control TxGain(D10) and 0x31 as TX Gain value
+ /* 0x080F1B00 for 3 wire control TxGain(D10)
+ * and 0x31 as TX Gain value */
dwMax7230Pwr = 0x080C0B00 | ((byPwr) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;

@@ -931,8 +934,8 @@ RFvRSSITodBm(
*pldBm = -1 * (a + b * 2);
}

-// Post processing for the 11b/g and 11a.
-// for save time on changing Reg2,3,5,7,10,12,15
+/* Post processing for the 11b/g and 11a.
+ * for save time on changing Reg2,3,5,7,10,12,15 */
bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,
unsigned char byOldChannel,
unsigned char byNewChannel)
@@ -941,9 +944,9 @@ bool RFbAL7230SelectChannelPostProcess(struct vnt_private *priv,

bResult = true;

- // if change between 11 b/g and 11a need to update the following register
- // Channel Index 1~14
-
+ /* if change between 11 b/g and 11a need to update the following
+ * register
+ * Channel Index 1~14 */
if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G)) {
/* Change from 2.4G to 5G [Reg] */
bResult &= IFRFbWriteEmbedded(priv, dwAL7230InitTableAMode[2]);
--
2.1.0


2014-11-12 21:11:54

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 2/8] staging: vt6655: card.c move __iomem into functions.

Removing dereferencing from callers

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/card.c | 18 ++++++++++++------
drivers/staging/vt6655/card.h | 8 ++++----
drivers/staging/vt6655/device_main.c | 7 +++----
drivers/staging/vt6655/rxtx.c | 2 +-
4 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index a93ca16..a079640 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -394,7 +394,7 @@ bool CARDbSetBeaconPeriod(struct vnt_private *pDevice,
{
u64 qwNextTBTT = 0;

- CARDbGetCurrentTSF(pDevice->PortOffset, &qwNextTBTT); /* Get Local TSF counter */
+ CARDbGetCurrentTSF(pDevice, &qwNextTBTT); /* Get Local TSF counter */

qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);

@@ -828,8 +828,10 @@ unsigned char CARDbyGetPktType(struct vnt_private *pDevice)
*
* Return Value: none
*/
-void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode)
+void CARDvSetLoopbackMode(struct vnt_private *priv, unsigned short wLoopbackMode)
{
+ void __iomem *dwIoBase = priv->PortOffset;
+
switch (wLoopbackMode) {
case CARD_LB_NONE:
case CARD_LB_MAC:
@@ -905,8 +907,9 @@ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2)
*
* Return Value: true if success; otherwise false
*/
-bool CARDbGetCurrentTSF(void __iomem *dwIoBase, u64 *pqwCurrTSF)
+bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF)
{
+ void __iomem *dwIoBase = priv->PortOffset;
unsigned short ww;
unsigned char byData;

@@ -964,11 +967,12 @@ u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval)
*
* Return Value: none
*/
-void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short wBeaconInterval)
+void CARDvSetFirstNextTBTT(struct vnt_private *priv, unsigned short wBeaconInterval)
{
+ void __iomem *dwIoBase = priv->PortOffset;
u64 qwNextTBTT = 0;

- CARDbGetCurrentTSF(dwIoBase, &qwNextTBTT); /* Get Local TSF counter */
+ CARDbGetCurrentTSF(priv, &qwNextTBTT); /* Get Local TSF counter */

qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
/* Set NextTBTT */
@@ -991,8 +995,10 @@ void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short wBeaconInterva
*
* Return Value: none
*/
-void CARDvUpdateNextTBTT(void __iomem *dwIoBase, u64 qwTSF, unsigned short wBeaconInterval)
+void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, unsigned short wBeaconInterval)
{
+ void __iomem *dwIoBase = priv->PortOffset;
+
qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
/* Set NextTBTT */
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, (u32)qwTSF);
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 2e56710..2dfc419 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -69,11 +69,11 @@ struct vnt_private;
void CARDvSetRSPINF(struct vnt_private *, u8);
void CARDvUpdateBasicTopRate(struct vnt_private *);
bool CARDbIsOFDMinBasicRate(struct vnt_private *);
-void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode);
+void CARDvSetLoopbackMode(struct vnt_private *, unsigned short wLoopbackMode);
bool CARDbSoftwareReset(struct vnt_private *);
-void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short wBeaconInterval);
-void CARDvUpdateNextTBTT(void __iomem *dwIoBase, u64 qwTSF, unsigned short wBeaconInterval);
-bool CARDbGetCurrentTSF(void __iomem *dwIoBase, u64 *pqwCurrTSF);
+void CARDvSetFirstNextTBTT(struct vnt_private *, unsigned short wBeaconInterval);
+void CARDvUpdateNextTBTT(struct vnt_private *, u64 qwTSF, unsigned short wBeaconInterval);
+bool CARDbGetCurrentTSF(struct vnt_private *, u64 *pqwCurrTSF);
u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
unsigned char CARDbyGetPktType(struct vnt_private *);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 1392332..83e4162 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1513,8 +1513,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,

CARDbSetBeaconPeriod(priv, conf->beacon_int);

- CARDvSetFirstNextTBTT(priv->PortOffset,
- conf->beacon_int);
+ CARDvSetFirstNextTBTT(priv, conf->beacon_int);
} else {
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL,
TFTCTL_TSFCNTRST);
@@ -1633,7 +1632,7 @@ static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct vnt_private *priv = hw->priv;
u64 tsf;

- CARDbGetCurrentTSF(priv->PortOffset, &tsf);
+ CARDbGetCurrentTSF(priv, &tsf);

return tsf;
}
@@ -1643,7 +1642,7 @@ static void vnt_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
struct vnt_private *priv = hw->priv;

- CARDvUpdateNextTBTT(priv->PortOffset, tsf, vif->bss_conf.beacon_int);
+ CARDvUpdateNextTBTT(priv, tsf, vif->bss_conf.beacon_int);
}

static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index f4da7e7..4189405 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -1521,7 +1521,7 @@ int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,

VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);

- CARDvSetFirstNextTBTT(priv->PortOffset, conf->beacon_int);
+ CARDvSetFirstNextTBTT(priv, conf->beacon_int);

CARDbSetBeaconPeriod(priv, conf->beacon_int);

--
2.1.0


2014-11-12 21:12:03

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 7/8] staging: vt6655: rf.c Removed unneeded comments

Type and function that are not present comments

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/rf.c | 134 --------------------------------------------
1 file changed, 134 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 87d97da..0b16ebf 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -39,8 +39,6 @@
#include "rf.h"
#include "baseband.h"

-/*--------------------- Static Definitions -------------------------*/
-
#define BY_AL2230_REG_LEN 23 //24bit
#define CB_AL2230_INIT_SEQ 15
#define SWITCH_CHANNEL_DELAY_AL2230 200 //us
@@ -51,10 +49,6 @@
#define SWITCH_CHANNEL_DELAY_AL7230 200 //us
#define AL7230_PWR_IDX_LEN 64

-/*--------------------- Static Classes ----------------------------*/
-
-/*--------------------- Static Variables --------------------------*/
-
static const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
@@ -410,8 +404,6 @@ static const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56)
};

-/*--------------------- Static Functions --------------------------*/
-
/*
* Description: AIROHA IFRF chip init function
*
@@ -498,64 +490,6 @@ static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char byCha
}

/*
- * Description: Select channel with UW2452 chip
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * uChannel - Channel number
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: UW2452 IFRF chip init function
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: VT3226 IFRF chip init function
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: Select channel with VT3226 chip
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * uChannel - Channel number
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*--------------------- Export Variables --------------------------*/
-
-/*--------------------- Export Functions --------------------------*/
-
-/*
* Description: Write to IF/RF, by embedded programming
*
* Parameters:
@@ -590,33 +524,6 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)
}

/*
- * Description: RFMD RF2959 IFRF chip init function
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: Select channel with RFMD 2959 chip
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * uChannel - Channel number
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
* Description: AIROHA IFRF chip init function
*
* Parameters:
@@ -693,47 +600,6 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha
}

/*
- * Description: UW2451 IFRF chip init function
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: Select channel with UW2451 chip
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * uChannel - Channel number
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
- * Description: Set sleep mode to UW2451 chip
- *
- * Parameters:
- * In:
- * dwIoBase - I/O base address
- * uChannel - Channel number
- * Out:
- * none
- *
- * Return Value: true if succeeded; false if failed.
- *
- */
-
-/*
* Description: RF init function
*
* Parameters:
--
2.1.0


2014-11-12 21:11:59

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 5/8] staging: vt6655: rf.c camel calse vnt_private rename pDevice to priv

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/rf.c | 72 ++++++++++++++++++++++-----------------------
1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 3b7ad49..798dfb7 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -754,20 +754,20 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha
*
*/
bool RFbInit(
- struct vnt_private *pDevice
+ struct vnt_private *priv
)
{
bool bResult = true;

- switch (pDevice->byRFType) {
+ switch (priv->byRFType) {
case RF_AIROHA:
case RF_AL2230S:
- pDevice->byMaxPwrLevel = AL2230_PWR_IDX_LEN;
- bResult = RFbAL2230Init(pDevice);
+ priv->byMaxPwrLevel = AL2230_PWR_IDX_LEN;
+ bResult = RFbAL2230Init(priv);
break;
case RF_AIROHA7230:
- pDevice->byMaxPwrLevel = AL7230_PWR_IDX_LEN;
- bResult = s_bAL7230Init(pDevice);
+ priv->byMaxPwrLevel = AL7230_PWR_IDX_LEN;
+ bResult = s_bAL7230Init(priv);
break;
case RF_NOTHING:
bResult = true;
@@ -906,7 +906,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, unsig
*
*/
bool RFbSetPower(
- struct vnt_private *pDevice,
+ struct vnt_private *priv,
unsigned int uRATE,
unsigned int uCH
)
@@ -916,7 +916,7 @@ bool RFbSetPower(
unsigned char byDec = 0;
unsigned char byPwrdBm = 0;

- if (pDevice->dwDiagRefCount != 0)
+ if (priv->dwDiagRefCount != 0)
return true;

if ((uCH < 1) || (uCH > CB_MAX_CHANNEL))
@@ -927,22 +927,22 @@ bool RFbSetPower(
case RATE_2M:
case RATE_5M:
case RATE_11M:
- byPwr = pDevice->abyCCKPwrTbl[uCH];
- byPwrdBm = pDevice->abyCCKDefaultPwr[uCH];
+ byPwr = priv->abyCCKPwrTbl[uCH];
+ byPwrdBm = priv->abyCCKDefaultPwr[uCH];
break;
case RATE_6M:
case RATE_9M:
case RATE_18M:
- byPwr = pDevice->abyOFDMPwrTbl[uCH];
- if (pDevice->byRFType == RF_UW2452)
+ byPwr = priv->abyOFDMPwrTbl[uCH];
+ if (priv->byRFType == RF_UW2452)
byDec = byPwr + 14;
else
byDec = byPwr + 10;

- if (byDec >= pDevice->byMaxPwrLevel)
- byDec = pDevice->byMaxPwrLevel-1;
+ if (byDec >= priv->byMaxPwrLevel)
+ byDec = priv->byMaxPwrLevel-1;

- if (pDevice->byRFType == RF_UW2452) {
+ if (priv->byRFType == RF_UW2452) {
byPwrdBm = byDec - byPwr;
byPwrdBm /= 3;
} else {
@@ -950,24 +950,24 @@ bool RFbSetPower(
byPwrdBm >>= 1;
}

- byPwrdBm += pDevice->abyOFDMDefaultPwr[uCH];
+ byPwrdBm += priv->abyOFDMDefaultPwr[uCH];
byPwr = byDec;
break;
case RATE_24M:
case RATE_36M:
case RATE_48M:
case RATE_54M:
- byPwr = pDevice->abyOFDMPwrTbl[uCH];
- byPwrdBm = pDevice->abyOFDMDefaultPwr[uCH];
+ byPwr = priv->abyOFDMPwrTbl[uCH];
+ byPwrdBm = priv->abyOFDMDefaultPwr[uCH];
break;
}

- if (pDevice->byCurPwr == byPwr)
+ if (priv->byCurPwr == byPwr)
return true;

- bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
+ bResult = RFbRawSetPower(priv, byPwr, uRATE);
if (bResult)
- pDevice->byCurPwr = byPwr;
+ priv->byCurPwr = byPwr;

return bResult;
}
@@ -987,7 +987,7 @@ bool RFbSetPower(
*/

bool RFbRawSetPower(
- struct vnt_private *pDevice,
+ struct vnt_private *priv,
unsigned char byPwr,
unsigned int uRATE
)
@@ -995,27 +995,27 @@ bool RFbRawSetPower(
bool bResult = true;
unsigned long dwMax7230Pwr = 0;

- if (byPwr >= pDevice->byMaxPwrLevel)
+ if (byPwr >= priv->byMaxPwrLevel)
return false;

- switch (pDevice->byRFType) {
+ switch (priv->byRFType) {
case RF_AIROHA:
- bResult &= IFRFbWriteEmbedded(pDevice, dwAL2230PowerTable[byPwr]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230PowerTable[byPwr]);
if (uRATE <= RATE_11M)
- bResult &= IFRFbWriteEmbedded(pDevice, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
else
- bResult &= IFRFbWriteEmbedded(pDevice, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);

break;

case RF_AL2230S:
- bResult &= IFRFbWriteEmbedded(pDevice, dwAL2230PowerTable[byPwr]);
+ bResult &= IFRFbWriteEmbedded(priv, dwAL2230PowerTable[byPwr]);
if (uRATE <= RATE_11M) {
- bResult &= IFRFbWriteEmbedded(pDevice, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
- bResult &= IFRFbWriteEmbedded(pDevice, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
} else {
- bResult &= IFRFbWriteEmbedded(pDevice, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
- bResult &= IFRFbWriteEmbedded(pDevice, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
+ bResult &= IFRFbWriteEmbedded(priv, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
}

break;
@@ -1025,7 +1025,7 @@ bool RFbRawSetPower(
dwMax7230Pwr = 0x080C0B00 | ((byPwr) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;

- bResult &= IFRFbWriteEmbedded(pDevice, dwMax7230Pwr);
+ bResult &= IFRFbWriteEmbedded(priv, dwMax7230Pwr);
break;

default:
@@ -1041,7 +1041,7 @@ bool RFbRawSetPower(
*
* Parameters:
* In:
- * pDevice - The adapter to be translated
+ * priv - The adapter to be translated
* byCurrRSSI - RSSI to be translated
* Out:
* pdwdbm - Translated dbm number
@@ -1051,7 +1051,7 @@ bool RFbRawSetPower(
-*/
void
RFvRSSITodBm(
- struct vnt_private *pDevice,
+ struct vnt_private *priv,
unsigned char byCurrRSSI,
long *pldBm
)
@@ -1061,7 +1061,7 @@ RFvRSSITodBm(
long a = 0;
unsigned char abyAIROHARF[4] = {0, 18, 0, 40};

- switch (pDevice->byRFType) {
+ switch (priv->byRFType) {
case RF_AIROHA:
case RF_AL2230S:
case RF_AIROHA7230: //RobertYu: 20040104
--
2.1.0