Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2012 17:27:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229293 - stable/9/sys/dev/ata
Message-ID:  <201201021727.q02HR73V077098@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jan  2 17:27:07 2012
New Revision: 229293
URL: http://svn.freebsd.org/changeset/base/229293

Log:
  MFC r226680:
  Some dmesg cosmetics:
   - for the legacy PCI ATA channels move channel number out of the device
  description, same as it is for ahci(4), siis(4) and mvs(4);
   - add device description for the ISA ATA channels.

Modified:
  stable/9/sys/dev/ata/ata-isa.c
  stable/9/sys/dev/ata/ata-pci.c
  stable/9/sys/dev/ata/ata-pci.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/ata/ata-isa.c
==============================================================================
--- stable/9/sys/dev/ata/ata-isa.c	Mon Jan  2 17:21:41 2012	(r229292)
+++ stable/9/sys/dev/ata/ata-isa.c	Mon Jan  2 17:27:07 2012	(r229293)
@@ -92,6 +92,7 @@ ata_isa_probe(device_t dev)
     bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlio);
     bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
 
+    device_set_desc(dev, "ATA channel");
     return (ata_probe(dev));
 }
 

Modified: stable/9/sys/dev/ata/ata-pci.c
==============================================================================
--- stable/9/sys/dev/ata/ata-pci.c	Mon Jan  2 17:21:41 2012	(r229292)
+++ stable/9/sys/dev/ata/ata-pci.c	Mon Jan  2 17:27:07 2012	(r229293)
@@ -540,6 +540,19 @@ ata_pci_dmafini(device_t dev)
 }
 
 int
+ata_pci_print_child(device_t dev, device_t child)
+{
+	int retval;
+
+	retval = bus_print_child_header(dev, child);
+	retval += printf(" at channel %d",
+	    (int)(intptr_t)device_get_ivars(child));
+	retval += bus_print_child_footer(dev, child);
+
+	return (retval);
+}
+
+int
 ata_pci_child_location_str(device_t dev, device_t child, char *buf,
     size_t buflen)
 {
@@ -569,6 +582,7 @@ static device_method_t ata_pci_methods[]
     DEVMETHOD(bus_teardown_intr,        ata_pci_teardown_intr),
     DEVMETHOD(pci_read_config,		ata_pci_read_config),
     DEVMETHOD(pci_write_config,		ata_pci_write_config),
+    DEVMETHOD(bus_print_child,		ata_pci_print_child),
     DEVMETHOD(bus_child_location_str,	ata_pci_child_location_str),
 
     { 0, 0 }
@@ -589,12 +603,10 @@ MODULE_DEPEND(atapci, ata, 1, 1, 1);
 static int
 ata_pcichannel_probe(device_t dev)
 {
-    char buffer[32];
 
     if ((intptr_t)device_get_ivars(dev) < 0)
 	    return (ENXIO);
-    sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev));
-    device_set_desc_copy(dev, buffer);
+    device_set_desc(dev, "ATA channel");
 
     return ata_probe(dev);
 }

Modified: stable/9/sys/dev/ata/ata-pci.h
==============================================================================
--- stable/9/sys/dev/ata/ata-pci.h	Mon Jan  2 17:21:41 2012	(r229292)
+++ stable/9/sys/dev/ata/ata-pci.h	Mon Jan  2 17:27:07 2012	(r229293)
@@ -549,6 +549,7 @@ int ata_pci_write_ivar(device_t dev, dev
 uint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width);
 void ata_pci_write_config(device_t dev, device_t child, int reg, 
     uint32_t val, int width);
+int ata_pci_print_child(device_t dev, device_t child);
 int ata_pci_child_location_str(device_t dev, device_t child, char *buf,
     size_t buflen);
 struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
@@ -601,6 +602,7 @@ static device_method_t __CONCAT(dname,_m
     DEVMETHOD(bus_teardown_intr,        ata_pci_teardown_intr), \
     DEVMETHOD(pci_read_config,		ata_pci_read_config), \
     DEVMETHOD(pci_write_config,		ata_pci_write_config), \
+    DEVMETHOD(bus_print_child,		ata_pci_print_child), \
     DEVMETHOD(bus_child_location_str,	ata_pci_child_location_str), \
     { 0, 0 } \
 }; \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201021727.q02HR73V077098>