diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_acx.c')
| -rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index 0b3434843476..60f10dce4800 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
| @@ -830,12 +830,14 @@ out: | |||
| 830 | return ret; | 830 | return ret; |
| 831 | } | 831 | } |
| 832 | 832 | ||
| 833 | int wl1271_acx_ac_cfg(struct wl1271 *wl) | 833 | int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, |
| 834 | u8 aifsn, u16 txop) | ||
| 834 | { | 835 | { |
| 835 | struct acx_ac_cfg *acx; | 836 | struct acx_ac_cfg *acx; |
| 836 | int i, ret = 0; | 837 | int ret = 0; |
| 837 | 838 | ||
| 838 | wl1271_debug(DEBUG_ACX, "acx access category config"); | 839 | wl1271_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d " |
| 840 | "aifs %d txop %d", ac, cw_min, cw_max, aifsn, txop); | ||
| 839 | 841 | ||
| 840 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | 842 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); |
| 841 | 843 | ||
| @@ -844,21 +846,16 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl) | |||
| 844 | goto out; | 846 | goto out; |
| 845 | } | 847 | } |
| 846 | 848 | ||
| 847 | for (i = 0; i < wl->conf.tx.ac_conf_count; i++) { | 849 | acx->ac = ac; |
| 848 | struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]); | 850 | acx->cw_min = cw_min; |
| 849 | acx->ac = c->ac; | 851 | acx->cw_max = cpu_to_le16(cw_max); |
| 850 | acx->cw_min = c->cw_min; | 852 | acx->aifsn = aifsn; |
| 851 | acx->cw_max = cpu_to_le16(c->cw_max); | 853 | acx->tx_op_limit = cpu_to_le16(txop); |
| 852 | acx->aifsn = c->aifsn; | ||
| 853 | acx->reserved = 0; | ||
| 854 | acx->tx_op_limit = cpu_to_le16(c->tx_op_limit); | ||
| 855 | 854 | ||
| 856 | ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); | 855 | ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx)); |
| 857 | if (ret < 0) { | 856 | if (ret < 0) { |
| 858 | wl1271_warning("Setting of access category " | 857 | wl1271_warning("acx ac cfg failed: %d", ret); |
| 859 | "config: %d", ret); | 858 | goto out; |
| 860 | goto out; | ||
| 861 | } | ||
| 862 | } | 859 | } |
| 863 | 860 | ||
| 864 | out: | 861 | out: |
| @@ -866,10 +863,12 @@ out: | |||
| 866 | return ret; | 863 | return ret; |
| 867 | } | 864 | } |
| 868 | 865 | ||
| 869 | int wl1271_acx_tid_cfg(struct wl1271 *wl) | 866 | int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type, |
| 867 | u8 tsid, u8 ps_scheme, u8 ack_policy, | ||
| 868 | u32 apsd_conf0, u32 apsd_conf1) | ||
| 870 | { | 869 | { |
| 871 | struct acx_tid_config *acx; | 870 | struct acx_tid_config *acx; |
| 872 | int i, ret = 0; | 871 | int ret = 0; |
| 873 | 872 | ||
| 874 | wl1271_debug(DEBUG_ACX, "acx tid config"); | 873 | wl1271_debug(DEBUG_ACX, "acx tid config"); |
| 875 | 874 | ||
| @@ -880,21 +879,18 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl) | |||
| 880 | goto out; | 879 | goto out; |
| 881 | } | 880 | } |
| 882 | 881 | ||
| 883 | for (i = 0; i < wl->conf.tx.tid_conf_count; i++) { | 882 | acx->queue_id = queue_id; |
| 884 | struct conf_tx_tid *c = &(wl->conf.tx.tid_conf[i]); | 883 | acx->channel_type = channel_type; |
| 885 | acx->queue_id = c->queue_id; | 884 | acx->tsid = tsid; |
| 886 | acx->channel_type = c->channel_type; | 885 | acx->ps_scheme = ps_scheme; |
| 887 | acx->tsid = c->tsid; | 886 | acx->ack_policy = ack_policy; |
| 888 | acx->ps_scheme = c->ps_scheme; | 887 | acx->apsd_conf[0] = cpu_to_le32(apsd_conf0); |
| 889 | acx->ack_policy = c->ack_policy; | 888 | acx->apsd_conf[1] = cpu_to_le32(apsd_conf1); |
| 890 | acx->apsd_conf[0] = cpu_to_le32(c->apsd_conf[0]); | ||
| 891 | acx->apsd_conf[1] = cpu_to_le32(c->apsd_conf[1]); | ||
| 892 | 889 | ||
| 893 | ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx)); | 890 | ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx)); |
| 894 | if (ret < 0) { | 891 | if (ret < 0) { |
| 895 | wl1271_warning("Setting of tid config failed: %d", ret); | 892 | wl1271_warning("Setting of tid config failed: %d", ret); |
| 896 | goto out; | 893 | goto out; |
| 897 | } | ||
| 898 | } | 894 | } |
| 899 | 895 | ||
| 900 | out: | 896 | out: |
