• Home
  • Raw
  • Download

Lines Matching refs:ntb

20 	struct ntb_dev *ntb;  member
48 dev_dbg(&nm->ntb->dev, "Interrupt Occurred: %d", in ntb_msit_isr()
65 ret = ntb_msi_setup_mws(nm->ntb); in ntb_msit_setup_work()
67 dev_err(&nm->ntb->dev, "Unable to setup MSI windows: %d\n", in ntb_msit_setup_work()
77 irq = ntbm_msi_request_irq(nm->ntb, ntb_msit_isr, in ntb_msit_setup_work()
87 ret = ntb_spad_write(nm->ntb, 2 * i + 1, in ntb_msit_setup_work()
92 ret = ntb_spad_write(nm->ntb, 2 * i + 2, in ntb_msit_setup_work()
100 ntb_spad_write(nm->ntb, 0, irq_count); in ntb_msit_setup_work()
101 ntb_peer_db_set(nm->ntb, BIT(ntb_port_number(nm->ntb))); in ntb_msit_setup_work()
109 dev_dbg(&nm->ntb->dev, "MSI Descriptors Changed\n"); in ntb_msit_desc_changed()
112 ntb_spad_write(nm->ntb, 2 * i + 1, in ntb_msit_desc_changed()
114 ntb_spad_write(nm->ntb, 2 * i + 2, in ntb_msit_desc_changed()
118 ntb_peer_db_set(nm->ntb, BIT(ntb_port_number(nm->ntb))); in ntb_msit_desc_changed()
125 if (!ntb_link_is_up(nm->ntb, NULL, NULL)) in ntb_msit_link_event()
138 desc[i].addr_offset = ntb_peer_spad_read(nm->ntb, peer, in ntb_msit_copy_peer_desc()
140 desc[i].data = ntb_peer_spad_read(nm->ntb, peer, 2 * i + 2); in ntb_msit_copy_peer_desc()
143 dev_info(&nm->ntb->dev, "Found %d interrupts on peer %d\n", in ntb_msit_copy_peer_desc()
153 u64 peer_mask = ntb_db_read(nm->ntb); in ntb_msit_db_event()
157 ntb_db_clear(nm->ntb, peer_mask); in ntb_msit_db_event()
163 irq_count = ntb_peer_spad_read(nm->ntb, peer, 0); in ntb_msit_db_event()
191 dev_dbg(&peer->nm->ntb->dev, "trigger irq %llu on peer %u\n", in ntb_msit_dbgfs_trigger()
194 return ntb_msi_peer_trigger(peer->nm->ntb, peer->pidx, in ntb_msit_dbgfs_trigger()
205 *port = ntb_peer_port_number(peer->nm->ntb, peer->pidx); in ntb_msit_dbgfs_port_get()
261 *port = ntb_port_number(nm->ntb); in ntb_msit_dbgfs_local_port_get()
272 struct pci_dev *pdev = nm->ntb->pdev; in ntb_msit_create_dbgfs()
282 for (i = 0; i < ntb_peer_port_count(nm->ntb); i++) { in ntb_msit_create_dbgfs()
319 static int ntb_msit_probe(struct ntb_client *client, struct ntb_dev *ntb) in ntb_msit_probe() argument
325 peers = ntb_peer_port_count(ntb); in ntb_msit_probe()
329 if (ntb_spad_is_unsafe(ntb) || ntb_spad_count(ntb) < 2 * num_irqs + 1) { in ntb_msit_probe()
330 dev_err(&ntb->dev, "NTB MSI test requires at least %d spads for %d irqs\n", in ntb_msit_probe()
335 ret = ntb_spad_write(ntb, 0, -1); in ntb_msit_probe()
337 dev_err(&ntb->dev, "Unable to write spads: %d\n", ret); in ntb_msit_probe()
341 ret = ntb_db_clear_mask(ntb, GENMASK(peers - 1, 0)); in ntb_msit_probe()
343 dev_err(&ntb->dev, "Unable to clear doorbell mask: %d\n", ret); in ntb_msit_probe()
347 ret = ntb_msi_init(ntb, ntb_msit_desc_changed); in ntb_msit_probe()
349 dev_err(&ntb->dev, "Unable to initialize MSI library: %d\n", in ntb_msit_probe()
354 nm = devm_kzalloc(&ntb->dev, struct_size(nm, peers, peers), GFP_KERNEL); in ntb_msit_probe()
358 nm->isr_ctx = devm_kcalloc(&ntb->dev, num_irqs, sizeof(*nm->isr_ctx), in ntb_msit_probe()
364 nm->ntb = ntb; in ntb_msit_probe()
368 ret = ntb_set_ctx(ntb, nm, &ntb_msit_ops); in ntb_msit_probe()
377 ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); in ntb_msit_probe()
383 devm_kfree(&ntb->dev, nm->isr_ctx); in ntb_msit_probe()
384 devm_kfree(&ntb->dev, nm); in ntb_msit_probe()
388 static void ntb_msit_remove(struct ntb_client *client, struct ntb_dev *ntb) in ntb_msit_remove() argument
390 struct ntb_msit_ctx *nm = ntb->ctx; in ntb_msit_remove()
393 ntb_link_disable(ntb); in ntb_msit_remove()
394 ntb_db_set_mask(ntb, ntb_db_valid_mask(ntb)); in ntb_msit_remove()
395 ntb_msi_clear_mws(ntb); in ntb_msit_remove()
397 for (i = 0; i < ntb_peer_port_count(ntb); i++) in ntb_msit_remove()
400 ntb_clear_ctx(ntb); in ntb_msit_remove()