2 * Huawei HiNIC PCI Express Linux driver
3 * Copyright(c) 2017 Huawei Technologies Co., Ltd
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #ifndef HINIC_COMMON_H
17 #define HINIC_COMMON_H
19 #include <linux/types.h>
21 #define UPPER_8_BITS(data) (((data) >> 8) & 0xFF)
22 #define LOWER_8_BITS(data) ((data) & 0xFF)
30 void hinic_cpu_to_be32(void *data
, int len
);
32 void hinic_be32_to_cpu(void *data
, int len
);
34 void hinic_set_sge(struct hinic_sge
*sge
, dma_addr_t addr
, int len
);
36 dma_addr_t
hinic_sge_to_dma(struct hinic_sge
*sge
);