diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wireless/wl12xx/wl1271_tx.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_tx.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.h | 54 |
1 files changed, 45 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h index 4a614067ddba..17e405a09caa 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.h +++ b/drivers/net/wireless/wl12xx/wl1271_tx.h | |||
@@ -58,7 +58,7 @@ | |||
58 | 58 | ||
59 | struct wl1271_tx_hw_descr { | 59 | struct wl1271_tx_hw_descr { |
60 | /* Length of packet in words, including descriptor+header+data */ | 60 | /* Length of packet in words, including descriptor+header+data */ |
61 | u16 length; | 61 | __le16 length; |
62 | /* Number of extra memory blocks to allocate for this packet in | 62 | /* Number of extra memory blocks to allocate for this packet in |
63 | addition to the number of blocks derived from the packet length */ | 63 | addition to the number of blocks derived from the packet length */ |
64 | u8 extra_mem_blocks; | 64 | u8 extra_mem_blocks; |
@@ -67,12 +67,12 @@ struct wl1271_tx_hw_descr { | |||
67 | HW!! */ | 67 | HW!! */ |
68 | u8 total_mem_blocks; | 68 | u8 total_mem_blocks; |
69 | /* Device time (in us) when the packet arrived to the driver */ | 69 | /* Device time (in us) when the packet arrived to the driver */ |
70 | u32 start_time; | 70 | __le32 start_time; |
71 | /* Max delay in TUs until transmission. The last device time the | 71 | /* Max delay in TUs until transmission. The last device time the |
72 | packet can be transmitted is: startTime+(1024*LifeTime) */ | 72 | packet can be transmitted is: startTime+(1024*LifeTime) */ |
73 | u16 life_time; | 73 | __le16 life_time; |
74 | /* Bitwise fields - see TX_ATTR... definitions above. */ | 74 | /* Bitwise fields - see TX_ATTR... definitions above. */ |
75 | u16 tx_attr; | 75 | __le16 tx_attr; |
76 | /* Packet identifier used also in the Tx-Result. */ | 76 | /* Packet identifier used also in the Tx-Result. */ |
77 | u8 id; | 77 | u8 id; |
78 | /* The packet TID value (as User-Priority) */ | 78 | /* The packet TID value (as User-Priority) */ |
@@ -100,12 +100,12 @@ struct wl1271_tx_hw_res_descr { | |||
100 | several possible reasons for failure. */ | 100 | several possible reasons for failure. */ |
101 | u8 status; | 101 | u8 status; |
102 | /* Total air access duration including all retrys and overheads.*/ | 102 | /* Total air access duration including all retrys and overheads.*/ |
103 | u16 medium_usage; | 103 | __le16 medium_usage; |
104 | /* The time passed from host xfer to Tx-complete.*/ | 104 | /* The time passed from host xfer to Tx-complete.*/ |
105 | u32 fw_handling_time; | 105 | __le32 fw_handling_time; |
106 | /* Total media delay | 106 | /* Total media delay |
107 | (from 1st EDCA AIFS counter until TX Complete). */ | 107 | (from 1st EDCA AIFS counter until TX Complete). */ |
108 | u32 medium_delay; | 108 | __le32 medium_delay; |
109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ | 109 | /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ |
110 | u8 lsb_security_sequence_number; | 110 | u8 lsb_security_sequence_number; |
111 | /* Retry count - number of transmissions without successful ACK.*/ | 111 | /* Retry count - number of transmissions without successful ACK.*/ |
@@ -118,11 +118,47 @@ struct wl1271_tx_hw_res_descr { | |||
118 | } __attribute__ ((packed)); | 118 | } __attribute__ ((packed)); |
119 | 119 | ||
120 | struct wl1271_tx_hw_res_if { | 120 | struct wl1271_tx_hw_res_if { |
121 | u32 tx_result_fw_counter; | 121 | __le32 tx_result_fw_counter; |
122 | u32 tx_result_host_counter; | 122 | __le32 tx_result_host_counter; |
123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; | 123 | struct wl1271_tx_hw_res_descr tx_results_queue[TX_HW_RESULT_QUEUE_LEN]; |
124 | } __attribute__ ((packed)); | 124 | } __attribute__ ((packed)); |
125 | 125 | ||
126 | static inline int wl1271_tx_get_queue(int queue) | ||
127 | { | ||
128 | /* FIXME: use best effort until WMM is enabled */ | ||
129 | return CONF_TX_AC_BE; | ||
130 | |||
131 | switch (queue) { | ||
132 | case 0: | ||
133 | return CONF_TX_AC_VO; | ||
134 | case 1: | ||
135 | return CONF_TX_AC_VI; | ||
136 | case 2: | ||
137 | return CONF_TX_AC_BE; | ||
138 | case 3: | ||
139 | return CONF_TX_AC_BK; | ||
140 | default: | ||
141 | return CONF_TX_AC_BE; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | /* wl1271 tx descriptor needs the tid and we need to convert it from ac */ | ||
146 | static inline int wl1271_tx_ac_to_tid(int ac) | ||
147 | { | ||
148 | switch (ac) { | ||
149 | case 0: | ||
150 | return 0; | ||
151 | case 1: | ||
152 | return 2; | ||
153 | case 2: | ||
154 | return 4; | ||
155 | case 3: | ||
156 | return 6; | ||
157 | default: | ||
158 | return 0; | ||
159 | } | ||
160 | } | ||
161 | |||
126 | void wl1271_tx_work(struct work_struct *work); | 162 | void wl1271_tx_work(struct work_struct *work); |
127 | void wl1271_tx_complete(struct wl1271 *wl, u32 count); | 163 | void wl1271_tx_complete(struct wl1271 *wl, u32 count); |
128 | void wl1271_tx_flush(struct wl1271 *wl); | 164 | void wl1271_tx_flush(struct wl1271 *wl); |