All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Kropelin <akropel1@rochester.rr.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Neil Cafferkey <caffer@cs.ucc.ie>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Re: Setting MAC address in ewrk3 driver
Date: Thu, 21 Nov 2002 20:30:04 -0500	[thread overview]
Message-ID: <20021122013004.GA23061@www.kroptech.com> (raw)
In-Reply-To: <3DDD7418.2010408@pobox.com>

On Thu, Nov 21, 2002 at 07:02:32PM -0500, Jeff Garzik wrote:
> Alan Cox wrote:
> 
> >On Thu, 2002-11-21 at 23:39, Adam Kropelin wrote:
> >
> >>Alan, could you clarify for me? I'm the last guy to diddle with ewrk3 so
> >>I'll track this down if there is indeed something to track down. ewrk3
> >>has a private ioctl for setting the mac address. By the "up" method do
> >>you mean the etherdev open method? Should there be a standard ioctl
> >>implemented for setting the mac address?
> >
> >
> >dev->set_mac_address()
> 
> To be more specific:
> 
> Read the MAC address in the probe phase.
> Write MAC address to NIC on _each_ dev->open().

Got it. Quick patch below. Works for me (TM). Against recent 2.5 but
should apply to 2.4 with offsets.

Neil, does this work for you?

> If you care about changing the MAC address while interface is up, 
> implement dev->set_mac_address().

Sounds like that is best avoided unless someone specifically needs it.
Even then it'll get implemented as a close/open sequence internally
anyway, so there's not much point.

--Adam

--- linux-2.5.47/drivers/net/ewrk3.c.orig	Thu Nov 21 20:24:00 2002
+++ linux-2.5.47/drivers/net/ewrk3.c	Thu Nov 21 20:22:24 2002
@@ -712,6 +712,7 @@
 	struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
 	u_char csr, page;
 	u_long iobase = dev->base_addr;
+	int i;
 
 	/*
 	   ** Enable any multicasts
@@ -719,6 +720,13 @@
 	set_multicast_list(dev);
 
 	/*
+	** Set hardware MAC address. Address is initialized from the EEPROM
+	** during startup but may have since been changed by the user.
+	*/
+	for (i=0; i<ETH_ALEN; i++)
+		outb(dev->dev_addr[i], EWRK3_PAR0 + i);
+
+	/*
 	   ** Clean out any remaining entries in all the queues here
 	 */
 	while (inb(EWRK3_TQ));


  reply	other threads:[~2002-11-22  1:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-21 19:54 Setting MAC address in ewrk3 driver Neil Cafferkey
2002-11-21 21:28 ` Alan Cox
2002-11-21 23:39   ` Adam Kropelin
2002-11-22  0:26     ` Alan Cox
2002-11-21 23:29 ` Adam Kropelin
2002-11-22  0:02 ` Jeff Garzik
2002-11-22  1:30   ` Adam Kropelin [this message]
2002-11-26  1:47     ` Neil Cafferkey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021122013004.GA23061@www.kroptech.com \
    --to=akropel1@rochester.rr.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=caffer@cs.ucc.ie \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.