]>
Commit | Line | Data |
---|---|---|
b8422dcb LC |
1 | /* |
2 | * This file is part of wl18xx | |
3 | * | |
4 | * Copyright (C) 2011 Texas Instruments Inc. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License | |
8 | * version 2 as published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but | |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA | |
19 | * | |
20 | */ | |
21 | ||
22 | #include "../wlcore/cmd.h" | |
23 | #include "../wlcore/debug.h" | |
24 | #include "../wlcore/acx.h" | |
25 | ||
26 | #include "acx.h" | |
27 | ||
28 | int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap, | |
29 | u32 sdio_blk_size, u32 extra_mem_blks, | |
30 | u32 len_field_size) | |
31 | { | |
32 | struct wl18xx_acx_host_config_bitmap *bitmap_conf; | |
33 | int ret; | |
34 | ||
35 | bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL); | |
36 | if (!bitmap_conf) { | |
37 | ret = -ENOMEM; | |
38 | goto out; | |
39 | } | |
40 | ||
41 | bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap); | |
42 | bitmap_conf->host_sdio_block_size = cpu_to_le32(sdio_blk_size); | |
43 | bitmap_conf->extra_mem_blocks = cpu_to_le32(extra_mem_blks); | |
44 | bitmap_conf->length_field_size = cpu_to_le32(len_field_size); | |
45 | ||
46 | ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP, | |
47 | bitmap_conf, sizeof(*bitmap_conf)); | |
48 | if (ret < 0) { | |
49 | wl1271_warning("wl1271 bitmap config opt failed: %d", ret); | |
50 | goto out; | |
51 | } | |
52 | ||
53 | out: | |
54 | kfree(bitmap_conf); | |
55 | ||
56 | return ret; | |
57 | } | |
2fc28de5 AN |
58 | |
59 | int wl18xx_acx_set_checksum_state(struct wl1271 *wl) | |
60 | { | |
61 | struct wl18xx_acx_checksum_state *acx; | |
62 | int ret; | |
63 | ||
64 | wl1271_debug(DEBUG_ACX, "acx checksum state"); | |
65 | ||
66 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | |
67 | if (!acx) { | |
68 | ret = -ENOMEM; | |
69 | goto out; | |
70 | } | |
71 | ||
72 | acx->checksum_state = CHECKSUM_OFFLOAD_ENABLED; | |
73 | ||
74 | ret = wl1271_cmd_configure(wl, ACX_CHECKSUM_CONFIG, acx, sizeof(*acx)); | |
75 | if (ret < 0) { | |
76 | wl1271_warning("failed to set Tx checksum state: %d", ret); | |
77 | goto out; | |
78 | } | |
79 | ||
80 | out: | |
81 | kfree(acx); | |
82 | return ret; | |
83 | } |