pci_endpoint_test.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /**
  2. * Host side test driver to test endpoint functionality
  3. *
  4. * Copyright (C) 2017 Texas Instruments
  5. * Author: Kishon Vijay Abraham I <kishon@ti.com>
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 of
  9. * the License as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <linux/crc32.h>
  20. #include <linux/delay.h>
  21. #include <linux/fs.h>
  22. #include <linux/io.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/irq.h>
  25. #include <linux/miscdevice.h>
  26. #include <linux/module.h>
  27. #include <linux/mutex.h>
  28. #include <linux/random.h>
  29. #include <linux/slab.h>
  30. #include <linux/pci.h>
  31. #include <linux/pci_ids.h>
  32. #include <linux/pci_regs.h>
  33. #include <uapi/linux/pcitest.h>
  34. #define DRV_MODULE_NAME "pci-endpoint-test"
  35. #define PCI_ENDPOINT_TEST_MAGIC 0x0
  36. #define PCI_ENDPOINT_TEST_COMMAND 0x4
  37. #define COMMAND_RAISE_LEGACY_IRQ BIT(0)
  38. #define COMMAND_RAISE_MSI_IRQ BIT(1)
  39. #define MSI_NUMBER_SHIFT 2
  40. /* 6 bits for MSI number */
  41. #define COMMAND_READ BIT(8)
  42. #define COMMAND_WRITE BIT(9)
  43. #define COMMAND_COPY BIT(10)
  44. #define PCI_ENDPOINT_TEST_STATUS 0x8
  45. #define STATUS_READ_SUCCESS BIT(0)
  46. #define STATUS_READ_FAIL BIT(1)
  47. #define STATUS_WRITE_SUCCESS BIT(2)
  48. #define STATUS_WRITE_FAIL BIT(3)
  49. #define STATUS_COPY_SUCCESS BIT(4)
  50. #define STATUS_COPY_FAIL BIT(5)
  51. #define STATUS_IRQ_RAISED BIT(6)
  52. #define STATUS_SRC_ADDR_INVALID BIT(7)
  53. #define STATUS_DST_ADDR_INVALID BIT(8)
  54. #define PCI_ENDPOINT_TEST_LOWER_SRC_ADDR 0xc
  55. #define PCI_ENDPOINT_TEST_UPPER_SRC_ADDR 0x10
  56. #define PCI_ENDPOINT_TEST_LOWER_DST_ADDR 0x14
  57. #define PCI_ENDPOINT_TEST_UPPER_DST_ADDR 0x18
  58. #define PCI_ENDPOINT_TEST_SIZE 0x1c
  59. #define PCI_ENDPOINT_TEST_CHECKSUM 0x20
  60. static DEFINE_IDA(pci_endpoint_test_ida);
  61. #define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \
  62. miscdev)
  63. static bool no_msi;
  64. module_param(no_msi, bool, 0444);
  65. MODULE_PARM_DESC(no_msi, "Disable MSI interrupt in pci_endpoint_test");
  66. enum pci_barno {
  67. BAR_0,
  68. BAR_1,
  69. BAR_2,
  70. BAR_3,
  71. BAR_4,
  72. BAR_5,
  73. };
  74. struct pci_endpoint_test {
  75. struct pci_dev *pdev;
  76. void __iomem *base;
  77. void __iomem *bar[6];
  78. struct completion irq_raised;
  79. int last_irq;
  80. /* mutex to protect the ioctls */
  81. struct mutex mutex;
  82. struct miscdevice miscdev;
  83. enum pci_barno test_reg_bar;
  84. size_t alignment;
  85. };
  86. struct pci_endpoint_test_data {
  87. enum pci_barno test_reg_bar;
  88. size_t alignment;
  89. bool no_msi;
  90. };
  91. static inline u32 pci_endpoint_test_readl(struct pci_endpoint_test *test,
  92. u32 offset)
  93. {
  94. return readl(test->base + offset);
  95. }
  96. static inline void pci_endpoint_test_writel(struct pci_endpoint_test *test,
  97. u32 offset, u32 value)
  98. {
  99. writel(value, test->base + offset);
  100. }
  101. static inline u32 pci_endpoint_test_bar_readl(struct pci_endpoint_test *test,
  102. int bar, int offset)
  103. {
  104. return readl(test->bar[bar] + offset);
  105. }
  106. static inline void pci_endpoint_test_bar_writel(struct pci_endpoint_test *test,
  107. int bar, u32 offset, u32 value)
  108. {
  109. writel(value, test->bar[bar] + offset);
  110. }
  111. static irqreturn_t pci_endpoint_test_irqhandler(int irq, void *dev_id)
  112. {
  113. struct pci_endpoint_test *test = dev_id;
  114. u32 reg;
  115. reg = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_STATUS);
  116. if (reg & STATUS_IRQ_RAISED) {
  117. test->last_irq = irq;
  118. complete(&test->irq_raised);
  119. reg &= ~STATUS_IRQ_RAISED;
  120. }
  121. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_STATUS,
  122. reg);
  123. return IRQ_HANDLED;
  124. }
  125. static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
  126. enum pci_barno barno)
  127. {
  128. int j;
  129. u32 val;
  130. int size;
  131. struct pci_dev *pdev = test->pdev;
  132. if (!test->bar[barno])
  133. return false;
  134. size = pci_resource_len(pdev, barno);
  135. if (barno == test->test_reg_bar)
  136. size = 0x4;
  137. for (j = 0; j < size; j += 4)
  138. pci_endpoint_test_bar_writel(test, barno, j, 0xA0A0A0A0);
  139. for (j = 0; j < size; j += 4) {
  140. val = pci_endpoint_test_bar_readl(test, barno, j);
  141. if (val != 0xA0A0A0A0)
  142. return false;
  143. }
  144. return true;
  145. }
  146. static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test)
  147. {
  148. u32 val;
  149. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
  150. COMMAND_RAISE_LEGACY_IRQ);
  151. val = wait_for_completion_timeout(&test->irq_raised,
  152. msecs_to_jiffies(1000));
  153. if (!val)
  154. return false;
  155. return true;
  156. }
  157. static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test,
  158. u8 msi_num)
  159. {
  160. u32 val;
  161. struct pci_dev *pdev = test->pdev;
  162. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
  163. msi_num << MSI_NUMBER_SHIFT |
  164. COMMAND_RAISE_MSI_IRQ);
  165. val = wait_for_completion_timeout(&test->irq_raised,
  166. msecs_to_jiffies(1000));
  167. if (!val)
  168. return false;
  169. if (test->last_irq - pdev->irq == msi_num - 1)
  170. return true;
  171. return false;
  172. }
  173. static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, size_t size)
  174. {
  175. bool ret = false;
  176. void *src_addr;
  177. void *dst_addr;
  178. dma_addr_t src_phys_addr;
  179. dma_addr_t dst_phys_addr;
  180. struct pci_dev *pdev = test->pdev;
  181. struct device *dev = &pdev->dev;
  182. void *orig_src_addr;
  183. dma_addr_t orig_src_phys_addr;
  184. void *orig_dst_addr;
  185. dma_addr_t orig_dst_phys_addr;
  186. size_t offset;
  187. size_t alignment = test->alignment;
  188. u32 src_crc32;
  189. u32 dst_crc32;
  190. if (size > SIZE_MAX - alignment)
  191. goto err;
  192. orig_src_addr = dma_alloc_coherent(dev, size + alignment,
  193. &orig_src_phys_addr, GFP_KERNEL);
  194. if (!orig_src_addr) {
  195. dev_err(dev, "failed to allocate source buffer\n");
  196. ret = false;
  197. goto err;
  198. }
  199. if (alignment && !IS_ALIGNED(orig_src_phys_addr, alignment)) {
  200. src_phys_addr = PTR_ALIGN(orig_src_phys_addr, alignment);
  201. offset = src_phys_addr - orig_src_phys_addr;
  202. src_addr = orig_src_addr + offset;
  203. } else {
  204. src_phys_addr = orig_src_phys_addr;
  205. src_addr = orig_src_addr;
  206. }
  207. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_SRC_ADDR,
  208. lower_32_bits(src_phys_addr));
  209. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_SRC_ADDR,
  210. upper_32_bits(src_phys_addr));
  211. get_random_bytes(src_addr, size);
  212. src_crc32 = crc32_le(~0, src_addr, size);
  213. orig_dst_addr = dma_alloc_coherent(dev, size + alignment,
  214. &orig_dst_phys_addr, GFP_KERNEL);
  215. if (!orig_dst_addr) {
  216. dev_err(dev, "failed to allocate destination address\n");
  217. ret = false;
  218. goto err_orig_src_addr;
  219. }
  220. if (alignment && !IS_ALIGNED(orig_dst_phys_addr, alignment)) {
  221. dst_phys_addr = PTR_ALIGN(orig_dst_phys_addr, alignment);
  222. offset = dst_phys_addr - orig_dst_phys_addr;
  223. dst_addr = orig_dst_addr + offset;
  224. } else {
  225. dst_phys_addr = orig_dst_phys_addr;
  226. dst_addr = orig_dst_addr;
  227. }
  228. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_DST_ADDR,
  229. lower_32_bits(dst_phys_addr));
  230. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_DST_ADDR,
  231. upper_32_bits(dst_phys_addr));
  232. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_SIZE,
  233. size);
  234. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
  235. 1 << MSI_NUMBER_SHIFT | COMMAND_COPY);
  236. wait_for_completion(&test->irq_raised);
  237. dst_crc32 = crc32_le(~0, dst_addr, size);
  238. if (dst_crc32 == src_crc32)
  239. ret = true;
  240. dma_free_coherent(dev, size + alignment, orig_dst_addr,
  241. orig_dst_phys_addr);
  242. err_orig_src_addr:
  243. dma_free_coherent(dev, size + alignment, orig_src_addr,
  244. orig_src_phys_addr);
  245. err:
  246. return ret;
  247. }
  248. static bool pci_endpoint_test_write(struct pci_endpoint_test *test, size_t size)
  249. {
  250. bool ret = false;
  251. u32 reg;
  252. void *addr;
  253. dma_addr_t phys_addr;
  254. struct pci_dev *pdev = test->pdev;
  255. struct device *dev = &pdev->dev;
  256. void *orig_addr;
  257. dma_addr_t orig_phys_addr;
  258. size_t offset;
  259. size_t alignment = test->alignment;
  260. u32 crc32;
  261. if (size > SIZE_MAX - alignment)
  262. goto err;
  263. orig_addr = dma_alloc_coherent(dev, size + alignment, &orig_phys_addr,
  264. GFP_KERNEL);
  265. if (!orig_addr) {
  266. dev_err(dev, "failed to allocate address\n");
  267. ret = false;
  268. goto err;
  269. }
  270. if (alignment && !IS_ALIGNED(orig_phys_addr, alignment)) {
  271. phys_addr = PTR_ALIGN(orig_phys_addr, alignment);
  272. offset = phys_addr - orig_phys_addr;
  273. addr = orig_addr + offset;
  274. } else {
  275. phys_addr = orig_phys_addr;
  276. addr = orig_addr;
  277. }
  278. get_random_bytes(addr, size);
  279. crc32 = crc32_le(~0, addr, size);
  280. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_CHECKSUM,
  281. crc32);
  282. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_SRC_ADDR,
  283. lower_32_bits(phys_addr));
  284. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_SRC_ADDR,
  285. upper_32_bits(phys_addr));
  286. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_SIZE, size);
  287. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
  288. 1 << MSI_NUMBER_SHIFT | COMMAND_READ);
  289. wait_for_completion(&test->irq_raised);
  290. reg = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_STATUS);
  291. if (reg & STATUS_READ_SUCCESS)
  292. ret = true;
  293. dma_free_coherent(dev, size + alignment, orig_addr, orig_phys_addr);
  294. err:
  295. return ret;
  296. }
  297. static bool pci_endpoint_test_read(struct pci_endpoint_test *test, size_t size)
  298. {
  299. bool ret = false;
  300. void *addr;
  301. dma_addr_t phys_addr;
  302. struct pci_dev *pdev = test->pdev;
  303. struct device *dev = &pdev->dev;
  304. void *orig_addr;
  305. dma_addr_t orig_phys_addr;
  306. size_t offset;
  307. size_t alignment = test->alignment;
  308. u32 crc32;
  309. if (size > SIZE_MAX - alignment)
  310. goto err;
  311. orig_addr = dma_alloc_coherent(dev, size + alignment, &orig_phys_addr,
  312. GFP_KERNEL);
  313. if (!orig_addr) {
  314. dev_err(dev, "failed to allocate destination address\n");
  315. ret = false;
  316. goto err;
  317. }
  318. if (alignment && !IS_ALIGNED(orig_phys_addr, alignment)) {
  319. phys_addr = PTR_ALIGN(orig_phys_addr, alignment);
  320. offset = phys_addr - orig_phys_addr;
  321. addr = orig_addr + offset;
  322. } else {
  323. phys_addr = orig_phys_addr;
  324. addr = orig_addr;
  325. }
  326. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_LOWER_DST_ADDR,
  327. lower_32_bits(phys_addr));
  328. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_UPPER_DST_ADDR,
  329. upper_32_bits(phys_addr));
  330. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_SIZE, size);
  331. pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
  332. 1 << MSI_NUMBER_SHIFT | COMMAND_WRITE);
  333. wait_for_completion(&test->irq_raised);
  334. crc32 = crc32_le(~0, addr, size);
  335. if (crc32 == pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_CHECKSUM))
  336. ret = true;
  337. dma_free_coherent(dev, size + alignment, orig_addr, orig_phys_addr);
  338. err:
  339. return ret;
  340. }
  341. static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
  342. unsigned long arg)
  343. {
  344. int ret = -EINVAL;
  345. enum pci_barno bar;
  346. struct pci_endpoint_test *test = to_endpoint_test(file->private_data);
  347. mutex_lock(&test->mutex);
  348. switch (cmd) {
  349. case PCITEST_BAR:
  350. bar = arg;
  351. if (bar < 0 || bar > 5)
  352. goto ret;
  353. ret = pci_endpoint_test_bar(test, bar);
  354. break;
  355. case PCITEST_LEGACY_IRQ:
  356. ret = pci_endpoint_test_legacy_irq(test);
  357. break;
  358. case PCITEST_MSI:
  359. ret = pci_endpoint_test_msi_irq(test, arg);
  360. break;
  361. case PCITEST_WRITE:
  362. ret = pci_endpoint_test_write(test, arg);
  363. break;
  364. case PCITEST_READ:
  365. ret = pci_endpoint_test_read(test, arg);
  366. break;
  367. case PCITEST_COPY:
  368. ret = pci_endpoint_test_copy(test, arg);
  369. break;
  370. }
  371. ret:
  372. mutex_unlock(&test->mutex);
  373. return ret;
  374. }
  375. static const struct file_operations pci_endpoint_test_fops = {
  376. .owner = THIS_MODULE,
  377. .unlocked_ioctl = pci_endpoint_test_ioctl,
  378. };
  379. static int pci_endpoint_test_probe(struct pci_dev *pdev,
  380. const struct pci_device_id *ent)
  381. {
  382. int i;
  383. int err;
  384. int irq = 0;
  385. int id;
  386. char name[20];
  387. enum pci_barno bar;
  388. void __iomem *base;
  389. struct device *dev = &pdev->dev;
  390. struct pci_endpoint_test *test;
  391. struct pci_endpoint_test_data *data;
  392. enum pci_barno test_reg_bar = BAR_0;
  393. struct miscdevice *misc_device;
  394. if (pci_is_bridge(pdev))
  395. return -ENODEV;
  396. test = devm_kzalloc(dev, sizeof(*test), GFP_KERNEL);
  397. if (!test)
  398. return -ENOMEM;
  399. test->test_reg_bar = 0;
  400. test->alignment = 0;
  401. test->pdev = pdev;
  402. data = (struct pci_endpoint_test_data *)ent->driver_data;
  403. if (data) {
  404. test_reg_bar = data->test_reg_bar;
  405. test->alignment = data->alignment;
  406. no_msi = data->no_msi;
  407. }
  408. init_completion(&test->irq_raised);
  409. mutex_init(&test->mutex);
  410. err = pci_enable_device(pdev);
  411. if (err) {
  412. dev_err(dev, "Cannot enable PCI device\n");
  413. return err;
  414. }
  415. err = pci_request_regions(pdev, DRV_MODULE_NAME);
  416. if (err) {
  417. dev_err(dev, "Cannot obtain PCI resources\n");
  418. goto err_disable_pdev;
  419. }
  420. pci_set_master(pdev);
  421. if (!no_msi) {
  422. irq = pci_alloc_irq_vectors(pdev, 1, 32, PCI_IRQ_MSI);
  423. if (irq < 0)
  424. dev_err(dev, "failed to get MSI interrupts\n");
  425. }
  426. err = devm_request_irq(dev, pdev->irq, pci_endpoint_test_irqhandler,
  427. IRQF_SHARED, DRV_MODULE_NAME, test);
  428. if (err) {
  429. dev_err(dev, "failed to request IRQ %d\n", pdev->irq);
  430. goto err_disable_msi;
  431. }
  432. for (i = 1; i < irq; i++) {
  433. err = devm_request_irq(dev, pdev->irq + i,
  434. pci_endpoint_test_irqhandler,
  435. IRQF_SHARED, DRV_MODULE_NAME, test);
  436. if (err)
  437. dev_err(dev, "failed to request IRQ %d for MSI %d\n",
  438. pdev->irq + i, i + 1);
  439. }
  440. for (bar = BAR_0; bar <= BAR_5; bar++) {
  441. base = pci_ioremap_bar(pdev, bar);
  442. if (!base) {
  443. dev_err(dev, "failed to read BAR%d\n", bar);
  444. WARN_ON(bar == test_reg_bar);
  445. }
  446. test->bar[bar] = base;
  447. }
  448. test->base = test->bar[test_reg_bar];
  449. if (!test->base) {
  450. dev_err(dev, "Cannot perform PCI test without BAR%d\n",
  451. test_reg_bar);
  452. goto err_iounmap;
  453. }
  454. pci_set_drvdata(pdev, test);
  455. id = ida_simple_get(&pci_endpoint_test_ida, 0, 0, GFP_KERNEL);
  456. if (id < 0) {
  457. dev_err(dev, "unable to get id\n");
  458. goto err_iounmap;
  459. }
  460. snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
  461. misc_device = &test->miscdev;
  462. misc_device->minor = MISC_DYNAMIC_MINOR;
  463. misc_device->name = name;
  464. misc_device->fops = &pci_endpoint_test_fops,
  465. err = misc_register(misc_device);
  466. if (err) {
  467. dev_err(dev, "failed to register device\n");
  468. goto err_ida_remove;
  469. }
  470. return 0;
  471. err_ida_remove:
  472. ida_simple_remove(&pci_endpoint_test_ida, id);
  473. err_iounmap:
  474. for (bar = BAR_0; bar <= BAR_5; bar++) {
  475. if (test->bar[bar])
  476. pci_iounmap(pdev, test->bar[bar]);
  477. }
  478. err_disable_msi:
  479. pci_disable_msi(pdev);
  480. pci_release_regions(pdev);
  481. err_disable_pdev:
  482. pci_disable_device(pdev);
  483. return err;
  484. }
  485. static void pci_endpoint_test_remove(struct pci_dev *pdev)
  486. {
  487. int id;
  488. enum pci_barno bar;
  489. struct pci_endpoint_test *test = pci_get_drvdata(pdev);
  490. struct miscdevice *misc_device = &test->miscdev;
  491. if (sscanf(misc_device->name, DRV_MODULE_NAME ".%d", &id) != 1)
  492. return;
  493. if (id < 0)
  494. return;
  495. misc_deregister(&test->miscdev);
  496. ida_simple_remove(&pci_endpoint_test_ida, id);
  497. for (bar = BAR_0; bar <= BAR_5; bar++) {
  498. if (test->bar[bar])
  499. pci_iounmap(pdev, test->bar[bar]);
  500. }
  501. pci_disable_msi(pdev);
  502. pci_release_regions(pdev);
  503. pci_disable_device(pdev);
  504. }
  505. static const struct pci_device_id pci_endpoint_test_tbl[] = {
  506. { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA74x) },
  507. { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA72x) },
  508. { }
  509. };
  510. MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);
  511. static struct pci_driver pci_endpoint_test_driver = {
  512. .name = DRV_MODULE_NAME,
  513. .id_table = pci_endpoint_test_tbl,
  514. .probe = pci_endpoint_test_probe,
  515. .remove = pci_endpoint_test_remove,
  516. };
  517. module_pci_driver(pci_endpoint_test_driver);
  518. MODULE_DESCRIPTION("PCI ENDPOINT TEST HOST DRIVER");
  519. MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
  520. MODULE_LICENSE("GPL v2");