|
Lines 209-216
Link Here
|
| 209 |
* control endpoint is open or not. It is always present. |
209 |
* control endpoint is open or not. It is always present. |
| 210 |
*/ |
210 |
*/ |
| 211 |
for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++) |
211 |
for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++) |
| 212 |
if (sc->sc_is_open[endptno]) |
212 |
if (sc->sc_is_open[endptno]) { |
|
|
213 |
DPRINTFN(1, |
| 214 |
("ugen_set_config: %s - endpoint %d is open\n", |
| 215 |
USBDEVNAME(sc->sc_dev), endptno)); |
| 213 |
return (USBD_IN_USE); |
216 |
return (USBD_IN_USE); |
|
|
217 |
} |
| 214 |
|
218 |
|
| 215 |
if (usbd_get_config_descriptor(dev)->bConfigurationValue != configno) { |
219 |
if (usbd_get_config_descriptor(dev)->bConfigurationValue != configno) { |
| 216 |
/* Avoid setting the current value. */ |
220 |
/* Avoid setting the current value. */ |
|
Lines 957-966
Link Here
|
| 957 |
if (!(flag & FWRITE)) |
961 |
if (!(flag & FWRITE)) |
| 958 |
return (EPERM); |
962 |
return (EPERM); |
| 959 |
err = ugen_set_config(sc, *(int *)addr); |
963 |
err = ugen_set_config(sc, *(int *)addr); |
| 960 |
if (err == USBD_IN_USE) |
964 |
switch (err) { |
| 961 |
return(EBUSY); |
965 |
case USBD_NORMAL_COMPLETION: |
| 962 |
else |
966 |
break; |
|
|
967 |
case USBD_IN_USE: |
| 968 |
return (EBUSY); |
| 969 |
default: |
| 963 |
return (EIO); |
970 |
return (EIO); |
|
|
971 |
} |
| 964 |
break; |
972 |
break; |
| 965 |
case USB_GET_ALTINTERFACE: |
973 |
case USB_GET_ALTINTERFACE: |
| 966 |
ai = (struct usb_alt_interface *)addr; |
974 |
ai = (struct usb_alt_interface *)addr; |