Skip to contentSkip to conversation

staging: vt6656: s_uGetRTSCTSDuration remove camel case

PATCH New Malcolm Priestley 1 participant 13 messages Jul 11, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/13 staging: vt6656: s_uGetRTSCTSDuration remove camel case

camel case changes
pDevice -> priv
byDurType -> dur_type
cbFrameLength -> frame_length
byPktType -> pkt_type
wRate -> rate
bNeedAck -> need_ack
uCTSTime -> cts_time
uDurTime -> dur_time

---
 drivers/staging/vt6656/rxtx.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/staging/vt6656/rxtx.c +20 -20
index f8c2323..0e853c1 100644
@@ -92,9 +92,9 @@ static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
 static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
 	u8 byPktType, int bNeedAck);
 
-static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
-	u8 byDurType, u32 cbFrameLength, u8 byPktType, u16 wRate,
-	int bNeedAck);
+static __le16 s_uGetRTSCTSDuration(struct vnt_private *priv,
+	u8 dur_type, u32 frame_length, u8 pkt_type, u16 rate,
+	int need_ack);
 
 static struct vnt_usb_send_context
 	*s_vGetFreeContext(struct vnt_private *priv)
@@ -229,45 +229,45 @@ static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
 }
 
 //byFreqType: 0=>5GHZ 1=>2.4GHZ
-static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice, u8 byDurType,
-	u32 cbFrameLength, u8 byPktType, u16 wRate, int bNeedAck)
+static __le16 s_uGetRTSCTSDuration(struct vnt_private *priv, u8 dur_type,
+	u32 frame_length, u8 pkt_type, u16 rate, int need_ack)
 {
-	u32 uCTSTime = 0, uDurTime = 0;
+	u32 cts_time = 0, dur_time = 0;
 
-	switch (byDurType) {
+	switch (dur_type) {
 	case RTSDUR_BB:
 	case RTSDUR_BA:
 	case RTSDUR_BA_F0:
 	case RTSDUR_BA_F1:
-		uCTSTime = vnt_get_frame_time(pDevice->byPreambleType,
-				byPktType, 14, pDevice->byTopCCKBasicRate);
-		uDurTime = uCTSTime + 2 * pDevice->uSIFS +
-			s_uGetTxRsvTime(pDevice, byPktType,
-						cbFrameLength, wRate, bNeedAck);
+		cts_time = vnt_get_frame_time(priv->byPreambleType,
+				pkt_type, 14, priv->byTopCCKBasicRate);
+		dur_time = cts_time + 2 * priv->uSIFS +
+			s_uGetTxRsvTime(priv, pkt_type,
+						frame_length, rate, need_ack);
 		break;
 
 	case RTSDUR_AA:
 	case RTSDUR_AA_F0:
 	case RTSDUR_AA_F1:
-		uCTSTime = vnt_get_frame_time(pDevice->byPreambleType,
-				byPktType, 14, pDevice->byTopOFDMBasicRate);
-		uDurTime = uCTSTime + 2 * pDevice->uSIFS +
-			s_uGetTxRsvTime(pDevice, byPktType,
-						cbFrameLength, wRate, bNeedAck);
+		cts_time = vnt_get_frame_time(priv->byPreambleType,
+				pkt_type, 14, priv->byTopOFDMBasicRate);
+		dur_time = cts_time + 2 * priv->uSIFS +
+			s_uGetTxRsvTime(priv, pkt_type,
+						frame_length, rate, need_ack);
 		break;
 
 	case CTSDUR_BA:
 	case CTSDUR_BA_F0:
 	case CTSDUR_BA_F1:
-		uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice,
-				byPktType, cbFrameLength, wRate, bNeedAck);
+		dur_time = priv->uSIFS + s_uGetTxRsvTime(priv,
+				pkt_type, frame_length, rate, need_ack);
 		break;
 
 	default:
 		break;
 	}
 
-	return cpu_to_le16((u16)uDurTime);
+	return cpu_to_le16((u16)dur_time);
 }
 
 static u16 vnt_mac_hdr_pos(struct vnt_usb_send_context *tx_context,
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/13 staging: vt6656: rxtx rename s_uGetRTSCTSDuration to vnt_get_rtscts_duration_le

Function always returns little endian value.

---
 drivers/staging/vt6656/rxtx.c | 54 +++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)
drivers/staging/vt6656/rxtx.c +27 -27
index 0e853c1..c994c08 100644
@@ -30,7 +30,7 @@
  *      csMgmt_xmit - management tx function
  *      s_uGetDataDuration - get tx data required duration
  *      s_uFillDataHead- fulfill tx data duration header
- *      s_uGetRTSCTSDuration- get rtx/cts required duration
+ *      vnt_get_rtscts_duration_le- get rtx/cts required duration
  *      s_uGetRTSCTSRsvTime- get rts/cts reserved time
  *      s_uGetTxRsvTime- get frame reserved time
  *      vnt_fill_cts_head- fulfill CTS ctl header
