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