Giter VIP home page Giter VIP logo

mt7612u's Introduction

MT7612U for Linux

NEWSFLASH
since v5.0 please use upstream driver mt76x2u

Tested with latest -stable, v4.15.6

Driver for 802.11ac USB Adapter with
MT7612U/MT7632U/MT7662U chipset
STA, AP are possible

Current setting for this driver is APSTA mode as default.
STA mode is working fine, (your need to set STA in Makefile) AP mode can crash your kernel if you call iwconfig after module loading

Codepaths for Monitor Mode are missing, detected while fix memory leak in mt7610u

At least v4.2 is needed to compile this module
sorry people with older kernels, the code is removed.

Tested on X86_64 platform(s) only,
cross compile possible

For compiling type
make
in source dir

For install the needed firmware files
sudo make installfw

For install the driver use
sudo insmod mt7612u.ko

To Unload driver you may need to disconnect the device

If the driver fails building consult your distro how to
install the kernel sources and build an external module.

Questions about this will silently ignored !
They are plenty information around the web.

NOTES

The original driver is PITA
Both mt7610u and mt7612u can work with the same driver.
but currently dont't

Code which is missing in one driver, may found in the other driver.
i.e STA, AP, Monitor, RSSI, LED handling stuff

STATUS
Driver works fine (some sort of)
Most of the work is done is cleaning the driver and make this mess readable for conversion.
Updates for wireless-ext/cfg80211 are not accepted.
The only solution is uptream and this is mac80211 support.

BUGS

  • enable cfg80211
  • remove stupid AP/STA switch
  • fix unloading driver
  • do more function typesafe
  • cross compile check with real hw on $target
  • strip fw files and use kernel firmware load
  • check for wrong typecasts
  • remove/strip hardcoded RT2870STA.dat
  • check for wrong variable sizes (driver was for 32bit)
  • update to more USB-IDs
  • check if monitor mode is working
  • more cleanup and other stuff
  • fix compile warnings
  • misc. other stuff

Hans Ulli Kroll [email protected]

mt7612u's People

Contributors

ulli-kroll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mt7612u's Issues

How do i install after download?

hello, i am very new to these issues, i need your help. i downloaded the driver you shared, but i don't know how to install it, i would appreciate it if you tell me step by step :)

There is an error doing "make"

