Add pmf register/deregister to ucom and ugensa. (Addtionally, let a

Sierra wireless card be recognized as a ugensa.)
This commit is contained in:
smb 2007-12-30 21:49:47 +00:00
parent aeab3db895
commit 1d2e422408
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucom.c,v 1.73 2007/11/19 18:51:50 ad Exp $ */
/* $NetBSD: ucom.c,v 1.74 2007/12/30 21:49:47 smb Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.73 2007/11/19 18:51:50 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.74 2007/12/30 21:49:47 smb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -208,6 +208,8 @@ USB_ATTACH(ucom)
RND_TYPE_TTY, 0);
#endif
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
USB_ATTACH_SUCCESS_RETURN;
}
@ -222,6 +224,7 @@ USB_DETACH(ucom)
sc, flags, tp, sc->sc_bulkin_no, sc->sc_bulkout_no));
sc->sc_dying = 1;
pmf_device_deregister(self);
if (sc->sc_bulkin_pipe != NULL)
usbd_abort_pipe(sc->sc_bulkin_pipe);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ugensa.c,v 1.13 2007/12/11 12:36:02 lukem Exp $ */
/* $NetBSD: ugensa.c,v 1.14 2007/12/30 21:49:47 smb Exp $ */
/*
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.13 2007/12/11 12:36:02 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ugensa.c,v 1.14 2007/12/30 21:49:47 smb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -97,6 +97,7 @@ static const struct usb_devno ugensa_devs[] = {
{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_FLEXPACKGPS },
{ USB_VENDOR_QUALCOMM_K, USB_PRODUCT_QUALCOMM_K_CDMA_MSM_K },
{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD580 },
{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MINI5725},
{ USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_CDMA_MODEM },
{ USB_VENDOR_DELL, USB_PRODUCT_DELL_HSDPA }
};
@ -205,6 +206,8 @@ USB_ATTACH(ugensa)
sc->sc_subdev = config_found_sm_loc(self, "ucombus", NULL, &uca,
ucomprint, ucomsubmatch);
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
USB_ATTACH_SUCCESS_RETURN;
bad:
@ -241,6 +244,7 @@ USB_DETACH(ugensa)
DPRINTF(("ugensa_detach: sc=%p flags=%d\n", sc, flags));
sc->sc_dying = 1;
pmf_device_deregister(self);
if (sc->sc_subdev != NULL)
rv = config_detach(sc->sc_subdev, flags);