/* Checks if an adapter's tp sram is compatible with the driver. Returns 0 if the versions are compatible, a negative error otherwise.  */
int t3_check_tpsram(struct adapter *adapter, const u8 *tp_sram, unsigned int size)
/* Checks if an adapter's tp sram is compatible with the driver. Returns 0 if the versions are compatible, a negative error otherwise.  */
int t3_check_tpsram(struct adapter *adapter, const u8 *tp_sram, unsigned int size)
{
	u32 csum;
	unsigned int i;
	const __be32 *p = (const __be32 *)tp_sram;
	for (csum = 0, i = 0; i < size / sizeof(csum); i++)
		csum += ntohl(p[i]);
	if (csum != 0xffffffff) {
		CH_ERR(adapter, "corrupted protocol SRAM image, checksum %u\n",
		       csum);
		return -EINVAL;
	}
	return 0;
}