diff options
author | Tony Luck <tony.luck@intel.com> | 2005-10-20 13:41:44 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-10-20 13:41:44 -0400 |
commit | 9cec58dc138d6fcad9f447a19c8ff69f6540e667 (patch) | |
tree | 4fe1cca94fdba8b705c87615bee06d3346f687ce /drivers/char | |
parent | 17e5ad6c0ce5a970e2830d0de8bdd60a2f077d38 (diff) | |
parent | ac9b9c667c2e1194e22ebe0a441ae1c37aaa9b90 (diff) |
Update from upstream with manual merge of Yasunori Goto's
changes to swiotlb.c made in commit 281dd25cdc0d6903929b79183816d151ea626341
since this file has been moved from arch/ia64/lib/swiotlb.c to
lib/swiotlb.c
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/.gitignore | 3 | ||||
-rw-r--r-- | drivers/char/agp/hp-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_drv.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_proc.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/drm_stub.c | 2 | ||||
-rw-r--r-- | drivers/char/drm/mga_dma.c | 22 | ||||
-rw-r--r-- | drivers/char/epca.c | 84 | ||||
-rw-r--r-- | drivers/char/epca.h | 12 | ||||
-rw-r--r-- | drivers/char/hpet.c | 1 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 6 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_poweroff.c | 2 | ||||
-rw-r--r-- | drivers/char/mbcs.c | 3 | ||||
-rw-r--r-- | drivers/char/n_r3964.c | 92 | ||||
-rw-r--r-- | drivers/char/s3c2410-rtc.c | 1 | ||||
-rw-r--r-- | drivers/char/vt.c | 5 | ||||
-rw-r--r-- | drivers/char/watchdog/mv64x60_wdt.c | 14 | ||||
-rw-r--r-- | drivers/char/watchdog/pcwd_pci.c | 239 |
17 files changed, 312 insertions, 180 deletions
diff --git a/drivers/char/.gitignore b/drivers/char/.gitignore new file mode 100644 index 000000000000..2b6b1d772ed7 --- /dev/null +++ b/drivers/char/.gitignore | |||
@@ -0,0 +1,3 @@ | |||
1 | consolemap_deftbl.c | ||
2 | defkeymap.c | ||
3 | |||
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 99762b6c19ae..de5d6d212674 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -252,7 +252,7 @@ hp_zx1_configure (void) | |||
252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); | 252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); |
253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); | 253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); |
254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); | 254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); |
255 | writel(~(HP_ZX1_IOVA_SIZE-1), hp->ioc_regs+HP_ZX1_IMASK); | 255 | writel((unsigned int)(~(HP_ZX1_IOVA_SIZE-1)), hp->ioc_regs+HP_ZX1_IMASK); |
256 | readl(hp->ioc_regs+HP_ZX1_IMASK); | 256 | readl(hp->ioc_regs+HP_ZX1_IMASK); |
257 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); | 257 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); |
258 | readl(hp->ioc_regs+HP_ZX1_IBASE); | 258 | readl(hp->ioc_regs+HP_ZX1_IBASE); |
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 6ba48f346fcf..041bb47b5c39 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c | |||
@@ -376,7 +376,7 @@ static int __init drm_core_init(void) | |||
376 | goto err_p2; | 376 | goto err_p2; |
377 | } | 377 | } |
378 | 378 | ||
379 | drm_proc_root = create_proc_entry("dri", S_IFDIR, NULL); | 379 | drm_proc_root = proc_mkdir("dri", NULL); |
380 | if (!drm_proc_root) { | 380 | if (!drm_proc_root) { |
381 | DRM_ERROR("Cannot create /proc/dri\n"); | 381 | DRM_ERROR("Cannot create /proc/dri\n"); |
382 | ret = -1; | 382 | ret = -1; |
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c index 32d2bb99462c..977961002488 100644 --- a/drivers/char/drm/drm_proc.c +++ b/drivers/char/drm/drm_proc.c | |||
@@ -95,7 +95,7 @@ int drm_proc_init(drm_device_t *dev, int minor, | |||
95 | char name[64]; | 95 | char name[64]; |
96 | 96 | ||
97 | sprintf(name, "%d", minor); | 97 | sprintf(name, "%d", minor); |
98 | *dev_root = create_proc_entry(name, S_IFDIR, root); | 98 | *dev_root = proc_mkdir(name, root); |
99 | if (!*dev_root) { | 99 | if (!*dev_root) { |
100 | DRM_ERROR("Cannot create /proc/dri/%s\n", name); | 100 | DRM_ERROR("Cannot create /proc/dri/%s\n", name); |
101 | return -1; | 101 | return -1; |
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c index 95a976c96eb8..70458cb061c6 100644 --- a/drivers/char/drm/drm_stub.c +++ b/drivers/char/drm/drm_stub.c | |||
@@ -47,7 +47,7 @@ MODULE_PARM_DESC(cards_limit, "Maximum number of graphics cards"); | |||
47 | MODULE_PARM_DESC(debug, "Enable debug output"); | 47 | MODULE_PARM_DESC(debug, "Enable debug output"); |
48 | 48 | ||
49 | module_param_named(cards_limit, drm_cards_limit, int, 0444); | 49 | module_param_named(cards_limit, drm_cards_limit, int, 0444); |
50 | module_param_named(debug, drm_debug, int, 0666); | 50 | module_param_named(debug, drm_debug, int, 0600); |
51 | 51 | ||
52 | drm_head_t **drm_heads; | 52 | drm_head_t **drm_heads; |
53 | struct drm_sysfs_class *drm_class; | 53 | struct drm_sysfs_class *drm_class; |
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c index fc7d4a594bca..c8e1b6c83636 100644 --- a/drivers/char/drm/mga_dma.c +++ b/drivers/char/drm/mga_dma.c | |||
@@ -437,7 +437,7 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev, | |||
437 | drm_mga_dma_bootstrap_t * dma_bs) | 437 | drm_mga_dma_bootstrap_t * dma_bs) |
438 | { | 438 | { |
439 | drm_mga_private_t * const dev_priv = (drm_mga_private_t *) dev->dev_private; | 439 | drm_mga_private_t * const dev_priv = (drm_mga_private_t *) dev->dev_private; |
440 | const unsigned int warp_size = mga_warp_microcode_size(dev_priv); | 440 | unsigned int warp_size = mga_warp_microcode_size(dev_priv); |
441 | int err; | 441 | int err; |
442 | unsigned offset; | 442 | unsigned offset; |
443 | const unsigned secondary_size = dma_bs->secondary_bin_count | 443 | const unsigned secondary_size = dma_bs->secondary_bin_count |
@@ -499,6 +499,12 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev, | |||
499 | return err; | 499 | return err; |
500 | } | 500 | } |
501 | 501 | ||
502 | /* Make drm_addbufs happy by not trying to create a mapping for less | ||
503 | * than a page. | ||
504 | */ | ||
505 | if (warp_size < PAGE_SIZE) | ||
506 | warp_size = PAGE_SIZE; | ||
507 | |||
502 | offset = 0; | 508 | offset = 0; |
503 | err = drm_addmap( dev, offset, warp_size, | 509 | err = drm_addmap( dev, offset, warp_size, |
504 | _DRM_AGP, _DRM_READ_ONLY, & dev_priv->warp ); | 510 | _DRM_AGP, _DRM_READ_ONLY, & dev_priv->warp ); |
@@ -587,7 +593,7 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev, | |||
587 | drm_mga_dma_bootstrap_t * dma_bs) | 593 | drm_mga_dma_bootstrap_t * dma_bs) |
588 | { | 594 | { |
589 | drm_mga_private_t * const dev_priv = (drm_mga_private_t *) dev->dev_private; | 595 | drm_mga_private_t * const dev_priv = (drm_mga_private_t *) dev->dev_private; |
590 | const unsigned int warp_size = mga_warp_microcode_size(dev_priv); | 596 | unsigned int warp_size = mga_warp_microcode_size(dev_priv); |
591 | unsigned int primary_size; | 597 | unsigned int primary_size; |
592 | unsigned int bin_count; | 598 | unsigned int bin_count; |
593 | int err; | 599 | int err; |
@@ -599,6 +605,12 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev, | |||
599 | return DRM_ERR(EFAULT); | 605 | return DRM_ERR(EFAULT); |
600 | } | 606 | } |
601 | 607 | ||
608 | /* Make drm_addbufs happy by not trying to create a mapping for less | ||
609 | * than a page. | ||
610 | */ | ||
611 | if (warp_size < PAGE_SIZE) | ||
612 | warp_size = PAGE_SIZE; | ||
613 | |||
602 | /* The proper alignment is 0x100 for this mapping */ | 614 | /* The proper alignment is 0x100 for this mapping */ |
603 | err = drm_addmap(dev, 0, warp_size, _DRM_CONSISTENT, | 615 | err = drm_addmap(dev, 0, warp_size, _DRM_CONSISTENT, |
604 | _DRM_READ_ONLY, &dev_priv->warp); | 616 | _DRM_READ_ONLY, &dev_priv->warp); |
@@ -812,6 +824,10 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init ) | |||
812 | } | 824 | } |
813 | 825 | ||
814 | if (! dev_priv->used_new_dma_init) { | 826 | if (! dev_priv->used_new_dma_init) { |
827 | |||
828 | dev_priv->dma_access = MGA_PAGPXFER; | ||
829 | dev_priv->wagp_enable = MGA_WAGP_ENABLE; | ||
830 | |||
815 | dev_priv->status = drm_core_findmap(dev, init->status_offset); | 831 | dev_priv->status = drm_core_findmap(dev, init->status_offset); |
816 | if (!dev_priv->status) { | 832 | if (!dev_priv->status) { |
817 | DRM_ERROR("failed to find status page!\n"); | 833 | DRM_ERROR("failed to find status page!\n"); |
@@ -928,7 +944,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev ) | |||
928 | drm_mga_private_t *dev_priv = dev->dev_private; | 944 | drm_mga_private_t *dev_priv = dev->dev_private; |
929 | 945 | ||
930 | if ((dev_priv->warp != NULL) | 946 | if ((dev_priv->warp != NULL) |
931 | && (dev_priv->mmio->type != _DRM_CONSISTENT)) | 947 | && (dev_priv->warp->type != _DRM_CONSISTENT)) |
932 | drm_core_ioremapfree(dev_priv->warp, dev); | 948 | drm_core_ioremapfree(dev_priv->warp, dev); |
933 | 949 | ||
934 | if ((dev_priv->primary != NULL) | 950 | if ((dev_priv->primary != NULL) |
diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 58d3738a2b7f..407708a001e4 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c | |||
@@ -534,7 +534,7 @@ static void shutdown(struct channel *ch) | |||
534 | 534 | ||
535 | unsigned long flags; | 535 | unsigned long flags; |
536 | struct tty_struct *tty; | 536 | struct tty_struct *tty; |
537 | struct board_chan *bc; | 537 | struct board_chan __iomem *bc; |
538 | 538 | ||
539 | if (!(ch->asyncflags & ASYNC_INITIALIZED)) | 539 | if (!(ch->asyncflags & ASYNC_INITIALIZED)) |
540 | return; | 540 | return; |
@@ -618,7 +618,7 @@ static int pc_write(struct tty_struct * tty, | |||
618 | struct channel *ch; | 618 | struct channel *ch; |
619 | unsigned long flags; | 619 | unsigned long flags; |
620 | int remain; | 620 | int remain; |
621 | struct board_chan *bc; | 621 | struct board_chan __iomem *bc; |
622 | 622 | ||
623 | /* ---------------------------------------------------------------- | 623 | /* ---------------------------------------------------------------- |
624 | pc_write is primarily called directly by the kernel routine | 624 | pc_write is primarily called directly by the kernel routine |
@@ -685,7 +685,7 @@ static int pc_write(struct tty_struct * tty, | |||
685 | ------------------------------------------------------------------- */ | 685 | ------------------------------------------------------------------- */ |
686 | 686 | ||
687 | dataLen = min(bytesAvailable, dataLen); | 687 | dataLen = min(bytesAvailable, dataLen); |
688 | memcpy(ch->txptr + head, buf, dataLen); | 688 | memcpy_toio(ch->txptr + head, buf, dataLen); |
689 | buf += dataLen; | 689 | buf += dataLen; |
690 | head += dataLen; | 690 | head += dataLen; |
691 | amountCopied += dataLen; | 691 | amountCopied += dataLen; |
@@ -726,7 +726,7 @@ static int pc_write_room(struct tty_struct *tty) | |||
726 | struct channel *ch; | 726 | struct channel *ch; |
727 | unsigned long flags; | 727 | unsigned long flags; |
728 | unsigned int head, tail; | 728 | unsigned int head, tail; |
729 | struct board_chan *bc; | 729 | struct board_chan __iomem *bc; |
730 | 730 | ||
731 | remain = 0; | 731 | remain = 0; |
732 | 732 | ||
@@ -773,7 +773,7 @@ static int pc_chars_in_buffer(struct tty_struct *tty) | |||
773 | int remain; | 773 | int remain; |
774 | unsigned long flags; | 774 | unsigned long flags; |
775 | struct channel *ch; | 775 | struct channel *ch; |
776 | struct board_chan *bc; | 776 | struct board_chan __iomem *bc; |
777 | 777 | ||
778 | /* --------------------------------------------------------- | 778 | /* --------------------------------------------------------- |
779 | verifyChannel returns the channel from the tty struct | 779 | verifyChannel returns the channel from the tty struct |
@@ -830,7 +830,7 @@ static void pc_flush_buffer(struct tty_struct *tty) | |||
830 | unsigned int tail; | 830 | unsigned int tail; |
831 | unsigned long flags; | 831 | unsigned long flags; |
832 | struct channel *ch; | 832 | struct channel *ch; |
833 | struct board_chan *bc; | 833 | struct board_chan __iomem *bc; |
834 | /* --------------------------------------------------------- | 834 | /* --------------------------------------------------------- |
835 | verifyChannel returns the channel from the tty struct | 835 | verifyChannel returns the channel from the tty struct |
836 | if it is valid. This serves as a sanity check. | 836 | if it is valid. This serves as a sanity check. |
@@ -976,7 +976,7 @@ static int pc_open(struct tty_struct *tty, struct file * filp) | |||
976 | struct channel *ch; | 976 | struct channel *ch; |
977 | unsigned long flags; | 977 | unsigned long flags; |
978 | int line, retval, boardnum; | 978 | int line, retval, boardnum; |
979 | struct board_chan *bc; | 979 | struct board_chan __iomem *bc; |
980 | unsigned int head; | 980 | unsigned int head; |
981 | 981 | ||
982 | line = tty->index; | 982 | line = tty->index; |
@@ -1041,7 +1041,7 @@ static int pc_open(struct tty_struct *tty, struct file * filp) | |||
1041 | ch->statusflags = 0; | 1041 | ch->statusflags = 0; |
1042 | 1042 | ||
1043 | /* Save boards current modem status */ | 1043 | /* Save boards current modem status */ |
1044 | ch->imodem = bc->mstat; | 1044 | ch->imodem = readb(&bc->mstat); |
1045 | 1045 | ||
1046 | /* ---------------------------------------------------------------- | 1046 | /* ---------------------------------------------------------------- |
1047 | Set receive head and tail ptrs to each other. This indicates | 1047 | Set receive head and tail ptrs to each other. This indicates |
@@ -1399,10 +1399,10 @@ static void post_fep_init(unsigned int crd) | |||
1399 | { /* Begin post_fep_init */ | 1399 | { /* Begin post_fep_init */ |
1400 | 1400 | ||
1401 | int i; | 1401 | int i; |
1402 | unsigned char *memaddr; | 1402 | void __iomem *memaddr; |
1403 | struct global_data *gd; | 1403 | struct global_data __iomem *gd; |
1404 | struct board_info *bd; | 1404 | struct board_info *bd; |
1405 | struct board_chan *bc; | 1405 | struct board_chan __iomem *bc; |
1406 | struct channel *ch; | 1406 | struct channel *ch; |
1407 | int shrinkmem = 0, lowwater ; | 1407 | int shrinkmem = 0, lowwater ; |
1408 | 1408 | ||
@@ -1461,7 +1461,7 @@ static void post_fep_init(unsigned int crd) | |||
1461 | 8 and 64 of these structures. | 1461 | 8 and 64 of these structures. |
1462 | -------------------------------------------------------------------- */ | 1462 | -------------------------------------------------------------------- */ |
1463 | 1463 | ||
1464 | bc = (struct board_chan *)(memaddr + CHANSTRUCT); | 1464 | bc = memaddr + CHANSTRUCT; |
1465 | 1465 | ||
1466 | /* ------------------------------------------------------------------- | 1466 | /* ------------------------------------------------------------------- |
1467 | The below assignment will set gd to point at the BEGINING of | 1467 | The below assignment will set gd to point at the BEGINING of |
@@ -1470,7 +1470,7 @@ static void post_fep_init(unsigned int crd) | |||
1470 | pointer begins at 0xd10. | 1470 | pointer begins at 0xd10. |
1471 | ---------------------------------------------------------------------- */ | 1471 | ---------------------------------------------------------------------- */ |
1472 | 1472 | ||
1473 | gd = (struct global_data *)(memaddr + GLOBAL); | 1473 | gd = memaddr + GLOBAL; |
1474 | 1474 | ||
1475 | /* -------------------------------------------------------------------- | 1475 | /* -------------------------------------------------------------------- |
1476 | XEPORTS (address 0xc22) points at the number of channels the | 1476 | XEPORTS (address 0xc22) points at the number of channels the |
@@ -1493,6 +1493,7 @@ static void post_fep_init(unsigned int crd) | |||
1493 | 1493 | ||
1494 | for (i = 0; i < bd->numports; i++, ch++, bc++) { /* Begin for each port */ | 1494 | for (i = 0; i < bd->numports; i++, ch++, bc++) { /* Begin for each port */ |
1495 | unsigned long flags; | 1495 | unsigned long flags; |
1496 | u16 tseg, rseg; | ||
1496 | 1497 | ||
1497 | ch->brdchan = bc; | 1498 | ch->brdchan = bc; |
1498 | ch->mailbox = gd; | 1499 | ch->mailbox = gd; |
@@ -1553,50 +1554,53 @@ static void post_fep_init(unsigned int crd) | |||
1553 | shrinkmem = 0; | 1554 | shrinkmem = 0; |
1554 | } | 1555 | } |
1555 | 1556 | ||
1557 | tseg = readw(&bc->tseg); | ||
1558 | rseg = readw(&bc->rseg); | ||
1559 | |||
1556 | switch (bd->type) { | 1560 | switch (bd->type) { |
1557 | 1561 | ||
1558 | case PCIXEM: | 1562 | case PCIXEM: |
1559 | case PCIXRJ: | 1563 | case PCIXRJ: |
1560 | case PCIXR: | 1564 | case PCIXR: |
1561 | /* Cover all the 2MEG cards */ | 1565 | /* Cover all the 2MEG cards */ |
1562 | ch->txptr = memaddr + (((bc->tseg) << 4) & 0x1fffff); | 1566 | ch->txptr = memaddr + ((tseg << 4) & 0x1fffff); |
1563 | ch->rxptr = memaddr + (((bc->rseg) << 4) & 0x1fffff); | 1567 | ch->rxptr = memaddr + ((rseg << 4) & 0x1fffff); |
1564 | ch->txwin = FEPWIN | ((bc->tseg) >> 11); | 1568 | ch->txwin = FEPWIN | (tseg >> 11); |
1565 | ch->rxwin = FEPWIN | ((bc->rseg) >> 11); | 1569 | ch->rxwin = FEPWIN | (rseg >> 11); |
1566 | break; | 1570 | break; |
1567 | 1571 | ||
1568 | case PCXEM: | 1572 | case PCXEM: |
1569 | case EISAXEM: | 1573 | case EISAXEM: |
1570 | /* Cover all the 32K windowed cards */ | 1574 | /* Cover all the 32K windowed cards */ |
1571 | /* Mask equal to window size - 1 */ | 1575 | /* Mask equal to window size - 1 */ |
1572 | ch->txptr = memaddr + (((bc->tseg) << 4) & 0x7fff); | 1576 | ch->txptr = memaddr + ((tseg << 4) & 0x7fff); |
1573 | ch->rxptr = memaddr + (((bc->rseg) << 4) & 0x7fff); | 1577 | ch->rxptr = memaddr + ((rseg << 4) & 0x7fff); |
1574 | ch->txwin = FEPWIN | ((bc->tseg) >> 11); | 1578 | ch->txwin = FEPWIN | (tseg >> 11); |
1575 | ch->rxwin = FEPWIN | ((bc->rseg) >> 11); | 1579 | ch->rxwin = FEPWIN | (rseg >> 11); |
1576 | break; | 1580 | break; |
1577 | 1581 | ||
1578 | case PCXEVE: | 1582 | case PCXEVE: |
1579 | case PCXE: | 1583 | case PCXE: |
1580 | ch->txptr = memaddr + (((bc->tseg - bd->memory_seg) << 4) & 0x1fff); | 1584 | ch->txptr = memaddr + (((tseg - bd->memory_seg) << 4) & 0x1fff); |
1581 | ch->txwin = FEPWIN | ((bc->tseg - bd->memory_seg) >> 9); | 1585 | ch->txwin = FEPWIN | ((tseg - bd->memory_seg) >> 9); |
1582 | ch->rxptr = memaddr + (((bc->rseg - bd->memory_seg) << 4) & 0x1fff); | 1586 | ch->rxptr = memaddr + (((rseg - bd->memory_seg) << 4) & 0x1fff); |
1583 | ch->rxwin = FEPWIN | ((bc->rseg - bd->memory_seg) >>9 ); | 1587 | ch->rxwin = FEPWIN | ((rseg - bd->memory_seg) >>9 ); |
1584 | break; | 1588 | break; |
1585 | 1589 | ||
1586 | case PCXI: | 1590 | case PCXI: |
1587 | case PC64XE: | 1591 | case PC64XE: |
1588 | ch->txptr = memaddr + ((bc->tseg - bd->memory_seg) << 4); | 1592 | ch->txptr = memaddr + ((tseg - bd->memory_seg) << 4); |
1589 | ch->rxptr = memaddr + ((bc->rseg - bd->memory_seg) << 4); | 1593 | ch->rxptr = memaddr + ((rseg - bd->memory_seg) << 4); |
1590 | ch->txwin = ch->rxwin = 0; | 1594 | ch->txwin = ch->rxwin = 0; |
1591 | break; | 1595 | break; |
1592 | 1596 | ||
1593 | } /* End switch bd->type */ | 1597 | } /* End switch bd->type */ |
1594 | 1598 | ||
1595 | ch->txbufhead = 0; | 1599 | ch->txbufhead = 0; |
1596 | ch->txbufsize = bc->tmax + 1; | 1600 | ch->txbufsize = readw(&bc->tmax) + 1; |
1597 | 1601 | ||
1598 | ch->rxbufhead = 0; | 1602 | ch->rxbufhead = 0; |
1599 | ch->rxbufsize = bc->rmax + 1; | 1603 | ch->rxbufsize = readw(&bc->rmax) + 1; |
1600 | 1604 | ||
1601 | lowwater = ch->txbufsize >= 2000 ? 1024 : (ch->txbufsize / 2); | 1605 | lowwater = ch->txbufsize >= 2000 ? 1024 : (ch->txbufsize / 2); |
1602 | 1606 | ||
@@ -1718,11 +1722,11 @@ static void epcapoll(unsigned long ignored) | |||
1718 | static void doevent(int crd) | 1722 | static void doevent(int crd) |
1719 | { /* Begin doevent */ | 1723 | { /* Begin doevent */ |
1720 | 1724 | ||
1721 | void *eventbuf; | 1725 | void __iomem *eventbuf; |
1722 | struct channel *ch, *chan0; | 1726 | struct channel *ch, *chan0; |
1723 | static struct tty_struct *tty; | 1727 | static struct tty_struct *tty; |
1724 | struct board_info *bd; | 1728 | struct board_info *bd; |
1725 | struct board_chan *bc; | 1729 | struct board_chan __iomem *bc; |
1726 | unsigned int tail, head; | 1730 | unsigned int tail, head; |
1727 | int event, channel; | 1731 | int event, channel; |
1728 | int mstat, lstat; | 1732 | int mstat, lstat; |
@@ -1817,7 +1821,7 @@ static void doevent(int crd) | |||
1817 | static void fepcmd(struct channel *ch, int cmd, int word_or_byte, | 1821 | static void fepcmd(struct channel *ch, int cmd, int word_or_byte, |
1818 | int byte2, int ncmds, int bytecmd) | 1822 | int byte2, int ncmds, int bytecmd) |
1819 | { /* Begin fepcmd */ | 1823 | { /* Begin fepcmd */ |
1820 | unchar *memaddr; | 1824 | unchar __iomem *memaddr; |
1821 | unsigned int head, cmdTail, cmdStart, cmdMax; | 1825 | unsigned int head, cmdTail, cmdStart, cmdMax; |
1822 | long count; | 1826 | long count; |
1823 | int n; | 1827 | int n; |
@@ -2000,7 +2004,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) | |||
2000 | 2004 | ||
2001 | unsigned int cmdHead; | 2005 | unsigned int cmdHead; |
2002 | struct termios *ts; | 2006 | struct termios *ts; |
2003 | struct board_chan *bc; | 2007 | struct board_chan __iomem *bc; |
2004 | unsigned mval, hflow, cflag, iflag; | 2008 | unsigned mval, hflow, cflag, iflag; |
2005 | 2009 | ||
2006 | bc = ch->brdchan; | 2010 | bc = ch->brdchan; |
@@ -2010,7 +2014,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) | |||
2010 | ts = tty->termios; | 2014 | ts = tty->termios; |
2011 | if ((ts->c_cflag & CBAUD) == 0) { /* Begin CBAUD detected */ | 2015 | if ((ts->c_cflag & CBAUD) == 0) { /* Begin CBAUD detected */ |
2012 | cmdHead = readw(&bc->rin); | 2016 | cmdHead = readw(&bc->rin); |
2013 | bc->rout = cmdHead; | 2017 | writew(cmdHead, &bc->rout); |
2014 | cmdHead = readw(&bc->tin); | 2018 | cmdHead = readw(&bc->tin); |
2015 | /* Changing baud in mid-stream transmission can be wonderful */ | 2019 | /* Changing baud in mid-stream transmission can be wonderful */ |
2016 | /* --------------------------------------------------------------- | 2020 | /* --------------------------------------------------------------- |
@@ -2116,7 +2120,7 @@ static void receive_data(struct channel *ch) | |||
2116 | unchar *rptr; | 2120 | unchar *rptr; |
2117 | struct termios *ts = NULL; | 2121 | struct termios *ts = NULL; |
2118 | struct tty_struct *tty; | 2122 | struct tty_struct *tty; |
2119 | struct board_chan *bc; | 2123 | struct board_chan __iomem *bc; |
2120 | int dataToRead, wrapgap, bytesAvailable; | 2124 | int dataToRead, wrapgap, bytesAvailable; |
2121 | unsigned int tail, head; | 2125 | unsigned int tail, head; |
2122 | unsigned int wrapmask; | 2126 | unsigned int wrapmask; |
@@ -2154,7 +2158,7 @@ static void receive_data(struct channel *ch) | |||
2154 | --------------------------------------------------------------------- */ | 2158 | --------------------------------------------------------------------- */ |
2155 | 2159 | ||
2156 | if (!tty || !ts || !(ts->c_cflag & CREAD)) { | 2160 | if (!tty || !ts || !(ts->c_cflag & CREAD)) { |
2157 | bc->rout = head; | 2161 | writew(head, &bc->rout); |
2158 | return; | 2162 | return; |
2159 | } | 2163 | } |
2160 | 2164 | ||
@@ -2270,7 +2274,7 @@ static int info_ioctl(struct tty_struct *tty, struct file * file, | |||
2270 | static int pc_tiocmget(struct tty_struct *tty, struct file *file) | 2274 | static int pc_tiocmget(struct tty_struct *tty, struct file *file) |
2271 | { | 2275 | { |
2272 | struct channel *ch = (struct channel *) tty->driver_data; | 2276 | struct channel *ch = (struct channel *) tty->driver_data; |
2273 | struct board_chan *bc; | 2277 | struct board_chan __iomem *bc; |
2274 | unsigned int mstat, mflag = 0; | 2278 | unsigned int mstat, mflag = 0; |
2275 | unsigned long flags; | 2279 | unsigned long flags; |
2276 | 2280 | ||
@@ -2351,7 +2355,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file, | |||
2351 | unsigned long flags; | 2355 | unsigned long flags; |
2352 | unsigned int mflag, mstat; | 2356 | unsigned int mflag, mstat; |
2353 | unsigned char startc, stopc; | 2357 | unsigned char startc, stopc; |
2354 | struct board_chan *bc; | 2358 | struct board_chan __iomem *bc; |
2355 | struct channel *ch = (struct channel *) tty->driver_data; | 2359 | struct channel *ch = (struct channel *) tty->driver_data; |
2356 | void __user *argp = (void __user *)arg; | 2360 | void __user *argp = (void __user *)arg; |
2357 | 2361 | ||
@@ -2633,7 +2637,7 @@ static void pc_start(struct tty_struct *tty) | |||
2633 | spin_lock_irqsave(&epca_lock, flags); | 2637 | spin_lock_irqsave(&epca_lock, flags); |
2634 | /* Just in case output was resumed because of a change in Digi-flow */ | 2638 | /* Just in case output was resumed because of a change in Digi-flow */ |
2635 | if (ch->statusflags & TXSTOPPED) { /* Begin transmit resume requested */ | 2639 | if (ch->statusflags & TXSTOPPED) { /* Begin transmit resume requested */ |
2636 | struct board_chan *bc; | 2640 | struct board_chan __iomem *bc; |
2637 | globalwinon(ch); | 2641 | globalwinon(ch); |
2638 | bc = ch->brdchan; | 2642 | bc = ch->brdchan; |
2639 | if (ch->statusflags & LOWWAIT) | 2643 | if (ch->statusflags & LOWWAIT) |
@@ -2727,7 +2731,7 @@ void digi_send_break(struct channel *ch, int msec) | |||
2727 | static void setup_empty_event(struct tty_struct *tty, struct channel *ch) | 2731 | static void setup_empty_event(struct tty_struct *tty, struct channel *ch) |
2728 | { /* Begin setup_empty_event */ | 2732 | { /* Begin setup_empty_event */ |
2729 | 2733 | ||
2730 | struct board_chan *bc = ch->brdchan; | 2734 | struct board_chan __iomem *bc = ch->brdchan; |
2731 | 2735 | ||
2732 | globalwinon(ch); | 2736 | globalwinon(ch); |
2733 | ch->statusflags |= EMPTYWAIT; | 2737 | ch->statusflags |= EMPTYWAIT; |
diff --git a/drivers/char/epca.h b/drivers/char/epca.h index 20eeb5a70e1a..456d6c8f94a8 100644 --- a/drivers/char/epca.h +++ b/drivers/char/epca.h | |||
@@ -128,17 +128,17 @@ struct channel | |||
128 | unsigned long c_cflag; | 128 | unsigned long c_cflag; |
129 | unsigned long c_lflag; | 129 | unsigned long c_lflag; |
130 | unsigned long c_oflag; | 130 | unsigned long c_oflag; |
131 | unsigned char *txptr; | 131 | unsigned char __iomem *txptr; |
132 | unsigned char *rxptr; | 132 | unsigned char __iomem *rxptr; |
133 | unsigned char *tmp_buf; | 133 | unsigned char *tmp_buf; |
134 | struct board_info *board; | 134 | struct board_info *board; |
135 | struct board_chan *brdchan; | 135 | struct board_chan __iomem *brdchan; |
136 | struct digi_struct digiext; | 136 | struct digi_struct digiext; |
137 | struct tty_struct *tty; | 137 | struct tty_struct *tty; |
138 | wait_queue_head_t open_wait; | 138 | wait_queue_head_t open_wait; |
139 | wait_queue_head_t close_wait; | 139 | wait_queue_head_t close_wait; |
140 | struct work_struct tqueue; | 140 | struct work_struct tqueue; |
141 | struct global_data *mailbox; | 141 | struct global_data __iomem *mailbox; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | struct board_info | 144 | struct board_info |
@@ -149,8 +149,8 @@ struct board_info | |||
149 | unsigned short numports; | 149 | unsigned short numports; |
150 | unsigned long port; | 150 | unsigned long port; |
151 | unsigned long membase; | 151 | unsigned long membase; |
152 | unsigned char __iomem *re_map_port; | 152 | void __iomem *re_map_port; |
153 | unsigned char *re_map_membase; | 153 | void __iomem *re_map_membase; |
154 | unsigned long memory_seg; | 154 | unsigned long memory_seg; |
155 | void ( * memwinon ) (struct board_info *, unsigned int) ; | 155 | void ( * memwinon ) (struct board_info *, unsigned int) ; |
156 | void ( * memwinoff ) (struct board_info *, unsigned int) ; | 156 | void ( * memwinoff ) (struct board_info *, unsigned int) ; |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index de0379b6d502..c055bb630ffc 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -273,7 +273,6 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma) | |||
273 | 273 | ||
274 | vma->vm_flags |= VM_IO; | 274 | vma->vm_flags |= VM_IO; |
275 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 275 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
276 | addr = __pa(addr); | ||
277 | 276 | ||
278 | if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT, | 277 | if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT, |
279 | PAGE_SIZE, vma->vm_page_prot)) { | 278 | PAGE_SIZE, vma->vm_page_prot)) { |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 463351d4f942..32fa82c78c73 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -2620,7 +2620,7 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, | |||
2620 | spin_lock_irqsave(&(intf->waiting_msgs_lock), flags); | 2620 | spin_lock_irqsave(&(intf->waiting_msgs_lock), flags); |
2621 | if (!list_empty(&(intf->waiting_msgs))) { | 2621 | if (!list_empty(&(intf->waiting_msgs))) { |
2622 | list_add_tail(&(msg->link), &(intf->waiting_msgs)); | 2622 | list_add_tail(&(msg->link), &(intf->waiting_msgs)); |
2623 | spin_unlock(&(intf->waiting_msgs_lock)); | 2623 | spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags); |
2624 | goto out_unlock; | 2624 | goto out_unlock; |
2625 | } | 2625 | } |
2626 | spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags); | 2626 | spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags); |
@@ -2629,9 +2629,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf, | |||
2629 | if (rv > 0) { | 2629 | if (rv > 0) { |
2630 | /* Could not handle the message now, just add it to a | 2630 | /* Could not handle the message now, just add it to a |
2631 | list to handle later. */ | 2631 | list to handle later. */ |
2632 | spin_lock(&(intf->waiting_msgs_lock)); | 2632 | spin_lock_irqsave(&(intf->waiting_msgs_lock), flags); |
2633 | list_add_tail(&(msg->link), &(intf->waiting_msgs)); | 2633 | list_add_tail(&(msg->link), &(intf->waiting_msgs)); |
2634 | spin_unlock(&(intf->waiting_msgs_lock)); | 2634 | spin_unlock_irqrestore(&(intf->waiting_msgs_lock), flags); |
2635 | } else if (rv == 0) { | 2635 | } else if (rv == 0) { |
2636 | ipmi_free_smi_msg(msg); | 2636 | ipmi_free_smi_msg(msg); |
2637 | } | 2637 | } |
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index e82a96ba396b..f66947722e12 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c | |||
@@ -55,7 +55,7 @@ extern void (*pm_power_off)(void); | |||
55 | static int poweroff_powercycle; | 55 | static int poweroff_powercycle; |
56 | 56 | ||
57 | /* parameter definition to allow user to flag power cycle */ | 57 | /* parameter definition to allow user to flag power cycle */ |
58 | module_param(poweroff_powercycle, int, 0); | 58 | module_param(poweroff_powercycle, int, 0644); |
59 | MODULE_PARM_DESC(poweroff_powercycles, " Set to non-zero to enable power cycle instead of power down. Power cycle is contingent on hardware support, otherwise it defaults back to power down."); | 59 | MODULE_PARM_DESC(poweroff_powercycles, " Set to non-zero to enable power cycle instead of power down. Power cycle is contingent on hardware support, otherwise it defaults back to power down."); |
60 | 60 | ||
61 | /* Stuff from the get device id command. */ | 61 | /* Stuff from the get device id command. */ |
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 3fa64c631108..c268ee04b2aa 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -830,6 +830,9 @@ static int __init mbcs_init(void) | |||
830 | { | 830 | { |
831 | int rv; | 831 | int rv; |
832 | 832 | ||
833 | if (!ia64_platform_is("sn2")) | ||
834 | return -ENODEV; | ||
835 | |||
833 | // Put driver into chrdevs[]. Get major number. | 836 | // Put driver into chrdevs[]. Get major number. |
834 | rv = register_chrdev(mbcs_major, DEVICE_NAME, &mbcs_ops); | 837 | rv = register_chrdev(mbcs_major, DEVICE_NAME, &mbcs_ops); |
835 | if (rv < 0) { | 838 | if (rv < 0) { |
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index 2291a87e8ada..853c98cee64f 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c | |||
@@ -229,8 +229,8 @@ static int __init r3964_init(void) | |||
229 | TRACE_L("line discipline %d registered", N_R3964); | 229 | TRACE_L("line discipline %d registered", N_R3964); |
230 | TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags, | 230 | TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags, |
231 | tty_ldisc_N_R3964.num); | 231 | tty_ldisc_N_R3964.num); |
232 | TRACE_L("open=%x", (int)tty_ldisc_N_R3964.open); | 232 | TRACE_L("open=%p", tty_ldisc_N_R3964.open); |
233 | TRACE_L("tty_ldisc_N_R3964 = %x", (int)&tty_ldisc_N_R3964); | 233 | TRACE_L("tty_ldisc_N_R3964 = %p", &tty_ldisc_N_R3964); |
234 | } | 234 | } |
235 | else | 235 | else |
236 | { | 236 | { |
@@ -267,8 +267,8 @@ static void add_tx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH | |||
267 | 267 | ||
268 | spin_unlock_irqrestore(&pInfo->lock, flags); | 268 | spin_unlock_irqrestore(&pInfo->lock, flags); |
269 | 269 | ||
270 | TRACE_Q("add_tx_queue %x, length %d, tx_first = %x", | 270 | TRACE_Q("add_tx_queue %p, length %d, tx_first = %p", |
271 | (int)pHeader, pHeader->length, (int)pInfo->tx_first ); | 271 | pHeader, pHeader->length, pInfo->tx_first ); |
272 | } | 272 | } |
273 | 273 | ||
274 | static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | 274 | static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) |
@@ -285,10 +285,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | |||
285 | return; | 285 | return; |
286 | 286 | ||
287 | #ifdef DEBUG_QUEUE | 287 | #ifdef DEBUG_QUEUE |
288 | printk("r3964: remove_from_tx_queue: %x, length %d - ", | 288 | printk("r3964: remove_from_tx_queue: %p, length %u - ", |
289 | (int)pHeader, (int)pHeader->length ); | 289 | pHeader, pHeader->length ); |
290 | for(pDump=pHeader;pDump;pDump=pDump->next) | 290 | for(pDump=pHeader;pDump;pDump=pDump->next) |
291 | printk("%x ", (int)pDump); | 291 | printk("%p ", pDump); |
292 | printk("\n"); | 292 | printk("\n"); |
293 | #endif | 293 | #endif |
294 | 294 | ||
@@ -319,10 +319,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | |||
319 | spin_unlock_irqrestore(&pInfo->lock, flags); | 319 | spin_unlock_irqrestore(&pInfo->lock, flags); |
320 | 320 | ||
321 | kfree(pHeader); | 321 | kfree(pHeader); |
322 | TRACE_M("remove_from_tx_queue - kfree %x",(int)pHeader); | 322 | TRACE_M("remove_from_tx_queue - kfree %p",pHeader); |
323 | 323 | ||
324 | TRACE_Q("remove_from_tx_queue: tx_first = %x, tx_last = %x", | 324 | TRACE_Q("remove_from_tx_queue: tx_first = %p, tx_last = %p", |
325 | (int)pInfo->tx_first, (int)pInfo->tx_last ); | 325 | pInfo->tx_first, pInfo->tx_last ); |
326 | } | 326 | } |
327 | 327 | ||
328 | static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader) | 328 | static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader) |
@@ -346,9 +346,9 @@ static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH | |||
346 | 346 | ||
347 | spin_unlock_irqrestore(&pInfo->lock, flags); | 347 | spin_unlock_irqrestore(&pInfo->lock, flags); |
348 | 348 | ||
349 | TRACE_Q("add_rx_queue: %x, length = %d, rx_first = %x, count = %d", | 349 | TRACE_Q("add_rx_queue: %p, length = %d, rx_first = %p, count = %d", |
350 | (int)pHeader, pHeader->length, | 350 | pHeader, pHeader->length, |
351 | (int)pInfo->rx_first, pInfo->blocks_in_rx_queue); | 351 | pInfo->rx_first, pInfo->blocks_in_rx_queue); |
352 | } | 352 | } |
353 | 353 | ||
354 | static void remove_from_rx_queue(struct r3964_info *pInfo, | 354 | static void remove_from_rx_queue(struct r3964_info *pInfo, |
@@ -360,10 +360,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo, | |||
360 | if(pHeader==NULL) | 360 | if(pHeader==NULL) |
361 | return; | 361 | return; |
362 | 362 | ||
363 | TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", | 363 | TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d", |
364 | (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); | 364 | pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue ); |
365 | TRACE_Q("remove_from_rx_queue: %x, length %d", | 365 | TRACE_Q("remove_from_rx_queue: %p, length %u", |
366 | (int)pHeader, (int)pHeader->length ); | 366 | pHeader, pHeader->length ); |
367 | 367 | ||
368 | spin_lock_irqsave(&pInfo->lock, flags); | 368 | spin_lock_irqsave(&pInfo->lock, flags); |
369 | 369 | ||
@@ -401,10 +401,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo, | |||
401 | spin_unlock_irqrestore(&pInfo->lock, flags); | 401 | spin_unlock_irqrestore(&pInfo->lock, flags); |
402 | 402 | ||
403 | kfree(pHeader); | 403 | kfree(pHeader); |
404 | TRACE_M("remove_from_rx_queue - kfree %x",(int)pHeader); | 404 | TRACE_M("remove_from_rx_queue - kfree %p",pHeader); |
405 | 405 | ||
406 | TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", | 406 | TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d", |
407 | (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); | 407 | pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue ); |
408 | } | 408 | } |
409 | 409 | ||
410 | static void put_char(struct r3964_info *pInfo, unsigned char ch) | 410 | static void put_char(struct r3964_info *pInfo, unsigned char ch) |
@@ -506,8 +506,8 @@ static void transmit_block(struct r3964_info *pInfo) | |||
506 | if(tty->driver->write_room) | 506 | if(tty->driver->write_room) |
507 | room=tty->driver->write_room(tty); | 507 | room=tty->driver->write_room(tty); |
508 | 508 | ||
509 | TRACE_PS("transmit_block %x, room %d, length %d", | 509 | TRACE_PS("transmit_block %p, room %d, length %d", |
510 | (int)pBlock, room, pBlock->length); | 510 | pBlock, room, pBlock->length); |
511 | 511 | ||
512 | while(pInfo->tx_position < pBlock->length) | 512 | while(pInfo->tx_position < pBlock->length) |
513 | { | 513 | { |
@@ -588,7 +588,7 @@ static void on_receive_block(struct r3964_info *pInfo) | |||
588 | 588 | ||
589 | /* prepare struct r3964_block_header: */ | 589 | /* prepare struct r3964_block_header: */ |
590 | pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL); | 590 | pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL); |
591 | TRACE_M("on_receive_block - kmalloc %x",(int)pBlock); | 591 | TRACE_M("on_receive_block - kmalloc %p",pBlock); |
592 | 592 | ||
593 | if(pBlock==NULL) | 593 | if(pBlock==NULL) |
594 | return; | 594 | return; |
@@ -695,7 +695,7 @@ static void receive_char(struct r3964_info *pInfo, const unsigned char c) | |||
695 | { | 695 | { |
696 | TRACE_PE("IDLE - got STX but no space in rx_queue!"); | 696 | TRACE_PE("IDLE - got STX but no space in rx_queue!"); |
697 | pInfo->state=R3964_WAIT_FOR_RX_BUF; | 697 | pInfo->state=R3964_WAIT_FOR_RX_BUF; |
698 | mod_timer(&pInfo->tmr, R3964_TO_NO_BUF); | 698 | mod_timer(&pInfo->tmr, jiffies + R3964_TO_NO_BUF); |
699 | break; | 699 | break; |
700 | } | 700 | } |
701 | start_receiving: | 701 | start_receiving: |
@@ -705,7 +705,7 @@ start_receiving: | |||
705 | pInfo->last_rx = 0; | 705 | pInfo->last_rx = 0; |
706 | pInfo->flags &= ~R3964_ERROR; | 706 | pInfo->flags &= ~R3964_ERROR; |
707 | pInfo->state=R3964_RECEIVING; | 707 | pInfo->state=R3964_RECEIVING; |
708 | mod_timer(&pInfo->tmr, R3964_TO_ZVZ); | 708 | mod_timer(&pInfo->tmr, jiffies + R3964_TO_ZVZ); |
709 | pInfo->nRetry = 0; | 709 | pInfo->nRetry = 0; |
710 | put_char(pInfo, DLE); | 710 | put_char(pInfo, DLE); |
711 | flush(pInfo); | 711 | flush(pInfo); |
@@ -732,7 +732,7 @@ start_receiving: | |||
732 | if(pInfo->flags & R3964_BCC) | 732 | if(pInfo->flags & R3964_BCC) |
733 | { | 733 | { |
734 | pInfo->state = R3964_WAIT_FOR_BCC; | 734 | pInfo->state = R3964_WAIT_FOR_BCC; |
735 | mod_timer(&pInfo->tmr, R3964_TO_ZVZ); | 735 | mod_timer(&pInfo->tmr, jiffies + R3964_TO_ZVZ); |
736 | } | 736 | } |
737 | else | 737 | else |
738 | { | 738 | { |
@@ -744,7 +744,7 @@ start_receiving: | |||
744 | pInfo->last_rx = c; | 744 | pInfo->last_rx = c; |
745 | char_to_buf: | 745 | char_to_buf: |
746 | pInfo->rx_buf[pInfo->rx_position++] = c; | 746 | pInfo->rx_buf[pInfo->rx_position++] = c; |
747 | mod_timer(&pInfo->tmr, R3964_TO_ZVZ); | 747 | mod_timer(&pInfo->tmr, jiffies + R3964_TO_ZVZ); |
748 | } | 748 | } |
749 | } | 749 | } |
750 | /* else: overflow-msg? BUF_SIZE>MTU; should not happen? */ | 750 | /* else: overflow-msg? BUF_SIZE>MTU; should not happen? */ |
@@ -868,11 +868,11 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg) | |||
868 | if(pMsg) | 868 | if(pMsg) |
869 | { | 869 | { |
870 | kfree(pMsg); | 870 | kfree(pMsg); |
871 | TRACE_M("enable_signals - msg kfree %x",(int)pMsg); | 871 | TRACE_M("enable_signals - msg kfree %p",pMsg); |
872 | } | 872 | } |
873 | } | 873 | } |
874 | kfree(pClient); | 874 | kfree(pClient); |
875 | TRACE_M("enable_signals - kfree %x",(int)pClient); | 875 | TRACE_M("enable_signals - kfree %p",pClient); |
876 | return 0; | 876 | return 0; |
877 | } | 877 | } |
878 | } | 878 | } |
@@ -890,7 +890,7 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg) | |||
890 | { | 890 | { |
891 | /* add client to client list */ | 891 | /* add client to client list */ |
892 | pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL); | 892 | pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL); |
893 | TRACE_M("enable_signals - kmalloc %x",(int)pClient); | 893 | TRACE_M("enable_signals - kmalloc %p",pClient); |
894 | if(pClient==NULL) | 894 | if(pClient==NULL) |
895 | return -ENOMEM; | 895 | return -ENOMEM; |
896 | 896 | ||
@@ -954,7 +954,7 @@ static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg, | |||
954 | queue_the_message: | 954 | queue_the_message: |
955 | 955 | ||
956 | pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); | 956 | pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); |
957 | TRACE_M("add_msg - kmalloc %x",(int)pMsg); | 957 | TRACE_M("add_msg - kmalloc %p",pMsg); |
958 | if(pMsg==NULL) { | 958 | if(pMsg==NULL) { |
959 | return; | 959 | return; |
960 | } | 960 | } |
@@ -1067,11 +1067,11 @@ static int r3964_open(struct tty_struct *tty) | |||
1067 | struct r3964_info *pInfo; | 1067 | struct r3964_info *pInfo; |
1068 | 1068 | ||
1069 | TRACE_L("open"); | 1069 | TRACE_L("open"); |
1070 | TRACE_L("tty=%x, PID=%d, disc_data=%x", | 1070 | TRACE_L("tty=%p, PID=%d, disc_data=%p", |
1071 | (int)tty, current->pid, (int)tty->disc_data); | 1071 | tty, current->pid, tty->disc_data); |
1072 | 1072 | ||
1073 | pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL); | 1073 | pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL); |
1074 | TRACE_M("r3964_open - info kmalloc %x",(int)pInfo); | 1074 | TRACE_M("r3964_open - info kmalloc %p",pInfo); |
1075 | 1075 | ||
1076 | if(!pInfo) | 1076 | if(!pInfo) |
1077 | { | 1077 | { |
@@ -1080,26 +1080,26 @@ static int r3964_open(struct tty_struct *tty) | |||
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL); | 1082 | pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL); |
1083 | TRACE_M("r3964_open - rx_buf kmalloc %x",(int)pInfo->rx_buf); | 1083 | TRACE_M("r3964_open - rx_buf kmalloc %p",pInfo->rx_buf); |
1084 | 1084 | ||
1085 | if(!pInfo->rx_buf) | 1085 | if(!pInfo->rx_buf) |
1086 | { | 1086 | { |
1087 | printk(KERN_ERR "r3964: failed to alloc receive buffer\n"); | 1087 | printk(KERN_ERR "r3964: failed to alloc receive buffer\n"); |
1088 | kfree(pInfo); | 1088 | kfree(pInfo); |
1089 | TRACE_M("r3964_open - info kfree %x",(int)pInfo); | 1089 | TRACE_M("r3964_open - info kfree %p",pInfo); |
1090 | return -ENOMEM; | 1090 | return -ENOMEM; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL); | 1093 | pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL); |
1094 | TRACE_M("r3964_open - tx_buf kmalloc %x",(int)pInfo->tx_buf); | 1094 | TRACE_M("r3964_open - tx_buf kmalloc %p",pInfo->tx_buf); |
1095 | 1095 | ||
1096 | if(!pInfo->tx_buf) | 1096 | if(!pInfo->tx_buf) |
1097 | { | 1097 | { |
1098 | printk(KERN_ERR "r3964: failed to alloc transmit buffer\n"); | 1098 | printk(KERN_ERR "r3964: failed to alloc transmit buffer\n"); |
1099 | kfree(pInfo->rx_buf); | 1099 | kfree(pInfo->rx_buf); |
1100 | TRACE_M("r3964_open - rx_buf kfree %x",(int)pInfo->rx_buf); | 1100 | TRACE_M("r3964_open - rx_buf kfree %p",pInfo->rx_buf); |
1101 | kfree(pInfo); | 1101 | kfree(pInfo); |
1102 | TRACE_M("r3964_open - info kfree %x",(int)pInfo); | 1102 | TRACE_M("r3964_open - info kfree %p",pInfo); |
1103 | return -ENOMEM; | 1103 | return -ENOMEM; |
1104 | } | 1104 | } |
1105 | 1105 | ||
@@ -1154,11 +1154,11 @@ static void r3964_close(struct tty_struct *tty) | |||
1154 | if(pMsg) | 1154 | if(pMsg) |
1155 | { | 1155 | { |
1156 | kfree(pMsg); | 1156 | kfree(pMsg); |
1157 | TRACE_M("r3964_close - msg kfree %x",(int)pMsg); | 1157 | TRACE_M("r3964_close - msg kfree %p",pMsg); |
1158 | } | 1158 | } |
1159 | } | 1159 | } |
1160 | kfree(pClient); | 1160 | kfree(pClient); |
1161 | TRACE_M("r3964_close - client kfree %x",(int)pClient); | 1161 | TRACE_M("r3964_close - client kfree %p",pClient); |
1162 | pClient=pNext; | 1162 | pClient=pNext; |
1163 | } | 1163 | } |
1164 | /* Remove jobs from tx_queue: */ | 1164 | /* Remove jobs from tx_queue: */ |
@@ -1177,11 +1177,11 @@ static void r3964_close(struct tty_struct *tty) | |||
1177 | /* Free buffers: */ | 1177 | /* Free buffers: */ |
1178 | wake_up_interruptible(&pInfo->read_wait); | 1178 | wake_up_interruptible(&pInfo->read_wait); |
1179 | kfree(pInfo->rx_buf); | 1179 | kfree(pInfo->rx_buf); |
1180 | TRACE_M("r3964_close - rx_buf kfree %x",(int)pInfo->rx_buf); | 1180 | TRACE_M("r3964_close - rx_buf kfree %p",pInfo->rx_buf); |
1181 | kfree(pInfo->tx_buf); | 1181 | kfree(pInfo->tx_buf); |
1182 | TRACE_M("r3964_close - tx_buf kfree %x",(int)pInfo->tx_buf); | 1182 | TRACE_M("r3964_close - tx_buf kfree %p",pInfo->tx_buf); |
1183 | kfree(pInfo); | 1183 | kfree(pInfo); |
1184 | TRACE_M("r3964_close - info kfree %x",(int)pInfo); | 1184 | TRACE_M("r3964_close - info kfree %p",pInfo); |
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | static ssize_t r3964_read(struct tty_struct *tty, struct file *file, | 1187 | static ssize_t r3964_read(struct tty_struct *tty, struct file *file, |
@@ -1234,7 +1234,7 @@ repeat: | |||
1234 | count = sizeof(struct r3964_client_message); | 1234 | count = sizeof(struct r3964_client_message); |
1235 | 1235 | ||
1236 | kfree(pMsg); | 1236 | kfree(pMsg); |
1237 | TRACE_M("r3964_read - msg kfree %x",(int)pMsg); | 1237 | TRACE_M("r3964_read - msg kfree %p",pMsg); |
1238 | 1238 | ||
1239 | if (copy_to_user(buf,&theMsg, count)) | 1239 | if (copy_to_user(buf,&theMsg, count)) |
1240 | return -EFAULT; | 1240 | return -EFAULT; |
@@ -1279,7 +1279,7 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file, | |||
1279 | * Allocate a buffer for the data and copy it from the buffer with header prepended | 1279 | * Allocate a buffer for the data and copy it from the buffer with header prepended |
1280 | */ | 1280 | */ |
1281 | new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL); | 1281 | new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL); |
1282 | TRACE_M("r3964_write - kmalloc %x",(int)new_data); | 1282 | TRACE_M("r3964_write - kmalloc %p",new_data); |
1283 | if (new_data == NULL) { | 1283 | if (new_data == NULL) { |
1284 | if (pInfo->flags & R3964_DEBUG) | 1284 | if (pInfo->flags & R3964_DEBUG) |
1285 | { | 1285 | { |
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index ed867db550a9..e1a90d9a8756 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
@@ -564,6 +564,7 @@ static int s3c2410_rtc_resume(struct device *dev, u32 level) | |||
564 | 564 | ||
565 | static struct device_driver s3c2410_rtcdrv = { | 565 | static struct device_driver s3c2410_rtcdrv = { |
566 | .name = "s3c2410-rtc", | 566 | .name = "s3c2410-rtc", |
567 | .owner = THIS_MODULE, | ||
567 | .bus = &platform_bus_type, | 568 | .bus = &platform_bus_type, |
568 | .probe = s3c2410_rtc_probe, | 569 | .probe = s3c2410_rtc_probe, |
569 | .remove = s3c2410_rtc_remove, | 570 | .remove = s3c2410_rtc_remove, |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1e33cb032e07..e91268e86833 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -810,13 +810,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
810 | * from the top and bottom of cursor position | 810 | * from the top and bottom of cursor position |
811 | */ | 811 | */ |
812 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; | 812 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; |
813 | end = old_origin + new_screen_size; | 813 | end = old_origin + (old_row_size * new_rows); |
814 | } | 814 | } |
815 | } else | 815 | } else |
816 | /* | 816 | /* |
817 | * Cursor near the top, copy contents from the top of buffer | 817 | * Cursor near the top, copy contents from the top of buffer |
818 | */ | 818 | */ |
819 | end = (old_rows > new_rows) ? old_origin + new_screen_size : | 819 | end = (old_rows > new_rows) ? old_origin + |
820 | (old_row_size * new_rows) : | ||
820 | vc->vc_scr_end; | 821 | vc->vc_scr_end; |
821 | 822 | ||
822 | update_attr(vc); | 823 | update_attr(vc); |
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index 1436aea3b28f..6d3ff0836c44 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c | |||
@@ -87,6 +87,8 @@ static int mv64x60_wdt_open(struct inode *inode, struct file *file) | |||
87 | mv64x60_wdt_service(); | 87 | mv64x60_wdt_service(); |
88 | mv64x60_wdt_handler_enable(); | 88 | mv64x60_wdt_handler_enable(); |
89 | 89 | ||
90 | nonseekable_open(inode, file); | ||
91 | |||
90 | return 0; | 92 | return 0; |
91 | } | 93 | } |
92 | 94 | ||
@@ -103,12 +105,9 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file) | |||
103 | return 0; | 105 | return 0; |
104 | } | 106 | } |
105 | 107 | ||
106 | static ssize_t mv64x60_wdt_write(struct file *file, const char *data, | 108 | static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data, |
107 | size_t len, loff_t * ppos) | 109 | size_t len, loff_t * ppos) |
108 | { | 110 | { |
109 | if (*ppos != file->f_pos) | ||
110 | return -ESPIPE; | ||
111 | |||
112 | if (len) | 111 | if (len) |
113 | mv64x60_wdt_service(); | 112 | mv64x60_wdt_service(); |
114 | 113 | ||
@@ -119,6 +118,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
119 | unsigned int cmd, unsigned long arg) | 118 | unsigned int cmd, unsigned long arg) |
120 | { | 119 | { |
121 | int timeout; | 120 | int timeout; |
121 | void __user *argp = (void __user *)arg; | ||
122 | static struct watchdog_info info = { | 122 | static struct watchdog_info info = { |
123 | .options = WDIOF_KEEPALIVEPING, | 123 | .options = WDIOF_KEEPALIVEPING, |
124 | .firmware_version = 0, | 124 | .firmware_version = 0, |
@@ -127,13 +127,13 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
127 | 127 | ||
128 | switch (cmd) { | 128 | switch (cmd) { |
129 | case WDIOC_GETSUPPORT: | 129 | case WDIOC_GETSUPPORT: |
130 | if (copy_to_user((void *)arg, &info, sizeof(info))) | 130 | if (copy_to_user(argp, &info, sizeof(info))) |
131 | return -EFAULT; | 131 | return -EFAULT; |
132 | break; | 132 | break; |
133 | 133 | ||
134 | case WDIOC_GETSTATUS: | 134 | case WDIOC_GETSTATUS: |
135 | case WDIOC_GETBOOTSTATUS: | 135 | case WDIOC_GETBOOTSTATUS: |
136 | if (put_user(wdt_status, (int *)arg)) | 136 | if (put_user(wdt_status, (int __user *)argp)) |
137 | return -EFAULT; | 137 | return -EFAULT; |
138 | wdt_status &= ~WDIOF_KEEPALIVEPING; | 138 | wdt_status &= ~WDIOF_KEEPALIVEPING; |
139 | break; | 139 | break; |
@@ -154,7 +154,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
154 | 154 | ||
155 | case WDIOC_GETTIMEOUT: | 155 | case WDIOC_GETTIMEOUT: |
156 | timeout = mv64x60_wdt_timeout * HZ; | 156 | timeout = mv64x60_wdt_timeout * HZ; |
157 | if (put_user(timeout, (int *)arg)) | 157 | if (put_user(timeout, (int __user *)argp)) |
158 | return -EFAULT; | 158 | return -EFAULT; |
159 | break; | 159 | break; |
160 | 160 | ||
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c index 5a80adbf8032..0b8e493be045 100644 --- a/drivers/char/watchdog/pcwd_pci.c +++ b/drivers/char/watchdog/pcwd_pci.c | |||
@@ -50,8 +50,8 @@ | |||
50 | #include <asm/io.h> /* For inb/outb/... */ | 50 | #include <asm/io.h> /* For inb/outb/... */ |
51 | 51 | ||
52 | /* Module and version information */ | 52 | /* Module and version information */ |
53 | #define WATCHDOG_VERSION "1.01" | 53 | #define WATCHDOG_VERSION "1.02" |
54 | #define WATCHDOG_DATE "02 Sep 2005" | 54 | #define WATCHDOG_DATE "03 Sep 2005" |
55 | #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" | 55 | #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" |
56 | #define WATCHDOG_NAME "pcwd_pci" | 56 | #define WATCHDOG_NAME "pcwd_pci" |
57 | #define PFX WATCHDOG_NAME ": " | 57 | #define PFX WATCHDOG_NAME ": " |
@@ -70,19 +70,30 @@ | |||
70 | * These are the defines that describe the control status bits for the | 70 | * These are the defines that describe the control status bits for the |
71 | * PCI-PC Watchdog card. | 71 | * PCI-PC Watchdog card. |
72 | */ | 72 | */ |
73 | #define WD_PCI_WTRP 0x01 /* Watchdog Trip status */ | 73 | /* Port 1 : Control Status #1 */ |
74 | #define WD_PCI_HRBT 0x02 /* Watchdog Heartbeat */ | 74 | #define WD_PCI_WTRP 0x01 /* Watchdog Trip status */ |
75 | #define WD_PCI_TTRP 0x04 /* Temperature Trip status */ | 75 | #define WD_PCI_HRBT 0x02 /* Watchdog Heartbeat */ |
76 | #define WD_PCI_TTRP 0x04 /* Temperature Trip status */ | ||
77 | #define WD_PCI_RL2A 0x08 /* Relay 2 Active */ | ||
78 | #define WD_PCI_RL1A 0x10 /* Relay 1 Active */ | ||
79 | #define WD_PCI_R2DS 0x40 /* Relay 2 Disable Temperature-trip/reset */ | ||
80 | #define WD_PCI_RLY2 0x80 /* Activate Relay 2 on the board */ | ||
81 | /* Port 2 : Control Status #2 */ | ||
82 | #define WD_PCI_WDIS 0x10 /* Watchdog Disable */ | ||
83 | #define WD_PCI_ENTP 0x20 /* Enable Temperature Trip Reset */ | ||
84 | #define WD_PCI_WRSP 0x40 /* Watchdog wrote response */ | ||
85 | #define WD_PCI_PCMD 0x80 /* PC has sent command */ | ||
76 | 86 | ||
77 | /* according to documentation max. time to process a command for the pci | 87 | /* according to documentation max. time to process a command for the pci |
78 | * watchdog card is 100 ms, so we give it 150 ms to do it's job */ | 88 | * watchdog card is 100 ms, so we give it 150 ms to do it's job */ |
79 | #define PCI_COMMAND_TIMEOUT 150 | 89 | #define PCI_COMMAND_TIMEOUT 150 |
80 | 90 | ||
81 | /* Watchdog's internal commands */ | 91 | /* Watchdog's internal commands */ |
82 | #define CMD_GET_STATUS 0x04 | 92 | #define CMD_GET_STATUS 0x04 |
83 | #define CMD_GET_FIRMWARE_VERSION 0x08 | 93 | #define CMD_GET_FIRMWARE_VERSION 0x08 |
84 | #define CMD_READ_WATCHDOG_TIMEOUT 0x18 | 94 | #define CMD_READ_WATCHDOG_TIMEOUT 0x18 |
85 | #define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 | 95 | #define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 |
96 | #define CMD_GET_CLEAR_RESET_COUNT 0x84 | ||
86 | 97 | ||
87 | /* We can only use 1 card due to the /dev/watchdog restriction */ | 98 | /* We can only use 1 card due to the /dev/watchdog restriction */ |
88 | static int cards_found; | 99 | static int cards_found; |
@@ -91,15 +102,22 @@ static int cards_found; | |||
91 | static int temp_panic; | 102 | static int temp_panic; |
92 | static unsigned long is_active; | 103 | static unsigned long is_active; |
93 | static char expect_release; | 104 | static char expect_release; |
94 | static struct { | 105 | static struct { /* this is private data for each PCI-PC watchdog card */ |
95 | int supports_temp; /* Wether or not the card has a temperature device */ | 106 | int supports_temp; /* Wether or not the card has a temperature device */ |
96 | int boot_status; /* The card's boot status */ | 107 | int boot_status; /* The card's boot status */ |
97 | unsigned long io_addr; /* The cards I/O address */ | 108 | unsigned long io_addr; /* The cards I/O address */ |
98 | spinlock_t io_lock; | 109 | spinlock_t io_lock; /* the lock for io operations */ |
99 | struct pci_dev *pdev; | 110 | struct pci_dev *pdev; /* the PCI-device */ |
100 | } pcipcwd_private; | 111 | } pcipcwd_private; |
101 | 112 | ||
102 | /* module parameters */ | 113 | /* module parameters */ |
114 | #define QUIET 0 /* Default */ | ||
115 | #define VERBOSE 1 /* Verbose */ | ||
116 | #define DEBUG 2 /* print fancy stuff too */ | ||
117 | static int debug = QUIET; | ||
118 | module_param(debug, int, 0); | ||
119 | MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)"); | ||
120 | |||
103 | #define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */ | 121 | #define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */ |
104 | static int heartbeat = WATCHDOG_HEARTBEAT; | 122 | static int heartbeat = WATCHDOG_HEARTBEAT; |
105 | module_param(heartbeat, int, 0); | 123 | module_param(heartbeat, int, 0); |
@@ -117,6 +135,10 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
117 | { | 135 | { |
118 | int got_response, count; | 136 | int got_response, count; |
119 | 137 | ||
138 | if (debug >= DEBUG) | ||
139 | printk(KERN_DEBUG PFX "sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n", | ||
140 | cmd, *msb, *lsb); | ||
141 | |||
120 | spin_lock(&pcipcwd_private.io_lock); | 142 | spin_lock(&pcipcwd_private.io_lock); |
121 | /* If a command requires data it should be written first. | 143 | /* If a command requires data it should be written first. |
122 | * Data for commands with 8 bits of data should be written to port 4. | 144 | * Data for commands with 8 bits of data should be written to port 4. |
@@ -131,10 +153,19 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
131 | /* wait till the pci card processed the command, signaled by | 153 | /* wait till the pci card processed the command, signaled by |
132 | * the WRSP bit in port 2 and give it a max. timeout of | 154 | * the WRSP bit in port 2 and give it a max. timeout of |
133 | * PCI_COMMAND_TIMEOUT to process */ | 155 | * PCI_COMMAND_TIMEOUT to process */ |
134 | got_response = inb_p(pcipcwd_private.io_addr + 2) & 0x40; | 156 | got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP; |
135 | for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) { | 157 | for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) { |
136 | mdelay(1); | 158 | mdelay(1); |
137 | got_response = inb_p(pcipcwd_private.io_addr + 2) & 0x40; | 159 | got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP; |
160 | } | ||
161 | |||
162 | if (debug >= DEBUG) { | ||
163 | if (got_response) { | ||
164 | printk(KERN_DEBUG PFX "time to process command was: %d ms\n", | ||
165 | count); | ||
166 | } else { | ||
167 | printk(KERN_DEBUG PFX "card did not respond on command!\n"); | ||
168 | } | ||
138 | } | 169 | } |
139 | 170 | ||
140 | if (got_response) { | 171 | if (got_response) { |
@@ -144,12 +175,66 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
144 | 175 | ||
145 | /* clear WRSP bit */ | 176 | /* clear WRSP bit */ |
146 | inb_p(pcipcwd_private.io_addr + 6); | 177 | inb_p(pcipcwd_private.io_addr + 6); |
178 | |||
179 | if (debug >= DEBUG) | ||
180 | printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", | ||
181 | cmd, *msb, *lsb); | ||
147 | } | 182 | } |
183 | |||
148 | spin_unlock(&pcipcwd_private.io_lock); | 184 | spin_unlock(&pcipcwd_private.io_lock); |
149 | 185 | ||
150 | return got_response; | 186 | return got_response; |
151 | } | 187 | } |
152 | 188 | ||
189 | static inline void pcipcwd_check_temperature_support(void) | ||
190 | { | ||
191 | if (inb_p(pcipcwd_private.io_addr) != 0xF0) | ||
192 | pcipcwd_private.supports_temp = 1; | ||
193 | } | ||
194 | |||
195 | static int pcipcwd_get_option_switches(void) | ||
196 | { | ||
197 | int option_switches; | ||
198 | |||
199 | option_switches = inb_p(pcipcwd_private.io_addr + 3); | ||
200 | return option_switches; | ||
201 | } | ||
202 | |||
203 | static void pcipcwd_show_card_info(void) | ||
204 | { | ||
205 | int got_fw_rev, fw_rev_major, fw_rev_minor; | ||
206 | char fw_ver_str[20]; /* The cards firmware version */ | ||
207 | int option_switches; | ||
208 | |||
209 | got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); | ||
210 | if (got_fw_rev) { | ||
211 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); | ||
212 | } else { | ||
213 | sprintf(fw_ver_str, "<card no answer>"); | ||
214 | } | ||
215 | |||
216 | /* Get switch settings */ | ||
217 | option_switches = pcipcwd_get_option_switches(); | ||
218 | |||
219 | printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n", | ||
220 | (int) pcipcwd_private.io_addr, fw_ver_str, | ||
221 | (pcipcwd_private.supports_temp ? "with" : "without")); | ||
222 | |||
223 | printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
224 | option_switches, | ||
225 | ((option_switches & 0x10) ? "ON" : "OFF"), | ||
226 | ((option_switches & 0x08) ? "ON" : "OFF")); | ||
227 | |||
228 | if (pcipcwd_private.boot_status & WDIOF_CARDRESET) | ||
229 | printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n"); | ||
230 | |||
231 | if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) | ||
232 | printk(KERN_INFO PFX "Card sensed a CPU Overheat\n"); | ||
233 | |||
234 | if (pcipcwd_private.boot_status == 0) | ||
235 | printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); | ||
236 | } | ||
237 | |||
153 | static int pcipcwd_start(void) | 238 | static int pcipcwd_start(void) |
154 | { | 239 | { |
155 | int stat_reg; | 240 | int stat_reg; |
@@ -161,11 +246,14 @@ static int pcipcwd_start(void) | |||
161 | stat_reg = inb_p(pcipcwd_private.io_addr + 2); | 246 | stat_reg = inb_p(pcipcwd_private.io_addr + 2); |
162 | spin_unlock(&pcipcwd_private.io_lock); | 247 | spin_unlock(&pcipcwd_private.io_lock); |
163 | 248 | ||
164 | if (stat_reg & 0x10) { | 249 | if (stat_reg & WD_PCI_WDIS) { |
165 | printk(KERN_ERR PFX "Card timer not enabled\n"); | 250 | printk(KERN_ERR PFX "Card timer not enabled\n"); |
166 | return -1; | 251 | return -1; |
167 | } | 252 | } |
168 | 253 | ||
254 | if (debug >= VERBOSE) | ||
255 | printk(KERN_DEBUG PFX "Watchdog started\n"); | ||
256 | |||
169 | return 0; | 257 | return 0; |
170 | } | 258 | } |
171 | 259 | ||
@@ -183,18 +271,25 @@ static int pcipcwd_stop(void) | |||
183 | stat_reg = inb_p(pcipcwd_private.io_addr + 2); | 271 | stat_reg = inb_p(pcipcwd_private.io_addr + 2); |
184 | spin_unlock(&pcipcwd_private.io_lock); | 272 | spin_unlock(&pcipcwd_private.io_lock); |
185 | 273 | ||
186 | if (!(stat_reg & 0x10)) { | 274 | if (!(stat_reg & WD_PCI_WDIS)) { |
187 | printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n"); | 275 | printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n"); |
188 | return -1; | 276 | return -1; |
189 | } | 277 | } |
190 | 278 | ||
279 | if (debug >= VERBOSE) | ||
280 | printk(KERN_DEBUG PFX "Watchdog stopped\n"); | ||
281 | |||
191 | return 0; | 282 | return 0; |
192 | } | 283 | } |
193 | 284 | ||
194 | static int pcipcwd_keepalive(void) | 285 | static int pcipcwd_keepalive(void) |
195 | { | 286 | { |
196 | /* Re-trigger watchdog by writing to port 0 */ | 287 | /* Re-trigger watchdog by writing to port 0 */ |
197 | outb_p(0x42, pcipcwd_private.io_addr); | 288 | outb_p(0x42, pcipcwd_private.io_addr); /* send out any data */ |
289 | |||
290 | if (debug >= DEBUG) | ||
291 | printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); | ||
292 | |||
198 | return 0; | 293 | return 0; |
199 | } | 294 | } |
200 | 295 | ||
@@ -210,29 +305,64 @@ static int pcipcwd_set_heartbeat(int t) | |||
210 | send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb); | 305 | send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb); |
211 | 306 | ||
212 | heartbeat = t; | 307 | heartbeat = t; |
308 | if (debug >= VERBOSE) | ||
309 | printk(KERN_DEBUG PFX "New heartbeat: %d\n", | ||
310 | heartbeat); | ||
311 | |||
213 | return 0; | 312 | return 0; |
214 | } | 313 | } |
215 | 314 | ||
216 | static int pcipcwd_get_status(int *status) | 315 | static int pcipcwd_get_status(int *status) |
217 | { | 316 | { |
218 | int new_status; | 317 | int control_status; |
219 | 318 | ||
220 | *status=0; | 319 | *status=0; |
221 | new_status = inb_p(pcipcwd_private.io_addr + 1); | 320 | control_status = inb_p(pcipcwd_private.io_addr + 1); |
222 | if (new_status & WD_PCI_WTRP) | 321 | if (control_status & WD_PCI_WTRP) |
223 | *status |= WDIOF_CARDRESET; | 322 | *status |= WDIOF_CARDRESET; |
224 | if (new_status & WD_PCI_TTRP) { | 323 | if (control_status & WD_PCI_TTRP) { |
225 | *status |= WDIOF_OVERHEAT; | 324 | *status |= WDIOF_OVERHEAT; |
226 | if (temp_panic) | 325 | if (temp_panic) |
227 | panic(PFX "Temperature overheat trip!\n"); | 326 | panic(PFX "Temperature overheat trip!\n"); |
228 | } | 327 | } |
229 | 328 | ||
329 | if (debug >= DEBUG) | ||
330 | printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n", | ||
331 | control_status); | ||
332 | |||
230 | return 0; | 333 | return 0; |
231 | } | 334 | } |
232 | 335 | ||
233 | static int pcipcwd_clear_status(void) | 336 | static int pcipcwd_clear_status(void) |
234 | { | 337 | { |
235 | outb_p(0x01, pcipcwd_private.io_addr + 1); | 338 | int control_status; |
339 | int msb; | ||
340 | int reset_counter; | ||
341 | |||
342 | if (debug >= VERBOSE) | ||
343 | printk(KERN_INFO PFX "clearing watchdog trip status & LED\n"); | ||
344 | |||
345 | control_status = inb_p(pcipcwd_private.io_addr + 1); | ||
346 | |||
347 | if (debug >= DEBUG) { | ||
348 | printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status); | ||
349 | printk(KERN_DEBUG PFX "sending: 0x%02x\n", | ||
350 | (control_status & WD_PCI_R2DS) | WD_PCI_WTRP); | ||
351 | } | ||
352 | |||
353 | /* clear trip status & LED and keep mode of relay 2 */ | ||
354 | outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1); | ||
355 | |||
356 | /* clear reset counter */ | ||
357 | msb=0; | ||
358 | reset_counter=0xff; | ||
359 | send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); | ||
360 | |||
361 | if (debug >= DEBUG) { | ||
362 | printk(KERN_DEBUG PFX "reset count was: 0x%02x\n", | ||
363 | reset_counter); | ||
364 | } | ||
365 | |||
236 | return 0; | 366 | return 0; |
237 | } | 367 | } |
238 | 368 | ||
@@ -242,11 +372,18 @@ static int pcipcwd_get_temperature(int *temperature) | |||
242 | if (!pcipcwd_private.supports_temp) | 372 | if (!pcipcwd_private.supports_temp) |
243 | return -ENODEV; | 373 | return -ENODEV; |
244 | 374 | ||
375 | *temperature = inb_p(pcipcwd_private.io_addr); | ||
376 | |||
245 | /* | 377 | /* |
246 | * Convert celsius to fahrenheit, since this was | 378 | * Convert celsius to fahrenheit, since this was |
247 | * the decided 'standard' for this return value. | 379 | * the decided 'standard' for this return value. |
248 | */ | 380 | */ |
249 | *temperature = ((inb_p(pcipcwd_private.io_addr)) * 9 / 5) + 32; | 381 | *temperature = (*temperature * 9 / 5) + 32; |
382 | |||
383 | if (debug >= DEBUG) { | ||
384 | printk(KERN_DEBUG PFX "temperature is: %d F\n", | ||
385 | *temperature); | ||
386 | } | ||
250 | 387 | ||
251 | return 0; | 388 | return 0; |
252 | } | 389 | } |
@@ -256,7 +393,7 @@ static int pcipcwd_get_temperature(int *temperature) | |||
256 | */ | 393 | */ |
257 | 394 | ||
258 | static ssize_t pcipcwd_write(struct file *file, const char __user *data, | 395 | static ssize_t pcipcwd_write(struct file *file, const char __user *data, |
259 | size_t len, loff_t *ppos) | 396 | size_t len, loff_t *ppos) |
260 | { | 397 | { |
261 | /* See if we got the magic character 'V' and reload the timer */ | 398 | /* See if we got the magic character 'V' and reload the timer */ |
262 | if (len) { | 399 | if (len) { |
@@ -381,8 +518,11 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file, | |||
381 | static int pcipcwd_open(struct inode *inode, struct file *file) | 518 | static int pcipcwd_open(struct inode *inode, struct file *file) |
382 | { | 519 | { |
383 | /* /dev/watchdog can only be opened once */ | 520 | /* /dev/watchdog can only be opened once */ |
384 | if (test_and_set_bit(0, &is_active)) | 521 | if (test_and_set_bit(0, &is_active)) { |
522 | if (debug >= VERBOSE) | ||
523 | printk(KERN_ERR PFX "Attempt to open already opened device.\n"); | ||
385 | return -EBUSY; | 524 | return -EBUSY; |
525 | } | ||
386 | 526 | ||
387 | /* Activate */ | 527 | /* Activate */ |
388 | pcipcwd_start(); | 528 | pcipcwd_start(); |
@@ -492,19 +632,10 @@ static struct notifier_block pcipcwd_notifier = { | |||
492 | * Init & exit routines | 632 | * Init & exit routines |
493 | */ | 633 | */ |
494 | 634 | ||
495 | static inline void check_temperature_support(void) | ||
496 | { | ||
497 | if (inb_p(pcipcwd_private.io_addr) != 0xF0) | ||
498 | pcipcwd_private.supports_temp = 1; | ||
499 | } | ||
500 | |||
501 | static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | 635 | static int __devinit pcipcwd_card_init(struct pci_dev *pdev, |
502 | const struct pci_device_id *ent) | 636 | const struct pci_device_id *ent) |
503 | { | 637 | { |
504 | int ret = -EIO; | 638 | int ret = -EIO; |
505 | int got_fw_rev, fw_rev_major, fw_rev_minor; | ||
506 | char fw_ver_str[20]; | ||
507 | char option_switches; | ||
508 | 639 | ||
509 | cards_found++; | 640 | cards_found++; |
510 | if (cards_found == 1) | 641 | if (cards_found == 1) |
@@ -546,36 +677,10 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | |||
546 | pcipcwd_stop(); | 677 | pcipcwd_stop(); |
547 | 678 | ||
548 | /* Check whether or not the card supports the temperature device */ | 679 | /* Check whether or not the card supports the temperature device */ |
549 | check_temperature_support(); | 680 | pcipcwd_check_temperature_support(); |
550 | |||
551 | /* Get the Firmware Version */ | ||
552 | got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); | ||
553 | if (got_fw_rev) { | ||
554 | sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); | ||
555 | } else { | ||
556 | sprintf(fw_ver_str, "<card no answer>"); | ||
557 | } | ||
558 | 681 | ||
559 | /* Get switch settings */ | 682 | /* Show info about the card itself */ |
560 | option_switches = inb_p(pcipcwd_private.io_addr + 3); | 683 | pcipcwd_show_card_info(); |
561 | |||
562 | printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n", | ||
563 | (int) pcipcwd_private.io_addr, fw_ver_str, | ||
564 | (pcipcwd_private.supports_temp ? "with" : "without")); | ||
565 | |||
566 | printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
567 | option_switches, | ||
568 | ((option_switches & 0x10) ? "ON" : "OFF"), | ||
569 | ((option_switches & 0x08) ? "ON" : "OFF")); | ||
570 | |||
571 | if (pcipcwd_private.boot_status & WDIOF_CARDRESET) | ||
572 | printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n"); | ||
573 | |||
574 | if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) | ||
575 | printk(KERN_INFO PFX "Card sensed a CPU Overheat\n"); | ||
576 | |||
577 | if (pcipcwd_private.boot_status == 0) | ||
578 | printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); | ||
579 | 684 | ||
580 | /* Check that the heartbeat value is within it's range ; if not reset to the default */ | 685 | /* Check that the heartbeat value is within it's range ; if not reset to the default */ |
581 | if (pcipcwd_set_heartbeat(heartbeat)) { | 686 | if (pcipcwd_set_heartbeat(heartbeat)) { |
@@ -656,7 +761,7 @@ static struct pci_driver pcipcwd_driver = { | |||
656 | 761 | ||
657 | static int __init pcipcwd_init_module(void) | 762 | static int __init pcipcwd_init_module(void) |
658 | { | 763 | { |
659 | spin_lock_init (&pcipcwd_private.io_lock); | 764 | spin_lock_init(&pcipcwd_private.io_lock); |
660 | 765 | ||
661 | return pci_register_driver(&pcipcwd_driver); | 766 | return pci_register_driver(&pcipcwd_driver); |
662 | } | 767 | } |