All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
To: "John W . Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>,
	<linux-wireless@vger.kernel.org>,
	"Luis R . Rodriguez" <rodrigue@qca.qualcomm.com>
Subject: [PATCH 60g v2 2/5] wireless: rate check logic for 60g
Date: Mon, 2 Jul 2012 09:32:33 +0300	[thread overview]
Message-ID: <1341210756-11054-3-git-send-email-qca_vkondrat@qca.qualcomm.com> (raw)
In-Reply-To: <1341210756-11054-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

On the 60g band, there is no 'basic rates'. Only MCS used.
Instead of mandatory basic rates, standard requires support for
mandatory MCS 1..4

Modify logic to comply with 60g requirements

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 net/wireless/core.c |   10 ++++++++--
 net/wireless/util.c |    5 +++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 907f62c..029db45 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -458,8 +458,14 @@ int wiphy_register(struct wiphy *wiphy)
 			continue;
 
 		sband->band = band;
-
-		if (WARN_ON(!sband->n_channels || !sband->n_bitrates))
+		if (WARN_ON(!sband->n_channels))
+			return -EINVAL;
+		/*
+		 * on 60gHz band, there are no legacy rates, so
+		 * n_bitrates is 0
+		 */
+		if (WARN_ON(band != IEEE80211_BAND_60GHZ &&
+			    !sband->n_bitrates))
 			return -EINVAL;
 
 		/*
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f3ce35b..11188c6 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -151,6 +151,11 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
 		}
 		WARN_ON(want != 0 && want != 3 && want != 6);
 		break;
+	case IEEE80211_BAND_60GHZ:
+		/* check for mandatory HT MCS 1..4 */
+		WARN_ON(!sband->ht_cap.ht_supported);
+		WARN_ON((sband->ht_cap.mcs.rx_mask[0] & 0x1e) != 0x1e);
+		break;
 	case IEEE80211_NUM_BANDS:
 		WARN_ON(1);
 		break;
-- 
1.7.9.5


  parent reply	other threads:[~2012-07-02  6:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02  6:32 [PATCH 60g v2 0/5] Infrastructure for 60g (802.11ad) Vladimir Kondratiev
2012-07-02  6:32 ` [PATCH 60g v2 1/5] wireless: add 802.11ad (60gHz band) Vladimir Kondratiev
2012-07-02 14:22   ` Arik Nemtsov
2012-07-02 15:12     ` Johannes Berg
2012-07-02 15:15       ` Arik Nemtsov
2012-07-02  6:32 ` Vladimir Kondratiev [this message]
2012-07-02 13:02   ` [PATCH 60g v2 2/5] wireless: rate check logic for 60g Johannes Berg
2012-07-02  6:32 ` [PATCH 60g v2 3/5] wireless: regulatory " Vladimir Kondratiev
2012-07-02  6:32 ` [PATCH 60g v2 4/5] wireless: 60g protocol constants Vladimir Kondratiev
2012-07-02  6:32 ` [PATCH 60g v2 5/5] wireless: bitrate calculation for 60g Vladimir Kondratiev
2012-07-02 12:54   ` Johannes Berg
2012-07-02 12:54 ` [PATCH 60g v2 0/5] Infrastructure for 60g (802.11ad) Johannes Berg
2012-07-02 12:58   ` Johannes Berg
2012-07-02 15:01     ` Vladimir Kondratiev
2012-07-02 15:08       ` Johannes Berg
2012-07-03  4:15         ` Julian Calaby
2012-07-03  6:50           ` Johannes Berg

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=1341210756-11054-3-git-send-email-qca_vkondrat@qca.qualcomm.com \
    --to=qca_vkondrat@qca.qualcomm.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rodrigue@qca.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.