acx.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include "../wlcore/cmd.h"
  22. #include "../wlcore/debug.h"
  23. #include "../wlcore/acx.h"
  24. #include "acx.h"
  25. int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
  26. u32 sdio_blk_size, u32 extra_mem_blks,
  27. u32 len_field_size)
  28. {
  29. struct wl18xx_acx_host_config_bitmap *bitmap_conf;
  30. int ret;
  31. bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL);
  32. if (!bitmap_conf) {
  33. ret = -ENOMEM;
  34. goto out;
  35. }
  36. bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap);
  37. bitmap_conf->host_sdio_block_size = cpu_to_le32(sdio_blk_size);
  38. bitmap_conf->extra_mem_blocks = cpu_to_le32(extra_mem_blks);
  39. bitmap_conf->length_field_size = cpu_to_le32(len_field_size);
  40. ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP,
  41. bitmap_conf, sizeof(*bitmap_conf));
  42. if (ret < 0) {
  43. wl1271_warning("wl1271 bitmap config opt failed: %d", ret);
  44. goto out;
  45. }
  46. out:
  47. kfree(bitmap_conf);
  48. return ret;
  49. }