All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
@ 2020-05-16 10:39 ` Malcolm Priestley
  0 siblings, 0 replies; 6+ messages in thread
From: Malcolm Priestley @ 2020-05-16 10:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-wireless

Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.

The struct ieee80211_mgmt is not longer in the header and is at
the initial skb->data point.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 22 +++++++++-------------
 drivers/staging/vt6656/rxtx.h |  5 +----
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 792833f8192a..cf194c95df03 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -684,8 +684,9 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	beacon_buffer = (struct vnt_beacon_buffer *)&context->data[0];
-	short_head = &beacon_buffer->short_head;
+	mgmt_hdr = (struct ieee80211_mgmt *)skb->data;
+	short_head = skb_push(skb, sizeof(*short_head));
+	count = skb->len;
 
 	if (priv->bb_type == BB_TYPE_11A) {
 		current_rate = RATE_6M;
@@ -710,10 +711,6 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 			vnt_time_stamp_off(priv, current_rate);
 	}
 
-	/* Generate Beacon Header */
-	mgmt_hdr = &beacon_buffer->mgmt_hdr;
-	memcpy(mgmt_hdr, skb->data, skb->len);
-
 	/* Get Duration */
 	short_head->duration = mgmt_hdr->duration;
 
@@ -732,15 +729,14 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 	if (priv->seq_counter > 0x0fff)
 		priv->seq_counter = 0;
 
-	count = sizeof(struct vnt_tx_short_buf_head) + skb->len;
-
-	beacon_buffer->tx_byte_count = cpu_to_le16(count);
-	beacon_buffer->pkt_no = context->pkt_no;
-	beacon_buffer->type = 0x01;
+	beacon_buffer = skb_push(skb, sizeof(struct vnt_tx_usb_header));
+	beacon_buffer->usb.tx_byte_count = cpu_to_le16(count);
+	beacon_buffer->usb.pkt_no = context->pkt_no;
+	beacon_buffer->usb.type = 0x01;
 
 	context->type = CONTEXT_BEACON_PACKET;
-	context->tx_buffer = &context->data;
-	context->buf_len = count + 4; /* USB header */
+	context->tx_buffer = beacon_buffer;
+	context->buf_len = skb->len;
 
 	spin_lock_irqsave(&priv->lock, flags);
 
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 819b45394673..fd64d0838e34 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -180,11 +180,8 @@ struct vnt_tx_short_buf_head {
 } __packed;
 
 struct vnt_beacon_buffer {
-	u8 type;
-	u8 pkt_no;
-	__le16 tx_byte_count;
+	struct vnt_tx_usb_header usb;
 	struct vnt_tx_short_buf_head short_head;
-	struct ieee80211_mgmt mgmt_hdr;
 } __packed;
 
 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb);
-- 
2.25.1

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

* [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
@ 2020-05-16 10:39 ` Malcolm Priestley
  0 siblings, 0 replies; 6+ messages in thread
From: Malcolm Priestley @ 2020-05-16 10:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-wireless

Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.

The struct ieee80211_mgmt is not longer in the header and is at
the initial skb->data point.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rxtx.c | 22 +++++++++-------------
 drivers/staging/vt6656/rxtx.h |  5 +----
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 792833f8192a..cf194c95df03 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -684,8 +684,9 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	beacon_buffer = (struct vnt_beacon_buffer *)&context->data[0];
-	short_head = &beacon_buffer->short_head;
+	mgmt_hdr = (struct ieee80211_mgmt *)skb->data;
+	short_head = skb_push(skb, sizeof(*short_head));
+	count = skb->len;
 
 	if (priv->bb_type == BB_TYPE_11A) {
 		current_rate = RATE_6M;
@@ -710,10 +711,6 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 			vnt_time_stamp_off(priv, current_rate);
 	}
 
-	/* Generate Beacon Header */
-	mgmt_hdr = &beacon_buffer->mgmt_hdr;
-	memcpy(mgmt_hdr, skb->data, skb->len);
-
 	/* Get Duration */
 	short_head->duration = mgmt_hdr->duration;
 
@@ -732,15 +729,14 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
 	if (priv->seq_counter > 0x0fff)
 		priv->seq_counter = 0;
 
-	count = sizeof(struct vnt_tx_short_buf_head) + skb->len;
-
-	beacon_buffer->tx_byte_count = cpu_to_le16(count);
-	beacon_buffer->pkt_no = context->pkt_no;
-	beacon_buffer->type = 0x01;
+	beacon_buffer = skb_push(skb, sizeof(struct vnt_tx_usb_header));
+	beacon_buffer->usb.tx_byte_count = cpu_to_le16(count);
+	beacon_buffer->usb.pkt_no = context->pkt_no;
+	beacon_buffer->usb.type = 0x01;
 
 	context->type = CONTEXT_BEACON_PACKET;
