summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
authorAndreas Noever <andreas.noever@gmail.com>2014-06-04 00:04:01 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-20 01:07:07 +0400
commit7adf60972c692b0b3d0958cd7322e22a67187111 (patch)
tree08b992f201dda4a6a2c545c2dce7b4620f72a5ca /drivers/thunderbolt/tb.c
parentd6cc51cd1a4aed1d9e2dd66d643d729acb4be560 (diff)
downloadlinux-7adf60972c692b0b3d0958cd7322e22a67187111.tar.xz
thunderbolt: Add tb_regs.h
Every thunderbolt device consists (logically) of a switch with multiple ports. Every port contains up to four config regions (HOPS, PORT, SWITCH, COUNTERS) which are used to configure the device. The tb_regs.h file contains all known registers and capabilities from these config regions. Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 6920979c5b14..164dea083e9e 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -9,6 +9,7 @@
#include <linux/delay.h>
#include "tb.h"
+#include "tb_regs.h"
/* hotplug handling */
@@ -100,6 +101,10 @@ struct tb *thunderbolt_alloc_and_start(struct tb_nhi *nhi)
{
struct tb *tb;
+ BUILD_BUG_ON(sizeof(struct tb_regs_switch_header) != 5 * 4);
+ BUILD_BUG_ON(sizeof(struct tb_regs_port_header) != 8 * 4);
+ BUILD_BUG_ON(sizeof(struct tb_regs_hop) != 2 * 4);
+
tb = kzalloc(sizeof(*tb), GFP_KERNEL);
if (!tb)
return NULL;