diff options
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.h | 43 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_conf.h | 85 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 12 |
5 files changed, 110 insertions, 54 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index d19d8605b9d..63aa64618e1 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
@@ -198,7 +198,7 @@ int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map, | |||
198 | return 0; | 198 | return 0; |
199 | } | 199 | } |
200 | 200 | ||
201 | int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl, u32 life_time) | 201 | int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl) |
202 | { | 202 | { |
203 | struct acx_rx_msdu_lifetime *acx; | 203 | struct acx_rx_msdu_lifetime *acx; |
204 | int ret; | 204 | int ret; |
@@ -211,7 +211,7 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl, u32 life_time) | |||
211 | goto out; | 211 | goto out; |
212 | } | 212 | } |
213 | 213 | ||
214 | acx->lifetime = life_time; | 214 | acx->lifetime = wl->conf.rx.rx_msdu_life_time; |
215 | ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME, | 215 | ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME, |
216 | acx, sizeof(*acx)); | 216 | acx, sizeof(*acx)); |
217 | if (ret < 0) { | 217 | if (ret < 0) { |
@@ -265,7 +265,7 @@ int wl1271_acx_pd_threshold(struct wl1271 *wl) | |||
265 | goto out; | 265 | goto out; |
266 | } | 266 | } |
267 | 267 | ||
268 | /* FIXME: threshold value not set */ | 268 | pd->threshold = wl->conf.rx.packet_detection_threshold; |
269 | 269 | ||
270 | ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd)); | 270 | ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd)); |
271 | if (ret < 0) { | 271 | if (ret < 0) { |
@@ -349,8 +349,8 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl) | |||
349 | 349 | ||
350 | wl1271_debug(DEBUG_ACX, "acx service period timeout"); | 350 | wl1271_debug(DEBUG_ACX, "acx service period timeout"); |
351 | 351 | ||
352 | rx_timeout->ps_poll_timeout = RX_TIMEOUT_PS_POLL_DEF; | 352 | rx_timeout->ps_poll_timeout = wl->conf.rx.ps_poll_timeout; |
353 | rx_timeout->upsd_timeout = RX_TIMEOUT_UPSD_DEF; | 353 | rx_timeout->upsd_timeout = wl->conf.rx.upsd_timeout; |
354 | 354 | ||
355 | ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT, | 355 | ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT, |
356 | rx_timeout, sizeof(*rx_timeout)); | 356 | rx_timeout, sizeof(*rx_timeout)); |
@@ -557,7 +557,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl) | |||
557 | goto out; | 557 | goto out; |
558 | } | 558 | } |
559 | 559 | ||
560 | detection->rx_cca_threshold = CCA_THRSH_DISABLE_ENERGY_D; | 560 | detection->rx_cca_threshold = wl->conf.rx.rx_cca_threshold; |
561 | detection->tx_energy_detection = 0; | 561 | detection->tx_energy_detection = 0; |
562 | 562 | ||
563 | ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD, | 563 | ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD, |
@@ -966,10 +966,10 @@ int wl1271_acx_init_rx_interrupt(struct wl1271 *wl) | |||
966 | goto out; | 966 | goto out; |
967 | } | 967 | } |
968 | 968 | ||
969 | rx_conf->threshold = WL1271_RX_INTR_THRESHOLD_DEF; | 969 | rx_conf->threshold = wl->conf.rx.irq_pkt_threshold; |
970 | rx_conf->timeout = WL1271_RX_INTR_TIMEOUT_DEF; | 970 | rx_conf->timeout = wl->conf.rx.irq_timeout; |
971 | rx_conf->mblk_threshold = USHORT_MAX; /* Disabled */ | 971 | rx_conf->mblk_threshold = wl->conf.rx.irq_blk_threshold; |
972 | rx_conf->queue_type = RX_QUEUE_TYPE_RX_LOW_PRIORITY; | 972 | rx_conf->queue_type = wl->conf.rx.queue_type; |
973 | 973 | ||
974 | ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf, | 974 | ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf, |
975 | sizeof(*rx_conf)); | 975 | sizeof(*rx_conf)); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h index 8e3b97cff79..1fbd4e5fcc4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h | |||
@@ -314,35 +314,13 @@ struct acx_dot11_grp_addr_tbl { | |||
314 | u8 mac_table[ADDRESS_GROUP_MAX_LEN]; | 314 | u8 mac_table[ADDRESS_GROUP_MAX_LEN]; |
315 | } __attribute__ ((packed)); | 315 | } __attribute__ ((packed)); |
316 | 316 | ||
317 | #define RX_TIMEOUT_PS_POLL_MIN 0 | ||
318 | #define RX_TIMEOUT_PS_POLL_MAX (200000) | ||
319 | #define RX_TIMEOUT_PS_POLL_DEF (15) | ||
320 | #define RX_TIMEOUT_UPSD_MIN 0 | ||
321 | #define RX_TIMEOUT_UPSD_MAX (200000) | ||
322 | #define RX_TIMEOUT_UPSD_DEF (15) | ||
323 | |||
324 | struct acx_rx_timeout { | 317 | struct acx_rx_timeout { |
325 | struct acx_header header; | 318 | struct acx_header header; |
326 | 319 | ||
327 | /* | ||
328 | * The longest time the STA will wait to receive | ||
329 | * traffic from the AP after a PS-poll has been | ||
330 | * transmitted. | ||
331 | */ | ||
332 | u16 ps_poll_timeout; | 320 | u16 ps_poll_timeout; |
333 | |||
334 | /* | ||
335 | * The longest time the STA will wait to receive | ||
336 | * traffic from the AP after a frame has been sent | ||
337 | * from an UPSD enabled queue. | ||
338 | */ | ||
339 | u16 upsd_timeout; | 321 | u16 upsd_timeout; |
340 | } __attribute__ ((packed)); | 322 | } __attribute__ ((packed)); |
341 | 323 | ||
342 | #define RTS_THRESHOLD_MIN 0 | ||
343 | #define RTS_THRESHOLD_MAX 4096 | ||
344 | #define RTS_THRESHOLD_DEF 2347 | ||
345 | |||
346 | struct acx_rts_threshold { | 324 | struct acx_rts_threshold { |
347 | struct acx_header header; | 325 | struct acx_header header; |
348 | 326 | ||
@@ -510,9 +488,6 @@ struct acx_bt_wlan_coex_param { | |||
510 | u8 padding[3]; | 488 | u8 padding[3]; |
511 | } __attribute__ ((packed)); | 489 | } __attribute__ ((packed)); |
512 | 490 | ||
513 | #define CCA_THRSH_ENABLE_ENERGY_D 0x140A | ||
514 | #define CCA_THRSH_DISABLE_ENERGY_D 0xFFEF | ||
515 | |||
516 | struct acx_energy_detection { | 491 | struct acx_energy_detection { |
517 | struct acx_header header; | 492 | struct acx_header header; |
518 | 493 | ||
@@ -1017,22 +992,6 @@ struct wl1271_acx_mem_map { | |||
1017 | void *tx_ctrl; | 992 | void *tx_ctrl; |
1018 | } __attribute__ ((packed)); | 993 | } __attribute__ ((packed)); |
1019 | 994 | ||
1020 | enum wl1271_acx_rx_queue_type { | ||
1021 | RX_QUEUE_TYPE_RX_LOW_PRIORITY, /* All except the high priority */ | ||
1022 | RX_QUEUE_TYPE_RX_HIGH_PRIORITY, /* Management and voice packets */ | ||
1023 | RX_QUEUE_TYPE_NUM, | ||
1024 | RX_QUEUE_TYPE_MAX = USHORT_MAX | ||
1025 | }; | ||
1026 | |||
1027 | #define WL1271_RX_INTR_THRESHOLD_DEF 0 /* no pacing, send interrupt on | ||
1028 | * every event */ | ||
1029 | #define WL1271_RX_INTR_THRESHOLD_MIN 0 | ||
1030 | #define WL1271_RX_INTR_THRESHOLD_MAX 15 | ||
1031 | |||
1032 | #define WL1271_RX_INTR_TIMEOUT_DEF 5 | ||
1033 | #define WL1271_RX_INTR_TIMEOUT_MIN 1 | ||
1034 | #define WL1271_RX_INTR_TIMEOUT_MAX 100 | ||
1035 | |||
1036 | struct wl1271_acx_rx_config_opt { | 995 | struct wl1271_acx_rx_config_opt { |
1037 | struct acx_header header; | 996 | struct acx_header header; |
1038 | 997 | ||
@@ -1122,7 +1081,7 @@ int wl1271_acx_tx_power(struct wl1271 *wl, int power); | |||
1122 | int wl1271_acx_feature_cfg(struct wl1271 *wl); | 1081 | int wl1271_acx_feature_cfg(struct wl1271 *wl); |
1123 | int wl1271_acx_mem_map(struct wl1271 *wl, | 1082 | int wl1271_acx_mem_map(struct wl1271 *wl, |
1124 | struct acx_header *mem_map, size_t len); | 1083 | struct acx_header *mem_map, size_t len); |
1125 | int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl, u32 life_time); | 1084 | int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl); |
1126 | int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter); | 1085 | int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter); |
1127 | int wl1271_acx_pd_threshold(struct wl1271 *wl); | 1086 | int wl1271_acx_pd_threshold(struct wl1271 *wl); |
1128 | int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time); | 1087 | int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h index 1d6a44bec1c..8bf8bff54b5 100644 --- a/drivers/net/wireless/wl12xx/wl1271_conf.h +++ b/drivers/net/wireless/wl12xx/wl1271_conf.h | |||
@@ -171,8 +171,93 @@ struct conf_sg_settings { | |||
171 | s8 rate_adaptation_snr; | 171 | s8 rate_adaptation_snr; |
172 | }; | 172 | }; |
173 | 173 | ||
174 | enum conf_rx_queue_type { | ||
175 | CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */ | ||
176 | CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */ | ||
177 | }; | ||
178 | |||
179 | struct conf_rx_settings { | ||
180 | /* | ||
181 | * The maximum amount of time, in TU, before the | ||
182 | * firmware discards the MSDU. | ||
183 | * | ||
184 | * Range: 0 - 0xFFFFFFFF | ||
185 | */ | ||
186 | u32 rx_msdu_life_time; | ||
187 | |||
188 | /* | ||
189 | * Packet detection threshold in the PHY. | ||
190 | * | ||
191 | * FIXME: details unknown. | ||
192 | */ | ||
193 | u32 packet_detection_threshold; | ||
194 | |||
195 | /* | ||
196 | * The longest time the STA will wait to receive traffic from the AP | ||
197 | * after a PS-poll has been transmitted. | ||
198 | * | ||
199 | * Range: 0 - 200000 | ||
200 | */ | ||
201 | u16 ps_poll_timeout; | ||
202 | /* | ||
203 | * The longest time the STA will wait to receive traffic from the AP | ||
204 | * after a frame has been sent from an UPSD enabled queue. | ||
205 | * | ||
206 | * Range: 0 - 200000 | ||
207 | */ | ||
208 | u16 upsd_timeout; | ||
209 | |||
210 | /* | ||
211 | * The number of octets in an MPDU, below which an RTS/CTS | ||
212 | * handshake is not performed. | ||
213 | * | ||
214 | * Range: 0 - 4096 | ||
215 | */ | ||
216 | u16 rts_threshold; | ||
217 | |||
218 | /* | ||
219 | * The RX Clear Channel Assessment threshold in the PHY | ||
220 | * (the energy threshold). | ||
221 | * | ||
222 | * Range: ENABLE_ENERGY_D == 0x140A | ||
223 | * DISABLE_ENERGY_D == 0xFFEF | ||
224 | */ | ||
225 | u16 rx_cca_threshold; | ||
226 | |||
227 | /* | ||
228 | * Occupied Rx mem-blocks number which requires interrupting the host | ||
229 | * (0 = no buffering, 0xffff = disabled). | ||
230 | * | ||
231 | * Range: u16 | ||
232 | */ | ||
233 | u16 irq_blk_threshold; | ||
234 | |||
235 | /* | ||
236 | * Rx packets number which requires interrupting the host | ||
237 | * (0 = no buffering). | ||
238 | * | ||
239 | * Range: u16 | ||
240 | */ | ||
241 | u16 irq_pkt_threshold; | ||
242 | |||
243 | /* | ||
244 | * Max time in msec the FW may delay RX-Complete interrupt. | ||
245 | * | ||
246 | * Range: 1 - 100 | ||
247 | */ | ||
248 | u16 irq_timeout; | ||
249 | |||
250 | /* | ||
251 | * The RX queue type. | ||
252 | * | ||
253 | * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY, | ||
254 | */ | ||
255 | u8 queue_type; | ||
256 | }; | ||
257 | |||
174 | struct conf_drv_settings { | 258 | struct conf_drv_settings { |
175 | struct conf_sg_settings sg; | 259 | struct conf_sg_settings sg; |
260 | struct conf_rx_settings rx; | ||
176 | }; | 261 | }; |
177 | 262 | ||
178 | #endif | 263 | #endif |
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 9abe062f187..57382631c1a 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -94,7 +94,7 @@ static int wl1271_init_rx_config(struct wl1271 *wl, u32 config, u32 filter) | |||
94 | { | 94 | { |
95 | int ret; | 95 | int ret; |
96 | 96 | ||
97 | ret = wl1271_acx_rx_msdu_life_time(wl, RX_MSDU_LIFETIME_DEF); | 97 | ret = wl1271_acx_rx_msdu_life_time(wl); |
98 | if (ret < 0) | 98 | if (ret < 0) |
99 | return ret; | 99 | return ret; |
100 | 100 | ||
@@ -125,7 +125,7 @@ static int wl1271_init_phy_config(struct wl1271 *wl) | |||
125 | if (ret < 0) | 125 | if (ret < 0) |
126 | return ret; | 126 | return ret; |
127 | 127 | ||
128 | ret = wl1271_acx_rts_threshold(wl, RTS_THRESHOLD_DEF); | 128 | ret = wl1271_acx_rts_threshold(wl, wl->conf.rx.rts_threshold); |
129 | if (ret < 0) | 129 | if (ret < 0) |
130 | return ret; | 130 | return ret; |
131 | 131 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 69bc929e185..d04706de7f4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -61,6 +61,18 @@ static void wl1271_conf_init(struct wl1271 *wl) | |||
61 | .beacon_miss_threshold = 60, | 61 | .beacon_miss_threshold = 60, |
62 | .rate_adaptation_threshold = CONF_HW_BIT_RATE_12MBPS, | 62 | .rate_adaptation_threshold = CONF_HW_BIT_RATE_12MBPS, |
63 | .rate_adaptation_snr = 0 | 63 | .rate_adaptation_snr = 0 |
64 | }, | ||
65 | .rx = { | ||
66 | .rx_msdu_life_time = 512000, | ||
67 | .packet_detection_threshold = 0, | ||
68 | .ps_poll_timeout = 15, | ||
69 | .upsd_timeout = 15, | ||
70 | .rts_threshold = 2347, | ||
71 | .rx_cca_threshold = 0xFFEF, | ||
72 | .irq_blk_threshold = 0, | ||
73 | .irq_pkt_threshold = USHORT_MAX, | ||
74 | .irq_timeout = 5, | ||
75 | .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY, | ||
64 | } | 76 | } |
65 | }; | 77 | }; |
66 | 78 | ||