Replacing the variables.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 2 +-
drivers/staging/vt6656/wcmd.c | 8 ++++----
drivers/staging/vt6656/wcmd.h | 22 +++++++++++-----------
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 789c55d..4630206 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -400,7 +400,7 @@ struct vnt_private {
CMD_STATE eCommandState;
- CMD_CODE eCommand;
+ enum vnt_cmd command;
int bStopDataPkt;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index ade0f81..3d9ace2 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -146,13 +146,13 @@ static int s_bCommandComplete(struct vnt_private *priv)
return true;
}
- priv->eCommand = priv->eCmdQueue[priv->uCmdDequeueIdx].eCmd;
+ priv->command = priv->eCmdQueue[priv->uCmdDequeueIdx].cmd;
ADD_ONE_WITH_WRAP_AROUND(priv->uCmdDequeueIdx, CMD_Q_SIZE);
priv->cbFreeCmdQueue++;
priv->bCmdRunning = true;
- switch (priv->eCommand) {
+ switch (priv->command) {
case WLAN_CMD_INIT_MAC80211:
priv->eCommandState = WLAN_CMD_INIT_MAC80211_START;
break;
@@ -186,13 +186,13 @@ static int s_bCommandComplete(struct vnt_private *priv)
return true;
}
-int bScheduleCommand(struct vnt_private *priv, CMD_CODE command, u8 *item0)
+int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
{
if (priv->cbFreeCmdQueue == 0)
return false;
- priv->eCmdQueue[priv->uCmdEnqueueIdx].eCmd = command;
+ priv->eCmdQueue[priv->uCmdEnqueueIdx].cmd = command;
ADD_ONE_WITH_WRAP_AROUND(priv->uCmdEnqueueIdx, CMD_Q_SIZE);
priv->cbFreeCmdQueue--;
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index 98387f3..1d0201a 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -34,15 +34,15 @@
#define AUTHENTICATE_TIMEOUT 1000 //ms
#define ASSOCIATE_TIMEOUT 1000 //ms
-// Command code
-typedef enum tagCMD_CODE {
- WLAN_CMD_INIT_MAC80211,
- WLAN_CMD_SETPOWER,
- WLAN_CMD_TBTT_WAKEUP,
- WLAN_CMD_BECON_SEND,
- WLAN_CMD_CHANGE_ANTENNA,
- WLAN_CMD_11H_CHSW,
-} CMD_CODE, *PCMD_CODE;
+/* Command code */
+enum vnt_cmd {
+ WLAN_CMD_INIT_MAC80211,
+ WLAN_CMD_SETPOWER,
+ WLAN_CMD_TBTT_WAKEUP,
+ WLAN_CMD_BECON_SEND,
+ WLAN_CMD_CHANGE_ANTENNA,
+ WLAN_CMD_11H_CHSW,
+};
#define CMD_Q_SIZE 32
@@ -57,7 +57,7 @@ typedef enum tagCMD_STATUS {
} CMD_STATUS, *PCMD_STATUS;
typedef struct tagCMD_ITEM {
- CMD_CODE eCmd;
+ enum vnt_cmd cmd;
} CMD_ITEM, *PCMD_ITEM;
// Command state
@@ -75,7 +75,7 @@ struct vnt_private;
void vResetCommandTimer(struct vnt_private *);
-int bScheduleCommand(struct vnt_private *, CMD_CODE eCommand, u8 *pbyItem0);
+int bScheduleCommand(struct vnt_private *, enum vnt_cmd, u8 *);
void vRunCommand(struct work_struct *work);
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/wcmd.c | 2 +-
drivers/staging/vt6656/wcmd.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 34b6148..d9b5210 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1111,7 +1111,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
spin_lock_init(&priv->lock);
mutex_init(&priv->usb_lock);
- INIT_DELAYED_WORK(&priv->run_command_work, vRunCommand);
+ INIT_DELAYED_WORK(&priv->run_command_work, vnt_run_command);
usb_set_intfdata(intf, priv);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 87e682d..864d5e5 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -104,7 +104,7 @@ static int vnt_cmd_complete(struct vnt_private *priv)
return true;
}
-void vRunCommand(struct work_struct *work)
+void vnt_run_command(struct work_struct *work)
{
struct vnt_private *priv =
container_of(work, struct vnt_private, run_command_work.work);
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index a2943ab..783d6c9 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -63,6 +63,6 @@ void vResetCommandTimer(struct vnt_private *);
int bScheduleCommand(struct vnt_private *, enum vnt_cmd, u8 *);
-void vRunCommand(struct work_struct *work);
+void vnt_run_command(struct work_struct *work);
#endif /* __WCMD_H__ */
--
1.9.1
Removing old functions and comments.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/wcmd.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 3c65228..bf41e67 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -25,14 +25,9 @@
* Date: May 8, 2003
*
* Functions:
- * s_vProbeChannel - Active scan channel
- * s_MgrMakeProbeRequest - Make ProbeRequest packet
- * CommandTimer - Timer function to handle command
* vnt_cmd_complete - Command Complete function
- * vnt_schedule_command - Push Command and wait Command Scheduler to do
- * vCommandTimer- Command call back functions
+ * vnt_schedule_command - Push Command and wait Command Scheduler to do
* vnt_cmd_timer_wait- Call back timer
- * s_bClearBSSID_SCAN- Clear BSSID_SCAN cmd in CMD Queue
*
* Revision History:
*
@@ -174,7 +169,7 @@ void vnt_run_command(struct work_struct *work)
default:
break;
- } //switch
+ }
vnt_cmd_complete(priv);
--
1.9.1
Since enum vnt_cmd is only member replace with array
enum vnt_cmd cmd_queue with size of CMD_Q_SIZE
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 2 +-
drivers/staging/vt6656/wcmd.c | 4 ++--
drivers/staging/vt6656/wcmd.h | 4 ----
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 0c9166e..a6eeebc 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -406,7 +406,7 @@ struct vnt_private {
/* 802.11 counter */
- CMD_ITEM eCmdQueue[CMD_Q_SIZE];
+ enum vnt_cmd cmd_queue[CMD_Q_SIZE];
u32 uCmdDequeueIdx;
u32 uCmdEnqueueIdx;
u32 cbFreeCmdQueue;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index e0ad20a..c2da8cc 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -146,7 +146,7 @@ static int s_bCommandComplete(struct vnt_private *priv)
return true;
}
- priv->command = priv->eCmdQueue[priv->uCmdDequeueIdx].cmd;
+ priv->command = priv->cmd_queue[priv->uCmdDequeueIdx];
ADD_ONE_WITH_WRAP_AROUND(priv->uCmdDequeueIdx, CMD_Q_SIZE);
priv->cbFreeCmdQueue++;
@@ -192,7 +192,7 @@ int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
if (priv->cbFreeCmdQueue == 0)
return false;
- priv->eCmdQueue[priv->uCmdEnqueueIdx].cmd = command;
+ priv->cmd_queue[priv->uCmdEnqueueIdx] = command;
ADD_ONE_WITH_WRAP_AROUND(priv->uCmdEnqueueIdx, CMD_Q_SIZE);
priv->cbFreeCmdQueue--;
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index 283df61..f42270b 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -56,10 +56,6 @@ typedef enum tagCMD_STATUS {
} CMD_STATUS, *PCMD_STATUS;
-typedef struct tagCMD_ITEM {
- enum vnt_cmd cmd;
-} CMD_ITEM, *PCMD_ITEM;
-
/* Command state */
enum vnt_cmd_state {
WLAN_CMD_INIT_MAC80211_START,
--
1.9.1
camel case changes
uCmdDequeueIdx -> cmd_dequeue_idx
uCmdEnqueueIdx -> cmd_enqueue_idx
cbFreeCmdQueue -> free_cmd_queue
bCmdRunning -> cmd_running
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 8 ++++----
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/wcmd.c | 32 ++++++++++++++++----------------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index a1ed376..436f109 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -407,10 +407,10 @@ struct vnt_private {
/* 802.11 counter */
enum vnt_cmd cmd_queue[CMD_Q_SIZE];
- u32 uCmdDequeueIdx;
- u32 uCmdEnqueueIdx;
- u32 cbFreeCmdQueue;
- int bCmdRunning;
+ u32 cmd_dequeue_idx;
+ u32 cmd_enqueue_idx;
+ u32 free_cmd_queue;
+ int cmd_running;
unsigned long key_entry_inuse;
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 4cdf29e..34b6148 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -708,7 +708,7 @@ static void vnt_stop(struct ieee80211_hw *hw)
cancel_delayed_work_sync(&priv->run_command_work);
- priv->bCmdRunning = false;
+ priv->cmd_running = false;
priv->flags &= ~DEVICE_FLAGS_OPENED;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index fa7c7b6..37ca3de 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -64,7 +64,7 @@ void vRunCommand(struct work_struct *work)
if (priv->Flags & fMP_DISCONNECTED)
return;
- if (priv->bCmdRunning != true)
+ if (priv->cmd_running != true)
return;
switch (priv->command_state) {
@@ -140,17 +140,17 @@ static int s_bCommandComplete(struct vnt_private *priv)
{
priv->command_state = WLAN_CMD_IDLE;
- if (priv->cbFreeCmdQueue == CMD_Q_SIZE) {
+ if (priv->free_cmd_queue == CMD_Q_SIZE) {
/* Command Queue Empty */
- priv->bCmdRunning = false;
+ priv->cmd_running = false;
return true;
}
- priv->command = priv->cmd_queue[priv->uCmdDequeueIdx];
+ priv->command = priv->cmd_queue[priv->cmd_dequeue_idx];
- ADD_ONE_WITH_WRAP_AROUND(priv->uCmdDequeueIdx, CMD_Q_SIZE);
- priv->cbFreeCmdQueue++;
- priv->bCmdRunning = true;
+ ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE);
+ priv->free_cmd_queue++;
+ priv->cmd_running = true;
switch (priv->command) {
case WLAN_CMD_INIT_MAC80211:
@@ -189,15 +189,15 @@ static int s_bCommandComplete(struct vnt_private *priv)
int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
{
- if (priv->cbFreeCmdQueue == 0)
+ if (priv->free_cmd_queue == 0)
return false;
- priv->cmd_queue[priv->uCmdEnqueueIdx] = command;
+ priv->cmd_queue[priv->cmd_enqueue_idx] = command;
- ADD_ONE_WITH_WRAP_AROUND(priv->uCmdEnqueueIdx, CMD_Q_SIZE);
- priv->cbFreeCmdQueue--;
+ ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE);
+ priv->free_cmd_queue--;
- if (priv->bCmdRunning == false)
+ if (priv->cmd_running == false)
s_bCommandComplete(priv);
return true;
@@ -206,9 +206,9 @@ int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
void vResetCommandTimer(struct vnt_private *priv)
{
- priv->cbFreeCmdQueue = CMD_Q_SIZE;
- priv->uCmdDequeueIdx = 0;
- priv->uCmdEnqueueIdx = 0;
+ priv->free_cmd_queue = CMD_Q_SIZE;
+ priv->cmd_dequeue_idx = 0;
+ priv->cmd_enqueue_idx = 0;
priv->command_state = WLAN_CMD_IDLE;
- priv->bCmdRunning = false;
+ priv->cmd_running = false;
}
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/wcmd.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index f42270b..a2943ab 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -46,16 +46,6 @@ enum vnt_cmd {
#define CMD_Q_SIZE 32
-typedef enum tagCMD_STATUS {
-
- CMD_STATUS_SUCCESS = 0,
- CMD_STATUS_FAILURE,
- CMD_STATUS_RESOURCES,
- CMD_STATUS_TIMEOUT,
- CMD_STATUS_PENDING
-
-} CMD_STATUS, *PCMD_STATUS;
-
/* Command state */
enum vnt_cmd_state {
WLAN_CMD_INIT_MAC80211_START,
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/wcmd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 8c5a0e8..87e682d 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -31,7 +31,7 @@
* vnt_cmd_complete - Command Complete function
* bScheduleCommand - Push Command and wait Command Scheduler to do
* vCommandTimer- Command call back functions
- * vCommandTimerWait- Call back timer
+ * vnt_cmd_timer_wait- Call back timer
* s_bClearBSSID_SCAN- Clear BSSID_SCAN cmd in CMD Queue
*
* Revision History:
@@ -49,7 +49,7 @@
#include "rf.h"
#include "channel.h"
-static void vCommandTimerWait(struct vnt_private *priv, unsigned long msecs)
+static void vnt_cmd_timer_wait(struct vnt_private *priv, unsigned long msecs)
{
schedule_delayed_work(&priv->run_command_work, msecs_to_jiffies(msecs));
}
@@ -99,7 +99,7 @@ static int vnt_cmd_complete(struct vnt_private *priv)
break;
}
- vCommandTimerWait(priv, 0);
+ vnt_cmd_timer_wait(priv, 0);
return true;
}
--
1.9.1
Remove static declaration and moving for function visibility
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/wcmd.c | 108 +++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 55 deletions(-)
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 37ca3de..8c5a0e8 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -28,7 +28,7 @@
* s_vProbeChannel - Active scan channel
* s_MgrMakeProbeRequest - Make ProbeRequest packet
* CommandTimer - Timer function to handle command
- * s_bCommandComplete - Command Complete function
+ * vnt_cmd_complete - Command Complete function
* bScheduleCommand - Push Command and wait Command Scheduler to do
* vCommandTimer- Command call back functions
* vCommandTimerWait- Call back timer
@@ -49,13 +49,61 @@
#include "rf.h"
#include "channel.h"
-static int s_bCommandComplete(struct vnt_private *);
-
static void vCommandTimerWait(struct vnt_private *priv, unsigned long msecs)
{
schedule_delayed_work(&priv->run_command_work, msecs_to_jiffies(msecs));
}
+static int vnt_cmd_complete(struct vnt_private *priv)
+{
+
+ priv->command_state = WLAN_CMD_IDLE;
+ if (priv->free_cmd_queue == CMD_Q_SIZE) {
+ /* Command Queue Empty */
+ priv->cmd_running = false;
+ return true;
+ }
+
+ priv->command = priv->cmd_queue[priv->cmd_dequeue_idx];
+
+ ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE);
+ priv->free_cmd_queue++;
+ priv->cmd_running = true;
+
+ switch (priv->command) {
+ case WLAN_CMD_INIT_MAC80211:
+ priv->command_state = WLAN_CMD_INIT_MAC80211_START;
+ break;
+
+ case WLAN_CMD_TBTT_WAKEUP:
+ priv->command_state = WLAN_CMD_TBTT_WAKEUP_START;
+ break;
+
+ case WLAN_CMD_BECON_SEND:
+ priv->command_state = WLAN_CMD_BECON_SEND_START;
+ break;
+
+ case WLAN_CMD_SETPOWER:
+ priv->command_state = WLAN_CMD_SETPOWER_START;
+ break;
+
+ case WLAN_CMD_CHANGE_ANTENNA:
+ priv->command_state = WLAN_CMD_CHANGE_ANTENNA_START;
+ break;
+
+ case WLAN_CMD_11H_CHSW:
+ priv->command_state = WLAN_CMD_11H_CHSW_START;
+ break;
+
+ default:
+ break;
+ }
+
+ vCommandTimerWait(priv, 0);
+
+ return true;
+}
+
void vRunCommand(struct work_struct *work)
{
struct vnt_private *priv =
@@ -131,61 +179,11 @@ void vRunCommand(struct work_struct *work)
break;
} //switch
- s_bCommandComplete(priv);
+ vnt_cmd_complete(priv);
return;
}
-static int s_bCommandComplete(struct vnt_private *priv)
-{
-
- priv->command_state = WLAN_CMD_IDLE;
- if (priv->free_cmd_queue == CMD_Q_SIZE) {
- /* Command Queue Empty */
- priv->cmd_running = false;
- return true;
- }
-
- priv->command = priv->cmd_queue[priv->cmd_dequeue_idx];
-
- ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE);
- priv->free_cmd_queue++;
- priv->cmd_running = true;
-
- switch (priv->command) {
- case WLAN_CMD_INIT_MAC80211:
- priv->command_state = WLAN_CMD_INIT_MAC80211_START;
- break;
-
- case WLAN_CMD_TBTT_WAKEUP:
- priv->command_state = WLAN_CMD_TBTT_WAKEUP_START;
- break;
-
- case WLAN_CMD_BECON_SEND:
- priv->command_state = WLAN_CMD_BECON_SEND_START;
- break;
-
- case WLAN_CMD_SETPOWER:
- priv->command_state = WLAN_CMD_SETPOWER_START;
- break;
-
- case WLAN_CMD_CHANGE_ANTENNA:
- priv->command_state = WLAN_CMD_CHANGE_ANTENNA_START;
- break;
-
- case WLAN_CMD_11H_CHSW:
- priv->command_state = WLAN_CMD_11H_CHSW_START;
- break;
-
- default:
- break;
- }
-
- vCommandTimerWait(priv, 0);
-
- return true;
-}
-
int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
{
@@ -198,7 +196,7 @@ int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
priv->free_cmd_queue--;
if (priv->cmd_running == false)
- s_bCommandComplete(priv);
+ vnt_cmd_complete(priv);
return true;
--
1.9.1
Rename to vnt_schedule_command removing unused u8 pointer.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/int.c | 12 +++++-------
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/rxtx.c | 2 +-
drivers/staging/vt6656/wcmd.c | 4 ++--
drivers/staging/vt6656/wcmd.h | 2 +-
5 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/vt6656/int.c b/drivers/staging/vt6656/int.c
index 77bd9dd..15841b8 100644
--- a/drivers/staging/vt6656/int.c
+++ b/drivers/staging/vt6656/int.c
@@ -172,20 +172,18 @@ void INTnsProcessData(struct vnt_private *priv)
if (int_data->isr0 != 0) {
if (int_data->isr0 & ISR_BNTX &&
priv->op_mode == NL80211_IFTYPE_AP)
- bScheduleCommand(priv, WLAN_CMD_BECON_SEND, NULL);
+ vnt_schedule_command(priv, WLAN_CMD_BECON_SEND);
if (int_data->isr0 & ISR_TBTT) {
if (priv->hw->conf.flags & IEEE80211_CONF_PS)
- bScheduleCommand((void *) priv,
- WLAN_CMD_TBTT_WAKEUP,
- NULL);
+ vnt_schedule_command(priv,
+ WLAN_CMD_TBTT_WAKEUP);
#if 0 /* TODO channel switch */
if (priv->bChannelSwitch) {
priv->byChannelSwitchCount--;
if (priv->byChannelSwitchCount == 0)
- bScheduleCommand((void *) priv,
- WLAN_CMD_11H_CHSW,
- NULL);
+ vnt_schedule_command(priv,
+ WLAN_CMD_11H_CHSW);
}
#endif
}
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index d9b5210..ceef9ef 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1137,7 +1137,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
MP_CLEAR_FLAG(priv, fMP_DISCONNECTED);
vResetCommandTimer(priv);
- bScheduleCommand(priv, WLAN_CMD_INIT_MAC80211, NULL);
+ vnt_schedule_command(priv, WLAN_CMD_INIT_MAC80211);
return 0;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 3dc6d07..1f1ec04 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -767,7 +767,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
if (priv->wCurrentRate != current_rate &&
!(priv->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
priv->wCurrentRate = current_rate;
- bScheduleCommand(priv, WLAN_CMD_SETPOWER, NULL);
+ vnt_schedule_command(priv, WLAN_CMD_SETPOWER);
}
if (current_rate > RATE_11M)
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 864d5e5..b217efb 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -29,7 +29,7 @@
* s_MgrMakeProbeRequest - Make ProbeRequest packet
* CommandTimer - Timer function to handle command
* vnt_cmd_complete - Command Complete function
- * bScheduleCommand - Push Command and wait Command Scheduler to do
+ * vnt_schedule_command - Push Command and wait Command Scheduler to do
* vCommandTimer- Command call back functions
* vnt_cmd_timer_wait- Call back timer
* s_bClearBSSID_SCAN- Clear BSSID_SCAN cmd in CMD Queue
@@ -184,7 +184,7 @@ void vnt_run_command(struct work_struct *work)
return;
}
-int bScheduleCommand(struct vnt_private *priv, enum vnt_cmd command, u8 *item0)
+int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command)
{
if (priv->free_cmd_queue == 0)
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index 783d6c9..3248c95 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -61,7 +61,7 @@ struct vnt_private;
void vResetCommandTimer(struct vnt_private *);
-int bScheduleCommand(struct vnt_private *, enum vnt_cmd, u8 *);
+int vnt_schedule_command(struct vnt_private *, enum vnt_cmd);
void vnt_run_command(struct work_struct *work);
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/wcmd.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index bb9500f..3c65228 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -40,14 +40,11 @@
#include "device.h"
#include "mac.h"
-#include "card.h"
#include "wcmd.h"
#include "power.h"
-#include "baseband.h"
#include "usbpipe.h"
#include "rxtx.h"
#include "rf.h"
-#include "channel.h"
static void vnt_cmd_timer_wait(struct vnt_private *priv, unsigned long msecs)
{
--
1.9.1
Replacing variables.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 2 +-
drivers/staging/vt6656/wcmd.c | 18 +++++++++---------
drivers/staging/vt6656/wcmd.h | 20 ++++++++++----------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 4630206..0c9166e 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -398,7 +398,7 @@ struct vnt_private {
/* Beacon releated */
u16 wSeqCounter;
- CMD_STATE eCommandState;
+ enum vnt_cmd_state command_state;
enum vnt_cmd command;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 3d9ace2..e0ad20a 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -67,7 +67,7 @@ void vRunCommand(struct work_struct *work)
if (priv->bCmdRunning != true)
return;
- switch (priv->eCommandState) {
+ switch (priv->command_state) {
case WLAN_CMD_INIT_MAC80211_START:
if (priv->mac_hw)
break;
@@ -139,7 +139,7 @@ void vRunCommand(struct work_struct *work)
static int s_bCommandComplete(struct vnt_private *priv)
{
- priv->eCommandState = WLAN_CMD_IDLE;
+ priv->command_state = WLAN_CMD_IDLE;
if (priv->cbFreeCmdQueue == CMD_Q_SIZE) {
/* Command Queue Empty */
priv->bCmdRunning = false;
@@ -154,27 +154,27 @@ static int s_bCommandComplete(struct vnt_private *priv)
switch (priv->command) {
case WLAN_CMD_INIT_MAC80211:
- priv->eCommandState = WLAN_CMD_INIT_MAC80211_START;
+ priv->command_state = WLAN_CMD_INIT_MAC80211_START;
break;
case WLAN_CMD_TBTT_WAKEUP:
- priv->eCommandState = WLAN_CMD_TBTT_WAKEUP_START;
+ priv->command_state = WLAN_CMD_TBTT_WAKEUP_START;
break;
case WLAN_CMD_BECON_SEND:
- priv->eCommandState = WLAN_CMD_BECON_SEND_START;
+ priv->command_state = WLAN_CMD_BECON_SEND_START;
break;
case WLAN_CMD_SETPOWER:
- priv->eCommandState = WLAN_CMD_SETPOWER_START;
+ priv->command_state = WLAN_CMD_SETPOWER_START;
break;
case WLAN_CMD_CHANGE_ANTENNA:
- priv->eCommandState = WLAN_CMD_CHANGE_ANTENNA_START;
+ priv->command_state = WLAN_CMD_CHANGE_ANTENNA_START;
break;
case WLAN_CMD_11H_CHSW:
- priv->eCommandState = WLAN_CMD_11H_CHSW_START;
+ priv->command_state = WLAN_CMD_11H_CHSW_START;
break;
default:
@@ -209,7 +209,7 @@ void vResetCommandTimer(struct vnt_private *priv)
priv->cbFreeCmdQueue = CMD_Q_SIZE;
priv->uCmdDequeueIdx = 0;
priv->uCmdEnqueueIdx = 0;
- priv->eCommandState = WLAN_CMD_IDLE;
+ priv->command_state = WLAN_CMD_IDLE;
priv->bCmdRunning = false;
priv->bCmdClear = false;
}
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index 1d0201a..283df61 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -60,16 +60,16 @@ typedef struct tagCMD_ITEM {
enum vnt_cmd cmd;
} CMD_ITEM, *PCMD_ITEM;
-// Command state
-typedef enum tagCMD_STATE {
- WLAN_CMD_INIT_MAC80211_START,
- WLAN_CMD_SETPOWER_START,
- WLAN_CMD_TBTT_WAKEUP_START,
- WLAN_CMD_BECON_SEND_START,
- WLAN_CMD_CHANGE_ANTENNA_START,
- WLAN_CMD_11H_CHSW_START,
- WLAN_CMD_IDLE
-} CMD_STATE, *PCMD_STATE;
+/* Command state */
+enum vnt_cmd_state {
+ WLAN_CMD_INIT_MAC80211_START,
+ WLAN_CMD_SETPOWER_START,
+ WLAN_CMD_TBTT_WAKEUP_START,
+ WLAN_CMD_BECON_SEND_START,
+ WLAN_CMD_CHANGE_ANTENNA_START,
+ WLAN_CMD_11H_CHSW_START,
+ WLAN_CMD_IDLE
+};
struct vnt_private;
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/device.h | 2 --
drivers/staging/vt6656/wcmd.c | 1 -
2 files changed, 3 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index a6eeebc..a1ed376 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -411,8 +411,6 @@ struct vnt_private {
u32 uCmdEnqueueIdx;
u32 cbFreeCmdQueue;
int bCmdRunning;
- int bCmdClear;
- int bNeedRadioOFF;
unsigned long key_entry_inuse;
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index c2da8cc..fa7c7b6 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -211,5 +211,4 @@ void vResetCommandTimer(struct vnt_private *priv)
priv->uCmdEnqueueIdx = 0;
priv->command_state = WLAN_CMD_IDLE;
priv->bCmdRunning = false;
- priv->bCmdClear = false;
}
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/wcmd.c | 2 +-
drivers/staging/vt6656/wcmd.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index ceef9ef..dffd0c7 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1135,7 +1135,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_device_reset(priv);
MP_CLEAR_FLAG(priv, fMP_DISCONNECTED);
- vResetCommandTimer(priv);
+ vnt_reset_command_timer(priv);
vnt_schedule_command(priv, WLAN_CMD_INIT_MAC80211);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index b217efb..bb9500f 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -202,7 +202,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command)
}
-void vResetCommandTimer(struct vnt_private *priv)
+void vnt_reset_command_timer(struct vnt_private *priv)
{
priv->free_cmd_queue = CMD_Q_SIZE;
priv->cmd_dequeue_idx = 0;
diff --git a/drivers/staging/vt6656/wcmd.h b/drivers/staging/vt6656/wcmd.h
index 3248c95..0fc2c40 100644
--- a/drivers/staging/vt6656/wcmd.h
+++ b/drivers/staging/vt6656/wcmd.h
@@ -59,7 +59,7 @@ enum vnt_cmd_state {
struct vnt_private;
-void vResetCommandTimer(struct vnt_private *);
+void vnt_reset_command_timer(struct vnt_private *);
int vnt_schedule_command(struct vnt_private *, enum vnt_cmd);
--
1.9.1