Convert all remaining locks to spin_lock_irqsave and
spin_unlock_irqrestore
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/dpc.c | 5 +++--
drivers/staging/vt6656/int.c | 5 +++--
drivers/staging/vt6656/iwctl.c | 17 ++++++++++++-----
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 286e735..c0ec5b3 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -863,13 +863,14 @@ void RXvWorkItem(struct work_struct *work)
container_of(work, struct vnt_private, read_work_item);
int status;
struct vnt_rcb *rcb = NULL;
+ unsigned long flags;
if (priv->Flags & fMP_DISCONNECTED)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n");
- spin_lock_irq(&priv->lock);
+ spin_lock_irqsave(&priv->lock, flags);
while ((priv->Flags & fMP_POST_READS) && MP_IS_READY(priv) &&
(priv->NumRecvFreeList != 0)) {
@@ -884,7 +885,7 @@ void RXvWorkItem(struct work_struct *work)
priv->bIsRxWorkItemQueued = false;
- spin_unlock_irq(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
}
void RXvFreeRCB(struct vnt_rcb *rcb, int re_alloc_skb)
diff --git a/drivers/staging/vt6656/int.c b/drivers/staging/vt6656/int.c
index cca56b2..f2a5225 100644
--- a/drivers/staging/vt6656/int.c
+++ b/drivers/staging/vt6656/int.c
@@ -65,15 +65,16 @@ static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */
-*/
void INTvWorkItem(struct vnt_private *pDevice)
{
+ unsigned long flags;
int ntStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
- spin_lock_irq(&pDevice->lock);
+ spin_lock_irqsave(&pDevice->lock, flags);
ntStatus = PIPEnsInterruptRead(pDevice);
- spin_unlock_irq(&pDevice->lock);
+ spin_unlock_irqrestore(&pDevice->lock, flags);
}
void INTnsProcessData(struct vnt_private *priv)
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 3edeb2f..e7b7ca5 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -91,6 +91,7 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
struct iw_scan_req *req = (struct iw_scan_req *)extra;
u8 abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
PWLAN_IE_SSID pItemSSID = NULL;
+ unsigned long flags;
if (!(pDevice->flags & DEVICE_FLAGS_OPENED))
return -EINVAL;
@@ -115,7 +116,7 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
return 0;
}
- spin_lock_irq(&pDevice->lock);
+ spin_lock_irqsave(&pDevice->lock, flags);
BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
@@ -136,7 +137,8 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n", ((PWLAN_IE_SSID)abyScanSSID)->abySSID,
((PWLAN_IE_SSID)abyScanSSID)->len);
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
- spin_unlock_irq(&pDevice->lock);
+
+ spin_unlock_irqrestore(&pDevice->lock, flags);
return 0;
} else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { // passive scan
@@ -148,7 +150,8 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
- spin_unlock_irq(&pDevice->lock);
+
+ spin_unlock_irqrestore(&pDevice->lock, flags);
return 0;
}
@@ -375,6 +378,7 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
struct vnt_private *pDevice = netdev_priv(dev);
__u32 *wmode = &wrqu->mode;
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+ unsigned long flags;
int rc = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWMODE\n");
@@ -415,10 +419,13 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
if (pDevice->bCommit) {
if (pMgmt->eConfigMode == WMAC_CONFIG_AP) {
netif_stop_queue(pDevice->dev);
- spin_lock_irq(&pDevice->lock);
+
+ spin_lock_irqsave(&pDevice->lock, flags);
+
bScheduleCommand((void *) pDevice,
WLAN_CMD_RUN_AP, NULL);
- spin_unlock_irq(&pDevice->lock);
+
+ spin_unlock_irqrestore(&pDevice->lock, flags);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Commit the settings\n");
--
1.9.1
qwTSF -> tsf
wBeaconInterval -> beacon_interval
uBeaconInterval -> beacon_int
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index bb06f59..3ed218a 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -657,30 +657,30 @@ bool CARDbClearCurrentTSF(struct vnt_private *priv)
*
* Parameters:
* In:
- * qwTSF - Current TSF counter
- * wbeaconInterval - Beacon Interval
+ * tsf - Current TSF counter
+ * beacon_interval - Beacon Interval
* Out:
- * qwCurrTSF - Current TSF counter
+ * tsf - Current TSF counter
*
* Return Value: TSF value of next Beacon
*
*/
-u64 CARDqGetNextTBTT(u64 qwTSF, u16 wBeaconInterval)
+u64 CARDqGetNextTBTT(u64 tsf, u16 beacon_interval)
{
- u32 uBeaconInterval;
+ u32 beacon_int;
- uBeaconInterval = wBeaconInterval * 1024;
+ beacon_int = beacon_interval * 1024;
/* Next TBTT =
* ((local_current_TSF / beacon_interval) + 1) * beacon_interval
*/
- if (uBeaconInterval) {
- do_div(qwTSF, uBeaconInterval);
- qwTSF += 1;
- qwTSF *= uBeaconInterval;
+ if (beacon_int) {
+ do_div(tsf, beacon_int);
+ tsf += 1;
+ tsf *= beacon_int;
}
- return qwTSF;
+ return tsf;
}
/*
--
1.9.1
In patch
staging: vt6656 camel case clean up CARDvCalculateOFDMRParameter
rsv_time is indented incorrectly.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 5a65f75..ce069c9 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -256,7 +256,7 @@ void CARDvCalculateOFDMRParameter(u16 rate, u8 bb_type,
*rsv_time = 4;
} else {
*tx_rate = 0x88;
- *rsv_time = 10;
+ *rsv_time = 10;
}
break;
case RATE_54M:
--
1.9.1
camel case change
pDevice -> priv
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 439e536..5a357c5 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -522,15 +522,16 @@ void CARDbAddBasicRate(struct vnt_private *priv, u16 rate_idx)
CARDvUpdateBasicTopRate(priv);
}
-int CARDbIsOFDMinBasicRate(struct vnt_private *pDevice)
+int CARDbIsOFDMinBasicRate(struct vnt_private *priv)
{
int ii;
- for (ii = RATE_54M; ii >= RATE_6M; ii --) {
- if ((pDevice->wBasicRate) & ((u16)(1<<ii)))
- return true;
- }
- return false;
+ for (ii = RATE_54M; ii >= RATE_6M; ii--) {
+ if ((priv->wBasicRate) & ((u16)(1 << ii)))
+ return true;
+ }
+
+ return false;
}
u8 CARDbyGetPktType(struct vnt_private *pDevice)
--
1.9.1
camel case changes
pDevice -> priv
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 5a357c5..e39bdd5 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -534,18 +534,15 @@ int CARDbIsOFDMinBasicRate(struct vnt_private *priv)
return false;
}
-u8 CARDbyGetPktType(struct vnt_private *pDevice)
+u8 CARDbyGetPktType(struct vnt_private *priv)
{
- if (pDevice->byBBType == BB_TYPE_11A || pDevice->byBBType == BB_TYPE_11B) {
- return (u8)pDevice->byBBType;
- }
- else if (CARDbIsOFDMinBasicRate(pDevice)) {
- return PK_TYPE_11GA;
- }
- else {
- return PK_TYPE_11GB;
- }
+ if (priv->byBBType == BB_TYPE_11A || priv->byBBType == BB_TYPE_11B)
+ return (u8)priv->byBBType;
+ else if (CARDbIsOFDMinBasicRate(priv))
+ return PK_TYPE_11GA;
+ else
+ return PK_TYPE_11GB;
}
/*
--
1.9.1
camel case changes
pDevice -> priv
qwTSF -> tsf
wBeaconInterval -> beacon_interval
pbyData -> data
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 45 ++++++++++++++++++-------------------------
1 file changed, 19 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index b73b1b8..09b6de5 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -727,45 +727,38 @@ void CARDvSetFirstNextTBTT(struct vnt_private *priv, u16 beacon_interval)
*
* Parameters:
* In:
- * pDevice - The adapter to be set
- * qwTSF - Current TSF counter
- * wBeaconInterval - Beacon Interval
+ * priv - The adapter to be set
+ * tsf - Current TSF counter
+ * beacon_interval - Beacon Interval
* Out:
* none
*
* Return Value: none
*
*/
-void CARDvUpdateNextTBTT(struct vnt_private *pDevice, u64 qwTSF,
- u16 wBeaconInterval)
+void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 tsf,
+ u16 beacon_interval)
{
- u8 pbyData[8];
-
- qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
+ u8 data[8];
- // Set NextTBTT
+ tsf = CARDqGetNextTBTT(tsf, beacon_interval);
- pbyData[0] = (u8)qwTSF;
- pbyData[1] = (u8)(qwTSF >> 8);
- pbyData[2] = (u8)(qwTSF >> 16);
- pbyData[3] = (u8)(qwTSF >> 24);
- pbyData[4] = (u8)(qwTSF >> 32);
- pbyData[5] = (u8)(qwTSF >> 40);
- pbyData[6] = (u8)(qwTSF >> 48);
- pbyData[7] = (u8)(qwTSF >> 56);
+ data[0] = (u8)tsf;
+ data[1] = (u8)(tsf >> 8);
+ data[2] = (u8)(tsf >> 16);
+ data[3] = (u8)(tsf >> 24);
+ data[4] = (u8)(tsf >> 32);
+ data[5] = (u8)(tsf >> 40);
+ data[6] = (u8)(tsf >> 48);
+ data[7] = (u8)(tsf >> 56);
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_SET_TSFTBTT,
- MESSAGE_REQUEST_TBTT,
- 0,
- 8,
- pbyData
- );
+ CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ MESSAGE_REQUEST_TBTT, 0, 8, data);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "Card:Update Next TBTT[%8lx]\n", (unsigned long)qwTSF);
+ "Card:Update Next TBTT[%8lx]\n", (unsigned long)tsf);
- return;
+ return;
}
/*
--
1.9.1
pDevice -> priv
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index b904b20..bb06f59 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -636,17 +636,17 @@ bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *current_tsf)
*
* Parameters:
* In:
- * pDevice - The adapter to be read
+ * priv - The adapter to be read
*
* Return Value: true if success; otherwise false
*
*/
-bool CARDbClearCurrentTSF(struct vnt_private *pDevice)
+bool CARDbClearCurrentTSF(struct vnt_private *priv)
{
- MACvRegBitsOn(pDevice, MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
+ MACvRegBitsOn(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
- pDevice->qwCurrTSF = 0;
+ priv->qwCurrTSF = 0;
return true;
}
--
1.9.1
pDevice -> priv
pqwCurrTSF -> current_tsf
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 4b0b3ef..b904b20 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -615,17 +615,17 @@ void CARDvAdjustTSF(struct vnt_private *priv, u8 rx_rate,
*
* Parameters:
* In:
- * pDevice - The adapter to be read
+ * priv - The adapter to be read
* Out:
- * qwCurrTSF - Current TSF counter
+ * current_tsf - Current TSF counter
*
* Return Value: true if success; otherwise false
*
*/
-bool CARDbGetCurrentTSF(struct vnt_private *pDevice, u64 *pqwCurrTSF)
+bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *current_tsf)
{
- *pqwCurrTSF = pDevice->qwCurrTSF;
+ *current_tsf = priv->qwCurrTSF;
return true;
}
--
1.9.1
camel case changes
pDevice -> priv
bResult -> ret
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 09b6de5..2635cf7 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -766,38 +766,36 @@ void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 tsf,
*
* Parameters:
* In:
- * pDevice - The adapter to be turned off
+ * priv - The adapter to be turned off
* Out:
* none
*
* Return Value: true if success; otherwise false
*
*/
-int CARDbRadioPowerOff(struct vnt_private *pDevice)
+int CARDbRadioPowerOff(struct vnt_private *priv)
{
- int bResult = true;
-
- //if (pDevice->bRadioOff == true)
- // return true;
-
- pDevice->bRadioOff = true;
-
- switch (pDevice->byRFType) {
- case RF_AL2230:
- case RF_AL2230S:
- case RF_AIROHA7230:
- case RF_VT3226: //RobertYu:20051111
- case RF_VT3226D0:
- case RF_VT3342A0: //RobertYu:20060609
- MACvRegBitsOff(pDevice, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
- break;
- }
+ int ret = true;
+
+ priv->bRadioOff = true;
+
+ switch (priv->byRFType) {
+ case RF_AL2230:
+ case RF_AL2230S:
+ case RF_AIROHA7230:
+ case RF_VT3226:
+ case RF_VT3226D0:
+ case RF_VT3342A0:
+ MACvRegBitsOff(priv, MAC_REG_SOFTPWRCTL,
+ (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
+ break;
+ }
- MACvRegBitsOff(pDevice, MAC_REG_HOSTCR, HOSTCR_RXON);
+ MACvRegBitsOff(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
- BBvSetDeepSleep(pDevice);
+ BBvSetDeepSleep(priv);
- return bResult;
+ return ret;
}
/*
--
1.9.1
camel case changes
byRxRate -> rx_rate
qwTSF1 -> tsf1
qwTSF2 -> tsf2
qwTSFOffset -> tsf_offset
wRxBcnTSFOffst -> rx_bcn_offset
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index e39bdd5..8d12ae9 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -551,27 +551,27 @@ u8 CARDbyGetPktType(struct vnt_private *priv)
*
* Parameters:
* In:
- * pDevice - The adapter to be sync.
- * qwTSF1 - Rx BCN's TSF
- * qwTSF2 - Local TSF
+ * rx_rate - rx rate.
+ * tsf1 - Rx BCN's TSF
+ * tsf2 - Local TSF
* Out:
* none
*
* Return Value: TSF Offset value
*
*/
-u64 CARDqGetTSFOffset(u8 byRxRate, u64 qwTSF1, u64 qwTSF2)
+u64 CARDqGetTSFOffset(u8 rx_rate, u64 tsf1, u64 tsf2)
{
- u64 qwTSFOffset = 0;
- u16 wRxBcnTSFOffst = 0;
+ u64 tsf_offset = 0;
+ u16 rx_bcn_offset = 0;
- wRxBcnTSFOffst = cwRXBCNTSFOff[byRxRate % MAX_RATE];
+ rx_bcn_offset = cwRXBCNTSFOff[rx_rate % MAX_RATE];
- qwTSF2 += (u64)wRxBcnTSFOffst;
+ tsf2 += (u64)rx_bcn_offset;
- qwTSFOffset = qwTSF1 - qwTSF2;
+ tsf_offset = tsf1 - tsf2;
- return qwTSFOffset;
+ return tsf_offset;
}
/*
--
1.9.1
camel case changes
pDevice -> priv
byRxRate -> rx_rate
qwBSSTimestamp -> time_stamp
qwLocalTSF -> local_tsf
qwTSFOffset -> tsf_offset
pbyData -> data
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 44 ++++++++++++++++++-------------------------
1 file changed, 18 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 8d12ae9..4b0b3ef 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -580,42 +580,34 @@ u64 CARDqGetTSFOffset(u8 rx_rate, u64 tsf1, u64 tsf2)
*
* Parameters:
* In:
- * pDevice - The adapter to be sync.
- * qwBSSTimestamp - Rx BCN's TSF
- * qwLocalTSF - Local TSF
+ * priv - The adapter to be sync.
+ * time_stamp - Rx BCN's TSF
+ * local_tsf - Local TSF
* Out:
* none
*
* Return Value: none
*
*/
-void CARDvAdjustTSF(struct vnt_private *pDevice, u8 byRxRate,
- u64 qwBSSTimestamp, u64 qwLocalTSF)
+void CARDvAdjustTSF(struct vnt_private *priv, u8 rx_rate,
+ u64 time_stamp, u64 local_tsf)
{
- u64 qwTSFOffset = 0;
- u8 pbyData[8];
-
- qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, qwLocalTSF);
- // adjust TSF
- // HW's TSF add TSF Offset reg
+ u64 tsf_offset = 0;
+ u8 data[8];
- pbyData[0] = (u8)qwTSFOffset;
- pbyData[1] = (u8)(qwTSFOffset >> 8);
- pbyData[2] = (u8)(qwTSFOffset >> 16);
- pbyData[3] = (u8)(qwTSFOffset >> 24);
- pbyData[4] = (u8)(qwTSFOffset >> 32);
- pbyData[5] = (u8)(qwTSFOffset >> 40);
- pbyData[6] = (u8)(qwTSFOffset >> 48);
- pbyData[7] = (u8)(qwTSFOffset >> 56);
+ tsf_offset = CARDqGetTSFOffset(rx_rate, time_stamp, local_tsf);
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_SET_TSFTBTT,
- MESSAGE_REQUEST_TSF,
- 0,
- 8,
- pbyData
- );
+ data[0] = (u8)tsf_offset;
+ data[1] = (u8)(tsf_offset >> 8);
+ data[2] = (u8)(tsf_offset >> 16);
+ data[3] = (u8)(tsf_offset >> 24);
+ data[4] = (u8)(tsf_offset >> 32);
+ data[5] = (u8)(tsf_offset >> 40);
+ data[6] = (u8)(tsf_offset >> 48);
+ data[7] = (u8)(tsf_offset >> 56);
+ CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ MESSAGE_REQUEST_TSF, 0, 8, data);
}
/*
* Description: Read NIC TSF counter
--
1.9.1
camel case changes
pDevice -> priv
bResult -> ret
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 2635cf7..3d41709 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -803,42 +803,39 @@ int CARDbRadioPowerOff(struct vnt_private *priv)
*
* Parameters:
* In:
- * pDevice - The adapter to be turned on
+ * priv - The adapter to be turned on
* Out:
* none
*
* Return Value: true if success; otherwise false
*
*/
-int CARDbRadioPowerOn(struct vnt_private *pDevice)
+int CARDbRadioPowerOn(struct vnt_private *priv)
{
- int bResult = true;
-
- if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) {
- return false;
- }
+ int ret = true;
- //if (pDevice->bRadioOff == false)
- // return true;
+ if (priv->bHWRadioOff == true || priv->bRadioControlOff == true)
+ return false;
- pDevice->bRadioOff = false;
+ priv->bRadioOff = false;
- BBvExitDeepSleep(pDevice);
+ BBvExitDeepSleep(priv);
- MACvRegBitsOn(pDevice, MAC_REG_HOSTCR, HOSTCR_RXON);
+ MACvRegBitsOn(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
- switch (pDevice->byRFType) {
- case RF_AL2230:
- case RF_AL2230S:
- case RF_AIROHA7230:
- case RF_VT3226: //RobertYu:20051111
- case RF_VT3226D0:
- case RF_VT3342A0: //RobertYu:20060609
- MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
- break;
- }
+ switch (priv->byRFType) {
+ case RF_AL2230:
+ case RF_AL2230S:
+ case RF_AIROHA7230:
+ case RF_VT3226:
+ case RF_VT3226D0:
+ case RF_VT3342A0:
+ MACvRegBitsOn(priv, MAC_REG_SOFTPWRCTL,
+ (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
+ break;
+ }
- return bResult;
+ return ret;
}
void CARDvSetBSSMode(struct vnt_private *pDevice)
--
1.9.1
camel case changes
pDevice -> priv
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 80 +++++++++++++++++++++----------------------
1 file changed, 39 insertions(+), 41 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 3d41709..5a65f75 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -838,46 +838,44 @@ int CARDbRadioPowerOn(struct vnt_private *priv)
return ret;
}
-void CARDvSetBSSMode(struct vnt_private *pDevice)
+void CARDvSetBSSMode(struct vnt_private *priv)
{
- // Set BB and packet type at the same time.//{{RobertYu:20050222, AL7230 have two TX PA output, only connet to b/g now
- // so in 11a mode need to set the MAC Reg0x4C to 11b/g mode to turn on PA
- if( (pDevice->byRFType == RF_AIROHA7230 ) && (pDevice->byBBType == BB_TYPE_11A) )
- {
- MACvSetBBType(pDevice, BB_TYPE_11G);
- }
- else
- {
- MACvSetBBType(pDevice, pDevice->byBBType);
- }
- pDevice->byPacketType = CARDbyGetPktType(pDevice);
-
- if (pDevice->byBBType == BB_TYPE_11A) {
- ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
- } else if (pDevice->byBBType == BB_TYPE_11B) {
- ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
- } else if (pDevice->byBBType == BB_TYPE_11G) {
- ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
- }
-
- vUpdateIFS(pDevice);
- CARDvSetRSPINF(pDevice, (u8)pDevice->byBBType);
-
- if ( pDevice->byBBType == BB_TYPE_11A ) {
- //request by Jack 2005-04-26
- if (pDevice->byRFType == RF_AIROHA7230) {
- pDevice->abyBBVGA[0] = 0x20;
- ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, pDevice->abyBBVGA[0]);
- }
- pDevice->abyBBVGA[2] = 0x10;
- pDevice->abyBBVGA[3] = 0x10;
- } else {
- //request by Jack 2005-04-26
- if (pDevice->byRFType == RF_AIROHA7230) {
- pDevice->abyBBVGA[0] = 0x1C;
- ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, pDevice->abyBBVGA[0]);
- }
- pDevice->abyBBVGA[2] = 0x0;
- pDevice->abyBBVGA[3] = 0x0;
- }
+ if (priv->byRFType == RF_AIROHA7230 && priv->byBBType == BB_TYPE_11A)
+ MACvSetBBType(priv, BB_TYPE_11G);
+ else
+ MACvSetBBType(priv, priv->byBBType);
+
+ priv->byPacketType = CARDbyGetPktType(priv);
+
+ if (priv->byBBType == BB_TYPE_11A)
+ ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
+ else if (priv->byBBType == BB_TYPE_11B)
+ ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
+ else if (priv->byBBType == BB_TYPE_11G)
+ ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
+
+ vUpdateIFS(priv);
+ CARDvSetRSPINF(priv, (u8)priv->byBBType);
+
+ if (priv->byBBType == BB_TYPE_11A) {
+ if (priv->byRFType == RF_AIROHA7230) {
+ priv->abyBBVGA[0] = 0x20;
+
+ ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+ 0xe7, priv->abyBBVGA[0]);
+ }
+
+ priv->abyBBVGA[2] = 0x10;
+ priv->abyBBVGA[3] = 0x10;
+ } else {
+ if (priv->byRFType == RF_AIROHA7230) {
+ priv->abyBBVGA[0] = 0x1c;
+
+ ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+ 0xe7, priv->abyBBVGA[0]);
+ }
+
+ priv->abyBBVGA[2] = 0x0;
+ priv->abyBBVGA[3] = 0x0;
+ }
}
--
1.9.1
camel case changes
pDevice -> priv
wBeaconInterval -> beacon_interval
qwNextTBTT -> next_tbtt
pbyData -> data
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 42 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 3ed218a..b73b1b8 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -690,41 +690,35 @@ u64 CARDqGetNextTBTT(u64 tsf, u16 beacon_interval)
* Parameters:
* In:
* dwIoBase - IO Base
- * wBeaconInterval - Beacon Interval
+ * beacon_interval - Beacon Interval
* Out:
* none
*
* Return Value: none
*
*/
-void CARDvSetFirstNextTBTT(struct vnt_private *pDevice, u16 wBeaconInterval)
+void CARDvSetFirstNextTBTT(struct vnt_private *priv, u16 beacon_interval)
{
- u64 qwNextTBTT = 0;
- u8 pbyData[8];
+ u64 next_tbtt = 0;
+ u8 data[8];
- CARDbClearCurrentTSF(pDevice);
- //CARDbGetCurrentTSF(pDevice, &qwNextTBTT); //Get Local TSF counter
- qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
- // Set NextTBTT
+ CARDbClearCurrentTSF(priv);
- pbyData[0] = (u8)qwNextTBTT;
- pbyData[1] = (u8)(qwNextTBTT >> 8);
- pbyData[2] = (u8)(qwNextTBTT >> 16);
- pbyData[3] = (u8)(qwNextTBTT >> 24);
- pbyData[4] = (u8)(qwNextTBTT >> 32);
- pbyData[5] = (u8)(qwNextTBTT >> 40);
- pbyData[6] = (u8)(qwNextTBTT >> 48);
- pbyData[7] = (u8)(qwNextTBTT >> 56);
+ next_tbtt = CARDqGetNextTBTT(next_tbtt, beacon_interval);
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_SET_TSFTBTT,
- MESSAGE_REQUEST_TBTT,
- 0,
- 8,
- pbyData
- );
+ data[0] = (u8)next_tbtt;
+ data[1] = (u8)(next_tbtt >> 8);
+ data[2] = (u8)(next_tbtt >> 16);
+ data[3] = (u8)(next_tbtt >> 24);
+ data[4] = (u8)(next_tbtt >> 32);
+ data[5] = (u8)(next_tbtt >> 40);
+ data[6] = (u8)(next_tbtt >> 48);
+ data[7] = (u8)(next_tbtt >> 56);
- return;
+ CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ MESSAGE_REQUEST_TBTT, 0, 8, data);
+
+ return;
}
/*
--
1.9.1