drivers/net/wireless/ath/ath11k/thermal.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/thermal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/thermal.c- Extension
.c- Size
- 5702 bytes
- Lines
- 231
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/sysfs.hlinux/thermal.hlinux/hwmon.hlinux/hwmon-sysfs.hcore.hdebug.h
Detected Declarations
function Copyrightfunction ath11k_thermal_get_cur_throttle_statefunction ath11k_thermal_set_cur_throttle_statefunction ath11k_thermal_show_tempfunction ath11k_thermal_event_temperaturefunction ath11k_thermal_set_throttlingfunction ath11k_thermal_registerfunction ath11k_thermal_unregister
Annotated Snippet
if (IS_ERR(cdev)) {
ath11k_err(ab, "failed to setup thermal device result: %ld\n",
PTR_ERR(cdev));
ret = -EINVAL;
goto err_thermal_destroy;
}
ar->thermal.cdev = cdev;
ret = sysfs_create_link(&ar->hw->wiphy->dev.kobj, &cdev->device.kobj,
"cooling_device");
if (ret) {
ath11k_err(ab, "failed to create cooling device symlink\n");
goto err_thermal_destroy;
}
if (!IS_REACHABLE(CONFIG_HWMON))
return 0;
hwmon_dev = devm_hwmon_device_register_with_groups(&ar->hw->wiphy->dev,
"ath11k_hwmon", ar,
ath11k_hwmon_groups);
if (IS_ERR(hwmon_dev)) {
ath11k_err(ar->ab, "failed to register hwmon device: %ld\n",
PTR_ERR(hwmon_dev));
ret = -EINVAL;
goto err_thermal_destroy;
}
}
return 0;
err_thermal_destroy:
ath11k_thermal_unregister(ab);
return ret;
}
void ath11k_thermal_unregister(struct ath11k_base *ab)
{
struct ath11k *ar;
struct ath11k_pdev *pdev;
int i;
for (i = 0; i < ab->num_radios; i++) {
pdev = &ab->pdevs[i];
ar = pdev->ar;
if (!ar)
continue;
sysfs_remove_link(&ar->hw->wiphy->dev.kobj, "cooling_device");
thermal_cooling_device_unregister(ar->thermal.cdev);
}
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/sysfs.h`, `linux/thermal.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `core.h`, `debug.h`.
- Detected declarations: `function Copyright`, `function ath11k_thermal_get_cur_throttle_state`, `function ath11k_thermal_set_cur_throttle_state`, `function ath11k_thermal_show_temp`, `function ath11k_thermal_event_temperature`, `function ath11k_thermal_set_throttling`, `function ath11k_thermal_register`, `function ath11k_thermal_unregister`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.