Skip to content
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
7 changes: 6 additions & 1 deletion csr/os_linux/driver/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3428,7 +3428,12 @@ void uf_net_get_name(struct net_device *dev, char *name, int len)
{
*name = '\0';
if (dev) {
strlcpy(name, dev->name, (len > IFNAMSIZ) ? IFNAMSIZ : len);
int maxlen = (len > IFNAMSIZ) ? IFNAMSIZ : len;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
strscpy(name, dev->name, maxlen);
#else
strlcpy(name, dev->name, maxlen);
#endif
}

} /* uf_net_get_name */
Expand Down