1138fe4e0SKonrad Rzeszutek /* 2138fe4e0SKonrad Rzeszutek * Copyright 2007 Red Hat, Inc. 3138fe4e0SKonrad Rzeszutek * by Peter Jones <[email protected]> 4138fe4e0SKonrad Rzeszutek * Copyright 2007 IBM, Inc. 5138fe4e0SKonrad Rzeszutek * by Konrad Rzeszutek <[email protected]> 6138fe4e0SKonrad Rzeszutek * Copyright 2008 7138fe4e0SKonrad Rzeszutek * by Konrad Rzeszutek <[email protected]> 8138fe4e0SKonrad Rzeszutek * 9138fe4e0SKonrad Rzeszutek * This code exposes the iSCSI Boot Format Table to userland via sysfs. 10138fe4e0SKonrad Rzeszutek * 11138fe4e0SKonrad Rzeszutek * This program is free software; you can redistribute it and/or modify 12138fe4e0SKonrad Rzeszutek * it under the terms of the GNU General Public License v2.0 as published by 13138fe4e0SKonrad Rzeszutek * the Free Software Foundation 14138fe4e0SKonrad Rzeszutek * 15138fe4e0SKonrad Rzeszutek * This program is distributed in the hope that it will be useful, 16138fe4e0SKonrad Rzeszutek * but WITHOUT ANY WARRANTY; without even the implied warranty of 17138fe4e0SKonrad Rzeszutek * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18138fe4e0SKonrad Rzeszutek * GNU General Public License for more details. 19138fe4e0SKonrad Rzeszutek */ 20138fe4e0SKonrad Rzeszutek 21138fe4e0SKonrad Rzeszutek #ifndef ISCSI_IBFT_H 22138fe4e0SKonrad Rzeszutek #define ISCSI_IBFT_H 23138fe4e0SKonrad Rzeszutek 24138fe4e0SKonrad Rzeszutek struct ibft_table_header { 25138fe4e0SKonrad Rzeszutek char signature[4]; 26138fe4e0SKonrad Rzeszutek u32 length; 27138fe4e0SKonrad Rzeszutek u8 revision; 28138fe4e0SKonrad Rzeszutek u8 checksum; 29138fe4e0SKonrad Rzeszutek char oem_id[6]; 30138fe4e0SKonrad Rzeszutek char oem_table_id[8]; 31138fe4e0SKonrad Rzeszutek char reserved[24]; 32138fe4e0SKonrad Rzeszutek } __attribute__((__packed__)); 33138fe4e0SKonrad Rzeszutek 34138fe4e0SKonrad Rzeszutek /* 35138fe4e0SKonrad Rzeszutek * Logical location of iSCSI Boot Format Table. 36138fe4e0SKonrad Rzeszutek * If the value is NULL there is no iBFT on the machine. 37138fe4e0SKonrad Rzeszutek */ 38138fe4e0SKonrad Rzeszutek extern struct ibft_table_header *ibft_addr; 39138fe4e0SKonrad Rzeszutek 40138fe4e0SKonrad Rzeszutek /* 41138fe4e0SKonrad Rzeszutek * Routine used to find and reserve the iSCSI Boot Format Table. The 42138fe4e0SKonrad Rzeszutek * mapped address is set in the ibft_addr variable. 43138fe4e0SKonrad Rzeszutek */ 44138fe4e0SKonrad Rzeszutek #ifdef CONFIG_ISCSI_IBFT_FIND 45*042be38eSYinghai Lu unsigned long find_ibft_region(unsigned long *sizep); 46138fe4e0SKonrad Rzeszutek #else 47*042be38eSYinghai Lu static inline unsigned long find_ibft_region(unsigned long *sizep) 48*042be38eSYinghai Lu { 49*042be38eSYinghai Lu *sizep = 0; 50*042be38eSYinghai Lu return 0; 51*042be38eSYinghai Lu } 52138fe4e0SKonrad Rzeszutek #endif 53138fe4e0SKonrad Rzeszutek 54138fe4e0SKonrad Rzeszutek #endif /* ISCSI_IBFT_H */ 55