mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-23 21:26:58 +00:00

We load the Thunderbolt controller firmware to see if the controller is in native mode, as this changes the GUID. If the controller is asleep the firmware is not cached by the kernel and it can take more than 4 seconds to read out 504kB of firmware. We only need the first two 64-byte chunks, so only read what is required. This speeds up fwupd starting substantially, and also means we don't have to allocate a giant chunk of heap memory just to inspect one byte. Fixes: https://github.com/hughsie/fwupd/issues/848
31 lines
686 B
C
31 lines
686 B
C
/*
|
|
* Copyright (C) 2017 Intel Corporation.
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.1+
|
|
*/
|
|
|
|
#ifndef __FU_THUNDERBOLT_IMAGE_H__
|
|
#define __FU_THUNDERBOLT_IMAGE_H__
|
|
|
|
#include <glib.h>
|
|
|
|
typedef enum {
|
|
VALIDATION_PASSED,
|
|
VALIDATION_FAILED,
|
|
UNKNOWN_DEVICE,
|
|
} FuPluginValidation;
|
|
|
|
/* byte offsets in firmware image */
|
|
#define FU_TBT_OFFSET_NATIVE 0x7B
|
|
#define FU_TBT_CHUNK_SZ 0x40
|
|
|
|
FuPluginValidation fu_thunderbolt_image_validate (GBytes *controller_fw,
|
|
GBytes *blob_fw,
|
|
GError **error);
|
|
|
|
gboolean fu_thunderbolt_image_controller_is_native (GBytes *controller_fw,
|
|
gboolean *is_native,
|
|
GError **error);
|
|
|
|
#endif /* __FU_THUNDERBOLT_IMAGE_H__ */
|