[PATCH] ixgb: Fix EEPROM functions to be endian-aware

Fix EEPROM functions to be endian-aware

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>

diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_ee.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_ee.c

authored by Malli Chilakala and committed by Jeff Garzik abf481d6 41639fed

+12 -12
+12 -12
drivers/net/ixgb/ixgb_ee.c
··· 411 ixgb_cleanup_eeprom(hw); 412 413 /* clear the init_ctrl_reg_1 to signify that the cache is invalidated */ 414 - ee_map->init_ctrl_reg_1 = EEPROM_ICW1_SIGNATURE_CLEAR; 415 416 return; 417 } ··· 483 DEBUGOUT("ixgb_ee: Checksum invalid.\n"); 484 /* clear the init_ctrl_reg_1 to signify that the cache is 485 * invalidated */ 486 - ee_map->init_ctrl_reg_1 = EEPROM_ICW1_SIGNATURE_CLEAR; 487 return (FALSE); 488 } 489 ··· 579 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 580 581 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 582 - return(ee_map->compatibility); 583 584 return(0); 585 } ··· 616 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 617 618 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 619 - return(ee_map->init_ctrl_reg_1); 620 621 return(0); 622 } ··· 635 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 636 637 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 638 - return(ee_map->init_ctrl_reg_2); 639 640 return(0); 641 } ··· 654 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 655 656 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 657 - return(ee_map->subsystem_id); 658 659 return(0); 660 } ··· 673 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 674 675 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 676 - return(ee_map->subvendor_id); 677 678 return(0); 679 } ··· 692 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 693 694 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 695 - return(ee_map->device_id); 696 697 return(0); 698 } ··· 711 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 712 713 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 714 - return(ee_map->vendor_id); 715 716 return(0); 717 } ··· 730 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 731 732 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 733 - return(ee_map->swdpins_reg); 734 735 return(0); 736 } ··· 749 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 750 751 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 752 - return(ee_map->d3_power); 753 754 return(0); 755 } ··· 768 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 769 770 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 771 - return(ee_map->d0_power); 772 773 return(0); 774 }
··· 411 ixgb_cleanup_eeprom(hw); 412 413 /* clear the init_ctrl_reg_1 to signify that the cache is invalidated */ 414 + ee_map->init_ctrl_reg_1 = le16_to_cpu(EEPROM_ICW1_SIGNATURE_CLEAR); 415 416 return; 417 } ··· 483 DEBUGOUT("ixgb_ee: Checksum invalid.\n"); 484 /* clear the init_ctrl_reg_1 to signify that the cache is 485 * invalidated */ 486 + ee_map->init_ctrl_reg_1 = le16_to_cpu(EEPROM_ICW1_SIGNATURE_CLEAR); 487 return (FALSE); 488 } 489 ··· 579 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 580 581 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 582 + return (le16_to_cpu(ee_map->compatibility)); 583 584 return(0); 585 } ··· 616 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 617 618 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 619 + return (le16_to_cpu(ee_map->init_ctrl_reg_1)); 620 621 return(0); 622 } ··· 635 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 636 637 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 638 + return (le16_to_cpu(ee_map->init_ctrl_reg_2)); 639 640 return(0); 641 } ··· 654 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 655 656 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 657 + return (le16_to_cpu(ee_map->subsystem_id)); 658 659 return(0); 660 } ··· 673 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 674 675 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 676 + return (le16_to_cpu(ee_map->subvendor_id)); 677 678 return(0); 679 } ··· 692 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 693 694 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 695 + return (le16_to_cpu(ee_map->device_id)); 696 697 return(0); 698 } ··· 711 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 712 713 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 714 + return (le16_to_cpu(ee_map->vendor_id)); 715 716 return(0); 717 } ··· 730 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 731 732 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 733 + return (le16_to_cpu(ee_map->swdpins_reg)); 734 735 return(0); 736 } ··· 749 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 750 751 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 752 + return (le16_to_cpu(ee_map->d3_power)); 753 754 return(0); 755 } ··· 768 struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; 769 770 if(ixgb_check_and_get_eeprom_data(hw) == TRUE) 771 + return (le16_to_cpu(ee_map->d0_power)); 772 773 return(0); 774 }