aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-15 02:38:17 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:34 -0500
commit75567670c66329a111c2b4f12d6c1fc02b3b14d2 (patch)
treec67721251a925dd4d1f8ac15644bdf45bf7473ea /drivers/net/wireless/libertas
parentad12d0f418b7d3bbc6d1ccc4ff0858361cf0aafe (diff)
libertas: kill pdata_buf member of struct cmd_ctrl_node
We can use the callback_arg for it; that's the way we're heading anyway... Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/cmd.c4
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c26
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h1
3 files changed, 14 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index e7f07c3098f4..f2e027b58101 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1280,7 +1280,6 @@ static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
1280 if (!cmdnode) 1280 if (!cmdnode)
1281 goto out; 1281 goto out;
1282 1282
1283 cmdnode->pdata_buf = NULL;
1284 cmdnode->callback = NULL; 1283 cmdnode->callback = NULL;
1285 cmdnode->callback_arg = 0; 1284 cmdnode->callback_arg = 0;
1286 1285
@@ -1801,9 +1800,8 @@ static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
1801 if (!ptempnode) 1800 if (!ptempnode)
1802 return; 1801 return;
1803 1802
1804 ptempnode->pdata_buf = pdata_buf;
1805 ptempnode->callback = NULL; 1803 ptempnode->callback = NULL;
1806 ptempnode->callback_arg = 0; 1804 ptempnode->callback_arg = (unsigned long)pdata_buf;
1807 1805
1808 lbs_deb_leave(LBS_DEB_HOST); 1806 lbs_deb_leave(LBS_DEB_HOST);
1809} 1807}
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 89f83165e04f..4c22e7849515 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -399,13 +399,13 @@ static int lbs_ret_802_11_enable_rsn(struct lbs_private *priv,
399 struct cmd_ds_command *resp) 399 struct cmd_ds_command *resp)
400{ 400{
401 struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn; 401 struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn;
402 u32 * pdata_buf = priv->cur_cmd->pdata_buf; 402 uint32_t * pdata_buf = (uint32_t *)priv->cur_cmd->callback_arg;
403 403
404 lbs_deb_enter(LBS_DEB_CMD); 404 lbs_deb_enter(LBS_DEB_CMD);
405 405
406 if (enable_rsn->action == cpu_to_le16(CMD_ACT_GET)) { 406 if (enable_rsn->action == cpu_to_le16(CMD_ACT_GET)) {
407 if (pdata_buf) 407 if (pdata_buf)
408 *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable); 408 *pdata_buf = (uint32_t) le16_to_cpu(enable_rsn->enable);
409 } 409 }
410 410
411 lbs_deb_leave(LBS_DEB_CMD); 411 lbs_deb_leave(LBS_DEB_CMD);
@@ -435,7 +435,7 @@ static int lbs_ret_802_11_subscribe_event(struct lbs_private *priv,
435 struct cmd_ds_802_11_subscribe_event *cmd_event = 435 struct cmd_ds_802_11_subscribe_event *cmd_event =
436 &resp->params.subscribe_event; 436 &resp->params.subscribe_event;
437 struct cmd_ds_802_11_subscribe_event *dst_event = 437 struct cmd_ds_802_11_subscribe_event *dst_event =
438 priv->cur_cmd->pdata_buf; 438 (void *)priv->cur_cmd->callback_arg;
439 439
440 lbs_deb_enter(LBS_DEB_CMD); 440 lbs_deb_enter(LBS_DEB_CMD);
441 441
@@ -505,7 +505,7 @@ static inline int handle_cmd_response(struct lbs_private *priv,
505 case CMD_RET(CMD_802_11_SET_AFC): 505 case CMD_RET(CMD_802_11_SET_AFC):
506 case CMD_RET(CMD_802_11_GET_AFC): 506 case CMD_RET(CMD_802_11_GET_AFC):
507 spin_lock_irqsave(&priv->driver_lock, flags); 507 spin_lock_irqsave(&priv->driver_lock, flags);
508 memmove(priv->cur_cmd->pdata_buf, &resp->params.afc, 508 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.afc,
509 sizeof(struct cmd_ds_802_11_afc)); 509 sizeof(struct cmd_ds_802_11_afc));
510 spin_unlock_irqrestore(&priv->driver_lock, flags); 510 spin_unlock_irqrestore(&priv->driver_lock, flags);
511 511
@@ -557,20 +557,20 @@ static inline int handle_cmd_response(struct lbs_private *priv,
557 break; 557 break;
558 case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT): 558 case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
559 spin_lock_irqsave(&priv->driver_lock, flags); 559 spin_lock_irqsave(&priv->driver_lock, flags);
560 *((u16 *) priv->cur_cmd->pdata_buf) = 560 *((uint16_t *) priv->cur_cmd->callback_arg) =
561 le16_to_cpu(resp->params.inactivity_timeout.timeout); 561 le16_to_cpu(resp->params.inactivity_timeout.timeout);
562 spin_unlock_irqrestore(&priv->driver_lock, flags); 562 spin_unlock_irqrestore(&priv->driver_lock, flags);
563 break; 563 break;
564 564
565 case CMD_RET(CMD_802_11_TPC_CFG): 565 case CMD_RET(CMD_802_11_TPC_CFG):
566 spin_lock_irqsave(&priv->driver_lock, flags); 566 spin_lock_irqsave(&priv->driver_lock, flags);
567 memmove(priv->cur_cmd->pdata_buf, &resp->params.tpccfg, 567 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
568 sizeof(struct cmd_ds_802_11_tpc_cfg)); 568 sizeof(struct cmd_ds_802_11_tpc_cfg));
569 spin_unlock_irqrestore(&priv->driver_lock, flags); 569 spin_unlock_irqrestore(&priv->driver_lock, flags);
570 break; 570 break;
571 case CMD_RET(CMD_802_11_LED_GPIO_CTRL): 571 case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
572 spin_lock_irqsave(&priv->driver_lock, flags); 572 spin_lock_irqsave(&priv->driver_lock, flags);
573 memmove(priv->cur_cmd->pdata_buf, &resp->params.ledgpio, 573 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio,
574 sizeof(struct cmd_ds_802_11_led_ctrl)); 574 sizeof(struct cmd_ds_802_11_led_ctrl));
575 spin_unlock_irqrestore(&priv->driver_lock, flags); 575 spin_unlock_irqrestore(&priv->driver_lock, flags);
576 break; 576 break;
@@ -580,7 +580,7 @@ static inline int handle_cmd_response(struct lbs_private *priv,
580 580
581 case CMD_RET(CMD_802_11_PWR_CFG): 581 case CMD_RET(CMD_802_11_PWR_CFG):
582 spin_lock_irqsave(&priv->driver_lock, flags); 582 spin_lock_irqsave(&priv->driver_lock, flags);
583 memmove(priv->cur_cmd->pdata_buf, &resp->params.pwrcfg, 583 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.pwrcfg,
584 sizeof(struct cmd_ds_802_11_pwr_cfg)); 584 sizeof(struct cmd_ds_802_11_pwr_cfg));
585 spin_unlock_irqrestore(&priv->driver_lock, flags); 585 spin_unlock_irqrestore(&priv->driver_lock, flags);
586 586
@@ -588,21 +588,21 @@ static inline int handle_cmd_response(struct lbs_private *priv,
588 588
589 case CMD_RET(CMD_GET_TSF): 589 case CMD_RET(CMD_GET_TSF):
590 spin_lock_irqsave(&priv->driver_lock, flags); 590 spin_lock_irqsave(&priv->driver_lock, flags);
591 memcpy(priv->cur_cmd->pdata_buf, 591 memcpy((void *)priv->cur_cmd->callback_arg,
592 &resp->params.gettsf.tsfvalue, sizeof(u64)); 592 &resp->params.gettsf.tsfvalue, sizeof(u64));
593 spin_unlock_irqrestore(&priv->driver_lock, flags); 593 spin_unlock_irqrestore(&priv->driver_lock, flags);
594 break; 594 break;
595 case CMD_RET(CMD_BT_ACCESS): 595 case CMD_RET(CMD_BT_ACCESS):
596 spin_lock_irqsave(&priv->driver_lock, flags); 596 spin_lock_irqsave(&priv->driver_lock, flags);
597 if (priv->cur_cmd->pdata_buf) 597 if (priv->cur_cmd->callback_arg)
598 memcpy(priv->cur_cmd->pdata_buf, 598 memcpy((void *)priv->cur_cmd->callback_arg,
599 &resp->params.bt.addr1, 2 * ETH_ALEN); 599 &resp->params.bt.addr1, 2 * ETH_ALEN);
600 spin_unlock_irqrestore(&priv->driver_lock, flags); 600 spin_unlock_irqrestore(&priv->driver_lock, flags);
601 break; 601 break;
602 case CMD_RET(CMD_FWT_ACCESS): 602 case CMD_RET(CMD_FWT_ACCESS):
603 spin_lock_irqsave(&priv->driver_lock, flags); 603 spin_lock_irqsave(&priv->driver_lock, flags);
604 if (priv->cur_cmd->pdata_buf) 604 if (priv->cur_cmd->callback_arg)
605 memcpy(priv->cur_cmd->pdata_buf, &resp->params.fwt, 605 memcpy((void *)priv->cur_cmd->callback_arg, &resp->params.fwt,
606 sizeof(resp->params.fwt)); 606 sizeof(resp->params.fwt));
607 spin_unlock_irqrestore(&priv->driver_lock, flags); 607 spin_unlock_irqrestore(&priv->driver_lock, flags);
608 break; 608 break;
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 1b31250fdab2..719da737aaf0 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -75,7 +75,6 @@ struct cmd_header {
75struct cmd_ctrl_node { 75struct cmd_ctrl_node {
76 struct list_head list; 76 struct list_head list;
77 /* command response */ 77 /* command response */
78 void *pdata_buf;
79 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *); 78 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
80 unsigned long callback_arg; 79 unsigned long callback_arg;
81 /* command data */ 80 /* command data */