From patchwork Sat Jan 19 01:54:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 2005911 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 30FEA3FD86 for ; Sat, 19 Jan 2013 01:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755662Ab3ASByg (ORCPT ); Fri, 18 Jan 2013 20:54:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40474 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646Ab3ASByc (ORCPT ); Fri, 18 Jan 2013 20:54:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0J1sTWT001228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Jan 2013 20:54:29 -0500 Received: from t430s.redhat.com (vpn1-114-38.nay.redhat.com [10.66.114.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0J1sGVI006902; Fri, 18 Jan 2013 20:54:26 -0500 From: akong@redhat.com To: mst@redhat.com Cc: qemu-devel@nongnu.org, stefanha@redhat.com, virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au, kvm@vger.kernel.org Subject: [QEMU PATCH v4 3/3] virtio-net: rename ctrl rx commands Date: Sat, 19 Jan 2013 09:54:28 +0800 Message-Id: <1358560468-10865-4-git-send-email-akong@redhat.com> In-Reply-To: <1358560468-10865-1-git-send-email-akong@redhat.com> References: <1358560468-10865-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Amos Kong This patch makes rx commands consistent with specification. Signed-off-by: Amos Kong --- hw/virtio-net.c | 14 +++++++------- hw/virtio-net.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index cf40ff2..5700e22 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -326,17 +326,17 @@ static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd, return VIRTIO_NET_ERR; } - if (cmd == VIRTIO_NET_CTRL_RX_MODE_PROMISC) { + if (cmd == VIRTIO_NET_CTRL_RX_PROMISC) { n->promisc = on; - } else if (cmd == VIRTIO_NET_CTRL_RX_MODE_ALLMULTI) { + } else if (cmd == VIRTIO_NET_CTRL_RX_ALLMULTI) { n->allmulti = on; - } else if (cmd == VIRTIO_NET_CTRL_RX_MODE_ALLUNI) { + } else if (cmd == VIRTIO_NET_CTRL_RX_ALLUNI) { n->alluni = on; - } else if (cmd == VIRTIO_NET_CTRL_RX_MODE_NOMULTI) { + } else if (cmd == VIRTIO_NET_CTRL_RX_NOMULTI) { n->nomulti = on; - } else if (cmd == VIRTIO_NET_CTRL_RX_MODE_NOUNI) { + } else if (cmd == VIRTIO_NET_CTRL_RX_NOUNI) { n->nouni = on; - } else if (cmd == VIRTIO_NET_CTRL_RX_MODE_NOBCAST) { + } else if (cmd == VIRTIO_NET_CTRL_RX_NOBCAST) { n->nobcast = on; } else { return VIRTIO_NET_ERR; @@ -474,7 +474,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) iov_discard_front(&iov, &iov_cnt, sizeof(ctrl)); if (s != sizeof(ctrl)) { status = VIRTIO_NET_ERR; - } else if (ctrl.class == VIRTIO_NET_CTRL_RX_MODE) { + } else if (ctrl.class == VIRTIO_NET_CTRL_RX) { status = virtio_net_handle_rx_mode(n, ctrl.cmd, iov, iov_cnt); } else if (ctrl.class == VIRTIO_NET_CTRL_MAC) { status = virtio_net_handle_mac(n, ctrl.cmd, iov, iov_cnt); diff --git a/hw/virtio-net.h b/hw/virtio-net.h index 1ec632f..c0bb284 100644 --- a/hw/virtio-net.h +++ b/hw/virtio-net.h @@ -99,13 +99,13 @@ typedef uint8_t virtio_net_ctrl_ack; * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature. * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA. */ -#define VIRTIO_NET_CTRL_RX_MODE 0 - #define VIRTIO_NET_CTRL_RX_MODE_PROMISC 0 - #define VIRTIO_NET_CTRL_RX_MODE_ALLMULTI 1 - #define VIRTIO_NET_CTRL_RX_MODE_ALLUNI 2 - #define VIRTIO_NET_CTRL_RX_MODE_NOMULTI 3 - #define VIRTIO_NET_CTRL_RX_MODE_NOUNI 4 - #define VIRTIO_NET_CTRL_RX_MODE_NOBCAST 5 +#define VIRTIO_NET_CTRL_RX 0 + #define VIRTIO_NET_CTRL_RX_PROMISC 0 + #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 + #define VIRTIO_NET_CTRL_RX_ALLUNI 2 + #define VIRTIO_NET_CTRL_RX_NOMULTI 3 + #define VIRTIO_NET_CTRL_RX_NOUNI 4 + #define VIRTIO_NET_CTRL_RX_NOBCAST 5 /* * Control the MAC