/* for now, they are expected to be zero, but ignored.  */
static int drbd_send_handshake(struct drbd_conf *mdev)
/* for now, they are expected to be zero, but ignored.  */
static int drbd_send_handshake(struct drbd_conf *mdev)
{
	struct p_handshake *p = &mdev->data.sbuf.handshake;
	int ok;
	if (mutex_lock_interruptible(&mdev->data.mutex)) {
		dev_err(DEV, "interrupted during initial handshake\n");
		return 0;
	}
	if (mdev->data.socket == NULL) {
		mutex_unlock(&mdev->data.mutex);
		return 0;
	}
	memset(p, 0, sizeof(*p));
	p->protocol_min = cpu_to_be32(PRO_VERSION_MIN);
	p->protocol_max = cpu_to_be32(PRO_VERSION_MAX);
	ok = _drbd_send_cmd( mdev, mdev->data.socket, P_HAND_SHAKE,
			     (struct p_header *)p, sizeof(*p), 0 );
	mutex_unlock(&mdev->data.mutex);
	return ok;
}