From owner-freebsd-drivers@FreeBSD.ORG Thu Mar 6 18:16:37 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D7DA99E for ; Thu, 6 Mar 2014 18:16:37 +0000 (UTC) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3083F81E for ; Thu, 6 Mar 2014 18:16:37 +0000 (UTC) Received: by mail-pb0-f45.google.com with SMTP id uo5so2960201pbc.32 for ; Thu, 06 Mar 2014 10:16:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=4V4lOCbBytBcoKMjFsuse3N0WGPSOpOcVBghQNMpuDE=; b=V17/fsz06feuOZnNgtsgr7ynOc5G5bNqN+lzYl2F5YZQcyR2k4ZlSeADYJTwsmbFXp fw7RblDYAxe6/QCLVCtUjT9CmUUA6xZxQD8QH1ibZ+yQvd7lWbdT2gcEYHT855Qjig4p jOp9TOgKXB9rzfGrVevHJHgP8zkCMv3u3HDywkVBGsXH6W24stW0QlEgueRFSekgHerX 4BUYKuBfFc1vwTG6KSiJHeUaFh/zTJASXYDYUA8Tkr5KSGEis8L5ly//rUOn+yvBrDHd QpH/hRALW+NjkK5GXFaDwTWqwRAPtKiAp1UxEm671RMm7j9WwbzZJNDL6/sTf2W2LdhL XOrw== X-Gm-Message-State: ALoCoQmM0IAYPTFfqu1fsBgCho1WKtAg0DZCpZuOUisKSZrn+CfZFxPi3AqpBbQH5mQVz3HvnV0p X-Received: by 10.68.178.229 with SMTP id db5mr15986135pbc.97.1394129796508; Thu, 06 Mar 2014 10:16:36 -0800 (PST) Received: from lglt-nvaradarajan.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id vf7sm22156451pbc.5.2014.03.06.10.16.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 10:16:35 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Reading burned-in NIC MAC address from the user space. From: Warner Losh In-Reply-To: <1394129227.732.37.camel@eva02> Date: Thu, 6 Mar 2014 11:16:34 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <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> To: clutton X-Mailer: Apple Mail (2.1874) 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:16:37 -0000 On Mar 6, 2014, at 11:07 AM, clutton wrote: > 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 = done, >>> except restoring the mac to the original one. >>>=20 >>> The Linux users can exploit ioctl with SIOCETHTOOL pointing to a = proper >>> ifreq(ETHTOOL_GPERMADDR), I have no idea how to do this using = FreeBSD, >>> is it even possible? >>=20 >> I=92d check the source for ifconfig. >>=20 >> ifconfig ep0 link 1:2:3:4:5:6 >>=20 >> does the trick=85 >>=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. ifconfig foo0 | grep link is the usual answer here :) > 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. so you want to be able to ask the driver for the original mac address? Warner