All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt2x00: make the driver build for Ralink SoC
@ 2013-03-20 19:48 John Crispin
  2013-03-20 21:29 ` Gertjan van Wingerde
  0 siblings, 1 reply; 9+ messages in thread
From: John Crispin @ 2013-03-20 19:48 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, users, John Crispin

Fix up the dependencies to make the driver actually compile on Ralink WiSoC.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/net/wireless/rt2x00/Kconfig     |    2 +-
 drivers/net/wireless/rt2x00/rt2x00pci.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index 2bf4efa..dc7ee6c 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -57,7 +57,7 @@ config RT2800PCI
 	tristate "Ralink rt27xx/rt28xx/rt30xx (PCI/PCIe/PCMCIA) support"
 	depends on PCI || SOC_RT288X || SOC_RT305X
 	select RT2800_LIB
-	select RT2X00_LIB_PCI if PCI
+	select RT2X00_LIB_PCI
 	select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X
 	select RT2X00_LIB_FIRMWARE
 	select RT2X00_LIB_CRYPTO
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index a0c8cae..fa20add 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -208,6 +208,7 @@ void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev)
 }
 EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
 
+#ifdef CONFIG_PCI
 /*
  * PCI driver handlers.
  */
@@ -392,6 +393,7 @@ int rt2x00pci_resume(struct pci_dev *pci_dev)
 }
 EXPORT_SYMBOL_GPL(rt2x00pci_resume);
 #endif /* CONFIG_PM */
+#endif /* CONFIG_PCI */
 
 /*
  * rt2x00pci module information.
-- 
1.7.10.4


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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-20 19:48 [PATCH] rt2x00: make the driver build for Ralink SoC John Crispin
@ 2013-03-20 21:29 ` Gertjan van Wingerde
  2013-03-21  7:35   ` John Crispin
  2013-03-21 18:03   ` Gabor Juhos
  0 siblings, 2 replies; 9+ messages in thread
From: Gertjan van Wingerde @ 2013-03-20 21:29 UTC (permalink / raw)
  To: John Crispin; +Cc: John W. Linville, linux-wireless, users, John Crispin



Sent from my iPad

On 20 mrt. 2013, at 20:48, John Crispin <blogic@openwrt.org> wrote:

> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
> 
> Signed-off-by: John Crispin <blogic@openwrt.org>

I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.

Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.

