Commit 8830cb67 authored by John Daiker's avatar John Daiker Committed by John W. Linville

atmel: checkpatch.pl cleanups

Before: 881 errors, 265 warnings, 4507 lines checked
After:  114 errors, 273 warnings, 4548 lines checked

This was mostly "space required after that ',' (ctx:VxV)".
Also a fair number of whitespace, code indent, and C99 comment cleanups.

New warnings introduced are all "line over 80 character"

md5sums are identical, as I skipped any fixes which may have altered the resulting binary.
Signed-off-by: default avatarJohn Daiker <daikerjohn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 62b4fb66
...@@ -95,7 +95,7 @@ static struct { ...@@ -95,7 +95,7 @@ static struct {
{ ATMEL_FW_TYPE_502_3COM, "atmel_at76c502_3com", "bin" }, { ATMEL_FW_TYPE_502_3COM, "atmel_at76c502_3com", "bin" },
{ ATMEL_FW_TYPE_504, "atmel_at76c504", "bin" }, { ATMEL_FW_TYPE_504, "atmel_at76c504", "bin" },
{ ATMEL_FW_TYPE_504_2958, "atmel_at76c504_2958", "bin" }, { ATMEL_FW_TYPE_504_2958, "atmel_at76c504_2958", "bin" },
{ ATMEL_FW_TYPE_504A_2958,"atmel_at76c504a_2958","bin" }, { ATMEL_FW_TYPE_504A_2958, "atmel_at76c504a_2958", "bin" },
{ ATMEL_FW_TYPE_506, "atmel_at76c506", "bin" }, { ATMEL_FW_TYPE_506, "atmel_at76c506", "bin" },
{ ATMEL_FW_TYPE_NONE, NULL, NULL } { ATMEL_FW_TYPE_NONE, NULL, NULL }
}; };
...@@ -106,35 +106,35 @@ static struct { ...@@ -106,35 +106,35 @@ static struct {
#define MAX_BSS_ENTRIES 64 #define MAX_BSS_ENTRIES 64
/* registers */ /* registers */
#define GCR 0x00 // (SIR0) General Configuration Register #define GCR 0x00 /* (SIR0) General Configuration Register */
#define BSR 0x02 // (SIR1) Bank Switching Select Register #define BSR 0x02 /* (SIR1) Bank Switching Select Register */
#define AR 0x04 #define AR 0x04
#define DR 0x08 #define DR 0x08
#define MR1 0x12 // Mirror Register 1 #define MR1 0x12 /* Mirror Register 1 */
#define MR2 0x14 // Mirror Register 2 #define MR2 0x14 /* Mirror Register 2 */
#define MR3 0x16 // Mirror Register 3 #define MR3 0x16 /* Mirror Register 3 */
#define MR4 0x18 // Mirror Register 4 #define MR4 0x18 /* Mirror Register 4 */
#define GPR1 0x0c #define GPR1 0x0c
#define GPR2 0x0e #define GPR2 0x0e
#define GPR3 0x10 #define GPR3 0x10
// /*
// Constants for the GCR register. * Constants for the GCR register.
// */
#define GCR_REMAP 0x0400 // Remap internal SRAM to 0 #define GCR_REMAP 0x0400 /* Remap internal SRAM to 0 */
#define GCR_SWRES 0x0080 // BIU reset (ARM and PAI are NOT reset) #define GCR_SWRES 0x0080 /* BIU reset (ARM and PAI are NOT reset) */
#define GCR_CORES 0x0060 // Core Reset (ARM and PAI are reset) #define GCR_CORES 0x0060 /* Core Reset (ARM and PAI are reset) */
#define GCR_ENINT 0x0002 // Enable Interrupts #define GCR_ENINT 0x0002 /* Enable Interrupts */
#define GCR_ACKINT 0x0008 // Acknowledge Interrupts #define GCR_ACKINT 0x0008 /* Acknowledge Interrupts */
#define BSS_SRAM 0x0200 // AMBA module selection --> SRAM #define BSS_SRAM 0x0200 /* AMBA module selection --> SRAM */
#define BSS_IRAM 0x0100 // AMBA module selection --> IRAM #define BSS_IRAM 0x0100 /* AMBA module selection --> IRAM */
// /*
// Constants for the MR registers. *Constants for the MR registers.
// */
#define MAC_INIT_COMPLETE 0x0001 // MAC init has been completed #define MAC_INIT_COMPLETE 0x0001 /* MAC init has been completed */
#define MAC_BOOT_COMPLETE 0x0010 // MAC boot has been completed #define MAC_BOOT_COMPLETE 0x0010 /* MAC boot has been completed */
#define MAC_INIT_OK 0x0002 // MAC boot has been completed #define MAC_INIT_OK 0x0002 /* MAC boot has been completed */
#define MIB_MAX_DATA_BYTES 212 #define MIB_MAX_DATA_BYTES 212
#define MIB_HEADER_SIZE 4 /* first four fields */ #define MIB_HEADER_SIZE 4 /* first four fields */
...@@ -212,9 +212,9 @@ struct tx_desc { ...@@ -212,9 +212,9 @@ struct tx_desc {
#define TX_DESC_PACKET_TYPE_OFFSET 17 #define TX_DESC_PACKET_TYPE_OFFSET 17
#define TX_DESC_HOST_LENGTH_OFFSET 18 #define TX_DESC_HOST_LENGTH_OFFSET 18
/////////////////////////////////////////////////////// /*
// Host-MAC interface * Host-MAC interface
/////////////////////////////////////////////////////// */
#define TX_STATUS_SUCCESS 0x00 #define TX_STATUS_SUCCESS 0x00
...@@ -226,14 +226,14 @@ struct tx_desc { ...@@ -226,14 +226,14 @@ struct tx_desc {
#define TX_PACKET_TYPE_DATA 0x01 #define TX_PACKET_TYPE_DATA 0x01
#define TX_PACKET_TYPE_MGMT 0x02 #define TX_PACKET_TYPE_MGMT 0x02
#define ISR_EMPTY 0x00 // no bits set in ISR #define ISR_EMPTY 0x00 /* no bits set in ISR */
#define ISR_TxCOMPLETE 0x01 // packet transmitted #define ISR_TxCOMPLETE 0x01 /* packet transmitted */
#define ISR_RxCOMPLETE 0x02 // packet received #define ISR_RxCOMPLETE 0x02 /* packet received */
#define ISR_RxFRAMELOST 0x04 // Rx Frame lost #define ISR_RxFRAMELOST 0x04 /* Rx Frame lost */
#define ISR_FATAL_ERROR 0x08 // Fatal error #define ISR_FATAL_ERROR 0x08 /* Fatal error */
#define ISR_COMMAND_COMPLETE 0x10 // command completed #define ISR_COMMAND_COMPLETE 0x10 /* command completed */
#define ISR_OUT_OF_RANGE 0x20 // command completed #define ISR_OUT_OF_RANGE 0x20 /* command completed */
#define ISR_IBSS_MERGE 0x40 // (4.1.2.30): IBSS merge #define ISR_IBSS_MERGE 0x40 /* (4.1.2.30): IBSS merge */
#define ISR_GENERIC_IRQ 0x80 #define ISR_GENERIC_IRQ 0x80
#define Local_Mib_Type 0x01 #define Local_Mib_Type 0x01
...@@ -311,22 +311,22 @@ struct tx_desc { ...@@ -311,22 +311,22 @@ struct tx_desc {
#define MAX_ENCRYPTION_KEYS 4 #define MAX_ENCRYPTION_KEYS 4
#define MAX_ENCRYPTION_KEY_SIZE 40 #define MAX_ENCRYPTION_KEY_SIZE 40
/////////////////////////////////////////////////////////////////////////// /*
// 802.11 related definitions * 802.11 related definitions
/////////////////////////////////////////////////////////////////////////// */
// /*
// Regulatory Domains * Regulatory Domains
// */
#define REG_DOMAIN_FCC 0x10 //Channels 1-11 USA #define REG_DOMAIN_FCC 0x10 /* Channels 1-11 USA */
#define REG_DOMAIN_DOC 0x20 //Channel 1-11 Canada #define REG_DOMAIN_DOC 0x20 /* Channel 1-11 Canada */
#define REG_DOMAIN_ETSI 0x30 //Channel 1-13 Europe (ex Spain/France) #define REG_DOMAIN_ETSI 0x30 /* Channel 1-13 Europe (ex Spain/France) */
#define REG_DOMAIN_SPAIN 0x31 //Channel 10-11 Spain #define REG_DOMAIN_SPAIN 0x31 /* Channel 10-11 Spain */
#define REG_DOMAIN_FRANCE 0x32 //Channel 10-13 France #define REG_DOMAIN_FRANCE 0x32 /* Channel 10-13 France */
#define REG_DOMAIN_MKK 0x40 //Channel 14 Japan #define REG_DOMAIN_MKK 0x40 /* Channel 14 Japan */
#define REG_DOMAIN_MKK1 0x41 //Channel 1-14 Japan(MKK1) #define REG_DOMAIN_MKK1 0x41 /* Channel 1-14 Japan(MKK1) */
#define REG_DOMAIN_ISRAEL 0x50 //Channel 3-9 ISRAEL #define REG_DOMAIN_ISRAEL 0x50 /* Channel 3-9 ISRAEL */
#define BSS_TYPE_AD_HOC 1 #define BSS_TYPE_AD_HOC 1
#define BSS_TYPE_INFRASTRUCTURE 2 #define BSS_TYPE_INFRASTRUCTURE 2
...@@ -364,13 +364,13 @@ struct tx_desc { ...@@ -364,13 +364,13 @@ struct tx_desc {
#define CIPHER_SUITE_CCX 4 #define CIPHER_SUITE_CCX 4
#define CIPHER_SUITE_WEP_128 5 #define CIPHER_SUITE_WEP_128 5
// /*
// IFACE MACROS & definitions * IFACE MACROS & definitions
// */
//
// FuncCtrl field: /*
// * FuncCtrl field:
*/
#define FUNC_CTRL_TxENABLE 0x10 #define FUNC_CTRL_TxENABLE 0x10
#define FUNC_CTRL_RxENABLE 0x20 #define FUNC_CTRL_RxENABLE 0x20
#define FUNC_CTRL_INIT_COMPLETE 0x01 #define FUNC_CTRL_INIT_COMPLETE 0x01
...@@ -378,48 +378,48 @@ struct tx_desc { ...@@ -378,48 +378,48 @@ struct tx_desc {
/* A stub firmware image which reads the MAC address from NVRAM on the card. /* A stub firmware image which reads the MAC address from NVRAM on the card.
For copyright information and source see the end of this file. */ For copyright information and source see the end of this file. */
static u8 mac_reader[] = { static u8 mac_reader[] = {
0x06,0x00,0x00,0xea,0x04,0x00,0x00,0xea,0x03,0x00,0x00,0xea,0x02,0x00,0x00,0xea, 0x06, 0x00, 0x00, 0xea, 0x04, 0x00, 0x00, 0xea, 0x03, 0x00, 0x00, 0xea, 0x02, 0x00, 0x00, 0xea,
0x01,0x00,0x00,0xea,0x00,0x00,0x00,0xea,0xff,0xff,0xff,0xea,0xfe,0xff,0xff,0xea, 0x01, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xea, 0xff, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea,
0xd3,0x00,0xa0,0xe3,0x00,0xf0,0x21,0xe1,0x0e,0x04,0xa0,0xe3,0x00,0x10,0xa0,0xe3, 0xd3, 0x00, 0xa0, 0xe3, 0x00, 0xf0, 0x21, 0xe1, 0x0e, 0x04, 0xa0, 0xe3, 0x00, 0x10, 0xa0, 0xe3,
0x81,0x11,0xa0,0xe1,0x00,0x10,0x81,0xe3,0x00,0x10,0x80,0xe5,0x1c,0x10,0x90,0xe5, 0x81, 0x11, 0xa0, 0xe1, 0x00, 0x10, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x1c, 0x10, 0x90, 0xe5,
0x10,0x10,0xc1,0xe3,0x1c,0x10,0x80,0xe5,0x01,0x10,0xa0,0xe3,0x08,0x10,0x80,0xe5, 0x10, 0x10, 0xc1, 0xe3, 0x1c, 0x10, 0x80, 0xe5, 0x01, 0x10, 0xa0, 0xe3, 0x08, 0x10, 0x80, 0xe5,
0x02,0x03,0xa0,0xe3,0x00,0x10,0xa0,0xe3,0xb0,0x10,0xc0,0xe1,0xb4,0x10,0xc0,0xe1, 0x02, 0x03, 0xa0, 0xe3, 0x00, 0x10, 0xa0, 0xe3, 0xb0, 0x10, 0xc0, 0xe1, 0xb4, 0x10, 0xc0, 0xe1,
0xb8,0x10,0xc0,0xe1,0xbc,0x10,0xc0,0xe1,0x56,0xdc,0xa0,0xe3,0x21,0x00,0x00,0xeb, 0xb8, 0x10, 0xc0, 0xe1, 0xbc, 0x10, 0xc0, 0xe1, 0x56, 0xdc, 0xa0, 0xe3, 0x21, 0x00, 0x00, 0xeb,
0x0a,0x00,0xa0,0xe3,0x1a,0x00,0x00,0xeb,0x10,0x00,0x00,0xeb,0x07,0x00,0x00,0xeb, 0x0a, 0x00, 0xa0, 0xe3, 0x1a, 0x00, 0x00, 0xeb, 0x10, 0x00, 0x00, 0xeb, 0x07, 0x00, 0x00, 0xeb,
0x02,0x03,0xa0,0xe3,0x02,0x14,0xa0,0xe3,0xb4,0x10,0xc0,0xe1,0x4c,0x10,0x9f,0xe5, 0x02, 0x03, 0xa0, 0xe3, 0x02, 0x14, 0xa0, 0xe3, 0xb4, 0x10, 0xc0, 0xe1, 0x4c, 0x10, 0x9f, 0xe5,
0xbc,0x10,0xc0,0xe1,0x10,0x10,0xa0,0xe3,0xb8,0x10,0xc0,0xe1,0xfe,0xff,0xff,0xea, 0xbc, 0x10, 0xc0, 0xe1, 0x10, 0x10, 0xa0, 0xe3, 0xb8, 0x10, 0xc0, 0xe1, 0xfe, 0xff, 0xff, 0xea,
0x00,0x40,0x2d,0xe9,0x00,0x20,0xa0,0xe3,0x02,0x3c,0xa0,0xe3,0x00,0x10,0xa0,0xe3, 0x00, 0x40, 0x2d, 0xe9, 0x00, 0x20, 0xa0, 0xe3, 0x02, 0x3c, 0xa0, 0xe3, 0x00, 0x10, 0xa0, 0xe3,
0x28,0x00,0x9f,0xe5,0x37,0x00,0x00,0xeb,0x00,0x40,0xbd,0xe8,0x1e,0xff,0x2f,0xe1, 0x28, 0x00, 0x9f, 0xe5, 0x37, 0x00, 0x00, 0xeb, 0x00, 0x40, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1,
0x00,0x40,0x2d,0xe9,0x12,0x2e,0xa0,0xe3,0x06,0x30,0xa0,0xe3,0x00,0x10,0xa0,0xe3, 0x00, 0x40, 0x2d, 0xe9, 0x12, 0x2e, 0xa0, 0xe3, 0x06, 0x30, 0xa0, 0xe3, 0x00, 0x10, 0xa0, 0xe3,
0x02,0x04,0xa0,0xe3,0x2f,0x00,0x00,0xeb,0x00,0x40,0xbd,0xe8,0x1e,0xff,0x2f,0xe1, 0x02, 0x04, 0xa0, 0xe3, 0x2f, 0x00, 0x00, 0xeb, 0x00, 0x40, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1,
0x00,0x02,0x00,0x02,0x80,0x01,0x90,0xe0,0x01,0x00,0x00,0x0a,0x01,0x00,0x50,0xe2, 0x00, 0x02, 0x00, 0x02, 0x80, 0x01, 0x90, 0xe0, 0x01, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x50, 0xe2,
0xfc,0xff,0xff,0xea,0x1e,0xff,0x2f,0xe1,0x80,0x10,0xa0,0xe3,0xf3,0x06,0xa0,0xe3, 0xfc, 0xff, 0xff, 0xea, 0x1e, 0xff, 0x2f, 0xe1, 0x80, 0x10, 0xa0, 0xe3, 0xf3, 0x06, 0xa0, 0xe3,
0x00,0x10,0x80,0xe5,0x00,0x10,0xa0,0xe3,0x00,0x10,0x80,0xe5,0x01,0x10,0xa0,0xe3, 0x00, 0x10, 0x80, 0xe5, 0x00, 0x10, 0xa0, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x01, 0x10, 0xa0, 0xe3,
0x04,0x10,0x80,0xe5,0x00,0x10,0x80,0xe5,0x0e,0x34,0xa0,0xe3,0x1c,0x10,0x93,0xe5, 0x04, 0x10, 0x80, 0xe5, 0x00, 0x10, 0x80, 0xe5, 0x0e, 0x34, 0xa0, 0xe3, 0x1c, 0x10, 0x93, 0xe5,
0x02,0x1a,0x81,0xe3,0x1c,0x10,0x83,0xe5,0x58,0x11,0x9f,0xe5,0x30,0x10,0x80,0xe5, 0x02, 0x1a, 0x81, 0xe3, 0x1c, 0x10, 0x83, 0xe5, 0x58, 0x11, 0x9f, 0xe5, 0x30, 0x10, 0x80, 0xe5,
0x54,0x11,0x9f,0xe5,0x34,0x10,0x80,0xe5,0x38,0x10,0x80,0xe5,0x3c,0x10,0x80,0xe5, 0x54, 0x11, 0x9f, 0xe5, 0x34, 0x10, 0x80, 0xe5, 0x38, 0x10, 0x80, 0xe5, 0x3c, 0x10, 0x80, 0xe5,
0x10,0x10,0x90,0xe5,0x08,0x00,0x90,0xe5,0x1e,0xff,0x2f,0xe1,0xf3,0x16,0xa0,0xe3, 0x10, 0x10, 0x90, 0xe5, 0x08, 0x00, 0x90, 0xe5, 0x1e, 0xff, 0x2f, 0xe1, 0xf3, 0x16, 0xa0, 0xe3,
0x08,0x00,0x91,0xe5,0x05,0x00,0xa0,0xe3,0x0c,0x00,0x81,0xe5,0x10,0x00,0x91,0xe5, 0x08, 0x00, 0x91, 0xe5, 0x05, 0x00, 0xa0, 0xe3, 0x0c, 0x00, 0x81, 0xe5, 0x10, 0x00, 0x91, 0xe5,
0x02,0x00,0x10,0xe3,0xfc,0xff,0xff,0x0a,0xff,0x00,0xa0,0xe3,0x0c,0x00,0x81,0xe5, 0x02, 0x00, 0x10, 0xe3, 0xfc, 0xff, 0xff, 0x0a, 0xff, 0x00, 0xa0, 0xe3, 0x0c, 0x00, 0x81, 0xe5,
0x10,0x00,0x91,0xe5,0x02,0x00,0x10,0xe3,0xfc,0xff,0xff,0x0a,0x08,0x00,0x91,0xe5, 0x10, 0x00, 0x91, 0xe5, 0x02, 0x00, 0x10, 0xe3, 0xfc, 0xff, 0xff, 0x0a, 0x08, 0x00, 0x91, 0xe5,
0x10,0x00,0x91,0xe5,0x01,0x00,0x10,0xe3,0xfc,0xff,0xff,0x0a,0x08,0x00,0x91,0xe5, 0x10, 0x00, 0x91, 0xe5, 0x01, 0x00, 0x10, 0xe3, 0xfc, 0xff, 0xff, 0x0a, 0x08, 0x00, 0x91, 0xe5,
0xff,0x00,0x00,0xe2,0x1e,0xff,0x2f,0xe1,0x30,0x40,0x2d,0xe9,0x00,0x50,0xa0,0xe1, 0xff, 0x00, 0x00, 0xe2, 0x1e, 0xff, 0x2f, 0xe1, 0x30, 0x40, 0x2d, 0xe9, 0x00, 0x50, 0xa0, 0xe1,
0x03,0x40,0xa0,0xe1,0xa2,0x02,0xa0,0xe1,0x08,0x00,0x00,0xe2,0x03,0x00,0x80,0xe2, 0x03, 0x40, 0xa0, 0xe1, 0xa2, 0x02, 0xa0, 0xe1, 0x08, 0x00, 0x00, 0xe2, 0x03, 0x00, 0x80, 0xe2,
0xd8,0x10,0x9f,0xe5,0x00,0x00,0xc1,0xe5,0x01,0x20,0xc1,0xe5,0xe2,0xff,0xff,0xeb, 0xd8, 0x10, 0x9f, 0xe5, 0x00, 0x00, 0xc1, 0xe5, 0x01, 0x20, 0xc1, 0xe5, 0xe2, 0xff, 0xff, 0xeb,
0x01,0x00,0x10,0xe3,0xfc,0xff,0xff,0x1a,0x14,0x00,0xa0,0xe3,0xc4,0xff,0xff,0xeb, 0x01, 0x00, 0x10, 0xe3, 0xfc, 0xff, 0xff, 0x1a, 0x14, 0x00, 0xa0, 0xe3, 0xc4, 0xff, 0xff, 0xeb,
0x04,0x20,0xa0,0xe1,0x05,0x10,0xa0,0xe1,0x02,0x00,0xa0,0xe3,0x01,0x00,0x00,0xeb, 0x04, 0x20, 0xa0, 0xe1, 0x05, 0x10, 0xa0, 0xe1, 0x02, 0x00, 0xa0, 0xe3, 0x01, 0x00, 0x00, 0xeb,
0x30,0x40,0xbd,0xe8,0x1e,0xff,0x2f,0xe1,0x70,0x40,0x2d,0xe9,0xf3,0x46,0xa0,0xe3, 0x30, 0x40, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1, 0x70, 0x40, 0x2d, 0xe9, 0xf3, 0x46, 0xa0, 0xe3,
0x00,0x30,0xa0,0xe3,0x00,0x00,0x50,0xe3,0x08,0x00,0x00,0x9a,0x8c,0x50,0x9f,0xe5, 0x00, 0x30, 0xa0, 0xe3, 0x00, 0x00, 0x50, 0xe3, 0x08, 0x00, 0x00, 0x9a, 0x8c, 0x50, 0x9f, 0xe5,
0x03,0x60,0xd5,0xe7,0x0c,0x60,0x84,0xe5,0x10,0x60,0x94,0xe5,0x02,0x00,0x16,0xe3, 0x03, 0x60, 0xd5, 0xe7, 0x0c, 0x60, 0x84, 0xe5, 0x10, 0x60, 0x94, 0xe5, 0x02, 0x00, 0x16, 0xe3,
0xfc,0xff,0xff,0x0a,0x01,0x30,0x83,0xe2,0x00,0x00,0x53,0xe1,0xf7,0xff,0xff,0x3a, 0xfc, 0xff, 0xff, 0x0a, 0x01, 0x30, 0x83, 0xe2, 0x00, 0x00, 0x53, 0xe1, 0xf7, 0xff, 0xff, 0x3a,
0xff,0x30,0xa0,0xe3,0x0c,0x30,0x84,0xe5,0x08,0x00,0x94,0xe5,0x10,0x00,0x94,0xe5, 0xff, 0x30, 0xa0, 0xe3, 0x0c, 0x30, 0x84, 0xe5, 0x08, 0x00, 0x94, 0xe5, 0x10, 0x00, 0x94, 0xe5,
0x01,0x00,0x10,0xe3,0xfc,0xff,0xff,0x0a,0x08,0x00,0x94,0xe5,0x00,0x00,0xa0,0xe3, 0x01, 0x00, 0x10, 0xe3, 0xfc, 0xff, 0xff, 0x0a, 0x08, 0x00, 0x94, 0xe5, 0x00, 0x00, 0xa0, 0xe3,
0x00,0x00,0x52,0xe3,0x0b,0x00,0x00,0x9a,0x10,0x50,0x94,0xe5,0x02,0x00,0x15,0xe3, 0x00, 0x00, 0x52, 0xe3, 0x0b, 0x00, 0x00, 0x9a, 0x10, 0x50, 0x94, 0xe5, 0x02, 0x00, 0x15, 0xe3,
0xfc,0xff,0xff,0x0a,0x0c,0x30,0x84,0xe5,0x10,0x50,0x94,0xe5,0x01,0x00,0x15,0xe3, 0xfc, 0xff, 0xff, 0x0a, 0x0c, 0x30, 0x84, 0xe5, 0x10, 0x50, 0x94, 0xe5, 0x01, 0x00, 0x15, 0xe3,
0xfc,0xff,0xff,0x0a,0x08,0x50,0x94,0xe5,0x01,0x50,0xc1,0xe4,0x01,0x00,0x80,0xe2, 0xfc, 0xff, 0xff, 0x0a, 0x08, 0x50, 0x94, 0xe5, 0x01, 0x50, 0xc1, 0xe4, 0x01, 0x00, 0x80, 0xe2,
0x02,0x00,0x50,0xe1,0xf3,0xff,0xff,0x3a,0xc8,0x00,0xa0,0xe3,0x98,0xff,0xff,0xeb, 0x02, 0x00, 0x50, 0xe1, 0xf3, 0xff, 0xff, 0x3a, 0xc8, 0x00, 0xa0, 0xe3, 0x98, 0xff, 0xff, 0xeb,
0x70,0x40,0xbd,0xe8,0x1e,0xff,0x2f,0xe1,0x01,0x0c,0x00,0x02,0x01,0x02,0x00,0x02, 0x70, 0x40, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1, 0x01, 0x0c, 0x00, 0x02, 0x01, 0x02, 0x00, 0x02,
0x00,0x01,0x00,0x02 0x00, 0x01, 0x00, 0x02
}; };
struct atmel_private { struct atmel_private {
...@@ -433,7 +433,7 @@ struct atmel_private { ...@@ -433,7 +433,7 @@ struct atmel_private {
struct net_device *dev; struct net_device *dev;
struct device *sys_dev; struct device *sys_dev;
struct iw_statistics wstats; struct iw_statistics wstats;
spinlock_t irqlock, timerlock; // spinlocks spinlock_t irqlock, timerlock; /* spinlocks */
enum { BUS_TYPE_PCCARD, BUS_TYPE_PCI } bus_type; enum { BUS_TYPE_PCCARD, BUS_TYPE_PCI } bus_type;
enum { enum {
CARD_TYPE_PARALLEL_FLASH, CARD_TYPE_PARALLEL_FLASH,
...@@ -541,7 +541,7 @@ struct atmel_private { ...@@ -541,7 +541,7 @@ struct atmel_private {
u8 rx_buf[MAX_WIRELESS_BODY]; u8 rx_buf[MAX_WIRELESS_BODY];
}; };
static u8 atmel_basic_rates[4] = {0x82,0x84,0x0b,0x16}; static u8 atmel_basic_rates[4] = {0x82, 0x84, 0x0b, 0x16};
static const struct { static const struct {
int reg_domain; int reg_domain;
...@@ -1420,10 +1420,17 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv) ...@@ -1420,10 +1420,17 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv)
priv->firmware_id); priv->firmware_id);
switch (priv->card_type) { switch (priv->card_type) {
case CARD_TYPE_PARALLEL_FLASH: c = "Parallel flash"; break; case CARD_TYPE_PARALLEL_FLASH:
case CARD_TYPE_SPI_FLASH: c = "SPI flash\n"; break; c = "Parallel flash";
case CARD_TYPE_EEPROM: c = "EEPROM"; break; break;
default: c = "<unknown>"; case CARD_TYPE_SPI_FLASH:
c = "SPI flash\n";
break;
case CARD_TYPE_EEPROM:
c = "EEPROM";
break;
default:
c = "<unknown>";
} }
r = "<unknown>"; r = "<unknown>";
...@@ -1439,16 +1446,33 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv) ...@@ -1439,16 +1446,33 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv)
priv->use_wpa ? "Yes" : "No"); priv->use_wpa ? "Yes" : "No");
} }
switch(priv->station_state) { switch (priv->station_state) {
case STATION_STATE_SCANNING: s = "Scanning"; break; case STATION_STATE_SCANNING:
case STATION_STATE_JOINNING: s = "Joining"; break; s = "Scanning";
case STATION_STATE_AUTHENTICATING: s = "Authenticating"; break; break;
case STATION_STATE_ASSOCIATING: s = "Associating"; break; case STATION_STATE_JOINNING:
case STATION_STATE_READY: s = "Ready"; break; s = "Joining";
case STATION_STATE_REASSOCIATING: s = "Reassociating"; break; break;
case STATION_STATE_MGMT_ERROR: s = "Management error"; break; case STATION_STATE_AUTHENTICATING:
case STATION_STATE_DOWN: s = "Down"; break; s = "Authenticating";
default: s = "<unknown>"; break;
case STATION_STATE_ASSOCIATING:
s = "Associating";
break;
case STATION_STATE_READY:
s = "Ready";
break;
case STATION_STATE_REASSOCIATING:
s = "Reassociating";
break;
case STATION_STATE_MGMT_ERROR:
s = "Management error";
break;
case STATION_STATE_DOWN:
s = "Down";
break;
default:
s = "<unknown>";
} }
p += sprintf(p, "Current state:\t\t%s\n", s); p += sprintf(p, "Current state:\t\t%s\n", s);
...@@ -1460,11 +1484,14 @@ static int atmel_read_proc(char *page, char **start, off_t off, ...@@ -1460,11 +1484,14 @@ static int atmel_read_proc(char *page, char **start, off_t off,
{ {
struct atmel_private *priv = data; struct atmel_private *priv = data;
int len = atmel_proc_output (page, priv); int len = atmel_proc_output (page, priv);
if (len <= off+count) *eof = 1; if (len <= off+count)
*eof = 1;
*start = page + off; *start = page + off;
len -= off; len -= off;
if (len>count) len = count; if (len > count)
if (len<0) len = 0; len = count;
if (len < 0)
len = 0;
return len; return len;
} }
...@@ -1577,7 +1604,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, ...@@ -1577,7 +1604,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
if (register_netdev(dev)) if (register_netdev(dev))
goto err_out_res; goto err_out_res;
if (!probe_atmel_card(dev)){ if (!probe_atmel_card(dev)) {
unregister_netdev(dev); unregister_netdev(dev);
goto err_out_res; goto err_out_res;
} }
...@@ -1594,7 +1621,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, ...@@ -1594,7 +1621,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
return dev; return dev;
err_out_res: err_out_res:
release_region( dev->base_addr, 32); release_region(dev->base_addr, 32);
err_out_irq: err_out_irq:
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
err_out_free: err_out_free:
...@@ -1632,7 +1659,7 @@ static int atmel_set_essid(struct net_device *dev, ...@@ -1632,7 +1659,7 @@ static int atmel_set_essid(struct net_device *dev,
struct atmel_private *priv = netdev_priv(dev); struct atmel_private *priv = netdev_priv(dev);
/* Check if we asked for `any' */ /* Check if we asked for `any' */
if(dwrq->flags == 0) { if (dwrq->flags == 0) {
priv->connect_to_any_BSS = 1; priv->connect_to_any_BSS = 1;
} else { } else {
int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
...@@ -1768,7 +1795,7 @@ static int atmel_set_encode(struct net_device *dev, ...@@ -1768,7 +1795,7 @@ static int atmel_set_encode(struct net_device *dev,
} }
if (dwrq->flags & IW_ENCODE_RESTRICTED) if (dwrq->flags & IW_ENCODE_RESTRICTED)
priv->exclude_unencrypted = 1; priv->exclude_unencrypted = 1;
if(dwrq->flags & IW_ENCODE_OPEN) if (dwrq->flags & IW_ENCODE_OPEN)
priv->exclude_unencrypted = 0; priv->exclude_unencrypted = 0;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
...@@ -1797,7 +1824,7 @@ static int atmel_get_encode(struct net_device *dev, ...@@ -1797,7 +1824,7 @@ static int atmel_get_encode(struct net_device *dev,
/* Copy the key to the user buffer */ /* Copy the key to the user buffer */
dwrq->length = priv->wep_key_len[index]; dwrq->length = priv->wep_key_len[index];
if (dwrq->length > 16) { if (dwrq->length > 16) {
dwrq->length=0; dwrq->length = 0;
} else { } else {
memset(extra, 0, 16); memset(extra, 0, 16);
memcpy(extra, priv->wep_keys[index], dwrq->length); memcpy(extra, priv->wep_keys[index], dwrq->length);
...@@ -2013,11 +2040,20 @@ static int atmel_set_rate(struct net_device *dev, ...@@ -2013,11 +2040,20 @@ static int atmel_set_rate(struct net_device *dev,
} else { } else {
/* Setting by frequency value */ /* Setting by frequency value */
switch (vwrq->value) { switch (vwrq->value) {
case 1000000: priv->tx_rate = 0; break; case 1000000:
case 2000000: priv->tx_rate = 1; break; priv->tx_rate = 0;
case 5500000: priv->tx_rate = 2; break; break;
case 11000000: priv->tx_rate = 3; break; case 2000000:
default: return -EINVAL; priv->tx_rate = 1;
break;
case 5500000:
priv->tx_rate = 2;
break;
case 11000000:
priv->tx_rate = 3;
break;
default:
return -EINVAL;
} }
} }
} }
...@@ -2062,11 +2098,19 @@ static int atmel_get_rate(struct net_device *dev, ...@@ -2062,11 +2098,19 @@ static int atmel_get_rate(struct net_device *dev,
vwrq->value = 11000000; vwrq->value = 11000000;
} else { } else {
vwrq->fixed = 1; vwrq->fixed = 1;
switch(priv->tx_rate) { switch (priv->tx_rate) {
case 0: vwrq->value = 1000000; break; case 0:
case 1: vwrq->value = 2000000; break; vwrq->value = 1000000;
case 2: vwrq->value = 5500000; break; break;
case 3: vwrq->value = 11000000; break; case 1:
vwrq->value = 2000000;
break;
case 2:
vwrq->value = 5500000;
break;
case 3:
vwrq->value = 11000000;
break;
} }
} }
return 0; return 0;
...@@ -2576,8 +2620,7 @@ static const struct iw_priv_args atmel_private_args[] = { ...@@ -2576,8 +2620,7 @@ static const struct iw_priv_args atmel_private_args[] = {
}, },
}; };
static const struct iw_handler_def atmel_handler_def = static const struct iw_handler_def atmel_handler_def = {
{
.num_standard = ARRAY_SIZE(atmel_handler), .num_standard = ARRAY_SIZE(atmel_handler),
.num_private = ARRAY_SIZE(atmel_private_handler), .num_private = ARRAY_SIZE(atmel_private_handler),
.num_private_args = ARRAY_SIZE(atmel_private_args), .num_private_args = ARRAY_SIZE(atmel_private_args),
...@@ -2995,7 +3038,7 @@ static void store_bss_info(struct atmel_private *priv, ...@@ -2995,7 +3038,7 @@ static void store_bss_info(struct atmel_private *priv,
if (capability & WLAN_CAPABILITY_IBSS) if (capability & WLAN_CAPABILITY_IBSS)
priv->BSSinfo[index].BSStype = IW_MODE_ADHOC; priv->BSSinfo[index].BSStype = IW_MODE_ADHOC;
else if (capability & WLAN_CAPABILITY_ESS) else if (capability & WLAN_CAPABILITY_ESS)
priv->BSSinfo[index].BSStype =IW_MODE_INFRA; priv->BSSinfo[index].BSStype = IW_MODE_INFRA;
priv->BSSinfo[index].preamble = capability & WLAN_CAPABILITY_SHORT_PREAMBLE ? priv->BSSinfo[index].preamble = capability & WLAN_CAPABILITY_SHORT_PREAMBLE ?
SHORT_PREAMBLE : LONG_PREAMBLE; SHORT_PREAMBLE : LONG_PREAMBLE;
...@@ -3042,7 +3085,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) ...@@ -3042,7 +3085,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
} }
if (should_associate) { if (should_associate) {
if(priv->station_was_associated) { if (priv->station_was_associated) {
atmel_enter_state(priv, STATION_STATE_REASSOCIATING); atmel_enter_state(priv, STATION_STATE_REASSOCIATING);
send_association_request(priv, 1); send_association_request(priv, 1);
return; return;
...@@ -3063,7 +3106,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) ...@@ -3063,7 +3106,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
priv->exclude_unencrypted = 1; priv->exclude_unencrypted = 1;
send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0);
return; return;
} else if ( system == WLAN_AUTH_SHARED_KEY } else if (system == WLAN_AUTH_SHARED_KEY
&& priv->wep_is_on) { && priv->wep_is_on) {
priv->CurrentAuthentTransactionSeqNum = 0x001; priv->CurrentAuthentTransactionSeqNum = 0x001;
priv->exclude_unencrypted = 0; priv->exclude_unencrypted = 0;
...@@ -3473,8 +3516,7 @@ static void atmel_command_irq(struct atmel_private *priv) ...@@ -3473,8 +3516,7 @@ static void atmel_command_irq(struct atmel_private *priv)
status == CMD_STATUS_IN_PROGRESS) status == CMD_STATUS_IN_PROGRESS)
return; return;
switch (command){ switch (command) {
case CMD_Start: case CMD_Start:
if (status == CMD_STATUS_COMPLETE) { if (status == CMD_STATUS_COMPLETE) {
priv->station_was_associated = priv->station_is_associated; priv->station_was_associated = priv->station_is_associated;
...@@ -3709,7 +3751,7 @@ static int probe_atmel_card(struct net_device *dev) ...@@ -3709,7 +3751,7 @@ static int probe_atmel_card(struct net_device *dev)
if (rc) { if (rc) {
if (dev->dev_addr[0] == 0xFF) { if (dev->dev_addr[0] == 0xFF) {
u8 default_mac[] = {0x00,0x04, 0x25, 0x00, 0x00, 0x00}; u8 default_mac[] = {0x00, 0x04, 0x25, 0x00, 0x00, 0x00};
printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name); printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
memcpy(dev->dev_addr, default_mac, 6); memcpy(dev->dev_addr, default_mac, 6);
} }
...@@ -3999,8 +4041,7 @@ static int reset_atmel_card(struct net_device *dev) ...@@ -3999,8 +4041,7 @@ static int reset_atmel_card(struct net_device *dev)
else else
build_wep_mib(priv); build_wep_mib(priv);
if (old_state == STATION_STATE_READY) if (old_state == STATION_STATE_READY) {
{
union iwreq_data wrqu; union iwreq_data wrqu;
wrqu.data.length = 0; wrqu.data.length = 0;
...@@ -4306,7 +4347,7 @@ HALT1: b HALT1 ...@@ -4306,7 +4347,7 @@ HALT1: b HALT1
ldr r0, =SPI_CGEN_BASE ldr r0, =SPI_CGEN_BASE
mov r1, #0 mov r1, #0
mov r1, r1, lsl #3 mov r1, r1, lsl #3
orr r1,r1, #0 orr r1, r1, #0
str r1, [r0] str r1, [r0]
ldr r1, [r0, #28] ldr r1, [r0, #28]
bic r1, r1, #16 bic r1, r1, #16
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment