From patchwork Sun May 15 13:49:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 9096391 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1EF49F1D3 for ; Sun, 15 May 2016 13:52:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D368202BE for ; Sun, 15 May 2016 13:52:40 +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 97912202A1 for ; Sun, 15 May 2016 13:52:39 +0000 (UTC) Received: from localhost ([::1]:40412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1wTG-0002x3-02 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 May 2016 09:52:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1wR9-0007e6-IN for qemu-devel@nongnu.org; Sun, 15 May 2016 09:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1wR8-0007Yx-Gh for qemu-devel@nongnu.org; Sun, 15 May 2016 09:50:27 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1wR8-0007Ys-53 for qemu-devel@nongnu.org; Sun, 15 May 2016 09:50:26 -0400 Received: by mail-wm0-x22b.google.com with SMTP id n129so72932655wmn.1 for ; Sun, 15 May 2016 06:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravellosystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8uDWiyq2DEZNLL+yKry28HRuca2GtBoqrYlNpSjymHM=; b=0l6hW4bEu5jT49AqAjXHlLvNbHSQdaJJfKS4xpouyekDb97exOQTapn4JmkXzMY/+D v6FA1O++oKUBLi8xY/jTxOf6XX7w2g0KWdD+8kcFBevR3+OOXB1rR1sgneKZ19V+9BUJ re5EU+zrzH41rbAVd/KUBBY0x6gCb/+uaS7eELnCprKIxxBw0/MUvhVmo8iBIE8O4cB0 JCq0OkyK1zNOB6/CbbvTCj//eiJr0A329417iKHqpU2WJa6cV9NNeK8bXrCURq1lWIu2 sXZnTxO9RDviT8xeVb/SXg96RvXIjCkUAUzZgKyfjF+R0uLooM9oC5lH6iDacd+FTVIn +nSQ== 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=8uDWiyq2DEZNLL+yKry28HRuca2GtBoqrYlNpSjymHM=; b=JBgC2ngKCXyv5iXzdYyD2O3maOuECp66/9/TjUuz4+YKiwcanDNPEMjHz3W+YhtW7o grpDcUWNAQSt96whTfCRNc6K0d0Mks2/k1r8uD/tmR5COMHcx4ChjU0AUim0W00707b9 uRT7Nzmg4t2RW9kKYNQmuqp8BrRUB5CQQ+k+7huQcm4yMghZcf8XOSJDC22pe+BINvJu r6QvMelIUF+1pRnmJiDB9cyvnD6xa6rt+HYs1qIFb84+jXrGaDkBE5jM72le4SqxEeJo YYoZxdNnRk336fbdcUYQiR3g1T2DMvwXpTiDJNR+rhSrrliSSNPQycAKex9gYaMO/18V 0m2Q== X-Gm-Message-State: AOPr4FUU99/t+n9/gvzWy5S5MK6kDg0++Ck++IG18aYaIwWd0yOuF31CmSs7Icyx27fNkQka X-Received: by 10.194.105.230 with SMTP id gp6mr24062211wjb.90.1463320225457; Sun, 15 May 2016 06:50:25 -0700 (PDT) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id c4sm28742403wjm.24.2016.05.15.06.50.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 May 2016 06:50:24 -0700 (PDT) From: Leonid Bloch To: qemu-devel@nongnu.org Date: Sun, 15 May 2016 16:49:43 +0300 Message-Id: <1463320189-14108-11-git-send-email-leonid.bloch@ravellosystems.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463320189-14108-1-git-send-email-leonid.bloch@ravellosystems.com> References: <1463320189-14108-1-git-send-email-leonid.bloch@ravellosystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b Subject: [Qemu-devel] [PATCH v5 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: Dmitry Fleytman , 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 */