src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_get_speed_and_duplex_copper_generic(struct igc_hw *hw, u16 *speed,
					      u16 *duplex)
{
	u32 status;

	DEBUGFUNC("igc_get_speed_and_duplex_copper_generic");

	status = IGC_READ_REG(hw, IGC_STATUS);
	if (status & IGC_STATUS_SPEED_1000) {
		/* For I225, STATUS will indicate 1G speed in both 1 Gbps
		 * and 2.5 Gbps link modes. An additional bit is used
		 * to differentiate between 1 Gbps and 2.5 Gbps.
		 */
		if (hw->mac.type == igc_i225 &&
		    (status & IGC_STATUS_SPEED_2500)) {
			*speed = SPEED_2500;
			DEBUGOUT("2500 Mbs, ");
		} else {
			*speed = SPEED_1000;
			DEBUGOUT("1000 Mbs, ");
		}
	} else if (status & IGC_STATUS_SPEED_100) {
		*speed = SPEED_100;
		DEBUGOUT("100 Mbs, ");
	} else {
		*speed = SPEED_10;
		DEBUGOUT("10 Mbs, ");
	}

	if (status & IGC_STATUS_FD) {
		*duplex = FULL_DUPLEX;
		DEBUGOUT("Full Duplex\n");
	} else {
		*duplex = HALF_DUPLEX;
		DEBUGOUT("Half Duplex\n");
	}

	return IGC_SUCCESS;
}
/**
 *  igc_get_speed_and_duplex_copper_generic - Retrieve current speed/duplex
 *  @hw: pointer to the HW structure
 *  @speed: stores the current speed
 *  @duplex: stores the current duplex
 *
 *  Read the status register for the current speed/duplex and store the current
 *  speed and duplex for copper connections.
 **/
Retrieve current speed/duplex
@hw: pointer to the HW structure
@speed: stores the current speed
@duplex: stores the current duplex

Read the status register for the current speed/duplex and store the current
speed and duplex for copper connections.
Retrieve current speed / duplex @hw : pointer to the HW structure @speed : stores the current speed @duplex : stores the current duplex Read the status register for the current speed / duplex and store the current speed and duplex for copper connections .
s32 igc_get_speed_and_duplex_copper_generic(struct igc_hw *hw, u16 *speed,
					      u16 *duplex)
{
	u32 status;
	DEBUGFUNC("igc_get_speed_and_duplex_copper_generic");
	status = IGC_READ_REG(hw, IGC_STATUS);
	if (status & IGC_STATUS_SPEED_1000) {
		if (hw->mac.type == igc_i225 &&
		    (status & IGC_STATUS_SPEED_2500)) {
			*speed = SPEED_2500;
			DEBUGOUT("2500 Mbs, ");
		} else {
			*speed = SPEED_1000;
			DEBUGOUT("1000 Mbs, ");
		}
	} else if (status & IGC_STATUS_SPEED_100) {
		*speed = SPEED_100;
		DEBUGOUT("100 Mbs, ");
	} else {
		*speed = SPEED_10;
		DEBUGOUT("10 Mbs, ");
	}
	if (status & IGC_STATUS_FD) {
		*duplex = FULL_DUPLEX;
		DEBUGOUT("Full Duplex\n");
	} else {
		*duplex = HALF_DUPLEX;
		DEBUGOUT("Half Duplex\n");
	}
	return IGC_SUCCESS;
}
s32 igc_get_speed_and_duplex_copper_generic ( struct igc_hw * hw , u16 * speed , u16 * duplex ) { u32 status ; DEBUGFUNC ( " " ) ; status = IGC_READ_REG ( hw , IGC_STATUS ) ; if ( status & IGC_STATUS_SPEED_1000 ) { if ( hw -> mac . type == igc_i225 && ( status & IGC_STATUS_SPEED_2500 ) ) { * speed = SPEED_2500 ; DEBUGOUT ( " " ) ; } else { * speed = SPEED_1000 ; DEBUGOUT ( " " ) ; } } else if ( status & IGC_STATUS_SPEED_100 ) { * speed = SPEED_100 ; DEBUGOUT ( " " ) ; } else { * speed = SPEED_10 ; DEBUGOUT ( " " ) ; } if ( status & IGC_STATUS_FD ) { * duplex = FULL_DUPLEX ; DEBUGOUT ( " \n " ) ; } else { * duplex = HALF_DUPLEX ; DEBUGOUT ( " \n " ) ; } return IGC_SUCCESS ; }
igc_get_speed_and_duplex_copper_generic - Retrieve current speed/duplex
  @hw: pointer to the HW structure
  @speed: stores the current speed
  @duplex: stores the current duplex
igc_get_speed_and_duplex_copper_generic - Retrieve current speed / duplex @hw : pointer to the HW structure @speed : stores the current speed @duplex : stores the current duplex
/* For I225, STATUS will indicate 1G speed in both 1 Gbps
		 * and 2.5 Gbps link modes. An additional bit is used
		 * to differentiate between 1 Gbps and 2.5 Gbps.
		 */