cn23xx_pf_device.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**********************************************************************
  2. * Author: Cavium, Inc.
  3. *
  4. * Contact: support@cavium.com
  5. * Please include "LiquidIO" in the subject.
  6. *
  7. * Copyright (c) 2003-2016 Cavium, Inc.
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more details.
  17. ***********************************************************************/
  18. /*! \file cn23xx_device.h
  19. * \brief Host Driver: Routines that perform CN23XX specific operations.
  20. */
  21. #ifndef __CN23XX_PF_DEVICE_H__
  22. #define __CN23XX_PF_DEVICE_H__
  23. #include "cn23xx_pf_regs.h"
  24. /* Register address and configuration for a CN23XX devices.
  25. * If device specific changes need to be made then add a struct to include
  26. * device specific fields as shown in the commented section
  27. */
  28. struct octeon_cn23xx_pf {
  29. /** PCI interrupt summary register */
  30. u8 __iomem *intr_sum_reg64;
  31. /** PCI interrupt enable register */
  32. u8 __iomem *intr_enb_reg64;
  33. /** The PCI interrupt mask used by interrupt handler */
  34. u64 intr_mask64;
  35. struct octeon_config *conf;
  36. };
  37. #define CN23XX_SLI_DEF_BP 0x40
  38. struct oct_vf_stats {
  39. u64 rx_packets;
  40. u64 tx_packets;
  41. u64 rx_bytes;
  42. u64 tx_bytes;
  43. u64 broadcast;
  44. u64 multicast;
  45. };
  46. int setup_cn23xx_octeon_pf_device(struct octeon_device *oct);
  47. int validate_cn23xx_pf_config_info(struct octeon_device *oct,
  48. struct octeon_config *conf23xx);
  49. u32 cn23xx_pf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us);
  50. void cn23xx_dump_pf_initialized_regs(struct octeon_device *oct);
  51. int cn23xx_sriov_config(struct octeon_device *oct);
  52. int cn23xx_fw_loaded(struct octeon_device *oct);
  53. void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
  54. u8 *mac);
  55. int cn23xx_get_vf_stats(struct octeon_device *oct, int ifidx,
  56. struct oct_vf_stats *stats);
  57. #endif