mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-12 08:39:36 +00:00
[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:
parent
02f1f3066d
commit
d3d87a2d92
@ -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" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user