linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Paulus <dominik.paulus@fau.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	Ilija Hadzic <ihadzic@research.bell-labs.com>,
	Anthony Foiani <anthony.foiani@gmail.com>,
	Masanari Iida <standby24x7@gmail.com>,
	linux-kernel@i4.cs.fau.de, devel@driverdev.osuosl.org,
	tobias.polzer@fau.de, Dominik Paulus <dominik.paulus@fau.de>
Subject: [PATCHv3  09/16] staging: usbip: Separate protocol/program version
Date: Sat, 28 Sep 2013 19:42:46 +0200	[thread overview]
Message-ID: <1380390173-3746-9-git-send-email-dominik.paulus@fau.de> (raw)
In-Reply-To: <1380390173-3746-1-git-send-email-dominik.paulus@fau.de>

Not all new program versions necessarily introduce
non-backwards-compatible protocol changes. We thus move the definition
of the protocol version from configure.ac to usbip_network.h, where it
logically belongs to.

Signed-off-by: Dominik Paulus <dominik.paulus@fau.de>
Signed-off-by: Tobias Polzer <tobias.polzer@fau.de>
---
 drivers/staging/usbip/userspace/configure.ac        | 1 -
 drivers/staging/usbip/userspace/src/usbip_network.c | 6 +++---
 drivers/staging/usbip/userspace/src/usbip_network.h | 6 ++++++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/usbip/userspace/configure.ac b/drivers/staging/usbip/userspace/configure.ac
index 2208516..bc08b81 100644
--- a/drivers/staging/usbip/userspace/configure.ac
+++ b/drivers/staging/usbip/userspace/configure.ac
@@ -2,7 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
 AC_INIT([usbip-utils], [1.1.1], [linux-usb@vger.kernel.org])
-AC_DEFINE([USBIP_VERSION], [0x00000111], [binary-coded decimal version number])
 
 CURRENT=0
 REVISION=1
diff --git a/drivers/staging/usbip/userspace/src/usbip_network.c b/drivers/staging/usbip/userspace/src/usbip_network.c
index e573cb2..a606e2b 100644
--- a/drivers/staging/usbip/userspace/src/usbip_network.c
+++ b/drivers/staging/usbip/userspace/src/usbip_network.c
@@ -156,7 +156,7 @@ int usbip_net_send_op_common(int sockfd, uint32_t code, uint32_t status)
 
 	memset(&op_common, 0, sizeof(op_common));
 
-	op_common.version = USBIP_VERSION;
+	op_common.version = PROTOCOL_VERSION;
 	op_common.code    = code;
 	op_common.status  = status;
 
@@ -186,9 +186,9 @@ int usbip_net_recv_op_common(int sockfd, uint16_t *code)
 
 	PACK_OP_COMMON(0, &op_common);
 
-	if (op_common.version != USBIP_VERSION) {
+	if (op_common.version != PROTOCOL_VERSION) {
 		dbg("version mismatch: %d %d", op_common.version,
-		    USBIP_VERSION);
+		    PROTOCOL_VERSION);
 		return -ERR_MISMATCH;
 	}
 
diff --git a/drivers/staging/usbip/userspace/src/usbip_network.h b/drivers/staging/usbip/userspace/src/usbip_network.h
index d3c1b71..6a41fd8 100644
--- a/drivers/staging/usbip/userspace/src/usbip_network.h
+++ b/drivers/staging/usbip/userspace/src/usbip_network.h
@@ -14,6 +14,12 @@
 
 #include <stdint.h>
 
+/*
+ * Protocol version. Incremented only on non-backwards-compatible
+ * changes.
+ */
+#define PROTOCOL_VERSION 0x111
+
 extern int usbip_port;
 extern char *usbip_port_string;
 extern char *usbip_srp_password;
-- 
1.8.4


  parent reply	other threads:[~2013-09-28 17:46 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13  9:55 [PATCHv2 0/11] staging: usbip: Userland crypto and ACLs Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 01/11] staging: usbip: Fix IPv6 support in usbipd Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 02/11] staging: usbip: Add support for client authentication Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 03/11] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 04/11] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 05/11] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 06/11] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 07/11] staging: usbip: Add proper error reporting Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 08/11] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 09/11] staging: usbip: Improve debug output Dominik Paulus
2013-09-13  9:56 ` [PATCHv2 10/11] staging: usbip: Separate protocol/program version Dominik Paulus
2013-09-13  9:56 ` [PATCHv2 11/11] staging: usbip: Increment version to 1.2.0 Dominik Paulus
2013-09-25 23:36 ` [PATCHv2 0/11] staging: usbip: Userland crypto and ACLs Greg Kroah-Hartman
2013-09-28 17:41   ` Dominik Paulus
2013-09-28 17:42   ` [PATCHv3 01/16] staging: usbip: Add support for client authentication Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 02/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-09-30  8:29       ` Dan Carpenter
2013-09-28 17:42     ` [PATCHv3 03/16] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 04/16] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 05/16] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 06/16] staging: usbip: Add proper error reporting Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 07/16] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 08/16] staging: usbip: Improve debug output Dominik Paulus
2013-09-28 17:42     ` Dominik Paulus [this message]
2013-09-28 17:42     ` [PATCHv3 10/16] staging: usbip: TLS for all userspace communication Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 11/16] staging: usbip: Exchange session keys in userspace Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 12/16] staging: usbip: Pass session keys to the kernel Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg() Dominik Paulus
2013-09-30 12:42       ` Dan Carpenter
2013-09-28 17:42     ` [PATCHv3 14/16] staging: usbip: Add encryption support to kernel Dominik Paulus
2013-09-30 12:38       ` Dan Carpenter
2013-10-19 14:39         ` [PATCHv4 00/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 01/16] staging: usbip: Add support for client authentication Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 02/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 03/16] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 04/16] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 05/16] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 06/16] staging: usbip: Add proper error reporting Dominik Paulus
2013-10-25 13:26             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 07/16] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 08/16] staging: usbip: Improve debug output Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 09/16] staging: usbip: Separate protocol/program version Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 10/16] staging: usbip: TLS for all userspace communication Dominik Paulus
2013-10-25 14:45             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 11/16] staging: usbip: Exchange session keys in userspace Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel Dominik Paulus
2013-10-25 15:02             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg() Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 14/16] staging: usbip: Add encryption support to kernel Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 15/16] staging: usbip: Update documentation Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 16/16] staging: usbip: Increment version number to 1.2.1 Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 15/16] staging: usbip: Update documentation Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 16/16] staging: usbip: Increment version number to 1.2.1 Dominik Paulus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380390173-3746-9-git-send-email-dominik.paulus@fau.de \
    --to=dominik.paulus@fau.de \
    --cc=anthony.foiani@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ihadzic@research.bell-labs.com \
    --cc=linux-kernel@i4.cs.fau.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=standby24x7@gmail.com \
    --cc=tobias.polzer@fau.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).