diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2010-01-12 07:50:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-12 14:21:20 -0500 |
commit | f57ca9c1af3c1e30a40ad99d75940176d8c3ff3a (patch) | |
tree | 996f555011d9f41158cb2f11a355792d1580c719 /drivers/net/wireless/mwl8k.c | |
parent | f5bb87cfba5ae9dd3724b846ac2fa7e033425c1c (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index ee7d8a6329f8..ea39ef64defe 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -214,6 +214,9 @@ struct mwl8k_vif { | |||
214 | struct list_head list; | 214 | struct list_head list; |
215 | struct ieee80211_vif *vif; | 215 | struct ieee80211_vif *vif; |
216 | 216 | ||
217 | /* Firmware macid for this vif. */ | ||
218 | int macid; | ||
219 | |||
217 | /* Non AMPDU sequence number assigned by driver. */ | 220 | /* Non AMPDU sequence number assigned by driver. */ |
218 | u16 seqno; | 221 | u16 seqno; |
219 | }; | 222 | }; |
@@ -419,7 +422,8 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv) | |||
419 | struct mwl8k_cmd_pkt { | 422 | struct mwl8k_cmd_pkt { |
420 | __le16 code; | 423 | __le16 code; |
421 | __le16 length; | 424 | __le16 length; |
422 | __le16 seq_num; | 425 | __u8 seq_num; |
426 | __u8 macid; | ||
423 | __le16 result; | 427 | __le16 result; |
424 | char payload[0]; | 428 | char payload[0]; |
425 | } __attribute__((packed)); | 429 | } __attribute__((packed)); |
@@ -477,6 +481,7 @@ static int mwl8k_load_fw_image(struct mwl8k_priv *priv, | |||
477 | 481 | ||
478 | cmd->code = cpu_to_le16(MWL8K_CMD_CODE_DNLD); | 482 | cmd->code = cpu_to_le16(MWL8K_CMD_CODE_DNLD); |
479 | cmd->seq_num = 0; | 483 | cmd->seq_num = 0; |
484 | cmd->macid = 0; | ||
480 | cmd->result = 0; | 485 | cmd->result = 0; |
481 | 486 | ||
482 | done = 0; | 487 | done = 0; |
@@ -1595,6 +1600,15 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1595 | return rc; | 1600 | return rc; |
1596 | } | 1601 | } |
1597 | 1602 | ||
1603 | static int mwl8k_post_pervif_cmd(struct ieee80211_hw *hw, | ||
1604 | struct ieee80211_vif *vif, | ||
1605 | struct mwl8k_cmd_pkt *cmd) | ||
1606 | { | ||
1607 | if (vif != NULL) | ||
1608 | cmd->macid = MWL8K_VIF(vif)->macid; | ||
1609 | return mwl8k_post_cmd(hw, cmd); | ||
1610 | } | ||
1611 | |||
1598 | /* | 1612 | /* |
1599 | * Setup code shared between STA and AP firmware images. | 1613 | * Setup code shared between STA and AP firmware images. |
1600 | */ | 1614 | */ |
@@ -3283,6 +3297,7 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw, | |||
3283 | mwl8k_vif = MWL8K_VIF(vif); | 3297 | mwl8k_vif = MWL8K_VIF(vif); |
3284 | memset(mwl8k_vif, 0, sizeof(*mwl8k_vif)); | 3298 | memset(mwl8k_vif, 0, sizeof(*mwl8k_vif)); |
3285 | mwl8k_vif->vif = vif; | 3299 | mwl8k_vif->vif = vif; |
3300 | mwl8k_vif->macid = 0; | ||
3286 | mwl8k_vif->seqno = 0; | 3301 | mwl8k_vif->seqno = 0; |
3287 | 3302 | ||
3288 | list_add_tail(&mwl8k_vif->list, &priv->vif_list); | 3303 | list_add_tail(&mwl8k_vif->list, &priv->vif_list); |