diff options
| author | Michael Brown | 2012-04-19 23:52:09 +0200 |
|---|---|---|
| committer | Michael Brown | 2012-04-19 23:54:24 +0200 |
| commit | d3d87a2d92fef33d5ac93aaca38170b9666c7378 (patch) | |
| tree | 3ddd18d803a8d1f5b167170e8445ac099d72ac45 /src/interface/efi/efi_snp.c | |
| parent | [crypto] Allow trusted root certificate to be changed without a rebuild (diff) | |
| download | ipxe-d3d87a2d92fef33d5ac93aaca38170b9666c7378.tar.gz ipxe-d3d87a2d92fef33d5ac93aaca38170b9666c7378.tar.xz ipxe-d3d87a2d92fef33d5ac93aaca38170b9666c7378.zip | |
[efi] Update link state in SNP device mode data
There is no explicit SNP API call to determine link state; the SNP
interface user may check the MediaPresent field within the mode data
at any time.
Update the MediaPresent field whenever the link state changes.
Reported-by: Michael R Turner <mikeyt@us.ibm.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_snp.c')
| -rw-r--r-- | src/interface/efi/efi_snp.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c index 4c4998267..4df221c53 100644 --- a/src/interface/efi/efi_snp.c +++ b/src/interface/efi/efi_snp.c @@ -1282,8 +1282,21 @@ static int efi_snp_probe ( struct net_device *netdev ) { * * @v netdev Network device */ -static void efi_snp_notify ( struct net_device *netdev __unused ) { - /* Nothing to do */ +static void efi_snp_notify ( struct net_device *netdev ) { + struct efi_snp_device *snpdev; + + /* Locate SNP device */ + snpdev = efi_snp_demux ( netdev ); + if ( ! snpdev ) { + DBG ( "SNP skipping non-SNP device %s\n", netdev->name ); + return; + } + + /* Update link state */ + snpdev->mode.MediaPresent = + ( netdev_link_ok ( netdev ) ? TRUE : FALSE ); + DBGC ( snpdev, "SNPDEV %p link is %s\n", snpdev, + ( snpdev->mode.MediaPresent ? "up" : "down" ) ); } /** |
