From patchwork Sun Apr 10 15:14:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Fleytman X-Patchwork-Id: 8789521 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 140B8C0554 for ; Sun, 10 Apr 2016 15:22:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BCF820225 for ; Sun, 10 Apr 2016 15:22:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8AA2420222 for ; Sun, 10 Apr 2016 15:22:37 +0000 (UTC) Received: from localhost ([::1]:35288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apHC8-0004ES-Up for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Apr 2016 11:22:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apH5R-0007jN-R8 for qemu-devel@nongnu.org; Sun, 10 Apr 2016 11:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apH5R-0008AV-0E for qemu-devel@nongnu.org; Sun, 10 Apr 2016 11:15:41 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:36699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apH5Q-0008A5-IV for qemu-devel@nongnu.org; Sun, 10 Apr 2016 11:15:40 -0400 Received: by mail-wm0-x235.google.com with SMTP id v188so60453681wme.1 for ; Sun, 10 Apr 2016 08:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fv0zfrRCEYMaexse7w1ufHyMHoQIyDPyMc2duUdQL8o=; b=yW+YBThsepSV3yOQslAPCwUml8hS/Wt5hqObflM1IPuBAQVcUzNN8t9ainOb1QozaD cXTVUvZQzCTrm61yrVq8K1lP7SV2maXusQnJB60G40LQ2nuJTuiitKsw0d448I7d4g5f ouXb3h36GQB61cugUTPe1qvGDxs6YQiwNCeJ4wd+8up4oGkEe8E2yfXyIr7lBPXUIGo5 XzC/3BPwGqGtdd0esIn1wARbgOFinKiAW7rxQDbZkBbVmPmsjywYIPLni5ygeGarsAxf b0hMmnwvkdOmGIbmBBkIVqMeOxYrWVT/DH0hSiNSUyThqPVdmD4IYD4whyAUM4f8Hn8M 1JfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fv0zfrRCEYMaexse7w1ufHyMHoQIyDPyMc2duUdQL8o=; b=CM2HmMKTpwLTf2TV9cHNHAfbEmAPBhPPSK7Ih/p6aYQs1WOokN/ZSqA+Hp8LquqdwK 3L6ndodIbZDWmWBQvB8q2bdMTODfE8rDDU09qKLNKOpma8fbXSK3HNieI2dL19y6rQRi 6W89F5snRMsa6U78667kX+uf4SeUK28WbzHQt8GeNjjlHArUdAKXH02jlxaHY6ip9vzV Kxr88KPkMwmFejvAUElSQgHKWBi1F9v3R4sx+oifjz2b7CqWXsp9s+IiA8EU79ul54A0 rOkkYjNZqcCTEYpHItQj6CxLxIBRaVs+9Q4cCpoTa+COHn8SIQbrcc1PN2pKpchvE9AL D3jw== X-Gm-Message-State: AD7BkJLZh0IvIfgRkXjU9pU2nIngttf4WBW6Is10OULhgXsbaE5B7+33Hr3BhNbIPLxXaA== X-Received: by 10.28.134.67 with SMTP id i64mr13334274wmd.83.1460301340012; Sun, 10 Apr 2016 08:15:40 -0700 (PDT) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id j71sm12685874wmj.21.2016.04.10.08.15.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Apr 2016 08:15:39 -0700 (PDT) From: Dmitry Fleytman To: qemu-devel@nongnu.org Date: Sun, 10 Apr 2016 18:14:59 +0300 Message-Id: <1460301305-5321-11-git-send-email-dmitry@daynix.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460301305-5321-1-git-send-email-dmitry@daynix.com> References: <1460301305-5321-1-git-send-email-dmitry@daynix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PATCH v4 10/16] rtl8139: Move more TCP definitions to common header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Jason Wang , Leonid Bloch , Shmulik Ladkani , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Fleytman Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch --- hw/net/rtl8139.c | 5 ----- include/net/eth.h | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 1e5ec14..562c1fd 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1867,11 +1867,6 @@ static int rtl8139_transmit_one(RTL8139State *s, int descriptor) return 1; } -/* structures and macros for task offloading */ -#define TCP_HEADER_DATA_OFFSET(tcp) (((be16_to_cpu(tcp->th_offset_flags) >> 12)&0xf) << 2) -#define TCP_FLAGS_ONLY(flags) ((flags)&0x3f) -#define TCP_HEADER_FLAGS(tcp) TCP_FLAGS_ONLY(be16_to_cpu(tcp->th_offset_flags)) - #define TCP_HEADER_CLEAR_FLAGS(tcp, off) ((tcp)->th_offset_flags &= cpu_to_be16(~TCP_FLAGS_ONLY(off))) /* produces ones' complement sum of data */ diff --git a/include/net/eth.h b/include/net/eth.h index 18d0be3..5a32259 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -67,6 +67,14 @@ typedef struct tcp_header { uint16_t th_urp; /* urgent pointer */ } tcp_header; +#define TCP_FLAGS_ONLY(flags) ((flags) & 0x3f) + +#define TCP_HEADER_FLAGS(tcp) \ + TCP_FLAGS_ONLY(be16_to_cpu((tcp)->th_offset_flags)) + +#define TCP_HEADER_DATA_OFFSET(tcp) \ + (((be16_to_cpu((tcp)->th_offset_flags) >> 12) & 0xf) << 2) + typedef struct udp_header { uint16_t uh_sport; /* source port */ uint16_t uh_dport; /* destination port */