ntb_hw_intel.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. /*
  2. * This file is provided under a dual BSD/GPLv2 license. When using or
  3. * redistributing this file, you may do so under either license.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2012 Intel Corporation. All rights reserved.
  8. * Copyright (C) 2015 EMC Corporation. All Rights Reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of version 2 of the GNU General Public License as
  12. * published by the Free Software Foundation.
  13. *
  14. * BSD LICENSE
  15. *
  16. * Copyright(c) 2012 Intel Corporation. All rights reserved.
  17. * Copyright (C) 2015 EMC Corporation. All Rights Reserved.
  18. *
  19. * Redistribution and use in source and binary forms, with or without
  20. * modification, are permitted provided that the following conditions
  21. * are met:
  22. *
  23. * * Redistributions of source code must retain the above copyright
  24. * notice, this list of conditions and the following disclaimer.
  25. * * Redistributions in binary form must reproduce the above copy
  26. * notice, this list of conditions and the following disclaimer in
  27. * the documentation and/or other materials provided with the
  28. * distribution.
  29. * * Neither the name of Intel Corporation nor the names of its
  30. * contributors may be used to endorse or promote products derived
  31. * from this software without specific prior written permission.
  32. *
  33. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  34. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  35. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  36. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  37. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  38. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  39. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  40. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  41. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  42. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  43. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44. *
  45. * Intel PCIe NTB Linux driver
  46. *
  47. * Contact Information:
  48. * Jon Mason <jon.mason@intel.com>
  49. */
  50. #ifndef NTB_HW_INTEL_H
  51. #define NTB_HW_INTEL_H
  52. #include <linux/ntb.h>
  53. #include <linux/pci.h>
  54. #define PCI_DEVICE_ID_INTEL_NTB_B2B_JSF 0x3725
  55. #define PCI_DEVICE_ID_INTEL_NTB_PS_JSF 0x3726
  56. #define PCI_DEVICE_ID_INTEL_NTB_SS_JSF 0x3727
  57. #define PCI_DEVICE_ID_INTEL_NTB_B2B_SNB 0x3C0D
  58. #define PCI_DEVICE_ID_INTEL_NTB_PS_SNB 0x3C0E
  59. #define PCI_DEVICE_ID_INTEL_NTB_SS_SNB 0x3C0F
  60. #define PCI_DEVICE_ID_INTEL_NTB_B2B_IVT 0x0E0D
  61. #define PCI_DEVICE_ID_INTEL_NTB_PS_IVT 0x0E0E
  62. #define PCI_DEVICE_ID_INTEL_NTB_SS_IVT 0x0E0F
  63. #define PCI_DEVICE_ID_INTEL_NTB_B2B_HSX 0x2F0D
  64. #define PCI_DEVICE_ID_INTEL_NTB_PS_HSX 0x2F0E
  65. #define PCI_DEVICE_ID_INTEL_NTB_SS_HSX 0x2F0F
  66. #define PCI_DEVICE_ID_INTEL_NTB_B2B_BWD 0x0C4E
  67. #define PCI_DEVICE_ID_INTEL_NTB_B2B_BDX 0x6F0D
  68. #define PCI_DEVICE_ID_INTEL_NTB_PS_BDX 0x6F0E
  69. #define PCI_DEVICE_ID_INTEL_NTB_SS_BDX 0x6F0F
  70. #define PCI_DEVICE_ID_INTEL_NTB_B2B_SKX 0x201C
  71. /* Intel Xeon hardware */
  72. #define XEON_PBAR23LMT_OFFSET 0x0000
  73. #define XEON_PBAR45LMT_OFFSET 0x0008
  74. #define XEON_PBAR4LMT_OFFSET 0x0008
  75. #define XEON_PBAR5LMT_OFFSET 0x000c
  76. #define XEON_PBAR23XLAT_OFFSET 0x0010
  77. #define XEON_PBAR45XLAT_OFFSET 0x0018
  78. #define XEON_PBAR4XLAT_OFFSET 0x0018
  79. #define XEON_PBAR5XLAT_OFFSET 0x001c
  80. #define XEON_SBAR23LMT_OFFSET 0x0020
  81. #define XEON_SBAR45LMT_OFFSET 0x0028
  82. #define XEON_SBAR4LMT_OFFSET 0x0028
  83. #define XEON_SBAR5LMT_OFFSET 0x002c
  84. #define XEON_SBAR23XLAT_OFFSET 0x0030
  85. #define XEON_SBAR45XLAT_OFFSET 0x0038
  86. #define XEON_SBAR4XLAT_OFFSET 0x0038
  87. #define XEON_SBAR5XLAT_OFFSET 0x003c
  88. #define XEON_SBAR0BASE_OFFSET 0x0040
  89. #define XEON_SBAR23BASE_OFFSET 0x0048
  90. #define XEON_SBAR45BASE_OFFSET 0x0050
  91. #define XEON_SBAR4BASE_OFFSET 0x0050
  92. #define XEON_SBAR5BASE_OFFSET 0x0054
  93. #define XEON_SBDF_OFFSET 0x005c
  94. #define XEON_NTBCNTL_OFFSET 0x0058
  95. #define XEON_PDOORBELL_OFFSET 0x0060
  96. #define XEON_PDBMSK_OFFSET 0x0062
  97. #define XEON_SDOORBELL_OFFSET 0x0064
  98. #define XEON_SDBMSK_OFFSET 0x0066
  99. #define XEON_USMEMMISS_OFFSET 0x0070
  100. #define XEON_SPAD_OFFSET 0x0080
  101. #define XEON_PBAR23SZ_OFFSET 0x00d0
  102. #define XEON_PBAR45SZ_OFFSET 0x00d1
  103. #define XEON_PBAR4SZ_OFFSET 0x00d1
  104. #define XEON_SBAR23SZ_OFFSET 0x00d2
  105. #define XEON_SBAR45SZ_OFFSET 0x00d3
  106. #define XEON_SBAR4SZ_OFFSET 0x00d3
  107. #define XEON_PPD_OFFSET 0x00d4
  108. #define XEON_PBAR5SZ_OFFSET 0x00d5
  109. #define XEON_SBAR5SZ_OFFSET 0x00d6
  110. #define XEON_WCCNTRL_OFFSET 0x00e0
  111. #define XEON_UNCERRSTS_OFFSET 0x014c
  112. #define XEON_CORERRSTS_OFFSET 0x0158
  113. #define XEON_LINK_STATUS_OFFSET 0x01a2
  114. #define XEON_SPCICMD_OFFSET 0x0504
  115. #define XEON_DEVCTRL_OFFSET 0x0598
  116. #define XEON_DEVSTS_OFFSET 0x059a
  117. #define XEON_SLINK_STATUS_OFFSET 0x05a2
  118. #define XEON_B2B_SPAD_OFFSET 0x0100
  119. #define XEON_B2B_DOORBELL_OFFSET 0x0140
  120. #define XEON_B2B_XLAT_OFFSETL 0x0144
  121. #define XEON_B2B_XLAT_OFFSETU 0x0148
  122. #define XEON_PPD_CONN_MASK 0x03
  123. #define XEON_PPD_CONN_TRANSPARENT 0x00
  124. #define XEON_PPD_CONN_B2B 0x01
  125. #define XEON_PPD_CONN_RP 0x02
  126. #define XEON_PPD_DEV_MASK 0x10
  127. #define XEON_PPD_DEV_USD 0x00
  128. #define XEON_PPD_DEV_DSD 0x10
  129. #define XEON_PPD_SPLIT_BAR_MASK 0x40
  130. #define XEON_PPD_TOPO_MASK (XEON_PPD_CONN_MASK | XEON_PPD_DEV_MASK)
  131. #define XEON_PPD_TOPO_PRI_USD (XEON_PPD_CONN_RP | XEON_PPD_DEV_USD)
  132. #define XEON_PPD_TOPO_PRI_DSD (XEON_PPD_CONN_RP | XEON_PPD_DEV_DSD)
  133. #define XEON_PPD_TOPO_SEC_USD (XEON_PPD_CONN_TRANSPARENT | XEON_PPD_DEV_USD)
  134. #define XEON_PPD_TOPO_SEC_DSD (XEON_PPD_CONN_TRANSPARENT | XEON_PPD_DEV_DSD)
  135. #define XEON_PPD_TOPO_B2B_USD (XEON_PPD_CONN_B2B | XEON_PPD_DEV_USD)
  136. #define XEON_PPD_TOPO_B2B_DSD (XEON_PPD_CONN_B2B | XEON_PPD_DEV_DSD)
  137. #define XEON_MW_COUNT 2
  138. #define HSX_SPLIT_BAR_MW_COUNT 3
  139. #define XEON_DB_COUNT 15
  140. #define XEON_DB_LINK 15
  141. #define XEON_DB_LINK_BIT BIT_ULL(XEON_DB_LINK)
  142. #define XEON_DB_MSIX_VECTOR_COUNT 4
  143. #define XEON_DB_MSIX_VECTOR_SHIFT 5
  144. #define XEON_DB_TOTAL_SHIFT 16
  145. #define XEON_SPAD_COUNT 16
  146. /* Intel Skylake Xeon hardware */
  147. #define SKX_IMBAR1SZ_OFFSET 0x00d0
  148. #define SKX_IMBAR2SZ_OFFSET 0x00d1
  149. #define SKX_EMBAR1SZ_OFFSET 0x00d2
  150. #define SKX_EMBAR2SZ_OFFSET 0x00d3
  151. #define SKX_DEVCTRL_OFFSET 0x0098
  152. #define SKX_DEVSTS_OFFSET 0x009a
  153. #define SKX_UNCERRSTS_OFFSET 0x014c
  154. #define SKX_CORERRSTS_OFFSET 0x0158
  155. #define SKX_LINK_STATUS_OFFSET 0x01a2
  156. #define SKX_NTBCNTL_OFFSET 0x0000
  157. #define SKX_IMBAR1XBASE_OFFSET 0x0010 /* SBAR2XLAT */
  158. #define SKX_IMBAR1XLMT_OFFSET 0x0018 /* SBAR2LMT */
  159. #define SKX_IMBAR2XBASE_OFFSET 0x0020 /* SBAR4XLAT */
  160. #define SKX_IMBAR2XLMT_OFFSET 0x0028 /* SBAR4LMT */
  161. #define SKX_IM_INT_STATUS_OFFSET 0x0040
  162. #define SKX_IM_INT_DISABLE_OFFSET 0x0048
  163. #define SKX_IM_SPAD_OFFSET 0x0080 /* SPAD */
  164. #define SKX_USMEMMISS_OFFSET 0x0070
  165. #define SKX_INTVEC_OFFSET 0x00d0
  166. #define SKX_IM_DOORBELL_OFFSET 0x0100 /* SDOORBELL0 */
  167. #define SKX_B2B_SPAD_OFFSET 0x0180 /* B2B SPAD */
  168. #define SKX_EMBAR0XBASE_OFFSET 0x4008 /* B2B_XLAT */
  169. #define SKX_EMBAR1XBASE_OFFSET 0x4010 /* PBAR2XLAT */
  170. #define SKX_EMBAR1XLMT_OFFSET 0x4018 /* PBAR2LMT */
  171. #define SKX_EMBAR2XBASE_OFFSET 0x4020 /* PBAR4XLAT */
  172. #define SKX_EMBAR2XLMT_OFFSET 0x4028 /* PBAR4LMT */
  173. #define SKX_EM_INT_STATUS_OFFSET 0x4040
  174. #define SKX_EM_INT_DISABLE_OFFSET 0x4048
  175. #define SKX_EM_SPAD_OFFSET 0x4080 /* remote SPAD */
  176. #define SKX_EM_DOORBELL_OFFSET 0x4100 /* PDOORBELL0 */
  177. #define SKX_SPCICMD_OFFSET 0x4504 /* SPCICMD */
  178. #define SKX_EMBAR0_OFFSET 0x4510 /* SBAR0BASE */
  179. #define SKX_EMBAR1_OFFSET 0x4518 /* SBAR23BASE */
  180. #define SKX_EMBAR2_OFFSET 0x4520 /* SBAR45BASE */
  181. #define SKX_DB_COUNT 32
  182. #define SKX_DB_LINK 32
  183. #define SKX_DB_LINK_BIT BIT_ULL(SKX_DB_LINK)
  184. #define SKX_DB_MSIX_VECTOR_COUNT 33
  185. #define SKX_DB_MSIX_VECTOR_SHIFT 1
  186. #define SKX_DB_TOTAL_SHIFT 33
  187. #define SKX_SPAD_COUNT 16
  188. /* Intel Atom hardware */
  189. #define ATOM_SBAR2XLAT_OFFSET 0x0008
  190. #define ATOM_PDOORBELL_OFFSET 0x0020
  191. #define ATOM_PDBMSK_OFFSET 0x0028
  192. #define ATOM_NTBCNTL_OFFSET 0x0060
  193. #define ATOM_SPAD_OFFSET 0x0080
  194. #define ATOM_PPD_OFFSET 0x00d4
  195. #define ATOM_PBAR2XLAT_OFFSET 0x8008
  196. #define ATOM_B2B_DOORBELL_OFFSET 0x8020
  197. #define ATOM_B2B_SPAD_OFFSET 0x8080
  198. #define ATOM_SPCICMD_OFFSET 0xb004
  199. #define ATOM_LINK_STATUS_OFFSET 0xb052
  200. #define ATOM_ERRCORSTS_OFFSET 0xb110
  201. #define ATOM_IP_BASE 0xc000
  202. #define ATOM_DESKEWSTS_OFFSET (ATOM_IP_BASE + 0x3024)
  203. #define ATOM_LTSSMERRSTS0_OFFSET (ATOM_IP_BASE + 0x3180)
  204. #define ATOM_LTSSMSTATEJMP_OFFSET (ATOM_IP_BASE + 0x3040)
  205. #define ATOM_IBSTERRRCRVSTS0_OFFSET (ATOM_IP_BASE + 0x3324)
  206. #define ATOM_MODPHY_PCSREG4 0x1c004
  207. #define ATOM_MODPHY_PCSREG6 0x1c006
  208. #define ATOM_PPD_INIT_LINK 0x0008
  209. #define ATOM_PPD_CONN_MASK 0x0300
  210. #define ATOM_PPD_CONN_TRANSPARENT 0x0000
  211. #define ATOM_PPD_CONN_B2B 0x0100
  212. #define ATOM_PPD_CONN_RP 0x0200
  213. #define ATOM_PPD_DEV_MASK 0x1000
  214. #define ATOM_PPD_DEV_USD 0x0000
  215. #define ATOM_PPD_DEV_DSD 0x1000
  216. #define ATOM_PPD_TOPO_MASK (ATOM_PPD_CONN_MASK | ATOM_PPD_DEV_MASK)
  217. #define ATOM_PPD_TOPO_PRI_USD (ATOM_PPD_CONN_TRANSPARENT | ATOM_PPD_DEV_USD)
  218. #define ATOM_PPD_TOPO_PRI_DSD (ATOM_PPD_CONN_TRANSPARENT | ATOM_PPD_DEV_DSD)
  219. #define ATOM_PPD_TOPO_SEC_USD (ATOM_PPD_CONN_RP | ATOM_PPD_DEV_USD)
  220. #define ATOM_PPD_TOPO_SEC_DSD (ATOM_PPD_CONN_RP | ATOM_PPD_DEV_DSD)
  221. #define ATOM_PPD_TOPO_B2B_USD (ATOM_PPD_CONN_B2B | ATOM_PPD_DEV_USD)
  222. #define ATOM_PPD_TOPO_B2B_DSD (ATOM_PPD_CONN_B2B | ATOM_PPD_DEV_DSD)
  223. #define ATOM_MW_COUNT 2
  224. #define ATOM_DB_COUNT 34
  225. #define ATOM_DB_VALID_MASK (BIT_ULL(ATOM_DB_COUNT) - 1)
  226. #define ATOM_DB_MSIX_VECTOR_COUNT 34
  227. #define ATOM_DB_MSIX_VECTOR_SHIFT 1
  228. #define ATOM_DB_TOTAL_SHIFT 34
  229. #define ATOM_SPAD_COUNT 16
  230. #define ATOM_NTB_CTL_DOWN_BIT BIT(16)
  231. #define ATOM_NTB_CTL_ACTIVE(x) !(x & ATOM_NTB_CTL_DOWN_BIT)
  232. #define ATOM_DESKEWSTS_DBERR BIT(15)
  233. #define ATOM_LTSSMERRSTS0_UNEXPECTEDEI BIT(20)
  234. #define ATOM_LTSSMSTATEJMP_FORCEDETECT BIT(2)
  235. #define ATOM_IBIST_ERR_OFLOW 0x7FFF7FFF
  236. #define ATOM_LINK_HB_TIMEOUT msecs_to_jiffies(1000)
  237. #define ATOM_LINK_RECOVERY_TIME msecs_to_jiffies(500)
  238. /* Ntb control and link status */
  239. #define NTB_CTL_CFG_LOCK BIT(0)
  240. #define NTB_CTL_DISABLE BIT(1)
  241. #define NTB_CTL_S2P_BAR2_SNOOP BIT(2)
  242. #define NTB_CTL_P2S_BAR2_SNOOP BIT(4)
  243. #define NTB_CTL_S2P_BAR4_SNOOP BIT(6)
  244. #define NTB_CTL_P2S_BAR4_SNOOP BIT(8)
  245. #define NTB_CTL_S2P_BAR5_SNOOP BIT(12)
  246. #define NTB_CTL_P2S_BAR5_SNOOP BIT(14)
  247. #define NTB_LNK_STA_ACTIVE_BIT 0x2000
  248. #define NTB_LNK_STA_SPEED_MASK 0x000f
  249. #define NTB_LNK_STA_WIDTH_MASK 0x03f0
  250. #define NTB_LNK_STA_ACTIVE(x) (!!((x) & NTB_LNK_STA_ACTIVE_BIT))
  251. #define NTB_LNK_STA_SPEED(x) ((x) & NTB_LNK_STA_SPEED_MASK)
  252. #define NTB_LNK_STA_WIDTH(x) (((x) & NTB_LNK_STA_WIDTH_MASK) >> 4)
  253. /* Use the following addresses for translation between b2b ntb devices in case
  254. * the hardware default values are not reliable. */
  255. #define XEON_B2B_BAR0_ADDR 0x1000000000000000ull
  256. #define XEON_B2B_BAR2_ADDR64 0x2000000000000000ull
  257. #define XEON_B2B_BAR4_ADDR64 0x4000000000000000ull
  258. #define XEON_B2B_BAR4_ADDR32 0x20000000u
  259. #define XEON_B2B_BAR5_ADDR32 0x40000000u
  260. /* The peer ntb secondary config space is 32KB fixed size */
  261. #define XEON_B2B_MIN_SIZE 0x8000
  262. /* flags to indicate hardware errata */
  263. #define NTB_HWERR_SDOORBELL_LOCKUP BIT_ULL(0)
  264. #define NTB_HWERR_SB01BASE_LOCKUP BIT_ULL(1)
  265. #define NTB_HWERR_B2BDOORBELL_BIT14 BIT_ULL(2)
  266. #define NTB_HWERR_MSIX_VECTOR32_BAD BIT_ULL(3)
  267. /* flags to indicate unsafe api */
  268. #define NTB_UNSAFE_DB BIT_ULL(0)
  269. #define NTB_UNSAFE_SPAD BIT_ULL(1)
  270. #define NTB_BAR_MASK_64 ~(0xfull)
  271. #define NTB_BAR_MASK_32 ~(0xfu)
  272. struct intel_ntb_dev;
  273. struct intel_ntb_reg {
  274. int (*poll_link)(struct intel_ntb_dev *ndev);
  275. int (*link_is_up)(struct intel_ntb_dev *ndev);
  276. u64 (*db_ioread)(void __iomem *mmio);
  277. void (*db_iowrite)(u64 db_bits, void __iomem *mmio);
  278. unsigned long ntb_ctl;
  279. resource_size_t db_size;
  280. int mw_bar[];
  281. };
  282. struct intel_ntb_alt_reg {
  283. unsigned long db_bell;
  284. unsigned long db_mask;
  285. unsigned long db_clear;
  286. unsigned long spad;
  287. };
  288. struct intel_ntb_xlat_reg {
  289. unsigned long bar0_base;
  290. unsigned long bar2_xlat;
  291. unsigned long bar2_limit;
  292. };
  293. struct intel_b2b_addr {
  294. phys_addr_t bar0_addr;
  295. phys_addr_t bar2_addr64;
  296. phys_addr_t bar4_addr64;
  297. phys_addr_t bar4_addr32;
  298. phys_addr_t bar5_addr32;
  299. };
  300. struct intel_ntb_vec {
  301. struct intel_ntb_dev *ndev;
  302. int num;
  303. };
  304. struct intel_ntb_dev {
  305. struct ntb_dev ntb;
  306. /* offset of peer bar0 in b2b bar */
  307. unsigned long b2b_off;
  308. /* mw idx used to access peer bar0 */
  309. unsigned int b2b_idx;
  310. /* BAR45 is split into BAR4 and BAR5 */
  311. bool bar4_split;
  312. u32 ntb_ctl;
  313. u32 lnk_sta;
  314. unsigned char mw_count;
  315. unsigned char spad_count;
  316. unsigned char db_count;
  317. unsigned char db_vec_count;
  318. unsigned char db_vec_shift;
  319. u64 db_valid_mask;
  320. u64 db_link_mask;
  321. u64 db_mask;
  322. /* synchronize rmw access of db_mask and hw reg */
  323. spinlock_t db_mask_lock;
  324. struct msix_entry *msix;
  325. struct intel_ntb_vec *vec;
  326. const struct intel_ntb_reg *reg;
  327. const struct intel_ntb_alt_reg *self_reg;
  328. const struct intel_ntb_alt_reg *peer_reg;
  329. const struct intel_ntb_xlat_reg *xlat_reg;
  330. void __iomem *self_mmio;
  331. void __iomem *peer_mmio;
  332. phys_addr_t peer_addr;
  333. unsigned long last_ts;
  334. struct delayed_work hb_timer;
  335. unsigned long hwerr_flags;
  336. unsigned long unsafe_flags;
  337. unsigned long unsafe_flags_ignore;
  338. struct dentry *debugfs_dir;
  339. struct dentry *debugfs_info;
  340. };
  341. #define ndev_pdev(ndev) ((ndev)->ntb.pdev)
  342. #define ndev_name(ndev) pci_name(ndev_pdev(ndev))
  343. #define ndev_dev(ndev) (&ndev_pdev(ndev)->dev)
  344. #define ntb_ndev(__ntb) container_of(__ntb, struct intel_ntb_dev, ntb)
  345. #define hb_ndev(__work) container_of(__work, struct intel_ntb_dev, \
  346. hb_timer.work)
  347. #endif