Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2023 22:26:12 +0200
From:      Ronald Klop <ronald@FreeBSD.org>
To:        "Patrick M. Hausen" <pmh@hausen.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Getting a stable MAC address for a RPI CM3+ with ue0 interface
Message-ID:  <fec9f18a-8d8e-8909-f026-bd6ac50e77b4@FreeBSD.org>
In-Reply-To: <8305B36C-9DFE-4FF1-A836-80F2931A6A46@hausen.com>
References:  <3C1032FF-B914-4863-8A03-759A8B4BE216@hausen.com> <77E70D30-8E7D-42DC-A041-3A783E1C6908@yahoo.com> <5205C76E-BAB4-4AB7-8A03-1E8A2D4353BB@hausen.com> <B50A4409-84C0-405D-8099-43692243AE52@hausen.com> <84C20AD4-1F37-414E-8808-60A2C9B621D9@karels.net> <4951c134-39be-43de-0aa7-430a136d8b36@FreeBSD.org> <2071C2B6-B61A-40E0-8DA2-1E23D463B2E9@hausen.com> <8305B36C-9DFE-4FF1-A836-80F2931A6A46@hausen.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/25/23 19:10, Patrick M. Hausen wrote:
> Hi all
> 
>> Am 24.09.2023 um 23:05 schrieb Patrick M. Hausen <pmh@hausen.com>:
>>
>> Hi all
>>
>>> Am 23.09.2023 um 21:28 schrieb Ronald Klop <ronald@FreeBSD.org>:
>>>
>>> Would this work?
>>>
>>> diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c
>>> index 0a0268bfa1a2..4a7983a20717 100644
>>> --- a/sys/dev/usb/net/if_smsc.c
>>> +++ b/sys/dev/usb/net/if_smsc.c
>>> [...]
>>
>> After building and installing the kernel with this patch and reboot I
>> lost access to the node I used. I will try to set up console access
>> somehow ...
> 
> The development board I use for flashing etc. has got a serial port
> connector and even a USB to serial converter so you can just plug in
> USB to your laptop - I did not get any console output, though.
> 
> https://www.waveshare.com/wiki/Compute_Module_PoE_Board#Serial_port
> 
> I did get console output via HDMI, but my Apple keyboard seems not
> to work when plugged in to USB so I could not really examine what
> is wrong or boot into kernel.old - only diagonistic I can provide:
> 
> The new kernel prints the "No MAC address found" message, then panics.
> 
> I'm reflashing the module now ...
> 
>  From reading your source code, what are you really trying to achieve?
> More diagnostic messages are a good thing, but from where are you
> trying to read that MAC address?


The method ether_gen_addr() generates a MAC address bases on hostuuid and interface name. Maybe not ideal, bu a lot better then a random MAC.

sys/net/if_ethersubr.c:
/*
  * Allocate an address from the FreeBSD Foundation OUI.  This uses a
  * cryptographic hash function on the containing jail's name, UUID and the
  * interface name to attempt to provide a unique but stable address.
  * Pseudo-interfaces which require a MAC address should use this function to
  * allocate non-locally-administered addresses.
  */
void
ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr)


It would be nice to see more information from the panic. Can you make a picture or movie of the screen while this happens?
Or does the system make a kernel crashdump? See "dumpdev" in /etc/defaults/rc.conf. A crashdump is written to the swap partition and on reboot a summary is written in /var/crash from what is in the swap partition. This is all assuming the system has a large enough swap partition.

Regards,
Ronald.


> As far as I understand for the Pi you are supposed to use the RPi
> foundation OUI B8:27:EB plus the lower three octets of the Pi's
> serial number - regardless of the Ethernet adapter plugged in.
> 
> All Pis running Linux do this.
> 
> Kind regards,
> Patrick




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fec9f18a-8d8e-8909-f026-bd6ac50e77b4>