summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-10 11:01:14 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-10 11:01:14 +0000
commita7cfaef780e01b48a727f438bba90ddb26d2c944 (patch)
tree9db569b5a4bdcf9fe96e1a76a78290291dda09c8
parent95577037eb3a020972f17cacb20a5bfa587987bc (diff)
Remove USB locators. They are currently unused and this wont change due
to the way USB buses are discovered.
-rw-r--r--sys/dev/usb/usb_subr.c49
-rw-r--r--sys/dev/usb/usbdivar.h37
2 files changed, 7 insertions, 79 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 8c595dafb17..63819d8e092 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.112 2014/11/01 14:44:08 mpi Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.113 2014/11/10 11:01:13 mpi Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -66,7 +66,6 @@ void usbd_devinfo_vp(struct usbd_device *, char *, size_t,
char *usbd_get_string(struct usbd_device *, int, char *, size_t);
int usbd_getnewaddr(struct usbd_bus *);
int usbd_print(void *, const char *);
-int usbd_submatch(struct device *, void *, void *);
void usbd_free_iface_data(struct usbd_device *, int);
usbd_status usbd_probe_and_attach(struct device *,
struct usbd_device *, int, int);
@@ -859,7 +858,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port,
/* First try with device specific drivers. */
DPRINTF(("usbd_probe_and_attach trying device specific drivers\n"));
- dv = config_found_sm(parent, &uaa, usbd_print, usbd_submatch);
+ dv = config_found(parent, &uaa, usbd_print);
if (dv) {
dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);
if (dev->subdevs == NULL) {
@@ -919,8 +918,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port,
continue;
uaa.iface = ifaces[i];
uaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
- dv = config_found_sm(parent, &uaa, usbd_print,
- usbd_submatch);
+ dv = config_found(parent, &uaa, usbd_print);
if (dv != NULL) {
dev->subdevs[dev->ndevs++] = dv;
usbd_claim_iface(dev, i);
@@ -956,7 +954,7 @@ generic:
uaa.configno = dev->ndevs == 0 ? UHUB_UNK_CONFIGURATION :
dev->cdesc->bConfigurationValue;
uaa.ifaceno = UHUB_UNK_INTERFACE;
- dv = config_found_sm(parent, &uaa, usbd_print, usbd_submatch);
+ dv = config_found(parent, &uaa, usbd_print);
if (dv != NULL) {
if (dev->ndevs == 0) {
dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);
@@ -1244,45 +1242,6 @@ usbd_print(void *aux, const char *pnp)
return (UNCONF);
}
-int
-usbd_submatch(struct device *parent, void *match, void *aux)
-{
- struct cfdata *cf = match;
- struct usb_attach_arg *uaa = aux;
-
- DPRINTFN(5,("usbd_submatch port=%d,%d configno=%d,%d "
- "ifaceno=%d,%d vendor=0x%x,0x%x product=0x%x,0x%x release=%d,%d\n",
- uaa->port, cf->uhubcf_port,
- uaa->configno, cf->uhubcf_configuration,
- uaa->ifaceno, cf->uhubcf_interface,
- uaa->vendor, cf->uhubcf_vendor,
- uaa->product, cf->uhubcf_product,
- uaa->release, cf->uhubcf_release));
- if (uaa->port != 0 && /* root hub has port 0, it should match */
- ((uaa->port != 0 &&
- cf->uhubcf_port != UHUB_UNK_PORT &&
- cf->uhubcf_port != uaa->port) ||
- (uaa->configno != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != uaa->configno) ||
- (uaa->ifaceno != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != uaa->ifaceno) ||
- (uaa->vendor != UHUB_UNK_VENDOR &&
- cf->uhubcf_vendor != UHUB_UNK_VENDOR &&
- cf->uhubcf_vendor != uaa->vendor) ||
- (uaa->product != UHUB_UNK_PRODUCT &&
- cf->uhubcf_product != UHUB_UNK_PRODUCT &&
- cf->uhubcf_product != uaa->product) ||
- (uaa->release != UHUB_UNK_RELEASE &&
- cf->uhubcf_release != UHUB_UNK_RELEASE &&
- cf->uhubcf_release != uaa->release)
- )
- )
- return 0;
- return ((*cf->cf_attach->ca_match)(parent, cf, aux));
-}
-
void
usbd_fill_deviceinfo(struct usbd_device *dev, struct usb_device_info *di,
int usedev)
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 3cc74a0da17..8e9df7498c7 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.65 2014/11/01 14:44:08 mpi Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.66 2014/11/10 11:01:13 mpi Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -248,39 +248,8 @@ void usb_needs_explore(struct usbd_device *, int);
void usb_needs_reattach(struct usbd_device *);
void usb_schedsoftintr(struct usbd_bus *);
-/* Locator stuff. */
-
-/* XXX these values are used to statically bind some elements in the USB tree
- * to specific driver instances. This should be somehow emulated in FreeBSD
- * but can be done later on.
- * The values are copied from the files.usb file in the NetBSD sources.
- */
-#define UHUBCF_PORT_DEFAULT -1
-#define UHUBCF_CONFIGURATION_DEFAULT -1
-#define UHUBCF_INTERFACE_DEFAULT -1
-#define UHUBCF_VENDOR_DEFAULT -1
-#define UHUBCF_PRODUCT_DEFAULT -1
-#define UHUBCF_RELEASE_DEFAULT -1
-
-#define UHUBCF_PORT 0
-#define UHUBCF_CONFIGURATION 1
-#define UHUBCF_INTERFACE 2
-#define UHUBCF_VENDOR 3
-#define UHUBCF_PRODUCT 4
-#define UHUBCF_RELEASE 5
-
-#define uhubcf_port cf_loc[UHUBCF_PORT]
-#define uhubcf_configuration cf_loc[UHUBCF_CONFIGURATION]
-#define uhubcf_interface cf_loc[UHUBCF_INTERFACE]
-#define uhubcf_vendor cf_loc[UHUBCF_VENDOR]
-#define uhubcf_product cf_loc[UHUBCF_PRODUCT]
-#define uhubcf_release cf_loc[UHUBCF_RELEASE]
-#define UHUB_UNK_PORT UHUBCF_PORT_DEFAULT /* wildcarded 'port' */
-#define UHUB_UNK_CONFIGURATION UHUBCF_CONFIGURATION_DEFAULT /* wildcarded 'configuration' */
-#define UHUB_UNK_INTERFACE UHUBCF_INTERFACE_DEFAULT /* wildcarded 'interface' */
-#define UHUB_UNK_VENDOR UHUBCF_VENDOR_DEFAULT /* wildcarded 'vendor' */
-#define UHUB_UNK_PRODUCT UHUBCF_PRODUCT_DEFAULT /* wildcarded 'product' */
-#define UHUB_UNK_RELEASE UHUBCF_RELEASE_DEFAULT /* wildcarded 'release' */
+#define UHUB_UNK_CONFIGURATION -1
+#define UHUB_UNK_INTERFACE -1
static inline int
usbd_xfer_isread(struct usbd_xfer *xfer)