提交 8ec97cc8 编写于 作者: H Holger Schurig 提交者: John W. Linville

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: NHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b856f73b
...@@ -279,7 +279,7 @@ int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action, ...@@ -279,7 +279,7 @@ int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
if (cmd_action == CMD_ACT_GET) { if (cmd_action == CMD_ACT_GET) {
cmd.hdr.size = cpu_to_le16(S_DS_GEN + 2); cmd.hdr.size = cpu_to_le16(sizeof(struct cmd_header) + 2);
} else { } else {
memset(cmd.keyParamSet, 0, sizeof(cmd.keyParamSet)); memset(cmd.keyParamSet, 0, sizeof(cmd.keyParamSet));
...@@ -456,7 +456,8 @@ int lbs_cmd_802_11_rssi(struct lbs_private *priv, ...@@ -456,7 +456,8 @@ int lbs_cmd_802_11_rssi(struct lbs_private *priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
cmd->command = cpu_to_le16(CMD_802_11_RSSI); cmd->command = cpu_to_le16(CMD_802_11_RSSI);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_rssi) +
sizeof(struct cmd_header));
cmd->params.rssi.N = cpu_to_le16(DEFAULT_BCN_AVG_FACTOR); cmd->params.rssi.N = cpu_to_le16(DEFAULT_BCN_AVG_FACTOR);
/* reset Beacon SNR/NF/RSSI values */ /* reset Beacon SNR/NF/RSSI values */
...@@ -514,7 +515,7 @@ int lbs_cmd_bcn_ctrl(struct lbs_private *priv, ...@@ -514,7 +515,7 @@ int lbs_cmd_bcn_ctrl(struct lbs_private *priv,
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
cmd->size = cmd->size =
cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control) cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control)
+ S_DS_GEN); + sizeof(struct cmd_header));
cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL); cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL);
bcn_ctrl->action = cpu_to_le16(cmd_action); bcn_ctrl->action = cpu_to_le16(cmd_action);
......
...@@ -239,7 +239,7 @@ static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd, ...@@ -239,7 +239,7 @@ static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd,
cmd->command = cpu_to_le16(CMD_802_11_PS_MODE); cmd->command = cpu_to_le16(CMD_802_11_PS_MODE);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) + cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_ps_mode) +
S_DS_GEN); sizeof(struct cmd_header));
psm->action = cpu_to_le16(cmd_action); psm->action = cpu_to_le16(cmd_action);
psm->multipledtim = 0; psm->multipledtim = 0;
switch (cmd_action) { switch (cmd_action) {
...@@ -534,7 +534,7 @@ static int lbs_cmd_802_11_monitor_mode(struct cmd_ds_command *cmd, ...@@ -534,7 +534,7 @@ static int lbs_cmd_802_11_monitor_mode(struct cmd_ds_command *cmd,
cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE); cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE);
cmd->size = cmd->size =
cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) + cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) +
S_DS_GEN); sizeof(struct cmd_header));
monitor->action = cpu_to_le16(cmd_action); monitor->action = cpu_to_le16(cmd_action);
if (cmd_action == CMD_ACT_SET) { if (cmd_action == CMD_ACT_SET) {
...@@ -643,7 +643,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr, ...@@ -643,7 +643,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
cmdptr->size = cmdptr->size =
cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access) cpu_to_le16(sizeof (struct cmd_ds_mac_reg_access)
+ S_DS_GEN); + sizeof(struct cmd_header));
macreg = macreg =
(struct cmd_ds_mac_reg_access *)&cmdptr->params. (struct cmd_ds_mac_reg_access *)&cmdptr->params.
macreg; macreg;
...@@ -662,7 +662,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr, ...@@ -662,7 +662,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
cmdptr->size = cmdptr->size =
cpu_to_le16(sizeof cpu_to_le16(sizeof
(struct cmd_ds_bbp_reg_access) (struct cmd_ds_bbp_reg_access)
+ S_DS_GEN); + sizeof(struct cmd_header));
bbpreg = bbpreg =
(struct cmd_ds_bbp_reg_access *)&cmdptr->params. (struct cmd_ds_bbp_reg_access *)&cmdptr->params.
bbpreg; bbpreg;
...@@ -681,7 +681,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr, ...@@ -681,7 +681,7 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
cmdptr->size = cmdptr->size =
cpu_to_le16(sizeof cpu_to_le16(sizeof
(struct cmd_ds_rf_reg_access) + (struct cmd_ds_rf_reg_access) +
S_DS_GEN); sizeof(struct cmd_header));
rfreg = rfreg =
(struct cmd_ds_rf_reg_access *)&cmdptr->params. (struct cmd_ds_rf_reg_access *)&cmdptr->params.
rfreg; rfreg;
...@@ -708,7 +708,8 @@ static int lbs_cmd_bt_access(struct cmd_ds_command *cmd, ...@@ -708,7 +708,8 @@ static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
cmd->command = cpu_to_le16(CMD_BT_ACCESS); cmd->command = cpu_to_le16(CMD_BT_ACCESS);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(struct cmd_ds_bt_access) +
sizeof(struct cmd_header));
cmd->result = 0; cmd->result = 0;
bt_access->action = cpu_to_le16(cmd_action); bt_access->action = cpu_to_le16(cmd_action);
...@@ -745,7 +746,8 @@ static int lbs_cmd_fwt_access(struct cmd_ds_command *cmd, ...@@ -745,7 +746,8 @@ static int lbs_cmd_fwt_access(struct cmd_ds_command *cmd,
lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action); lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
cmd->command = cpu_to_le16(CMD_FWT_ACCESS); cmd->command = cpu_to_le16(CMD_FWT_ACCESS);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(struct cmd_ds_fwt_access) +
sizeof(struct cmd_header));
cmd->result = 0; cmd->result = 0;
if (pdata_buf) if (pdata_buf)
...@@ -1161,7 +1163,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, ...@@ -1161,7 +1163,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
cmdptr->command = cpu_to_le16(cmd_no); cmdptr->command = cpu_to_le16(cmd_no);
cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) + cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_afc) +
S_DS_GEN); sizeof(struct cmd_header));
memmove(&cmdptr->params.afc, memmove(&cmdptr->params.afc,
pdata_buf, sizeof(struct cmd_ds_802_11_afc)); pdata_buf, sizeof(struct cmd_ds_802_11_afc));
...@@ -1173,7 +1175,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv, ...@@ -1173,7 +1175,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG); cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
cmdptr->size = cmdptr->size =
cpu_to_le16(sizeof(struct cmd_ds_802_11_tpc_cfg) + cpu_to_le16(sizeof(struct cmd_ds_802_11_tpc_cfg) +
S_DS_GEN); sizeof(struct cmd_header));
memmove(&cmdptr->params.tpccfg, memmove(&cmdptr->params.tpccfg,
pdata_buf, sizeof(struct cmd_ds_802_11_tpc_cfg)); 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,7 +1196,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
break; break;
case CMD_802_11_DEEP_SLEEP: case CMD_802_11_DEEP_SLEEP:
cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP); cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
cmdptr->size = cpu_to_le16(S_DS_GEN); cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
break; break;
default: default:
lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no); lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no);
......
...@@ -389,19 +389,6 @@ struct lbs_offset_value { ...@@ -389,19 +389,6 @@ struct lbs_offset_value {
u32 value; u32 value;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Define general data structure */
/* cmd_DS_GEN */
struct cmd_ds_gen {
__le16 command;
__le16 size;
__le16 seqnum;
__le16 result;
void *cmdresp[0];
} __attribute__ ((packed));
#define S_DS_GEN sizeof(struct cmd_ds_gen)
/* /*
* Define data structure for CMD_GET_HW_SPEC * Define data structure for CMD_GET_HW_SPEC
* This structure defines the response for the GET_HW_SPEC command * This structure defines the response for the GET_HW_SPEC command
......
...@@ -1291,11 +1291,11 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy, ...@@ -1291,11 +1291,11 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
/* The size of the TLV buffer is equal to the entire command response /* The size of the TLV buffer is equal to the entire command response
* size (scanrespsize) minus the fixed fields (sizeof()'s), the * size (scanrespsize) minus the fixed fields (sizeof()'s), the
* BSS Descriptions (bssdescriptsize as bytesLef) and the command * BSS Descriptions (bssdescriptsize as bytesLef) and the command
* response header (S_DS_GEN) * response header (sizeof(struct cmd_header))
*/ */
tlvbufsize = scanrespsize - (bytesleft + sizeof(scanresp->bssdescriptsize) tlvbufsize = scanrespsize - (bytesleft + sizeof(scanresp->bssdescriptsize)
+ sizeof(scanresp->nr_sets) + sizeof(scanresp->nr_sets)
+ S_DS_GEN); + sizeof(struct cmd_header));
/* /*
* Process each scan response returned (scanresp->nr_sets). Save * Process each scan response returned (scanresp->nr_sets). Save
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册