131557f0fSJiri Pirko /* 231557f0fSJiri Pirko * drivers/net/ethernet/mellanox/mlxsw/txheader.h 331557f0fSJiri Pirko * Copyright (c) 2015 Mellanox Technologies. All rights reserved. 431557f0fSJiri Pirko * Copyright (c) 2015 Ido Schimmel <idosch@mellanox.com> 531557f0fSJiri Pirko * Copyright (c) 2015 Jiri Pirko <jiri@mellanox.com> 631557f0fSJiri Pirko * 731557f0fSJiri Pirko * Redistribution and use in source and binary forms, with or without 831557f0fSJiri Pirko * modification, are permitted provided that the following conditions are met: 931557f0fSJiri Pirko * 1031557f0fSJiri Pirko * 1. Redistributions of source code must retain the above copyright 1131557f0fSJiri Pirko * notice, this list of conditions and the following disclaimer. 1231557f0fSJiri Pirko * 2. Redistributions in binary form must reproduce the above copyright 1331557f0fSJiri Pirko * notice, this list of conditions and the following disclaimer in the 1431557f0fSJiri Pirko * documentation and/or other materials provided with the distribution. 1531557f0fSJiri Pirko * 3. Neither the names of the copyright holders nor the names of its 1631557f0fSJiri Pirko * contributors may be used to endorse or promote products derived from 1731557f0fSJiri Pirko * this software without specific prior written permission. 1831557f0fSJiri Pirko * 1931557f0fSJiri Pirko * Alternatively, this software may be distributed under the terms of the 2031557f0fSJiri Pirko * GNU General Public License ("GPL") version 2 as published by the Free 2131557f0fSJiri Pirko * Software Foundation. 2231557f0fSJiri Pirko * 2331557f0fSJiri Pirko * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2431557f0fSJiri Pirko * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2531557f0fSJiri Pirko * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2631557f0fSJiri Pirko * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2731557f0fSJiri Pirko * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2831557f0fSJiri Pirko * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2931557f0fSJiri Pirko * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 3031557f0fSJiri Pirko * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3131557f0fSJiri Pirko * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3231557f0fSJiri Pirko * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3331557f0fSJiri Pirko * POSSIBILITY OF SUCH DAMAGE. 3431557f0fSJiri Pirko */ 3531557f0fSJiri Pirko 3631557f0fSJiri Pirko #ifndef _MLXSW_TXHEADER_H 3731557f0fSJiri Pirko #define _MLXSW_TXHEADER_H 3831557f0fSJiri Pirko 3931557f0fSJiri Pirko #define MLXSW_TXHDR_LEN 0x10 4031557f0fSJiri Pirko #define MLXSW_TXHDR_VERSION_0 0 41*56ade8feSJiri Pirko #define MLXSW_TXHDR_VERSION_1 1 4231557f0fSJiri Pirko 4331557f0fSJiri Pirko enum { 4431557f0fSJiri Pirko MLXSW_TXHDR_ETH_CTL, 4531557f0fSJiri Pirko MLXSW_TXHDR_ETH_DATA, 4631557f0fSJiri Pirko }; 4731557f0fSJiri Pirko 4831557f0fSJiri Pirko #define MLXSW_TXHDR_PROTO_ETH 1 4931557f0fSJiri Pirko 5031557f0fSJiri Pirko enum { 5131557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_0, 5231557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_1, 5331557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_2, 5431557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_3, 5531557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_4, 5631557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_5, 5731557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_6, 5831557f0fSJiri Pirko MLXSW_TXHDR_ETCLASS_7, 5931557f0fSJiri Pirko }; 6031557f0fSJiri Pirko 6131557f0fSJiri Pirko enum { 6231557f0fSJiri Pirko MLXSW_TXHDR_RDQ_OTHER, 6331557f0fSJiri Pirko MLXSW_TXHDR_RDQ_EMAD = 0x1f, 6431557f0fSJiri Pirko }; 6531557f0fSJiri Pirko 6631557f0fSJiri Pirko #define MLXSW_TXHDR_CTCLASS3 0 6731557f0fSJiri Pirko #define MLXSW_TXHDR_CPU_SIG 0 6831557f0fSJiri Pirko #define MLXSW_TXHDR_SIG 0xE0E0 6931557f0fSJiri Pirko #define MLXSW_TXHDR_STCLASS_NONE 0 7031557f0fSJiri Pirko 7131557f0fSJiri Pirko enum { 7231557f0fSJiri Pirko MLXSW_TXHDR_NOT_EMAD, 7331557f0fSJiri Pirko MLXSW_TXHDR_EMAD, 7431557f0fSJiri Pirko }; 7531557f0fSJiri Pirko 7631557f0fSJiri Pirko enum { 7731557f0fSJiri Pirko MLXSW_TXHDR_TYPE_DATA, 7831557f0fSJiri Pirko MLXSW_TXHDR_TYPE_CONTROL = 6, 7931557f0fSJiri Pirko }; 8031557f0fSJiri Pirko 8131557f0fSJiri Pirko #endif 82