@@ -92,7 +92,7 @@ static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
 static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
 	u8 byPktType, int bNeedAck);
 
-static __le16 s_uGetRTSCTSDuration(struct vnt_private *priv,
+static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv,
 	u8 dur_type, u32 frame_length, u8 pkt_type, u16 rate,
 	int need_ack);
 
@@ -229,7 +229,7 @@ static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
 }
 
 //byFreqType: 0=>5GHZ 1=>2.4GHZ
-static __le16 s_uGetRTSCTSDuration(struct vnt_private *priv, u8 dur_type,
+static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv, u8 dur_type,
 	u32 frame_length, u8 pkt_type, u16 rate, int need_ack)
 {
 	u32 cts_time = 0, dur_time = 0;
@@ -422,12 +422,12 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
 	vnt_get_phy_field(priv, rts_frame_len,
 		priv->byTopOFDMBasicRate, pkt_type, &buf->a);
 
-	buf->duration_bb = s_uGetRTSCTSDuration(priv, RTSDUR_BB, frame_len,
-		PK_TYPE_11B, priv->byTopCCKBasicRate, need_ack);
-	buf->duration_aa = s_uGetRTSCTSDuration(priv, RTSDUR_AA, frame_len,
-		pkt_type, current_rate, need_ack);
-	buf->duration_ba = s_uGetRTSCTSDuration(priv, RTSDUR_BA, frame_len,
-		pkt_type, current_rate, need_ack);
+	buf->duration_bb = vnt_get_rtscts_duration_le(priv, RTSDUR_BB,
+		frame_len, PK_TYPE_11B, priv->byTopCCKBasicRate, need_ack);
+	buf->duration_aa = vnt_get_rtscts_duration_le(priv, RTSDUR_AA,
+		frame_len, pkt_type, current_rate, need_ack);
+	buf->duration_ba = vnt_get_rtscts_duration_le(priv, RTSDUR_BA,
+		frame_len, pkt_type, current_rate, need_ack);
 
 	vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
 
@@ -448,21 +448,21 @@ static u16 vnt_rxtx_rts_g_fb_head(struct vnt_usb_send_context *tx_context,
 		priv->byTopOFDMBasicRate, pkt_type, &buf->a);
 
 
-	buf->duration_bb = s_uGetRTSCTSDuration(priv, RTSDUR_BB, frame_len,
-		PK_TYPE_11B, priv->byTopCCKBasicRate, need_ack);
-	buf->duration_aa = s_uGetRTSCTSDuration(priv, RTSDUR_AA, frame_len,
-		pkt_type, current_rate, need_ack);
-	buf->duration_ba = s_uGetRTSCTSDuration(priv, RTSDUR_BA, frame_len,
-		pkt_type, current_rate, need_ack);
+	buf->duration_bb = vnt_get_rtscts_duration_le(priv, RTSDUR_BB,
+		frame_len, PK_TYPE_11B, priv->byTopCCKBasicRate, need_ack);
+	buf->duration_aa = vnt_get_rtscts_duration_le(priv, RTSDUR_AA,
+		frame_len, pkt_type, current_rate, need_ack);
+	buf->duration_ba = vnt_get_rtscts_duration_le(priv, RTSDUR_BA,
+		frame_len, pkt_type, current_rate, need_ack);
 
 
-	buf->rts_duration_ba_f0 = s_uGetRTSCTSDuration(priv, RTSDUR_BA_F0,
+	buf->rts_duration_ba_f0 = vnt_get_rtscts_duration_le(priv, RTSDUR_BA_F0,
 		frame_len, pkt_type, priv->tx_rate_fb0, need_ack);
-	buf->rts_duration_aa_f0 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F0,
+	buf->rts_duration_aa_f0 = vnt_get_rtscts_duration_le(priv, RTSDUR_AA_F0,
 		frame_len, pkt_type, priv->tx_rate_fb0, need_ack);
-	buf->rts_duration_ba_f1 = s_uGetRTSCTSDuration(priv, RTSDUR_BA_F1,
+	buf->rts_duration_ba_f1 = vnt_get_rtscts_duration_le(priv, RTSDUR_BA_F1,
 		frame_len, pkt_type, priv->tx_rate_fb1, need_ack);
-	buf->rts_duration_aa_f1 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F1,
+	buf->rts_duration_aa_f1 = vnt_get_rtscts_duration_le(priv, RTSDUR_AA_F1,
 		frame_len, pkt_type, priv->tx_rate_fb1, need_ack);
 
 	vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
@@ -481,7 +481,7 @@ static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
 	vnt_get_phy_field(priv, rts_frame_len,
 		priv->byTopOFDMBasicRate, pkt_type, &buf->ab);
 
-	buf->duration = s_uGetRTSCTSDuration(priv, RTSDUR_AA, frame_len,
+	buf->duration = vnt_get_rtscts_duration_le(priv, RTSDUR_AA, frame_len,
 		pkt_type, current_rate, need_ack);
 
 	vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
@@ -500,13 +500,13 @@ static u16 vnt_rxtx_rts_a_fb_head(struct vnt_usb_send_context *tx_context,
 	vnt_get_phy_field(priv, rts_frame_len,
 		priv->byTopOFDMBasicRate, pkt_type, &buf->a);
 
-	buf->duration = s_uGetRTSCTSDuration(priv, RTSDUR_AA, frame_len,
+	buf->duration = vnt_get_rtscts_duration_le(priv, RTSDUR_AA, frame_len,
 		pkt_type, current_rate, need_ack);
 
-	buf->rts_duration_f0 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F0,
+	buf->rts_duration_f0 = vnt_get_rtscts_duration_le(priv, RTSDUR_AA_F0,
 		frame_len, pkt_type, priv->tx_rate_fb0, need_ack);
 
-	buf->rts_duration_f1 = s_uGetRTSCTSDuration(priv, RTSDUR_AA_F1,
+	buf->rts_duration_f1 = vnt_get_rtscts_duration_le(priv, RTSDUR_AA_F1,
 		frame_len, pkt_type, priv->tx_rate_fb1, need_ack);
 
 	vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
@@ -531,15 +531,15 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
 		/* Get SignalField,ServiceField,Length */
 		vnt_get_phy_field(priv, cts_frame_len,
 			priv->byTopCCKBasicRate, PK_TYPE_11B, &buf->b);
-		buf->duration_ba = s_uGetRTSCTSDuration(priv, CTSDUR_BA,
+		buf->duration_ba = vnt_get_rtscts_duration_le(priv, CTSDUR_BA,
 			frame_len, pkt_type,
 			current_rate, need_ack);
 		/* Get CTSDuration_ba_f0 */
-		buf->cts_duration_ba_f0 = s_uGetRTSCTSDuration(priv,
+		buf->cts_duration_ba_f0 = vnt_get_rtscts_duration_le(priv,
 			CTSDUR_BA_F0, frame_len, pkt_type,
 			priv->tx_rate_fb0, need_ack);
 		/* Get CTSDuration_ba_f1 */
-		buf->cts_duration_ba_f1 = s_uGetRTSCTSDuration(priv,
+		buf->cts_duration_ba_f1 = vnt_get_rtscts_duration_le(priv,
 			CTSDUR_BA_F1, frame_len, pkt_type,
 			priv->tx_rate_fb1, need_ack);
 		/* Get CTS Frame body */
@@ -558,7 +558,7 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
 		vnt_get_phy_field(priv, cts_frame_len,
 			priv->byTopCCKBasicRate, PK_TYPE_11B, &buf->b);
 		/* Get CTSDuration_ba */
-		buf->duration_ba = s_uGetRTSCTSDuration(priv,
+		buf->duration_ba = vnt_get_rtscts_duration_le(priv,
 			CTSDUR_BA, frame_len, pkt_type,
 			current_rate, need_ack);
 		/*Get CTS Frame body*/
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/13 staging: vt6656: s_uGetDataDuration remove camel case

In reply to Malcolm Priestley

camel case changes
pDevice -> priv
byPktType -> pkt_type
bNeedAck -> need_ack
uAckTime -> ack_time

---
 drivers/staging/vt6656/rxtx.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/staging/vt6656/rxtx.c +11 -10
index c994c08..a89f7fd 100644
@@ -210,19 +210,20 @@ static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
 }
 
 //byFreqType 0: 5GHz, 1:2.4Ghz
-static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
-					u8 byPktType, int bNeedAck)
+static __le16 s_uGetDataDuration(struct vnt_private *piv,
+					u8 pkt_type, int need_ack)
 {
-	u32 uAckTime = 0;
+	u32 ack_time = 0;
 
-	if (bNeedAck) {
-		if (byPktType == PK_TYPE_11B)
-			uAckTime = vnt_get_frame_time(pDevice->byPreambleType,
-				byPktType, 14, pDevice->byTopCCKBasicRate);
+	if (need_ack) {
+		if (pkt_type == PK_TYPE_11B)
+			ack_time = vnt_get_frame_time(piv->byPreambleType,
+				pkt_type, 14, piv->byTopCCKBasicRate);
 		else
-			uAckTime = vnt_get_frame_time(pDevice->byPreambleType,
-				byPktType, 14, pDevice->byTopOFDMBasicRate);
-		return cpu_to_le16((u16)(pDevice->uSIFS + uAckTime));
+			ack_time = vnt_get_frame_time(piv->byPreambleType,
+				pkt_type, 14, piv->byTopOFDMBasicRate);
+
+		return cpu_to_le16((u16)(piv->uSIFS + ack_time));
 	}
 
 	return 0;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/13 staging: vt6656: rename s_uGetDataDuration to vnt_get_duration_le

In reply to Malcolm Priestley

Drop data and the function always returns little endian

---
 drivers/staging/vt6656/rxtx.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/vt6656/rxtx.c +15 -15
index a89f7fd..3c92360 100644
@@ -28,7 +28,7 @@
  *      vnt_generate_tx_parameter - Generate tx dma required parameter.
  *      csBeacon_xmit - beacon tx function
  *      csMgmt_xmit - management tx function
- *      s_uGetDataDuration - get tx data required duration
+ *      vnt_get_duration_le - get tx data required duration
  *      s_uFillDataHead- fulfill tx data duration header
  *      vnt_get_rtscts_duration_le- get rtx/cts required duration
  *      s_uGetRTSCTSRsvTime- get rts/cts reserved time
@@ -89,7 +89,7 @@ static unsigned int s_uGetTxRsvTime(struct vnt_private *pDevice, u8 byPktType,
 static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
 	u8 rsv_type, u8 pkt_type, u32 frame_length, u16 current_rate);
 
-static __le16 s_uGetDataDuration(struct vnt_private *pDevice,
+static __le16 vnt_get_duration_le(struct vnt_private *pDevice,
 	u8 byPktType, int bNeedAck);
 
 static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv,
@@ -210,7 +210,7 @@ static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
 }
 
 //byFreqType 0: 5GHz, 1:2.4Ghz
-static __le16 s_uGetDataDuration(struct vnt_private *piv,
+static __le16 vnt_get_duration_le(struct vnt_private *piv,
 					u8 pkt_type, int need_ack)
 {
 	u32 ack_time = 0;
@@ -305,8 +305,8 @@ static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
 		buf->duration_a = dur;
 		buf->duration_b = dur;
 	} else {
-		buf->duration_a = s_uGetDataDuration(priv, pkt_type, need_ack);
-		buf->duration_b = s_uGetDataDuration(priv,
+		buf->duration_a = vnt_get_duration_le(priv, pkt_type, need_ack);
+		buf->duration_b = vnt_get_duration_le(priv,
 							PK_TYPE_11B, need_ack);
 	}
 
@@ -332,11 +332,11 @@ static u16 vnt_rxtx_datahead_g_fb(struct vnt_usb_send_context *tx_context,
 						PK_TYPE_11B, &buf->b);
 
 	/* Get Duration and TimeStamp */
-	buf->duration_a = s_uGetDataDuration(priv, pkt_type, need_ack);
-	buf->duration_b = s_uGetDataDuration(priv, PK_TYPE_11B, need_ack);
+	buf->duration_a = vnt_get_duration_le(priv, pkt_type, need_ack);
+	buf->duration_b = vnt_get_duration_le(priv, PK_TYPE_11B, need_ack);
 
-	buf->duration_a_f0 = s_uGetDataDuration(priv, pkt_type, need_ack);
-	buf->duration_a_f1 = s_uGetDataDuration(priv, pkt_type, need_ack);
+	buf->duration_a_f0 = vnt_get_duration_le(priv, pkt_type, need_ack);
+	buf->duration_a_f1 = vnt_get_duration_le(priv, pkt_type, need_ack);
 
 	buf->time_stamp_off_a = vnt_time_stamp_off(priv, rate);
 	buf->time_stamp_off_b = vnt_time_stamp_off(priv,
@@ -356,10 +356,10 @@ static u16 vnt_rxtx_datahead_a_fb(struct vnt_usb_send_context *tx_context,
 	/* Get SignalField,ServiceField,Length */
 	vnt_get_phy_field(priv, frame_len, rate, pkt_type, &buf->a);
 	/* Get Duration and TimeStampOff */
-	buf->duration = s_uGetDataDuration(priv, pkt_type, need_ack);
+	buf->duration = vnt_get_duration_le(priv, pkt_type, need_ack);
 
-	buf->duration_f0 = s_uGetDataDuration(priv, pkt_type, need_ack);
-	buf->duration_f1 = s_uGetDataDuration(priv, pkt_type, need_ack);
+	buf->duration_f0 = vnt_get_duration_le(priv, pkt_type, need_ack);
+	buf->duration_f1 = vnt_get_duration_le(priv, pkt_type, need_ack);
 
 	buf->time_stamp_off = vnt_time_stamp_off(priv, rate);
 
@@ -385,7 +385,7 @@ static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
 
 		buf->duration = dur;
 	} else {
-		buf->duration = s_uGetDataDuration(priv, pkt_type, need_ack);
+		buf->duration = vnt_get_duration_le(priv, pkt_type, need_ack);
 	}
 
 	buf->time_stamp_off = vnt_time_stamp_off(priv, rate);
@@ -1027,7 +1027,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv,
 			PK_TYPE_11A, &short_head->ab);
 
 		/* Get Duration and TimeStampOff */
-		short_head->duration = s_uGetDataDuration(priv,
+		short_head->duration = vnt_get_duration_le(priv,
 							PK_TYPE_11A, false);
 		short_head->time_stamp_off =
 				vnt_time_stamp_off(priv, current_rate);
@@ -1040,7 +1040,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv,
 					PK_TYPE_11B, &short_head->ab);
 
 		/* Get Duration and TimeStampOff */
-		short_head->duration = s_uGetDataDuration(priv,
+		short_head->duration = vnt_get_duration_le(priv,
 						PK_TYPE_11B, false);
 		short_head->time_stamp_off =
 			vnt_time_stamp_off(priv, current_rate);
Signature · 1 line
1.9.1
#4 lore raw

PATCH 5/13 staging: vt6656: rename s_uGetRTSCTSRsvTime to vnt_get_rtscts_rsvtime_le

In reply to Malcolm Priestley

Function always returns little endian.

---
 drivers/staging/vt6656/rxtx.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/vt6656/rxtx.c +9 -9
index 3c92360..ceaaca0 100644
@@ -31,7 +31,7 @@
  *      vnt_get_duration_le - get tx data required duration
  *      s_uFillDataHead- fulfill tx data duration header
  *      vnt_get_rtscts_duration_le- get rtx/cts required duration
- *      s_uGetRTSCTSRsvTime- get rts/cts reserved time
+ *      vnt_get_rtscts_rsvtime_le- get rts/cts reserved time
  *      s_uGetTxRsvTime- get frame reserved time
  *      vnt_fill_cts_head- fulfill CTS ctl header
  *      s_vFillFragParameter- Set fragment ctl parameter.
@@ -86,7 +86,7 @@ static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *);
 static unsigned int s_uGetTxRsvTime(struct vnt_private *pDevice, u8 byPktType,
 	u32 cbFrameLength, u16 wRate, int bNeedAck);
 
-static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
+static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
 	u8 rsv_type, u8 pkt_type, u32 frame_length, u16 current_rate);
 
 static __le16 vnt_get_duration_le(struct vnt_private *pDevice,
@@ -166,7 +166,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 }
 
 //byFreqType: 0=>5GHZ 1=>2.4GHZ
-static __le16 s_uGetRTSCTSRsvTime(struct vnt_private *priv,
+static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
 	u8 rsv_type, u8 pkt_type, u32 frame_length, u16 current_rate)
 {
 	u32 rrv_time, rts_time, cts_time, ack_time, data_time;
@@ -584,11 +584,11 @@ static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
 	struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts;
 	union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
 
-	buf->rts_rrv_time_aa = s_uGetRTSCTSRsvTime(priv, 2,
+	buf->rts_rrv_time_aa = vnt_get_rtscts_rsvtime_le(priv, 2,
 				pkt_type, frame_size, current_rate);
-	buf->rts_rrv_time_ba = s_uGetRTSCTSRsvTime(priv, 1,
+	buf->rts_rrv_time_ba = vnt_get_rtscts_rsvtime_le(priv, 1,
 				pkt_type, frame_size, current_rate);
-	buf->rts_rrv_time_bb = s_uGetRTSCTSRsvTime(priv, 0,
+	buf->rts_rrv_time_bb = vnt_get_rtscts_rsvtime_le(priv, 0,
 				pkt_type, frame_size, current_rate);
 
 	buf->rrv_time_a = vnt_rxtx_rsvtime_le16(priv, pkt_type, frame_size,
@@ -621,7 +621,7 @@ static u16 vnt_rxtx_cts(struct vnt_usb_send_context *tx_context,
 	buf->rrv_time_b = vnt_rxtx_rsvtime_le16(priv, PK_TYPE_11B,
 				frame_size, priv->byTopCCKBasicRate, need_ack);
 
-	buf->cts_rrv_time_ba = s_uGetRTSCTSRsvTime(priv, 3,
+	buf->cts_rrv_time_ba = vnt_get_rtscts_rsvtime_le(priv, 3,
 			pkt_type, frame_size, current_rate);
 
 	if (need_mic)
@@ -648,10 +648,10 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,
 
 	if (need_rts) {
 		if (pkt_type == PK_TYPE_11B)
-			buf->rts_rrv_time = s_uGetRTSCTSRsvTime(priv, 0,
+			buf->rts_rrv_time = vnt_get_rtscts_rsvtime_le(priv, 0,
 				pkt_type, frame_size, current_rate);
 		else /* PK_TYPE_11A */
-			buf->rts_rrv_time = s_uGetRTSCTSRsvTime(priv, 2,
+			buf->rts_rrv_time = vnt_get_rtscts_rsvtime_le(priv, 2,
 				pkt_type, frame_size, current_rate);
 
 		if (tx_context->fb_option && pkt_type == PK_TYPE_11A)
Signature · 1 line
1.9.1
#5 lore raw

PATCH 6/13 staging: vt6656: rename s_uGetTxRsvTime to vnt_get_rsvtime

In reply to Malcolm Priestley

Drop tx from name

---
 drivers/staging/vt6656/rxtx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/vt6656/rxtx.c +7 -7
index ceaaca0..5084434 100644
@@ -32,7 +32,7 @@
  *      s_uFillDataHead- fulfill tx data duration header
  *      vnt_get_rtscts_duration_le- get rtx/cts required duration
  *      vnt_get_rtscts_rsvtime_le- get rts/cts reserved time
- *      s_uGetTxRsvTime- get frame reserved time
+ *      vnt_get_rsvtime- get frame reserved time
  *      vnt_fill_cts_head- fulfill CTS ctl header
  *      s_vFillFragParameter- Set fragment ctl parameter.
  *      s_vFillRTSHead- fulfill RTS ctl header
@@ -83,7 +83,7 @@ static const u16 wFB_Opt1[2][5] = {
 
 static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *);
 
-static unsigned int s_uGetTxRsvTime(struct vnt_private *pDevice, u8 byPktType,
+static unsigned int vnt_get_rsvtime(struct vnt_private *pDevice, u8 byPktType,
 	u32 cbFrameLength, u16 wRate, int bNeedAck);
 
 static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
@@ -137,7 +137,7 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
              PK_TYPE_11GB    2
              PK_TYPE_11GA    3
 */
-static u32 s_uGetTxRsvTime(struct vnt_private *priv, u8 pkt_type,
+static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type,
 	u32 frame_length, u16 rate, int need_ack)
 {
 	u32 data_time, ack_time;
@@ -161,7 +161,7 @@ static u32 s_uGetTxRsvTime(struct vnt_private *priv, u8 pkt_type,
 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 	u32 frame_length, u16 rate, int need_ack)
 {
-	return cpu_to_le16((u16)s_uGetTxRsvTime(priv, pkt_type,
+	return cpu_to_le16((u16)vnt_get_rsvtime(priv, pkt_type,
 		frame_length, rate, need_ack));
 }
 
@@ -243,7 +243,7 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv, u8 dur_type,
 		cts_time = vnt_get_frame_time(priv->byPreambleType,
 				pkt_type, 14, priv->byTopCCKBasicRate);
 		dur_time = cts_time + 2 * priv->uSIFS +
-			s_uGetTxRsvTime(priv, pkt_type,
+			vnt_get_rsvtime(priv, pkt_type,
 						frame_length, rate, need_ack);
 		break;
 
@@ -253,14 +253,14 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv, u8 dur_type,
 		cts_time = vnt_get_frame_time(priv->byPreambleType,
 				pkt_type, 14, priv->byTopOFDMBasicRate);
 		dur_time = cts_time + 2 * priv->uSIFS +
-			s_uGetTxRsvTime(priv, pkt_type,
+			vnt_get_rsvtime(priv, pkt_type,
 						frame_length, rate, need_ack);
 		break;
 
 	case CTSDUR_BA:
 	case CTSDUR_BA_F0:
 	case CTSDUR_BA_F1:
-		dur_time = priv->uSIFS + s_uGetTxRsvTime(priv,
+		dur_time = priv->uSIFS + vnt_get_rsvtime(priv,
 				pkt_type, frame_length, rate, need_ack);
 		break;
 
Signature · 1 line
1.9.1
#6 lore raw

PATCH 7/13 staging: vt6656: rename and cleanup wTimeStampOff

In reply to Malcolm Priestley

Rename to vnt_time_stampoff

---
 drivers/staging/vt6656/rxtx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vt6656/rxtx.c +5 -5
index 5084434..7faef28 100644
@@ -52,10 +52,10 @@
 
 static int          msglevel                = MSG_LEVEL_INFO;
 
-static const u16 wTimeStampOff[2][MAX_RATE] = {
-        {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, // Long Preamble
-        {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, // Short Preamble
-    };
+static const u16 vnt_time_stampoff[2][MAX_RATE] = {
+	{384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23},/* Long Preamble */
+	{384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},/* Short Preamble */
+};
 
 static const u16 wFB_Opt0[2][5] = {
         {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, // fallback_rate0
@@ -128,7 +128,7 @@ static struct vnt_usb_send_context
 
 static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
 {
-	return cpu_to_le16(wTimeStampOff[priv->byPreambleType % 2]
+	return cpu_to_le16(vnt_time_stampoff[priv->byPreambleType % 2]
 							[rate % MAX_RATE]);
 }
 
Signature · 1 line
1.9.1
#7 lore raw

PATCH 8/13 staging: vt6656: clean up and rename wFB_Opt0 to vnt_fb_opt0

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/rxtx.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/staging/vt6656/rxtx.c +7 -6
index 7faef28..6ca2638 100644
@@ -57,10 +57,11 @@ static const u16 vnt_time_stampoff[2][MAX_RATE] = {
 	{384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},/* Short Preamble */
 };
 
-static const u16 wFB_Opt0[2][5] = {
-        {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, // fallback_rate0
-        {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, // fallback_rate1
-    };
+static const u16 vnt_fb_opt0[2][5] = {
+	{RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */
+	{RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
+};
+
 static const u16 wFB_Opt1[2][5] = {
         {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, // fallback_rate0
         {RATE_6M , RATE_6M,  RATE_12M, RATE_12M, RATE_18M}, // fallback_rate1
@@ -923,9 +924,9 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 			tx_buffer_head->wFIFOCtl |= FIFOCTL_AUTO_FB_0;
 
 			priv->tx_rate_fb0 =
-				wFB_Opt0[FB_RATE0][current_rate - RATE_18M];
+				vnt_fb_opt0[FB_RATE0][current_rate - RATE_18M];
 			priv->tx_rate_fb1 =
-				wFB_Opt0[FB_RATE1][current_rate - RATE_18M];
+				vnt_fb_opt0[FB_RATE1][current_rate - RATE_18M];
 
 			fb_option = AUTO_FB_0;
 		} else if (priv->byAutoFBCtrl == AUTO_FB_1) {
Signature · 1 line
1.9.1
#8 lore raw

PATCH 9/13 staging: vt6656: clean up and rename wFB_Opt1 to vnt_fb_opt1

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/rxtx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/vt6656/rxtx.c +6 -6
index 6ca2638..582bc1f 100644
@@ -62,10 +62,10 @@ static const u16 vnt_fb_opt0[2][5] = {
 	{RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
 };
 
-static const u16 wFB_Opt1[2][5] = {
-        {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, // fallback_rate0
-        {RATE_6M , RATE_6M,  RATE_12M, RATE_12M, RATE_18M}, // fallback_rate1
-    };
+static const u16 vnt_fb_opt1[2][5] = {
+	{RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */
+	{RATE_6M , RATE_6M,  RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */
+};
 
 #define RTSDUR_BB       0
 #define RTSDUR_BA       1
@@ -933,9 +933,9 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 			tx_buffer_head->wFIFOCtl |= FIFOCTL_AUTO_FB_1;
 
 			priv->tx_rate_fb0 =
-				wFB_Opt1[FB_RATE0][current_rate - RATE_18M];
+				vnt_fb_opt1[FB_RATE0][current_rate - RATE_18M];
 			priv->tx_rate_fb1 =
-				wFB_Opt1[FB_RATE1][current_rate - RATE_18M];
+				vnt_fb_opt1[FB_RATE1][current_rate - RATE_18M];
 
 			fb_option = AUTO_FB_1;
 		}
Signature · 1 line
1.9.1
#9 lore raw

PATCH 10/13 staging: vt6656: rename s_vGetFreeContext to vnt_get_free_context

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/rxtx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/vt6656/rxtx.c +4 -4
index 582bc1f..bd96627 100644
@@ -82,7 +82,7 @@ static const u16 vnt_fb_opt1[2][5] = {
 #define DATADUR_A_F0    12
 #define DATADUR_A_F1    13
 
-static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *);
+static struct vnt_usb_send_context *vnt_get_free_context(struct vnt_private *);
 
 static unsigned int vnt_get_rsvtime(struct vnt_private *pDevice, u8 byPktType,
 	u32 cbFrameLength, u16 wRate, int bNeedAck);
@@ -98,7 +98,7 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv,
 	int need_ack);
 
 static struct vnt_usb_send_context
-	*s_vGetFreeContext(struct vnt_private *priv)
+	*vnt_get_free_context(struct vnt_private *priv)
 {
 	struct vnt_usb_send_context *context = NULL;
 	int ii;
@@ -831,7 +831,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	tx_context = s_vGetFreeContext(priv);
+	tx_context = vnt_get_free_context(priv);
 	if (!tx_context) {
 		dev_dbg(&priv->usb->dev, "%s No free context\n", __func__);
 		spin_unlock_irqrestore(&priv->lock, flags);
@@ -1006,7 +1006,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv,
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	context = s_vGetFreeContext(priv);
+	context = vnt_get_free_context(priv);
 	if (!context) {
 		dev_dbg(&priv->usb->dev, "%s No free context!\n", __func__);
 		spin_unlock_irqrestore(&priv->lock, flags);
Signature · 1 line
1.9.1
#10 lore raw

PATCH 11/13 staging: vt6656: rxtx remove static declarations

In reply to Malcolm Priestley

all functions are in visibility order.

---
 drivers/staging/vt6656/rxtx.c | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/staging/vt6656/rxtx.c +0 -15
index bd96627..733c86e 100644
@@ -82,21 +82,6 @@ static const u16 vnt_fb_opt1[2][5] = {
 #define DATADUR_A_F0    12
 #define DATADUR_A_F1    13
 
-static struct vnt_usb_send_context *vnt_get_free_context(struct vnt_private *);
-
-static unsigned int vnt_get_rsvtime(struct vnt_private *pDevice, u8 byPktType,
-	u32 cbFrameLength, u16 wRate, int bNeedAck);
-
-static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
-	u8 rsv_type, u8 pkt_type, u32 frame_length, u16 current_rate);
-
-static __le16 vnt_get_duration_le(struct vnt_private *pDevice,
-	u8 byPktType, int bNeedAck);
-
-static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv,
-	u8 dur_type, u32 frame_length, u8 pkt_type, u16 rate,
-	int need_ack);
-
 static struct vnt_usb_send_context
 	*vnt_get_free_context(struct vnt_private *priv)
 {
Signature · 1 line
1.9.1
#11 lore raw

PATCH 12/13 staging: vt6656: rxtx remove unneeded comments

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/rxtx.c | 37 -------------------------------------
 1 file changed, 37 deletions(-)
drivers/staging/vt6656/rxtx.c +0 -37
index 733c86e..35edf41 100644
@@ -26,18 +26,11 @@
  *
  * Functions:
  *      vnt_generate_tx_parameter - Generate tx dma required parameter.
- *      csBeacon_xmit - beacon tx function
- *      csMgmt_xmit - management tx function
  *      vnt_get_duration_le - get tx data required duration
- *      s_uFillDataHead- fulfill tx data duration header
  *      vnt_get_rtscts_duration_le- get rtx/cts required duration
  *      vnt_get_rtscts_rsvtime_le- get rts/cts reserved time
  *      vnt_get_rsvtime- get frame reserved time
  *      vnt_fill_cts_head- fulfill CTS ctl header
- *      s_vFillFragParameter- Set fragment ctl parameter.
- *      s_vFillRTSHead- fulfill RTS ctl header
- *      vDMA0_tx_80211- tx 802.11 frame via dma0
- *      vGenerateFIFOHeader- Generate tx FIFO ctl header
  *
  * Revision History:
  *
@@ -118,11 +111,6 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
 							[rate % MAX_RATE]);
 }
 
-/*byPktType : PK_TYPE_11A     0
-             PK_TYPE_11B     1
-             PK_TYPE_11GB    2
-             PK_TYPE_11GA    3
-*/
 static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type,
 	u32 frame_length, u16 rate, int need_ack)
 {
@@ -151,7 +139,6 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 		frame_length, rate, need_ack));
 }
 
-//byFreqType: 0=>5GHZ 1=>2.4GHZ
 static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
 	u8 rsv_type, u8 pkt_type, u32 frame_length, u16 current_rate)
 {
@@ -195,7 +182,6 @@ static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
 	return cpu_to_le16((u16)rrv_time);
 }
 
-//byFreqType 0: 5GHz, 1:2.4Ghz
 static __le16 vnt_get_duration_le(struct vnt_private *piv,
 					u8 pkt_type, int need_ack)
 {
@@ -215,7 +201,6 @@ static __le16 vnt_get_duration_le(struct vnt_private *piv,
 	return 0;
 }
 
-//byFreqType: 0=>5GHZ 1=>2.4GHZ
 static __le16 vnt_get_rtscts_duration_le(struct vnt_private *priv, u8 dur_type,
 	u32 frame_length, u8 pkt_type, u16 rate, int need_ack)
 {
@@ -658,28 +643,6 @@ static u16 vnt_rxtx_ab(struct vnt_usb_send_context *tx_context,
 				&head->data_head_ab, frame_size, need_ack);
 }
 
-/*+
- *
- * Description:
- *      Generate FIFO control for MAC & Baseband controller
- *
- * Parameters:
- *  In:
- *      pDevice         - Pointer to adpater
- *      pTxDataHead     - Transmit Data Buffer
- *      pTxBufHead      - pTxBufHead
- *      pvRrvTime        - pvRrvTime
- *      pvRTS            - RTS Buffer
- *      pCTS            - CTS Buffer
- *      cbFrameSize     - Transmit Data Length (Hdr+Payload+FCS)
- *      bNeedACK        - If need ACK
- *  Out:
- *      none
- *
- * Return Value: none
- *
--*/
-
 static u16 vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context,
 	u8 pkt_type, u16 current_rate, struct vnt_tx_buffer *tx_buffer,
 	struct vnt_mic_hdr **mic_hdr, u32 need_mic, u32 frame_size,
Signature · 1 line
1.9.1
#12 lore raw

PATCH 13/13 staging: vt6656: rxtx replace debug messages DBG_PRT

In reply to Malcolm Priestley

Replace with dev_dbg

---
 drivers/staging/vt6656/rxtx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/vt6656/rxtx.c +2 -4
index 35edf41..3dc6d07 100644
@@ -43,8 +43,6 @@
 #include "rf.h"
 #include "usbpipe.h"
 
-static int          msglevel                = MSG_LEVEL_INFO;
-
 static const u16 vnt_time_stampoff[2][MAX_RATE] = {
 	{384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23},/* Long Preamble */
 	{384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},/* Short Preamble */
@@ -81,7 +79,7 @@ static struct vnt_usb_send_context
 	struct vnt_usb_send_context *context = NULL;
 	int ii;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GetFreeContext()\n");
+	dev_dbg(&priv->usb->dev, "%s\n", __func__);
 
 	for (ii = 0; ii < priv->cbTD; ii++) {
 		if (!priv->apTD[ii])
@@ -100,7 +98,7 @@ static struct vnt_usb_send_context
 	}
 
 	if (ii == priv->cbTD)
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"No Free Tx Context\n");
+		dev_dbg(&priv->usb->dev, "%s No Free Tx Context\n", __func__);
 
 	return NULL;
 }
Signature · 1 line
1.9.1