aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-01-12 07:49:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 14:21:19 -0500
commitf5bb87cfba5ae9dd3724b846ac2fa7e033425c1c (patch)
tree1aaf8a97d636a4b711f2073d2b1267d8d970bfc5 /drivers/net/wireless/mwl8k.c
parent06953235f48c696b22c5ed45570680fb070f7277 (diff)
mwl8k: convert the priv->vif pointer to a list of vifs
To prepare for adding multi-BSS support. 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.c51
1 files changed, 35 insertions, 16 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 382ef4305a3..ee7d8a6329f 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -160,7 +160,8 @@ struct mwl8k_priv {
160 /* TX quiesce completion, protected by fw_mutex and tx_lock */ 160 /* TX quiesce completion, protected by fw_mutex and tx_lock */
161 struct completion *tx_wait; 161 struct completion *tx_wait;
162 162
163 struct ieee80211_vif *vif; 163 /* List of interfaces. */
164 struct list_head vif_list;
164 165
165 /* power management status cookie from firmware */ 166 /* power management status cookie from firmware */
166 u32 *cookie; 167 u32 *cookie;
@@ -210,6 +211,9 @@ struct mwl8k_priv {
210 211
211/* Per interface specific private data */ 212/* Per interface specific private data */
212struct mwl8k_vif { 213struct mwl8k_vif {
214 struct list_head list;
215 struct ieee80211_vif *vif;
216
213 /* Non AMPDU sequence number assigned by driver. */ 217 /* Non AMPDU sequence number assigned by driver. */
214 u16 seqno; 218 u16 seqno;
215}; 219};
@@ -3246,7 +3250,7 @@ static void mwl8k_stop(struct ieee80211_hw *hw)
3246} 3250}
3247 3251
3248static int mwl8k_add_interface(struct ieee80211_hw *hw, 3252static int mwl8k_add_interface(struct ieee80211_hw *hw,
3249 struct ieee80211_vif *vif) 3253 struct ieee80211_vif *vif)
3250{ 3254{
3251 struct mwl8k_priv *priv = hw->priv; 3255 struct mwl8k_priv *priv = hw->priv;
3252 struct mwl8k_vif *mwl8k_vif; 3256 struct mwl8k_vif *mwl8k_vif;
@@ -3254,7 +3258,7 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
3254 /* 3258 /*
3255 * We only support one active interface at a time. 3259 * We only support one active interface at a time.
3256 */ 3260 */
3257 if (priv->vif != NULL) 3261 if (!list_empty(&priv->vif_list))
3258 return -EBUSY; 3262 return -EBUSY;
3259 3263
3260 /* 3264 /*
@@ -3275,14 +3279,13 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
3275 if (priv->ap_fw) 3279 if (priv->ap_fw)
3276 mwl8k_cmd_set_new_stn_add_self(hw, vif); 3280 mwl8k_cmd_set_new_stn_add_self(hw, vif);
3277 3281
3278 /* Clean out driver private area */ 3282 /* Setup driver private area. */
3279 mwl8k_vif = MWL8K_VIF(vif); 3283 mwl8k_vif = MWL8K_VIF(vif);
3280 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif)); 3284 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif));
3281 3285 mwl8k_vif->vif = vif;
3282 /* Set Initial sequence number to zero */
3283 mwl8k_vif->seqno = 0; 3286 mwl8k_vif->seqno = 0;
3284 3287
3285 priv->vif = vif; 3288 list_add_tail(&mwl8k_vif->list, &priv->vif_list);
3286 3289
3287 return 0; 3290 return 0;
3288} 3291}
@@ -3291,13 +3294,14 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw,
3291 struct ieee80211_vif *vif) 3294 struct ieee80211_vif *vif)
3292{ 3295{
3293 struct mwl8k_priv *priv = hw->priv; 3296 struct mwl8k_priv *priv = hw->priv;
3297 struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
3294 3298
3295 if (priv->ap_fw) 3299 if (priv->ap_fw)
3296 mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr); 3300 mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr);
3297 3301
3298 mwl8k_cmd_set_mac_addr(hw, "\x00\x00\x00\x00\x00\x00"); 3302 mwl8k_cmd_set_mac_addr(hw, "\x00\x00\x00\x00\x00\x00");
3299 3303
3300 priv->vif = NULL; 3304 list_del(&mwl8k_vif->list);
3301} 3305}
3302 3306
3303static int mwl8k_config(struct ieee80211_hw *hw, u32 changed) 3307static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
@@ -3526,7 +3530,7 @@ mwl8k_configure_filter_sniffer(struct ieee80211_hw *hw,
3526 * operation, so refuse to enable sniffer mode if a STA 3530 * operation, so refuse to enable sniffer mode if a STA
3527 * interface is active. 3531 * interface is active.
3528 */ 3532 */
3529 if (priv->vif != NULL) { 3533 if (!list_empty(&priv->vif_list)) {
3530 if (net_ratelimit()) 3534 if (net_ratelimit())
3531 printk(KERN_INFO "%s: not enabling sniffer " 3535 printk(KERN_INFO "%s: not enabling sniffer "
3532 "mode because STA interface is active\n", 3536 "mode because STA interface is active\n",
@@ -3547,6 +3551,14 @@ mwl8k_configure_filter_sniffer(struct ieee80211_hw *hw,
3547 return 1; 3551 return 1;
3548} 3552}
3549 3553
3554static struct mwl8k_vif *mwl8k_first_vif(struct mwl8k_priv *priv)
3555{
3556 if (!list_empty(&priv->vif_list))
3557 return list_entry(priv->vif_list.next, struct mwl8k_vif, list);
3558
3559 return NULL;
3560}
3561
3550static void mwl8k_configure_filter(struct ieee80211_hw *hw, 3562static void mwl8k_configure_filter(struct ieee80211_hw *hw,
3551 unsigned int changed_flags, 3563 unsigned int changed_flags,
3552 unsigned int *total_flags, 3564 unsigned int *total_flags,
@@ -3595,6 +3607,7 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw,
3595 */ 3607 */
3596 mwl8k_cmd_set_pre_scan(hw); 3608 mwl8k_cmd_set_pre_scan(hw);
3597 } else { 3609 } else {
3610 struct mwl8k_vif *mwl8k_vif;
3598 const u8 *bssid; 3611 const u8 *bssid;
3599 3612
3600 /* 3613 /*
@@ -3605,9 +3618,11 @@ static void mwl8k_configure_filter(struct ieee80211_hw *hw,
3605 * (where the OUI part needs to be nonzero for 3618 * (where the OUI part needs to be nonzero for
3606 * the BSSID to be accepted by POST_SCAN). 3619 * the BSSID to be accepted by POST_SCAN).
3607 */ 3620 */
3608 bssid = "\x01\x00\x00\x00\x00\x00"; 3621 mwl8k_vif = mwl8k_first_vif(priv);
3609 if (priv->vif != NULL) 3622 if (mwl8k_vif != NULL)
3610 bssid = priv->vif->bss_conf.bssid; 3623 bssid = mwl8k_vif->vif->bss_conf.bssid;
3624 else
3625 bssid = "\x01\x00\x00\x00\x00\x00";
3611 3626
3612 mwl8k_cmd_set_post_scan(hw, bssid); 3627 mwl8k_cmd_set_post_scan(hw, bssid);
3613 } 3628 }
@@ -3810,11 +3825,14 @@ static void mwl8k_finalize_join_worker(struct work_struct *work)
3810 struct mwl8k_priv *priv = 3825 struct mwl8k_priv *priv =
3811 container_of(work, struct mwl8k_priv, finalize_join_worker); 3826 container_of(work, struct mwl8k_priv, finalize_join_worker);
3812 struct sk_buff *skb = priv->beacon_skb; 3827 struct sk_buff *skb = priv->beacon_skb;
3828 struct mwl8k_vif *mwl8k_vif;
3813 3829
3814 mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, 3830 mwl8k_vif = mwl8k_first_vif(priv);
3815 priv->vif->bss_conf.dtim_period); 3831 if (mwl8k_vif != NULL)
3816 dev_kfree_skb(skb); 3832 mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len,
3833 mwl8k_vif->vif->bss_conf.dtim_period);
3817 3834
3835 dev_kfree_skb(skb);
3818 priv->beacon_skb = NULL; 3836 priv->beacon_skb = NULL;
3819} 3837}
3820 3838
@@ -3986,7 +4004,8 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
3986 hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_NOISE_DBM; 4004 hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_NOISE_DBM;
3987 hw->vif_data_size = sizeof(struct mwl8k_vif); 4005 hw->vif_data_size = sizeof(struct mwl8k_vif);
3988 hw->sta_data_size = sizeof(struct mwl8k_sta); 4006 hw->sta_data_size = sizeof(struct mwl8k_sta);
3989 priv->vif = NULL; 4007
4008 INIT_LIST_HEAD(&priv->vif_list);
3990 4009
3991 /* Set default radio state and preamble */ 4010 /* Set default radio state and preamble */
3992 priv->radio_on = 0; 4011 priv->radio_on = 0;