src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_get_bus_info_pci_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	struct igc_bus_info *bus = &hw->bus;
	u32 status = IGC_READ_REG(hw, IGC_STATUS);
	s32 ret_val = IGC_SUCCESS;

	DEBUGFUNC("igc_get_bus_info_pci_generic");

	/* PCI or PCI-X? */
	bus->type = (status & IGC_STATUS_PCIX_MODE)
			? igc_bus_type_pcix
			: igc_bus_type_pci;

	/* Bus speed */
	if (bus->type == igc_bus_type_pci) {
		bus->speed = (status & IGC_STATUS_PCI66)
			     ? igc_bus_speed_66
			     : igc_bus_speed_33;
	} else {
		switch (status & IGC_STATUS_PCIX_SPEED) {
		case IGC_STATUS_PCIX_SPEED_66:
			bus->speed = igc_bus_speed_66;
			break;
		case IGC_STATUS_PCIX_SPEED_100:
			bus->speed = igc_bus_speed_100;
			break;
		case IGC_STATUS_PCIX_SPEED_133:
			bus->speed = igc_bus_speed_133;
			break;
		default:
			bus->speed = igc_bus_speed_reserved;
			break;
		}
	}

	/* Bus width */
	bus->width = (status & IGC_STATUS_BUS64)
		     ? igc_bus_width_64
		     : igc_bus_width_32;

	/* Which PCI(-X) function? */
	mac->ops.set_lan_id(hw);

	return ret_val;
}
/**
 *  igc_get_bus_info_pci_generic - Get PCI(x) bus information
 *  @hw: pointer to the HW structure
 *
 *  Determines and stores the system bus information for a particular
 *  network interface.  The following bus information is determined and stored:
 *  bus speed, bus width, type (PCI/PCIx), and PCI(-x) function.
 **/
Get PCI(x) bus information
@hw: pointer to the HW structure

Determines and stores the system bus information for a particular
network interface.  The following bus information is determined and stored:
bus speed, bus width, type (PCI/PCIx), and PCI(-x) function.
Get PCI ( x ) bus information @hw : pointer to the HW structure Determines and stores the system bus information for a particular network interface . The following bus information is determined and stored : bus speed bus width type ( PCI / PCIx ) and PCI ( - x ) function .
s32 igc_get_bus_info_pci_generic(struct igc_hw *hw)
{
	struct igc_mac_info *mac = &hw->mac;
	struct igc_bus_info *bus = &hw->bus;
	u32 status = IGC_READ_REG(hw, IGC_STATUS);
	s32 ret_val = IGC_SUCCESS;
	DEBUGFUNC("igc_get_bus_info_pci_generic");
	bus->type = (status & IGC_STATUS_PCIX_MODE)
			? igc_bus_type_pcix
			: igc_bus_type_pci;
	if (bus->type == igc_bus_type_pci) {
		bus->speed = (status & IGC_STATUS_PCI66)
			     ? igc_bus_speed_66
			     : igc_bus_speed_33;
	} else {
		switch (status & IGC_STATUS_PCIX_SPEED) {
		case IGC_STATUS_PCIX_SPEED_66:
			bus->speed = igc_bus_speed_66;
			break;
		case IGC_STATUS_PCIX_SPEED_100:
			bus->speed = igc_bus_speed_100;
			break;
		case IGC_STATUS_PCIX_SPEED_133:
			bus->speed = igc_bus_speed_133;
			break;
		default:
			bus->speed = igc_bus_speed_reserved;
			break;
		}
	}
	bus->width = (status & IGC_STATUS_BUS64)
		     ? igc_bus_width_64
		     : igc_bus_width_32;
	mac->ops.set_lan_id(hw);
	return ret_val;
}
s32 igc_get_bus_info_pci_generic ( struct igc_hw * hw ) { struct igc_mac_info * mac = & hw -> mac ; struct igc_bus_info * bus = & hw -> bus ; u32 status = IGC_READ_REG ( hw , IGC_STATUS ) ; s32 ret_val = IGC_SUCCESS ; DEBUGFUNC ( " " ) ; bus -> type = ( status & IGC_STATUS_PCIX_MODE ) ? igc_bus_type_pcix : igc_bus_type_pci ; if ( bus -> type == igc_bus_type_pci ) { bus -> speed = ( status & IGC_STATUS_PCI66 ) ? igc_bus_speed_66 : igc_bus_speed_33 ; } else { switch ( status & IGC_STATUS_PCIX_SPEED ) { case IGC_STATUS_PCIX_SPEED_66 : bus -> speed = igc_bus_speed_66 ; break ; case IGC_STATUS_PCIX_SPEED_100 : bus -> speed = igc_bus_speed_100 ; break ; case IGC_STATUS_PCIX_SPEED_133 : bus -> speed = igc_bus_speed_133 ; break ; default : bus -> speed = igc_bus_speed_reserved ; break ; } } bus -> width = ( status & IGC_STATUS_BUS64 ) ? igc_bus_width_64 : igc_bus_width_32 ; mac -> ops . set_lan_id ( hw ) ; return ret_val ; }
igc_get_bus_info_pci_generic - Get PCI(x) bus information
  @hw: pointer to the HW structure
igc_get_bus_info_pci_generic - Get PCI ( x ) bus information @hw : pointer to the HW structure
/* PCI or PCI-X? */ /* Bus speed */ /* Bus width */ /* Which PCI(-X) function? */