}
va_end ( args );
end = dst;
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
return path;
}
} else {
end = ( ( ( void * ) macpath ) + sizeof ( *macpath ) );
}
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
return path;
}
uripath->Header.Length[1] = ( uripath_len >> 8 );
format_uri ( uri, uripath->Uri, uri_len );
end = ( ( ( void * ) path ) + uripath_len );
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
return path;
}
name = ( ( ( void * ) iscsipath ) + sizeof ( *iscsipath ) );
memcpy ( name, iscsi->target_iqn, name_len );
end = ( ( ( void * ) name ) + name_len );
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
/* Free temporary paths */
free ( netpath );
satapath.sata.Header.Length[0] = sizeof ( satapath.sata );
satapath.sata.HBAPortNumber = aoedev->major;
satapath.sata.PortMultiplierPortNumber = aoedev->minor;
- satapath.end.Type = END_DEVICE_PATH_TYPE;
- satapath.end.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- satapath.end.Length[0] = sizeof ( satapath.end );
+ efi_path_terminate ( &satapath.end );
/* Construct overall device path */
path = efi_paths ( netpath, &satapath, NULL );
path->fc.Header.Length[0] = sizeof ( path->fc );
memcpy ( path->fc.WWN, &desc->wwn, sizeof ( path->fc.WWN ) );
memcpy ( path->fc.Lun, &desc->lun, sizeof ( path->fc.Lun ) );
- path->end.Type = END_DEVICE_PATH_TYPE;
- path->end.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- path->end.Length[0] = sizeof ( path->end );
+ efi_path_terminate ( &path->end );
return &path->fc.Header;
}
memcpy ( &ibpath->DeviceId, &id->ib.id_ext,
sizeof ( ibpath->DeviceId ) );
end = ( ( ( void * ) ibpath ) + sizeof ( *ibpath ) );
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
return path;
}
/* Construct device path */
memcpy ( path, efidev->path, prefix_len );
end = ( ( ( void * ) path ) + len - sizeof ( *end ) );
- end->Type = END_DEVICE_PATH_TYPE;
- end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- end->Length[0] = sizeof ( *end );
+ efi_path_terminate ( end );
usbpath = ( ( ( void * ) end ) - sizeof ( *usbpath ) );
usbpath->InterfaceNumber = func->interface[0];
for ( ; usb ; usbpath--, usb = usb->port->hub->usb ) {