xref: /openbmc/linux/drivers/net/wireless/ti/wl12xx/acx.c (revision bc5aa3a0)
1 /*
2  * This file is part of wl12xx
3  *
4  * Copyright (C) 2008-2009 Nokia Corporation
5  * Copyright (C) 2011 Texas Instruments Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  *
21  */
22 
23 #include "../wlcore/cmd.h"
24 #include "../wlcore/debug.h"
25 #include "../wlcore/acx.h"
26 
27 #include "acx.h"
28 
29 int wl1271_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap)
30 {
31 	struct wl1271_acx_host_config_bitmap *bitmap_conf;
32 	int ret;
33 
34 	bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL);
35 	if (!bitmap_conf) {
36 		ret = -ENOMEM;
37 		goto out;
38 	}
39 
40 	bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap);
41 
42 	ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP,
43 				   bitmap_conf, sizeof(*bitmap_conf));
44 	if (ret < 0) {
45 		wl1271_warning("wl1271 bitmap config opt failed: %d", ret);
46 		goto out;
47 	}
48 
49 out:
50 	kfree(bitmap_conf);
51 
52 	return ret;
53 }
54