1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Broadcom Dongle Host Driver (DHD), Generic work queue framework 4 * Generic interface to handle dhd deferred work events 5 * 6 * Copyright (C) 1999-2017, Broadcom Corporation 7 * 8 * Unless you and Broadcom execute a separate written software license 9 * agreement governing use of this software, this software is licensed to you 10 * under the terms of the GNU General Public License version 2 (the "GPL"), 11 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 12 * following added to such license: 13 * 14 * As a special exception, the copyright holders of this software give you 15 * permission to link this software with independent modules, and to copy and 16 * distribute the resulting executable under terms of your choice, provided that 17 * you also meet, for each linked independent module, the terms and conditions of 18 * the license of that module. An independent module is a module which is not 19 * derived from this software. The special exception does not apply to any 20 * modifications of the software. 21 * 22 * Notwithstanding the above, under no circumstances may you combine this 23 * software in any way with any other Broadcom software provided under a license 24 * other than the GPL, without Broadcom's express prior written consent. 25 * 26 * 27 * <<Broadcom-WL-IPTag/Open:>> 28 * 29 * $Id: dhd_linux_wq.h 704361 2017-06-13 08:50:38Z $ 30 */ 31 #ifndef _dhd_linux_wq_h_ 32 #define _dhd_linux_wq_h_ 33 /* 34 * Work event definitions 35 */ 36 enum _wq_event { 37 DHD_WQ_WORK_IF_ADD = 1, 38 DHD_WQ_WORK_IF_DEL, 39 DHD_WQ_WORK_SET_MAC, 40 DHD_WQ_WORK_SET_MCAST_LIST, 41 DHD_WQ_WORK_IPV6_NDO, 42 DHD_WQ_WORK_HANG_MSG, 43 DHD_WQ_WORK_SOC_RAM_DUMP, 44 DHD_WQ_WORK_DHD_LOG_DUMP, 45 DHD_WQ_WORK_INFORM_DHD_MON, 46 DHD_WQ_WORK_EVENT_LOGTRACE, 47 DHD_WQ_WORK_DMA_LB_MEM_REL, 48 DHD_WQ_WORK_DEBUG_UART_DUMP, 49 DHD_WQ_WORK_SSSR_DUMP, 50 DHD_WQ_WORK_PKTLOG_DUMP, 51 #ifdef DHD_UPDATE_INTF_MAC 52 DHD_WQ_WORK_IF_UPDATE, 53 #endif /* DHD_UPDATE_INTF_MAC */ 54 DHD_MAX_WQ_EVENTS 55 }; 56 57 /* 58 * Work event priority 59 */ 60 enum wq_priority { 61 DHD_WQ_WORK_PRIORITY_LOW = 1, 62 DHD_WQ_WORK_PRIORITY_HIGH, 63 DHD_WQ_MAX_PRIORITY 64 }; 65 66 /* 67 * Error definitions 68 */ 69 #define DHD_WQ_STS_OK 0 70 #define DHD_WQ_STS_FAILED -1 /* General failure */ 71 #define DHD_WQ_STS_UNINITIALIZED -2 72 #define DHD_WQ_STS_SCHED_FAILED -3 73 #define DHD_WQ_STS_UNKNOWN_EVENT -4 74 #define DHD_WQ_STS_UNKNOWN_PRIORITY -5 75 76 typedef void (*event_handler_t)(void *handle, void *event_data, u8 event); 77 78 void *dhd_deferred_work_init(void *dhd); 79 void dhd_deferred_work_deinit(void *workq); 80 int dhd_deferred_schedule_work(void *workq, void *event_data, u8 event, 81 event_handler_t evt_handler, u8 priority); 82 #endif /* _dhd_linux_wq_h_ */ 83