linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat: backport linux/pci-aspm.h
@ 2010-08-27 18:41 Hauke Mehrtens
  2010-08-28 21:01 ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Hauke Mehrtens @ 2010-08-27 18:41 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/pci-aspm.h

diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
new file mode 100644
index 0000000..c791d00
--- /dev/null
+++ b/include/linux/pci-aspm.h
@@ -0,0 +1,55 @@
+#ifndef _COMPAT_LINUX_ASPM_H
+#define _COMPAT_LINUX_ASPM_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25))
+#include_next <linux/pci-aspm.h>
+#else
+
+/*
+ *	aspm.h
+ *
+ *	PCI Express ASPM defines and function prototypes
+ *
+ *	Copyright (C) 2007 Intel Corp.
+ *		Zhang Yanmin (yanmin.zhang@intel.com)
+ *		Shaohua Li (shaohua.li@intel.com)
+ *
+ *	For more information, please consult the following manuals (look at
+ *	http://www.pcisig.com/ for how to get them):
+ *
+ *	PCI Express Specification
+ */
+
+#include <linux/pci.h>
+
+#define PCIE_LINK_STATE_L0S	1
+#define PCIE_LINK_STATE_L1	2
+#define PCIE_LINK_STATE_CLKPM	4
+
+static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
+{
+}
+static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev)
+{
+}
+static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev)
+{
+}
+static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
+{
+}
+static inline void pcie_no_aspm(void)
+{
+}
+static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
+{
+}
+static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
+{
+}
+
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)) */
+
+#endif	/* _COMPAT_LINUX_ASPM_H */
-- 
1.7.0.4


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

* Re: [PATCH] compat: backport linux/pci-aspm.h
  2010-08-27 18:41 [PATCH] compat: backport linux/pci-aspm.h Hauke Mehrtens
@ 2010-08-28 21:01 ` Luis R. Rodriguez
  2010-09-01 15:07   ` Hauke Mehrtens
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-08-28 21:01 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org

On Fri, Aug 27, 2010 at 11:41:54AM -0700, Hauke Mehrtens wrote:
> pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 55 insertions(+), 0 deletions(-)
>  create mode 100644 include/linux/pci-aspm.h
> 
> diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
> new file mode 100644
> index 0000000..c791d00
> --- /dev/null
> +++ b/include/linux/pci-aspm.h

So compat-wireless would have to copy this file over? We'd then have to synch
this file for older kernels, and the real kernel header's own pci-aspm.h for
kernels >= 2.6.25 would be using this version of the file. Can we just stuff
the ASPM required stuff onto include/linux/compat-2.6.25.h ?

  Luis

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

* Re: [PATCH] compat: backport linux/pci-aspm.h
  2010-08-28 21:01 ` Luis R. Rodriguez
@ 2010-09-01 15:07   ` Hauke Mehrtens
  2010-09-01 15:12     ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Hauke Mehrtens @ 2010-09-01 15:07 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org

Am 28.08.2010 23:01, schrieb Luis R. Rodriguez:
> On Fri, Aug 27, 2010 at 11:41:54AM -0700, Hauke Mehrtens wrote:
>> pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 55 insertions(+), 0 deletions(-)
>>  create mode 100644 include/linux/pci-aspm.h
>>
>> diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
>> new file mode 100644
>> index 0000000..c791d00
>> --- /dev/null
>> +++ b/include/linux/pci-aspm.h
> 
> So compat-wireless would have to copy this file over? We'd then have to synch
> this file for older kernels, and the real kernel header's own pci-aspm.h for
> kernels >= 2.6.25 would be using this version of the file. Can we just stuff
> the ASPM required stuff onto include/linux/compat-2.6.25.h ?
> 
>   Luis
Hi,

we can stuff the empty aspm functions into compat-2.6.25.h, but we need
include/linux/pci-aspm.h or we need an extra ifdef in compat-wireless
(not nice). Some drivers like drivers/net/wireless/ath/ath5k/base.c and
drivers/net/wireless/iwlwifi/iwl-agn.c are including pci-aspm.h, but it
is not there for kernels < 2.6.25.

