11.1Sthorpej/*	$NetBSD: ether_calls.h,v 1.2 2025/10/12 23:41:42 thorpej Exp $	*/
21.1Sthorpej
31.1Sthorpej/*
41.1Sthorpej * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
51.1Sthorpej *
61.1Sthorpej * generated from:
71.2Sthorpej *	NetBSD: ether_calls,v 1.1 2025/10/12 23:41:08 thorpej Exp
81.1Sthorpej */
91.1Sthorpej
101.1Sthorpej/*-
111.1Sthorpej * Copyright (c) 2025 The NetBSD Foundation, Inc.
121.1Sthorpej * All rights reserved.
131.1Sthorpej *
141.1Sthorpej * This code is derived from software contributed to The NetBSD Foundation
151.1Sthorpej * by Jason R. Thorpe.
161.1Sthorpej *
171.1Sthorpej * Redistribution and use in source and binary forms, with or without
181.1Sthorpej * modification, are permitted provided that the following conditions
191.1Sthorpej * are met:
201.1Sthorpej * 1. Redistributions of source code must retain the above copyright
211.1Sthorpej *    notice, this list of conditions and the following disclaimer.
221.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
231.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
241.1Sthorpej *    documentation and/or other materials provided with the distribution.
251.1Sthorpej *
261.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Sthorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Sthorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Sthorpej * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Sthorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Sthorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Sthorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Sthorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Sthorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Sthorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Sthorpej * POSSIBILITY OF SUCH DAMAGE.
371.1Sthorpej */
381.1Sthorpej
391.1Sthorpej/*
401.1Sthorpej * Device calls used by the Ethernet subsystem.
411.1Sthorpej */
421.1Sthorpej
431.1Sthorpej#ifndef _ETHER_CALLS_H_
441.1Sthorpej#define _ETHER_CALLS_H_
451.1Sthorpej
461.1Sthorpej#include <sys/device.h>
471.1Sthorpej
481.1Sthorpej#include <net/if_ether.h>
491.1Sthorpej
501.1Sthorpej/*
511.1Sthorpej * ether-get-mac-address
521.1Sthorpej *
531.1Sthorpej * Retrieve the MAC address for the Ethernet interface associated
541.1Sthorpej * with the device handle.
551.1Sthorpej *
561.1Sthorpej * While it is common for platform device trees to provide the MAC
571.1Sthorpej * address in a property, some platforms may use single system-wide
581.1Sthorpej * MAC address in addition to interface-specific addresses, and the
591.1Sthorpej * rules about which one to use on a given interface are encoded into
601.1Sthorpej * the device tree itself, hence this hook.
611.1Sthorpej */
621.1Sthorpejstruct ether_get_mac_address_args {
631.1Sthorpej	/* This buffer is assumed to be ETHER_ADDR_LEN bytes in size. */
641.1Sthorpej	uint8_t *	enaddr;		/* OUT */
651.1Sthorpej};
661.1Sthorpej
671.1Sthorpejunion ether_get_mac_address_binding {
681.1Sthorpej	struct device_call_generic generic;
691.1Sthorpej	struct {
701.1Sthorpej		const char *name;
711.1Sthorpej		struct ether_get_mac_address_args *args;
721.1Sthorpej	} binding;
731.1Sthorpej};
741.1Sthorpej
751.1Sthorpej#define ETHER_GET_MAC_ADDRESS_STR "ether-get-mac-address"
761.1Sthorpej
771.1Sthorpej#define ETHER_GET_MAC_ADDRESS(_args_) \
781.1Sthorpej	&((const union ether_get_mac_address_binding){ \
791.1Sthorpej		.binding.name = "ether-get-mac-address", \
801.1Sthorpej		.binding.args = (_args_), \
811.1Sthorpej	})
821.1Sthorpej
831.1Sthorpej#endif /* _ETHER_CALLS_H_ */
84