thunderbolt: Read switch uid from EEPROM

Add eeprom access code and read the uid during switch initialization.
The UID will be used to check device identity after suspend.

Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Andreas Noever
2014-06-03 22:04:11 +02:00
committed by Greg Kroah-Hartman
parent 1df5172c5c
commit c90553b3c4
4 changed files with 198 additions and 1 deletions

View File

@@ -376,6 +376,11 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, u64 route)
}
sw->cap_plug_events = cap;
if (tb_eeprom_read_uid(sw, &sw->uid))
tb_sw_warn(sw, "could not read uid from eeprom\n");
else
tb_sw_info(sw, "uid: %#llx\n", sw->uid);
if (tb_plug_events_active(sw, true))
goto err;