-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dell-dock: add support for k2 dock #7355
Conversation
I'm seeing an error with WD19 that the child device is somewhat early finalized than the parent, I have no idea how to make the order. This issue isn't reproducible with origin/main, @superm1 any suggestion?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment; it would be a lot easier to review if you can split this into individual commits.
It will also be a lot easier to bisect when/how problems are introduced if you have individual commits.
plugins/dell-dock/meson.build
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth a commit before you add this to sort the list and put them in the right place alphabetically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #7369 to rebuild the base.
@@ -0,0 +1,24 @@ | |||
/* | |||
* Copyright 2018 Dell Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely 2024 for a new file?
@@ -0,0 +1,24 @@ | |||
/* | |||
* Copyright 2018 Dell Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely 2024 for a new file?
@@ -0,0 +1,34 @@ | |||
/* | |||
* Copyright 2018 Realtek Semiconductor Corporation | |||
* Copyright 2018 Dell Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024 right?
g_autoptr(FuDeviceLocker) locker = NULL; | ||
|
||
locker = fu_device_locker_new(device, error); | ||
if (locker == NULL) | ||
if (!fu_device_open(device, error)) | ||
return FALSE; | ||
|
||
fu_plugin_device_add(plugin, device); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this a device lifecycle problem? You'll leave it open after it's created
name = g_string_new(self->dock_data->marketing_name); | ||
if (name->len > 0) | ||
fu_device_set_name(device, name->str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has this happened in practice? I would think you should just be able to do fu_device_set_name(device, self->dock_data->marketing_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the enums in this file should be rustgen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, -- and also structs like FuDellDockVer2DockFWVersion
/* header */ | ||
fu_byte_array_append_uint8(fwbuf, HID_v2_CMD_WRITE_DATA); | ||
fu_byte_array_append_uint8(fwbuf, HID_v2_EXT_WRITE_DATA); | ||
fu_byte_array_append_uint32(fwbuf, 7 + fw_size, G_BIG_ENDIAN); // 7 = sizeof(command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 7 = sizeof(command)
, how about just use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the command here means total bytes from below section, i.e.: 1 + 1 + 1 + 4. I haven't found a way to streamline hardcoded 7 into the sum of bytes.
And you can do your generic "get ready" changes that move lines around and rename stuff and definitely don't break things immediately in another PR too to make this one a lot smaller. |
if (!fu_device_open(FU_DEVICE(hub_device), error)) | ||
return FALSE; | ||
} else { | ||
hub_device = FU_DELL_DOCK_HUB(device); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just realized that this assignment (or even with g_steal_pointer) will fall into a situation that a ghost device in the plugin. I don't have better way to do this but currently it is https://github.com/fwupd/fwupd/pull/7369/files#diff-cf3e2d3d7e960a425b0276b4438c42ef41d1d841fddafa0d256331654f303844R202.
} else { | ||
g_set_error_literal(error, | ||
FWUPD_ERROR, | ||
FWUPD_ERROR_NOT_SUPPORTED, | ||
"no valid proxy for package update."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should return FALSE
in this branch
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UNSIGNED_PAYLOAD); | ||
fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_SIGNED_PAYLOAD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really right? The package is being signed now? It's different from WD19/WD22 then. There should be special casing between docks for this flag it means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just reconfirmed the status package itself is unsigned, will fix it.
#define FU_TYPE_DELL_DOCK_PD_FIRMWARE (fu_dell_dock_pd_firmware_get_type()) | ||
G_DECLARE_FINAL_TYPE(FuDellDockPdFirmware, | ||
fu_dell_dock_pd_firmware, | ||
FU, | ||
DELL_DOCK_PD_FIRMWARE, | ||
FuFirmware) | ||
|
||
FuFirmware * | ||
fu_dell_dock_pd_firmware_new(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing a call to fu_plugin_add_firmware_gtype
to register this. Look at when/how other plugins do it.
Type of pull request: