Skip to contentSkip to conversation

staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER

PATCH Superseded Malcolm Priestley 2 participants 6 messages Aug 5, 2013 – Aug 13, 2013 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: vt6656: rxtx.h always pack BEACON_BUFFER/TX_BUFFER

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

---
 drivers/staging/vt6656/rxtx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/rxtx.h +2 -2
index dd7e85d..d854b38 100644
@@ -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);
Signature · 1 line
1.8.1.2
maintainer
#1 lore raw
Quoted 1 line · Malcolm Priestley

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Why?

What happens if they are not?

greg k-h

#2 lore raw
Quoted 4 lines · Greg KH
Quoted 1 line · Malcolm Priestley

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.

Quoted 2 lines

What happens if they are not?

The driver does not work.

Regards

Malcolm

maintainer
#3 lore raw
Quoted 8 lines · Malcolm Priestley
Quoted 4 lines · Greg KH
Quoted 1 line · Malcolm Priestley

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Why?

Only the first 4 members of these structures are live.

Quoted 7 lines

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

Quoted 3 lines
Quoted 2 lines

What happens if they are not?

The driver does not work.

How is it working today without this change?

thanks,

greg k-h

#4 lore raw
Quoted 17 lines · Greg KH
Quoted 8 lines · Malcolm Priestley
Quoted 4 lines · Greg KH
Quoted 1 line · Malcolm Priestley

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Why?

Only the first 4 members of these structures are live.

Quoted 7 lines

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.

Quoted 7 lines

Then say all of this in the patch please :)

Quoted 3 lines
Quoted 2 lines

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.

maintainer
#5 lore raw
Quoted 24 lines · Malcolm Priestley
Quoted 23 lines · Greg KH
Quoted 8 lines · Malcolm Priestley
Quoted 4 lines · Greg KH
Quoted 1 line · Malcolm Priestley

All structure members of BEACON_BUFFER/TX_BUFFER should be packed.

Why?

Only the first 4 members of these structures are live.

Quoted 7 lines

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

Quoted 3 lines
Quoted 2 lines

What happens if they are not?

The driver does not work.

Quoted 9 lines
Quoted 1 line

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