update for 2.6.38
cover update for 2.6.38
We add advance power management support for newer devices
We also consider BT coex and shadow register as part of power management
Wey-Yi Guy (5):
iwlagn: name change for BT config flag
iwlwifi: add more power management flags
iwlwifi: consider BT for power management
iwlwifi: power management checking for shadow register
iwlwifi: advance power management support
these patches are also available from wireless-next-2.6 branch on
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git
drivers/net/wireless/iwlwifi/iwl-6000.c | 9 +++ drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 4 + drivers/net/wireless/iwlwifi/iwl-commands.h | 12 +++- drivers/net/wireless/iwlwifi/iwl-core.h | 4 + drivers/net/wireless/iwlwifi/iwl-power.c | 95 +++++++++++++++++++++++++-- 5 files changed, 117 insertions(+), 7 deletions(-)
PATCH 1/5 iwlagn: name change for BT config flag
Bit 7 of BT config flag is used to enable/disable PSPoll sync. Make the name to match it.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +3 -2
@@ -2439,8 +2439,9 @@ struct iwl_bt_cmd {#define IWLAGN_BT_FLAG_COEX_MODE_3W 2#define IWLAGN_BT_FLAG_COEX_MODE_4W 3 -#define IWLAGN_BT_FLAG_UCODE_DEFAULT BIT(6) -#define IWLAGN_BT_FLAG_NOCOEX_NOTIF BIT(7) +#define IWLAGN_BT_FLAG_UCODE_DEFAULT BIT(6) +/* Disable Sync PSPoll on SCO/eSCO */ +#define IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE BIT(7)#define IWLAGN_BT_PRIO_BOOST_MAX 0xFF#define IWLAGN_BT_PRIO_BOOST_MIN 0x00
Signature · 1 line
1.7.0.4
PATCH 2/5 iwlwifi: add more power management flags
In reply to Wey-Yi GuyAdding additional power management option available for the device.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +5 -0
@@ -2671,6 +2671,11 @@ struct iwl_spectrum_notification {#define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2))#define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3))#define IWL_POWER_FAST_PD cpu_to_le16(BIT(4)) +#define IWL_POWER_BEACON_FILTERING cpu_to_le16(BIT(5)) +#define IWL_POWER_SHADOW_REG_ENA cpu_to_le16(BIT(6)) +#define IWL_POWER_CT_KILL_SET cpu_to_le16(BIT(7)) +#define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8)) +#define IWL_POWER_ADVANCE_PM_ENA cpu_to_le16(BIT(9))struct iwl3945_powertable_cmd {__le16 flags;
Signature · 1 line
1.7.0.4
PATCH 3/5 iwlwifi: consider BT for power management
In reply to Wey-Yi GuyCheck the BT PSPoll flag when fill PM command to uCode
--- drivers/net/wireless/iwlwifi/iwl-6000.c | 1 + drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 4 ++++ drivers/net/wireless/iwlwifi/iwl-core.h | 2 ++ drivers/net/wireless/iwlwifi/iwl-power.c | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-6000.c +1 -0
@@ -549,6 +549,7 @@ static struct iwl_bt_params iwl6000_bt_params = { .agg_time_limit = BT_AGG_THRESHOLD_DEF, .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE, .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT, + .bt_sco_disable = true, };struct iwl_cfg iwl6000g2a_2agn_cfg = {
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +4 -0
@@ -1829,6 +1829,10 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) }else { bt_cmd.flags =IWLAGN_BT_FLAG_COEX_MODE_3W <<IWLAGN_BT_FLAG_COEX_MODE_SHIFT ; +if (priv->cfg->bt_params && + priv->cfg->bt_params->bt_sco_disable) + bt_cmd.flags |=IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE ; +if (priv->bt_ch_announce) bt_cmd.flags |=IWLAGN_BT_FLAG_CHANNEL_INHIBITION ;IWL_DEBUG_INFO (priv,"BT coex flag: 0X%x\n" , bt_cmd.flags);
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -334,6 +334,7 @@ struct iwl_base_params {* @agg_time_limit: maximum number of uSec in aggregation * @ampdu_factor: Maximum A-MPDU length factor * @ampdu_density: Minimum A-MPDU spacing +* @bt_sco_disable: uCode should not response to BT in SCO/ESCO mode */ struct iwl_bt_params {bool advanced_bt_coexist;
@@ -343,6 +344,7 @@ struct iwl_bt_params {u16 agg_time_limit;u8 ampdu_factor;u8 ampdu_density; +bool bt_sco_disable; };/* * @use_rts_for_aggregation: use rts/cts protection for HT traffic
drivers/net/wireless/iwlwifi/iwl-power.c +17 -0
@@ -163,6 +163,15 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,else cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK ; +if (priv->cfg->bt_params && + priv->cfg->bt_params->advanced_bt_coexist) { +if (!priv->cfg->bt_params->bt_sco_disable) + cmd->flags |=IWL_POWER_BT_SCO_ENA ; +else + cmd->flags &= ~IWL_POWER_BT_SCO_ENA ; + } + + slp_itrvl =le32_to_cpu (cmd->sleep_interval[IWL_POWER_VEC_SIZE -1 ]);if (slp_itrvl >IWL_CONN_MAX_LISTEN_INTERVAL ) cmd->sleep_interval[IWL_POWER_VEC_SIZE - 1] =
@@ -236,6 +245,14 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,if (priv->power_data.pci_pm) cmd->flags |=IWL_POWER_PCI_PM_MSK ; +if (priv->cfg->bt_params && + priv->cfg->bt_params->advanced_bt_coexist) { +if (!priv->cfg->bt_params->bt_sco_disable) + cmd->flags |=IWL_POWER_BT_SCO_ENA ; +else + cmd->flags &= ~IWL_POWER_BT_SCO_ENA ; + } + cmd->rx_data_timeout =cpu_to_le32 (1000 * dynps_ms); cmd->tx_data_timeout =cpu_to_le32 (1000 * dynps_ms);
Signature · 1 line
1.7.0.4
PATCH 4/5 iwlwifi: power management checking for shadow register
In reply to Wey-Yi GuyIf shadow register is enable, modify the power management command to inform uCode
--- drivers/net/wireless/iwlwifi/iwl-power.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-power.c +10 -0
@@ -163,6 +163,11 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,else cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK ; +if (priv->cfg->base_params->shadow_reg_enable) + cmd->flags |=IWL_POWER_SHADOW_REG_ENA ; +else + cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA ; +if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) {if (!priv->cfg->bt_params->bt_sco_disable)
@@ -245,6 +250,11 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,if (priv->power_data.pci_pm) cmd->flags |=IWL_POWER_PCI_PM_MSK ; +if (priv->cfg->base_params->shadow_reg_enable) + cmd->flags |=IWL_POWER_SHADOW_REG_ENA ; +else + cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA ; +if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) {if (!priv->cfg->bt_params->bt_sco_disable)
Signature · 1 line
1.7.0.4
PATCH 5/5 iwlwifi: advance power management support
In reply to Wey-Yi GuyFor 6000g2b and up, adding advance power management support for better power consumption
--- drivers/net/wireless/iwlwifi/iwl-6000.c | 8 +++ drivers/net/wireless/iwlwifi/iwl-commands.h | 4 +- drivers/net/wireless/iwlwifi/iwl-core.h | 2 + drivers/net/wireless/iwlwifi/iwl-power.c | 68 +++++++++++++++++++++++++-- 4 files changed, 76 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-6000.c +8 -0
@@ -621,6 +621,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -641,6 +642,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -662,6 +664,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -682,6 +685,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -703,6 +707,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -723,6 +728,7 @@ struct iwl_cfg iwl6000g2b_bg_cfg = { .need_dc_calib = true, .need_temp_offset_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -862,6 +868,7 @@ struct iwl_cfg iwl130_bgn_cfg = { .ht_params = &iwl6000_ht_params, .need_dc_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -881,6 +888,7 @@ struct iwl_cfg iwl130_bg_cfg = { .bt_params = &iwl6000_bt_params, .need_dc_calib = true, .led_mode = IWL_LED_RF_STATE, + .adv_pm = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
drivers/net/wireless/iwlwifi/iwl-commands.h +3 -1
@@ -2668,6 +2668,8 @@ struct iwl_spectrum_notification {#define IWL_POWER_VEC_SIZE 5#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(BIT(0)) +#define IWL_POWER_POWER_SAVE_ENA_MSK cpu_to_le16(BIT(0)) +#define IWL_POWER_POWER_MANAGEMENT_ENA_MSK cpu_to_le16(BIT(1))#define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2))#define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3))#define IWL_POWER_FAST_PD cpu_to_le16(BIT(4))
@@ -2675,7 +2677,7 @@ struct iwl_spectrum_notification {#define IWL_POWER_SHADOW_REG_ENA cpu_to_le16(BIT(6))#define IWL_POWER_CT_KILL_SET cpu_to_le16(BIT(7))#define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8)) -#define IWL_POWER_ADVANCE_PM_ENA cpu_to_le16(BIT(9)) +#define IWL_POWER_ADVANCE_PM_ENA_MSK cpu_to_le16(BIT(9))struct iwl3945_powertable_cmd {__le16 flags;
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -366,6 +366,7 @@ struct iwl_ht_params {* @need_temp_offset_calib: need to perform temperature offset calibration * @scan_antennas: available antenna for scan operation * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off) +* @adv_pm: advance power management * * We enable the driver to be backward compatible wrt API version. The * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -413,6 +414,7 @@ struct iwl_cfg {u8 scan_rx_antennas[IEEE80211_NUM_BANDS ];u8 scan_tx_antennas[IEEE80211_NUM_BANDS ];enum iwl_led_mode led_mode; +const bool adv_pm; };/***************************
drivers/net/wireless/iwlwifi/iwl-power.c +63 -5
86 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Quoted 10 lines · Wey-Yi Guy
We add advance power management support for newer devices
We also consider BT coex and shadow register as part of power managementWey-Yi Guy (5):
iwlagn: name change for BT config flag
iwlwifi: add more power management flags
iwlwifi: consider BT for power management
iwlwifi: power management checking for shadow register
iwlwifi: advance power management support
Quoted 2 lines
these patches are also available from wireless-next-2.6 branch on
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git
Since I had to rebase wireless-next-2.6, this pull wasn't good. I applied the patches manually.
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Quoted 11 lines · John W. Linville
Quoted 10 lines · Wey-Yi Guy
We add advance power management support for newer devices
We also consider BT coex and shadow register as part of power managementWey-Yi Guy (5):
iwlagn: name change for BT config flag
iwlwifi: add more power management flags
iwlwifi: consider BT for power management
iwlwifi: power management checking for shadow register
iwlwifi: advance power management support
Quoted 6 lines
Quoted 2 lines
these patches are also available from wireless-next-2.6 branch on
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.gitSince I had to rebase wireless-next-2.6, this pull wasn't good. I applied the patches manually.
Thank you very much
Wey