Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[driver] Add support for the AoE boot firmware table (aBFT)
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
- Loading branch information
Showing
7 changed files
with
491 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* 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. | ||
*/ | ||
|
||
#pragma warning(disable:4100) /* unreferenced formal parameter */ | ||
|
||
#include <ntddk.h> | ||
#include <ntstrsafe.h> | ||
#include "sanbootconf.h" | ||
#include "nic.h" | ||
#include "abft.h" | ||
|
||
/** | ||
* Do nothing with NIC | ||
* | ||
* @v pdo Physical device object | ||
* @v netcfginstanceid Interface name within registry | ||
* @v opaque iBFT NIC structure | ||
* @ret ntstatus NT status | ||
*/ | ||
static NTSTATUS abft_dummy ( PDEVICE_OBJECT pdo, | ||
LPCWSTR netcfginstanceid, | ||
PVOID opaque ) { | ||
return STATUS_SUCCESS; | ||
} | ||
|
||
/** | ||
* Parse aBFT | ||
* | ||
* @v acpi ACPI description header | ||
*/ | ||
VOID parse_abft ( PACPI_DESCRIPTION_HEADER acpi ) { | ||
PABFT_TABLE abft = ( PABFT_TABLE ) acpi; | ||
NTSTATUS status; | ||
|
||
/* Dump structure information */ | ||
DbgPrint ( "Found aBFT target e%d.%d\n", abft->shelf, abft->slot ); | ||
DbgPrint ( "Found aBFT NIC %02x:%02x:%02x:%02x:%02x:%02x\n", | ||
abft->mac[0], abft->mac[1], abft->mac[2], | ||
abft->mac[3], abft->mac[4], abft->mac[5] ); | ||
|
||
/* Check for existence of NIC */ | ||
status = find_nic ( abft->mac, abft_dummy, NULL ); | ||
if ( NT_SUCCESS ( status ) ) { | ||
DbgPrint ( "Successfully identified aBFT NIC\n" ); | ||
} else { | ||
DbgPrint ( "Could not identify aBFT NIC\n" ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef _ABFT_H | ||
#define _ABFT_H | ||
|
||
/* | ||
* Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* 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. | ||
*/ | ||
|
||
/** @file | ||
* | ||
* AoE boot firmware table | ||
* | ||
* The working draft specification for the SRP boot firmware table can | ||
* be found at | ||
* | ||
* http://www.etherboot.org/wiki/aoe/abft | ||
* | ||
*/ | ||
|
||
#include "acpi.h" | ||
|
||
/** AoE Boot Firmware Table signature */ | ||
#define ABFT_SIG "aBFT" | ||
|
||
/** | ||
* AoE Boot Firmware Table (aBFT) | ||
*/ | ||
#pragma pack(1) | ||
typedef struct _ABFT_TABLE { | ||
/** ACPI header */ | ||
ACPI_DESCRIPTION_HEADER acpi; | ||
/** AoE shelf */ | ||
USHORT shelf; | ||
/** AoE slot */ | ||
UCHAR slot; | ||
/** Reserved */ | ||
UCHAR reserved_a; | ||
/** MAC address */ | ||
UCHAR mac[6]; | ||
} ABFT_TABLE, *PABFT_TABLE; | ||
#pragma pack() | ||
|
||
extern VOID parse_abft ( PACPI_DESCRIPTION_HEADER acpi ); | ||
|
||
#endif /* _ABFT_H */ |
Oops, something went wrong.