hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/******************************************************************************
 *
 * Copyright(c) 2007 - 2019 Realtek Corporation.
 *
 * 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.
 *
 * 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.
 *
 *****************************************************************************/
#ifndef __DRV_TYPES_PCI_H__
#define __DRV_TYPES_PCI_H__
 
#ifdef PLATFORM_LINUX
   #include <linux/pci.h>
#endif
 
#define    INTEL_VENDOR_ID                0x8086
#define    SIS_VENDOR_ID                    0x1039
#define    ATI_VENDOR_ID                    0x1002
#define    ATI_DEVICE_ID                    0x7914
#define    AMD_VENDOR_ID                    0x1022
 
#define PCI_VENDER_ID_REALTEK        0x10ec
 
enum aspm_mode {
   ASPM_MODE_UND,
   ASPM_MODE_PERF,
   ASPM_MODE_PS,
   ASPM_MODE_DEF,
};
 
struct pci_priv {
   BOOLEAN        pci_clk_req;
 
   u8    pciehdr_offset;
 
   u8    linkctrl_reg;
   u8    pcibridge_linkctrlreg;
 
   u8    amd_l1_patch;
 
#ifdef CONFIG_PCI_DYNAMIC_ASPM
   u8    aspm_mode;
#endif
};
 
typedef struct _RT_ISR_CONTENT {
   union {
       u32            IntArray[2];
       u32            IntReg4Byte;
       u16            IntReg2Byte;
   };
} RT_ISR_CONTENT, *PRT_ISR_CONTENT;
 
typedef struct pci_data {
#ifdef PLATFORM_LINUX
   struct pci_dev *ppcidev;
 
   /* PCI MEM map */
   unsigned long    pci_mem_end;    /* shared mem end    */
   unsigned long    pci_mem_start;    /* shared mem start    */
 
   /* PCI IO map */
   unsigned long    pci_base_addr;    /* device I/O address    */
 
   #ifdef RTK_129X_PLATFORM
   unsigned long    ctrl_start;
   /* PCI MASK addr */
   unsigned long    mask_addr;
 
   /* PCI TRANSLATE addr */
   unsigned long    tran_addr;
 
   _lock    io_reg_lock;
   #endif
 
   /* PciBridge */
   struct pci_priv pcipriv;
 
   u8 irq_alloc;
   unsigned int irq; /* get from pci_dev.irq, store to net_device.irq */
   u16    irqline;
   u8    irq_enabled;
   RT_ISR_CONTENT    isr_content;
   _lock    irq_th_lock;
 
   u8    bdma64;
#endif/* PLATFORM_LINUX */
} PCI_DATA, *PPCI_DATA;
 
#endif