]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/ipw2200.h
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6] / drivers / net / wireless / ipw2200.h
index 4e8b75e7962a1d485b65ed9afd6b50364bd054b2..e9cf32bf3e31741936882932b24ce289bf28f982 100644 (file)
@@ -1,23 +1,23 @@
 /******************************************************************************
-  
+
   Copyright(c) 2003 - 2004 Intel Corporation. All rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it 
-  under the terms of version 2 of the GNU General Public License as 
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of version 2 of the GNU General Public License as
   published by the Free Software Foundation.
-  
-  This program is distributed in the hope that it will be useful, but WITHOUT 
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
-  
+
   You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc., 59 
+  this program; if not, write to the Free Software Foundation, Inc., 59
   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  
+
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
-  
+
   Contact Information:
   James P. Ketrenos <ipw2100-admin@linux.intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
 #include <linux/random.h>
+#include <linux/dma-mapping.h>
 
 #include <linux/firmware.h>
 #include <linux/wireless.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 
 #include <net/ieee80211.h>
 
 #include <linux/workqueue.h>
 
-#ifndef IRQ_NONE
-typedef void irqreturn_t;
-#define IRQ_NONE 
-#define IRQ_HANDLED 
-#define IRQ_RETVAL(x)
-#endif
-
-#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) )
-#define __iomem
-#endif
-
-#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) )
-#define pci_dma_sync_single_for_cpu    pci_dma_sync_single
-#define pci_dma_sync_single_for_device pci_dma_sync_single
-#endif
-
-#ifndef HAVE_FREE_NETDEV
-#define free_netdev(x) kfree(x)
-#endif
-
 /* Authentication  and Association States */
