mwl8k: prepare for posting per-vif firmware commands
One of the bytes in the mwl8k firmware command header is the 'macid' byte, which for per-vif commands indicates which of the BSSes this command is intended for. (For commands that are not per-vif commands, this byte can just be 0.) This patch adds mwl8k_post_pervif_cmd(), which will take the macid assigned to this interface (to be done in ->add_interface()), copy it into the command packet macid field, and post the command as usual. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
f5bb87cfba
commit
f57ca9c1af
@@ -214,6 +214,9 @@ struct mwl8k_vif {
|
|||||||
struct list_head list;
|
struct list_head list;
|
||||||
struct ieee80211_vif *vif;
|
struct ieee80211_vif *vif;
|
||||||
|
|
||||||
|
/* Firmware macid for this vif. */
|
||||||
|
int macid;
|
||||||
|
|
||||||
/* Non AMPDU sequence number assigned by driver. */
|
/* Non AMPDU sequence number assigned by driver. */
|
||||||
u16 seqno;
|
u16 seqno;
|
||||||
};
|
};
|
||||||
@@ -419,7 +422,8 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv)
|
|||||||
struct mwl8k_cmd_pkt {
|
struct mwl8k_cmd_pkt {
|
||||||
__le16 code;
|
__le16 code;
|
||||||
__le16 length;
|
__le16 length;
|
||||||
__le16 seq_num;
|
__u8 seq_num;
|
||||||
|
__u8 macid;
|
||||||
__le16 result;
|
__le16 result;
|
||||||
char payload[0];
|
char payload[0];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
@@ -477,6 +481,7 @@ static int mwl8k_load_fw_image(struct mwl8k_priv *priv,
|
|||||||
|
|
||||||
cmd->code = cpu_to_le16(MWL8K_CMD_CODE_DNLD);
|
cmd->code = cpu_to_le16(MWL8K_CMD_CODE_DNLD);
|
||||||
cmd->seq_num = 0;
|
cmd->seq_num = 0;
|
||||||
|
cmd->macid = 0;
|
||||||
cmd->result = 0;
|
cmd->result = 0;
|
||||||
|
|
||||||
done = 0;
|
done = 0;
|
||||||
@@ -1595,6 +1600,15 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mwl8k_post_pervif_cmd(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
struct mwl8k_cmd_pkt *cmd)
|
||||||
|
{
|
||||||
|
if (vif != NULL)
|
||||||
|
cmd->macid = MWL8K_VIF(vif)->macid;
|
||||||
|
return mwl8k_post_cmd(hw, cmd);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup code shared between STA and AP firmware images.
|
* Setup code shared between STA and AP firmware images.
|
||||||
*/
|
*/
|
||||||
@@ -3283,6 +3297,7 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
|
|||||||
mwl8k_vif = MWL8K_VIF(vif);
|
mwl8k_vif = MWL8K_VIF(vif);
|
||||||
memset(mwl8k_vif, 0, sizeof(*mwl8k_vif));
|
memset(mwl8k_vif, 0, sizeof(*mwl8k_vif));
|
||||||
mwl8k_vif->vif = vif;
|
mwl8k_vif->vif = vif;
|
||||||
|
mwl8k_vif->macid = 0;
|
||||||
mwl8k_vif->seqno = 0;
|
mwl8k_vif->seqno = 0;
|
||||||
|
|
||||||
list_add_tail(&mwl8k_vif->list, &priv->vif_list);
|
list_add_tail(&mwl8k_vif->list, &priv->vif_list);
|
||||||
|
Reference in New Issue
Block a user