aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/cmd.c8
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c9
-rw-r--r--drivers/net/wireless/libertas/host.h3
-rw-r--r--drivers/net/wireless/libertas/mesh.c34
-rw-r--r--drivers/net/wireless/libertas/mesh.h6
5 files changed, 26 insertions, 34 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index dd25b2a9dbeb..2c96cf3400c9 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1206,14 +1206,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1206 ret = lbs_cmd_802_11_ps_mode(cmdptr, cmd_action); 1206 ret = lbs_cmd_802_11_ps_mode(cmdptr, cmd_action);
1207 break; 1207 break;
1208 1208
1209#ifdef CONFIG_LIBERTAS_MESH
1210
1211 case CMD_FWT_ACCESS:
1212 ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf);
1213 break;
1214
1215#endif
1216
1217 case CMD_802_11_DEEP_SLEEP: 1209 case CMD_802_11_DEEP_SLEEP:
1218 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP); 1210 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
1219 cmdptr->size = cpu_to_le16(sizeof(struct cmd_header)); 1211 cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 098b6453cb09..26a30db77d37 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -59,7 +59,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
59{ 59{
60 struct cmd_ds_command *resp = (struct cmd_ds_command *) cmd_response; 60 struct cmd_ds_command *resp = (struct cmd_ds_command *) cmd_response;
61 int ret = 0; 61 int ret = 0;
62 unsigned long flags;
63 uint16_t respcmd = le16_to_cpu(resp->command); 62 uint16_t respcmd = le16_to_cpu(resp->command);
64 63
65 lbs_deb_enter(LBS_DEB_HOST); 64 lbs_deb_enter(LBS_DEB_HOST);
@@ -68,14 +67,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
68 case CMD_RET(CMD_802_11_BEACON_STOP): 67 case CMD_RET(CMD_802_11_BEACON_STOP):
69 break; 68 break;
70 69
71 case CMD_RET(CMD_FWT_ACCESS):
72 spin_lock_irqsave(&priv->driver_lock, flags);
73 if (priv->cur_cmd->callback_arg)
74 memcpy((void *)priv->cur_cmd->callback_arg, &resp->params.fwt,
75 sizeof(resp->params.fwt));
76 spin_unlock_irqrestore(&priv->driver_lock, flags);
77 break;
78
79 default: 70 default:
80 lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n", 71 lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
81 le16_to_cpu(resp->command)); 72 le16_to_cpu(resp->command));
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index e8171777846a..03d2ae9bdd75 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -912,6 +912,8 @@ struct cmd_ds_bt_access {
912} __packed; 912} __packed;
913 913
914struct cmd_ds_fwt_access { 914struct cmd_ds_fwt_access {
915 struct cmd_header hdr;
916
915 __le16 action; 917 __le16 action;
916 __le32 id; 918 __le32 id;
917 u8 valid; 919 u8 valid;
@@ -961,7 +963,6 @@ struct cmd_ds_command {
961 /* command Body */ 963 /* command Body */
962 union { 964 union {
963 struct cmd_ds_802_11_ps_mode psmode; 965 struct cmd_ds_802_11_ps_mode psmode;
964 struct cmd_ds_fwt_access fwt;
965 } params; 966 } params;
966} __packed; 967} __packed;
967#endif 968#endif
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
diff --git a/drivers/net/wireless/libertas/mesh.h b/drivers/net/wireless/libertas/mesh.h
index 855497902d9f..afb2e8dead3f 100644
--- a/drivers/net/wireless/libertas/mesh.h
+++ b/drivers/net/wireless/libertas/mesh.h
@@ -8,6 +8,7 @@
8#include <net/iw_handler.h> 8#include <net/iw_handler.h>
9#include <net/lib80211.h> 9#include <net/lib80211.h>
10 10
11#include "host.h"
11 12
12#ifdef CONFIG_LIBERTAS_MESH 13#ifdef CONFIG_LIBERTAS_MESH
13 14
@@ -57,8 +58,9 @@ int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted);
57int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted); 58int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted);
58int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1); 59int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1);
59 60
60int lbs_cmd_fwt_access(struct cmd_ds_command *cmd, 61int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action,
61 u16 cmd_action, void *pdata_buf); 62 struct cmd_ds_fwt_access *cmd);
63
62int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, 64int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
63 struct cmd_ds_mesh_access *cmd); 65 struct cmd_ds_mesh_access *cmd);
64int lbs_mesh_config_send(struct lbs_private *priv, 66int lbs_mesh_config_send(struct lbs_private *priv,