linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
@ 2013-08-05 20:04 Malcolm Priestley
  2013-08-12 21:59 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Malcolm Priestley @ 2013-08-05 20:04 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

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

diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index dd7e85d..d854b38 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -609,7 +609,7 @@ typedef struct tagSTX_BUFFER
     // Actual message
     TX_BUFFER_CONTAINER             BufferHeader;
 
-} TX_BUFFER, *PTX_BUFFER;
+} __packed TX_BUFFER, *PTX_BUFFER;
 
 //
 // Remote NDIS message format
@@ -626,7 +626,7 @@ typedef struct tagSBEACON_BUFFER
     // Actual message
     TX_BUFFER_CONTAINER             BufferHeader;
 
-} BEACON_BUFFER, *PBEACON_BUFFER;
+} __packed BEACON_BUFFER, *PBEACON_BUFFER;
 
 void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb);
 int nsDMA_tx_packet(struct vnt_private *, u32 uDMAIdx, struct sk_buff *skb);
-- 
1.8.1.2




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

* Re: [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
  2013-08-05 20:04 [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER Malcolm Priestley
@ 2013-08-12 21:59 ` Greg KH
  2013-08-12 23:07   ` Malcolm Priestley
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-08-12 21:59 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: linux-wireless

On Mon, Aug 05, 2013 at 09:04:54PM +0100, Malcolm Priestley wrote:
> All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Why?

What happens if they are not?

greg k-h

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

* Re: [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
  2013-08-12 21:59 ` Greg KH
@ 2013-08-12 23:07   ` Malcolm Priestley
  2013-08-12 23:09     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Malcolm Priestley @ 2013-08-12 23:07 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-wireless

On Mon, 2013-08-12 at 14:59 -0700, Greg KH wrote:
> On Mon, Aug 05, 2013 at 09:04:54PM +0100, Malcolm Priestley wrote:
> > All structure members of BEACON_BUFFER/TX_BUFFER should be packed.
> 
> Why?

Only the first 4 members of these structures are live.

The forth member is referenced at run-time by packed structures.
typedef struct tagSTxBufHead
typedef struct tagSTxShortBufHead
in desc.h

If these structures are not packed the alignment of these members
will be wrong.

> 
> What happens if they are not?
The driver does not work.

Regards


Malcolm




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

* Re: [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
  2013-08-12 23:07   ` Malcolm Priestley
@ 2013-08-12 23:09     ` Greg KH
  2013-08-12 23:35       ` Malcolm Priestley
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-08-12 23:09 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: linux-wireless

On Tue, Aug 13, 2013 at 12:07:15AM +0100, Malcolm Priestley wrote:
> On Mon, 2013-08-12 at 14:59 -0700, Greg KH wrote:
> > On Mon, Aug 05, 2013 at 09:04:54PM +0100, Malcolm Priestley wrote:
> > > All structure members of BEACON_BUFFER/TX_BUFFER should be packed.
> > 
> > Why?
> 
> Only the first 4 members of these structures are live.
> 
> The forth member is referenced at run-time by packed structures.
> typedef struct tagSTxBufHead
> typedef struct tagSTxShortBufHead
> in desc.h
> 
> If these structures are not packed the alignment of these members
> will be wrong.

Then say all of this in the patch please :)

> > 
> > What happens if they are not?
> The driver does not work.

How is it working today without this change?

thanks,

greg k-h

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

* Re: [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
  2013-08-12 23:09     ` Greg KH
@ 2013-08-12 23:35       ` Malcolm Priestley
  2013-08-13  0:26         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Malcolm Priestley @ 2013-08-12 23:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-wireless

On Mon, 2013-08-12 at 16:09 -0700, Greg KH wrote:
> On Tue, Aug 13, 2013 at 12:07:15AM +0100, Malcolm Priestley wrote:
> > On Mon, 2013-08-12 at 14:59 -0700, Greg KH wrote:
> > > On Mon, Aug 05, 2013 at 09:04:54PM +0100, Malcolm Priestley wrote:
> > > > All structure members of BEACON_BUFFER/TX_BUFFER should be packed.
> > > 
> > > Why?
> > 
> > Only the first 4 members of these structures are live.
> > 
> > The forth member is referenced at run-time by packed structures.
> > typedef struct tagSTxBufHead
> > typedef struct tagSTxShortBufHead
> > in desc.h
> > 
> > If these structures are not packed the alignment of these members
> > will be wrong.
> 
> Then say all of this in the patch please :)
> 
> > > 
> > > What happens if they are not?
> > The driver does not work.
> 
> How is it working today without this change?
Well for *me* it works.

It appears the structure is packed anyway.

But is this guaranteed?

Anyway, do you want me to resend the patch.



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

* Re: [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER
  2013-08-12 23:35       ` Malcolm Priestley
@ 2013-08-13  0:26         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2013-08-13  0:26 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: linux-wireless

On Tue, Aug 13, 2013 at 12:35:16AM +0100, Malcolm Priestley wrote:
> On Mon, 2013-08-12 at 16:09 -0700, Greg KH wrote:
> > On Tue, Aug 13, 2013 at 12:07:15AM +0100, Malcolm Priestley wrote:
> > > On Mon, 2013-08-12 at 14:59 -0700, Greg KH wrote:
> > > > On Mon, Aug 05, 2013 at 09:04:54PM +0100, Malcolm Priestley wrote:
> > > > > All structure members of BEACON_BUFFER/TX_BUFFER should be packed.
> > > > 
> > > > Why?
> > > 
> > > Only the first 4 members of these structures are live.
> > > 
> > > The forth member is referenced at run-time by packed structures.
> > > typedef struct tagSTxBufHead
> > > typedef struct tagSTxShortBufHead
> > > in desc.h
> > > 
> > > If these structures are not packed the alignment of these members
> > > will be wrong.
> > 
> > Then say all of this in the patch please :)
> > 
> > > > 
> > > > What happens if they are not?
> > > The driver does not work.
> > 
> > How is it working today without this change?
> Well for *me* it works.
> 
> It appears the structure is packed anyway.
> 
> But is this guaranteed?
> 
> Anyway, do you want me to resend the patch.
> 

Yes, please do, with this added information, and all other patches from
you that I did not apply, due to me not accepting this one.

thanks,

greg k-h

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

end of thread, other threads:[~2013-08-13  0:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 20:04 [PATCH 1/3] staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER Malcolm Priestley
2013-08-12 21:59 ` Greg KH
2013-08-12 23:07   ` Malcolm Priestley
2013-08-12 23:09     ` Greg KH
2013-08-12 23:35       ` Malcolm Priestley
2013-08-13  0:26         ` Greg KH

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).