Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad)
@ 2012-07-01  6:45 Vladimir Kondratiev
  2012-07-01  6:45 ` [PATCH 60g v1 1/5] wireless: add 802.11ad (60gHz band) Vladimir Kondratiev
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Vladimir Kondratiev @ 2012-07-01  6:45 UTC (permalink / raw)
  To: John W . Linville, Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez

These patches add minimal infrastructure for the 60gHz (802.11ad)
band WiFi drivers.

This change enables offload drivers for the 60GHz devices that implement
the 802.11 MAC functionality in the device itself.

Addressed comments form Johannes Berg. Since no significant issues raised,
change it from RFC to PATCH.

Driver based on this infrastructure see at:
http://wireless.kernel.org/en/users/Drivers/wil6210

Vladimir Kondratiev (5):
  wireless: add 802.11ad (60gHz band)
  wireless: rate check logic for 60g
  wireless: regulatory for 60g
  wireless: 60g protocol constants
  wireless: bitrate calculation for 60g

 include/linux/ieee80211.h |   89 ++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/nl80211.h   |    2 +
 include/net/cfg80211.h    |    4 ++
 net/mac80211/tx.c         |    2 +
 net/wireless/core.c       |   10 ++++-
 net/wireless/reg.c        |    5 ++-
 net/wireless/util.c       |   84 ++++++++++++++++++++++++++++++++++++++----
 7 files changed, 184 insertions(+), 12 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 60g v1 5/5] wireless: bitrate calculation for 60g
@ 2012-07-01 10:44 Vladimir Kondratiev
  0 siblings, 0 replies; 11+ messages in thread
From: Vladimir Kondratiev @ 2012-07-01 10:44 UTC (permalink / raw)
  To: John W . Linville, Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez

60g band uses different from .11n MCS scheme, so bitrate should be calculated
differently

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 include/net/cfg80211.h |    2 ++
 net/wireless/util.c    |   55 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 56e840d..f760520 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -563,11 +563,13 @@ enum station_info_flags {
  * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled
  * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission
  * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
+ * @RATE_INFO_FLAGS_60G: 60gHz MCS
  */
 enum rate_info_flags {
 	RATE_INFO_FLAGS_MCS		= 1<<0,
 	RATE_INFO_FLAGS_40_MHZ_WIDTH	= 1<<1,
 	RATE_INFO_FLAGS_SHORT_GI	= 1<<2,
+	RATE_INFO_FLAGS_60G		= 1<<3,
 };
 
 /**
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 11188c6..130eaed 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -890,12 +890,67 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
 	return err;
 }
 
+static u16 cfg80211_calculate_bitrate_60g(struct rate_info *rate)
+{
+	static const u16 __mcs2bitrate[] = {
+		/* control PHY */
+		[0] =   275,
+		/* SC PHY */
+		[1] =  3850,
+		[2] =  7700,
+		[3] =  9625,
+		[4] = 11550,
+		[5] = 12512, /* 1251.25 mbps */
+		[6] = 15400,
+		[7] = 19250,
+		[8] = 23100,
+		[9] = 25025,
+		[10] = 30800,
+		[11] = 38500,
+		[12] = 46200,
+		/* OFDM PHY */
+		[13] =  6930,
+		[14] =  8662, /* 866.25 mbps */
+		[15] = 13860,
+		[16] = 17325,
+		[17] = 20790,
+		[18] = 27720,
+		[19] = 34650,
+		[20] = 41580,
+		[21] = 45045,
+		[22] = 51975,
+		[23] = 62370,
+#if 0
+		/*
+		 * TODO: How to report this bitrate?
+		 * It don't fit into u16
+		 */
+		[24] = 67568, /* 6756.75 mbps */
+#endif
+		/* LP-SC PHY */
+		[25] =  6260,
+		[26] =  8340,
+		[27] = 11120,
+		[28] = 12510,
+		[29] = 16680,
+		[30] = 22240,
+		[31] = 25030,
+	};
+
+	if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate)))
+		return 0;
+
+	return __mcs2bitrate[rate->mcs];
+}
+
 u16 cfg80211_calculate_bitrate(struct rate_info *rate)
 {
 	int modulation, streams, bitrate;
 
 	if (!(rate->flags & RATE_INFO_FLAGS_MCS))
 		return rate->legacy;
+	if (rate->flags & RATE_INFO_FLAGS_60G)
+		return cfg80211_calculate_bitrate_60g(rate);
 
 	/* the formula below does only work for MCS values smaller than 32 */
 	if (WARN_ON_ONCE(rate->mcs >= 32))
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-01 16:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-01  6:45 [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad) Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 1/5] wireless: add 802.11ad (60gHz band) Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 2/5] wireless: rate check logic for 60g Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 3/5] wireless: regulatory " Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 4/5] wireless: 60g protocol constants Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 5/5] wireless: bitrate calculation for 60g Vladimir Kondratiev
     [not found]   ` <28548934.Ph3aMyPjKt@lx-vladimir>
2012-07-01 11:21     ` Johannes Berg
2012-07-01 11:23 ` [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad) Johannes Berg
2012-07-01 16:28   ` Vladimir Kondratiev
2012-07-01 16:55     ` Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2012-07-01 10:44 [PATCH 60g v1 5/5] wireless: bitrate calculation for 60g Vladimir Kondratiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox