diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-03-26 06:53:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:39:16 -0400 |
commit | bfb24c9e16921f0e57fcec5180ffa20929832545 (patch) | |
tree | efe695fedc1c879524ba3948bf65bb97b26cfdfa /drivers/net/wireless/wl12xx/wl1271_init.c | |
parent | a9af092b524614dd3fc7b52bde7c87f8b82cd2a6 (diff) |
wl1271: Add keep-alive frame template support
Add support for keep-alive templates, which are indexed.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_init.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 987978c3bce0..0106663bc45b 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -51,50 +51,63 @@ static int wl1271_init_hwenc_config(struct wl1271 *wl) | |||
51 | 51 | ||
52 | int wl1271_init_templates_config(struct wl1271 *wl) | 52 | int wl1271_init_templates_config(struct wl1271 *wl) |
53 | { | 53 | { |
54 | int ret; | 54 | int ret, i; |
55 | 55 | ||
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 | if (ret < 0) | 60 | if (ret < 0) |
60 | return ret; | 61 | return ret; |
61 | 62 | ||
62 | if (wl1271_11a_enabled()) { | 63 | if (wl1271_11a_enabled()) { |
64 | size_t size = sizeof(struct wl12xx_probe_req_template); | ||
63 | 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, |
64 | NULL, | 66 | NULL, size, 0); |
65 | sizeof(struct wl12xx_probe_req_template)); | ||
66 | if (ret < 0) | 67 | if (ret < 0) |
67 | return ret; | 68 | return ret; |
68 | } | 69 | } |
69 | 70 | ||
70 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, | 71 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, |
71 | sizeof(struct wl12xx_null_data_template)); | 72 | sizeof(struct wl12xx_null_data_template), |
73 | 0); | ||
72 | if (ret < 0) | 74 | if (ret < 0) |
73 | return ret; | 75 | return ret; |
74 | 76 | ||
75 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, | 77 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, |
76 | sizeof(struct wl12xx_ps_poll_template)); | 78 | sizeof(struct wl12xx_ps_poll_template), |
79 | 0); | ||
77 | if (ret < 0) | 80 | if (ret < 0) |
78 | return ret; | 81 | return ret; |
79 | 82 | ||
80 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, | 83 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, |
81 | sizeof | 84 | sizeof |
82 | (struct wl12xx_qos_null_data_template)); | 85 | (struct wl12xx_qos_null_data_template), |
86 | 0); | ||
83 | if (ret < 0) | 87 | if (ret < 0) |
84 | return ret; | 88 | return ret; |
85 | 89 | ||
86 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, | 90 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, |
87 | sizeof | 91 | sizeof |
88 | (struct wl12xx_probe_resp_template)); | 92 | (struct wl12xx_probe_resp_template), |
93 | 0); | ||
89 | if (ret < 0) | 94 | if (ret < 0) |
90 | return ret; | 95 | return ret; |
91 | 96 | ||
92 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, | 97 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, |
93 | sizeof | 98 | sizeof |
94 | (struct wl12xx_beacon_template)); | 99 | (struct wl12xx_beacon_template), |
100 | 0); | ||
95 | if (ret < 0) | 101 | if (ret < 0) |
96 | return ret; | 102 | return ret; |
97 | 103 | ||
104 | for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { | ||
105 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL, | ||
106 | WL1271_CMD_TEMPL_MAX_SIZE, i); | ||
107 | if (ret < 0) | ||
108 | return ret; | ||
109 | } | ||
110 | |||
98 | return 0; | 111 | return 0; |
99 | } | 112 | } |
100 | 113 | ||