Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150001
b: refs/heads/master
c: 04fe203
h: refs/heads/master
i:
  149999: 2edf247
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 22, 2009
1 parent 576665a commit e9d9edf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e30bc55de98c000b0b836cb42525c82f605f191
refs/heads/master: 04fe20372e70685d9f15966216cdffd3795fe590
19 changes: 16 additions & 3 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ struct ieee80211_rx_status {
* Flags to define PHY configuration options
*
* @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
* @IEEE80211_CONF_PS: Enable 802.11 power save mode
* @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only)
*/
enum ieee80211_conf_flags {
IEEE80211_CONF_RADIOTAP = (1<<0),
Expand Down Expand Up @@ -553,14 +553,26 @@ enum ieee80211_conf_changed {
*
* This struct indicates how the driver shall configure the hardware.
*
* @flags: configuration flags defined above
*
* @radio_enabled: when zero, driver is required to switch off the radio.
* @beacon_int: beacon interval (TODO make interface config)
*
* @listen_interval: listen interval in units of beacon interval
* @flags: configuration flags defined above
* @max_sleep_interval: the maximum number of beacon intervals to sleep for
* before checking the beacon for a TIM bit (managed mode only); this
* value will be only achievable between DTIM frames, the hardware
* needs to check for the multicast traffic bit in DTIM beacons.
* This variable is valid only when the CONF_PS flag is set.
* @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
* powersave documentation below. This variable is valid only when
* the CONF_PS flag is set.
*
* @power_level: requested transmit power (in dBm)
* @dynamic_ps_timeout: dynamic powersave timeout (in ms)
*
* @channel: the channel to tune to
* @channel_type: the channel (HT) type
*
* @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
* (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
* but actually means the number of transmissions not the number of retries
Expand All @@ -572,6 +584,7 @@ struct ieee80211_conf {
int beacon_int;
u32 flags;
int power_level, dynamic_ps_timeout;
int max_sleep_interval;

u16 listen_interval;
bool radio_enabled;
Expand Down
20 changes: 16 additions & 4 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,19 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
beaconint_us = ieee80211_tu_to_usec(
found->vif.bss_conf.beacon_int);

if (beaconint_us > latency)
if (beaconint_us > latency) {
local->ps_sdata = NULL;
else
} else {
u8 dtimper = found->vif.bss_conf.dtim_period;
int maxslp = 1;

if (dtimper > 1)
maxslp = min_t(int, dtimper,
latency / beaconint_us);

local->hw.conf.max_sleep_interval = maxslp;
local->ps_sdata = found;
}
} else {
local->ps_sdata = NULL;
}
Expand Down Expand Up @@ -851,8 +860,11 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
ieee80211_bss_info_change_notify(sdata, bss_info_changed);

/* will be same as sdata */
if (local->ps_sdata)
ieee80211_enable_ps(local, sdata);
if (local->ps_sdata) {
mutex_lock(&local->iflist_mtx);
ieee80211_recalc_ps(local, -1);
mutex_unlock(&local->iflist_mtx);
}

netif_tx_start_all_queues(sdata->dev);
netif_carrier_on(sdata->dev);
Expand Down

0 comments on commit e9d9edf

Please sign in to comment.