Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Mar 2011 11:00:26 -0500
From:      Etienne Robillard <erob@gthcfoundation.org>
To:        bschmidt@freebsd.org
Cc:        freebsd-current@freebsd.org
Subject:   RE: urtw0: could not allocate USB transfers
Message-ID:  <4D6E699A.2020405@gthcfoundation.org>
In-Reply-To: <201102251331.37589.bschmidt@freebsd.org>
References:  <4D66C4CB.1060207@2egos.de> <201102251218.12664.bschmidt@freebsd.org> <4D6796C0.6040402@gthcfoundation.org> <201102251331.37589.bschmidt@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/25/2011 07:31, Bernhard Schmidt wrote:
> On Friday, February 25, 2011 12:47:12 Etienne Robillard wrote:
>    
>> On 25/02/11 06:18 AM, Bernhard Schmidt wrote:
>>      
>>> On Friday, February 25, 2011 11:03:04 Etienne Robillard wrote:
>>>
>>>        
>>>> On 25/02/11 04:11 AM, Bernhard Schmidt wrote:
>>>>
>>>>          
>>>>> On Thursday, February 24, 2011 21:51:23 joseph wrote:
>>>>>
>>>>>
>>>>>            
>>>>>> Hello,
>>>>>>
>>>>>> i decided to get my laptop wlan via usb because my internal device isn't
>>>>>> supported yet.
>>>>>> The usb device is a logilink WL0006 unit its vendorid is 0x0bda and the
>>>>>> productid says 0x8187.
>>>>>> My search results say that this device depends on a RTL8187 chipset.
>>>>>> I tried both, load the kernel module at boot time and compile kernel
>>>>>> withe urtw, but i get the same output at dmesg
>>>>>>
>>>>>> device_attach: urtw0 attach returned 6
>>>>>> urtw0:<vendor 0x0bda product 0x8187, class 0/0, rev 2.00/2.00, addr 2>
>>>>>> on usbus3
>>>>>> urtw0: could not allocate USB transfers, err=USB_ERR_NO_PIPE
>>>>>> device_attach: urtw0 attach returned 6
>>>>>>
>>>>>> im running FreeBSD 8.1-RELEASE-p2 amd64.
>>>>>>
>>>>>> What might be the reason for this error?
>>>>>> Thanks for all hints.
>>>>>>
>>>>>>
>>>>>>              
>>>>> Well, I have no clue about USB.. but this smells like one of the
>>>>> endpoints is 'not there'. At least I can't find any reference to
>>>>> it in the Linux driver. Wanna give attached patch a shot?
>>>>>
>>>>>
>>>>>            
>>>> Hi Bernard,
>>>>
>>>> For rt287x based cards, you can try using rt28700 chipset instead of
>>>> urtw0 on
>>>> FreeBSD 8.
>>>>
>>>> The former is not in the stable src tree, but could be retrieved from here:
>>>>
>>>> https://gthc.org/distfiles/freebsd/rt2870_fbsd8.tar.gz
>>>>
>>>> Any takers to make module rt28700 (if_rt2870) officially part of the
>>>> FreeBSD src tree?
>>>>
>>>>          
>>> I'm a bit confused now, shouldn't the rt2870 be supported by run(4)? On
>>> a site-note, this is Ralink chipset not a Realtek one.
>>>
>>>
>>>        
>> I believe this is a different implementation for RT8187 usb network
>> adapters than
>> run(4). However in my view I found urtw0 buggy, but would certainly take
>> a look at run(4) to
>> compare the results with wireless networking agaisnt the other driver
>> (rt28700).
>>      
> Yeah, urtw(4) has a few flaws..
>
> - urtw(4): Realtek RTL8187B/RTL8187L
> - rum(4): Ralink RT2501/RT2601
> - run(4): Ralink RT2700/RT2800/RT3000
>
> So it seems the driver you've posted conflicts with run(4). From a
> quick glance at it, it seems to support 11n? If so, can I talk you
> into working on getting those bits merged?
> Thanks!
>
> --
> Bernhard
> X-UID: 10549
> Status:
> X-Keywords:
> Content-Length: 0
>
>    
I forwarded this thread on -current.

