/* * Copyright (C) 2015 Cavium, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. */#include<linux/acpi.h>#include<linux/module.h>#include<linux/interrupt.h>#include<linux/pci.h>#include<linux/netdevice.h>#include<linux/etherdevice.h>#include<linux/phy.h>#include<linux/of.h>#include<linux/of_mdio.h>#include<linux/of_net.h>#include"nic_reg.h"#include"nic.h"#include"thunder_bgx.h"#define DRV_NAME "thunder-BGX"#define DRV_VERSION "1.0"structlmac{structbgx*bgx;intdmac;u8mac[ETH_ALEN];u8lmac_type;u8lane_to_sds;booluse_training;boollink_up;intlmacid;/* ID within BGX */intlmacid_bd;/* ID on board */structnet_devicenetdev;structphy_device*phydev;unsignedintlast_duplex;unsignedintlast_link;unsignedintlast_speed;boolis_sgmii;structdelayed_workdwork;structworkqueue_struct*check_link;};structbgx{u8bgx_id;structlmaclmac[MAX_LMAC_PER_BGX];u8lmac_count;u8max_lmac;u8acpi_lmac_idx;void__iomem*reg_base;structpci_dev*pdev;boolis_dlm;boolis_rgx;};staticstructbgx*bgx_vnic[MAX_BGX_THUNDER];staticintlmac_count;/* Total no of LMACs in system */staticintbgx_xaui_check_link(structlmac