┌──(root㉿kali)-[/home/kali/Downloads/mt7612u-master]
└─# make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.4.0-kali3-amd64/build M=/home/kali/Downloads/mt7612u-master modules
make[1]: Entering directory '/usr/src/linux-headers-6.4.0-kali3-amd64'
CC [M] /home/kali/Downloads/mt7612u-master/ap/ap_mbss.o
In file included from /home/kali/Downloads/mt7612u-master/include/rtmp_os.h:37,
from /home/kali/Downloads/mt7612u-master/include/rtmp_comm.h:38,
from /home/kali/Downloads/mt7612u-master/include/rt_config.h:35,
from /home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:47:
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:230:9: error: unknown type name ‘mm_segment_t’
230 | mm_segment_t fs;
| ^~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c: In function ‘MBSS_Init’:
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:125:33: error: expected ‘(’ before ‘static’
125 | #define __inline static inline
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/compiler_types.h:332:24: note: in expansion of macro ‘__inline’
332 | #define asm_inline asm __inline
| ^~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:9: note: in expansion of macro ‘asm_inline’
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:630:26: note: in expansion of macro ‘__fortify_memcpy_chk’
630 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:134:17: note: in expansion of macro ‘memcpy’
134 | memcpy(&netDevHook, pNetDevOps, sizeof(netDevHook));
| ^~~~~~
In file included from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/bug.h:5,
from /usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/paravirt.h:15,
from /usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/cpuid.h:62,
from /usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/processor.h:19,
from /usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/timex.h:5,
from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/timex.h:67,
from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/time32.h:13,
from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/time.h:60,
from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/stat.h:19,
from /usr/src/linux-headers-6.4.0-kali3-common/include/linux/module.h:13,
from /home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:18:
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:29: error: expected identifier or ‘(’ before string constant
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:630:26: note: in expansion of macro ‘__fortify_memcpy_chk’
630 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:134:17: note: in expansion of macro ‘memcpy’
134 | memcpy(&netDevHook, pNetDevOps, sizeof(netDevHook));
| ^~~~~~
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:125:33: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
125 | #define __inline static inline
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/compiler_types.h:332:24: note: in expansion of macro ‘__inline’
332 | #define asm_inline asm __inline
| ^~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:9: note: in expansion of macro ‘asm_inline’
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:630:26: note: in expansion of macro ‘__fortify_memcpy_chk’
630 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:134:17: note: in expansion of macro ‘memcpy’
134 | memcpy(&netDevHook, pNetDevOps, sizeof(netDevHook));
| ^~~~~~
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:125:33: error: expected ‘(’ before ‘static’
125 | #define __inline static inline
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/compiler_types.h:332:24: note: in expansion of macro ‘__inline’
332 | #define asm_inline asm __inline
| ^~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:9: note: in expansion of macro ‘asm_inline’
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:634:27: note: in expansion of macro ‘__fortify_memcpy_chk’
634 | #define memmove(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:141:17: note: in expansion of macro ‘memmove’
141 | memmove(&netDevHook.devAddr[0], &wdev->bssid[0], MAC_ADDR_LEN);
| ^~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:29: error: expected identifier or ‘(’ before string constant
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:634:27: note: in expansion of macro ‘__fortify_memcpy_chk’
634 | #define memmove(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:141:17: note: in expansion of macro ‘memmove’
141 | memmove(&netDevHook.devAddr[0], &wdev->bssid[0], MAC_ADDR_LEN);
| ^~~~~~~
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:125:33: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
125 | #define __inline static inline
| ^~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/compiler_types.h:332:24: note: in expansion of macro ‘__inline’
332 | #define asm_inline asm __inline
| ^~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:28:9: note: in expansion of macro ‘asm_inline’
28 | asm_inline volatile("1:\t" ins "\n"
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/arch/x86/include/asm/bug.h:83:9: note: in expansion of macro ‘_BUG_FLAGS’
83 | _BUG_FLAGS(ASM_UD2, __flags, ASM_REACHABLE);
| ^~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:106:17: note: in expansion of macro ‘__WARN_FLAGS’
106 | __WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));
| ^~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:133:17: note: in expansion of macro ‘__WARN_printf’
133 | __WARN_printf(TAINT_WARN, format);
| ^~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/once_lite.h:31:25: note: in expansion of macro ‘WARN’
31 | func(VA_ARGS);
| ^~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/asm-generic/bug.h:151:9: note: in expansion of macro ‘DO_ONCE_LITE_IF’
151 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:578:9: note: in expansion of macro ‘WARN_ONCE’
578 | WARN_ONCE(fortify_memcpy_chk(__fortify_size, __p_size,
| ^~~~~~~~~
/usr/src/linux-headers-6.4.0-kali3-common/include/linux/fortify-string.h:634:27: note: in expansion of macro ‘__fortify_memcpy_chk’
634 | #define memmove(p, q, s) __fortify_memcpy_chk(p, q, s,
| ^~~~~~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:141:17: note: in expansion of macro ‘memmove’
141 | memmove(&netDevHook.devAddr[0], &wdev->bssid[0], MAC_ADDR_LEN);
| ^~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c: In function ‘MBSS_Close’:
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:279:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
279 | if (BssId < 0)
| ^~
/home/kali/Downloads/mt7612u-master/include/os/rt_linux.h:559:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
559 | #define RTMP_OS_NETDEV_STOP_QUEUE(_pNetDev) netif_stop_queue((_pNetDev))
| ^~~~~~~~~~~~~~~~
/home/kali/Downloads/mt7612u-master/ap/ap_mbss.c:282:9: note: in expansion of macro ‘RTMP_OS_NETDEV_STOP_QUEUE’
282 | RTMP_OS_NETDEV_STOP_QUEUE(pDev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [/usr/src/linux-headers-6.4.0-kali3-common/scripts/Makefile.build:257: /home/kali/Downloads/mt7612u-master/ap/ap_mbss.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.4.0-kali3-common/Makefile:2057: /home/kali/Downloads/mt7612u-master] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.4.0-kali3-amd64'
make: *** [Makefile:615: modules] Error 2

How do i fix this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.