hinic_common.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Huawei HiNIC PCI Express Linux driver
  3. * Copyright(c) 2017 Huawei Technologies Co., Ltd
  4. *
  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.
  8. *
  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.
  13. *
  14. */
  15. #ifndef HINIC_COMMON_H
  16. #define HINIC_COMMON_H
  17. #include <linux/types.h>
  18. #define UPPER_8_BITS(data) (((data) >> 8) & 0xFF)
  19. #define LOWER_8_BITS(data) ((data) & 0xFF)
  20. struct hinic_sge {
  21. u32 hi_addr;
  22. u32 lo_addr;
  23. u32 len;
  24. };
  25. void hinic_cpu_to_be32(void *data, int len);
  26. void hinic_be32_to_cpu(void *data, int len);
  27. void hinic_set_sge(struct hinic_sge *sge, dma_addr_t addr, int len);
  28. dma_addr_t hinic_sge_to_dma(struct hinic_sge *sge);
  29. #endif