Commit 32bfd35d authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f6532111
...@@ -1312,7 +1312,8 @@ static int adm8211_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) ...@@ -1312,7 +1312,8 @@ static int adm8211_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
return 0; return 0;
} }
static int adm8211_config_interface(struct ieee80211_hw *dev, int if_id, static int adm8211_config_interface(struct ieee80211_hw *dev,
struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct adm8211_priv *priv = dev->priv; struct adm8211_priv *priv = dev->priv;
......
...@@ -178,7 +178,8 @@ static void ath5k_remove_interface(struct ieee80211_hw *hw, ...@@ -178,7 +178,8 @@ static void ath5k_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf); struct ieee80211_if_init_conf *conf);
static int ath5k_config(struct ieee80211_hw *hw, static int ath5k_config(struct ieee80211_hw *hw,
struct ieee80211_conf *conf); struct ieee80211_conf *conf);
static int ath5k_config_interface(struct ieee80211_hw *hw, int if_id, static int ath5k_config_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf); struct ieee80211_if_conf *conf);
static void ath5k_configure_filter(struct ieee80211_hw *hw, static void ath5k_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags, unsigned int changed_flags,
...@@ -2498,12 +2499,12 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, ...@@ -2498,12 +2499,12 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
int ret; int ret;
mutex_lock(&sc->lock); mutex_lock(&sc->lock);
if (sc->iface_id) { if (sc->vif) {
ret = 0; ret = 0;
goto end; goto end;
} }
sc->iface_id = conf->if_id; sc->vif = conf->vif;
switch (conf->type) { switch (conf->type) {
case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_STA:
...@@ -2528,10 +2529,10 @@ ath5k_remove_interface(struct ieee80211_hw *hw, ...@@ -2528,10 +2529,10 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
struct ath5k_softc *sc = hw->priv; struct ath5k_softc *sc = hw->priv;
mutex_lock(&sc->lock); mutex_lock(&sc->lock);
if (sc->iface_id != conf->if_id) if (sc->vif != conf->vif)
goto end; goto end;
sc->iface_id = 0; sc->vif = NULL;
end: end:
mutex_unlock(&sc->lock); mutex_unlock(&sc->lock);
} }
...@@ -2549,7 +2550,7 @@ ath5k_config(struct ieee80211_hw *hw, ...@@ -2549,7 +2550,7 @@ ath5k_config(struct ieee80211_hw *hw,
} }
static int static int
ath5k_config_interface(struct ieee80211_hw *hw, int if_id, ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct ath5k_softc *sc = hw->priv; struct ath5k_softc *sc = hw->priv;
...@@ -2560,7 +2561,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, int if_id, ...@@ -2560,7 +2561,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, int if_id,
* be set to mac80211's value at ath5k_config(). */ * be set to mac80211's value at ath5k_config(). */
sc->bintval = 1000 * 1000 / 1024; sc->bintval = 1000 * 1000 / 1024;
mutex_lock(&sc->lock); mutex_lock(&sc->lock);
if (sc->iface_id != if_id) { if (sc->vif != vif) {
ret = -EIO; ret = -EIO;
goto unlock; goto unlock;
} }
......
...@@ -123,7 +123,7 @@ struct ath5k_softc { ...@@ -123,7 +123,7 @@ struct ath5k_softc {
unsigned int curmode; /* current phy mode */ unsigned int curmode; /* current phy mode */
struct ieee80211_channel *curchan; /* current h/w channel */ struct ieee80211_channel *curchan; /* current h/w channel */
int iface_id; /* add/remove_interface id */ struct ieee80211_vif *vif;
struct { struct {
u8 rxflags; /* radiotap rx flags */ u8 rxflags; /* radiotap rx flags */
......
...@@ -533,7 +533,7 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah, ...@@ -533,7 +533,7 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah,
* ieee80211_duration() for a brief description of * ieee80211_duration() for a brief description of
* what rate we should choose to TX ACKs. */ * what rate we should choose to TX ACKs. */
tx_time = ieee80211_generic_frame_duration(sc->hw, tx_time = ieee80211_generic_frame_duration(sc->hw,
sc->iface_id, 10, control_rate->rate_kbps/100); sc->vif, 10, control_rate->rate_kbps/100);
ath5k_hw_reg_write(ah, tx_time, reg); ath5k_hw_reg_write(ah, tx_time, reg);
......
...@@ -625,10 +625,7 @@ struct b43_wl { ...@@ -625,10 +625,7 @@ struct b43_wl {
* at a time. General information about this interface follows. * at a time. General information about this interface follows.
*/ */
/* Opaque ID of the operating interface from the ieee80211 struct ieee80211_vif *vif;
* subsystem. Do not modify.
*/
int if_id;
/* The MAC address of the operating interface. */ /* The MAC address of the operating interface. */
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
/* Current BSSID */ /* Current BSSID */
......
...@@ -1169,7 +1169,7 @@ static void b43_write_probe_resp_plcp(struct b43_wldev *dev, ...@@ -1169,7 +1169,7 @@ static void b43_write_probe_resp_plcp(struct b43_wldev *dev,
plcp.data = 0; plcp.data = 0;
b43_generate_plcp_hdr(&plcp, size + FCS_LEN, rate); b43_generate_plcp_hdr(&plcp, size + FCS_LEN, rate);
dur = ieee80211_generic_frame_duration(dev->wl->hw, dur = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, size, dev->wl->vif, size,
B43_RATE_TO_BASE100KBPS(rate)); B43_RATE_TO_BASE100KBPS(rate));
/* Write PLCP in two parts and timing for packet transfer */ /* Write PLCP in two parts and timing for packet transfer */
tmp = le32_to_cpu(plcp.data); tmp = le32_to_cpu(plcp.data);
...@@ -1226,7 +1226,7 @@ static u8 *b43_generate_probe_resp(struct b43_wldev *dev, ...@@ -1226,7 +1226,7 @@ static u8 *b43_generate_probe_resp(struct b43_wldev *dev,
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP); IEEE80211_STYPE_PROBE_RESP);
dur = ieee80211_generic_frame_duration(dev->wl->hw, dur = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, *dest_size, dev->wl->vif, *dest_size,
B43_RATE_TO_BASE100KBPS(rate)); B43_RATE_TO_BASE100KBPS(rate));
hdr->duration_id = dur; hdr->duration_id = dur;
...@@ -2928,7 +2928,7 @@ static void b43_op_configure_filter(struct ieee80211_hw *hw, ...@@ -2928,7 +2928,7 @@ static void b43_op_configure_filter(struct ieee80211_hw *hw,
} }
static int b43_op_config_interface(struct ieee80211_hw *hw, static int b43_op_config_interface(struct ieee80211_hw *hw,
int if_id, struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct b43_wl *wl = hw_to_b43_wl(hw); struct b43_wl *wl = hw_to_b43_wl(hw);
...@@ -2939,7 +2939,7 @@ static int b43_op_config_interface(struct ieee80211_hw *hw, ...@@ -2939,7 +2939,7 @@ static int b43_op_config_interface(struct ieee80211_hw *hw,
return -ENODEV; return -ENODEV;
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
spin_lock_irqsave(&wl->irq_lock, flags); spin_lock_irqsave(&wl->irq_lock, flags);
B43_WARN_ON(wl->if_id != if_id); B43_WARN_ON(wl->vif != vif);
if (conf->bssid) if (conf->bssid)
memcpy(wl->bssid, conf->bssid, ETH_ALEN); memcpy(wl->bssid, conf->bssid, ETH_ALEN);
else else
...@@ -3445,7 +3445,7 @@ static int b43_op_add_interface(struct ieee80211_hw *hw, ...@@ -3445,7 +3445,7 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
dev = wl->current_dev; dev = wl->current_dev;
wl->operating = 1; wl->operating = 1;
wl->if_id = conf->if_id; wl->vif = conf->vif;
wl->if_type = conf->type; wl->if_type = conf->type;
memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN);
...@@ -3473,7 +3473,8 @@ static void b43_op_remove_interface(struct ieee80211_hw *hw, ...@@ -3473,7 +3473,8 @@ static void b43_op_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
B43_WARN_ON(!wl->operating); B43_WARN_ON(!wl->operating);
B43_WARN_ON(wl->if_id != conf->if_id); B43_WARN_ON(wl->vif != conf->vif);
wl->vif = NULL;
wl->operating = 0; wl->operating = 0;
......
...@@ -221,7 +221,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev, ...@@ -221,7 +221,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev,
} else { } else {
int fbrate_base100kbps = B43_RATE_TO_BASE100KBPS(rate_fb); int fbrate_base100kbps = B43_RATE_TO_BASE100KBPS(rate_fb);
txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, txctl->vif,
fragment_len, fragment_len,
fbrate_base100kbps); fbrate_base100kbps);
} }
...@@ -312,7 +312,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev, ...@@ -312,7 +312,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev,
rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb); rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb);
if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
ieee80211_ctstoself_get(dev->wl->hw, dev->wl->if_id, ieee80211_ctstoself_get(dev->wl->hw, txctl->vif,
fragment_data, fragment_len, fragment_data, fragment_len,
txctl, txctl,
(struct ieee80211_cts *)(txhdr-> (struct ieee80211_cts *)(txhdr->
...@@ -320,7 +320,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev, ...@@ -320,7 +320,7 @@ static void generate_txhdr_fw4(struct b43_wldev *dev,
mac_ctl |= B43_TX4_MAC_SENDCTS; mac_ctl |= B43_TX4_MAC_SENDCTS;
len = sizeof(struct ieee80211_cts); len = sizeof(struct ieee80211_cts);
} else { } else {
ieee80211_rts_get(dev->wl->hw, dev->wl->if_id, ieee80211_rts_get(dev->wl->hw, txctl->vif,
fragment_data, fragment_len, txctl, fragment_data, fragment_len, txctl,
(struct ieee80211_rts *)(txhdr-> (struct ieee80211_rts *)(txhdr->
rts_frame)); rts_frame));
......
...@@ -577,10 +577,7 @@ struct b43legacy_wl { ...@@ -577,10 +577,7 @@ struct b43legacy_wl {
* at a time. General information about this interface follows. * at a time. General information about this interface follows.
*/ */
/* Opaque ID of the operating interface from the ieee80211 struct ieee80211_vif *vif;
* subsystem. Do not modify.
*/
int if_id;
/* MAC address (can be NULL). */ /* MAC address (can be NULL). */
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
/* Current BSSID (can be NULL). */ /* Current BSSID (can be NULL). */
......
...@@ -976,7 +976,7 @@ static void b43legacy_write_probe_resp_plcp(struct b43legacy_wldev *dev, ...@@ -976,7 +976,7 @@ static void b43legacy_write_probe_resp_plcp(struct b43legacy_wldev *dev,
plcp.data = 0; plcp.data = 0;
b43legacy_generate_plcp_hdr(&plcp, size + FCS_LEN, rate); b43legacy_generate_plcp_hdr(&plcp, size + FCS_LEN, rate);
dur = ieee80211_generic_frame_duration(dev->wl->hw, dur = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, dev->wl->vif,
size, size,
B43legacy_RATE_TO_100KBPS(rate)); B43legacy_RATE_TO_100KBPS(rate));
/* Write PLCP in two parts and timing for packet transfer */ /* Write PLCP in two parts and timing for packet transfer */
...@@ -1042,7 +1042,7 @@ static u8 *b43legacy_generate_probe_resp(struct b43legacy_wldev *dev, ...@@ -1042,7 +1042,7 @@ static u8 *b43legacy_generate_probe_resp(struct b43legacy_wldev *dev,
hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_PROBE_RESP); IEEE80211_STYPE_PROBE_RESP);
dur = ieee80211_generic_frame_duration(dev->wl->hw, dur = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, dev->wl->vif,
*dest_size, *dest_size,
B43legacy_RATE_TO_100KBPS(rate)); B43legacy_RATE_TO_100KBPS(rate));
hdr->duration_id = dur; hdr->duration_id = dur;
...@@ -2647,7 +2647,7 @@ static void b43legacy_op_configure_filter(struct ieee80211_hw *hw, ...@@ -2647,7 +2647,7 @@ static void b43legacy_op_configure_filter(struct ieee80211_hw *hw,
} }
static int b43legacy_op_config_interface(struct ieee80211_hw *hw, static int b43legacy_op_config_interface(struct ieee80211_hw *hw,
int if_id, struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
...@@ -2658,7 +2658,7 @@ static int b43legacy_op_config_interface(struct ieee80211_hw *hw, ...@@ -2658,7 +2658,7 @@ static int b43legacy_op_config_interface(struct ieee80211_hw *hw,
return -ENODEV; return -ENODEV;
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
spin_lock_irqsave(&wl->irq_lock, flags); spin_lock_irqsave(&wl->irq_lock, flags);
B43legacy_WARN_ON(wl->if_id != if_id); B43legacy_WARN_ON(wl->vif != vif);
if (conf->bssid) if (conf->bssid)
memcpy(wl->bssid, conf->bssid, ETH_ALEN); memcpy(wl->bssid, conf->bssid, ETH_ALEN);
else else
...@@ -3177,7 +3177,7 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw, ...@@ -3177,7 +3177,7 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw,
dev = wl->current_dev; dev = wl->current_dev;
wl->operating = 1; wl->operating = 1;
wl->if_id = conf->if_id; wl->vif = conf->vif;
wl->if_type = conf->type; wl->if_type = conf->type;
memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN);
...@@ -3205,7 +3205,8 @@ static void b43legacy_op_remove_interface(struct ieee80211_hw *hw, ...@@ -3205,7 +3205,8 @@ static void b43legacy_op_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
B43legacy_WARN_ON(!wl->operating); B43legacy_WARN_ON(!wl->operating);
B43legacy_WARN_ON(wl->if_id != conf->if_id); B43legacy_WARN_ON(wl->vif != conf->vif);
wl->vif = NULL;
wl->operating = 0; wl->operating = 0;
......
...@@ -223,7 +223,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev, ...@@ -223,7 +223,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
} else { } else {
int fbrate_base100kbps = B43legacy_RATE_TO_100KBPS(rate_fb); int fbrate_base100kbps = B43legacy_RATE_TO_100KBPS(rate_fb);
txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw,
dev->wl->if_id, txctl->vif,
fragment_len, fragment_len,
fbrate_base100kbps); fbrate_base100kbps);
} }
...@@ -312,7 +312,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev, ...@@ -312,7 +312,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
ieee80211_ctstoself_get(dev->wl->hw, ieee80211_ctstoself_get(dev->wl->hw,
dev->wl->if_id, txctl->vif,
fragment_data, fragment_data,
fragment_len, txctl, fragment_len, txctl,
(struct ieee80211_cts *) (struct ieee80211_cts *)
...@@ -321,7 +321,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev, ...@@ -321,7 +321,7 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
len = sizeof(struct ieee80211_cts); len = sizeof(struct ieee80211_cts);
} else { } else {
ieee80211_rts_get(dev->wl->hw, ieee80211_rts_get(dev->wl->hw,
dev->wl->if_id, txctl->vif,
fragment_data, fragment_len, txctl, fragment_data, fragment_len, txctl,
(struct ieee80211_rts *) (struct ieee80211_rts *)
(txhdr->rts_frame)); (txhdr->rts_frame));
......
...@@ -863,7 +863,7 @@ struct iwl3945_priv { ...@@ -863,7 +863,7 @@ struct iwl3945_priv {
u32 timestamp1; u32 timestamp1;
u16 beacon_int; u16 beacon_int;
struct iwl3945_driver_hw_info hw_setting; struct iwl3945_driver_hw_info hw_setting;
int interface_id; struct ieee80211_vif *vif;
/* Current association information needed to configure the /* Current association information needed to configure the
* hardware */ * hardware */
......
...@@ -1212,7 +1212,7 @@ struct iwl4965_priv { ...@@ -1212,7 +1212,7 @@ struct iwl4965_priv {
u32 timestamp1; u32 timestamp1;
u16 beacon_int; u16 beacon_int;
struct iwl4965_driver_hw_info hw_setting; struct iwl4965_driver_hw_info hw_setting;
int interface_id; struct ieee80211_vif *vif;
/* Current association information needed to configure the /* Current association information needed to configure the
* hardware */ * hardware */
......
...@@ -2767,8 +2767,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, ...@@ -2767,8 +2767,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
goto drop_unlock; goto drop_unlock;
} }
if (!priv->interface_id) { if (!priv->vif) {
IWL_DEBUG_DROP("Dropping - !priv->interface_id\n"); IWL_DEBUG_DROP("Dropping - !priv->vif\n");
goto drop_unlock; goto drop_unlock;
} }
...@@ -3549,7 +3549,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work) ...@@ -3549,7 +3549,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work)
struct sk_buff *beacon; struct sk_buff *beacon;
/* Pull updated AP beacon from mac80211. will fail if not in AP mode */ /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL); beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL);
if (!beacon) { if (!beacon) {
IWL_ERROR("update beacon failed\n"); IWL_ERROR("update beacon failed\n");
...@@ -6780,7 +6780,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) ...@@ -6780,7 +6780,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data)
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
if (!priv->interface_id || !priv->is_open) { if (!priv->vif || !priv->is_open) {
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
return; return;
} }
...@@ -6981,15 +6981,15 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, ...@@ -6981,15 +6981,15 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
unsigned long flags; unsigned long flags;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); IWL_DEBUG_MAC80211("enter: type %d\n", conf->type);
if (priv->interface_id) { if (priv->vif) {
IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); IWL_DEBUG_MAC80211("leave - vif != NULL\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
priv->interface_id = conf->if_id; priv->vif = conf->vif;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
...@@ -7157,7 +7157,8 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) ...@@ -7157,7 +7157,8 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
* clear sta table, add BCAST sta... */ * clear sta table, add BCAST sta... */
} }
static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct iwl3945_priv *priv = hw->priv; struct iwl3945_priv *priv = hw->priv;
...@@ -7179,7 +7180,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, ...@@ -7179,7 +7180,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id,
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
IWL_DEBUG_MAC80211("enter: interface id %d\n", if_id);
if (conf->bssid) if (conf->bssid)
IWL_DEBUG_MAC80211("bssid: %s\n", IWL_DEBUG_MAC80211("bssid: %s\n",
print_mac(mac, conf->bssid)); print_mac(mac, conf->bssid));
...@@ -7196,8 +7196,8 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id, ...@@ -7196,8 +7196,8 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id,
return 0; return 0;
} }
if (priv->interface_id != if_id) { if (priv->vif != vif) {
IWL_DEBUG_MAC80211("leave - interface_id != if_id\n"); IWL_DEBUG_MAC80211("leave - priv->vif != vif\n");
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
return 0; return 0;
} }
...@@ -7295,8 +7295,8 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -7295,8 +7295,8 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv); iwl3945_commit_rxon(priv);
} }
if (priv->interface_id == conf->if_id) { if (priv->vif == conf->vif) {
priv->interface_id = 0; priv->vif = NULL;
memset(priv->bssid, 0, ETH_ALEN); memset(priv->bssid, 0, ETH_ALEN);
memset(priv->essid, 0, IW_ESSID_MAX_SIZE); memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
priv->essid_len = 0; priv->essid_len = 0;
......
...@@ -2897,8 +2897,8 @@ static int iwl4965_tx_skb(struct iwl4965_priv *priv, ...@@ -2897,8 +2897,8 @@ static int iwl4965_tx_skb(struct iwl4965_priv *priv,
goto drop_unlock; goto drop_unlock;
} }
if (!priv->interface_id) { if (!priv->vif) {
IWL_DEBUG_DROP("Dropping - !priv->interface_id\n"); IWL_DEBUG_DROP("Dropping - !priv->vif\n");
goto drop_unlock; goto drop_unlock;
} }
...@@ -3893,7 +3893,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work) ...@@ -3893,7 +3893,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work)
struct sk_buff *beacon; struct sk_buff *beacon;
/* Pull updated AP beacon from mac80211. will fail if not in AP mode */ /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
beacon = ieee80211_beacon_get(priv->hw, priv->interface_id, NULL); beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL);
if (!beacon) { if (!beacon) {
IWL_ERROR("update beacon failed\n"); IWL_ERROR("update beacon failed\n");
...@@ -7214,7 +7214,7 @@ static void iwl4965_bg_post_associate(struct work_struct *data) ...@@ -7214,7 +7214,7 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
if (!priv->interface_id || !priv->is_open) { if (!priv->vif || !priv->is_open) {
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
return; return;
} }
...@@ -7425,15 +7425,15 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw, ...@@ -7425,15 +7425,15 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,
unsigned long flags; unsigned long flags;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);