diff options
author | Bill Paul <wpaul@FreeBSD.org> | 2000-01-16 22:45:07 +0000 |
---|---|---|
committer | Bill Paul <wpaul@FreeBSD.org> | 2000-01-16 22:45:07 +0000 |
commit | 20a08a85e4a53e1f3c8b9c08148ab3add3b8117b (patch) | |
tree | 61a595ce493b93390989a2b9644dd2cdcd024085 | |
parent | ec23c255e21474cba0b82dcbb2c09102254e14ae (diff) | |
download | src-20a08a85e4a53e1f3c8b9c08148ab3add3b8117b.tar.gz src-20a08a85e4a53e1f3c8b9c08148ab3add3b8117b.zip |
Remove device name strings from vendor/product lists since we don't use
them (they're read from the device directly). Also do a set_config
command for the ADMtek and CATC drivers.
Notes
Notes:
svn path=/head/; revision=56129
-rw-r--r-- | sys/dev/usb/if_aue.c | 41 | ||||
-rw-r--r-- | sys/dev/usb/if_auereg.h | 3 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_cuereg.h | 3 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 46 | ||||
-rw-r--r-- | sys/dev/usb/if_kuereg.h | 3 |
6 files changed, 57 insertions, 59 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 9e8a3449c7bc..2ce83fbca6c7 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -101,24 +101,17 @@ static const char rcsid[] = #endif /* - * Various supported device vendors/types and their names. + * Various supported device vendors/products. */ static struct aue_type aue_devs[] = { - { USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX_PNA, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_SMC, USB_PRODUCT_SMC_2202USB, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100TX, - "ADMtek AN986 Pegasus 10/100BaseTX" }, - { 0, 0, NULL } + { USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS }, + { USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100 }, + { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX }, + { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX }, + { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650TX_PNA }, + { USB_VENDOR_SMC, USB_PRODUCT_SMC_2202USB }, + { USB_VENDOR_LINKSYS, USB_PRODUCT_LINKSYS_USB100TX }, + { 0, 0 } }; static struct usb_qdat aue_qdat; @@ -582,10 +575,9 @@ USB_MATCH(aue) return(UMATCH_NONE); t = aue_devs; - while(t->aue_name != NULL) { + while(t->aue_vid) { if (uaa->vendor == t->aue_vid && uaa->product == t->aue_did) { - device_set_desc(self, t->aue_name); return(UMATCH_VENDOR_PRODUCT); } t++; @@ -617,8 +609,15 @@ USB_ATTACH(aue) sc->aue_udev = uaa->device; sc->aue_unit = device_get_unit(self); + if (usbd_set_config_no(sc->aue_udev, AUE_CONFIG_NO, 0)) { + printf("aue%d: getting interface handle failed\n", + sc->aue_unit); + splx(s); + USB_ATTACH_ERROR_RETURN; + } + t = aue_devs; - while(t->aue_name != NULL) { + while(t->aue_vid) { if (uaa->vendor == t->aue_vid && uaa->product == t->aue_did) { sc->aue_info = t; @@ -688,7 +687,7 @@ USB_ATTACH(aue) * NOTE: Doing this causes child devices to be attached to us, * which we would normally disconnect at in the detach routine * using device_delete_child(). However the USB code is set up - * such that when this driver is removed, all childred devices + * such that when this driver is removed, all children devices * are removed as well. In effect, the USB code ends up detaching * all of our children for us, so we don't have to do is ourselves * in aue_detach(). It's important to point this out since if @@ -1138,7 +1137,7 @@ static int aue_encap(sc, m, idx) * and base the frame size on the bulk transfer length. */ c->aue_buf[0] = (u_int8_t)m->m_pkthdr.len; - c->aue_buf[1] = (u_int8_t)(m->m_pkthdr.len >> 3) & 0xE0; + c->aue_buf[1] = (u_int8_t)(m->m_pkthdr.len >> 8); usbd_setup_xfer(c->aue_xfer, sc->aue_ep[AUE_ENDPT_TX], c, c->aue_buf, total_len, 0, 10000, aue_txeof); diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h index d804705b8314..23a7c930a80c 100644 --- a/sys/dev/usb/if_auereg.h +++ b/sys/dev/usb/if_auereg.h @@ -59,6 +59,8 @@ #define AUE_UR_READREG 0xF0 #define AUE_UR_WRITEREG 0xF1 +#define AUE_CONFIG_NO 1 + /* * Note that while the ADMtek technically has four * endpoints, the control endpoint (endpoint 0) is @@ -203,7 +205,6 @@ struct aue_rxpkt { struct aue_type { u_int16_t aue_vid; u_int16_t aue_did; - char *aue_name; }; #define AUE_TX_LIST_CNT 1 diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index f832e6181185..905b34a638a1 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -84,14 +84,12 @@ static const char rcsid[] = #endif /* - * Various supported device vendors/types and their names. + * Various supported device vendors/products. */ static struct cue_type cue_devs[] = { - { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE, - "CATC Netmate USB Ethernet" }, - { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE2, - "CATC Netmate USB Ethernet" }, - { 0, 0, NULL } + { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE }, + { USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE2 }, + { 0, 0 } }; static struct usb_qdat cue_qdat; @@ -431,12 +429,11 @@ USB_MATCH(cue) dd = &uaa->device->ddesc; t = cue_devs; - while(t->cue_name != NULL) { + while(t->cue_vid) { if (uaa->vendor == t->cue_vid && uaa->product == t->cue_did) { USETW(dd->bcdDevice, 0x220); uaa->device->quirks = usbd_find_quirk(dd); - device_set_desc(self, t->cue_name); return(UMATCH_VENDOR_PRODUCT); } t++; @@ -467,6 +464,13 @@ USB_ATTACH(cue) sc->cue_udev = uaa->device; sc->cue_unit = device_get_unit(self); + if (usbd_set_config_no(sc->cue_udev, CUE_CONFIG_NO, 0)) { + printf("cue%d: getting interface handle failed\n", + sc->cue_unit); + splx(s); + USB_ATTACH_ERROR_RETURN; + } + id = usbd_get_interface_descriptor(uaa->iface); usbd_devinfo(uaa->device, 0, devinfo); diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h index 13bec95913ff..392184303772 100644 --- a/sys/dev/usb/if_cuereg.h +++ b/sys/dev/usb/if_cuereg.h @@ -129,6 +129,8 @@ #define CUE_CTL_READ 0x01 #define CUE_CTL_WRITE 0x02 +#define CUE_CONFIG_NO 1 + /* * The interrupt endpoint is currently unused * by the KLSI part. @@ -141,7 +143,6 @@ struct cue_type { u_int16_t cue_vid; u_int16_t cue_did; - char *cue_name; }; struct cue_softc; diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 12afa7ad3c58..3c8d846b0fec 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -100,32 +100,21 @@ static const char rcsid[] = #endif /* - * Various supported device vendors/types and their names. + * Various supported device vendors/products. */ static struct kue_type kue_devs[] = { - { USB_VENDOR_AOX, USB_PRODUCT_AOX_USB101, - "KLSI USB ethernet" }, - { USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET, - "KLSI USB ethernet" }, - { USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC10T, - "KLSI USB ethernet" }, - { USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_EA101, - "KLSI USB ethernet" }, - { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET, - "KLSI USB ethernet" }, - { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET2, - "KLSI USB ethernet" }, - { USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_E45, - "KLSI USB ethernet" }, - { USB_VENDOR_3COM, USB_PRODUCT_3COM_3C19250, - "KLSI USB ethernet" }, - { USB_VENDOR_COREGA, USB_PRODUCT_COREGA_USB_T, - "KLSI USB ethernet" }, - { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650C, - "KLSI USB ethernet" }, - { USB_VENDOR_SMC, USB_PRODUCT_SMC_2102USB, - "KLSI USB ethernet" }, - { 0, 0, NULL } + { USB_VENDOR_AOX, USB_PRODUCT_AOX_USB101 }, + { USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET }, + { USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC10T }, + { USB_VENDOR_NETGEAR, USB_PRODUCT_NETGEAR_EA101 }, + { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET }, + { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET2 }, + { USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_E45 }, + { USB_VENDOR_3COM, USB_PRODUCT_3COM_3C19250 }, + { USB_VENDOR_COREGA, USB_PRODUCT_COREGA_USB_T }, + { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650C }, + { USB_VENDOR_SMC, USB_PRODUCT_SMC_2102USB }, + { 0, 0 } }; static struct usb_qdat kue_qdat; @@ -376,7 +365,11 @@ static void kue_setmulti(sc) static void kue_reset(sc) struct kue_softc *sc; { - usbd_set_config_no(sc->kue_udev, 1, 0); + if (usbd_set_config_no(sc->kue_udev, KUE_CONFIG_NO, 0)) { + printf("kue%d: getting interface handle failed\n", + sc->kue_unit); + } + /* Wait a little while for the chip to get its brains in order. */ DELAY(1000); return; @@ -397,7 +390,7 @@ USB_MATCH(kue) dd = &uaa->device->ddesc; t = kue_devs; - while(t->kue_name != NULL) { + while(t->kue_vid) { if (uaa->vendor == t->kue_vid && uaa->product == t->kue_did) { /* @@ -411,7 +404,6 @@ USB_MATCH(kue) */ USETW(dd->bcdDevice, 0x002); uaa->device->quirks = usbd_find_quirk(dd); - device_set_desc(self, t->kue_name); return(UMATCH_VENDOR_PRODUCT); } t++; diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h index ca0af561fdf7..6b3e56307918 100644 --- a/sys/dev/usb/if_kuereg.h +++ b/sys/dev/usb/if_kuereg.h @@ -121,6 +121,8 @@ struct kue_ether_desc { #define KUE_CTL_READ 0x01 #define KUE_CTL_WRITE 0x02 +#define KUE_CONFIG_NO 1 + /* * The interrupt endpoint is currently unused * by the KLSI part. @@ -133,7 +135,6 @@ struct kue_ether_desc { struct kue_type { u_int16_t kue_vid; u_int16_t kue_did; - char *kue_name; }; struct kue_softc; |