Lines Matching refs:ntb

39 #include "ntb.h"
42 SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
112 rm_init(&nc->ctx_lock, "ntb ctx");
255 ntb_port_number(device_t ntb)
257 return (NTB_PORT_NUMBER(device_get_parent(ntb)));
261 ntb_peer_port_count(device_t ntb)
263 return (NTB_PEER_PORT_COUNT(device_get_parent(ntb)));
267 ntb_peer_port_number(device_t ntb, int pidx)
269 return (NTB_PEER_PORT_NUMBER(device_get_parent(ntb), pidx));
273 ntb_peer_port_idx(device_t ntb, int port)
275 return (NTB_PEER_PORT_IDX(device_get_parent(ntb), port));
279 ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width)
282 return (NTB_LINK_IS_UP(device_get_parent(ntb), speed, width));
286 ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width)
288 struct ntb_child *nc = device_get_ivars(ntb);
299 return (NTB_LINK_ENABLE(device_get_parent(ntb), speed, width));
303 ntb_link_disable(device_t ntb)
305 struct ntb_child *nc = device_get_ivars(ntb);
316 return (NTB_LINK_DISABLE(device_get_parent(ntb)));
320 ntb_link_enabled(device_t ntb)
322 struct ntb_child *nc = device_get_ivars(ntb);
324 return (nc->enabled && NTB_LINK_ENABLED(device_get_parent(ntb)));
328 ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops)
330 struct ntb_child *nc = device_get_ivars(ntb);
355 ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops)
357 struct ntb_child *nc = device_get_ivars(ntb);
366 ntb_clear_ctx(device_t ntb)
368 struct ntb_child *nc = device_get_ivars(ntb);
377 ntb_mw_count(device_t ntb)
379 struct ntb_child *nc = device_get_ivars(ntb);
385 ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base,
389 struct ntb_child *nc = device_get_ivars(ntb);
391 return (NTB_MW_GET_RANGE(device_get_parent(ntb), mw_idx + nc->mwoff,
396 ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, size_t size)
398 struct ntb_child *nc = device_get_ivars(ntb);
400 return (NTB_MW_SET_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff,
405 ntb_mw_clear_trans(device_t ntb, unsigned mw_idx)
407 struct ntb_child *nc = device_get_ivars(ntb);
409 return (NTB_MW_CLEAR_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff));
413 ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode)
415 struct ntb_child *nc = device_get_ivars(ntb);
417 return (NTB_MW_GET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode));
421 ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode)
423 struct ntb_child *nc = device_get_ivars(ntb);
425 return (NTB_MW_SET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode));
429 ntb_spad_count(device_t ntb)
431 struct ntb_child *nc = device_get_ivars(ntb);
437 ntb_spad_clear(device_t ntb)
439 struct ntb_child *nc = device_get_ivars(ntb);
443 NTB_SPAD_WRITE(device_get_parent(ntb), i + nc->spadoff, 0);
447 ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val)
449 struct ntb_child *nc = device_get_ivars(ntb);
451 return (NTB_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, val));
455 ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val)
457 struct ntb_child *nc = device_get_ivars(ntb);
459 return (NTB_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, val));
463 ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val)
465 struct ntb_child *nc = device_get_ivars(ntb);
467 return (NTB_PEER_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff,
472 ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val)
474 struct ntb_child *nc = device_get_ivars(ntb);
476 return (NTB_PEER_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff,
481 ntb_db_valid_mask(device_t ntb)
483 struct ntb_child *nc = device_get_ivars(ntb);
489 ntb_db_vector_count(device_t ntb)
492 return (NTB_DB_VECTOR_COUNT(device_get_parent(ntb)));
496 ntb_db_vector_mask(device_t ntb, uint32_t vector)
498 struct ntb_child *nc = device_get_ivars(ntb);
500 return ((NTB_DB_VECTOR_MASK(device_get_parent(ntb), vector)
505 ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size)
508 return (NTB_PEER_DB_ADDR(device_get_parent(ntb), db_addr, db_size));
512 ntb_db_clear(device_t ntb, uint64_t bits)
514 struct ntb_child *nc = device_get_ivars(ntb);
516 return (NTB_DB_CLEAR(device_get_parent(ntb), bits << nc->dboff));
520 ntb_db_clear_mask(device_t ntb, uint64_t bits)
522 struct ntb_child *nc = device_get_ivars(ntb);
524 return (NTB_DB_CLEAR_MASK(device_get_parent(ntb), bits << nc->dboff));
528 ntb_db_read(device_t ntb)
530 struct ntb_child *nc = device_get_ivars(ntb);
532 return ((NTB_DB_READ(device_get_parent(ntb)) >> nc->dboff)
537 ntb_db_set_mask(device_t ntb, uint64_t bits)
539 struct ntb_child *nc = device_get_ivars(ntb);
541 return (NTB_DB_SET_MASK(device_get_parent(ntb), bits << nc->dboff));
545 ntb_peer_db_set(device_t ntb, uint64_t bits)
547 struct ntb_child *nc = device_get_ivars(ntb);
549 return (NTB_PEER_DB_SET(device_get_parent(ntb), bits << nc->dboff));
552 MODULE_VERSION(ntb, 1);