Skip to content

Commit

Permalink
Merge pull request #6 from jsuann/4.15-fixes
Browse files Browse the repository at this point in the history
Fixes for 4.15+ kernels
  • Loading branch information
mareksuscak authored Sep 18, 2018
2 parents 9bb52e9 + 4e24880 commit 38e8f7e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
38 changes: 19 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,26 @@ ifeq ($(OSABL),YES)
endif

ifeq ($(RT28xx_MODE),AP)
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)ap.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)ap.o /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)ap.o /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)ap.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)ap.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)ap.o /tftpboot
endif
ifeq ($(PLATFORM),INF_AMAZON_SE)
cp -f /tftpboot/rt2870ap.o /backup/ifx/build/root_filesystem/lib/modules/2.4.31-Amazon_SE-3.6.2.2-R0416_Ralink/kernel/drivers/net
# cp -f /tftpboot/rt2870ap.o /backup/ifx/build/root_filesystem/lib/modules/2.4.31-Amazon_SE-3.6.2.2-R0416_Ralink/kernel/drivers/net
endif
else
ifeq ($(RT28xx_MODE),APSTA)
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)apsta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)apsta.o /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)apsta.o /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)apsta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)apsta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)apsta.o /tftpboot
endif
else
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)sta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)sta.o /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)sta.o /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)sta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)sta.o /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)sta.o /tftpboot
endif
endif
endif
Expand Down Expand Up @@ -398,25 +398,25 @@ ifeq ($(OSABL),YES)
endif

ifeq ($(RT28xx_MODE),AP)
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)ap.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)ap.ko /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)ap.ko /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)ap.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)ap.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)ap.ko /tftpboot
endif
rm -f os/linux/rt$(MODULE)ap.ko.lzma
/root/bin/lzma e os/linux/rt$(MODULE)ap.ko os/linux/rt$(MODULE)ap.ko.lzma
else
ifeq ($(RT28xx_MODE),APSTA)
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)apsta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)apsta.ko /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)apsta.ko /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)apsta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)apsta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)apsta.ko /tftpboot
endif
else
cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)sta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rt$(MODULE)sta.ko /tftpboot
ifeq ($(OSABL),YES)
cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)sta.ko /tftpboot
cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)sta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtutil$(MODULE)sta.ko /tftpboot
# cp -f $(RT28xx_DIR)/os/linux/rtnet$(MODULE)sta.ko /tftpboot
endif
endif
endif
Expand Down
4 changes: 2 additions & 2 deletions common/rtmp_mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ INT RtmpAsicSendCommandToMcu(
&& (pAd->HostVendor != PCIBUS_INTEL_VENDOR)))
{
offset = 0x70F;
pci_read_config_word(((POS_COOKIE)pAd->OS_Cookie)->pci_dev, offset, &Configuration);
pci_read_config_word(((POS_COOKIE)pAd->OS_Cookie)->pci_dev, offset, (u16*)&Configuration);
Configuration=le2cpu16(Configuration);
Configuration &= 0xffffff00;
Configuration |= (0x13); /* set Latency to default */
Expand All @@ -575,7 +575,7 @@ INT RtmpAsicSendCommandToMcu(
{
offset = 0x70F;
/* Configuration = RTMPReadCBConfigXP(pAd, offset); */
pci_read_config_word(((POS_COOKIE)pAd->OS_Cookie)->pci_dev, offset, &Configuration);
pci_read_config_word(((POS_COOKIE)pAd->OS_Cookie)->pci_dev, offset, (u16*)&Configuration);
Configuration=le2cpu16(Configuration);

Configuration &= 0xffffff00;
Expand Down
4 changes: 4 additions & 0 deletions include/os/rt_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,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) \
Expand Down
2 changes: 1 addition & 1 deletion os/linux/pci_main_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,4 +528,4 @@ static VOID __devexit rt2860_remove_one(




MODULE_LICENSE("GPL");
4 changes: 4 additions & 0 deletions os/linux/rt_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,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(data, function, 0);
#else
init_timer(pTimer);
pTimer->data = (unsigned long)data;
pTimer->function = function;
#endif
}
}

Expand Down
2 changes: 1 addition & 1 deletion os/linux/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ int rt_ioctl_iwaplist(struct net_device *dev,
set_quality(pAd, &qual[i], pList); /*&pAd->ScanTab.BssEntry[i]); */
}
data->length = i;
memcpy(extra, &addr, i*sizeof(addr[0]));
memcpy(extra, addr, i*sizeof(addr[0]));
data->flags = 1; /* signal quality present (sort of) */
memcpy(extra + i*sizeof(addr[0]), &qual, i*sizeof(qual[i]));

Expand Down

0 comments on commit 38e8f7e

Please sign in to comment.