diff mbox

[v7,1/3] dt-bindings: net: add mt76 wireless device binding

Message ID 20171120193549.80831-2-nbd@nbd.name (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Felix Fietkau Nov. 20, 2017, 7:35 p.m. UTC
Add documentation describing how device tree can be used to configure
wireless chips supported by the mt76 driver.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 .../bindings/net/wireless/mediatek,mt76.txt        | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt

Comments

Rob Herring (Arm) Nov. 20, 2017, 9:34 p.m. UTC | #1
On Mon, Nov 20, 2017 at 08:35:47PM +0100, Felix Fietkau wrote:
> Add documentation describing how device tree can be used to configure
> wireless chips supported by the mt76 driver.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  .../bindings/net/wireless/mediatek,mt76.txt        | 32 ++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt

Acked-by: Rob Herring <robh@kernel.org>
Kalle Valo Nov. 21, 2017, 7:08 a.m. UTC | #2
Felix Fietkau <nbd@nbd.name> wrote:

> Add documentation describing how device tree can be used to configure
> wireless chips supported by the mt76 driver.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> Acked-by: Rob Herring <robh@kernel.org>

Fails to compile:

drivers/net/wireless/mediatek/mt76/mac80211.c: In function ‘mt76_led_init’:
drivers/net/wireless/mediatek/mt76/mac80211.c:111:7: error: implicit declaration of function ‘of_get_child_by_name’ [-Werror=implicit-function-declaration]
  np = of_get_child_by_name(np, "led");
       ^
drivers/net/wireless/mediatek/mt76/mac80211.c:111:5: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  np = of_get_child_by_name(np, "led");
     ^
drivers/net/wireless/mediatek/mt76/mac80211.c:113:8: error: implicit declaration of function ‘of_property_read_u32’ [-Werror=implicit-function-declaration]
   if (!of_property_read_u32(np, "led-sources", &led_pin))
        ^
drivers/net/wireless/mediatek/mt76/mac80211.c:115:17: error: implicit declaration of function ‘of_property_read_bool’ [-Werror=implicit-function-declaration]
   dev->led_al = of_property_read_bool(np, "led-active-low");
                 ^
cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/mediatek/mt76/mac80211.o] Error 1
make[5]: *** Waiting for unfinished jobs....
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c: In function ‘mt76x2_mac_process_rate’:
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:49:20: error: ‘RX_FLAG_SHORTPRE’ undeclared (first use in this function)
    status->flag |= RX_FLAG_SHORTPRE;
                    ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:49:20: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:58:19: error: ‘RX_FLAG_HT_GF’ undeclared (first use in this function)
   status->flag |= RX_FLAG_HT_GF;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:61:19: error: ‘RX_FLAG_HT’ undeclared (first use in this function)
   status->flag |= RX_FLAG_HT;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:65:19: error: ‘RX_FLAG_VHT’ undeclared (first use in this function)
   status->flag |= RX_FLAG_VHT;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:67:9: error: ‘struct ieee80211_rx_status’ has no member named ‘vht_nss’
   status->vht_nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1;
         ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:75:19: error: ‘RX_FLAG_LDPC’ undeclared (first use in this function)
   status->flag |= RX_FLAG_LDPC;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:78:19: error: ‘RX_FLAG_SHORT_GI’ undeclared (first use in this function)
   status->flag |= RX_FLAG_SHORT_GI;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:81:24: error: ‘RX_FLAG_STBC_SHIFT’ undeclared (first use in this function)
   status->flag |= 1 << RX_FLAG_STBC_SHIFT;
                        ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:87:19: error: ‘RX_FLAG_40MHZ’ undeclared (first use in this function)
   status->flag |= RX_FLAG_40MHZ;
                   ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:90:9: error: ‘struct ieee80211_rx_status’ has no member named ‘vht_flag’
   status->vht_flag |= RX_VHT_FLAG_80MHZ;
         ^
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c:90:23: error: ‘RX_VHT_FLAG_80MHZ’ undeclared (first use in this function)
   status->vht_flag |= RX_VHT_FLAG_80MHZ;
                       ^
make[5]: *** [drivers/net/wireless/mediatek/mt76/mt76x2_mac.o] Error 1
make[4]: *** [drivers/net/wireless/mediatek/mt76] Error 2
make[3]: *** [drivers/net/wireless/mediatek] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

3 patches set to Changes Requested.

10067143 [v7,1/3] dt-bindings: net: add mt76 wireless device binding
10067141 [v7,2/3] mt76: add common code shared between multiple chipsets
10067145 [v7,3/3] mt76: add driver code for MT76x2e
Felix Fietkau Nov. 21, 2017, 8:45 a.m. UTC | #3
On 2017-11-21 08:08, Kalle Valo wrote:
> Felix Fietkau <nbd@nbd.name> wrote:
> 
>> Add documentation describing how device tree can be used to configure
>> wireless chips supported by the mt76 driver.
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> Acked-by: Rob Herring <robh@kernel.org>
> 
> Fails to compile:
> 
> drivers/net/wireless/mediatek/mt76/mac80211.c: In function ‘mt76_led_init’:
> drivers/net/wireless/mediatek/mt76/mac80211.c:111:7: error: implicit declaration of function ‘of_get_child_by_name’ [-Werror=implicit-function-declaration]
>   np = of_get_child_by_name(np, "led");
>        ^
Sorry about that, I must have mixed up something while updating the
patches based on my git tree. Will send out a fixed version later today.

- Felix
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
new file mode 100644
index 000000000000..0c17a0ec9b7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
@@ -0,0 +1,32 @@ 
+* MediaTek mt76xx devices
+
+This node provides properties for configuring the MediaTek mt76xx wireless
+device. The node is expected to be specified as a child node of the PCI
+controller to which the wireless chip is connected.
+
+Optional properties:
+
+- mac-address: See ethernet.txt in the parent directory
+- local-mac-address: See ethernet.txt in the parent directory
+- ieee80211-freq-limit: See ieee80211.txt
+- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
+
+Optional nodes:
+- led: Properties for a connected LED
+  Optional properties:
+    - led-sources: See Documentation/devicetree/bindings/leds/common.txt
+
+&pcie {
+	pcie0 {
+		wifi@0,0 {
+			compatible = "mediatek,mt76";
+			reg = <0x0000 0 0 0 0>;
+			ieee80211-freq-limit = <5000000 6000000>;
+			mediatek,mtd-eeprom = <&factory 0x8000>;
+
+			led {
+				led-sources = <2>;
+			};
+		};
+	};
+};