staging: vt6655: vnt_tx_packet fix dma_idx selection.
There is still a problem that dma_idx is causing packets to go onto the wrong tx path. Protect dma_idx fully with the present first lock and use pTDInfo->byFlags TD_FLAGS_NETIF_SKB to set MACvTransmit. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9eccca0843
commit
c312530589
1 changed files with 9 additions and 7 deletions
|
@ -1187,12 +1187,14 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
PSTxDesc head_td;
|
PSTxDesc head_td;
|
||||||
u32 dma_idx = TYPE_AC0DMA;
|
u32 dma_idx;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
|
||||||
if (!ieee80211_is_data(hdr->frame_control))
|
if (ieee80211_is_data(hdr->frame_control))
|
||||||
|
dma_idx = TYPE_AC0DMA;
|
||||||
|
else
|
||||||
dma_idx = TYPE_TXDMA0;
|
dma_idx = TYPE_TXDMA0;
|
||||||
|
|
||||||
if (AVAIL_TD(priv, dma_idx) < 1) {
|
if (AVAIL_TD(priv, dma_idx) < 1) {
|
||||||
|
@ -1206,6 +1208,9 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
|
||||||
|
|
||||||
head_td->pTDInfo->skb = skb;
|
head_td->pTDInfo->skb = skb;
|
||||||
|
|
||||||
|
if (dma_idx == TYPE_AC0DMA)
|
||||||
|
head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB;
|
||||||
|
|
||||||
priv->iTDUsed[dma_idx]++;
|
priv->iTDUsed[dma_idx]++;
|
||||||
|
|
||||||
/* Take ownership */
|
/* Take ownership */
|
||||||
|
@ -1234,13 +1239,10 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
|
||||||
|
|
||||||
head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->skb_dma);
|
head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->skb_dma);
|
||||||
|
|
||||||
if (dma_idx == TYPE_AC0DMA) {
|
if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB)
|
||||||
head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB;
|
|
||||||
|
|
||||||
MACvTransmitAC0(priv->PortOffset);
|
MACvTransmitAC0(priv->PortOffset);
|
||||||
} else {
|
else
|
||||||
MACvTransmit0(priv->PortOffset);
|
MACvTransmit0(priv->PortOffset);
|
||||||
}
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue