Skip to content

Commit

Permalink
libertas: un-garbage various command structs
Browse files Browse the repository at this point in the history
Some command structs contain reserved or unused fields, which the driver
send uninitialized down to the card.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Holger Schurig authored and John W. Linville committed Apr 16, 2008
1 parent 7919b89 commit 8d0c7fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action,

lbs_deb_enter(LBS_DEB_CMD);

memset(&cmd, 0, sizeof(cmd));
cmd.hdr.command = cpu_to_le16(CMD_802_11_SET_WEP);
cmd.hdr.size = cpu_to_le16(sizeof(cmd));

Expand Down Expand Up @@ -359,7 +360,9 @@ int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(cmd_action);

if (cmd_action == CMD_ACT_SET) {
if (cmd_action == CMD_ACT_GET)
cmd.enable = 0;
else {
if (*enable)
cmd.enable = cpu_to_le16(CMD_ENABLE_RSN);
else
Expand Down Expand Up @@ -811,6 +814,7 @@ int lbs_get_channel(struct lbs_private *priv)

lbs_deb_enter(LBS_DEB_CMD);

memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);

Expand Down Expand Up @@ -858,6 +862,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)

lbs_deb_enter(LBS_DEB_CMD);

memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
cmd.channel = cpu_to_le16(channel);
Expand Down

0 comments on commit 8d0c7fa

Please sign in to comment.