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/iwl3945-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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index b662ff3b914..1830e13d5cf 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2767,8 +2767,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, | |||
2767 | goto drop_unlock; | 2767 | goto drop_unlock; |
2768 | } | 2768 | } |
2769 | 2769 | ||
2770 | if (!priv->interface_id) { | 2770 | if (!priv->vif) { |
2771 | IWL_DEBUG_DROP("Dropping - !priv->interface_id\n"); | 2771 | IWL_DEBUG_DROP("Dropping - !priv->vif\n"); |
2772 | goto drop_unlock; | 2772 | goto drop_unlock; |
2773 | } | 2773 | } |
2774 | 2774 | ||
@@ -3549,7 +3549,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work) | |||
3549 | struct sk_buff *beacon; | 3549 | struct sk_buff *beacon; |
3550 | 3550 | ||
3551 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ | 3551 | /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ |
3552 | beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL); | 3552 | beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); |
3553 | 3553 | ||
3554 | if (!beacon) { | 3554 | if (!beacon) { |
3555 | IWL_ERROR("update beacon failed\n"); | 3555 | IWL_ERROR("update beacon failed\n"); |
@@ -6780,7 +6780,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) | |||
6780 | 6780 | ||
6781 | mutex_lock(&priv->mutex); | 6781 | mutex_lock(&priv->mutex); |
6782 | 6782 | ||
6783 | if (!priv->interface_id || !priv->is_open) { | 6783 | if (!priv->vif || !priv->is_open) { |
6784 | mutex_unlock(&priv->mutex); | 6784 | mutex_unlock(&priv->mutex); |
6785 | return; | 6785 | return; |
6786 | } | 6786 | } |
@@ -6981,15 +6981,15 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, | |||
6981 | unsigned long flags; | 6981 | unsigned long flags; |
6982 | DECLARE_MAC_BUF(mac); | 6982 | DECLARE_MAC_BUF(mac); |
6983 | 6983 | ||
6984 | IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); | 6984 | IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); |
6985 | 6985 | ||
6986 | if (priv->interface_id) { | 6986 | if (priv->vif) { |
6987 | IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); | 6987 | IWL_DEBUG_MAC80211("leave - vif != NULL\n"); |
6988 | return -EOPNOTSUPP; | 6988 | return -EOPNOTSUPP; |
6989 | } | 6989 | } |
6990 | 6990 | ||
6991 | spin_lock_irqsave(&priv->lock, flags); | 6991 | spin_lock_irqsave(&priv->lock, flags); |
6992 | priv->interface_id = conf->if_id; | 6992 | priv->vif = conf->vif; |
6993 | 6993 | ||
6994 | spin_unlock_irqrestore(&priv->lock, flags); | 6994 | spin_unlock_irqrestore(&priv->lock, flags); |
6995 | 6995 | ||
@@ -7157,7 +7157,8 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) | |||
7157 | * clear sta table, add BCAST sta... */ | 7157 | * clear sta table, add BCAST sta... */ |
7158 | } | 7158 | } |
7159 | 7159 | ||
7160 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, | 7160 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, |
7161 | struct ieee80211_vif *vif, | ||
7161 | struct ieee80211_if_conf *conf) | 7162 | struct ieee80211_if_conf *conf) |
7162 | { | 7163 | { |
7163 | struct iwl3945_priv *priv = hw->priv; | 7164 | struct iwl3945_priv *priv = hw->priv; |
@@ -7179,7 +7180,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7179 | 7180 | ||
7180 | mutex_lock(&priv->mutex); | 7181 | mutex_lock(&priv->mutex); |
7181 | 7182 | ||
7182 | IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id); | ||
7183 | if (conf->bssid) | 7183 | if (conf->bssid) |
7184 | IWL_DEBUG_MAC80211("bssid: %s\n", | 7184 | IWL_DEBUG_MAC80211("bssid: %s\n", |
7185 | print_mac(mac, conf->bssid)); | 7185 | print_mac(mac, conf->bssid)); |
@@ -7196,8 +7196,8 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7196 | return 0; | 7196 | return 0; |
7197 | } | 7197 | } |
7198 | 7198 | ||
7199 | if (priv->interface_id != if_id) { | 7199 | if (priv->vif != vif) { |
7200 | IWL_DEBUG_MAC80211("leave - interface_id != if_id\n"); | 7200 | IWL_DEBUG_MAC80211("leave - priv->vif != vif\n"); |
7201 | mutex_unlock(&priv->mutex); | 7201 | mutex_unlock(&priv->mutex); |
7202 | return 0; | 7202 | return 0; |
7203 | } | 7203 | } |
@@ -7295,8 +7295,8 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | |||
7295 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7295 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
7296 | iwl3945_commit_rxon(priv); | 7296 | iwl3945_commit_rxon(priv); |
7297 | } | 7297 | } |
7298 | if (priv->interface_id == conf->if_id) { | 7298 | if (priv->vif == conf->vif) { |
7299 | priv->interface_id = 0; | 7299 | priv->vif = NULL; |
7300 | memset(priv->bssid, 0, ETH_ALEN); | 7300 | memset(priv->bssid, 0, ETH_ALEN); |
7301 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); | 7301 | memset(priv->essid, 0, IW_ESSID_MAX_SIZE); |
7302 | priv->essid_len = 0; | 7302 | priv->essid_len = 0; |