Subject: Re: changing wi(4) MAC address
To: Lord Isildur <mrfusion@vaxpower.org>
From: David Young <dyoung@pobox.com>
List: tech-net
Date: 08/09/2005 16:44:31
On Tue, Aug 09, 2005 at 03:39:28PM -0400, Lord Isildur wrote:
> 
> so, i finally got tired of not being able
> to set the mac address on wi devices... so i fixed it. 
> it's just a few lines, but now e.g. wiconfig -m  works again.    
> here's a diff from the -current sources of /sys/dev/ic/wi.c : 

Isildur,

Thanks.  What happens if you change the MAC while wi is in the UP state?
What hardware have you tested this on?

Setting the link-layer address really deserves to be a
hardware-independent feature.  There have been a few discussions on
tech-net about how best to set link-layer addresses in a h/w-independent
way---especially which ioctl is most appropriate (SIOCSALIFADDR, IIRC).
Would you be willing to produce a patch based on the discussion?

Dave

> 
> 15:29:35 vinyalonde $ diff wi.c wi.c.new
> 2307a2308,2312
> >         case WI_RID_MAC_NODE:
> >               memcpy(ic->ic_myaddr, wreq.wi_val, ETHER_ADDR_LEN);
> >               IEEE80211_ADDR_COPY(LLADDR(ifp->if_sadl),ic->ic_myaddr);
> >               wi_write_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr,
> IEEE80211_ADDR_LEN);
> >               break;
> 
> a full copy of my updated wi.c is here: 
> 
> http://www.vaxpower.org/~isildur/wi.c.new
> http://www.vaxpower.org/~isildur/wi.c.new.MD5
> 
> 
> happy hacking,
> isildur

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933