david/ipxe
Archived
1
0

[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>
This commit is contained in:
Michael Brown 2012-04-19 22:52:09 +01:00
parent 02f1f3066d
commit d3d87a2d92

View File

@ -1282,8 +1282,21 @@ static int efi_snp_probe ( struct net_device *netdev ) {
* *
* @v netdev Network device * @v netdev Network device
*/ */
static void efi_snp_notify ( struct net_device *netdev __unused ) { static void efi_snp_notify ( struct net_device *netdev ) {
/* Nothing to do */ 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" ) );
} }
/** /**