cmd.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 2007, Red Hat, Inc. */
  2. #ifndef _LBS_CMD_H_
  3. #define _LBS_CMD_H_
  4. #include "hostcmd.h"
  5. #include "dev.h"
  6. #define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \
  7. __lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg)
  8. /* lbs_cmd_with_response() infers the size of the command to be _sent_
  9. and requires that the caller sets cmd->size to the (LE) size of
  10. the _response_ buffer. */
  11. #define lbs_cmd_with_response(priv, cmdnr, cmd) \
  12. lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))
  13. /* __lbs_cmd() will free the cmdnode and return success/failure.
  14. __lbs_cmd_async() requires that the callback free the cmdnode */
  15. struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, uint16_t command,
  16. struct cmd_header *in_cmd, int in_cmd_size,
  17. int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *),
  18. unsigned long callback_arg);
  19. int __lbs_cmd(struct lbs_private *priv, uint16_t command,
  20. struct cmd_header *in_cmd, int in_cmd_size,
  21. int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *),
  22. unsigned long callback_arg);
  23. int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
  24. struct cmd_header *resp);
  25. int lbs_update_hw_spec(struct lbs_private *priv);
  26. int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
  27. struct cmd_ds_mesh_access *cmd);
  28. int lbs_get_data_rate(struct lbs_private *priv);
  29. int lbs_set_data_rate(struct lbs_private *priv, u8 rate);
  30. int lbs_get_channel(struct lbs_private *priv);
  31. int lbs_set_channel(struct lbs_private *priv, u8 channel);
  32. int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
  33. int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
  34. int lbs_suspend(struct lbs_private *priv);
  35. int lbs_resume(struct lbs_private *priv);
  36. #endif /* _LBS_CMD_H */