]>
Commit | Line | Data |
---|---|---|
5449c685 FB |
1 | /* |
2 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. | |
3 | * All rights reserved. | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
5449c685 FB |
15 | * File: upc.h |
16 | * | |
17 | * Purpose: Macros to access device | |
18 | * | |
19 | * Author: Tevin Chen | |
20 | * | |
21 | * Date: Mar 17, 1997 | |
22 | * | |
23 | */ | |
24 | ||
5449c685 FB |
25 | #ifndef __UPC_H__ |
26 | #define __UPC_H__ | |
27 | ||
5449c685 | 28 | #include "device.h" |
5449c685 FB |
29 | |
30 | /*--------------------- Export Definitions -------------------------*/ | |
31 | ||
c3dd5a08 NP |
32 | |
33 | /* For memory mapped IO */ | |
34 | ||
5449c685 | 35 | |
11208b0b NP |
36 | #define VNSvInPortB(dwIOAddress, pbyData) \ |
37 | (*(pbyData) = ioread8(dwIOAddress)) | |
5449c685 | 38 | |
11208b0b NP |
39 | #define VNSvInPortW(dwIOAddress, pwData) \ |
40 | (*(pwData) = ioread16(dwIOAddress)) | |
5449c685 | 41 | |
11208b0b NP |
42 | #define VNSvInPortD(dwIOAddress, pdwData) \ |
43 | (*(pdwData) = ioread32(dwIOAddress)) | |
5449c685 | 44 | |
11208b0b NP |
45 | #define VNSvOutPortB(dwIOAddress, byData) \ |
46 | iowrite8((u8)(byData), dwIOAddress) | |
5449c685 | 47 | |
11208b0b NP |
48 | #define VNSvOutPortW(dwIOAddress, wData) \ |
49 | iowrite16((u16)(wData), dwIOAddress) | |
5449c685 | 50 | |
11208b0b NP |
51 | #define VNSvOutPortD(dwIOAddress, dwData) \ |
52 | iowrite32((u32)(dwData), dwIOAddress) | |
5449c685 | 53 | |
bda2a44e JP |
54 | #define PCAvDelayByIO(uDelayUnit) \ |
55 | do { \ | |
56 | unsigned char byData; \ | |
57 | unsigned long ii; \ | |
031d3996 | 58 | \ |
bda2a44e JP |
59 | if (uDelayUnit <= 50) { \ |
60 | udelay(uDelayUnit); \ | |
61 | } else { \ | |
62 | for (ii = 0; ii < (uDelayUnit); ii++) \ | |
63 | byData = inb(0x61); \ | |
64 | } \ | |
65 | } while (0) | |
5449c685 | 66 | |
5449c685 FB |
67 | /*--------------------- Export Classes ----------------------------*/ |
68 | ||
69 | /*--------------------- Export Variables --------------------------*/ | |
70 | ||
71 | /*--------------------- Export Functions --------------------------*/ | |
72 | ||
c3dd5a08 | 73 | #endif /* __UPC_H__ */ |