All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: PATCH [1/1]: wireless: mac80211_hwsim: support/ignore power state changes
       [not found] <CAOGAQep2Yj62JDAY0qGwXFYohsje6fuu57Ss4U7+coygBe7u0A@mail.gmail.com>
@ 2018-04-05  8:35 ` Johannes Berg
  2018-04-05 15:48   ` Bjoern Johansson
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2018-04-05  8:35 UTC (permalink / raw)
  To: Roman Kiryanov, linux-wireless
  Cc: Greg Kroah-Hartman, Bjoern Johansson, Bo Hu


> indicate power state support. This in turn causes VTS failures because
> the WiFi HAL can't enable power saving mode. The remaining code is
> just there to deal with the incoming state change request.

What's VTS?

johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH [1/1]: wireless: mac80211_hwsim: support/ignore power state changes
  2018-04-05  8:35 ` PATCH [1/1]: wireless: mac80211_hwsim: support/ignore power state changes Johannes Berg
@ 2018-04-05 15:48   ` Bjoern Johansson
  0 siblings, 0 replies; 3+ messages in thread
From: Bjoern Johansson @ 2018-04-05 15:48 UTC (permalink / raw)
  To: johannes; +Cc: Roman Kiryanov, linux-wireless, gregkh, Bo Hu

On Thu, Apr 5, 2018 at 1:35 AM Johannes Berg <johannes@sipsolutions.net>
wrote:


> > indicate power state support. This in turn causes VTS failures because
> > the WiFi HAL can't enable power saving mode. The remaining code is
> > just there to deal with the incoming state change request.

> What's VTS?

> johannes

That message wasn't really intended as a commit message but an internal
clarification of why we needed this fix but I'll try to give an
explanation. VTS is the Android Vendor Test Suite (
https://source.android.com/compatibility/vts/). It's one of the test suites
required by Google to be able to put the Play Store on an Android device.
The tests verify that the device and APIs behave in the expected,
documented way (hopefully) without bugs or unexpected behavior. One of the
tests requires that WiFi can be placed in power saving mode to improve
battery life. Battery life is of course not really an issue for an emulator
but the tests cover other devices where this is important.

Regards,
Bjoern

^ permalink raw reply	[flat|nested] 3+ messages in thread

* PATCH [1/1]: wireless: mac80211_hwsim: support/ignore power state changes
@ 2018-04-05 17:15 Roman Kiryanov
  0 siblings, 0 replies; 3+ messages in thread
From: Roman Kiryanov @ 2018-04-05 17:15 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: Bjoern Johansson, Greg Kroah-Hartman, Bo Hu

From: Bjoern Johansson <bjoernj@google.com>

Indicate support for power state changes and handle them by calling an
empty function.
The important part is "ieee80211_hw_set(hw, SUPPORTS_PS);" at the
bottom of the diff. Without this upper layers in the kernel will return an
error code when trying to set the power state because the driver doesn't
indicate power state support. This in turn causes VTS
(Android Vendor Test Suite) failures because the WiFi HAL can't enable
power saving mode. The remaining code is just there to deal with the
incoming state change request.

Signed-off-by: Bjoern Johansson <bjoernj@google.com>
Signed-off-by: Lingfeng Yang <lfy@google.com>
Signed-off-by: Roman Kiryanov <rkir@google.com>
---
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1637,6 +1637,11 @@ static const char * const hwsim_chanwidths[] = {
         [NL80211_CHAN_WIDTH_160] = "vht160",
  };

+static void mac80211_power_state_changed(bool enabled)
+{
+       /* TODO: Do something when the power state changes */
+}
+
  static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
  {
         struct mac80211_hwsim_data *data = hw->priv;
@@ -1649,6 +1654,11 @@ static int mac80211_hwsim_config(struct ieee80211_hw
*hw, u32 changed)
         };
         int idx;

+       if (changed & IEEE80211_CONF_CHANGE_PS) {
+               bool enabled = (conf->flags & IEEE80211_CONF_PS) != 0;
+               mac80211_power_state_changed(enabled);
+       }
+
         if (conf->chandef.chan)
                 wiphy_dbg(hw->wiphy,
                           "%s (freq=%d(%d - %d)/%s idle=%d ps=%d
smps=%s)\n",
@@ -2650,7 +2660,9 @@ static int mac80211_hwsim_new_radio(struct genl_info
*info,
         ieee80211_hw_set(hw, AMPDU_AGGREGATION);
         ieee80211_hw_set(hw, MFP_CAPABLE);
         ieee80211_hw_set(hw, SIGNAL_DBM);
+       ieee80211_hw_set(hw, SUPPORTS_PS);
         ieee80211_hw_set(hw, TDLS_WIDER_BW);
+
         if (rctbl)
                 ieee80211_hw_set(hw, SUPPORTS_RC_TABLE);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-05 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAOGAQep2Yj62JDAY0qGwXFYohsje6fuu57Ss4U7+coygBe7u0A@mail.gmail.com>
2018-04-05  8:35 ` PATCH [1/1]: wireless: mac80211_hwsim: support/ignore power state changes Johannes Berg
2018-04-05 15:48   ` Bjoern Johansson
2018-04-05 17:15 Roman Kiryanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.