Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0edd5b44 authored by Jeff Garzik's avatar Jeff Garzik
Browse files

[wireless ieee80211,ipw2200] Lindent source code

No code changes, just Lindent + manual fixups.

This prepares us for updating to the latest Intel driver code, plus
gives the source code a nice facelift.
parent bbeec90b
Loading
Loading
Loading
Loading
+1150 −1120

File changed.

Preview size limit exceeded, changes collapsed.

+171 −235
Original line number Diff line number Diff line
@@ -56,8 +56,7 @@
#include <linux/workqueue.h>

/* 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,
@@ -74,7 +73,6 @@ enum connection_manager_assoc_states
	CMAS_LAST
};


#define IPW_WAIT                     (1<<0)
#define IPW_QUIET                    (1<<1)
#define IPW_ROAMING                  (1<<2)
@@ -190,7 +188,6 @@ enum connection_manager_assoc_states
#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
@@ -252,8 +249,7 @@ struct clx2_queue {
	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];
@@ -264,8 +260,7 @@ struct machdr32
	u16 qos_ctrl;
} __attribute__ ((packed));

struct machdr30
{
struct machdr30 {
	u16 frame_ctl;
	u16 duration;		// watch out for endians!
	u8 addr1[MACADRR_BYTE_LEN];
@@ -275,8 +270,7 @@ struct machdr30
	u8 addr4[MACADRR_BYTE_LEN];
} __attribute__ ((packed));

struct machdr26
{
struct machdr26 {
	u16 frame_ctl;
	u16 duration;		// watch out for endians!
	u8 addr1[MACADRR_BYTE_LEN];
@@ -286,8 +280,7 @@ struct machdr26
	u16 qos_ctrl;
} __attribute__ ((packed));

struct machdr24
{
struct machdr24 {
	u16 frame_ctl;
	u16 duration;		// watch out for endians!
	u8 addr1[MACADRR_BYTE_LEN];
@@ -297,23 +290,20 @@ struct machdr24
} __attribute__ ((packed));

// TX TFD with 32 byte MAC Header
struct tx_tfd_32
{
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 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 tx_tfd_26 {
	struct machdr26 mchdr;	// 26
	u8 reserved1[2];	// 2
	u32 uivplaceholder[2];	// 8
@@ -321,18 +311,15 @@ struct tx_tfd_26
} __attribute__ ((packed));

// tx tfd with 24 byte mac header
struct tx_tfd_24
{
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;
@@ -365,8 +352,7 @@ struct tfd_data {
	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;
@@ -379,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;
@@ -390,8 +375,7 @@ 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;
@@ -423,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];
@@ -571,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;
@@ -604,7 +586,6 @@ struct ipw_rx_queue {
	spinlock_t lock;
};				/* Not transferred over network, so not  __attribute__ ((packed)) */


struct alive_command_responce {
	u8 alive_command;
	u8 sequence_number;
@@ -627,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;
@@ -636,8 +616,7 @@ 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];
@@ -646,8 +625,7 @@ struct fw_image_desc
	unsigned long len;
};

struct ipw_sys_config
{
struct ipw_sys_config {
	u8 bt_coexistence;
	u8 reserved1;
	u8 answer_broadcast_ssid_probe;
@@ -670,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];
@@ -680,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;
@@ -689,8 +665,7 @@ struct ipw_wep_key
	u8 key[16];
} __attribute__ ((packed));

struct ipw_tgi_tx_key
{
struct ipw_tgi_tx_key {
	u8 key_id;
	u8 security_type;
	u8 station_index;
@@ -701,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];
@@ -718,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];
@@ -740,19 +713,16 @@ extern inline void ipw_set_scan_type(struct ipw_scan_request_ext *scan,
{
	if (index % 2)
		scan->scan_type[index / 2] =
			(scan->scan_type[index / 2] & 0xF0) |
			(scan_type & 0x0F);
		    (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);
}

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;
@@ -771,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;
@@ -780,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;
@@ -826,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));
@@ -852,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];
@@ -868,15 +826,13 @@ 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));
@@ -897,7 +853,8 @@ struct ipw_sensitivity_calib
struct ipw_cmd {
	u32 cmd;   /**< Host command */
	u32 status;/**< Status */
  u32 status_len;  /**< How many 32 bit parameters in the status */
	u32 status_len;
		   /**< How many 32 bit parameters in the status */
	u32 len;   /**< incoming parameters length, bytes */
  /**
   * command parameters.
@@ -1091,7 +1048,6 @@ struct ipw_priv {

	struct tasklet_struct irq_tasklet;


#define IPW_2200BG  1
#define IPW_2915ABG 2
	u8 adapter;
@@ -1114,7 +1070,6 @@ struct ipw_priv {
	u32 indirect_byte;
};				/*ipw_priv */


/* debug macros */

#ifdef CONFIG_IPW_DEBUG
@@ -1170,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)
@@ -1184,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)
@@ -1289,14 +1242,12 @@ 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 CX2_SHARED_SRAM_SIZE               0x00030000
#define CX2_SHARED_SRAM_DMA_CONTROL        0x00027000
#define CB_MAX_LENGTH                      0x1FFF
@@ -1304,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
@@ -1356,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))
@@ -1479,7 +1428,6 @@ enum {
#define IPW_RATE_CAPABILITIES 1
#define IPW_RATE_CONNECT      0


/*
 * Rate values and masks
 */
@@ -1524,12 +1472,6 @@ enum {
	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,
@@ -1549,12 +1491,6 @@ enum {
	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,
+13 −14
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ struct ieee80211_crypto_alg {
	struct ieee80211_crypto_ops *ops;
};


struct ieee80211_crypto {
	struct list_head algs;
	spinlock_t lock;
@@ -38,8 +37,7 @@ struct ieee80211_crypto {

static struct ieee80211_crypto *hcrypt;

void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee,
					   int force)
void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, int force)
{
	struct list_head *ptr, *n;
	struct ieee80211_crypt_data *entry;
@@ -158,7 +156,6 @@ int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops)
	return del_alg ? 0 : -1;
}


struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name)
{
	unsigned long flags;
@@ -185,9 +182,13 @@ struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name)
		return NULL;
}


