Re: Socket Ioctl Interface for 3c509.c

George Magklaras (gmagklaras@geocities.com)
Sat, 12 Jun 1999 08:35:31 +0100


--------------C5994C1AEE50C6BF51F836A5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tim Fletcher wrote:

> > I am using a 2.0.34 kernel and I have two ISA 3Com Etherlink III cards
> > installed on the machine. Note that I am using the latest 3c509.c driver
> >
> > downloaded from Donald Becker's site. (note the one that came originally
> >
> > with the LINUX distribution RH5.1)
> >
> > I am trying to utilise the Socket ioctl interface for the particular
> > device, in order to retrieve config info and also change the MAC address
> >
> > of the board at run-time.
> > I have no problems retrieving and passing info by using the ifmap
> > structure (linux/if.h). However, I do not understand how I can implement
> >
> > a SIOCSIFADDR in the device layer, in order to change the MAC address of
> >
> > the board at run-time. Hence, I have a few questions regarding the ifreq
> >
> > structure in <linux/if.h> and also the do_ioctl function that is
> > prototyped in <linux/netdevice.h>:
> >
> > i) One of the variables in the ifreq structure is ifru_hwaddr. Is this
> > the only variable that relates to the MAC address? If not what else
> > relates to it?
> >
> > ii) I think (by looking at the 3c509.c) that I will have to implement a
> > private ioctl (SIOCDEVPRIVATE) to modify the MAC address at run time.
> > Hence, I am going to have to implement a do_ioctl function inside the
> > driver...Can somebody (with good knowledge of the 3Com driver) help me
> > implement this? Alternatively, if there is already a device method that
> > achieves the change of MAC address at run time, can somebody shout and
> > point the method to me?
>
> I have some code (not written by me) that changes mac address if you would
> like a copy. It came from www.rootshell.com a while (year or so) back.
>
> --
>
> Tim Fletcher .~.
> /V\ L I N U X
> tjdf@st-andrews.ac.uk // \ >Don't fear the penguin<
> tim@night-shade.demon.co.uk /( )\
> ^^-^^
> "Commercial OS vendors are, at the moment, all closed economies, and
> doomed to fall in their competition with open economies just as
> communism eventually fell."
> -- H. Reiser, Unix OS developer

Hi Tim,

Thanks for the info. I had a look at the website and I found changemac.c
(dated 7/9/98). Is this the code you use? If not I would like a copy. If yes,
have you added any functionality to it.

I am coding an Ethernet redundancy packet for Linux.. Any exchange of ideas is
very welcome.

Thanks again.

George Magklaras (gmagklaras@geocities.com)
http://www.geocities.com/SiliconValley/Bridge/3862
Computer Programmer

-------
A system is anything with no system to it,
hardware is anything that clatters when you drop it,
and software is anything for which there is a logical explanation why it's not
working.

Johannes Leckebusch
-------

--------------C5994C1AEE50C6BF51F836A5
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 

Tim Fletcher wrote:

> I am using a 2.0.34 kernel and I have two ISA 3Com Etherlink III cards
> installed on the machine. Note that I am using the latest 3c509.c driver
>
> downloaded from Donald Becker's site. (note the one that came originally
>
> with the LINUX distribution RH5.1)
>
> I am trying to utilise the Socket ioctl interface for the particular
> device, in order to retrieve config info and also change the MAC address
>
> of the board at run-time.
> I have no problems retrieving and passing info by using the ifmap
> structure (linux/if.h). However, I do not understand how I can implement
>
> a SIOCSIFADDR in the device layer, in order to change the MAC address of
>
> the board at run-time. Hence, I have a few questions regarding the ifreq
>
> structure  in <linux/if.h> and also the do_ioctl function that is
> prototyped in <linux/netdevice.h>:
>
> i) One of the variables in the ifreq structure is ifru_hwaddr. Is this
> the only variable that relates to the MAC address? If not what else
> relates to it?
>
> ii) I think (by looking at the 3c509.c) that I will have to implement a
> private ioctl (SIOCDEVPRIVATE) to modify the MAC address at run time.
> Hence, I am going to have to implement a do_ioctl function inside the
> driver...Can somebody (with good knowledge of the 3Com driver) help me
> implement this? Alternatively, if there is already a device method that
> achieves the change of MAC address at run time, can somebody shout and
> point the method to me?

I have some code (not written by me) that changes mac address if you would
like a copy. It came from www.rootshell.com a while (year or so) back.

--

      Tim Fletcher                  .~.
                                    /V\       L   I   N   U   X
   tjdf@st-andrews.ac.uk           // \  >Don't fear the penguin<
tim@night-shade.demon.co.uk       /(   )\
                                   ^^-^^
"Commercial OS vendors are, at the moment, all closed economies, and
doomed to fall in their competition with open economies just as
communism eventually fell."
                   -- H. Reiser, Unix OS developer

Hi Tim,

Thanks for the info. I had a look at the website and I found changemac.c (dated 7/9/98). Is this the code you use? If not I would like a copy. If yes, have you added any functionality to it.

I am coding an Ethernet redundancy packet for Linux.. Any exchange of ideas is very welcome.

Thanks again.

George Magklaras (gmagklaras@geocities.com)
http://www.geocities.com/SiliconValley/Bridge/3862
Computer Programmer

-------
A system is anything with no system to it,
hardware is anything that clatters when you drop it,
and software is anything for which there is a logical explanation why it's not working.

Johannes Leckebusch
-------
  --------------C5994C1AEE50C6BF51F836A5-- - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu