From patchwork Tue Jan 22 15:44:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 2018951 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 32B7ADF2EB for ; Tue, 22 Jan 2013 15:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816Ab3AVPo7 (ORCPT ); Tue, 22 Jan 2013 10:44:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64771 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753239Ab3AVPo7 (ORCPT ); Tue, 22 Jan 2013 10:44:59 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0MFitj2022948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Jan 2013 10:44:55 -0500 Received: from dhcp-8-167.nay.redhat.com ([10.66.4.143]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0MFihKW031659; Tue, 22 Jan 2013 10:44:53 -0500 From: Amos Kong To: mst@redhat.com, qemu-devel@nongnu.org, aliguori@us.ibm.com Cc: stefanha@gmail.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [QEMU PATCH v5 3/3] virtio-net: rename ctrl rx commands Date: Tue, 22 Jan 2013 23:44:46 +0800 Message-Id: <1358869486-22777-4-git-send-email-akong@redhat.com> In-Reply-To: <1358869486-22777-1-git-send-email-akong@redhat.com> References: <1358869486-22777-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 acef5a5..ac4434e 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; @@ -473,7 +473,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