drivers/net/wireless/ti/wl1251/acx.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl1251/acx.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ti/wl1251/acx.c
Extension
.c
Size
21739 bytes
Lines
1013
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
#include "acx.h"

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>

#include "wl1251.h"
#include "reg.h"
#include "cmd.h"
#include "ps.h"

int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod,
			   u8 mgt_rate, u8 mgt_mod)
{
	struct acx_fw_gen_frame_rates *rates;
	int ret;

	wl1251_debug(DEBUG_ACX, "acx frame rates");

	rates = kzalloc_obj(*rates);
	if (!rates)
		return -ENOMEM;

	rates->tx_ctrl_frame_rate = ctrl_rate;
	rates->tx_ctrl_frame_mod = ctrl_mod;
	rates->tx_mgt_frame_rate = mgt_rate;
	rates->tx_mgt_frame_mod = mgt_mod;

	ret = wl1251_cmd_configure(wl, ACX_FW_GEN_FRAME_RATES,
				   rates, sizeof(*rates));
	if (ret < 0) {
		wl1251_error("Failed to set FW rates and modulation");
		goto out;
	}

out:
	kfree(rates);
	return ret;
}


int wl1251_acx_station_id(struct wl1251 *wl)
{
	struct acx_dot11_station_id *mac;
	int ret, i;

	wl1251_debug(DEBUG_ACX, "acx dot11_station_id");

	mac = kzalloc_obj(*mac);
	if (!mac)
		return -ENOMEM;

	for (i = 0; i < ETH_ALEN; i++)
		mac->mac[i] = wl->mac_addr[ETH_ALEN - 1 - i];

	ret = wl1251_cmd_configure(wl, DOT11_STATION_ID, mac, sizeof(*mac));

	kfree(mac);
	return ret;
}

int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id)
{
	struct acx_dot11_default_key *default_key;
	int ret;

	wl1251_debug(DEBUG_ACX, "acx dot11_default_key (%d)", key_id);

	default_key = kzalloc_obj(*default_key);
	if (!default_key)
		return -ENOMEM;

	default_key->id = key_id;

	ret = wl1251_cmd_configure(wl, DOT11_DEFAULT_KEY,
				   default_key, sizeof(*default_key));
	if (ret < 0) {
		wl1251_error("Couldn't set default key");
		goto out;
	}

	wl->default_key = key_id;

out:
	kfree(default_key);
	return ret;
}

int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event,

Annotation

Implementation Notes