drivers/net/wireless/silabs/wfx/hif_rx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/silabs/wfx/hif_rx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/silabs/wfx/hif_rx.c- Extension
.c- Size
- 11976 bytes
- Lines
- 392
- 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/skbuff.hlinux/etherdevice.hhif_rx.hwfx.hscan.hbh.hsta.hdata_rx.hhif_api_cmd.h
Detected Declarations
function Copyrightfunction wfx_hif_tx_confirmfunction wfx_hif_multi_tx_confirmfunction wfx_hif_startup_indicationfunction wfx_hif_wakeup_indicationfunction wfx_hif_receive_indicationfunction wfx_hif_event_indicationfunction wfx_hif_pm_mode_complete_indicationfunction wfx_hif_scan_complete_indicationfunction wfx_hif_join_complete_indicationfunction wfx_hif_suspend_resume_indicationfunction wfx_hif_generic_indicationfunction wfx_hif_error_indicationfunction wfx_hif_exception_indicationfunction wfx_handle_rx
Annotated Snippet
if (!wvif) {
dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__);
return -EIO;
}
if (body->resume)
wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE);
else
wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP);
} else {
WARN(body->peer_sta_set, "misunderstood indication");
WARN(hif->interface != 2, "misunderstood indication");
if (body->resume)
wfx_suspend_hot_dev(wdev, STA_NOTIFY_AWAKE);
else
wfx_suspend_hot_dev(wdev, STA_NOTIFY_SLEEP);
}
return 0;
}
static int wfx_hif_generic_indication(struct wfx_dev *wdev,
const struct wfx_hif_msg *hif, const void *buf)
{
const struct wfx_hif_ind_generic *body = buf;
int type = le32_to_cpu(body->type);
switch (type) {
case HIF_GENERIC_INDICATION_TYPE_RAW:
return 0;
case HIF_GENERIC_INDICATION_TYPE_STRING:
dev_info(wdev->dev, "firmware says: %s\n", (char *)&body->data);
return 0;
case HIF_GENERIC_INDICATION_TYPE_RX_STATS:
mutex_lock(&wdev->rx_stats_lock);
/* Older firmware send a generic indication beside RxStats */
if (!wfx_api_older_than(wdev, 1, 4))
dev_info(wdev->dev, "Rx test ongoing. Temperature: %d degrees C\n",
body->data.rx_stats.current_temp);
memcpy(&wdev->rx_stats, &body->data.rx_stats, sizeof(wdev->rx_stats));
mutex_unlock(&wdev->rx_stats_lock);
return 0;
case HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO:
mutex_lock(&wdev->tx_power_loop_info_lock);
memcpy(&wdev->tx_power_loop_info, &body->data.tx_power_loop_info,
sizeof(wdev->tx_power_loop_info));
mutex_unlock(&wdev->tx_power_loop_info_lock);
return 0;
default:
dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", type);
return -EIO;
}
}
static const struct {
int val;
const char *str;
bool has_param;
} hif_errors[] = {
{ HIF_ERROR_FIRMWARE_ROLLBACK,
"rollback status" },
{ HIF_ERROR_FIRMWARE_DEBUG_ENABLED,
"debug feature enabled" },
{ HIF_ERROR_PDS_PAYLOAD,
"PDS version is not supported" },
{ HIF_ERROR_PDS_TESTFEATURE,
"PDS ask for an unknown test mode" },
{ HIF_ERROR_OOR_VOLTAGE,
"out-of-range power supply voltage", true },
{ HIF_ERROR_OOR_TEMPERATURE,
"out-of-range temperature", true },
{ HIF_ERROR_SLK_REQ_DURING_KEY_EXCHANGE,
"secure link does not expect request during key exchange" },
{ HIF_ERROR_SLK_SESSION_KEY,
"secure link session key is invalid" },
{ HIF_ERROR_SLK_OVERFLOW,
"secure link overflow" },
{ HIF_ERROR_SLK_WRONG_ENCRYPTION_STATE,
"secure link messages list does not match message encryption" },
{ HIF_ERROR_SLK_UNCONFIGURED,
"secure link not yet configured" },
{ HIF_ERROR_HIF_BUS_FREQUENCY_TOO_LOW,
"bus clock is too slow (<1kHz)" },
{ HIF_ERROR_HIF_RX_DATA_TOO_LARGE,
"HIF message too large" },
/* Following errors only exists in old firmware versions: */
{ HIF_ERROR_HIF_TX_QUEUE_FULL,
"HIF messages queue is full" },
{ HIF_ERROR_HIF_BUS,
"HIF bus" },
{ HIF_ERROR_SLK_MULTI_TX_UNSUPPORTED,
Annotation
- Immediate include surface: `linux/skbuff.h`, `linux/etherdevice.h`, `hif_rx.h`, `wfx.h`, `scan.h`, `bh.h`, `sta.h`, `data_rx.h`.
- Detected declarations: `function Copyright`, `function wfx_hif_tx_confirm`, `function wfx_hif_multi_tx_confirm`, `function wfx_hif_startup_indication`, `function wfx_hif_wakeup_indication`, `function wfx_hif_receive_indication`, `function wfx_hif_event_indication`, `function wfx_hif_pm_mode_complete_indication`, `function wfx_hif_scan_complete_indication`, `function wfx_hif_join_complete_indication`.
- 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.