Hi Petr,

On Sun, Dec 9, 2012 at 11:37 PM, Petr Štetiar <yn...@true.cz> wrote:
> As rt2800 hw can only be configured to mask the last three bits of the
> programmed MAC addresses, we can't change first byte of the MAC - otherwise it
> doesn't work. More information about this issue [1].
>
> Should fix #12133.
>
> 1. http://marc.info/?l=linux-wireless&m=135387062429809&w=2
>
> Thanks to Paul Fertser and Helmut Schaa.
>
> Signed-off-by: Petr Štetiar <yn...@true.cz>
> ---
>  package/mac80211/files/lib/wifi/mac80211.sh |   19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
> b/package/mac80211/files/lib/wifi/mac80211.sh
> index 1b0bea7..752325e 100644
> --- a/package/mac80211/files/lib/wifi/mac80211.sh
> +++ b/package/mac80211/files/lib/wifi/mac80211.sh
> @@ -272,13 +272,28 @@ get_freq() {
>         iw "$phy" info | grep -E -m1 "(\* ${chan:-....} 
> MHz${chan:+|\\[$chan\\]})" | grep MHz | awk '{print $2}'
>  }
>
> +is_not_rt2800() {
> +       local phy="$1"
> +       local drvname="$(readlink /sys/class/ieee80211/$phy/device/driver)"
> +       drvname="${drvname##*/}"
> +
> +       case "$drvname" in
> +       *"rt2800_wmac")
> +               return 1
> +               ;;
> +       esac
> +
> +       return 0
> +}

I've just submitted a rt2x00 patch that registers a valid address mask
with mac80211. So, you
could actually use this information to generate valid MAC addresses
for this device:

/sys/class/ieee80211/phy0/macaddress
/sys/class/ieee80211/phy0/address_mask

However, I'm not sure if other devices behave the same or not. So
using this approach
might not work for other devices ...

Helmut
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to