static void * ieee80211_crypt_null_init(int keyidx) { return (void *) 1; }
static void ieee80211_crypt_null_deinit(void *priv) {}
static void *ieee80211_crypt_null_init(int keyidx)
{
	return (void *)1;
}
static void ieee80211_crypt_null_deinit(void *priv)
{
}

static struct ieee80211_crypto_ops ieee80211_crypt_null = {
	.name			= "NULL",
@@ -204,7 +205,6 @@ static struct ieee80211_crypto_ops ieee80211_crypt_null = {
	.owner			= THIS_MODULE,
};


static int __init ieee80211_crypto_init(void)
{
	int ret = -ENOMEM;
@@ -226,7 +226,6 @@ out:
	return ret;
}


static void __exit ieee80211_crypto_deinit(void)
{
	struct list_head *ptr, *n;
+16 −31
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

#include <net/ieee80211.h>


#include <linux/crypto.h>
#include <asm/scatterlist.h>

@@ -104,7 +103,6 @@ fail:
	return NULL;
}


static void ieee80211_ccmp_deinit(void *priv)
{
	struct ieee80211_ccmp_data *_priv = priv;
@@ -113,7 +111,6 @@ static void ieee80211_ccmp_deinit(void *priv)
	kfree(priv);
}


static inline void xor_block(u8 * b, u8 * a, size_t len)
{
	int i;
@@ -121,11 +118,9 @@ static inline void xor_block(u8 *b, u8 *a, size_t len)
		b[i] ^= a[i];
}


static void ccmp_init_blocks(struct crypto_tfm *tfm,
			     struct ieee80211_hdr *hdr,
			     u8 *pn, size_t dlen, u8 *b0, u8 *auth,
			     u8 *s0)
			     u8 * pn, size_t dlen, u8 * b0, u8 * auth, u8 * s0)
{
	u8 *pos, qc = 0;
	size_t aad_len;
@@ -196,7 +191,6 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
	ieee80211_ccmp_aes_encrypt(tfm, b0, s0);
}


static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
	struct ieee80211_ccmp_data *key = priv;
@@ -209,8 +203,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
	u8 *s0 = key->tx_s0;

	if (skb_headroom(skb) < CCMP_HDR_LEN ||
	    skb_tailroom(skb) < CCMP_MIC_LEN ||
	    skb->len < hdr_len)
	    skb_tailroom(skb) < CCMP_MIC_LEN || skb->len < hdr_len)
		return -1;

	data_len = skb->len - hdr_len;
@@ -261,7 +254,6 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
	return 0;
}


static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
	struct ieee80211_ccmp_data *key = priv;
@@ -364,7 +356,6 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
	return keyidx;
}


static int ieee80211_ccmp_set_key(void *key, int len, u8 * seq, void *priv)
{
	struct ieee80211_ccmp_data *data = priv;
@@ -395,7 +386,6 @@ static int ieee80211_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
	return 0;
}


static int ieee80211_ccmp_get_key(void *key, int len, u8 * seq, void *priv)
{
	struct ieee80211_ccmp_data *data = priv;
@@ -419,7 +409,6 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
	return CCMP_TK_LEN;
}


static char *ieee80211_ccmp_print_stats(char *p, void *priv)
{
	struct ieee80211_ccmp_data *ccmp = priv;
@@ -436,7 +425,6 @@ static char * ieee80211_ccmp_print_stats(char *p, void *priv)
	return p;
}


static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = {
	.name			= "CCMP",
	.init			= ieee80211_ccmp_init,
@@ -453,18 +441,15 @@ static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = {
	.owner			= THIS_MODULE,
};


static int __init ieee80211_crypto_ccmp_init(void)
{
	return ieee80211_register_crypto_ops(&ieee80211_crypt_ccmp);
}


static void __exit ieee80211_crypto_ccmp_exit(void)
{
	ieee80211_unregister_crypto_ops(&ieee80211_crypt_ccmp);
}


module_init(ieee80211_crypto_ccmp_init);
module_exit(ieee80211_crypto_ccmp_exit);
+54 −79
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

#include <net/ieee80211.h>


#include <linux/crypto.h>
#include <asm/scatterlist.h>
#include <linux/crc32.h>
@@ -100,7 +99,6 @@ fail:
	return NULL;
}


