Wireless usb + wep = no usbd_do_request

View: New views
4 Messages — Rating Filter:   Alert me  

Wireless usb + wep = no usbd_do_request

by PseudoCylon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm porting a wireless usb driver (if_run) to freebsd current, and I got stuck. Once I "ifconfig wlan0 wepkey 1:0x... weptxkey 1" I cannot call usbd_do_request() any more. Even ifconfig didn't exit. Chipset supports h/w en/decryption, so cannot write keys on chip. (It works without encryption, by the way.)

So, I tried the same thing on another device, linksys wusb54gc with if_rum. It worked fine, but about 3 to 4 min later. (Just left it alone.) It started giving error
rum0: could not multi read MAC register: USB_ERR_TIMEOUT and
rum0: device timeout
when ifconfig wlan0 down,
rum0: could not multi write MAC register: USB_ERR_TIMEOUT
which means failed on usbd_do_request() (This could be totally different issue.)

Any ideas, patches, or walkaround?


More info
#uname -a
FreeBSD  9.0-CURRENT FreeBSD 9.0-CURRENT #1 r198150M: Fri Oct 16 22:44:08 UTC 2009 amd64

ddb trace output 20+ minutes after "ifconfig wepkey" (using if_run)
Tracing command ifconfig pid 1586 tid 100159 td 0xffffff000b3d3a80
sched_switch() at sched_switch+0x180
mi_switch() at mi_switch+0x21d
sleepq_switch() at sleepq_switch+0x123
sleepq_wait() at sleepq_wait+0x4d
_sleep() at _sleep+0x357
taskqueue_drain() at taskqueue_drain+0xc2
ieee80211_waitfor_parent() at ieee80211_waitfor_parent+0x3e
ieee80211_ioctl() at ieee80211_ioctl+0x162
ifioctl() at ifioctl+0xde4
kern_ioctl() at kern_ioctl+0xc5
ioctl() at ioctl+0xfd
syscall() at syscall+0x1af
Xfast_syscall() at Xfast_syscall+0xe1

Also, sleep mutex became spin mutex. I get a panic
panic: mtx_lock of spin mutex(null)
It works fine before ifconfig wepkey.


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: Wireless usb + wep = no usbd_do_request

by Paul B Mahol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/3/09, PseudoCylon <moonlightakkiy@...> wrote:

> Hi,
>
> I'm porting a wireless usb driver (if_run) to freebsd current, and I got
> stuck. Once I "ifconfig wlan0 wepkey 1:0x... weptxkey 1" I cannot call
> usbd_do_request() any more. Even ifconfig didn't exit. Chipset supports h/w
> en/decryption, so cannot write keys on chip. (It works without encryption,
> by the way.)
>
> So, I tried the same thing on another device, linksys wusb54gc with if_rum.
> It worked fine, but about 3 to 4 min later. (Just left it alone.) It started
> giving error
> rum0: could not multi read MAC register: USB_ERR_TIMEOUT and
> rum0: device timeout
> when ifconfig wlan0 down,
> rum0: could not multi write MAC register: USB_ERR_TIMEOUT
> which means failed on usbd_do_request() (This could be totally different
> issue.)

I get this one multiple times after card got detached but vap was not
manually destroyed.
Recently I did not used if_rum more that 5 min I think(maybe in AP
mode when I was testing hidden ssid ...)

> Any ideas, patches, or walkaround?

Make sure how locks are handled between net80211, usb and driver itself.

> More info
> #uname -a
> FreeBSD  9.0-CURRENT FreeBSD 9.0-CURRENT #1 r198150M: Fri Oct 16 22:44:08
> UTC 2009 amd64
>
> ddb trace output 20+ minutes after "ifconfig wepkey" (using if_run)
> Tracing command ifconfig pid 1586 tid 100159 td 0xffffff000b3d3a80
> sched_switch() at sched_switch+0x180
> mi_switch() at mi_switch+0x21d
> sleepq_switch() at sleepq_switch+0x123
> sleepq_wait() at sleepq_wait+0x4d
> _sleep() at _sleep+0x357
> taskqueue_drain() at taskqueue_drain+0xc2
> ieee80211_waitfor_parent() at ieee80211_waitfor_parent+0x3e
> ieee80211_ioctl() at ieee80211_ioctl+0x162
> ifioctl() at ifioctl+0xde4
> kern_ioctl() at kern_ioctl+0xc5
> ioctl() at ioctl+0xfd
> syscall() at syscall+0x1af
> Xfast_syscall() at Xfast_syscall+0xe1
>
> Also, sleep mutex became spin mutex. I get a panic
> panic: mtx_lock of spin mutex(null)
> It works fine before ifconfig wepkey.

It is hard to tell without code example but wepkey works fine with
if_rum last time I tried, note that if_rum have done encryption in
software mode.
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: Wireless usb + wep = no usbd_do_request

by PseudoCylon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

----- Original Message ----

