From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 6 18:42:34 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BFDEC4E; Thu, 6 Mar 2014 18:42:34 +0000 (UTC) Received: from sender1.zohomail.com (sender1.zohomail.com [72.5.230.95]) by mx1.freebsd.org (Postfix) with ESMTP id 5A838AFF; Thu, 6 Mar 2014 18:42:34 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version; b=OIXY+4W++3HWcGxpX+WQ9KP9lufOXNIVjDvfmhIqjcl4l0tnYL5ApWfmCkvk2LyhFs+jRqdaKptx mxWLZrFAZywTA8OYwMwnjAEEekYWKRxaS8WwhvZzr9L4WO5rQX1m Received: from [10.1.2.6] (46.229.54.117 [46.229.54.117]) by mx.zohomail.com with SMTPS id 1394131350972920.5689008583166; Thu, 6 Mar 2014 10:42:30 -0800 (PST) Subject: Re: Reading burned-in NIC MAC address from the user space. From: clutton To: Warner Losh In-Reply-To: <78D3808C-A446-4697-AE6A-0718C058F8C1@bsdimp.com> References: <1394115222.8935.17.camel@eva02> <10C93415-7C49-459E-921E-EE358C3B886C@bsdimp.com> <1394129227.732.37.camel@eva02> <78D3808C-A446-4697-AE6A-0718C058F8C1@bsdimp.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-RcZbhJI4L3A75vsrq/0Q" Date: Thu, 06 Mar 2014 20:42:23 +0200 Message-ID: <1394131343.732.39.camel@eva02> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Zoho-Virus-Status: 1 X-ZohoMail: Ss SS_10 UW UB UW UB SF_TD_EXT SGR3_1_19024_64 X-ZohoMail-Owner: <1394131343.732.39.camel@eva02>+zmo_0_ X-ZohoMail-Sender: 46.229.54.117 X-ZohoMailClient: External Cc: FreeBSD Hackers , freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:42:34 -0000 --=-RcZbhJI4L3A75vsrq/0Q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2014-03-06 at 11:16 -0700, Warner Losh wrote: > On Mar 6, 2014, at 11:07 AM, clutton wrote: >=20 > > On Thu, 2014-03-06 at 08:35 -0700, Warner Losh wrote: > >> On Mar 6, 2014, at 7:13 AM, clutton wrote: > >>=20 > >>> Hi lists. > >>>=20 > >>> I'm porting a GNU macchanger to the FreeBSD. Everything has almost do= ne, > >>> except restoring the mac to the original one. > >>>=20 > >>> The Linux users can exploit ioctl with SIOCETHTOOL pointing to a prop= er > >>> ifreq(ETHTOOL_GPERMADDR), I have no idea how to do this using FreeBSD= , > >>> is it even possible? > >>=20 > >> I=E2=80=99d check the source for ifconfig. > >>=20 > >> ifconfig ep0 link 1:2:3:4:5:6 > >>=20 > >> does the trick=E2=80=A6 > >>=20 > >> Warner > >=20 > > No, it doesn't. It does the different trick :) > > You misunderstood the question. I don't asked how to set the mac > > address. The question is how to read burned in mac address from user > > space. ifconfig is not capable doing such a thing. >=20 > ifconfig foo0 | grep link >=20 > is the usual answer here :) >=20 > > As I can see the drivers read MAC from EEPROM using different ways. Is > > there any interface to this low level work? > >=20 > > WHY: > > The GNU macchanger has very nice option "--permanent Reset to original, > > permanent hardware MAC". This is only one thing I haven't ported yet. >=20 > so you want to be able to ask the driver for the original mac address? >=20 > Warner Exactly. --=-RcZbhJI4L3A75vsrq/0Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAABAgAGBQJTGMGPAAoJECNkWbjnbjui5+oQAImY6TVmSCmHMOCj/iFS9rg7 mBLiPnvqKWQQr8qtJwsNO0yxq6XAYayhROg63h2GrCl5GZL0orxuCz/xlHW+omSj nmJePSmvzZYhvr8wZ5EjtkS2tUKK39F7YvNvH8uO2Lff7fIele1+S9AApVhQLlcX WM4eX/7N4olQuLlDg8nAp/UpIliEF3oilOA+hcokyaxNBQYvGI7DQSRMM1e+o6ff gInTOm2I3dpTMpiJ97cnmXHfDUFO0gy3G6SVVIeNWtq4Vo7pi9KqtVtCMgCDuemP yJbDrskdTtIikxIWea6v1QBk/m3Cy2y0UOQiG0ZEttD7CnUjx9XcUkZpPf7O4QEa jYQAVXtgaey6W6+9/wdN1OTx//h51bMHNKdEO++0noH97gKc8CR6belJhtNOi6E6 9XkTN5hcmbgrk3XdoAAUCQyPt6Z2sc1fXEgmJFsvLkgRZkO6aRCJcgZjOF3FSi9X syRdbh35aFcw+4MKUWmy9rGBr9ur6y2jTLKQsg/R20SW6mXVcrazmjOqx2CXoWwt +54KquIK9Ey8rhQ+tQqH1vEWCAeglc4APEzuyRE+vKICyuLXoyuOW9im0MiFyQ+s nNztlAR3oCunVdIpQxCY5mm3AMjpGik8If+eSlXw08PbrJks3kBJYyspdO8ay5Pr GURp4cfidlOWRxWb9vOy =mhXe -----END PGP SIGNATURE----- --=-RcZbhJI4L3A75vsrq/0Q--