aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt61pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index b20e3eac9d6..bf04605896c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1,5 +1,5 @@
1/* 1/*
2 Copyright (C) 2004 - 2009 rt2x00 SourceForge Project 2 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
3 <http://rt2x00.serialmonkey.com> 3 <http://rt2x00.serialmonkey.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
@@ -51,7 +51,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
51 * These indirect registers work with busy bits, 51 * These indirect registers work with busy bits,
52 * and we will try maximal REGISTER_BUSY_COUNT times to access 52 * and we will try maximal REGISTER_BUSY_COUNT times to access
53 * the register while taking a REGISTER_BUSY_DELAY us delay 53 * the register while taking a REGISTER_BUSY_DELAY us delay
54 * between each attampt. When the busy bit is still set at that time, 54 * between each attempt. When the busy bit is still set at that time,
55 * the access attempt is considered to have failed, 55 * the access attempt is considered to have failed,
56 * and we will print an error. 56 * and we will print an error.
57 */ 57 */
@@ -386,7 +386,7 @@ static int rt61pci_config_shared_key(struct rt2x00_dev *rt2x00dev,
386 * The driver does not support the IV/EIV generation 386 * The driver does not support the IV/EIV generation
387 * in hardware. However it doesn't support the IV/EIV 387 * in hardware. However it doesn't support the IV/EIV
388 * inside the ieee80211 frame either, but requires it 388 * inside the ieee80211 frame either, but requires it
389 * to be provided seperately for the descriptor. 389 * to be provided separately for the descriptor.
390 * rt2x00lib will cut the IV/EIV data out of all frames 390 * rt2x00lib will cut the IV/EIV data out of all frames
391 * given to us by mac80211, but we must tell mac80211 391 * given to us by mac80211, but we must tell mac80211
392 * to generate the IV/EIV data. 392 * to generate the IV/EIV data.
@@ -397,7 +397,7 @@ static int rt61pci_config_shared_key(struct rt2x00_dev *rt2x00dev,
397 /* 397 /*
398 * SEC_CSR0 contains only single-bit fields to indicate 398 * SEC_CSR0 contains only single-bit fields to indicate
399 * a particular key is valid. Because using the FIELD32() 399 * a particular key is valid. Because using the FIELD32()
400 * defines directly will cause a lot of overhead we use 400 * defines directly will cause a lot of overhead, we use
401 * a calculation to determine the correct bit directly. 401 * a calculation to determine the correct bit directly.
402 */ 402 */
403 mask = 1 << key->hw_key_idx; 403 mask = 1 << key->hw_key_idx;
@@ -425,11 +425,11 @@ static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
425 /* 425 /*
426 * rt2x00lib can't determine the correct free 426 * rt2x00lib can't determine the correct free
427 * key_idx for pairwise keys. We have 2 registers 427 * key_idx for pairwise keys. We have 2 registers
428 * with key valid bits. The goal is simple, read 428 * with key valid bits. The goal is simple: read
429 * the first register, if that is full move to 429 * the first register. If that is full, move to
430 * the next register. 430 * the next register.
431 * When both registers are full, we drop the key, 431 * When both registers are full, we drop the key.
432 * otherwise we use the first invalid entry. 432 * Otherwise, we use the first invalid entry.
433 */ 433 */
434 rt2x00pci_register_read(rt2x00dev, SEC_CSR2, &reg); 434 rt2x00pci_register_read(rt2x00dev, SEC_CSR2, &reg);
435 if (reg && reg == ~0) { 435 if (reg && reg == ~0) {
@@ -464,8 +464,8 @@ static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
464 &addr_entry, sizeof(addr_entry)); 464 &addr_entry, sizeof(addr_entry));
465 465
466 /* 466 /*
467 * Enable pairwise lookup table for given BSS idx, 467 * Enable pairwise lookup table for given BSS idx.
468 * without this received frames will not be decrypted 468 * Without this, received frames will not be decrypted
469 * by the hardware. 469 * by the hardware.
470 */ 470 */
471 rt2x00pci_register_read(rt2x00dev, SEC_CSR4, &reg); 471 rt2x00pci_register_read(rt2x00dev, SEC_CSR4, &reg);
@@ -487,7 +487,7 @@ static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
487 /* 487 /*
488 * SEC_CSR2 and SEC_CSR3 contain only single-bit fields to indicate 488 * SEC_CSR2 and SEC_CSR3 contain only single-bit fields to indicate
489 * a particular key is valid. Because using the FIELD32() 489 * a particular key is valid. Because using the FIELD32()
490 * defines directly will cause a lot of overhead we use 490 * defines directly will cause a lot of overhead, we use
491 * a calculation to determine the correct bit directly. 491 * a calculation to determine the correct bit directly.
492 */ 492 */
493 if (key->hw_key_idx < 32) { 493 if (key->hw_key_idx < 32) {
@@ -556,7 +556,7 @@ static void rt61pci_config_intf(struct rt2x00_dev *rt2x00dev,
556 if (flags & CONFIG_UPDATE_TYPE) { 556 if (flags & CONFIG_UPDATE_TYPE) {
557 /* 557 /*
558 * Clear current synchronisation setup. 558 * Clear current synchronisation setup.
559 * For the Beacon base registers we only need to clear 559 * For the Beacon base registers, we only need to clear
560 * the first byte since that byte contains the VALID and OWNER 560 * the first byte since that byte contains the VALID and OWNER
561 * bits which (when set to 0) will invalidate the entire beacon. 561 * bits which (when set to 0) will invalidate the entire beacon.
562 */ 562 */
@@ -1168,8 +1168,8 @@ static int rt61pci_check_firmware(struct rt2x00_dev *rt2x00dev,
1168 return FW_BAD_LENGTH; 1168 return FW_BAD_LENGTH;
1169 1169
1170 /* 1170 /*
1171 * The last 2 bytes in the firmware array are the crc checksum itself, 1171 * The last 2 bytes in the firmware array are the crc checksum itself.
1172 * this means that we should never pass those 2 bytes to the crc 1172 * This means that we should never pass those 2 bytes to the crc
1173 * algorithm. 1173 * algorithm.
1174 */ 1174 */
1175 fw_crc = (data[len - 2] << 8 | data[len - 1]); 1175 fw_crc = (data[len - 2] << 8 | data[len - 1]);
@@ -1986,7 +1986,7 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry,
1986 1986
1987 /* 1987 /*
1988 * Hardware has stripped IV/EIV data from 802.11 frame during 1988 * Hardware has stripped IV/EIV data from 802.11 frame during
1989 * decryption. It has provided the data seperately but rt2x00lib 1989 * decryption. It has provided the data separately but rt2x00lib
1990 * should decide if it should be reinserted. 1990 * should decide if it should be reinserted.
1991 */ 1991 */
1992 rxdesc->flags |= RX_FLAG_IV_STRIPPED; 1992 rxdesc->flags |= RX_FLAG_IV_STRIPPED;
@@ -2042,7 +2042,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
2042 * During each loop we will compare the freshly read 2042 * During each loop we will compare the freshly read
2043 * STA_CSR4 register value with the value read from 2043 * STA_CSR4 register value with the value read from
2044 * the previous loop. If the 2 values are equal then 2044 * the previous loop. If the 2 values are equal then
2045 * we should stop processing because the chance it 2045 * we should stop processing because the chance is
2046 * quite big that the device has been unplugged and 2046 * quite big that the device has been unplugged and
2047 * we risk going into an endless loop. 2047 * we risk going into an endless loop.
2048 */ 2048 */
@@ -2300,6 +2300,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2300 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 2300 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
2301 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg); 2301 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg);
2302 rt2x00_set_chip_rf(rt2x00dev, value, reg); 2302 rt2x00_set_chip_rf(rt2x00dev, value, reg);
2303 rt2x00_print_chip(rt2x00dev);
2303 2304
2304 if (!rt2x00_rf(&rt2x00dev->chip, RF5225) && 2305 if (!rt2x00_rf(&rt2x00dev->chip, RF5225) &&
2305 !rt2x00_rf(&rt2x00dev->chip, RF5325) && 2306 !rt2x00_rf(&rt2x00dev->chip, RF5325) &&
@@ -2330,7 +2331,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2330 __set_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags); 2331 __set_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags);
2331 2332
2332 /* 2333 /*
2333 * Detect if this device has an hardware controlled radio. 2334 * Detect if this device has a hardware controlled radio.
2334 */ 2335 */
2335 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) 2336 if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
2336 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); 2337 __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags);
@@ -2355,7 +2356,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2355 __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); 2356 __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags);
2356 2357
2357 /* 2358 /*
2358 * When working with a RF2529 chip without double antenna 2359 * When working with a RF2529 chip without double antenna,
2359 * the antenna settings should be gathered from the NIC 2360 * the antenna settings should be gathered from the NIC
2360 * eeprom word. 2361 * eeprom word.
2361 */ 2362 */
@@ -2668,7 +2669,7 @@ static int rt61pci_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
2668 2669
2669 /* 2670 /*
2670 * We only need to perform additional register initialization 2671 * We only need to perform additional register initialization
2671 * for WMM queues/ 2672 * for WMM queues.
2672 */ 2673 */
2673 if (queue_idx >= 4) 2674 if (queue_idx >= 4)
2674 return 0; 2675 return 0;