> From: Paul B Mahol <onemda@...>
> To: PseudoCylon <moonlightakkiy@...>
> Cc: freebsd-current@...
> Sent: Tue, November 3, 2009 5:08:47 AM
> Subject: Re: Wireless usb + wep = no usbd_do_request
>
> On 11/3/09, PseudoCylon wrote:
> > Hi,
> >
> > I'm porting a wireless usb driver (if_run) to freebsd current, and I got
> > stuck. Once I "ifconfig wlan0 wepkey 1:0x... weptxkey 1" I cannot call
> > usbd_do_request() any more. Even ifconfig didn't exit. Chipset supports h/w
> > en/decryption, so cannot write keys on chip. (It works without encryption,
> > by the way.)
> >
> > So, I tried the same thing on another device, linksys wusb54gc with if_rum.
> > It worked fine, but about 3 to 4 min later. (Just left it alone.) It started
> > giving error
> > rum0: could not multi read MAC register: USB_ERR_TIMEOUT and
> > rum0: device timeout
> > when ifconfig wlan0 down,
> > rum0: could not multi write MAC register: USB_ERR_TIMEOUT
> > which means failed on usbd_do_request() (This could be totally different
> > issue.)
>
> I get this one multiple times after card got detached but vap was not
> manually destroyed.
> Recently I did not used if_rum more that 5 min I think(maybe in AP
> mode when I was testing hidden ssid ...)
>
> > Any ideas, patches, or walkaround?
>
> Make sure how locks are handled between net80211, usb and driver itself.

Thanks for the reply.

I think that's just simple lock problem, too. Just I don't know what it is. I tried
IEEE80211_LOCK
IEEE80211_NODE_LOCK
IEEE80211_NODE_ITERATE_LOCK
but I cannot lock or unlock them. (I can lock IF_LOCK.) I just get "panic: mtx_lock of spin mutex(null)" For example, IEEE80211_LOCK is sleep mutex, and I can use it in newstate() no problem, but I some how it becomes spin mutex in key_set(). Once I find what is over writing lock type, I can make it work. Wish me a luck.

>
> > More info
> > #uname -a
> > FreeBSD  9.0-CURRENT FreeBSD 9.0-CURRENT #1 r198150M: Fri Oct 16 22:44:08
> > UTC 2009 amd64
> >
> > ddb trace output 20+ minutes after "ifconfig wepkey" (using if_run)
> > Tracing command ifconfig pid 1586 tid 100159 td 0xffffff000b3d3a80
> > sched_switch() at sched_switch+0x180
> > mi_switch() at mi_switch+0x21d
> > sleepq_switch() at sleepq_switch+0x123
> > sleepq_wait() at sleepq_wait+0x4d
> > _sleep() at _sleep+0x357
> > taskqueue_drain() at taskqueue_drain+0xc2
> > ieee80211_waitfor_parent() at ieee80211_waitfor_parent+0x3e
> > ieee80211_ioctl() at ieee80211_ioctl+0x162
> > ifioctl() at ifioctl+0xde4
> > kern_ioctl() at kern_ioctl+0xc5
> > ioctl() at ioctl+0xfd
> > syscall() at syscall+0x1af
> > Xfast_syscall() at Xfast_syscall+0xe1
> >
> > Also, sleep mutex became spin mutex. I get a panic
> > panic: mtx_lock of spin mutex(null)
> > It works fine before ifconfig wepkey.
>
> It is hard to tell without code example but wepkey works fine with
> if_rum last time I tried, note that if_rum have done encryption in
> software mode.



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."

Re: Wireless usb + wep = no usbd_do_request

by Paul B Mahol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/4/09, PseudoCylon <moonlightakkiy@...> wrote:

> ----- Original Message ----
>
>> From: Paul B Mahol <onemda@...>
>> To: PseudoCylon <moonlightakkiy@...>
>> Cc: freebsd-current@...
>> Sent: Tue, November 3, 2009 5:08:47 AM
>> Subject: Re: Wireless usb + wep = no usbd_do_request
>>
>> On 11/3/09, PseudoCylon wrote:
>> > Hi,
>> >
>> > I'm porting a wireless usb driver (if_run) to freebsd current, and I got
>> > stuck. Once I "ifconfig wlan0 wepkey 1:0x... weptxkey 1" I cannot call
>> > usbd_do_request() any more. Even ifconfig didn't exit. Chipset supports
>> > h/w
>> > en/decryption, so cannot write keys on chip. (It works without
>> > encryption,
>> > by the way.)
>> >
>> > So, I tried the same thing on another device, linksys wusb54gc with
>> > if_rum.
>> > It worked fine, but about 3 to 4 min later. (Just left it alone.) It
>> > started
>> > giving error
>> > rum0: could not multi read MAC register: USB_ERR_TIMEOUT and
>> > rum0: device timeout
>> > when ifconfig wlan0 down,
>> > rum0: could not multi write MAC register: USB_ERR_TIMEOUT
>> > which means failed on usbd_do_request() (This could be totally different
>> > issue.)
>>
>> I get this one multiple times after card got detached but vap was not
>> manually destroyed.
>> Recently I did not used if_rum more that 5 min I think(maybe in AP
>> mode when I was testing hidden ssid ...)
>>
>> > Any ideas, patches, or walkaround?
>>
>> Make sure how locks are handled between net80211, usb and driver itself.
>
> Thanks for the reply.
>
> I think that's just simple lock problem, too. Just I don't know what it is.
> I tried
> IEEE80211_LOCK
> IEEE80211_NODE_LOCK
> IEEE80211_NODE_ITERATE_LOCK
> but I cannot lock or unlock them. (I can lock IF_LOCK.) I just get "panic:
> mtx_lock of spin mutex(null)" For example, IEEE80211_LOCK is sleep mutex,
> and I can use it in newstate() no problem, but I some how it becomes spin
> mutex in key_set(). Once I find what is over writing lock type, I can make
> it work. Wish me a luck.

Look other freebsd usb drivers for example when un/lock is required, also
you need to have you own driver lock - and you need to really know
when to use it.
_______________________________________________
freebsd-current@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@..."