aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/mesh.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-07-27 16:03:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-27 15:11:38 -0400
commita6bb1bcebced1eeed6a96f37cda7cbb7cbd6dae6 (patch)
tree99dc476a4a6c4c6125f9e18366127a516534b926 /drivers/net/wireless/libertas/mesh.c
parent52148655608b31b7e18325ae7711de3a86466136 (diff)
libertas: convert CMD_FWT_ACCESS to a direct command
Slightly different approach here since there are so many arguments to the firmware command. Just let the caller fill them in before pushing the command to the firmware. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
-rw-r--r--drivers/net/wireless/libertas/mesh.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index 35ee574f588f..194762ab0142 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -613,25 +613,31 @@ int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1)
613 return ret; 613 return ret;
614} 614}
615 615
616int lbs_cmd_fwt_access(struct cmd_ds_command *cmd, 616/**
617 u16 cmd_action, void *pdata_buf) 617 * @brief Access the mesh forwarding table
618 *
619 * @param priv A pointer to struct lbs_private structure
620 * @param cmd_action The forwarding table action to perform
621 * @param cmd The pre-filled FWT_ACCESS command
622 *
623 * @return 0 on success and 'cmd' will be filled with the
624 * firmware's response
625 */
626int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action,
627 struct cmd_ds_fwt_access *cmd)
618{ 628{
619 struct cmd_ds_fwt_access *fwt_access = &cmd->params.fwt; 629 int ret;
620 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
621 630
622 cmd->command = cpu_to_le16(CMD_FWT_ACCESS); 631 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
623 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) +
624 sizeof(struct cmd_header));
625 cmd->result = 0;
626 632
627 if (pdata_buf) 633 cmd->hdr.command = cpu_to_le16(CMD_FWT_ACCESS);
628 memcpy(fwt_access, pdata_buf, sizeof(*fwt_access)); 634 cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access));
629 else 635 cmd->hdr.result = 0;
630 memset(fwt_access, 0, sizeof(*fwt_access)); 636 cmd->action = cpu_to_le16(cmd_action);
631 637
632 fwt_access->action = cpu_to_le16(cmd_action); 638 ret = lbs_cmd_with_response(priv, CMD_FWT_ACCESS, cmd);
633 639
634 lbs_deb_leave(LBS_DEB_CMD); 640 lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
635 return 0; 641 return 0;
636} 642}
637 643