mac_client_priv.h revision 10309:1b8c848f3840
1218885Sdim/* 2218885Sdim * CDDL HEADER START 3218885Sdim * 4218885Sdim * The contents of this file are subject to the terms of the 5218885Sdim * Common Development and Distribution License (the "License"). 6218885Sdim * You may not use this file except in compliance with the License. 7218885Sdim * 8218885Sdim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9218885Sdim * or http://www.opensolaris.org/os/licensing. 10218885Sdim * See the License for the specific language governing permissions 11218885Sdim * and limitations under the License. 12218885Sdim * 13218885Sdim * When distributing Covered Code, include this CDDL HEADER in each 14218885Sdim * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15218885Sdim * If applicable, add the following below this CDDL HEADER, with the 16218885Sdim * fields enclosed by brackets "[]" replaced with your own identifying 17218885Sdim * information: Portions Copyright [yyyy] [name of copyright owner] 18218885Sdim * 19218885Sdim * CDDL HEADER END 20218885Sdim */ 21218885Sdim 22226633Sdim/* 23226633Sdim * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24226633Sdim * Use is subject to license terms. 25218885Sdim */ 26218885Sdim 27218885Sdim/* 28218885Sdim * This file contains *private* MAC API definitions. This header file 29234353Sdim * should only be included by kernel components which are part of the 30218885Sdim * GLDv3 stack (dld, dls, aggr, softmac). 31218885Sdim */ 32218885Sdim 33218885Sdim#ifndef _SYS_MAC_CLIENT_PRIV_H 34218885Sdim#define _SYS_MAC_CLIENT_PRIV_H 35218885Sdim 36218885Sdim#include <sys/mac.h> 37218885Sdim#include <sys/mac_flow.h> 38218885Sdim 39218885Sdim#ifdef __cplusplus 40218885Sdimextern "C" { 41218885Sdim#endif 42218885Sdim 43218885Sdim#ifdef _KERNEL 44218885Sdim 45234353Sdim#ifdef DEBUG 46234353Sdim#define MAC_PERIM_HELD(mph) mac_perim_held(mph) 47234353Sdim#else 48234353Sdim#define MAC_PERIM_HELD(mph) 49218885Sdim#endif 50234353Sdim 51234353Sdimextern boolean_t mac_rx_bypass_set(mac_client_handle_t, mac_direct_rx_t, 52218885Sdim void *); 53234353Sdim 54234353Sdimextern const mac_info_t *mac_info(mac_handle_t); 55218885Sdimextern boolean_t mac_info_get(const char *, mac_info_t *); 56234353Sdimextern boolean_t mac_promisc_get(mac_handle_t); 57234353Sdim 58234353Sdimextern int mac_start(mac_handle_t); 59234353Sdimextern void mac_stop(mac_handle_t); 60234353Sdim 61234353Sdimextern void mac_ioctl(mac_handle_t, queue_t *, mblk_t *); 62218885Sdimextern link_state_t mac_link_get(mac_handle_t); 63218885Sdimextern void mac_resource_set(mac_client_handle_t, mac_resource_add_t, void *); 64234353Sdimextern dev_info_t *mac_devinfo_get(mac_handle_t); 65234353Sdimextern void *mac_driver(mac_handle_t); 66234353Sdimextern boolean_t mac_capab_get(mac_handle_t, mac_capab_t, void *); 67234353Sdimextern boolean_t mac_sap_verify(mac_handle_t, uint32_t, uint32_t *); 68218885Sdimextern mblk_t *mac_header(mac_handle_t, const uint8_t *, uint32_t, mblk_t *, 69218885Sdim size_t); 70234353Sdimextern int mac_header_info(mac_handle_t, mblk_t *, mac_header_info_t *); 71234353Sdimextern mblk_t *mac_header_cook(mac_handle_t, mblk_t *); 72234353Sdimextern mblk_t *mac_header_uncook(mac_handle_t, mblk_t *); 73234353Sdim 74218885Sdimextern void mac_resource_set_common(mac_client_handle_t, 75218885Sdim mac_resource_add_t, mac_resource_remove_t, mac_resource_quiesce_t, 76234353Sdim mac_resource_restart_t, mac_resource_bind_t, void *); 77234353Sdim 78234353Sdimextern void mac_perim_enter_by_mh(mac_handle_t, mac_perim_handle_t *); 79234353Sdimextern int mac_perim_enter_by_macname(const char *, mac_perim_handle_t *); 80234353Sdimextern int mac_perim_enter_by_linkid(datalink_id_t, mac_perim_handle_t *); 81234353Sdimextern void mac_perim_exit(mac_perim_handle_t); 82234353Sdimextern boolean_t mac_perim_held(mac_handle_t); 83234353Sdim 84234353Sdimextern uint16_t mac_client_vid(mac_client_handle_t); 85218885Sdimextern int mac_vnic_unicast_set(mac_client_handle_t, const uint8_t *); 86218885Sdimextern boolean_t mac_client_is_vlan_vnic(mac_client_handle_t); 87234353Sdim 88234353Sdimextern void mac_client_poll_enable(mac_client_handle_t); 89218885Sdimextern void mac_client_poll_disable(mac_client_handle_t); 90234353Sdim 91234353Sdimextern int mac_resource_ctl_set(mac_client_handle_t, mac_resource_props_t *); 92234353Sdimextern void mac_resource_ctl_get(mac_client_handle_t, mac_resource_props_t *); 93218885Sdim 94234353Sdim/* 95234353Sdim * Flow-related APIs for MAC clients. 96218885Sdim */ 97218885Sdim 98234353Sdimextern void mac_link_init_flows(mac_client_handle_t); 99234353Sdimextern void mac_link_release_flows(mac_client_handle_t); 100218885Sdimextern int mac_link_flow_add(datalink_id_t, char *, flow_desc_t *, 101234353Sdim mac_resource_props_t *); 102218885Sdimextern int mac_link_flow_remove(char *); 103234353Sdimextern int mac_link_flow_modify(char *, mac_resource_props_t *); 104234353Sdimextern boolean_t mac_link_has_flows(mac_client_handle_t); 105234353Sdim 106234353Sdimtypedef struct { 107234353Sdim char fi_flow_name[MAXFLOWNAMELEN]; 108218885Sdim datalink_id_t fi_link_id; 109234353Sdim flow_desc_t fi_flow_desc; 110234353Sdim mac_resource_props_t fi_resource_props; 111234353Sdim} mac_flowinfo_t; 112234353Sdim 113234353Sdimextern int mac_link_flow_walk(datalink_id_t, 114218885Sdim int (*)(mac_flowinfo_t *, void *), void *); 115218885Sdimextern int mac_link_flow_info(char *, mac_flowinfo_t *); 116234353Sdim 117234353Sdimextern void *mac_tx_hold(mac_client_handle_t); 118234353Sdimextern void mac_tx_rele(mac_client_handle_t, void *); 119218885Sdimextern void mac_rx_client_quiesce(mac_client_handle_t); 120234353Sdimextern void mac_rx_client_restart(mac_client_handle_t); 121234353Sdimextern void mac_srs_perm_quiesce(mac_client_handle_t, boolean_t); 122218885Sdimextern int mac_hwrings_get(mac_client_handle_t, mac_group_handle_t *, 123234353Sdim mac_ring_handle_t *, mac_ring_type_t); 124218885Sdimextern void mac_hwring_setup(mac_ring_handle_t, mac_resource_handle_t); 125234353Sdimextern void mac_hwring_teardown(mac_ring_handle_t); 126234353Sdimextern int mac_hwring_disable_intr(mac_ring_handle_t); 127234353Sdimextern int mac_hwring_enable_intr(mac_ring_handle_t); 128218885Sdimextern int mac_hwring_start(mac_ring_handle_t); 129218885Sdimextern void mac_hwring_stop(mac_ring_handle_t); 130218885Sdimextern mblk_t *mac_hwring_poll(mac_ring_handle_t, int); 131234353Sdim#define MAC_HWRING_POLL(ring, bytes) \ 132218885Sdim (((ring)->mr_info.mri_poll) \ 133234353Sdim ((ring)->mr_info.mri_driver, (bytes))) 134234353Sdim 135234353Sdimextern int mac_hwgroup_addmac(mac_group_handle_t, const uint8_t *); 136234353Sdimextern int mac_hwgroup_remmac(mac_group_handle_t, const uint8_t *); 137234353Sdim 138234353Sdimextern void mac_set_upper_mac(mac_client_handle_t, mac_handle_t); 139218885Sdim 140218885Sdimextern int mac_mark_exclusive(mac_handle_t); 141218885Sdimextern void mac_unmark_exclusive(mac_handle_t); 142218885Sdim 143218885Sdimextern int32_t mac_client_intr_cpu(mac_client_handle_t); 144218885Sdimextern void mac_client_set_intr_cpu(void *, mac_client_handle_t, int32_t); 145218885Sdimextern void *mac_get_devinfo(mac_handle_t); 146218885Sdim 147218885Sdim#endif /* _KERNEL */ 148218885Sdim 149218885Sdim#ifdef __cplusplus 150218885Sdim} 151#endif 152 153#endif /* _SYS_MAC_CLIENT_PRIV_H */ 154