Deleted Added
full compact
puc.c (200397) puc.c (223091)
1/*-
2 * Copyright (c) 2006 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 200397 2009-12-11 03:08:07Z marcel $");
28__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 223091 2011-06-14 18:19:48Z jhb $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>

--- 684 unchanged lines hidden (view full) ---

721 case PUC_IVAR_TYPE:
722 *result = port->p_type;
723 break;
724 default:
725 return (ENOENT);
726 }
727 return (0);
728}
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>

--- 684 unchanged lines hidden (view full) ---

721 case PUC_IVAR_TYPE:
722 *result = port->p_type;
723 break;
724 default:
725 return (ENOENT);
726 }
727 return (0);
728}
729
730int
731puc_bus_print_child(device_t dev, device_t child)
732{
733 struct puc_port *port;
734 int retval;
735
736 port = device_get_ivars(child);
737 retval = 0;
738
739 retval += bus_print_child_header(dev, child);
740 retval += printf(" at port %d", port->p_nr);
741 retval += bus_print_child_footer(dev, child);
742
743 return (retval);
744}
745
746int
747puc_bus_child_location_str(device_t dev, device_t child, char *buf,
748 size_t buflen)
749{
750 struct puc_port *port;
751
752 port = device_get_ivars(child);
753 snprintf(buf, buflen, "port=%d", port->p_nr);
754 return (0);
755}
756
757int
758puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf,
759 size_t buflen)
760{
761 struct puc_port *port;
762
763 port = device_get_ivars(child);
764 snprintf(buf, buflen, "type=%d", port->p_type);
765 return (0);
766}