patch-2.1.6 linux/drivers/isdn/teles/card.c

Next file: linux/drivers/isdn/teles/config.c
Previous file: linux/drivers/isdn/teles/callc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.5/linux/drivers/isdn/teles/card.c linux/drivers/isdn/teles/card.c
@@ -64,6 +64,8 @@
 #include <linux/tqueue.h>
 #include <linux/interrupt.h>
 
+#include <asm/io.h>
+
 #undef DCHAN_VERBOSE
 
 extern void     tei_handler(struct PStack *st, byte pr,
@@ -75,9 +77,9 @@
 #define bytein(addr) inb_p(addr)
 
 static inline   byte
-readisac_0(byte * cardm, byte offset)
+readisac_0(unsigned int cardm, byte offset)
 {
-	return *(byte *) (cardm + 0x100 + ((offset & 1) ? 0x1ff : 0) + offset);
+	return readb(cardm + 0x100 + ((offset & 1) ? 0x1ff : 0) + offset);
 }
 
 static inline   byte
@@ -90,9 +92,9 @@
         ((mbase)?readisac_0(mbase,ofs):readisac_3(ibase,ofs))
 
 static inline void
-writeisac_0(byte * cardm, byte offset, byte value)
+writeisac_0(unsigned int cardm, byte offset, byte value)
 {
-	*(byte *) (cardm + 0x100 + ((offset & 1) ? 0x1ff : 0) + offset) = value;
+	writeb(value, cardm + 0x100 + ((offset & 1) ? 0x1ff : 0) + offset);
 }
 
 static inline void
@@ -117,9 +119,9 @@
 }
 
 static inline   byte
-readhscx_0(byte * base, byte hscx, byte offset)
+readhscx_0(unsigned int base, byte hscx, byte offset)
 {
-	return *(byte *) (base + 0x180 + ((offset & 1) ? 0x1FF : 0) +
+	return readb(base + 0x180 + ((offset & 1) ? 0x1FF : 0) +
 			  ((hscx & 1) ? 0x40 : 0) + offset);
 }
 
@@ -133,10 +135,10 @@
         ((mbase)?readhscx_0(mbase,hscx,ofs):readhscx_3(ibase,hscx,ofs))
 
 static inline void
-writehscx_0(byte * base, byte hscx, byte offset, byte data)
+writehscx_0(unsigned int base, byte hscx, byte offset, byte data)
 {
-	*(byte *) (base + 0x180 + ((offset & 1) ? 0x1FF : 0) +
-		   ((hscx & 1) ? 0x40 : 0) + offset) = data;
+	writeb(data, base + 0x180 + ((offset & 1) ? 0x1FF : 0) +
+		   ((hscx & 1) ? 0x40 : 0) + offset);
 }
 
 static inline void
@@ -199,7 +201,7 @@
 #define HSCX_MASK 0x20
 
 static inline void
-waitforCEC_0(byte * base, byte hscx)
+waitforCEC_0(unsigned int base, byte hscx)
 {
 	long            to = 10;
 
@@ -225,7 +227,7 @@
 }
 
 static inline void
-waitforXFW_0(byte * base, byte hscx)
+waitforXFW_0(unsigned int base, byte hscx)
 {
 	long            to = 20;
 
@@ -251,7 +253,7 @@
 }
 
 static inline void
-writehscxCMDR_0(byte * base, byte hscx, byte data)
+writehscxCMDR_0(unsigned int base, byte hscx, byte data)
 {
 	long            flags;
 
@@ -1059,7 +1061,7 @@
 }
 
 static void
-initisac(byte * cardmem, int iobase)
+initisac(unsigned int cardmem, int iobase)
 {
         if (cardmem) {
                 writeisac_0(cardmem, ISAC_MASK, 0xff);
@@ -1093,17 +1095,17 @@
 	struct IsdnCard *card = cards + cardnr;
 
         if (card->membase)
-                if ((unsigned long)card->membase < 0x10000) {
-                        (unsigned long)card->membase <<= 4;
+                if (card->membase < 0x10000) {
+                        card->membase <<= 4;
                         printk(KERN_INFO
-                               "Teles membase configured DOSish, assuming 0x%lx\n",
-                               (unsigned long)card->membase);
+                               "Teles membase configured DOSish, assuming 0x%x\n",
+                               card->membase);
                 }
         if (!card->iobase) {
                 if (card->membase) {
                         printk(KERN_NOTICE
-                               "Teles 8 assumed, mem: %lx irq: %d proto: %s\n",
-                               (long) card->membase, card->interrupt,
+                               "Teles 8 assumed, mem: %x irq: %d proto: %s\n",
+                               card->membase, card->interrupt,
                                (card->protocol == ISDN_PTYPE_1TR6) ?
                                "1TR6" : "EDSS1");
                         printk(KERN_INFO "HSCX version A:%x B:%x\n",
@@ -1186,7 +1188,7 @@
                         break;
                 }
                 if (card->membase) {
-                        cfval |= (((unsigned int) card->membase >> 9) & 0xF0);
+                        cfval |= (card->membase >> 9) & 0xF0;
                 }   
                 if (bytein(card->iobase + 0) != 0x51) {
                         printk(KERN_INFO "XXX Byte at %x is %x\n",
@@ -1232,8 +1234,8 @@
                 
                 if (card->membase)
                         printk(KERN_NOTICE
-                               "Teles 16.0 found, io: %x mem: %lx irq: %d proto: %s\n",
-                               card->iobase, (long) card->membase,
+                               "Teles 16.0 found, io: %x mem: %x irq: %d proto: %s\n",
+                               card->iobase, card->membase,
                                card->interrupt,
                                (card->protocol == ISDN_PTYPE_1TR6) ?
                                "1TR6" : "EDSS1");
@@ -1253,12 +1255,12 @@
         if (card->membase) {
                 cli();
                 timout = jiffies + (HZ / 5) + 1;
-                *(byte *) (card->membase + 0x80) = 0;
+                writeb(0, card->membase + 0x80);
                 sti();
                 while (jiffies <= timout);
                 
                 cli();
-                *(byte *) (card->membase + 0x80) = 1;
+                writeb(1, card->membase + 0x80);
                 timout = jiffies + (HZ / 5) + 1;
                 sti();
                 while (jiffies <= timout);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov