* [PATCH 1/2] compat-wireless: make patches apply again
@ 2010-11-10 21:04 Hauke Mehrtens
2010-11-10 21:04 ` [PATCH 2/2] compat-wireless: Backport pci power management Hauke Mehrtens
0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2010-11-10 21:04 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/03-rfkill.patch | 27 +++++++++------------------
patches/08-rename-iwl4965-config.patch | 14 ++++++++++----
2 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/patches/03-rfkill.patch b/patches/03-rfkill.patch
index 0ac3758..673ebd0 100644
--- a/patches/03-rfkill.patch
+++ b/patches/03-rfkill.patch
@@ -92,7 +92,7 @@ This would do the policing from within mac80211.
static void rfkill_led_trigger_event(struct rfkill *rfkill)
{
struct led_trigger *trigger;
-@@ -318,7 +318,7 @@ static void rfkill_set_block(struct rfki
+@@ -304,7 +304,7 @@ static void rfkill_set_block(struct rfki
rfkill_event(rfkill);
}
@@ -101,7 +101,7 @@ This would do the policing from within mac80211.
static atomic_t rfkill_input_disabled = ATOMIC_INIT(0);
/**
-@@ -819,7 +819,7 @@ static int rfkill_resume(struct device *
+@@ -805,7 +805,7 @@ static int rfkill_resume(struct device *
}
static struct class rfkill_class = {
@@ -110,7 +110,7 @@ This would do the policing from within mac80211.
.dev_release = rfkill_release,
.dev_attrs = rfkill_dev_attrs,
.dev_uevent = rfkill_dev_uevent,
-@@ -965,7 +965,7 @@ int __must_check rfkill_register(struct
+@@ -951,7 +951,7 @@ int __must_check rfkill_register(struct
if (!rfkill->persistent || rfkill_epo_lock_active) {
schedule_work(&rfkill->sync_work);
} else {
@@ -119,7 +119,7 @@ This would do the policing from within mac80211.
bool soft_blocked = !!(rfkill->state & RFKILL_BLOCK_SW);
if (!atomic_read(&rfkill_input_disabled))
-@@ -1193,7 +1193,7 @@ static int rfkill_fop_release(struct ino
+@@ -1179,7 +1179,7 @@ static int rfkill_fop_release(struct ino
list_for_each_entry_safe(ev, tmp, &data->events, list)
kfree(ev);
@@ -128,7 +128,7 @@ This would do the policing from within mac80211.
if (data->input_handler)
if (atomic_dec_return(&rfkill_input_disabled) == 0)
printk(KERN_DEBUG "rfkill: input handler enabled\n");
-@@ -1204,7 +1204,7 @@ static int rfkill_fop_release(struct ino
+@@ -1190,7 +1190,7 @@ static int rfkill_fop_release(struct ino
return 0;
}
@@ -137,7 +137,7 @@ This would do the policing from within mac80211.
static long rfkill_fop_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
-@@ -1237,7 +1237,7 @@ static const struct file_operations rfki
+@@ -1223,7 +1223,7 @@ static const struct file_operations rfki
.write = rfkill_fop_write,
.poll = rfkill_fop_poll,
.release = rfkill_fop_release,
@@ -146,7 +146,7 @@ This would do the policing from within mac80211.
.unlocked_ioctl = rfkill_fop_ioctl,
.compat_ioctl = rfkill_fop_ioctl,
#endif
-@@ -1268,7 +1268,7 @@ static int __init rfkill_init(void)
+@@ -1254,7 +1254,7 @@ static int __init rfkill_init(void)
goto out;
}
@@ -155,7 +155,7 @@ This would do the policing from within mac80211.
error = rfkill_handler_init();
if (error) {
misc_deregister(&rfkill_miscdev);
-@@ -1284,7 +1284,7 @@ subsys_initcall(rfkill_init);
+@@ -1270,7 +1270,7 @@ subsys_initcall(rfkill_init);
static void __exit rfkill_exit(void)
{
@@ -183,15 +183,6 @@ This would do the policing from within mac80211.
/**
* rfkill_alloc - allocate rfkill structure
* @name: name of the struct -- the string is not copied internally
-@@ -355,7 +356,7 @@ static inline bool rfkill_blocked(struct
- #endif /* RFKILL || RFKILL_MODULE */
-
-
--#ifdef CONFIG_RFKILL_LEDS
-+#ifdef CONFIG_RFKILL_BACKPORT_LEDS
- /**
- * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED.
- * This function might return a NULL pointer if registering of the
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -11,7 +11,11 @@
@@ -208,7 +199,7 @@ This would do the policing from within mac80211.
#include <net/cfg80211.h>
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
-@@ -1872,7 +1872,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw
+@@ -1883,7 +1883,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw
pCap->hw_caps |= ATH9K_HW_CAP_ENHANCEDPM;
diff --git a/patches/08-rename-iwl4965-config.patch b/patches/08-rename-iwl4965-config.patch
index 46d8bf9..a2354e9 100644
--- a/patches/08-rename-iwl4965-config.patch
+++ b/patches/08-rename-iwl4965-config.patch
@@ -16,24 +16,30 @@ CONFIG_IWL4965 has to be set to y, to build correctly.
obj-$(CONFIG_P54_COMMON) += p54/
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
-@@ -1,4 +1,4 @@
+@@ -1,9 +1,9 @@
-obj-$(CONFIG_IWLWIFI) += iwlcore.o
+obj-$(CONFIG_COMPAT_IWLWIFI) += iwlcore.o
iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o
iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o
iwlcore-objs += iwl-scan.o iwl-led.o
-@@ -15,7 +15,7 @@ iwlagn-objs += iwl-agn-lib.o iwl-agn-rx
+ iwlcore-$(CONFIG_IWL3945) += iwl-legacy.o
+-iwlcore-$(CONFIG_IWL4965) += iwl-legacy.o
++iwlcore-$(CONFIG_COMPAT_IWL4965) += iwl-legacy.o
+ iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
+ iwlcore-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o
+
+@@ -17,7 +17,7 @@ iwlagn-objs += iwl-agn-lib.o iwl-agn-rx
iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o
iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o
-iwlagn-$(CONFIG_IWL4965) += iwl-4965.o
+iwlagn-$(CONFIG_COMPAT_IWL4965) += iwl-4965.o
+ iwlagn-$(CONFIG_IWL5000) += iwl-agn-rxon.o
iwlagn-$(CONFIG_IWL5000) += iwl-5000.o
iwlagn-$(CONFIG_IWL5000) += iwl-6000.o
- iwlagn-$(CONFIG_IWL5000) += iwl-1000.o
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
-@@ -4659,10 +4659,10 @@ static void __devexit iwl_pci_remove(str
+@@ -4357,10 +4357,10 @@ static void __devexit iwl_pci_remove(str
/* Hardware specific file defines the PCI IDs table for that hardware module */
static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] compat-wireless: Backport pci power management
2010-11-10 21:04 [PATCH 1/2] compat-wireless: make patches apply again Hauke Mehrtens
@ 2010-11-10 21:04 ` Hauke Mehrtens
2010-11-10 22:45 ` Luis R. Rodriguez
0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2010-11-10 21:04 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
The new PCI power management is now also used by iwl and ath9k.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/11-dev-pm-ops.patch | 162 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 160 insertions(+), 2 deletions(-)
diff --git a/patches/11-dev-pm-ops.patch b/patches/11-dev-pm-ops.patch
index 2a7cb3c..8931276 100644
--- a/patches/11-dev-pm-ops.patch
+++ b/patches/11-dev-pm-ops.patch
@@ -9,7 +9,7 @@ calls on compat code with only slight modifications.
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -3714,6 +3714,34 @@ static int ath5k_pci_resume(struct devic
+@@ -3732,6 +3732,34 @@ static int ath5k_pci_resume(struct devic
return 0;
}
@@ -44,7 +44,7 @@ calls on compat code with only slight modifications.
static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
#define ATH5K_PM_OPS (&ath5k_pm_ops)
#else
-@@ -3725,7 +3753,12 @@ static struct pci_driver ath5k_pci_drive
+@@ -3743,7 +3771,12 @@ static struct pci_driver ath5k_pci_drive
.id_table = ath5k_pci_id_table,
.probe = ath5k_pci_probe,
.remove = __devexit_p(ath5k_pci_remove),
@@ -57,3 +57,161 @@ calls on compat code with only slight modifications.
};
/*
+--- a/drivers/net/wireless/ath/ath9k/pci.c
++++ b/drivers/net/wireless/ath/ath9k/pci.c
+@@ -284,14 +284,36 @@ static int ath_pci_resume(struct device
+ return 0;
+ }
+
+-static const struct dev_pm_ops ath9k_pm_ops = {
+- .suspend = ath_pci_suspend,
+- .resume = ath_pci_resume,
+- .freeze = ath_pci_suspend,
+- .thaw = ath_pci_resume,
+- .poweroff = ath_pci_suspend,
+- .restore = ath_pci_resume,
+-};
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++static int ath_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state)
++{
++ int r;
++
++ r = ath_pci_suspend(&pdev->dev);
++ if (r)
++ return r;
++
++ pci_save_state(pdev);
++ pci_disable_device(pdev);
++ pci_set_power_state(pdev, PCI_D3hot);
++
++ return 0;
++}
++
++static int ath_pci_resume_compat(struct pci_dev *pdev)
++{
++ int r;
++
++ pci_restore_state(pdev);
++ r = pci_enable_device(pdev);
++ if (r)
++ return r;
++
++ return ath_pci_resume(&pdev->dev);
++}
++#endif
++
++static SIMPLE_DEV_PM_OPS(ath9k_pm_ops, ath_pci_suspend, ath_pci_resume);
+
+ #define ATH9K_PM_OPS (&ath9k_pm_ops)
+
+@@ -309,7 +331,12 @@ static struct pci_driver ath_pci_driver
+ .id_table = ath_pci_id_table,
+ .probe = ath_pci_probe,
+ .remove = ath_pci_remove,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ .driver.pm = ATH9K_PM_OPS,
++#elif defined(CONFIG_PM_SLEEP)
++ .suspend = ath_pci_suspend_compat,
++ .resume = ath_pci_resume_compat,
++#endif
+ };
+
+ int ath_pci_init(void)
+--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
+@@ -4534,7 +4534,12 @@ static struct pci_driver iwl_driver = {
+ .id_table = iwl_hw_card_ids,
+ .probe = iwl_pci_probe,
+ .remove = __devexit_p(iwl_pci_remove),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ .driver.pm = IWL_PM_OPS,
++#elif defined(CONFIG_PM_SLEEP)
++ .suspend = iwl_pci_suspend_compat,
++ .resume = iwl_pci_resume_compat,
++#endif
+ };
+
+ static int __init iwl_init(void)
+--- a/drivers/net/wireless/iwlwifi/iwl-core.c
++++ b/drivers/net/wireless/iwlwifi/iwl-core.c
+@@ -2188,14 +2188,42 @@ int iwl_pci_resume(struct device *device
+ }
+ EXPORT_SYMBOL(iwl_pci_resume);
+
+-const struct dev_pm_ops iwl_pm_ops = {
+- .suspend = iwl_pci_suspend,
+- .resume = iwl_pci_resume,
+- .freeze = iwl_pci_suspend,
+- .thaw = iwl_pci_resume,
+- .poweroff = iwl_pci_suspend,
+- .restore = iwl_pci_resume,
+-};
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++int iwl_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state)
++{
++ int r;
++
++ r = iwl_pci_suspend(&pdev->dev);
++ if (r)
++ return r;
++
++ pci_save_state(pdev);
++ pci_disable_device(pdev);
++ pci_set_power_state(pdev, PCI_D3hot);
++
++ return 0;
++}
++EXPORT_SYMBOL(iwl_pci_suspend_compat);
++
++int iwl_pci_resume_compat(struct pci_dev *pdev)
++{
++ int r;
++
++ pci_set_power_state(pdev, PCI_D0);
++ r = pci_enable_device(pdev);
++ if (r)
++ return r;
++ pci_restore_state(pdev);
++
++ return iwl_pci_resume(&pdev->dev);
++}
++EXPORT_SYMBOL(iwl_pci_resume_compat);
++#endif
++
++SIMPLE_DEV_PM_OPS(iwl_pm_ops, iwl_pci_suspend, iwl_pci_resume);
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ EXPORT_SYMBOL(iwl_pm_ops);
++#endif
+
+ #endif /* CONFIG_PM */
+--- a/drivers/net/wireless/iwlwifi/iwl-core.h
++++ b/drivers/net/wireless/iwlwifi/iwl-core.h
+@@ -615,7 +615,12 @@ __le32 iwl_add_beacon_time(struct iwl_pr
+ #ifdef CONFIG_PM
+ int iwl_pci_suspend(struct device *device);
+ int iwl_pci_resume(struct device *device);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++int iwl_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state);
++int iwl_pci_resume_compat(struct pci_dev *pdev);
++#else
+ extern const struct dev_pm_ops iwl_pm_ops;
++#endif
+
+ #define IWL_PM_OPS (&iwl_pm_ops)
+
+--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
++++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
+@@ -4279,7 +4279,12 @@ static struct pci_driver iwl3945_driver
+ .id_table = iwl3945_hw_card_ids,
+ .probe = iwl3945_pci_probe,
+ .remove = __devexit_p(iwl3945_pci_remove),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ .driver.pm = IWL_PM_OPS,
++#elif defined(CONFIG_PM_SLEEP)
++ .suspend = iwl_pci_suspend_compat,
++ .resume = iwl_pci_resume_compat,
++#endif
+ };
+
+ static int __init iwl3945_init(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-10 22:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-10 21:04 [PATCH 1/2] compat-wireless: make patches apply again Hauke Mehrtens
2010-11-10 21:04 ` [PATCH 2/2] compat-wireless: Backport pci power management Hauke Mehrtens
2010-11-10 22:45 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).