All of lore.kernel.org
 help / color / mirror / Atom feed
* Cross-compiling wifi driver on Android
@ 2017-12-02  0:44 Remington Furman
  2017-12-02  8:08 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Remington Furman @ 2017-12-02  0:44 UTC (permalink / raw)
  To: backports

Hi,

I've been following the directions here:
<https://backports.wiki.kernel.org/index.php/Documentation/packaging#Cross_compiling>
Thanks you your help, I've successfully run gentree.py

I used a "make showcommands kernelconfig" Android build command
to find the proper CROSS_COMPILE and ARCH variables for building
the kernel.  I then pointed KLIB and KLIB_BUILD to the proper
directories for my Android build (it uses a separate build
directory for everything, including the kernel).

 From my backports directory:
set -a
CROSS_COMPILE=aarch64-linux-android-
ARCH=arm64
KLIB=/media/remicles/BP2/work/linux_android_board_support_package_vla.br_.1.2.4-01810-8x16.0-3/APQ8016_410C_LA.BR.1.2.4-01810-8x16.0_5.1.1_Lollipop_P2/kernel
KLIB_BUILD=/media/remicles/BP2/work/linux_android_board_support_package_vla.br_.1.2.4-01810-8x16.0-3/APQ8016_410C_LA.BR.1.2.4-01810-8x16.0_5.1.1_Lollipop_P2/out/target/product/msm8916_64/obj/KERNEL_OBJ
set +a
make menuconfig

That succeeds and shows me a menu.  However, '<M> USB Network
Adapters ----' is an empty menu and the rtl8192cu driver I am
after is not available.  Enabling CPTCFG_WLAN_VENDOR_REALTEK in
'make menuconfig' doesn't lead to any other options.

If I instead run 'make defconfig-rtlwifi' (which includes
'CPTCFG_RTL8192CU=m'), then the resulting .config file still
contains:

$ grep -i -e "rtl" -e "realtek" .config
CPTCFG_WLAN_VENDOR_REALTEK=y
CPTCFG_NET_VENDOR_REALTEK=y
CPTCFG_BACKPORTED_WLAN_VENDOR_REALTEK=y
# CPTCFG_BACKPORTED_RTL8180 is not set
[snip]
# CPTCFG_BACKPORTED_RTL8192CU is not set
# CPTCFG_BACKPORTED_RTLWIFI is not set
# CPTCFG_BACKPORTED_RTLWIFI_PCI is not set
# CPTCFG_BACKPORTED_RTLWIFI_USB is not set
# CPTCFG_BACKPORTED_RTLWIFI_DEBUG is not set
[snip]
# CPTCFG_BACKPORTED_USB_RTL8152 is not set

At this point, a build includes compat.ko and cfg80211.ko, but no
rtl8192cu.ko, of course.

If I understand this page correctly, I need to first disable
conflicting drivers in my target kernel .config before running
'make menuconfig' in backports.
<https://backports.wiki.kernel.org/index.php/Documentation/integration#Kernel_integration_menuconfig>
I've tried a number of target kernel configurations, but haven't
found a combination that makes backports happy yet.  I've disable
CONFIG_CFG80211 and CONFIG_WLAN, but no luck.

I've tried to dive into Makefile.real to understand how the two
.config files interact, but I don't understand menuconfig/kconf
enough.  Is there a way I can get some debug output to see any
conflicts between my .config files?

I've thought about just copying the backports driver code into my
target kernel source directory and building from there, but I'm
not sure if that would work or is advised.  My guess is that it
could be a mess without using the backports Kconfig files.  My
goal is to have an rtl8192cu.ko module (and the modules it
depends on) that I can load on the target.

Does anyone have any pointers or suggestions?

Thank you,
Remington

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: Cross-compiling wifi driver on Android
  2017-12-02  0:44 Cross-compiling wifi driver on Android Remington Furman
@ 2017-12-02  8:08 ` Johannes Berg
  2017-12-02 16:31   ` Remington Furman
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2017-12-02  8:08 UTC (permalink / raw)
  To: Remington Furman, backports

On Fri, 2017-12-01 at 16:44 -0800, Remington Furman wrote:

> That succeeds and shows me a menu.  However, '<M> USB Network
> Adapters ----' is an empty menu and the rtl8192cu driver I am
> after is not available.  Enabling CPTCFG_WLAN_VENDOR_REALTEK in
> 'make menuconfig' doesn't lead to any other options.

In menuconfig, hit "/" and search for (part of) the symbol you want
(e.g. "RTL8192"), and check the dependencies.

It really only has one though "depends on USB", which is weird. Check
it there.

> If I understand this page correctly, I need to first disable
> conflicting drivers in my target kernel .config before running
> 'make menuconfig' in backports.
> <https://backports.wiki.kernel.org/index.php/Documentation/integration#Kernel_integration_menuconfig>
> I've tried a number of target kernel configurations, but haven't
> found a combination that makes backports happy yet.  I've disable
> CONFIG_CFG80211 and CONFIG_WLAN, but no luck.

You don't want integration, so I think you can ignore that page.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: Cross-compiling wifi driver on Android
  2017-12-02  8:08 ` Johannes Berg
@ 2017-12-02 16:31   ` Remington Furman
  2017-12-02 20:28     ` Johannes Berg
  2017-12-12 14:38     ` Remington Furman
  0 siblings, 2 replies; 5+ messages in thread
From: Remington Furman @ 2017-12-02 16:31 UTC (permalink / raw)
  To: Johannes Berg, backports

Hi Johannes,

Thank you very much.  That tip to follow the dependencies helped a lot.  
I had been using "/" before, but just learned you can type the numbers 
in parenthesis in the search results to jump to them. Saves a lot of time.

After working recursively through the dependencies for the backports 
menuconfig option I wanted (RTL8192CU) I found out that CPTCFG_MAC80211 
wasn't appearing as an option in backports because my target kernel did 
not satisfy it's dependencies for CRYPTO_CCM, CRYPTO_GCM, and 
CRYPTO_CMAC.  After enabling those on my target kernel, CPTCFG_MAC80211 
appeared and I could enable everything in backports down to my desired 
driver.

Thanks again.  I'll let you know when I'm able to get the new drivers 
loaded on my target next week.

Cheers,

Remington

On 12/02/2017 12:08 AM, Johannes Berg wrote:
> On Fri, 2017-12-01 at 16:44 -0800, Remington Furman wrote:
>
>> That succeeds and shows me a menu.  However, '<M> USB Network
>> Adapters ----' is an empty menu and the rtl8192cu driver I am
>> after is not available.  Enabling CPTCFG_WLAN_VENDOR_REALTEK in
>> 'make menuconfig' doesn't lead to any other options.
> In menuconfig, hit "/" and search for (part of) the symbol you want
> (e.g. "RTL8192"), and check the dependencies.
>
> It really only has one though "depends on USB", which is weird. Check
> it there.
>
>> If I understand this page correctly, I need to first disable
>> conflicting drivers in my target kernel .config before running
>> 'make menuconfig' in backports.
>> <https://backports.wiki.kernel.org/index.php/Documentation/integration#Kernel_integration_menuconfig>
>> I've tried a number of target kernel configurations, but haven't
>> found a combination that makes backports happy yet.  I've disable
>> CONFIG_CFG80211 and CONFIG_WLAN, but no luck.
> You don't want integration, so I think you can ignore that page.
>
> johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: Cross-compiling wifi driver on Android
  2017-12-02 16:31   ` Remington Furman
@ 2017-12-02 20:28     ` Johannes Berg
  2017-12-12 14:38     ` Remington Furman
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2017-12-02 20:28 UTC (permalink / raw)
  To: Remington Furman, backports

Hi,

> Thank you very much.  That tip to follow the dependencies helped a lot.  
> I had been using "/" before, but just learned you can type the numbers 
> in parenthesis in the search results to jump to them. Saves a lot of time.

Hah, nice trick, I wasn't aware of that either :-)

Thanks!

> After working recursively through the dependencies for the backports 
> menuconfig option I wanted (RTL8192CU) I found out that CPTCFG_MAC80211 
> wasn't appearing as an option in backports because my target kernel did 
> not satisfy it's dependencies for CRYPTO_CCM, CRYPTO_GCM, and 
> CRYPTO_CMAC.  After enabling those on my target kernel, CPTCFG_MAC80211 
> appeared and I could enable everything in backports down to my desired 
> driver.

Ah, yes, I should've guessed that, but forgot that the driver needs
mac80211 at all. I had attempted to backport these (crypto) at some
point, but it's very tricky.

Glad you could sort it out :)

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: Cross-compiling wifi driver on Android
  2017-12-02 16:31   ` Remington Furman
  2017-12-02 20:28     ` Johannes Berg
@ 2017-12-12 14:38     ` Remington Furman
  1 sibling, 0 replies; 5+ messages in thread
From: Remington Furman @ 2017-12-12 14:38 UTC (permalink / raw)
  To: Johannes Berg, backports

Hi all,

I want to say thanks for the help and give an update on where I
got with this.

I was able to build the RTL8192CU driver and it's dependencies
and load them onto my target.  However, I got stuck debugging
some run-time driver dependencies on my Android system that
caused kernel panics.  Unfortunately, I ran out of time to sort
this out and must move on to another project.

A little background for those interested in the details, please
feel free to stop reading.

I'm developing for the Dragonboard 410c single-board computer and
an Android 5.1.1 build provided by the board vendor.  The kernel
version is based on 3.10.49 and modified by the vendor for
Android (last commit for that branch is from July 2015). The
board has a built-in WCN3620 wifi+bluetooth low energy+fm radio
chip.  I think there are two drivers for that: wcnss/wcn36xx,
which is in-tree, and prima, which is out-of-tree.

My project is using both wifi and BLE, but we were having
problems with dropped BLE packets when using both at the same
time, so our workaround was to use a USB wifi adapter and not use
the wcnss/prima wifi driver.  However, we had RTL driver related
problems that caused unreliable wifi performance and dropped
connections.  Hence our choice to backport the latest RTL driver.

The current issue at runtime is that the Android stack still
depends on the WCN3620 driver, so disabling it is not an option.
But building and running both is not an option either, because
both depend on CFG80211 and that is now provided by backports,
and our out-of-tree prima driver isn't backported.  I did notice
a WCN36xx driver in backports (which might solve our original
wifi+ble issue), but it depends on kernel code that appeared in
Sept 2015 and our kernel can't satisfy those dependencies, so we
have build errors.

I think the best path forward is to migrate to the latest build
from the vendor, which is Android 6.0.  That way we'll have a
more up-to-date kernel with driver bug-fixes that might solve our
problem or at least help us backport a shorter distance. But
again, I must move on to another project for now.

Thanks again for all your help!

-Remington

On 12/02/2017 08:31 AM, Remington Furman wrote:
> Hi Johannes,
>
> Thank you very much.  That tip to follow the dependencies helped a 
> lot.  I had been using "/" before, but just learned you can type the 
> numbers in parenthesis in the search results to jump to them. Saves a 
> lot of time.
>
> After working recursively through the dependencies for the backports 
> menuconfig option I wanted (RTL8192CU) I found out that 
> CPTCFG_MAC80211 wasn't appearing as an option in backports because my 
> target kernel did not satisfy it's dependencies for CRYPTO_CCM, 
> CRYPTO_GCM, and CRYPTO_CMAC.  After enabling those on my target 
> kernel, CPTCFG_MAC80211 appeared and I could enable everything in 
> backports down to my desired driver.
>
> Thanks again.  I'll let you know when I'm able to get the new drivers 
> loaded on my target next week.
>
> Cheers,
>
> Remington
>
> On 12/02/2017 12:08 AM, Johannes Berg wrote:
>> On Fri, 2017-12-01 at 16:44 -0800, Remington Furman wrote:
>>
>>> That succeeds and shows me a menu. However, '<M> USB Network
>>> Adapters ----' is an empty menu and the rtl8192cu driver I am
>>> after is not available.  Enabling CPTCFG_WLAN_VENDOR_REALTEK in
>>> 'make menuconfig' doesn't lead to any other options.
>> In menuconfig, hit "/" and search for (part of) the symbol you want
>> (e.g. "RTL8192"), and check the dependencies.
>>
>> It really only has one though "depends on USB", which is weird. Check
>> it there.
>>
>>> If I understand this page correctly, I need to first disable
>>> conflicting drivers in my target kernel .config before running
>>> 'make menuconfig' in backports.
>>> <https://backports.wiki.kernel.org/index.php/Documentation/integration#Kernel_integration_menuconfig> 
>>>
>>> I've tried a number of target kernel configurations, but haven't
>>> found a combination that makes backports happy yet.  I've disable
>>> CONFIG_CFG80211 and CONFIG_WLAN, but no luck.
>> You don't want integration, so I think you can ignore that page.
>>
>> johannes
>

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

end of thread, other threads:[~2017-12-12 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-02  0:44 Cross-compiling wifi driver on Android Remington Furman
2017-12-02  8:08 ` Johannes Berg
2017-12-02 16:31   ` Remington Furman
2017-12-02 20:28     ` Johannes Berg
2017-12-12 14:38     ` Remington Furman

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.