drivers/net/wireless/rsi/rsi_91x_hal.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/rsi/rsi_91x_hal.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/rsi/rsi_91x_hal.c
Extension
.c
Size
32168 bytes
Lines
1169
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (common->vif_info[0].sgi && (fixed_rate & 0x100)) {
		       /* Only MCS rates */
			data_desc->rate_info |=
				cpu_to_le16(ENABLE_SHORTGI_RATE);
		}
	}

	if (tx_eapol) {
		rsi_dbg(INFO_ZONE, "*** Tx EAPOL ***\n");

		data_desc->frame_info = cpu_to_le16(RATE_INFO_ENABLE);
		if (common->band == NL80211_BAND_5GHZ)
			data_desc->rate_info = cpu_to_le16(RSI_RATE_6);
		else
			data_desc->rate_info = cpu_to_le16(RSI_RATE_1);
		data_desc->mac_flags |= cpu_to_le16(RSI_REKEY_PURPOSE);
		data_desc->misc_flags |= RSI_FETCH_RETRY_CNT_FRM_HST;
#define EAPOL_RETRY_CNT 15
		xtend_desc->retry_cnt = EAPOL_RETRY_CNT;

		if (common->eapol4_confirm)
			skb->priority = VO_Q;
		else
			rsi_set_len_qno(&data_desc->len_qno,
					(skb->len - FRAME_DESC_SZ),
					RSI_WIFI_MGMT_Q);
		if (((skb->len - header_size) == EAPOL4_PACKET_LEN) ||
		    ((skb->len - header_size) == EAPOL4_PACKET_LEN - 2)) {
			data_desc->misc_flags |=
				RSI_DESC_REQUIRE_CFM_TO_HOST;
			xtend_desc->confirm_frame_type = EAPOL4_CONFIRM;
		}
	}

	data_desc->mac_flags |= cpu_to_le16(seq_num & 0xfff);
	data_desc->qid_tid = ((skb->priority & 0xf) |
			      ((tx_params->tid & 0xf) << 4));
	data_desc->sta_id = tx_params->sta_id;

	if ((is_broadcast_ether_addr(wh->addr1)) ||
	    (is_multicast_ether_addr(wh->addr1))) {
		data_desc->frame_info = cpu_to_le16(RATE_INFO_ENABLE);
		data_desc->frame_info |= cpu_to_le16(RSI_BROADCAST_PKT);
		data_desc->sta_id = vap_id;

		if ((vif->type == NL80211_IFTYPE_AP) ||
		    (vif->type == NL80211_IFTYPE_P2P_GO)) {
			if (common->band == NL80211_BAND_5GHZ)
				data_desc->rate_info = cpu_to_le16(RSI_RATE_6);
			else
				data_desc->rate_info = cpu_to_le16(RSI_RATE_1);
		}
	}
	if (((vif->type == NL80211_IFTYPE_AP) ||
	     (vif->type == NL80211_IFTYPE_P2P_GO)) &&
	    (ieee80211_has_moredata(wh->frame_control)))
		data_desc->frame_info |= cpu_to_le16(MORE_DATA_PRESENT);

	data_desc->rate_info |=
		cpu_to_le16((tx_params->vap_id << RSI_DESC_VAP_ID_OFST) &
			    RSI_DESC_VAP_ID_MASK);

	return 0;
}

/* This function sends received data packet from driver to device */
int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
{
	struct rsi_hw *adapter = common->priv;
	struct ieee80211_vif *vif;
	struct ieee80211_tx_info *info;
	int status = -EINVAL;

	if (!skb)
		return 0;
	if (common->iface_down)
		goto err;

	info = IEEE80211_SKB_CB(skb);
	if (!info->control.vif)
		goto err;
	vif = info->control.vif;

	if (((vif->type == NL80211_IFTYPE_STATION) ||
	     (vif->type == NL80211_IFTYPE_P2P_CLIENT)) &&
	    (!vif->cfg.assoc))
		goto err;

	status = rsi_send_pkt_to_bus(common, skb);
	if (status)

Annotation

Implementation Notes