Lines Matching refs:pidx

263 	int (*peer_port_number)(struct ntb_dev *ntb, int pidx);
272 int (*mw_count)(struct ntb_dev *ntb, int pidx);
273 int (*mw_get_align)(struct ntb_dev *ntb, int pidx, int widx,
277 int (*mw_set_trans)(struct ntb_dev *ntb, int pidx, int widx,
279 int (*mw_clear_trans)(struct ntb_dev *ntb, int pidx, int widx);
283 int (*peer_mw_set_trans)(struct ntb_dev *ntb, int pidx, int widx,
285 int (*peer_mw_clear_trans)(struct ntb_dev *ntb, int pidx, int widx);
317 int (*peer_spad_addr)(struct ntb_dev *ntb, int pidx, int sidx,
319 u32 (*peer_spad_read)(struct ntb_dev *ntb, int pidx, int sidx);
320 int (*peer_spad_write)(struct ntb_dev *ntb, int pidx, int sidx,
330 u32 (*msg_read)(struct ntb_dev *ntb, int *pidx, int midx);
331 int (*peer_msg_write)(struct ntb_dev *ntb, int pidx, int midx, u32 msg);
591 int ntb_default_peer_port_number(struct ntb_dev *ntb, int pidx);
653 static inline int ntb_peer_port_number(struct ntb_dev *ntb, int pidx) in ntb_peer_port_number() argument
656 return ntb_default_peer_port_number(ntb, pidx); in ntb_peer_port_number()
658 return ntb->ops->peer_port_number(ntb, pidx); in ntb_peer_port_number()
678 int pidx; in ntb_logical_port_number() local
683 for (pidx = 0; pidx < ntb_peer_port_count(ntb); pidx++) in ntb_logical_port_number()
684 if (lport <= ntb_peer_port_number(ntb, pidx)) in ntb_logical_port_number()
685 return pidx; in ntb_logical_port_number()
687 return pidx; in ntb_logical_port_number()
705 static inline int ntb_peer_logical_port_number(struct ntb_dev *ntb, int pidx) in ntb_peer_logical_port_number() argument
707 if (ntb_peer_port_number(ntb, pidx) < ntb_port_number(ntb)) in ntb_peer_logical_port_number()
708 return pidx; in ntb_peer_logical_port_number()
710 return pidx + 1; in ntb_peer_logical_port_number()
802 static inline int ntb_mw_count(struct ntb_dev *ntb, int pidx) in ntb_mw_count() argument
804 return ntb->ops->mw_count(ntb, pidx); in ntb_mw_count()
823 static inline int ntb_mw_get_align(struct ntb_dev *ntb, int pidx, int widx, in ntb_mw_get_align() argument
828 if (!(ntb_link_is_up(ntb, NULL, NULL) & BIT_ULL(pidx))) in ntb_mw_get_align()
831 return ntb->ops->mw_get_align(ntb, pidx, widx, addr_align, size_align, in ntb_mw_get_align()
854 static inline int ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx, in ntb_mw_set_trans() argument
860 return ntb->ops->mw_set_trans(ntb, pidx, widx, addr, size); in ntb_mw_set_trans()
875 static inline int ntb_mw_clear_trans(struct ntb_dev *ntb, int pidx, int widx) in ntb_mw_clear_trans() argument
878 return ntb_mw_set_trans(ntb, pidx, widx, 0, 0); in ntb_mw_clear_trans()
880 return ntb->ops->mw_clear_trans(ntb, pidx, widx); in ntb_mw_clear_trans()
936 static inline int ntb_peer_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx, in ntb_peer_mw_set_trans() argument
942 return ntb->ops->peer_mw_set_trans(ntb, pidx, widx, addr, size); in ntb_peer_mw_set_trans()
960 static inline int ntb_peer_mw_clear_trans(struct ntb_dev *ntb, int pidx, in ntb_peer_mw_clear_trans() argument
964 return ntb_peer_mw_set_trans(ntb, pidx, widx, 0, 0); in ntb_peer_mw_clear_trans()
966 return ntb->ops->peer_mw_clear_trans(ntb, pidx, widx); in ntb_peer_mw_clear_trans()
1359 static inline int ntb_peer_spad_addr(struct ntb_dev *ntb, int pidx, int sidx, in ntb_peer_spad_addr() argument
1365 return ntb->ops->peer_spad_addr(ntb, pidx, sidx, spad_addr); in ntb_peer_spad_addr()
1378 static inline u32 ntb_peer_spad_read(struct ntb_dev *ntb, int pidx, int sidx) in ntb_peer_spad_read() argument
1383 return ntb->ops->peer_spad_read(ntb, pidx, sidx); in ntb_peer_spad_read()
1397 static inline int ntb_peer_spad_write(struct ntb_dev *ntb, int pidx, int sidx, in ntb_peer_spad_write() argument
1403 return ntb->ops->peer_spad_write(ntb, pidx, sidx, val); in ntb_peer_spad_write()
1536 static inline u32 ntb_msg_read(struct ntb_dev *ntb, int *pidx, int midx) in ntb_msg_read() argument
1541 return ntb->ops->msg_read(ntb, pidx, midx); in ntb_msg_read()
1557 static inline int ntb_peer_msg_write(struct ntb_dev *ntb, int pidx, int midx, in ntb_peer_msg_write() argument
1563 return ntb->ops->peer_msg_write(ntb, pidx, midx, msg); in ntb_peer_msg_write()
1597 static inline int ntb_peer_resource_idx(struct ntb_dev *ntb, int pidx) in ntb_peer_resource_idx() argument
1601 if (pidx >= ntb_peer_port_count(ntb)) in ntb_peer_resource_idx()
1605 peer_port = ntb_peer_logical_port_number(ntb, pidx); in ntb_peer_resource_idx()
1625 static inline int ntb_peer_highest_mw_idx(struct ntb_dev *ntb, int pidx) in ntb_peer_highest_mw_idx() argument
1629 ret = ntb_peer_resource_idx(ntb, pidx); in ntb_peer_highest_mw_idx()
1633 return ntb_mw_count(ntb, pidx) - ret - 1; in ntb_peer_highest_mw_idx()