static void ieee80211_tkip_deinit(void *priv)
{
	struct ieee80211_tkip_data *_priv = priv;
@@ -111,51 +109,42 @@ static void ieee80211_tkip_deinit(void *priv)
	kfree(priv);
}


static inline u16 RotR1(u16 val)
{
	return (val >> 1) | (val << 15);
}


static inline u8 Lo8(u16 val)
{
	return val & 0xff;
}


static inline u8 Hi8(u16 val)
{
	return val >> 8;
}


static inline u16 Lo16(u32 val)
{
	return val & 0xffff;
}


static inline u16 Hi16(u32 val)
{
	return val >> 16;
}


static inline u16 Mk16(u8 hi, u8 lo)
{
	return lo | (((u16) hi) << 8);
}


static inline u16 Mk16_le(u16 * v)
{
	return le16_to_cpu(*v);
}


static const u16 Sbox[256] =
{
static const u16 Sbox[256] = {
	0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
	0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A,
	0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B,
@@ -190,17 +179,16 @@ static const u16 Sbox[256] =
	0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A,
};


static inline u16 _S_(u16 v)
{
	u16 t = Sbox[Hi8(v)];
	return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8));
}


#define PHASE1_LOOP_COUNT 8

static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32)
static void tkip_mixing_phase1(u16 * TTAK, const u8 * TK, const u8 * TA,
			       u32 IV32)
{
	int i, j;

@@ -221,7 +209,6 @@ static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32)
	}
}


static void tkip_mixing_phase2(u8 * WEPSeed, const u8 * TK, const u16 * TTAK,
			       u16 IV16)
{
@@ -427,7 +414,6 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
	return keyidx;
}


static int michael_mic(struct ieee80211_tkip_data *tkey, u8 * key, u8 * hdr,
		       u8 * data, size_t data_len, u8 * mic)
{
@@ -482,8 +468,8 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
	hdr[13] = hdr[14] = hdr[15] = 0;	/* reserved */
}


static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv)
static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len,
				     void *priv)
{
	struct ieee80211_tkip_data *tkey = priv;
	u8 *pos;
@@ -504,11 +490,9 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
	return 0;
}


#if WIRELESS_EXT >= 18
static void ieee80211_michael_mic_failure(struct net_device *dev,
				       struct ieee80211_hdr *hdr,
				       int keyidx)
					  struct ieee80211_hdr *hdr, int keyidx)
{
	union iwreq_data wrqu;
	struct iw_michaelmicfailure ev;
@@ -528,8 +512,7 @@ static void ieee80211_michael_mic_failure(struct net_device *dev,
}
#elif WIRELESS_EXT >= 15
static void ieee80211_michael_mic_failure(struct net_device *dev,
				       struct ieee80211_hdr *hdr,
				       int keyidx)
					  struct ieee80211_hdr *hdr, int keyidx)
{
	union iwreq_data wrqu;
	char buf[128];
@@ -550,7 +533,6 @@ static inline void ieee80211_michael_mic_failure(struct net_device *dev,
}
#endif				/* WIRELESS_EXT >= 15 */


static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
					int hdr_len, void *priv)
{
@@ -587,7 +569,6 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
	return 0;
}


static int ieee80211_tkip_set_key(void *key, int len, u8 * seq, void *priv)
{
	struct ieee80211_tkip_data *tkey = priv;
@@ -617,7 +598,6 @@ static int ieee80211_tkip_set_key(void *key, int len, u8 *seq, void *priv)
	return 0;
}


static int ieee80211_tkip_get_key(void *key, int len, u8 * seq, void *priv)
{
	struct ieee80211_tkip_data *tkey = priv;
@@ -647,7 +627,6 @@ static int ieee80211_tkip_get_key(void *key, int len, u8 *seq, void *priv)
	return TKIP_KEY_LEN;
}


static char *ieee80211_tkip_print_stats(char *p, void *priv)
{
	struct ieee80211_tkip_data *tkip = priv;
@@ -674,7 +653,6 @@ static char * ieee80211_tkip_print_stats(char *p, void *priv)
	return p;
}


static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
	.name			= "TKIP",
	.init			= ieee80211_tkip_init,
@@ -691,18 +669,15 @@ static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
	.owner			= THIS_MODULE,
};


static int __init ieee80211_crypto_tkip_init(void)
{
	return ieee80211_register_crypto_ops(&ieee80211_crypt_tkip);
}


static void __exit ieee80211_crypto_tkip_exit(void)
{
	ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip);
}


module_init(ieee80211_crypto_tkip_init);
module_exit(ieee80211_crypto_tkip_exit);
Loading