Lines Matching refs:ntb

46 	struct ntb_dev ntb;  member
93 static struct switchtec_ntb *ntb_sndev(struct ntb_dev *ntb) in ntb_sndev() argument
95 return container_of(ntb, struct switchtec_ntb, ntb); in ntb_sndev()
166 static int switchtec_ntb_mw_count(struct ntb_dev *ntb, int pidx) in switchtec_ntb_mw_count() argument
168 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_mw_count()
191 static int switchtec_ntb_mw_get_align(struct ntb_dev *ntb, int pidx, in switchtec_ntb_mw_get_align() argument
196 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_mw_get_align()
270 static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx, in switchtec_ntb_mw_set_trans() argument
273 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_mw_set_trans()
285 if (widx >= switchtec_ntb_mw_count(ntb, pidx)) in switchtec_ntb_mw_set_trans()
341 static int switchtec_ntb_peer_mw_count(struct ntb_dev *ntb) in switchtec_ntb_peer_mw_count() argument
343 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_mw_count()
370 *base = pci_resource_start(sndev->ntb.pdev, bar) + offset; in switchtec_ntb_direct_get_addr()
373 *size = pci_resource_len(sndev->ntb.pdev, bar) - offset; in switchtec_ntb_direct_get_addr()
394 *base = pci_resource_start(sndev->ntb.pdev, bar) + offset; in switchtec_ntb_lut_get_addr()
402 static int switchtec_ntb_peer_mw_get_addr(struct ntb_dev *ntb, int idx, in switchtec_ntb_peer_mw_get_addr() argument
406 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_mw_get_addr()
410 else if (idx < switchtec_ntb_peer_mw_count(ntb)) in switchtec_ntb_peer_mw_get_addr()
511 ntb_link_event(&sndev->ntb); in switchtec_ntb_link_status_update()
533 ntb_link_event(&sndev->ntb); in check_link_status_work()
559 static u64 switchtec_ntb_link_is_up(struct ntb_dev *ntb, in switchtec_ntb_link_is_up() argument
563 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_is_up()
573 static int switchtec_ntb_link_enable(struct ntb_dev *ntb, in switchtec_ntb_link_enable() argument
577 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_enable()
589 static int switchtec_ntb_link_disable(struct ntb_dev *ntb) in switchtec_ntb_link_disable() argument
591 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_disable()
603 static u64 switchtec_ntb_db_valid_mask(struct ntb_dev *ntb) in switchtec_ntb_db_valid_mask() argument
605 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_valid_mask()
610 static int switchtec_ntb_db_vector_count(struct ntb_dev *ntb) in switchtec_ntb_db_vector_count() argument
615 static u64 switchtec_ntb_db_vector_mask(struct ntb_dev *ntb, int db_vector) in switchtec_ntb_db_vector_mask() argument
617 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_vector_mask()
625 static u64 switchtec_ntb_db_read(struct ntb_dev *ntb) in switchtec_ntb_db_read() argument
628 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_read()
635 static int switchtec_ntb_db_clear(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_clear() argument
637 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_clear()
644 static int switchtec_ntb_db_set_mask(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_set_mask() argument
647 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_set_mask()
662 static int switchtec_ntb_db_clear_mask(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_clear_mask() argument
665 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_clear_mask()
680 static u64 switchtec_ntb_db_read_mask(struct ntb_dev *ntb) in switchtec_ntb_db_read_mask() argument
682 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_read_mask()
687 static int switchtec_ntb_peer_db_addr(struct ntb_dev *ntb, in switchtec_ntb_peer_db_addr() argument
693 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_db_addr()
705 *db_addr = pci_resource_start(ntb->pdev, 0) + offset; in switchtec_ntb_peer_db_addr()
714 static int switchtec_ntb_peer_db_set(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_peer_db_set() argument
716 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_db_set()
724 static int switchtec_ntb_spad_count(struct ntb_dev *ntb) in switchtec_ntb_spad_count() argument
726 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_count()
731 static u32 switchtec_ntb_spad_read(struct ntb_dev *ntb, int idx) in switchtec_ntb_spad_read() argument
733 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_read()
744 static int switchtec_ntb_spad_write(struct ntb_dev *ntb, int idx, u32 val) in switchtec_ntb_spad_write() argument
746 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_write()
759 static u32 switchtec_ntb_peer_spad_read(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_read() argument
762 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_read()
776 static int switchtec_ntb_peer_spad_write(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_write() argument
779 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_write()
795 static int switchtec_ntb_peer_spad_addr(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_addr() argument
798 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_addr()
808 *spad_addr = pci_resource_start(ntb->pdev, 0) + offset; in switchtec_ntb_peer_spad_addr()
846 sndev->ntb.pdev = sndev->stdev->pdev; in switchtec_ntb_init_sndev()
847 sndev->ntb.topo = NTB_TOPO_SWITCH; in switchtec_ntb_init_sndev()
848 sndev->ntb.ops = &switchtec_ntb_ops; in switchtec_ntb_init_sndev()
1029 size = pci_resource_len(sndev->ntb.pdev, bar) - offset; in crosslink_setup_mws()
1133 sndev->ntb.topo = NTB_TOPO_CROSSLINK; in switchtec_ntb_init_crosslink()
1379 ntb_db_event(&sndev->ntb, 0); in switchtec_ntb_doorbell_isr()
1522 rc = ntb_register_device(&sndev->ntb); in switchtec_ntb_add()
1555 ntb_unregister_device(&sndev->ntb); in switchtec_ntb_remove()