Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Apr 19, 2012
1 parent 02f1f30 commit d3d87a2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/interface/efi/efi_snp.c
Expand Up @@ -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" ) );
}

/**
Expand Down

0 comments on commit d3d87a2

Please sign in to comment.