> ---
> drivers/net/wireless/rt2x00/Kconfig     |    2 +-
> drivers/net/wireless/rt2x00/rt2x00pci.c |    2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
> index 2bf4efa..dc7ee6c 100644
> --- a/drivers/net/wireless/rt2x00/Kconfig
> +++ b/drivers/net/wireless/rt2x00/Kconfig
> @@ -57,7 +57,7 @@ config RT2800PCI
>    tristate "Ralink rt27xx/rt28xx/rt30xx (PCI/PCIe/PCMCIA) support"
>    depends on PCI || SOC_RT288X || SOC_RT305X
>    select RT2800_LIB
> -    select RT2X00_LIB_PCI if PCI
> +    select RT2X00_LIB_PCI
>    select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X
>    select RT2X00_LIB_FIRMWARE
>    select RT2X00_LIB_CRYPTO
> diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
> index a0c8cae..fa20add 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
> @@ -208,6 +208,7 @@ void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev)
> }
> EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
> 
> +#ifdef CONFIG_PCI
> /*
>  * PCI driver handlers.
>  */
> @@ -392,6 +393,7 @@ int rt2x00pci_resume(struct pci_dev *pci_dev)
> }
> EXPORT_SYMBOL_GPL(rt2x00pci_resume);
> #endif /* CONFIG_PM */
> +#endif /* CONFIG_PCI */
> 
> /*
>  * rt2x00pci module information.
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-20 21:29 ` Gertjan van Wingerde
@ 2013-03-21  7:35   ` John Crispin
  2013-03-27 17:17     ` John W. Linville
  2013-03-21 18:03   ` Gabor Juhos
  1 sibling, 1 reply; 9+ messages in thread
From: John Crispin @ 2013-03-21  7:35 UTC (permalink / raw)
  To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users


>> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
>>
>> Signed-off-by: John Crispin<blogic@openwrt.org>
> I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.
>
> Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.
>

Indeed not the cleanest patch ... after changing the config symbols I 
realized that that is not enough to make the driver actually work

It turns out that inside openwrt the compat-wireless package sets 
CONFIG_RT2800PCI=m to make the driver build and then applies the 
#ifdef'ery to rt2880pci.c

I will try to find the time today or tomorrow to have a closer look at this

     John

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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-20 21:29 ` Gertjan van Wingerde
  2013-03-21  7:35   ` John Crispin
@ 2013-03-21 18:03   ` Gabor Juhos
  1 sibling, 0 replies; 9+ messages in thread
From: Gabor Juhos @ 2013-03-21 18:03 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: John Crispin, John W. Linville, linux-wireless, users

2013.03.20. 22:29 keltezéssel, Gertjan van Wingerde írta:
> 
> 
> Sent from my iPad
> 
> On 20 mrt. 2013, at 20:48, John Crispin <blogic@openwrt.org> wrote:
> 
>> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
>>
>> Signed-off-by: John Crispin <blogic@openwrt.org>
> 
> I don't think this is a proper way to handle this. rt2x00pci.c was only
> meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file
> doesn't seem appropriate to me.

Well, CONFIG_PCI is also used in rt2800pci.c. The root cause of the problem is
that rt2800pci (despite its name) is used to drive the built-in wireless MAC of
various SoCs. This is because handling of the PCI and of the SoC built-in
devices is quite similar. However regardless of the underlying bus type,
rt2800pci uses several functions exported from rt2x00pci so it should always
select RT2X00_LIB_PCI.

The rt2x00pci_{probe,remove,suspend,resume} handlers from rt2x00pci are not used
by rt2800pci if PCI disabled. However the presence of that functions in rt2x00
causes build error if the driver is compiled with disabled PCI support.

If we properly want to fix the issue, lots of functions should be renamed and
should be moved into separate modules. The name of these new modules could be
rt2x00mmio and rt2800mmio for example.

Adding CONFIG_PCI to rt2x00pci could be a temporary solution until that is not done.

-Gabor

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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-21  7:35   ` John Crispin
@ 2013-03-27 17:17     ` John W. Linville
  2013-03-27 18:25       ` John Crispin
  0 siblings, 1 reply; 9+ messages in thread
From: John W. Linville @ 2013-03-27 17:17 UTC (permalink / raw)
  To: John Crispin; +Cc: Gertjan van Wingerde, linux-wireless, users

On Thu, Mar 21, 2013 at 08:35:34AM +0100, John Crispin wrote:
> 
> >>Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
> >>
> >>Signed-off-by: John Crispin<blogic@openwrt.org>
> >I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.
> >
> >Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.
> >
> 
> Indeed not the cleanest patch ... after changing the config symbols
> I realized that that is not enough to make the driver actually work
> 
> It turns out that inside openwrt the compat-wireless package sets
> CONFIG_RT2800PCI=m to make the driver build and then applies the
> #ifdef'ery to rt2880pci.c
> 
> I will try to find the time today or tomorrow to have a closer look at this

Any more word on this?

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-27 17:17     ` John W. Linville
@ 2013-03-27 18:25       ` John Crispin
  2013-03-27 20:38         ` Gertjan van Wingerde
  0 siblings, 1 reply; 9+ messages in thread
From: John Crispin @ 2013-03-27 18:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: Gertjan van Wingerde, linux-wireless, users

On 27/03/13 18:17, John W. Linville wrote:
> On Thu, Mar 21, 2013 at 08:35:34AM +0100, John Crispin wrote:
>>>> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
>>>>
>>>> Signed-off-by: John Crispin<blogic@openwrt.org>
>>> I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.
>>>
>>> Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.
>>>
>> Indeed not the cleanest patch ... after changing the config symbols
>> I realized that that is not enough to make the driver actually work
>>
>> It turns out that inside openwrt the compat-wireless package sets
>> CONFIG_RT2800PCI=m to make the driver build and then applies the
>> #ifdef'ery to rt2880pci.c
>>
>> I will try to find the time today or tomorrow to have a closer look at this
> Any more word on this?
Gabor posted a series as RFC that would fix this properly ->

http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2013-March/005837.html

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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-27 18:25       ` John Crispin
@ 2013-03-27 20:38         ` Gertjan van Wingerde
  2013-03-27 20:48           ` John Crispin
  2013-03-29 15:02           ` Gabor Juhos
  0 siblings, 2 replies; 9+ messages in thread
From: Gertjan van Wingerde @ 2013-03-27 20:38 UTC (permalink / raw)
  To: John Crispin; +Cc: John W. Linville, linux-wireless, users



Sent from my iPad

On 27 mrt. 2013, at 19:25, John Crispin <blogic@openwrt.org> wrote:

> On 27/03/13 18:17, John W. Linville wrote:
>> On Thu, Mar 21, 2013 at 08:35:34AM +0100, John Crispin wrote:
>>>>> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
>>>>> 
>>>>> Signed-off-by: John Crispin<blogic@openwrt.org>
>>>> I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.
>>>> 
>>>> Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.
>>>> 
>>> Indeed not the cleanest patch ... after changing the config symbols
>>> I realized that that is not enough to make the driver actually work
>>> 
>>> It turns out that inside openwrt the compat-wireless package sets
>>> CONFIG_RT2800PCI=m to make the driver build and then applies the
>>> #ifdef'ery to rt2880pci.c
>>> 
>>> I will try to find the time today or tomorrow to have a closer look at this
>> Any more word on this?
> Gabor posted a series as RFC that would fix this properly ->
> 
> http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2013-March/005837.html

Yeah, and that series looks good. Unfortunately, it is too intrusive to still apply for 3.9.

John L., could we get in a scheme where we apply John C.'s patch for 3.9 and then use Gabor's series for 3.10?
Don't know how that works with making sure that this patch is reverted for 3.10.

Can you coordinate, or should I help you with this?

---
Gertjan



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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-27 20:38         ` Gertjan van Wingerde
@ 2013-03-27 20:48           ` John Crispin
  2013-03-29 15:02           ` Gabor Juhos
  1 sibling, 0 replies; 9+ messages in thread
From: John Crispin @ 2013-03-27 20:48 UTC (permalink / raw)
  To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users


>>> Any more word on this?
>> Gabor posted a series as RFC that would fix this properly ->
>>
>> http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2013-March/005837.html
> Yeah, and that series looks good. Unfortunately, it is too intrusive to still apply for 3.9.
>
> John L., could we get in a scheme where we apply John C.'s patch for 3.9 and then use Gabor's series for 3.10?
> Don't know how that works with making sure that this patch is reverted for 3.10.
>
> Can you coordinate, or should I help you with this?
>
Hi,

if we could apply my original 'dirty' patch as a temporary fix for 3.9, 
that would be great. Its not an optimal solution but it at least makes 
the code compile/work.

Gabor and myself have also accumulated a pile of other patches. In 
addition to the 8 patch series that splits the pci/generic code, there 
is a 20 patch series, that adds rt3662/rt3883 support, a 7 patch series 
that adds rt5350 support and another 8 patches that add OF support.

I am planning to setup a git tree with all these after easter and then 
send them to the list for review. Ideally these patches all make it into 
3.10 as we will also be merging the remaining Ralink SoC patches via the 
linux-mips tree for 3.10 (with the exception of the ethernet driver as 
it will need a rewrite before I can send it upstream)

     John



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

* Re: [PATCH] rt2x00: make the driver build for Ralink SoC
  2013-03-27 20:38         ` Gertjan van Wingerde
  2013-03-27 20:48           ` John Crispin
@ 2013-03-29 15:02           ` Gabor Juhos
  1 sibling, 0 replies; 9+ messages in thread
From: Gabor Juhos @ 2013-03-29 15:02 UTC (permalink / raw)
  To: Gertjan van Wingerde
  Cc: John Crispin, John W. Linville, linux-wireless, users

2013.03.27. 21:38 keltezéssel, Gertjan van Wingerde írta:
> 
> 
> Sent from my iPad
> 
> On 27 mrt. 2013, at 19:25, John Crispin <blogic@openwrt.org> wrote:
> 
>> On 27/03/13 18:17, John W. Linville wrote:
>>> On Thu, Mar 21, 2013 at 08:35:34AM +0100, John Crispin wrote:
>>>>>> Fix up the dependencies to make the driver actually compile on Ralink WiSoC.
>>>>>>
>>>>>> Signed-off-by: John Crispin<blogic@openwrt.org>
>>>>> I don't think this is a proper way to handle this. rt2x00pci.c was only meant to be used for PCI devices; introducing the use of CONFIG_PCI in that file doesn't seem appropriate to me.
>>>>>
>>>>> Unfortunately I am away from my home computer, so I can't look at this properly until the weekend.
>>>>>
>>>> Indeed not the cleanest patch ... after changing the config symbols
>>>> I realized that that is not enough to make the driver actually work
>>>>
>>>> It turns out that inside openwrt the compat-wireless package sets
>>>> CONFIG_RT2800PCI=m to make the driver build and then applies the
>>>> #ifdef'ery to rt2880pci.c
>>>>
>>>> I will try to find the time today or tomorrow to have a closer look at this
>>> Any more word on this?
>> Gabor posted a series as RFC that would fix this properly ->
>>
>> http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2013-March/005837.html
> 
> Yeah, and that series looks good. Unfortunately, it is too intrusive to still apply for 3.9.
> 
> John L., could we get in a scheme where we apply John C.'s patch for 3.9 and then use Gabor's series for 3.10?
> Don't know how that works with making sure that this patch is reverted for 3.10.
> 
> Can you coordinate, or should I help you with this?

Sorry for the late reply. I have sent a less intrusive version of that RFC
patch-set, as an alternative solution.

-Gabor

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

end of thread, other threads:[~2013-03-29 15:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 19:48 [PATCH] rt2x00: make the driver build for Ralink SoC John Crispin
2013-03-20 21:29 ` Gertjan van Wingerde
2013-03-21  7:35   ` John Crispin
2013-03-27 17:17     ` John W. Linville
2013-03-27 18:25       ` John Crispin
2013-03-27 20:38         ` Gertjan van Wingerde
2013-03-27 20:48           ` John Crispin
2013-03-29 15:02           ` Gabor Juhos
2013-03-21 18:03   ` Gabor Juhos

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.