astsam / mt7921

Backport mt7921u driver
GNU General Public License v3.0
12 stars 2 forks source link

Build fails on Orange pi 5 / armbian #1

Open dmarkey opened 1 year ago

dmarkey commented 1 year ago
make -C /lib/modules/5.10.110-rockchip-rk3588//build/ M=/home/dmarkey/mt7921
  CC [M]  /home/dmarkey/mt7921/mt76/mt76x0/usb.o
In file included from /home/dmarkey/mt7921/mt76/mt76x0/../mt76x02.h:12,
                 from /home/dmarkey/mt7921/mt76/mt76x0/mt76x0.h:20,
                 from /home/dmarkey/mt7921/mt76/mt76x0/usb.c:10:
/home/dmarkey/mt7921/mt76/mt76x0/../mt76.h:1192:38: warning: 'struct cfg80211_sar_specs' declared inside parameter list will not be visible outside of this definition or declaration
error, forbidden warning:mt76.h:1192
 1192 |                         const struct cfg80211_sar_specs *sar);
      |                                      ^~~~~~~~~~~~~~~~~~
In file included from /home/dmarkey/mt7921/mt76/mt76x0/usb.c:10:
/home/dmarkey/mt7921/mt76/mt76x0/mt76x0.h:53:39: warning: 'struct cfg80211_sar_specs' declared inside parameter list will not be visible outside of this definition or declaration
error, forbidden warning:mt76x0.h:53
   53 |                          const struct cfg80211_sar_specs *sar);
      |                                       ^~~~~~~~~~~~~~~~~~
/home/dmarkey/mt7921/mt76/mt76x0/usb.c:144:10: error: 'const struct ieee80211_ops' has no member named 'set_sar_specs'
  144 |         .set_sar_specs = mt76x0_set_sar_specs,
      |          ^~~~~~~~~~~~~
/home/dmarkey/mt7921/mt76/mt76x0/usb.c:144:26: error: initialization of 'int (*)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel *, int,  enum ieee80211_roc_type)' from incompatible pointer type 'int (*)(struct ieee80211_hw *, const struct cfg80211_sar_specs *)' [-Werror=incompatible-pointer-types]
  144 |         .set_sar_specs = mt76x0_set_sar_specs,
      |                          ^~~~~~~~~~~~~~~~~~~~
/home/dmarkey/mt7921/mt76/mt76x0/usb.c:144:26: note: (near initialization for 'mt76x0u_ops.remain_on_channel')
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:273: /home/dmarkey/mt7921/mt76/mt76x0/usb.o] Error 1
make[3]: *** [scripts/Makefile.build:516: /home/dmarkey/mt7921/mt76/mt76x0] Error 2
make[2]: *** [scripts/Makefile.build:516: /home/dmarkey/mt7921/mt76] Error 2
make[1]: *** [Makefile:1920: /home/dmarkey/mt7921] Error 2
make: *** [Makefile:35: default] Error 2

5.10.110-rockchip-rk3588

Any idea?

astsam commented 1 year ago

