/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/* Qualcomm Technologies, Inc. EMAC Ethernet Controller MAC layer support
*/
#include <linux/tcp.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/crc32.h>
#include <linux/if_vlan.h>
#include <linux/jiffies.h>
#include <linux/phy.h>
#include <linux/of.h>
#include <net/ip6_checksum.h>
#include "emac.h"
#include "emac-sgmii.h"
/* EMAC_MAC_CTRL */
#define SINGLE_PAUSE_MODE 0x10000000
#define DEBUG_MODE 0x08000000
#define BROAD_EN 0x04000000
#define MULTI_ALL 0x02000000
#define RX_CHKSUM_EN 0x01000000
#define HUGE 0x00800000
#define SPEED(x) (((x) & 0x3) << 20)
#define SPEED_MASK SPEED(0x3)
#define SIMR 0x00080000
#define TPAUSE 0x00010000
#define PROM_MODE 0x00008000
#define VLAN_STRIP 0x00004000
#define PRLEN_BMSK 0x00003c00
#define PRLEN_SHFT 10
#define HUGEN 0x00000200
#define FLCHK 0x00000100
#define PCRCE 0x00000080
#define CRCE 0x00000040
#define FULLD 0x00000020
#define MAC_LP_EN 0x00000010
#define RXFC 0x00000008
#define TXFC 0x00000004
#define RXEN 0x00000002
#define TXEN 0x00000001
/* EMAC_DESC_CTRL_3