diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_acx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.c | 84 |
1 files changed, 81 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c index a46c92a29526..10b26c4532c9 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.c +++ b/drivers/net/wireless/wl12xx/wl1251_acx.c | |||
@@ -2,11 +2,10 @@ | |||
2 | 2 | ||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/crc7.h> | 4 | #include <linux/crc7.h> |
5 | #include <linux/spi/spi.h> | ||
6 | 5 | ||
7 | #include "wl1251.h" | 6 | #include "wl1251.h" |
8 | #include "reg.h" | 7 | #include "wl1251_reg.h" |
9 | #include "wl1251_spi.h" | 8 | #include "wl1251_cmd.h" |
10 | #include "wl1251_ps.h" | 9 | #include "wl1251_ps.h" |
11 | 10 | ||
12 | int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod, | 11 | int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod, |
@@ -838,3 +837,82 @@ int wl1251_acx_statistics(struct wl1251 *wl, struct acx_statistics *stats) | |||
838 | 837 | ||
839 | return 0; | 838 | return 0; |
840 | } | 839 | } |
840 | |||
841 | int wl1251_acx_rate_policies(struct wl1251 *wl) | ||
842 | { | ||
843 | struct acx_rate_policy *acx; | ||
844 | int ret = 0; | ||
845 | |||
846 | wl1251_debug(DEBUG_ACX, "acx rate policies"); | ||
847 | |||
848 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
849 | |||
850 | if (!acx) { | ||
851 | ret = -ENOMEM; | ||
852 | goto out; | ||
853 | } | ||
854 | |||
855 | /* configure one default (one-size-fits-all) rate class */ | ||
856 | acx->rate_class_cnt = 1; | ||
857 | acx->rate_class[0].enabled_rates = ACX_RATE_MASK_UNSPECIFIED; | ||
858 | acx->rate_class[0].short_retry_limit = ACX_RATE_RETRY_LIMIT; | ||
859 | acx->rate_class[0].long_retry_limit = ACX_RATE_RETRY_LIMIT; | ||
860 | acx->rate_class[0].aflags = 0; | ||
861 | |||
862 | ret = wl1251_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx)); | ||
863 | if (ret < 0) { | ||
864 | wl1251_warning("Setting of rate policies failed: %d", ret); | ||
865 | goto out; | ||
866 | } | ||
867 | |||
868 | out: | ||
869 | kfree(acx); | ||
870 | return ret; | ||
871 | } | ||
872 | |||
873 | int wl1251_acx_mem_cfg(struct wl1251 *wl) | ||
874 | { | ||
875 | struct wl1251_acx_config_memory *mem_conf; | ||
876 | int ret, i; | ||
877 | |||
878 | wl1251_debug(DEBUG_ACX, "acx mem cfg"); | ||
879 | |||
880 | mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL); | ||
881 | if (!mem_conf) { | ||
882 | ret = -ENOMEM; | ||
883 | goto out; | ||
884 | } | ||
885 | |||
886 | /* memory config */ | ||
887 | mem_conf->mem_config.num_stations = cpu_to_le16(DEFAULT_NUM_STATIONS); | ||
888 | mem_conf->mem_config.rx_mem_block_num = 35; | ||
889 | mem_conf->mem_config.tx_min_mem_block_num = 64; | ||
890 | mem_conf->mem_config.num_tx_queues = MAX_TX_QUEUES; | ||
891 | mem_conf->mem_config.host_if_options = HOSTIF_PKT_RING; | ||
892 | mem_conf->mem_config.num_ssid_profiles = 1; | ||
893 | mem_conf->mem_config.debug_buffer_size = | ||
894 | cpu_to_le16(TRACE_BUFFER_MAX_SIZE); | ||
895 | |||
896 | /* RX queue config */ | ||
897 | mem_conf->rx_queue_config.dma_address = 0; | ||
898 | mem_conf->rx_queue_config.num_descs = ACX_RX_DESC_DEF; | ||
899 | mem_conf->rx_queue_config.priority = DEFAULT_RXQ_PRIORITY; | ||
900 | mem_conf->rx_queue_config.type = DEFAULT_RXQ_TYPE; | ||
901 | |||
902 | /* TX queue config */ | ||
903 | for (i = 0; i < MAX_TX_QUEUES; i++) { | ||
904 | mem_conf->tx_queue_config[i].num_descs = ACX_TX_DESC_DEF; | ||
905 | mem_conf->tx_queue_config[i].attributes = i; | ||
906 | } | ||
907 | |||
908 | ret = wl1251_cmd_configure(wl, ACX_MEM_CFG, mem_conf, | ||
909 | sizeof(*mem_conf)); | ||
910 | if (ret < 0) { | ||
911 | wl1251_warning("wl1251 mem config failed: %d", ret); | ||
912 | goto out; | ||
913 | } | ||
914 | |||
915 | out: | ||
916 | kfree(mem_conf); | ||
917 | return ret; | ||
918 | } | ||