mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 10:06:41 +00:00
dfu: Invalidate the DFU mode, state and status when replugging
This commit is contained in:
parent
5826838987
commit
fd4697188a
@ -1706,6 +1706,9 @@ dfu_device_set_new_usb_dev (DfuDevice *device, GUsbDevice *dev,
|
|||||||
g_clear_object (&priv->dev);
|
g_clear_object (&priv->dev);
|
||||||
g_ptr_array_set_size (priv->targets, 0);
|
g_ptr_array_set_size (priv->targets, 0);
|
||||||
priv->claimed_interface = FALSE;
|
priv->claimed_interface = FALSE;
|
||||||
|
priv->mode = DFU_MODE_UNKNOWN;
|
||||||
|
priv->state = DFU_STATE_LAST;
|
||||||
|
priv->status = DFU_STATUS_LAST;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2029,7 +2032,8 @@ dfu_device_upload (DfuDevice *device,
|
|||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
FWUPD_ERROR,
|
FWUPD_ERROR,
|
||||||
FWUPD_ERROR_NOT_SUPPORTED,
|
FWUPD_ERROR_NOT_SUPPORTED,
|
||||||
"device is not in DFU mode");
|
"device is not in DFU mode, got %s",
|
||||||
|
dfu_mode_to_string (priv->mode));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
g_debug ("detaching");
|
g_debug ("detaching");
|
||||||
@ -2227,7 +2231,8 @@ dfu_device_download (DfuDevice *device,
|
|||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
FWUPD_ERROR,
|
FWUPD_ERROR,
|
||||||
FWUPD_ERROR_NOT_SUPPORTED,
|
FWUPD_ERROR_NOT_SUPPORTED,
|
||||||
"device is not in DFU mode");
|
"device is not in DFU mode, got %s",
|
||||||
|
dfu_mode_to_string (priv->mode));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user