Received: with ECARTIS (v1.0.0; list netdev); Wed, 13 Jul 2005 06:24:23 -0700 (PDT) Received: from ms-smtp-01.tampabay.rr.com (ms-smtp-01-smtplb.tampabay.rr.com [65.32.5.131]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j6DDOEH9023120 for ; Wed, 13 Jul 2005 06:24:15 -0700 Received: from smtp.davehollis.com (111-50.26-24.tampabay.res.rr.com [24.26.50.111]) by ms-smtp-01.tampabay.rr.com (8.12.10/8.12.7) with ESMTP id j6DChdEg025949; Wed, 13 Jul 2005 08:43:39 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.davehollis.com (Postfix) with ESMTP id D5287B35AD; Wed, 13 Jul 2005 08:43:37 -0400 (EDT) Received: from smtp.davehollis.com ([127.0.0.1]) by localhost (bender.davehollis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08065-09; Wed, 13 Jul 2005 08:43:29 -0400 (EDT) Received: from [10.11.0.10] (static-68-238-170-130.tampfl.fios.verizon.net [68.238.170.130]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by smtp.davehollis.com (Postfix) with ESMTP id 0FCADB35AC; Wed, 13 Jul 2005 08:43:27 -0400 (EDT) Subject: Re: [PATCH] forcedeth: Additional ethtool support From: David Hollis To: Manfred Spraul Cc: Jeff Garzik , Netdev , renaud.lienhart@free.fr In-Reply-To: <42D101EC.6000608@colorfullife.com> References: <42D101EC.6000608@colorfullife.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Z/rD2cz0FCO9rdb3WWp/" Date: Wed, 13 Jul 2005 08:39:21 -0400 Message-Id: <1121258362.5023.1.camel@dhollis-lnx.sunera.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) X-archive-position: 2727 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev Content-Length: 1354 Lines: 54 --=-Z/rD2cz0FCO9rdb3WWp/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2005-07-10 at 13:09 +0200, Manfred Spraul wrote: > + > +static int nv_nway_reset(struct net_device *dev) > +{ > + struct fe_priv *np =3D get_nvpriv(dev); > + int ret; > + > + spin_lock_irq(&np->lock); > + if (np->autoneg) { > + int bmcr; > + > + bmcr =3D mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); > + bmcr |=3D (BMCR_ANENABLE | BMCR_ANRESTART); > + mii_rw(dev, np->phyaddr, MII_BMCR, bmcr); > + > + ret =3D 0; > + } else { > + ret =3D -EINVAL; > + } > + spin_unlock_irq(&np->lock); > + > + return ret; > +} > + This seems almost completely generic-ified (except for the np->autoneg part) and should be able to operate on any NIC. Do you think there'd be some way to whip up a stock ethtool_nway_reset() type of function that drivers can use if they don't need to do anything fancy? Would help save a lot of code duplication. --=20 David Hollis --=-Z/rD2cz0FCO9rdb3WWp/ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBC1Qt5xasLqOyGHncRAp8jAJ9XLG/8d8Dkspyk3dgkxE4DLdsbogCguIYg 0GiUeyFb1vikkowDrHfdktg= =69hb -----END PGP SIGNATURE----- --=-Z/rD2cz0FCO9rdb3WWp/--