1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Wifi Band Exclusion Interface (AMD ACPI Implementation)
4 * Copyright (C) 2023 Advanced Micro Devices
7 #ifndef _ACPI_AMD_WBRF_H
8 #define _ACPI_AMD_WBRF_H
10 #include <linux/device.h>
11 #include <linux/notifier.h>
13 /* The maximum number of frequency band ranges */
14 #define MAX_NUM_OF_WBRF_RANGES 11
17 #define WBRF_RECORD_ADD 0x0
18 #define WBRF_RECORD_REMOVE 0x1
21 * struct freq_band_range - Wifi frequency band range definition
22 * @start: start frequency point (in Hz)
23 * @end: end frequency point (in Hz)
25 struct freq_band_range
{
31 * struct wbrf_ranges_in_out - wbrf ranges info
32 * @num_of_ranges: total number of band ranges in this struct
33 * @band_list: array of Wifi band ranges
35 struct wbrf_ranges_in_out
{
37 struct freq_band_range band_list
[MAX_NUM_OF_WBRF_RANGES
];
41 * enum wbrf_notifier_actions - wbrf notifier actions index
42 * @WBRF_CHANGED: there was some frequency band updates. The consumers
43 * should retrieve the latest active frequency bands.
45 enum wbrf_notifier_actions
{
49 #if IS_ENABLED(CONFIG_AMD_WBRF)
50 bool acpi_amd_wbrf_supported_producer(struct device
*dev
);
51 int acpi_amd_wbrf_add_remove(struct device
*dev
, uint8_t action
, struct wbrf_ranges_in_out
*in
);
52 bool acpi_amd_wbrf_supported_consumer(struct device
*dev
);
53 int amd_wbrf_retrieve_freq_band(struct device
*dev
, struct wbrf_ranges_in_out
*out
);
54 int amd_wbrf_register_notifier(struct notifier_block
*nb
);
55 int amd_wbrf_unregister_notifier(struct notifier_block
*nb
);
58 bool acpi_amd_wbrf_supported_consumer(struct device
*dev
)
64 int acpi_amd_wbrf_add_remove(struct device
*dev
, uint8_t action
, struct wbrf_ranges_in_out
*in
)
70 bool acpi_amd_wbrf_supported_producer(struct device
*dev
)
75 int amd_wbrf_retrieve_freq_band(struct device
*dev
, struct wbrf_ranges_in_out
*out
)
80 int amd_wbrf_register_notifier(struct notifier_block
*nb
)
85 int amd_wbrf_unregister_notifier(struct notifier_block
*nb
)
89 #endif /* CONFIG_AMD_WBRF */
91 #endif /* _ACPI_AMD_WBRF_H */