mirror of
https://github.com/chinawrj/rtl8812au
synced 2024-11-30 17:02:28 +00:00
Fix injected frames drop
This commit is contained in:
parent
7b407130a0
commit
8167c6674b
@ -3831,6 +3831,21 @@ int rtw_ieee80211_radiotap_iterator_init(
|
|||||||
struct ieee80211_radiotap_header *radiotap_header,
|
struct ieee80211_radiotap_header *radiotap_header,
|
||||||
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
|
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
|
||||||
|
|
||||||
|
static struct xmit_frame* monitor_alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) {
|
||||||
|
int tries;
|
||||||
|
int delay = 300;
|
||||||
|
struct xmit_frame *pmgntframe = NULL;
|
||||||
|
|
||||||
|
for(tries = 3; tries >= 0; tries--) {
|
||||||
|
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||||
|
if(pmgntframe != NULL)
|
||||||
|
return pmgntframe;
|
||||||
|
rtw_udelay_os(delay);
|
||||||
|
delay += delay/2;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -3876,6 +3891,11 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
|||||||
if (unlikely(skb->len < rtap_len))
|
if (unlikely(skb->len < rtap_len))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if ((pmgntframe = monitor_alloc_mgtxmitframe(pxmitpriv)) == NULL) {
|
||||||
|
DBG_COUNTER(padapter->tx_logs.core_tx_err_pxmitframe);
|
||||||
|
return NETDEV_TX_BUSY;
|
||||||
|
}
|
||||||
|
|
||||||
ret = rtw_ieee80211_radiotap_iterator_init(&iterator, rtap_hdr, skb->len, NULL);
|
ret = rtw_ieee80211_radiotap_iterator_init(&iterator, rtap_hdr, skb->len, NULL);
|
||||||
while (!ret) {
|
while (!ret) {
|
||||||
ret = rtw_ieee80211_radiotap_iterator_next(&iterator);
|
ret = rtw_ieee80211_radiotap_iterator_next(&iterator);
|
||||||
@ -3956,11 +3976,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
|||||||
// dot11_hdr = (struct ieee80211_hdr *)skb->data;
|
// dot11_hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
// frame_ctl = le16_to_cpu(dot11_hdr->frame_control);
|
// frame_ctl = le16_to_cpu(dot11_hdr->frame_control);
|
||||||
/* Check if the QoS bit is set */
|
/* Check if the QoS bit is set */
|
||||||
|
|
||||||
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
|
|
||||||
rtw_udelay_os(500);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
pattrib = &pmgntframe->attrib;
|
pattrib = &pmgntframe->attrib;
|
||||||
update_monitor_frame_attrib(padapter, pattrib);
|
update_monitor_frame_attrib(padapter, pattrib);
|
||||||
|
|
||||||
@ -3988,10 +4004,11 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
|||||||
|
|
||||||
pattrib->last_txcmdsz = pattrib->pktlen;
|
pattrib->last_txcmdsz = pattrib->pktlen;
|
||||||
dump_mgntframe(padapter, pmgntframe);
|
dump_mgntframe(padapter, pmgntframe);
|
||||||
|
DBG_COUNTER(padapter->tx_logs.core_tx);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
rtw_skb_free(skb);
|
rtw_skb_free(skb);
|
||||||
return 0;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
#ifdef CONFIG_SINGLE_XMIT_BUF
|
#ifdef CONFIG_SINGLE_XMIT_BUF
|
||||||
#define NR_XMIT_EXTBUFF (1)
|
#define NR_XMIT_EXTBUFF (1)
|
||||||
#else
|
#else
|
||||||
#define NR_XMIT_EXTBUFF (32)
|
#define NR_XMIT_EXTBUFF (64)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_RTL8812A
|
#ifdef CONFIG_RTL8812A
|
||||||
|
Loading…
Reference in New Issue
Block a user