linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration
@ 2020-05-05 21:13 Malcolm Priestley
  2020-05-13  8:07 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Malcolm Priestley @ 2020-05-05 21:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-wireless, Oscar Carter

use the mac80211 ieee80211_rts_duration for RTS frames.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 6724b213a723..48fe16c27d3f 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -285,28 +285,18 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_usb_send_context *context,
 					 u8 dur_type, u8 pkt_type, u16 rate)
 {
 	struct vnt_private *priv = context->priv;
-	u32 cts_time = 0, dur_time = 0;
+	u32 dur_time = 0;
 	u32 frame_length = context->frame_len;
 	u8 need_ack = context->need_ack;
+	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
 
 	switch (dur_type) {
+	/* fall through */
 	case RTSDUR_BB:
 	case RTSDUR_BA:
-		cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
-					      14, priv->top_cck_basic_rate);
-		dur_time = cts_time + 2 * priv->sifs +
-			vnt_get_rsvtime(priv, pkt_type,
-					frame_length, rate, need_ack);
-		break;
-
 	case RTSDUR_AA:
-		cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
-					      14, priv->top_ofdm_basic_rate);
-		dur_time = cts_time + 2 * priv->sifs +
-			vnt_get_rsvtime(priv, pkt_type,
-					frame_length, rate, need_ack);
-		break;
-
+		return ieee80211_rts_duration(priv->hw, priv->vif,
+					      context->frame_len, info);
 	case CTSDUR_BA:
 		dur_time = priv->sifs + vnt_get_rsvtime(priv,
 				pkt_type, frame_length, rate, need_ack);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration
  2020-05-05 21:13 [PATCH 2/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration Malcolm Priestley
@ 2020-05-13  8:07 ` Dan Carpenter
  2020-05-13  8:11   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-05-13  8:07 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: Greg Kroah-Hartman, devel, Oscar Carter, linux-wireless

On Tue, May 05, 2020 at 10:13:54PM +0100, Malcolm Priestley wrote:
> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
> index 6724b213a723..48fe16c27d3f 100644
> --- a/drivers/staging/vt6656/rxtx.c
> +++ b/drivers/staging/vt6656/rxtx.c
> @@ -285,28 +285,18 @@ static __le16 vnt_get_rtscts_duration_le(struct vnt_usb_send_context *context,
>  					 u8 dur_type, u8 pkt_type, u16 rate)
>  {
>  	struct vnt_private *priv = context->priv;
> -	u32 cts_time = 0, dur_time = 0;
> +	u32 dur_time = 0;
>  	u32 frame_length = context->frame_len;
>  	u8 need_ack = context->need_ack;
> +	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
>  
>  	switch (dur_type) {
> +	/* fall through */
>  	case RTSDUR_BB:
>  	case RTSDUR_BA:

This fall through annotation shouldn't be necessary.  It's not preceded
by a case statement.  Also you don't need /* fall through */ for empty
case statements.  In other words you only need it for stuff like this:

	case FOO:
	case BAR:
		frob();
		frob();
		/* fall through */
	case BAZ:

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration
  2020-05-13  8:07 ` Dan Carpenter
@ 2020-05-13  8:11   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-05-13  8:11 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: devel, Greg Kroah-Hartman, Oscar Carter, linux-wireless

Btw, I don't know if this has already been applied.  I'm fine with
applying it as-is.  The code doesn't hurt anything and it disappears
later in the series anyways.

I only mentioned this about fall through for future reference.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-13  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 21:13 [PATCH 2/6] staging: vt6656: vnt_get_rtscts_duration_le use ieee80211_rts_duration Malcolm Priestley
2020-05-13  8:07 ` Dan Carpenter
2020-05-13  8:11   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).