MFNetBSD:

date: 2002/10/01 01:25:25;  author: thorpej;
    Use CFATTACH_DECL().

Not a functional change on FreeBSD.
This commit is contained in:
joe 2003-07-14 18:33:55 +00:00
parent 0be29d9f18
commit db1f3022aa
2 changed files with 16 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.59 2002/09/23 05:51:20 simonb Exp $ */
/* $NetBSD: uhub.c,v 1.61 2002/10/01 01:25:25 thorpej Exp $ */
/* $FreeBSD$ */
/* Also already merged from netbsd:
@ -108,10 +108,8 @@ Static bus_child_detached_t uhub_child_detached;
USB_DECLARE_DRIVER(uhub);
/* Create the driver instance for the hub connected to hub case */
struct cfattach uhub_uhub_ca = {
sizeof(struct uhub_softc), uhub_match, uhub_attach,
uhub_detach, uhub_activate
};
CFATTACH_DECL(uhub_uhub, sizeof(struct uhub_softc),
uhub_match, uhub_attach, uhub_detach, uhub_activate)
#elif defined(__FreeBSD__)
USB_DECLARE_DRIVER_INIT(uhub,
DEVMETHOD(bus_driver_added, uhub_driver_added),

View File

@ -2,6 +2,11 @@
/* $NetBSD: usb_port.h,v 1.54 2002/03/28 21:49:19 ichiro Exp $ */
/* $FreeBSD$ */
/* Also already merged from NetBSD:
* $NetBSD: usb_port.h,v 1.57 2002/09/27 20:42:01 thorpej Exp $
* $NetBSD: usb_port.h,v 1.58 2002/10/01 01:25:26 thorpej Exp $
*/
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -95,6 +100,7 @@ typedef int usb_malloc_type;
#define logprintf printf
#define USB_DNAME(dname) dname
#define USB_DECLARE_DRIVER(dname) \
int __CONCAT(dname,_match)(struct device *, struct cfdata *, void *); \
void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \
@ -103,13 +109,12 @@ int __CONCAT(dname,_activate)(struct device *, enum devact); \
\
extern struct cfdriver __CONCAT(dname,_cd); \
\
struct cfattach __CONCAT(dname,_ca) = { \
sizeof(struct __CONCAT(dname,_softc)), \
__CONCAT(dname,_match), \
__CONCAT(dname,_attach), \
__CONCAT(dname,_detach), \
__CONCAT(dname,_activate), \
}
CFATTACH_DECL(USB_DNAME(dname), \
sizeof(struct ___CONCAT(dname,_softc)), \
___CONCAT(dname,_match), \
___CONCAT(dname,_attach), \
___CONCAT(dname,_detach), \
___CONCAT(dname,_activate))
#define USB_MATCH(dname) \
int __CONCAT(dname,_match)(struct device *parent, struct cfdata *match, void *aux)
@ -262,7 +267,7 @@ struct cfdriver __CONCAT(dname,_cd) = { \
NULL, #dname, DV_DULL \
}; \
\
struct cfattach __CONCAT(dname,_ca) = { \
const struct cfattach __CONCAT(dname,_ca) = { \
sizeof(struct __CONCAT(dname,_softc)), \
__CONCAT(dname,_match), \
__CONCAT(dname,_attach), \