diff options
Diffstat (limited to 'drivers/net/wan/pc300_drv.c')
-rw-r--r-- | drivers/net/wan/pc300_drv.c | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 65c40cd4a08f..d0a8d1e352ac 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -283,8 +283,8 @@ static void rx_dma_buf_init(pc300_t *, int); | |||
283 | static void tx_dma_buf_check(pc300_t *, int); | 283 | static void tx_dma_buf_check(pc300_t *, int); |
284 | static void rx_dma_buf_check(pc300_t *, int); | 284 | static void rx_dma_buf_check(pc300_t *, int); |
285 | static irqreturn_t cpc_intr(int, void *); | 285 | static irqreturn_t cpc_intr(int, void *); |
286 | static int clock_rate_calc(uclong, uclong, int *); | 286 | static int clock_rate_calc(u32, u32, int *); |
287 | static uclong detect_ram(pc300_t *); | 287 | static u32 detect_ram(pc300_t *); |
288 | static void plx_init(pc300_t *); | 288 | static void plx_init(pc300_t *); |
289 | static void cpc_trace(struct net_device *, struct sk_buff *, char); | 289 | static void cpc_trace(struct net_device *, struct sk_buff *, char); |
290 | static int cpc_attach(struct net_device *, unsigned short, unsigned short); | 290 | static int cpc_attach(struct net_device *, unsigned short, unsigned short); |
@@ -309,10 +309,10 @@ static void tx_dma_buf_pt_init(pc300_t * card, int ch) | |||
309 | + DMA_TX_BD_BASE + ch_factor * sizeof(pcsca_bd_t)); | 309 | + DMA_TX_BD_BASE + ch_factor * sizeof(pcsca_bd_t)); |
310 | 310 | ||
311 | for (i = 0; i < N_DMA_TX_BUF; i++, ptdescr++) { | 311 | for (i = 0; i < N_DMA_TX_BUF; i++, ptdescr++) { |
312 | cpc_writel(&ptdescr->next, (uclong) (DMA_TX_BD_BASE + | 312 | cpc_writel(&ptdescr->next, (u32)(DMA_TX_BD_BASE + |
313 | (ch_factor + ((i + 1) & (N_DMA_TX_BUF - 1))) * sizeof(pcsca_bd_t))); | 313 | (ch_factor + ((i + 1) & (N_DMA_TX_BUF - 1))) * sizeof(pcsca_bd_t))); |
314 | cpc_writel(&ptdescr->ptbuf, | 314 | cpc_writel(&ptdescr->ptbuf, |
315 | (uclong) (DMA_TX_BASE + (ch_factor + i) * BD_DEF_LEN)); | 315 | (u32)(DMA_TX_BASE + (ch_factor + i) * BD_DEF_LEN)); |
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
@@ -339,10 +339,10 @@ static void rx_dma_buf_pt_init(pc300_t * card, int ch) | |||
339 | + DMA_RX_BD_BASE + ch_factor * sizeof(pcsca_bd_t)); | 339 | + DMA_RX_BD_BASE + ch_factor * sizeof(pcsca_bd_t)); |
340 | 340 | ||
341 | for (i = 0; i < N_DMA_RX_BUF; i++, ptdescr++) { | 341 | for (i = 0; i < N_DMA_RX_BUF; i++, ptdescr++) { |
342 | cpc_writel(&ptdescr->next, (uclong) (DMA_RX_BD_BASE + | 342 | cpc_writel(&ptdescr->next, (u32)(DMA_RX_BD_BASE + |
343 | (ch_factor + ((i + 1) & (N_DMA_RX_BUF - 1))) * sizeof(pcsca_bd_t))); | 343 | (ch_factor + ((i + 1) & (N_DMA_RX_BUF - 1))) * sizeof(pcsca_bd_t))); |
344 | cpc_writel(&ptdescr->ptbuf, | 344 | cpc_writel(&ptdescr->ptbuf, |
345 | (uclong) (DMA_RX_BASE + (ch_factor + i) * BD_DEF_LEN)); | 345 | (u32)(DMA_RX_BASE + (ch_factor + i) * BD_DEF_LEN)); |
346 | } | 346 | } |
347 | } | 347 | } |
348 | 348 | ||
@@ -365,8 +365,8 @@ static void tx_dma_buf_check(pc300_t * card, int ch) | |||
365 | { | 365 | { |
366 | volatile pcsca_bd_t __iomem *ptdescr; | 366 | volatile pcsca_bd_t __iomem *ptdescr; |
367 | int i; | 367 | int i; |
368 | ucshort first_bd = card->chan[ch].tx_first_bd; | 368 | u16 first_bd = card->chan[ch].tx_first_bd; |
369 | ucshort next_bd = card->chan[ch].tx_next_bd; | 369 | u16 next_bd = card->chan[ch].tx_next_bd; |
370 | 370 | ||
371 | printk("#CH%d: f_bd = %d(0x%08zx), n_bd = %d(0x%08zx)\n", ch, | 371 | printk("#CH%d: f_bd = %d(0x%08zx), n_bd = %d(0x%08zx)\n", ch, |
372 | first_bd, TX_BD_ADDR(ch, first_bd), | 372 | first_bd, TX_BD_ADDR(ch, first_bd), |
@@ -390,9 +390,9 @@ static void tx1_dma_buf_check(pc300_t * card, int ch) | |||
390 | { | 390 | { |
391 | volatile pcsca_bd_t __iomem *ptdescr; | 391 | volatile pcsca_bd_t __iomem *ptdescr; |
392 | int i; | 392 | int i; |
393 | ucshort first_bd = card->chan[ch].tx_first_bd; | 393 | u16 first_bd = card->chan[ch].tx_first_bd; |
394 | ucshort next_bd = card->chan[ch].tx_next_bd; | 394 | u16 next_bd = card->chan[ch].tx_next_bd; |
395 | uclong scabase = card->hw.scabase; | 395 | u32 scabase = card->hw.scabase; |
396 | 396 | ||
397 | printk ("\nnfree_tx_bd = %d \n", card->chan[ch].nfree_tx_bd); | 397 | printk ("\nnfree_tx_bd = %d \n", card->chan[ch].nfree_tx_bd); |
398 | printk("#CH%d: f_bd = %d(0x%08x), n_bd = %d(0x%08x)\n", ch, | 398 | printk("#CH%d: f_bd = %d(0x%08x), n_bd = %d(0x%08x)\n", ch, |
@@ -411,13 +411,13 @@ static void tx1_dma_buf_check(pc300_t * card, int ch) | |||
411 | printk("\n"); | 411 | printk("\n"); |
412 | } | 412 | } |
413 | #endif | 413 | #endif |
414 | 414 | ||
415 | static void rx_dma_buf_check(pc300_t * card, int ch) | 415 | static void rx_dma_buf_check(pc300_t * card, int ch) |
416 | { | 416 | { |
417 | volatile pcsca_bd_t __iomem *ptdescr; | 417 | volatile pcsca_bd_t __iomem *ptdescr; |
418 | int i; | 418 | int i; |
419 | ucshort first_bd = card->chan[ch].rx_first_bd; | 419 | u16 first_bd = card->chan[ch].rx_first_bd; |
420 | ucshort last_bd = card->chan[ch].rx_last_bd; | 420 | u16 last_bd = card->chan[ch].rx_last_bd; |
421 | int ch_factor; | 421 | int ch_factor; |
422 | 422 | ||
423 | ch_factor = ch * N_DMA_RX_BUF; | 423 | ch_factor = ch * N_DMA_RX_BUF; |
@@ -438,9 +438,9 @@ static void rx_dma_buf_check(pc300_t * card, int ch) | |||
438 | static int dma_get_rx_frame_size(pc300_t * card, int ch) | 438 | static int dma_get_rx_frame_size(pc300_t * card, int ch) |
439 | { | 439 | { |
440 | volatile pcsca_bd_t __iomem *ptdescr; | 440 | volatile pcsca_bd_t __iomem *ptdescr; |
441 | ucshort first_bd = card->chan[ch].rx_first_bd; | 441 | u16 first_bd = card->chan[ch].rx_first_bd; |
442 | int rcvd = 0; | 442 | int rcvd = 0; |
443 | volatile ucchar status; | 443 | volatile u8 status; |
444 | 444 | ||
445 | ptdescr = (card->hw.rambase + RX_BD_ADDR(ch, first_bd)); | 445 | ptdescr = (card->hw.rambase + RX_BD_ADDR(ch, first_bd)); |
446 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { | 446 | while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { |
@@ -460,12 +460,12 @@ static int dma_get_rx_frame_size(pc300_t * card, int ch) | |||
460 | * dma_buf_write: writes a frame to the Tx DMA buffers | 460 | * dma_buf_write: writes a frame to the Tx DMA buffers |
461 | * NOTE: this function writes one frame at a time. | 461 | * NOTE: this function writes one frame at a time. |
462 | */ | 462 | */ |
463 | static int dma_buf_write(pc300_t * card, int ch, ucchar * ptdata, int len) | 463 | static int dma_buf_write(pc300_t *card, int ch, u8 *ptdata, int len) |
464 | { | 464 | { |
465 | int i, nchar; | 465 | int i, nchar; |
466 | volatile pcsca_bd_t __iomem *ptdescr; | 466 | volatile pcsca_bd_t __iomem *ptdescr; |
467 | int tosend = len; | 467 | int tosend = len; |
468 | ucchar nbuf = ((len - 1) / BD_DEF_LEN) + 1; | 468 | u8 nbuf = ((len - 1) / BD_DEF_LEN) + 1; |
469 | 469 | ||
470 | if (nbuf >= card->chan[ch].nfree_tx_bd) { | 470 | if (nbuf >= card->chan[ch].nfree_tx_bd) { |
471 | return -ENOMEM; | 471 | return -ENOMEM; |
@@ -507,7 +507,7 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb) | |||
507 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 507 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
508 | volatile pcsca_bd_t __iomem *ptdescr; | 508 | volatile pcsca_bd_t __iomem *ptdescr; |
509 | int rcvd = 0; | 509 | int rcvd = 0; |
510 | volatile ucchar status; | 510 | volatile u8 status; |
511 | 511 | ||
512 | ptdescr = (card->hw.rambase + | 512 | ptdescr = (card->hw.rambase + |
513 | RX_BD_ADDR(ch, chan->rx_first_bd)); | 513 | RX_BD_ADDR(ch, chan->rx_first_bd)); |
@@ -561,8 +561,8 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb) | |||
561 | static void tx_dma_stop(pc300_t * card, int ch) | 561 | static void tx_dma_stop(pc300_t * card, int ch) |
562 | { | 562 | { |
563 | void __iomem *scabase = card->hw.scabase; | 563 | void __iomem *scabase = card->hw.scabase; |
564 | ucchar drr_ena_bit = 1 << (5 + 2 * ch); | 564 | u8 drr_ena_bit = 1 << (5 + 2 * ch); |
565 | ucchar drr_rst_bit = 1 << (1 + 2 * ch); | 565 | u8 drr_rst_bit = 1 << (1 + 2 * ch); |
566 | 566 | ||
567 | /* Disable DMA */ | 567 | /* Disable DMA */ |
568 | cpc_writeb(scabase + DRR, drr_ena_bit); | 568 | cpc_writeb(scabase + DRR, drr_ena_bit); |
@@ -572,8 +572,8 @@ static void tx_dma_stop(pc300_t * card, int ch) | |||
572 | static void rx_dma_stop(pc300_t * card, int ch) | 572 | static void rx_dma_stop(pc300_t * card, int ch) |
573 | { | 573 | { |
574 | void __iomem *scabase = card->hw.scabase; | 574 | void __iomem *scabase = card->hw.scabase; |
575 | ucchar drr_ena_bit = 1 << (4 + 2 * ch); | 575 | u8 drr_ena_bit = 1 << (4 + 2 * ch); |
576 | ucchar drr_rst_bit = 1 << (2 * ch); | 576 | u8 drr_rst_bit = 1 << (2 * ch); |
577 | 577 | ||
578 | /* Disable DMA */ | 578 | /* Disable DMA */ |
579 | cpc_writeb(scabase + DRR, drr_ena_bit); | 579 | cpc_writeb(scabase + DRR, drr_ena_bit); |
@@ -605,7 +605,7 @@ static void rx_dma_start(pc300_t * card, int ch) | |||
605 | /*************************/ | 605 | /*************************/ |
606 | /*** FALC Routines ***/ | 606 | /*** FALC Routines ***/ |
607 | /*************************/ | 607 | /*************************/ |
608 | static void falc_issue_cmd(pc300_t * card, int ch, ucchar cmd) | 608 | static void falc_issue_cmd(pc300_t *card, int ch, u8 cmd) |
609 | { | 609 | { |
610 | void __iomem *falcbase = card->hw.falcbase; | 610 | void __iomem *falcbase = card->hw.falcbase; |
611 | unsigned long i = 0; | 611 | unsigned long i = 0; |
@@ -673,7 +673,7 @@ static void falc_intr_enable(pc300_t * card, int ch) | |||
673 | static void falc_open_timeslot(pc300_t * card, int ch, int timeslot) | 673 | static void falc_open_timeslot(pc300_t * card, int ch, int timeslot) |
674 | { | 674 | { |
675 | void __iomem *falcbase = card->hw.falcbase; | 675 | void __iomem *falcbase = card->hw.falcbase; |
676 | ucchar tshf = card->chan[ch].falc.offset; | 676 | u8 tshf = card->chan[ch].falc.offset; |
677 | 677 | ||
678 | cpc_writeb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch), | 678 | cpc_writeb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch), |
679 | cpc_readb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch)) & | 679 | cpc_readb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch)) & |
@@ -689,7 +689,7 @@ static void falc_open_timeslot(pc300_t * card, int ch, int timeslot) | |||
689 | static void falc_close_timeslot(pc300_t * card, int ch, int timeslot) | 689 | static void falc_close_timeslot(pc300_t * card, int ch, int timeslot) |
690 | { | 690 | { |
691 | void __iomem *falcbase = card->hw.falcbase; | 691 | void __iomem *falcbase = card->hw.falcbase; |
692 | ucchar tshf = card->chan[ch].falc.offset; | 692 | u8 tshf = card->chan[ch].falc.offset; |
693 | 693 | ||
694 | cpc_writeb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch), | 694 | cpc_writeb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch), |
695 | cpc_readb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch)) | | 695 | cpc_readb(falcbase + F_REG((ICB1 + (timeslot - tshf) / 8), ch)) | |
@@ -810,7 +810,7 @@ static void falc_init_t1(pc300_t * card, int ch) | |||
810 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; | 810 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; |
811 | falc_t *pfalc = (falc_t *) & chan->falc; | 811 | falc_t *pfalc = (falc_t *) & chan->falc; |
812 | void __iomem *falcbase = card->hw.falcbase; | 812 | void __iomem *falcbase = card->hw.falcbase; |
813 | ucchar dja = (ch ? (LIM2_DJA2 | LIM2_DJA1) : 0); | 813 | u8 dja = (ch ? (LIM2_DJA2 | LIM2_DJA1) : 0); |
814 | 814 | ||
815 | /* Switch to T1 mode (PCM 24) */ | 815 | /* Switch to T1 mode (PCM 24) */ |
816 | cpc_writeb(falcbase + F_REG(FMR1, ch), FMR1_PMOD); | 816 | cpc_writeb(falcbase + F_REG(FMR1, ch), FMR1_PMOD); |
@@ -979,7 +979,7 @@ static void falc_init_e1(pc300_t * card, int ch) | |||
979 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; | 979 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; |
980 | falc_t *pfalc = (falc_t *) & chan->falc; | 980 | falc_t *pfalc = (falc_t *) & chan->falc; |
981 | void __iomem *falcbase = card->hw.falcbase; | 981 | void __iomem *falcbase = card->hw.falcbase; |
982 | ucchar dja = (ch ? (LIM2_DJA2 | LIM2_DJA1) : 0); | 982 | u8 dja = (ch ? (LIM2_DJA2 | LIM2_DJA1) : 0); |
983 | 983 | ||
984 | /* Switch to E1 mode (PCM 30) */ | 984 | /* Switch to E1 mode (PCM 30) */ |
985 | cpc_writeb(falcbase + F_REG(FMR1, ch), | 985 | cpc_writeb(falcbase + F_REG(FMR1, ch), |
@@ -1185,7 +1185,7 @@ static void te_config(pc300_t * card, int ch) | |||
1185 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; | 1185 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; |
1186 | falc_t *pfalc = (falc_t *) & chan->falc; | 1186 | falc_t *pfalc = (falc_t *) & chan->falc; |
1187 | void __iomem *falcbase = card->hw.falcbase; | 1187 | void __iomem *falcbase = card->hw.falcbase; |
1188 | ucchar dummy; | 1188 | u8 dummy; |
1189 | unsigned long flags; | 1189 | unsigned long flags; |
1190 | 1190 | ||
1191 | memset(pfalc, 0, sizeof(falc_t)); | 1191 | memset(pfalc, 0, sizeof(falc_t)); |
@@ -1401,7 +1401,7 @@ static void falc_update_stats(pc300_t * card, int ch) | |||
1401 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; | 1401 | pc300chconf_t *conf = (pc300chconf_t *) & chan->conf; |
1402 | falc_t *pfalc = (falc_t *) & chan->falc; | 1402 | falc_t *pfalc = (falc_t *) & chan->falc; |
1403 | void __iomem *falcbase = card->hw.falcbase; | 1403 | void __iomem *falcbase = card->hw.falcbase; |
1404 | ucshort counter; | 1404 | u16 counter; |
1405 | 1405 | ||
1406 | counter = cpc_readb(falcbase + F_REG(FECL, ch)); | 1406 | counter = cpc_readb(falcbase + F_REG(FECL, ch)); |
1407 | counter |= cpc_readb(falcbase + F_REG(FECH, ch)) << 8; | 1407 | counter |= cpc_readb(falcbase + F_REG(FECH, ch)) << 8; |
@@ -1727,7 +1727,7 @@ static void falc_pattern_test(pc300_t * card, int ch, unsigned int activate) | |||
1727 | * Description: This routine returns the bit error counter value | 1727 | * Description: This routine returns the bit error counter value |
1728 | *---------------------------------------------------------------------------- | 1728 | *---------------------------------------------------------------------------- |
1729 | */ | 1729 | */ |
1730 | static ucshort falc_pattern_test_error(pc300_t * card, int ch) | 1730 | static u16 falc_pattern_test_error(pc300_t * card, int ch) |
1731 | { | 1731 | { |
1732 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 1732 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
1733 | falc_t *pfalc = (falc_t *) & chan->falc; | 1733 | falc_t *pfalc = (falc_t *) & chan->falc; |
@@ -1774,7 +1774,7 @@ static void cpc_tx_timeout(struct net_device *dev) | |||
1774 | pc300_t *card = (pc300_t *) chan->card; | 1774 | pc300_t *card = (pc300_t *) chan->card; |
1775 | int ch = chan->channel; | 1775 | int ch = chan->channel; |
1776 | unsigned long flags; | 1776 | unsigned long flags; |
1777 | ucchar ilar; | 1777 | u8 ilar; |
1778 | 1778 | ||
1779 | dev->stats.tx_errors++; | 1779 | dev->stats.tx_errors++; |
1780 | dev->stats.tx_aborted_errors++; | 1780 | dev->stats.tx_aborted_errors++; |
@@ -1830,7 +1830,7 @@ static int cpc_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1830 | } | 1830 | } |
1831 | 1831 | ||
1832 | /* Write buffer to DMA buffers */ | 1832 | /* Write buffer to DMA buffers */ |
1833 | if (dma_buf_write(card, ch, (ucchar *) skb->data, skb->len) != 0) { | 1833 | if (dma_buf_write(card, ch, (u8 *)skb->data, skb->len) != 0) { |
1834 | // printk("%s: write error. Dropping TX packet.\n", dev->name); | 1834 | // printk("%s: write error. Dropping TX packet.\n", dev->name); |
1835 | netif_stop_queue(dev); | 1835 | netif_stop_queue(dev); |
1836 | dev_kfree_skb(skb); | 1836 | dev_kfree_skb(skb); |
@@ -1995,7 +1995,7 @@ static void sca_tx_intr(pc300dev_t *dev) | |||
1995 | static void sca_intr(pc300_t * card) | 1995 | static void sca_intr(pc300_t * card) |
1996 | { | 1996 | { |
1997 | void __iomem *scabase = card->hw.scabase; | 1997 | void __iomem *scabase = card->hw.scabase; |
1998 | volatile uclong status; | 1998 | volatile u32 status; |
1999 | int ch; | 1999 | int ch; |
2000 | int intr_count = 0; | 2000 | int intr_count = 0; |
2001 | unsigned char dsr_rx; | 2001 | unsigned char dsr_rx; |
@@ -2010,7 +2010,7 @@ static void sca_intr(pc300_t * card) | |||
2010 | 2010 | ||
2011 | /**** Reception ****/ | 2011 | /**** Reception ****/ |
2012 | if (status & IR0_DRX((IR0_DMIA | IR0_DMIB), ch)) { | 2012 | if (status & IR0_DRX((IR0_DMIA | IR0_DMIB), ch)) { |
2013 | ucchar drx_stat = cpc_readb(scabase + DSR_RX(ch)); | 2013 | u8 drx_stat = cpc_readb(scabase + DSR_RX(ch)); |
2014 | 2014 | ||
2015 | /* Clear RX interrupts */ | 2015 | /* Clear RX interrupts */ |
2016 | cpc_writeb(scabase + DSR_RX(ch), drx_stat | DSR_DWE); | 2016 | cpc_writeb(scabase + DSR_RX(ch), drx_stat | DSR_DWE); |
@@ -2084,7 +2084,7 @@ static void sca_intr(pc300_t * card) | |||
2084 | 2084 | ||
2085 | /**** Transmission ****/ | 2085 | /**** Transmission ****/ |
2086 | if (status & IR0_DTX((IR0_EFT | IR0_DMIA | IR0_DMIB), ch)) { | 2086 | if (status & IR0_DTX((IR0_EFT | IR0_DMIA | IR0_DMIB), ch)) { |
2087 | ucchar dtx_stat = cpc_readb(scabase + DSR_TX(ch)); | 2087 | u8 dtx_stat = cpc_readb(scabase + DSR_TX(ch)); |
2088 | 2088 | ||
2089 | /* Clear TX interrupts */ | 2089 | /* Clear TX interrupts */ |
2090 | cpc_writeb(scabase + DSR_TX(ch), dtx_stat | DSR_DWE); | 2090 | cpc_writeb(scabase + DSR_TX(ch), dtx_stat | DSR_DWE); |
@@ -2128,7 +2128,7 @@ static void sca_intr(pc300_t * card) | |||
2128 | 2128 | ||
2129 | /**** MSCI ****/ | 2129 | /**** MSCI ****/ |
2130 | if (status & IR0_M(IR0_RXINTA, ch)) { | 2130 | if (status & IR0_M(IR0_RXINTA, ch)) { |
2131 | ucchar st1 = cpc_readb(scabase + M_REG(ST1, ch)); | 2131 | u8 st1 = cpc_readb(scabase + M_REG(ST1, ch)); |
2132 | 2132 | ||
2133 | /* Clear MSCI interrupts */ | 2133 | /* Clear MSCI interrupts */ |
2134 | cpc_writeb(scabase + M_REG(ST1, ch), st1); | 2134 | cpc_writeb(scabase + M_REG(ST1, ch), st1); |
@@ -2170,7 +2170,7 @@ static void sca_intr(pc300_t * card) | |||
2170 | } | 2170 | } |
2171 | } | 2171 | } |
2172 | 2172 | ||
2173 | static void falc_t1_loop_detection(pc300_t * card, int ch, ucchar frs1) | 2173 | static void falc_t1_loop_detection(pc300_t *card, int ch, u8 frs1) |
2174 | { | 2174 | { |
2175 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 2175 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
2176 | falc_t *pfalc = (falc_t *) & chan->falc; | 2176 | falc_t *pfalc = (falc_t *) & chan->falc; |
@@ -2195,7 +2195,7 @@ static void falc_t1_loop_detection(pc300_t * card, int ch, ucchar frs1) | |||
2195 | } | 2195 | } |
2196 | } | 2196 | } |
2197 | 2197 | ||
2198 | static void falc_e1_loop_detection(pc300_t * card, int ch, ucchar rsp) | 2198 | static void falc_e1_loop_detection(pc300_t *card, int ch, u8 rsp) |
2199 | { | 2199 | { |
2200 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 2200 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
2201 | falc_t *pfalc = (falc_t *) & chan->falc; | 2201 | falc_t *pfalc = (falc_t *) & chan->falc; |
@@ -2225,8 +2225,8 @@ static void falc_t1_intr(pc300_t * card, int ch) | |||
2225 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 2225 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
2226 | falc_t *pfalc = (falc_t *) & chan->falc; | 2226 | falc_t *pfalc = (falc_t *) & chan->falc; |
2227 | void __iomem *falcbase = card->hw.falcbase; | 2227 | void __iomem *falcbase = card->hw.falcbase; |
2228 | ucchar isr0, isr3, gis; | 2228 | u8 isr0, isr3, gis; |
2229 | ucchar dummy; | 2229 | u8 dummy; |
2230 | 2230 | ||
2231 | while ((gis = cpc_readb(falcbase + F_REG(GIS, ch))) != 0) { | 2231 | while ((gis = cpc_readb(falcbase + F_REG(GIS, ch))) != 0) { |
2232 | if (gis & GIS_ISR0) { | 2232 | if (gis & GIS_ISR0) { |
@@ -2272,8 +2272,8 @@ static void falc_e1_intr(pc300_t * card, int ch) | |||
2272 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 2272 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
2273 | falc_t *pfalc = (falc_t *) & chan->falc; | 2273 | falc_t *pfalc = (falc_t *) & chan->falc; |
2274 | void __iomem *falcbase = card->hw.falcbase; | 2274 | void __iomem *falcbase = card->hw.falcbase; |
2275 | ucchar isr1, isr2, isr3, gis, rsp; | 2275 | u8 isr1, isr2, isr3, gis, rsp; |
2276 | ucchar dummy; | 2276 | u8 dummy; |
2277 | 2277 | ||
2278 | while ((gis = cpc_readb(falcbase + F_REG(GIS, ch))) != 0) { | 2278 | while ((gis = cpc_readb(falcbase + F_REG(GIS, ch))) != 0) { |
2279 | rsp = cpc_readb(falcbase + F_REG(RSP, ch)); | 2279 | rsp = cpc_readb(falcbase + F_REG(RSP, ch)); |
@@ -2355,7 +2355,7 @@ static void falc_intr(pc300_t * card) | |||
2355 | static irqreturn_t cpc_intr(int irq, void *dev_id) | 2355 | static irqreturn_t cpc_intr(int irq, void *dev_id) |
2356 | { | 2356 | { |
2357 | pc300_t *card = dev_id; | 2357 | pc300_t *card = dev_id; |
2358 | volatile ucchar plx_status; | 2358 | volatile u8 plx_status; |
2359 | 2359 | ||
2360 | if (!card) { | 2360 | if (!card) { |
2361 | #ifdef PC300_DEBUG_INTR | 2361 | #ifdef PC300_DEBUG_INTR |
@@ -2394,7 +2394,7 @@ static irqreturn_t cpc_intr(int irq, void *dev_id) | |||
2394 | 2394 | ||
2395 | static void cpc_sca_status(pc300_t * card, int ch) | 2395 | static void cpc_sca_status(pc300_t * card, int ch) |
2396 | { | 2396 | { |
2397 | ucchar ilar; | 2397 | u8 ilar; |
2398 | void __iomem *scabase = card->hw.scabase; | 2398 | void __iomem *scabase = card->hw.scabase; |
2399 | unsigned long flags; | 2399 | unsigned long flags; |
2400 | 2400 | ||
@@ -2812,7 +2812,7 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
2812 | } | 2812 | } |
2813 | } | 2813 | } |
2814 | 2814 | ||
2815 | static int clock_rate_calc(uclong rate, uclong clock, int *br_io) | 2815 | static int clock_rate_calc(u32 rate, u32 clock, int *br_io) |
2816 | { | 2816 | { |
2817 | int br, tc; | 2817 | int br, tc; |
2818 | int br_pwr, error; | 2818 | int br_pwr, error; |
@@ -2849,12 +2849,12 @@ static int ch_config(pc300dev_t * d) | |||
2849 | void __iomem *scabase = card->hw.scabase; | 2849 | void __iomem *scabase = card->hw.scabase; |
2850 | void __iomem *plxbase = card->hw.plxbase; | 2850 | void __iomem *plxbase = card->hw.plxbase; |
2851 | int ch = chan->channel; | 2851 | int ch = chan->channel; |
2852 | uclong clkrate = chan->conf.phys_settings.clock_rate; | 2852 | u32 clkrate = chan->conf.phys_settings.clock_rate; |
2853 | uclong clktype = chan->conf.phys_settings.clock_type; | 2853 | u32 clktype = chan->conf.phys_settings.clock_type; |
2854 | ucshort encoding = chan->conf.proto_settings.encoding; | 2854 | u16 encoding = chan->conf.proto_settings.encoding; |
2855 | ucshort parity = chan->conf.proto_settings.parity; | 2855 | u16 parity = chan->conf.proto_settings.parity; |
2856 | ucchar md0, md2; | 2856 | u8 md0, md2; |
2857 | 2857 | ||
2858 | /* Reset the channel */ | 2858 | /* Reset the channel */ |
2859 | cpc_writeb(scabase + M_REG(CMD, ch), CMD_CH_RST); | 2859 | cpc_writeb(scabase + M_REG(CMD, ch), CMD_CH_RST); |
2860 | 2860 | ||
@@ -3193,16 +3193,16 @@ static int cpc_close(struct net_device *dev) | |||
3193 | return 0; | 3193 | return 0; |
3194 | } | 3194 | } |
3195 | 3195 | ||
3196 | static uclong detect_ram(pc300_t * card) | 3196 | static u32 detect_ram(pc300_t * card) |
3197 | { | 3197 | { |
3198 | uclong i; | 3198 | u32 i; |
3199 | ucchar data; | 3199 | u8 data; |
3200 | void __iomem *rambase = card->hw.rambase; | 3200 | void __iomem *rambase = card->hw.rambase; |
3201 | 3201 | ||
3202 | card->hw.ramsize = PC300_RAMSIZE; | 3202 | card->hw.ramsize = PC300_RAMSIZE; |
3203 | /* Let's find out how much RAM is present on this board */ | 3203 | /* Let's find out how much RAM is present on this board */ |
3204 | for (i = 0; i < card->hw.ramsize; i++) { | 3204 | for (i = 0; i < card->hw.ramsize; i++) { |
3205 | data = (ucchar) (i & 0xff); | 3205 | data = (u8)(i & 0xff); |
3206 | cpc_writeb(rambase + i, data); | 3206 | cpc_writeb(rambase + i, data); |
3207 | if (cpc_readb(rambase + i) != data) { | 3207 | if (cpc_readb(rambase + i) != data) { |
3208 | break; | 3208 | break; |
@@ -3279,7 +3279,7 @@ static void cpc_init_card(pc300_t * card) | |||
3279 | cpc_writeb(card->hw.scabase + DMER, 0x80); | 3279 | cpc_writeb(card->hw.scabase + DMER, 0x80); |
3280 | 3280 | ||
3281 | if (card->hw.type == PC300_TE) { | 3281 | if (card->hw.type == PC300_TE) { |
3282 | ucchar reg1; | 3282 | u8 reg1; |
3283 | 3283 | ||
3284 | /* Check CPLD version */ | 3284 | /* Check CPLD version */ |
3285 | reg1 = cpc_readb(card->hw.falcbase + CPLD_REG1); | 3285 | reg1 = cpc_readb(card->hw.falcbase + CPLD_REG1); |
@@ -3413,7 +3413,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3413 | { | 3413 | { |
3414 | static int first_time = 1; | 3414 | static int first_time = 1; |
3415 | int err, eeprom_outdated = 0; | 3415 | int err, eeprom_outdated = 0; |
3416 | ucshort device_id; | 3416 | u16 device_id; |
3417 | pc300_t *card; | 3417 | pc300_t *card; |
3418 | 3418 | ||
3419 | if (first_time) { | 3419 | if (first_time) { |