Skip to content

Instantly share code, notes, and snippets.

@moutend
Last active June 5, 2018 07:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save moutend/cb35a37297910c99d3e2 to your computer and use it in GitHub Desktop.
Save moutend/cb35a37297910c99d3e2 to your computer and use it in GitHub Desktop.
diff -ru mt7610u_wifi_sta_v3002_dpo_20130916.orig/os/linux/config.mk mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/config.mk
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/os/linux/config.mk 2015-04-30 05:14:38.000000000 +0900
+++ mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/config.mk 2015-04-30 05:44:07.000000000 +0900
@@ -23,12 +23,12 @@
# Support Wpa_Supplicant
# i.e. wpa_supplicant -Dralink
-HAS_WPA_SUPPLICANT=n
+HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Maganger
# i.e. wpa_supplicant -Dwext
-HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
+HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
#Support Net interface block while Tx-Sw queue full
HAS_BLOCK_NET_IF=n
@@ -660,7 +660,7 @@
WFLAGS += -DCONFIG_CSO_SUPPORT -DCONFIG_TSO_SUPPORT
endif
-CHIPSET_DAT = 2860
+CHIPSET_DAT = 2870
endif
ifneq ($(or $(findstring mt7662e,$(CHIPSET)),$(findstring mt7612e,$(CHIPSET))),)
#!/bin/bash
# Patches for mt7610u
#
# Author: moutend <moutend@gmail.com>
# LICENSE: CC BY-SA 4.0
# This bash-script targets Raspberry Pi 2.
KERNEL_VERSION=`uname -r | cut -d '.' -f 1`
if [ "$KERNEL_VERSION" -eq "4" ]
then
patch $HOME/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/rt_linux.c < $HOME/gist/rt_linux.c.patch
fi
patch $HOME/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/config.mk < $HOME/gist/config.mk.patch
patch $HOME/mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h < $HOME/gist/rt_linux.h.patch
patch $HOME/mt7610u_wifi_sta_v3002_dpo_20130916/conf/RT2870STA.dat < $HOME/gist/RT2870STA.dat.patch
patch $HOME/mt7610u_wifi_sta_v3002_dpo_20130916/common/rtusb_dev_id.c < $HOME/gist/rtusb_dev_id.c.patch
echo "Successfully done."
diff -ru mt7610u_wifi_sta_v3002_dpo_20130916.orig/conf/RT2870STA.dat mt7610u_wifi_sta_v3002_dpo_20130916/conf/RT2870STA.dat
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/conf/RT2870STA.dat 2015-04-24 03:01:48.612387993 +0000
+++ mt7610u_wifi_sta_v3002_dpo_20130916/conf/RT2870STA.dat 2015-04-24 03:23:32.330434121 +0000
@@ -4,7 +4,7 @@
CountryRegionABand=7
CountryCode=
ChannelGeography=1
-SSID=11n-AP
+SSID=
NetworkType=Infra
WirelessMode=5
EfuseBufferMode=0
@@ -19,8 +19,8 @@
PktAggregate=0
WmmCapable=1
AckPolicy=0;0;0;0
-AuthMode=OPEN
-EncrypType=NONE
+AuthMode=WPA2PSK
+EncrypType=AES
WPAPSK=
DefaultKeyID=1
Key1Type=0
diff -ru mt7610u_wifi_sta_v3002_dpo_20130916.orig/os/linux/rt_linux.c mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/rt_linux.c > rt_linux.c.patch
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/os/linux/rt_linux.c 2013-09-16 14:03:08.000000000 +0000
+++ mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/rt_linux.c 2015-09-03 20:05:31.870245456 +0000
@@ -1083,8 +1083,8 @@
int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
{
/* The object must have a read method */
- if (osfd->f_op && osfd->f_op->read) {
- return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
+ if (osfd->f_op) {
+ return __vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
} else {
DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
return -1;
diff -ru mt7610u_wifi_sta_v3002_dpo_20130916.orig/include/os/rt_linux.h mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/include/os/rt_linux.h 2015-04-24 03:01:48.612387993 +0000
+++ mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h 2015-04-24 03:14:18.435327475 +0000
@@ -277,8 +277,8 @@
typedef struct _OS_FS_INFO_
{
- int fsuid;
- int fsgid;
+ kuid_t fsuid;
+ kgid_t fsgid;
mm_segment_t fs;
} OS_FS_INFO;
diff -ru mt7610u_wifi_sta_v3002_dpo_20130916.orig/common/rtusb_dev_id.c mt7610u_wifi_sta_v3002_dpo_20130916/common/rtusb_dev_id.c
--- mt7610u_wifi_sta_v3002_dpo_20130916.orig/common/rtusb_dev_id.c 2015-04-24 03:01:48.572388365 +0000
+++ mt7610u_wifi_sta_v3002_dpo_20130916/common/rtusb_dev_id.c 2015-04-24 03:02:54.971770759 +0000
@@ -36,6 +36,7 @@
/* module table */
USB_DEVICE_ID rtusb_dev_id[] = {
#ifdef MT76x0
+ {USB_DEVICE(0x2019,0xAB31)}, /* GW-450D */
{USB_DEVICE(0x148F,0x7610)}, /* MT7610U */
{USB_DEVICE(0x0E8D,0x7610)}, /* MT7610U */
{USB_DEVICE_AND_INTERFACE_INFO(0x0E8D, 0x7630, 0xff, 0x2, 0xff)}, /* MT7630U */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment