summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_epreg.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-10-18 15:22:43 +0000
committerimp <imp@FreeBSD.org>2003-10-18 15:22:43 +0000
commitcec43b43e0b92892eab598176532589231b0e56c (patch)
treeab531bd40e22e6dd9d9c1314f55c111778a4c762 /sys/dev/ep/if_epreg.h
parent4c2cb3f397c38a3130cc662b11c357e626595ce7 (diff)
downloadFreeBSD-src-cec43b43e0b92892eab598176532589231b0e56c.zip
FreeBSD-src-cec43b43e0b92892eab598176532589231b0e56c.tar.gz
Transition to using bus_space macros rather than the inb/outb/etc.
Use EP_{READ,WRITE}{,_MULTI}_{1,2,4} instead. I've had several people submit patches like this over the years of varying qualities, markm being the last. The names were chosen in consulation with mdodd on irc. I've tested this with only PCMCIA cards: 3CCE589EC and 3CCSH572BT. I've not tried with my more extensive ISA, EISA and cbus collection. Reviewed by: mdodd
Diffstat (limited to 'sys/dev/ep/if_epreg.h')
-rw-r--r--sys/dev/ep/if_epreg.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/ep/if_epreg.h b/sys/dev/ep/if_epreg.h
index 986dacf..cc80901 100644
--- a/sys/dev/ep/if_epreg.h
+++ b/sys/dev/ep/if_epreg.h
@@ -60,11 +60,6 @@
#define EP_IOSIZE 16 /* 16 bytes of I/O space used. */
/*
- * some macros to acces long named fields
- */
-#define BASE (sc->ep_io_addr)
-
-/*
* Commands to read/write EEPROM trough EEPROM command register (Window 0,
* Offset 0xa)
*/
@@ -79,8 +74,8 @@
/*
* Some short functions, worth to let them be a macro
*/
-#define is_eeprom_busy(b) (inw((b)+EP_W0_EEPROM_COMMAND)&EEPROM_BUSY)
-#define GO_WINDOW(x) outw(BASE+EP_COMMAND, WINDOW_SELECT|(x))
+#define is_eeprom_busy(sc) (EP_READ_2(sc, EP_W0_EEPROM_COMMAND)&EEPROM_BUSY)
+#define GO_WINDOW(x) EP_WRITE_2(sc, EP_COMMAND, WINDOW_SELECT|(x))
/**************************************************************************
* *
@@ -343,8 +338,8 @@
*
*/
-#define SET_IRQ(base,irq) outw((base) + EP_W0_RESOURCE_CFG, \
- ((inw((base) + EP_W0_RESOURCE_CFG) & 0x0fff) | \
+#define SET_IRQ(sc, irq) EP_WRITE_2((sc), EP_W0_RESOURCE_CFG, \
+ ((EP_READ_2((sc), EP_W0_RESOURCE_CFG) & 0x0fff) | \
((u_short)(irq)<<12)) ) /* set IRQ i */
/*
OpenPOWER on IntegriCloud