Skip to content

Commit

Permalink
rtlwifi: rtl8192ee: Fix adhoc fail
Browse files Browse the repository at this point in the history
When the buffer descriptor index exceeds 2, then a TX HANG condition
will result.

Signed-off-by: Troy Tan <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Cc: Stable <[email protected]> [V3.18]
Signed-off-by: Kalle Valo <[email protected]>
Signed-off-by: Christian Lamparter <[email protected]>
  • Loading branch information
troy-tan authored and chunkeey committed May 22, 2015
1 parent 3209d91 commit c670eab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
6 changes: 1 addition & 5 deletions rtlwifi/rtl8192ee/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
struct sk_buff *skb = NULL;

u32 totalpacketlen;
bool rtstatus;
u8 u1rsvdpageloc[5] = { 0 };
bool b_dlok = false;

Expand Down Expand Up @@ -728,10 +727,7 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
memcpy((u8 *)skb_put(skb, totalpacketlen),
&reserved_page_packet, totalpacketlen);

rtstatus = rtl_cmd_send_packet(hw, skb);

if (rtstatus)
b_dlok = true;
b_dlok = true;

if (b_dlok) {
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD ,
Expand Down
26 changes: 0 additions & 26 deletions rtlwifi/rtl8192ee/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,6 @@ static void _rtl92ee_enable_bcn_sub_func(struct ieee80211_hw *hw)
_rtl92ee_set_bcn_ctrl_reg(hw, 0, BIT(1));
}

static void _rtl92ee_return_beacon_queue_skb(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE];
unsigned long flags;

spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
while (skb_queue_len(&ring->queue)) {
struct rtl_tx_buffer_desc *entry =
&ring->buffer_desc[ring->idx];
struct sk_buff *skb = __skb_dequeue(&ring->queue);

pci_unmap_single(rtlpci->pdev,
rtlpriv->cfg->ops->get_desc(
(u8 *)entry, true, HW_DESC_TXBUFF_ADDR),
skb->len, PCI_DMA_TODEVICE);
kfree_skb(skb);
ring->idx = (ring->idx + 1) % ring->entries;
}
spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
}

static void _rtl92ee_disable_bcn_sub_func(struct ieee80211_hw *hw)
{
_rtl92ee_set_bcn_ctrl_reg(hw, BIT(1), 0);
Expand Down Expand Up @@ -403,9 +380,6 @@ static void _rtl92ee_download_rsvd_page(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_DWBCN0_CTRL + 2,
bcnvalid_reg | BIT(0));

/* Return Beacon TCB */
_rtl92ee_return_beacon_queue_skb(hw);

/* download rsvd page */
rtl92ee_set_fw_rsvdpagepkt(hw, false);

Expand Down

0 comments on commit c670eab

Please sign in to comment.