All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] compat-stable-2.6.37
@ 2011-01-09 15:00 Hauke Mehrtens
  2011-01-09 15:00 ` [PATCH] compat: backport pci_wake_from_d3 Hauke Mehrtens
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2011-01-09 15:00 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Hauke Mehrtens

This patch should go into compat stable linux-2.6.37.y as the function 
is also used in linux version 2.6.37. It is already included in compat-
wireless based on linux-next.

Hauke Mehrtens (1):
  compat: backport pci_wake_from_d3

 compat/compat-2.6.28.c        |   22 ++++++++++++++++++++++
 include/linux/compat-2.6.28.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)


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

* [PATCH] compat: backport pci_wake_from_d3
  2011-01-09 15:00 [PATCH] compat-stable-2.6.37 Hauke Mehrtens
@ 2011-01-09 15:00 ` Hauke Mehrtens
  2011-01-13  0:45   ` Luis R. Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2011-01-09 15:00 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Hauke Mehrtens

This is needed by atl1c.

This is compat-wireless upstream commit:
	454fb1a4a698bd2935af76800bc17e14b086476a

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 compat/compat-2.6.28.c        |   22 ++++++++++++++++++++++
 include/linux/compat-2.6.28.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/compat/compat-2.6.28.c b/compat/compat-2.6.28.c
index 7a834d2..72c9e09 100644
--- a/compat/compat-2.6.28.c
+++ b/compat/compat-2.6.28.c
@@ -439,3 +439,25 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
 }
 EXPORT_SYMBOL(n_tty_ioctl_helper);
 
+/**
+ * pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold
+ * @dev: PCI device to prepare
+ * @enable: True to enable wake-up event generation; false to disable
+ *
+ * Many drivers want the device to wake up the system from D3_hot or D3_cold
+ * and this function allows them to set that up cleanly - pci_enable_wake()
+ * should not be called twice in a row to enable wake-up due to PCI PM vs ACPI
+ * ordering constraints.
+ *
+ * This function only returns error code if the device is not capable of
+ * generating PME# from both D3_hot and D3_cold, and the platform is unable to
+ * enable wake-up power for it.
+ */
+int pci_wake_from_d3(struct pci_dev *dev, bool enable)
+{
+	return pci_pme_capable(dev, PCI_D3cold) ?
+			pci_enable_wake(dev, PCI_D3cold, enable) :
+			pci_enable_wake(dev, PCI_D3hot, enable);
+}
+EXPORT_SYMBOL(pci_wake_from_d3);
+
diff --git a/include/linux/compat-2.6.28.h b/include/linux/compat-2.6.28.h
index 1de39ad..b9024d6 100644
--- a/include/linux/compat-2.6.28.h
+++ b/include/linux/compat-2.6.28.h
@@ -234,6 +234,8 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
 extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
 		       unsigned int cmd, unsigned long arg);
 
+int pci_wake_from_d3(struct pci_dev *dev, bool enable);
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */
 
 #endif /* LINUX_26_28_COMPAT_H */
-- 
1.7.1


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

* Re: [PATCH] compat: backport pci_wake_from_d3
  2011-01-09 15:00 ` [PATCH] compat: backport pci_wake_from_d3 Hauke Mehrtens
@ 2011-01-13  0:45   ` Luis R. Rodriguez
  0 siblings, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2011-01-13  0:45 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless

On Sun, Jan 9, 2011 at 7:00 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> This is needed by atl1c.
>
> This is compat-wireless upstream commit:
>        454fb1a4a698bd2935af76800bc17e14b086476a
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied, thanks!

 Luis

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

end of thread, other threads:[~2011-01-13  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-09 15:00 [PATCH] compat-stable-2.6.37 Hauke Mehrtens
2011-01-09 15:00 ` [PATCH] compat: backport pci_wake_from_d3 Hauke Mehrtens
2011-01-13  0:45   ` Luis R. Rodriguez

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.