18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/* Atlantic Network Driver
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2014-2019 aQuantia Corporation
58c2ecf20Sopenharmony_ci * Copyright (C) 2019-2020 Marvell International Ltd.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* File aq_common.h: Basic includes for all files in project. */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef AQ_COMMON_H
118c2ecf20Sopenharmony_ci#define AQ_COMMON_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/etherdevice.h>
148c2ecf20Sopenharmony_ci#include <linux/pci.h>
158c2ecf20Sopenharmony_ci#include <linux/if_vlan.h>
168c2ecf20Sopenharmony_ci#include "aq_cfg.h"
178c2ecf20Sopenharmony_ci#include "aq_utils.h"
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define PCI_VENDOR_ID_AQUANTIA  0x1D6A
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_0001	0x0001
228c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_D100	0xD100
238c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_D107	0xD107
248c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_D108	0xD108
258c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_D109	0xD109
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC100	0x00B1
288c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC107	0x07B1
298c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC108	0x08B1
308c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC109	0x09B1
318c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC111	0x11B1
328c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC112	0x12B1
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC100S	0x80B1
358c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC107S	0x87B1
368c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC108S	0x88B1
378c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC109S	0x89B1
388c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC111S	0x91B1
398c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC112S	0x92B1
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC113DEV	0x00C0
428c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC113CS	0x94C0
438c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC113CA	0x34C0
448c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC114CS	0x93C0
458c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC113	0x04C0
468c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC113C	0x14C0
478c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC115C	0x12C0
488c2ecf20Sopenharmony_ci#define AQ_DEVICE_ID_AQC116C	0x11C0
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define HW_ATL_NIC_NAME "Marvell (aQuantia) AQtion 10Gbit Network Adapter"
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define AQ_HWREV_ANY	0
538c2ecf20Sopenharmony_ci#define AQ_HWREV_1	1
548c2ecf20Sopenharmony_ci#define AQ_HWREV_2	2
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_10G		BIT(0)
578c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_5G		BIT(1)
588c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_2G5		BIT(2)
598c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_1G		BIT(3)
608c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_100M	BIT(4)
618c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_10M		BIT(5)
628c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_1G_HALF	BIT(6)
638c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_100M_HALF	BIT(7)
648c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_10M_HALF	BIT(8)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_10G	BIT(9)
678c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_5G	BIT(10)
688c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_2G5	BIT(11)
698c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_1G	BIT(12)
708c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_100M	BIT(13)
718c2ecf20Sopenharmony_ci#define AQ_NIC_RATE_EEE_MSK     (AQ_NIC_RATE_EEE_10G |\
728c2ecf20Sopenharmony_ci				 AQ_NIC_RATE_EEE_5G |\
738c2ecf20Sopenharmony_ci				 AQ_NIC_RATE_EEE_2G5 |\
748c2ecf20Sopenharmony_ci				 AQ_NIC_RATE_EEE_1G |\
758c2ecf20Sopenharmony_ci				 AQ_NIC_RATE_EEE_100M)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#endif /* AQ_COMMON_H */
78