diff options
Diffstat (limited to 'drivers/net/sk98lin')
-rw-r--r-- | drivers/net/sk98lin/h/skdrv2nd.h | 1 | ||||
-rw-r--r-- | drivers/net/sk98lin/h/skvpd.h | 8 | ||||
-rw-r--r-- | drivers/net/sk98lin/skge.c | 43 |
3 files changed, 21 insertions, 31 deletions
diff --git a/drivers/net/sk98lin/h/skdrv2nd.h b/drivers/net/sk98lin/h/skdrv2nd.h index 2dc5728e3ef6..9bdfde80c30b 100644 --- a/drivers/net/sk98lin/h/skdrv2nd.h +++ b/drivers/net/sk98lin/h/skdrv2nd.h | |||
@@ -60,7 +60,6 @@ extern SK_U64 SkOsGetTime(SK_AC*); | |||
60 | extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*); | 60 | extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*); |
61 | extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*); | 61 | extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*); |
62 | extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*); | 62 | extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*); |
63 | extern int SkPciWriteCfgDWord(SK_AC*, int, SK_U32); | ||
64 | extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16); | 63 | extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16); |
65 | extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8); | 64 | extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8); |
66 | extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA); | 65 | extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA); |
diff --git a/drivers/net/sk98lin/h/skvpd.h b/drivers/net/sk98lin/h/skvpd.h index bdc1a5eaaae9..daa9a8d154fc 100644 --- a/drivers/net/sk98lin/h/skvpd.h +++ b/drivers/net/sk98lin/h/skvpd.h | |||
@@ -130,14 +130,12 @@ typedef struct s_vpd_key { | |||
130 | #ifndef VPD_DO_IO | 130 | #ifndef VPD_DO_IO |
131 | #define VPD_OUT8(pAC,IoC,Addr,Val) (void)SkPciWriteCfgByte(pAC,Addr,Val) | 131 | #define VPD_OUT8(pAC,IoC,Addr,Val) (void)SkPciWriteCfgByte(pAC,Addr,Val) |
132 | #define VPD_OUT16(pAC,IoC,Addr,Val) (void)SkPciWriteCfgWord(pAC,Addr,Val) | 132 | #define VPD_OUT16(pAC,IoC,Addr,Val) (void)SkPciWriteCfgWord(pAC,Addr,Val) |
133 | #define VPD_OUT32(pAC,IoC,Addr,Val) (void)SkPciWriteCfgDWord(pAC,Addr,Val) | ||
134 | #define VPD_IN8(pAC,IoC,Addr,pVal) (void)SkPciReadCfgByte(pAC,Addr,pVal) | 133 | #define VPD_IN8(pAC,IoC,Addr,pVal) (void)SkPciReadCfgByte(pAC,Addr,pVal) |
135 | #define VPD_IN16(pAC,IoC,Addr,pVal) (void)SkPciReadCfgWord(pAC,Addr,pVal) | 134 | #define VPD_IN16(pAC,IoC,Addr,pVal) (void)SkPciReadCfgWord(pAC,Addr,pVal) |
136 | #define VPD_IN32(pAC,IoC,Addr,pVal) (void)SkPciReadCfgDWord(pAC,Addr,pVal) | 135 | #define VPD_IN32(pAC,IoC,Addr,pVal) (void)SkPciReadCfgDWord(pAC,Addr,pVal) |
137 | #else /* VPD_DO_IO */ | 136 | #else /* VPD_DO_IO */ |
138 | #define VPD_OUT8(pAC,IoC,Addr,Val) SK_OUT8(IoC,PCI_C(Addr),Val) | 137 | #define VPD_OUT8(pAC,IoC,Addr,Val) SK_OUT8(IoC,PCI_C(Addr),Val) |
139 | #define VPD_OUT16(pAC,IoC,Addr,Val) SK_OUT16(IoC,PCI_C(Addr),Val) | 138 | #define VPD_OUT16(pAC,IoC,Addr,Val) SK_OUT16(IoC,PCI_C(Addr),Val) |
140 | #define VPD_OUT32(pAC,IoC,Addr,Val) SK_OUT32(IoC,PCI_C(Addr),Val) | ||
141 | #define VPD_IN8(pAC,IoC,Addr,pVal) SK_IN8(IoC,PCI_C(Addr),pVal) | 139 | #define VPD_IN8(pAC,IoC,Addr,pVal) SK_IN8(IoC,PCI_C(Addr),pVal) |
142 | #define VPD_IN16(pAC,IoC,Addr,pVal) SK_IN16(IoC,PCI_C(Addr),pVal) | 140 | #define VPD_IN16(pAC,IoC,Addr,pVal) SK_IN16(IoC,PCI_C(Addr),pVal) |
143 | #define VPD_IN32(pAC,IoC,Addr,pVal) SK_IN32(IoC,PCI_C(Addr),pVal) | 141 | #define VPD_IN32(pAC,IoC,Addr,pVal) SK_IN32(IoC,PCI_C(Addr),pVal) |
@@ -155,12 +153,6 @@ typedef struct s_vpd_key { | |||
155 | else \ | 153 | else \ |
156 | SK_OUT16(pAC,PCI_C(Addr),Val); \ | 154 | SK_OUT16(pAC,PCI_C(Addr),Val); \ |
157 | } | 155 | } |
158 | #define VPD_OUT32(pAC,Ioc,Addr,Val) { \ | ||
159 | if ((pAC)->DgT.DgUseCfgCycle) \ | ||
160 | SkPciWriteCfgDWord(pAC,Addr,Val); \ | ||
161 | else \ | ||
162 | SK_OUT32(pAC,PCI_C(Addr),Val); \ | ||
163 | } | ||
164 | #define VPD_IN8(pAC,Ioc,Addr,pVal) { \ | 156 | #define VPD_IN8(pAC,Ioc,Addr,pVal) { \ |
165 | if ((pAC)->DgT.DgUseCfgCycle) \ | 157 | if ((pAC)->DgT.DgUseCfgCycle) \ |
166 | SkPciReadCfgByte(pAC,Addr,pVal); \ | 158 | SkPciReadCfgByte(pAC,Addr,pVal); \ |
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 00c5d7f04c68..107c5d97546c 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -279,6 +279,27 @@ static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480}; | |||
279 | 279 | ||
280 | /***************************************************************************** | 280 | /***************************************************************************** |
281 | * | 281 | * |
282 | * SkPciWriteCfgDWord - write a 32 bit value to pci config space | ||
283 | * | ||
284 | * Description: | ||
285 | * This routine writes a 32 bit value to the pci configuration | ||
286 | * space. | ||
287 | * | ||
288 | * Returns: | ||
289 | * 0 - indicate everything worked ok. | ||
290 | * != 0 - error indication | ||
291 | */ | ||
292 | static inline int SkPciWriteCfgDWord( | ||
293 | SK_AC *pAC, /* Adapter Control structure pointer */ | ||
294 | int PciAddr, /* PCI register address */ | ||
295 | SK_U32 Val) /* pointer to store the read value */ | ||
296 | { | ||
297 | pci_write_config_dword(pAC->PciDev, PciAddr, Val); | ||
298 | return(0); | ||
299 | } /* SkPciWriteCfgDWord */ | ||
300 | |||
301 | /***************************************************************************** | ||
302 | * | ||
282 | * SkGeInitPCI - Init the PCI resources | 303 | * SkGeInitPCI - Init the PCI resources |
283 | * | 304 | * |
284 | * Description: | 305 | * Description: |
@@ -3992,28 +4013,6 @@ SK_U8 *pVal) /* pointer to store the read value */ | |||
3992 | 4013 | ||
3993 | /***************************************************************************** | 4014 | /***************************************************************************** |
3994 | * | 4015 | * |
3995 | * SkPciWriteCfgDWord - write a 32 bit value to pci config space | ||
3996 | * | ||
3997 | * Description: | ||
3998 | * This routine writes a 32 bit value to the pci configuration | ||
3999 | * space. | ||
4000 | * | ||
4001 | * Returns: | ||
4002 | * 0 - indicate everything worked ok. | ||
4003 | * != 0 - error indication | ||
4004 | */ | ||
4005 | int SkPciWriteCfgDWord( | ||
4006 | SK_AC *pAC, /* Adapter Control structure pointer */ | ||
4007 | int PciAddr, /* PCI register address */ | ||
4008 | SK_U32 Val) /* pointer to store the read value */ | ||
4009 | { | ||
4010 | pci_write_config_dword(pAC->PciDev, PciAddr, Val); | ||
4011 | return(0); | ||
4012 | } /* SkPciWriteCfgDWord */ | ||
4013 | |||
4014 | |||
4015 | /***************************************************************************** | ||
4016 | * | ||
4017 | * SkPciWriteCfgWord - write a 16 bit value to pci config space | 4016 | * SkPciWriteCfgWord - write a 16 bit value to pci config space |
4018 | * | 4017 | * |
4019 | * Description: | 4018 | * Description: |