2013-05-18 15:10:56

by Alessandro Lannocca

[permalink] [raw]
Subject: rt3070-based usb device won't accept mac address changes

Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
unable to change my alfa AWUS036NH mac address; a simple:

ifconfig <device> down
ifconfig <device> hw ether <random hw>

results in:

SIOCSIFHWADDR: Invalid argument

I tried the drivers shipped with the distribution,
compat-drivers-3.9-rc4-2-su and compat-drivers-2013-03-28-4-u aswell;
all to no avail.

Any help appreciated, I'm able to recompile/test if needed.

Thank you for your time.

Alessandro Lannocca

Attached 'lsusb -v' , kernel 3.8.8 x86_64

<snip>

Bus 003 Device 005: ID 148f:3070 Ralink Technology, Corp.
RT2870/RT3070 Wireless Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x148f Ralink Technology, Corp.
idProduct 0x3070 RT2870/RT3070 Wireless Adapter
bcdDevice 1.01
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 450mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 7
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x06 EP 6 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0

</snip>


2013-05-21 15:08:04

by Alessandro Lannocca

[permalink] [raw]
Subject: R: rt3070-based usb device won't accept mac address changes

Hi, I have an ath9k-driven integrated card active at the same time (wlan0);
but only one wlan interface (wlan1) active on the rt2800usb phy, running in
managed mode.

Thank you for your time.

-----Messaggio originale-----
Da: Helmut Schaa [mailto:[email protected]]
Inviato: marted? 21 maggio 2013 10.16
A: Alessandro Lannocca
Cc: linux-wireless
Oggetto: Re: rt3070-based usb device won't accept mac address changes

On Sat, May 18, 2013 at 5:10 PM, Alessandro Lannocca
<[email protected]> wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument

Do you have multiple wifi interfaces or just that single one?
Helmut


2013-05-18 17:01:16

by Bruno Randolf

[permalink] [raw]
Subject: Re: rt3070-based usb device won't accept mac address changes

On 05/18/2013 04:10 PM, Alessandro Lannocca wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument
>
> I tried the drivers shipped with the distribution,
> compat-drivers-3.9-rc4-2-su and compat-drivers-2013-03-28-4-u aswell;
> all to no avail.

Hi!

I have the same problem with RT5370 (rt2800usb driver).
compat-drivers-v3.7.9-1 still works, so this must be a regression in
kernels after 3.8...

bruno

2013-05-21 08:16:08

by Helmut Schaa

[permalink] [raw]
Subject: Re: rt3070-based usb device won't accept mac address changes

On Sat, May 18, 2013 at 5:10 PM, Alessandro Lannocca
<[email protected]> wrote:
> Hi, after switching to kernel 3.8.8 (ubuntu quantal to raring), I'm
> unable to change my alfa AWUS036NH mac address; a simple:
>
> ifconfig <device> down
> ifconfig <device> hw ether <random hw>
>
> results in:
>
> SIOCSIFHWADDR: Invalid argument

Do you have multiple wifi interfaces or just that single one?
Helmut

2013-05-20 23:40:11

by Bruno Randolf

[permalink] [raw]
Subject: Re: rt3070-based usb device won't accept mac address changes

On 05/18/2013 10:07 PM, Alessandro Lannocca wrote:
> After digging a bit into linux-stable.git I found the culprit: this
> regression comes from commit #
> 6c50f9459e62eb133563fd23606f68bfc9d120e8 (rt2x00: Use addr_mask to
> disallow invalid MAC addresses in mutli-bssid mode) ; reverting it
> fixes the problem, tested by me in compat-drivers-2013-03-28-5-u .
>
>
> I can't tell if reverting that commit adds any trouble as I'm not a
> developer; however I'm sure you guys will know how to handle the
> situation.

Basically the driver got more picky and only allows the last 3 bit of
the MAC address changed. I just found out that if you generate your new
MAC accordingly it works!

I wonder wether this is addr_mask is necessary for all RT chipsets,
since mine (RT5372) happily accepted different MAC addresses before,
also in multi-AP configurations...

bruno

2013-05-18 21:07:11

by Alessandro Lannocca

[permalink] [raw]
Subject: Re: rt3070-based usb device won't accept mac address changes

After digging a bit into linux-stable.git I found the culprit: this
regression comes from commit #
6c50f9459e62eb133563fd23606f68bfc9d120e8 (rt2x00: Use addr_mask to
disallow invalid MAC addresses in mutli-bssid mode) ; reverting it
fixes the problem, tested by me in compat-drivers-2013-03-28-5-u .


I can't tell if reverting that commit adds any trouble as I'm not a
developer; however I'm sure you guys will know how to handle the
situation.


Alessandro Lannocca