Lines Matching refs:ifp
676 static u8 flash_csum(struct ipath_flash *ifp, int adjust) in flash_csum() argument
678 u8 *ip = (u8 *) ifp; in flash_csum()
686 len = ifp->if_length; in flash_csum()
691 csum -= ifp->if_csum; in flash_csum()
694 ifp->if_csum = csum; in flash_csum()
709 struct ipath_flash *ifp; in ipath_get_eeprom_info() local
767 ifp = (struct ipath_flash *)buf; in ipath_get_eeprom_info()
769 csum = flash_csum(ifp, 0); in ipath_get_eeprom_info()
770 if (csum != ifp->if_csum) { in ipath_get_eeprom_info()
772 "0x%x, not 0x%x\n", csum, ifp->if_csum); in ipath_get_eeprom_info()
775 if (*(__be64 *) ifp->if_guid == cpu_to_be64(0) || in ipath_get_eeprom_info()
776 *(__be64 *) ifp->if_guid == ~cpu_to_be64(0)) { in ipath_get_eeprom_info()
779 *(unsigned long long *) ifp->if_guid); in ipath_get_eeprom_info()
785 if (*(u64 *) ifp->if_guid == 0x100007511000000ULL) in ipath_get_eeprom_info()
788 *(unsigned long long *) ifp->if_guid); in ipath_get_eeprom_info()
790 bguid = ifp->if_guid; in ipath_get_eeprom_info()
799 guid = *(__be64 *) ifp->if_guid; in ipath_get_eeprom_info()
803 guid = *(__be64 *) ifp->if_guid; in ipath_get_eeprom_info()
805 dd->ipath_nguid = ifp->if_numguid; in ipath_get_eeprom_info()
811 if ((ifp->if_fversion > 1) && ifp->if_sprefix[0] in ipath_get_eeprom_info()
812 && ((u8 *)ifp->if_sprefix)[0] != 0xFF) { in ipath_get_eeprom_info()
817 memcpy(snp, ifp->if_sprefix, sizeof ifp->if_sprefix); in ipath_get_eeprom_info()
818 snp[sizeof ifp->if_sprefix] = '\0'; in ipath_get_eeprom_info()
822 if (len > sizeof ifp->if_serial) { in ipath_get_eeprom_info()
823 len = sizeof ifp->if_serial; in ipath_get_eeprom_info()
825 memcpy(snp, ifp->if_serial, len); in ipath_get_eeprom_info()
827 memcpy(dd->ipath_serial, ifp->if_serial, in ipath_get_eeprom_info()
828 sizeof ifp->if_serial); in ipath_get_eeprom_info()
829 if (!strstr(ifp->if_comment, "Tested successfully")) in ipath_get_eeprom_info()
832 ifp->if_comment); in ipath_get_eeprom_info()
837 memcpy(&dd->ipath_eep_st_errs, &ifp->if_errcntp, IPATH_EEP_LOG_CNT); in ipath_get_eeprom_info()
844 dd->ipath_eep_hrs = ifp->if_powerhour[0] | (ifp->if_powerhour[1] << 8); in ipath_get_eeprom_info()
868 struct ipath_flash *ifp; in ipath_update_eeprom_log() local
917 ifp = (struct ipath_flash *)buf; in ipath_update_eeprom_log()
919 csum = flash_csum(ifp, 0); in ipath_update_eeprom_log()
920 if (csum != ifp->if_csum) { in ipath_update_eeprom_log()
923 csum, ifp->if_csum); in ipath_update_eeprom_log()
940 new_val += ifp->if_errcntp[idx]; in ipath_update_eeprom_log()
943 if (ifp->if_errcntp[idx] != new_val) { in ipath_update_eeprom_log()
944 ifp->if_errcntp[idx] = new_val; in ipath_update_eeprom_log()
970 if ((new_hrs & 0xFF) != ifp->if_powerhour[0]) { in ipath_update_eeprom_log()
971 ifp->if_powerhour[0] = new_hrs & 0xFF; in ipath_update_eeprom_log()
974 if ((new_hrs >> 8) != ifp->if_powerhour[1]) { in ipath_update_eeprom_log()
975 ifp->if_powerhour[1] = new_hrs >> 8; in ipath_update_eeprom_log()
988 csum = flash_csum(ifp, 1); in ipath_update_eeprom_log()