Skip to content

Commit

Permalink
update for the kernels up to 5.19, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
loimu committed Feb 18, 2023
1 parent f4fba63 commit 0394bf7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
1 change: 0 additions & 1 deletion dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ PACKAGE_VERSION="#MODULE_VERSION#"
BUILT_MODULE_NAME[0]="rtbth"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="yes"
REMAKE_INITRD="yes"
3 changes: 3 additions & 0 deletions include/rt_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ typedef struct _RTMP_OS_FS_INFO_
int fsuid;
int fsgid;
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
mm_segment_t fs;
#endif
}RTMP_OS_FS_INFO;

#define IS_FILE_OPEN_ERR(_fd) IS_ERR((_fd))
Expand Down
8 changes: 8 additions & 0 deletions include/rtbt_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
#define __RTBT_TYPE_H

#ifdef __GNUC__

#include <linux/version.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
#include <linux/stdarg.h>
#else
#include <stdarg.h>
#endif

#endif // __GNUC__ //

typedef signed char INT8;
Expand Down
2 changes: 1 addition & 1 deletion rtbth_core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "rtbth_3298.h"
#include "rtbt_ctrl.h"

#define VERSION "3.9.7"
#define VERSION "3.9.8"

MODULE_AUTHOR("Ralink Tech.");
MODULE_DESCRIPTION("Support for Ralink Bluetooth RT3290 Cards");
Expand Down
19 changes: 14 additions & 5 deletions rtbth_core_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,13 @@ int rtbt_dma_mem_alloc(
OUT void **virt_addr,
OUT PHYSICAL_ADDRESS *phy_addr)
{
*virt_addr = (PVOID)pci_alloc_consistent((struct pci_dev *)if_dev,
sizeof(char)*len,
(dma_addr_t *)phy_addr);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
*virt_addr = (PVOID)dma_alloc_coherent(
&((struct pci_dev *)if_dev)->dev, sizeof(char)*len, (dma_addr_t *)phy_addr, GFP_KERNEL);
#else
*virt_addr = (PVOID)pci_alloc_consistent(
(struct pci_dev *)if_dev, sizeof(char)*len, (dma_addr_t *)phy_addr);
#endif

return TRUE;
}
Expand All @@ -418,8 +422,13 @@ void rtbt_dma_mem_free(
IN void *virt_addr,
IN PHYSICAL_ADDRESS phy_addr)
{
pci_free_consistent((struct pci_dev *)if_dev,
len, virt_addr, phy_addr);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
dma_free_coherent(
&((struct pci_dev *)if_dev)->dev, len, virt_addr, phy_addr);
#else
pci_free_consistent(
(struct pci_dev *)if_dev, len, virt_addr, phy_addr);
#endif
}


Expand Down

0 comments on commit 0394bf7

Please sign in to comment.