diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2021-04-12 14:25:08 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2021-06-01 09:53:32 +0200 |
commit | 1cbf680f7687f55ae5a1405556519bc70d66a616 (patch) | |
tree | eb5ac85abaffcae38f4924a2f667b84e00e62eaa /drivers/thunderbolt/usb4.c | |
parent | thunderbolt: Move nvm_write_ops to tb.h (diff) | |
download | linux-1cbf680f7687f55ae5a1405556519bc70d66a616.tar.xz linux-1cbf680f7687f55ae5a1405556519bc70d66a616.zip |
thunderbolt: Allow router NVM authenticate separately
It may be useful if the actual NVM authentication can be delayed to be
run later, for instance when the user logs out. For this reason add a
new NVM operation (AUHENTICATE_ONLY) that just triggers the authentication
procedure over whatever was written to the NVM storage.
This is not supported with Thunderbolt 1-3 devices, though.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/usb4.c')
-rw-r--r-- | drivers/thunderbolt/usb4.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c index 8af96dbaa7a7..76d7335aa440 100644 --- a/drivers/thunderbolt/usb4.c +++ b/drivers/thunderbolt/usb4.c @@ -547,8 +547,17 @@ int usb4_switch_nvm_read(struct tb_switch *sw, unsigned int address, void *buf, usb4_switch_nvm_read_block, sw); } -static int usb4_switch_nvm_set_offset(struct tb_switch *sw, - unsigned int address) +/** + * usb4_switch_nvm_set_offset() - Set NVM write offset + * @sw: USB4 router + * @address: Start offset + * + * Explicitly sets NVM write offset. Normally when writing to NVM this + * is done automatically by usb4_switch_nvm_write(). + * + * Returns %0 in success and negative errno if there was a failure. + */ +int usb4_switch_nvm_set_offset(struct tb_switch *sw, unsigned int address) { u32 metadata, dwaddress; u8 status = 0; |