brintos

brintos / linux-shallow public Read only

0
0
Text · 2.2 KiB · 898f31d Raw
92 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * Wifi Band Exclusion Interface (AMD ACPI Implementation)4 * Copyright (C) 2023 Advanced Micro Devices5 */6 7#ifndef _ACPI_AMD_WBRF_H8#define _ACPI_AMD_WBRF_H9 10#include <linux/device.h>11#include <linux/notifier.h>12 13/* The maximum number of frequency band ranges */14#define MAX_NUM_OF_WBRF_RANGES		1115 16/* Record actions */17#define WBRF_RECORD_ADD		0x018#define WBRF_RECORD_REMOVE	0x119 20/**21 * struct freq_band_range - Wifi frequency band range definition22 * @start: start frequency point (in Hz)23 * @end: end frequency point (in Hz)24 */25struct freq_band_range {26	u64		start;27	u64		end;28};29 30/**31 * struct wbrf_ranges_in_out - wbrf ranges info32 * @num_of_ranges: total number of band ranges in this struct33 * @band_list: array of Wifi band ranges34 */35struct wbrf_ranges_in_out {36	u64			num_of_ranges;37	struct freq_band_range	band_list[MAX_NUM_OF_WBRF_RANGES];38};39 40/**41 * enum wbrf_notifier_actions - wbrf notifier actions index42 * @WBRF_CHANGED: there was some frequency band updates. The consumers43 *               should retrieve the latest active frequency bands.44 */45enum wbrf_notifier_actions {46	WBRF_CHANGED,47};48 49#if IS_ENABLED(CONFIG_AMD_WBRF)50bool acpi_amd_wbrf_supported_producer(struct device *dev);51int acpi_amd_wbrf_add_remove(struct device *dev, uint8_t action, struct wbrf_ranges_in_out *in);52bool acpi_amd_wbrf_supported_consumer(struct device *dev);53int amd_wbrf_retrieve_freq_band(struct device *dev, struct wbrf_ranges_in_out *out);54int amd_wbrf_register_notifier(struct notifier_block *nb);55int amd_wbrf_unregister_notifier(struct notifier_block *nb);56#else57static inline58bool acpi_amd_wbrf_supported_consumer(struct device *dev)59{60	return false;61}62 63static inline64int acpi_amd_wbrf_add_remove(struct device *dev, uint8_t action, struct wbrf_ranges_in_out *in)65{66	return -ENODEV;67}68 69static inline70bool acpi_amd_wbrf_supported_producer(struct device *dev)71{72	return false;73}74static inline75int amd_wbrf_retrieve_freq_band(struct device *dev, struct wbrf_ranges_in_out *out)76{77	return -ENODEV;78}79static inline80int amd_wbrf_register_notifier(struct notifier_block *nb)81{82	return -ENODEV;83}84static inline85int amd_wbrf_unregister_notifier(struct notifier_block *nb)86{87	return -ENODEV;88}89#endif /* CONFIG_AMD_WBRF */90 91#endif /* _ACPI_AMD_WBRF_H */92