Author: dwhite
Date: Mon Jan 26 20:24:04 2009
New Revision: 187739
URL: http://svn.freebsd.org/changeset/base/187739

Log:
  Fix hostap power-save station support by always initializing the TIM
  bitmaps. Prior to this change, hostap would queue packets for power-saved
  stations but not indicate in the beacon that the station should wake up
  and poll for those queued packets.
  
  Reviewed by:  sam

Modified:
  stable/7/sys/net80211/ieee80211_freebsd.h
  stable/7/sys/net80211/ieee80211_power.c

Modified: stable/7/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- stable/7/sys/net80211/ieee80211_freebsd.h   Mon Jan 26 18:46:37 2009        
(r187738)
+++ stable/7/sys/net80211/ieee80211_freebsd.h   Mon Jan 26 20:24:04 2009        
(r187739)
@@ -115,7 +115,7 @@ typedef struct mtx ieee80211_scan_lock_t
 #define        _IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _m, _qlen, _age) do {\
        (_m)->m_nextpkt = NULL;                                 \
        if ((_ni)->ni_savedq.ifq_tail != NULL) {                \
-               _age -= M_AGE_GET((_ni)->ni_savedq.ifq_tail);   \
+               _age -= M_AGE_GET((_ni)->ni_savedq.ifq_head);   \
                (_ni)->ni_savedq.ifq_tail->m_nextpkt = (_m);    \
        } else {                                                \
                (_ni)->ni_savedq.ifq_head = (_m);               \

Modified: stable/7/sys/net80211/ieee80211_power.c
==============================================================================
--- stable/7/sys/net80211/ieee80211_power.c     Mon Jan 26 18:46:37 2009        
(r187738)
+++ stable/7/sys/net80211/ieee80211_power.c     Mon Jan 26 20:24:04 2009        
(r187739)
@@ -48,29 +48,20 @@ static void ieee80211_set_tim(struct iee
 void
 ieee80211_power_attach(struct ieee80211com *ic)
 {
-       if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
-           ic->ic_opmode == IEEE80211_M_IBSS) {
-               /* NB: driver should override */
-               ic->ic_set_tim = ieee80211_set_tim;
-       }
+       /* NB: driver should override */
+       ic->ic_set_tim = ieee80211_set_tim;
 }
 
 void
 ieee80211_power_lateattach(struct ieee80211com *ic)
 {
-       /*
-        * Allocate these only if needed.  Beware that we
-        * know adhoc mode doesn't support ATIM yet...
-        */
-       if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
-               ic->ic_tim_len = howmany(ic->ic_max_aid,8) * sizeof(uint8_t);
-               MALLOC(ic->ic_tim_bitmap, uint8_t *, ic->ic_tim_len,
-                       M_DEVBUF, M_NOWAIT | M_ZERO);
-               if (ic->ic_tim_bitmap == NULL) {
-                       printf("%s: no memory for TIM bitmap!\n", __func__);
-                       /* XXX good enough to keep from crashing? */
-                       ic->ic_tim_len = 0;
-               }
+       ic->ic_tim_len = howmany(ic->ic_max_aid,8) * sizeof(uint8_t);
+       MALLOC(ic->ic_tim_bitmap, uint8_t *, ic->ic_tim_len,
+               M_DEVBUF, M_NOWAIT | M_ZERO);
+       if (ic->ic_tim_bitmap == NULL) {
+               printf("%s: no memory for TIM bitmap!\n", __func__);
+               /* XXX good enough to keep from crashing? */
+               ic->ic_tim_len = 0;
        }
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to