aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2009-10-22 09:30:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:39 -0400
commit8ec97cc803e1d52022e916074415acaec276288c (patch)
tree911a0c21873162726e23942a175d1cc2f990e5d9
parentb856f73b39ca6b619e6e8d088141aec3ff62852c (diff)
libertas: remove "struct cmd_ds_gen"
It was only used as a source for S_DS_GEN, but the size of this struct is equal to the size of "struct cmd_header". Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/assoc.c7
-rw-r--r--drivers/net/wireless/libertas/cmd.c22
-rw-r--r--drivers/net/wireless/libertas/host.h13
-rw-r--r--drivers/net/wireless/libertas/scan.c4
4 files changed, 18 insertions, 28 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 17e76ac4179..4ce554ac900 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -279,7 +279,7 @@ int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
279 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 279 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
280 280
281 if (cmd_action == CMD_ACT_GET) { 281 if (cmd_action == CMD_ACT_GET) {
282 cmd.hdr.size = cpu_to_le16(S_DS_GEN + 2); 282 cmd.hdr.size = cpu_to_le16(sizeof(struct cmd_header) + 2);
283 } else { 283 } else {
284 memset(cmd.keyParamSet, 0, sizeof(cmd.keyParamSet)); 284 memset(cmd.keyParamSet, 0, sizeof(cmd.keyParamSet));
285 285
@@ -456,7 +456,8 @@ int lbs_cmd_802_11_rssi(struct lbs_private *priv,
456 456
457 lbs_deb_enter(LBS_DEB_CMD); 457 lbs_deb_enter(LBS_DEB_CMD);
458 cmd->command = cpu_to_le16(CMD_802_11_RSSI); 458 cmd->command = cpu_to_le16(CMD_802_11_RSSI);
459 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) + S_DS_GEN); 459 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) +
460 sizeof(struct cmd_header));
460 cmd->params.rssi.N = cpu_to_le16(DEFAULT_BCN_AVG_FACTOR); 461 cmd->params.rssi.N = cpu_to_le16(DEFAULT_BCN_AVG_FACTOR);
461 462
462 /* reset Beacon SNR/NF/RSSI values */ 463 /* reset Beacon SNR/NF/RSSI values */
@@ -514,7 +515,7 @@ int lbs_cmd_bcn_ctrl(struct lbs_private *priv,
514 lbs_deb_enter(LBS_DEB_CMD); 515 lbs_deb_enter(LBS_DEB_CMD);
515 cmd->size = 516 cmd->size =
516 cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control) 517 cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control)
517 + S_DS_GEN); 518 + sizeof(struct cmd_header));
518 cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL); 519 cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL);
519 520
520 bcn_ctrl->action = cpu_to_le16(cmd_action); 521 bcn_ctrl->action = cpu_to_le16(cmd_action);
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index b7b562445cf..5326483b50d 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -239,7 +239,7 @@ static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd,
239 239
240 cmd->command = cpu_to_le16(CMD_802_11_PS_MODE); 240 cmd->command = cpu_to_le16(CMD_802_11_PS_MODE);
241 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + 241 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) +
242 S_DS_GEN); 242 sizeof(struct cmd_header));
243 psm->action = cpu_to_le16(cmd_action); 243 psm->action = cpu_to_le16(cmd_action);
244 psm->multipledtim = 0; 244 psm->multipledtim = 0;
245 switch (cmd_action) { 245 switch (cmd_action) {
@@ -534,7 +534,7 @@ static int lbs_cmd_802_11_monitor_mode(struct cmd_ds_command *cmd,
534 cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE); 534 cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE);
535 cmd->size = 535 cmd->size =
536 cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) + 536 cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) +
537 S_DS_GEN); 537 sizeof(struct cmd_header));
538 538
539 monitor->action = cpu_to_le16(cmd_action); 539 monitor->action = cpu_to_le16(cmd_action);
540 if (cmd_action == CMD_ACT_SET) { 540 if (cmd_action == CMD_ACT_SET) {
@@ -643,7 +643,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
643 643
644 cmdptr->size = 644 cmdptr->size =
645 cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access) 645 cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access)
646 + S_DS_GEN); 646 + sizeof(struct cmd_header));
647 macreg = 647 macreg =
648 (struct cmd_ds_mac_reg_access *)&cmdptr->params. 648 (struct cmd_ds_mac_reg_access *)&cmdptr->params.
649 macreg; 649 macreg;
@@ -662,7 +662,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
662 cmdptr->size = 662 cmdptr->size =
663 cpu_to_le16(sizeof 663 cpu_to_le16(sizeof
664 (struct cmd_ds_bbp_reg_access) 664 (struct cmd_ds_bbp_reg_access)
665 + S_DS_GEN); 665 + sizeof(struct cmd_header));
666 bbpreg = 666 bbpreg =
667 (struct cmd_ds_bbp_reg_access *)&cmdptr->params. 667 (struct cmd_ds_bbp_reg_access *)&cmdptr->params.
668 bbpreg; 668 bbpreg;
@@ -681,7 +681,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
681 cmdptr->size = 681 cmdptr->size =
682 cpu_to_le16(sizeof 682 cpu_to_le16(sizeof
683 (struct cmd_ds_rf_reg_access) + 683 (struct cmd_ds_rf_reg_access) +
684 S_DS_GEN); 684 sizeof(struct cmd_header));
685 rfreg = 685 rfreg =
686 (struct cmd_ds_rf_reg_access *)&cmdptr->params. 686 (struct cmd_ds_rf_reg_access *)&cmdptr->params.
687 rfreg; 687 rfreg;
@@ -708,7 +708,8 @@ static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
708 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); 708 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
709 709
710 cmd->command = cpu_to_le16(CMD_BT_ACCESS); 710 cmd->command = cpu_to_le16(CMD_BT_ACCESS);
711 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) + S_DS_GEN); 711 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) +
712 sizeof(struct cmd_header));
712 cmd->result = 0; 713 cmd->result = 0;
713 bt_access->action = cpu_to_le16(cmd_action); 714 bt_access->action = cpu_to_le16(cmd_action);
714 715
@@ -745,7 +746,8 @@ static int lbs_cmd_fwt_access(struct cmd_ds_command *cmd,
745 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); 746 lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
746 747
747 cmd->command = cpu_to_le16(CMD_FWT_ACCESS); 748 cmd->command = cpu_to_le16(CMD_FWT_ACCESS);
748 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) + S_DS_GEN); 749 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) +
750 sizeof(struct cmd_header));
749 cmd->result = 0; 751 cmd->result = 0;
750 752
751 if (pdata_buf) 753 if (pdata_buf)
@@ -1161,7 +1163,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1161 1163
1162 cmdptr->command = cpu_to_le16(cmd_no); 1164 cmdptr->command = cpu_to_le16(cmd_no);
1163 cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) + 1165 cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) +
1164 S_DS_GEN); 1166 sizeof(struct cmd_header));
1165 1167
1166 memmove(&cmdptr->params.afc, 1168 memmove(&cmdptr->params.afc,
1167 pdata_buf, sizeof(struct cmd_ds_802_11_afc)); 1169 pdata_buf, sizeof(struct cmd_ds_802_11_afc));
@@ -1173,7 +1175,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1173 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG); 1175 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
1174 cmdptr->size = 1176 cmdptr->size =
1175 cpu_to_le16(sizeof(struct cmd_ds_802_11_tpc_cfg) + 1177 cpu_to_le16(sizeof(struct cmd_ds_802_11_tpc_cfg) +
1176 S_DS_GEN); 1178 sizeof(struct cmd_header));
1177 1179
1178 memmove(&cmdptr->params.tpccfg, 1180 memmove(&cmdptr->params.tpccfg,
1179 pdata_buf, sizeof(struct cmd_ds_802_11_tpc_cfg)); 1181 pdata_buf, sizeof(struct cmd_ds_802_11_tpc_cfg));
@@ -1194,7 +1196,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1194 break; 1196 break;
1195 case CMD_802_11_DEEP_SLEEP: 1197 case CMD_802_11_DEEP_SLEEP:
1196 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP); 1198 cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
1197 cmdptr->size = cpu_to_le16(S_DS_GEN); 1199 cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
1198 break; 1200 break;
1199 default: 1201 default:
1200 lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no); 1202 lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no);
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index c600f67b2de..3809c0b4946 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -389,19 +389,6 @@ struct lbs_offset_value {
389 u32 value; 389 u32 value;
390} __attribute__ ((packed)); 390} __attribute__ ((packed));
391 391
392/* Define general data structure */
393/* cmd_DS_GEN */
394struct cmd_ds_gen {
395 __le16 command;
396 __le16 size;
397 __le16 seqnum;
398 __le16 result;
399 void *cmdresp[0];
400} __attribute__ ((packed));
401
402#define S_DS_GEN sizeof(struct cmd_ds_gen)
403
404
405/* 392/*
406 * Define data structure for CMD_GET_HW_SPEC 393 * Define data structure for CMD_GET_HW_SPEC
407 * This structure defines the response for the GET_HW_SPEC command 394 * This structure defines the response for the GET_HW_SPEC command
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 8273bcd216b..5f0a598a3b5 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -1291,11 +1291,11 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
1291 /* The size of the TLV buffer is equal to the entire command response 1291 /* The size of the TLV buffer is equal to the entire command response
1292 * size (scanrespsize) minus the fixed fields (sizeof()'s), the 1292 * size (scanrespsize) minus the fixed fields (sizeof()'s), the
1293 * BSS Descriptions (bssdescriptsize as bytesLef) and the command 1293 * BSS Descriptions (bssdescriptsize as bytesLef) and the command
1294 * response header (S_DS_GEN) 1294 * response header (sizeof(struct cmd_header))
1295 */ 1295 */
1296 tlvbufsize = scanrespsize - (bytesleft + sizeof(scanresp->bssdescriptsize) 1296 tlvbufsize = scanrespsize - (bytesleft + sizeof(scanresp->bssdescriptsize)
1297 + sizeof(scanresp->nr_sets) 1297 + sizeof(scanresp->nr_sets)
1298 + S_DS_GEN); 1298 + sizeof(struct cmd_header));
1299 1299
1300 /* 1300 /*
1301 * Process each scan response returned (scanresp->nr_sets). Save 1301 * Process each scan response returned (scanresp->nr_sets). Save