blob: 36be4c9703e0b0c12fd4f0ee6f4b31db56bc8fe5 [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 Woodhousef15ebb62007-12-19 13:03:19 +00009/* lbs_cmd() infers the size of the buffer to copy data back into, from
10 the size of the target of the pointer. Since the command to be sent
11 may often be smaller, that size is set in cmd->size by the caller.*/
12#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) ({ \
13 uint16_t __sz = le16_to_cpu((cmd)->hdr.size); \
14 (cmd)->hdr.size = cpu_to_le16(sizeof(*(cmd))); \
15 __lbs_cmd(priv, cmdnr, &(cmd)->hdr, __sz, cb, cb_arg); \
16})
Dan Williams14e865b2007-12-10 15:11:23 -050017
David Woodhouse689442d2007-12-12 16:00:42 -050018#define lbs_cmd_with_response(priv, cmdnr, cmd) \
19 lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))
David Woodhouse7e226272007-12-14 22:53:41 -050020
Holger Schurig8db4a2b2008-03-19 10:11:00 +010021void lbs_cmd_async(struct lbs_private *priv, uint16_t command,
22 struct cmd_header *in_cmd, int in_cmd_size);
23
Dan Williams7ad994d2007-12-11 12:33:30 -050024int __lbs_cmd(struct lbs_private *priv, uint16_t command,
David Woodhouse7e226272007-12-14 22:53:41 -050025 struct cmd_header *in_cmd, int in_cmd_size,
Dan Williams7ad994d2007-12-11 12:33:30 -050026 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *),
Dan Williams14e865b2007-12-10 15:11:23 -050027 unsigned long callback_arg);
28
Anna Neal0112c9e2008-09-11 11:17:25 -070029int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
30 int8_t p1, int8_t p2);
31
32int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
33 int8_t p2, int usesnr);
34
Anna Neal3ed6e082008-09-26 11:34:35 -040035int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
36 int8_t p1, int8_t p2);
37
38int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
39 int8_t p2, int usesnr);
40
Dan Williamsa8bdcd72007-12-11 12:40:35 -050041int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
42 struct cmd_header *resp);
43
Dan Williams6e66f032007-12-11 12:42:16 -050044int lbs_update_hw_spec(struct lbs_private *priv);
45
David Woodhouse301eacb2007-12-11 15:23:59 -050046int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
47 struct cmd_ds_mesh_access *cmd);
48
Dan Williams8e3c91b2007-12-11 15:50:59 -050049int lbs_set_data_rate(struct lbs_private *priv, u8 rate);
50
Dan Williams2dd4b262007-12-11 16:54:15 -050051int lbs_get_channel(struct lbs_private *priv);
52int lbs_set_channel(struct lbs_private *priv, u8 channel);
53
Javier Cardonaedaea5c2008-05-17 00:55:10 -070054int lbs_mesh_config_send(struct lbs_private *priv,
55 struct cmd_ds_mesh_config *cmd,
56 uint16_t action, uint16_t type);
David Woodhouse86062132007-12-13 00:32:36 -050057int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
David Woodhouse23a397a2007-12-11 18:56:42 -050058
David Woodhouse506e9022007-12-12 20:06:06 -050059int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
David Woodhouseab25eca2007-12-12 17:38:56 -050060int lbs_suspend(struct lbs_private *priv);
Holger Schuriga63e5cb2008-04-30 10:50:39 +020061void lbs_resume(struct lbs_private *priv);
David Woodhouse6ce4fd22007-12-12 15:19:29 -050062
Javier Cardona85319f92008-05-24 10:59:49 +010063int lbs_cmd_802_11_rate_adapt_rateset(struct lbs_private *priv,
64 uint16_t cmd_action);
David Woodhouse6e5cc4f2007-12-17 23:04:37 -050065int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
66 uint16_t cmd_action, uint16_t *timeout);
David Woodhouse3fbe1042007-12-17 23:48:31 -050067int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
68 struct sleep_params *sp);
David Woodhousef70dd452007-12-18 00:18:05 -050069int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action,
70 struct assoc_request *assoc);
David Woodhouse4f59abf2007-12-18 00:47:17 -050071int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
72 uint16_t *enable);
David Woodhouse9e1228d2008-03-03 12:15:39 +010073int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
74 struct assoc_request *assoc);
David Woodhouse6e5cc4f2007-12-17 23:04:37 -050075
Dan Williams87c8c722008-08-19 15:15:35 -040076int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel,
77 s16 *maxlevel);
78int lbs_set_tx_power(struct lbs_private *priv, s16 dbm);
79
Dan Williamsd5db2df2008-08-21 17:51:07 -040080int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on);
81
Dan Williams39fcf7a2008-09-10 12:49:00 -040082int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val);
83
84int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val);
85
Dan Williams14e865b2007-12-10 15:11:23 -050086#endif /* _LBS_CMD_H */