iPXE
mlx_mtu.h
Go to the documentation of this file.
00001 #ifndef MLX_MTU_H_
00002 #define MLX_MTU_H_
00003 
00004 /*
00005  * Copyright (C) 2015 Mellanox Technologies Ltd.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301, USA.
00021  */
00022 
00023 FILE_LICENCE ( GPL2_OR_LATER );
00024 
00025 #include "../../include/public/mlx_utils.h"
00026 #include "../../mlx_lib/mlx_reg_access/mlx_reg_access.h"
00027 
00028 #define BYTE_TO_BIT     0x8
00029 
00030 struct mlx_mtu {
00031         mlx_uint32 reserved1    :16;
00032         mlx_uint32 local_port   :8;
00033         mlx_uint32 reserved2    :8;
00034         /* -------------- */
00035         mlx_uint32 reserved3    :16;
00036         mlx_uint32 max_mtu              :16;
00037         /* -------------- */
00038         mlx_uint32 reserved4    :16;
00039         mlx_uint32 admin_mtu    :16;
00040         /* -------------- */
00041         mlx_uint32 reserved5    :16;
00042         mlx_uint32 oper_mtu             :16;
00043 };
00044 
00045 mlx_status
00046 mlx_get_max_mtu(
00047                 IN mlx_utils    *utils,
00048                 IN mlx_uint8    port_num,
00049                 OUT mlx_uint32  *max_mtu
00050                 );
00051 
00052 mlx_status
00053 mlx_set_admin_mtu(
00054                 IN mlx_utils    *utils,
00055                 IN mlx_uint8    port_num,
00056                 IN mlx_uint32   admin_mtu
00057                 );
00058 #endif /* MLX_MTU_H_ */