From owner-svn-src-all@FreeBSD.ORG Mon Jan 26 20:24:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53FD6106567D; Mon, 26 Jan 2009 20:24:05 +0000 (UTC) (envelope-from dwhite@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8408FC16; Mon, 26 Jan 2009 20:24:05 +0000 (UTC) (envelope-from dwhite@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0QKO4cW062020; Mon, 26 Jan 2009 20:24:05 GMT (envelope-from dwhite@svn.freebsd.org) Received: (from dwhite@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0QKO4vA062018; Mon, 26 Jan 2009 20:24:04 GMT (envelope-from dwhite@svn.freebsd.org) Message-Id: <200901262024.n0QKO4vA062018@svn.freebsd.org> From: Doug White Date: Mon, 26 Jan 2009 20:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187739 - stable/7/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2009 20:24:06 -0000 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; } }