diff options
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma.h')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h index 294dd27b601e..7c001b97b23f 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma.h | |||
@@ -423,5 +423,17 @@ static inline int is_cqe_wr_imm(struct ocrdma_cqe *cqe) | |||
423 | OCRDMA_CQE_WRITE_IMM) ? 1 : 0; | 423 | OCRDMA_CQE_WRITE_IMM) ? 1 : 0; |
424 | } | 424 | } |
425 | 425 | ||
426 | static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev, | ||
427 | struct ib_ah_attr *ah_attr, u8 *mac_addr) | ||
428 | { | ||
429 | struct in6_addr in6; | ||
430 | |||
431 | memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6)); | ||
432 | if (rdma_is_multicast_addr(&in6)) | ||
433 | rdma_get_mcast_mac(&in6, mac_addr); | ||
434 | else | ||
435 | memcpy(mac_addr, ah_attr->dmac, ETH_ALEN); | ||
436 | return 0; | ||
437 | } | ||
426 | 438 | ||
427 | #endif | 439 | #endif |