diff mbox

[RFC,2/3] wireless: Add 40MHz Intolerance support to HT capablities.

Message ID 1310559873-10314-2-git-send-email-rmanohar@qca.qualcomm.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Manoharan, Rajkumar July 13, 2011, 12:24 p.m. UTC
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 include/net/cfg80211.h |    5 +++++
 net/wireless/core.c    |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

Comments

Johannes Berg July 14, 2011, 10:11 a.m. UTC | #1
On Wed, 2011-07-13 at 17:54 +0530, Rajkumar Manoharan wrote:
> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>

More description would be nice. I don't think I get it.

> +++ b/include/net/cfg80211.h
> @@ -128,6 +128,8 @@ enum ieee80211_channel_flags {
>   * @beacon_found: helper to regulatory code to indicate when a beacon
>   *	has been found on this channel. Use regulatory_hint_found_beacon()
>   *	to enable this, this is useful only on 5 GHz band.
> + * @is_40mhz_intolerant: one of the bss in this channel disallows the use of
> + *	20/40 MHz BSS. this will be used by Intolerant Channel Report.

I'm not convinced this should a channel thing here?

> @@ -1746,6 +1749,7 @@ struct wiphy_wowlan_support {
>   *	add to probe request frames transmitted during a scan, must not
>   *	include fixed IEs like supported rates
>   * @coverage_class: current coverage class
> + * @dot11FortyMHzIntolerant: Enable/Disable Forty MHz Intolerance

that variable name is ... highly unusual. please make it match its
surroundings better.

> @@ -1806,6 +1810,7 @@ struct wiphy {
>  	u32 frag_threshold;
>  	u32 rts_threshold;
>  	u8 coverage_class;
> +	bool dot11FortyMHzIntolerant;
 
Ok so in struct wiphy, to me means that the *driver* said it was 40MHz
intolerant? That makes no sense, why would the driver want to say that
*statically*? I can see maybe dynamically, but statically?

> @@ -412,6 +412,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
>  	rdev->wiphy.frag_threshold = (u32) -1;
>  	rdev->wiphy.rts_threshold = (u32) -1;
>  	rdev->wiphy.coverage_class = 0;
> +	rdev->wiphy.dot11FortyMHzIntolerant = false;

not really necessary, but I guess it's ok.
 
> @@ -532,6 +533,8 @@ int wiphy_register(struct wiphy *wiphy)
>  			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>  			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
>  		}
> +		if (wiphy->dot11FortyMHzIntolerant)
> +			sband->ht_cap.cap |= IEEE80211_HT_CAP_40MHZ_INTOLERANT;

I don't get this. All you use this variable for is setting a
variable ... that the driver could already have set. Seems completely
pointless.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Manoharan, Rajkumar July 14, 2011, 4:41 p.m. UTC | #2
On Thu, Jul 14, 2011 at 12:11:24PM +0200, Johannes Berg wrote:
> On Wed, 2011-07-13 at 17:54 +0530, Rajkumar Manoharan wrote:
> > Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
> 
> More description would be nice. I don't think I get it.
> 
> > +++ b/include/net/cfg80211.h
> > @@ -128,6 +128,8 @@ enum ieee80211_channel_flags {
> >   * @beacon_found: helper to regulatory code to indicate when a beacon
> >   *	has been found on this channel. Use regulatory_hint_found_beacon()
> >   *	to enable this, this is useful only on 5 GHz band.
> > + * @is_40mhz_intolerant: one of the bss in this channel disallows the use of
> > + *	20/40 MHz BSS. this will be used by Intolerant Channel Report.
> 
> I'm not convinced this should a channel thing here?
> 
> > @@ -1746,6 +1749,7 @@ struct wiphy_wowlan_support {
> >   *	add to probe request frames transmitted during a scan, must not
> >   *	include fixed IEs like supported rates
> >   * @coverage_class: current coverage class
> > + * @dot11FortyMHzIntolerant: Enable/Disable Forty MHz Intolerance
> 
> that variable name is ... highly unusual. please make it match its
> surroundings better.
>
OK
> > @@ -1806,6 +1810,7 @@ struct wiphy {
> >  	u32 frag_threshold;
> >  	u32 rts_threshold;
> >  	u8 coverage_class;
> > +	bool dot11FortyMHzIntolerant;
>  
> Ok so in struct wiphy, to me means that the *driver* said it was 40MHz
> intolerant? That makes no sense, why would the driver want to say that
> *statically*? I can see maybe dynamically, but statically?
>
Yes. I should be set dynamically. As of now, this field is not configurable.
Will send the followup patch for nl80211 support.
> > @@ -412,6 +412,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
> >  	rdev->wiphy.frag_threshold = (u32) -1;
> >  	rdev->wiphy.rts_threshold = (u32) -1;
> >  	rdev->wiphy.coverage_class = 0;
> > +	rdev->wiphy.dot11FortyMHzIntolerant = false;
> 
> not really necessary, but I guess it's ok.
>  
> > @@ -532,6 +533,8 @@ int wiphy_register(struct wiphy *wiphy)
> >  			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
> >  			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
> >  		}
> > +		if (wiphy->dot11FortyMHzIntolerant)
> > +			sband->ht_cap.cap |= IEEE80211_HT_CAP_40MHZ_INTOLERANT;
> 
> I don't get this. All you use this variable for is setting a
> variable ... that the driver could already have set. Seems completely
> pointless.
>
I agree.

--
Rajkumar

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4bf101b..eaa9dee 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -128,6 +128,8 @@  enum ieee80211_channel_flags {
  * @beacon_found: helper to regulatory code to indicate when a beacon
  *	has been found on this channel. Use regulatory_hint_found_beacon()
  *	to enable this, this is useful only on 5 GHz band.
+ * @is_40mhz_intolerant: one of the bss in this channel disallows the use of
+ *	20/40 MHz BSS. this will be used by Intolerant Channel Report.
  * @orig_mag: internal use
  * @orig_mpwr: internal use
  */
@@ -139,6 +141,7 @@  struct ieee80211_channel {
 	int max_antenna_gain;
 	int max_power;
 	bool beacon_found;
+	bool is_40mhz_intolerant;
 	u32 orig_flags;
 	int orig_mag, orig_mpwr;
 };
@@ -1746,6 +1749,7 @@  struct wiphy_wowlan_support {
  *	add to probe request frames transmitted during a scan, must not
  *	include fixed IEs like supported rates
  * @coverage_class: current coverage class
+ * @dot11FortyMHzIntolerant: Enable/Disable Forty MHz Intolerance
  * @fw_version: firmware version for ethtool reporting
  * @hw_version: hardware version for ethtool reporting
  * @max_num_pmkids: maximum number of PMKIDs supported by device
@@ -1806,6 +1810,7 @@  struct wiphy {
 	u32 frag_threshold;
 	u32 rts_threshold;
 	u8 coverage_class;
+	bool dot11FortyMHzIntolerant;
 
 	char fw_version[ETHTOOL_BUSINFO_LEN];
 	u32 hw_version;
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 880dbe2..e4b9321 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -412,6 +412,7 @@  struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
 	rdev->wiphy.frag_threshold = (u32) -1;
 	rdev->wiphy.rts_threshold = (u32) -1;
 	rdev->wiphy.coverage_class = 0;
+	rdev->wiphy.dot11FortyMHzIntolerant = false;
 
 	return &rdev->wiphy;
 }
@@ -532,6 +533,8 @@  int wiphy_register(struct wiphy *wiphy)
 			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
 			sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
 		}
+		if (wiphy->dot11FortyMHzIntolerant)
+			sband->ht_cap.cap |= IEEE80211_HT_CAP_40MHZ_INTOLERANT;
 
 		/*
 		 * Since we use a u32 for rate bitmaps in