.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* Architecture specific parts of the Floppy driver |
---|
2 | 3 | * |
---|
3 | 4 | * Linux/PA-RISC Project (http://www.parisc-linux.org/) |
---|
4 | 5 | * Copyright (C) 2000 Matthew Wilcox (willy a debian . org) |
---|
5 | 6 | * Copyright (C) 2000 Dave Kennedy |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License as published by |
---|
9 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
10 | | - * (at your option) any later version. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, |
---|
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | | - * |
---|
17 | | - * You should have received a copy of the GNU General Public License |
---|
18 | | - * along with this program; if not, write to the Free Software |
---|
19 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
20 | 7 | */ |
---|
21 | 8 | #ifndef __ASM_PARISC_FLOPPY_H |
---|
22 | 9 | #define __ASM_PARISC_FLOPPY_H |
---|
.. | .. |
---|
42 | 29 | #define CSW fd_routine[can_use_virtual_dma & 1] |
---|
43 | 30 | |
---|
44 | 31 | |
---|
45 | | -#define fd_inb(port) readb(port) |
---|
46 | | -#define fd_outb(value, port) writeb(value, port) |
---|
| 32 | +#define fd_inb(base, reg) readb((base) + (reg)) |
---|
| 33 | +#define fd_outb(value, base, reg) writeb(value, (base) + (reg)) |
---|
47 | 34 | |
---|
48 | 35 | #define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") |
---|
49 | 36 | #define fd_free_dma() CSW._free_dma(FLOPPY_DMA) |
---|
.. | .. |
---|
88 | 75 | register char *lptr = virtual_dma_addr; |
---|
89 | 76 | |
---|
90 | 77 | for (lcount = virtual_dma_count; lcount; lcount--) { |
---|
91 | | - st = fd_inb(virtual_dma_port+4) & 0xa0 ; |
---|
92 | | - if (st != 0xa0) |
---|
| 78 | + st = fd_inb(virtual_dma_port, FD_STATUS); |
---|
| 79 | + st &= STATUS_DMA | STATUS_READY; |
---|
| 80 | + if (st != (STATUS_DMA | STATUS_READY)) |
---|
93 | 81 | break; |
---|
94 | 82 | if (virtual_dma_mode) { |
---|
95 | | - fd_outb(*lptr, virtual_dma_port+5); |
---|
| 83 | + fd_outb(*lptr, virtual_dma_port, FD_DATA); |
---|
96 | 84 | } else { |
---|
97 | | - *lptr = fd_inb(virtual_dma_port+5); |
---|
| 85 | + *lptr = fd_inb(virtual_dma_port, FD_DATA); |
---|
98 | 86 | } |
---|
99 | 87 | lptr++; |
---|
100 | 88 | } |
---|
101 | 89 | virtual_dma_count = lcount; |
---|
102 | 90 | virtual_dma_addr = lptr; |
---|
103 | | - st = fd_inb(virtual_dma_port+4); |
---|
| 91 | + st = fd_inb(virtual_dma_port, FD_STATUS); |
---|
104 | 92 | } |
---|
105 | 93 | |
---|
106 | 94 | #ifdef TRACE_FLPY_INT |
---|
107 | 95 | calls++; |
---|
108 | 96 | #endif |
---|
109 | | - if (st == 0x20) |
---|
| 97 | + if (st == STATUS_DMA) |
---|
110 | 98 | return; |
---|
111 | | - if (!(st & 0x20)) { |
---|
| 99 | + if (!(st & STATUS_DMA)) { |
---|
112 | 100 | virtual_dma_residue += virtual_dma_count; |
---|
113 | 101 | virtual_dma_count = 0; |
---|
114 | 102 | #ifdef TRACE_FLPY_INT |
---|