Ralink rt2870 wifi support?

ok, minor err with usb
Code:
ugen0.2: <Ralink> at usbus0
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
uhub_explore:611: illegal enable change, port 1
any thoughts
 
code7395 said:
ok, minor err with usb
Code:
ugen0.2: <Ralink> at usbus0
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
uhub_explore:611: illegal enable change, port 1
any thoughts

OK, we need to find out how many endpoints your device has.

1. # usbconfig -u 0 -a 2 -i 0 dump_all_config_desc

And post the result of the command here please.
 
Code:
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0035 
    bNumInterfaces = 0x0001 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080 
    bMaxPower = 0x00e1 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0005 
      bInterfaceClass = 0x00ff 
      bInterfaceSubClass = 0x00ff 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0005  <1.0>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0001 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 2
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 3
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0003 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 4
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0004 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000
 
code7395 said:
Code:
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0035 
    bNumInterfaces = 0x0001 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080 
    bMaxPower = 0x00e1 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0005 
      bInterfaceClass = 0x00ff 
      bInterfaceSubClass = 0x00ff 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0005  <1.0>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0001 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 2
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 3
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0003 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 4
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0004 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000

Aha, as i thought, your device has 5 endpoints but my rt2870 chip has 7 endpoints. I need to investigate that.

I will give you a feedback later when i'm done.

Did you try if_run driver ? You can find it in another forum here.

:e :e :e
 
code7395 said:
Code:
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0035 
    bNumInterfaces = 0x0001 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080 
    bMaxPower = 0x00e1 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0005 
      bInterfaceClass = 0x00ff 
      bInterfaceSubClass = 0x00ff 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0005  <1.0>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0001 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 2
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 3
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0003 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 4
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0004 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000

My device has 7 endpoints: 1 Rx queue and 6 Tx queue (4 EDCA + MGMT + HCCA). Your device has 5 endpoints: 1 Rx queue and
4 Tx queues (4 EDCA). Your device doesn't have MGMT and HCCA Tx queues but it is not a problem because HCCA queue is never used and MGMT queue can be replaced by one of the EDCA Tx queues. The Linux driver does this in that way :)

Wait a minute and i'm going to update the driver.

:e :e :e
 
OK, i fixed the driver rt2870 (FreeBSD 8) so that it should not have any problems with devices that have only 5 USB endpoints. Please test it.
 
after pugging the device in i get this
Code:
rt28700: invalid EEPROM LNA gain #2: 0x00
rt28700: invalid EEPROM LNA gain #3: 0x00
rt28700: EEPROM LNA gains=0x00/0xff/0xff/0xff
rt28700: EEPROM RSSI offsets 2GHZ=0/0/0
rt28700: EEPROM RSSI offsets 5GHZ=0/0/0
RT28700: EEPROM Tx power per rate deltas=0(2MHz), 0(5MHz)
RT28700: EEPROM Tx power per rate #0=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #1=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #2=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #3=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #4=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
rt28700: EEPROM TSSI offsets 2GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700: EEPROM TSSI offsets 5GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700:MAC/BBP RT2870 (rev 0x28720202), RF RT2720
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
uhub_explore:611: illegal enable change, port 2
even though, when i do ifconfig i see rt28700 beeing present;)
Code:
rt28700: flags=8802<BROADCAST,SIMPLEX,MULTICAST> METRIC 0MTU 2290
        ether <XX:XX:XX:XX:XX:XX>
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
does that show any problem
anyway,
Thank you for this big effort, and wish you could make it compatible for 7.2 i386
 
code7395 said:
after pugging the device in i get this
Code:
rt28700: invalid EEPROM LNA gain #2: 0x00
rt28700: invalid EEPROM LNA gain #3: 0x00
rt28700: EEPROM LNA gains=0x00/0xff/0xff/0xff
rt28700: EEPROM RSSI offsets 2GHZ=0/0/0
rt28700: EEPROM RSSI offsets 5GHZ=0/0/0
RT28700: EEPROM Tx power per rate deltas=0(2MHz), 0(5MHz)
RT28700: EEPROM Tx power per rate #0=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #1=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #2=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #3=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #4=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
rt28700: EEPROM TSSI offsets 2GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700: EEPROM TSSI offsets 5GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700:MAC/BBP RT2870 (rev 0x28720202), RF RT2720
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
uhub_explore:611: illegal enable change, port 2
even though, when i do ifconfig i see rt28700 beeing present;)
Code:
rt28700: flags=8802<BROADCAST,SIMPLEX,MULTICAST> METRIC 0MTU 2290
        ether <XX:XX:XX:XX:XX:XX>
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
does that show any problem
anyway,
Thank you for this big effort, and wish you could make it compatible for 7.2 i386

Everything is OK, it's only debug messages, the driver is loaded.
WLAN works on FreeBSD 8 a bit different then on FreeBSD 7.
You need to create a wlan device:

# ifconfig wlan0 create wlandev rt28700 wlanmode sta up

And you also have to configure wpa_supplicant if you want to use security in your WLAN. :)

And don't worry i'm going to modify the rt2870 driver for FreeBSD 7.2 next week so that it will support your device.
That is if i have time because Mass Effect 2 is coming next week :)

:e :e :e
 
fine,
back in trouble till than,
when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
/var/log/messages complaints about
Code:
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 0; apic id = 00
kernel: fault virtual adress    = 0xb0
kernel: fault code              = supervisor write data, page not present
...
 
code7395 said:
fine,
back in trouble till than,
when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
/var/log/messages complaints about
Code:
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 0; apic id = 00
kernel: fault virtual adress    = 0xb0
kernel: fault code              = supervisor write data, page not present
...

Unfortunately, I cannot test your device by myself but if you are willing we can do it together.
First, it would be good if you could add debugger support to your kernel and recompile it. With debugger it is easier to find problems because the message you posted doesn't say anything to me :e
 
Guys, take a breath, or switch to a messenger or IRC. You're turning this into a chatbox.
 
after reboot , doing a netif restart brings this:
Code:
rt28700: initializing
rt28700: loading 8051 microcode
rt28700: 8051 microcode was successfully loaded

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual adress    = 0x520
fault code              = supervisor write data, page not present
instruction pointer     = 0x20:0xffffffff81024ab9
stack pointer           = 0x28:0xffffff800a83a8c0
frame pointer           = 0x28:0xffffff800a83a8f0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 1405 (ifconfig)
trap number             = 12
panic: page fault
cpuid = 0
Uptime: 16m29s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort
--> Press a key on the console to reboot,
--> or switch off the system now.
 
code7395 said:
fine,
back in trouble till than,
when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
/var/log/messages complaints about
Code:
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 0; apic id = 00
kernel: fault virtual adress    = 0xb0
kernel: fault code              = supervisor write data, page not present
...

OK, already fixed the problem and teste it. It works for me with only 5 endpoints. Download the driver again.

OK, if you have other questions or problems just send them to my ICQ account.
 
Back
Top