Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 040b232..e56defa 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -123,7 +123,7 @@ static u8 vnt_vt3184_vt3226d0[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xff */
};
-static const u16 awcFrameTime[MAX_RATE] = {
+static const u16 vnt_frame_time[MAX_RATE] = {
10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216
};
@@ -152,7 +152,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
if (tx_rate > RATE_54M)
return 0;
- rate = (unsigned int)awcFrameTime[tx_rate];
+ rate = (unsigned int)vnt_frame_time[tx_rate];
if (tx_rate <= 3) {
if (preamble_type == 1)
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 4 ++--
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/main_usb.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 6586614..44068d0 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -29,7 +29,7 @@
* vnt_get_frame_time - Calculate data frame transmitting time
* vnt_get_phy_field - Calculate PhyLength, PhyService and Phy
* Signal parameter for baseband Tx
- * BBbVT3184Init - VIA VT3184 baseband chip init code
+ * vnt_vt3184_init - VIA VT3184 baseband chip init code
*
* Revision History:
*
@@ -378,7 +378,7 @@ void vnt_set_antenna_mode(struct vnt_private *priv, u8 antenna_mode)
*
*/
-int BBbVT3184Init(struct vnt_private *priv)
+int vnt_vt3184_init(struct vnt_private *priv)
{
int status;
u16 length;
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index a612690..f102ec0 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -96,7 +96,7 @@ void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
void BBvSetShortSlotTime(struct vnt_private *);
void BBvSetVGAGainOffset(struct vnt_private *, u8 byData);
void vnt_set_antenna_mode(struct vnt_private *, u8);
-int BBbVT3184Init(struct vnt_private *);
+int vnt_vt3184_init(struct vnt_private *);
void BBvSetDeepSleep(struct vnt_private *);
void BBvExitDeepSleep(struct vnt_private *);
void BBvUpdatePreEDThreshold(struct vnt_private *, int scanning);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 7cd4c2b..caafb93 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -247,8 +247,8 @@ static int device_init_registers(struct vnt_private *pDevice)
}
}
- if (!BBbVT3184Init(pDevice)) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail\n");
+ if (!vnt_vt3184_init(pDevice)) {
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" vnt_vt3184_init fail\n");
return false;
}
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/main_usb.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 44068d0..3138826 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -526,7 +526,7 @@ int vnt_vt3184_init(struct vnt_private *priv)
* Return Value: none
*
*/
-void BBvSetShortSlotTime(struct vnt_private *priv)
+void vnt_set_short_slot_time(struct vnt_private *priv)
{
u8 bb_vga = 0;
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index f102ec0..1a36e13 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -93,7 +93,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
-void BBvSetShortSlotTime(struct vnt_private *);
+void vnt_set_short_slot_time(struct vnt_private *);
void BBvSetVGAGainOffset(struct vnt_private *, u8 byData);
void vnt_set_antenna_mode(struct vnt_private *, u8);
int vnt_vt3184_init(struct vnt_private *);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index caafb93..a418d1d 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -441,7 +441,7 @@ static int device_init_registers(struct vnt_private *pDevice)
else
pDevice->bShortSlotTime = false;
- BBvSetShortSlotTime(pDevice);
+ vnt_set_short_slot_time(pDevice);
pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
pDevice->bHWRadioOff = false;
@@ -880,7 +880,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
else
priv->bShortSlotTime = false;
- BBvSetShortSlotTime(priv);
+ vnt_set_short_slot_time(priv);
BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
BBvUpdatePreEDThreshold(priv, false);
}
--
2.0.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index e822572..40594a1 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -203,8 +203,8 @@ static bool device_alloc_bufs(struct vnt_private *pDevice);
static void usb_device_reset(struct vnt_private *pDevice);
-static void
-device_set_options(struct vnt_private *pDevice) {
+static void device_set_options(struct vnt_private *pDevice)
+{
pDevice->cbTD = TX_DESC_DEF0;
pDevice->cbRD = RX_DESC_DEF0;
pDevice->byShortRetryLimit = SHORT_RETRY_DEF;
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/wcmd.c | 8 ++++----
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index e56defa..6586614 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -345,7 +345,7 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
* Return Value: none
*
*/
-void BBvSetAntennaMode(struct vnt_private *priv, u8 antenna_mode)
+void vnt_set_antenna_mode(struct vnt_private *priv, u8 antenna_mode)
{
switch (antenna_mode) {
case ANT_TXA:
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index c73244b..a612690 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -95,7 +95,7 @@ void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
void BBvSetShortSlotTime(struct vnt_private *);
void BBvSetVGAGainOffset(struct vnt_private *, u8 byData);
-void BBvSetAntennaMode(struct vnt_private *, u8 byAntennaMode);
+void vnt_set_antenna_mode(struct vnt_private *, u8);
int BBbVT3184Init(struct vnt_private *);
void BBvSetDeepSleep(struct vnt_private *);
void BBvExitDeepSleep(struct vnt_private *);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index c595a15..7cd4c2b 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -371,7 +371,7 @@ static int device_init_registers(struct vnt_private *pDevice)
}
/* Set initial antenna mode */
- BBvSetAntennaMode(pDevice, pDevice->byRxAntennaMode);
+ vnt_set_antenna_mode(pDevice, pDevice->byRxAntennaMode);
/* get Auto Fall Back type */
pDevice->byAutoFBCtrl = AUTO_FB_0;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index bf41e67..c56b7b3 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -151,15 +151,15 @@ void vnt_run_command(struct work_struct *work)
if (priv->dwRxAntennaSel == 0) {
priv->dwRxAntennaSel = 1;
if (priv->bTxRxAntInv == true)
- BBvSetAntennaMode(priv, ANT_RXA);
+ vnt_set_antenna_mode(priv, ANT_RXA);
else
- BBvSetAntennaMode(priv, ANT_RXB);
+ vnt_set_antenna_mode(priv, ANT_RXB);
} else {
priv->dwRxAntennaSel = 0;
if (priv->bTxRxAntInv == true)
- BBvSetAntennaMode(priv, ANT_RXB);
+ vnt_set_antenna_mode(priv, ANT_RXB);
else
- BBvSetAntennaMode(priv, ANT_RXA);
+ vnt_set_antenna_mode(priv, ANT_RXA);
}
break;
--
2.0.1
replace with dev_dbg
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 12f93c7..021e892 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -230,25 +230,24 @@ static int device_init_registers(struct vnt_private *priv)
u8 tmp;
u8 calib_tx_iq = 0, calib_tx_dc = 0, calib_rx_iq = 0;
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "---->INIbInitAdapter. [%d][%d]\n",
+ dev_dbg(&priv->usb->dev, "---->INIbInitAdapter. [%d][%d]\n",
DEVICE_INIT_COLD, priv->byPacketType);
if (!vnt_check_firmware_version(priv)) {
if (vnt_download_firmware(priv) == true) {
if (vnt_firmware_branch_to_sram(priv) == false) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ dev_dbg(&priv->usb->dev,
" vnt_firmware_branch_to_sram fail\n");
return false;
}
} else {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- " FIRMWAREbDownload fail\n");
+ dev_dbg(&priv->usb->dev, "FIRMWAREbDownload fail\n");
return false;
}
}
if (!vnt_vt3184_init(priv)) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" vnt_vt3184_init fail\n");
+ dev_dbg(&priv->usb->dev, "vnt_vt3184_init fail\n");
return false;
}
@@ -264,14 +263,14 @@ static int device_init_registers(struct vnt_private *priv)
MESSAGE_TYPE_CARDINIT, 0, 0,
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
if (status != STATUS_SUCCESS) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n");
+ dev_dbg(&priv->usb->dev, "Issue Card init fail\n");
return false;
}
status = vnt_control_in(priv, MESSAGE_TYPE_INIT_RSP, 0, 0,
sizeof(struct vnt_rsp_card_init), (u8 *)init_rsp);
if (status != STATUS_SUCCESS) {
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
+ dev_dbg(&priv->usb->dev,
"Cardinit request in status fail!\n");
return false;
}
@@ -429,7 +428,7 @@ static int device_init_registers(struct vnt_private *priv)
priv->abyPermanentNetAddr, ETH_ALEN);
/* if exist SW network address, use it */
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n",
+ dev_dbg(&priv->usb->dev, "Network address = %pM\n",
priv->abyCurrentNetAddr);
/*
@@ -478,7 +477,7 @@ static int device_init_registers(struct vnt_private *priv)
vnt_radio_power_on(priv);
}
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n");
+ dev_dbg(&priv->usb->dev, "<----INIbInitAdapter Exit\n");
return true;
}
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/card.c | 2 +-
drivers/staging/vt6656/main_usb.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 3138826..184f416 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -543,7 +543,7 @@ void vnt_set_short_slot_time(struct vnt_private *priv)
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
}
-void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
+void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data)
{
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index 1a36e13..a3aff07 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -94,7 +94,7 @@ void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
void vnt_set_short_slot_time(struct vnt_private *);
-void BBvSetVGAGainOffset(struct vnt_private *, u8 byData);
+void vnt_set_vga_gain_offset(struct vnt_private *, u8);
void vnt_set_antenna_mode(struct vnt_private *, u8);
int vnt_vt3184_init(struct vnt_private *);
void BBvSetDeepSleep(struct vnt_private *);
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 37cd96b..1cbdfee 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -836,5 +836,5 @@ void vnt_set_bss_mode(struct vnt_private *priv)
priv->abyBBVGA[3] = 0x0;
}
- BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
+ vnt_set_vga_gain_offset(priv, priv->abyBBVGA[0]);
}
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index a418d1d..695c541 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -881,7 +881,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
priv->bShortSlotTime = false;
vnt_set_short_slot_time(priv);
- BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
+ vnt_set_vga_gain_offset(priv, priv->abyBBVGA[0]);
BBvUpdatePreEDThreshold(priv, false);
}
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/main_usb.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 39e2629..91c24a3 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -581,7 +581,7 @@ void vnt_exit_deep_sleep(struct vnt_private *priv)
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
}
-void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
+void vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning)
{
u8 cr_201 = 0x0, cr_206 = 0x0;
u8 ed_inx = priv->byBBPreEDIndex;
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index aee51a1..771ea40 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -99,6 +99,6 @@ void vnt_set_antenna_mode(struct vnt_private *, u8);
int vnt_vt3184_init(struct vnt_private *);
void vnt_set_deep_sleep(struct vnt_private *);
void vnt_exit_deep_sleep(struct vnt_private *);
-void BBvUpdatePreEDThreshold(struct vnt_private *, int scanning);
+void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
#endif /* __BASEBAND_H__ */
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 695c541..e822572 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -882,7 +882,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
vnt_set_short_slot_time(priv);
vnt_set_vga_gain_offset(priv, priv->abyBBVGA[0]);
- BBvUpdatePreEDThreshold(priv, false);
+ vnt_update_pre_ed_threshold(priv, false);
}
if (changed & BSS_CHANGED_TXPOWER)
@@ -1003,7 +1003,7 @@ static void vnt_sw_scan_start(struct ieee80211_hw *hw)
vnt_set_bss_mode(priv);
/* Set max sensitivity*/
- BBvUpdatePreEDThreshold(priv, true);
+ vnt_update_pre_ed_threshold(priv, true);
}
static void vnt_sw_scan_complete(struct ieee80211_hw *hw)
@@ -1011,7 +1011,7 @@ static void vnt_sw_scan_complete(struct ieee80211_hw *hw)
struct vnt_private *priv = hw->priv;
/* Return sensitivity to channel level*/
- BBvUpdatePreEDThreshold(priv, false);
+ vnt_update_pre_ed_threshold(priv, false);
}
static int vnt_get_stats(struct ieee80211_hw *hw,
--
2.0.1
These frequencies are already defined in new tables channel.c
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 932382f..6a46203 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -104,17 +104,6 @@ static struct usb_device_id vt6656_table[] = {
{}
};
-/* frequency list (map channels to frequencies) */
-/*
-static const long frequency_list[] = {
- 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467,
- 2472, 2484, 4915, 4920, 4925, 4935, 4940, 4945, 4960, 4980, 5035, 5040,
- 5045, 5055, 5060, 5080, 5170, 5180, 5190, 5200, 5210, 5220, 5230, 5240,
- 5260, 5280, 5300, 5320, 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640,
- 5660, 5680, 5700, 5745, 5765, 5785, 5805, 5825
-};
-*/
-
static void device_set_options(struct vnt_private *priv)
{
/* Set number of TX buffers */
--
2.0.1
All these macros relate to module parameters already removed
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 49 ---------------------------------------
1 file changed, 49 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 0e65795..4bcdf8e 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -82,51 +82,9 @@ static int vnt_tx_buffers = TX_DESC_DEF0;
module_param_named(tx_buffers, vnt_rx_buffers, int, 0644);
MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
-
-#define CHANNEL_DEF 6
-
-/* PreambleType[] is the preamble length used for transmit.
- 0: indicate allows long preamble type
- 1: indicate allows short preamble type
-*/
-
-#define PREAMBLE_TYPE_DEF 1
#define RTS_THRESH_DEF 2347
#define FRAG_THRESH_DEF 2346
-#define DATA_RATE_DEF 13
-/* datarate[] index
- 0: indicate 1 Mbps 0x02
- 1: indicate 2 Mbps 0x04
- 2: indicate 5.5 Mbps 0x0B
- 3: indicate 11 Mbps 0x16
- 4: indicate 6 Mbps 0x0c
- 5: indicate 9 Mbps 0x12
- 6: indicate 12 Mbps 0x18
- 7: indicate 18 Mbps 0x24
- 8: indicate 24 Mbps 0x30
- 9: indicate 36 Mbps 0x48
- 10: indicate 48 Mbps 0x60
- 11: indicate 54 Mbps 0x6c
- 12: indicate 72 Mbps 0x90
- 13: indicate auto rate
-*/
-#define OP_MODE_DEF 0
-
-/* OpMode[] is used for transmit.
- 0: indicate infrastruct mode used
- 1: indicate adhoc mode used
- 2: indicate AP mode used
-*/
-
-/* PSMode[]
- 0: indicate disable power saving mode
- 1: indicate enable power saving mode
-*/
-
-#define PS_MODE_DEF 0
-
#define SHORT_RETRY_DEF 8
-
#define LONG_RETRY_DEF 4
/* BasebandType[] baseband type selected
@@ -137,13 +95,6 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
#define BBP_TYPE_DEF 2
-/* 80211hEnable[]
- 0: indicate disable 802.11h
- 1: indicate enable 802.11h
-*/
-
-#define X80211h_MODE_DEF 0
-
/*
* Static vars definitions
*/
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 4 ++--
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/card.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 184f416..2a6c6ea 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -558,7 +558,7 @@ void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data)
}
/*
- * Description: BBvSetDeepSleep
+ * Description: vnt_set_deep_sleep
*
* Parameters:
* In:
@@ -569,7 +569,7 @@ void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data)
* Return Value: none
*
*/
-void BBvSetDeepSleep(struct vnt_private *priv)
+void vnt_set_deep_sleep(struct vnt_private *priv)
{
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index a3aff07..f246700 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -97,7 +97,7 @@ void vnt_set_short_slot_time(struct vnt_private *);
void vnt_set_vga_gain_offset(struct vnt_private *, u8);
void vnt_set_antenna_mode(struct vnt_private *, u8);
int vnt_vt3184_init(struct vnt_private *);
-void BBvSetDeepSleep(struct vnt_private *);
+void vnt_set_deep_sleep(struct vnt_private *);
void BBvExitDeepSleep(struct vnt_private *);
void BBvUpdatePreEDThreshold(struct vnt_private *, int scanning);
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 1cbdfee..fd6f6e2 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -750,7 +750,7 @@ int vnt_radio_power_off(struct vnt_private *priv)
vnt_mac_reg_bits_off(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
- BBvSetDeepSleep(priv);
+ vnt_set_deep_sleep(priv);
return ret;
}
--
2.0.1
All dead code and nolonger used by driver.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index dbd5810..f08f7de 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -185,16 +185,6 @@
/* USB registers */
#define USB_REG4 0x604
-#define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
-
-enum {
- MSG_LEVEL_ERR = 0, /* Errors causing abnormal operation */
- MSG_LEVEL_NOTICE = 1, /* Errors needing user notification */
- MSG_LEVEL_INFO = 2, /* Normal message. */
- MSG_LEVEL_VERBOSE = 3, /* Will report all trival errors. */
- MSG_LEVEL_DEBUG = 4 /* Only for debug purpose. */
-};
-
#define DEVICE_INIT_COLD 0x0 /* cold init */
#define DEVICE_INIT_RESET 0x1 /* reset init or Dx to D0 power remain */
#define DEVICE_INIT_DXPL 0x2 /* Dx to D0 power lost init */
--
2.0.1
Dropping BB
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/baseband.h | 2 +-
drivers/staging/vt6656/card.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 2a6c6ea..39e2629 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -575,7 +575,7 @@ void vnt_set_deep_sleep(struct vnt_private *priv)
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
}
-void BBvExitDeepSleep(struct vnt_private *priv)
+void vnt_exit_deep_sleep(struct vnt_private *priv)
{
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */
vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h
index f246700..aee51a1 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -98,7 +98,7 @@ void vnt_set_vga_gain_offset(struct vnt_private *, u8);
void vnt_set_antenna_mode(struct vnt_private *, u8);
int vnt_vt3184_init(struct vnt_private *);
void vnt_set_deep_sleep(struct vnt_private *);
-void BBvExitDeepSleep(struct vnt_private *);
+void vnt_exit_deep_sleep(struct vnt_private *);
void BBvUpdatePreEDThreshold(struct vnt_private *, int scanning);
#endif /* __BASEBAND_H__ */
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index fd6f6e2..34ca2a6 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -776,7 +776,7 @@ int vnt_radio_power_on(struct vnt_private *priv)
priv->bRadioOff = false;
- BBvExitDeepSleep(priv);
+ vnt_exit_deep_sleep(priv);
vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
--
2.0.1
replace with dev_err
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 021e892..ed56b60 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -61,9 +61,6 @@
#include "channel.h"
#include "int.h"
-/* static int msglevel = MSG_LEVEL_DEBUG; */
-static int msglevel = MSG_LEVEL_INFO;
-
/*
* define module options
*/
@@ -567,8 +564,7 @@ static bool device_alloc_bufs(struct vnt_private *priv)
/* allocate URBs */
tx_context->urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!tx_context->urb) {
- DBG_PRT(MSG_LEVEL_ERR,
- KERN_ERR "alloc tx urb failed\n");
+ dev_err(&priv->usb->dev, "alloc tx urb failed\n");
goto free_tx;
}
@@ -590,15 +586,13 @@ static bool device_alloc_bufs(struct vnt_private *priv)
/* allocate URBs */
rcb->pUrb = usb_alloc_urb(0, GFP_ATOMIC);
if (rcb->pUrb == NULL) {
- DBG_PRT(MSG_LEVEL_ERR, KERN_ERR
- " Failed to alloc rx urb\n");
+ dev_err(&priv->usb->dev, "Failed to alloc rx urb\n");
goto free_rx_tx;
}
rcb->skb = dev_alloc_skb(priv->rx_buf_sz);
if (rcb->skb == NULL) {
- DBG_PRT(MSG_LEVEL_ERR, KERN_ERR
- " Failed to alloc rx skb\n");
+ dev_err(&priv->usb->dev, "Failed to alloc rx skb\n");
goto free_rx_tx;
}
@@ -611,13 +605,13 @@ static bool device_alloc_bufs(struct vnt_private *priv)
priv->pInterruptURB = usb_alloc_urb(0, GFP_ATOMIC);
if (priv->pInterruptURB == NULL) {
- DBG_PRT(MSG_LEVEL_ERR, KERN_ERR"Failed to alloc int urb\n");
+ dev_err(&priv->usb->dev, "Failed to alloc int urb\n");
goto free_rx_tx;
}
priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL);
if (priv->int_buf.data_buf == NULL) {
- DBG_PRT(MSG_LEVEL_ERR, KERN_ERR"Failed to alloc int buf\n");
+ dev_err(&priv->usb->dev, "Failed to alloc int buf\n");
usb_free_urb(priv->pInterruptURB);
goto free_rx_tx;
}
--
2.0.1
camel case changes
pDevice -> priv
byAntenna -> antenna
ntStatus -> status
byTmp-> tmp
byCalibTXIQ -> calib_tx_iq
byCalibTXDC -> calib_tx_dc
byCalibRXIQ -> calib_rx_iq
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 234 +++++++++++++++++++-------------------
1 file changed, 117 insertions(+), 117 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 37541f0..12f93c7 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -220,22 +220,22 @@ static void device_set_options(struct vnt_private *priv)
/*
* initialization of MAC & BBP registers
*/
-static int device_init_registers(struct vnt_private *pDevice)
+static int device_init_registers(struct vnt_private *priv)
{
- struct vnt_cmd_card_init *init_cmd = &pDevice->init_command;
- struct vnt_rsp_card_init *init_rsp = &pDevice->init_response;
- u8 byAntenna;
+ struct vnt_cmd_card_init *init_cmd = &priv->init_command;
+ struct vnt_rsp_card_init *init_rsp = &priv->init_response;
+ u8 antenna;
int ii;
- int ntStatus = STATUS_SUCCESS;
- u8 byTmp;
- u8 byCalibTXIQ = 0, byCalibTXDC = 0, byCalibRXIQ = 0;
+ int status = STATUS_SUCCESS;
+ u8 tmp;
+ u8 calib_tx_iq = 0, calib_tx_dc = 0, calib_rx_iq = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "---->INIbInitAdapter. [%d][%d]\n",
- DEVICE_INIT_COLD, pDevice->byPacketType);
+ DEVICE_INIT_COLD, priv->byPacketType);
- if (!vnt_check_firmware_version(pDevice)) {
- if (vnt_download_firmware(pDevice) == true) {
- if (vnt_firmware_branch_to_sram(pDevice) == false) {
+ if (!vnt_check_firmware_version(priv)) {
+ if (vnt_download_firmware(priv) == true) {
+ if (vnt_firmware_branch_to_sram(priv) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" vnt_firmware_branch_to_sram fail\n");
return false;
@@ -247,63 +247,63 @@ static int device_init_registers(struct vnt_private *pDevice)
}
}
- if (!vnt_vt3184_init(pDevice)) {
+ if (!vnt_vt3184_init(priv)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" vnt_vt3184_init fail\n");
return false;
}
init_cmd->init_class = DEVICE_INIT_COLD;
- init_cmd->exist_sw_net_addr = (u8) pDevice->bExistSWNetAddr;
+ init_cmd->exist_sw_net_addr = (u8) priv->bExistSWNetAddr;
for (ii = 0; ii < 6; ii++)
- init_cmd->sw_net_addr[ii] = pDevice->abyCurrentNetAddr[ii];
- init_cmd->short_retry_limit = pDevice->byShortRetryLimit;
- init_cmd->long_retry_limit = pDevice->byLongRetryLimit;
+ init_cmd->sw_net_addr[ii] = priv->abyCurrentNetAddr[ii];
+ init_cmd->short_retry_limit = priv->byShortRetryLimit;
+ init_cmd->long_retry_limit = priv->byLongRetryLimit;
/* issue card_init command to device */
- ntStatus = vnt_control_out(pDevice,
+ status = vnt_control_out(priv,
MESSAGE_TYPE_CARDINIT, 0, 0,
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
- if (ntStatus != STATUS_SUCCESS) {
+ if (status != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n");
return false;
}
- ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_INIT_RSP, 0, 0,
+ status = vnt_control_in(priv, MESSAGE_TYPE_INIT_RSP, 0, 0,
sizeof(struct vnt_rsp_card_init), (u8 *)init_rsp);
- if (ntStatus != STATUS_SUCCESS) {
+ if (status != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Cardinit request in status fail!\n");
return false;
}
/* local ID for AES functions */
- ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_READ,
+ status = vnt_control_in(priv, MESSAGE_TYPE_READ,
MAC_REG_LOCALID, MESSAGE_REQUEST_MACREG, 1,
- &pDevice->byLocalID);
- if (ntStatus != STATUS_SUCCESS)
+ &priv->byLocalID);
+ if (status != STATUS_SUCCESS)
return false;
/* do MACbSoftwareReset in MACvInitialize */
- pDevice->byTopOFDMBasicRate = RATE_24M;
- pDevice->byTopCCKBasicRate = RATE_1M;
+ priv->byTopOFDMBasicRate = RATE_24M;
+ priv->byTopCCKBasicRate = RATE_1M;
/* target to IF pin while programming to RF chip */
- pDevice->byCurPwr = 0xFF;
+ priv->byCurPwr = 0xFF;
- pDevice->byCCKPwr = pDevice->abyEEPROM[EEP_OFS_PWR_CCK];
- pDevice->byOFDMPwrG = pDevice->abyEEPROM[EEP_OFS_PWR_OFDMG];
+ priv->byCCKPwr = priv->abyEEPROM[EEP_OFS_PWR_CCK];
+ priv->byOFDMPwrG = priv->abyEEPROM[EEP_OFS_PWR_OFDMG];
/* load power table */
for (ii = 0; ii < 14; ii++) {
- pDevice->abyCCKPwrTbl[ii] =
- pDevice->abyEEPROM[ii + EEP_OFS_CCK_PWR_TBL];
-
- if (pDevice->abyCCKPwrTbl[ii] == 0)
- pDevice->abyCCKPwrTbl[ii] = pDevice->byCCKPwr;
- pDevice->abyOFDMPwrTbl[ii] =
- pDevice->abyEEPROM[ii + EEP_OFS_OFDM_PWR_TBL];
- if (pDevice->abyOFDMPwrTbl[ii] == 0)
- pDevice->abyOFDMPwrTbl[ii] = pDevice->byOFDMPwrG;
+ priv->abyCCKPwrTbl[ii] =
+ priv->abyEEPROM[ii + EEP_OFS_CCK_PWR_TBL];
+
+ if (priv->abyCCKPwrTbl[ii] == 0)
+ priv->abyCCKPwrTbl[ii] = priv->byCCKPwr;
+ priv->abyOFDMPwrTbl[ii] =
+ priv->abyEEPROM[ii + EEP_OFS_OFDM_PWR_TBL];
+ if (priv->abyOFDMPwrTbl[ii] == 0)
+ priv->abyOFDMPwrTbl[ii] = priv->byOFDMPwrG;
}
/*
@@ -311,111 +311,111 @@ static int device_init_registers(struct vnt_private *pDevice)
* then need to recover 12, 13, 14 channels with 11 channel
*/
for (ii = 11; ii < 14; ii++) {
- pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
- pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
+ priv->abyCCKPwrTbl[ii] = priv->abyCCKPwrTbl[10];
+ priv->abyOFDMPwrTbl[ii] = priv->abyOFDMPwrTbl[10];
}
- pDevice->byOFDMPwrA = 0x34; /* same as RFbMA2829SelectChannel */
+ priv->byOFDMPwrA = 0x34; /* same as RFbMA2829SelectChannel */
/* load OFDM A power table */
for (ii = 0; ii < CB_MAX_CHANNEL_5G; ii++) {
- pDevice->abyOFDMAPwrTbl[ii] =
- pDevice->abyEEPROM[ii + EEP_OFS_OFDMA_PWR_TBL];
+ priv->abyOFDMAPwrTbl[ii] =
+ priv->abyEEPROM[ii + EEP_OFS_OFDMA_PWR_TBL];
- if (pDevice->abyOFDMAPwrTbl[ii] == 0)
- pDevice->abyOFDMAPwrTbl[ii] = pDevice->byOFDMPwrA;
+ if (priv->abyOFDMAPwrTbl[ii] == 0)
+ priv->abyOFDMAPwrTbl[ii] = priv->byOFDMPwrA;
}
- byAntenna = pDevice->abyEEPROM[EEP_OFS_ANTENNA];
+ antenna = priv->abyEEPROM[EEP_OFS_ANTENNA];
- if (byAntenna & EEP_ANTINV)
- pDevice->bTxRxAntInv = true;
+ if (antenna & EEP_ANTINV)
+ priv->bTxRxAntInv = true;
else
- pDevice->bTxRxAntInv = false;
+ priv->bTxRxAntInv = false;
- byAntenna &= (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
+ antenna &= (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
- if (byAntenna == 0) /* if not set default is both */
- byAntenna = (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
+ if (antenna == 0) /* if not set default is both */
+ antenna = (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
- if (byAntenna == (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN)) {
- pDevice->byAntennaCount = 2;
- pDevice->byTxAntennaMode = ANT_B;
- pDevice->dwTxAntennaSel = 1;
- pDevice->dwRxAntennaSel = 1;
+ if (antenna == (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN)) {
+ priv->byAntennaCount = 2;
+ priv->byTxAntennaMode = ANT_B;
+ priv->dwTxAntennaSel = 1;
+ priv->dwRxAntennaSel = 1;
- if (pDevice->bTxRxAntInv == true)
- pDevice->byRxAntennaMode = ANT_A;
+ if (priv->bTxRxAntInv == true)
+ priv->byRxAntennaMode = ANT_A;
else
- pDevice->byRxAntennaMode = ANT_B;
+ priv->byRxAntennaMode = ANT_B;
} else {
- pDevice->byAntennaCount = 1;
- pDevice->dwTxAntennaSel = 0;
- pDevice->dwRxAntennaSel = 0;
+ priv->byAntennaCount = 1;
+ priv->dwTxAntennaSel = 0;
+ priv->dwRxAntennaSel = 0;
- if (byAntenna & EEP_ANTENNA_AUX) {
- pDevice->byTxAntennaMode = ANT_A;
+ if (antenna & EEP_ANTENNA_AUX) {
+ priv->byTxAntennaMode = ANT_A;
- if (pDevice->bTxRxAntInv == true)
- pDevice->byRxAntennaMode = ANT_B;
+ if (priv->bTxRxAntInv == true)
+ priv->byRxAntennaMode = ANT_B;
else
- pDevice->byRxAntennaMode = ANT_A;
+ priv->byRxAntennaMode = ANT_A;
} else {
- pDevice->byTxAntennaMode = ANT_B;
+ priv->byTxAntennaMode = ANT_B;
- if (pDevice->bTxRxAntInv == true)
- pDevice->byRxAntennaMode = ANT_A;
+ if (priv->bTxRxAntInv == true)
+ priv->byRxAntennaMode = ANT_A;
else
- pDevice->byRxAntennaMode = ANT_B;
+ priv->byRxAntennaMode = ANT_B;
}
}
/* Set initial antenna mode */
- vnt_set_antenna_mode(pDevice, pDevice->byRxAntennaMode);
+ vnt_set_antenna_mode(priv, priv->byRxAntennaMode);
/* get Auto Fall Back type */
- pDevice->byAutoFBCtrl = AUTO_FB_0;
+ priv->byAutoFBCtrl = AUTO_FB_0;
/* default Auto Mode */
- pDevice->byBBType = BB_TYPE_11G;
+ priv->byBBType = BB_TYPE_11G;
/* get RFType */
- pDevice->byRFType = init_rsp->rf_type;
+ priv->byRFType = init_rsp->rf_type;
/* load vt3266 calibration parameters in EEPROM */
- if (pDevice->byRFType == RF_VT3226D0) {
- if ((pDevice->abyEEPROM[EEP_OFS_MAJOR_VER] == 0x1) &&
- (pDevice->abyEEPROM[EEP_OFS_MINOR_VER] >= 0x4)) {
-
- byCalibTXIQ = pDevice->abyEEPROM[EEP_OFS_CALIB_TX_IQ];
- byCalibTXDC = pDevice->abyEEPROM[EEP_OFS_CALIB_TX_DC];
- byCalibRXIQ = pDevice->abyEEPROM[EEP_OFS_CALIB_RX_IQ];
- if (byCalibTXIQ || byCalibTXDC || byCalibRXIQ) {
+ if (priv->byRFType == RF_VT3226D0) {
+ if ((priv->abyEEPROM[EEP_OFS_MAJOR_VER] == 0x1) &&
+ (priv->abyEEPROM[EEP_OFS_MINOR_VER] >= 0x4)) {
+
+ calib_tx_iq = priv->abyEEPROM[EEP_OFS_CALIB_TX_IQ];
+ calib_tx_dc = priv->abyEEPROM[EEP_OFS_CALIB_TX_DC];
+ calib_rx_iq = priv->abyEEPROM[EEP_OFS_CALIB_RX_IQ];
+ if (calib_tx_iq || calib_tx_dc || calib_rx_iq) {
/* CR255, enable TX/RX IQ and
DC compensation mode */
- vnt_control_out_u8(pDevice,
+ vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xff,
0x03);
/* CR251, TX I/Q Imbalance Calibration */
- vnt_control_out_u8(pDevice,
+ vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xfb,
- byCalibTXIQ);
+ calib_tx_iq);
/* CR252, TX DC-Offset Calibration */
- vnt_control_out_u8(pDevice,
+ vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xfC,
- byCalibTXDC);
+ calib_tx_dc);
/* CR253, RX I/Q Imbalance Calibration */
- vnt_control_out_u8(pDevice,
+ vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xfd,
- byCalibRXIQ);
+ calib_rx_iq);
} else {
/* CR255, turn off
BB Calibration compensation */
- vnt_control_out_u8(pDevice,
+ vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xff,
0x0);
@@ -424,58 +424,58 @@ static int device_init_registers(struct vnt_private *pDevice)
}
/* get permanent network address */
- memcpy(pDevice->abyPermanentNetAddr, init_rsp->net_addr, 6);
- memcpy(pDevice->abyCurrentNetAddr,
- pDevice->abyPermanentNetAddr, ETH_ALEN);
+ memcpy(priv->abyPermanentNetAddr, init_rsp->net_addr, 6);
+ memcpy(priv->abyCurrentNetAddr,
+ priv->abyPermanentNetAddr, ETH_ALEN);
/* if exist SW network address, use it */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n",
- pDevice->abyCurrentNetAddr);
+ priv->abyCurrentNetAddr);
/*
* set BB and packet type at the same time
* set Short Slot Time, xIFS, and RSPINF
*/
- if (pDevice->byBBType == BB_TYPE_11A)
- pDevice->bShortSlotTime = true;
+ if (priv->byBBType == BB_TYPE_11A)
+ priv->bShortSlotTime = true;
else
- pDevice->bShortSlotTime = false;
+ priv->bShortSlotTime = false;
- vnt_set_short_slot_time(pDevice);
+ vnt_set_short_slot_time(priv);
- pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
- pDevice->bHWRadioOff = false;
+ priv->byRadioCtl = priv->abyEEPROM[EEP_OFS_RADIOCTL];
+ priv->bHWRadioOff = false;
- if ((pDevice->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0) {
- ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_READ,
- MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &byTmp);
+ if ((priv->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0) {
+ status = vnt_control_in(priv, MESSAGE_TYPE_READ,
+ MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &tmp);
- if (ntStatus != STATUS_SUCCESS)
+ if (status != STATUS_SUCCESS)
return false;
- if ((byTmp & GPIO3_DATA) == 0) {
- pDevice->bHWRadioOff = true;
- vnt_mac_reg_bits_on(pDevice, MAC_REG_GPIOCTL1,
+ if ((tmp & GPIO3_DATA) == 0) {
+ priv->bHWRadioOff = true;
+ vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1,
GPIO3_INTMD);
} else {
- vnt_mac_reg_bits_off(pDevice, MAC_REG_GPIOCTL1,
+ vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1,
GPIO3_INTMD);
- pDevice->bHWRadioOff = false;
+ priv->bHWRadioOff = false;
}
}
- vnt_mac_set_led(pDevice, LEDSTS_TMLEN, 0x38);
+ vnt_mac_set_led(priv, LEDSTS_TMLEN, 0x38);
- vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
+ vnt_mac_set_led(priv, LEDSTS_STS, LEDSTS_SLOW);
- vnt_mac_reg_bits_on(pDevice, MAC_REG_GPIOCTL0, 0x01);
+ vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL0, 0x01);
- if ((pDevice->bHWRadioOff == true) ||
- (pDevice->bRadioControlOff == true)) {
- vnt_radio_power_off(pDevice);
+ if ((priv->bHWRadioOff == true) ||
+ (priv->bRadioControlOff == true)) {
+ vnt_radio_power_off(priv);
} else {
- vnt_radio_power_on(pDevice);
+ vnt_radio_power_on(priv);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n");
--
2.0.1
All these functions are in visibility order.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 4bcdf8e..932382f 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -115,24 +115,6 @@ static const long frequency_list[] = {
};
*/
-static int vt6656_probe(struct usb_interface *intf,
- const struct usb_device_id *id);
-static void vt6656_disconnect(struct usb_interface *intf);
-
-#ifdef CONFIG_PM /* Minimal support for suspend and resume */
-static int vt6656_suspend(struct usb_interface *intf, pm_message_t message);
-static int vt6656_resume(struct usb_interface *intf);
-#endif /* CONFIG_PM */
-
-static int device_init_registers(struct vnt_private *pDevice);
-
-static void device_free_tx_bufs(struct vnt_private *pDevice);
-static void device_free_rx_bufs(struct vnt_private *pDevice);
-static void device_free_int_bufs(struct vnt_private *pDevice);
-static bool device_alloc_bufs(struct vnt_private *pDevice);
-
-static void usb_device_reset(struct vnt_private *pDevice);
-
static void device_set_options(struct vnt_private *priv)
{
/* Set number of TX buffers */
--
2.0.1
Camel case changes
pDevice -> priv
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 40594a1..37541f0 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -203,18 +203,18 @@ static bool device_alloc_bufs(struct vnt_private *pDevice);
static void usb_device_reset(struct vnt_private *pDevice);
-static void device_set_options(struct vnt_private *pDevice)
+static void device_set_options(struct vnt_private *priv)
{
- pDevice->cbTD = TX_DESC_DEF0;
- pDevice->cbRD = RX_DESC_DEF0;
- pDevice->byShortRetryLimit = SHORT_RETRY_DEF;
- pDevice->byLongRetryLimit = LONG_RETRY_DEF;
- pDevice->op_mode = NL80211_IFTYPE_UNSPECIFIED;
- pDevice->byBBType = BBP_TYPE_DEF;
- pDevice->byPacketType = pDevice->byBBType;
- pDevice->byAutoFBCtrl = AUTO_FB_0;
- pDevice->byPreambleType = 0;
- pDevice->bExistSWNetAddr = false;
+ priv->cbTD = TX_DESC_DEF0;
+ priv->cbRD = RX_DESC_DEF0;
+ priv->byShortRetryLimit = SHORT_RETRY_DEF;
+ priv->byLongRetryLimit = LONG_RETRY_DEF;
+ priv->op_mode = NL80211_IFTYPE_UNSPECIFIED;
+ priv->byBBType = BBP_TYPE_DEF;
+ priv->byPacketType = priv->byBBType;
+ priv->byAutoFBCtrl = AUTO_FB_0;
+ priv->byPreambleType = 0;
+ priv->bExistSWNetAddr = false;
}
/*
--
2.0.1
Replace with vnt_rx_buffers using module_param_named and
MODULE_PARM_DESC
Check user doe not set rx_buffer beyond the define limits of driver
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index ed56b60..6e79c4c 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -78,7 +78,9 @@ MODULE_DESCRIPTION(DEVICE_FULL_DRV_NAM);
MODULE_PARM_DESC(N, D)
#define RX_DESC_DEF0 64
-DEVICE_PARAM(RxDescriptors0, "Number of receive usb desc buffer");
+static int vnt_rx_buffers = RX_DESC_DEF0;
+module_param_named(rx_buffers, vnt_rx_buffers, int, 0644);
+MODULE_PARM_DESC(rx_buffers, "Number of receive usb rx buffers");
#define TX_DESC_DEF0 64
DEVICE_PARAM(TxDescriptors0, "Number of transmit usb desc buffer");
@@ -203,7 +205,13 @@ static void usb_device_reset(struct vnt_private *pDevice);
static void device_set_options(struct vnt_private *priv)
{
priv->cbTD = TX_DESC_DEF0;
- priv->cbRD = RX_DESC_DEF0;
+
+ /* Set number of RX buffers */
+ if (vnt_rx_buffers < CB_MIN_RX_DESC || vnt_rx_buffers > CB_MAX_RX_DESC)
+ priv->cbRD = RX_DESC_DEF0;
+ else
+ priv->cbRD = vnt_rx_buffers;
+
priv->byShortRetryLimit = SHORT_RETRY_DEF;
priv->byLongRetryLimit = LONG_RETRY_DEF;
priv->op_mode = NL80211_IFTYPE_UNSPECIFIED;
--
2.0.1
All these module parameters are dead
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 46f8491..0e65795 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -72,11 +72,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION(DEVICE_FULL_DRV_NAM);
-#define DEVICE_PARAM(N, D) \
- static int N[MAX_UINTS] = OPTION_DEFAULT; \
- module_param_array(N, int, NULL, 0); \
- MODULE_PARM_DESC(N, D)
-
#define RX_DESC_DEF0 64
static int vnt_rx_buffers = RX_DESC_DEF0;
module_param_named(rx_buffers, vnt_rx_buffers, int, 0644);
@@ -89,7 +84,6 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
#define CHANNEL_DEF 6
-DEVICE_PARAM(Channel, "Channel number");
/* PreambleType[] is the preamble length used for transmit.
0: indicate allows long preamble type
@@ -97,15 +91,8 @@ DEVICE_PARAM(Channel, "Channel number");
*/
#define PREAMBLE_TYPE_DEF 1
-
-DEVICE_PARAM(PreambleType, "Preamble Type");
-
#define RTS_THRESH_DEF 2347
-DEVICE_PARAM(RTSThreshold, "RTS threshold");
-
#define FRAG_THRESH_DEF 2346
-DEVICE_PARAM(FragThreshold, "Fragmentation threshold");
-
#define DATA_RATE_DEF 13
/* datarate[] index
0: indicate 1 Mbps 0x02
@@ -123,11 +110,7 @@ DEVICE_PARAM(FragThreshold, "Fragmentation threshold");
12: indicate 72 Mbps 0x90
13: indicate auto rate
*/
-
-DEVICE_PARAM(ConnectionRate, "Connection data rate");
-
#define OP_MODE_DEF 0
-DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode ");
/* OpMode[] is used for transmit.
0: indicate infrastruct mode used
@@ -141,13 +124,10 @@ DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode ");
*/
#define PS_MODE_DEF 0
-DEVICE_PARAM(PSMode, "Power saving mode");
#define SHORT_RETRY_DEF 8
-DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits");
#define LONG_RETRY_DEF 4
-DEVICE_PARAM(LongRetryLimit, "long frame retry limits");
/* BasebandType[] baseband type selected
0: indicate 802.11a type
@@ -156,7 +136,6 @@ DEVICE_PARAM(LongRetryLimit, "long frame retry limits");
*/
#define BBP_TYPE_DEF 2
-DEVICE_PARAM(BasebandType, "baseband type");
/* 80211hEnable[]
0: indicate disable 802.11h
@@ -165,8 +144,6 @@ DEVICE_PARAM(BasebandType, "baseband type");
#define X80211h_MODE_DEF 0
-DEVICE_PARAM(b80211hEnable, "802.11h mode");
-
/*
* Static vars definitions
*/
--
2.0.1
Replace with dev_dbg
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/power.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index dbda303..0ffbaed 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -42,8 +42,6 @@
#include "card.h"
#include "usbpipe.h"
-static int msglevel = MSG_LEVEL_INFO;
-
/*
*
* Routine Description:
@@ -93,7 +91,7 @@ void vnt_enable_power_saving(struct vnt_private *priv, u16 listen_interval)
vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_ALBCN);
}
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PS:Power Saving Mode Enable...\n");
+ dev_dbg(&priv->usb->dev, "PS:Power Saving Mode Enable...\n");
}
/*
--
2.0.1
Replace with vnt_tx_buffers using module_param_named and
MODULE_PARM_DESC
Check user doe not set tx_buffer beyond the define limits of driver
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 6e79c4c..46f8491 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -83,7 +83,10 @@ module_param_named(rx_buffers, vnt_rx_buffers, int, 0644);
MODULE_PARM_DESC(rx_buffers, "Number of receive usb rx buffers");
#define TX_DESC_DEF0 64
-DEVICE_PARAM(TxDescriptors0, "Number of transmit usb desc buffer");
+static int vnt_tx_buffers = TX_DESC_DEF0;
+module_param_named(tx_buffers, vnt_rx_buffers, int, 0644);
+MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
+
#define CHANNEL_DEF 6
DEVICE_PARAM(Channel, "Channel number");
@@ -204,7 +207,11 @@ static void usb_device_reset(struct vnt_private *pDevice);
static void device_set_options(struct vnt_private *priv)
{
- priv->cbTD = TX_DESC_DEF0;
+ /* Set number of TX buffers */
+ if (vnt_tx_buffers < CB_MIN_TX_DESC || vnt_tx_buffers > CB_MAX_TX_DESC)
+ priv->cbTD = TX_DESC_DEF0;
+ else
+ priv->cbTD = vnt_tx_buffers;
/* Set number of RX buffers */
if (vnt_rx_buffers < CB_MIN_RX_DESC || vnt_rx_buffers > CB_MAX_RX_DESC)
--
2.0.1