linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 14/25 v2] iwlegacy: remove ctx interface_modes
Date: Fri, 3 Feb 2012 14:30:04 +0100	[thread overview]
Message-ID: <20120203133003.GB2213@redhat.com> (raw)
In-Reply-To: <1328270845-16891-15-git-send-email-sgruszka@redhat.com>

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
v2 does not contain rt2x00 changes
  
 drivers/net/wireless/iwlegacy/3945-mac.c |    6 ++----
 drivers/net/wireless/iwlegacy/4965-mac.c |    6 ++----
 drivers/net/wireless/iwlegacy/common.c   |   29 ++++-------------------------
 drivers/net/wireless/iwlegacy/common.h   |    2 --
 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 52cac0c..7c81f5a 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)
 	/* Tell mac80211 our characteristics */
 	hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_SPECTRUM_MGMT;
 
-	hw->wiphy->interface_modes = il->ctx.interface_modes;
+	hw->wiphy->interface_modes =
+	    BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
 
 	hw->wiphy->flags |=
 	    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)
 
 	il->cmd_queue = IL39_CMD_QUEUE_NUM;
 
-	il->ctx.interface_modes =
-	    BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
-
 	/*
 	 * Disabling hardware scan means that mac80211 will perform scans
 	 * "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 35d868c..1dd0014 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)
 	hw->sta_data_size = sizeof(struct il_station_priv);
 	hw->vif_data_size = sizeof(struct il_vif_priv);
 
-	hw->wiphy->interface_modes |= il->ctx.interface_modes;
-	hw->wiphy->interface_modes |= il->ctx.exclusive_interface_modes;
+	hw->wiphy->interface_modes =
+	    BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
 
 	hw->wiphy->flags |=
 	    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)
 	il->ctx.is_active = true;
 	il->ctx.ac_to_fifo = il4965_bss_ac_to_fifo;
 	il->ctx.ac_to_queue = il4965_bss_ac_to_queue;
-	il->ctx.exclusive_interface_modes = BIT(NL80211_IFTYPE_ADHOC);
-	il->ctx.interface_modes = BIT(NL80211_IFTYPE_STATION);
 
 	SET_IEEE80211_DEV(hw, &pdev->dev);
 
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index ac26985..7f4c6bf 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)
 	struct il_priv *il = hw->priv;
 	struct il_vif_priv *vif_priv = (void *)vif->drv_priv;
 	int err;
-	u32 modes;
 
 	D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
 
@@ -4578,15 +4577,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 		goto out;
 	}
 
-	/* check if busy context is exclusive */
-	if (il->ctx.vif &&
-	    (il->ctx.exclusive_interface_modes & BIT(il->ctx.vif->type))) {
-		err = -EINVAL;
-		goto out;
-	}
-
-	modes = il->ctx.interface_modes | il->ctx.exclusive_interface_modes;
-	if (!(modes & BIT(vif->type))) {
+	if (il->ctx.vif) {
 		err = -EOPNOTSUPP;
 		goto out;
 	}
@@ -4979,10 +4970,10 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 {
 	struct il_priv *il = hw->priv;
 	struct il_rxon_context *ctx = il_rxon_ctx_from_vif(vif);
-	u32 modes;
 	int err;
 
-	newtype = ieee80211_iftype_p2p(newtype, newp2p);
+	if (newp2p)
+		return -EOPNOTSUPP;
 
 	mutex_lock(&il->mutex);
 
@@ -4995,22 +4986,10 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		goto out;
 	}
 
-	modes = ctx->interface_modes | ctx->exclusive_interface_modes;
-	if (!(modes & BIT(newtype))) {
-		err = -EOPNOTSUPP;
-		goto out;
-	}
-
-	if ((il->ctx.exclusive_interface_modes & BIT(il->ctx.vif->type)) ||
-	    (il->ctx.exclusive_interface_modes & BIT(newtype))) {
-		err = -EINVAL;
-		goto out;
-	}
-
 	/* success */
 	il_teardown_interface(il, vif, true);
 	vif->type = newtype;
-	vif->p2p = newp2p;
+	vif->p2p = false;
 	err = il_setup_interface(il, ctx);
 	WARN_ON(err);
 	/*
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index a872175..eddf22d 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1165,8 +1165,6 @@ struct il_rxon_context {
 	 */
 	bool always_active, is_active;
 
-	u32 interface_modes, exclusive_interface_modes;
-
 	struct il_qos_info qos_data;
 
 	struct {
-- 
1.7.1


  parent reply	other threads:[~2012-02-03 13:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 12:07 [PATCH 0/25] iwlegacy update 2012-02-03 Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 01/25] iwlegacy: move rxon commands out of ctx structure Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 02/25] iwlegacy: get rid of ctx->rxon_cmd Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 03/25] iwlegacy: get rid of ctx->rxon_timing_cmd Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 04/25] iwlegacy: get rid of C_RXON_ASSOC Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 05/25] iwlegacy: get rid of qos_cmd Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 06/25] iwlegacy: get rid of wep_key_cmd Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 07/25] iwlegacy: get rid of ap_sta_id Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 08/25] iwlegacy: move bcast_sta_id to hw_params Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 09/25] iwlegacy: get rid of *_devtype Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 10/25] iwlegacy: get rid of ctxid Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 11/25] iwlegacy: get rid of mcast_queue Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 12/25] iwlegacy: move wep_keys out of context Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 13/25] iwlegacy: get rid of ctx->station_flags Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 14/25] iwlegacy: remove ctx interface_modes Stanislaw Gruszka
2012-02-03 12:47   ` Gertjan van Wingerde
2012-02-03 13:27     ` Stanislaw Gruszka
2012-02-03 13:30   ` Stanislaw Gruszka [this message]
2012-02-03 12:07 ` [PATCH 15/25] iwlegacy: move qos_data out of ctx structure Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 16/25] iwlegacy: move ht " Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 17/25] iwlegacy: get rid of ctx->ac_to_fifo Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 18/25] iwlegacy: get rid of ctx->ac_to_queue Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 19/25] iwlegacy: get rid of ctx->is_active Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 20/25] iwlegacy: remove il_setup_interface() Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 21/25] iwlegacy: get rid of ctx structure Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 22/25] iwlegacy: move ops out of config Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 23/25] iwlegacy: merge il_base_params into il_cfg Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 24/25] iwlegacy: remove struct il_tx_info Stanislaw Gruszka
2012-02-03 12:07 ` [PATCH 25/25] iwlegacy: remove set_hw_params callback Stanislaw Gruszka
2012-02-03 15:35 ` [PATCH 0/25] iwlegacy update 2012-02-03 Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120203133003.GB2213@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).