1 /* $NetBSD: ether_calls.h,v 1.2 2025/10/12 23:41:42 thorpej Exp $ */ 2 3 /* 4 * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. 5 * 6 * generated from: 7 * NetBSD: ether_calls,v 1.1 2025/10/12 23:41:08 thorpej Exp 8 */ 9 10 /*- 11 * Copyright (c) 2025 The NetBSD Foundation, Inc. 12 * All rights reserved. 13 * 14 * This code is derived from software contributed to The NetBSD Foundation 15 * by Jason R. Thorpe. 16 * 17 * Redistribution and use in source and binary forms, with or without 18 * modification, are permitted provided that the following conditions 19 * are met: 20 * 1. Redistributions of source code must retain the above copyright 21 * notice, this list of conditions and the following disclaimer. 22 * 2. Redistributions in binary form must reproduce the above copyright 23 * notice, this list of conditions and the following disclaimer in the 24 * documentation and/or other materials provided with the distribution. 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 * POSSIBILITY OF SUCH DAMAGE. 37 */ 38 39 /* 40 * Device calls used by the Ethernet subsystem. 41 */ 42 43 #ifndef _ETHER_CALLS_H_ 44 #define _ETHER_CALLS_H_ 45 46 #include <sys/device.h> 47 48 #include <net/if_ether.h> 49 50 /* 51 * ether-get-mac-address 52 * 53 * Retrieve the MAC address for the Ethernet interface associated 54 * with the device handle. 55 * 56 * While it is common for platform device trees to provide the MAC 57 * address in a property, some platforms may use single system-wide 58 * MAC address in addition to interface-specific addresses, and the 59 * rules about which one to use on a given interface are encoded into 60 * the device tree itself, hence this hook. 61 */ 62 struct ether_get_mac_address_args { 63 /* This buffer is assumed to be ETHER_ADDR_LEN bytes in size. */ 64 uint8_t * enaddr; /* OUT */ 65 }; 66 67 union ether_get_mac_address_binding { 68 struct device_call_generic generic; 69 struct { 70 const char *name; 71 struct ether_get_mac_address_args *args; 72 } binding; 73 }; 74 75 #define ETHER_GET_MAC_ADDRESS_STR "ether-get-mac-address" 76 77 #define ETHER_GET_MAC_ADDRESS(_args_) \ 78 &((const union ether_get_mac_address_binding){ \ 79 .binding.name = "ether-get-mac-address", \ 80 .binding.args = (_args_), \ 81 }) 82 83 #endif /* _ETHER_CALLS_H_ */ 84