summaryrefslogtreecommitdiff
path: root/include/linux/switchtec.h
diff options
context:
space:
mode:
authorKelvin Cao <kelvin.cao@microsemi.com>2017-11-29 10:55:24 -0700
committerJon Mason <jdmason@kudzu.us>2018-01-28 22:17:23 -0500
commit3df54c870f52b4c47b53eead8d22a109f741b91c (patch)
tree2d5a63d9462ff3533eb56bf4f0e200d6f508303f /include/linux/switchtec.h
parent2dd0f6a64a36bf7176c6055c919da3f53b7924f3 (diff)
downloadlwn-3df54c870f52b4c47b53eead8d22a109f741b91c.tar.gz
lwn-3df54c870f52b4c47b53eead8d22a109f741b91c.zip
ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups
Allow using Switchtec NTB in setups that have more than two partitions. Note: this does not enable having multi-host communication, it only allows for a single NTB link between two hosts in a network that might have more than two. Use following logic to determine the NT peer partition: 1) If there are 2 partitions, and the target vector is set in the Switchtec configuration, use the partition specified in target vector. 2) If there are 2 partitions and target vector is unset use the only other partition as specified in the NT EP map. 3) If there are more than 2 partitions and target vector is set use the other partition specified in target vector. 4) If there are more than 2 partitions and target vector is unset, this is invalid and report an error. Signed-off-by: Kelvin Cao <kelvin.cao@microsemi.com> [logang@deltatee.com: commit message fleshed out] Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'include/linux/switchtec.h')
-rw-r--r--include/linux/switchtec.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h
index 09d73d0d1aa8..d4a7c18b42cf 100644
--- a/include/linux/switchtec.h
+++ b/include/linux/switchtec.h
@@ -168,6 +168,14 @@ struct ntb_info_regs {
u16 reserved1;
u64 ep_map;
u16 requester_id;
+ u16 reserved2;
+ u32 reserved3[4];
+ struct nt_partition_info {
+ u32 xlink_enabled;
+ u32 target_part_low;
+ u32 target_part_high;
+ u32 reserved;
+ } ntp_info[48];
} __packed;
struct part_cfg_regs {