From nobody Wed Sep 20 20:02:07 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RrTvl3Ypqz4v68v for ; Wed, 20 Sep 2023 20:02:11 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RrTvl38jQz4DfX for ; Wed, 20 Sep 2023 20:02:11 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 38KK291M090406; Wed, 20 Sep 2023 15:02:09 -0500 (CDT) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1695240129; bh=8ICG24QRfNpfcWxOVibZyAN8GkG4KsZRRol0iMIeJhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bDt/dwCmQJjaJI1pOOjZeJKOG7giU+p9xYYjREfdYPiRZeyixZ2hZ9Es6PBafa1dY vaoC0BiXTmazT0NN9W0+vfFQbYOKxPuMSXRfyEjRWgTfc6En1BACyqhQGVtkbmLnWK tenfc035ODQ6q46/WqrdHtM+te/smXwUzgeI3NCDN0PzfkEbhSf3Qv/FkEe/HSpun4 ecDSVXbXC9OHnSwlIPwJ65ScBlCF+cjR+13ol1zUEqYf6ZXUSMjDJfCn8HMYv8h1Bj v0zLUTj2Co3In11Rw4Zp2ZjryEqtUqWlxhWwpZKBnNVDqskXybtSd0RYfpXWgqm7eP 2ALXK7cprfjMg== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id KNiCGsFPC2UkYQEAs/W3XQ (envelope-from ); Wed, 20 Sep 2023 15:02:09 -0500 From: Mike Karels To: "Patrick M. Hausen" Cc: Mark Millard , freebsd-arm@freebsd.org Subject: Re: Getting a stable MAC address for a RPI CM3+ with ue0 interface Date: Wed, 20 Sep 2023 15:02:07 -0500 X-Mailer: MailMate (1.14r5964) Message-ID: <84C20AD4-1F37-414E-8808-60A2C9B621D9@karels.net> In-Reply-To: References: <3C1032FF-B914-4863-8A03-759A8B4BE216@hausen.com> <77E70D30-8E7D-42DC-A041-3A783E1C6908@yahoo.com> <5205C76E-BAB4-4AB7-8A03-1E8A2D4353BB@hausen.com> List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4RrTvl38jQz4DfX On 20 Sep 2023, at 14:49, Patrick M. Hausen wrote: > Hi all, > > some more research ... > >> Am 20.09.2023 um 21:05 schrieb Patrick M. Hausen : >> No worky. >> [...] > > > I could not find any code in the network startup routines in userland that > would generate and configure a random MAC address. So I looked for > the driver. > > Apparently the TuringPi uses smsc(4), and there we have it straight from > the driver source: > > ------------------- > static void > smsc_attach_post(struct usb_ether *ue) > { > [...] > /* Attempt to get the mac address, if an EEPROM is not attached this > * will just return FF:FF:FF:FF:FF:FF, so in such cases we invent a MAC > * address based on urandom. > */ > [...] > /* Initialise the chip for the first time */ > smsc_chip_init(sc); > } > ------------------- > > So what we would really need is a tunable - one per driver or possibly a > common one read and acted upon by all of the USB ethernet drivers ... There is a routine called ether_gen_addr(), which will generate an Ethernet MAC based on the hostid and the interface name, both of which are reasonably stable. Not very many drivers use it though. It would probably be an improvement. > With no code on our side to perform anything, no wonder the RPI > config files have no effect. It would seem wrong to me to have USB Ethernet drivers using an RPI-specific mechanism. > Dang. That's frustrating. With aarch64 having been promoted to "tier 1" > I really expected full support for all RPI platforms and related features > and hardware. > > Or am I misreading that? I though that the Pi was *the* aarch64 platform, > at least in numbers ... In numbers, probably. In support, no. Mike > Kind regards, > Patrick