Please also find below a stack trace produced with option KDB_UNATTENDED
for the rt28700 driver (if_rt28700).

On another side note, I have not being able to load
the runfw firmware module anymore after having updated
the src tree for 8.2-STABLE ?

$ sudo kldload /boot/kernel/runfw.ko
kldload: can't load /boot/kernel/runfw.ko: Exec format error

$ objdump -x /boot/kernel/runfw.ko

/boot/kernel/runfw.ko:     file format elf64-x86-64
/boot/kernel/runfw.ko
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000

Sections:
Idx Name          Size      VMA               LMA               File 
off  Algn
   0 .text         00000056  0000000000000000  0000000000000000  
00000040  2**4
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .rodata.str1.1 0000001f  0000000000000000  0000000000000000  
00000096  2**0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   2 set_modmetadata_set 00000020  0000000000000000  0000000000000000  
000000b8  2**3
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
   3 set_sysinit_set 00000008  0000000000000000  0000000000000000  
000000d8  2**3
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
   4 .data         000020d4  0000000000000000  0000000000000000  
000000e0  2**4
                   CONTENTS, ALLOC, LOAD, RELOC, DATA
   5 .bss          00000000  0000000000000000  0000000000000000  
000021b4  2**2
                   ALLOC
   6 .comment      00000026  0000000000000000  0000000000000000  
000021b4  2**0
                   CONTENTS, READONLY
SYMBOL TABLE:
0000000000000000 l    d  .text  0000000000000000
0000000000000000 l    d  .rodata.str1.1 0000000000000000
0000000000000000 l    d  .data  0000000000000000
0000000000000000 l     F .text  0000000000000056 runfw_fw_modevent
0000000000000000 l     O set_modmetadata_set    0000000000000008 
__set_modmetadata_set_sym__mod_metadata_md_runfw_fw_on_firmware
0000000000002000 l     O .data  0000000000000018 
_mod_metadata_md_runfw_fw_on_firmware
0000000000000008 l     O set_modmetadata_set    0000000000000008 
__set_modmetadata_set_sym__mod_metadata_runfw_fw_version
0000000000002020 l     O .data  0000000000000018 
_mod_metadata_runfw_fw_version
0000000000000000 l     O set_sysinit_set        0000000000000008 
__set_sysinit_set_sym_runfw_fwmodule_sys_init
0000000000002040 l     O .data  0000000000000018 runfw_fwmodule_sys_init
0000000000000010 l     O set_modmetadata_set    0000000000000008 
__set_modmetadata_set_sym__mod_metadata_md_runfw_fw
0000000000002060 l     O .data  0000000000000018 _mod_metadata_md_runfw_fw
0000000000000018 l     O set_modmetadata_set    0000000000000008 
__set_modmetadata_set_sym__mod_metadata_md_runfw_fw_on_kernel
0000000000002080 l     O .data  0000000000000018 
_mod_metadata_md_runfw_fw_on_kernel
0000000000002098 l     O .data  000000000000000c 
_runfw_fw_depend_on_firmware
00000000000020a4 l     O .data  0000000000000004 _runfw_fw_version
00000000000020b0 l     O .data  0000000000000018 runfw_fw_mod
00000000000020c8 l     O .data  000000000000000c _runfw_fw_depend_on_kernel
0000000000002000 l       .data  0000000000000000 _binary_runfw_end
0000000000000000 l       .data  0000000000000000 _binary_runfw_start
0000000000000000 l    d  set_modmetadata_set    0000000000000000
0000000000000000 l    d  set_sysinit_set        0000000000000000
0000000000000000 l    d  .bss   0000000000000000
0000000000000000 l    d  .comment       0000000000000000
0000000000000000         *UND*  0000000000000000 firmware_register
0000000000000000         *UND*  0000000000000000 module_register_init
0000000000002000 g       *ABS*  0000000000000000 _binary_runfw_size
0000000000000000         *UND*  0000000000000000 firmware_unregister


RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE
000000000000000b R_X86_64_32S      _binary_runfw_end
000000000000001a R_X86_64_32S      _binary_runfw_start
0000000000000021 R_X86_64_32S      _binary_runfw_start
0000000000000028 R_X86_64_32S      .rodata.str1.1
000000000000002d R_X86_64_PC32     firmware_register+0xfffffffffffffffc
000000000000004d R_X86_64_32S      .rodata.str1.1
0000000000000052 R_X86_64_PC32     firmware_unregister+0xfffffffffffffffc


RELOCATION RECORDS FOR [set_modmetadata_set]:
OFFSET           TYPE              VALUE
0000000000000000 R_X86_64_64       .data+0x0000000000002000
0000000000000008 R_X86_64_64       .data+0x0000000000002020
0000000000000010 R_X86_64_64       .data+0x0000000000002060
0000000000000018 R_X86_64_64       .data+0x0000000000002080


RELOCATION RECORDS FOR [set_sysinit_set]:
OFFSET           TYPE              VALUE
0000000000000000 R_X86_64_64       .data+0x0000000000002040


RELOCATION RECORDS FOR [.data]:
OFFSET           TYPE              VALUE
0000000000002008 R_X86_64_64       .data+0x0000000000002098
0000000000002010 R_X86_64_64       .rodata.str1.1+0x0000000000000006
0000000000002028 R_X86_64_64       .data+0x00000000000020a4
0000000000002030 R_X86_64_64       .rodata.str1.1+0x000000000000000f
0000000000002048 R_X86_64_64       module_register_init
0000000000002050 R_X86_64_64       .data+0x00000000000020b0
0000000000002068 R_X86_64_64       .data+0x00000000000020b0
0000000000002070 R_X86_64_64       .rodata.str1.1+0x000000000000000f
0000000000002088 R_X86_64_64       .data+0x00000000000020c8
0000000000002090 R_X86_64_64       .rodata.str1.1+0x0000000000000018
00000000000020b0 R_X86_64_64       .rodata.str1.1+0x000000000000000f
00000000000020b8 R_X86_64_64       .text

$ dmesg
Waiting on "WCTRL" with the following non-sleepable locks held:
exclusive sleep mutex rt28700_com_loc (rt28700_com_loc) r = 0 
(0xffffff8001458018) locked @ net80211/ieee80211_node.c:653
KDB: stack backtrace:
#0 0xffffffff804e0da0 at kdb_backtrace+0x60
#1 0xffffffff804effec at _witness_debugger+0x2c
#2 0xffffffff804f1672 at witness_warn+0x322
#3 0xffffffff8047a85d at _cv_wait+0x6d
#4 0xffffffff80400e73 at usbd_do_request_flags+0x4f3
#5 0xffffffff810220cb at rt2870_io_vendor_req+0x9b
#6 0xffffffff81022232 at rt2870_io_mac_write_multi+0x52
#7 0xffffffff810222ac at rt2870_io_mac_write+0x1c
#8 0xffffffff81026fd7 at rt2870_newassoc+0x1d7
#9 0xffffffff805893d2 at sta_newstate+0x5a2
#10 0xffffffff8102da7d at rt2870_vap_newstate+0x4d
#11 0xffffffff805817a1 at ieee80211_newstate_cb+0x161
#12 0xffffffff804eb6b7 at taskqueue_run_locked+0xb7
#13 0xffffffff804eb7a0 at taskqueue_thread_loop+0x50
#14 0xffffffff804906d5 at fork_exit+0x115
#15 0xffffffff8064bc4e at fork_trampoline+0xe
t_delta 15.fd86ccdfed384c60 too short
KLD runfw.ko: depends on firmware - not available or version mismatch
linker_load_file: Unsupported file type


$ uname -a
FreeBSD marina.localdomain 8.2-STABLE FreeBSD 8.2-STABLE #7: Wed Mar  2 
08:43:21 EST 2011     
root@marina.localdomain:/usr/local/freebsd8/src/sys/amd64/compile/GENERIC.d  
amd64

$ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
         ether 00:00:00:00:00:00
         inet 192.168.0.101 netmask 0xffffff00 broadcast 192.168.0.255
         media: IEEE 802.11 Wireless Ethernet<unknown subtype>
         status: associated
         ssid dlink2 channel 2 (2417 MHz 11g ht/40+) bssid 00:00:00:00:00:00
         country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
         bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 64
         protmode CTS ampdulimit 64k ampdudensity 8 shortgi smps wme burst

