staging: vt6656: Remove flags fMP_POST_READS and fMP_POST_WRITES
PATCH 1/8 staging: vt6656: Remove flags fMP_POST_READS and fMP_POST_WRITES
MP_IS_READY(fMP_DISCONNECTED) is used to block thread in vnt_tx_context
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 2 -- drivers/staging/vt6656/main_usb.c | 4 ---- drivers/staging/vt6656/usbpipe.c | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/vt6656/device.h +0 -2
@@ -406,8 +406,6 @@ struct vnt_private { }#define fMP_DISCONNECTED 0x00000002 -#define fMP_POST_READS 0x00000100 -#define fMP_POST_WRITES 0x00000200#define MP_SET_FLAG (_M, _F) ((_M)->Flags |= (_F))#define MP_CLEAR_FLAG (_M, _F) ((_M)->Flags &= ~(_F))
drivers/staging/vt6656/main_usb.c +0 -4
@@ -552,8 +552,6 @@ static int vnt_start(struct ieee80211_hw *hw) }MP_CLEAR_FLAG (priv, fMP_DISCONNECTED); -MP_SET_FLAG (priv, fMP_POST_READS); -MP_SET_FLAG (priv, fMP_POST_WRITES);if (device_init_registers (priv) == false) {dev_dbg (&priv->usb->dev," init register fail\n" );
@@ -601,8 +599,6 @@ static void vnt_stop(struct ieee80211_hw *hw)ieee80211_stop_queues (hw);MP_SET_FLAG (priv, fMP_DISCONNECTED); -MP_CLEAR_FLAG (priv, fMP_POST_WRITES); -MP_CLEAR_FLAG (priv, fMP_POST_READS);cancel_delayed_work_sync (&priv->run_command_work);
drivers/staging/vt6656/usbpipe.c +1 -1
@@ -289,7 +289,7 @@ int vnt_tx_context(struct vnt_private *priv,int status;struct urb *urb; -if (!(MP_IS_READY (priv) && priv->Flags & fMP_POST_WRITES)) { +if (!(MP_IS_READY (priv))) { context->in_use = false;return STATUS_RESOURCES ; }
Signature · 1 line
2.0.1
PATCH 2/8 staging: vt6656: remove macro MP_IS_READY
Just test FLag and remove not.
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 2 -- drivers/staging/vt6656/usbpipe.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vt6656/device.h +0 -2
@@ -411,8 +411,6 @@ struct vnt_private {#define MP_CLEAR_FLAG (_M, _F) ((_M)->Flags &= ~(_F))#define MP_TEST_FLAGS (_M, _F) (((_M)->Flags & (_F)) == (_F)) -#define MP_IS_READY (_M) (((_M)->Flags & fMP_DISCONNECTED) == 0) -int vnt_init (struct vnt_private *priv);#endif
drivers/staging/vt6656/usbpipe.c +1 -1
@@ -289,7 +289,7 @@ int vnt_tx_context(struct vnt_private *priv,int status;struct urb *urb; -if (!(MP_IS_READY (priv))) { +if (priv->Flags & fMP_DISCONNECTED) { context->in_use = false;return STATUS_RESOURCES ; }
Signature · 1 line
2.0.1
PATCH 3/8 staging: vt6656: Remove unsed macro DEVICE_FLAGS_OPENED
In reply to Malcolm PriestleySigned-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 3 --- drivers/staging/vt6656/main_usb.c | 4 ---- 2 files changed, 7 deletions(-)
drivers/staging/vt6656/device.h +0 -3
@@ -264,9 +264,6 @@ enum {/* flags for options */ #define DEVICE_FLAGS_UNPLUG 0x00000001UL -/* flags for driver status */ -#define DEVICE_FLAGS_OPENED 0x00010000UL -struct vnt_private {/* mac80211 */ struct ieee80211_hw *hw;
drivers/staging/vt6656/main_usb.c +0 -4
@@ -562,8 +562,6 @@ static int vnt_start(struct ieee80211_hw *hw)vnt_int_start_interrupt (priv); - priv->flags |=DEVICE_FLAGS_OPENED ; -ieee80211_wake_queues (hw);return 0 ;
@@ -604,8 +602,6 @@ static void vnt_stop(struct ieee80211_hw *hw) priv->cmd_running = false; - priv->flags &= ~DEVICE_FLAGS_OPENED ; -device_free_tx_bufs (priv);device_free_rx_bufs (priv);device_free_int_bufs (priv);
Signature · 1 line
2.0.1
PATCH 4/8 staging: vt6656: struct vnt_private merge flag and macros
In reply to Malcolm Priestleymerge u32 flag into unsigned long Flags
Replacing fMP_DISCONNECTED with DEVICE_FLAGS_DISCONNECTED
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 14 ++++++-------- drivers/staging/vt6656/main_usb.c | 6 +++--- drivers/staging/vt6656/usbpipe.c | 6 +++--- drivers/staging/vt6656/wcmd.c | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-)
drivers/staging/vt6656/device.h +6 -8
@@ -262,7 +262,8 @@ enum { };/* flags for options */ -#define DEVICE_FLAGS_UNPLUG 0x00000001UL +#define DEVICE_FLAGS_UNPLUG BIT(0) +#define DEVICE_FLAGS_DISCONNECTED BIT(1)struct vnt_private {/* mac80211 */
@@ -281,8 +282,7 @@ struct vnt_private {spinlock_t lock;struct mutex usb_lock; -u32 flags; -unsigned long Flags; +unsigned long flags;/* USB */ struct urb *interrupt_urb;
@@ -402,11 +402,9 @@ struct vnt_private { (uVar)++; \ } -#define fMP_DISCONNECTED 0x00000002 - -#define MP_SET_FLAG (_M, _F) ((_M)->Flags |= (_F)) -#define MP_CLEAR_FLAG (_M, _F) ((_M)->Flags &= ~(_F)) -#define MP_TEST_FLAGS (_M, _F) (((_M)->Flags & (_F)) == (_F)) +#define MP_SET_FLAG (_M, _F) ((_M)->flags |= (_F)) +#define MP_CLEAR_FLAG (_M, _F) ((_M)->flags &= ~(_F)) +#define MP_TEST_FLAGS (_M, _F) (((_M)->flags & (_F)) == (_F))int vnt_init (struct vnt_private *priv);
drivers/staging/vt6656/main_usb.c +3 -3
@@ -551,7 +551,7 @@ static int vnt_start(struct ieee80211_hw *hw)return -ENOMEM ; } -MP_CLEAR_FLAG (priv, fMP_DISCONNECTED); +MP_CLEAR_FLAG (priv,DEVICE_FLAGS_DISCONNECTED );if (device_init_registers (priv) == false) {dev_dbg (&priv->usb->dev," init register fail\n" );
@@ -596,7 +596,7 @@ static void vnt_stop(struct ieee80211_hw *hw)ieee80211_stop_queues (hw); -MP_SET_FLAG (priv, fMP_DISCONNECTED); +MP_SET_FLAG (priv,DEVICE_FLAGS_DISCONNECTED );cancel_delayed_work_sync (&priv->run_command_work);
@@ -1025,7 +1025,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)usb_device_reset (priv); -MP_CLEAR_FLAG (priv, fMP_DISCONNECTED); +MP_CLEAR_FLAG (priv,DEVICE_FLAGS_DISCONNECTED );vnt_reset_command_timer (priv);vnt_schedule_command (priv,WLAN_CMD_INIT_MAC80211 );
drivers/staging/vt6656/usbpipe.c +3 -3
@@ -52,7 +52,7 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value, {int status =0 ; -if (priv->Flags & fMP_DISCONNECTED) +if (priv->flags &DEVICE_FLAGS_DISCONNECTED )return STATUS_FAILURE ;mutex_lock (&priv->usb_lock);
@@ -80,7 +80,7 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value, {int status; -if (priv->Flags & fMP_DISCONNECTED) +if (priv->flags &DEVICE_FLAGS_DISCONNECTED )return STATUS_FAILURE ;mutex_lock (&priv->usb_lock);
@@ -289,7 +289,7 @@ int vnt_tx_context(struct vnt_private *priv,int status;struct urb *urb; -if (priv->Flags & fMP_DISCONNECTED) { +if (priv->flags &DEVICE_FLAGS_DISCONNECTED ) { context->in_use = false;return STATUS_RESOURCES ; }
drivers/staging/vt6656/wcmd.c +1 -1
@@ -97,7 +97,7 @@ void vnt_run_command(struct work_struct *work)struct vnt_private *priv = container_of(work, struct vnt_private, run_command_work.work); -if (priv->Flags & fMP_DISCONNECTED) +if (priv->flags &DEVICE_FLAGS_DISCONNECTED )return ;if (priv->cmd_running != true)
Signature · 1 line
2.0.1
PATCH 5/8 staging: vt6656: use set_bit to set flags
In reply to Malcolm PriestleyReplacing MP_SET_FLAG
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/main_usb.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/vt6656/device.h +0 -1
@@ -402,7 +402,6 @@ struct vnt_private { (uVar)++; \ } -#define MP_SET_FLAG (_M, _F) ((_M)->flags |= (_F))#define MP_CLEAR_FLAG (_M, _F) ((_M)->flags &= ~(_F))#define MP_TEST_FLAGS (_M, _F) (((_M)->flags & (_F)) == (_F))
drivers/staging/vt6656/main_usb.c +2 -2
@@ -596,7 +596,7 @@ static void vnt_stop(struct ieee80211_hw *hw)ieee80211_stop_queues (hw); -MP_SET_FLAG (priv,DEVICE_FLAGS_DISCONNECTED ); +set_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags);cancel_delayed_work_sync (&priv->run_command_work);
@@ -1051,7 +1051,7 @@ static void vt6656_disconnect(struct usb_interface *intf)usb_set_intfdata (intf,NULL );usb_put_dev (interface_to_usbdev (intf)); - priv->flags |=DEVICE_FLAGS_UNPLUG ; +set_bit (DEVICE_FLAGS_UNPLUG , &priv->flags);ieee80211_free_hw (priv->hw); }
Signature · 1 line
2.0.1
PATCH 6/8 staging: vt6656: use clear_bit to remove device flag
In reply to Malcolm PriestleyReplacing MP_CLEAR_FLAG
Signed-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/main_usb.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/vt6656/device.h +0 -1
@@ -402,7 +402,6 @@ struct vnt_private { (uVar)++; \ } -#define MP_CLEAR_FLAG (_M, _F) ((_M)->flags &= ~(_F))#define MP_TEST_FLAGS (_M, _F) (((_M)->flags & (_F)) == (_F))int vnt_init (struct vnt_private *priv);
drivers/staging/vt6656/main_usb.c +2 -2
@@ -551,7 +551,7 @@ static int vnt_start(struct ieee80211_hw *hw)return -ENOMEM ; } -MP_CLEAR_FLAG (priv,DEVICE_FLAGS_DISCONNECTED ); +clear_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags);if (device_init_registers (priv) == false) {dev_dbg (&priv->usb->dev," init register fail\n" );
@@ -1025,7 +1025,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)usb_device_reset (priv); -MP_CLEAR_FLAG (priv,DEVICE_FLAGS_DISCONNECTED ); +clear_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags);vnt_reset_command_timer (priv);vnt_schedule_command (priv,WLAN_CMD_INIT_MAC80211 );
Signature · 1 line
2.0.1
PATCH 7/8 staging: vt6656: Remove unused macro MP_TEST_FLAGS
In reply to Malcolm PriestleySigned-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/device.h | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/vt6656/device.h +0 -2
@@ -402,8 +402,6 @@ struct vnt_private { (uVar)++; \ } -#define MP_TEST_FLAGS (_M, _F) (((_M)->flags & (_F)) == (_F)) -int vnt_init (struct vnt_private *priv);#endif
Signature · 1 line
2.0.1
PATCH 8/8 staging: vt6656: use test_bit to check flags status
In reply to Malcolm PriestleySigned-off-by Malcolm Priestley <[email protected]>
--- drivers/staging/vt6656/main_usb.c | 2 +- drivers/staging/vt6656/usbpipe.c | 6 +++--- drivers/staging/vt6656/wcmd.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vt6656/main_usb.c +1 -1
@@ -591,7 +591,7 @@ static void vnt_stop(struct ieee80211_hw *hw)/* clear all keys */ priv->key_entry_inuse =0 ; -if ((priv->flags &DEVICE_FLAGS_UNPLUG ) == false) +if (!test_bit (DEVICE_FLAGS_UNPLUG , &priv->flags))vnt_mac_shutdown (priv);ieee80211_stop_queues (hw);
drivers/staging/vt6656/usbpipe.c +3 -3
@@ -52,7 +52,7 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value, {int status =0 ; -if (priv->flags &DEVICE_FLAGS_DISCONNECTED ) +if (test_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags))return STATUS_FAILURE ;mutex_lock (&priv->usb_lock);
@@ -80,7 +80,7 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value, {int status; -if (priv->flags &DEVICE_FLAGS_DISCONNECTED ) +if (test_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags))return STATUS_FAILURE ;mutex_lock (&priv->usb_lock);
@@ -289,7 +289,7 @@ int vnt_tx_context(struct vnt_private *priv,int status;struct urb *urb; -if (priv->flags &DEVICE_FLAGS_DISCONNECTED ) { +if (test_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags)) { context->in_use = false;return STATUS_RESOURCES ; }
drivers/staging/vt6656/wcmd.c +1 -1
@@ -97,7 +97,7 @@ void vnt_run_command(struct work_struct *work)struct vnt_private *priv = container_of(work, struct vnt_private, run_command_work.work); -if (priv->flags &DEVICE_FLAGS_DISCONNECTED ) +if (test_bit (DEVICE_FLAGS_DISCONNECTED , &priv->flags))return ;if (priv->cmd_running != true)
Signature · 1 line
2.0.1