Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Linux kernel 6.4 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion csr/os_linux/driver/drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ static void udi_set_log_filter(ul_client_t *pcli,


/* Mutex to protect access to priv->sme_cli */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
DEFINE_SEMAPHORE(udi_mutex,1);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
DEFINE_SEMAPHORE(udi_mutex);
#else
DECLARE_MUTEX(udi_mutex);
Expand Down Expand Up @@ -2132,7 +2134,11 @@ uf_create_debug_device(struct file_operations *fops)
}

/* Create a UniFi class */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
unifi_class = class_create(UNIFI_NAME);
#else
unifi_class = class_create(THIS_MODULE, UNIFI_NAME);
#endif
if (IS_ERR(unifi_class)) {
unifi_error(NULL, "Failed to create UniFi class\n");

Expand Down
4 changes: 3 additions & 1 deletion csr/os_linux/driver/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ static int In_use[MAX_UNIFI_DEVS];
* Mutex to prevent UDI clients to open the character device before the priv
* is created and initialised.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
DEFINE_SEMAPHORE(Unifi_instance_mutex,1);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
DEFINE_SEMAPHORE(Unifi_instance_mutex);
#else
DECLARE_MUTEX(Unifi_instance_mutex);
Expand Down