Linux 4.16.11
[linux/fpc-iii.git] / drivers / net / ethernet / huawei / hinic / hinic_common.h
blob2c06b76e94a167f37449782e29ec5e84d10f8b4a
1 /*
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
12 * for more details.
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)
24 struct hinic_sge {
25 u32 hi_addr;
26 u32 lo_addr;
27 u32 len;
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);
38 #endif