aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-02-03 11:31:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:56:05 -0500
commit8c9c48d5a9ca5e1426372f8a747846bd0609dc08 (patch)
tree62272c0becb1161a9c57779aeb855f09c9dffd4d /drivers/net/wireless/iwlegacy
parentfd6415bcfb303e37052c72a3f44b7f81089d7336 (diff)
iwlegacy: remove ctx interface_modes
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c6
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c6
-rw-r--r--drivers/net/wireless/iwlegacy/common.c29
-rw-r--r--drivers/net/wireless/iwlegacy/common.h2
4 files changed, 8 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 52cac0cd1064..7c81f5aaf7a3 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3557,7 +3557,8 @@ il3945_setup_mac(struct il_priv *il)
3557 /* Tell mac80211 our characteristics */ 3557 /* Tell mac80211 our characteristics */
3558 hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_SPECTRUM_MGMT; 3558 hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_SPECTRUM_MGMT;
3559 3559
3560 hw->wiphy->interface_modes = il->ctx.interface_modes; 3560 hw->wiphy->interface_modes =
3561 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
3561 3562
3562 hw->wiphy->flags |= 3563 hw->wiphy->flags |=
3563 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS | 3564 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS |
@@ -3617,9 +3618,6 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3617 3618
3618 il->cmd_queue = IL39_CMD_QUEUE_NUM; 3619 il->cmd_queue = IL39_CMD_QUEUE_NUM;
3619 3620
3620 il->ctx.interface_modes =
3621 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
3622
3623 /* 3621 /*
3624 * Disabling hardware scan means that mac80211 will perform scans 3622 * Disabling hardware scan means that mac80211 will perform scans
3625 * "the hard way", rather than using device's scan. 3623 * "the hard way", rather than using device's scan.
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 35d868c4ba92..1dd001475522 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5454,8 +5454,8 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
5454 hw->sta_data_size = sizeof(struct il_station_priv); 5454 hw->sta_data_size = sizeof(struct il_station_priv);
5455 hw->vif_data_size = sizeof(struct il_vif_priv); 5455 hw->vif_data_size = sizeof(struct il_vif_priv);
5456 5456
5457 hw->wiphy->interface_modes |= il->ctx.interface_modes; 5457 hw->wiphy->interface_modes =
5458 hw->wiphy->interface_modes |= il->ctx.exclusive_interface_modes; 5458 BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
5459 5459
5460 hw->wiphy->flags |= 5460 hw->wiphy->flags |=
5461 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS; 5461 WIPHY_FLAG_CUSTOM_REGULATORY | WIPHY_FLAG_DISABLE_BEACON_HINTS;
@@ -6141,8 +6141,6 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
6141 il->ctx.is_active = true; 6141 il->ctx.is_active = true;
6142 il->ctx.ac_to_fifo = il4965_bss_ac_to_fifo; 6142 il->ctx.ac_to_fifo = il4965_bss_ac_to_fifo;
6143 il->ctx.ac_to_queue = il4965_bss_ac_to_queue; 6143 il->ctx.ac_to_queue = il4965_bss_ac_to_queue;
6144 il->ctx.exclusive_interface_modes = BIT(NL80211_IFTYPE_ADHOC);
6145 il->ctx.interface_modes = BIT(NL80211_IFTYPE_STATION);
6146 6144
6147 SET_IEEE80211_DEV(hw, &pdev->dev); 6145 SET_IEEE80211_DEV(hw, &pdev->dev);
6148 6146
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index ac269856be14..7f4c6bf41995 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4566,7 +4566,6 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
4566 struct il_priv *il = hw->priv; 4566 struct il_priv *il = hw->priv;
4567 struct il_vif_priv *vif_priv = (void *)vif->drv_priv; 4567 struct il_vif_priv *vif_priv = (void *)vif->drv_priv;
4568 int err; 4568 int err;
4569 u32 modes;
4570 4569
4571 D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); 4570 D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
4572 4571
@@ -4578,15 +4577,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
4578 goto out; 4577 goto out;
4579 } 4578 }
4580 4579
4581 /* check if busy context is exclusive */ 4580 if (il->ctx.vif) {
4582 if (il->ctx.vif &&
4583 (il->ctx.exclusive_interface_modes & BIT(il->ctx.vif->type))) {
4584 err = -EINVAL;
4585 goto out;
4586 }
4587
4588 modes = il->ctx.interface_modes | il->ctx.exclusive_interface_modes;
4589 if (!(modes & BIT(vif->type))) {
4590 err = -EOPNOTSUPP; 4581 err = -EOPNOTSUPP;
4591 goto out; 4582 goto out;
4592 } 4583 }
@@ -4979,10 +4970,10 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4979{ 4970{
4980 struct il_priv *il = hw->priv; 4971 struct il_priv *il = hw->priv;
4981 struct il_rxon_context *ctx = il_rxon_ctx_from_vif(vif); 4972 struct il_rxon_context *ctx = il_rxon_ctx_from_vif(vif);
4982 u32 modes;
4983 int err; 4973 int err;
4984 4974
4985 newtype = ieee80211_iftype_p2p(newtype, newp2p); 4975 if (newp2p)
4976 return -EOPNOTSUPP;
4986 4977
4987 mutex_lock(&il->mutex); 4978 mutex_lock(&il->mutex);
4988 4979
@@ -4995,22 +4986,10 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4995 goto out; 4986 goto out;
4996 } 4987 }
4997 4988
4998 modes = ctx->interface_modes | ctx->exclusive_interface_modes;
4999 if (!(modes & BIT(newtype))) {
5000 err = -EOPNOTSUPP;
5001 goto out;
5002 }
5003
5004 if ((il->ctx.exclusive_interface_modes & BIT(il->ctx.vif->type)) ||
5005 (il->ctx.exclusive_interface_modes & BIT(newtype))) {
5006 err = -EINVAL;
5007 goto out;
5008 }
5009
5010 /* success */ 4989 /* success */
5011 il_teardown_interface(il, vif, true); 4990 il_teardown_interface(il, vif, true);
5012 vif->type = newtype; 4991 vif->type = newtype;
5013 vif->p2p = newp2p; 4992 vif->p2p = false;
5014 err = il_setup_interface(il, ctx); 4993 err = il_setup_interface(il, ctx);
5015 WARN_ON(err); 4994 WARN_ON(err);
5016 /* 4995 /*
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index a872175f164c..eddf22d4f1b2 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1165,8 +1165,6 @@ struct il_rxon_context {
1165 */ 1165 */
1166 bool always_active, is_active; 1166 bool always_active, is_active;
1167 1167
1168 u32 interface_modes, exclusive_interface_modes;
1169
1170 struct il_qos_info qos_data; 1168 struct il_qos_info qos_data;
1171 1169
1172 struct { 1170 struct {