diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-11-26 10:07:14 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:04:55 -0800 |
commit | 3a1886491710c196656a005fcc693172f5bb4c8a (patch) | |
tree | c33009fb8cacd0fdea6fe7b7fdb7b5269c3063e4 /drivers/net/wireless/libertas/cmdresp.c | |
parent | 69f9032d9dfeb763b467fdbe8cf5938f5457083a (diff) | |
download | lwn-3a1886491710c196656a005fcc693172f5bb4c8a.tar.gz lwn-3a1886491710c196656a005fcc693172f5bb4c8a.zip |
libertas: rework event subscription
This patch moves re-works the implementation of event subscription
via debugfs. For this:
* it tells cmd.c and cmdresp.c about CMD_802_11_SUBSCRIBE_EVENT
* removes lots of low-level cmd stuff from debugfs.c
* create unified functions to read/write snr, rssi, bcnmiss and
failcount
* introduces #define's for subscription event bitmask values
* add a function to search for a specific element in an IE
(a.k.a. TLV)
* add a function to find out the size of the TLV. This is needed
because lbs_prepare_and_send_command() has an argument for a
data buffer, but not for it's lengths and TLVs can be, by
definition, vary in size.
* fix a bug where it was not possible to disable an event
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 3596957f1d5a..87b5bd2988e7 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c @@ -554,6 +554,26 @@ static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv, return 0; } +static int lbs_ret_802_11_subscribe_event(struct lbs_private *priv, + struct cmd_ds_command *resp) +{ + struct lbs_adapter *adapter = priv->adapter; + struct cmd_ds_802_11_subscribe_event *cmd_event = + &resp->params.subscribe_event; + struct cmd_ds_802_11_subscribe_event *dst_event = + adapter->cur_cmd->pdata_buf; + + lbs_deb_enter(LBS_DEB_CMD); + + if (dst_event->action == cpu_to_le16(CMD_ACT_GET)) { + dst_event->events = le16_to_cpu(cmd_event->events); + memcpy(dst_event->tlv, cmd_event->tlv, sizeof(dst_event->tlv)); + } + + lbs_deb_leave(LBS_DEB_CMD); + return 0; +} + static inline int handle_cmd_response(u16 respcmd, struct cmd_ds_command *resp, struct lbs_private *priv) @@ -689,6 +709,10 @@ static inline int handle_cmd_response(u16 respcmd, sizeof(struct cmd_ds_802_11_led_ctrl)); spin_unlock_irqrestore(&adapter->driver_lock, flags); break; + case CMD_RET(CMD_802_11_SUBSCRIBE_EVENT): + ret = lbs_ret_802_11_subscribe_event(priv, resp); + break; + case CMD_RET(CMD_802_11_PWR_CFG): spin_lock_irqsave(&adapter->driver_lock, flags); memmove(adapter->cur_cmd->pdata_buf, &resp->params.pwrcfg, |