igc_hw.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2018 Intel Corporation */
  3. #ifndef _IGC_HW_H_
  4. #define _IGC_HW_H_
  5. #include <linux/types.h>
  6. #include <linux/if_ether.h>
  7. #include "igc_regs.h"
  8. #include "igc_defines.h"
  9. #include "igc_mac.h"
  10. #include "igc_i225.h"
  11. #define IGC_DEV_ID_I225_LM 0x15F2
  12. #define IGC_DEV_ID_I225_V 0x15F3
  13. /* Function pointers for the MAC. */
  14. struct igc_mac_operations {
  15. };
  16. enum igc_mac_type {
  17. igc_undefined = 0,
  18. igc_i225,
  19. igc_num_macs /* List is 1-based, so subtract 1 for true count. */
  20. };
  21. enum igc_phy_type {
  22. igc_phy_unknown = 0,
  23. igc_phy_none,
  24. igc_phy_i225,
  25. };
  26. struct igc_mac_info {
  27. struct igc_mac_operations ops;
  28. u8 addr[ETH_ALEN];
  29. u8 perm_addr[ETH_ALEN];
  30. enum igc_mac_type type;
  31. u32 collision_delta;
  32. u32 ledctl_default;
  33. u32 ledctl_mode1;
  34. u32 ledctl_mode2;
  35. u32 mc_filter_type;
  36. u32 tx_packet_delta;
  37. u32 txcw;
  38. u16 mta_reg_count;
  39. u16 uta_reg_count;
  40. u16 rar_entry_count;
  41. u8 forced_speed_duplex;
  42. bool adaptive_ifs;
  43. bool has_fwsm;
  44. bool arc_subsystem_valid;
  45. bool autoneg;
  46. bool autoneg_failed;
  47. };
  48. struct igc_bus_info {
  49. u16 func;
  50. u16 pci_cmd_word;
  51. };
  52. struct igc_hw {
  53. void *back;
  54. u8 __iomem *hw_addr;
  55. unsigned long io_base;
  56. struct igc_mac_info mac;
  57. struct igc_bus_info bus;
  58. u16 device_id;
  59. u16 subsystem_vendor_id;
  60. u16 subsystem_device_id;
  61. u16 vendor_id;
  62. u8 revision_id;
  63. };
  64. s32 igc_read_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value);
  65. s32 igc_write_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value);
  66. void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value);
  67. void igc_write_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value);
  68. #endif /* _IGC_HW_H_ */