aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/init.c')
-rw-r--r--drivers/net/wireless/wl12xx/init.c55
1 files changed, 36 insertions, 19 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index ca7ee59e4505..203fbebf09eb 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -37,54 +37,64 @@
37int wl1271_init_templates_config(struct wl1271 *wl) 37int wl1271_init_templates_config(struct wl1271 *wl)
38{ 38{
39 int ret, i; 39 int ret, i;
40 size_t max_size;
40 41
41 /* send empty templates for fw memory reservation */ 42 /* send empty templates for fw memory reservation */
42 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, 43 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
43 WL1271_CMD_TEMPL_DFLT_SIZE, 44 CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
45 WL1271_CMD_TEMPL_MAX_SIZE,
44 0, WL1271_RATE_AUTOMATIC); 46 0, WL1271_RATE_AUTOMATIC);
45 if (ret < 0) 47 if (ret < 0)
46 return ret; 48 return ret;
47 49
48 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, 50 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
49 NULL, WL1271_CMD_TEMPL_DFLT_SIZE, 0, 51 CMD_TEMPL_CFG_PROBE_REQ_5,
52 NULL, WL1271_CMD_TEMPL_MAX_SIZE, 0,
50 WL1271_RATE_AUTOMATIC); 53 WL1271_RATE_AUTOMATIC);
51 if (ret < 0) 54 if (ret < 0)
52 return ret; 55 return ret;
53 56
54 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, 57 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
58 CMD_TEMPL_NULL_DATA, NULL,
55 sizeof(struct wl12xx_null_data_template), 59 sizeof(struct wl12xx_null_data_template),
56 0, WL1271_RATE_AUTOMATIC); 60 0, WL1271_RATE_AUTOMATIC);
57 if (ret < 0) 61 if (ret < 0)
58 return ret; 62 return ret;
59 63
60 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, 64 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
65 CMD_TEMPL_PS_POLL, NULL,
61 sizeof(struct wl12xx_ps_poll_template), 66 sizeof(struct wl12xx_ps_poll_template),
62 0, WL1271_RATE_AUTOMATIC); 67 0, WL1271_RATE_AUTOMATIC);
63 if (ret < 0) 68 if (ret < 0)
64 return ret; 69 return ret;
65 70
66 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, 71 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
72 CMD_TEMPL_QOS_NULL_DATA, NULL,
67 sizeof 73 sizeof
68 (struct ieee80211_qos_hdr), 74 (struct ieee80211_qos_hdr),
69 0, WL1271_RATE_AUTOMATIC); 75 0, WL1271_RATE_AUTOMATIC);
70 if (ret < 0) 76 if (ret < 0)
71 return ret; 77 return ret;
72 78
73 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, 79 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
80 CMD_TEMPL_PROBE_RESPONSE, NULL,
74 WL1271_CMD_TEMPL_DFLT_SIZE, 81 WL1271_CMD_TEMPL_DFLT_SIZE,
75 0, WL1271_RATE_AUTOMATIC); 82 0, WL1271_RATE_AUTOMATIC);
76 if (ret < 0) 83 if (ret < 0)
77 return ret; 84 return ret;
78 85
79 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, 86 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
87 CMD_TEMPL_BEACON, NULL,
80 WL1271_CMD_TEMPL_DFLT_SIZE, 88 WL1271_CMD_TEMPL_DFLT_SIZE,
81 0, WL1271_RATE_AUTOMATIC); 89 0, WL1271_RATE_AUTOMATIC);
82 if (ret < 0) 90 if (ret < 0)
83 return ret; 91 return ret;
84 92
85 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP, NULL, 93 max_size = sizeof(struct wl12xx_arp_rsp_template) +
86 sizeof 94 WL1271_EXTRA_SPACE_MAX;
87 (struct wl12xx_arp_rsp_template), 95 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
96 CMD_TEMPL_ARP_RSP, NULL,
97 max_size,
88 0, WL1271_RATE_AUTOMATIC); 98 0, WL1271_RATE_AUTOMATIC);
89 if (ret < 0) 99 if (ret < 0)
90 return ret; 100 return ret;
@@ -93,19 +103,22 @@ int wl1271_init_templates_config(struct wl1271 *wl)
93 * Put very large empty placeholders for all templates. These 103 * Put very large empty placeholders for all templates. These
94 * reserve memory for later. 104 * reserve memory for later.
95 */ 105 */
96 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_AP_PROBE_RESPONSE, NULL, 106 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
107 CMD_TEMPL_AP_PROBE_RESPONSE, NULL,
97 WL1271_CMD_TEMPL_MAX_SIZE, 108 WL1271_CMD_TEMPL_MAX_SIZE,
98 0, WL1271_RATE_AUTOMATIC); 109 0, WL1271_RATE_AUTOMATIC);
99 if (ret < 0) 110 if (ret < 0)
100 return ret; 111 return ret;
101 112
102 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_AP_BEACON, NULL, 113 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
114 CMD_TEMPL_AP_BEACON, NULL,
103 WL1271_CMD_TEMPL_MAX_SIZE, 115 WL1271_CMD_TEMPL_MAX_SIZE,
104 0, WL1271_RATE_AUTOMATIC); 116 0, WL1271_RATE_AUTOMATIC);
105 if (ret < 0) 117 if (ret < 0)
106 return ret; 118 return ret;
107 119
108 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_DEAUTH_AP, NULL, 120 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
121 CMD_TEMPL_DEAUTH_AP, NULL,
109 sizeof 122 sizeof
110 (struct wl12xx_disconn_template), 123 (struct wl12xx_disconn_template),
111 0, WL1271_RATE_AUTOMATIC); 124 0, WL1271_RATE_AUTOMATIC);
@@ -113,7 +126,8 @@ int wl1271_init_templates_config(struct wl1271 *wl)
113 return ret; 126 return ret;
114 127
115 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { 128 for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
116 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL, 129 ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
130 CMD_TEMPL_KLV, NULL,
117 sizeof(struct ieee80211_qos_hdr), 131 sizeof(struct ieee80211_qos_hdr),
118 i, WL1271_RATE_AUTOMATIC); 132 i, WL1271_RATE_AUTOMATIC);
119 if (ret < 0) 133 if (ret < 0)
@@ -140,7 +154,8 @@ static int wl1271_ap_init_deauth_template(struct wl1271 *wl,
140 IEEE80211_STYPE_DEAUTH); 154 IEEE80211_STYPE_DEAUTH);
141 155
142 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 156 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
143 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_DEAUTH_AP, 157 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
158 CMD_TEMPL_DEAUTH_AP,
144 tmpl, sizeof(*tmpl), 0, rate); 159 tmpl, sizeof(*tmpl), 0, rate);
145 160
146out: 161out:
@@ -172,7 +187,8 @@ static int wl1271_ap_init_null_template(struct wl1271 *wl,
172 memcpy(nullfunc->addr3, vif->addr, ETH_ALEN); 187 memcpy(nullfunc->addr3, vif->addr, ETH_ALEN);
173 188
174 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 189 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
175 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, nullfunc, 190 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
191 CMD_TEMPL_NULL_DATA, nullfunc,
176 sizeof(*nullfunc), 0, rate); 192 sizeof(*nullfunc), 0, rate);
177 193
178out: 194out:
@@ -204,7 +220,8 @@ static int wl1271_ap_init_qos_null_template(struct wl1271 *wl,
204 memcpy(qosnull->addr3, vif->addr, ETH_ALEN); 220 memcpy(qosnull->addr3, vif->addr, ETH_ALEN);
205 221
206 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set); 222 rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
207 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, qosnull, 223 ret = wl1271_cmd_template_set(wl, wlvif->role_id,
224 CMD_TEMPL_QOS_NULL_DATA, qosnull,
208 sizeof(*qosnull), 0, rate); 225 sizeof(*qosnull), 0, rate);
209 226
210out: 227out: