1 (edited by sowmyabr 2015-06-09 06:07:13)

Topic: realtek usb to ethernet connection issue

Hello all,

We are working on openwrt tl-mr3420 platform, version 2.0. Our requirement is to set up the board to support lan (internet) connetivity using USB to LAN adapter.

When we plug the device to the USB port, it is detecting as a USB device and not registering to the cdc-ether.

These are the packages I have installed for net configuration:

  • kmod-usb-net

  • kmod-usb-net-cdc-ether

  • kmod-usb-serial

  • kmod-usb-serial-option

  • kmod-usb-serial-wwan

  • kmod-cdc-acm

Still the device is not getting detected.
We have googled it but in no result.

We followed these links:
https://forum.openwrt.org/viewtopic.php?id=55691
https://github.com/openwrt/bcm63xx-next … dc_ether.c


And also we tried to get the kernel source from git by follows this page.
http://wiki.openwrt.org/doc/howto/buildroot.exigence

cdc_ether.c is for broadcom platform and realtek is blacklisted in that file.
But the same file we tried to check in AR71xx but ther is no ar71xx platform folder containing drivers.

Please help us in fixing this iisue as this is critical in our requirement.

Regards,
Sowmya

2 (edited by zloop 2015-06-09 09:09:00)

Re: realtek usb to ethernet connection issue

cdc_ether.c is for broadcom platform and realtek is blacklisted in that file.

from that cdc_ether file there is a comment

/* BLACKLIST !!
 *
 * First blacklist any products that are egregiously nonconformant
 * with the CDC Ethernet specs.  Minor braindamage we cope with; when
 * they're not even trying, needing a separate driver is only the first
 * of the differences to show up.
 */

The following lines should add the 2 realtek USB-Ethernet modules to OpenWrt:
(in packages/linux/modules/usb.mk)

define KernelPackage/usb-net-rtl8150
  TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
  KCONFIG:=CONFIG_USB_RTL8150
  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko
  AUTOLOAD:=$(call AutoProbe,rtl8150)
  $(call AddDepends/usb-net)
endef

define KernelPackage/usb-net-rtl8150/description
 Kernel module for USB-to-Ethernet Realtek 8150 convertors
endef

$(eval $(call KernelPackage,usb-net-rtl8150))


define KernelPackage/usb-net-rtl8152
  TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
  KCONFIG:=CONFIG_USB_RTL8152
  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
  AUTOLOAD:=$(call AutoProbe,r8152)
  $(call AddDepends/usb-net)
endef

define KernelPackage/usb-net-rtl8152/description
 Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors
endef

$(eval $(call KernelPackage,usb-net-rtl8152))

Pls test if this works for you and I can send a patch to the mailing list to add this feature.

V2: corrected KCONFIG symbols

Re: realtek usb to ethernet connection issue

Hi Zloop,

Thanks for the reply.
But there is no linux folder under openwrt/packages

We have openwrt/package/linux-atm  sad

Do I have to update the firmware?

BR,
Sowmya

Re: realtek usb to ethernet connection issue

Update:

usb.mk file is located in openwrt/package/kernel/modules/ .
Do I have to add the mentioned lines in this file and recompile?

Regards,
Sowmya

5 (edited by zloop 2015-06-09 09:13:26)

Re: realtek usb to ethernet connection issue

Yes - add that to the usb.mk file in openwrt/package/kernel/modules

After that you should be able to select the 2 modules in make menuconfig

I corrected an error in the post above

Re: realtek usb to ethernet connection issue

Hi zloop,

I did as you told, but I am not getting the options to select the modules.
Do I have to compile?

7 (edited by zloop 2015-06-09 10:57:35)

Re: realtek usb to ethernet connection issue

are you sure you are looking in the correct sub menu ?

I prepared a screenshot of my environment that has this module after I added it and then ran "make menuconfig": http://imgur.com/u6ZrPgJ

Edit: you can search for these modules too

Edit2: building for x86 target works
kmod-usb-net-rtl8150_3.18.14-1_x86.ipk
kmod-usb-net-rtl8152_3.18.14-1_x86.ipk
are created

Re: realtek usb to ethernet connection issue

Yes I am searching in the usb support sub menu. But I am not getting the option for realtek modules.

Re: realtek usb to ethernet connection issue

post the complete usb.mk to a pastebin and link it here

Re: realtek usb to ethernet connection issue

Check the following link for usb.mk file :
http://pastebin.com/DP0NMGi9

Re: realtek usb to ethernet connection issue

- You seem to use an older version of usb.mk : are you using BB ?
The patch/added lines work fine in Trunk (CC)

- your usb.mk file seem to be broken
DOS line endings - might be an issue with the pastebin

Maybe you forgot to select kmod-usb-net first?
Since all usb-net packages depend on that

I see those modules with:
- I replaced my usb.mk with your file.
- I changed the line endings to UNIX
- make menuconfig
- select kmod-usb-net
- "kmod-usb-net-rtl8152" + the other one are selectable in my buildroot (trunk)

Re: realtek usb to ethernet connection issue

Now I selected kmod-usb-net package and I am able to select rtl8152 device.
Before I used to install packages through commands.

Okay now I will compile the kernel and get back to you.
Thanks a lot.

BR,
Sowmya

Re: realtek usb to ethernet connection issue

I'm also trying to setup an RTL8153 USB to LAN adapter but for the Raspi1B+ with CC.

Can someone help me to compile the driver or does someone got a link?
I can login with ssh but never build a driver before and only used precompiled packages.