Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
diblOffline
Post subject: [SOLVED] Realtek driver for Belkin n300 USB wireless  PostPosted: 23.07.2011, 21:29



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
I believe this is the module needed for my Belkin n300 Micro USB wireless adapter. Following the manual, I have installed firmware-realtek and confirmed it:

      Code:
# ls /lib/firmware/RTL8192SU
rtl8192sfw.bin

However, I see this problem:

      Code:
# modprobe r8192s_usb
FATAL: Module r8192s_usb not found.


Is there more to know?

System info:
      Code:
root@ambucsbox:/home/demouser# infobash -v3
Host/Kernel/OS  "ambucsbox" running Linux 3.0-0.slh.3-aptosid-686 i686 [ aptosid 2011-02 Ἡμέρα - kde-lite - (201107131633) ]                                                                                                               
CPU Info        Intel Pentium 4 512 KB cache flags( sse2 ht ) clocked at [ 2659.667 MHz ]                             
Videocard       Intel 82865G Integrated Graphics Controller  X.Org 1.10.2.902  [ 1600x900@60.0hz ]                   
Network cards   Intel 82540EM Gigabit                                                                                 
Processes 151 | Uptime 10min | Memory 341.4/1008.3MB | HDD WDC WD400BB-75FJ Size 40GB (14%used) | Client Shell | Infobash v3.36


USB Adapter:

      Code:
# lsusb                                                                                 
.
.
Bus 001 Device 002: ID 050d:2103 Belkin Components
.


Thanks!


Last edited by dibl on 26.07.2012, 16:27; edited 4 times in total
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slhOffline
Post subject: RE: Realtek module r8192s_usb  PostPosted: 23.07.2011, 21:47



Joined: 2010-08-25
Posts: 758

Status: Offline
rtl8192su/ r8192s_usb has been replaced by r8712u, which covers the same set of devices. The required firmware however is not rtl8192sfw.bin, but "200fd952db3cc9259b1fd05e3e51966f */lib/firmware/rtlwifi/rtl8712u.bin", which is provided by firmware-realtek as well.

Your device ID seems to be unknown so far and isn't covered by any driver yet. You can try if it is an rtl8192su device, but chances are rather small:
      Code:
# modprobe r8712u
# echo -n "050d 2103" > /sys/bus/usb/drivers/r8712u/new_id
(you may also try rtl8192cu, which is a different USB chipset produced by RealTek; unload r8712u before trying this one or better reboot).
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 23.07.2011, 22:24



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Thanks for the quick reply!

Unfortunately, I'm not finding a wlan0 with ceni, with r8712u or rtl8192cu. Probably the hardware is too new.

But thank you for the advice.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slhOffline
Post subject:   PostPosted: 23.07.2011, 22:34



Joined: 2010-08-25
Posts: 758

Status: Offline
The most important aspect would be to determine which chipset we're really talking about (RealTek alone produces at least four different 802.11n/ usb wlan chipsets) - be it by looking through the web (the windows drivers, *.inf in particular, are often revealing) or by physical inspection.
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 24.07.2011, 01:17



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
The adapter is this: http://www.belkin.com/IWCatProductPage. ... _Id=544005

I find the Windows driver here: http://en-us-support.belkin.com/app/ans ... r---driver

I opened it with okteta and I see many citations of "rtl8192cu", for example "WinXP/net8192.sysPK" but honestly I am way far over my head with such stuff.

I also see 88_92_cu referenced for Win 7 .... Confused
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slhOffline
Post subject:   PostPosted: 24.07.2011, 07:37



Joined: 2010-08-25
Posts: 758

Status: Offline
rtl8192cu would be good, are you sure that
      Code:
# modprobe rtl8192cu
# echo -n "050d 2103" > /sys/bus/usb/drivers/rtl8192cu/new_id
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 24.07.2011, 11:47



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Trying again with fresh eyes. This morning, after a reboot, I tried again with rtl8192cu, and triggered a crash:

http://pastebin.com/ppZJ0GmU

I'll see if I can repeat that.

I seem to see different messages when I boot with the Belkin adapter plugged in at boot time, versus when I hotplug it and then work with it. Maybe I can get something useful out of dmesg. This hardware is pretty old (Dell Optiplex GX270 from ~2003/4), so it may be less than 100% solid, even though it passes basic tests.

EDIT: The kernel oops is absolutely repeatable. The modprobe works fine, lsmod shows it loaded. But the echo line crashes it. I'm putting the module in /etc/modules and we'll see if it is successfully loaded at boot.

EDIT #2: I don't think the "echo" command is actually changing the intended file. After loading module (at 8:09), but before issuing the command, I changed to that directory and took a look, then I ran the command (at 8:13), which hung the shell, so I issued Ctrl-C, and then took another look:


      Code:
root@ambucsbox:/sys/bus/usb/drivers/rtl8192cu# ls
bind  module  new_id  remove_id  uevent  unbind
root@ambucsbox:/sys/bus/usb/drivers/rtl8192cu# echo -n ""050d 2103" > new_id
> ^C
root@ambucsbox:/sys/bus/usb/drivers/rtl8192cu# ls -la
total 0
drwxr-xr-x 2 root root    0 Jul 24 08:04 .
drwxr-xr-x 6 root root    0 Jul 24 08:04 ..
--w------- 1 root root 4096 Jul 24 08:09 bind
lrwxrwxrwx 1 root root    0 Jul 24 08:09 module -> ../../../../module/rtl8192cu
--w------- 1 root root 4096 Jul 24 08:09 new_id
--w------- 1 root root 4096 Jul 24 08:09 remove_id
--w------- 1 root root 4096 Jul 24 08:04 uevent
--w------- 1 root root 4096 Jul 24 08:09 unbind
root@ambucsbox:/sys/bus/usb/drivers/rtl8192cu#


But no kernel oops happened in this case. I tried a second time with "ls -la" before the echo command, but that time it did oops when I issued the echo command. It looks like the permissions on the files in that directory are a problem for root to make changes.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DeepDayzeOffline
Post subject:   PostPosted: 24.07.2011, 14:44



Joined: 2010-09-11
Posts: 616
Location: USA
Status: Offline
what if you added the PCI ID to the device driver's header and recompiled it?
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 24.07.2011, 15:10



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
      DeepDayze wrote:
what if you added the PCI ID to the device driver's header and recompiled it?


That sounds promising -- also sounds like something I have not done before. Can you point to some guidance for me?

Thanks.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DeepDayzeOffline
Post subject:   PostPosted: 24.07.2011, 23:57



Joined: 2010-09-11
Posts: 616
Location: USA
Status: Offline
      dibl wrote:
      DeepDayze wrote:
what if you added the PCI ID to the device driver's header and recompiled it?


That sounds promising -- also sounds like something I have not done before. Can you point to some guidance for me?

Thanks.


I haven't had to add an ID to a driver but you'd need to download the kernel source package that matches the kernel you have and edit the source code for the driver. Usually there's a declaration at the top with something like "pci_ids" or similar. You add an entry to this declaration that corresponds to the device ID you want to add and then recompile. I am sure you can recompile a single driver and not the whole kernel tree...as I am not a kernel expert so someone like slh can chime in on this.

The relevant section is in /usr/src/linux/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c:

      Code:

#define USB_VENDER_ID_REALTEK           0x0bda
 
/* 2010-10-19 DID_USB_V3.4 */
static struct usb_device_id rtl8192c_usb_ids[] = {
 
         /*=== Realtek demoboard ===*/
         /* Default ID */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8191, rtl92cu_hal_cfg)},
 
         /****** 8188CU ********/
         /* 8188CE-VAU USB minCard */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8170, rtl92cu_hal_cfg)},
         /* 8188cu 1*1 dongle */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8176, rtl92cu_hal_cfg)},
         /* 8188cu 1*1 dongle, (b/g mode only) */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8177, rtl92cu_hal_cfg)},
         /* 8188cu Slim Solo */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817a, rtl92cu_hal_cfg)},
         /* 8188cu Slim Combo */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817b, rtl92cu_hal_cfg)},
         /* 8188RU High-power USB Dongle */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817d, rtl92cu_hal_cfg)},
         /* 8188CE-VAU USB minCard (b/g mode only) */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817e, rtl92cu_hal_cfg)},
         /* 8188 Combo for BC4 */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)},
 
         /****** 8192CU ********/
         /* 8191cu 1*2 */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8177, rtl92cu_hal_cfg)},
         /* 8192cu 2*2 */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817b, rtl92cu_hal_cfg)},
         /* 8192CE-VAU USB minCard */
         {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817c, rtl92cu_hal_cfg)},
 
         /*=== Customer ID ===*/
         /****** 8188CU ********/
         {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/
         {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
         {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
         {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
         {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
         {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
         /* HP - Lite-On ,8188CUS Slim Combo */
         {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)},
         {RTL_USB_DEVICE(0x2001, 0x3308, rtl92cu_hal_cfg)}, /*D-Link - Alpha*/
         {RTL_USB_DEVICE(0x2019, 0xab2a, rtl92cu_hal_cfg)}, /*Planex - Abocom*/
         {RTL_USB_DEVICE(0x2019, 0xed17, rtl92cu_hal_cfg)}, /*PCI - Edimax*/
         {RTL_USB_DEVICE(0x20f4, 0x648b, rtl92cu_hal_cfg)}, /*TRENDnet - Cameo*/
         {RTL_USB_DEVICE(0x7392, 0x7811, rtl92cu_hal_cfg)}, /*Edimax - Edimax*/
         {RTL_USB_DEVICE(0x3358, 0x13d3, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/
         /* Russian customer -Azwave (8188CE-VAU  b/g mode only) */
         {RTL_USB_DEVICE(0x3359, 0x13d3, rtl92cu_hal_cfg)},
 
        [b] /****** 8192CU ********/ <---- add your device's ID below[/b]
         {RTL_USB_DEVICE(0x0586, 0x341f, rtl92cu_hal_cfg)}, /*Zyxel -Abocom*/
         {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/
         {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
         {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Abocom -Abocom*/
         {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
         {RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
         {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
         {RTL_USB_DEVICE(0x2019, 0xab2b, rtl92cu_hal_cfg)}, /*Planex -Abocom*/
         {RTL_USB_DEVICE(0x7392, 0x7822, rtl92cu_hal_cfg)}, /*Edimax -Edimax*/
         {}
};
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 25.07.2011, 15:23



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
@DeepDayze, I'm suffering from "first-timeritis", I think. I downloaded the kernel source with:

      Code:
# apt-get source linux-image-3.0-0.slh.3-aptosid-686


It appears to have been installed under /usr/src/linux-headers-3.0-0.slh.3-aptosid-686/. Under that directory is what I assume we refer to as the "kernel tree" -- long list of subdirectories and 4 files. Under the subdirectory "drivers" I can find the /net/wireless/rtlwifi/rtl8192cu path that you showed. But, when I take a look in that folder, there is no "sw.c" file, there is only "Makefile". So, what do I still not know?

Thank you.

Edit: "make" outputs an error that says "*** No targets. Stop"
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
DeepDayzeOffline
Post subject:   PostPosted: 25.07.2011, 16:21



Joined: 2010-09-11
Posts: 616
Location: USA
Status: Offline
I'm not sure if you can compile a single driver, perhaps slh or someone who's a kernel expert can chime in and assist
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 26.07.2011, 18:26



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Progress today. Working with this information, it appears the correct driver to load is r8192u_usb. With that module loaded, the following sets the ID:

      Code:
# echo -n "050d 2103" > /sys/bus/usb/drivers/rtl819xU/new_id


Afterward, wlan1 (the Belkin USB device)is found by ceni, and I can begin to configure it. However, something is still not configured correctly -- at the end of the "roam" process, wpa_supplicant gives this

      Code:
Configuring interface wlan1=wlan1 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wait for wpa_cli to attach
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: using debug level: 1
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan1.pid -i wlan1 -W -D nl80211,wext -t -d -c /etc/wpa_supplicant/wpa-roam.conf
Starting /sbin/wpa_supplicant...
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/ntpdate
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/samba
run-parts: executing /etc/network/if-up.d/wpasupplicant
wpa_supplicant: /sbin/wpa_cli -B -P /var/run/wpa_action.wlan1.pid -i wlan1 -p /var/run/wpa_supplicant -a /sbin/wpa_action
Starting /sbin/wpa_cli...
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
wpa_supplicant: /sbin/wpa_cli daemon failed to start
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1

Press Enter key to continue ...
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slhOffline
Post subject:   PostPosted: 26.07.2011, 19:28



Joined: 2010-08-25
Posts: 758

Status: Offline
r8192u_usb is possible, but not very likely for a brand-new device. Before trying to get a connection, please try (assuming wlan1 is your device):
      Code:
# ifconfig wlan1 up
# iwlist wlan1 channel
# iwlist wlan1 scan
Your device may be similar to r8192u_usb, but is not necessarily compatible with it (and a staging driver is already bad news to begin with). Trying to debug the connection further only makes sense, if you can at least scan and find your AP successfully. Messages from dmesg (at least the part after you told r8192u_usb about the new IDs) would also be interesting.
 
 View user's profile Send private message  
Reply with quote Back to top
diblOffline
Post subject:   PostPosted: 26.07.2011, 19:41



Joined: 2010-09-12
Posts: 302
Location: Dayton, Ohio, USA
Status: Offline
Thanks. Yes, your first command shows a problem:

      Code:
root@ambucsbox:~# ifconfig wlan1 up
SIOCSIFFLAGS: Resource temporarily unavailable
root@ambucsbox:~# iwlist wlan1 channel
wlan1     11 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
root@ambucsbox:~# iwlist wlan1 scan
wlan1     Interface doesn't support scanning : Network is down

root@ambucsbox:~# ifup wlan1
ifup: interface wlan1 already configured
root@ambucsbox:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan1     802.11b/g/n  Mode:Managed  Access Point: Not-Associated   
          Bit Rate:1 Mb/s   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


I'm going to take a look at dmesg.

EDIT: The early part of dmesg show the USB device found:

      Code:
[    1.738026] Switching to clocksource tsc
[    1.790635] usb 4-4: New USB device found, idVendor=050d, idProduct=2103
[    1.790639] usb 4-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.790642] usb 4-4: Product: Belkin Wireless Adapter
[    1.790645] usb 4-4: Manufacturer: Realtek
[    1.790647] usb 4-4: SerialNumber: 00e04c000001


but later comes bad news:

      Code:
[  127.391911] rtl819xU:EEPROM ID is invalid(is 0x0(should be 0x8129)
[  127.391915]
[  127.391920] Dot11d_Init()
[  127.391924] End of initendpoints
[  127.415162] udevd[696]: renamed network interface wlan0 to wlan1
[  127.680011] rtl819xU:====>error=====dwRegRead: eaeaeaea, WriteData: fffff027
[  127.680014]
[  127.680017] rtl819xU:PHY_RF8256_Config():Check PHY0 Fail!!
[  127.680019]
[  153.844471] rtl819xU:ERR in CPUcheck_maincodeok_turnonCPU()
[  153.844475]
[  153.844478] rtl819xU:CPUcheck_maincodeok_turnonCPU fail!
[  153.844479]
[  153.844481] rtl819xU:ERR in init_firmware()
[  153.844482]
[  153.844485] rtl819xU:ERR!!! rtl8192_adapter_start(): Firmware download is failed
[  153.844487]
[  153.844489] rtl819xU:ERR!!! _rtl8192_up(): initialization is failed!
[  153.844491]
[  473.160697] exe (4836): /proc/4836/oom_adj is deprecated, please use /proc/4836/oom_score_adj instead.
[  538.503200] rtl819xU:====>error=====dwRegRead: eaeaeaea, WriteData: fffff027
[  538.503203]
[  538.503207] rtl819xU:PHY_RF8256_Config():Check PHY0 Fail!!
[  538.503209]
[  564.801583] rtl819xU:ERR in CPUcheck_maincodeok_turnonCPU()
[  564.801586]
[  564.801589] rtl819xU:CPUcheck_maincodeok_turnonCPU fail!
[  564.801591]
[  564.801593] rtl819xU:ERR in init_firmware()
[  564.801594]
[  564.801597] rtl819xU:ERR!!! rtl8192_adapter_start(): Firmware download is failed
[  564.801598]
[  564.801601] rtl819xU:ERR!!! _rtl8192_up(): initialization is failed!
[  564.801602]


I guess the firmware is not even loading.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio