1 /* 2 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: Driver Synchronization Core (DSC) APIs for use by the driver 22 * orchestration layer. 23 * 24 * This infrastructure accomplishes two high level goals: 25 * 1) Replace ad-hoc locking/flags (hdd_init_deinit_lock, 26 * iface_change_lock, con_mode_flag, etc., etc., etc.) 27 * 2) Make cds_ssr_protect() and driver state checking atomic 28 * 29 * These two goals are commplished in DSC via two corollary concepts: 30 * 1) Transitions (as in driver state machine transitions) 31 * These are mutually exclusive, and replace ad-hoc locking 32 * 2) Operations (as in operations the driver is currently servicing) 33 * These execute concurrently with other operations, and replace 34 * cds_ssr_protect(). Any active transition causes new operations to be 35 * rejected, in the same way as cds_ssr_protect/hdd_validate_context would. 36 * 37 * Transitions and operations are split into 3 distinct levels: driver, psoc, 38 * and vdev. These levels are arranged into a tree, with a single driver at 39 * the root, zero or more psocs per driver, and zero or more vdevs per psoc. 40 * 41 * High level transitions block transitions and operations at the same level, 42 * down-tree, and up-tree. So a driver transition effectively prevents any new 43 * activity in the system, while a vdev transition prevents transitions and 44 * operations on the same vdev, its parent psoc, and the driver. This also means 45 * that sibling nodes can transition at the same time, e.g. one vdev going up at 46 * the same time another is going down. 47 */ 48 49 #ifndef __WLAN_DSC_H 50 #define __WLAN_DSC_H 51 52 #include "wlan_dsc_driver.h" 53 #include "wlan_dsc_psoc.h" 54 #include "wlan_dsc_vdev.h" 55 56 #endif /* __WLAN_DSC_H */ 57