aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r--drivers/net/wireless/libertas/cmd.c87
1 files changed, 76 insertions, 11 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 0fa6b0e59ea5..6c8a9d952a01 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -7,13 +7,8 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/slab.h> 8#include <linux/slab.h>
9 9
10#include "host.h"
11#include "decl.h" 10#include "decl.h"
12#include "defs.h" 11#include "cfg.h"
13#include "dev.h"
14#include "assoc.h"
15#include "wext.h"
16#include "scan.h"
17#include "cmd.h" 12#include "cmd.h"
18 13
19 14
@@ -177,11 +172,6 @@ int lbs_update_hw_spec(struct lbs_private *priv)
177 if (priv->mesh_dev) 172 if (priv->mesh_dev)
178 memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN); 173 memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
179 174
180 if (lbs_set_regiontable(priv, priv->regioncode, 0)) {
181 ret = -1;
182 goto out;
183 }
184
185out: 175out:
186 lbs_deb_leave(LBS_DEB_CMD); 176 lbs_deb_leave(LBS_DEB_CMD);
187 return ret; 177 return ret;
@@ -909,6 +899,66 @@ void lbs_set_mac_control(struct lbs_private *priv)
909} 899}
910 900
911/** 901/**
902 * @brief This function implements command CMD_802_11D_DOMAIN_INFO
903 * @param priv pointer to struct lbs_private
904 * @param cmd pointer to cmd buffer
905 * @param cmdno cmd ID
906 * @param cmdOption cmd action
907 * @return 0
908*/
909int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
910 struct cmd_ds_command *cmd,
911 u16 cmdoption)
912{
913 struct cmd_ds_802_11d_domain_info *pdomaininfo =
914 &cmd->params.domaininfo;
915 struct mrvl_ie_domain_param_set *domain = &pdomaininfo->domain;
916 u8 nr_triplet = priv->domain_reg.no_triplet;
917
918 lbs_deb_enter(LBS_DEB_11D);
919
920 lbs_deb_11d("nr_triplet=%x\n", nr_triplet);
921
922 pdomaininfo->action = cpu_to_le16(cmdoption);
923 if (cmdoption == CMD_ACT_GET) {
924 cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
925 sizeof(struct cmd_header));
926 lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
927 le16_to_cpu(cmd->size));
928 goto done;
929 }
930
931 domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
932 memcpy(domain->countrycode, priv->domain_reg.country_code,
933 sizeof(domain->countrycode));
934
935 domain->header.len = cpu_to_le16(nr_triplet
936 * sizeof(struct ieee80211_country_ie_triplet)
937 + sizeof(domain->countrycode));
938
939 if (nr_triplet) {
940 memcpy(domain->triplet, priv->domain_reg.triplet,
941 nr_triplet *
942 sizeof(struct ieee80211_country_ie_triplet));
943
944 cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
945 le16_to_cpu(domain->header.len) +
946 sizeof(struct mrvl_ie_header) +
947 sizeof(struct cmd_header));
948 } else {
949 cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
950 sizeof(struct cmd_header));
951 }
952
953 lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
954 le16_to_cpu(cmd->size));
955
956done:
957 lbs_deb_enter(LBS_DEB_11D);
958 return 0;
959}
960
961/**
912 * @brief This function prepare the command before send to firmware. 962 * @brief This function prepare the command before send to firmware.
913 * 963 *
914 * @param priv A pointer to struct lbs_private structure 964 * @param priv A pointer to struct lbs_private structure
@@ -1006,6 +1056,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1006 ret = 0; 1056 ret = 0;
1007 goto done; 1057 goto done;
1008 1058
1059 case CMD_802_11D_DOMAIN_INFO:
1060 cmdptr->command = cpu_to_le16(cmd_no);
1061 ret = lbs_cmd_802_11d_domain_info(priv, cmdptr, cmd_action);
1062 break;
1063
1009 case CMD_802_11_TPC_CFG: 1064 case CMD_802_11_TPC_CFG:
1010 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG); 1065 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
1011 cmdptr->size = 1066 cmdptr->size =
@@ -1325,6 +1380,15 @@ int lbs_execute_next_command(struct lbs_private *priv)
1325 * check if in power save mode, if yes, put the device back 1380 * check if in power save mode, if yes, put the device back
1326 * to PS mode 1381 * to PS mode
1327 */ 1382 */
1383#ifdef TODO
1384 /*
1385 * This was the old code for libertas+wext. Someone that
1386 * understands this beast should re-code it in a sane way.
1387 *
1388 * I actually don't understand why this is related to WPA
1389 * and to connection status, shouldn't powering should be
1390 * independ of such things?
1391 */
1328 if ((priv->psmode != LBS802_11POWERMODECAM) && 1392 if ((priv->psmode != LBS802_11POWERMODECAM) &&
1329 (priv->psstate == PS_STATE_FULL_POWER) && 1393 (priv->psstate == PS_STATE_FULL_POWER) &&
1330 ((priv->connect_status == LBS_CONNECTED) || 1394 ((priv->connect_status == LBS_CONNECTED) ||
@@ -1346,6 +1410,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
1346 lbs_ps_sleep(priv, 0); 1410 lbs_ps_sleep(priv, 0);
1347 } 1411 }
1348 } 1412 }
1413#endif
1349 } 1414 }
1350 1415
1351 ret = 0; 1416 ret = 0;