I will prepare a new patch for compat. With an mostly empty pci-aspm.h
with an include_next and some functions in compat-2.6.35.h.

Hauke

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

* Re: [PATCH] compat: backport linux/pci-aspm.h
  2010-09-01 15:07   ` Hauke Mehrtens
@ 2010-09-01 15:12     ` Luis R. Rodriguez
  2010-09-02 13:18       ` Hauke Mehrtens
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-09-01 15:12 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org

On Wed, Sep 1, 2010 at 8:07 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Am 28.08.2010 23:01, schrieb Luis R. Rodriguez:
>> On Fri, Aug 27, 2010 at 11:41:54AM -0700, Hauke Mehrtens wrote:
>>> pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>> ---
>>>  include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 files changed, 55 insertions(+), 0 deletions(-)
>>>  create mode 100644 include/linux/pci-aspm.h
>>>
>>> diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
>>> new file mode 100644
>>> index 0000000..c791d00
>>> --- /dev/null
>>> +++ b/include/linux/pci-aspm.h
>>
>> So compat-wireless would have to copy this file over? We'd then have to synch
>> this file for older kernels, and the real kernel header's own pci-aspm.h for
>> kernels >= 2.6.25 would be using this version of the file. Can we just stuff
>> the ASPM required stuff onto include/linux/compat-2.6.25.h ?
>>
>>   Luis
> Hi,
>
> we can stuff the empty aspm functions into compat-2.6.25.h, but we need
> include/linux/pci-aspm.h or we need an extra ifdef in compat-wireless
> (not nice). Some drivers like drivers/net/wireless/ath/ath5k/base.c and
> drivers/net/wireless/iwlwifi/iwl-agn.c are including pci-aspm.h, but it
> is not there for kernels < 2.6.25.

Understood and good point.

> I will prepare a new patch for compat. With an mostly empty pci-aspm.h
> with an include_next and some functions in compat-2.6.35.h.

Well so the issue is getting kernels newer than include their own
kernel header's include/linux/pci-aspm.h rather than the one provided
by compat. How will this be achieved?

  Luis

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

* Re: [PATCH] compat: backport linux/pci-aspm.h
  2010-09-01 15:12     ` Luis R. Rodriguez
@ 2010-09-02 13:18       ` Hauke Mehrtens
  2010-09-02 14:12         ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Hauke Mehrtens @ 2010-09-02 13:18 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org

Am 01.09.2010 17:12, schrieb Luis R. Rodriguez:
> On Wed, Sep 1, 2010 at 8:07 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> Am 28.08.2010 23:01, schrieb Luis R. Rodriguez:
>>> On Fri, Aug 27, 2010 at 11:41:54AM -0700, Hauke Mehrtens wrote:
>>>> pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.
>>>>
>>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>>> ---
>>>>  include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
>>>>  1 files changed, 55 insertions(+), 0 deletions(-)
>>>>  create mode 100644 include/linux/pci-aspm.h
>>>>
>>>> diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
>>>> new file mode 100644
>>>> index 0000000..c791d00
>>>> --- /dev/null
>>>> +++ b/include/linux/pci-aspm.h
>>>
>>> So compat-wireless would have to copy this file over? We'd then have to synch
>>> this file for older kernels, and the real kernel header's own pci-aspm.h for
>>> kernels >= 2.6.25 would be using this version of the file. Can we just stuff
>>> the ASPM required stuff onto include/linux/compat-2.6.25.h ?
>>>
>>>   Luis
>> Hi,
>>
>> we can stuff the empty aspm functions into compat-2.6.25.h, but we need
>> include/linux/pci-aspm.h or we need an extra ifdef in compat-wireless
>> (not nice). Some drivers like drivers/net/wireless/ath/ath5k/base.c and
>> drivers/net/wireless/iwlwifi/iwl-agn.c are including pci-aspm.h, but it
>> is not there for kernels < 2.6.25.
> 
> Understood and good point.
> 
>> I will prepare a new patch for compat. With an mostly empty pci-aspm.h
>> with an include_next and some functions in compat-2.6.35.h.
> 
> Well so the issue is getting kernels newer than include their own
> kernel header's include/linux/pci-aspm.h rather than the one provided
> by compat. How will this be achieved?

#include_next includes the next file with this name.
http://www.delorie.com/gnu/docs/gcc/cpp_11.html (middle)
We can do it like it is done in include/linux/tracepoint.h in compat.
If something changes in pci-aspm.h in the kernel we do not have to
change anything for kernel > 2.6.25.

Hauke

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

* Re: [PATCH] compat: backport linux/pci-aspm.h
  2010-09-02 13:18       ` Hauke Mehrtens
