aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/mesh.c
diff options
context:
space:
mode:
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