Fix wFmSequence and wFrameCtl to __le16
Don't restrict to u8, if packet is a duplicate both bytes of __le16 will be
the same.
Fixes warnings
wctl.c:66:9: warning: restricted __le16 degrades to integer
wctl.c:71:56: warning: restricted __le16 degrades to integer
wctl.c:73:49: warning: cast from restricted __le16
wctl.c:83:30: warning: incorrect type in assignment (different base types)
wctl.c:83:30: expected unsigned short [unsigned] [usertype] wFmSequence
wctl.c:83:30: got restricted __le16 [usertype] seq_ctrl
wctl.c:85:28: warning: incorrect type in assignment (different base types)
wctl.c:85:28: expected unsigned short [unsigned] [usertype] wFrameCtl
wctl.c:85:28: got restricted __le16 [usertype] frame_control
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 6 +++---
drivers/staging/vt6656/wctl.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index e5f84f5..5b64ca7 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -340,9 +340,9 @@ typedef struct tagSPMKIDCandidateEvent {
/* The receive duplicate detection cache entry */
typedef struct tagSCacheEntry{
- u16 wFmSequence;
- u8 abyAddr2[ETH_ALEN];
- u16 wFrameCtl;
+ __le16 wFmSequence;
+ u8 abyAddr2[ETH_ALEN];
+ __le16 wFrameCtl;
} SCacheEntry, *PSCacheEntry;
typedef struct tagSCache{
diff --git a/drivers/staging/vt6656/wctl.c b/drivers/staging/vt6656/wctl.c
index 814342c..efdc5d5 100644
--- a/drivers/staging/vt6656/wctl.c
+++ b/drivers/staging/vt6656/wctl.c
@@ -70,7 +70,7 @@ bool WCTLbIsDuplicate (PSCache pCache, struct ieee80211_hdr *pMACHeader)
pCacheEntry = &(pCache->asCacheEntry[uIndex]);
if ((pCacheEntry->wFmSequence == pMACHeader->seq_ctrl) &&
ether_addr_equal(pCacheEntry->abyAddr2, pMACHeader->addr2) &&
- (LOBYTE(pCacheEntry->wFrameCtl) == LOBYTE(pMACHeader->frame_control))
+ (pCacheEntry->wFrameCtl == pMACHeader->frame_control)
) {
/* Duplicate match */
return true;
--
1.9.1
In commit 78a650dc19ba44e2e07768c6d3b2ff080cf9d245
there was a typo error
abyVT3226_InitTable -> at3226_init_table
abyVT3226D0_InitTable -> at3226d0_init_table
Shoud be vt3226_init_table and vt3226d0_init_table
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 4420114..d509839 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -354,7 +354,7 @@ static u8 al7230_channel_table2[CB_MAX_CHANNEL][3] = {
};
///{{RobertYu:20051111
-static u8 at3226_init_table[CB_VT3226_INIT_SEQ][3] = {
+static u8 vt3226_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x03, 0xFF, 0x80},
{0x02, 0x82, 0xA1},
{0x03, 0xC6, 0xA2},
@@ -368,7 +368,7 @@ static u8 at3226_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x02, 0x00, 0x2A}
};
-static u8 at3226d0_init_table[CB_VT3226_INIT_SEQ][3] = {
+static u8 vt3226d0_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x03, 0xFF, 0x80},
{0x03, 0x02, 0x21}, //RobertYu:20060327
{0x03, 0xC6, 0xA2},
@@ -1021,7 +1021,7 @@ void vnt_rf_table_download(struct vnt_private *priv)
length1 = CB_VT3226_INIT_SEQ * 3;
length2 = CB_MAX_CHANNEL_24G * 3;
length3 = CB_MAX_CHANNEL_24G * 3;
- addr1 = &at3226_init_table[0][0];
+ addr1 = &vt3226_init_table[0][0];
addr2 = &vt3226_channel_table0[0][0];
addr3 = &vt3226_channel_table1[0][0];
break;
@@ -1029,7 +1029,7 @@ void vnt_rf_table_download(struct vnt_private *priv)
length1 = CB_VT3226_INIT_SEQ * 3;
length2 = CB_MAX_CHANNEL_24G * 3;
length3 = CB_MAX_CHANNEL_24G * 3;
- addr1 = &at3226d0_init_table[0][0];
+ addr1 = &vt3226d0_init_table[0][0];
addr2 = &vt3226_channel_table0[0][0];
addr3 = &vt3226_channel_table1[0][0];
break;
--
1.9.1
Remove raw and use txpower.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 6 +++---
drivers/staging/vt6656/rf.c | 10 +++++-----
drivers/staging/vt6656/rf.h | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 5ad0a98..d662e54 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -99,15 +99,15 @@ void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel)
if (priv->byBBType == BB_TYPE_11A) {
priv->byCurPwr = 0xff;
- RFbRawSetPower(priv,
+ vnt_rf_set_txpower(priv,
priv->abyOFDMAPwrTbl[connection_channel-15], RATE_54M);
} else if (priv->byBBType == BB_TYPE_11G) {
priv->byCurPwr = 0xff;
- RFbRawSetPower(priv,
+ vnt_rf_set_txpower(priv,
priv->abyOFDMPwrTbl[connection_channel-1], RATE_54M);
} else {
priv->byCurPwr = 0xff;
- RFbRawSetPower(priv,
+ vnt_rf_set_txpower(priv,
priv->abyCCKPwrTbl[connection_channel-1], RATE_1M);
}
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index c1e0a79..fd69960 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -763,7 +763,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
break;
}
- ret = RFbRawSetPower(priv, power, rate);
+ ret = vnt_rf_set_txpower(priv, power, rate);
return ret;
}
@@ -808,7 +808,7 @@ static u8 vnt_rf_addpower(struct vnt_private *priv)
*
*/
-int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
+int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
{
u32 power_setting = 0;
int ret = true;
@@ -903,14 +903,14 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
if (priv->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ "vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uScanChannel);
ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uScanChannel - 1]);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ "vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uCurrChannel);
ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
@@ -921,7 +921,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "@@@@ RFbRawSetPower> 11G mode\n");
+ "@@@@ vnt_rf_set_txpower> 11G mode\n");
power_setting = ((0x3f-priv->byCurPwr) << 20) |
(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index e47b67d..2040d50 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -59,7 +59,7 @@ extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
-int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
+int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
void RFbRFTableDownload(struct vnt_private *pDevice);
--
1.9.1
Camel case changes
pDevice -> priv
dwData -> data
pbyData -> reg_data
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 9126156..a8e50f7 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -706,17 +706,17 @@ const u8 RFaby11aChannelIndex[200] = {
* Return Value: true if succeeded; false if failed.
*
*/
-int IFRFbWriteEmbedded(struct vnt_private *pDevice, u32 dwData)
+int IFRFbWriteEmbedded(struct vnt_private *priv, u32 data)
{
- u8 pbyData[4];
+ u8 reg_data[4];
- pbyData[0] = (u8)dwData;
- pbyData[1] = (u8)(dwData >> 8);
- pbyData[2] = (u8)(dwData >> 16);
- pbyData[3] = (u8)(dwData >> 24);
+ reg_data[0] = (u8)data;
+ reg_data[1] = (u8)(data >> 8);
+ reg_data[2] = (u8)(data >> 16);
+ reg_data[3] = (u8)(data >> 24);
- vnt_control_out(pDevice,
- MESSAGE_TYPE_WRITE_IFRF, 0, 0, ARRAY_SIZE(pbyData), pbyData);
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF,
+ 0, 0, ARRAY_SIZE(reg_data), reg_data);
return true;
}
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/bssdb.c | 9 +++++----
drivers/staging/vt6656/iwctl.c | 6 +++---
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index f53d3bf..8e9ce96 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -457,8 +457,9 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
/* Monitor if RSSI is too strong. */
pBSSList->byRSSIStatCnt = 0;
- RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI),
- &pBSSList->ldBmMAX);
+
+ vnt_rf_rssi_to_dbm(pDevice, (u8)pRxPacket->uRSSI, &pBSSList->ldBmMAX);
+
pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
@@ -578,7 +579,7 @@ int BSSbUpdateToBSSList(struct vnt_private *pDevice,
}
if (pRxPacket->uRSSI != 0) {
- RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)pRxPacket->uRSSI, &ldBm);
/* Monitor if RSSI is too strong. */
pBSSList->byRSSIStatCnt++;
pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT;
@@ -1417,7 +1418,7 @@ static void s_uCalculateLinkQual(struct vnt_private *pDevice)
if (pDevice->bLinkPass != true) {
pDevice->wstats.qual.qual = 0;
} else {
- RFvRSSITodBm(pDevice, (u8) (pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8) (pDevice->uCurrRSSI), &ldBm);
if (-ldBm < 50)
RssiRatio = 4000;
else if (-ldBm > 90)
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 94b7fe8..c43718d 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -57,7 +57,7 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
long ldBm;
pDevice->wstats.status = pDevice->op_mode;
- RFvRSSITodBm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
pDevice->wstats.qual.level = ldBm;
pDevice->wstats.qual.noise = 0;
pDevice->wstats.qual.updated = 1;
@@ -235,7 +235,7 @@ int iwctl_giwscan(struct net_device *dev, struct iw_request_info *info,
// ADD quality
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
- RFvRSSITodBm(pDevice, (u8)(pBSS->uRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pBSS->uRSSI), &ldBm);
iwe.u.qual.level = ldBm;
iwe.u.qual.noise = 0;
@@ -1399,7 +1399,7 @@ int iwctl_giwsens(struct net_device *dev, struct iw_request_info *info,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS\n");
if (pDevice->bLinkPass == true) {
- RFvRSSITodBm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
wrq->value = ldBm;
} else {
wrq->value = 0;
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index fd69960..4e1a28d 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -969,7 +969,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
* Return Value: none
*
-*/
-void RFvRSSITodBm(struct vnt_private *priv, u8 rssi, long *dbm)
+void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm)
{
u8 idx = (((rssi & 0xc0) >> 6) & 0x03);
long b = (rssi & 0x3f);
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 2040d50..bc0e923 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -60,7 +60,7 @@ extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
-void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
+void vnt_rf_rssi_to_dbm(struct vnt_private *, u8, long *);
void RFbRFTableDownload(struct vnt_private *pDevice);
#endif /* __RF_H__ */
--
1.9.1
Removing camel case
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
drivers/staging/vt6656/rxtx.c | 4 ++--
drivers/staging/vt6656/wcmd.c | 3 ++-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index b30a373..c1e0a79 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -734,7 +734,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data)
* Return Value: true if succeeded; false if failed.
*
*/
-int RFbSetPower(struct vnt_private *priv, u32 rate, u32 channel)
+int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
{
int ret = true;
u8 power = priv->byCCKPwr;
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 70d5b82..e47b67d 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -58,7 +58,7 @@
extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
-int RFbSetPower(struct vnt_private *, u32 uRATE, u32 uCH);
+int vnt_rf_setpower(struct vnt_private *, u32, u32);
int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
void RFbRFTableDownload(struct vnt_private *pDevice);
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index f11c2d3..704f4d3 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -1386,9 +1386,9 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
}
if (pMgmt->eScanState != WMAC_NO_SCANNING)
- RFbSetPower(pDevice, wCurrentRate, pDevice->byCurrentCh);
+ vnt_rf_setpower(pDevice, wCurrentRate, pDevice->byCurrentCh);
else
- RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
+ vnt_rf_setpower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
pDevice->wCurrentRate = wCurrentRate;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 9a166fb..da72d4d 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -835,7 +835,8 @@ void vRunCommand(struct work_struct *work)
case WLAN_CMD_SETPOWER_START:
- RFbSetPower(pDevice, pDevice->wCurrentRate, pMgmt->uCurrChannel);
+ vnt_rf_setpower(pDevice, pDevice->wCurrentRate,
+ pMgmt->uCurrChannel);
break;
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 3 +--
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index d96308f..694e34a 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1040,8 +1040,7 @@ int BBbVT3184Init(struct vnt_private *priv)
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f);
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
- RFbRFTableDownload(priv);
-
+ vnt_rf_table_download(priv);
/* Fix for TX USB resets from vendors driver */
vnt_control_in(priv, MESSAGE_TYPE_READ, USB_REG4,
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 4e1a28d..4420114 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -992,7 +992,7 @@ void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm)
*dbm = -1 * (a + b * 2);
}
-void RFbRFTableDownload(struct vnt_private *priv)
+void vnt_rf_table_download(struct vnt_private *priv)
{
u16 length1 = 0, length2 = 0, length3 = 0;
u8 *addr1 = NULL, *addr2 = NULL, *addr3 = NULL;
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index bc0e923..cb33151 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -61,6 +61,6 @@ int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
void vnt_rf_rssi_to_dbm(struct vnt_private *, u8, long *);
-void RFbRFTableDownload(struct vnt_private *pDevice);
+void vnt_rf_table_download(struct vnt_private *);
#endif /* __RF_H__ */
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 48 ++++++++++++++++++++++-----------------------
drivers/staging/vt6656/rf.h | 2 +-
2 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index a8e50f7..b30a373 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -26,7 +26,7 @@
* Date: Feb. 19, 2004
*
* Functions:
- * IFRFbWriteEmbedded - Embedded write RF register via MAC
+ * vnt_rf_write_embedded - Embedded write RF register via MAC
*
* Revision History:
* RF_VT3226: RobertYu:20051111, VT3226C0 and before
@@ -706,7 +706,7 @@ const u8 RFaby11aChannelIndex[200] = {
* Return Value: true if succeeded; false if failed.
*
*/
-int IFRFbWriteEmbedded(struct vnt_private *priv, u32 data)
+int vnt_rf_write_embedded(struct vnt_private *priv, u32 data)
{
u8 reg_data[4];
@@ -827,42 +827,42 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
return false;
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
al2230_power_table[priv->byCurPwr]);
if (rate <= RATE_11M)
- ret &= IFRFbWriteEmbedded(priv, 0x0001b400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0001b400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
else
- ret &= IFRFbWriteEmbedded(priv, 0x0005a400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0005a400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
break;
case RF_AL2230S:
if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
return false;
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
al2230_power_table[priv->byCurPwr]);
if (rate <= RATE_11M) {
- ret &= IFRFbWriteEmbedded(priv, 0x040c1400 +
+ ret &= vnt_rf_write_embedded(priv, 0x040c1400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00299b00 +
+ ret &= vnt_rf_write_embedded(priv, 0x00299b00 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
} else {
- ret &= IFRFbWriteEmbedded(priv, 0x0005a400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0005a400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00099b00 +
+ ret &= vnt_rf_write_embedded(priv, 0x00099b00 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
}
break;
case RF_AIROHA7230:
if (rate <= RATE_11M)
- ret &= IFRFbWriteEmbedded(priv, 0x111bb900 +
+ ret &= vnt_rf_write_embedded(priv, 0x111bb900 +
(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
else
- ret &= IFRFbWriteEmbedded(priv, 0x221bb900 +
+ ret &= vnt_rf_write_embedded(priv, 0x221bb900 +
(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
if (priv->byCurPwr > AL7230_PWR_IDX_LEN)
@@ -875,7 +875,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
power_setting = 0x080c0b00 | ((priv->byCurPwr) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
@@ -885,7 +885,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
power_setting = ((0x3f - priv->byCurPwr) << 20) | (0x17 << 8) |
(BY_VT3226_REG_LEN << 3) | IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
case RF_VT3226D0:
@@ -897,27 +897,27 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0xe07 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
- ret &= IFRFbWriteEmbedded(priv, 0x03c6a200 +
+ ret &= vnt_rf_write_embedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, 0x03c6a200 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
if (priv->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uScanChannel);
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uScanChannel - 1]);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uCurrChannel);
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uCurrChannel - 1]);
}
- ret &= IFRFbWriteEmbedded(priv, 0x015C0800 +
+ ret &= vnt_rf_write_embedded(priv, 0x015C0800 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
@@ -927,12 +927,12 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
- ret &= IFRFbWriteEmbedded(priv, 0x00C6A200 +
+ ret &= vnt_rf_write_embedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, 0x00C6A200 +
(BY_VT3226_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x016BC600 +
+ ret &= vnt_rf_write_embedded(priv, 0x016BC600 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00900800 +
+ ret &= vnt_rf_write_embedded(priv, 0x00900800 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
}
break;
@@ -945,7 +945,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0x27 << 8) | (BY_VT3342_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
default:
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index e9a01fe..70d5b82 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -57,7 +57,7 @@
extern const u8 RFaby11aChannelIndex[200];
-int IFRFbWriteEmbedded(struct vnt_private *, u32 dwData);
+int vnt_rf_write_embedded(struct vnt_private *, u32);
int RFbSetPower(struct vnt_private *, u32 uRATE, u32 uCH);
int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
--
1.9.1
Replace magic number with ARRAY_SIZE of pbyData
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index d244dab..9126156 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -716,7 +716,7 @@ int IFRFbWriteEmbedded(struct vnt_private *pDevice, u32 dwData)
pbyData[3] = (u8)(dwData >> 24);
vnt_control_out(pDevice,
- MESSAGE_TYPE_WRITE_IFRF, 0, 0, 4, pbyData);
+ MESSAGE_TYPE_WRITE_IFRF, 0, 0, ARRAY_SIZE(pbyData), pbyData);
return true;
}
--
1.9.1
replace with dev_dbg
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/rf.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index d509839..3f54ae3 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -41,8 +41,6 @@
#include "usbpipe.h"
#include "datarate.h"
-static int msglevel =MSG_LEVEL_INFO;
-//static int msglevel =MSG_LEVEL_DEBUG;
#define BY_AL2230_REG_LEN 23 //24bit
#define CB_AL2230_INIT_SEQ 15
#define AL2230_PWR_IDX_LEN 64
@@ -902,14 +900,14 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
if (priv->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ dev_dbg(&priv->usb->dev,
"vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uScanChannel);
ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uScanChannel - 1]);
} else {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ dev_dbg(&priv->usb->dev,
"vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uCurrChannel);
ret &= vnt_rf_write_embedded(priv,
@@ -920,7 +918,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
ret &= vnt_rf_write_embedded(priv, 0x015C0800 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
} else {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ dev_dbg(&priv->usb->dev,
"@@@@ vnt_rf_set_txpower> 11G mode\n");
power_setting = ((0x3f-priv->byCurPwr) << 20) |
--
1.9.1