Beispiel #1
0
/******************************************************************************
 * return the Printed Board Assembly number from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          PBA number if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
u32
ixgb_get_ee_pba_number(struct ixgb_hw *hw)
{
	if (ixgb_check_and_get_eeprom_data(hw))
		return le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG])
			| (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16);

	return 0;
}
Beispiel #2
0
/******************************************************************************
 * return a word from the eeprom
 *
 * hw - Struct containing variables accessed by shared code
 * index - Offset of eeprom word
 *
 * Returns:
 *          Word at indexed offset in eeprom, if valid, 0 otherwise.
 ******************************************************************************/
__le16
ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index)
{

	if (index < IXGB_EEPROM_SIZE && ixgb_check_and_get_eeprom_data(hw))
		return hw->eeprom[index];

	return 0;
}
Beispiel #3
0
/******************************************************************************
 * return the Printed Board Assembly number from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          PBA number if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint32_t
ixgb_get_ee_pba_number(struct ixgb_hw *hw)
{
	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
		return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG])
			| (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG]) << 16));

	return (0);
}
Beispiel #4
0
/******************************************************************************
 * return the Device Id from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          Device Id if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
u16
ixgb_get_ee_device_id(struct ixgb_hw *hw)
{
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	if (ixgb_check_and_get_eeprom_data(hw))
		return le16_to_cpu(ee_map->device_id);

	return 0;
}
Beispiel #5
0
/******************************************************************************
 * return the Device Id from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          Device Id if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint16_t
ixgb_get_ee_device_id(struct ixgb_hw *hw)
{
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
		return (le16_to_cpu(ee_map->device_id));

	return (0);
}
/******************************************************************************
 * return the D0 Power Management Bits from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          D0 Power Management Bits if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint8_t
ixgb_get_ee_d0_power(struct ixgb_hw *hw)
{
    struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *) hw->eeprom;

    if (ixgb_check_and_get_eeprom_data (hw) == TRUE)
       return(ee_map->d0_power);

    return(0);
}
/******************************************************************************
 * return the Software Defined Pins Register from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          SDP Register if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint16_t
ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw)
{
    struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *) hw->eeprom;

    if (ixgb_check_and_get_eeprom_data (hw) == TRUE)
       return(ee_map->swdpins_reg);

    return(0);
}
/******************************************************************************
 * return the Vendor Id from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          Device Id if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint16_t
ixgb_get_ee_vendor_id(struct ixgb_hw *hw)
{
    struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *) hw->eeprom;

    if (ixgb_check_and_get_eeprom_data (hw) == TRUE)
       return(ee_map->vendor_id);

    return(0);
}
/******************************************************************************
 * return the Initialization Control Word 2 from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint16_t
ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw)
{
    struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *) hw->eeprom;

    if (ixgb_check_and_get_eeprom_data (hw) == TRUE)
       return(ee_map->init_ctrl_reg_2);

    return(0);
}
/******************************************************************************
 * return the compatibility flags from EEPROM
 *
 * hw - Struct containing variables accessed by shared code
 *
 * Returns:
 *          compatibility flags if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
uint16_t
ixgb_get_ee_compatibility(struct ixgb_hw *hw)
{
    struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *) hw->eeprom;

    if (ixgb_check_and_get_eeprom_data (hw) == TRUE)
       return(ee_map->compatibility);

    return(0);
}
Beispiel #11
0
/******************************************************************************
 * return a word from the eeprom
 *
 * hw - Struct containing variables accessed by shared code
 * index - Offset of eeprom word
 *
 * Returns:
 *          Word at indexed offset in eeprom, if valid, 0 otherwise.
 ******************************************************************************/
__le16
ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index)
{

	if ((index < IXGB_EEPROM_SIZE) &&
		(ixgb_check_and_get_eeprom_data(hw) == true)) {
	   return hw->eeprom[index];
	}

	return 0;
}
Beispiel #12
0
/******************************************************************************
 * return a word from the eeprom
 *
 * hw - Struct containing variables accessed by shared code
 * index - Offset of eeprom word
 *
 * Returns:
 *          Word at indexed offset in eeprom, if valid, 0 otherwise.
 ******************************************************************************/
uint16_t
ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index)
{

	if((index < IXGB_EEPROM_SIZE) &&
	   (ixgb_check_and_get_eeprom_data(hw) == TRUE)) {
		return (hw->eeprom[index]);
	}

	return (0);
}
Beispiel #13
0
/******************************************************************************
 * return the Subsystem Id from EEPROM
 *
 * hw - Struct containing variables accessed by shared code 
 *
 * Returns: 
 *          Subsystem Id if EEPROM contents are valid, 0 otherwise
 ******************************************************************************/
u16
ixgb_get_ee_subsystem_id(struct ixgb_hw * hw)
{
	struct ixgb_ee_map_type *ee_map =
	    (struct ixgb_ee_map_type *) hw->eeprom;

	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
		return (ee_map->subsystem_id);

	return (0);
}
Beispiel #14
0
/******************************************************************************
 * return the mac address from EEPROM
 *
 * hw       - Struct containing variables accessed by shared code
 * mac_addr - Ethernet Address if EEPROM contents are valid, 0 otherwise
 *
 * Returns: None.
 ******************************************************************************/
void
ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr)
{
	int i;
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	DEBUGFUNC("ixgb_get_ee_mac_addr");

	if(ixgb_check_and_get_eeprom_data(hw) == TRUE) {
		for(i = 0; i < IXGB_ETH_LENGTH_OF_ADDRESS; i++) {
			mac_addr[i] = ee_map->mac_addr[i];
			DEBUGOUT2("mac(%d) = %.2X\n", i, mac_addr[i]);
		}
	}
}
Beispiel #15
0
/******************************************************************************
 * return the mac address from EEPROM
 *
 * hw       - Struct containing variables accessed by shared code
 * mac_addr - Ethernet Address if EEPROM contents are valid, 0 otherwise
 *
 * Returns: None.
 ******************************************************************************/
void
ixgb_get_ee_mac_addr(struct ixgb_hw *hw,
			u8 *mac_addr)
{
	int i;
	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;

	ENTER();

	if (ixgb_check_and_get_eeprom_data(hw)) {
		for (i = 0; i < ETH_ALEN; i++) {
			mac_addr[i] = ee_map->mac_addr[i];
		}
		pr_debug("eeprom mac address = %pM\n", mac_addr);
	}
}