aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-04-19 22:52:09 +0100
committerMichael Brown <mcb30@ipxe.org>2012-04-19 22:54:24 +0100
commitd3d87a2d92fef33d5ac93aaca38170b9666c7378 (patch)
tree3ddd18d803a8d1f5b167170e8445ac099d72ac45 /src
parent02f1f3066d434cf67b886a1cc482f74dee87479e (diff)
downloadipxe-d3d87a2d92fef33d5ac93aaca38170b9666c7378.tar.gz
[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')
-rw-r--r--src/interface/efi/efi_snp.c17
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" ) );
}
/**