aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-18 02:01:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:51 -0500
commit5844d12ea30bacae9224db6561a16e86ad31c6e5 (patch)
tree2487845a1cc973a9a81511497b48dcef7e0e93d9 /drivers/net/wireless/libertas/cmd.c
parentf15ebb63b36eca5fa68fabd04ab2f7840bc67205 (diff)
libertas: convert SUBSCRIBE_EVENT to a direct command
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r--drivers/net/wireless/libertas/cmd.c52
1 files changed, 1 insertions, 51 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 5d2c928fdd36..4d06dec6cd46 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -327,53 +327,6 @@ int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
327 return ret; 327 return ret;
328} 328}
329 329
330
331static ssize_t lbs_tlv_size(const u8 *tlv, u16 size)
332{
333 ssize_t pos = 0;
334 struct mrvlietypesheader *tlv_h;
335 while (pos < size) {
336 u16 length;
337 tlv_h = (struct mrvlietypesheader *) tlv;
338 if (tlv_h->len == 0)
339 return pos;
340 length = le16_to_cpu(tlv_h->len) +
341 sizeof(struct mrvlietypesheader);
342 pos += length;
343 tlv += length;
344 }
345 return pos;
346}
347
348
349static void lbs_cmd_802_11_subscribe_event(struct lbs_private *priv,
350 struct cmd_ds_command *cmd, u16 cmd_action,
351 void *pdata_buf)
352{
353 struct cmd_ds_802_11_subscribe_event *events =
354 (struct cmd_ds_802_11_subscribe_event *) pdata_buf;
355
356 /* pdata_buf points to a struct cmd_ds_802_11_subscribe_event and room
357 * for various Marvell TLVs */
358
359 lbs_deb_enter(LBS_DEB_CMD);
360
361 cmd->size = cpu_to_le16(sizeof(*events)
362 - sizeof(events->tlv)
363 + S_DS_GEN);
364 cmd->params.subscribe_event.action = cpu_to_le16(cmd_action);
365 if (cmd_action == CMD_ACT_GET) {
366 cmd->params.subscribe_event.events = 0;
367 } else {
368 ssize_t sz = lbs_tlv_size(events->tlv, sizeof(events->tlv));
369 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) + sz);
370 cmd->params.subscribe_event.events = events->events;
371 memcpy(cmd->params.subscribe_event.tlv, events->tlv, sz);
372 }
373
374 lbs_deb_leave(LBS_DEB_CMD);
375}
376
377static void set_one_wpa_key(struct MrvlIEtype_keyParamSet * pkeyparamset, 330static void set_one_wpa_key(struct MrvlIEtype_keyParamSet * pkeyparamset,
378 struct enc_key * pkey) 331 struct enc_key * pkey)
379{ 332{
@@ -1545,10 +1498,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1545 ret = 0; 1498 ret = 0;
1546 break; 1499 break;
1547 } 1500 }
1548 case CMD_802_11_SUBSCRIBE_EVENT: 1501
1549 lbs_cmd_802_11_subscribe_event(priv, cmdptr,
1550 cmd_action, pdata_buf);
1551 break;
1552 case CMD_802_11_PWR_CFG: 1502 case CMD_802_11_PWR_CFG:
1553 cmdptr->command = cpu_to_le16(CMD_802_11_PWR_CFG); 1503 cmdptr->command = cpu_to_le16(CMD_802_11_PWR_CFG);
1554 cmdptr->size = 1504 cmdptr->size =