diff options
| author | Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2004-11-20 21:12:53 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-20 21:12:53 -0800 |
| commit | 8fe11cd89eeaec0a6e26f82e3ee355be599cf09f (patch) | |
| tree | 5969f4274304889203c07053e2bfdd95ec60c8cb | |
| parent | 36aed6eba53c8c8784333e1914bf24b5cd776328 (diff) | |
[PATCH] pc300 portability fixes
64bit portability fixes - as it is, driver had been broken on all 64bit
platforms except alpha.
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | drivers/net/wan/pc300.h | 12 | ||||
| -rw-r--r-- | drivers/net/wan/pc300_drv.c | 52 |
2 files changed, 30 insertions, 34 deletions
diff --git a/drivers/net/wan/pc300.h b/drivers/net/wan/pc300.h index a4bfff8d1eab..73401b0f0151 100644 --- a/drivers/net/wan/pc300.h +++ b/drivers/net/wan/pc300.h @@ -105,14 +105,10 @@ #ifndef CY_TYPES #define CY_TYPES -#if defined(__alpha__) -typedef unsigned long ucdouble; /* 64 bits, unsigned */ -typedef unsigned int uclong; /* 32 bits, unsigned */ -#else -typedef unsigned long uclong; /* 32 bits, unsigned */ -#endif -typedef unsigned short ucshort; /* 16 bits, unsigned */ -typedef unsigned char ucchar; /* 8 bits, unsigned */ +typedef __u64 ucdouble; /* 64 bits, unsigned */ +typedef __u32 uclong; /* 32 bits, unsigned */ +typedef __u16 ucshort; /* 16 bits, unsigned */ +typedef __u8 ucchar; /* 8 bits, unsigned */ #endif /* CY_TYPES */ #define PC300_PROTO_MLPPP 1 diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 9107aabef6ed..59b7d5727f80 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c @@ -378,9 +378,9 @@ static void tx_dma_buf_check(pc300_t * card, int ch) i != ((next_bd + 1) & (N_DMA_TX_BUF - 1)); i = (i + 1) & (N_DMA_TX_BUF - 1), ptdescr = (card->hw.rambase + TX_BD_ADDR(ch, i))) { - printk("\n CH%d TX%d: next=0x%lx, ptbuf=0x%lx, ST=0x%x, len=%d", - ch, i, (uclong) cpc_readl(&ptdescr->next), - (uclong) cpc_readl(&ptdescr->ptbuf), + printk("\n CH%d TX%d: next=0x%x, ptbuf=0x%x, ST=0x%x, len=%d", + ch, i, cpc_readl(&ptdescr->next), + cpc_readl(&ptdescr->ptbuf), cpc_readb(&ptdescr->status), cpc_readw(&ptdescr->len)); } printk("\n"); @@ -400,14 +400,14 @@ static void tx1_dma_buf_check(pc300_t * card, int ch) printk("#CH%d: f_bd = %d(0x%08x), n_bd = %d(0x%08x)\n", ch, first_bd, TX_BD_ADDR(ch, first_bd), next_bd, TX_BD_ADDR(ch, next_bd)); - printk("TX_CDA=0x%08lx, TX_EDA=0x%08lx\n", - (uclong) cpc_readl(scabase + DTX_REG(CDAL, ch)), - (uclong) cpc_readl(scabase + DTX_REG(EDAL, ch))); + printk("TX_CDA=0x%08x, TX_EDA=0x%08x\n", + cpc_readl(scabase + DTX_REG(CDAL, ch)), + cpc_readl(scabase + DTX_REG(EDAL, ch))); for (i = 0; i < N_DMA_TX_BUF; i++) { ptdescr = (card->hw.rambase + TX_BD_ADDR(ch, i)); - printk("\n CH%d TX%d: next=0x%lx, ptbuf=0x%lx, ST=0x%x, len=%d", - ch, i, (uclong) cpc_readl(&ptdescr->next), - (uclong) cpc_readl(&ptdescr->ptbuf), + printk("\n CH%d TX%d: next=0x%x, ptbuf=0x%x, ST=0x%x, len=%d", + ch, i, cpc_readl(&ptdescr->next), + cpc_readl(&ptdescr->ptbuf), cpc_readb(&ptdescr->status), cpc_readw(&ptdescr->len)); } printk("\n"); @@ -428,9 +428,9 @@ static void rx_dma_buf_check(pc300_t * card, int ch) DMA_RX_BD_BASE + ch_factor * sizeof(pcsca_bd_t)); i < N_DMA_RX_BUF; i++, ptdescr++) { if (cpc_readb(&ptdescr->status) & DST_OSB) - printk ("\n CH%d RX%d: next=0x%lx, ptbuf=0x%lx, ST=0x%x, len=%d", - ch, i, (uclong) cpc_readl(&ptdescr->next), - (uclong) cpc_readl(&ptdescr->ptbuf), + printk ("\n CH%d RX%d: next=0x%x, ptbuf=0x%x, ST=0x%x, len=%d", + ch, i, cpc_readl(&ptdescr->next), + cpc_readl(&ptdescr->ptbuf), cpc_readb(&ptdescr->status), cpc_readw(&ptdescr->len)); } @@ -2415,12 +2415,12 @@ void cpc_sca_status(pc300_t * card, int ch) printk ("ILAR=0x%02x, WCRL=0x%02x, PCR=0x%02x, BTCR=0x%02x, BOLR=0x%02x\n", ilar, cpc_readb(scabase + WCRL), cpc_readb(scabase + PCR), cpc_readb(scabase + BTCR), cpc_readb(scabase + BOLR)); - printk("TX_CDA=0x%08lx, TX_EDA=0x%08lx\n", - (uclong) cpc_readl(scabase + DTX_REG(CDAL, ch)), - (uclong) cpc_readl(scabase + DTX_REG(EDAL, ch))); - printk("RX_CDA=0x%08lx, RX_EDA=0x%08lx, BFL=0x%04x\n", - (uclong) cpc_readl(scabase + DRX_REG(CDAL, ch)), - (uclong) cpc_readl(scabase + DRX_REG(EDAL, ch)), + printk("TX_CDA=0x%08x, TX_EDA=0x%08x\n", + cpc_readl(scabase + DTX_REG(CDAL, ch)), + cpc_readl(scabase + DTX_REG(EDAL, ch))); + printk("RX_CDA=0x%08x, RX_EDA=0x%08x, BFL=0x%04x\n", + cpc_readl(scabase + DRX_REG(CDAL, ch)), + cpc_readl(scabase + DRX_REG(EDAL, ch)), cpc_readw(scabase + DRX_REG(BFLL, ch))); printk("DMER=0x%02x, DSR_TX=0x%02x, DSR_RX=0x%02x\n", cpc_readb(scabase + DMER), cpc_readb(scabase + DSR_TX(ch)), @@ -2485,7 +2485,7 @@ void cpc_sca_status(pc300_t * card, int ch) cpc_readb(scabase + M_REG(IE2, ch)), cpc_readb(scabase + M_REG(IE4, ch)), cpc_readb(scabase + M_REG(FIE, ch))); - printk("IER0=0x%08lx\n", (uclong) cpc_readl(scabase + IER0)); + printk("IER0=0x%08x\n", cpc_readl(scabase + IER0)); if (ilar != 0) { CPC_LOCK(card, flags); @@ -3406,12 +3406,12 @@ static void cpc_init_card(pc300_t * card) printk("RSV "); break; } - printk (" #%d, %ldKB of RAM at 0x%08lx, IRQ%d, channel %d.\n", + printk (" #%d, %dKB of RAM at 0x%08x, IRQ%d, channel %d.\n", board_nbr, card->hw.ramsize / 1024, card->hw.ramphys, card->hw.irq, i + 1); devcount++; } else { - printk ("Dev%d on card(0x%08lx): unable to allocate i/f name.\n", + printk ("Dev%d on card(0x%08x): unable to allocate i/f name.\n", i + 1, card->hw.ramphys); free_netdev(dev); continue; @@ -3491,7 +3491,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (!request_region(card->hw.iophys, card->hw.iosize, "PLX Registers")) { /* In case we can't allocate it, warn user */ printk("WARNING: couldn't allocate I/O region for PC300 board " - "at 0x%08lx!\n", card->hw.ramphys); + "at 0x%08x!\n", card->hw.ramphys); } if (card->hw.plxphys) { @@ -3504,7 +3504,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (!request_mem_region(card->hw.plxphys, card->hw.plxsize, "PLX Registers")) { - printk("PC300 found at RAM 0x%08lx, " + printk("PC300 found at RAM 0x%08x, " "but could not allocate PLX mem region.\n", card->hw.ramphys); err = -ENODEV; @@ -3512,7 +3512,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } if (!request_mem_region(card->hw.ramphys, card->hw.alloc_ramsize, "On-board RAM")) { - printk("PC300 found at RAM 0x%08lx, " + printk("PC300 found at RAM 0x%08x, " "but could not allocate RAM mem region.\n", card->hw.ramphys); err = -ENODEV; @@ -3520,7 +3520,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } if (!request_mem_region(card->hw.scaphys, card->hw.scasize, "SCA-II Registers")) { - printk("PC300 found at RAM 0x%08lx, " + printk("PC300 found at RAM 0x%08x, " "but could not allocate SCA mem region.\n", card->hw.ramphys); err = -ENODEV; @@ -3600,7 +3600,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) /* Allocate IRQ */ if (request_irq(card->hw.irq, cpc_intr, SA_SHIRQ, "Cyclades-PC300", card)) { - printk ("PC300 found at RAM 0x%08lx, but could not allocate IRQ%d.\n", + printk ("PC300 found at RAM 0x%08x, but could not allocate IRQ%d.\n", card->hw.ramphys, card->hw.irq); goto err_io_unmap; } |