Check the 5.10-compat branch (https://github.com/astsam/mt7921/commit/67adfa15ba3ac2853a0d3741ba6279431df74576). The driver is compiled successfully but I am not sure it is 100% functional.

dmarkey commented 1 year ago
/home/dmarkey/src/mt7921/mt76/mt76x0/pci.c:88:10: error: 'const struct ieee80211_ops' has no member named 'set_sar_specs'
   88 |         .set_sar_specs = mt76x0_set_sar_specs,
      |          ^~~~~~~~~~~~~
/home/dmarkey/src/mt7921/mt76/mt76x0/pci.c:88:26: error: 'mt76x0_set_sar_specs' undeclared here (not in a function); did you mean 'mt76x02_radar_specs'?
   88 |         .set_sar_specs = mt76x0_set_sar_specs,
      |                          ^~~~~~~~~~~~~~~~~~~~
      |                          mt76x02_radar_specs
make[4]: *** [scripts/Makefile.build:273: /home/dmarkey/src/mt7921/mt76/mt76x0/pci.o] Error 1
make[3]: *** [scripts/Makefile.build:516: /home/dmarkey/src/mt7921/mt76/mt76x0] Error 2
make[2]: *** [scripts/Makefile.build:516: /home/dmarkey/src/mt7921/mt76] Error 2
make[1]: *** [Makefile:1920: /home/dmarkey/src/mt7921] Error 2
make: *** [Makefile:35: default] Error 2

Thanks, but now getting a new error (take into account this kernel is very hacked by rockchip)

astsam commented 1 year ago

As a quick workaround disable support for mt76x0e, mt76x2e, mt7603e, mt7615e chips.

blackenz commented 1 year ago

I tried to disable support for the devices @astsam referred on the 5.10-compat branch but i'm also struggling to compile the module. I get this error:

make -C /lib/modules/5.10.110-rockchip-rk3588//build/ M=/home/blackenz/mt7921 arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable CC [M] /home/blackenz/mt7921/mt76/mt7921/mac.o In file included from /home/blackenz/mt7921/mt76/mt7921/../mt76_connac.h:7, from /home/blackenz/mt7921/mt76/mt7921/../mt76_connac_mcu.h:7, from /home/blackenz/mt7921/mt76/mt7921/mt7921.h:9, from /home/blackenz/mt7921/mt76/mt7921/mac.c:7: /home/blackenz/mt7921/mt76/mt7921/../mt76.h:1192:38: warning: 'struct cfg80211_sar_specs' declared inside parameter list will not be visible outside of this definition or declaration error, forbidden warning:mt76.h:1192 1192 | const struct cfg80211_sar_specs *sar); | ^~~~~~~~~~~~~~~~~~ /home/blackenz/mt7921/mt76/mt7921/mac.c: In function 'mt7921_mac_fill_rx': /home/blackenz/mt7921/mt76/mt7921/mac.c:793:33: error: 'RX_FLAG_8023' undeclared (first use in this function) 793 | status->flag |= RX_FLAG_8023; | ^~~~~~~~~~~~ /home/blackenz/mt7921/mt76/mt7921/mac.c:793:33: note: each undeclared identifier is reported only once for each function it appears in /home/blackenz/mt7921/mt76/mt7921/mac.c: In function 'mt7921_vif_connect_iter': /home/blackenz/mt7921/mt76/mt7921/mac.c:1366:17: error: implicit declaration of function 'ieee80211_disconnect'; did you mean 'ieee80211_beacon_get'? [-Werror=implicit-function-declaration] 1366 | ieee80211_disconnect(vif, true); | ^~~~~~~~~~~~~~~~~~~~ | ieee80211_beacon_get cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:273: /home/blackenz/mt7921/mt76/mt7921/mac.o] Error 1 make[3]: *** [scripts/Makefile.build:516: /home/blackenz/mt7921/mt76/mt7921] Error 2 make[2]: *** [scripts/Makefile.build:516: /home/blackenz/mt7921/mt76] Error 2 make[1]: *** [Makefile:1920: /home/blackenz/mt7921] Error 2 make: *** [Makefile:35: default] Error 2

Any advices? Thanks You

razvanphp commented 12 months ago

Any news on this? Would love to have this running on nvidia jetson, the kernel is pinned at 5.10 for the latest release.

Seems like OpenWRT 22.03 backported this for kernel 5.10, can't we reuse that one?

Or can we maybe use / merge it here: https://cdn.kernel.org/pub/linux/kernel/projects/backports/stable/ ?

yuanyangwangTJ commented 3 months ago

Any news on this? Would love to have this running on nvidia jetson, the kernel is pinned at 5.10 for the latest release.

Seems like OpenWRT 22.03 backported this for kernel 5.10, can't we reuse that one?

Or can we maybe use / merge it here: https://cdn.kernel.org/pub/linux/kernel/projects/backports/stable/ ?

Hello, I have a very similar situation, I need to install mt7921u driver on nvidia jetson, have you successfully installed this? I would appreciate it if you could give me any tips!