2 * This file is part of wl1271
4 * Copyright (C) 2008-2009 Nokia Corporation
6 * Contact: Luciano Coelho <luciano.coelho@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 "wl1271_acx.h"
26 #include <linux/module.h>
27 #include <linux/platform_device.h>
28 #include <linux/crc7.h>
29 #include <linux/spi/spi.h>
32 #include "wl12xx_80211.h"
33 #include "wl1271_reg.h"
34 #include "wl1271_ps.h"
36 int wl1271_acx_wake_up_conditions(struct wl1271 *wl)
38 struct acx_wake_up_condition *wake_up;
41 wl1271_debug(DEBUG_ACX, "acx wake up conditions");
43 wake_up = kzalloc(sizeof(*wake_up), GFP_KERNEL);
49 wake_up->wake_up_event = wl->conf.conn.wake_up_event;
50 wake_up->listen_interval = wl->conf.conn.listen_interval;
52 ret = wl1271_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS,
53 wake_up, sizeof(*wake_up));
55 wl1271_warning("could not set wake up conditions: %d", ret);
64 int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth)
66 struct acx_sleep_auth *auth;
69 wl1271_debug(DEBUG_ACX, "acx sleep auth");
71 auth = kzalloc(sizeof(*auth), GFP_KERNEL);
77 auth->sleep_auth = sleep_auth;
79 ret = wl1271_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
88 int wl1271_acx_fw_version(struct wl1271 *wl, char *buf, size_t len)
90 struct acx_revision *rev;
93 wl1271_debug(DEBUG_ACX, "acx fw rev");
95 rev = kzalloc(sizeof(*rev), GFP_KERNEL);
101 ret = wl1271_cmd_interrogate(wl, ACX_FW_REV, rev, sizeof(*rev));
103 wl1271_warning("ACX_FW_REV interrogate failed");
107 /* be careful with the buffer sizes */
108 strncpy(buf, rev->fw_version, min(len, sizeof(rev->fw_version)));
111 * if the firmware version string is exactly
112 * sizeof(rev->fw_version) long or fw_len is less than
113 * sizeof(rev->fw_version) it won't be null terminated
115 buf[min(len, sizeof(rev->fw_version)) - 1] = '\0';
122 int wl1271_acx_tx_power(struct wl1271 *wl, int power)
124 struct acx_current_tx_power *acx;
127 wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr");
129 if (power < 0 || power > 25)
132 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
138 acx->current_tx_power = power * 10;
140 ret = wl1271_cmd_configure(wl, DOT11_CUR_TX_PWR, acx, sizeof(*acx));
142 wl1271_warning("configure of tx power failed: %d", ret);
151 int wl1271_acx_feature_cfg(struct wl1271 *wl)
153 struct acx_feature_config *feature;
156 wl1271_debug(DEBUG_ACX, "acx feature cfg");
158 feature = kzalloc(sizeof(*feature), GFP_KERNEL);
164 /* DF_ENCRYPTION_DISABLE and DF_SNIFF_MODE_ENABLE are disabled */
165 feature->data_flow_options = 0;
166 feature->options = 0;
168 ret = wl1271_cmd_configure(wl, ACX_FEATURE_CFG,
169 feature, sizeof(*feature));
171 wl1271_error("Couldnt set HW encryption");
180 int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,
185 wl1271_debug(DEBUG_ACX, "acx mem map");
187 ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map, len);
194 int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl)
196 struct acx_rx_msdu_lifetime *acx;
199 wl1271_debug(DEBUG_ACX, "acx rx msdu life time");
201 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
207 acx->lifetime = cpu_to_le32(wl->conf.rx.rx_msdu_life_time);
208 ret = wl1271_cmd_configure(wl, DOT11_RX_MSDU_LIFE_TIME,
211 wl1271_warning("failed to set rx msdu life time: %d", ret);
220 int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter)
222 struct acx_rx_config *rx_config;
225 wl1271_debug(DEBUG_ACX, "acx rx config");
227 rx_config = kzalloc(sizeof(*rx_config), GFP_KERNEL);
233 rx_config->config_options = cpu_to_le32(config);
234 rx_config->filter_options = cpu_to_le32(filter);
236 ret = wl1271_cmd_configure(wl, ACX_RX_CFG,
237 rx_config, sizeof(*rx_config));
239 wl1271_warning("failed to set rx config: %d", ret);
248 int wl1271_acx_pd_threshold(struct wl1271 *wl)
250 struct acx_packet_detection *pd;
253 wl1271_debug(DEBUG_ACX, "acx data pd threshold");
255 pd = kzalloc(sizeof(*pd), GFP_KERNEL);
261 pd->threshold = cpu_to_le32(wl->conf.rx.packet_detection_threshold);
263 ret = wl1271_cmd_configure(wl, ACX_PD_THRESHOLD, pd, sizeof(*pd));
265 wl1271_warning("failed to set pd threshold: %d", ret);
274 int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time)
276 struct acx_slot *slot;
279 wl1271_debug(DEBUG_ACX, "acx slot");
281 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
287 slot->wone_index = STATION_WONE_INDEX;
288 slot->slot_time = slot_time;
290 ret = wl1271_cmd_configure(wl, ACX_SLOT, slot, sizeof(*slot));
292 wl1271_warning("failed to set slot time: %d", ret);
301 int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
302 void *mc_list, u32 mc_list_len)
304 struct acx_dot11_grp_addr_tbl *acx;
307 wl1271_debug(DEBUG_ACX, "acx group address tbl");
309 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
316 acx->enabled = enable;
317 acx->num_groups = mc_list_len;
318 memcpy(acx->mac_table, mc_list, mc_list_len * ETH_ALEN);
320 ret = wl1271_cmd_configure(wl, DOT11_GROUP_ADDRESS_TBL,
323 wl1271_warning("failed to set group addr table: %d", ret);
332 int wl1271_acx_service_period_timeout(struct wl1271 *wl)
334 struct acx_rx_timeout *rx_timeout;
337 rx_timeout = kzalloc(sizeof(*rx_timeout), GFP_KERNEL);
343 wl1271_debug(DEBUG_ACX, "acx service period timeout");
345 rx_timeout->ps_poll_timeout = cpu_to_le16(wl->conf.rx.ps_poll_timeout);
346 rx_timeout->upsd_timeout = cpu_to_le16(wl->conf.rx.upsd_timeout);
348 ret = wl1271_cmd_configure(wl, ACX_SERVICE_PERIOD_TIMEOUT,
349 rx_timeout, sizeof(*rx_timeout));
351 wl1271_warning("failed to set service period timeout: %d",
361 int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold)
363 struct acx_rts_threshold *rts;
366 wl1271_debug(DEBUG_ACX, "acx rts threshold");
368 rts = kzalloc(sizeof(*rts), GFP_KERNEL);
374 rts->threshold = cpu_to_le16(rts_threshold);
376 ret = wl1271_cmd_configure(wl, DOT11_RTS_THRESHOLD, rts, sizeof(*rts));
378 wl1271_warning("failed to set rts threshold: %d", ret);
387 int wl1271_acx_dco_itrim_params(struct wl1271 *wl)
389 struct acx_dco_itrim_params *dco;
390 struct conf_itrim_settings *c = &wl->conf.itrim;
393 wl1271_debug(DEBUG_ACX, "acx dco itrim parameters");
395 dco = kzalloc(sizeof(*dco), GFP_KERNEL);
401 dco->enable = c->enable;
402 dco->timeout = cpu_to_le32(c->timeout);
404 ret = wl1271_cmd_configure(wl, ACX_SET_DCO_ITRIM_PARAMS,
407 wl1271_warning("failed to set dco itrim parameters: %d", ret);
416 int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
418 struct acx_beacon_filter_option *beacon_filter = NULL;
421 wl1271_debug(DEBUG_ACX, "acx beacon filter opt");
424 wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED)
427 beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL);
428 if (!beacon_filter) {
433 beacon_filter->enable = enable_filter;
436 * When set to zero, and the filter is enabled, beacons
437 * without the unicast TIM bit set are dropped.
439 beacon_filter->max_num_beacons = 0;
441 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT,
442 beacon_filter, sizeof(*beacon_filter));
444 wl1271_warning("failed to set beacon filter opt: %d", ret);
449 kfree(beacon_filter);
453 int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
455 struct acx_beacon_filter_ie_table *ie_table;
458 bool vendor_spec = false;
460 wl1271_debug(DEBUG_ACX, "acx beacon filter table");
462 ie_table = kzalloc(sizeof(*ie_table), GFP_KERNEL);
468 /* configure default beacon pass-through rules */
469 ie_table->num_ie = 0;
470 for (i = 0; i < wl->conf.conn.bcn_filt_ie_count; i++) {
471 struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]);
472 ie_table->table[idx++] = r->ie;
473 ie_table->table[idx++] = r->rule;
475 if (r->ie == WLAN_EID_VENDOR_SPECIFIC) {
476 /* only one vendor specific ie allowed */
480 /* for vendor specific rules configure the
482 memcpy(&(ie_table->table[idx]), r->oui,
483 CONF_BCN_IE_OUI_LEN);
484 idx += CONF_BCN_IE_OUI_LEN;
485 ie_table->table[idx++] = r->type;
486 memcpy(&(ie_table->table[idx]), r->version,
487 CONF_BCN_IE_VER_LEN);
488 idx += CONF_BCN_IE_VER_LEN;
495 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE,
496 ie_table, sizeof(*ie_table));
498 wl1271_warning("failed to set beacon filter table: %d", ret);
507 #define ACX_CONN_MONIT_DISABLE_VALUE 0xffffffff
509 int wl1271_acx_conn_monit_params(struct wl1271 *wl, bool enable)
511 struct acx_conn_monit_params *acx;
512 u32 threshold = ACX_CONN_MONIT_DISABLE_VALUE;
513 u32 timeout = ACX_CONN_MONIT_DISABLE_VALUE;
516 wl1271_debug(DEBUG_ACX, "acx connection monitor parameters: %s",
517 enable ? "enabled" : "disabled");
519 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
526 threshold = wl->conf.conn.synch_fail_thold;
527 timeout = wl->conf.conn.bss_lose_timeout;
530 acx->synch_fail_thold = cpu_to_le32(threshold);
531 acx->bss_lose_timeout = cpu_to_le32(timeout);
533 ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS,
536 wl1271_warning("failed to set connection monitor "
537 "parameters: %d", ret);
547 int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable)
549 struct acx_bt_wlan_coex *pta;
552 wl1271_debug(DEBUG_ACX, "acx sg enable");
554 pta = kzalloc(sizeof(*pta), GFP_KERNEL);
561 pta->enable = wl->conf.sg.state;
563 pta->enable = CONF_SG_DISABLE;
565 ret = wl1271_cmd_configure(wl, ACX_SG_ENABLE, pta, sizeof(*pta));
567 wl1271_warning("failed to set softgemini enable: %d", ret);
576 int wl1271_acx_sg_cfg(struct wl1271 *wl)
578 struct acx_bt_wlan_coex_param *param;
579 struct conf_sg_settings *c = &wl->conf.sg;
582 wl1271_debug(DEBUG_ACX, "acx sg cfg");
584 param = kzalloc(sizeof(*param), GFP_KERNEL);
590 /* BT-WLAN coext parameters */
591 for (i = 0; i < CONF_SG_PARAMS_MAX; i++)
592 param->params[i] = c->params[i];
593 param->param_idx = CONF_SG_PARAMS_ALL;
595 ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param));
597 wl1271_warning("failed to set sg config: %d", ret);
606 int wl1271_acx_cca_threshold(struct wl1271 *wl)
608 struct acx_energy_detection *detection;
611 wl1271_debug(DEBUG_ACX, "acx cca threshold");
613 detection = kzalloc(sizeof(*detection), GFP_KERNEL);
619 detection->rx_cca_threshold = cpu_to_le16(wl->conf.rx.rx_cca_threshold);
620 detection->tx_energy_detection = wl->conf.tx.tx_energy_detection;
622 ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD,
623 detection, sizeof(*detection));
625 wl1271_warning("failed to set cca threshold: %d", ret);
634 int wl1271_acx_bcn_dtim_options(struct wl1271 *wl)
636 struct acx_beacon_broadcast *bb;
639 wl1271_debug(DEBUG_ACX, "acx bcn dtim options");
641 bb = kzalloc(sizeof(*bb), GFP_KERNEL);
647 bb->beacon_rx_timeout = cpu_to_le16(wl->conf.conn.beacon_rx_timeout);
648 bb->broadcast_timeout = cpu_to_le16(wl->conf.conn.broadcast_timeout);
649 bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps;
650 bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold;
652 ret = wl1271_cmd_configure(wl, ACX_BCN_DTIM_OPTIONS, bb, sizeof(*bb));
654 wl1271_warning("failed to set rx config: %d", ret);
663 int wl1271_acx_aid(struct wl1271 *wl, u16 aid)
665 struct acx_aid *acx_aid;
668 wl1271_debug(DEBUG_ACX, "acx aid");
670 acx_aid = kzalloc(sizeof(*acx_aid), GFP_KERNEL);
676 acx_aid->aid = cpu_to_le16(aid);
678 ret = wl1271_cmd_configure(wl, ACX_AID, acx_aid, sizeof(*acx_aid));
680 wl1271_warning("failed to set aid: %d", ret);
689 int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask)
691 struct acx_event_mask *mask;
694 wl1271_debug(DEBUG_ACX, "acx event mbox mask");
696 mask = kzalloc(sizeof(*mask), GFP_KERNEL);
702 /* high event mask is unused */
703 mask->high_event_mask = cpu_to_le32(0xffffffff);
704 mask->event_mask = cpu_to_le32(event_mask);
706 ret = wl1271_cmd_configure(wl, ACX_EVENT_MBOX_MASK,
707 mask, sizeof(*mask));
709 wl1271_warning("failed to set acx_event_mbox_mask: %d", ret);
718 int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble)
720 struct acx_preamble *acx;
723 wl1271_debug(DEBUG_ACX, "acx_set_preamble");
725 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
731 acx->preamble = preamble;
733 ret = wl1271_cmd_configure(wl, ACX_PREAMBLE_TYPE, acx, sizeof(*acx));
735 wl1271_warning("Setting of preamble failed: %d", ret);
744 int wl1271_acx_cts_protect(struct wl1271 *wl,
745 enum acx_ctsprotect_type ctsprotect)
747 struct acx_ctsprotect *acx;
750 wl1271_debug(DEBUG_ACX, "acx_set_ctsprotect");
752 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
758 acx->ctsprotect = ctsprotect;
760 ret = wl1271_cmd_configure(wl, ACX_CTS_PROTECTION, acx, sizeof(*acx));
762 wl1271_warning("Setting of ctsprotect failed: %d", ret);
771 int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
775 wl1271_debug(DEBUG_ACX, "acx statistics");
777 ret = wl1271_cmd_interrogate(wl, ACX_STATISTICS, stats,
780 wl1271_warning("acx statistics failed: %d", ret);
787 int wl1271_acx_rate_policies(struct wl1271 *wl)
789 struct acx_rate_policy *acx;
790 struct conf_tx_rate_class *c = &wl->conf.tx.rc_conf;
794 wl1271_debug(DEBUG_ACX, "acx rate policies");
796 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
803 /* configure one basic rate class */
804 idx = ACX_TX_BASIC_RATE;
805 acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->basic_rate_set);
806 acx->rate_class[idx].short_retry_limit = c->short_retry_limit;
807 acx->rate_class[idx].long_retry_limit = c->long_retry_limit;
808 acx->rate_class[idx].aflags = c->aflags;
810 /* configure one AP supported rate class */
811 idx = ACX_TX_AP_FULL_RATE;
812 acx->rate_class[idx].enabled_rates = cpu_to_le32(wl->rate_set);
813 acx->rate_class[idx].short_retry_limit = c->short_retry_limit;
814 acx->rate_class[idx].long_retry_limit = c->long_retry_limit;
815 acx->rate_class[idx].aflags = c->aflags;
817 acx->rate_class_cnt = cpu_to_le32(ACX_TX_RATE_POLICY_CNT);
819 ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
821 wl1271_warning("Setting of rate policies failed: %d", ret);
830 int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
833 struct acx_ac_cfg *acx;
836 wl1271_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d "
837 "aifs %d txop %d", ac, cw_min, cw_max, aifsn, txop);
839 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
847 acx->cw_min = cw_min;
848 acx->cw_max = cpu_to_le16(cw_max);
850 acx->tx_op_limit = cpu_to_le16(txop);
852 ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
854 wl1271_warning("acx ac cfg failed: %d", ret);
863 int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
864 u8 tsid, u8 ps_scheme, u8 ack_policy,
865 u32 apsd_conf0, u32 apsd_conf1)
867 struct acx_tid_config *acx;
870 wl1271_debug(DEBUG_ACX, "acx tid config");
872 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
879 acx->queue_id = queue_id;
880 acx->channel_type = channel_type;
882 acx->ps_scheme = ps_scheme;
883 acx->ack_policy = ack_policy;
884 acx->apsd_conf[0] = cpu_to_le32(apsd_conf0);
885 acx->apsd_conf[1] = cpu_to_le32(apsd_conf1);
887 ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx));
889 wl1271_warning("Setting of tid config failed: %d", ret);
898 int wl1271_acx_frag_threshold(struct wl1271 *wl)
900 struct acx_frag_threshold *acx;
903 wl1271_debug(DEBUG_ACX, "acx frag threshold");
905 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
912 acx->frag_threshold = cpu_to_le16(wl->conf.tx.frag_threshold);
913 ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx));
915 wl1271_warning("Setting of frag threshold failed: %d", ret);
924 int wl1271_acx_tx_config_options(struct wl1271 *wl)
926 struct acx_tx_config_options *acx;
929 wl1271_debug(DEBUG_ACX, "acx tx config options");
931 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
938 acx->tx_compl_timeout = cpu_to_le16(wl->conf.tx.tx_compl_timeout);
939 acx->tx_compl_threshold = cpu_to_le16(wl->conf.tx.tx_compl_threshold);
940 ret = wl1271_cmd_configure(wl, ACX_TX_CONFIG_OPT, acx, sizeof(*acx));
942 wl1271_warning("Setting of tx options failed: %d", ret);
951 int wl1271_acx_mem_cfg(struct wl1271 *wl)
953 struct wl1271_acx_config_memory *mem_conf;
956 wl1271_debug(DEBUG_ACX, "wl1271 mem cfg");
958 mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL);
965 mem_conf->num_stations = DEFAULT_NUM_STATIONS;
966 mem_conf->rx_mem_block_num = ACX_RX_MEM_BLOCKS;
967 mem_conf->tx_min_mem_block_num = ACX_TX_MIN_MEM_BLOCKS;
968 mem_conf->num_ssid_profiles = ACX_NUM_SSID_PROFILES;
969 mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS);
971 ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf,
974 wl1271_warning("wl1271 mem config failed: %d", ret);
983 int wl1271_acx_init_mem_config(struct wl1271 *wl)
987 ret = wl1271_acx_mem_cfg(wl);
991 wl->target_mem_map = kzalloc(sizeof(struct wl1271_acx_mem_map),
993 if (!wl->target_mem_map) {
994 wl1271_error("couldn't allocate target memory map");
998 /* we now ask for the firmware built memory map */
999 ret = wl1271_acx_mem_map(wl, (void *)wl->target_mem_map,
1000 sizeof(struct wl1271_acx_mem_map));
1002 wl1271_error("couldn't retrieve firmware memory map");
1003 kfree(wl->target_mem_map);
1004 wl->target_mem_map = NULL;
1008 /* initialize TX block book keeping */
1009 wl->tx_blocks_available =
1010 le32_to_cpu(wl->target_mem_map->num_tx_mem_blocks);
1011 wl1271_debug(DEBUG_TX, "available tx blocks: %d",
1012 wl->tx_blocks_available);
1017 int wl1271_acx_init_rx_interrupt(struct wl1271 *wl)
1019 struct wl1271_acx_rx_config_opt *rx_conf;
1022 wl1271_debug(DEBUG_ACX, "wl1271 rx interrupt config");
1024 rx_conf = kzalloc(sizeof(*rx_conf), GFP_KERNEL);
1030 rx_conf->threshold = cpu_to_le16(wl->conf.rx.irq_pkt_threshold);
1031 rx_conf->timeout = cpu_to_le16(wl->conf.rx.irq_timeout);
1032 rx_conf->mblk_threshold = cpu_to_le16(wl->conf.rx.irq_blk_threshold);
1033 rx_conf->queue_type = wl->conf.rx.queue_type;
1035 ret = wl1271_cmd_configure(wl, ACX_RX_CONFIG_OPT, rx_conf,
1038 wl1271_warning("wl1271 rx config opt failed: %d", ret);
1047 int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable)
1049 struct wl1271_acx_bet_enable *acx = NULL;
1052 wl1271_debug(DEBUG_ACX, "acx bet enable");
1054 if (enable && wl->conf.conn.bet_enable == CONF_BET_MODE_DISABLE)
1057 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
1063 acx->enable = enable ? CONF_BET_MODE_ENABLE : CONF_BET_MODE_DISABLE;
1064 acx->max_consecutive = wl->conf.conn.bet_max_consecutive;
1066 ret = wl1271_cmd_configure(wl, ACX_BET_ENABLE, acx, sizeof(*acx));
1068 wl1271_warning("acx bet enable failed: %d", ret);
1077 int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, u8 *address,
1080 struct wl1271_acx_arp_filter *acx;
1083 wl1271_debug(DEBUG_ACX, "acx arp ip filter, enable: %d", enable);
1085 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
1091 acx->version = version;
1092 acx->enable = enable;
1094 if (enable == true) {
1095 if (version == ACX_IPV4_VERSION)
1096 memcpy(acx->address, address, ACX_IPV4_ADDR_SIZE);
1097 else if (version == ACX_IPV6_VERSION)
1098 memcpy(acx->address, address, sizeof(acx->address));
1100 wl1271_error("Invalid IP version");
1103 ret = wl1271_cmd_configure(wl, ACX_ARP_IP_FILTER,
1106 wl1271_warning("failed to set arp ip filter: %d", ret);
1115 int wl1271_acx_pm_config(struct wl1271 *wl)
1117 struct wl1271_acx_pm_config *acx = NULL;
1118 struct conf_pm_config_settings *c = &wl->conf.pm_config;
1121 wl1271_debug(DEBUG_ACX, "acx pm config");
1123 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
1129 acx->host_clk_settling_time = cpu_to_le32(c->host_clk_settling_time);
1130 acx->host_fast_wakeup_support = c->host_fast_wakeup_support;
1132 ret = wl1271_cmd_configure(wl, ACX_PM_CONFIG, acx, sizeof(*acx));
1134 wl1271_warning("acx pm config failed: %d", ret);