aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-01-24 09:12:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:43 -0500
commit99590ffefc803caaf6ba923da092cde739269c06 (patch)
treef1ca93167b1cc96c26544eb63ab9243dc9c7177c /drivers/net/wireless/airo.c
parentdff8ccd9f5ff76b7449bf833f4646f70036b2256 (diff)
airo: use __attribute__ ((packed)) not #pragma
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c90
1 files changed, 49 insertions, 41 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 2306b1a3325c..49872db89514 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -496,39 +496,41 @@ typedef struct {
496 * so all rid access should use the read/writeXXXRid routines. 496 * so all rid access should use the read/writeXXXRid routines.
497 */ 497 */
498 498
499/* This is redundant for x86 archs, but it seems necessary for ARM */
500#pragma pack(1)
501
502/* This structure came from an email sent to me from an engineer at 499/* This structure came from an email sent to me from an engineer at
503 aironet for inclusion into this driver */ 500 aironet for inclusion into this driver */
504typedef struct { 501typedef struct WepKeyRid WepKeyRid;
502struct WepKeyRid {
505 __le16 len; 503 __le16 len;
506 __le16 kindex; 504 __le16 kindex;
507 u8 mac[ETH_ALEN]; 505 u8 mac[ETH_ALEN];
508 __le16 klen; 506 __le16 klen;
509 u8 key[16]; 507 u8 key[16];
510} WepKeyRid; 508} __attribute__ ((packed));
511 509
512/* These structures are from the Aironet's PC4500 Developers Manual */ 510/* These structures are from the Aironet's PC4500 Developers Manual */
513typedef struct { 511typedef struct Ssid Ssid;
512struct Ssid {
514 __le16 len; 513 __le16 len;
515 u8 ssid[32]; 514 u8 ssid[32];
516} Ssid; 515} __attribute__ ((packed));
517 516
518typedef struct { 517typedef struct SsidRid SsidRid;
518struct SsidRid {
519 __le16 len; 519 __le16 len;
520 Ssid ssids[3]; 520 Ssid ssids[3];
521} SsidRid; 521} __attribute__ ((packed));
522 522
523typedef struct { 523typedef struct ModulationRid ModulationRid;
524struct ModulationRid {
524 __le16 len; 525 __le16 len;
525 __le16 modulation; 526 __le16 modulation;
526#define MOD_DEFAULT cpu_to_le16(0) 527#define MOD_DEFAULT cpu_to_le16(0)
527#define MOD_CCK cpu_to_le16(1) 528#define MOD_CCK cpu_to_le16(1)
528#define MOD_MOK cpu_to_le16(2) 529#define MOD_MOK cpu_to_le16(2)
529} ModulationRid; 530} __attribute__ ((packed));
530 531
531typedef struct { 532typedef struct ConfigRid ConfigRid;
533struct ConfigRid {
532 __le16 len; /* sizeof(ConfigRid) */ 534 __le16 len; /* sizeof(ConfigRid) */
533 __le16 opmode; /* operating mode */ 535 __le16 opmode; /* operating mode */
534#define MODE_STA_IBSS cpu_to_le16(0) 536#define MODE_STA_IBSS cpu_to_le16(0)
@@ -649,9 +651,10 @@ typedef struct {
649#define MAGIC_STAY_IN_CAM (1<<10) 651#define MAGIC_STAY_IN_CAM (1<<10)
650 u8 magicControl; 652 u8 magicControl;
651 __le16 autoWake; 653 __le16 autoWake;
652} ConfigRid; 654} __attribute__ ((packed));
653 655
654typedef struct { 656typedef struct StatusRid StatusRid;
657struct StatusRid {
655 __le16 len; 658 __le16 len;
656 u8 mac[ETH_ALEN]; 659 u8 mac[ETH_ALEN];
657 __le16 mode; 660 __le16 mode;
@@ -707,21 +710,23 @@ typedef struct {
707#define STAT_LEAPFAILED 91 710#define STAT_LEAPFAILED 91
708#define STAT_LEAPTIMEDOUT 92 711#define STAT_LEAPTIMEDOUT 92
709#define STAT_LEAPCOMPLETE 93 712#define STAT_LEAPCOMPLETE 93
710} StatusRid; 713} __attribute__ ((packed));
711 714
712typedef struct { 715typedef struct StatsRid StatsRid;
716struct StatsRid {
713 __le16 len; 717 __le16 len;
714 __le16 spacer; 718 __le16 spacer;
715 __le32 vals[100]; 719 __le32 vals[100];
716} StatsRid; 720} __attribute__ ((packed));
717
718 721
719typedef struct { 722typedef struct APListRid APListRid;
723struct APListRid {
720 __le16 len; 724 __le16 len;
721 u8 ap[4][ETH_ALEN]; 725 u8 ap[4][ETH_ALEN];
722} APListRid; 726} __attribute__ ((packed));
723 727
724typedef struct { 728typedef struct CapabilityRid CapabilityRid;
729struct CapabilityRid {
725 __le16 len; 730 __le16 len;
726 char oui[3]; 731 char oui[3];
727 char zero; 732 char zero;
@@ -748,17 +753,18 @@ typedef struct {
748 __le16 bootBlockVer; 753 __le16 bootBlockVer;
749 __le16 requiredHard; 754 __le16 requiredHard;
750 __le16 extSoftCap; 755 __le16 extSoftCap;
751} CapabilityRid; 756} __attribute__ ((packed));
752
753 757
754/* Only present on firmware >= 5.30.17 */ 758/* Only present on firmware >= 5.30.17 */
755typedef struct { 759typedef struct BSSListRidExtra BSSListRidExtra;
760struct BSSListRidExtra {
756 __le16 unknown[4]; 761 __le16 unknown[4];
757 u8 fixed[12]; /* WLAN management frame */ 762 u8 fixed[12]; /* WLAN management frame */
758 u8 iep[624]; 763 u8 iep[624];
759} BSSListRidExtra; 764} __attribute__ ((packed));
760 765
761typedef struct { 766typedef struct BSSListRid BSSListRid;
767struct BSSListRid {
762 __le16 len; 768 __le16 len;
763 __le16 index; /* First is 0 and 0xffff means end of list */ 769 __le16 index; /* First is 0 and 0xffff means end of list */
764#define RADIO_FH 1 /* Frequency hopping radio type */ 770#define RADIO_FH 1 /* Frequency hopping radio type */
@@ -789,33 +795,37 @@ typedef struct {
789 795
790 /* Only present on firmware >= 5.30.17 */ 796 /* Only present on firmware >= 5.30.17 */
791 BSSListRidExtra extra; 797 BSSListRidExtra extra;
792} BSSListRid; 798} __attribute__ ((packed));
793 799
794typedef struct { 800typedef struct {
795 BSSListRid bss; 801 BSSListRid bss;
796 struct list_head list; 802 struct list_head list;
797} BSSListElement; 803} BSSListElement;
798 804
799typedef struct { 805typedef struct tdsRssiEntry tdsRssiEntry;
806struct tdsRssiEntry {
800 u8 rssipct; 807 u8 rssipct;
801 u8 rssidBm; 808 u8 rssidBm;
802} tdsRssiEntry; 809} __attribute__ ((packed));
803 810
804typedef struct { 811typedef struct tdsRssiRid tdsRssiRid;
812struct tdsRssiRid {
805 u16 len; 813 u16 len;
806 tdsRssiEntry x[256]; 814 tdsRssiEntry x[256];
807} tdsRssiRid; 815} __attribute__ ((packed));
808 816
809typedef struct { 817typedef struct MICRid MICRid;
810 u16 len; 818struct MICRid {
811 u16 state; 819 __le16 len;
812 u16 multicastValid; 820 __le16 state;
821 __le16 multicastValid;
813 u8 multicast[16]; 822 u8 multicast[16];
814 u16 unicastValid; 823 __le16 unicastValid;
815 u8 unicast[16]; 824 u8 unicast[16];
816} MICRid; 825} __attribute__ ((packed));
817 826
818typedef struct { 827typedef struct MICBuffer MICBuffer;
828struct MICBuffer {
819 __be16 typelen; 829 __be16 typelen;
820 830
821 union { 831 union {
@@ -830,15 +840,13 @@ typedef struct {
830 } u; 840 } u;
831 __be32 mic; 841 __be32 mic;
832 __be32 seq; 842 __be32 seq;
833} MICBuffer; 843} __attribute__ ((packed));
834 844
835typedef struct { 845typedef struct {
836 u8 da[ETH_ALEN]; 846 u8 da[ETH_ALEN];
837 u8 sa[ETH_ALEN]; 847 u8 sa[ETH_ALEN];
838} etherHead; 848} etherHead;
839 849
840#pragma pack()
841
842#define TXCTL_TXOK (1<<1) /* report if tx is ok */ 850#define TXCTL_TXOK (1<<1) /* report if tx is ok */
843#define TXCTL_TXEX (1<<2) /* report if tx fails */ 851#define TXCTL_TXEX (1<<2) /* report if tx fails */
844#define TXCTL_802_3 (0<<3) /* 802.3 packet */ 852#define TXCTL_802_3 (0<<3) /* 802.3 packet */