Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'upstream-jgarzik' of git://git.tuxdriver.com/git/netdev-jwl

+783 -773
-1
drivers/net/sk98lin/h/skdrv2nd.h
··· 60 60 extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*); 61 61 extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*); 62 62 extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*); 63 - extern int SkPciWriteCfgDWord(SK_AC*, int, SK_U32); 64 63 extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16); 65 64 extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8); 66 65 extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
-8
drivers/net/sk98lin/h/skvpd.h
··· 130 130 #ifndef VPD_DO_IO 131 131 #define VPD_OUT8(pAC,IoC,Addr,Val) (void)SkPciWriteCfgByte(pAC,Addr,Val) 132 132 #define VPD_OUT16(pAC,IoC,Addr,Val) (void)SkPciWriteCfgWord(pAC,Addr,Val) 133 - #define VPD_OUT32(pAC,IoC,Addr,Val) (void)SkPciWriteCfgDWord(pAC,Addr,Val) 134 133 #define VPD_IN8(pAC,IoC,Addr,pVal) (void)SkPciReadCfgByte(pAC,Addr,pVal) 135 134 #define VPD_IN16(pAC,IoC,Addr,pVal) (void)SkPciReadCfgWord(pAC,Addr,pVal) 136 135 #define VPD_IN32(pAC,IoC,Addr,pVal) (void)SkPciReadCfgDWord(pAC,Addr,pVal) 137 136 #else /* VPD_DO_IO */ 138 137 #define VPD_OUT8(pAC,IoC,Addr,Val) SK_OUT8(IoC,PCI_C(Addr),Val) 139 138 #define VPD_OUT16(pAC,IoC,Addr,Val) SK_OUT16(IoC,PCI_C(Addr),Val) 140 - #define VPD_OUT32(pAC,IoC,Addr,Val) SK_OUT32(IoC,PCI_C(Addr),Val) 141 139 #define VPD_IN8(pAC,IoC,Addr,pVal) SK_IN8(IoC,PCI_C(Addr),pVal) 142 140 #define VPD_IN16(pAC,IoC,Addr,pVal) SK_IN16(IoC,PCI_C(Addr),pVal) 143 141 #define VPD_IN32(pAC,IoC,Addr,pVal) SK_IN32(IoC,PCI_C(Addr),pVal) ··· 152 154 SkPciWriteCfgWord(pAC,Addr,Val); \ 153 155 else \ 154 156 SK_OUT16(pAC,PCI_C(Addr),Val); \ 155 - } 156 - #define VPD_OUT32(pAC,Ioc,Addr,Val) { \ 157 - if ((pAC)->DgT.DgUseCfgCycle) \ 158 - SkPciWriteCfgDWord(pAC,Addr,Val); \ 159 - else \ 160 - SK_OUT32(pAC,PCI_C(Addr),Val); \ 161 157 } 162 158 #define VPD_IN8(pAC,Ioc,Addr,pVal) { \ 163 159 if ((pAC)->DgT.DgUseCfgCycle) \
+21 -22
drivers/net/sk98lin/skge.c
··· 279 279 280 280 /***************************************************************************** 281 281 * 282 + * SkPciWriteCfgDWord - write a 32 bit value to pci config space 283 + * 284 + * Description: 285 + * This routine writes a 32 bit value to the pci configuration 286 + * space. 287 + * 288 + * Returns: 289 + * 0 - indicate everything worked ok. 290 + * != 0 - error indication 291 + */ 292 + static inline int SkPciWriteCfgDWord( 293 + SK_AC *pAC, /* Adapter Control structure pointer */ 294 + int PciAddr, /* PCI register address */ 295 + SK_U32 Val) /* pointer to store the read value */ 296 + { 297 + pci_write_config_dword(pAC->PciDev, PciAddr, Val); 298 + return(0); 299 + } /* SkPciWriteCfgDWord */ 300 + 301 + /***************************************************************************** 302 + * 282 303 * SkGeInitPCI - Init the PCI resources 283 304 * 284 305 * Description: ··· 4102 4081 pci_read_config_byte(pAC->PciDev, PciAddr, pVal); 4103 4082 return(0); 4104 4083 } /* SkPciReadCfgByte */ 4105 - 4106 - 4107 - /***************************************************************************** 4108 - * 4109 - * SkPciWriteCfgDWord - write a 32 bit value to pci config space 4110 - * 4111 - * Description: 4112 - * This routine writes a 32 bit value to the pci configuration 4113 - * space. 4114 - * 4115 - * Returns: 4116 - * 0 - indicate everything worked ok. 4117 - * != 0 - error indication 4118 - */ 4119 - int SkPciWriteCfgDWord( 4120 - SK_AC *pAC, /* Adapter Control structure pointer */ 4121 - int PciAddr, /* PCI register address */ 4122 - SK_U32 Val) /* pointer to store the read value */ 4123 - { 4124 - pci_write_config_dword(pAC->PciDev, PciAddr, Val); 4125 - return(0); 4126 - } /* SkPciWriteCfgDWord */ 4127 4084 4128 4085 4129 4086 /*****************************************************************************
-15
drivers/net/wan/lmc/lmc_prot.h
··· 1 - #ifndef _LMC_PROTO_H_ 2 - #define _LMC_PROTO_H_ 3 - 4 - void lmc_proto_init(lmc_softc_t * const) 5 - void lmc_proto_attach(lmc_softc_t *sc const) 6 - void lmc_proto_detach(lmc_softc *sc const) 7 - void lmc_proto_reopen(lmc_softc_t *sc const) 8 - int lmc_proto_ioctl(lmc_softc_t *sc const, struct ifreq *ifr, int cmd) 9 - void lmc_proto_open(lmc_softc_t *sc const) 10 - void lmc_proto_close(lmc_softc_t *sc const) 11 - unsigned short lmc_proto_type(lmc_softc_t *sc const, struct skbuff *skb) 12 - 13 - 14 - #endif 15 -
+761 -727
drivers/net/wireless/atmel.c
··· 5 5 Copyright 2000-2001 ATMEL Corporation. 6 6 Copyright 2003-2004 Simon Kelley. 7 7 8 - This code was developed from version 2.1.1 of the Atmel drivers, 9 - released by Atmel corp. under the GPL in December 2002. It also 10 - includes code from the Linux aironet drivers (C) Benjamin Reed, 8 + This code was developed from version 2.1.1 of the Atmel drivers, 9 + released by Atmel corp. under the GPL in December 2002. It also 10 + includes code from the Linux aironet drivers (C) Benjamin Reed, 11 11 and the Linux PCMCIA package, (C) David Hinds and the Linux wireless 12 12 extensions, (C) Jean Tourrilhes. 13 13 ··· 31 31 along with Atmel wireless lan drivers; if not, write to the Free Software 32 32 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 33 33 34 - For all queries about this code, please contact the current author, 34 + For all queries about this code, please contact the current author, 35 35 Simon Kelley <simon@thekelleys.org.uk> and not Atmel Corporation. 36 36 37 37 Credit is due to HP UK and Cambridge Online Systems Ltd for supplying ··· 79 79 MODULE_LICENSE("GPL"); 80 80 MODULE_SUPPORTED_DEVICE("Atmel at76c50x wireless cards"); 81 81 82 - /* The name of the firmware file to be loaded 82 + /* The name of the firmware file to be loaded 83 83 over-rides any automatic selection */ 84 84 static char *firmware = NULL; 85 85 module_param(firmware, charp, 0); 86 86 87 87 /* table of firmware file names */ 88 - static struct { 88 + static struct { 89 89 AtmelFWType fw_type; 90 90 const char *fw_file; 91 91 const char *fw_file_ext; ··· 104 104 #define MAX_SSID_LENGTH 32 105 105 #define MGMT_JIFFIES (256 * HZ / 100) 106 106 107 - #define MAX_BSS_ENTRIES 64 107 + #define MAX_BSS_ENTRIES 64 108 108 109 109 /* registers */ 110 - #define GCR 0x00 // (SIR0) General Configuration Register 111 - #define BSR 0x02 // (SIR1) Bank Switching Select Register 110 + #define GCR 0x00 // (SIR0) General Configuration Register 111 + #define BSR 0x02 // (SIR1) Bank Switching Select Register 112 112 #define AR 0x04 113 113 #define DR 0x08 114 - #define MR1 0x12 // Mirror Register 1 115 - #define MR2 0x14 // Mirror Register 2 116 - #define MR3 0x16 // Mirror Register 3 117 - #define MR4 0x18 // Mirror Register 4 114 + #define MR1 0x12 // Mirror Register 1 115 + #define MR2 0x14 // Mirror Register 2 116 + #define MR3 0x16 // Mirror Register 3 117 + #define MR4 0x18 // Mirror Register 4 118 118 119 119 #define GPR1 0x0c 120 120 #define GPR2 0x0e ··· 123 123 // Constants for the GCR register. 124 124 // 125 125 #define GCR_REMAP 0x0400 // Remap internal SRAM to 0 126 - #define GCR_SWRES 0x0080 // BIU reset (ARM and PAI are NOT reset) 126 + #define GCR_SWRES 0x0080 // BIU reset (ARM and PAI are NOT reset) 127 127 #define GCR_CORES 0x0060 // Core Reset (ARM and PAI are reset) 128 - #define GCR_ENINT 0x0002 // Enable Interrupts 128 + #define GCR_ENINT 0x0002 // Enable Interrupts 129 129 #define GCR_ACKINT 0x0008 // Acknowledge Interrupts 130 130 131 131 #define BSS_SRAM 0x0200 // AMBA module selection --> SRAM ··· 190 190 u32 Next; 191 191 u16 MsduPos; 192 192 u16 MsduSize; 193 - 193 + 194 194 u8 State; 195 195 u8 Status; 196 196 u8 Rate; ··· 199 199 u8 PreambleType; 200 200 u16 Duration; 201 201 u32 RxTime; 202 - 203 202 }; 204 203 205 204 #define RX_DESC_FLAG_VALID 0x80 ··· 217 218 #define RX_DESC_DURATION_OFFSET 14 218 219 #define RX_DESC_RX_TIME_OFFSET 16 219 220 220 - 221 221 struct tx_desc { 222 222 u32 NextDescriptor; 223 223 u16 TxStartOfFrame; 224 224 u16 TxLength; 225 - 225 + 226 226 u8 TxState; 227 227 u8 TxStatus; 228 228 u8 RetryCount; 229 - 229 + 230 230 u8 TxRate; 231 231 232 232 u8 KeyIndex; ··· 236 238 u8 Reserved; 237 239 u8 PacketType; 238 240 u16 HostTxLength; 239 - 240 241 }; 241 - 242 242 243 243 #define TX_DESC_NEXT_OFFSET 0 244 244 #define TX_DESC_POS_OFFSET 4 ··· 251 255 #define TX_DESC_PACKET_TYPE_OFFSET 17 252 256 #define TX_DESC_HOST_LENGTH_OFFSET 18 253 257 254 - 255 - 256 258 /////////////////////////////////////////////////////// 257 259 // Host-MAC interface 258 260 /////////////////////////////////////////////////////// ··· 259 265 260 266 #define TX_FIRM_OWN 0x80 261 267 #define TX_DONE 0x40 262 - 263 268 264 269 #define TX_ERROR 0x01 265 270 ··· 273 280 #define ISR_COMMAND_COMPLETE 0x10 // command completed 274 281 #define ISR_OUT_OF_RANGE 0x20 // command completed 275 282 #define ISR_IBSS_MERGE 0x40 // (4.1.2.30): IBSS merge 276 - #define ISR_GENERIC_IRQ 0x80 277 - 283 + #define ISR_GENERIC_IRQ 0x80 278 284 279 285 #define Local_Mib_Type 0x01 280 286 #define Mac_Address_Mib_Type 0x02 ··· 309 317 #define LOCAL_MIB_PREAMBLE_TYPE 9 310 318 #define MAC_ADDR_MIB_MAC_ADDR_POS 0 311 319 312 - 313 320 #define CMD_Set_MIB_Vars 0x01 314 321 #define CMD_Get_MIB_Vars 0x02 315 322 #define CMD_Scan 0x03 ··· 329 338 #define CMD_STATUS_HOST_ERROR 0xFF 330 339 #define CMD_STATUS_BUSY 0xFE 331 340 332 - 333 341 #define CMD_BLOCK_COMMAND_OFFSET 0 334 342 #define CMD_BLOCK_STATUS_OFFSET 1 335 343 #define CMD_BLOCK_PARAMETERS_OFFSET 4 ··· 337 347 338 348 #define MGMT_FRAME_BODY_OFFSET 24 339 349 #define MAX_AUTHENTICATION_RETRIES 3 340 - #define MAX_ASSOCIATION_RETRIES 3 350 + #define MAX_ASSOCIATION_RETRIES 3 341 351 342 352 #define AUTHENTICATION_RESPONSE_TIME_OUT 1000 343 353 344 354 #define MAX_WIRELESS_BODY 2316 /* mtu is 2312, CRC is 4 */ 345 355 #define LOOP_RETRY_LIMIT 500000 346 356 347 - #define ACTIVE_MODE 1 348 - #define PS_MODE 2 357 + #define ACTIVE_MODE 1 358 + #define PS_MODE 2 349 359 350 360 #define MAX_ENCRYPTION_KEYS 4 351 361 #define MAX_ENCRYPTION_KEY_SIZE 40 ··· 367 377 #define REG_DOMAIN_MKK1 0x41 //Channel 1-14 Japan(MKK1) 368 378 #define REG_DOMAIN_ISRAEL 0x50 //Channel 3-9 ISRAEL 369 379 370 - #define BSS_TYPE_AD_HOC 1 380 + #define BSS_TYPE_AD_HOC 1 371 381 #define BSS_TYPE_INFRASTRUCTURE 2 372 382 373 383 #define SCAN_TYPE_ACTIVE 0 ··· 379 389 380 390 #define DATA_FRAME_WS_HEADER_SIZE 30 381 391 382 - /* promiscuous mode control */ 392 + /* promiscuous mode control */ 383 393 #define PROM_MODE_OFF 0x0 384 394 #define PROM_MODE_UNKNOWN 0x1 385 395 #define PROM_MODE_CRC_FAILED 0x2 ··· 388 398 #define PROM_MODE_CTRL 0x10 389 399 #define PROM_MODE_BAD_PROTOCOL 0x20 390 400 391 - 392 - #define IFACE_INT_STATUS_OFFSET 0 401 + #define IFACE_INT_STATUS_OFFSET 0 393 402 #define IFACE_INT_MASK_OFFSET 1 394 403 #define IFACE_LOCKOUT_HOST_OFFSET 2 395 404 #define IFACE_LOCKOUT_MAC_OFFSET 3 ··· 396 407 #define IFACE_MAC_STAT_OFFSET 30 397 408 #define IFACE_GENERIC_INT_TYPE_OFFSET 32 398 409 399 - #define CIPHER_SUITE_NONE 0 410 + #define CIPHER_SUITE_NONE 0 400 411 #define CIPHER_SUITE_WEP_64 1 401 412 #define CIPHER_SUITE_TKIP 2 402 413 #define CIPHER_SUITE_AES 3 ··· 408 419 // 409 420 // 410 421 411 - // FuncCtrl field: 422 + // FuncCtrl field: 412 423 // 413 424 #define FUNC_CTRL_TxENABLE 0x10 414 425 #define FUNC_CTRL_RxENABLE 0x20 415 - #define FUNC_CTRL_INIT_COMPLETE 0x01 426 + #define FUNC_CTRL_INIT_COMPLETE 0x01 416 427 417 428 /* A stub firmware image which reads the MAC address from NVRAM on the card. 418 429 For copyright information and source see the end of this file. */ ··· 475 486 struct net_device_stats stats; // device stats 476 487 spinlock_t irqlock, timerlock; // spinlocks 477 488 enum { BUS_TYPE_PCCARD, BUS_TYPE_PCI } bus_type; 478 - enum { 479 - CARD_TYPE_PARALLEL_FLASH, 489 + enum { 490 + CARD_TYPE_PARALLEL_FLASH, 480 491 CARD_TYPE_SPI_FLASH, 481 - CARD_TYPE_EEPROM 492 + CARD_TYPE_EEPROM 482 493 } card_type; 483 494 int do_rx_crc; /* If we need to CRC incoming packets */ 484 495 int probe_crc; /* set if we don't yet know */ ··· 486 497 u16 rx_desc_head; 487 498 u16 tx_desc_free, tx_desc_head, tx_desc_tail, tx_desc_previous; 488 499 u16 tx_free_mem, tx_buff_head, tx_buff_tail; 489 - 500 + 490 501 u16 frag_seq, frag_len, frag_no; 491 - u8 frag_source[6]; 492 - 502 + u8 frag_source[6]; 503 + 493 504 u8 wep_is_on, default_key, exclude_unencrypted, encryption_level; 494 505 u8 group_cipher_suite, pairwise_cipher_suite; 495 506 u8 wep_keys[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE]; 496 - int wep_key_len[MAX_ENCRYPTION_KEYS]; 507 + int wep_key_len[MAX_ENCRYPTION_KEYS]; 497 508 int use_wpa, radio_on_broken; /* firmware dependent stuff. */ 498 509 499 510 u16 host_info_base; 500 - struct host_info_struct { 511 + struct host_info_struct { 501 512 /* NB this is matched to the hardware, don't change. */ 502 513 u8 volatile int_status; 503 514 u8 volatile int_mask; ··· 513 524 u16 rx_buff_size; 514 525 u16 rx_desc_pos; 515 526 u16 rx_desc_count; 516 - 527 + 517 528 u16 build_version; 518 - u16 command_pos; 519 - 529 + u16 command_pos; 530 + 520 531 u16 major_version; 521 532 u16 minor_version; 522 - 533 + 523 534 u16 func_ctrl; 524 535 u16 mac_status; 525 536 u16 generic_IRQ_type; 526 537 u8 reserved[2]; 527 538 } host_info; 528 539 529 - enum { 540 + enum { 530 541 STATION_STATE_SCANNING, 531 542 STATION_STATE_JOINNING, 532 543 STATION_STATE_AUTHENTICATING, ··· 536 547 STATION_STATE_DOWN, 537 548 STATION_STATE_MGMT_ERROR 538 549 } station_state; 539 - 550 + 540 551 int operating_mode, power_mode; 541 552 time_t last_qual; 542 553 int beacons_this_sec; ··· 549 560 int long_retry, short_retry; 550 561 int preamble; 551 562 int default_beacon_period, beacon_period, listen_interval; 552 - int CurrentAuthentTransactionSeqNum, ExpectedAuthentTransactionSeqNum; 563 + int CurrentAuthentTransactionSeqNum, ExpectedAuthentTransactionSeqNum; 553 564 int AuthenticationRequestRetryCnt, AssociationRequestRetryCnt, ReAssociationRequestRetryCnt; 554 565 enum { 555 566 SITE_SURVEY_IDLE, 556 567 SITE_SURVEY_IN_PROGRESS, 557 - SITE_SURVEY_COMPLETED 568 + SITE_SURVEY_COMPLETED 558 569 } site_survey_state; 559 570 time_t last_survey; 560 571 561 572 int station_was_associated, station_is_associated; 562 573 int fast_scan; 563 - 574 + 564 575 struct bss_info { 565 576 int channel; 566 577 int SSIDsize; ··· 573 584 u8 SSID[MAX_SSID_LENGTH]; 574 585 } BSSinfo[MAX_BSS_ENTRIES]; 575 586 int BSS_list_entries, current_BSS; 576 - int connect_to_any_BSS; 587 + int connect_to_any_BSS; 577 588 int SSID_size, new_SSID_size; 578 589 u8 CurrentBSSID[6], BSSID[6]; 579 590 u8 SSID[MAX_SSID_LENGTH], new_SSID[MAX_SSID_LENGTH]; 580 591 u64 last_beacon_timestamp; 581 592 u8 rx_buf[MAX_WIRELESS_BODY]; 582 - 583 593 }; 584 594 585 595 static u8 atmel_basic_rates[4] = {0x82,0x84,0x0b,0x16}; ··· 586 598 static const struct { 587 599 int reg_domain; 588 600 int min, max; 589 - char *name; 601 + char *name; 590 602 } channel_table[] = { { REG_DOMAIN_FCC, 1, 11, "USA" }, 591 603 { REG_DOMAIN_DOC, 1, 11, "Canada" }, 592 604 { REG_DOMAIN_ETSI, 1, 13, "Europe" }, 593 605 { REG_DOMAIN_SPAIN, 10, 11, "Spain" }, 594 - { REG_DOMAIN_FRANCE, 10, 13, "France" }, 606 + { REG_DOMAIN_FRANCE, 10, 13, "France" }, 595 607 { REG_DOMAIN_MKK, 14, 14, "MKK" }, 596 608 { REG_DOMAIN_MKK1, 1, 14, "MKK1" }, 597 609 { REG_DOMAIN_ISRAEL, 3, 9, "Israel"} }; 598 610 599 611 static void build_wpa_mib(struct atmel_private *priv); 600 612 static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 601 - static void atmel_copy_to_card(struct net_device *dev, u16 dest, unsigned char *src, u16 len); 602 - static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, u16 src, u16 len); 613 + static void atmel_copy_to_card(struct net_device *dev, u16 dest, 614 + unsigned char *src, u16 len); 615 + static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, 616 + u16 src, u16 len); 603 617 static void atmel_set_gcr(struct net_device *dev, u16 mask); 604 618 static void atmel_clear_gcr(struct net_device *dev, u16 mask); 605 619 static int atmel_lock_mac(struct atmel_private *priv); 606 620 static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data); 607 621 static void atmel_command_irq(struct atmel_private *priv); 608 622 static int atmel_validate_channel(struct atmel_private *priv, int channel); 609 - static void atmel_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 623 + static void atmel_management_frame(struct atmel_private *priv, 624 + struct ieee80211_hdr_4addr *header, 610 625 u16 frame_len, u8 rssi); 611 626 static void atmel_management_timer(u_long a); 612 - static void atmel_send_command(struct atmel_private *priv, int command, void *cmd, int cmd_size); 613 - static int atmel_send_command_wait(struct atmel_private *priv, int command, void *cmd, int cmd_size); 614 - static void atmel_transmit_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 627 + static void atmel_send_command(struct atmel_private *priv, int command, 628 + void *cmd, int cmd_size); 629 + static int atmel_send_command_wait(struct atmel_private *priv, int command, 630 + void *cmd, int cmd_size); 631 + static void atmel_transmit_management_frame(struct atmel_private *priv, 632 + struct ieee80211_hdr_4addr *header, 615 633 u8 *body, int body_len); 616 634 617 635 static u8 atmel_get_mib8(struct atmel_private *priv, u8 type, u8 index); 618 - static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, u8 data); 619 - static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data); 620 - static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len); 621 - static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len); 636 + static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, 637 + u8 data); 638 + static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, 639 + u16 data); 640 + static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, 641 + u8 *data, int data_len); 642 + static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, 643 + u8 *data, int data_len); 622 644 static void atmel_scan(struct atmel_private *priv, int specific_ssid); 623 645 static void atmel_join_bss(struct atmel_private *priv, int bss_index); 624 646 static void atmel_smooth_qual(struct atmel_private *priv); ··· 648 650 return priv->host_info.command_pos + offset; 649 651 } 650 652 651 - static inline u16 atmel_rx(struct atmel_private *priv, u16 offset, u16 desc) 653 + static inline u16 atmel_rx(struct atmel_private *priv, u16 offset, u16 desc) 652 654 { 653 655 return priv->host_info.rx_desc_pos + (sizeof(struct rx_desc) * desc) + offset; 654 656 } 655 657 656 - static inline u16 atmel_tx(struct atmel_private *priv, u16 offset, u16 desc) 658 + static inline u16 atmel_tx(struct atmel_private *priv, u16 offset, u16 desc) 657 659 { 658 660 return priv->host_info.tx_desc_pos + (sizeof(struct tx_desc) * desc) + offset; 659 661 } ··· 680 682 681 683 static inline u8 atmel_rmem8(struct atmel_private *priv, u16 pos) 682 684 { 683 - atmel_writeAR(priv->dev, pos); 685 + atmel_writeAR(priv->dev, pos); 684 686 return atmel_read8(priv->dev, DR); 685 687 } 686 688 687 689 static inline void atmel_wmem8(struct atmel_private *priv, u16 pos, u16 data) 688 690 { 689 - atmel_writeAR(priv->dev, pos); 691 + atmel_writeAR(priv->dev, pos); 690 692 atmel_write8(priv->dev, DR, data); 691 693 } 692 694 693 695 static inline u16 atmel_rmem16(struct atmel_private *priv, u16 pos) 694 696 { 695 - atmel_writeAR(priv->dev, pos); 697 + atmel_writeAR(priv->dev, pos); 696 698 return atmel_read16(priv->dev, DR); 697 699 } 698 700 699 701 static inline void atmel_wmem16(struct atmel_private *priv, u16 pos, u16 data) 700 702 { 701 - atmel_writeAR(priv->dev, pos); 703 + atmel_writeAR(priv->dev, pos); 702 704 atmel_write16(priv->dev, DR, data); 703 705 } 704 706 ··· 708 710 { 709 711 int i; 710 712 711 - for (i = 0; 713 + for (i = 0; 712 714 atmel_rmem8(priv, atmel_tx(priv, TX_DESC_FLAGS_OFFSET, priv->tx_desc_head)) == TX_DONE && 713 715 i < priv->host_info.tx_desc_count; 714 716 i++) { 715 - 716 717 u8 status = atmel_rmem8(priv, atmel_tx(priv, TX_DESC_STATUS_OFFSET, priv->tx_desc_head)); 717 718 u16 msdu_size = atmel_rmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, priv->tx_desc_head)); 718 719 u8 type = atmel_rmem8(priv, atmel_tx(priv, TX_DESC_PACKET_TYPE_OFFSET, priv->tx_desc_head)); ··· 725 728 priv->tx_buff_head = 0; 726 729 else 727 730 priv->tx_buff_head += msdu_size; 728 - 731 + 729 732 if (priv->tx_desc_head < (priv->host_info.tx_desc_count - 1)) 730 - priv->tx_desc_head++ ; 733 + priv->tx_desc_head++ ; 731 734 else 732 735 priv->tx_desc_head = 0; 733 - 736 + 734 737 if (type == TX_PACKET_TYPE_DATA) { 735 738 if (status == TX_STATUS_SUCCESS) 736 739 priv->stats.tx_packets++; 737 - else 740 + else 738 741 priv->stats.tx_errors++; 739 742 netif_wake_queue(priv->dev); 740 743 } ··· 745 748 { 746 749 u16 bottom_free = priv->host_info.tx_buff_size - priv->tx_buff_tail; 747 750 748 - if (priv->tx_desc_free == 3 || priv->tx_free_mem < len) 751 + if (priv->tx_desc_free == 3 || priv->tx_free_mem < len) 749 752 return 0; 750 - 753 + 751 754 if (bottom_free >= len) 752 755 return priv->host_info.tx_buff_pos + priv->tx_buff_tail; 753 - 756 + 754 757 if (priv->tx_free_mem - bottom_free >= len) { 755 758 priv->tx_buff_tail = 0; 756 759 return priv->host_info.tx_buff_pos; 757 760 } 758 - 761 + 759 762 return 0; 760 763 } 761 764 762 - static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, u16 len, u16 buff, u8 type) 765 + static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, 766 + u16 len, u16 buff, u8 type) 763 767 { 764 768 atmel_wmem16(priv, atmel_tx(priv, TX_DESC_POS_OFFSET, priv->tx_desc_tail), buff); 765 769 atmel_wmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, priv->tx_desc_tail), len); ··· 773 775 int cipher_type, cipher_length; 774 776 if (is_bcast) { 775 777 cipher_type = priv->group_cipher_suite; 776 - if (cipher_type == CIPHER_SUITE_WEP_64 || 777 - cipher_type == CIPHER_SUITE_WEP_128 ) 778 + if (cipher_type == CIPHER_SUITE_WEP_64 || 779 + cipher_type == CIPHER_SUITE_WEP_128) 778 780 cipher_length = 8; 779 781 else if (cipher_type == CIPHER_SUITE_TKIP) 780 782 cipher_length = 12; ··· 788 790 } 789 791 } else { 790 792 cipher_type = priv->pairwise_cipher_suite; 791 - if (cipher_type == CIPHER_SUITE_WEP_64 || 792 - cipher_type == CIPHER_SUITE_WEP_128 ) 793 + if (cipher_type == CIPHER_SUITE_WEP_64 || 794 + cipher_type == CIPHER_SUITE_WEP_128) 793 795 cipher_length = 8; 794 796 else if (cipher_type == CIPHER_SUITE_TKIP) 795 797 cipher_length = 12; ··· 802 804 cipher_length = 0; 803 805 } 804 806 } 805 - 807 + 806 808 atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_TYPE_OFFSET, priv->tx_desc_tail), 807 - cipher_type); 809 + cipher_type); 808 810 atmel_wmem8(priv, atmel_tx(priv, TX_DESC_CIPHER_LENGTH_OFFSET, priv->tx_desc_tail), 809 811 cipher_length); 810 812 } ··· 813 815 if (priv->tx_desc_previous != priv->tx_desc_tail) 814 816 atmel_wmem32(priv, atmel_tx(priv, TX_DESC_NEXT_OFFSET, priv->tx_desc_previous), 0); 815 817 priv->tx_desc_previous = priv->tx_desc_tail; 816 - if (priv->tx_desc_tail < (priv->host_info.tx_desc_count -1 )) 818 + if (priv->tx_desc_tail < (priv->host_info.tx_desc_count - 1)) 817 819 priv->tx_desc_tail++; 818 820 else 819 821 priv->tx_desc_tail = 0; 820 822 priv->tx_desc_free--; 821 823 priv->tx_free_mem -= len; 822 - 823 824 } 824 825 825 - static int start_tx (struct sk_buff *skb, struct net_device *dev) 826 + static int start_tx(struct sk_buff *skb, struct net_device *dev) 826 827 { 827 828 struct atmel_private *priv = netdev_priv(dev); 828 829 struct ieee80211_hdr_4addr header; 829 830 unsigned long flags; 830 831 u16 buff, frame_ctl, len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN; 831 832 u8 SNAP_RFC1024[6] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; 832 - 833 - if (priv->card && priv->present_callback && 833 + 834 + if (priv->card && priv->present_callback && 834 835 !(*priv->present_callback)(priv->card)) { 835 836 priv->stats.tx_errors++; 836 837 dev_kfree_skb(skb); 837 838 return 0; 838 839 } 839 - 840 + 840 841 if (priv->station_state != STATION_STATE_READY) { 841 842 priv->stats.tx_errors++; 842 843 dev_kfree_skb(skb); 843 844 return 0; 844 845 } 845 - 846 + 846 847 /* first ensure the timer func cannot run */ 847 - spin_lock_bh(&priv->timerlock); 848 + spin_lock_bh(&priv->timerlock); 848 849 /* then stop the hardware ISR */ 849 - spin_lock_irqsave(&priv->irqlock, flags); 850 + spin_lock_irqsave(&priv->irqlock, flags); 850 851 /* nb doing the above in the opposite order will deadlock */ 851 - 852 + 852 853 /* The Wireless Header is 30 bytes. In the Ethernet packet we "cut" the 853 - 12 first bytes (containing DA/SA) and put them in the appropriate fields of 854 - the Wireless Header. Thus the packet length is then the initial + 18 (+30-12) */ 855 - 854 + 12 first bytes (containing DA/SA) and put them in the appropriate 855 + fields of the Wireless Header. Thus the packet length is then the 856 + initial + 18 (+30-12) */ 857 + 856 858 if (!(buff = find_tx_buff(priv, len + 18))) { 857 859 priv->stats.tx_dropped++; 858 860 spin_unlock_irqrestore(&priv->irqlock, flags); ··· 860 862 netif_stop_queue(dev); 861 863 return 1; 862 864 } 863 - 865 + 864 866 frame_ctl = IEEE80211_FTYPE_DATA; 865 867 header.duration_id = 0; 866 868 header.seq_ctl = 0; ··· 876 878 memcpy(&header.addr2, dev->dev_addr, 6); 877 879 memcpy(&header.addr3, skb->data, 6); 878 880 } 879 - 881 + 880 882 if (priv->use_wpa) 881 883 memcpy(&header.addr4, SNAP_RFC1024, 6); 882 884 ··· 886 888 /* Copy the packet sans its 802.3 header addresses which have been replaced */ 887 889 atmel_copy_to_card(dev, buff + DATA_FRAME_WS_HEADER_SIZE, skb->data + 12, len - 12); 888 890 priv->tx_buff_tail += len - 12 + DATA_FRAME_WS_HEADER_SIZE; 889 - 891 + 890 892 /* low bit of first byte of destination tells us if broadcast */ 891 893 tx_update_descriptor(priv, *(skb->data) & 0x01, len + 18, buff, TX_PACKET_TYPE_DATA); 892 894 dev->trans_start = jiffies; 893 895 priv->stats.tx_bytes += len; 894 - 896 + 895 897 spin_unlock_irqrestore(&priv->irqlock, flags); 896 898 spin_unlock_bh(&priv->timerlock); 897 899 dev_kfree_skb(skb); 898 - 899 - return 0; 900 + 901 + return 0; 900 902 } 901 903 902 - static void atmel_transmit_management_frame(struct atmel_private *priv, 904 + static void atmel_transmit_management_frame(struct atmel_private *priv, 903 905 struct ieee80211_hdr_4addr *header, 904 906 u8 *body, int body_len) 905 907 { 906 908 u16 buff; 907 - int len = MGMT_FRAME_BODY_OFFSET + body_len; 908 - 909 - if (!(buff = find_tx_buff(priv, len))) 909 + int len = MGMT_FRAME_BODY_OFFSET + body_len; 910 + 911 + if (!(buff = find_tx_buff(priv, len))) 910 912 return; 911 913 912 914 atmel_copy_to_card(priv->dev, buff, (u8 *)header, MGMT_FRAME_BODY_OFFSET); ··· 914 916 priv->tx_buff_tail += len; 915 917 tx_update_descriptor(priv, header->addr1[0] & 0x01, len, buff, TX_PACKET_TYPE_MGMT); 916 918 } 917 - 918 - static void fast_rx_path(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 919 + 920 + static void fast_rx_path(struct atmel_private *priv, 921 + struct ieee80211_hdr_4addr *header, 919 922 u16 msdu_size, u16 rx_packet_loc, u32 crc) 920 923 { 921 924 /* fast path: unfragmented packet copy directly into skbuf */ 922 - u8 mac4[6]; 923 - struct sk_buff *skb; 925 + u8 mac4[6]; 926 + struct sk_buff *skb; 924 927 unsigned char *skbp; 925 - 928 + 926 929 /* get the final, mac 4 header field, this tells us encapsulation */ 927 930 atmel_copy_to_host(priv->dev, mac4, rx_packet_loc + 24, 6); 928 931 msdu_size -= 6; 929 - 932 + 930 933 if (priv->do_rx_crc) { 931 934 crc = crc32_le(crc, mac4, 6); 932 935 msdu_size -= 4; 933 936 } 934 - 937 + 935 938 if (!(skb = dev_alloc_skb(msdu_size + 14))) { 936 939 priv->stats.rx_dropped++; 937 940 return; ··· 941 942 skb_reserve(skb, 2); 942 943 skbp = skb_put(skb, msdu_size + 12); 943 944 atmel_copy_to_host(priv->dev, skbp + 12, rx_packet_loc + 30, msdu_size); 944 - 945 + 945 946 if (priv->do_rx_crc) { 946 947 u32 netcrc; 947 948 crc = crc32_le(crc, skbp + 12, msdu_size); ··· 952 953 return; 953 954 } 954 955 } 955 - 956 + 956 957 memcpy(skbp, header->addr1, 6); /* destination address */ 957 - if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) 958 + if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) 958 959 memcpy(&skbp[6], header->addr3, 6); 959 960 else 960 961 memcpy(&skbp[6], header->addr2, 6); /* source address */ 961 - 962 - priv->dev->last_rx=jiffies; 962 + 963 + priv->dev->last_rx = jiffies; 963 964 skb->dev = priv->dev; 964 965 skb->protocol = eth_type_trans(skb, priv->dev); 965 - skb->ip_summed = CHECKSUM_NONE; 966 + skb->ip_summed = CHECKSUM_NONE; 966 967 netif_rx(skb); 967 968 priv->stats.rx_bytes += 12 + msdu_size; 968 969 priv->stats.rx_packets++; 969 970 } 970 971 971 972 /* Test to see if the packet in card memory at packet_loc has a valid CRC 972 - It doesn't matter that this is slow: it is only used to proble the first few packets. */ 973 + It doesn't matter that this is slow: it is only used to proble the first few 974 + packets. */ 973 975 static int probe_crc(struct atmel_private *priv, u16 packet_loc, u16 msdu_size) 974 976 { 975 977 int i = msdu_size - 4; ··· 980 980 return 0; 981 981 982 982 atmel_copy_to_host(priv->dev, (void *)&netcrc, packet_loc + i, 4); 983 - 983 + 984 984 atmel_writeAR(priv->dev, packet_loc); 985 985 while (i--) { 986 986 u8 octet = atmel_read8(priv->dev, DR); ··· 990 990 return (crc ^ 0xffffffff) == netcrc; 991 991 } 992 992 993 - static void frag_rx_path(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 994 - u16 msdu_size, u16 rx_packet_loc, u32 crc, u16 seq_no, u8 frag_no, int more_frags) 993 + static void frag_rx_path(struct atmel_private *priv, 994 + struct ieee80211_hdr_4addr *header, 995 + u16 msdu_size, u16 rx_packet_loc, u32 crc, u16 seq_no, 996 + u8 frag_no, int more_frags) 995 997 { 996 - u8 mac4[6]; 998 + u8 mac4[6]; 997 999 u8 source[6]; 998 1000 struct sk_buff *skb; 999 1001 1000 - if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) 1002 + if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) 1001 1003 memcpy(source, header->addr3, 6); 1002 1004 else 1003 - memcpy(source, header->addr2, 6); 1004 - 1005 + memcpy(source, header->addr2, 6); 1006 + 1005 1007 rx_packet_loc += 24; /* skip header */ 1006 - 1008 + 1007 1009 if (priv->do_rx_crc) 1008 1010 msdu_size -= 4; 1009 1011 ··· 1014 1012 msdu_size -= 6; 1015 1013 rx_packet_loc += 6; 1016 1014 1017 - if (priv->do_rx_crc) 1015 + if (priv->do_rx_crc) 1018 1016 crc = crc32_le(crc, mac4, 6); 1019 - 1017 + 1020 1018 priv->frag_seq = seq_no; 1021 1019 priv->frag_no = 1; 1022 1020 priv->frag_len = msdu_size; 1023 - memcpy(priv->frag_source, source, 6); 1021 + memcpy(priv->frag_source, source, 6); 1024 1022 memcpy(&priv->rx_buf[6], source, 6); 1025 1023 memcpy(priv->rx_buf, header->addr1, 6); 1026 - 1024 + 1027 1025 atmel_copy_to_host(priv->dev, &priv->rx_buf[12], rx_packet_loc, msdu_size); 1028 1026 1029 1027 if (priv->do_rx_crc) { ··· 1035 1033 memset(priv->frag_source, 0xff, 6); 1036 1034 } 1037 1035 } 1038 - 1036 + 1039 1037 } else if (priv->frag_no == frag_no && 1040 1038 priv->frag_seq == seq_no && 1041 1039 memcmp(priv->frag_source, source, 6) == 0) { 1042 - 1043 - atmel_copy_to_host(priv->dev, &priv->rx_buf[12 + priv->frag_len], 1040 + 1041 + atmel_copy_to_host(priv->dev, &priv->rx_buf[12 + priv->frag_len], 1044 1042 rx_packet_loc, msdu_size); 1045 1043 if (priv->do_rx_crc) { 1046 1044 u32 netcrc; 1047 - crc = crc32_le(crc, 1048 - &priv->rx_buf[12 + priv->frag_len], 1045 + crc = crc32_le(crc, 1046 + &priv->rx_buf[12 + priv->frag_len], 1049 1047 msdu_size); 1050 1048 atmel_copy_to_host(priv->dev, (void *)&netcrc, rx_packet_loc + msdu_size, 4); 1051 1049 if ((crc ^ 0xffffffff) != netcrc) { ··· 1054 1052 more_frags = 1; /* don't send broken assembly */ 1055 1053 } 1056 1054 } 1057 - 1055 + 1058 1056 priv->frag_len += msdu_size; 1059 1057 priv->frag_no++; 1060 1058 ··· 1064 1062 priv->stats.rx_dropped++; 1065 1063 } else { 1066 1064 skb_reserve(skb, 2); 1067 - memcpy(skb_put(skb, priv->frag_len + 12), 1065 + memcpy(skb_put(skb, priv->frag_len + 12), 1068 1066 priv->rx_buf, 1069 1067 priv->frag_len + 12); 1070 1068 priv->dev->last_rx = jiffies; 1071 1069 skb->dev = priv->dev; 1072 1070 skb->protocol = eth_type_trans(skb, priv->dev); 1073 - skb->ip_summed = CHECKSUM_NONE; 1071 + skb->ip_summed = CHECKSUM_NONE; 1074 1072 netif_rx(skb); 1075 1073 priv->stats.rx_bytes += priv->frag_len + 12; 1076 1074 priv->stats.rx_packets++; 1077 1075 } 1078 1076 } 1079 - 1080 1077 } else 1081 1078 priv->wstats.discard.fragment++; 1082 1079 } 1083 - 1080 + 1084 1081 static void rx_done_irq(struct atmel_private *priv) 1085 1082 { 1086 1083 int i; 1087 1084 struct ieee80211_hdr_4addr header; 1088 - 1089 - for (i = 0; 1085 + 1086 + for (i = 0; 1090 1087 atmel_rmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head)) == RX_DESC_FLAG_VALID && 1091 1088 i < priv->host_info.rx_desc_count; 1092 1089 i++) { 1093 - 1090 + 1094 1091 u16 msdu_size, rx_packet_loc, frame_ctl, seq_control; 1095 1092 u8 status = atmel_rmem8(priv, atmel_rx(priv, RX_DESC_STATUS_OFFSET, priv->rx_desc_head)); 1096 1093 u32 crc = 0xffffffff; 1097 - 1094 + 1098 1095 if (status != RX_STATUS_SUCCESS) { 1099 1096 if (status == 0xc1) /* determined by experiment */ 1100 1097 priv->wstats.discard.nwid++; 1101 1098 else 1102 - priv->stats.rx_errors++; 1099 + priv->stats.rx_errors++; 1103 1100 goto next; 1104 1101 } 1105 1102 1106 1103 msdu_size = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_SIZE_OFFSET, priv->rx_desc_head)); 1107 1104 rx_packet_loc = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_POS_OFFSET, priv->rx_desc_head)); 1108 - 1105 + 1109 1106 if (msdu_size < 30) { 1110 - priv->stats.rx_errors++; 1107 + priv->stats.rx_errors++; 1111 1108 goto next; 1112 1109 } 1113 - 1110 + 1114 1111 /* Get header as far as end of seq_ctl */ 1115 1112 atmel_copy_to_host(priv->dev, (char *)&header, rx_packet_loc, 24); 1116 1113 frame_ctl = le16_to_cpu(header.frame_ctl); 1117 1114 seq_control = le16_to_cpu(header.seq_ctl); 1118 1115 1119 - /* probe for CRC use here if needed once five packets have arrived with 1120 - the same crc status, we assume we know what's happening and stop probing */ 1116 + /* probe for CRC use here if needed once five packets have 1117 + arrived with the same crc status, we assume we know what's 1118 + happening and stop probing */ 1121 1119 if (priv->probe_crc) { 1122 1120 if (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED)) { 1123 1121 priv->do_rx_crc = probe_crc(priv, rx_packet_loc, msdu_size); ··· 1132 1130 priv->probe_crc = 0; 1133 1131 } 1134 1132 } 1135 - 1133 + 1136 1134 /* don't CRC header when WEP in use */ 1137 1135 if (priv->do_rx_crc && (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED))) { 1138 1136 crc = crc32_le(0xffffffff, (unsigned char *)&header, 24); 1139 1137 } 1140 1138 msdu_size -= 24; /* header */ 1141 1139 1142 - if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { 1143 - 1140 + if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { 1144 1141 int more_fragments = frame_ctl & IEEE80211_FCTL_MOREFRAGS; 1145 1142 u8 packet_fragment_no = seq_control & IEEE80211_SCTL_FRAG; 1146 1143 u16 packet_sequence_no = (seq_control & IEEE80211_SCTL_SEQ) >> 4; 1147 - 1148 - if (!more_fragments && packet_fragment_no == 0 ) { 1144 + 1145 + if (!more_fragments && packet_fragment_no == 0) { 1149 1146 fast_rx_path(priv, &header, msdu_size, rx_packet_loc, crc); 1150 1147 } else { 1151 1148 frag_rx_path(priv, &header, msdu_size, rx_packet_loc, crc, 1152 1149 packet_sequence_no, packet_fragment_no, more_fragments); 1153 1150 } 1154 1151 } 1155 - 1152 + 1156 1153 if ((frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { 1157 1154 /* copy rest of packet into buffer */ 1158 1155 atmel_copy_to_host(priv->dev, (unsigned char *)&priv->rx_buf, rx_packet_loc + 24, msdu_size); 1159 - 1156 + 1160 1157 /* we use the same buffer for frag reassembly and control packets */ 1161 1158 memset(priv->frag_source, 0xff, 6); 1162 - 1159 + 1163 1160 if (priv->do_rx_crc) { 1164 1161 /* last 4 octets is crc */ 1165 1162 msdu_size -= 4; ··· 1171 1170 1172 1171 atmel_management_frame(priv, &header, msdu_size, 1173 1172 atmel_rmem8(priv, atmel_rx(priv, RX_DESC_RSSI_OFFSET, priv->rx_desc_head))); 1174 - } 1173 + } 1175 1174 1176 - next: 1175 + next: 1177 1176 /* release descriptor */ 1178 - atmel_wmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head), RX_DESC_FLAG_CONSUMED); 1179 - 1177 + atmel_wmem8(priv, atmel_rx(priv, RX_DESC_FLAGS_OFFSET, priv->rx_desc_head), RX_DESC_FLAG_CONSUMED); 1178 + 1180 1179 if (priv->rx_desc_head < (priv->host_info.rx_desc_count - 1)) 1181 - priv->rx_desc_head++; 1180 + priv->rx_desc_head++; 1182 1181 else 1183 1182 priv->rx_desc_head = 0; 1184 1183 } 1185 - } 1184 + } 1186 1185 1187 1186 static irqreturn_t service_interrupt(int irq, void *dev_id, struct pt_regs *regs) 1188 1187 { ··· 1190 1189 struct atmel_private *priv = netdev_priv(dev); 1191 1190 u8 isr; 1192 1191 int i = -1; 1193 - static u8 irq_order[] = { 1192 + static u8 irq_order[] = { 1194 1193 ISR_OUT_OF_RANGE, 1195 1194 ISR_RxCOMPLETE, 1196 1195 ISR_TxCOMPLETE, ··· 1200 1199 ISR_IBSS_MERGE, 1201 1200 ISR_GENERIC_IRQ 1202 1201 }; 1203 - 1204 1202 1205 - if (priv->card && priv->present_callback && 1203 + if (priv->card && priv->present_callback && 1206 1204 !(*priv->present_callback)(priv->card)) 1207 1205 return IRQ_HANDLED; 1208 1206 1209 1207 /* In this state upper-level code assumes it can mess with 1210 1208 the card unhampered by interrupts which may change register state. 1211 1209 Note that even though the card shouldn't generate interrupts 1212 - the inturrupt line may be shared. This allows card setup 1210 + the inturrupt line may be shared. This allows card setup 1213 1211 to go on without disabling interrupts for a long time. */ 1214 1212 if (priv->station_state == STATION_STATE_DOWN) 1215 1213 return IRQ_NONE; 1216 - 1214 + 1217 1215 atmel_clear_gcr(dev, GCR_ENINT); /* disable interrupts */ 1218 1216 1219 1217 while (1) { ··· 1221 1221 printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name); 1222 1222 return IRQ_HANDLED; 1223 1223 } 1224 - 1224 + 1225 1225 isr = atmel_rmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET)); 1226 1226 atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); 1227 - 1227 + 1228 1228 if (!isr) { 1229 1229 atmel_set_gcr(dev, GCR_ENINT); /* enable interrupts */ 1230 1230 return i == -1 ? IRQ_NONE : IRQ_HANDLED; 1231 1231 } 1232 - 1232 + 1233 1233 atmel_set_gcr(dev, GCR_ACKINT); /* acknowledge interrupt */ 1234 - 1234 + 1235 1235 for (i = 0; i < sizeof(irq_order)/sizeof(u8); i++) 1236 1236 if (isr & irq_order[i]) 1237 1237 break; 1238 - 1238 + 1239 1239 if (!atmel_lock_mac(priv)) { 1240 1240 /* failed to contact card */ 1241 1241 printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name); 1242 1242 return IRQ_HANDLED; 1243 1243 } 1244 - 1244 + 1245 1245 isr = atmel_rmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET)); 1246 1246 isr ^= irq_order[i]; 1247 1247 atmel_wmem8(priv, atmel_hi(priv, IFACE_INT_STATUS_OFFSET), isr); 1248 1248 atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); 1249 - 1249 + 1250 1250 switch (irq_order[i]) { 1251 - 1252 - case ISR_OUT_OF_RANGE: 1253 - if (priv->operating_mode == IW_MODE_INFRA && 1251 + 1252 + case ISR_OUT_OF_RANGE: 1253 + if (priv->operating_mode == IW_MODE_INFRA && 1254 1254 priv->station_state == STATION_STATE_READY) { 1255 1255 priv->station_is_associated = 0; 1256 1256 atmel_scan(priv, 1); ··· 1261 1261 priv->wstats.discard.misc++; 1262 1262 /* fall through */ 1263 1263 case ISR_RxCOMPLETE: 1264 - rx_done_irq(priv); 1264 + rx_done_irq(priv); 1265 1265 break; 1266 - 1266 + 1267 1267 case ISR_TxCOMPLETE: 1268 - tx_done_irq(priv); 1268 + tx_done_irq(priv); 1269 1269 break; 1270 - 1270 + 1271 1271 case ISR_FATAL_ERROR: 1272 1272 printk(KERN_ALERT "%s: *** FATAL error interrupt ***\n", dev->name); 1273 1273 atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 1274 1274 break; 1275 - 1276 - case ISR_COMMAND_COMPLETE: 1275 + 1276 + case ISR_COMMAND_COMPLETE: 1277 1277 atmel_command_irq(priv); 1278 1278 break; 1279 1279 1280 1280 case ISR_IBSS_MERGE: 1281 - atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, 1281 + atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, 1282 1282 priv->CurrentBSSID, 6); 1283 1283 /* The WPA stuff cares about the current AP address */ 1284 1284 if (priv->use_wpa) ··· 1288 1288 printk(KERN_INFO "%s: Generic_irq received.\n", dev->name); 1289 1289 break; 1290 1290 } 1291 - } 1291 + } 1292 1292 } 1293 1293 1294 - 1295 - static struct net_device_stats *atmel_get_stats (struct net_device *dev) 1294 + static struct net_device_stats *atmel_get_stats(struct net_device *dev) 1296 1295 { 1297 1296 struct atmel_private *priv = netdev_priv(dev); 1298 1297 return &priv->stats; 1299 1298 } 1300 1299 1301 - static struct iw_statistics *atmel_get_wireless_stats (struct net_device *dev) 1300 + static struct iw_statistics *atmel_get_wireless_stats(struct net_device *dev) 1302 1301 { 1303 1302 struct atmel_private *priv = netdev_priv(dev); 1304 1303 1305 - /* update the link quality here in case we are seeing no beacons 1304 + /* update the link quality here in case we are seeing no beacons 1306 1305 at all to drive the process */ 1307 1306 atmel_smooth_qual(priv); 1308 - 1307 + 1309 1308 priv->wstats.status = priv->station_state; 1310 1309 1311 1310 if (priv->operating_mode == IW_MODE_INFRA) { ··· 1327 1328 | IW_QUAL_NOISE_INVALID; 1328 1329 priv->wstats.miss.beacon = 0; 1329 1330 } 1330 - 1331 - return (&priv->wstats); 1331 + 1332 + return &priv->wstats; 1332 1333 } 1333 1334 1334 1335 static int atmel_change_mtu(struct net_device *dev, int new_mtu) ··· 1342 1343 static int atmel_set_mac_address(struct net_device *dev, void *p) 1343 1344 { 1344 1345 struct sockaddr *addr = p; 1345 - 1346 + 1346 1347 memcpy (dev->dev_addr, addr->sa_data, dev->addr_len); 1347 1348 return atmel_open(dev); 1348 1349 } 1349 1350 1350 1351 EXPORT_SYMBOL(atmel_open); 1351 1352 1352 - int atmel_open (struct net_device *dev) 1353 + int atmel_open(struct net_device *dev) 1353 1354 { 1354 1355 struct atmel_private *priv = netdev_priv(dev); 1355 1356 int i, channel; 1356 1357 1357 1358 /* any scheduled timer is no longer needed and might screw things up.. */ 1358 1359 del_timer_sync(&priv->management_timer); 1359 - 1360 + 1360 1361 /* Interrupts will not touch the card once in this state... */ 1361 1362 priv->station_state = STATION_STATE_DOWN; 1362 1363 ··· 1376 1377 priv->site_survey_state = SITE_SURVEY_IDLE; 1377 1378 priv->station_is_associated = 0; 1378 1379 1379 - if (!reset_atmel_card(dev)) 1380 + if (!reset_atmel_card(dev)) 1380 1381 return -EAGAIN; 1381 1382 1382 1383 if (priv->config_reg_domain) { ··· 1390 1391 if (i == sizeof(channel_table)/sizeof(channel_table[0])) { 1391 1392 priv->reg_domain = REG_DOMAIN_MKK1; 1392 1393 printk(KERN_ALERT "%s: failed to get regulatory domain: assuming MKK1.\n", dev->name); 1393 - } 1394 + } 1394 1395 } 1395 - 1396 + 1396 1397 if ((channel = atmel_validate_channel(priv, priv->channel))) 1397 1398 priv->channel = channel; 1398 1399 1399 - /* this moves station_state on.... */ 1400 - atmel_scan(priv, 1); 1400 + /* this moves station_state on.... */ 1401 + atmel_scan(priv, 1); 1401 1402 1402 1403 atmel_set_gcr(priv->dev, GCR_ENINT); /* enable interrupts */ 1403 1404 return 0; 1404 1405 } 1405 1406 1406 - static int atmel_close (struct net_device *dev) 1407 + static int atmel_close(struct net_device *dev) 1407 1408 { 1408 1409 struct atmel_private *priv = netdev_priv(dev); 1409 - 1410 + 1410 1411 atmel_enter_state(priv, STATION_STATE_DOWN); 1411 - 1412 - if (priv->bus_type == BUS_TYPE_PCCARD) 1412 + 1413 + if (priv->bus_type == BUS_TYPE_PCCARD) 1413 1414 atmel_write16(dev, GCR, 0x0060); 1414 1415 atmel_write16(dev, GCR, 0x0040); 1415 1416 return 0; ··· 1437 1438 int i; 1438 1439 char *p = buf; 1439 1440 char *s, *r, *c; 1440 - 1441 - p += sprintf(p, "Driver version:\t\t%d.%d\n", DRIVER_MAJOR, DRIVER_MINOR); 1442 - 1441 + 1442 + p += sprintf(p, "Driver version:\t\t%d.%d\n", 1443 + DRIVER_MAJOR, DRIVER_MINOR); 1444 + 1443 1445 if (priv->station_state != STATION_STATE_DOWN) { 1444 - p += sprintf(p, "Firmware version:\t%d.%d build %d\nFirmware location:\t", 1446 + p += sprintf(p, "Firmware version:\t%d.%d build %d\n" 1447 + "Firmware location:\t", 1445 1448 priv->host_info.major_version, 1446 1449 priv->host_info.minor_version, 1447 1450 priv->host_info.build_version); 1448 - 1449 - if (priv->card_type != CARD_TYPE_EEPROM) 1451 + 1452 + if (priv->card_type != CARD_TYPE_EEPROM) 1450 1453 p += sprintf(p, "on card\n"); 1451 - else if (priv->firmware) 1452 - p += sprintf(p, "%s loaded by host\n", priv->firmware_id); 1454 + else if (priv->firmware) 1455 + p += sprintf(p, "%s loaded by host\n", 1456 + priv->firmware_id); 1453 1457 else 1454 - p += sprintf(p, "%s loaded by hotplug\n", priv->firmware_id); 1455 - 1456 - switch(priv->card_type) { 1458 + p += sprintf(p, "%s loaded by hotplug\n", 1459 + priv->firmware_id); 1460 + 1461 + switch (priv->card_type) { 1457 1462 case CARD_TYPE_PARALLEL_FLASH: c = "Parallel flash"; break; 1458 1463 case CARD_TYPE_SPI_FLASH: c = "SPI flash\n"; break; 1459 1464 case CARD_TYPE_EEPROM: c = "EEPROM"; break; 1460 1465 default: c = "<unknown>"; 1461 1466 } 1462 1467 1463 - 1464 1468 r = "<unknown>"; 1465 1469 for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) 1466 1470 if (priv->reg_domain == channel_table[i].reg_domain) 1467 1471 r = channel_table[i].name; 1468 - 1472 + 1469 1473 p += sprintf(p, "MAC memory type:\t%s\n", c); 1470 1474 p += sprintf(p, "Regulatory domain:\t%s\n", r); 1471 - p += sprintf(p, "Host CRC checking:\t%s\n", 1475 + p += sprintf(p, "Host CRC checking:\t%s\n", 1472 1476 priv->do_rx_crc ? "On" : "Off"); 1473 1477 p += sprintf(p, "WPA-capable firmware:\t%s\n", 1474 1478 priv->use_wpa ? "Yes" : "No"); 1475 1479 } 1476 - 1480 + 1477 1481 switch(priv->station_state) { 1478 1482 case STATION_STATE_SCANNING: s = "Scanning"; break; 1479 1483 case STATION_STATE_JOINNING: s = "Joining"; break; ··· 1488 1486 case STATION_STATE_DOWN: s = "Down"; break; 1489 1487 default: s = "<unknown>"; 1490 1488 } 1491 - 1489 + 1492 1490 p += sprintf(p, "Current state:\t\t%s\n", s); 1493 - return p - buf; 1491 + return p - buf; 1494 1492 } 1495 1493 1496 1494 static int atmel_read_proc(char *page, char **start, off_t off, ··· 1506 1504 return len; 1507 1505 } 1508 1506 1509 - struct net_device *init_atmel_card( unsigned short irq, unsigned long port, const AtmelFWType fw_type, 1510 - struct device *sys_dev, int (*card_present)(void *), void *card) 1507 + struct net_device *init_atmel_card(unsigned short irq, unsigned long port, 1508 + const AtmelFWType fw_type, 1509 + struct device *sys_dev, 1510 + int (*card_present)(void *), void *card) 1511 1511 { 1512 + struct proc_dir_entry *ent; 1512 1513 struct net_device *dev; 1513 1514 struct atmel_private *priv; 1514 1515 int rc; ··· 1519 1514 /* Create the network device object. */ 1520 1515 dev = alloc_etherdev(sizeof(*priv)); 1521 1516 if (!dev) { 1522 - printk(KERN_ERR "atmel: Couldn't alloc_etherdev\n"); 1517 + printk(KERN_ERR "atmel: Couldn't alloc_etherdev\n"); 1523 1518 return NULL; 1524 1519 } 1525 1520 if (dev_alloc_name(dev, dev->name) < 0) { 1526 - printk(KERN_ERR "atmel: Couldn't get name!\n"); 1521 + printk(KERN_ERR "atmel: Couldn't get name!\n"); 1527 1522 goto err_out_free; 1528 1523 } 1529 1524 ··· 1555 1550 memset(priv->BSSID, 0, 6); 1556 1551 priv->CurrentBSSID[0] = 0xFF; /* Initialize to something invalid.... */ 1557 1552 priv->station_was_associated = 0; 1558 - 1553 + 1559 1554 priv->last_survey = jiffies; 1560 1555 priv->preamble = LONG_PREAMBLE; 1561 1556 priv->operating_mode = IW_MODE_INFRA; ··· 1591 1586 spin_lock_init(&priv->timerlock); 1592 1587 priv->management_timer.function = atmel_management_timer; 1593 1588 priv->management_timer.data = (unsigned long) dev; 1594 - 1589 + 1595 1590 dev->open = atmel_open; 1596 1591 dev->stop = atmel_close; 1597 1592 dev->change_mtu = atmel_change_mtu; ··· 1602 1597 dev->do_ioctl = atmel_ioctl; 1603 1598 dev->irq = irq; 1604 1599 dev->base_addr = port; 1605 - 1600 + 1606 1601 SET_NETDEV_DEV(dev, sys_dev); 1607 - 1602 + 1608 1603 if ((rc = request_irq(dev->irq, service_interrupt, SA_SHIRQ, dev->name, dev))) { 1609 - printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc ); 1604 + printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc); 1610 1605 goto err_out_free; 1611 1606 } 1612 1607 1613 - if (!request_region(dev->base_addr, 32, 1608 + if (!request_region(dev->base_addr, 32, 1614 1609 priv->bus_type == BUS_TYPE_PCCARD ? "atmel_cs" : "atmel_pci")) { 1615 1610 goto err_out_irq; 1616 1611 } 1617 - 1612 + 1618 1613 if (register_netdev(dev)) 1619 1614 goto err_out_res; 1620 - 1615 + 1621 1616 if (!probe_atmel_card(dev)){ 1622 1617 unregister_netdev(dev); 1623 1618 goto err_out_res; 1624 1619 } 1625 - 1620 + 1626 1621 netif_carrier_off(dev); 1627 - 1628 - create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); 1629 - 1622 + 1623 + ent = create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); 1624 + if (!ent) 1625 + printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); 1626 + 1630 1627 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 1631 1628 dev->name, DRIVER_MAJOR, DRIVER_MINOR, 1632 1629 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 1633 1630 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] ); 1634 - 1631 + 1635 1632 SET_MODULE_OWNER(dev); 1636 1633 return dev; 1637 - 1638 - err_out_res: 1634 + 1635 + err_out_res: 1639 1636 release_region( dev->base_addr, 32); 1640 - err_out_irq: 1637 + err_out_irq: 1641 1638 free_irq(dev->irq, dev); 1642 - err_out_free: 1639 + err_out_free: 1643 1640 free_netdev(dev); 1644 1641 return NULL; 1645 1642 } ··· 1651 1644 void stop_atmel_card(struct net_device *dev) 1652 1645 { 1653 1646 struct atmel_private *priv = netdev_priv(dev); 1654 - 1647 + 1655 1648 /* put a brick on it... */ 1656 - if (priv->bus_type == BUS_TYPE_PCCARD) 1649 + if (priv->bus_type == BUS_TYPE_PCCARD) 1657 1650 atmel_write16(dev, GCR, 0x0060); 1658 1651 atmel_write16(dev, GCR, 0x0040); 1659 - 1652 + 1660 1653 del_timer_sync(&priv->management_timer); 1661 1654 unregister_netdev(dev); 1662 1655 remove_proc_entry("driver/atmel", NULL); ··· 1682 1675 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; 1683 1676 1684 1677 priv->connect_to_any_BSS = 0; 1685 - 1678 + 1686 1679 /* Check the size of the string */ 1687 1680 if (dwrq->length > MAX_SSID_LENGTH + 1) 1688 - return -E2BIG ; 1681 + return -E2BIG; 1689 1682 if (index != 0) 1690 1683 return -EINVAL; 1691 - 1684 + 1692 1685 memcpy(priv->new_SSID, extra, dwrq->length - 1); 1693 1686 priv->new_SSID_size = dwrq->length - 1; 1694 1687 } ··· 1713 1706 extra[priv->SSID_size] = '\0'; 1714 1707 dwrq->length = priv->SSID_size + 1; 1715 1708 } 1716 - 1709 + 1717 1710 dwrq->flags = !priv->connect_to_any_BSS; /* active */ 1718 1711 1719 1712 return 0; ··· 1775 1768 /* WE specify that if a valid key is set, encryption 1776 1769 * should be enabled (user may turn it off later) 1777 1770 * This is also how "iwconfig ethX key on" works */ 1778 - if (index == current_index && 1771 + if (index == current_index && 1779 1772 priv->wep_key_len[index] > 0) { 1780 1773 priv->wep_is_on = 1; 1781 1774 priv->exclude_unencrypted = 1; ··· 1790 1783 } else { 1791 1784 /* Do we want to just set the transmit key index ? */ 1792 1785 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; 1793 - if ( index>=0 && index < 4 ) { 1786 + if (index >= 0 && index < 4) { 1794 1787 priv->default_key = index; 1795 1788 } else 1796 1789 /* Don't complain if only change the mode */ 1797 - if(!dwrq->flags & IW_ENCODE_MODE) { 1790 + if (!dwrq->flags & IW_ENCODE_MODE) { 1798 1791 return -EINVAL; 1799 1792 } 1800 1793 } 1801 1794 /* Read the flags */ 1802 - if(dwrq->flags & IW_ENCODE_DISABLED) { 1795 + if (dwrq->flags & IW_ENCODE_DISABLED) { 1803 1796 priv->wep_is_on = 0; 1804 - priv->encryption_level = 0; 1797 + priv->encryption_level = 0; 1805 1798 priv->pairwise_cipher_suite = CIPHER_SUITE_NONE; 1806 1799 } else { 1807 1800 priv->wep_is_on = 1; ··· 1813 1806 priv->encryption_level = 1; 1814 1807 } 1815 1808 } 1816 - if(dwrq->flags & IW_ENCODE_RESTRICTED) 1809 + if (dwrq->flags & IW_ENCODE_RESTRICTED) 1817 1810 priv->exclude_unencrypted = 1; 1818 - if(dwrq->flags & IW_ENCODE_OPEN) 1811 + if(dwrq->flags & IW_ENCODE_OPEN) 1819 1812 priv->exclude_unencrypted = 0; 1820 - 1813 + 1821 1814 return -EINPROGRESS; /* Call commit handler */ 1822 1815 } 1823 - 1824 1816 1825 1817 static int atmel_get_encode(struct net_device *dev, 1826 1818 struct iw_request_info *info, ··· 1828 1822 { 1829 1823 struct atmel_private *priv = netdev_priv(dev); 1830 1824 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; 1831 - 1825 + 1832 1826 if (!priv->wep_is_on) 1833 1827 dwrq->flags = IW_ENCODE_DISABLED; 1834 1828 else { ··· 1849 1843 memset(extra, 0, 16); 1850 1844 memcpy(extra, priv->wep_keys[index], dwrq->length); 1851 1845 } 1852 - 1846 + 1853 1847 return 0; 1854 1848 } 1855 1849 ··· 1868 1862 char *extra) 1869 1863 { 1870 1864 struct atmel_private *priv = netdev_priv(dev); 1871 - 1865 + 1872 1866 if (vwrq->fixed == 0) { 1873 1867 priv->tx_rate = 3; 1874 1868 priv->auto_tx_rate = 1; 1875 1869 } else { 1876 1870 priv->auto_tx_rate = 0; 1877 - 1871 + 1878 1872 /* Which type of value ? */ 1879 - if((vwrq->value < 4) && (vwrq->value >= 0)) { 1873 + if ((vwrq->value < 4) && (vwrq->value >= 0)) { 1880 1874 /* Setting by rate index */ 1881 - priv->tx_rate = vwrq->value; 1875 + priv->tx_rate = vwrq->value; 1882 1876 } else { 1883 1877 /* Setting by frequency value */ 1884 1878 switch (vwrq->value) { ··· 1905 1899 return -EINVAL; 1906 1900 1907 1901 priv->operating_mode = *uwrq; 1908 - return -EINPROGRESS; 1902 + return -EINPROGRESS; 1909 1903 } 1910 1904 1911 1905 static int atmel_get_mode(struct net_device *dev, ··· 1914 1908 char *extra) 1915 1909 { 1916 1910 struct atmel_private *priv = netdev_priv(dev); 1917 - 1911 + 1918 1912 *uwrq = priv->operating_mode; 1919 1913 return 0; 1920 1914 } ··· 1968 1962 char *extra) 1969 1963 { 1970 1964 struct atmel_private *priv = netdev_priv(dev); 1971 - 1972 - if(!vwrq->disabled && (vwrq->flags & IW_RETRY_LIMIT)) { 1973 - if(vwrq->flags & IW_RETRY_MAX) 1965 + 1966 + if (!vwrq->disabled && (vwrq->flags & IW_RETRY_LIMIT)) { 1967 + if (vwrq->flags & IW_RETRY_MAX) 1974 1968 priv->long_retry = vwrq->value; 1975 1969 else if (vwrq->flags & IW_RETRY_MIN) 1976 1970 priv->short_retry = vwrq->value; ··· 1979 1973 priv->long_retry = vwrq->value; 1980 1974 priv->short_retry = vwrq->value; 1981 1975 } 1982 - return -EINPROGRESS; 1976 + return -EINPROGRESS; 1983 1977 } 1984 - 1978 + 1985 1979 return -EINVAL; 1986 1980 } 1987 1981 ··· 1995 1989 vwrq->disabled = 0; /* Can't be disabled */ 1996 1990 1997 1991 /* Note : by default, display the min retry number */ 1998 - if((vwrq->flags & IW_RETRY_MAX)) { 1992 + if (vwrq->flags & IW_RETRY_MAX) { 1999 1993 vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; 2000 1994 vwrq->value = priv->long_retry; 2001 1995 } else { 2002 1996 vwrq->flags = IW_RETRY_LIMIT; 2003 1997 vwrq->value = priv->short_retry; 2004 - if(priv->long_retry != priv->short_retry) 1998 + if (priv->long_retry != priv->short_retry) 2005 1999 vwrq->flags |= IW_RETRY_MIN; 2006 2000 } 2007 2001 ··· 2016 2010 struct atmel_private *priv = netdev_priv(dev); 2017 2011 int rthr = vwrq->value; 2018 2012 2019 - if(vwrq->disabled) 2013 + if (vwrq->disabled) 2020 2014 rthr = 2347; 2021 - if((rthr < 0) || (rthr > 2347)) { 2015 + if ((rthr < 0) || (rthr > 2347)) { 2022 2016 return -EINVAL; 2023 2017 } 2024 2018 priv->rts_threshold = rthr; 2025 - 2019 + 2026 2020 return -EINPROGRESS; /* Call commit handler */ 2027 2021 } 2028 2022 ··· 2032 2026 char *extra) 2033 2027 { 2034 2028 struct atmel_private *priv = netdev_priv(dev); 2035 - 2029 + 2036 2030 vwrq->value = priv->rts_threshold; 2037 2031 vwrq->disabled = (vwrq->value >= 2347); 2038 2032 vwrq->fixed = 1; ··· 2048 2042 struct atmel_private *priv = netdev_priv(dev); 2049 2043 int fthr = vwrq->value; 2050 2044 2051 - if(vwrq->disabled) 2045 + if (vwrq->disabled) 2052 2046 fthr = 2346; 2053 - if((fthr < 256) || (fthr > 2346)) { 2047 + if ((fthr < 256) || (fthr > 2346)) { 2054 2048 return -EINVAL; 2055 2049 } 2056 2050 fthr &= ~0x1; /* Get an even value - is it really needed ??? */ 2057 2051 priv->frag_threshold = fthr; 2058 - 2052 + 2059 2053 return -EINPROGRESS; /* Call commit handler */ 2060 2054 } 2061 2055 ··· 2083 2077 { 2084 2078 struct atmel_private *priv = netdev_priv(dev); 2085 2079 int rc = -EINPROGRESS; /* Call commit handler */ 2086 - 2080 + 2087 2081 /* If setting by frequency, convert to a channel */ 2088 - if((fwrq->e == 1) && 2089 - (fwrq->m >= (int) 241200000) && 2090 - (fwrq->m <= (int) 248700000)) { 2082 + if ((fwrq->e == 1) && 2083 + (fwrq->m >= (int) 241200000) && 2084 + (fwrq->m <= (int) 248700000)) { 2091 2085 int f = fwrq->m / 100000; 2092 2086 int c = 0; 2093 - while((c < 14) && (f != frequency_list[c])) 2087 + while ((c < 14) && (f != frequency_list[c])) 2094 2088 c++; 2095 2089 /* Hack to fall through... */ 2096 2090 fwrq->e = 0; 2097 2091 fwrq->m = c + 1; 2098 2092 } 2099 2093 /* Setting by channel number */ 2100 - if((fwrq->m > 1000) || (fwrq->e > 0)) 2094 + if ((fwrq->m > 1000) || (fwrq->e > 0)) 2101 2095 rc = -EOPNOTSUPP; 2102 2096 else { 2103 2097 int channel = fwrq->m; ··· 2105 2099 priv->channel = channel; 2106 2100 } else { 2107 2101 rc = -EINVAL; 2108 - } 2102 + } 2109 2103 } 2110 2104 return rc; 2111 2105 } ··· 2136 2130 * This is not an error, while the device perform scanning, 2137 2131 * traffic doesn't flow, so it's a perfect DoS... 2138 2132 * Jean II */ 2139 - 2133 + 2140 2134 if (priv->station_state == STATION_STATE_DOWN) 2141 2135 return -EAGAIN; 2142 2136 ··· 2148 2142 /* Initiate a scan command */ 2149 2143 if (priv->site_survey_state == SITE_SURVEY_IN_PROGRESS) 2150 2144 return -EBUSY; 2151 - 2145 + 2152 2146 del_timer_sync(&priv->management_timer); 2153 2147 spin_lock_irqsave(&priv->irqlock, flags); 2154 - 2148 + 2155 2149 priv->site_survey_state = SITE_SURVEY_IN_PROGRESS; 2156 2150 priv->fast_scan = 0; 2157 2151 atmel_scan(priv, 0); 2158 2152 spin_unlock_irqrestore(&priv->irqlock, flags); 2159 - 2153 + 2160 2154 return 0; 2161 2155 } 2162 2156 ··· 2169 2163 int i; 2170 2164 char *current_ev = extra; 2171 2165 struct iw_event iwe; 2172 - 2166 + 2173 2167 if (priv->site_survey_state != SITE_SURVEY_COMPLETED) 2174 2168 return -EAGAIN; 2175 - 2176 - for(i=0; i<priv->BSS_list_entries; i++) { 2169 + 2170 + for (i = 0; i < priv->BSS_list_entries; i++) { 2177 2171 iwe.cmd = SIOCGIWAP; 2178 2172 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 2179 2173 memcpy(iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID, 6); ··· 2185 2179 iwe.cmd = SIOCGIWESSID; 2186 2180 iwe.u.data.flags = 1; 2187 2181 current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, priv->BSSinfo[i].SSID); 2188 - 2182 + 2189 2183 iwe.cmd = SIOCGIWMODE; 2190 2184 iwe.u.mode = priv->BSSinfo[i].BSStype; 2191 2185 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_UINT_LEN); 2192 - 2186 + 2193 2187 iwe.cmd = SIOCGIWFREQ; 2194 2188 iwe.u.freq.m = priv->BSSinfo[i].channel; 2195 2189 iwe.u.freq.e = 0; 2196 2190 current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_FREQ_LEN); 2197 - 2191 + 2198 2192 iwe.cmd = SIOCGIWENCODE; 2199 2193 if (priv->BSSinfo[i].UsingWEP) 2200 2194 iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; ··· 2202 2196 iwe.u.data.flags = IW_ENCODE_DISABLED; 2203 2197 iwe.u.data.length = 0; 2204 2198 current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, NULL); 2205 - 2206 2199 } 2207 2200 2208 2201 /* Length of data */ 2209 2202 dwrq->length = (current_ev - extra); 2210 - dwrq->flags = 0; 2211 - 2203 + dwrq->flags = 0; 2204 + 2212 2205 return 0; 2213 2206 } 2214 2207 ··· 2218 2213 { 2219 2214 struct atmel_private *priv = netdev_priv(dev); 2220 2215 struct iw_range *range = (struct iw_range *) extra; 2221 - int k,i,j; 2216 + int k, i, j; 2222 2217 2223 2218 dwrq->length = sizeof(struct iw_range); 2224 2219 memset(range, 0, sizeof(struct iw_range)); ··· 2231 2226 break; 2232 2227 } 2233 2228 if (range->num_channels != 0) { 2234 - for(k = 0, i = channel_table[j].min; i <= channel_table[j].max; i++) { 2229 + for (k = 0, i = channel_table[j].min; i <= channel_table[j].max; i++) { 2235 2230 range->freq[k].i = i; /* List index */ 2236 - range->freq[k].m = frequency_list[i-1] * 100000; 2231 + range->freq[k].m = frequency_list[i - 1] * 100000; 2237 2232 range->freq[k++].e = 1; /* Values in table in MHz -> * 10^5 * 10 */ 2238 2233 } 2239 2234 range->num_frequency = k; 2240 2235 } 2241 - 2236 + 2242 2237 range->max_qual.qual = 100; 2243 2238 range->max_qual.level = 100; 2244 2239 range->max_qual.noise = 0; ··· 2266 2261 range->encoding_size[1] = 13; 2267 2262 range->num_encoding_sizes = 2; 2268 2263 range->max_encoding_tokens = 4; 2269 - 2264 + 2270 2265 range->pmp_flags = IW_POWER_ON; 2271 2266 range->pmt_flags = IW_POWER_ON; 2272 2267 range->pm_capa = 0; 2273 - 2268 + 2274 2269 range->we_version_source = WIRELESS_EXT; 2275 2270 range->we_version_compiled = WIRELESS_EXT; 2276 2271 range->retry_capa = IW_RETRY_LIMIT ; ··· 2294 2289 2295 2290 if (awrq->sa_family != ARPHRD_ETHER) 2296 2291 return -EINVAL; 2297 - 2292 + 2298 2293 if (memcmp(bcast, awrq->sa_data, 6) == 0) { 2299 2294 del_timer_sync(&priv->management_timer); 2300 2295 spin_lock_irqsave(&priv->irqlock, flags); ··· 2302 2297 spin_unlock_irqrestore(&priv->irqlock, flags); 2303 2298 return 0; 2304 2299 } 2305 - 2306 - for(i=0; i<priv->BSS_list_entries; i++) { 2300 + 2301 + for (i = 0; i < priv->BSS_list_entries; i++) { 2307 2302 if (memcmp(priv->BSSinfo[i].BSSID, awrq->sa_data, 6) == 0) { 2308 2303 if (!priv->wep_is_on && priv->BSSinfo[i].UsingWEP) { 2309 2304 return -EINVAL; ··· 2318 2313 } 2319 2314 } 2320 2315 } 2321 - 2316 + 2322 2317 return -EINVAL; 2323 2318 } 2324 - 2319 + 2325 2320 static int atmel_config_commit(struct net_device *dev, 2326 2321 struct iw_request_info *info, /* NULL */ 2327 2322 void *zwrq, /* NULL */ ··· 2330 2325 return atmel_open(dev); 2331 2326 } 2332 2327 2333 - static const iw_handler atmel_handler[] = 2328 + static const iw_handler atmel_handler[] = 2334 2329 { 2335 2330 (iw_handler) atmel_config_commit, /* SIOCSIWCOMMIT */ 2336 - (iw_handler) atmel_get_name, /* SIOCGIWNAME */ 2331 + (iw_handler) atmel_get_name, /* SIOCGIWNAME */ 2337 2332 (iw_handler) NULL, /* SIOCSIWNWID */ 2338 2333 (iw_handler) NULL, /* SIOCGIWNWID */ 2339 2334 (iw_handler) atmel_set_freq, /* SIOCSIWFREQ */ 2340 2335 (iw_handler) atmel_get_freq, /* SIOCGIWFREQ */ 2341 2336 (iw_handler) atmel_set_mode, /* SIOCSIWMODE */ 2342 2337 (iw_handler) atmel_get_mode, /* SIOCGIWMODE */ 2343 - (iw_handler) NULL, /* SIOCSIWSENS */ 2344 - (iw_handler) NULL, /* SIOCGIWSENS */ 2338 + (iw_handler) NULL, /* SIOCSIWSENS */ 2339 + (iw_handler) NULL, /* SIOCGIWSENS */ 2345 2340 (iw_handler) NULL, /* SIOCSIWRANGE */ 2346 2341 (iw_handler) atmel_get_range, /* SIOCGIWRANGE */ 2347 2342 (iw_handler) NULL, /* SIOCSIWPRIV */ ··· 2355 2350 (iw_handler) atmel_set_wap, /* SIOCSIWAP */ 2356 2351 (iw_handler) atmel_get_wap, /* SIOCGIWAP */ 2357 2352 (iw_handler) NULL, /* -- hole -- */ 2358 - (iw_handler) NULL, /* SIOCGIWAPLIST */ 2353 + (iw_handler) NULL, /* SIOCGIWAPLIST */ 2359 2354 (iw_handler) atmel_set_scan, /* SIOCSIWSCAN */ 2360 2355 (iw_handler) atmel_get_scan, /* SIOCGIWSCAN */ 2361 2356 (iw_handler) atmel_set_essid, /* SIOCSIWESSID */ 2362 2357 (iw_handler) atmel_get_essid, /* SIOCGIWESSID */ 2363 - (iw_handler) NULL, /* SIOCSIWNICKN */ 2364 - (iw_handler) NULL, /* SIOCGIWNICKN */ 2358 + (iw_handler) NULL, /* SIOCSIWNICKN */ 2359 + (iw_handler) NULL, /* SIOCGIWNICKN */ 2365 2360 (iw_handler) NULL, /* -- hole -- */ 2366 2361 (iw_handler) NULL, /* -- hole -- */ 2367 2362 (iw_handler) atmel_set_rate, /* SIOCSIWRATE */ ··· 2370 2365 (iw_handler) atmel_get_rts, /* SIOCGIWRTS */ 2371 2366 (iw_handler) atmel_set_frag, /* SIOCSIWFRAG */ 2372 2367 (iw_handler) atmel_get_frag, /* SIOCGIWFRAG */ 2373 - (iw_handler) NULL, /* SIOCSIWTXPOW */ 2374 - (iw_handler) NULL, /* SIOCGIWTXPOW */ 2368 + (iw_handler) NULL, /* SIOCSIWTXPOW */ 2369 + (iw_handler) NULL, /* SIOCGIWTXPOW */ 2375 2370 (iw_handler) atmel_set_retry, /* SIOCSIWRETRY */ 2376 2371 (iw_handler) atmel_get_retry, /* SIOCGIWRETRY */ 2377 2372 (iw_handler) atmel_set_encode, /* SIOCSIWENCODE */ ··· 2380 2375 (iw_handler) atmel_get_power, /* SIOCGIWPOWER */ 2381 2376 }; 2382 2377 2383 - 2384 - static const iw_handler atmel_private_handler[] = 2378 + static const iw_handler atmel_private_handler[] = 2385 2379 { 2386 2380 NULL, /* SIOCIWFIRSTPRIV */ 2387 2381 }; 2388 2382 2389 2383 typedef struct atmel_priv_ioctl { 2390 2384 char id[32]; 2391 - unsigned char __user *data; 2392 - unsigned short len; 2385 + unsigned char __user *data; 2386 + unsigned short len; 2393 2387 } atmel_priv_ioctl; 2394 2388 2395 - 2396 - #define ATMELFWL SIOCIWFIRSTPRIV 2397 - #define ATMELIDIFC ATMELFWL + 1 2398 - #define ATMELRD ATMELFWL + 2 2399 - #define ATMELMAGIC 0x51807 2389 + #define ATMELFWL SIOCIWFIRSTPRIV 2390 + #define ATMELIDIFC ATMELFWL + 1 2391 + #define ATMELRD ATMELFWL + 2 2392 + #define ATMELMAGIC 0x51807 2400 2393 #define REGDOMAINSZ 20 2401 2394 2402 2395 static const struct iw_priv_args atmel_private_args[] = { 2403 - /*{ cmd, set_args, get_args, name } */ 2404 - { ATMELFWL, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | sizeof (atmel_priv_ioctl), IW_PRIV_TYPE_NONE, "atmelfwl" }, 2405 - { ATMELIDIFC, IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "atmelidifc" }, 2406 - { ATMELRD, IW_PRIV_TYPE_CHAR | REGDOMAINSZ, IW_PRIV_TYPE_NONE, "regdomain" }, 2396 + { 2397 + .cmd = ATMELFWL, 2398 + .set_args = IW_PRIV_TYPE_BYTE 2399 + | IW_PRIV_SIZE_FIXED 2400 + | sizeof (atmel_priv_ioctl), 2401 + .get_args = IW_PRIV_TYPE_NONE, 2402 + .name = "atmelfwl" 2403 + }, { 2404 + .cmd = ATMELIDIFC, 2405 + .set_args = IW_PRIV_TYPE_NONE, 2406 + .get_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 2407 + .name = "atmelidifc" 2408 + }, { 2409 + .cmd = ATMELRD, 2410 + .set_args = IW_PRIV_TYPE_CHAR | REGDOMAINSZ, 2411 + .get_args = IW_PRIV_TYPE_NONE, 2412 + .name = "regdomain" 2413 + }, 2407 2414 }; 2408 2415 2409 - static const struct iw_handler_def atmel_handler_def = 2416 + static const struct iw_handler_def atmel_handler_def = 2410 2417 { 2411 2418 .num_standard = sizeof(atmel_handler)/sizeof(iw_handler), 2412 - .num_private = sizeof(atmel_private_handler)/sizeof(iw_handler), 2413 - .num_private_args = sizeof(atmel_private_args)/sizeof(struct iw_priv_args), 2419 + .num_private = sizeof(atmel_private_handler)/sizeof(iw_handler), 2420 + .num_private_args = sizeof(atmel_private_args)/sizeof(struct iw_priv_args), 2414 2421 .standard = (iw_handler *) atmel_handler, 2415 - .private = (iw_handler *) atmel_private_handler, 2422 + .private = (iw_handler *) atmel_private_handler, 2416 2423 .private_args = (struct iw_priv_args *) atmel_private_args, 2417 2424 .get_wireless_stats = atmel_get_wireless_stats 2418 2425 }; ··· 2436 2419 atmel_priv_ioctl com; 2437 2420 struct iwreq *wrq = (struct iwreq *) rq; 2438 2421 unsigned char *new_firmware; 2439 - char domain[REGDOMAINSZ+1]; 2422 + char domain[REGDOMAINSZ + 1]; 2440 2423 2441 2424 switch (cmd) { 2442 2425 case ATMELIDIFC: 2443 - wrq->u.param.value = ATMELMAGIC; 2426 + wrq->u.param.value = ATMELMAGIC; 2444 2427 break; 2445 - 2428 + 2446 2429 case ATMELFWL: 2447 2430 if (copy_from_user(&com, rq->ifr_data, sizeof(com))) { 2448 2431 rc = -EFAULT; ··· 2466 2449 } 2467 2450 2468 2451 kfree(priv->firmware); 2469 - 2452 + 2470 2453 priv->firmware = new_firmware; 2471 2454 priv->firmware_length = com.len; 2472 2455 strncpy(priv->firmware_id, com.id, 31); ··· 2478 2461 rc = -EFAULT; 2479 2462 break; 2480 2463 } 2481 - 2464 + 2482 2465 if (!capable(CAP_NET_ADMIN)) { 2483 2466 rc = -EPERM; 2484 2467 break; ··· 2501 2484 rc = 0; 2502 2485 } 2503 2486 } 2504 - 2487 + 2505 2488 if (rc == 0 && priv->station_state != STATION_STATE_DOWN) 2506 2489 rc = atmel_open(dev); 2507 2490 break; 2508 - 2491 + 2509 2492 default: 2510 2493 rc = -EOPNOTSUPP; 2511 2494 } 2512 - 2495 + 2513 2496 return rc; 2514 2497 } 2515 2498 ··· 2520 2503 u8 el_id; 2521 2504 u8 chall_text_len; 2522 2505 u8 chall_text[253]; 2523 - }; 2506 + }; 2524 2507 2525 2508 static void atmel_enter_state(struct atmel_private *priv, int new_state) 2526 2509 { 2527 2510 int old_state = priv->station_state; 2528 - 2511 + 2529 2512 if (new_state == old_state) 2530 2513 return; 2531 - 2514 + 2532 2515 priv->station_state = new_state; 2533 - 2516 + 2534 2517 if (new_state == STATION_STATE_READY) { 2535 2518 netif_start_queue(priv->dev); 2536 2519 netif_carrier_on(priv->dev); ··· 2557 2540 u8 options; 2558 2541 u8 SSID_size; 2559 2542 } cmd; 2560 - 2543 + 2561 2544 memset(cmd.BSSID, 0xff, 6); 2562 2545 2563 2546 if (priv->fast_scan) { ··· 2571 2554 cmd.min_channel_time = cpu_to_le16(10); 2572 2555 cmd.max_channel_time = cpu_to_le16(120); 2573 2556 } 2574 - 2557 + 2575 2558 cmd.options = 0; 2576 - 2559 + 2577 2560 if (!specific_ssid) 2578 2561 cmd.options |= SCAN_OPTIONS_SITE_SURVEY; 2579 - 2580 - cmd.channel = (priv->channel & 0x7f); 2562 + 2563 + cmd.channel = (priv->channel & 0x7f); 2581 2564 cmd.scan_type = SCAN_TYPE_ACTIVE; 2582 - cmd.BSS_type = cpu_to_le16(priv->operating_mode == IW_MODE_ADHOC ? 2565 + cmd.BSS_type = cpu_to_le16(priv->operating_mode == IW_MODE_ADHOC ? 2583 2566 BSS_TYPE_AD_HOC : BSS_TYPE_INFRASTRUCTURE); 2584 - 2567 + 2585 2568 atmel_send_command(priv, CMD_Scan, &cmd, sizeof(cmd)); 2586 2569 2587 2570 /* This must come after all hardware access to avoid being messed up ··· 2608 2591 cmd.BSS_type = type; 2609 2592 cmd.timeout = cpu_to_le16(2000); 2610 2593 2611 - atmel_send_command(priv, CMD_Join, &cmd, sizeof(cmd)); 2594 + atmel_send_command(priv, CMD_Join, &cmd, sizeof(cmd)); 2612 2595 } 2613 - 2614 2596 2615 2597 static void start(struct atmel_private *priv, int type) 2616 2598 { 2617 2599 struct { 2618 2600 u8 BSSID[6]; 2619 2601 u8 SSID[MAX_SSID_LENGTH]; 2620 - u8 BSS_type; 2602 + u8 BSS_type; 2621 2603 u8 channel; 2622 2604 u8 SSID_size; 2623 2605 u8 reserved[3]; ··· 2628 2612 cmd.BSS_type = type; 2629 2613 cmd.channel = (priv->channel & 0x7f); 2630 2614 2631 - atmel_send_command(priv, CMD_Start, &cmd, sizeof(cmd)); 2615 + atmel_send_command(priv, CMD_Start, &cmd, sizeof(cmd)); 2632 2616 } 2633 2617 2634 - static void handle_beacon_probe(struct atmel_private *priv, u16 capability, u8 channel) 2618 + static void handle_beacon_probe(struct atmel_private *priv, u16 capability, 2619 + u8 channel) 2635 2620 { 2636 2621 int rejoin = 0; 2637 - int new = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? 2622 + int new = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? 2638 2623 SHORT_PREAMBLE : LONG_PREAMBLE; 2639 2624 2640 2625 if (priv->preamble != new) { ··· 2643 2626 rejoin = 1; 2644 2627 atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, new); 2645 2628 } 2646 - 2629 + 2647 2630 if (priv->channel != channel) { 2648 2631 priv->channel = channel; 2649 2632 rejoin = 1; 2650 2633 atmel_set_mib8(priv, Phy_Mib_Type, PHY_MIB_CHANNEL_POS, channel); 2651 2634 } 2652 - 2635 + 2653 2636 if (rejoin) { 2654 2637 priv->station_is_associated = 0; 2655 2638 atmel_enter_state(priv, STATION_STATE_JOINNING); 2656 - 2639 + 2657 2640 if (priv->operating_mode == IW_MODE_INFRA) 2658 2641 join(priv, BSS_TYPE_INFRASTRUCTURE); 2659 - else 2642 + else 2660 2643 join(priv, BSS_TYPE_AD_HOC); 2661 - } 2644 + } 2662 2645 } 2663 2646 2664 - 2665 - static void send_authentication_request(struct atmel_private *priv, u16 system, u8 *challenge, int challenge_len) 2647 + static void send_authentication_request(struct atmel_private *priv, u16 system, 2648 + u8 *challenge, int challenge_len) 2666 2649 { 2667 2650 struct ieee80211_hdr_4addr header; 2668 2651 struct auth_body auth; 2669 - 2670 - header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); 2671 - header.duration_id = cpu_to_le16(0x8000); 2652 + 2653 + header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); 2654 + header.duration_id = cpu_to_le16(0x8000); 2672 2655 header.seq_ctl = 0; 2673 2656 memcpy(header.addr1, priv->CurrentBSSID, 6); 2674 2657 memcpy(header.addr2, priv->dev->dev_addr, 6); 2675 2658 memcpy(header.addr3, priv->CurrentBSSID, 6); 2676 - 2677 - if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1) 2659 + 2660 + if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1) 2678 2661 /* no WEP for authentication frames with TrSeqNo 1 */ 2679 2662 header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); 2680 - 2681 - auth.alg = cpu_to_le16(system); 2663 + 2664 + auth.alg = cpu_to_le16(system); 2682 2665 2683 2666 auth.status = 0; 2684 2667 auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum); 2685 - priv->ExpectedAuthentTransactionSeqNum = priv->CurrentAuthentTransactionSeqNum+1; 2668 + priv->ExpectedAuthentTransactionSeqNum = priv->CurrentAuthentTransactionSeqNum+1; 2686 2669 priv->CurrentAuthentTransactionSeqNum += 2; 2687 - 2670 + 2688 2671 if (challenge_len != 0) { 2689 2672 auth.el_id = 16; /* challenge_text */ 2690 2673 auth.chall_text_len = challenge_len; ··· 2702 2685 struct ieee80211_hdr_4addr header; 2703 2686 struct ass_req_format { 2704 2687 u16 capability; 2705 - u16 listen_interval; 2688 + u16 listen_interval; 2706 2689 u8 ap[6]; /* nothing after here directly accessible */ 2707 2690 u8 ssid_el_id; 2708 2691 u8 ssid_len; ··· 2711 2694 u8 sup_rates_len; 2712 2695 u8 rates[4]; 2713 2696 } body; 2714 - 2715 - header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | 2697 + 2698 + header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT | 2716 2699 (is_reassoc ? IEEE80211_STYPE_REASSOC_REQ : IEEE80211_STYPE_ASSOC_REQ)); 2717 2700 header.duration_id = cpu_to_le16(0x8000); 2718 2701 header.seq_ctl = 0; 2719 2702 2720 - memcpy(header.addr1, priv->CurrentBSSID, 6); 2703 + memcpy(header.addr1, priv->CurrentBSSID, 6); 2721 2704 memcpy(header.addr2, priv->dev->dev_addr, 6); 2722 - memcpy(header.addr3, priv->CurrentBSSID, 6); 2705 + memcpy(header.addr3, priv->CurrentBSSID, 6); 2723 2706 2724 2707 body.capability = cpu_to_le16(C80211_MGMT_CAPABILITY_ESS); 2725 2708 if (priv->wep_is_on) ··· 2728 2711 body.capability |= cpu_to_le16(C80211_MGMT_CAPABILITY_ShortPreamble); 2729 2712 2730 2713 body.listen_interval = cpu_to_le16(priv->listen_interval * priv->beacon_period); 2731 - 2714 + 2732 2715 /* current AP address - only in reassoc frame */ 2733 2716 if (is_reassoc) { 2734 - memcpy(body.ap, priv->CurrentBSSID, 6); 2717 + memcpy(body.ap, priv->CurrentBSSID, 6); 2735 2718 ssid_el_p = (u8 *)&body.ssid_el_id; 2736 2719 bodysize = 18 + priv->SSID_size; 2737 2720 } else { 2738 2721 ssid_el_p = (u8 *)&body.ap[0]; 2739 2722 bodysize = 12 + priv->SSID_size; 2740 2723 } 2741 - 2742 - ssid_el_p[0]= C80211_MGMT_ElementID_SSID; 2724 + 2725 + ssid_el_p[0] = C80211_MGMT_ElementID_SSID; 2743 2726 ssid_el_p[1] = priv->SSID_size; 2744 2727 memcpy(ssid_el_p + 2, priv->SSID, priv->SSID_size); 2745 2728 ssid_el_p[2 + priv->SSID_size] = C80211_MGMT_ElementID_SupportedRates; ··· 2749 2732 atmel_transmit_management_frame(priv, &header, (void *)&body, bodysize); 2750 2733 } 2751 2734 2752 - static int is_frame_from_current_bss(struct atmel_private *priv, struct ieee80211_hdr_4addr *header) 2735 + static int is_frame_from_current_bss(struct atmel_private *priv, 2736 + struct ieee80211_hdr_4addr *header) 2753 2737 { 2754 2738 if (le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_FROMDS) 2755 2739 return memcmp(header->addr3, priv->CurrentBSSID, 6) == 0; ··· 2763 2745 int i; 2764 2746 int max_rssi = -128; 2765 2747 int max_index = -1; 2766 - 2748 + 2767 2749 if (priv->BSS_list_entries == 0) 2768 2750 return -1; 2769 - 2751 + 2770 2752 if (priv->connect_to_any_BSS) { 2771 - /* Select a BSS with the max-RSSI but of the same type and of the same WEP mode 2772 - and that it is not marked as 'bad' (i.e. we had previously failed to connect to 2773 - this BSS with the settings that we currently use) */ 2753 + /* Select a BSS with the max-RSSI but of the same type and of 2754 + the same WEP mode and that it is not marked as 'bad' (i.e. 2755 + we had previously failed to connect to this BSS with the 2756 + settings that we currently use) */ 2774 2757 priv->current_BSS = 0; 2775 - for(i=0; i<priv->BSS_list_entries; i++) { 2758 + for (i = 0; i < priv->BSS_list_entries; i++) { 2776 2759 if (priv->operating_mode == priv->BSSinfo[i].BSStype && 2777 - ((!priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) || 2760 + ((!priv->wep_is_on && !priv->BSSinfo[i].UsingWEP) || 2778 2761 (priv->wep_is_on && priv->BSSinfo[i].UsingWEP)) && 2779 2762 !(priv->BSSinfo[i].channel & 0x80)) { 2780 2763 max_rssi = priv->BSSinfo[i].RSSI; 2781 2764 priv->current_BSS = max_index = i; 2782 2765 } 2783 - 2784 2766 } 2785 2767 return max_index; 2786 2768 } 2787 - 2788 - for(i=0; i<priv->BSS_list_entries; i++) { 2769 + 2770 + for (i = 0; i < priv->BSS_list_entries; i++) { 2789 2771 if (priv->SSID_size == priv->BSSinfo[i].SSIDsize && 2790 2772 memcmp(priv->SSID, priv->BSSinfo[i].SSID, priv->SSID_size) == 0 && 2791 2773 priv->operating_mode == priv->BSSinfo[i].BSStype && ··· 2799 2781 return max_index; 2800 2782 } 2801 2783 2802 - 2803 - static void store_bss_info(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 2804 - u16 capability, u16 beacon_period, u8 channel, u8 rssi, 2805 - u8 ssid_len, u8 *ssid, int is_beacon) 2784 + static void store_bss_info(struct atmel_private *priv, 2785 + struct ieee80211_hdr_4addr *header, u16 capability, 2786 + u16 beacon_period, u8 channel, u8 rssi, u8 ssid_len, 2787 + u8 *ssid, int is_beacon) 2806 2788 { 2807 2789 u8 *bss = capability & C80211_MGMT_CAPABILITY_ESS ? header->addr2 : header->addr3; 2808 2790 int i, index; 2809 - 2810 - for (index = -1, i = 0; i < priv->BSS_list_entries; i++) 2811 - if (memcmp(bss, priv->BSSinfo[i].BSSID, 6) == 0) 2791 + 2792 + for (index = -1, i = 0; i < priv->BSS_list_entries; i++) 2793 + if (memcmp(bss, priv->BSSinfo[i].BSSID, 6) == 0) 2812 2794 index = i; 2813 2795 2814 - /* If we process a probe and an entry from this BSS exists 2796 + /* If we process a probe and an entry from this BSS exists 2815 2797 we will update the BSS entry with the info from this BSS. 2816 2798 If we process a beacon we will only update RSSI */ 2817 2799 ··· 2838 2820 priv->BSSinfo[index].BSStype = IW_MODE_ADHOC; 2839 2821 else if (capability & C80211_MGMT_CAPABILITY_ESS) 2840 2822 priv->BSSinfo[index].BSStype =IW_MODE_INFRA; 2841 - 2842 - priv->BSSinfo[index].preamble = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? 2823 + 2824 + priv->BSSinfo[index].preamble = capability & C80211_MGMT_CAPABILITY_ShortPreamble ? 2843 2825 SHORT_PREAMBLE : LONG_PREAMBLE; 2844 2826 } 2845 2827 ··· 2849 2831 u16 status = le16_to_cpu(auth->status); 2850 2832 u16 trans_seq_no = le16_to_cpu(auth->trans_seq); 2851 2833 u16 system = le16_to_cpu(auth->alg); 2852 - 2853 - if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { 2834 + 2835 + if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { 2854 2836 /* no WEP */ 2855 2837 if (priv->station_was_associated) { 2856 2838 atmel_enter_state(priv, STATION_STATE_REASSOCIATING); ··· 2860 2842 atmel_enter_state(priv, STATION_STATE_ASSOCIATING); 2861 2843 send_association_request(priv, 0); 2862 2844 return; 2863 - } 2845 + } 2864 2846 } 2865 - 2866 - if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 2847 + 2848 + if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 2867 2849 /* WEP */ 2868 2850 if (trans_seq_no != priv->ExpectedAuthentTransactionSeqNum) 2869 2851 return; 2870 - 2852 + 2871 2853 if (trans_seq_no == 0x0002 && 2872 2854 auth->el_id == C80211_MGMT_ElementID_ChallengeText) { 2873 2855 send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len); 2874 2856 return; 2875 2857 } 2876 - 2858 + 2877 2859 if (trans_seq_no == 0x0004) { 2878 2860 if(priv->station_was_associated) { 2879 2861 atmel_enter_state(priv, STATION_STATE_REASSOCIATING); ··· 2883 2865 atmel_enter_state(priv, STATION_STATE_ASSOCIATING); 2884 2866 send_association_request(priv, 0); 2885 2867 return; 2886 - } 2868 + } 2887 2869 } 2888 - } 2889 - 2870 + } 2871 + 2890 2872 if (status == C80211_MGMT_SC_AuthAlgNotSupported) { 2891 2873 /* Do opensystem first, then try sharedkey */ 2892 2874 if (system == C80211_MGMT_AAN_OPENSYSTEM) { ··· 2894 2876 send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0); 2895 2877 } else if (priv->connect_to_any_BSS) { 2896 2878 int bss_index; 2897 - 2879 + 2898 2880 priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; 2899 - 2881 + 2900 2882 if ((bss_index = retrieve_bss(priv)) != -1) { 2901 2883 atmel_join_bss(priv, bss_index); 2902 2884 return; 2903 2885 } 2904 2886 } 2905 2887 } 2906 - 2907 - 2888 + 2908 2889 priv->AuthenticationRequestRetryCnt = 0; 2909 2890 atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 2910 2891 priv->station_is_associated = 0; ··· 2919 2902 u8 length; 2920 2903 u8 rates[4]; 2921 2904 } *ass_resp = (struct ass_resp_format *)priv->rx_buf; 2922 - 2923 - u16 status = le16_to_cpu(ass_resp->status); 2905 + 2906 + u16 status = le16_to_cpu(ass_resp->status); 2924 2907 u16 ass_id = le16_to_cpu(ass_resp->ass_id); 2925 - u16 rates_len = ass_resp->length > 4 ? 4 : ass_resp->length; 2926 - 2908 + u16 rates_len = ass_resp->length > 4 ? 4 : ass_resp->length; 2909 + 2927 2910 if (frame_len < 8 + rates_len) 2928 2911 return; 2929 - 2912 + 2930 2913 if (status == C80211_MGMT_SC_Success) { 2931 2914 if (subtype == C80211_SUBTYPE_MGMT_ASS_RESPONSE) 2932 2915 priv->AssociationRequestRetryCnt = 0; 2933 2916 else 2934 2917 priv->ReAssociationRequestRetryCnt = 0; 2935 - 2936 - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_STATION_ID_POS, ass_id & 0x3fff); 2937 - atmel_set_mib(priv, Phy_Mib_Type, PHY_MIB_RATE_SET_POS, ass_resp->rates, rates_len); 2918 + 2919 + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, 2920 + MAC_MGMT_MIB_STATION_ID_POS, ass_id & 0x3fff); 2921 + atmel_set_mib(priv, Phy_Mib_Type, 2922 + PHY_MIB_RATE_SET_POS, ass_resp->rates, rates_len); 2938 2923 if (priv->power_mode == 0) { 2939 2924 priv->listen_interval = 1; 2940 - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); 2941 - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); 2925 + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, 2926 + MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); 2927 + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, 2928 + MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); 2942 2929 } else { 2943 2930 priv->listen_interval = 2; 2944 - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, PS_MODE); 2945 - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 2); 2931 + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, 2932 + MAC_MGMT_MIB_PS_MODE_POS, PS_MODE); 2933 + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, 2934 + MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 2); 2946 2935 } 2947 - 2936 + 2948 2937 priv->station_is_associated = 1; 2949 2938 priv->station_was_associated = 1; 2950 2939 atmel_enter_state(priv, STATION_STATE_READY); 2951 2940 return; 2952 2941 } 2953 - 2942 + 2954 2943 if (subtype == C80211_SUBTYPE_MGMT_ASS_RESPONSE && 2955 2944 status != C80211_MGMT_SC_AssDeniedBSSRate && 2956 2945 status != C80211_MGMT_SC_SupportCapabilities && ··· 2966 2943 send_association_request(priv, 0); 2967 2944 return; 2968 2945 } 2969 - 2946 + 2970 2947 if (subtype == C80211_SUBTYPE_MGMT_REASS_RESPONSE && 2971 2948 status != C80211_MGMT_SC_AssDeniedBSSRate && 2972 2949 status != C80211_MGMT_SC_SupportCapabilities && ··· 2976 2953 send_association_request(priv, 1); 2977 2954 return; 2978 2955 } 2979 - 2956 + 2980 2957 atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 2981 2958 priv->station_is_associated = 0; 2982 - 2983 - if(priv->connect_to_any_BSS) { 2959 + 2960 + if (priv->connect_to_any_BSS) { 2984 2961 int bss_index; 2985 2962 priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; 2986 - 2987 - if ((bss_index = retrieve_bss(priv)) != -1) 2963 + 2964 + if ((bss_index = retrieve_bss(priv)) != -1) 2988 2965 atmel_join_bss(priv, bss_index); 2989 - 2990 2966 } 2991 2967 } 2992 2968 ··· 2999 2977 /* The WPA stuff cares about the current AP address */ 3000 2978 if (priv->use_wpa) 3001 2979 build_wpa_mib(priv); 3002 - 2980 + 3003 2981 /* When switching to AdHoc turn OFF Power Save if needed */ 3004 2982 3005 2983 if (bss->BSStype == IW_MODE_ADHOC && ··· 3007 2985 priv->power_mode) { 3008 2986 priv->power_mode = 0; 3009 2987 priv->listen_interval = 1; 3010 - atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); 3011 - atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); 2988 + atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, 2989 + MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); 2990 + atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, 2991 + MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); 3012 2992 } 3013 - 2993 + 3014 2994 priv->operating_mode = bss->BSStype; 3015 - priv->channel = bss->channel & 0x7f; 2995 + priv->channel = bss->channel & 0x7f; 3016 2996 priv->beacon_period = bss->beacon_period; 3017 - 2997 + 3018 2998 if (priv->preamble != bss->preamble) { 3019 2999 priv->preamble = bss->preamble; 3020 - atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, bss->preamble); 3000 + atmel_set_mib8(priv, Local_Mib_Type, 3001 + LOCAL_MIB_PREAMBLE_TYPE, bss->preamble); 3021 3002 } 3022 - 3003 + 3023 3004 if (!priv->wep_is_on && bss->UsingWEP) { 3024 3005 atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3025 3006 priv->station_is_associated = 0; 3026 3007 return; 3027 3008 } 3028 - 3009 + 3029 3010 if (priv->wep_is_on && !bss->UsingWEP) { 3030 3011 atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3031 3012 priv->station_is_associated = 0; ··· 3036 3011 } 3037 3012 3038 3013 atmel_enter_state(priv, STATION_STATE_JOINNING); 3039 - 3014 + 3040 3015 if (priv->operating_mode == IW_MODE_INFRA) 3041 3016 join(priv, BSS_TYPE_INFRASTRUCTURE); 3042 - else 3017 + else 3043 3018 join(priv, BSS_TYPE_AD_HOC); 3044 3019 } 3045 - 3046 3020 3047 3021 static void restart_search(struct atmel_private *priv) 3048 3022 { 3049 3023 int bss_index; 3050 - 3024 + 3051 3025 if (!priv->connect_to_any_BSS) { 3052 3026 atmel_scan(priv, 1); 3053 3027 } else { 3054 3028 priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; 3055 - 3056 - if ((bss_index = retrieve_bss(priv)) != -1) 3029 + 3030 + if ((bss_index = retrieve_bss(priv)) != -1) 3057 3031 atmel_join_bss(priv, bss_index); 3058 3032 else 3059 3033 atmel_scan(priv, 0); 3060 - 3061 - } 3062 - } 3034 + } 3035 + } 3063 3036 3064 3037 static void smooth_rssi(struct atmel_private *priv, u8 rssi) 3065 3038 { ··· 3073 3050 } 3074 3051 3075 3052 rssi = rssi * 100 / max_rssi; 3076 - if((rssi + old) % 2) 3077 - priv->wstats.qual.level = ((rssi + old)/2) + 1; 3053 + if ((rssi + old) % 2) 3054 + priv->wstats.qual.level = (rssi + old) / 2 + 1; 3078 3055 else 3079 - priv->wstats.qual.level = ((rssi + old)/2); 3056 + priv->wstats.qual.level = (rssi + old) / 2; 3080 3057 priv->wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED; 3081 3058 priv->wstats.qual.updated &= ~IW_QUAL_LEVEL_INVALID; 3082 3059 } 3083 3060 3084 3061 static void atmel_smooth_qual(struct atmel_private *priv) 3085 3062 { 3086 - unsigned long time_diff = (jiffies - priv->last_qual)/HZ; 3063 + unsigned long time_diff = (jiffies - priv->last_qual) / HZ; 3087 3064 while (time_diff--) { 3088 3065 priv->last_qual += HZ; 3089 - priv->wstats.qual.qual = priv->wstats.qual.qual/2; 3090 - priv->wstats.qual.qual += 3066 + priv->wstats.qual.qual = priv->wstats.qual.qual / 2; 3067 + priv->wstats.qual.qual += 3091 3068 priv->beacons_this_sec * priv->beacon_period * (priv->wstats.qual.level + 100) / 4000; 3092 3069 priv->beacons_this_sec = 0; 3093 3070 } ··· 3096 3073 } 3097 3074 3098 3075 /* deals with incoming managment frames. */ 3099 - static void atmel_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 3100 - u16 frame_len, u8 rssi) 3076 + static void atmel_management_frame(struct atmel_private *priv, 3077 + struct ieee80211_hdr_4addr *header, 3078 + u16 frame_len, u8 rssi) 3101 3079 { 3102 3080 u16 subtype; 3103 - 3104 - switch (subtype = le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_STYPE) { 3105 - case C80211_SUBTYPE_MGMT_BEACON : 3081 + 3082 + subtype = le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_STYPE; 3083 + switch (subtype) { 3084 + case C80211_SUBTYPE_MGMT_BEACON: 3106 3085 case C80211_SUBTYPE_MGMT_ProbeResponse: 3107 - 3086 + 3108 3087 /* beacon frame has multiple variable-length fields - 3109 3088 never let an engineer loose with a data structure design. */ 3110 3089 { ··· 3124 3099 u8 ds_length; 3125 3100 /* ds here */ 3126 3101 } *beacon = (struct beacon_format *)priv->rx_buf; 3127 - 3102 + 3128 3103 u8 channel, rates_length, ssid_length; 3129 3104 u64 timestamp = le64_to_cpu(beacon->timestamp); 3130 3105 u16 beacon_interval = le16_to_cpu(beacon->interval); ··· 3132 3107 u8 *beaconp = priv->rx_buf; 3133 3108 ssid_length = beacon->ssid_length; 3134 3109 /* this blows chunks. */ 3135 - if (frame_len < 14 || frame_len < ssid_length + 15) 3110 + if (frame_len < 14 || frame_len < ssid_length + 15) 3136 3111 return; 3137 3112 rates_length = beaconp[beacon->ssid_length + 15]; 3138 3113 if (frame_len < ssid_length + rates_length + 18) ··· 3140 3115 if (ssid_length > MAX_SSID_LENGTH) 3141 3116 return; 3142 3117 channel = beaconp[ssid_length + rates_length + 18]; 3143 - 3118 + 3144 3119 if (priv->station_state == STATION_STATE_READY) { 3145 3120 smooth_rssi(priv, rssi); 3146 - if (is_frame_from_current_bss(priv, header)) { 3121 + if (is_frame_from_current_bss(priv, header)) { 3147 3122 priv->beacons_this_sec++; 3148 3123 atmel_smooth_qual(priv); 3149 3124 if (priv->last_beacon_timestamp) { ··· 3157 3132 handle_beacon_probe(priv, capability, channel); 3158 3133 } 3159 3134 } 3160 - 3161 - if (priv->station_state == STATION_STATE_SCANNING ) 3162 - store_bss_info(priv, header, capability, beacon_interval, channel, 3163 - rssi, ssid_length, &beacon->rates_el_id, 3164 - subtype == C80211_SUBTYPE_MGMT_BEACON) ; 3135 + 3136 + if (priv->station_state == STATION_STATE_SCANNING) 3137 + store_bss_info(priv, header, capability, 3138 + beacon_interval, channel, rssi, 3139 + ssid_length, 3140 + &beacon->rates_el_id, 3141 + subtype == C80211_SUBTYPE_MGMT_BEACON); 3165 3142 } 3166 3143 break; 3167 - 3144 + 3168 3145 case C80211_SUBTYPE_MGMT_Authentication: 3169 3146 3170 3147 if (priv->station_state == STATION_STATE_AUTHENTICATING) 3171 3148 authenticate(priv, frame_len); 3172 - 3149 + 3173 3150 break; 3174 - 3151 + 3175 3152 case C80211_SUBTYPE_MGMT_ASS_RESPONSE: 3176 3153 case C80211_SUBTYPE_MGMT_REASS_RESPONSE: 3177 - 3178 - if (priv->station_state == STATION_STATE_ASSOCIATING || 3154 + 3155 + if (priv->station_state == STATION_STATE_ASSOCIATING || 3179 3156 priv->station_state == STATION_STATE_REASSOCIATING) 3180 3157 associate(priv, frame_len, subtype); 3181 - 3158 + 3182 3159 break; 3183 3160 3184 3161 case C80211_SUBTYPE_MGMT_DISASSOSIATION: 3185 - if (priv->station_is_associated && 3186 - priv->operating_mode == IW_MODE_INFRA && 3162 + if (priv->station_is_associated && 3163 + priv->operating_mode == IW_MODE_INFRA && 3187 3164 is_frame_from_current_bss(priv, header)) { 3188 3165 priv->station_was_associated = 0; 3189 3166 priv->station_is_associated = 0; 3190 - 3167 + 3191 3168 atmel_enter_state(priv, STATION_STATE_JOINNING); 3192 3169 join(priv, BSS_TYPE_INFRASTRUCTURE); 3193 3170 } 3194 - 3171 + 3195 3172 break; 3196 3173 3197 3174 case C80211_SUBTYPE_MGMT_Deauthentication: ··· 3204 3177 atmel_enter_state(priv, STATION_STATE_JOINNING); 3205 3178 join(priv, BSS_TYPE_INFRASTRUCTURE); 3206 3179 } 3207 - 3180 + 3208 3181 break; 3209 3182 } 3210 3183 } ··· 3212 3185 /* run when timer expires */ 3213 3186 static void atmel_management_timer(u_long a) 3214 3187 { 3215 - struct net_device *dev = (struct net_device *) a; 3216 - struct atmel_private *priv = netdev_priv(dev); 3217 - unsigned long flags; 3218 - 3219 - /* Check if the card has been yanked. */ 3220 - if (priv->card && priv->present_callback && 3221 - !(*priv->present_callback)(priv->card)) 3222 - return; 3223 - 3224 - spin_lock_irqsave(&priv->irqlock, flags); 3188 + struct net_device *dev = (struct net_device *) a; 3189 + struct atmel_private *priv = netdev_priv(dev); 3190 + unsigned long flags; 3225 3191 3226 - switch (priv->station_state) { 3227 - 3228 - case STATION_STATE_AUTHENTICATING: 3229 - if (priv->AuthenticationRequestRetryCnt >= MAX_AUTHENTICATION_RETRIES) { 3230 - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3231 - priv->station_is_associated = 0; 3232 - priv->AuthenticationRequestRetryCnt = 0; 3233 - restart_search(priv); 3234 - } else { 3235 - priv->AuthenticationRequestRetryCnt++; 3236 - priv->CurrentAuthentTransactionSeqNum = 0x0001; 3237 - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3238 - send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0); 3192 + /* Check if the card has been yanked. */ 3193 + if (priv->card && priv->present_callback && 3194 + !(*priv->present_callback)(priv->card)) 3195 + return; 3196 + 3197 + spin_lock_irqsave(&priv->irqlock, flags); 3198 + 3199 + switch (priv->station_state) { 3200 + 3201 + case STATION_STATE_AUTHENTICATING: 3202 + if (priv->AuthenticationRequestRetryCnt >= MAX_AUTHENTICATION_RETRIES) { 3203 + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3204 + priv->station_is_associated = 0; 3205 + priv->AuthenticationRequestRetryCnt = 0; 3206 + restart_search(priv); 3207 + } else { 3208 + priv->AuthenticationRequestRetryCnt++; 3209 + priv->CurrentAuthentTransactionSeqNum = 0x0001; 3210 + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3211 + send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0); 3239 3212 } 3240 - 3241 3213 break; 3242 3214 3243 - case STATION_STATE_ASSOCIATING: 3244 - if (priv->AssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { 3245 - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3246 - priv->station_is_associated = 0; 3247 - priv->AssociationRequestRetryCnt = 0; 3248 - restart_search(priv); 3249 - } else { 3250 - priv->AssociationRequestRetryCnt++; 3251 - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3252 - send_association_request(priv, 0); 3253 - } 3215 + case STATION_STATE_ASSOCIATING: 3216 + if (priv->AssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { 3217 + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3218 + priv->station_is_associated = 0; 3219 + priv->AssociationRequestRetryCnt = 0; 3220 + restart_search(priv); 3221 + } else { 3222 + priv->AssociationRequestRetryCnt++; 3223 + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3224 + send_association_request(priv, 0); 3225 + } 3226 + break; 3254 3227 3255 - break; 3256 - 3257 - case STATION_STATE_REASSOCIATING: 3258 - if (priv->ReAssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { 3259 - atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3260 - priv->station_is_associated = 0; 3261 - priv->ReAssociationRequestRetryCnt = 0; 3262 - restart_search(priv); 3263 - } else { 3264 - priv->ReAssociationRequestRetryCnt++; 3265 - mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3266 - send_association_request(priv, 1); 3267 - } 3228 + case STATION_STATE_REASSOCIATING: 3229 + if (priv->ReAssociationRequestRetryCnt == MAX_ASSOCIATION_RETRIES) { 3230 + atmel_enter_state(priv, STATION_STATE_MGMT_ERROR); 3231 + priv->station_is_associated = 0; 3232 + priv->ReAssociationRequestRetryCnt = 0; 3233 + restart_search(priv); 3234 + } else { 3235 + priv->ReAssociationRequestRetryCnt++; 3236 + mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3237 + send_association_request(priv, 1); 3238 + } 3239 + break; 3268 3240 3269 - break; 3270 - 3271 - default: 3272 - break; 3273 - } 3274 - 3275 - spin_unlock_irqrestore(&priv->irqlock, flags); 3241 + default: 3242 + break; 3243 + } 3244 + 3245 + spin_unlock_irqrestore(&priv->irqlock, flags); 3276 3246 } 3277 - 3247 + 3278 3248 static void atmel_command_irq(struct atmel_private *priv) 3279 3249 { 3280 3250 u8 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); 3281 3251 u8 command = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET)); 3282 3252 int fast_scan; 3283 - 3284 - if (status == CMD_STATUS_IDLE || 3253 + 3254 + if (status == CMD_STATUS_IDLE || 3285 3255 status == CMD_STATUS_IN_PROGRESS) 3286 3256 return; 3287 3257 ··· 3290 3266 atmel_get_mib(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_CUR_BSSID_POS, 3291 3267 (u8 *)priv->CurrentBSSID, 6); 3292 3268 atmel_enter_state(priv, STATION_STATE_READY); 3293 - } 3269 + } 3294 3270 break; 3295 - 3271 + 3296 3272 case CMD_Scan: 3297 3273 fast_scan = priv->fast_scan; 3298 3274 priv->fast_scan = 0; 3299 - 3275 + 3300 3276 if (status != CMD_STATUS_COMPLETE) { 3301 3277 atmel_scan(priv, 1); 3302 3278 } else { 3303 3279 int bss_index = retrieve_bss(priv); 3304 3280 if (bss_index != -1) { 3305 3281 atmel_join_bss(priv, bss_index); 3306 - } else if (priv->operating_mode == IW_MODE_ADHOC && 3282 + } else if (priv->operating_mode == IW_MODE_ADHOC && 3307 3283 priv->SSID_size != 0) { 3308 3284 start(priv, BSS_TYPE_AD_HOC); 3309 3285 } else { ··· 3313 3289 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3314 3290 } 3315 3291 break; 3316 - 3292 + 3317 3293 case CMD_SiteSurvey: 3318 3294 priv->fast_scan = 0; 3319 - 3295 + 3320 3296 if (status != CMD_STATUS_COMPLETE) 3321 3297 return; 3322 - 3298 + 3323 3299 priv->site_survey_state = SITE_SURVEY_COMPLETED; 3324 3300 if (priv->station_is_associated) { 3325 - atmel_enter_state(priv, STATION_STATE_READY); 3301 + atmel_enter_state(priv, STATION_STATE_READY); 3326 3302 } else { 3327 3303 atmel_scan(priv, 1); 3328 3304 } ··· 3336 3312 } else { 3337 3313 priv->AuthenticationRequestRetryCnt = 0; 3338 3314 atmel_enter_state(priv, STATION_STATE_AUTHENTICATING); 3339 - 3315 + 3340 3316 mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3341 3317 priv->CurrentAuthentTransactionSeqNum = 0x0001; 3342 3318 send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0); 3343 3319 } 3344 3320 return; 3345 3321 } 3346 - 3322 + 3347 3323 atmel_scan(priv, 1); 3348 - 3349 3324 } 3350 3325 } 3351 3326 ··· 3356 3333 3357 3334 if (priv->card_type == CARD_TYPE_SPI_FLASH) 3358 3335 atmel_set_gcr(priv->dev, GCR_REMAP); 3359 - 3336 + 3360 3337 /* wake up on-board processor */ 3361 3338 atmel_clear_gcr(priv->dev, 0x0040); 3362 3339 atmel_write16(priv->dev, BSR, BSS_SRAM); 3363 - 3340 + 3364 3341 if (priv->card_type == CARD_TYPE_SPI_FLASH) 3365 3342 mdelay(100); 3366 3343 3367 3344 /* and wait for it */ 3368 - for (i = LOOP_RETRY_LIMIT; i; i--) { 3345 + for (i = LOOP_RETRY_LIMIT; i; i--) { 3369 3346 mr1 = atmel_read16(priv->dev, MR1); 3370 3347 mr3 = atmel_read16(priv->dev, MR3); 3371 - 3372 - if (mr3 & MAC_BOOT_COMPLETE) 3348 + 3349 + if (mr3 & MAC_BOOT_COMPLETE) 3373 3350 break; 3374 3351 if (mr1 & MAC_BOOT_COMPLETE && 3375 3352 priv->bus_type == BUS_TYPE_PCCARD) ··· 3380 3357 printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); 3381 3358 return 0; 3382 3359 } 3383 - 3360 + 3384 3361 if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { 3385 3362 printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); 3386 3363 return 0; 3387 3364 } 3388 - 3389 - /* now check for completion of MAC initialization through 3390 - the FunCtrl field of the IFACE, poll MR1 to detect completion of 3391 - MAC initialization, check completion status, set interrupt mask, 3392 - enables interrupts and calls Tx and Rx initialization functions */ 3393 - 3365 + 3366 + /* now check for completion of MAC initialization through 3367 + the FunCtrl field of the IFACE, poll MR1 to detect completion of 3368 + MAC initialization, check completion status, set interrupt mask, 3369 + enables interrupts and calls Tx and Rx initialization functions */ 3370 + 3394 3371 atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), FUNC_CTRL_INIT_COMPLETE); 3395 - 3396 - for (i = LOOP_RETRY_LIMIT; i; i--) { 3372 + 3373 + for (i = LOOP_RETRY_LIMIT; i; i--) { 3397 3374 mr1 = atmel_read16(priv->dev, MR1); 3398 3375 mr3 = atmel_read16(priv->dev, MR3); 3399 - 3400 - if (mr3 & MAC_INIT_COMPLETE) 3376 + 3377 + if (mr3 & MAC_INIT_COMPLETE) 3401 3378 break; 3402 3379 if (mr1 & MAC_INIT_COMPLETE && 3403 3380 priv->bus_type == BUS_TYPE_PCCARD) 3404 3381 break; 3405 3382 } 3406 - 3383 + 3407 3384 if (i == 0) { 3408 - printk(KERN_ALERT "%s: MAC failed to initialise.\n", priv->dev->name); 3385 + printk(KERN_ALERT "%s: MAC failed to initialise.\n", 3386 + priv->dev->name); 3409 3387 return 0; 3410 3388 } 3411 - 3389 + 3412 3390 /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ 3413 3391 if ((mr3 & MAC_INIT_COMPLETE) && 3414 3392 !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { ··· 3422 3398 return 0; 3423 3399 } 3424 3400 3425 - atmel_copy_to_host(priv->dev, (unsigned char *)iface, 3401 + atmel_copy_to_host(priv->dev, (unsigned char *)iface, 3426 3402 priv->host_info_base, sizeof(*iface)); 3427 - 3403 + 3428 3404 iface->tx_buff_pos = le16_to_cpu(iface->tx_buff_pos); 3429 3405 iface->tx_buff_size = le16_to_cpu(iface->tx_buff_size); 3430 3406 iface->tx_desc_pos = le16_to_cpu(iface->tx_desc_pos); ··· 3448 3424 { 3449 3425 int rc = 0; 3450 3426 struct atmel_private *priv = netdev_priv(dev); 3451 - 3427 + 3452 3428 /* reset pccard */ 3453 - if (priv->bus_type == BUS_TYPE_PCCARD) 3429 + if (priv->bus_type == BUS_TYPE_PCCARD) 3454 3430 atmel_write16(dev, GCR, 0x0060); 3455 - 3431 + 3456 3432 atmel_write16(dev, GCR, 0x0040); 3457 3433 mdelay(500); 3458 - 3434 + 3459 3435 if (atmel_read16(dev, MR2) == 0) { 3460 - /* No stored firmware so load a small stub which just 3436 + /* No stored firmware so load a small stub which just 3461 3437 tells us the MAC address */ 3462 3438 int i; 3463 3439 priv->card_type = CARD_TYPE_EEPROM; ··· 3466 3442 atmel_set_gcr(dev, GCR_REMAP); 3467 3443 atmel_clear_gcr(priv->dev, 0x0040); 3468 3444 atmel_write16(dev, BSR, BSS_SRAM); 3469 - for (i = LOOP_RETRY_LIMIT; i; i--) 3445 + for (i = LOOP_RETRY_LIMIT; i; i--) 3470 3446 if (atmel_read16(dev, MR3) & MAC_BOOT_COMPLETE) 3471 3447 break; 3472 3448 if (i == 0) { ··· 3475 3451 atmel_copy_to_host(dev, dev->dev_addr, atmel_read16(dev, MR2), 6); 3476 3452 /* got address, now squash it again until the network 3477 3453 interface is opened */ 3478 - if (priv->bus_type == BUS_TYPE_PCCARD) 3454 + if (priv->bus_type == BUS_TYPE_PCCARD) 3479 3455 atmel_write16(dev, GCR, 0x0060); 3480 3456 atmel_write16(dev, GCR, 0x0040); 3481 3457 rc = 1; ··· 3483 3459 } else if (atmel_read16(dev, MR4) == 0) { 3484 3460 /* Mac address easy in this case. */ 3485 3461 priv->card_type = CARD_TYPE_PARALLEL_FLASH; 3486 - atmel_write16(dev, BSR, 1); 3462 + atmel_write16(dev, BSR, 1); 3487 3463 atmel_copy_to_host(dev, dev->dev_addr, 0xc000, 6); 3488 3464 atmel_write16(dev, BSR, 0x200); 3489 3465 rc = 1; ··· 3493 3469 priv->card_type = CARD_TYPE_SPI_FLASH; 3494 3470 if (atmel_wakeup_firmware(priv)) { 3495 3471 atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); 3496 - 3472 + 3497 3473 /* got address, now squash it again until the network 3498 3474 interface is opened */ 3499 - if (priv->bus_type == BUS_TYPE_PCCARD) 3475 + if (priv->bus_type == BUS_TYPE_PCCARD) 3500 3476 atmel_write16(dev, GCR, 0x0060); 3501 3477 atmel_write16(dev, GCR, 0x0040); 3502 3478 rc = 1; 3503 3479 } 3504 3480 } 3505 - 3481 + 3506 3482 if (rc) { 3507 3483 if (dev->dev_addr[0] == 0xFF) { 3508 3484 u8 default_mac[] = {0x00,0x04, 0x25, 0x00, 0x00, 0x00}; ··· 3510 3486 memcpy(dev->dev_addr, default_mac, 6); 3511 3487 } 3512 3488 } 3513 - 3489 + 3514 3490 return rc; 3515 3491 } 3516 3492 3517 - static void build_wep_mib(struct atmel_private *priv) 3518 3493 /* Move the encyption information on the MIB structure. 3519 3494 This routine is for the pre-WPA firmware: later firmware has 3520 3495 a different format MIB and a different routine. */ 3496 + static void build_wep_mib(struct atmel_private *priv) 3521 3497 { 3522 3498 struct { /* NB this is matched to the hardware, don't change. */ 3523 - u8 wep_is_on; 3499 + u8 wep_is_on; 3524 3500 u8 default_key; /* 0..3 */ 3525 3501 u8 reserved; 3526 3502 u8 exclude_unencrypted; 3527 - 3503 + 3528 3504 u32 WEPICV_error_count; 3529 3505 u32 WEP_excluded_count; 3530 - 3506 + 3531 3507 u8 wep_keys[MAX_ENCRYPTION_KEYS][13]; 3532 - u8 encryption_level; /* 0, 1, 2 */ 3533 - u8 reserved2[3]; 3508 + u8 encryption_level; /* 0, 1, 2 */ 3509 + u8 reserved2[3]; 3534 3510 } mib; 3535 3511 int i; 3536 3512 ··· 3539 3515 if (priv->wep_key_len[priv->default_key] > 5) 3540 3516 mib.encryption_level = 2; 3541 3517 else 3542 - mib.encryption_level = 1; 3518 + mib.encryption_level = 1; 3543 3519 } else { 3544 3520 mib.encryption_level = 0; 3545 3521 } 3546 3522 3547 3523 mib.default_key = priv->default_key; 3548 3524 mib.exclude_unencrypted = priv->exclude_unencrypted; 3549 - 3550 - for(i = 0; i < MAX_ENCRYPTION_KEYS; i++) 3525 + 3526 + for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) 3551 3527 memcpy(mib.wep_keys[i], priv->wep_keys[i], 13); 3552 - 3528 + 3553 3529 atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib)); 3554 3530 } 3555 3531 3556 3532 static void build_wpa_mib(struct atmel_private *priv) 3557 3533 { 3558 - /* This is for the later (WPA enabled) firmware. */ 3534 + /* This is for the later (WPA enabled) firmware. */ 3559 3535 3560 3536 struct { /* NB this is matched to the hardware, don't change. */ 3561 3537 u8 cipher_default_key_value[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE]; 3562 3538 u8 receiver_address[6]; 3563 - u8 wep_is_on; 3539 + u8 wep_is_on; 3564 3540 u8 default_key; /* 0..3 */ 3565 3541 u8 group_key; 3566 3542 u8 exclude_unencrypted; 3567 3543 u8 encryption_type; 3568 3544 u8 reserved; 3569 - 3545 + 3570 3546 u32 WEPICV_error_count; 3571 3547 u32 WEP_excluded_count; 3572 - 3548 + 3573 3549 u8 key_RSC[4][8]; 3574 3550 } mib; 3575 - 3551 + 3576 3552 int i; 3577 3553 3578 3554 mib.wep_is_on = priv->wep_is_on; 3579 3555 mib.exclude_unencrypted = priv->exclude_unencrypted; 3580 3556 memcpy(mib.receiver_address, priv->CurrentBSSID, 6); 3581 - 3557 + 3582 3558 /* zero all the keys before adding in valid ones. */ 3583 3559 memset(mib.cipher_default_key_value, 0, sizeof(mib.cipher_default_key_value)); 3584 - 3560 + 3585 3561 if (priv->wep_is_on) { 3586 - /* There's a comment in the Atmel code to the effect that this is only valid 3587 - when still using WEP, it may need to be set to something to use WPA */ 3562 + /* There's a comment in the Atmel code to the effect that this 3563 + is only valid when still using WEP, it may need to be set to 3564 + something to use WPA */ 3588 3565 memset(mib.key_RSC, 0, sizeof(mib.key_RSC)); 3589 - 3566 + 3590 3567 mib.default_key = mib.group_key = 255; 3591 3568 for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) { 3592 3569 if (priv->wep_key_len[i] > 0) { ··· 3595 3570 if (i == priv->default_key) { 3596 3571 mib.default_key = i; 3597 3572 mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 7; 3598 - mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; 3573 + mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; 3599 3574 } else { 3600 3575 mib.group_key = i; 3601 3576 priv->group_cipher_suite = priv->pairwise_cipher_suite; 3602 3577 mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 1; 3603 - mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite; 3578 + mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite; 3604 3579 } 3605 3580 } 3606 3581 } ··· 3608 3583 mib.default_key = mib.group_key != 255 ? mib.group_key : 0; 3609 3584 if (mib.group_key == 255) 3610 3585 mib.group_key = mib.default_key; 3611 - 3586 + 3612 3587 } 3613 - 3588 + 3614 3589 atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib)); 3615 3590 } 3616 - 3617 - static int reset_atmel_card(struct net_device *dev) 3591 + 3592 + static int reset_atmel_card(struct net_device *dev) 3618 3593 { 3619 3594 /* do everything necessary to wake up the hardware, including 3620 3595 waiting for the lightning strike and throwing the knife switch.... 3621 3596 3622 - set all the Mib values which matter in the card to match 3597 + set all the Mib values which matter in the card to match 3623 3598 their settings in the atmel_private structure. Some of these 3624 3599 can be altered on the fly, but many (WEP, infrastucture or ad-hoc) 3625 3600 can only be changed by tearing down the world and coming back through 3626 3601 here. 3627 3602 3628 - This routine is also responsible for initialising some 3629 - hardware-specific fields in the atmel_private structure, 3603 + This routine is also responsible for initialising some 3604 + hardware-specific fields in the atmel_private structure, 3630 3605 including a copy of the firmware's hostinfo stucture 3631 3606 which is the route into the rest of the firmare datastructures. */ 3632 3607 3633 3608 struct atmel_private *priv = netdev_priv(dev); 3634 3609 u8 configuration; 3635 - 3610 + 3636 3611 /* data to add to the firmware names, in priority order 3637 3612 this implemenents firmware versioning */ 3638 - 3613 + 3639 3614 static char *firmware_modifier[] = { 3640 3615 "-wpa", 3641 3616 "", 3642 3617 NULL 3643 3618 }; 3644 - 3619 + 3645 3620 /* reset pccard */ 3646 - if (priv->bus_type == BUS_TYPE_PCCARD) 3621 + if (priv->bus_type == BUS_TYPE_PCCARD) 3647 3622 atmel_write16(priv->dev, GCR, 0x0060); 3648 - 3623 + 3649 3624 /* stop card , disable interrupts */ 3650 3625 atmel_write16(priv->dev, GCR, 0x0040); 3651 - 3626 + 3652 3627 if (priv->card_type == CARD_TYPE_EEPROM) { 3653 3628 /* copy in firmware if needed */ 3654 3629 const struct firmware *fw_entry = NULL; ··· 3661 3636 "%s: card type is unknown: assuming at76c502 firmware is OK.\n", 3662 3637 dev->name); 3663 3638 printk(KERN_INFO 3664 - "%s: if not, use the firmware= module parameter.\n", 3639 + "%s: if not, use the firmware= module parameter.\n", 3665 3640 dev->name); 3666 3641 strcpy(priv->firmware_id, "atmel_at76c502.bin"); 3667 3642 } 3668 3643 if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) { 3669 - printk(KERN_ALERT 3670 - "%s: firmware %s is missing, cannot continue.\n", 3644 + printk(KERN_ALERT 3645 + "%s: firmware %s is missing, cannot continue.\n", 3671 3646 dev->name, priv->firmware_id); 3672 3647 return 0; 3673 3648 } ··· 3679 3654 while (fw_table[fw_index].fw_type != priv->firmware_type 3680 3655 && fw_table[fw_index].fw_type != ATMEL_FW_TYPE_NONE) 3681 3656 fw_index++; 3682 - 3657 + 3683 3658 /* construct the actual firmware file name */ 3684 3659 if (fw_table[fw_index].fw_type != ATMEL_FW_TYPE_NONE) { 3685 3660 int i; ··· 3694 3669 } 3695 3670 } 3696 3671 if (!success) { 3697 - printk(KERN_ALERT 3698 - "%s: firmware %s is missing, cannot start.\n", 3672 + printk(KERN_ALERT 3673 + "%s: firmware %s is missing, cannot start.\n", 3699 3674 dev->name, priv->firmware_id); 3700 3675 priv->firmware_id[0] = '\0'; 3701 - return 0; 3676 + return 0; 3702 3677 } 3703 3678 } 3704 - 3679 + 3705 3680 fw = fw_entry->data; 3706 3681 len = fw_entry->size; 3707 3682 } 3708 - 3683 + 3709 3684 if (len <= 0x6000) { 3710 3685 atmel_write16(priv->dev, BSR, BSS_IRAM); 3711 3686 atmel_copy_to_card(priv->dev, 0, fw, len); 3712 3687 atmel_set_gcr(priv->dev, GCR_REMAP); 3713 3688 } else { 3714 - /* Remap */ 3689 + /* Remap */ 3715 3690 atmel_set_gcr(priv->dev, GCR_REMAP); 3716 3691 atmel_write16(priv->dev, BSR, BSS_IRAM); 3717 3692 atmel_copy_to_card(priv->dev, 0, fw, 0x6000); ··· 3733 3708 the 3com broken-ness filter. */ 3734 3709 priv->use_wpa = (priv->host_info.major_version == 4); 3735 3710 priv->radio_on_broken = (priv->host_info.major_version == 5); 3736 - 3711 + 3737 3712 /* unmask all irq sources */ 3738 3713 atmel_wmem8(priv, atmel_hi(priv, IFACE_INT_MASK_OFFSET), 0xff); 3739 - 3714 + 3740 3715 /* int Tx system and enable Tx */ 3741 3716 atmel_wmem8(priv, atmel_tx(priv, TX_DESC_FLAGS_OFFSET, 0), 0); 3742 3717 atmel_wmem32(priv, atmel_tx(priv, TX_DESC_NEXT_OFFSET, 0), 0x80000000L); 3743 3718 atmel_wmem16(priv, atmel_tx(priv, TX_DESC_POS_OFFSET, 0), 0); 3744 3719 atmel_wmem16(priv, atmel_tx(priv, TX_DESC_SIZE_OFFSET, 0), 0); 3745 3720 3746 - priv->tx_desc_free = priv->host_info.tx_desc_count; 3747 - priv->tx_desc_head = 0; 3748 - priv->tx_desc_tail = 0; 3721 + priv->tx_desc_free = priv->host_info.tx_desc_count; 3722 + priv->tx_desc_head = 0; 3723 + priv->tx_desc_tail = 0; 3749 3724 priv->tx_desc_previous = 0; 3750 3725 priv->tx_free_mem = priv->host_info.tx_buff_size; 3751 - priv->tx_buff_head = 0; 3752 - priv->tx_buff_tail = 0; 3753 - 3754 - configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); 3755 - atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), 3726 + priv->tx_buff_head = 0; 3727 + priv->tx_buff_tail = 0; 3728 + 3729 + configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); 3730 + atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), 3756 3731 configuration | FUNC_CTRL_TxENABLE); 3757 3732 3758 3733 /* init Rx system and enable */ 3759 3734 priv->rx_desc_head = 0; 3760 - 3761 - configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); 3762 - atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), 3735 + 3736 + configuration = atmel_rmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET)); 3737 + atmel_wmem8(priv, atmel_hi(priv, IFACE_FUNC_CTRL_OFFSET), 3763 3738 configuration | FUNC_CTRL_RxENABLE); 3764 - 3739 + 3765 3740 if (!priv->radio_on_broken) { 3766 - if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == 3741 + if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == 3767 3742 CMD_STATUS_REJECTED_RADIO_OFF) { 3768 - printk(KERN_INFO 3743 + printk(KERN_INFO 3769 3744 "%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n", 3770 3745 dev->name); 3771 3746 return 0; 3772 3747 } 3773 3748 } 3774 - 3749 + 3775 3750 /* set up enough MIB values to run. */ 3776 3751 atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_AUTO_TX_RATE_POS, priv->auto_tx_rate); 3777 3752 atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_TX_PROMISCUOUS_POS, PROM_MODE_OFF); ··· 3780 3755 atmel_set_mib8(priv, Mac_Mib_Type, MAC_MIB_SHORT_RETRY_POS, priv->short_retry); 3781 3756 atmel_set_mib8(priv, Mac_Mib_Type, MAC_MIB_LONG_RETRY_POS, priv->long_retry); 3782 3757 atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, priv->preamble); 3783 - atmel_set_mib(priv, Mac_Address_Mib_Type, MAC_ADDR_MIB_MAC_ADDR_POS, 3758 + atmel_set_mib(priv, Mac_Address_Mib_Type, MAC_ADDR_MIB_MAC_ADDR_POS, 3784 3759 priv->dev->dev_addr, 6); 3785 3760 atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS, ACTIVE_MODE); 3786 3761 atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1); ··· 3791 3766 build_wpa_mib(priv); 3792 3767 else 3793 3768 build_wep_mib(priv); 3794 - 3769 + 3795 3770 return 1; 3796 3771 } 3797 3772 3798 - static void atmel_send_command(struct atmel_private *priv, int command, void *cmd, int cmd_size) 3773 + static void atmel_send_command(struct atmel_private *priv, int command, 3774 + void *cmd, int cmd_size) 3799 3775 { 3800 3776 if (cmd) 3801 - atmel_copy_to_card(priv->dev, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET), 3777 + atmel_copy_to_card(priv->dev, atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET), 3802 3778 cmd, cmd_size); 3803 - 3779 + 3804 3780 atmel_wmem8(priv, atmel_co(priv, CMD_BLOCK_COMMAND_OFFSET), command); 3805 3781 atmel_wmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET), 0); 3806 3782 } 3807 - 3808 - static int atmel_send_command_wait(struct atmel_private *priv, int command, void *cmd, int cmd_size) 3783 + 3784 + static int atmel_send_command_wait(struct atmel_private *priv, int command, 3785 + void *cmd, int cmd_size) 3809 3786 { 3810 3787 int i, status; 3811 - 3788 + 3812 3789 atmel_send_command(priv, command, cmd, cmd_size); 3813 - 3790 + 3814 3791 for (i = 5000; i; i--) { 3815 3792 status = atmel_rmem8(priv, atmel_co(priv, CMD_BLOCK_STATUS_OFFSET)); 3816 - if (status != CMD_STATUS_IDLE && 3793 + if (status != CMD_STATUS_IDLE && 3817 3794 status != CMD_STATUS_IN_PROGRESS) 3818 3795 break; 3819 3796 udelay(20); 3820 3797 } 3821 - 3798 + 3822 3799 if (i == 0) { 3823 3800 printk(KERN_ALERT "%s: failed to contact MAC.\n", priv->dev->name); 3824 3801 status = CMD_STATUS_HOST_ERROR; 3825 - } else { 3802 + } else { 3826 3803 if (command != CMD_EnableRadio) 3827 3804 status = CMD_STATUS_COMPLETE; 3828 3805 } 3829 - 3806 + 3830 3807 return status; 3831 3808 } 3832 3809 ··· 3854 3827 atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 1); 3855 3828 } 3856 3829 3857 - static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data) 3830 + static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, 3831 + u16 data) 3858 3832 { 3859 3833 struct get_set_mib m; 3860 3834 m.type = type; ··· 3867 3839 atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + 2); 3868 3840 } 3869 3841 3870 - static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len) 3842 + static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, 3843 + u8 *data, int data_len) 3871 3844 { 3872 3845 struct get_set_mib m; 3873 3846 m.type = type; ··· 3877 3848 3878 3849 if (data_len > MIB_MAX_DATA_BYTES) 3879 3850 printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name); 3880 - 3851 + 3881 3852 memcpy(m.data, data, data_len); 3882 3853 atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + data_len); 3883 3854 } 3884 3855 3885 - static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len) 3856 + static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, 3857 + u8 *data, int data_len) 3886 3858 { 3887 3859 struct get_set_mib m; 3888 3860 m.type = type; 3889 3861 m.size = data_len; 3890 3862 m.index = index; 3891 - 3863 + 3892 3864 if (data_len > MIB_MAX_DATA_BYTES) 3893 3865 printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name); 3894 - 3866 + 3895 3867 atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, MIB_HEADER_SIZE + data_len); 3896 - atmel_copy_to_host(priv->dev, data, 3868 + atmel_copy_to_host(priv->dev, data, 3897 3869 atmel_co(priv, CMD_BLOCK_PARAMETERS_OFFSET + MIB_HEADER_SIZE), data_len); 3898 3870 } 3899 3871 ··· 3903 3873 int i; 3904 3874 outw(data, dev->base_addr + AR); 3905 3875 /* Address register appears to need some convincing..... */ 3906 - for (i = 0; data != inw(dev->base_addr + AR) && i<10; i++) 3876 + for (i = 0; data != inw(dev->base_addr + AR) && i < 10; i++) 3907 3877 outw(data, dev->base_addr + AR); 3908 3878 } 3909 3879 3910 - static void atmel_copy_to_card(struct net_device *dev, u16 dest, unsigned char *src, u16 len) 3880 + static void atmel_copy_to_card(struct net_device *dev, u16 dest, 3881 + unsigned char *src, u16 len) 3911 3882 { 3912 3883 int i; 3913 3884 atmel_writeAR(dev, dest); ··· 3925 3894 atmel_write8(dev, DR, *src); 3926 3895 } 3927 3896 3928 - static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, u16 src, u16 len) 3897 + static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, 3898 + u16 src, u16 len) 3929 3899 { 3930 3900 int i; 3931 3901 atmel_writeAR(dev, src); ··· 3962 3930 break; 3963 3931 udelay(20); 3964 3932 } 3965 - 3966 - if (!i) return 0; /* timed out */ 3967 - 3933 + 3934 + if (!i) 3935 + return 0; /* timed out */ 3936 + 3968 3937 atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 1); 3969 3938 if (atmel_rmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_HOST_OFFSET))) { 3970 3939 atmel_wmem8(priv, atmel_hi(priv, IFACE_LOCKOUT_MAC_OFFSET), 0); 3971 - if (!j--) return 0; /* timed out */ 3940 + if (!j--) 3941 + return 0; /* timed out */ 3972 3942 goto retry; 3973 3943 } 3974 - 3944 + 3975 3945 return 1; 3976 3946 } 3977 3947 3978 3948 static void atmel_wmem32(struct atmel_private *priv, u16 pos, u32 data) 3979 3949 { 3980 - atmel_writeAR(priv->dev, pos); 3950 + atmel_writeAR(priv->dev, pos); 3981 3951 atmel_write16(priv->dev, DR, data); /* card is little-endian */ 3982 3952 atmel_write16(priv->dev, DR, data >> 16); 3983 3953 } ··· 4051 4017 serial output, since SO is normally high. But it 4052 4018 does cause 8 clock cycles and thus 8 bits to be 4053 4019 clocked in to the chip. See Atmel's SPI 4054 - controller (e.g. AT91M55800) timing and 4K 4020 + controller (e.g. AT91M55800) timing and 4K 4055 4021 SPI EEPROM manuals */ 4056 - 4022 + 4057 4023 .set NVRAM_SCRATCH, 0x02000100 /* arbitrary area for scratchpad memory */ 4058 4024 .set NVRAM_IMAGE, 0x02000200 4059 4025 .set NVRAM_LENGTH, 0x0200 ··· 4066 4032 .set MR4, 0xC 4067 4033 RESET_VECTOR: 4068 4034 b RESET_HANDLER 4069 - UNDEF_VECTOR: 4035 + UNDEF_VECTOR: 4070 4036 b HALT1 4071 - SWI_VECTOR: 4037 + SWI_VECTOR: 4072 4038 b HALT1 4073 - IABORT_VECTOR: 4039 + IABORT_VECTOR: 4074 4040 b HALT1 4075 - DABORT_VECTOR: 4076 - RESERVED_VECTOR: 4041 + DABORT_VECTOR: 4042 + RESERVED_VECTOR: 4077 4043 b HALT1 4078 - IRQ_VECTOR: 4044 + IRQ_VECTOR: 4079 4045 b HALT1 4080 - FIQ_VECTOR: 4046 + FIQ_VECTOR: 4081 4047 b HALT1 4082 4048 HALT1: b HALT1 4083 4049 RESET_HANDLER: 4084 4050 mov r0, #CPSR_INITIAL 4085 4051 msr CPSR_c, r0 /* This is probably unnecessary */ 4086 - 4052 + 4087 4053 /* I'm guessing this is initializing clock generator electronics for SPI */ 4088 4054 ldr r0, =SPI_CGEN_BASE 4089 4055 mov r1, #0 ··· 4095 4061 str r1, [r0, #28] 4096 4062 mov r1, #1 4097 4063 str r1, [r0, #8] 4098 - 4064 + 4099 4065 ldr r0, =MRBASE 4100 4066 mov r1, #0 4101 4067 strh r1, [r0, #MR1] ··· 4128 4094 ldmia sp!, {lr} 4129 4095 bx lr 4130 4096 .endfunc 4131 - 4097 + 4132 4098 .func Get_MAC_Addr, GET_MAC_ADDR 4133 4099 GET_MAC_ADDR: 4134 4100 stmdb sp!, {lr} ··· 4144 4110 .func Delay9, DELAY9 4145 4111 DELAY9: 4146 4112 adds r0, r0, r0, LSL #3 /* r0 = r0 * 9 */ 4147 - DELAYLOOP: 4113 + DELAYLOOP: 4148 4114 beq DELAY9_done 4149 4115 subs r0, r0, #1 4150 4116 b DELAYLOOP 4151 - DELAY9_done: 4117 + DELAY9_done: 4152 4118 bx lr 4153 - .endfunc 4119 + .endfunc 4154 4120 4155 4121 .func SP_Init, SP_INIT 4156 4122 SP_INIT: ··· 4179 4145 ldr r0, [r0, #SP_RDR] 4180 4146 bx lr 4181 4147 .endfunc 4182 - .func NVRAM_Init, NVRAM_INIT 4148 + .func NVRAM_Init, NVRAM_INIT 4183 4149 NVRAM_INIT: 4184 4150 ldr r1, =SP_BASE 4185 4151 ldr r0, [r1, #SP_RDR] 4186 4152 mov r0, #NVRAM_CMD_RDSR 4187 4153 str r0, [r1, #SP_TDR] 4188 - SP_loop1: 4154 + SP_loop1: 4189 4155 ldr r0, [r1, #SP_SR] 4190 4156 tst r0, #SP_TDRE 4191 4157 beq SP_loop1 4192 4158 4193 4159 mov r0, #SPI_8CLOCKS 4194 - str r0, [r1, #SP_TDR] 4195 - SP_loop2: 4160 + str r0, [r1, #SP_TDR] 4161 + SP_loop2: 4196 4162 ldr r0, [r1, #SP_SR] 4197 4163 tst r0, #SP_TDRE 4198 4164 beq SP_loop2 4199 4165 4200 4166 ldr r0, [r1, #SP_RDR] 4201 - SP_loop3: 4167 + SP_loop3: 4202 4168 ldr r0, [r1, #SP_SR] 4203 4169 tst r0, #SP_RDRF 4204 4170 beq SP_loop3 ··· 4207 4173 and r0, r0, #255 4208 4174 bx lr 4209 4175 .endfunc 4210 - 4176 + 4211 4177 .func NVRAM_Xfer, NVRAM_XFER 4212 4178 /* r0 = dest address */ 4213 4179 /* r1 = not used */ ··· 4219 4185 mov r4, r3 /* save r3 (length) */ 4220 4186 mov r0, r2, LSR #5 /* SPI memories put A8 in the command field */ 4221 4187 and r0, r0, #8 4222 - add r0, r0, #NVRAM_CMD_READ 4188 + add r0, r0, #NVRAM_CMD_READ 4223 4189 ldr r1, =NVRAM_SCRATCH 4224 4190 strb r0, [r1, #0] /* save command in NVRAM_SCRATCH[0] */ 4225 4191 strb r2, [r1, #1] /* save low byte of source address in NVRAM_SCRATCH[1] */ 4226 - _local1: 4192 + _local1: 4227 4193 bl NVRAM_INIT 4228 4194 tst r0, #NVRAM_SR_RDY 4229 4195 bne _local1 ··· 4245 4211 cmp r0, #0 4246 4212 bls _local2 4247 4213 ldr r5, =NVRAM_SCRATCH 4248 - _local4: 4214 + _local4: 4249 4215 ldrb r6, [r5, r3] 4250 4216 str r6, [r4, #SP_TDR] 4251 4217 _local3: ··· 4259 4225 mov r3, #SPI_8CLOCKS 4260 4226 str r3, [r4, #SP_TDR] 4261 4227 ldr r0, [r4, #SP_RDR] 4262 - _local5: 4228 + _local5: 4263 4229 ldr r0, [r4, #SP_SR] 4264 4230 tst r0, #SP_RDRF 4265 4231 beq _local5 ··· 4267 4233 mov r0, #0 4268 4234 cmp r2, #0 /* r2 is # of bytes to copy in */ 4269 4235 bls _local6 4270 - _local7: 4236 + _local7: 4271 4237 ldr r5, [r4, #SP_SR] 4272 4238 tst r5, #SP_TDRE 4273 4239 beq _local7 4274 4240 str r3, [r4, #SP_TDR] /* r3 has SPI_8CLOCKS */ 4275 - _local8: 4241 + _local8: 4276 4242 ldr r5, [r4, #SP_SR] 4277 4243 tst r5, #SP_RDRF 4278 4244 beq _local8
+1
drivers/net/wireless/hostap/Makefile
··· 1 + hostap-y := hostap_main.o 1 2 obj-$(CONFIG_HOSTAP) += hostap.o 2 3 3 4 obj-$(CONFIG_HOSTAP_CS) += hostap_cs.o
drivers/net/wireless/hostap/hostap.c drivers/net/wireless/hostap/hostap_main.c