rtlwifi: Assign rx buffer ownership to hardware last

Ownership of an rx buffer should only be given to the hardware
after all other changes are written, otherwise there's
a potential race.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Mike McCormack 2011-05-31 08:49:51 +09:00 committed by John W. Linville
parent 312d5479dc
commit febc9fe538
1 changed files with 3 additions and 2 deletions

View File

@ -784,8 +784,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
HW_DESC_RXBUFF_ADDR,
(u8 *)&bufferaddress);
rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
(u8 *)&tmp_one);
rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
HW_DESC_RXPKT_LEN,
(u8 *)&rtlpci->rxbuffersize);
@ -795,6 +793,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
HW_DESC_RXERO,
(u8 *)&tmp_one);
rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
(u8 *)&tmp_one);
index = (index + 1) % rtlpci->rxringcount;
}