-enum connection_manager_assoc_states
-{
+enum connection_manager_assoc_states {
        CMAS_INIT = 0,
        CMAS_TX_AUTH_SEQ_1,
        CMAS_RX_AUTH_SEQ_2,
@@ -92,9 +73,6 @@ enum connection_manager_assoc_states
        CMAS_LAST
 };
 
-
-#define IPW_NORMAL                   0
-#define IPW_NOWAIT                   0
 #define IPW_WAIT                     (1<<0)
 #define IPW_QUIET                    (1<<1)
 #define IPW_ROAMING                  (1<<2)
@@ -179,18 +157,18 @@ enum connection_manager_assoc_states
 #define IPW_B_MODE                         1
 #define IPW_G_MODE                         2
 
-/* 
- * TX Queue Flag Definitions 
+/*
+ * TX Queue Flag Definitions
  */
 
 /* abort attempt if mgmt frame is rx'd */
-#define DCT_FLAG_ABORT_MGMT                0x01 
+#define DCT_FLAG_ABORT_MGMT                0x01
+
 /* require CTS */
 #define DCT_FLAG_CTS_REQUIRED              0x02
 
 /* use short preamble */
-#define DCT_FLAG_SHORT_PREMBL              0x04  
+#define DCT_FLAG_SHORT_PREMBL              0x04
 
 /* RTS/CTS first */
 #define DCT_FLAG_RTS_REQD                  0x08
@@ -200,17 +178,16 @@ enum connection_manager_assoc_states
 
 /* even if MAC WEP set (allows pre-encrypt) */
 #define DCT_FLAG_NO_WEP              0x20
-#define IPW_
+
 /* overwrite TSF field */
 #define DCT_FLAG_TSF_REQD                  0x40
 
 /* ACK rx is expected to follow */
-#define DCT_FLAG_ACK_REQD                  0x80  
+#define DCT_FLAG_ACK_REQD                  0x80
 
 #define DCT_FLAG_EXT_MODE_CCK  0x01
 #define DCT_FLAG_EXT_MODE_OFDM 0x00
 
-
 #define TX_RX_TYPE_MASK                    0xFF
 #define TX_FRAME_TYPE                      0x00
 #define TX_HOST_COMMAND_TYPE               0x01
@@ -238,13 +215,13 @@ enum connection_manager_assoc_states
 #define HOST_NOTIFICATION_CHANNEL_SWITCHED              23
 #define HOST_NOTIFICATION_RX_DURING_QUIET_PERIOD        24
 #define HOST_NOTIFICATION_NOISE_STATS                  25
-#define HOST_NOTIFICATION_S36_MEASUREMENT_ACCEPTED      30 
+#define HOST_NOTIFICATION_S36_MEASUREMENT_ACCEPTED      30
 #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED       31
 
 #define HOST_NOTIFICATION_STATUS_BEACON_MISSING         1
 #define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT           24
 #define IPW_MB_ROAMING_THRESHOLD_DEFAULT                8
-#define IPW_REAL_RATE_RX_PACKET_THRESHOLD               300    
+#define IPW_REAL_RATE_RX_PACKET_THRESHOLD               300
 
 #define MACADRR_BYTE_LEN                     6
 
@@ -258,118 +235,108 @@ enum connection_manager_assoc_states
 
 /**
  * Generic queue structure
- * 
+ *
  * Contains common data for Rx and Tx queues
  */
 struct clx2_queue {
-       int n_bd;                      /**< number of BDs in this queue */
-       int first_empty;               /**< 1-st empty entry (index) */
-       int last_used;                 /**< last used entry (index) */
-       u32 reg_w;                   /**< 'write' reg (queue head), addr in domain 1 */
-       u32 reg_r;                   /**< 'read' reg (queue tail), addr in domain 1 */
-       dma_addr_t dma_addr;            /**< physical addr for BD's */
-       int low_mark;                  /**< low watermark, resume queue if free space more than this */
-       int high_mark;                 /**< high watermark, stop queue if free space less than this */
+       int n_bd;                      /**< number of BDs in this queue */
+       int first_empty;               /**< 1-st empty entry (index) */
+       int last_used;                 /**< last used entry (index) */
+       u32 reg_w;                   /**< 'write' reg (queue head), addr in domain 1 */
+       u32 reg_r;                   /**< 'read' reg (queue tail), addr in domain 1 */
+       dma_addr_t dma_addr;            /**< physical addr for BD's */
+       int low_mark;                  /**< low watermark, resume queue if free space more than this */
+       int high_mark;                 /**< high watermark, stop queue if free space less than this */
 } __attribute__ ((packed));
 
-struct machdr32
-{
+struct machdr32 {
        u16 frame_ctl;
-       u16 duration;     // watch out for endians!
-       u8 addr1[ MACADRR_BYTE_LEN ];
-       u8 addr2[ MACADRR_BYTE_LEN ];
-       u8 addr3[ MACADRR_BYTE_LEN ];
-       u16 seq_ctrl;     // more endians!
-       u8 addr4[ MACADRR_BYTE_LEN ];
+       u16 duration;           // watch out for endians!
+       u8 addr1[MACADRR_BYTE_LEN];
+       u8 addr2[MACADRR_BYTE_LEN];
+       u8 addr3[MACADRR_BYTE_LEN];
+       u16 seq_ctrl;           // more endians!
+       u8 addr4[MACADRR_BYTE_LEN];
        u16 qos_ctrl;
-} __attribute__ ((packed)) ;
+} __attribute__ ((packed));
 
-struct machdr30
-{
+struct machdr30 {
        u16 frame_ctl;
-       u16 duration;     // watch out for endians!
-       u8 addr1[ MACADRR_BYTE_LEN ];
-       u8 addr2[ MACADRR_BYTE_LEN ];
-       u8 addr3[ MACADRR_BYTE_LEN ];
-       u16 seq_ctrl;     // more endians!
-       u8 addr4[ MACADRR_BYTE_LEN ];
-} __attribute__ ((packed)) ;
-
-struct machdr26
-{
+       u16 duration;           // watch out for endians!
+       u8 addr1[MACADRR_BYTE_LEN];
+       u8 addr2[MACADRR_BYTE_LEN];
+       u8 addr3[MACADRR_BYTE_LEN];
+       u16 seq_ctrl;           // more endians!
+       u8 addr4[MACADRR_BYTE_LEN];
+} __attribute__ ((packed));
+
+struct machdr26 {
        u16 frame_ctl;
-       u16 duration;     // watch out for endians!
-       u8 addr1[ MACADRR_BYTE_LEN ];
-       u8 addr2[ MACADRR_BYTE_LEN ];
-       u8 addr3[ MACADRR_BYTE_LEN ];
-       u16 seq_ctrl;     // more endians!
+       u16 duration;           // watch out for endians!
+       u8 addr1[MACADRR_BYTE_LEN];
+       u8 addr2[MACADRR_BYTE_LEN];
+       u8 addr3[MACADRR_BYTE_LEN];
+       u16 seq_ctrl;           // more endians!
        u16 qos_ctrl;
-} __attribute__ ((packed)) ;
+} __attribute__ ((packed));
 
-struct machdr24
-{
+struct machdr24 {
        u16 frame_ctl;
-       u16 duration;     // watch out for endians!
-       u8 addr1[ MACADRR_BYTE_LEN ];
-       u8 addr2[ MACADRR_BYTE_LEN ];
-       u8 addr3[ MACADRR_BYTE_LEN ];
-       u16 seq_ctrl;     // more endians!
-} __attribute__ ((packed)) ;
+       u16 duration;           // watch out for endians!
+       u8 addr1[MACADRR_BYTE_LEN];
+       u8 addr2[MACADRR_BYTE_LEN];
+       u8 addr3[MACADRR_BYTE_LEN];
+       u16 seq_ctrl;           // more endians!
+} __attribute__ ((packed));
 
 // TX TFD with 32 byte MAC Header
-struct tx_tfd_32
-{   
-       struct machdr32    mchdr;                      // 32
-       u32                uivplaceholder[2];          // 8
-} __attribute__ ((packed)) ;
+struct tx_tfd_32 {
+       struct machdr32 mchdr;  // 32
+       u32 uivplaceholder[2];  // 8
+} __attribute__ ((packed));
 
 // TX TFD with 30 byte MAC Header
-struct tx_tfd_30
-{
-       struct machdr30    mchdr;                      // 30
-       u8                 reserved[2];                // 2
-       u32                uivplaceholder[2];          // 8
-} __attribute__ ((packed)) ;
+struct tx_tfd_30 {
+       struct machdr30 mchdr;  // 30
+       u8 reserved[2];         // 2
+       u32 uivplaceholder[2];  // 8
+} __attribute__ ((packed));
 
 // tx tfd with 26 byte mac header
-struct tx_tfd_26
-{
-       struct machdr26    mchdr;                      // 26
-       u8                 reserved1[2];               // 2
-       u32                uivplaceholder[2];          // 8
-       u8                 reserved2[4];               // 4
-} __attribute__ ((packed)) ;
+struct tx_tfd_26 {
+       struct machdr26 mchdr;  // 26
+       u8 reserved1[2];        // 2
+       u32 uivplaceholder[2];  // 8
+       u8 reserved2[4];        // 4
+} __attribute__ ((packed));
 
 // tx tfd with 24 byte mac header
-struct tx_tfd_24
-{
-       struct machdr24    mchdr;                      // 24
-       u32                uivplaceholder[2];          // 8
-       u8                 reserved[8];                // 8
-} __attribute__ ((packed)) ;
-
+struct tx_tfd_24 {
+       struct machdr24 mchdr;  // 24
+       u32 uivplaceholder[2];  // 8
+       u8 reserved[8];         // 8
+} __attribute__ ((packed));
 
 #define DCT_WEP_KEY_FIELD_LENGTH 16
 
-struct tfd_command
-{
+struct tfd_command {
        u8 index;
        u8 length;
        u16 reserved;
        u8 payload[0];
-} __attribute__ ((packed)) ;
+} __attribute__ ((packed));
 
 struct tfd_data {
        /* Header */
        u32 work_area_ptr;
-       u8 station_number; /* 0 for BSS */
+       u8 station_number;      /* 0 for BSS */
        u8 reserved1;
        u16 reserved2;
 
        /* Tx Parameters */
        u8 cmd_id;
-       u8 seq_num;    
-       u16 len;  
+       u8 seq_num;
+       u16 len;
        u8 priority;
        u8 tx_flags;
        u8 tx_flags_ext;
@@ -378,15 +345,14 @@ struct tfd_data {
        u8 rate;
        u8 antenna;
        u16 next_packet_duration;
-       u16 next_frag_len;  
-       u16 back_off_counter; //////txop;
+       u16 next_frag_len;
+       u16 back_off_counter;   //////txop;
        u8 retrylimit;
-       u16 cwcurrent;  
+       u16 cwcurrent;
        u8 reserved3;
 
        /* 802.11 MAC Header */
-       union
-       {
+       union {
                struct tx_tfd_24 tfd_24;
                struct tx_tfd_26 tfd_26;
                struct tx_tfd_30 tfd_30;
@@ -399,8 +365,7 @@ struct tfd_data {
        u16 chunk_len[NUM_TFD_CHUNKS];
 } __attribute__ ((packed));
 
-struct txrx_control_flags
-{
+struct txrx_control_flags {
        u8 message_type;
        u8 rx_seq_num;
        u8 control_bits;
@@ -410,17 +375,16 @@ struct txrx_control_flags
 #define  TFD_SIZE                           128
 #define  TFD_CMD_IMMEDIATE_PAYLOAD_LENGTH   (TFD_SIZE - sizeof(struct txrx_control_flags))
 
-struct tfd_frame
-{
+struct tfd_frame {
        struct txrx_control_flags control_flags;
        union {
                struct tfd_data data;
                struct tfd_command cmd;
                u8 raw[TFD_CMD_IMMEDIATE_PAYLOAD_LENGTH];
        } u;
-} __attribute__ ((packed)) ;
+} __attribute__ ((packed));
 
-typedef void destructor_func(const void*);
+typedef void destructor_func(const void *);
 
 /**
  * Tx Queue for DMA. Queue consists of circular buffer of
@@ -428,7 +392,7 @@ typedef void destructor_func(const void*);
  */
 struct clx2_tx_queue {
        struct clx2_queue q;
-       struct tfd_framebd;
+       struct tfd_frame *bd;
        struct ieee80211_txb **txb;
 };
 
@@ -443,8 +407,7 @@ struct clx2_tx_queue {
 #define SUP_RATE_11G_MAX_NUM_CHANNELS  (12)
 
 // Used for passing to driver number of successes and failures per rate
-struct rate_histogram
-{
+struct rate_histogram {
        union {
                u32 a[SUP_RATE_11A_MAX_NUM_CHANNELS];
                u32 b[SUP_RATE_11B_MAX_NUM_CHANNELS];
@@ -457,29 +420,29 @@ struct rate_histogram
        } failed;
 } __attribute__ ((packed));
 
-/* statistics command response */      
+/* statistics command response */
 struct ipw_cmd_stats {
        u8 cmd_id;
        u8 seq_num;
-       u16 good_sfd;               
-       u16 bad_plcp;               
-       u16 wrong_bssid;            
-       u16 valid_mpdu;             
-       u16 bad_mac_header;         
-       u16 reserved_frame_types;   
-       u16 rx_ina;                 
-       u16 bad_crc32;              
-       u16 invalid_cts;            
-       u16 invalid_acks;           
-       u16 long_distance_ina_fina; 
+       u16 good_sfd;
+       u16 bad_plcp;
+       u16 wrong_bssid;
+       u16 valid_mpdu;
+       u16 bad_mac_header;
+       u16 reserved_frame_types;
+       u16 rx_ina;
+       u16 bad_crc32;
+       u16 invalid_cts;
+       u16 invalid_acks;
+       u16 long_distance_ina_fina;
        u16 dsp_silence_unreachable;
-       u16 accumulated_rssi;      
-       u16 rx_ovfl_frame_tossed;  
+       u16 accumulated_rssi;
+       u16 rx_ovfl_frame_tossed;
        u16 rssi_silence_threshold;
        u16 rx_ovfl_frame_supplied;
-       u16 last_rx_frame_signal;  
-       u16 last_rx_frame_noise;   
-       u16 rx_autodetec_no_ofdm;  
+       u16 last_rx_frame_signal;
+       u16 last_rx_frame_noise;
+       u16 rx_autodetec_no_ofdm;
        u16 rx_autodetec_no_barker;
        u16 reserved;
 } __attribute__ ((packed));
@@ -495,12 +458,12 @@ struct notif_scan_complete {
        u8 num_channels;
        u8 status;
        u8 reserved;
-}  __attribute__ ((packed));
+} __attribute__ ((packed));
 
 struct notif_frag_length {
        u16 frag_length;
        u16 reserved;
-}  __attribute__ ((packed));
+} __attribute__ ((packed));
 
 struct notif_beacon_state {
        u32 state;
@@ -533,12 +496,6 @@ struct notif_authenticate {
        u16 status;
 } __attribute__ ((packed));
 
-struct temperature
-{
-       s32 measured;
-       s32 active;
-} __attribute__ ((packed));
-
 struct notif_calibration {
        u8 data[104];
 } __attribute__ ((packed));
@@ -568,12 +525,12 @@ struct ipw_rx_notification {
 } __attribute__ ((packed));
 
 struct ipw_rx_frame {
-       u32 reserved1; 
-       u8 parent_tsf[4];     // fw_use[0] is boolean for OUR_TSF_IS_GREATER
-       u8 received_channel;  // The channel that this frame was received on.
-                             // Note that for .11b this does not have to be 
-                             // the same as the channel that it was sent. 
-                              // Filled by LMAC
+       u32 reserved1;
+       u8 parent_tsf[4];       // fw_use[0] is boolean for OUR_TSF_IS_GREATER
+       u8 received_channel;    // The channel that this frame was received on.
+       // Note that for .11b this does not have to be
+       // the same as the channel that it was sent.
+       // Filled by LMAC
        u8 frameStatus;
        u8 rate;
        u8 rssi;
@@ -582,14 +539,14 @@ struct ipw_rx_frame {
        u16 signal;
        u16 noise;
        u8 antennaAndPhy;
-       u8 control;           // control bit should be on in bg
-       u8 rtscts_rate;       // rate of rts or cts (in rts cts sequence rate 
-                             // is identical)
-       u8 rtscts_seen;       // 0x1 RTS seen ; 0x2 CTS seen
+       u8 control;             // control bit should be on in bg
+       u8 rtscts_rate;         // rate of rts or cts (in rts cts sequence rate
+       // is identical)
+       u8 rtscts_seen;         // 0x1 RTS seen ; 0x2 CTS seen
        u16 length;
        u8 data[0];
 } __attribute__ ((packed));
-                    
+
 struct ipw_rx_header {
        u8 message_type;
        u8 rx_seq_num;
@@ -597,8 +554,7 @@ struct ipw_rx_header {
        u8 reserved;
 } __attribute__ ((packed));
 
-struct ipw_rx_packet
-{
+struct ipw_rx_packet {
        struct ipw_rx_header header;
        union {
                struct ipw_rx_frame frame;
@@ -615,21 +571,20 @@ struct ipw_rx_mem_buffer {
        struct ipw_rx_buffer *rxb;
        struct sk_buff *skb;
        struct list_head list;
-}; /* Not transferred over network, so not  __attribute__ ((packed)) */
+};                             /* Not transferred over network, so not  __attribute__ ((packed)) */
 
 struct ipw_rx_queue {
        struct ipw_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
        struct ipw_rx_mem_buffer *queue[RX_QUEUE_SIZE];
-       u32 processed; /* Internal index to last handled Rx packet */
-       u32 read;      /* Shared index to newest available Rx buffer */
-       u32 write;     /* Shared index to oldest written Rx packet */
-       u32 free_count;/* Number of pre-allocated buffers in rx_free */
+       u32 processed;          /* Internal index to last handled Rx packet */
+       u32 read;               /* Shared index to newest available Rx buffer */
+       u32 write;              /* Shared index to oldest written Rx packet */
+       u32 free_count;         /* Number of pre-allocated buffers in rx_free */
        /* Each of these lists is used as a FIFO for ipw_rx_mem_buffers */
-       struct list_head rx_free;  /* Own an SKBs */
-       struct list_head rx_used;  /* No SKB allocated */
+       struct list_head rx_free;       /* Own an SKBs */
+       struct list_head rx_used;       /* No SKB allocated */
        spinlock_t lock;
-}; /* Not transferred over network, so not  __attribute__ ((packed)) */
-
+};                             /* Not transferred over network, so not  __attribute__ ((packed)) */
 
 struct alive_command_responce {
        u8 alive_command;
@@ -653,8 +608,7 @@ struct ipw_rates {
        u8 rates[IPW_MAX_RATES];
 } __attribute__ ((packed));
 
-struct command_block
-{
+struct command_block {
        unsigned int control;
        u32 source_addr;
        u32 dest_addr;
@@ -662,18 +616,16 @@ struct command_block
 } __attribute__ ((packed));
 
 #define CB_NUMBER_OF_ELEMENTS_SMALL 64
-struct fw_image_desc
-{
+struct fw_image_desc {
        unsigned long last_cb_index;
        unsigned long current_cb_index;
        struct command_block cb_list[CB_NUMBER_OF_ELEMENTS_SMALL];
-       void * v_addr;
+       void *v_addr;
        unsigned long p_addr;
        unsigned long len;
 };
 
-struct ipw_sys_config
-{
+struct ipw_sys_config {
        u8 bt_coexistence;
        u8 reserved1;
        u8 answer_broadcast_ssid_probe;
@@ -696,8 +648,7 @@ struct ipw_sys_config
        u8 reserved3;
 } __attribute__ ((packed));
 
-struct ipw_multicast_addr
-{
+struct ipw_multicast_addr {
        u8 num_of_multicast_addresses;
        u8 reserved[3];
        u8 mac1[6];
@@ -706,8 +657,7 @@ struct ipw_multicast_addr
        u8 mac4[6];
 } __attribute__ ((packed));
 
-struct ipw_wep_key
-{
+struct ipw_wep_key {
        u8 cmd_id;
        u8 seq_num;
        u8 key_index;
@@ -715,9 +665,8 @@ struct ipw_wep_key
        u8 key[16];
 } __attribute__ ((packed));
 
-struct ipw_tgi_tx_key
-{ 
-       u8 key_id;  
+struct ipw_tgi_tx_key {
+       u8 key_id;
        u8 security_type;
        u8 station_index;
        u8 flags;
@@ -727,8 +676,7 @@ struct ipw_tgi_tx_key
 
 #define IPW_SCAN_CHANNELS 54
 
-struct ipw_scan_request 
-{
+struct ipw_scan_request {
        u8 scan_type;
        u16 dwell_time;
        u8 channels_list[IPW_SCAN_CHANNELS];
@@ -744,8 +692,7 @@ enum {
        IPW_SCAN_TYPES
 };
 
-struct ipw_scan_request_ext
-{
+struct ipw_scan_request_ext {
        u32 full_scan_index;
        u8 channels_list[IPW_SCAN_CHANNELS];
        u8 scan_type[IPW_SCAN_CHANNELS / 2];
@@ -753,7 +700,7 @@ struct ipw_scan_request_ext
        u16 dwell_time[IPW_SCAN_TYPES];
 } __attribute__ ((packed));
 
-extern inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index) 
+extern inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index)
 {
        if (index % 2)
                return scan->scan_type[index / 2] & 0x0F;
@@ -761,24 +708,21 @@ extern inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index)
                return (scan->scan_type[index / 2] & 0xF0) >> 4;
 }
 
-extern inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan, 
+extern inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan,
                                     u8 index, u8 scan_type)
 {
-       if (index % 2) 
-               scan->scan_type[index / 2] = 
-                       (scan->scan_type[index / 2] & 0xF0) | 
-                       (scan_type & 0x0F);
+       if (index % 2)
+               scan->scan_type[index / 2] =
+                   (scan->scan_type[index / 2] & 0xF0) | (scan_type & 0x0F);
        else
-               scan->scan_type[index / 2] = 
-                       (scan->scan_type[index / 2] & 0x0F) | 
-                       ((scan_type & 0x0F) << 4);
+               scan->scan_type[index / 2] =
+                   (scan->scan_type[index / 2] & 0x0F) |
+                   ((scan_type & 0x0F) << 4);
 }
 
-struct ipw_associate
-{
+struct ipw_associate {
        u8 channel;
-       u8 auth_type:4,
-          auth_key:4;
+       u8 auth_type:4, auth_key:4;
        u8 assoc_type;
        u8 reserved;
        u16 policy_support;
@@ -797,8 +741,7 @@ struct ipw_associate
        u16 reserved2;
 } __attribute__ ((packed));
 
-struct ipw_supported_rates
-{
+struct ipw_supported_rates {
        u8 ieee_mode;
        u8 num_rates;
        u8 purpose;
@@ -806,42 +749,36 @@ struct ipw_supported_rates
        u8 supported_rates[IPW_MAX_RATES];
 } __attribute__ ((packed));
 
-struct ipw_rts_threshold
-{
+struct ipw_rts_threshold {
        u16 rts_threshold;
        u16 reserved;
 } __attribute__ ((packed));
 
-struct ipw_frag_threshold
-{
+struct ipw_frag_threshold {
        u16 frag_threshold;
        u16 reserved;
 } __attribute__ ((packed));
 
-struct ipw_retry_limit
-{
+struct ipw_retry_limit {
        u8 short_retry_limit;
        u8 long_retry_limit;
        u16 reserved;
 } __attribute__ ((packed));
 
-struct ipw_dino_config
-{
+struct ipw_dino_config {
        u32 dino_config_addr;
        u16 dino_config_size;
        u8 dino_response;
        u8 reserved;
 } __attribute__ ((packed));
 
-struct ipw_aironet_info
-{
+struct ipw_aironet_info {
        u8 id;
        u8 length;
        u16 reserved;
 } __attribute__ ((packed));
 
-struct ipw_rx_key
-{
+struct ipw_rx_key {
        u8 station_index;
        u8 key_type;
        u8 key_id;
@@ -852,23 +789,20 @@ struct ipw_rx_key
        u8 reserved;
 } __attribute__ ((packed));
 
-struct ipw_country_channel_info
-{
+struct ipw_country_channel_info {
        u8 first_channel;
        u8 no_channels;
        s8 max_tx_power;
 } __attribute__ ((packed));
 
-struct ipw_country_info
-{
+struct ipw_country_info {
        u8 id;
        u8 length;
        u8 country_str[3];
        struct ipw_country_channel_info groups[7];
 } __attribute__ ((packed));
 
-struct ipw_channel_tx_power
-{
+struct ipw_channel_tx_power {
        u8 channel_number;
        s8 tx_power;
 } __attribute__ ((packed));
@@ -878,15 +812,13 @@ struct ipw_channel_tx_power
 #define MAX_A_CHANNELS  37
 #define MAX_B_CHANNELS  14
 
-struct ipw_tx_power
-{
+struct ipw_tx_power {
        u8 num_channels;
        u8 ieee_mode;
        struct ipw_channel_tx_power channels_tx_power[MAX_A_CHANNELS];
 } __attribute__ ((packed));
 
-struct ipw_qos_parameters
-{
+struct ipw_qos_parameters {
        u16 cw_min[4];
        u16 cw_max[4];
        u8 aifs[4];
@@ -894,48 +826,47 @@ struct ipw_qos_parameters
        u16 tx_op_limit[4];
 } __attribute__ ((packed));
 
-struct ipw_rsn_capabilities
-{
+struct ipw_rsn_capabilities {
        u8 id;
        u8 length;
        u16 version;
 } __attribute__ ((packed));
 
-struct ipw_sensitivity_calib
-{
+struct ipw_sensitivity_calib {
        u16 beacon_rssi_raw;
        u16 reserved;
 } __attribute__ ((packed));
 
 /**
  * Host command structure.
- * 
+ *
  * On input, the following fields should be filled:
  * - cmd
  * - len
  * - status_len
  * - param (if needed)
- * 
- * On output, 
+ *
+ * On output,
  * - \a status contains status;
  * - \a param filled with status parameters.
  */
 struct ipw_cmd {
-  u32 cmd;         /**< Host command */
-  u32 status;      /**< Status */
-  u32 status_len;  /**< How many 32 bit parameters in the status */
-  u32 len;         /**< incoming parameters length, bytes */
+       u32 cmd;   /**< Host command */
+       u32 status;/**< Status */
+       u32 status_len;
+                  /**< How many 32 bit parameters in the status */
+       u32 len;   /**< incoming parameters length, bytes */
   /**
-   * command parameters. 
-   * There should be enough space for incoming and 
+   * command parameters.
+   * There should be enough space for incoming and
    * outcoming parameters.
    * Incoming parameters listed 1-st, followed by outcoming params.
    * nParams=(len+3)/4+status_len
    */
-  u32 param[0];
+       u32 param[0];
 } __attribute__ ((packed));
 
-#define STATUS_HCMD_ACTIVE      (1<<0)  /**< host command in progress */
+#define STATUS_HCMD_ACTIVE      (1<<0) /**< host command in progress */
 
 #define STATUS_INT_ENABLED      (1<<1)
 #define STATUS_RF_KILL_HW       (1<<2)
@@ -955,18 +886,18 @@ struct ipw_cmd {
 #define STATUS_STATE_PENDING    (1<<13)
 
 #define STATUS_SCAN_PENDING     (1<<20)
-#define STATUS_SCANNING         (1<<21) 
-#define STATUS_SCAN_ABORTING    (1<<22) 
+#define STATUS_SCANNING         (1<<21)
+#define STATUS_SCAN_ABORTING    (1<<22)
 
-#define STATUS_INDIRECT_BYTE    (1<<28) /* sysfs entry configured for access */
-#define STATUS_INDIRECT_DWORD   (1<<29) /* sysfs entry configured for access */
-#define STATUS_DIRECT_DWORD     (1<<30) /* sysfs entry configured for access */
+#define STATUS_INDIRECT_BYTE    (1<<28)        /* sysfs entry configured for access */
+#define STATUS_INDIRECT_DWORD   (1<<29)        /* sysfs entry configured for access */
+#define STATUS_DIRECT_DWORD     (1<<30)        /* sysfs entry configured for access */
 
-#define STATUS_SECURITY_UPDATED (1<<31) /* Security sync needed */
+#define STATUS_SECURITY_UPDATED (1<<31)        /* Security sync needed */
 
-#define CFG_STATIC_CHANNEL      (1<<0) /* Restrict assoc. to single channel */
-#define CFG_STATIC_ESSID        (1<<1) /* Restrict assoc. to single SSID */
-#define CFG_STATIC_BSSID        (1<<2) /* Restrict assoc. to single BSSID */
+#define CFG_STATIC_CHANNEL      (1<<0) /* Restrict assoc. to single channel */
+#define CFG_STATIC_ESSID        (1<<1) /* Restrict assoc. to single SSID */
+#define CFG_STATIC_BSSID        (1<<2) /* Restrict assoc. to single BSSID */
 #define CFG_CUSTOM_MAC          (1<<3)
 #define CFG_PREAMBLE            (1<<4)
 #define CFG_ADHOC_PERSIST       (1<<5)
@@ -974,8 +905,8 @@ struct ipw_cmd {
 #define CFG_FIXED_RATE          (1<<7)
 #define CFG_ADHOC_CREATE        (1<<8)
 
-#define CAP_SHARED_KEY          (1<<0) /* Off = OPEN */
-#define CAP_PRIVACY_ON          (1<<1) /* Off = No privacy */
+#define CAP_SHARED_KEY          (1<<0) /* Off = OPEN */
+#define CAP_PRIVACY_ON          (1<<1) /* Off = No privacy */
 
 #define MAX_STATIONS            32
 #define IPW_INVALID_STATION     (0xff)
@@ -1009,14 +940,14 @@ struct ipw_priv {
        /* pci hardware address support */
        void __iomem *hw_base;
        unsigned long hw_len;
-       
+
        struct fw_image_desc sram_desc;
 
        /* result of ucode download */
        struct alive_command_responce dino_alive;
 
-       wait_queue_head_t wait_command_queue;
-       wait_queue_head_t wait_state;
+       wait_queue_head_t wait_command_queue;
+       wait_queue_head_t wait_state;
 
        /* Rx and Tx DMA processing queues */
        struct ipw_rx_queue *rxq;
@@ -1032,28 +963,28 @@ struct ipw_priv {
        struct average average_rssi;
        struct average average_noise;
        u32 port_type;
-       int rx_bufs_min;          /**< minimum number of bufs in Rx queue */
-       int rx_pend_max;          /**< maximum pending buffers for one IRQ */
-       u32 hcmd_seq;             /**< sequence number for hcmd */
+       int rx_bufs_min;          /**< minimum number of bufs in Rx queue */
+       int rx_pend_max;          /**< maximum pending buffers for one IRQ */
+       u32 hcmd_seq;             /**< sequence number for hcmd */
        u32 missed_beacon_threshold;
-       u32 roaming_threshold; 
+       u32 roaming_threshold;
 
        struct ipw_associate assoc_request;
        struct ieee80211_network *assoc_network;
 
        unsigned long ts_scan_abort;
        struct ipw_supported_rates rates;
-       struct ipw_rates phy[3];           /**< PHY restrictions, per band */
-       struct ipw_rates supp;             /**< software defined */
-       struct ipw_rates extended;         /**< use for corresp. IE, AP only */
+       struct ipw_rates phy[3];           /**< PHY restrictions, per band */
+       struct ipw_rates supp;             /**< software defined */
+       struct ipw_rates extended;         /**< use for corresp. IE, AP only */
 
        struct notif_link_deterioration last_link_deterioration; /** for statistics */
-       struct ipw_cmdhcmd; /**< host command currently executed */
+       struct ipw_cmd *hcmd; /**< host command currently executed */
 
        wait_queue_head_t hcmd_wq;     /**< host command waits for execution */
-       u32 tsf_bcn[2];              /**< TSF from latest beacon */
+       u32 tsf_bcn[2];              /**< TSF from latest beacon */
 
-       struct notif_calibration calib; /**< last calibration */
+       struct notif_calibration calib; /**< last calibration */
 
        /* ordinal interface with firmware */
        u32 table0_addr;
@@ -1071,11 +1002,11 @@ struct ipw_priv {
        u8 channel;
        struct ipw_sys_config sys_config;
        u32 power_mode;
-       u8 bssid[ETH_ALEN];  
+       u8 bssid[ETH_ALEN];
        u16 rts_threshold;
        u8 mac_addr[ETH_ALEN];
        u8 num_stations;
-       u8 stations[MAX_STATIONS][ETH_ALEN]; 
+       u8 stations[MAX_STATIONS][ETH_ALEN];
 
        u32 notif_missed_beacons;
 
@@ -1093,14 +1024,14 @@ struct ipw_priv {
        u32 tx_packets;
        u32 quality;
 
-        /* eeprom */
-       u8 eeprom[0x100];  /* 256 bytes of eeprom */  
+       /* eeprom */
+       u8 eeprom[0x100];       /* 256 bytes of eeprom */
        int eeprom_delay;
 
-       struct iw_statistics wstats; 
+       struct iw_statistics wstats;
 
        struct workqueue_struct *workqueue;
-       
+
        struct work_struct adhoc_check;
        struct work_struct associate;
        struct work_struct disassociate;
@@ -1117,7 +1048,6 @@ struct ipw_priv {
 
        struct tasklet_struct irq_tasklet;
 
-
 #define IPW_2200BG  1
 #define IPW_2915ABG 2
        u8 adapter;
@@ -1125,7 +1055,7 @@ struct ipw_priv {
 #define IPW_DEFAULT_TX_POWER 0x14
        u8 tx_power;
 
-#ifdef CONFIG_PM       
+#ifdef CONFIG_PM
        u32 pm_state[16];
 #endif
 
@@ -1140,7 +1070,6 @@ struct ipw_priv {
        u32 indirect_byte;
 };                             /*ipw_priv */
 
-
 /* debug macros */
 
 #ifdef CONFIG_IPW_DEBUG
@@ -1159,7 +1088,7 @@ do { if (ipw_debug_level & (level)) \
  * list here in the form of:
  *
  * #define IPW_DL_xxxx VALUE
- * 
+ *
  * shifting value to the left one bit from the previous entry.  xxxx should be
  * the name of the classification (for example, WEP)
  *
@@ -1173,7 +1102,7 @@ do { if (ipw_debug_level & (level)) \
  *
  * you simply need to add your entry to the ipw_debug_levels array.
  *
- * If you do not see debug_level in /proc/net/ipw then you do not have 
+ * If you do not see debug_level in /proc/net/ipw then you do not have
  * CONFIG_IPW_DEBUG defined in your kernel configuration
  *
  */
@@ -1196,7 +1125,6 @@ do { if (ipw_debug_level & (level)) \
 #define IPW_DL_RF_KILL       (1<<17)
 #define IPW_DL_FW_ERRORS     (1<<18)
 
-
 #define IPW_DL_ORD           (1<<20)
 
 #define IPW_DL_FRAG          (1<<21)
@@ -1210,7 +1138,6 @@ do { if (ipw_debug_level & (level)) \
 
 #define IPW_DL_STATS         (1<<29)
 
-
 #define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
 #define IPW_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
 #define IPW_DEBUG_INFO(f, a...)    IPW_DEBUG(IPW_DL_INFO, f, ## a)
@@ -1247,7 +1174,7 @@ do { if (ipw_debug_level & (level)) \
 
 #define DINO_ENABLE_SYSTEM 0x80
 #define DINO_ENABLE_CS     0x40
-#define DINO_RXFIFO_DATA   0x01        
+#define DINO_RXFIFO_DATA   0x01
 #define DINO_CONTROL_REG   0x00200000
 
 #define CX2_INTA_RW       0x00000008
@@ -1279,12 +1206,12 @@ do { if (ipw_debug_level & (level)) \
 /*
  * RESET Register Bit Indexes
  */
-#define CBD_RESET_REG_PRINCETON_RESET 0x00000001  /* Bit 0 (LSB) */
-#define CX2_RESET_REG_SW_RESET        0x00000080  /* Bit 7       */
-#define CX2_RESET_REG_MASTER_DISABLED 0x00000100  /* Bit 8       */
-#define CX2_RESET_REG_STOP_MASTER     0x00000200  /* Bit 9       */
-#define CX2_ARC_KESHET_CONFIG         0x08000000  /* Bit 27      */
-#define CX2_START_STANDBY             0x00000004  /* Bit 2       */
+#define CBD_RESET_REG_PRINCETON_RESET 0x00000001       /* Bit 0 (LSB) */
+#define CX2_RESET_REG_SW_RESET        0x00000080       /* Bit 7       */
+#define CX2_RESET_REG_MASTER_DISABLED 0x00000100       /* Bit 8       */
+#define CX2_RESET_REG_STOP_MASTER     0x00000200       /* Bit 9       */
+#define CX2_ARC_KESHET_CONFIG         0x08000000       /* Bit 27      */
+#define CX2_START_STANDBY             0x00000004       /* Bit 2       */
 
 #define CX2_CSR_CIS_UPPER_BOUND        0x00000200
 #define CX2_DOMAIN_0_END 0x1000
@@ -1315,13 +1242,11 @@ do { if (ipw_debug_level & (level)) \
 #define CB_SRC_SIZE_LONG  0x00200000
 #define CB_DEST_SIZE_LONG 0x00020000
 
-
 /* DMA DEFINES */
 
 #define DMA_CONTROL_SMALL_CB_CONST_VALUE 0x00540000
 #define DMA_CB_STOP_AND_ABORT            0x00000C00
-#define DMA_CB_START                     0x00000100 
-
+#define DMA_CB_START                     0x00000100
 
 #define CX2_SHARED_SRAM_SIZE               0x00030000
 #define CX2_SHARED_SRAM_DMA_CONTROL        0x00027000
@@ -1330,7 +1255,6 @@ do { if (ipw_debug_level & (level)) \
 #define CX2_HOST_EEPROM_DATA_SRAM_SIZE 0xA18
 #define CX2_EEPROM_IMAGE_SIZE          0x100
 
-
 /* DMA defs */
 #define CX2_DMA_I_CURRENT_CB  0x003000D0
 #define CX2_DMA_O_CURRENT_CB  0x003000D4
@@ -1382,7 +1306,6 @@ do { if (ipw_debug_level & (level)) \
 #define IPW_WHO_IS_AWAKE             (CX2_SHARED_LOWER_BOUND + 0xB14)
 #define IPW_DURING_ATIM_WINDOW       (CX2_SHARED_LOWER_BOUND + 0xB18)
 
-
 #define MSB                             1
 #define LSB                             0
 #define WORD_TO_BYTE(_word)             ((_word) * sizeof(u16))
@@ -1391,16 +1314,16 @@ do { if (ipw_debug_level & (level)) \
     ( WORD_TO_BYTE(_wordoffset) + (_byteoffset) )
 
 /* EEPROM access by BYTE */
-#define EEPROM_PME_CAPABILITY   (GET_EEPROM_ADDR(0x09,MSB))     /* 1 byte   */
-#define EEPROM_MAC_ADDRESS      (GET_EEPROM_ADDR(0x21,LSB))     /* 6 byte   */
-#define EEPROM_VERSION          (GET_EEPROM_ADDR(0x24,MSB))     /* 1 byte   */
-#define EEPROM_NIC_TYPE         (GET_EEPROM_ADDR(0x25,LSB))     /* 1 byte   */
-#define EEPROM_SKU_CAPABILITY   (GET_EEPROM_ADDR(0x25,MSB))     /* 1 byte   */
-#define EEPROM_COUNTRY_CODE     (GET_EEPROM_ADDR(0x26,LSB))     /* 3 bytes  */
-#define EEPROM_IBSS_CHANNELS_BG (GET_EEPROM_ADDR(0x28,LSB))     /* 2 bytes  */
-#define EEPROM_IBSS_CHANNELS_A  (GET_EEPROM_ADDR(0x29,MSB))     /* 5 bytes  */
-#define EEPROM_BSS_CHANNELS_BG  (GET_EEPROM_ADDR(0x2c,LSB))     /* 2 bytes  */
-#define EEPROM_HW_VERSION       (GET_EEPROM_ADDR(0x72,LSB))     /* 2 bytes  */
+#define EEPROM_PME_CAPABILITY   (GET_EEPROM_ADDR(0x09,MSB))    /* 1 byte   */
+#define EEPROM_MAC_ADDRESS      (GET_EEPROM_ADDR(0x21,LSB))    /* 6 byte   */
+#define EEPROM_VERSION          (GET_EEPROM_ADDR(0x24,MSB))    /* 1 byte   */
+#define EEPROM_NIC_TYPE         (GET_EEPROM_ADDR(0x25,LSB))    /* 1 byte   */
+#define EEPROM_SKU_CAPABILITY   (GET_EEPROM_ADDR(0x25,MSB))    /* 1 byte   */
+#define EEPROM_COUNTRY_CODE     (GET_EEPROM_ADDR(0x26,LSB))    /* 3 bytes  */
+#define EEPROM_IBSS_CHANNELS_BG (GET_EEPROM_ADDR(0x28,LSB))    /* 2 bytes  */
+#define EEPROM_IBSS_CHANNELS_A  (GET_EEPROM_ADDR(0x29,MSB))    /* 5 bytes  */
+#define EEPROM_BSS_CHANNELS_BG  (GET_EEPROM_ADDR(0x2c,LSB))    /* 2 bytes  */
+#define EEPROM_HW_VERSION       (GET_EEPROM_ADDR(0x72,LSB))    /* 2 bytes  */
 
 /* NIC type as found in the one byte EEPROM_NIC_TYPE  offset*/
 #define EEPROM_NIC_TYPE_STANDARD        0
@@ -1410,7 +1333,7 @@ do { if (ipw_debug_level & (level)) \
 #define EEPROM_NIC_TYPE_HP              4
 
 #define FW_MEM_REG_LOWER_BOUND          0x00300000
-#define FW_MEM_REG_EEPROM_ACCESS        (FW_MEM_REG_LOWER_BOUND + 0x40)        
+#define FW_MEM_REG_EEPROM_ACCESS        (FW_MEM_REG_LOWER_BOUND + 0x40)
 
 #define EEPROM_BIT_SK                   (1<<0)
 #define EEPROM_BIT_CS                   (1<<1)
@@ -1505,16 +1428,15 @@ enum {
 #define IPW_RATE_CAPABILITIES 1
 #define IPW_RATE_CONNECT      0
 
-
-/* 
- * Rate values and masks 
+/*
+ * Rate values and masks
  */
 #define IPW_TX_RATE_1MB  0x0A
 #define IPW_TX_RATE_2MB  0x14
 #define IPW_TX_RATE_5MB  0x37
 #define IPW_TX_RATE_6MB  0x0D
 #define IPW_TX_RATE_9MB  0x0F
-#define IPW_TX_RATE_11MB 0x6E  
+#define IPW_TX_RATE_11MB 0x6E
 #define IPW_TX_RATE_12MB 0x05
 #define IPW_TX_RATE_18MB 0x07
 #define IPW_TX_RATE_24MB 0x09
@@ -1525,68 +1447,56 @@ enum {
 #define IPW_ORD_TABLE_ID_MASK             0x0000FF00
 #define IPW_ORD_TABLE_VALUE_MASK          0x000000FF
 
-#define IPW_ORD_TABLE_0_MASK              0x0000F000  
-#define IPW_ORD_TABLE_1_MASK              0x0000F100  
-#define IPW_ORD_TABLE_2_MASK              0x0000F200  
-#define IPW_ORD_TABLE_3_MASK              0x0000F300  
-#define IPW_ORD_TABLE_4_MASK              0x0000F400  
-#define IPW_ORD_TABLE_5_MASK              0x0000F500  
-#define IPW_ORD_TABLE_6_MASK              0x0000F600  
-#define IPW_ORD_TABLE_7_MASK              0x0000F700  
+#define IPW_ORD_TABLE_0_MASK              0x0000F000
+#define IPW_ORD_TABLE_1_MASK              0x0000F100
+#define IPW_ORD_TABLE_2_MASK              0x0000F200
+#define IPW_ORD_TABLE_3_MASK              0x0000F300
+#define IPW_ORD_TABLE_4_MASK              0x0000F400
+#define IPW_ORD_TABLE_5_MASK              0x0000F500
+#define IPW_ORD_TABLE_6_MASK              0x0000F600
+#define IPW_ORD_TABLE_7_MASK              0x0000F700
 
 /*
  * Table 0 Entries (all entries are 32 bits)
  */
-enum {           
+enum {
        IPW_ORD_STAT_TX_CURR_RATE = IPW_ORD_TABLE_0_MASK + 1,
        IPW_ORD_STAT_FRAG_TRESHOLD,
        IPW_ORD_STAT_RTS_THRESHOLD,
-       IPW_ORD_STAT_TX_HOST_REQUESTS,              
-       IPW_ORD_STAT_TX_HOST_COMPLETE,              
-       IPW_ORD_STAT_TX_DIR_DATA,                  
+       IPW_ORD_STAT_TX_HOST_REQUESTS,
+       IPW_ORD_STAT_TX_HOST_COMPLETE,
+       IPW_ORD_STAT_TX_DIR_DATA,
        IPW_ORD_STAT_TX_DIR_DATA_B_1,
        IPW_ORD_STAT_TX_DIR_DATA_B_2,
        IPW_ORD_STAT_TX_DIR_DATA_B_5_5,
        IPW_ORD_STAT_TX_DIR_DATA_B_11,
        /* Hole */
 
-
-
-
-
-
-
        IPW_ORD_STAT_TX_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 19,
        IPW_ORD_STAT_TX_DIR_DATA_G_2,
        IPW_ORD_STAT_TX_DIR_DATA_G_5_5,
        IPW_ORD_STAT_TX_DIR_DATA_G_6,
        IPW_ORD_STAT_TX_DIR_DATA_G_9,
-       IPW_ORD_STAT_TX_DIR_DATA_G_11,        
+       IPW_ORD_STAT_TX_DIR_DATA_G_11,
        IPW_ORD_STAT_TX_DIR_DATA_G_12,
        IPW_ORD_STAT_TX_DIR_DATA_G_18,
        IPW_ORD_STAT_TX_DIR_DATA_G_24,
        IPW_ORD_STAT_TX_DIR_DATA_G_36,
        IPW_ORD_STAT_TX_DIR_DATA_G_48,
        IPW_ORD_STAT_TX_DIR_DATA_G_54,
-       IPW_ORD_STAT_TX_NON_DIR_DATA, 
+       IPW_ORD_STAT_TX_NON_DIR_DATA,
        IPW_ORD_STAT_TX_NON_DIR_DATA_B_1,
        IPW_ORD_STAT_TX_NON_DIR_DATA_B_2,
        IPW_ORD_STAT_TX_NON_DIR_DATA_B_5_5,
-       IPW_ORD_STAT_TX_NON_DIR_DATA_B_11,  
+       IPW_ORD_STAT_TX_NON_DIR_DATA_B_11,
        /* Hole */
 
-
-
-
-
-
-
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 44,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_2,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_5_5,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_6,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_9,
-       IPW_ORD_STAT_TX_NON_DIR_DATA_G_11,        
+       IPW_ORD_STAT_TX_NON_DIR_DATA_G_11,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_12,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_18,
        IPW_ORD_STAT_TX_NON_DIR_DATA_G_24,
@@ -1601,12 +1511,12 @@ enum {
        IPW_ORD_STAT_FULL_SCANS,
        IPW_ORD_STAT_PARTIAL_SCANS,
        IPW_ORD_STAT_TGH_ABORTED_SCANS,
-       IPW_ORD_STAT_TX_TOTAL_BYTES,    
+       IPW_ORD_STAT_TX_TOTAL_BYTES,
        IPW_ORD_STAT_CURR_RSSI_RAW,
        IPW_ORD_STAT_RX_BEACON,
        IPW_ORD_STAT_MISSED_BEACONS,
-       IPW_ORD_TABLE_0_LAST  
-};                       
+       IPW_ORD_TABLE_0_LAST
+};
 
 #define IPW_RSSI_TO_DBM 112
 
@@ -1626,15 +1536,15 @@ enum {
  * ADDAPTER_MAC:  6 byte MAC address
  * RTC:           4 byte clock
  */
-enum {           
+enum {
        IPW_ORD_STAT_FW_VERSION = IPW_ORD_TABLE_2_MASK | 1,
-       IPW_ORD_STAT_FW_DATE,   
+       IPW_ORD_STAT_FW_DATE,
        IPW_ORD_STAT_UCODE_VERSION,
-       IPW_ORD_STAT_UCODE_DATE,                     
-       IPW_ORD_STAT_ADAPTER_MAC,                    
-       IPW_ORD_STAT_RTC,     
-       IPW_ORD_TABLE_2_LAST                     
-};                      
+       IPW_ORD_STAT_UCODE_DATE,
+       IPW_ORD_STAT_ADAPTER_MAC,
+       IPW_ORD_STAT_RTC,
+       IPW_ORD_TABLE_2_LAST
+};
 
 /* Table 3 */
 enum {
@@ -1711,7 +1621,7 @@ struct host_cmd {
 #define CFG_BT_COEXISTENCE_WME_OVER_BT          0x08
 #define CFG_BT_COEXISTENCE_OOB                  0x10
 #define CFG_BT_COEXISTENCE_MAX                  0xFF
-#define CFG_BT_COEXISTENCE_DEF                  0x80 /* read Bt from EEPROM*/ 
+#define CFG_BT_COEXISTENCE_DEF                  0x80   /* read Bt from EEPROM */
 
 #define CFG_CTS_TO_ITSELF_ENABLED_MIN  0x0
 #define CFG_CTS_TO_ITSELF_ENABLED_MAX  0x1
@@ -1722,9 +1632,9 @@ struct host_cmd {
 #define CFG_SYS_ANTENNA_B                         0x003
 
 /*
- * The definitions below were lifted off the ipw2100 driver, which only 
+ * The definitions below were lifted off the ipw2100 driver, which only
  * supports 'b' mode, so I'm sure these are not exactly correct.
- * 
+ *
  * Somebody fix these!!
  */
 #define REG_MIN_CHANNEL             0
@@ -1733,31 +1643,31 @@ struct host_cmd {
 #define REG_CHANNEL_MASK            0x00003FFF
 #define IPW_IBSS_11B_DEFAULT_MASK   0x87ff
 
-static const long ipw_frequencies[] = {  
-       2412, 2417, 2422, 2427, 
-       2432, 2437, 2442, 2447, 
-       2452, 2457, 2462, 2467, 
-       2472, 2484  
+static const long ipw_frequencies[] = {
+       2412, 2417, 2422, 2427,
+       2432, 2437, 2442, 2447,
+       2452, 2457, 2462, 2467,
+       2472, 2484
 };
 
 #define FREQ_COUNT ARRAY_SIZE(ipw_frequencies)
 
 #define IPW_MAX_CONFIG_RETRIES 10
 
-static inline u32 frame_hdr_len(struct ieee80211_hdr *hdr)
+static inline u32 frame_hdr_len(struct ieee80211_hdr_4addr *hdr)
 {
        u32 retval;
        u16 fc;
 
-       retval = sizeof(struct ieee80211_hdr);
+       retval = sizeof(struct ieee80211_hdr_3addr);
        fc = le16_to_cpu(hdr->frame_ctl);
 
        /*
-        * Function     ToDS    FromDS
-        * IBSS         0       0
-        * To AP        1       0
-        * From AP      0       1
-        * WDS (bridge) 1       1
+        * Function     ToDS    FromDS
+        * IBSS         0       0
+        * To AP        1       0
+        * From AP      0       1
+        * WDS (bridge) 1       1
         *
         * Only WDS frames use Address4 among them. --YZ
         */
@@ -1767,4 +1677,4 @@ static inline u32 frame_hdr_len(struct ieee80211_hdr *hdr)
        return retval;
 }
 
-#endif /* __ipw2200_h__ */
+#endif                         /* __ipw2200_h__ */