[OpenWrt-Devel] [PATCH] ralink: remove VHT capabilities when not using 802.11ac

2015-02-03 Thread wengbj
The mt76 driver might have some problem working with MT7602.
MT7602 should not have VHT capabilities . But the driver not identity properly.

Signed-off-by: wengbj 
---
 .../0001-mt7602-remove-vht-capabilities.patch  |   46 
 1 file changed, 46 insertions(+)
 create mode 100644 
package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch

diff --git 
a/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch 
b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
new file mode 100644
index 000..0a1f9c9
--- /dev/null
+++ b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
@@ -0,0 +1,46 @@
+--- a/init.c
 b/init.c
+@@ -682,24 +682,27 @@ mt76_init_sband(struct mt76_dev *dev, st
+   ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
+   ht_cap->ampdu_density = IEEE80211_HT_MPDU_DENSITY_4;
+ 
+-  vht_cap = &sband->vht_cap;
+-  vht_cap->vht_supported = true;
++  if (dev->cap.has_5ghz)
++  {
++  vht_cap = &sband->vht_cap;
++  vht_cap->vht_supported = true;
+ 
+-  mcs_map = (IEEE80211_VHT_MCS_SUPPORT_0_9 << (0 * 2)) |
+-(IEEE80211_VHT_MCS_SUPPORT_0_9 << (1 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (2 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (3 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (4 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (5 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (6 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (7 * 2));
++  mcs_map = (IEEE80211_VHT_MCS_SUPPORT_0_9 << (0 * 2)) |
++(IEEE80211_VHT_MCS_SUPPORT_0_9 << (1 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (2 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (3 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (4 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (5 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (6 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (7 * 2));
+ 
+-  vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
+-  vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
+-  vht_cap->cap = IEEE80211_VHT_CAP_RXLDPC |
+- IEEE80211_VHT_CAP_TXSTBC |
+- IEEE80211_VHT_CAP_RXSTBC_1 |
+- IEEE80211_VHT_CAP_SHORT_GI_80;
++  vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
++  vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
++  vht_cap->cap = IEEE80211_VHT_CAP_RXLDPC |
++ IEEE80211_VHT_CAP_TXSTBC |
++ IEEE80211_VHT_CAP_RXSTBC_1 |
++ IEEE80211_VHT_CAP_SHORT_GI_80;
++  }
+ 
+   dev->chandef.chan = &sband->channels[0];
+ 
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ralink: remove VHT capabilities when not using 802.11ac

2015-02-02 Thread John Crispin
Hi,

On 03/02/2015 02:54, wengbj wrote:
> Signed-off-by: wengbj 
> ---
>  .../0001-mt7602-remove-vht-capabilities.patch  |   46 
> 
>  1 file changed, 46 insertions(+)
>  create mode 100644 
> package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
> 
> diff --git 
> a/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch 
> b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
> new file mode 100644
> index 000..397fbbf
> --- /dev/null
> +++ b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
> @@ -0,0 +1,46 @@
> +--- a/init.c
>  b/init.c
> +@@ -682,24 +682,27 @@ mt76_init_sband(struct mt76_dev *dev, st
> + ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
> + ht_cap->ampdu_density = IEEE80211_HT_MPDU_DENSITY_4;
> + 
> +-vht_cap = &sband->vht_cap;
> +-vht_cap->vht_supported = true;
> ++if (dev->cap.has_5ghz)
> ++{
> +
  ^  whitespace bug, space vs tab. please fix and resend




+   vht_cap = &sband->vht_cap;
> ++vht_cap->vht_su
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ralink: remove VHT capabilities when not using 802.11ac

2015-02-02 Thread wengbj
The mt76 driver might have some problem working with MT7602.
MT7602 should not have VHT capabilities . But the driver not identity properly.

Signed-off-by: wengbj 
---
 .../0001-mt7602-remove-vht-capabilities.patch  |   46 
 1 file changed, 46 insertions(+)
 create mode 100644 
package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch

diff --git 
a/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch 
b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
new file mode 100644
index 000..397fbbf
--- /dev/null
+++ b/package/kernel/mt76/patches/0001-mt7602-remove-vht-capabilities.patch
@@ -0,0 +1,46 @@
+--- a/init.c
 b/init.c
+@@ -682,24 +682,27 @@ mt76_init_sband(struct mt76_dev *dev, st
+   ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
+   ht_cap->ampdu_density = IEEE80211_HT_MPDU_DENSITY_4;
+ 
+-  vht_cap = &sband->vht_cap;
+-  vht_cap->vht_supported = true;
++if (dev->cap.has_5ghz)
++{
++  vht_cap = &sband->vht_cap;
++  vht_cap->vht_supported = true;
+ 
+-  mcs_map = (IEEE80211_VHT_MCS_SUPPORT_0_9 << (0 * 2)) |
+-(IEEE80211_VHT_MCS_SUPPORT_0_9 << (1 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (2 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (3 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (4 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (5 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (6 * 2)) |
+-(IEEE80211_VHT_MCS_NOT_SUPPORTED << (7 * 2));
++  mcs_map = (IEEE80211_VHT_MCS_SUPPORT_0_9 << (0 * 2)) |
++(IEEE80211_VHT_MCS_SUPPORT_0_9 << (1 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (2 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (3 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (4 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (5 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (6 * 2)) |
++(IEEE80211_VHT_MCS_NOT_SUPPORTED << (7 * 2));
+ 
+-  vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
+-  vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
+-  vht_cap->cap = IEEE80211_VHT_CAP_RXLDPC |
+- IEEE80211_VHT_CAP_TXSTBC |
+- IEEE80211_VHT_CAP_RXSTBC_1 |
+- IEEE80211_VHT_CAP_SHORT_GI_80;
++  vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
++  vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
++  vht_cap->cap = IEEE80211_VHT_CAP_RXLDPC |
++ IEEE80211_VHT_CAP_TXSTBC |
++ IEEE80211_VHT_CAP_RXSTBC_1 |
++ IEEE80211_VHT_CAP_SHORT_GI_80;
++}
+ 
+   dev->chandef.chan = &sband->channels[0];
+ 
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel