diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-12-18 19:31:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:36 -0500 |
commit | 32bfd35d4b63bd63de4bb0d791ef049c3c868726 (patch) | |
tree | c1c213a35a00bcbe71a2ecc6521e19dec66cf6eb /drivers/net/wireless/iwlwifi/iwl4965-base.c | |
parent | f653211197f3841f383fa9757ef8ce182c6cf627 (diff) |
mac80211: dont use interface indices in drivers
This patch gets rid of the if_id stuff where possible in favour of
a new per-virtual-interface structure "struct ieee80211_vif". This
structure is located at the end of the per-interface structure and
contains a variable length driver-use data area.
This has two advantages:
* removes the need to look up interfaces by if_id, this is better
for working with network namespaces and performance
* allows drivers to store and retrieve per-interface data without
having to allocate own lists/hash tables
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index ce0574b087fb..52eb37f4ac78 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -2897,8 +2897,8 @@ static int iwl4965_tx_skb(struct iwl4965_priv *priv, | |||
2897 | goto drop_unlock; | 2897 | goto drop_unlock; |
2898 | } | 2898 | } |
2899 | 2899 | ||
2900 | if (!priv->interface_id) { | 2900 | if (!priv->vif) { |
2901 | IWL_DEBUG_DROP("Dropping - !priv->interface_id\n"); | 2901 | IWL_DEBUG_DROP("Dropping - !priv->vif\n"); |
2902 | goto drop_unlock; | 2902 | goto drop_unlock; |
2903 | } | 2903 | } |
2904 | 2904 | ||
@@ -3893,7 +3893,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work) | |||
3893 | struct sk_buff *beacon; | 3893 | struct sk_buff *beacon; |
3894 | 3894 | ||
3895 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ | 3895 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ |
3896 | beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL); | 3896 | beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); |
3897 | 3897 | ||
3898 | if (!beacon) { | 3898 | if (!beacon) { |
3899 | IWL_ERROR("update beacon failed\n"); | 3899 | IWL_ERROR("update beacon failed\n"); |
@@ -7214,7 +7214,7 @@ static void iwl4965_bg_post_associate(struct work_struct *data) | |||
7214 | 7214 | ||
7215 | mutex_lock(&priv->mutex); | 7215 | mutex_lock(&priv->mutex); |
7216 | 7216 | ||
7217 | if (!priv->interface_id || !priv->is_open) { | 7217 | if (!priv->vif || !priv->is_open) { |
7218 | mutex_unlock(&priv->mutex); | 7218 | mutex_unlock(&priv->mutex); |
7219 | return; | 7219 | return; |
7220 | } | 7220 | } |
@@ -7425,15 +7425,15 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw, | |||
7425 | unsigned long flags; | 7425 | unsigned long flags; |
7426 | DECLARE_MAC_BUF(mac); | 7426 | DECLARE_MAC_BUF(mac); |
7427 | 7427 | ||
7428 | IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); | 7428 | IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); |
7429 | 7429 | ||
7430 | if (priv->interface_id) { | 7430 | if (priv->vif) { |
7431 | IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); | 7431 | IWL_DEBUG_MAC80211("leave - vif != NULL\n"); |
7432 | return 0; | 7432 | return 0; |
7433 | } | 7433 | } |
7434 | 7434 | ||
7435 | spin_lock_irqsave(&priv->lock, flags); | 7435 | spin_lock_irqsave(&priv->lock, flags); |
7436 | priv->interface_id = conf->if_id; | 7436 | priv->vif = conf->vif; |
7437 | 7437 | ||
7438 | spin_unlock_irqrestore(&priv->lock, flags); | 7438 | spin_unlock_irqrestore(&priv->lock, flags); |
7439 | 7439 | ||
@@ -7617,7 +7617,8 @@ static void iwl4965_config_ap(struct iwl4965_priv *priv) | |||
7617 | * clear sta table, add BCAST sta... */ | 7617 | * clear sta table, add BCAST sta... */ |
7618 | } | 7618 | } |
7619 | 7619 | ||
7620 | static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id, | 7620 | static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, |
7621 | struct ieee80211_vif *vif, | ||
7621 | struct ieee80211_if_conf *conf) | 7622 | struct ieee80211_if_conf *conf) |
7622 | { | 7623 | { |
7623 | struct iwl4965_priv *priv = hw->priv; | 7624 | struct iwl4965_priv *priv = hw->priv; |
@@ -7637,7 +7638,6 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7637 | 7638 | ||
7638 | mutex_lock(&priv->mutex); | 7639 | mutex_lock(&priv->mutex); |
7639 | 7640 | ||
7640 | IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id); | ||
7641 | if (conf->bssid) | 7641 | if (conf->bssid) |
7642 | IWL_DEBUG_MAC80211("bssid: %s\n", | 7642 | IWL_DEBUG_MAC80211("bssid: %s\n", |
7643 | print_mac(mac, conf->bssid)); | 7643 | print_mac(mac, conf->bssid)); |
@@ -7654,8 +7654,8 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7654 | return 0; | 7654 | return 0; |
7655 | } | 7655 | } |
7656 | 7656 | ||
7657 | if (priv->interface_id != if_id) { | 7657 | if (priv->vif != vif) { |
7658 | IWL_DEBUG_MAC80211("leave - interface_id != if_id\n"); | 7658 | IWL_DEBUG_MAC80211("leave - priv->vif != vif\n"); |
7659 | mutex_unlock(&priv->mutex); | 7659 | mutex_unlock(&priv->mutex); |
7660 | return 0; | 7660 | return 0; |
7661 | } | 7661 | } |
@@ -7753,8 +7753,8 @@ static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, | |||
7753 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7753 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
7754 | iwl4965_commit_rxon(priv); | 7754 | iwl4965_commit_rxon(priv); |
7755 | } | 7755 | } |
7756 | if (priv->interface_id == conf->if_id) { | 7756 | if (priv->vif == conf->vif) { |
7757 | priv->interface_id = 0; | 7757 | priv->vif = NULL; |
7758 | memset(priv->bssid, 0, ETH_ALEN); | 7758 | memset(priv->bssid, 0, ETH_ALEN); |
7759 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | 7759 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); |
7760 | priv->essid_len = 0; | 7760 | priv->essid_len = 0; |