diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/acx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.c | 93 |
1 files changed, 76 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c index a3db755ceeda..a5c9c0aff83f 100644 --- a/drivers/net/wireless/wl12xx/acx.c +++ b/drivers/net/wireless/wl12xx/acx.c | |||
@@ -965,10 +965,13 @@ int wl1271_acx_ap_mem_cfg(struct wl1271 *wl) | |||
965 | } | 965 | } |
966 | 966 | ||
967 | /* memory config */ | 967 | /* memory config */ |
968 | mem_conf->num_stations = wl->conf.mem.num_stations; | 968 | /* FIXME: for now we always use mem_wl127x for AP, because it |
969 | mem_conf->rx_mem_block_num = wl->conf.mem.rx_block_num; | 969 | * doesn't support dynamic memory and we don't have the |
970 | mem_conf->tx_min_mem_block_num = wl->conf.mem.tx_min_block_num; | 970 | * optimal values for wl128x without dynamic memory yet */ |
971 | mem_conf->num_ssid_profiles = wl->conf.mem.ssid_profiles; | 971 | mem_conf->num_stations = wl->conf.mem_wl127x.num_stations; |
972 | mem_conf->rx_mem_block_num = wl->conf.mem_wl127x.rx_block_num; | ||
973 | mem_conf->tx_min_mem_block_num = wl->conf.mem_wl127x.tx_min_block_num; | ||
974 | mem_conf->num_ssid_profiles = wl->conf.mem_wl127x.ssid_profiles; | ||
972 | mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS); | 975 | mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS); |
973 | 976 | ||
974 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, | 977 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, |
@@ -986,6 +989,7 @@ out: | |||
986 | int wl1271_acx_sta_mem_cfg(struct wl1271 *wl) | 989 | int wl1271_acx_sta_mem_cfg(struct wl1271 *wl) |
987 | { | 990 | { |
988 | struct wl1271_acx_sta_config_memory *mem_conf; | 991 | struct wl1271_acx_sta_config_memory *mem_conf; |
992 | struct conf_memory_settings *mem; | ||
989 | int ret; | 993 | int ret; |
990 | 994 | ||
991 | wl1271_debug(DEBUG_ACX, "wl1271 mem cfg"); | 995 | wl1271_debug(DEBUG_ACX, "wl1271 mem cfg"); |
@@ -996,16 +1000,21 @@ int wl1271_acx_sta_mem_cfg(struct wl1271 *wl) | |||
996 | goto out; | 1000 | goto out; |
997 | } | 1001 | } |
998 | 1002 | ||
1003 | if (wl->chip.id == CHIP_ID_1283_PG20) | ||
1004 | mem = &wl->conf.mem_wl128x; | ||
1005 | else | ||
1006 | mem = &wl->conf.mem_wl127x; | ||
1007 | |||
999 | /* memory config */ | 1008 | /* memory config */ |
1000 | mem_conf->num_stations = wl->conf.mem.num_stations; | 1009 | mem_conf->num_stations = mem->num_stations; |
1001 | mem_conf->rx_mem_block_num = wl->conf.mem.rx_block_num; | 1010 | mem_conf->rx_mem_block_num = mem->rx_block_num; |
1002 | mem_conf->tx_min_mem_block_num = wl->conf.mem.tx_min_block_num; | 1011 | mem_conf->tx_min_mem_block_num = mem->tx_min_block_num; |
1003 | mem_conf->num_ssid_profiles = wl->conf.mem.ssid_profiles; | 1012 | mem_conf->num_ssid_profiles = mem->ssid_profiles; |
1004 | mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS); | 1013 | mem_conf->total_tx_descriptors = cpu_to_le32(ACX_TX_DESCRIPTORS); |
1005 | mem_conf->dyn_mem_enable = wl->conf.mem.dynamic_memory; | 1014 | mem_conf->dyn_mem_enable = mem->dynamic_memory; |
1006 | mem_conf->tx_free_req = wl->conf.mem.min_req_tx_blocks; | 1015 | mem_conf->tx_free_req = mem->min_req_tx_blocks; |
1007 | mem_conf->rx_free_req = wl->conf.mem.min_req_rx_blocks; | 1016 | mem_conf->rx_free_req = mem->min_req_rx_blocks; |
1008 | mem_conf->tx_min = wl->conf.mem.tx_min; | 1017 | mem_conf->tx_min = mem->tx_min; |
1009 | 1018 | ||
1010 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, | 1019 | ret = wl1271_cmd_configure(wl, ACX_MEM_CFG, mem_conf, |
1011 | sizeof(*mem_conf)); | 1020 | sizeof(*mem_conf)); |
@@ -1019,6 +1028,32 @@ out: | |||
1019 | return ret; | 1028 | return ret; |
1020 | } | 1029 | } |
1021 | 1030 | ||
1031 | int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap) | ||
1032 | { | ||
1033 | struct wl1271_acx_host_config_bitmap *bitmap_conf; | ||
1034 | int ret; | ||
1035 | |||
1036 | bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL); | ||
1037 | if (!bitmap_conf) { | ||
1038 | ret = -ENOMEM; | ||
1039 | goto out; | ||
1040 | } | ||
1041 | |||
1042 | bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap); | ||
1043 | |||
1044 | ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP, | ||
1045 | bitmap_conf, sizeof(*bitmap_conf)); | ||
1046 | if (ret < 0) { | ||
1047 | wl1271_warning("wl1271 bitmap config opt failed: %d", ret); | ||
1048 | goto out; | ||
1049 | } | ||
1050 | |||
1051 | out: | ||
1052 | kfree(bitmap_conf); | ||
1053 | |||
1054 | return ret; | ||
1055 | } | ||
1056 | |||
1022 | int wl1271_acx_init_mem_config(struct wl1271 *wl) | 1057 | int wl1271_acx_init_mem_config(struct wl1271 *wl) |
1023 | { | 1058 | { |
1024 | int ret; | 1059 | int ret; |
@@ -1489,22 +1524,46 @@ out: | |||
1489 | return ret; | 1524 | return ret; |
1490 | } | 1525 | } |
1491 | 1526 | ||
1492 | int wl1271_acx_max_tx_retry(struct wl1271 *wl) | 1527 | int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl) |
1493 | { | 1528 | { |
1494 | struct wl1271_acx_max_tx_retry *acx = NULL; | 1529 | struct wl1271_acx_ap_max_tx_retry *acx = NULL; |
1495 | int ret; | 1530 | int ret; |
1496 | 1531 | ||
1497 | wl1271_debug(DEBUG_ACX, "acx max tx retry"); | 1532 | wl1271_debug(DEBUG_ACX, "acx ap max tx retry"); |
1498 | 1533 | ||
1499 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | 1534 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); |
1500 | if (!acx) | 1535 | if (!acx) |
1501 | return -ENOMEM; | 1536 | return -ENOMEM; |
1502 | 1537 | ||
1503 | acx->max_tx_retry = cpu_to_le16(wl->conf.tx.ap_max_tx_retries); | 1538 | acx->max_tx_retry = cpu_to_le16(wl->conf.tx.max_tx_retries); |
1504 | 1539 | ||
1505 | ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx)); | 1540 | ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx)); |
1506 | if (ret < 0) { | 1541 | if (ret < 0) { |
1507 | wl1271_warning("acx max tx retry failed: %d", ret); | 1542 | wl1271_warning("acx ap max tx retry failed: %d", ret); |
1543 | goto out; | ||
1544 | } | ||
1545 | |||
1546 | out: | ||
1547 | kfree(acx); | ||
1548 | return ret; | ||
1549 | } | ||
1550 | |||
1551 | int wl1271_acx_sta_max_tx_retry(struct wl1271 *wl) | ||
1552 | { | ||
1553 | struct wl1271_acx_sta_max_tx_retry *acx = NULL; | ||
1554 | int ret; | ||
1555 | |||
1556 | wl1271_debug(DEBUG_ACX, "acx sta max tx retry"); | ||
1557 | |||
1558 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
1559 | if (!acx) | ||
1560 | return -ENOMEM; | ||
1561 | |||
1562 | acx->max_tx_retry = wl->conf.tx.max_tx_retries; | ||
1563 | |||
1564 | ret = wl1271_cmd_configure(wl, ACX_CONS_TX_FAILURE, acx, sizeof(*acx)); | ||
1565 | if (ret < 0) { | ||
1566 | wl1271_warning("acx sta max tx retry failed: %d", ret); | ||
1508 | goto out; | 1567 | goto out; |
1509 | } | 1568 | } |
1510 | 1569 | ||