HardenedBSD/sys/net80211
Adrian Chadd 545c886250 Fix some corner cases in the ieee80211_send_bar() handling.
* If the first call succeeded but failed to transmit, a timer would
  reschedule it via bar_timeout().  Unfortunately bar_timeout() didn't
  check the return value from the ieee80211_send_bar() reattempt and
  if that failed (eg the driver ic_raw_xmit() failed), it would never
  re-arm the timer.

* If BARPEND is cleared (which ieee80211_send_bar() will do if it can't
  TX), then re-arming the timer isn't enough - once bar_timeout() occurs,
  it'll see BARPEND is 0 and not run through the rest of the routine.
  So when rearming the timer, also set that flag.

* If the TX wasn't occuring, bar_tx_complete() wouldn't be called and the
  driver callback wouldn't be called either.  So the driver had no idea
  that the BAR TX attempt had failed.  In the ath(4) case, TX would stay
  paused.

  (There's no callback to indicate that BAR TX had failed or not;
  only a "BAR TX was attempted".  That's a separate, later problem.)

  So call the driver callback (ic_bar_response()) before the ADDBA session
  is torn down, so it has a chance of being notified that things didn't
  quite go to plan.

I've verified that yes, this does suspend traffic for ath(4), retry BAR
TX even if the driver is failing ic_raw_xmit(), and then eventually giving
up and sending a DELBA.  I'll address the "out of ath_buf" issue in ath(4)
in a subsequent commit - this commit just fixes the edge case where any
driver is (way) out of internal buffers/descriptors and fails frame TX.

PR:		kern/168170
Reviewed by:	bschmidt
MFC after:	1 month
2012-05-22 19:37:12 +00:00
..
_ieee80211.h
ieee80211_acl.c
ieee80211_action.c
ieee80211_action.h
ieee80211_adhoc.c
ieee80211_adhoc.h
ieee80211_ageq.c
ieee80211_ageq.h
ieee80211_alq.c
ieee80211_alq.h
ieee80211_amrr.c
ieee80211_amrr.h
ieee80211_crypto_ccmp.c
ieee80211_crypto_none.c
ieee80211_crypto_tkip.c
ieee80211_crypto_wep.c
ieee80211_crypto.c
ieee80211_crypto.h
ieee80211_ddb.c
ieee80211_dfs.c
ieee80211_dfs.h
ieee80211_freebsd.c
ieee80211_freebsd.h
ieee80211_hostap.c
ieee80211_hostap.h
ieee80211_ht.c
ieee80211_ht.h
ieee80211_hwmp.c
ieee80211_input.c
ieee80211_input.h
ieee80211_ioctl.c
ieee80211_ioctl.h
ieee80211_mesh.c
ieee80211_mesh.h
ieee80211_monitor.c
ieee80211_monitor.h
ieee80211_node.c
ieee80211_node.h
ieee80211_output.c
ieee80211_phy.c
ieee80211_phy.h
ieee80211_power.c
ieee80211_power.h
ieee80211_proto.c
ieee80211_proto.h
ieee80211_radiotap.c
ieee80211_radiotap.h
ieee80211_ratectl_none.c
ieee80211_ratectl.c
ieee80211_ratectl.h
ieee80211_regdomain.c
ieee80211_regdomain.h
ieee80211_rssadapt.c
ieee80211_rssadapt.h
ieee80211_scan_sta.c
ieee80211_scan.c
ieee80211_scan.h
ieee80211_sta.c
ieee80211_sta.h
ieee80211_superg.c
ieee80211_superg.h
ieee80211_tdma.c
ieee80211_tdma.h
ieee80211_var.h
ieee80211_wds.c
ieee80211_wds.h
ieee80211_xauth.c
ieee80211.c
ieee80211.h