diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-21 20:05:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 20:05:11 -0500 |
commit | 6c0bce37ffc8f000a516fadf6dee84579c4c8f9b (patch) | |
tree | 273af34d6f777b1ecb0fce7b2685e868064e6cf9 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | e243455d345ef62751723671bc2605a2f6032ceb (diff) | |
parent | a1eb5fe319beb9e181aa52c8adf75ad9aab56a89 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 57 |
1 files changed, 23 insertions, 34 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index f85eedbbad68..fee61bee1e7e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -92,6 +92,16 @@ | |||
92 | DEBUG_PRINTK(__dev, KERN_DEBUG, "EEPROM recovery", __msg, ##__args) | 92 | DEBUG_PRINTK(__dev, KERN_DEBUG, "EEPROM recovery", __msg, ##__args) |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * Duration calculations | ||
96 | * The rate variable passed is: 100kbs. | ||
97 | * To convert from bytes to bits we multiply size with 8, | ||
98 | * then the size is multiplied with 10 to make the | ||
99 | * real rate -> rate argument correction. | ||
100 | */ | ||
101 | #define GET_DURATION(__size, __rate) (((__size) * 8 * 10) / (__rate)) | ||
102 | #define GET_DURATION_RES(__size, __rate)(((__size) * 8 * 10) % (__rate)) | ||
103 | |||
104 | /* | ||
95 | * Standard timing and size defines. | 105 | * Standard timing and size defines. |
96 | * These values should follow the ieee80211 specifications. | 106 | * These values should follow the ieee80211 specifications. |
97 | */ | 107 | */ |
@@ -109,9 +119,9 @@ | |||
109 | #define DIFS ( PIFS + SLOT_TIME ) | 119 | #define DIFS ( PIFS + SLOT_TIME ) |
110 | #define SHORT_DIFS ( SHORT_PIFS + SHORT_SLOT_TIME ) | 120 | #define SHORT_DIFS ( SHORT_PIFS + SHORT_SLOT_TIME ) |
111 | #define EIFS ( SIFS + DIFS + \ | 121 | #define EIFS ( SIFS + DIFS + \ |
112 | (8 * (IEEE80211_HEADER + ACK_SIZE)) ) | 122 | GET_DURATION(IEEE80211_HEADER + ACK_SIZE, 10) ) |
113 | #define SHORT_EIFS ( SIFS + SHORT_DIFS + \ | 123 | #define SHORT_EIFS ( SIFS + SHORT_DIFS + \ |
114 | (8 * (IEEE80211_HEADER + ACK_SIZE)) ) | 124 | GET_DURATION(IEEE80211_HEADER + ACK_SIZE, 10) ) |
115 | 125 | ||
116 | /* | 126 | /* |
117 | * Chipset identification | 127 | * Chipset identification |
@@ -523,10 +533,8 @@ struct rt2x00lib_ops { | |||
523 | /* | 533 | /* |
524 | * queue initialization handlers | 534 | * queue initialization handlers |
525 | */ | 535 | */ |
526 | void (*init_rxentry) (struct rt2x00_dev *rt2x00dev, | 536 | bool (*get_entry_state) (struct queue_entry *entry); |
527 | struct queue_entry *entry); | 537 | void (*clear_entry) (struct queue_entry *entry); |
528 | void (*init_txentry) (struct rt2x00_dev *rt2x00dev, | ||
529 | struct queue_entry *entry); | ||
530 | 538 | ||
531 | /* | 539 | /* |
532 | * Radio control handlers. | 540 | * Radio control handlers. |
@@ -723,8 +731,7 @@ struct rt2x00_dev { | |||
723 | 731 | ||
724 | /* | 732 | /* |
725 | * This is the default TX/RX antenna setup as indicated | 733 | * This is the default TX/RX antenna setup as indicated |
726 | * by the device's EEPROM. When mac80211 sets its | 734 | * by the device's EEPROM. |
727 | * antenna value to 0 we should be using these values. | ||
728 | */ | 735 | */ |
729 | struct antenna_setup default_ant; | 736 | struct antenna_setup default_ant; |
730 | 737 | ||
@@ -739,16 +746,15 @@ struct rt2x00_dev { | |||
739 | } csr; | 746 | } csr; |
740 | 747 | ||
741 | /* | 748 | /* |
742 | * Mutex to protect register accesses on USB devices. | 749 | * Mutex to protect register accesses. |
743 | * There are 2 reasons this is needed, one is to ensure | 750 | * For PCI and USB devices it protects against concurrent indirect |
744 | * use of the csr_cache (for USB devices) by one thread | 751 | * register access (BBP, RF, MCU) since accessing those |
745 | * isn't corrupted by another thread trying to access it. | 752 | * registers require multiple calls to the CSR registers. |
746 | * The other is that access to BBP and RF registers | 753 | * For USB devices it also protects the csr_cache since that |
747 | * require multiple BUS transactions and if another thread | 754 | * field is used for normal CSR access and it cannot support |
748 | * attempted to access one of those registers at the same | 755 | * multiple callers simultaneously. |
749 | * time one of the writes could silently fail. | ||
750 | */ | 756 | */ |
751 | struct mutex usb_cache_mutex; | 757 | struct mutex csr_mutex; |
752 | 758 | ||
753 | /* | 759 | /* |
754 | * Current packet filter configuration for the device. | 760 | * Current packet filter configuration for the device. |
@@ -923,23 +929,6 @@ static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset, | |||
923 | !!(chipset->rev & 0x0000f)); | 929 | !!(chipset->rev & 0x0000f)); |
924 | } | 930 | } |
925 | 931 | ||
926 | /* | ||
927 | * Duration calculations | ||
928 | * The rate variable passed is: 100kbs. | ||
929 | * To convert from bytes to bits we multiply size with 8, | ||
930 | * then the size is multiplied with 10 to make the | ||
931 | * real rate -> rate argument correction. | ||
932 | */ | ||
933 | static inline u16 get_duration(const unsigned int size, const u8 rate) | ||
934 | { | ||
935 | return ((size * 8 * 10) / rate); | ||
936 | } | ||
937 | |||
938 | static inline u16 get_duration_res(const unsigned int size, const u8 rate) | ||
939 | { | ||
940 | return ((size * 8 * 10) % rate); | ||
941 | } | ||
942 | |||
943 | /** | 932 | /** |
944 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. | 933 | * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. |
945 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 934 | * @rt2x00dev: Pointer to &struct rt2x00_dev. |