drivers/net/wireless/marvell/mwifiex/join.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/join.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/join.c- Extension
.c- Size
- 50550 bytes
- Lines
- 1602
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.h11ac.h
Detected Declarations
function mwifiex_cmd_append_generic_iefunction mwifiex_cmd_append_tsf_tlvfunction mwifiex_get_common_ratesfunction mwifiex_setup_rates_from_bssdescfunction mwifiex_cmd_append_wps_iefunction mwifiex_cmd_append_wapi_iefunction mwifiex_append_rsn_ie_wpa_wpa2function mwifiex_cmd_802_11_associatefunction receivedfunction mwifiex_cmd_802_11_ad_hoc_startfunction mwifiex_cmd_802_11_ad_hoc_joinfunction mwifiex_ret_802_11_ad_hocfunction mwifiex_associatefunction mwifiex_adhoc_startfunction mwifiex_adhoc_joinfunction cfg80211_ssid_eqfunction mwifiex_deauthenticate_infrafunction mwifiex_deauthenticatefunction mwifiex_deauthenticate_allfunction mwifiex_band_to_radio_typeexport mwifiex_deauthenticate_all
Annotated Snippet
if ((rate2[i] & 0x7F) == (tmp[j] & 0x7F)) {
*rate1++ = tmp[j];
break;
}
}
}
mwifiex_dbg(priv->adapter, INFO, "info: Tx data rate set to %#x\n",
priv->data_rate);
if (!priv->is_data_rate_auto) {
while (*ptr) {
if ((*ptr & 0x7f) == priv->data_rate) {
ret = 0;
goto done;
}
ptr++;
}
mwifiex_dbg(priv->adapter, ERROR,
"previously set fixed data rate %#x\t"
"is not compatible with the network\n",
priv->data_rate);
ret = -1;
goto done;
}
ret = 0;
done:
kfree(tmp);
return ret;
}
/*
* This function creates the intersection of the rates supported by a
* target BSS and our adapter settings for use in an assoc/join command.
*/
static int
mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc,
u8 *out_rates, u32 *out_rates_size)
{
u8 card_rates[MWIFIEX_SUPPORTED_RATES];
u32 card_rates_size;
/* Copy AP supported rates */
memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES);
/* Get the STA supported rates */
card_rates_size = mwifiex_get_active_data_rates(priv, card_rates);
/* Get the common rates between AP and STA supported rates */
if (mwifiex_get_common_rates(priv, out_rates, MWIFIEX_SUPPORTED_RATES,
card_rates, card_rates_size)) {
*out_rates_size = 0;
mwifiex_dbg(priv->adapter, ERROR,
"%s: cannot get common rates\n",
__func__);
return -1;
}
*out_rates_size =
min_t(size_t, strlen(out_rates), MWIFIEX_SUPPORTED_RATES);
return 0;
}
/*
* This function appends a WPS IE. It is called from the network join command
* preparation routine.
*
* If the IE buffer has been setup by the application, this routine appends
* the buffer as a WPS TLV type to the request.
*/
static int
mwifiex_cmd_append_wps_ie(struct mwifiex_private *priv, u8 **buffer)
{
int retLen = 0;
struct mwifiex_ie_types_header ie_header;
if (!buffer || !*buffer)
return 0;
/*
* If there is a wps ie buffer setup, append it to the return
* parameter buffer pointer.
*/
if (priv->wps_ie_len) {
mwifiex_dbg(priv->adapter, CMD,
"cmd: append wps ie %d to %p\n",
priv->wps_ie_len, *buffer);
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`, `11ac.h`.
- Detected declarations: `function mwifiex_cmd_append_generic_ie`, `function mwifiex_cmd_append_tsf_tlv`, `function mwifiex_get_common_rates`, `function mwifiex_setup_rates_from_bssdesc`, `function mwifiex_cmd_append_wps_ie`, `function mwifiex_cmd_append_wapi_ie`, `function mwifiex_append_rsn_ie_wpa_wpa2`, `function mwifiex_cmd_802_11_associate`, `function received`, `function mwifiex_cmd_802_11_ad_hoc_start`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.