-	context->tx_buffer = &context->data;
-	context->buf_len = count + 4; /* USB header */
+	context->tx_buffer = beacon_buffer;
+	context->buf_len = skb->len;
 
 	spin_lock_irqsave(&priv->lock, flags);
 
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 819b45394673..fd64d0838e34 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -180,11 +180,8 @@ struct vnt_tx_short_buf_head {
 } __packed;
 
 struct vnt_beacon_buffer {
-	u8 type;
-	u8 pkt_no;
-	__le16 tx_byte_count;
+	struct vnt_tx_usb_header usb;
 	struct vnt_tx_short_buf_head short_head;
-	struct ieee80211_mgmt mgmt_hdr;
 } __packed;
 
 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb);
-- 
2.25.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
  2020-05-16 10:39 ` Malcolm Priestley
@ 2020-05-18 12:39   ` Dan Carpenter
  -1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-05-18 12:39 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: Greg Kroah-Hartman, devel, linux-wireless

On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:
> Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.
> 
> The struct ieee80211_mgmt is not longer in the header and is at
> the initial skb->data point.

I feel like the SubmittingPatches guidelines on verb tenses and not
saying "this patch" or "I" has got everyone so worried that it's like
playing Taboo.  Do you mean that the struct moved before or after we
aply *this patch*?

> 
> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

I can't understand the point of this patch at all.  Is it a fix or a
clean up?  If I had to guess from the subjec, I would say it's a
performance improvement but I don't know.

regards,
dan carpenter



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

* Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
@ 2020-05-18 12:39   ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-05-18 12:39 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: devel, Greg Kroah-Hartman, linux-wireless

On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:
> Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.
> 
> The struct ieee80211_mgmt is not longer in the header and is at
> the initial skb->data point.

I feel like the SubmittingPatches guidelines on verb tenses and not
saying "this patch" or "I" has got everyone so worried that it's like
playing Taboo.  Do you mean that the struct moved before or after we
aply *this patch*?

> 
> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

I can't understand the point of this patch at all.  Is it a fix or a
clean up?  If I had to guess from the subjec, I would say it's a
performance improvement but I don't know.

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
  2020-05-18 12:39   ` Dan Carpenter
@ 2020-05-18 20:42     ` Malcolm Priestley
  -1 siblings, 0 replies; 6+ messages in thread
From: Malcolm Priestley @ 2020-05-18 20:42 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-wireless



On 18/05/2020 13:39, Dan Carpenter wrote:
> On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:
>> Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.
>>
>> The struct ieee80211_mgmt is not longer in the header and is at
>> the initial skb->data point.
> 
> I feel like the SubmittingPatches guidelines on verb tenses and not
> saying "this patch" or "I" has got everyone so worried that it's like
> playing Taboo.  Do you mean that the struct moved before or after we
> aply *this patch*?
The struct has not moved, before skb->data was copied on to the address 
along with the rest of frame.

So now struct needs to be at skb->data.

>>
>> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> 
> I can't understand the point of this patch at all.  Is it a fix or a
> clean up?  If I had to guess from the subjec, I would say it's a
> performance improvement but I don't know.
Well there is a performance improvement as there is only one buffer 
instead of two.

Mainly to bring into line with other drivers in the mac80211 tree there
is no need for a secondary buffer in driver.

Regards

Malcolm


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

* Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.
@ 2020-05-18 20:42     ` Malcolm Priestley
  0 siblings, 0 replies; 6+ messages in thread
From: Malcolm Priestley @ 2020-05-18 20:42 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, Greg Kroah-Hartman, linux-wireless



On 18/05/2020 13:39, Dan Carpenter wrote:
> On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:
>> Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.
>>
>> The struct ieee80211_mgmt is not longer in the header and is at
>> the initial skb->data point.
> 
> I feel like the SubmittingPatches guidelines on verb tenses and not
> saying "this patch" or "I" has got everyone so worried that it's like
> playing Taboo.  Do you mean that the struct moved before or after we
> aply *this patch*?
The struct has not moved, before skb->data was copied on to the address 
along with the rest of frame.

So now struct needs to be at skb->data.

>>
>> Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> 
> I can't understand the point of this patch at all.  Is it a fix or a
> clean up?  If I had to guess from the subjec, I would say it's a
> performance improvement but I don't know.
Well there is a performance improvement as there is only one buffer 
instead of two.

Mainly to bring into line with other drivers in the mac80211 tree there
is no need for a secondary buffer in driver.

Regards

Malcolm

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2020-05-18 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16 10:39 [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom Malcolm Priestley
2020-05-16 10:39 ` Malcolm Priestley
2020-05-18 12:39 ` Dan Carpenter
2020-05-18 12:39   ` Dan Carpenter
2020-05-18 20:42   ` Malcolm Priestley
2020-05-18 20:42     ` Malcolm Priestley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.