uap_cmd.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Marvell Wireless LAN device driver: AP specific command handling
  3. *
  4. * Copyright (C) 2012, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #include "main.h"
  20. /* This function prepares the AP specific commands before sending them
  21. * to the firmware.
  22. * This is a generic function which calls specific command preparation
  23. * routines based upon the command number.
  24. */
  25. int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
  26. u16 cmd_action, u32 cmd_oid,
  27. void *data_buf, void *cmd_buf)
  28. {
  29. struct host_cmd_ds_command *cmd = cmd_buf;
  30. switch (cmd_no) {
  31. case HostCmd_CMD_UAP_BSS_START:
  32. case HostCmd_CMD_UAP_BSS_STOP:
  33. cmd->command = cpu_to_le16(cmd_no);
  34. cmd->size = cpu_to_le16(S_DS_GEN);
  35. break;
  36. default:
  37. dev_err(priv->adapter->dev,
  38. "PREP_CMD: unknown cmd %#x\n", cmd_no);
  39. return -1;
  40. }
  41. return 0;
  42. }