int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
{
struct rsi_hw *adapter = common->priv;
- struct ieee80211_hdr *tmp_hdr;
+ struct ieee80211_hdr *wh = NULL;
struct ieee80211_tx_info *info;
+ struct ieee80211_vif *vif = NULL;
struct skb_info *tx_params;
struct ieee80211_bss_conf *bss;
struct rsi_data_desc *data_desc;
+ struct xtended_desc *xtend_desc;
int status;
u8 ieee80211_size = MIN_802_11_HDR_LEN;
- u8 extnd_size;
+ u8 header_size;
+ u8 vap_id = 0;
+ u8 dword_align_bytes;
u16 seq_num;
info = IEEE80211_SKB_CB(skb);
status = -EINVAL;
goto err;
}
-
- tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
- seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4);
-
- extnd_size = ((uintptr_t)skb->data & 0x3);
-
- if ((FRAME_DESC_SZ + extnd_size) > skb_headroom(skb)) {
+ header_size = FRAME_DESC_SZ + sizeof(struct xtended_desc);
+ if (header_size > skb_headroom(skb)) {
rsi_dbg(ERR_ZONE, "%s: Unable to send pkt\n", __func__);
status = -ENOSPC;
goto err;
}
+ skb_push(skb, header_size);
+ dword_align_bytes = ((unsigned long)skb->data & 0x3f);
+ if (header_size > skb_headroom(skb)) {
+ rsi_dbg(ERR_ZONE, "%s: Not enough headroom\n", __func__);
+ status = -ENOSPC;
+ goto err;
+ }
+ skb_push(skb, dword_align_bytes);
+ header_size += dword_align_bytes;
- skb_push(skb, (FRAME_DESC_SZ + extnd_size));
+ tx_params->internal_hdr_size = header_size;
data_desc = (struct rsi_data_desc *)skb->data;
- memset(data_desc, 0, sizeof(*data_desc));
+ memset(data_desc, 0, header_size);
+
+ xtend_desc = (struct xtended_desc *)&skb->data[FRAME_DESC_SZ];
+ wh = (struct ieee80211_hdr *)&skb->data[header_size];
+ seq_num = (le16_to_cpu(wh->seq_ctrl) >> 4);
+ vif = adapter->vifs[0];
- if (ieee80211_is_data_qos(tmp_hdr->frame_control)) {
+ data_desc->xtend_desc_size = header_size - FRAME_DESC_SZ;
+
+ if (ieee80211_is_data_qos(wh->frame_control)) {
ieee80211_size += 2;
data_desc->mac_flags |= cpu_to_le16(RSI_QOS_ENABLE);
}
rsi_set_len_qno(&data_desc->len_qno, (skb->len - FRAME_DESC_SZ),
RSI_WIFI_DATA_Q);
data_desc->header_len = ieee80211_size;
- data_desc->xtend_desc_size = extnd_size;
if (common->min_rate != RSI_RATE_AUTO) {
/* Send fixed rate */
data_desc->rate_info |=
cpu_to_le16(ENABLE_SHORTGI_RATE);
}
+
+ }
+
+ if (skb->protocol == cpu_to_be16(ETH_P_PAE)) {
+ 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;
}
data_desc->mac_flags = cpu_to_le16(seq_num & 0xfff);
((tx_params->tid & 0xf) << 4));
data_desc->sta_id = tx_params->sta_id;
- status = adapter->host_intf_ops->write_pkt(adapter, skb->data,
+ 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;
+ }
+
+ status = adapter->host_intf_ops->write_pkt(common->priv, skb->data,
skb->len);
if (status)
rsi_dbg(ERR_ZONE, "%s: Failed to write pkt\n",