Lines Matching defs:ntb

12 #include <linux/ntb.h>
46 struct ntb_dev ntb;
93 static struct switchtec_ntb *ntb_sndev(struct ntb_dev *ntb)
95 return container_of(ntb, struct switchtec_ntb, ntb);
166 static int switchtec_ntb_mw_count(struct ntb_dev *ntb, int pidx)
168 struct switchtec_ntb *sndev = ntb_sndev(ntb);
191 static int switchtec_ntb_mw_get_align(struct ntb_dev *ntb, int pidx,
196 struct switchtec_ntb *sndev = ntb_sndev(ntb);
270 static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx,
273 struct switchtec_ntb *sndev = ntb_sndev(ntb);
285 if (widx >= switchtec_ntb_mw_count(ntb, pidx))
341 static int switchtec_ntb_peer_mw_count(struct ntb_dev *ntb)
343 struct switchtec_ntb *sndev = ntb_sndev(ntb);
370 *base = pci_resource_start(sndev->ntb.pdev, bar) + offset;
373 *size = pci_resource_len(sndev->ntb.pdev, bar) - offset;
394 *base = pci_resource_start(sndev->ntb.pdev, bar) + offset;
402 static int switchtec_ntb_peer_mw_get_addr(struct ntb_dev *ntb, int idx,
406 struct switchtec_ntb *sndev = ntb_sndev(ntb);
410 else if (idx < switchtec_ntb_peer_mw_count(ntb))
511 ntb_link_event(&sndev->ntb);
512 dev_info(&sndev->stdev->dev, "ntb link %s\n",
533 ntb_link_event(&sndev->ntb);
534 dev_info(&sndev->stdev->dev, "ntb link forced down\n");
559 static u64 switchtec_ntb_link_is_up(struct ntb_dev *ntb,
563 struct switchtec_ntb *sndev = ntb_sndev(ntb);
573 static int switchtec_ntb_link_enable(struct ntb_dev *ntb,
577 struct switchtec_ntb *sndev = ntb_sndev(ntb);
589 static int switchtec_ntb_link_disable(struct ntb_dev *ntb)
591 struct switchtec_ntb *sndev = ntb_sndev(ntb);
603 static u64 switchtec_ntb_db_valid_mask(struct ntb_dev *ntb)
605 struct switchtec_ntb *sndev = ntb_sndev(ntb);
610 static int switchtec_ntb_db_vector_count(struct ntb_dev *ntb)
615 static u64 switchtec_ntb_db_vector_mask(struct ntb_dev *ntb, int db_vector)
617 struct switchtec_ntb *sndev = ntb_sndev(ntb);
625 static u64 switchtec_ntb_db_read(struct ntb_dev *ntb)
628 struct switchtec_ntb *sndev = ntb_sndev(ntb);
635 static int switchtec_ntb_db_clear(struct ntb_dev *ntb, u64 db_bits)
637 struct switchtec_ntb *sndev = ntb_sndev(ntb);
644 static int switchtec_ntb_db_set_mask(struct ntb_dev *ntb, u64 db_bits)
647 struct switchtec_ntb *sndev = ntb_sndev(ntb);
662 static int switchtec_ntb_db_clear_mask(struct ntb_dev *ntb, u64 db_bits)
665 struct switchtec_ntb *sndev = ntb_sndev(ntb);
680 static u64 switchtec_ntb_db_read_mask(struct ntb_dev *ntb)
682 struct switchtec_ntb *sndev = ntb_sndev(ntb);
687 static int switchtec_ntb_peer_db_addr(struct ntb_dev *ntb,
693 struct switchtec_ntb *sndev = ntb_sndev(ntb);
705 *db_addr = pci_resource_start(ntb->pdev, 0) + offset;
714 static int switchtec_ntb_peer_db_set(struct ntb_dev *ntb, u64 db_bits)
716 struct switchtec_ntb *sndev = ntb_sndev(ntb);
724 static int switchtec_ntb_spad_count(struct ntb_dev *ntb)
726 struct switchtec_ntb *sndev = ntb_sndev(ntb);
731 static u32 switchtec_ntb_spad_read(struct ntb_dev *ntb, int idx)
733 struct switchtec_ntb *sndev = ntb_sndev(ntb);
744 static int switchtec_ntb_spad_write(struct ntb_dev *ntb, int idx, u32 val)
746 struct switchtec_ntb *sndev = ntb_sndev(ntb);
759 static u32 switchtec_ntb_peer_spad_read(struct ntb_dev *ntb, int pidx,
762 struct switchtec_ntb *sndev = ntb_sndev(ntb);
776 static int switchtec_ntb_peer_spad_write(struct ntb_dev *ntb, int pidx,
779 struct switchtec_ntb *sndev = ntb_sndev(ntb);
795 static int switchtec_ntb_peer_spad_addr(struct ntb_dev *ntb, int pidx,
798 struct switchtec_ntb *sndev = ntb_sndev(ntb);
808 *spad_addr = pci_resource_start(ntb->pdev, 0) + offset;
846 sndev->ntb.pdev = sndev->stdev->pdev;
847 sndev->ntb.topo = NTB_TOPO_SWITCH;
848 sndev->ntb.ops = &switchtec_ntb_ops;
869 "ntb target partition not defined\n");
883 "ntb driver only supports 1 pair of 1-1 ntb mapping\n");
890 "ntb target partition is not NT partition\n");
1029 size = pci_resource_len(sndev->ntb.pdev, bar) - offset;
1133 sndev->ntb.topo = NTB_TOPO_CROSSLINK;
1379 ntb_db_event(&sndev->ntb, 0);
1517 * once we register the ntb device).
1521 rc = ntb_register_device(&sndev->ntb);
1539 dev_err(dev, "failed to register ntb device: %d\n", rc);
1553 ntb_unregister_device(&sndev->ntb);
1558 dev_info(dev, "ntb device unregistered\n");