hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/arch/parisc/include/asm/floppy.h
....@@ -1,22 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* Architecture specific parts of the Floppy driver
23 *
34 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
45 * Copyright (C) 2000 Matthew Wilcox (willy a debian . org)
56 * 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
207 */
218 #ifndef __ASM_PARISC_FLOPPY_H
229 #define __ASM_PARISC_FLOPPY_H
....@@ -42,8 +29,8 @@
4229 #define CSW fd_routine[can_use_virtual_dma & 1]
4330
4431
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))
4734
4835 #define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy")
4936 #define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
....@@ -88,27 +75,28 @@
8875 register char *lptr = virtual_dma_addr;
8976
9077 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))
9381 break;
9482 if (virtual_dma_mode) {
95
- fd_outb(*lptr, virtual_dma_port+5);
83
+ fd_outb(*lptr, virtual_dma_port, FD_DATA);
9684 } else {
97
- *lptr = fd_inb(virtual_dma_port+5);
85
+ *lptr = fd_inb(virtual_dma_port, FD_DATA);
9886 }
9987 lptr++;
10088 }
10189 virtual_dma_count = lcount;
10290 virtual_dma_addr = lptr;
103
- st = fd_inb(virtual_dma_port+4);
91
+ st = fd_inb(virtual_dma_port, FD_STATUS);
10492 }
10593
10694 #ifdef TRACE_FLPY_INT
10795 calls++;
10896 #endif
109
- if (st == 0x20)
97
+ if (st == STATUS_DMA)
11098 return;
111
- if (!(st & 0x20)) {
99
+ if (!(st & STATUS_DMA)) {
112100 virtual_dma_residue += virtual_dma_count;
113101 virtual_dma_count = 0;
114102 #ifdef TRACE_FLPY_INT