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/b43/main.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/b43/main.c')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ea63a9928803..af3d24c559c0 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1169,7 +1169,7 @@ static void b43_write_probe_resp_plcp(struct b43_wldev *dev, | |||
1169 | plcp.data = 0; | 1169 | plcp.data = 0; |
1170 | b43_generate_plcp_hdr(&plcp, size + FCS_LEN, rate); | 1170 | b43_generate_plcp_hdr(&plcp, size + FCS_LEN, rate); |
1171 | dur = ieee80211_generic_frame_duration(dev->wl->hw, | 1171 | dur = ieee80211_generic_frame_duration(dev->wl->hw, |
1172 | dev->wl->if_id, size, | 1172 | dev->wl->vif, size, |
1173 | B43_RATE_TO_BASE100KBPS(rate)); | 1173 | B43_RATE_TO_BASE100KBPS(rate)); |
1174 | /* Write PLCP in two parts and timing for packet transfer */ | 1174 | /* Write PLCP in two parts and timing for packet transfer */ |
1175 | tmp = le32_to_cpu(plcp.data); | 1175 | tmp = le32_to_cpu(plcp.data); |
@@ -1226,7 +1226,7 @@ static u8 *b43_generate_probe_resp(struct b43_wldev *dev, | |||
1226 | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | 1226 | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
1227 | IEEE80211_STYPE_PROBE_RESP); | 1227 | IEEE80211_STYPE_PROBE_RESP); |
1228 | dur = ieee80211_generic_frame_duration(dev->wl->hw, | 1228 | dur = ieee80211_generic_frame_duration(dev->wl->hw, |
1229 | dev->wl->if_id, *dest_size, | 1229 | dev->wl->vif, *dest_size, |
1230 | B43_RATE_TO_BASE100KBPS(rate)); | 1230 | B43_RATE_TO_BASE100KBPS(rate)); |
1231 | hdr->duration_id = dur; | 1231 | hdr->duration_id = dur; |
1232 | 1232 | ||
@@ -2928,7 +2928,7 @@ static void b43_op_configure_filter(struct ieee80211_hw *hw, | |||
2928 | } | 2928 | } |
2929 | 2929 | ||
2930 | static int b43_op_config_interface(struct ieee80211_hw *hw, | 2930 | static int b43_op_config_interface(struct ieee80211_hw *hw, |
2931 | int if_id, | 2931 | struct ieee80211_vif *vif, |
2932 | struct ieee80211_if_conf *conf) | 2932 | struct ieee80211_if_conf *conf) |
2933 | { | 2933 | { |
2934 | struct b43_wl *wl = hw_to_b43_wl(hw); | 2934 | struct b43_wl *wl = hw_to_b43_wl(hw); |
@@ -2939,7 +2939,7 @@ static int b43_op_config_interface(struct ieee80211_hw *hw, | |||
2939 | return -ENODEV; | 2939 | return -ENODEV; |
2940 | mutex_lock(&wl->mutex); | 2940 | mutex_lock(&wl->mutex); |
2941 | spin_lock_irqsave(&wl->irq_lock, flags); | 2941 | spin_lock_irqsave(&wl->irq_lock, flags); |
2942 | B43_WARN_ON(wl->if_id != if_id); | 2942 | B43_WARN_ON(wl->vif != vif); |
2943 | if (conf->bssid) | 2943 | if (conf->bssid) |
2944 | memcpy(wl->bssid, conf->bssid, ETH_ALEN); | 2944 | memcpy(wl->bssid, conf->bssid, ETH_ALEN); |
2945 | else | 2945 | else |
@@ -3445,7 +3445,7 @@ static int b43_op_add_interface(struct ieee80211_hw *hw, | |||
3445 | 3445 | ||
3446 | dev = wl->current_dev; | 3446 | dev = wl->current_dev; |
3447 | wl->operating = 1; | 3447 | wl->operating = 1; |
3448 | wl->if_id = conf->if_id; | 3448 | wl->vif = conf->vif; |
3449 | wl->if_type = conf->type; | 3449 | wl->if_type = conf->type; |
3450 | memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); | 3450 | memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); |
3451 | 3451 | ||
@@ -3473,7 +3473,8 @@ static void b43_op_remove_interface(struct ieee80211_hw *hw, | |||
3473 | mutex_lock(&wl->mutex); | 3473 | mutex_lock(&wl->mutex); |
3474 | 3474 | ||
3475 | B43_WARN_ON(!wl->operating); | 3475 | B43_WARN_ON(!wl->operating); |
3476 | B43_WARN_ON(wl->if_id != conf->if_id); | 3476 | B43_WARN_ON(wl->vif != conf->vif); |
3477 | wl->vif = NULL; | ||
3477 | 3478 | ||
3478 | wl->operating = 0; | 3479 | wl->operating = 0; |
3479 | 3480 | ||