@ 2010-09-02 14:12         ` Luis R. Rodriguez
  0 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-09-02 14:12 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org

On Thu, Sep 02, 2010 at 06:18:00AM -0700, Hauke Mehrtens wrote:
> Am 01.09.2010 17:12, schrieb Luis R. Rodriguez:
> > On Wed, Sep 1, 2010 at 8:07 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >> Am 28.08.2010 23:01, schrieb Luis R. Rodriguez:
> >>> On Fri, Aug 27, 2010 at 11:41:54AM -0700, Hauke Mehrtens wrote:
> >>>> pci-aspm.h was introduced in kernel 2.6.25 and is used by the ath5k driver.
> >>>>
> >>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> >>>> ---
> >>>>  include/linux/pci-aspm.h |   55 ++++++++++++++++++++++++++++++++++++++++++++++
> >>>>  1 files changed, 55 insertions(+), 0 deletions(-)
> >>>>  create mode 100644 include/linux/pci-aspm.h
> >>>>
> >>>> diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
> >>>> new file mode 100644
> >>>> index 0000000..c791d00
> >>>> --- /dev/null
> >>>> +++ b/include/linux/pci-aspm.h
> >>>
> >>> So compat-wireless would have to copy this file over? We'd then have to synch
> >>> this file for older kernels, and the real kernel header's own pci-aspm.h for
> >>> kernels >= 2.6.25 would be using this version of the file. Can we just stuff
> >>> the ASPM required stuff onto include/linux/compat-2.6.25.h ?
> >>>
> >>>   Luis
> >> Hi,
> >>
> >> we can stuff the empty aspm functions into compat-2.6.25.h, but we need
> >> include/linux/pci-aspm.h or we need an extra ifdef in compat-wireless
> >> (not nice). Some drivers like drivers/net/wireless/ath/ath5k/base.c and
> >> drivers/net/wireless/iwlwifi/iwl-agn.c are including pci-aspm.h, but it
> >> is not there for kernels < 2.6.25.
> > 
> > Understood and good point.
> > 
> >> I will prepare a new patch for compat. With an mostly empty pci-aspm.h
> >> with an include_next and some functions in compat-2.6.35.h.
> > 
> > Well so the issue is getting kernels newer than include their own
> > kernel header's include/linux/pci-aspm.h rather than the one provided
> > by compat. How will this be achieved?
> 
> #include_next includes the next file with this name.
> http://www.delorie.com/gnu/docs/gcc/cpp_11.html (middle)
> We can do it like it is done in include/linux/tracepoint.h in compat.
> If something changes in pci-aspm.h in the kernel we do not have to
> change anything for kernel > 2.6.25.

Fair enough and thanks for the reference! Sounds good!

  Luis

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

end of thread, other threads:[~2010-09-02 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27 18:41 [PATCH] compat: backport linux/pci-aspm.h Hauke Mehrtens
2010-08-28 21:01 ` Luis R. Rodriguez
2010-09-01 15:07   ` Hauke Mehrtens
2010-09-01 15:12     ` Luis R. Rodriguez
2010-09-02 13:18       ` Hauke Mehrtens
2010-09-02 14:12         ` 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).