iPXE
mlx_pci.h
Go to the documentation of this file.
00001 #ifndef STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_
00002 #define STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_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 "mlx_utils.h"
00026 
00027 typedef enum {
00028                           MlxPciWidthUint8      = 0,
00029                           MlxPciWidthUint16,
00030                           MlxPciWidthUint32,
00031                           MlxPciWidthUint64,
00032 } mlx_pci_width;
00033 
00034 mlx_status
00035 mlx_pci_init(
00036                         IN mlx_utils *utils
00037                         );
00038 
00039 mlx_status
00040 mlx_pci_teardown(
00041                         IN mlx_utils *utils
00042                         );
00043 
00044 mlx_status
00045 mlx_pci_read(
00046                         IN mlx_utils *utils,
00047                         IN mlx_pci_width width,
00048                         IN mlx_uint32 offset,
00049                         IN mlx_uintn count,
00050                         OUT mlx_void *buffer
00051                         );
00052 
00053 mlx_status
00054 mlx_pci_write(
00055                         IN mlx_utils *utils,
00056                         IN mlx_pci_width width,
00057                         IN mlx_uint32 offset,
00058                         IN mlx_uintn count,
00059                         IN mlx_void *buffer
00060                         );
00061 
00062 mlx_status
00063 mlx_pci_mem_read(
00064                                 IN mlx_utils *utils,
00065                                 IN mlx_pci_width width,
00066                                 IN mlx_uint8 bar_index,
00067                                 IN mlx_uint64 offset,
00068                                 IN mlx_uintn count,
00069                                 OUT mlx_void *buffer
00070                                 );
00071 
00072 mlx_status
00073 mlx_pci_mem_write(
00074                                 IN mlx_utils *utils,
00075                                 IN mlx_pci_width width,
00076                                 IN mlx_uint8 bar_index,
00077                                 IN mlx_uint64 offset,
00078                                 IN mlx_uintn count,
00079                                 IN mlx_void *buffer
00080                                 );
00081 
00082 
00083 #endif /* STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_ */