/* We do it from here because some times we cannot do it in the original context the command was sent (it is a const), so when we copy it to our staging buffer, we add the checksum there.  */
void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd)
/* We do it from here because some times we cannot do it in the original context the command was sent (it is a const), so when we copy it to our staging buffer, we add the checksum there.  */
void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd)
{
	if (i2400m_brh_get_use_checksum(cmd)) {
		int i;
		u32 checksum = 0;
		const u32 *checksum_ptr = (void *) cmd->payload;
		for (i = 0; i < cmd->data_size / 4; i++)
			checksum += cpu_to_le32(*checksum_ptr++);
		checksum += cmd->command + cmd->target_addr + cmd->data_size;
		cmd->block_checksum = cpu_to_le32(checksum);
	}
}