Skip to contentSkip to conversation

staging: vt6656: usb_device_reset remove camel case

PATCH New Malcolm Priestley 1 participant 9 messages Jul 18, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 staging: vt6656: usb_device_reset remove camel case

Camel case change
pDevice -> priv

---
 drivers/staging/vt6656/main_usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/vt6656/main_usb.c +3 -3
index 6a46203..436523f 100644
@@ -438,13 +438,13 @@ static void device_free_rx_bufs(struct vnt_private *priv)
 	return;
 }
 
-static void usb_device_reset(struct vnt_private *pDevice)
+static void usb_device_reset(struct vnt_private *priv)
 {
 	int status;
 
-	status = usb_reset_device(pDevice->usb);
+	status = usb_reset_device(priv->usb);
 	if (status)
-		dev_warn(&pDevice->usb->dev,
+		dev_warn(&priv->usb->dev,
 			 "usb_device_reset fail status=%d\n", status);
 	return ;
 }
Signature · 1 line
2.0.1
#1 lore raw

PATCH 2/9 staging: vt6656: fix module_param_named tx_buffers variable

Should point to vnt_tx_buffers

---
 drivers/staging/vt6656/main_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/main_usb.c +1 -1
index 436523f..06e4861 100644
@@ -79,7 +79,7 @@ MODULE_PARM_DESC(rx_buffers, "Number of receive usb rx buffers");
 
 #define TX_DESC_DEF0 64
 static int vnt_tx_buffers = TX_DESC_DEF0;
-module_param_named(tx_buffers, vnt_rx_buffers, int, 0644);
+module_param_named(tx_buffers, vnt_tx_buffers, int, 0644);
 MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
 
 #define RTS_THRESH_DEF     2347
Signature · 1 line
2.0.1
#2 lore raw

PATCH 3/9 staging: vt6656: struct vnt_rcb remove unused members

In reply to Malcolm Priestley

Remove Next and Ref

---
 drivers/staging/vt6656/device.h  | 2 --
 drivers/staging/vt6656/usbpipe.c | 1 -
 2 files changed, 3 deletions(-)
drivers/staging/vt6656/device.h +0 -2
index f08f7de..ad43c6f 100644
@@ -219,8 +219,6 @@ enum {
 
 /* RCB (Receive Control Block) */
 struct vnt_rcb {
-	void *Next;
-	signed long Ref;
 	void *pDevice;
 	struct urb *pUrb;
 	struct sk_buff *skb;
drivers/staging/vt6656/usbpipe.c +0 -1
index 59e508c..d994b1b 100644
@@ -207,7 +207,6 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
 		return STATUS_FAILURE ;
 	}
 
-	rcb->Ref = 1;
 	rcb->bBoolInUse = true;
 
 	return status;
Signature · 1 line
2.0.1
#3 lore raw

PATCH 4/9 staging: vt6656: struct vnt_rcb remove camel case

In reply to Malcolm Priestley

Camel case changes
pDevice -> priv
pUrb -> urb
bBoolInUse -> in_use

---
 drivers/staging/vt6656/device.h   |  6 +++---
 drivers/staging/vt6656/main_usb.c | 14 +++++++-------
 drivers/staging/vt6656/usbpipe.c  | 10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/vt6656/device.h +3 -3
index ad43c6f..8f318a9 100644
@@ -219,10 +219,10 @@ enum {
 
 /* RCB (Receive Control Block) */
 struct vnt_rcb {
-	void *pDevice;
-	struct urb *pUrb;
+	void *priv;
+	struct urb *urb;
 	struct sk_buff *skb;
-	int bBoolInUse;
+	int in_use;
 };
 
 /* used to track bulk out irps */
drivers/staging/vt6656/main_usb.c +7 -7
index 06e4861..be498bc 100644
@@ -423,9 +423,9 @@ static void device_free_rx_bufs(struct vnt_private *priv)
 			continue;
 
 		/* deallocate URBs */
-		if (rcb->pUrb) {
-			usb_kill_urb(rcb->pUrb);
-			usb_free_urb(rcb->pUrb);
+		if (rcb->urb) {
+			usb_kill_urb(rcb->urb);
+			usb_free_urb(rcb->urb);
 		}
 
 		/* deallocate skb */
@@ -495,11 +495,11 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 
 		rcb = priv->apRCB[ii];
 
-		rcb->pDevice = priv;
+		rcb->priv = priv;
 
 		/* allocate URBs */
-		rcb->pUrb = usb_alloc_urb(0, GFP_ATOMIC);
-		if (rcb->pUrb == NULL) {
+		rcb->urb = usb_alloc_urb(0, GFP_ATOMIC);
+		if (rcb->urb == NULL) {
 			dev_err(&priv->usb->dev, "Failed to alloc rx urb\n");
 			goto free_rx_tx;
 		}
@@ -510,7 +510,7 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 			goto free_rx_tx;
 		}
 
-		rcb->bBoolInUse = false;
+		rcb->in_use = false;
 
 		/* submit rx urb */
 		if (vnt_submit_rx_urb(priv, rcb))
drivers/staging/vt6656/usbpipe.c +5 -5
index d994b1b..126294d 100644
@@ -187,7 +187,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
 	int status = 0;
 	struct urb *urb;
 
-	urb = rcb->pUrb;
+	urb = rcb->urb;
 	if (rcb->skb == NULL) {
 		dev_dbg(&priv->usb->dev, "rcb->skb is null\n");
 		return status;
@@ -207,7 +207,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
 		return STATUS_FAILURE ;
 	}
 
-	rcb->bBoolInUse = true;
+	rcb->in_use = true;
 
 	return status;
 }
@@ -215,7 +215,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
 static void vnt_submit_rx_urb_complete(struct urb *urb)
 {
 	struct vnt_rcb *rcb = urb->context;
-	struct vnt_private *priv = rcb->pDevice;
+	struct vnt_private *priv = rcb->priv;
 	unsigned long flags;
 
 	switch (urb->status) {
@@ -240,7 +240,7 @@ static void vnt_submit_rx_urb_complete(struct urb *urb)
 				dev_dbg(&priv->usb->dev,
 					"Failed to re-alloc rx skb\n");
 
-				rcb->bBoolInUse = false;
+				rcb->in_use = false;
 				spin_unlock_irqrestore(&priv->lock, flags);
 				return;
 			}
@@ -258,7 +258,7 @@ static void vnt_submit_rx_urb_complete(struct urb *urb)
 	if (usb_submit_urb(urb, GFP_ATOMIC)) {
 		dev_dbg(&priv->usb->dev, "Failed to re submit rx skb\n");
 
-		rcb->bBoolInUse = false;
+		rcb->in_use = false;
 	}
 
 	return;
Signature · 1 line
2.0.1
#4 lore raw

PATCH 5/9 staging: vt6656: remove dead structure struct vnt_tx_pkt_info

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h | 7 -------
 1 file changed, 7 deletions(-)
drivers/staging/vt6656/device.h +0 -7
index 8f318a9..f3ff6f5 100644
@@ -240,12 +240,6 @@ struct vnt_usb_send_context {
 	unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
 };
 
-/* tx packet info for rxtx */
-struct vnt_tx_pkt_info {
-	u16 fifo_ctl;
-	u8 dest_addr[ETH_ALEN];
-};
-
 /*
  * Structure to keep track of USB interrupt packets
  */
@@ -300,7 +294,6 @@ struct vnt_private {
 	/* Variables to track resources for the BULK Out Pipe */
 	struct vnt_usb_send_context *apTD[CB_MAX_TX_DESC];
 	u32 cbTD;
-	struct vnt_tx_pkt_info pkt_info[16];
 
 	/* Variables to track resources for the Interrupt In Pipe */
 	struct vnt_interrupt_buffer int_buf;
Signature · 1 line
2.0.1
#5 lore raw

PATCH 6/9 staging: vt6656: struct vnt_private remove dead variables

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/vt6656/device.h +0 -9
index f3ff6f5..8257a64 100644
@@ -381,8 +381,6 @@ struct vnt_private {
 
 	enum vnt_cmd command;
 
-	int bStopDataPkt;
-
 	/* 802.11 counter */
 
 	enum vnt_cmd cmd_queue[CMD_Q_SIZE];
@@ -396,22 +394,15 @@ struct vnt_private {
 	u8 byAutoFBCtrl;
 
 	/* For Update BaseBand VGA Gain Offset */
-	u32 uBBVGADiffCount;
-	u8 byBBVGANew;
-	u8 byBBVGACurrent;
 	u8 abyBBVGA[BB_VGA_LEVEL];
 	signed long ldBmThreshold[BB_VGA_LEVEL];
 
 	u8 byBBPreEDRSSI;
 	u8 byBBPreEDIndex;
 
-	int bRadioCmd;
-
 	/* command timer */
 	struct delayed_work run_command_work;
 
-	u8 tx_data_time_out;
-
 	int bChannelSwitch;
 	u8 byNewChannel;
 	u8 byChannelSwitchCount;
Signature · 1 line
2.0.1
#6 lore raw

PATCH 7/9 staging: vt6656: struct vnt_private pInterruptURB rename to interrupt_urb

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   |  2 +-
 drivers/staging/vt6656/main_usb.c | 14 +++++++-------
 drivers/staging/vt6656/usbpipe.c  |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/vt6656/device.h +1 -1
index 8257a64..22554af 100644
@@ -284,7 +284,7 @@ struct vnt_private {
 	unsigned long Flags;
 
 	/* USB */
-	struct urb *pInterruptURB;
+	struct urb *interrupt_urb;
 	u32 int_interval;
 
 	/* Variables to track resources for the BULK In Pipe */
drivers/staging/vt6656/main_usb.c +7 -7
index be498bc..fe2f0bc 100644
@@ -517,8 +517,8 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 			goto free_rx_tx;
 	}
 
-	priv->pInterruptURB = usb_alloc_urb(0, GFP_ATOMIC);
-	if (priv->pInterruptURB == NULL) {
+	priv->interrupt_urb = usb_alloc_urb(0, GFP_ATOMIC);
+	if (priv->interrupt_urb == NULL) {
 		dev_err(&priv->usb->dev, "Failed to alloc int urb\n");
 		goto free_rx_tx;
 	}
@@ -526,7 +526,7 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 	priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL);
 	if (priv->int_buf.data_buf == NULL) {
 		dev_err(&priv->usb->dev, "Failed to alloc int buf\n");
-		usb_free_urb(priv->pInterruptURB);
+		usb_free_urb(priv->interrupt_urb);
 		goto free_rx_tx;
 	}
 
@@ -590,8 +590,8 @@ free_all:
 	device_free_tx_bufs(priv);
 	device_free_int_bufs(priv);
 
-	usb_kill_urb(priv->pInterruptURB);
-	usb_free_urb(priv->pInterruptURB);
+	usb_kill_urb(priv->interrupt_urb);
+	usb_free_urb(priv->interrupt_urb);
 
 	return -ENOMEM;
 }
@@ -629,8 +629,8 @@ static void vnt_stop(struct ieee80211_hw *hw)
 	device_free_rx_bufs(priv);
 	device_free_int_bufs(priv);
 
-	usb_kill_urb(priv->pInterruptURB);
-	usb_free_urb(priv->pInterruptURB);
+	usb_kill_urb(priv->interrupt_urb);
+	usb_free_urb(priv->interrupt_urb);
 
 	return;
 }
drivers/staging/vt6656/usbpipe.c +3 -3
index 126294d..9a88749 100644
@@ -126,7 +126,7 @@ int vnt_start_interrupt_urb(struct vnt_private *priv)
 
 	priv->int_buf.in_use = true;
 
-	usb_fill_int_urb(priv->pInterruptURB,
+	usb_fill_int_urb(priv->interrupt_urb,
 		priv->usb,
 		usb_rcvintpipe(priv->usb, 1),
 		priv->int_buf.data_buf,
@@ -135,7 +135,7 @@ int vnt_start_interrupt_urb(struct vnt_private *priv)
 		priv,
 		priv->int_interval);
 
-	status = usb_submit_urb(priv->pInterruptURB, GFP_ATOMIC);
+	status = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC);
 	if (status) {
 		dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status);
 		priv->int_buf.in_use = false;
@@ -172,7 +172,7 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb)
 		vnt_int_process_data(priv);
 	}
 
-	status = usb_submit_urb(priv->pInterruptURB, GFP_ATOMIC);
+	status = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC);
 	if (status) {
 		dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status);
 	} else {
Signature · 1 line
2.0.1
#7 lore raw

PATCH 8/9 staging: vt6656: struct vnt_private rename apRCB to rcb

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   | 2 +-
 drivers/staging/vt6656/main_usb.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vt6656/device.h +1 -1
index 22554af..a5a6c39 100644
@@ -288,7 +288,7 @@ struct vnt_private {
 	u32 int_interval;
 
 	/* Variables to track resources for the BULK In Pipe */
-	struct vnt_rcb *apRCB[CB_MAX_RX_DESC];
+	struct vnt_rcb *rcb[CB_MAX_RX_DESC];
 	u32 cbRD;
 
 	/* Variables to track resources for the BULK Out Pipe */
drivers/staging/vt6656/main_usb.c +4 -4
index fe2f0bc..5c8ff98 100644
@@ -418,7 +418,7 @@ static void device_free_rx_bufs(struct vnt_private *priv)
 	int ii;
 
 	for (ii = 0; ii < priv->cbRD; ii++) {
-		rcb = priv->apRCB[ii];
+		rcb = priv->rcb[ii];
 		if (!rcb)
 			continue;
 
@@ -486,14 +486,14 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 	}
 
 	for (ii = 0; ii < priv->cbRD; ii++) {
-		priv->apRCB[ii] = kzalloc(sizeof(struct vnt_rcb), GFP_KERNEL);
-		if (!priv->apRCB[ii]) {
+		priv->rcb[ii] = kzalloc(sizeof(struct vnt_rcb), GFP_KERNEL);
+		if (!priv->rcb[ii]) {
 			dev_err(&priv->usb->dev,
 					"failed to allocate rcb no %d\n", ii);
 			goto free_rx_tx;
 		}
 
-		rcb = priv->apRCB[ii];
+		rcb = priv->rcb[ii];
 
 		rcb->priv = priv;
 
Signature · 1 line
2.0.1
#8 lore raw

PATCH 9/9 staging: vt6656: struct vnt_private rename apTD to tx_context

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   | 2 +-
 drivers/staging/vt6656/int.c      | 2 +-
 drivers/staging/vt6656/main_usb.c | 4 ++--
 drivers/staging/vt6656/rxtx.c     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/vt6656/device.h +1 -1
index a5a6c39..757d500 100644
@@ -292,7 +292,7 @@ struct vnt_private {
 	u32 cbRD;
 
 	/* Variables to track resources for the BULK Out Pipe */
-	struct vnt_usb_send_context *apTD[CB_MAX_TX_DESC];
+	struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC];
 	u32 cbTD;
 
 	/* Variables to track resources for the Interrupt In Pipe */
drivers/staging/vt6656/int.c +1 -1
index 87ac6a1..e404d9e 100644
@@ -78,7 +78,7 @@ static int vnt_int_report_rate(struct vnt_private *priv, u8 pkt_no, u8 tsr)
 	if (pkt_no >= priv->cbTD)
 		return -EINVAL;
 
-	context = priv->apTD[pkt_no];
+	context = priv->tx_context[pkt_no];
 
 	if (!context->skb)
 		return -EINVAL;
drivers/staging/vt6656/main_usb.c +2 -2
index 5c8ff98..ff4e18d 100644
@@ -399,7 +399,7 @@ static void device_free_tx_bufs(struct vnt_private *priv)
 	int ii;
 
 	for (ii = 0; ii < priv->cbTD; ii++) {
-		tx_context = priv->apTD[ii];
+		tx_context = priv->tx_context[ii];
 		/* deallocate URBs */
 		if (tx_context->urb) {
 			usb_kill_urb(tx_context->urb);
@@ -471,7 +471,7 @@ static bool device_alloc_bufs(struct vnt_private *priv)
 			goto free_tx;
 		}
 
-		priv->apTD[ii] = tx_context;
+		priv->tx_context[ii] = tx_context;
 		tx_context->priv = priv;
 		tx_context->pkt_no = ii;
 
drivers/staging/vt6656/rxtx.c +2 -2
index 76b7f17..f3bbfba 100644
@@ -82,10 +82,10 @@ static struct vnt_usb_send_context
 	dev_dbg(&priv->usb->dev, "%s\n", __func__);
 
 	for (ii = 0; ii < priv->cbTD; ii++) {
-		if (!priv->apTD[ii])
+		if (!priv->tx_context[ii])
 			return NULL;
 
-		context = priv->apTD[ii];
+		context = priv->tx_context[ii];
 		if (context->in_use == false) {
 			context->in_use = true;
 			memset(context->data, 0,
Signature · 1 line
2.0.1