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/wl1251_acx.c | |
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/wl1251_acx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.c | 138 |
1 files changed, 134 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c index 10b26c4532c9..91891f928070 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.c +++ b/drivers/net/wireless/wl12xx/wl1251_acx.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "wl1251_acx.h" | 1 | #include "wl1251_acx.h" |
2 | 2 | ||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/slab.h> | ||
4 | #include <linux/crc7.h> | 5 | #include <linux/crc7.h> |
5 | 6 | ||
6 | #include "wl1251.h" | 7 | #include "wl1251.h" |
@@ -494,7 +495,7 @@ out: | |||
494 | return ret; | 495 | return ret; |
495 | } | 496 | } |
496 | 497 | ||
497 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl) | 498 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter) |
498 | { | 499 | { |
499 | struct acx_beacon_filter_option *beacon_filter; | 500 | struct acx_beacon_filter_option *beacon_filter; |
500 | int ret; | 501 | int ret; |
@@ -507,7 +508,7 @@ int wl1251_acx_beacon_filter_opt(struct wl1251 *wl) | |||
507 | goto out; | 508 | goto out; |
508 | } | 509 | } |
509 | 510 | ||
510 | beacon_filter->enable = 0; | 511 | beacon_filter->enable = enable_filter; |
511 | beacon_filter->max_num_beacons = 0; | 512 | beacon_filter->max_num_beacons = 0; |
512 | 513 | ||
513 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_OPT, | 514 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_OPT, |
@@ -525,6 +526,7 @@ out: | |||
525 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl) | 526 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl) |
526 | { | 527 | { |
527 | struct acx_beacon_filter_ie_table *ie_table; | 528 | struct acx_beacon_filter_ie_table *ie_table; |
529 | int idx = 0; | ||
528 | int ret; | 530 | int ret; |
529 | 531 | ||
530 | wl1251_debug(DEBUG_ACX, "acx beacon filter table"); | 532 | wl1251_debug(DEBUG_ACX, "acx beacon filter table"); |
@@ -535,8 +537,10 @@ int wl1251_acx_beacon_filter_table(struct wl1251 *wl) | |||
535 | goto out; | 537 | goto out; |
536 | } | 538 | } |
537 | 539 | ||
538 | ie_table->num_ie = 0; | 540 | /* configure default beacon pass-through rules */ |
539 | memset(ie_table->table, 0, BEACON_FILTER_TABLE_MAX_SIZE); | 541 | ie_table->num_ie = 1; |
542 | ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN; | ||
543 | ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE; | ||
540 | 544 | ||
541 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, | 545 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, |
542 | ie_table, sizeof(*ie_table)); | 546 | ie_table, sizeof(*ie_table)); |
@@ -550,6 +554,35 @@ out: | |||
550 | return ret; | 554 | return ret; |
551 | } | 555 | } |
552 | 556 | ||
557 | int wl1251_acx_conn_monit_params(struct wl1251 *wl) | ||
558 | { | ||
559 | struct acx_conn_monit_params *acx; | ||
560 | int ret; | ||
561 | |||
562 | wl1251_debug(DEBUG_ACX, "acx connection monitor parameters"); | ||
563 | |||
564 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
565 | if (!acx) { | ||
566 | ret = -ENOMEM; | ||
567 | goto out; | ||
568 | } | ||
569 | |||
570 | acx->synch_fail_thold = SYNCH_FAIL_DEFAULT_THRESHOLD; | ||
571 | acx->bss_lose_timeout = NO_BEACON_DEFAULT_TIMEOUT; | ||
572 | |||
573 | ret = wl1251_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, | ||
574 | acx, sizeof(*acx)); | ||
575 | if (ret < 0) { | ||
576 | wl1251_warning("failed to set connection monitor " | ||
577 | "parameters: %d", ret); | ||
578 | goto out; | ||
579 | } | ||
580 | |||
581 | out: | ||
582 | kfree(acx); | ||
583 | return ret; | ||
584 | } | ||
585 | |||
553 | int wl1251_acx_sg_enable(struct wl1251 *wl) | 586 | int wl1251_acx_sg_enable(struct wl1251 *wl) |
554 | { | 587 | { |
555 | struct acx_bt_wlan_coex *pta; | 588 | struct acx_bt_wlan_coex *pta; |
@@ -916,3 +949,100 @@ out: | |||
916 | kfree(mem_conf); | 949 | kfree(mem_conf); |
917 | return ret; | 950 | return ret; |
918 | } | 951 | } |
952 | |||
953 | int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim) | ||
954 | { | ||
955 | struct wl1251_acx_wr_tbtt_and_dtim *acx; | ||
956 | int ret; | ||
957 | |||
958 | wl1251_debug(DEBUG_ACX, "acx tbtt and dtim"); | ||
959 | |||
960 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
961 | if (!acx) { | ||
962 | ret = -ENOMEM; | ||
963 | goto out; | ||
964 | } | ||
965 | |||
966 | acx->tbtt = tbtt; | ||
967 | acx->dtim = dtim; | ||
968 | |||
969 | ret = wl1251_cmd_configure(wl, ACX_WR_TBTT_AND_DTIM, | ||
970 | acx, sizeof(*acx)); | ||
971 | if (ret < 0) { | ||
972 | wl1251_warning("failed to set tbtt and dtim: %d", ret); | ||
973 | goto out; | ||
974 | } | ||
975 | |||
976 | out: | ||
977 | kfree(acx); | ||
978 | return ret; | ||
979 | } | ||
980 | |||
981 | int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max, | ||
982 | u8 aifs, u16 txop) | ||
983 | { | ||
984 | struct wl1251_acx_ac_cfg *acx; | ||
985 | int ret = 0; | ||
986 | |||
987 | wl1251_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " | ||
988 | "aifs %d txop %d", ac, cw_min, cw_max, aifs, txop); | ||
989 | |||
990 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
991 | |||
992 | if (!acx) { | ||
993 | ret = -ENOMEM; | ||
994 | goto out; | ||
995 | } | ||
996 | |||
997 | acx->ac = ac; | ||
998 | acx->cw_min = cw_min; | ||
999 | acx->cw_max = cw_max; | ||
1000 | acx->aifsn = aifs; | ||
1001 | acx->txop_limit = txop; | ||
1002 | |||
1003 | ret = wl1251_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); | ||
1004 | if (ret < 0) { | ||
1005 | wl1251_warning("acx ac cfg failed: %d", ret); | ||
1006 | goto out; | ||
1007 | } | ||
1008 | |||
1009 | out: | ||
1010 | kfree(acx); | ||
1011 | return ret; | ||
1012 | } | ||
1013 | |||
1014 | int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue, | ||
1015 | enum wl1251_acx_channel_type type, | ||
1016 | u8 tsid, enum wl1251_acx_ps_scheme ps_scheme, | ||
1017 | enum wl1251_acx_ack_policy ack_policy) | ||
1018 | { | ||
1019 | struct wl1251_acx_tid_cfg *acx; | ||
1020 | int ret = 0; | ||
1021 | |||
1022 | wl1251_debug(DEBUG_ACX, "acx tid cfg %d type %d tsid %d " | ||
1023 | "ps_scheme %d ack_policy %d", queue, type, tsid, | ||
1024 | ps_scheme, ack_policy); | ||
1025 | |||
1026 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
1027 | |||
1028 | if (!acx) { | ||
1029 | ret = -ENOMEM; | ||
1030 | goto out; | ||
1031 | } | ||
1032 | |||
1033 | acx->queue = queue; | ||
1034 | acx->type = type; | ||
1035 | acx->tsid = tsid; | ||
1036 | acx->ps_scheme = ps_scheme; | ||
1037 | acx->ack_policy = ack_policy; | ||
1038 | |||
1039 | ret = wl1251_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx)); | ||
1040 | if (ret < 0) { | ||
1041 | wl1251_warning("acx tid cfg failed: %d", ret); | ||
1042 | goto out; | ||
1043 | } | ||
1044 | |||
1045 | out: | ||
1046 | kfree(acx); | ||
1047 | return ret; | ||
1048 | } | ||