blob: 6efb81ec597edd8c0ece2e0727e5dd0501ff6f61 [file] [log] [blame]
Dan Williams14e865b2007-12-10 15:11:23 -05001/* Copyright (C) 2007, Red Hat, Inc. */
2
3#ifndef _LBS_CMD_H_
4#define _LBS_CMD_H_
5
6#include "hostcmd.h"
7#include "dev.h"
8
David Woodhouse689442d2007-12-12 16:00:42 -05009#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \
10 __lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg)
Dan Williams14e865b2007-12-10 15:11:23 -050011
David Woodhouse9fae8992007-12-15 03:46:44 -050012
13/* lbs_cmd_with_response() infers the size of the command to be _sent_
14 and requires that the caller sets cmd->size to the (LE) size of
15 the _response_ buffer. */
David Woodhouse689442d2007-12-12 16:00:42 -050016#define lbs_cmd_with_response(priv, cmdnr, cmd) \
17 lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))
David Woodhouse7e226272007-12-14 22:53:41 -050018
David Woodhouse3399ea52007-12-15 03:09:33 -050019/* __lbs_cmd() will free the cmdnode and return success/failure.
20 __lbs_cmd_async() requires that the callback free the cmdnode */
21struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, uint16_t command,
22 struct cmd_header *in_cmd, int in_cmd_size,
23 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *),
24 unsigned long callback_arg);
Dan Williams7ad994d2007-12-11 12:33:30 -050025int __lbs_cmd(struct lbs_private *priv, uint16_t command,
David Woodhouse7e226272007-12-14 22:53:41 -050026 struct cmd_header *in_cmd, int in_cmd_size,
Dan Williams7ad994d2007-12-11 12:33:30 -050027 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *),
Dan Williams14e865b2007-12-10 15:11:23 -050028 unsigned long callback_arg);
29
Dan Williamsa8bdcd72007-12-11 12:40:35 -050030int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
31 struct cmd_header *resp);
32
Dan Williams6e66f032007-12-11 12:42:16 -050033int lbs_update_hw_spec(struct lbs_private *priv);
34
David Woodhouse301eacb2007-12-11 15:23:59 -050035int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
36 struct cmd_ds_mesh_access *cmd);
37
Dan Williams8e3c91b2007-12-11 15:50:59 -050038int lbs_get_data_rate(struct lbs_private *priv);
39int lbs_set_data_rate(struct lbs_private *priv, u8 rate);
40
Dan Williams2dd4b262007-12-11 16:54:15 -050041int lbs_get_channel(struct lbs_private *priv);
42int lbs_set_channel(struct lbs_private *priv, u8 channel);
43
David Woodhouse86062132007-12-13 00:32:36 -050044int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
David Woodhouse23a397a2007-12-11 18:56:42 -050045
David Woodhouse506e9022007-12-12 20:06:06 -050046int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
David Woodhouseab25eca2007-12-12 17:38:56 -050047int lbs_suspend(struct lbs_private *priv);
48int lbs_resume(struct lbs_private *priv);
David Woodhouse6ce4fd22007-12-12 15:19:29 -050049
David Woodhouse6e5cc4f2007-12-17 23:04:37 -050050int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
51 uint16_t cmd_action, uint16_t *timeout);
David Woodhouse3fbe1042007-12-17 23:48:31 -050052int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
53 struct sleep_params *sp);
David Woodhousef70dd452007-12-18 00:18:05 -050054int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action,
55 struct assoc_request *assoc);
David Woodhouse4f59abf2007-12-18 00:47:17 -050056int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
57 uint16_t *enable);
David Woodhouse6e5cc4f2007-12-17 23:04:37 -050058
Dan Williams14e865b2007-12-10 15:11:23 -050059#endif /* _LBS_CMD_H */