Browse Source

Merge pull request #159 from AstroDrabb/master

Updated to work with kernel 5.0.x changes
Ole Petter Bang 6 years ago
parent
commit
f5f4112c6e
10 changed files with 34 additions and 15 deletions
  1. 9 0
      .gitignore
  2. 1 0
      Makefile
  3. 3 0
      README.md
  4. 1 1
      dkms.conf
  5. 1 1
      hal/rtl8812a/rtl8812a_mp.c
  6. 1 1
      include/rtw_version.h
  7. 9 5
      install.sh
  8. 5 1
      os_dep/linux/rtw_android.c
  9. 3 3
      os_dep/osdep_service.c
  10. 1 3
      runwpa

+ 9 - 0
.gitignore

@@ -0,0 +1,9 @@
+
+*.o
+*.o.cmd
+*.ko
+*.ko.cmd
+Module.symvers
+modules.order
+*.mod
+8812au.mod.c

+ 1 - 0
Makefile

@@ -16,6 +16,7 @@ EXTRA_CFLAGS += -Wno-unused
 
 EXTRA_CFLAGS += -Wno-uninitialized
 EXTRA_CFLAGS += -Wno-int-to-pointer-cast
+EXTRA_CFLAGS += -Wno-vla
 
 EXTRA_CFLAGS += -I$(src)/include
 

+ 3 - 0
README.md

@@ -1,3 +1,6 @@
+## Changes
+2019-07-11: Updated to compile against kernel 5.2
+
 ## Realtek 802.11ac (rtl8812au)
 
 This is a fork of the Realtek 802.11ac (rtl8812au) v4.2.2 (7502.20130507)

+ 1 - 1
dkms.conf

@@ -1,5 +1,5 @@
 PACKAGE_NAME=8812au
-PACKAGE_VERSION=4.2.2
+PACKAGE_VERSION=4.2.3
 
 DEST_MODULE_LOCATION=/kernel/drivers/net/wireless
 BUILT_MODULE_NAME=8812au

+ 1 - 1
hal/rtl8812a/rtl8812a_mp.c

@@ -600,6 +600,7 @@ void Hal_SetAntenna(PADAPTER pAdapter)
 	u8	r_rx_antenna_ofdm = 0, r_ant_select_cck_val = 0;
 	u8	chgTx = 0, chgRx = 0;
 	u32	r_ant_sel_cck_val = 0, r_ant_select_ofdm_val = 0, r_ofdm_tx_en_val = 0;
+	u32 reg0xC50 = 0;
 
 
 	p_ofdm_tx = (R_ANTENNA_SELECT_OFDM *)&r_ant_select_ofdm_val;
@@ -637,7 +638,6 @@ void Hal_SetAntenna(PADAPTER pAdapter)
 
 	switch (pAdapter->mppriv.antenna_rx)
 	{
-		u32 reg0xC50 = 0;
 		case ANTENNA_A:
 			PHY_SetBBReg(pAdapter, rRxPath_Jaguar, bMaskByte0, 0x11);	
 			PHY_SetRFReg(pAdapter, ODM_RF_PATH_B, RF_AC_Jaguar, 0xF0000, 0x1); // RF_B_0x0[19:16] = 1, Standby mode

+ 1 - 1
include/rtw_version.h

@@ -1 +1 @@
-#define DRIVERVERSION	"v4.2.2_7502.20130517"
+#define DRIVERVERSION	"v4.2.3"

+ 9 - 5
install.sh

@@ -1010,11 +1010,15 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
 }
 
 static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
-			    , void *unused
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-			    , select_queue_fallback_t fallback
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
+  #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
+	  , void *accel_priv
+  #else
+    , struct net_device *sb_dev
+  #endif
+  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0))
+	  , select_queue_fallback_t fallback
+  #endif
 #endif
 ){
 	_adapter	*padapter = rtw_netdev_priv(dev);

+ 5 - 1
os_dep/linux/rtw_android.c

@@ -352,7 +352,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
 		goto exit;
 	}
 
-	if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0))
+    if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){
+#else
+    if (!access_ok(priv_cmd.buf, priv_cmd.total_len)){
+#endif
 	 	DBG_871X("%s: failed to access memory\n", __FUNCTION__);
 		ret = -EFAULT;
 		goto exit;

+ 3 - 3
os_dep/osdep_service.c

@@ -1556,7 +1556,7 @@ static int isFileReadable(char *path)
 		ret = PTR_ERR(fp);
 	}
 	else {
-		oldfs = get_fs(); set_fs(get_ds());
+		oldfs = get_fs(); set_fs(KERNEL_DS);
 		
 		if(1!=readFile(fp, &buf, 1))
 			ret = PTR_ERR(fp);
@@ -1584,7 +1584,7 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
 		if( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
 			DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
 
-			oldfs = get_fs(); set_fs(get_ds());
+			oldfs = get_fs(); set_fs(KERNEL_DS);
 			ret=readFile(fp, buf, sz);
 			set_fs(oldfs);
 			closeFile(fp);
@@ -1618,7 +1618,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
 		if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
 			DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
 
-			oldfs = get_fs(); set_fs(get_ds());
+			oldfs = get_fs(); set_fs(KERNEL_DS);
 			ret=writeFile(fp, buf, sz);
 			set_fs(oldfs);
 			closeFile(fp);

+ 1 - 3
runwpa

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 if [ "`which iwconfig`" = "" ] ; then 
-	echo "WARNING:Wireless tool not exist!"
+	echo "WARNING:Wireless tool (iwconfig) not exist!"
 	echo "        Please install it!"
 	exit
 else
@@ -16,5 +16,3 @@ else
 
 	fi
 fi
-
-