Fix injected frames drop

This commit is contained in:
Sergei Makarenkov 2017-02-10 12:54:15 +03:00 committed by astsam
parent 7b407130a0
commit 8167c6674b
2 changed files with 24 additions and 7 deletions

View File

@ -3831,6 +3831,21 @@ int rtw_ieee80211_radiotap_iterator_init(
struct ieee80211_radiotap_header *radiotap_header,
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)
{
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))
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);
while (!ret) {
ret = rtw_ieee80211_radiotap_iterator_next(&iterator);
@ -3957,10 +3977,6 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
// frame_ctl = le16_to_cpu(dot11_hdr->frame_control);
/* Check if the QoS bit is set */
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
rtw_udelay_os(500);
goto fail;
}
pattrib = &pmgntframe->attrib;
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;
dump_mgntframe(padapter, pmgntframe);
DBG_COUNTER(padapter->tx_logs.core_tx);
fail:
rtw_skb_free(skb);
return 0;
return NETDEV_TX_OK;
}
/*

View File

@ -81,7 +81,7 @@
#ifdef CONFIG_SINGLE_XMIT_BUF
#define NR_XMIT_EXTBUFF (1)
#else
#define NR_XMIT_EXTBUFF (32)
#define NR_XMIT_EXTBUFF (64)
#endif
#ifdef CONFIG_RTL8812A