src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_init_ops_pf(struct txgbe_hw *hw)
{
	struct txgbe_bus_info *bus = &hw->bus;
	struct txgbe_mac_info *mac = &hw->mac;
	struct txgbe_phy_info *phy = &hw->phy;
	struct txgbe_rom_info *rom = &hw->rom;
	struct txgbe_mbx_info *mbx = &hw->mbx;

	DEBUGFUNC("txgbe_init_ops_pf");

	/* BUS */
	bus->set_lan_id = txgbe_set_lan_id_multi_port;

	/* PHY */
	phy->get_media_type = txgbe_get_media_type_raptor;
	phy->identify = txgbe_identify_phy;
	phy->init = txgbe_init_phy_raptor;
	phy->read_reg = txgbe_read_phy_reg;
	phy->write_reg = txgbe_write_phy_reg;
	phy->read_reg_mdi = txgbe_read_phy_reg_mdi;
	phy->write_reg_mdi = txgbe_write_phy_reg_mdi;
	phy->setup_link = txgbe_setup_phy_link;
	phy->setup_link_speed = txgbe_setup_phy_link_speed;
	phy->read_i2c_byte = txgbe_read_i2c_byte;
	phy->write_i2c_byte = txgbe_write_i2c_byte;
	phy->read_i2c_sff8472 = txgbe_read_i2c_sff8472;
	phy->read_i2c_eeprom = txgbe_read_i2c_eeprom;
	phy->write_i2c_eeprom = txgbe_write_i2c_eeprom;
	phy->identify_sfp = txgbe_identify_module;
	phy->read_i2c_byte_unlocked = txgbe_read_i2c_byte_unlocked;
	phy->write_i2c_byte_unlocked = txgbe_write_i2c_byte_unlocked;
	phy->reset = txgbe_reset_phy;

	/* MAC */
	mac->init_hw = txgbe_init_hw;
	mac->start_hw = txgbe_start_hw_raptor;
	mac->clear_hw_cntrs = txgbe_clear_hw_cntrs;
	mac->enable_rx_dma = txgbe_enable_rx_dma_raptor;
	mac->get_mac_addr = txgbe_get_mac_addr;
	mac->stop_hw = txgbe_stop_hw;
	mac->acquire_swfw_sync = txgbe_acquire_swfw_sync;
	mac->release_swfw_sync = txgbe_release_swfw_sync;
	mac->reset_hw = txgbe_reset_hw;

	mac->disable_sec_rx_path = txgbe_disable_sec_rx_path;
	mac->enable_sec_rx_path = txgbe_enable_sec_rx_path;
	mac->disable_sec_tx_path = txgbe_disable_sec_tx_path;
	mac->enable_sec_tx_path = txgbe_enable_sec_tx_path;
	mac->get_san_mac_addr = txgbe_get_san_mac_addr;
	mac->set_san_mac_addr = txgbe_set_san_mac_addr;
	mac->get_device_caps = txgbe_get_device_caps;
	mac->get_wwn_prefix = txgbe_get_wwn_prefix;
	mac->autoc_read = txgbe_autoc_read;
	mac->autoc_write = txgbe_autoc_write;
	mac->prot_autoc_read = txgbe_prot_autoc_read_raptor;
	mac->prot_autoc_write = txgbe_prot_autoc_write_raptor;

	/* RAR, Multicast, VLAN */
	mac->set_rar = txgbe_set_rar;
	mac->clear_rar = txgbe_clear_rar;
	mac->init_rx_addrs = txgbe_init_rx_addrs;
	mac->enable_rx = txgbe_enable_rx;
	mac->disable_rx = txgbe_disable_rx;
	mac->set_vmdq = txgbe_set_vmdq;
	mac->clear_vmdq = txgbe_clear_vmdq;
	mac->set_vfta = txgbe_set_vfta;
	mac->set_vlvf = txgbe_set_vlvf;
	mac->clear_vfta = txgbe_clear_vfta;
	mac->init_uta_tables = txgbe_init_uta_tables;
	mac->setup_sfp = txgbe_setup_sfp_modules;
	mac->set_mac_anti_spoofing = txgbe_set_mac_anti_spoofing;
	mac->set_ethertype_anti_spoofing = txgbe_set_ethertype_anti_spoofing;

	/* Flow Control */
	mac->fc_enable = txgbe_fc_enable;
	mac->setup_fc = txgbe_setup_fc;
	mac->fc_autoneg = txgbe_fc_autoneg;

	/* Link */
	mac->get_link_capabilities = txgbe_get_link_capabilities_raptor;
	mac->check_link = txgbe_check_mac_link;
	mac->setup_pba = txgbe_set_pba;

	/* Manageability interface */
	mac->set_fw_drv_ver = txgbe_hic_set_drv_ver;
	mac->get_thermal_sensor_data = txgbe_get_thermal_sensor_data;
	mac->init_thermal_sensor_thresh = txgbe_init_thermal_sensor_thresh;

	mbx->init_params = txgbe_init_mbx_params_pf;
	mbx->read = txgbe_read_mbx_pf;
	mbx->write = txgbe_write_mbx_pf;
	mbx->check_for_msg = txgbe_check_for_msg_pf;
	mbx->check_for_ack = txgbe_check_for_ack_pf;
	mbx->check_for_rst = txgbe_check_for_rst_pf;

	/* EEPROM */
	rom->init_params = txgbe_init_eeprom_params;
	rom->read16 = txgbe_ee_read16;
	rom->readw_buffer = txgbe_ee_readw_buffer;
	rom->readw_sw = txgbe_ee_readw_sw;
	rom->read32 = txgbe_ee_read32;
	rom->write16 = txgbe_ee_write16;
	rom->writew_buffer = txgbe_ee_writew_buffer;
	rom->writew_sw = txgbe_ee_writew_sw;
	rom->write32 = txgbe_ee_write32;
	rom->validate_checksum = txgbe_validate_eeprom_checksum;
	rom->update_checksum = txgbe_update_eeprom_checksum;
	rom->calc_checksum = txgbe_calc_eeprom_checksum;

	mac->mcft_size		= TXGBE_RAPTOR_MC_TBL_SIZE;
	mac->vft_size		= TXGBE_RAPTOR_VFT_TBL_SIZE;
	mac->num_rar_entries	= TXGBE_RAPTOR_RAR_ENTRIES;
	mac->rx_pb_size		= TXGBE_RAPTOR_RX_PB_SIZE;
	mac->max_rx_queues	= TXGBE_RAPTOR_MAX_RX_QUEUES;
	mac->max_tx_queues	= TXGBE_RAPTOR_MAX_TX_QUEUES;

	return 0;
}
/**
 *  txgbe_init_ops_pf - Inits func ptrs and MAC type
 *  @hw: pointer to hardware structure
 *
 *  Initialize the function pointers and assign the MAC type.
 *  Does not touch the hardware.
 **/
