aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-04-01 04:38:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-06 16:55:13 -0400
commit606c1487ac894798121bc2c64d27c1953c5a6210 (patch)
tree9b45dc3b6f06a6c7216ff30fad316fa4c5fcee88 /drivers
parentebba60c66b3aa321a84c9a90a343c91fde972066 (diff)
wl1271: Configure rates for templates
Configure meaningful rates to be used with the templates. For control frames, use the determined basic rates (currently the lowest rate for the band) and for data-frames (null-funcs) let the firmware use the current rate policy to determine the rate. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c21
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.h4
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c18
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c6
4 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 5cee59fb8c5e..b19090334bc0 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -700,7 +700,7 @@ out:
700} 700}
701 701
702int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 702int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
703 void *buf, size_t buf_len, int index) 703 void *buf, size_t buf_len, int index, u32 rates)
704{ 704{
705 struct wl1271_cmd_template_set *cmd; 705 struct wl1271_cmd_template_set *cmd;
706 int ret = 0; 706 int ret = 0;
@@ -718,7 +718,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
718 718
719 cmd->len = cpu_to_le16(buf_len); 719 cmd->len = cpu_to_le16(buf_len);
720 cmd->template_type = template_id; 720 cmd->template_type = template_id;
721 cmd->enabled_rates = cpu_to_le32(wl->conf.tx.rc_conf.enabled_rates); 721 cmd->enabled_rates = cpu_to_le32(rates);
722 cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit; 722 cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit;
723 cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit; 723 cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit;
724 cmd->index = index; 724 cmd->index = index;
@@ -758,7 +758,8 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)
758 ptr = skb->data; 758 ptr = skb->data;
759 } 759 }
760 760
761 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0); 761 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0,
762 WL1271_RATE_AUTOMATIC);
762 763
763out: 764out:
764 dev_kfree_skb(skb); 765 dev_kfree_skb(skb);
@@ -780,7 +781,8 @@ int wl1271_cmd_build_klv_null_data(struct wl1271 *wl)
780 781
781 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, 782 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV,
782 skb->data, skb->len, 783 skb->data, skb->len,
783 CMD_TEMPL_KLV_IDX_NULL_DATA); 784 CMD_TEMPL_KLV_IDX_NULL_DATA,
785 WL1271_RATE_AUTOMATIC);
784 786
785out: 787out:
786 dev_kfree_skb(skb); 788 dev_kfree_skb(skb);
@@ -801,7 +803,7 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid)
801 goto out; 803 goto out;
802 804
803 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data, 805 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, skb->data,
804 skb->len, 0); 806 skb->len, 0, wl->basic_rate);
805 807
806out: 808out:
807 dev_kfree_skb(skb); 809 dev_kfree_skb(skb);
@@ -826,10 +828,12 @@ int wl1271_cmd_build_probe_req(struct wl1271 *wl,
826 828
827 if (band == IEEE80211_BAND_2GHZ) 829 if (band == IEEE80211_BAND_2GHZ)
828 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, 830 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
829 skb->data, skb->len, 0); 831 skb->data, skb->len, 0,
832 wl->conf.tx.basic_rate);
830 else 833 else
831 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 834 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
832 skb->data, skb->len, 0); 835 skb->data, skb->len, 0,
836 wl->conf.tx.basic_rate_5);
833 837
834out: 838out:
835 dev_kfree_skb(skb); 839 dev_kfree_skb(skb);
@@ -854,7 +858,8 @@ int wl1271_build_qos_null_data(struct wl1271 *wl)
854 template.qos_ctrl = cpu_to_le16(0); 858 template.qos_ctrl = cpu_to_le16(0);
855 859
856 return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template, 860 return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template,
857 sizeof(template), 0); 861 sizeof(template), 0,
862 WL1271_RATE_AUTOMATIC);
858} 863}
859 864
860int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id) 865int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id)
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index d61f3394253f..00f78b7aa384 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -45,7 +45,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
45 const u8 *ie, size_t ie_len, u8 active_scan, 45 const u8 *ie, size_t ie_len, u8 active_scan,
46 u8 high_prio, u8 band, u8 probe_requests); 46 u8 high_prio, u8 band, u8 probe_requests);
47int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 47int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
48 void *buf, size_t buf_len, int index); 48 void *buf, size_t buf_len, int index, u32 rates);
49int wl1271_cmd_build_null_data(struct wl1271 *wl); 49int wl1271_cmd_build_null_data(struct wl1271 *wl);
50int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); 50int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
51int wl1271_cmd_build_probe_req(struct wl1271 *wl, 51int wl1271_cmd_build_probe_req(struct wl1271 *wl,
@@ -252,6 +252,8 @@ struct cmd_enabledisable_path {
252 u8 padding[3]; 252 u8 padding[3];
253} __attribute__ ((packed)); 253} __attribute__ ((packed));
254 254
255#define WL1271_RATE_AUTOMATIC 0
256
255struct wl1271_cmd_template_set { 257struct wl1271_cmd_template_set {
256 struct wl1271_cmd_header header; 258 struct wl1271_cmd_header header;
257 259
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index 8ec94ac84093..9ab336829044 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -56,54 +56,56 @@ int wl1271_init_templates_config(struct wl1271 *wl)
56 /* send empty templates for fw memory reservation */ 56 /* send empty templates for fw memory reservation */
57 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, 57 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
58 sizeof(struct wl12xx_probe_req_template), 58 sizeof(struct wl12xx_probe_req_template),
59 0); 59 0, WL1271_RATE_AUTOMATIC);
60 if (ret < 0) 60 if (ret < 0)
61 return ret; 61 return ret;
62 62
63 if (wl1271_11a_enabled()) { 63 if (wl1271_11a_enabled()) {
64 size_t size = sizeof(struct wl12xx_probe_req_template); 64 size_t size = sizeof(struct wl12xx_probe_req_template);
65 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 65 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
66 NULL, size, 0); 66 NULL, size, 0,
67 WL1271_RATE_AUTOMATIC);
67 if (ret < 0) 68 if (ret < 0)
68 return ret; 69 return ret;
69 } 70 }
70 71
71 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, 72 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL,
72 sizeof(struct wl12xx_null_data_template), 73 sizeof(struct wl12xx_null_data_template),
73 0); 74 0, WL1271_RATE_AUTOMATIC);
74 if (ret < 0) 75 if (ret < 0)
75 return ret; 76 return ret;
76 77
77 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, 78 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL,
78 sizeof(struct wl12xx_ps_poll_template), 79 sizeof(struct wl12xx_ps_poll_template),
79 0); 80 0, WL1271_RATE_AUTOMATIC);
80 if (ret < 0) 81 if (ret < 0)
81 return ret; 82 return ret;
82 83
83 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, 84 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL,
84 sizeof 85 sizeof
85 (struct wl12xx_qos_null_data_template), 86 (struct wl12xx_qos_null_data_template),
86 0); 87 0, WL1271_RATE_AUTOMATIC);
87 if (ret < 0) 88 if (ret < 0)
88 return ret; 89 return ret;
89 90
90 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, 91 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL,
91 sizeof 92 sizeof
92 (struct wl12xx_probe_resp_template), 93 (struct wl12xx_probe_resp_template),
93 0); 94 0, WL1271_RATE_AUTOMATIC);
94 if (ret < 0) 95 if (ret < 0)
95 return ret; 96 return ret;
96 97
97 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, 98 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL,
98 sizeof 99 sizeof
99 (struct wl12xx_beacon_template), 100 (struct wl12xx_beacon_template),
100 0); 101 0, WL1271_RATE_AUTOMATIC);
101 if (ret < 0) 102 if (ret < 0)
102 return ret; 103 return ret;
103 104
104 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { 105 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
105 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL, 106 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL,
106 WL1271_CMD_TEMPL_MAX_SIZE, i); 107 WL1271_CMD_TEMPL_MAX_SIZE, i,
108 WL1271_RATE_AUTOMATIC);
107 if (ret < 0) 109 if (ret < 0)
108 return ret; 110 return ret;
109 } 111 }
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index ca5cd325fac7..247f4079832e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1642,7 +1642,8 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1642 wl1271_ssid_set(wl, beacon); 1642 wl1271_ssid_set(wl, beacon);
1643 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, 1643 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON,
1644 beacon->data, 1644 beacon->data,
1645 beacon->len, 0); 1645 beacon->len, 0,
1646 wl1271_min_rate_get(wl));
1646 1647
1647 if (ret < 0) { 1648 if (ret < 0) {
1648 dev_kfree_skb(beacon); 1649 dev_kfree_skb(beacon);
@@ -1657,7 +1658,8 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1657 ret = wl1271_cmd_template_set(wl, 1658 ret = wl1271_cmd_template_set(wl,
1658 CMD_TEMPL_PROBE_RESPONSE, 1659 CMD_TEMPL_PROBE_RESPONSE,
1659 beacon->data, 1660 beacon->data,
1660 beacon->len, 0); 1661 beacon->len, 0,
1662 wl1271_min_rate_get(wl));
1661 dev_kfree_skb(beacon); 1663 dev_kfree_skb(beacon);
1662 if (ret < 0) 1664 if (ret < 0)
1663 goto out_sleep; 1665 goto out_sleep;