From patchwork Tue Jul 31 09:44:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 951491 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pLGrAsS3"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41frxY4nTsz9s1x for ; Tue, 31 Jul 2018 19:39:29 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 36B7CC21C27; Tue, 31 Jul 2018 09:39:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D49B2C2209F; Tue, 31 Jul 2018 09:39:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 207BDC220D5; Tue, 31 Jul 2018 09:39:15 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by lists.denx.de (Postfix) with ESMTPS id 7AA5CC220BF for ; Tue, 31 Jul 2018 09:39:15 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id e13-v6so5851525pff.7 for ; Tue, 31 Jul 2018 02:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=46hi0bU06y4I9G8dL5B/n6ca+aFwq9NbgcOZlbhuB7Q=; b=pLGrAsS3xcxr5fKol+OgEXHtcDA05p13ze98H9YBNzOBe4cZFhH7qf5+/H6kLNONfP XWfYPkgxeVL60LDJv9CdA5Hd0/tuL9dhNnDtxyCYvOV4c8RraUirE0s+B2RfjYIHdE7a F5OjOB2AtTwxjgDsC12EPDlq1n/EMA+0S365QsRsUwBhk6Ik6yIVol4QCMolTGCvkaMh 8VoxtQANYZJfuGlBIqBhkNE3bqWamf/X2KpWnc34p6Hezs4GF/0ilW0nXW1HdAkjmGxR JKYLpsExCBMAEboyFcYj1Efj6EZWKPoKl4cWz3Pu3IhSFNZB9EhyvohFgw0lf7QONndJ iVMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=46hi0bU06y4I9G8dL5B/n6ca+aFwq9NbgcOZlbhuB7Q=; b=evOT+nzxQ534rFmMaWuWZ+Lb46AcroTsWLcsIAF0SrjZKm7NKZN9sZpFYJ4P9XqxeL baFdU3HBGFtErWc85xHq7hRkgL2dHJphTTLO7vz5rHEo/iOwQeF3CDmH7Hglgtm0vXOW 4RqdZxGrcLVgmBcSMqNXUAo/ST6+/w9KpXRGRBZ67ptGszodg3ndMBsCrsTEYBUxVMnC larzo7qHRhGvLmJ5bsF0Zm+yxJbSt1YV1roV6c8Y/az1A6byDoJEfhXqAi0s9ADdM02/ NBSjMtDUZxCdTqNi+l2X9Q6hCl3vYC8ugfO05AhZOv23qqpgS/StuD8XrmcMS6traxaf CYJA== X-Gm-Message-State: AOUpUlHybGFwW+9rHCSbcEA1eG1XfCl2UokHVEd/Toi/tC/fECjndlaA 8i37lqU20SIZjMY/lhRSO/M= X-Google-Smtp-Source: AAOMgpdBvE1F8qzCgiYZjc169i4ec3r0dBS8Ij0/oMQ7oVcimDEuUU8cugee2/Ob03g/W2K3TBxtVA== X-Received: by 2002:a63:f002:: with SMTP id k2-v6mr19402407pgh.8.1533029954236; Tue, 31 Jul 2018 02:39:14 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id 21-v6sm20002745pgx.20.2018.07.31.02.39.12 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 02:39:13 -0700 (PDT) From: Bin Meng To: Joe Hershberger , U-Boot Mailing List Date: Tue, 31 Jul 2018 02:44:05 -0700 Message-Id: <1533030245-12363-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1533030245-12363-1-git-send-email-bmeng.cn@gmail.com> References: <1533030245-12363-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 3/3] linux/if_ether.h: Add VLAN related macros X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There are VLAN related macros defined in include/linux/if_vlan.h in Linux kernel, as well as some kernel useful structures and inline functions. Instead of a complete import from kernel, let's add these VLAN macros to U-Boot's include/linux/if_ether.h. Signed-off-by: Bin Meng --- include/linux/if_ether.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 181a54e..4b01c37 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -155,5 +155,24 @@ #define ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and */ /* aggregation protocol */ +/* The following macros come from Linux kernel include/linux/if_vlan.h */ + +#define VLAN_HLEN 4 /* The additional bytes required by VLAN */ + /* (in addition to the Ethernet header) */ +#define VLAN_ETH_HLEN 18 /* Total octets in header. */ +#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */ + +/* + * According to 802.3ac, the packet can be 4 bytes longer. --Klika Jan + */ +#define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */ +#define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */ + +#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */ +#define VLAN_PRIO_SHIFT 13 +#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ +#define VLAN_TAG_PRESENT VLAN_CFI_MASK +#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ +#define VLAN_N_VID 4096 #endif /* _UAPI_LINUX_IF_ETHER_H */