WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / ethernet / huawei / hinic / hinic_common.h
bloba0de9d9644c6ad39442086262063c52eaf9e9551
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Huawei HiNIC PCI Express Linux driver
4 * Copyright(c) 2017 Huawei Technologies Co., Ltd
5 */
7 #ifndef HINIC_COMMON_H
8 #define HINIC_COMMON_H
10 #include <linux/types.h>
12 #define UPPER_8_BITS(data) (((data) >> 8) & 0xFF)
13 #define LOWER_8_BITS(data) ((data) & 0xFF)
15 struct hinic_sge {
16 u32 hi_addr;
17 u32 lo_addr;
18 u32 len;
21 void hinic_cpu_to_be32(void *data, int len);
23 void hinic_be32_to_cpu(void *data, int len);
25 void hinic_set_sge(struct hinic_sge *sge, dma_addr_t addr, int len);
27 dma_addr_t hinic_sge_to_dma(struct hinic_sge *sge);
29 #endif