WBRF - Wifi Band RFI Mitigations

Due to electrical and mechanical constraints in certain platform designsthere may be likely interference of relatively high-powered harmonics ofthe GPU memory clocks with local radio module frequency bands used bycertain Wifi bands.

To mitigate possible RFI interference producers can advertise thefrequencies in use and consumers can use this information to avoid usingthese frequencies for sensitive features.

When a platform is known to have this issue with any contained devices,the platform designer will advertise the availability of this feature viaACPI devices with a device specific method (_DSM).* Producers with this _DSM will be able to advertise the frequencies in use.* Consumers with this _DSM will be able to register for notifications offrequencies in use.

Some general terms

Producer: such component who can produce high-powered radio frequencyConsumer: such component who can adjust its in-use frequency inresponse to the radio frequencies of other components to mitigate thepossible RFI.

To make the mechanism function, those producers should notify active useof their particular frequencies so that other consumers can make relativeinternal adjustments as necessary to avoid this resonance.

ACPI interface

Although initially used by for wifi + dGPU use cases, the ACPI interfacecan be scaled to any type of device that a platform designer discoverscan cause interference.

The GUID used for the _DSM is 7B7656CF-DC3D-4C1C-83E9-66E721DE3070.

3 functions are available in this _DSM:

  • 0: discover # of functions available

  • 1: record RF bands in use

  • 2: retrieve RF bands in use

Driver programming interface

intacpi_amd_wbrf_add_remove(structdevice*dev,uint8_taction,structwbrf_ranges_in_out*in)

add or remove the frequency band the device is using

Parameters

structdevice*dev

device pointer

uint8_taction

remove or add the frequency band into bios

structwbrf_ranges_in_out*in

input structure containing the frequency band the device is using

Description

Broadcast to other consumers the frequency band the device startsto use. Underneath the surface the information is cached into aninternal buffer first. Then a notification is sent to all thoseregistered consumers. So then they can retrieve that buffer toknow the latest active frequency bands. Consumers that haven’tyet been registered can retrieve the information from the cachewhen they register.

Return

0 for success add/remove wifi frequency band.Returns a negative error code for failure.

boolacpi_amd_wbrf_supported_producer(structdevice*dev)

determine if the WBRF can be enabled for the device as a producer

Parameters

structdevice*dev

device pointer

Description

Check if the platform equipped with necessary implementations tosupport WBRF for the device as a producer.

Return

true if WBRF is supported, otherwise returns false

boolacpi_amd_wbrf_supported_consumer(structdevice*dev)

determine if the WBRF can be enabled for the device as a consumer

Parameters

structdevice*dev

device pointer

Description

Determine if the platform equipped with necessary implementations tosupport WBRF for the device as a consumer.

Return

true if WBRF is supported, otherwise returns false.

intamd_wbrf_retrieve_freq_band(structdevice*dev,structwbrf_ranges_in_out*out)

retrieve current active frequency bands

Parameters

structdevice*dev

device pointer

structwbrf_ranges_in_out*out

output structure containing all the active frequency bands

Description

Retrieve the current active frequency bands which were broadcastedby other producers. The consumer who calls this API should takeproper actions if any of the frequency band may cause RFI with itsown frequency band used.

Return

0 for getting wifi freq band successfully.Returns a negative error code for failure.

intamd_wbrf_register_notifier(structnotifier_block*nb)

register for notifications of frequency band update

Parameters

structnotifier_block*nb

driver notifier block

Description

The consumer should register itself via this API so that it can getnotified on the frequency band updates from other producers.

Return

0 for registering a consumer driver successfully.Returns a negative error code for failure.

intamd_wbrf_unregister_notifier(structnotifier_block*nb)

unregister for notifications of frequency band update

Parameters

structnotifier_block*nb

driver notifier block

Description

The consumer should call this API when it is longer interested withthe frequency band updates from other producers. Usually, this shouldbe performed during driver cleanup.

Return

0 for unregistering a consumer driver.Returns a negative error code for failure.

Sample Usage

The expected flow for the producers:1. During probe, callacpi_amd_wbrf_supported_producer to check if WBRFcan be enabled for the device.2. On using some frequency band, callacpi_amd_wbrf_add_remove with ‘add’param to get other consumers properly notified.3. Or on stopping using some frequency band, callacpi_amd_wbrf_add_remove with ‘remove’ param to get other consumers notified.

The expected flow for the consumers:1. During probe, callacpi_amd_wbrf_supported_consumer to check if WBRFcan be enabled for the device.2. Callamd_wbrf_register_notifier to register for notificationof frequency band change(add or remove) from other producers.3. Call theamd_wbrf_retrieve_freq_band initially to retrievecurrent active frequency bands considering some producers may broadcastsuch information before the consumer is up.4. On receiving a notification for frequency band change, runamd_wbrf_retrieve_freq_band again to retrieve the latestactive frequency bands.5. During driver cleanup, callamd_wbrf_unregister_notifier tounregister the notifier.