diff --git a/qdf/inc/qdf_threads.h b/qdf/inc/qdf_threads.h index 5c624b80a3..aa430d9fd5 100644 --- a/qdf/inc/qdf_threads.h +++ b/qdf/inc/qdf_threads.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -134,4 +134,13 @@ int qdf_get_current_pid(void); */ const char *qdf_get_current_comm(void); +/** + * qdf_thread_set_cpus_allowed_mask() - set cpu mask for a particular thread + * @thread: thread for which new cpu mask is set + * @new_mask: new cpu mask to be set for the thread + * + * Return: None + */ +void +qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask); #endif /* __QDF_THREADS_H */ diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index 08b453dffa..653fe78fcb 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -157,6 +157,11 @@ typedef __qdf_dma_context_t qdf_dma_context_t; typedef __qdf_mem_info_t qdf_mem_info_t; typedef __sgtable_t sgtable_t; +/** + * typepdef qdf_cpu_mask - CPU Mask + */ +typedef __qdf_cpu_mask qdf_cpu_mask; + /** * pointer to net device */ diff --git a/qdf/linux/src/i_qdf_types.h b/qdf/linux/src/i_qdf_types.h index affd9d0922..2c68abfa33 100644 --- a/qdf/linux/src/i_qdf_types.h +++ b/qdf/linux/src/i_qdf_types.h @@ -156,6 +156,7 @@ typedef dma_addr_t __qdf_dma_addr_t; typedef size_t __qdf_dma_size_t; typedef dma_addr_t __qdf_dma_context_t; typedef struct net_device *__qdf_netdev_t; +typedef struct cpumask __qdf_cpu_mask; typedef __le16 __qdf_le16_t; typedef __le32 __qdf_le32_t; typedef __le64 __qdf_le64_t; diff --git a/qdf/linux/src/qdf_threads.c b/qdf/linux/src/qdf_threads.c index bad4a228db..b0b22ab7c8 100644 --- a/qdf/linux/src/qdf_threads.c +++ b/qdf/linux/src/qdf_threads.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -228,3 +228,11 @@ const char *qdf_get_current_comm(void) return current->comm; } qdf_export_symbol(qdf_get_current_comm); + +void +qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask) +{ + set_cpus_allowed_ptr(thread, new_mask); +} + +qdf_export_symbol(qdf_thread_set_cpus_allowed_mask);