/* You must explicitly specifiy the @generation for which the node ID is valid, to avoid sending packets to the wrong nodes when we race with a bus reset.  */
int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, u64 addr, quadlet_t *buffer, size_t length)
/* You must explicitly specifiy the @generation for which the node ID is valid, to avoid sending packets to the wrong nodes when we race with a bus reset.  */
int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, u64 addr, quadlet_t *buffer, size_t length)
{
	struct hpsb_packet *packet;
	int retval;
	if (length == 0)
		return -EINVAL;
	packet = hpsb_make_writepacket(host, node, addr, buffer, length);
	if (!packet)
		return -ENOMEM;
	packet->generation = generation;
	retval = hpsb_send_packet_and_wait(packet);
	if (retval < 0)
		goto hpsb_write_fail;
	retval = hpsb_packet_success(packet);
      hpsb_write_fail:
	hpsb_free_tlabel(packet);
	hpsb_free_packet(packet);
	return retval;
}