| /linux/drivers/thunderbolt/ |
| H A D | nhi.c | 48 bit += ring->nhi->hop_count; in ring_interrupt_index() 52 static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring) in nhi_mask_interrupt() argument 54 if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) { in nhi_mask_interrupt() 57 val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring); in nhi_mask_interrupt() 58 iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring); in nhi_mask_interrupt() 60 iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring); in nhi_mask_interrupt() 64 static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring) in nhi_clear_interrupt() argument 66 if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) in nhi_clear_interrupt() 67 ioread32(nhi->iobase + REG_RING_NOTIFY_BASE + ring); in nhi_clear_interrupt() 69 iowrite32(~0, nhi->iobase + REG_RING_INT_CLEAR + ring); in nhi_clear_interrupt() [all …]
|
| H A D | pci.c | 32 struct tb_nhi nhi; member 36 static inline struct tb_nhi_pci *nhi_to_pci(struct tb_nhi *nhi) in nhi_to_pci() argument 38 return container_of(nhi, struct tb_nhi_pci, nhi); in nhi_to_pci() 43 struct tb_nhi *nhi = &nhi_pci->nhi; in nhi_pci_check_quirks() local 44 struct pci_dev *pdev = to_pci_dev(nhi->dev); in nhi_pci_check_quirks() 52 nhi->quirks |= QUIRK_AUTO_CLEAR_INT; in nhi_pci_check_quirks() 62 nhi->quirks |= QUIRK_E2E; in nhi_pci_check_quirks() 79 struct tb_nhi *nhi = &nhi_pci->nhi; in nhi_pci_check_iommu() local 80 struct pci_dev *pdev = to_pci_dev(nhi->dev); in nhi_pci_check_iommu() 106 nhi->iommu_dma_protection = port_ok; in nhi_pci_check_iommu() [all …]
|
| H A D | nhi.h | 30 int nhi_mailbox_cmd(struct tb_nhi *nhi, enum nhi_mailbox_cmd cmd, u32 data); 31 enum nhi_fw_mode nhi_mailbox_mode(struct tb_nhi *nhi); 32 void nhi_enable_int_throttling(struct tb_nhi *nhi); 33 void nhi_disable_interrupts(struct tb_nhi *nhi); 37 int nhi_probe(struct tb_nhi *nhi); 38 void nhi_shutdown(struct tb_nhi *nhi); 57 int (*init)(struct tb_nhi *nhi); 58 int (*suspend_noirq)(struct tb_nhi *nhi, bool wakeup); 59 int (*resume_noirq)(struct tb_nhi *nhi); 60 int (*runtime_suspend)(struct tb_nhi *nhi); [all …]
|
| H A D | nhi_regs.h | 91 #define RING_NOTIFY_REG_COUNT(nhi) ((31 + 3 * nhi->hop_count) / 32) argument 100 #define RING_INTERRUPT_REG_COUNT(nhi) ((31 + 2 * nhi->hop_count) / 32) argument
|
| H A D | icm.c | 375 static bool icm_firmware_running(const struct tb_nhi *nhi) in icm_firmware_running() argument 379 val = ioread32(nhi->iobase + REG_FW_STS); in icm_firmware_running() 473 nhi_mailbox_cmd(tb->nhi, NHI_MAILBOX_SAVE_DEVS, 0); in icm_fr_save_devices() 631 nhi_mailbox_cmd(tb->nhi, cmd, 1); in icm_fr_disconnect_xdomain_paths() 633 nhi_mailbox_cmd(tb->nhi, cmd, 2); in icm_fr_disconnect_xdomain_paths() 1469 struct pci_dev *pdev = to_pci_dev(tb->nhi->dev); in icm_ar_is_supported() 1478 if (icm_firmware_running(tb->nhi)) in icm_ar_is_supported() 1511 struct tb_nhi *nhi = tb->nhi; in icm_ar_get_mode() local 1516 val = ioread32(nhi->iobase + REG_FW_STS); in icm_ar_get_mode() 1523 dev_err(nhi->dev, "ICM firmware not authenticated\n"); in icm_ar_get_mode() [all …]
|
| H A D | ctl.c | 40 struct tb_nhi *nhi; member 59 dev_WARN((ctl)->nhi->dev, format, ## arg) 62 dev_err((ctl)->nhi->dev, format, ## arg) 65 dev_warn((ctl)->nhi->dev, format, ## arg) 68 dev_info((ctl)->nhi->dev, format, ## arg) 71 dev_dbg((ctl)->nhi->dev, format, ## arg) 74 dev_dbg_once((ctl)->nhi->dev, format, ## arg) 652 struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, int index, int timeout_msec, in tb_ctl_alloc() argument 660 ctl->nhi = nhi; in tb_ctl_alloc() 668 ctl->frame_pool = dma_pool_create("thunderbolt_ctl", nhi->dev, in tb_ctl_alloc() [all …]
|
| H A D | domain.c | 257 return sysfs_emit(buf, "%d\n", tb->nhi->iommu_dma_protection); in iommu_dma_protection_show() 320 struct tb_nhi *nhi = tb->nhi; in tb_domain_release() local 328 complete(&nhi->domain_released); in tb_domain_release() 375 struct tb *tb_domain_alloc(struct tb_nhi *nhi, int timeout_msec, size_t privsize) in tb_domain_alloc() argument 391 tb->nhi = nhi; in tb_domain_alloc() 402 tb->ctl = tb_ctl_alloc(nhi, tb->index, timeout_msec, tb_domain_event_cb, tb); in tb_domain_alloc() 406 tb->dev.parent = nhi->dev; in tb_domain_alloc()
|
| H A D | test.c | 1825 struct tb_port *nhi, *port; in tb_test_tunnel_dma() local 1841 nhi = &host->ports[7]; in tb_test_tunnel_dma() 1844 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_tunnel_dma() 1847 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma() 1854 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, nhi); in tb_test_tunnel_dma() 1858 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, nhi); in tb_test_tunnel_dma() 1868 struct tb_port *nhi, *port; in tb_test_tunnel_dma_rx() local 1884 nhi = &host->ports[7]; in tb_test_tunnel_dma_rx() 1887 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 2); in tb_test_tunnel_dma_rx() 1890 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_rx() [all …]
|
| H A D | tb.c | 2954 struct tb_nhi *nhi = tb->nhi; in tb_stop() local 2981 if (nhi->host_reset) { in tb_stop() 3035 return dev_err_probe(tb->nhi->dev, PTR_ERR(tb->root_switch), in tb_start() 3053 return dev_err_probe(tb->nhi->dev, ret, "failed to configure host router\n"); in tb_start() 3060 return dev_err_probe(tb->nhi->dev, ret, "failed to add host router\n"); in tb_start() 3344 static bool tb_apple_add_links(struct tb_nhi *nhi) in tb_apple_add_links() argument 3346 struct pci_dev *nhi_pdev = to_pci_dev(nhi->dev); in tb_apple_add_links() 3390 link = device_link_add(&pdev->dev, nhi->dev, in tb_apple_add_links() 3394 dev_dbg(nhi->dev, "created link from %s\n", in tb_apple_add_links() 3398 dev_warn(nhi->dev, "device link creation from %s failed\n", in tb_apple_add_links() [all …]
|
| H A D | switch.c | 237 struct tb_nhi *nhi = sw->tb->nhi; in nvm_authenticate() local 254 if (nhi->ops->pre_nvm_auth) in nvm_authenticate() 255 nhi->ops->pre_nvm_auth(nhi); in nvm_authenticate() 2740 struct tb_nhi *nhi = sw->tb->nhi; in tb_switch_add_dma_port() local 2801 if (nhi->ops->post_nvm_auth) in tb_switch_add_dma_port() 2802 nhi->ops->post_nvm_auth(nhi); in tb_switch_add_dma_port() 2818 if (nhi->ops->post_nvm_auth) in tb_switch_add_dma_port() 2819 nhi->ops->post_nvm_auth(nhi); in tb_switch_add_dma_port()
|
| H A D | tunnel.h | 128 struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi,
|
| H A D | tunnel.c | 1925 struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi, in tb_tunnel_alloc_dma() argument 1951 tunnel->src_port = nhi; in tb_tunnel_alloc_dma() 1955 credits = min_not_zero(dma_credits, nhi->sw->max_dma_credits); in tb_tunnel_alloc_dma() 1963 path = tb_path_alloc(tb, dst, receive_path, nhi, receive_ring, 0, in tb_tunnel_alloc_dma() 1975 path = tb_path_alloc(tb, nhi, transmit_ring, dst, transmit_path, 0, in tb_tunnel_alloc_dma()
|
| H A D | eeprom.c | 475 struct device *dev = sw->tb->nhi->dev; in tb_drom_copy_efi()
|
| H A D | stream.c | 591 ring = tb_ring_alloc_tx(xd->tb->nhi, -1, sdev->ring_size, flags); in tbstream_dev_start() 604 ring = tb_ring_alloc_rx(xd->tb->nhi, -1, sdev->ring_size, flags, in tbstream_dev_start()
|
| /linux/include/net/ |
| H A D | nexthop.h | 291 const struct nh_info *nhi; in nexthop_is_fdb() local 293 nhi = rcu_dereference_rtnl(nh->nh_info); in nexthop_is_fdb() 294 return nhi->fdb_nh; in nexthop_is_fdb() 358 struct nh_info *nhi = rcu_dereference_rtnl(nhe->nh_info); in nexthop_mpath_fill_node() local 359 struct fib_nh_common *nhc = &nhi->fib_nhc; in nexthop_mpath_fill_node() 372 const struct nh_info *nhi; in nexthop_is_blackhole() local 384 nhi = rcu_dereference_rtnl(nh->nh_info); in nexthop_is_blackhole() 385 return nhi->reject_nh; in nexthop_is_blackhole() 390 struct nh_info *nhi; in nexthop_path_fib_result() local 394 nhi = rcu_dereference(nh->nh_info); in nexthop_path_fib_result() [all …]
|
| /linux/net/ipv4/ |
| H A D | nexthop.c | 99 const struct nh_info *nhi) in __nh_notifier_single_info_init() argument 101 nh_info->dev = nhi->fib_nhc.nhc_dev; in __nh_notifier_single_info_init() 102 nh_info->gw_family = nhi->fib_nhc.nhc_gw_family; in __nh_notifier_single_info_init() 104 nh_info->ipv4 = nhi->fib_nhc.nhc_gw.ipv4; in __nh_notifier_single_info_init() 106 nh_info->ipv6 = nhi->fib_nhc.nhc_gw.ipv6; in __nh_notifier_single_info_init() 108 nh_info->id = nhi->nh_parent->id; in __nh_notifier_single_info_init() 109 nh_info->is_reject = nhi->reject_nh; in __nh_notifier_single_info_init() 110 nh_info->is_fdb = nhi->fdb_nh; in __nh_notifier_single_info_init() 111 nh_info->has_encap = !!nhi->fib_nhc.nhc_lwtstate; in __nh_notifier_single_info_init() 117 struct nh_info *nhi = rtnl_dereference(nh->nh_info); in nh_notifier_single_info_init() local [all …]
|
| /linux/include/linux/ |
| H A D | thunderbolt.h | 86 struct tb_nhi *nhi; member 573 struct tb_nhi *nhi; member 664 struct tb_ring *tb_ring_alloc_tx(struct tb_nhi *nhi, int hop, int size, 666 struct tb_ring *tb_ring_alloc_rx(struct tb_nhi *nhi, int hop, int size, 737 return ring->nhi->dev; in tb_ring_dma_device()
|
| /linux/drivers/net/thunderbolt/ |
| H A D | main.c | 950 ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE, in tbnet_open() 975 ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE, flags, in tbnet_open()
|