From: Sepherosa Ziehau Date: Thu, 23 Nov 2006 13:43:05 +0000 (+0000) Subject: If power save mode changes, call ieee80211com.ic_reset instead of forcefully X-Git-Tag: v2.0.1~4072 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/45abbce2e3ff745a630324df1ddf491962d36990 If power save mode changes, call ieee80211com.ic_reset instead of forcefully changing (by returning ENETRESET) 802.11 state machine, so that driver has the chance to intercept this change and possibly avoid changing 802.11 state machine. Obtained-from: FreeBSD (sam@freebsd.org) --- diff --git a/sys/netproto/802_11/wlan/ieee80211_ioctl.c b/sys/netproto/802_11/wlan/ieee80211_ioctl.c index cb9dde5b8b..a5887499d0 100644 --- a/sys/netproto/802_11/wlan/ieee80211_ioctl.c +++ b/sys/netproto/802_11/wlan/ieee80211_ioctl.c @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.25.2.12 2006/04/03 17:21:05 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_ioctl.c,v 1.5 2006/11/23 12:57:56 sephe Exp $ + * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_ioctl.c,v 1.6 2006/11/23 13:43:05 sephe Exp $ */ /* @@ -2190,6 +2190,13 @@ ieee80211_ioctl_set80211(struct ieee80211com *ic, u_long cmd, struct ieee80211re error = EINVAL; break; } + if (error == ENETRESET) { + /* + * Switching in+out of power save mode + * should not require a state change. + */ + error = IS_UP(ic) ? ic->ic_reset(ic->ic_ifp) : 0; + } break; case IEEE80211_IOC_POWERSAVESLEEP: if (ireq->i_val < 0)