2 * This file is part of wl12xx
4 * Copyright (C) 2009 Nokia Corporation
6 * Contact: Kalle Valo <kalle.valo@nokia.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 #include <linux/kernel.h>
25 #include <linux/module.h>
28 #include "wl12xx_80211.h"
32 int wl12xx_hw_init_hwenc_config(struct wl12xx *wl)
36 ret = wl12xx_acx_feature_cfg(wl);
38 wl12xx_warning("couldn't set feature config");
42 ret = wl12xx_acx_default_key(wl, wl->default_key);
44 wl12xx_warning("couldn't set default key");
51 int wl12xx_hw_init_templates_config(struct wl12xx *wl)
54 u8 partial_vbm[PARTIAL_VBM_MAX];
56 /* send empty templates for fw memory reservation */
57 ret = wl12xx_cmd_template_set(wl, CMD_PROBE_REQ, NULL,
58 sizeof(struct wl12xx_probe_req_template));
62 ret = wl12xx_cmd_template_set(wl, CMD_NULL_DATA, NULL,
63 sizeof(struct wl12xx_null_data_template));
67 ret = wl12xx_cmd_template_set(wl, CMD_PS_POLL, NULL,
68 sizeof(struct wl12xx_ps_poll_template));
72 ret = wl12xx_cmd_template_set(wl, CMD_QOS_NULL_DATA, NULL,
74 (struct wl12xx_qos_null_data_template));
78 ret = wl12xx_cmd_template_set(wl, CMD_PROBE_RESP, NULL,
80 (struct wl12xx_probe_resp_template));
84 ret = wl12xx_cmd_template_set(wl, CMD_BEACON, NULL,
86 (struct wl12xx_beacon_template));
90 /* tim templates, first reserve space then allocate an empty one */
91 memset(partial_vbm, 0, PARTIAL_VBM_MAX);
92 ret = wl12xx_cmd_vbm(wl, TIM_ELE_ID, partial_vbm, PARTIAL_VBM_MAX, 0);
96 ret = wl12xx_cmd_vbm(wl, TIM_ELE_ID, partial_vbm, 1, 0);
103 int wl12xx_hw_init_rx_config(struct wl12xx *wl, u32 config, u32 filter)
107 ret = wl12xx_acx_rx_msdu_life_time(wl, RX_MSDU_LIFETIME_DEF);
111 ret = wl12xx_acx_rx_config(wl, config, filter);
118 int wl12xx_hw_init_phy_config(struct wl12xx *wl)
122 ret = wl12xx_acx_pd_threshold(wl);
126 ret = wl12xx_acx_slot(wl, DEFAULT_SLOT_TIME);
130 ret = wl12xx_acx_group_address_tbl(wl);
134 ret = wl12xx_acx_service_period_timeout(wl);
138 ret = wl12xx_acx_rts_threshold(wl, RTS_THRESHOLD_DEF);
145 int wl12xx_hw_init_beacon_filter(struct wl12xx *wl)
149 ret = wl12xx_acx_beacon_filter_opt(wl);
153 ret = wl12xx_acx_beacon_filter_table(wl);
160 int wl12xx_hw_init_pta(struct wl12xx *wl)
164 ret = wl12xx_acx_sg_enable(wl);
168 ret = wl12xx_acx_sg_cfg(wl);
175 int wl12xx_hw_init_energy_detection(struct wl12xx *wl)
179 ret = wl12xx_acx_cca_threshold(wl);
186 int wl12xx_hw_init_beacon_broadcast(struct wl12xx *wl)
190 ret = wl12xx_acx_bcn_dtim_options(wl);
197 int wl12xx_hw_init_power_auth(struct wl12xx *wl)
199 return wl12xx_acx_sleep_auth(wl, WL12XX_PSM_CAM);