]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/thunderbolt/tb.h
thunderbolt: Introduce USB only (SL4) security level
[mirror_ubuntu-bionic-kernel.git] / drivers / thunderbolt / tb.h
index 895c57a0a090b4f1ab958bf8caf1f46f3e78ad63..9d9f0ca16bfbea9bd18695ee712757df0354730f 100644 (file)
@@ -66,6 +66,7 @@ struct tb_switch_nvm {
  * @nvm: Pointer to the NVM if the switch has one (%NULL otherwise)
  * @no_nvm_upgrade: Prevent NVM upgrade of this switch
  * @safe_mode: The switch is in safe-mode
+ * @boot: Whether the switch was already authorized on boot or not
  * @authorized: Whether the switch is authorized by user or policy
  * @work: Work used to automatically authorize a switch
  * @security_level: Switch supported security level
@@ -99,6 +100,7 @@ struct tb_switch {
        struct tb_switch_nvm *nvm;
        bool no_nvm_upgrade;
        bool safe_mode;
+       bool boot;
        unsigned int authorized;
        struct work_struct work;
        enum tb_security_level security_level;
@@ -198,6 +200,8 @@ struct tb_path {
  * @suspend: Connection manager specific suspend
  * @complete: Connection manager specific complete
  * @handle_event: Handle thunderbolt event
+ * @get_boot_acl: Get boot ACL list
+ * @set_boot_acl: Set boot ACL list
  * @approve_switch: Approve switch
  * @add_switch_key: Add key to switch
  * @challenge_switch_key: Challenge switch using key
@@ -215,6 +219,8 @@ struct tb_cm_ops {
        void (*complete)(struct tb *tb);
        void (*handle_event)(struct tb *tb, enum tb_cfg_pkg_type,
                             const void *buf, size_t size);
+       int (*get_boot_acl)(struct tb *tb, uuid_t *uuids, size_t nuuids);
+       int (*set_boot_acl)(struct tb *tb, const uuid_t *uuids, size_t nuuids);
        int (*approve_switch)(struct tb *tb, struct tb_switch *sw);
        int (*add_switch_key)(struct tb *tb, struct tb_switch *sw);
        int (*challenge_switch_key)(struct tb *tb, struct tb_switch *sw,
@@ -386,6 +392,14 @@ struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
                                               u8 depth);
 struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
+struct tb_switch *tb_switch_find_by_route(struct tb *tb, u64 route);
+
+static inline struct tb_switch *tb_switch_get(struct tb_switch *sw)
+{
+       if (sw)
+               get_device(&sw->dev);
+       return sw;
+}
 
 static inline void tb_switch_put(struct tb_switch *sw)
 {