drivers/net/wireless/silabs/wfx/hif_tx_mib.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/silabs/wfx/hif_tx_mib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/silabs/wfx/hif_tx_mib.c- Extension
.c- Size
- 8953 bytes
- Lines
- 308
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hwfx.hhif_tx.hhif_tx_mib.hhif_api_mib.h
Detected Declarations
function Copyrightfunction wfx_hif_set_beacon_wakeup_periodfunction wfx_hif_set_rcpi_rssi_thresholdfunction wfx_hif_get_counters_tablefunction wfx_hif_set_macaddrfunction wfx_hif_set_rx_filterfunction wfx_hif_set_beacon_filter_tablefunction wfx_hif_beacon_filter_controlfunction wfx_hif_set_operational_modefunction wfx_hif_set_template_framefunction wfx_hif_set_mfpfunction wfx_hif_set_block_ack_policyfunction wfx_hif_set_association_modefunction wfx_hif_set_tx_rate_retry_policyfunction wfx_hif_keep_alive_periodfunction wfx_hif_set_arp_ipv4_filterfunction wfx_hif_use_multi_tx_conffunction wfx_hif_set_uapsd_infofunction wfx_hif_erp_use_protectionfunction wfx_hif_slot_timefunction wfx_hif_wep_default_key_idfunction wfx_hif_rts_threshold
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Implementation of the host-to-chip MIBs of the hardware API.
*
* Copyright (c) 2017-2020, Silicon Laboratories, Inc.
* Copyright (c) 2010, ST-Ericsson
* Copyright (C) 2010, ST-Ericsson SA
*/
#include <linux/etherdevice.h>
#include "wfx.h"
#include "hif_tx.h"
#include "hif_tx_mib.h"
#include "hif_api_mib.h"
int wfx_hif_set_output_power(struct wfx_vif *wvif, int val)
{
struct wfx_hif_mib_current_tx_power_level arg = {
.power_level = cpu_to_le32(val * 10),
};
return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
&arg, sizeof(arg));
}
int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
unsigned int dtim_interval, unsigned int listen_interval)
{
struct wfx_hif_mib_beacon_wake_up_period arg = {
.wakeup_period_min = dtim_interval,
.receive_dtim = 0,
.wakeup_period_max = listen_interval,
};
if (dtim_interval > 0xFF || listen_interval > 0xFFFF)
return -EINVAL;
return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BEACON_WAKEUP_PERIOD,
&arg, sizeof(arg));
}
int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, int rssi_thold, int rssi_hyst)
{
struct wfx_hif_mib_rcpi_rssi_threshold arg = {
.rolling_average_count = 8,
.detection = 1,
};
if (!rssi_thold && !rssi_hyst) {
arg.upperthresh = 1;
arg.lowerthresh = 1;
} else {
arg.upper_threshold = rssi_thold + rssi_hyst;
arg.upper_threshold = (arg.upper_threshold + 110) * 2;
arg.lower_threshold = rssi_thold;
arg.lower_threshold = (arg.lower_threshold + 110) * 2;
}
return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RCPI_RSSI_THRESHOLD,
&arg, sizeof(arg));
}
int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
struct wfx_hif_mib_extended_count_table *arg)
{
if (wfx_api_older_than(wdev, 1, 3)) {
/* extended_count_table is wider than count_table */
memset(arg, 0xFF, sizeof(*arg));
return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
arg, sizeof(struct wfx_hif_mib_count_table));
} else {
return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_EXTENDED_COUNTERS_TABLE,
arg, sizeof(struct wfx_hif_mib_extended_count_table));
}
}
int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
{
struct wfx_hif_mib_mac_address arg = { };
if (mac)
ether_addr_copy(arg.mac_addr, mac);
return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_MAC_ADDRESS,
&arg, sizeof(arg));
}
int wfx_hif_set_rx_filter(struct wfx_vif *wvif, bool filter_bssid, bool filter_prbreq)
{
struct wfx_hif_mib_rx_filter arg = { };
Annotation
- Immediate include surface: `linux/etherdevice.h`, `wfx.h`, `hif_tx.h`, `hif_tx_mib.h`, `hif_api_mib.h`.
- Detected declarations: `function Copyright`, `function wfx_hif_set_beacon_wakeup_period`, `function wfx_hif_set_rcpi_rssi_threshold`, `function wfx_hif_get_counters_table`, `function wfx_hif_set_macaddr`, `function wfx_hif_set_rx_filter`, `function wfx_hif_set_beacon_filter_table`, `function wfx_hif_beacon_filter_control`, `function wfx_hif_set_operational_mode`, `function wfx_hif_set_template_frame`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.