NTB: Add ntb_db_vector_mask() missed in r289546

This is the last one.

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
cem 2015-10-19 18:06:35 +00:00
parent 530285e6fc
commit 0965bc10d7
3 changed files with 22 additions and 4 deletions

View File

@ -290,7 +290,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp);
static void ntb_rx_copy_task(struct ntb_transport_qp *qp,
struct ntb_queue_entry *entry, void *offset);
static void ntb_complete_rxc(void *arg, int pending);
static void ntb_transport_doorbell_callback(void *data, int vector);
static void ntb_transport_doorbell_callback(void *data, uint32_t vector);
static void ntb_transport_event_callback(void *data);
static void ntb_transport_link_work(void *arg);
static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, unsigned size);
@ -1122,7 +1122,7 @@ ntb_complete_rxc(void *arg, int pending)
}
static void
ntb_transport_doorbell_callback(void *data, int vector)
ntb_transport_doorbell_callback(void *data, uint32_t vector)
{
struct ntb_transport_ctx *nt = data;
struct ntb_transport_qp *qp;

View File

@ -2207,6 +2207,24 @@ ntb_db_valid_mask(struct ntb_softc *ntb)
return (ntb->db_valid_mask);
}
/*
* ntb_db_vector_mask() - get a mask of doorbell bits serviced by a vector
* @ntb: NTB device context
* @vector: Doorbell vector number
*
* Each interrupt vector may have a different number or arrangement of bits.
*
* Return: A mask of doorbell bits serviced by a vector.
*/
uint64_t
ntb_db_vector_mask(struct ntb_softc *ntb, uint32_t vector)
{
if (vector > ntb->db_vec_count)
return (0);
return (ntb->db_valid_mask & ntb_vec_mask(ntb, vector));
}
/**
* ntb_link_is_up() - get the current ntb link state
* @ntb: NTB device context

View File

@ -56,7 +56,7 @@ enum ntb_width {
SYSCTL_DECL(_hw_ntb);
typedef void (*ntb_db_callback)(void *data, int vector);
typedef void (*ntb_db_callback)(void *data, uint32_t vector);
typedef void (*ntb_event_callback)(void *data);
struct ntb_ctx_ops {
@ -90,13 +90,13 @@ int ntb_peer_spad_read(struct ntb_softc *ntb, unsigned int idx,
uint32_t *val);
uint64_t ntb_db_valid_mask(struct ntb_softc *);
uint64_t ntb_db_vector_mask(struct ntb_softc *, uint32_t vector);
bus_addr_t ntb_get_peer_db_addr(struct ntb_softc *, vm_size_t *sz_out);
void ntb_db_clear(struct ntb_softc *, uint64_t bits);
void ntb_db_clear_mask(struct ntb_softc *, uint64_t bits);
uint64_t ntb_db_read(struct ntb_softc *);
void ntb_db_set_mask(struct ntb_softc *, uint64_t bits);
uint64_t ntb_db_vector_mask(struct ntb_softc *, int vector);
void ntb_peer_db_set(struct ntb_softc *, uint64_t bits);
/* Hardware owns the low 32 bits of features. */