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