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()
509 ntb_link_event(&sndev->ntb); in switchtec_ntb_link_status_update()
531 ntb_link_event(&sndev->ntb); in check_link_status_work()
557 static u64 switchtec_ntb_link_is_up(struct ntb_dev *ntb, in switchtec_ntb_link_is_up() argument
561 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_is_up()
571 static int switchtec_ntb_link_enable(struct ntb_dev *ntb, in switchtec_ntb_link_enable() argument
575 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_enable()
587 static int switchtec_ntb_link_disable(struct ntb_dev *ntb) in switchtec_ntb_link_disable() argument
589 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_link_disable()
601 static u64 switchtec_ntb_db_valid_mask(struct ntb_dev *ntb) in switchtec_ntb_db_valid_mask() argument
603 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_valid_mask()
608 static int switchtec_ntb_db_vector_count(struct ntb_dev *ntb) in switchtec_ntb_db_vector_count() argument
613 static u64 switchtec_ntb_db_vector_mask(struct ntb_dev *ntb, int db_vector) in switchtec_ntb_db_vector_mask() argument
615 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_vector_mask()
623 static u64 switchtec_ntb_db_read(struct ntb_dev *ntb) in switchtec_ntb_db_read() argument
626 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_read()
633 static int switchtec_ntb_db_clear(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_clear() argument
635 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_clear()
642 static int switchtec_ntb_db_set_mask(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_set_mask() argument
645 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_set_mask()
660 static int switchtec_ntb_db_clear_mask(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_db_clear_mask() argument
663 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_clear_mask()
678 static u64 switchtec_ntb_db_read_mask(struct ntb_dev *ntb) in switchtec_ntb_db_read_mask() argument
680 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_db_read_mask()
685 static int switchtec_ntb_peer_db_addr(struct ntb_dev *ntb, in switchtec_ntb_peer_db_addr() argument
691 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_db_addr()
703 *db_addr = pci_resource_start(ntb->pdev, 0) + offset; in switchtec_ntb_peer_db_addr()
712 static int switchtec_ntb_peer_db_set(struct ntb_dev *ntb, u64 db_bits) in switchtec_ntb_peer_db_set() argument
714 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_db_set()
722 static int switchtec_ntb_spad_count(struct ntb_dev *ntb) in switchtec_ntb_spad_count() argument
724 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_count()
729 static u32 switchtec_ntb_spad_read(struct ntb_dev *ntb, int idx) in switchtec_ntb_spad_read() argument
731 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_read()
742 static int switchtec_ntb_spad_write(struct ntb_dev *ntb, int idx, u32 val) in switchtec_ntb_spad_write() argument
744 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_spad_write()
757 static u32 switchtec_ntb_peer_spad_read(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_read() argument
760 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_read()
774 static int switchtec_ntb_peer_spad_write(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_write() argument
777 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_write()
793 static int switchtec_ntb_peer_spad_addr(struct ntb_dev *ntb, int pidx, in switchtec_ntb_peer_spad_addr() argument
796 struct switchtec_ntb *sndev = ntb_sndev(ntb); in switchtec_ntb_peer_spad_addr()
806 *spad_addr = pci_resource_start(ntb->pdev, 0) + offset; in switchtec_ntb_peer_spad_addr()
845 sndev->ntb.pdev = sndev->stdev->pdev; in switchtec_ntb_init_sndev()
846 sndev->ntb.topo = NTB_TOPO_SWITCH; in switchtec_ntb_init_sndev()
847 sndev->ntb.ops = &switchtec_ntb_ops; in switchtec_ntb_init_sndev()
1031 size = pci_resource_len(sndev->ntb.pdev, bar) - offset; in crosslink_setup_mws()
1135 sndev->ntb.topo = NTB_TOPO_CROSSLINK; in switchtec_ntb_init_crosslink()
1381 ntb_db_event(&sndev->ntb, 0); in switchtec_ntb_doorbell_isr()
1524 rc = ntb_register_device(&sndev->ntb); in switchtec_ntb_add()
1557 ntb_unregister_device(&sndev->ntb); in switchtec_ntb_remove()