/*
* Copyright (C) 2011 Michael Brown <mbrown@fensystems.co.uk>.
*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <errno.h>
/** @file
*
* IBM BladeCenter Open Fabric Manager (BOFM) EFI interface
*
*/
/***************************************************************************
*
* EFI BOFM definitions
*
***************************************************************************
*
* Taken from the BOFM UEFI Vendor Specification document
*
*/
{ 0x03207ce2, 0xd9c7, 0x11dc, \
{ 0xa9, 0x4d, 0x00, 0x19, 0x7d, 0x89, 0x02, 0x38 } }
{ 0xe82a9763, 0x0584, 0x4e41, \
{ 0xbb, 0x39, 0xe0, 0xcd, 0xb8, 0xc1, 0xf0, 0xfc } }
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct _IBM_BOFM_DRIVER_CONFIGURATION_PROTOCOL
typedef struct _IBM_BOFM_DRIVER_CONFIGURATION_PROTOCOL2
);
);
);
};
};
/***************************************************************************
*
* EFI BOFM interface
*
***************************************************************************
*/
/** BOFM1 protocol GUID */
/** BOFM2 protocol GUID */
/**
* Check if device is supported
*
* @v driver EFI driver
* @v device EFI device
* @v child Path to child device, if any
* @ret efirc EFI status code
*/
static EFI_STATUS EFIAPI
union {
void *interface;
} bofm1;
int rc;
/* Create corresponding PCI device, if any */
if ( ! efipci ) {
goto err_not_pci;
}
/* Look for a BOFM driver */
goto err_no_driver;
}
/* Locate BOFM protocol */
goto err_not_bofm;
}
/* Register support for this device */
0x04 /* Can change MAC */,
0x00 /* No iSCSI */,
0x02 /* Version */ ))!=0){
efi_strerror ( efirc ) );
goto err_cannot_register;
}
/* Destroy temporary PCI device */
return 0;
return efirc;
}
/**
* Attach driver to device
*
* @v driver EFI driver
* @v device EFI device
* @v child Path to child device, if any
* @ret efirc EFI status code
*/
union {
void *interface;
} bofm1;
union {
void *interface;
} bofm2;
int bofmrc;
/* Create corresponding PCI device */
if ( ! efipci ) {
goto err_create;
}
/* Enable PCI device */
goto err_enable;
/* Locate BOFM protocol */
goto err_locate_bofm;
}
/* Locate BOFM2 protocol, if available */
} else {
/* Not a fatal error; may be a BOFM1-only system */
}
/* Process BOFM table */
if ( bofmtab2 ) {
}
if ( bofmtab2 ) {
}
/* Return BOFM status */
if ( bofmtab2 ) {
efi_strerror ( efirc ) );
goto err_set_status;
}
} else {
efi_strerror ( efirc ) );
goto err_set_status;
}
}
/* Destroy the PCI device anyway; we have no further use for it */
/* BOFM (ab)uses the "start" method to mean "process and exit" */
return EFI_NOT_READY;
return efirc;
}
/**
* Detach driver from device
*
* @v driver EFI driver
* @v device EFI device
* @v num_children Number of child devices
* @v children List of child devices
* @ret efirc EFI status code
*/
EFI_HANDLE *children ) {
return 0;
}
/** EFI BOFM driver */
EFI_DRIVER_INIT ( "BOFM",
/**
* Install EFI BOFM driver
*
*/
static void efi_bofm_driver_init ( void ) {
/* Install driver */
efi_strerror ( efirc ) );
return;
}
}
/** EFI BOFM startup function */
};