aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVidhya Govindan <vidhya.govindan@nokia.com>2009-11-17 11:49:08 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-18 17:09:21 -0500
commitd531cf303f765bf3477330e58fbeab75da668931 (patch)
treeaca8935d61cc243faed99201a3063a484b37cc0c /drivers
parent2410378a4c8e978823354ab3e44cd07c3c18a237 (diff)
wl1251: Add acx command to set tbtt and dtim period
The dtim period obtained from the mac80211 is not set to the firmware. This patch implements the acx command to set correct tbtt and dtim value to the firmware. Signed-off-by: Vidhya Govindan <vidhya.govindan@nokia.com> Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Reviewed-by: Janne Ylalehto <janne.ylalehto@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/wl1251_acx.c28
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_acx.h18
2 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c
index 50633e043cfd..acfa086dbfc5 100644
--- a/drivers/net/wireless/wl12xx/wl1251_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1251_acx.c
@@ -948,3 +948,31 @@ out:
948 kfree(mem_conf); 948 kfree(mem_conf);
949 return ret; 949 return ret;
950} 950}
951
952int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim)
953{
954 struct wl1251_acx_wr_tbtt_and_dtim *acx;
955 int ret;
956
957 wl1251_debug(DEBUG_ACX, "acx tbtt and dtim");
958
959 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
960 if (!acx) {
961 ret = -ENOMEM;
962 goto out;
963 }
964
965 acx->tbtt = tbtt;
966 acx->dtim = dtim;
967
968 ret = wl1251_cmd_configure(wl, ACX_WR_TBTT_AND_DTIM,
969 acx, sizeof(*acx));
970 if (ret < 0) {
971 wl1251_warning("failed to set tbtt and dtim: %d", ret);
972 goto out;
973 }
974
975out:
976 kfree(acx);
977 return ret;
978}
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.h b/drivers/net/wireless/wl12xx/wl1251_acx.h
index ce1c995e08d8..44a4b0494592 100644
--- a/drivers/net/wireless/wl12xx/wl1251_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1251_acx.h
@@ -1149,6 +1149,23 @@ struct wl1251_acx_mem_map {
1149 u32 num_rx_mem_blocks; 1149 u32 num_rx_mem_blocks;
1150} __attribute__ ((packed)); 1150} __attribute__ ((packed));
1151 1151
1152
1153struct wl1251_acx_wr_tbtt_and_dtim {
1154
1155 struct acx_header header;
1156
1157 /* Time in TUs between two consecutive beacons */
1158 u16 tbtt;
1159
1160 /*
1161 * DTIM period
1162 * For BSS: Number of TBTTs in a DTIM period (range: 1-10)
1163 * For IBSS: value shall be set to 1
1164 */
1165 u8 dtim;
1166 u8 padding;
1167} __attribute__ ((packed));
1168
1152/************************************************************************* 1169/*************************************************************************
1153 1170
1154 Host Interrupt Register (WiLink -> Host) 1171 Host Interrupt Register (WiLink -> Host)
@@ -1304,5 +1321,6 @@ int wl1251_acx_statistics(struct wl1251 *wl, struct acx_statistics *stats);
1304int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime); 1321int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime);
1305int wl1251_acx_rate_policies(struct wl1251 *wl); 1322int wl1251_acx_rate_policies(struct wl1251 *wl);
1306int wl1251_acx_mem_cfg(struct wl1251 *wl); 1323int wl1251_acx_mem_cfg(struct wl1251 *wl);
1324int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim);
1307 1325
1308#endif /* __WL1251_ACX_H__ */ 1326#endif /* __WL1251_ACX_H__ */