Inits func ptrs and MAC type
@hw: pointer to hardware structure

Initialize the function pointers and assign the MAC type.
Does not touch the hardware.
Inits func ptrs and MAC type @hw : pointer to hardware structure Initialize the function pointers and assign the MAC type . Does not touch the hardware .
s32 txgbe_init_ops_pf(struct txgbe_hw *hw)
{
	struct txgbe_bus_info *bus = &hw->bus;
	struct txgbe_mac_info *mac = &hw->mac;
	struct txgbe_phy_info *phy = &hw->phy;
	struct txgbe_rom_info *rom = &hw->rom;
	struct txgbe_mbx_info *mbx = &hw->mbx;
	DEBUGFUNC("txgbe_init_ops_pf");
	bus->set_lan_id = txgbe_set_lan_id_multi_port;
	phy->get_media_type = txgbe_get_media_type_raptor;
	phy->identify = txgbe_identify_phy;
	phy->init = txgbe_init_phy_raptor;
	phy->read_reg = txgbe_read_phy_reg;
	phy->write_reg = txgbe_write_phy_reg;
	phy->read_reg_mdi = txgbe_read_phy_reg_mdi;
	phy->write_reg_mdi = txgbe_write_phy_reg_mdi;
	phy->setup_link = txgbe_setup_phy_link;
	phy->setup_link_speed = txgbe_setup_phy_link_speed;
	phy->read_i2c_byte = txgbe_read_i2c_byte;
	phy->write_i2c_byte = txgbe_write_i2c_byte;
	phy->read_i2c_sff8472 = txgbe_read_i2c_sff8472;
	phy->read_i2c_eeprom = txgbe_read_i2c_eeprom;
	phy->write_i2c_eeprom = txgbe_write_i2c_eeprom;
	phy->identify_sfp = txgbe_identify_module;
	phy->read_i2c_byte_unlocked = txgbe_read_i2c_byte_unlocked;
	phy->write_i2c_byte_unlocked = txgbe_write_i2c_byte_unlocked;
	phy->reset = txgbe_reset_phy;
	mac->init_hw = txgbe_init_hw;
	mac->start_hw = txgbe_start_hw_raptor;
	mac->clear_hw_cntrs = txgbe_clear_hw_cntrs;
	mac->enable_rx_dma = txgbe_enable_rx_dma_raptor;
	mac->get_mac_addr = txgbe_get_mac_addr;
	mac->stop_hw = txgbe_stop_hw;
	mac->acquire_swfw_sync = txgbe_acquire_swfw_sync;
	mac->release_swfw_sync = txgbe_release_swfw_sync;
	mac->reset_hw = txgbe_reset_hw;
	mac->disable_sec_rx_path = txgbe_disable_sec_rx_path;
	mac->enable_sec_rx_path = txgbe_enable_sec_rx_path;
	mac->disable_sec_tx_path = txgbe_disable_sec_tx_path;
	mac->enable_sec_tx_path = txgbe_enable_sec_tx_path;
	mac->get_san_mac_addr = txgbe_get_san_mac_addr;
	mac->set_san_mac_addr = txgbe_set_san_mac_addr;
	mac->get_device_caps = txgbe_get_device_caps;
	mac->get_wwn_prefix = txgbe_get_wwn_prefix;
	mac->autoc_read = txgbe_autoc_read;
	mac->autoc_write = txgbe_autoc_write;
	mac->prot_autoc_read = txgbe_prot_autoc_read_raptor;
	mac->prot_autoc_write = txgbe_prot_autoc_write_raptor;
	mac->set_rar = txgbe_set_rar;
	mac->clear_rar = txgbe_clear_rar;
	mac->init_rx_addrs = txgbe_init_rx_addrs;
	mac->enable_rx = txgbe_enable_rx;
	mac->disable_rx = txgbe_disable_rx;
	mac->set_vmdq = txgbe_set_vmdq;
	mac->clear_vmdq = txgbe_clear_vmdq;
	mac->set_vfta = txgbe_set_vfta;
	mac->set_vlvf = txgbe_set_vlvf;
	mac->clear_vfta = txgbe_clear_vfta;
	mac->init_uta_tables = txgbe_init_uta_tables;
	mac->setup_sfp = txgbe_setup_sfp_modules;
	mac->set_mac_anti_spoofing = txgbe_set_mac_anti_spoofing;
	mac->set_ethertype_anti_spoofing = txgbe_set_ethertype_anti_spoofing;
	mac->fc_enable = txgbe_fc_enable;
	mac->setup_fc = txgbe_setup_fc;
	mac->fc_autoneg = txgbe_fc_autoneg;
	mac->get_link_capabilities = txgbe_get_link_capabilities_raptor;
	mac->check_link = txgbe_check_mac_link;
	mac->setup_pba = txgbe_set_pba;
	mac->set_fw_drv_ver = txgbe_hic_set_drv_ver;
	mac->get_thermal_sensor_data = txgbe_get_thermal_sensor_data;
	mac->init_thermal_sensor_thresh = txgbe_init_thermal_sensor_thresh;
	mbx->init_params = txgbe_init_mbx_params_pf;
	mbx->read = txgbe_read_mbx_pf;
	mbx->write = txgbe_write_mbx_pf;
	mbx->check_for_msg = txgbe_check_for_msg_pf;
	mbx->check_for_ack = txgbe_check_for_ack_pf;
	mbx->check_for_rst = txgbe_check_for_rst_pf;
	rom->init_params = txgbe_init_eeprom_params;
	rom->read16 = txgbe_ee_read16;
	rom->readw_buffer = txgbe_ee_readw_buffer;
	rom->readw_sw = txgbe_ee_readw_sw;
	rom->read32 = txgbe_ee_read32;
	rom->write16 = txgbe_ee_write16;
	rom->writew_buffer = txgbe_ee_writew_buffer;
	rom->writew_sw = txgbe_ee_writew_sw;
	rom->write32 = txgbe_ee_write32;
	rom->validate_checksum = txgbe_validate_eeprom_checksum;
	rom->update_checksum = txgbe_update_eeprom_checksum;
	rom->calc_checksum = txgbe_calc_eeprom_checksum;
	mac->mcft_size		= TXGBE_RAPTOR_MC_TBL_SIZE;
	mac->vft_size		= TXGBE_RAPTOR_VFT_TBL_SIZE;
	mac->num_rar_entries	= TXGBE_RAPTOR_RAR_ENTRIES;
	mac->rx_pb_size		= TXGBE_RAPTOR_RX_PB_SIZE;
	mac->max_rx_queues	= TXGBE_RAPTOR_MAX_RX_QUEUES;
	mac->max_tx_queues	= TXGBE_RAPTOR_MAX_TX_QUEUES;
	return 0;
}
s32 txgbe_init_ops_pf ( struct txgbe_hw * hw ) { struct txgbe_bus_info * bus = & hw -> bus ; struct txgbe_mac_info * mac = & hw -> mac ; struct txgbe_phy_info * phy = & hw -> phy ; struct txgbe_rom_info * rom = & hw -> rom ; struct txgbe_mbx_info * mbx = & hw -> mbx ; DEBUGFUNC ( " " ) ; bus -> set_lan_id = txgbe_set_lan_id_multi_port ; phy -> get_media_type = txgbe_get_media_type_raptor ; phy -> identify = txgbe_identify_phy ; phy -> init = txgbe_init_phy_raptor ; phy -> read_reg = txgbe_read_phy_reg ; phy -> write_reg = txgbe_write_phy_reg ; phy -> read_reg_mdi = txgbe_read_phy_reg_mdi ; phy -> write_reg_mdi = txgbe_write_phy_reg_mdi ; phy -> setup_link = txgbe_setup_phy_link ; phy -> setup_link_speed = txgbe_setup_phy_link_speed ; phy -> read_i2c_byte = txgbe_read_i2c_byte ; phy -> write_i2c_byte = txgbe_write_i2c_byte ; phy -> read_i2c_sff8472 = txgbe_read_i2c_sff8472 ; phy -> read_i2c_eeprom = txgbe_read_i2c_eeprom ; phy -> write_i2c_eeprom = txgbe_write_i2c_eeprom ; phy -> identify_sfp = txgbe_identify_module ; phy -> read_i2c_byte_unlocked = txgbe_read_i2c_byte_unlocked ; phy -> write_i2c_byte_unlocked = txgbe_write_i2c_byte_unlocked ; phy -> reset = txgbe_reset_phy ; mac -> init_hw = txgbe_init_hw ; mac -> start_hw = txgbe_start_hw_raptor ; mac -> clear_hw_cntrs = txgbe_clear_hw_cntrs ; mac -> enable_rx_dma = txgbe_enable_rx_dma_raptor ; mac -> get_mac_addr = txgbe_get_mac_addr ; mac -> stop_hw = txgbe_stop_hw ; mac -> acquire_swfw_sync = txgbe_acquire_swfw_sync ; mac -> release_swfw_sync = txgbe_release_swfw_sync ; mac -> reset_hw = txgbe_reset_hw ; mac -> disable_sec_rx_path = txgbe_disable_sec_rx_path ; mac -> enable_sec_rx_path = txgbe_enable_sec_rx_path ; mac -> disable_sec_tx_path = txgbe_disable_sec_tx_path ; mac -> enable_sec_tx_path = txgbe_enable_sec_tx_path ; mac -> get_san_mac_addr = txgbe_get_san_mac_addr ; mac -> set_san_mac_addr = txgbe_set_san_mac_addr ; mac -> get_device_caps = txgbe_get_device_caps ; mac -> get_wwn_prefix = txgbe_get_wwn_prefix ; mac -> autoc_read = txgbe_autoc_read ; mac -> autoc_write = txgbe_autoc_write ; mac -> prot_autoc_read = txgbe_prot_autoc_read_raptor ; mac -> prot_autoc_write = txgbe_prot_autoc_write_raptor ; mac -> set_rar = txgbe_set_rar ; mac -> clear_rar = txgbe_clear_rar ; mac -> init_rx_addrs = txgbe_init_rx_addrs ; mac -> enable_rx = txgbe_enable_rx ; mac -> disable_rx = txgbe_disable_rx ; mac -> set_vmdq = txgbe_set_vmdq ; mac -> clear_vmdq = txgbe_clear_vmdq ; mac -> set_vfta = txgbe_set_vfta ; mac -> set_vlvf = txgbe_set_vlvf ; mac -> clear_vfta = txgbe_clear_vfta ; mac -> init_uta_tables = txgbe_init_uta_tables ; mac -> setup_sfp = txgbe_setup_sfp_modules ; mac -> set_mac_anti_spoofing = txgbe_set_mac_anti_spoofing ; mac -> set_ethertype_anti_spoofing = txgbe_set_ethertype_anti_spoofing ; mac -> fc_enable = txgbe_fc_enable ; mac -> setup_fc = txgbe_setup_fc ; mac -> fc_autoneg = txgbe_fc_autoneg ; mac -> get_link_capabilities = txgbe_get_link_capabilities_raptor ; mac -> check_link = txgbe_check_mac_link ; mac -> setup_pba = txgbe_set_pba ; mac -> set_fw_drv_ver = txgbe_hic_set_drv_ver ; mac -> get_thermal_sensor_data = txgbe_get_thermal_sensor_data ; mac -> init_thermal_sensor_thresh = txgbe_init_thermal_sensor_thresh ; mbx -> init_params = txgbe_init_mbx_params_pf ; mbx -> read = txgbe_read_mbx_pf ; mbx -> write = txgbe_write_mbx_pf ; mbx -> check_for_msg = txgbe_check_for_msg_pf ; mbx -> check_for_ack = txgbe_check_for_ack_pf ; mbx -> check_for_rst = txgbe_check_for_rst_pf ; rom -> init_params = txgbe_init_eeprom_params ; rom -> read16 = txgbe_ee_read16 ; rom -> readw_buffer = txgbe_ee_readw_buffer ; rom -> readw_sw = txgbe_ee_readw_sw ; rom -> read32 = txgbe_ee_read32 ; rom -> write16 = txgbe_ee_write16 ; rom -> writew_buffer = txgbe_ee_writew_buffer ; rom -> writew_sw = txgbe_ee_writew_sw ; rom -> write32 = txgbe_ee_write32 ; rom -> validate_checksum = txgbe_validate_eeprom_checksum ; rom -> update_checksum = txgbe_update_eeprom_checksum ; rom -> calc_checksum = txgbe_calc_eeprom_checksum ; mac -> mcft_size = TXGBE_RAPTOR_MC_TBL_SIZE ; mac -> vft_size = TXGBE_RAPTOR_VFT_TBL_SIZE ; mac -> num_rar_entries = TXGBE_RAPTOR_RAR_ENTRIES ; mac -> rx_pb_size = TXGBE_RAPTOR_RX_PB_SIZE ; mac -> max_rx_queues = TXGBE_RAPTOR_MAX_RX_QUEUES ; mac -> max_tx_queues = TXGBE_RAPTOR_MAX_TX_QUEUES ; return 0 ; }
txgbe_init_ops_pf - Inits func ptrs and MAC type
  @hw: pointer to hardware structure
txgbe_init_ops_pf - Inits func ptrs and MAC type @hw : pointer to hardware structure
/* BUS */ /* PHY */ /* MAC */ /* RAR, Multicast, VLAN */ /* Flow Control */ /* Link */ /* Manageability interface */ /* EEPROM */