diff --git a/README.md b/README.md index f31f8b3..d0cb63d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ For compiling type `make` in source dir +* NOTE: For some ARM 64-bit system, add argument `ARCH=arm64` if the above command doesn't work + For install the driver use `sudo insmod mt7612u.ko` diff --git a/chips/mt76x2.c b/chips/mt76x2.c index c8f3ef8..2fb26d4 100644 --- a/chips/mt76x2.c +++ b/chips/mt76x2.c @@ -1624,6 +1624,7 @@ int mt76x2_get_rx_high_gain(RTMP_ADAPTER *ad) else cap->rf1_5g_grp5_rx_high_gain = -((value & RF1_5G_GRP5_RX_HIGH_GAIN_MASK) >> 12); } + return 0; } static int mt76x2_get_tx_pwr_info(RTMP_ADAPTER *ad) @@ -2330,6 +2331,8 @@ static int mt76x2_get_tx_pwr_info(RTMP_ADAPTER *ad) /* check PA type combination */ RT28xx_EEPROM_READ16(ad, EEPROM_NIC1_OFFSET, value); cap->PAType= GET_PA_TYPE(value); + + return 0; } static u8 mt76x2_txpwr_chlist[] = { @@ -2415,6 +2418,7 @@ static INT rf_tr_agc_config(RTMP_ADAPTER *pAd, INT rf_bw) signed char rx_agc_fc_offset[3] = {2,2,2}; /* array idx 0: 20M, 1:40M, 2:80m */ UINT8 tx_agc_fc_offset[3] = {0,0,0}; /* array idx 0: 20M, 1:40M, 2:80m */ CHAR rf32_val, rf31_val, rf_diff; + return 0; } void mt76x2_get_tx_pwr_per_rate(RTMP_ADAPTER *ad) diff --git a/common/rt_channel.c b/common/rt_channel.c index 6bc1a7b..a411d04 100644 --- a/common/rt_channel.c +++ b/common/rt_channel.c @@ -2052,6 +2052,7 @@ INT get_vht_neighbor_index(IN UCHAR channel) || (channel == 144) || (channel == 161)) { return -3; } + return 0; } BOOLEAN AC_ChannelGroupCheck( diff --git a/include/os/rt_linux.h b/include/os/rt_linux.h index 58ca183..c27756b 100644 --- a/include/os/rt_linux.h +++ b/include/os/rt_linux.h @@ -537,8 +537,11 @@ typedef struct tasklet_struct *POS_NET_TASK_STRUCT; typedef struct timer_list OS_NDIS_MINIPORT_TIMER; typedef struct timer_list OS_TIMER; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) +typedef void (*TIMER_FUNCTION)(struct timer_list*); +#else typedef void (*TIMER_FUNCTION)(unsigned long); - +#endif #define OS_WAIT(_time) \ { \ diff --git a/os/linux/rt_linux.c b/os/linux/rt_linux.c index 9692027..3b0d269 100644 --- a/os/linux/rt_linux.c +++ b/os/linux/rt_linux.c @@ -150,9 +150,13 @@ static inline VOID __RTMP_OS_Init_Timer( IN PVOID data) { if (!timer_pending(pTimer)) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) + timer_setup(pTimer, function, data); +#else init_timer(pTimer); pTimer->data = (unsigned long)data; pTimer->function = function; +#endif } } diff --git a/os/linux/sta_ioctl.c b/os/linux/sta_ioctl.c index 3bf05a8..4b03272 100644 --- a/os/linux/sta_ioctl.c +++ b/os/linux/sta_ioctl.c @@ -2510,7 +2510,11 @@ INT rt28xx_sta_ioctl(struct net_device *net_dev, struct ifreq *rq, INT cmd) case SIOCGIWPRIV: if (wrqin->u.data.pointer) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) + if ( access_ok(wrqin->u.data.pointer, sizeof(privtab)) != TRUE) +#else if ( access_ok(VERIFY_WRITE, wrqin->u.data.pointer, sizeof(privtab)) != TRUE) +#endif break; if ((sizeof(privtab) / sizeof(privtab[0])) <= wrq->u.data.length) { @@ -2523,7 +2527,11 @@ INT rt28xx_sta_ioctl(struct net_device *net_dev, struct ifreq *rq, INT cmd) } break; case RTPRIV_IOCTL_SET: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) + if(access_ok(wrqin->u.data.pointer, wrqin->u.data.length) != TRUE) +#else if(access_ok(VERIFY_READ, wrqin->u.data.pointer, wrqin->u.data.length) != TRUE) +#endif break; return rt_ioctl_setparam(net_dev, NULL, NULL, wrqin->u.data.pointer); break;