$ cat /sys/amd64/conf/GENERIC.d | grep option
# An exhaustive list of options and more detailed explanations of the
makeoptions    DEBUG=-g        # Build kernel with gdb(1) debug symbols
options     SCHED_ULE        # ULE scheduler
options     PREEMPTION        # Enable kernel thread preemption
options     INET            # InterNETworking
#options     INET6            # IPv6 communications protocols
#options     SCTP            # Stream Control Transmission Protocol
options     FFS            # Berkeley Fast Filesystem
options     SOFTUPDATES        # Enable FFS soft updates support
options     UFS_ACL            # Support for access control lists
options     UFS_DIRHASH        # Improve performance on big directories
options     UFS_GJOURNAL        # Enable gjournal-based UFS journaling
options     MD_ROOT            # MD is a potential root device
options     NFSCLIENT        # Network Filesystem Client
#options     NFSSERVER        # Network Filesystem Server
#options     NFSLOCKD        # Network Lock Manager
options     NFS_ROOT        # NFS usable as /, requires NFSCLIENT
options     MSDOSFS            # MSDOS Filesystem
options     CD9660            # ISO 9660 Filesystem
options     PROCFS            # Process filesystem (requires PSEUDOFS)
options     PSEUDOFS        # Pseudo-filesystem framework
options     GEOM_PART_GPT        # GUID Partition Tables.
options     GEOM_LABEL        # Provides labelization
options     COMPAT_43TTY        # BSD 4.3 TTY compat (sgtty)
options     COMPAT_FREEBSD32    # Compatible with i386 binaries
options     COMPAT_FREEBSD4        # Compatible with FreeBSD4
options     COMPAT_FREEBSD5        # Compatible with FreeBSD5
options     COMPAT_FREEBSD6        # Compatible with FreeBSD6
options     COMPAT_FREEBSD7        # Compatible with FreeBSD7
options     SCSI_DELAY=8000        # Delay (in ms) before probing SCSI
options     KTRACE            # ktrace(1) support
options     STACK            # stack(9) support
options     SYSVSHM            # SYSV-style shared memory
options     SYSVMSG            # SYSV-style message queues
options     SYSVSEM            # SYSV-style semaphores
options     P1003_1B_SEMAPHORES    # POSIX-style semaphores
options     _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
options     PRINTF_BUFR_SIZE=128    # Prevent printf output being 
interspersed.
options     KBD_INSTALL_CDEV    # install a CDEV entry in /dev
options     HWPMC_HOOKS        # Necessary kernel hooks for hwpmc(4)
options     AUDIT            # Security event auditing
options     MAC            # TrustedBSD MAC Framework
options     FLOWTABLE        # per-cpu routing cache
options     KDTRACE_FRAME        # Ensure frames are compiled in
options     KDTRACE_HOOKS        # Kernel DTrace hooks
options     INCLUDE_CONFIG_FILE     # Include this file in kernel
options     KDB            # Kernel debugger related code
#options     KDB_TRACE        # Print a stack trace for a panic
options        KDB_UNATTENDED
options        DEADLKRES        # deadlock resolver (NEW)
options        WITNESS            # enables debugging of mutexes
options     SMP            # Symmetric MultiProcessor Kernel
options     ATA_STATIC_ID    # Static device numbering
options     AHC_REG_PRETTY_PRINT    # Print register bitfields in debug
options     AHD_REG_PRETTY_PRINT    # Print register bitfields in debug
#device        dpt        # DPT Smartcache III, IV - See NOTES for options
options     IEEE80211_DEBUG    # enable debug msgs
#options     IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
#options     IEEE80211_SUPPORT_MESH    # enable 802.11s draft support
#options     AH_SUPPORT_AR5416    # enable AR5416 tx/rx descriptors
options     USB_DEBUG    # enable debug msgs


so for me using the run(4) driver would be acceptable solution however as
the rt28700 driver doesn't depends on a firmware module, I have no choice
currently to stick with the former rt28700 driver. I notice however that 
there's
still some random page faults occuring with the run(4) module, but are 
non-fatal
with option KDB_UNATTENDED... :)

Cheers!

Etienne






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D6E699A.2020405>