uaudio.c (369283) | uaudio.c (369538) |
---|---|
1/* $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */ | 1/* $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */ |
2/* $FreeBSD: stable/11/sys/dev/sound/usb/uaudio.c 369283 2021-02-18 08:47:29Z git2svn $ */ | 2/* $FreeBSD: stable/11/sys/dev/sound/usb/uaudio.c 369538 2021-04-01 09:21:32Z git2svn $ */ |
3 4/*- 5 * Copyright (c) 1999 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Lennart Augustsson (lennart@augustsson.net) at 10 * Carlstedt Research & Technology. --- 16 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> | 3 4/*- 5 * Copyright (c) 1999 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Lennart Augustsson (lennart@augustsson.net) at 10 * Carlstedt Research & Technology. --- 16 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: stable/11/sys/dev/sound/usb/uaudio.c 369283 2021-02-18 08:47:29Z git2svn $"); | 35__FBSDID("$FreeBSD: stable/11/sys/dev/sound/usb/uaudio.c 369538 2021-04-01 09:21:32Z git2svn $"); |
36 37/* 38 * USB audio specs: http://www.usb.org/developers/devclass_docs/audio10.pdf 39 * http://www.usb.org/developers/devclass_docs/frmts10.pdf 40 * http://www.usb.org/developers/devclass_docs/termt10.pdf 41 */ 42 43/* --- 895 unchanged lines hidden (view full) --- 939} 940 941static int 942uaudio_set_spdif_dummy(struct uaudio_softc *sc, int flags) 943{ 944 return (0); 945} 946 | 36 37/* 38 * USB audio specs: http://www.usb.org/developers/devclass_docs/audio10.pdf 39 * http://www.usb.org/developers/devclass_docs/frmts10.pdf 40 * http://www.usb.org/developers/devclass_docs/termt10.pdf 41 */ 42 43/* --- 895 unchanged lines hidden (view full) --- 939} 940 941static int 942uaudio_set_spdif_dummy(struct uaudio_softc *sc, int flags) 943{ 944 return (0); 945} 946 |
947static usb_error_t 948uaudio_force_power_save(struct uaudio_softc *sc, uint8_t iface_index) 949{ 950 struct usb_interface *iface; 951 usb_error_t err; 952 953 iface = usbd_get_iface(sc->sc_udev, iface_index); 954 if (iface == NULL || iface->idesc == NULL) 955 return (USB_ERR_INVAL); 956 957 /* check if correct alternate setting is already selected */ 958 if (iface->alt_index == 0) { 959 /* force power save mode by selecting default alternate setting */ 960 err = usbd_req_set_alt_interface_no(sc->sc_udev, NULL, iface_index, 961 iface->idesc->bAlternateSetting); 962 } else { 963 err = usbd_set_alt_interface_index(sc->sc_udev, iface_index, 0); 964 } 965 return (err); 966} 967 |
|
947static int 948uaudio_attach(device_t dev) 949{ 950 struct usb_attach_arg *uaa = device_get_ivars(dev); 951 struct uaudio_softc *sc = device_get_softc(dev); 952 struct usb_interface_descriptor *id; 953 usb_error_t err; 954 unsigned i; --- 58 unchanged lines hidden (view full) --- 1013 for (i = 0; i != UAUDIO_MAX_CHILD; i++) { 1014 uint8_t x; 1015 1016 if (sc->sc_play_chan[i].num_alt <= 0) 1017 break; 1018 1019 /* 1020 * Need to set a default alternate interface, else | 968static int 969uaudio_attach(device_t dev) 970{ 971 struct usb_attach_arg *uaa = device_get_ivars(dev); 972 struct uaudio_softc *sc = device_get_softc(dev); 973 struct usb_interface_descriptor *id; 974 usb_error_t err; 975 unsigned i; --- 58 unchanged lines hidden (view full) --- 1034 for (i = 0; i != UAUDIO_MAX_CHILD; i++) { 1035 uint8_t x; 1036 1037 if (sc->sc_play_chan[i].num_alt <= 0) 1038 break; 1039 1040 /* 1041 * Need to set a default alternate interface, else |
1021 * some USB audio devices might go into an infinte | 1042 * some USB audio devices might go into an infinite |
1022 * re-enumeration loop: 1023 */ | 1043 * re-enumeration loop: 1044 */ |
1024 err = usbd_set_alt_interface_index(sc->sc_udev, 1025 sc->sc_play_chan[i].usb_alt[0].iface_index, 1026 sc->sc_play_chan[i].usb_alt[0].iface_alt_index); | 1045 err = uaudio_force_power_save(sc, 1046 sc->sc_play_chan[i].usb_alt[0].iface_index); |
1027 if (err) { 1028 DPRINTF("setting of alternate index failed: %s!\n", 1029 usbd_errstr(err)); 1030 } | 1047 if (err) { 1048 DPRINTF("setting of alternate index failed: %s!\n", 1049 usbd_errstr(err)); 1050 } |
1051 |
|
1031 for (x = 0; x != sc->sc_play_chan[i].num_alt; x++) { 1032 device_printf(dev, "Play[%u]: %d Hz, %d ch, %s format, " 1033 "2x%dms buffer.\n", i, 1034 sc->sc_play_chan[i].usb_alt[x].sample_rate, 1035 sc->sc_play_chan[i].usb_alt[x].channels, 1036 sc->sc_play_chan[i].usb_alt[x].p_fmt->description, 1037 uaudio_buffer_ms); 1038 } --- 4 unchanged lines hidden (view full) --- 1043 for (i = 0; i != UAUDIO_MAX_CHILD; i++) { 1044 uint8_t x; 1045 1046 if (sc->sc_rec_chan[i].num_alt <= 0) 1047 break; 1048 1049 /* 1050 * Need to set a default alternate interface, else | 1052 for (x = 0; x != sc->sc_play_chan[i].num_alt; x++) { 1053 device_printf(dev, "Play[%u]: %d Hz, %d ch, %s format, " 1054 "2x%dms buffer.\n", i, 1055 sc->sc_play_chan[i].usb_alt[x].sample_rate, 1056 sc->sc_play_chan[i].usb_alt[x].channels, 1057 sc->sc_play_chan[i].usb_alt[x].p_fmt->description, 1058 uaudio_buffer_ms); 1059 } --- 4 unchanged lines hidden (view full) --- 1064 for (i = 0; i != UAUDIO_MAX_CHILD; i++) { 1065 uint8_t x; 1066 1067 if (sc->sc_rec_chan[i].num_alt <= 0) 1068 break; 1069 1070 /* 1071 * Need to set a default alternate interface, else |
1051 * some USB audio devices might go into an infinte | 1072 * some USB audio devices might go into an infinite |
1052 * re-enumeration loop: 1053 */ | 1073 * re-enumeration loop: 1074 */ |
1054 err = usbd_set_alt_interface_index(sc->sc_udev, 1055 sc->sc_rec_chan[i].usb_alt[0].iface_index, 1056 sc->sc_rec_chan[i].usb_alt[0].iface_alt_index); | 1075 err = uaudio_force_power_save(sc, 1076 sc->sc_rec_chan[i].usb_alt[0].iface_index); |
1057 if (err) { 1058 DPRINTF("setting of alternate index failed: %s!\n", 1059 usbd_errstr(err)); 1060 } | 1077 if (err) { 1078 DPRINTF("setting of alternate index failed: %s!\n", 1079 usbd_errstr(err)); 1080 } |
1081 |
|
1061 for (x = 0; x != sc->sc_rec_chan[i].num_alt; x++) { 1062 device_printf(dev, "Record[%u]: %d Hz, %d ch, %s format, " 1063 "2x%dms buffer.\n", i, 1064 sc->sc_rec_chan[i].usb_alt[x].sample_rate, 1065 sc->sc_rec_chan[i].usb_alt[x].channels, 1066 sc->sc_rec_chan[i].usb_alt[x].p_fmt->description, 1067 uaudio_buffer_ms); 1068 } --- 234 unchanged lines hidden (view full) --- 1303static void 1304uaudio_configure_msg_sub(struct uaudio_softc *sc, 1305 struct uaudio_chan *chan, int dir) 1306{ 1307 struct uaudio_chan_alt *chan_alt; 1308 uint32_t frames; 1309 uint32_t buf_size; 1310 uint16_t fps; | 1082 for (x = 0; x != sc->sc_rec_chan[i].num_alt; x++) { 1083 device_printf(dev, "Record[%u]: %d Hz, %d ch, %s format, " 1084 "2x%dms buffer.\n", i, 1085 sc->sc_rec_chan[i].usb_alt[x].sample_rate, 1086 sc->sc_rec_chan[i].usb_alt[x].channels, 1087 sc->sc_rec_chan[i].usb_alt[x].p_fmt->description, 1088 uaudio_buffer_ms); 1089 } --- 234 unchanged lines hidden (view full) --- 1324static void 1325uaudio_configure_msg_sub(struct uaudio_softc *sc, 1326 struct uaudio_chan *chan, int dir) 1327{ 1328 struct uaudio_chan_alt *chan_alt; 1329 uint32_t frames; 1330 uint32_t buf_size; 1331 uint16_t fps; |
1311 uint8_t set_alt; | 1332 uint8_t next_alt; |
1312 uint8_t fps_shift; 1313 uint8_t operation; 1314 usb_error_t err; 1315 1316 if (chan->num_alt <= 0) 1317 return; 1318 1319 DPRINTF("\n"); 1320 1321 usb_proc_explore_lock(sc->sc_udev); 1322 operation = chan->operation; | 1333 uint8_t fps_shift; 1334 uint8_t operation; 1335 usb_error_t err; 1336 1337 if (chan->num_alt <= 0) 1338 return; 1339 1340 DPRINTF("\n"); 1341 1342 usb_proc_explore_lock(sc->sc_udev); 1343 operation = chan->operation; |
1323 chan->operation = CHAN_OP_NONE; | 1344 switch (operation) { 1345 case CHAN_OP_START: 1346 case CHAN_OP_STOP: 1347 chan->operation = CHAN_OP_NONE; 1348 break; 1349 default: 1350 break; 1351 } |
1324 usb_proc_explore_unlock(sc->sc_udev); 1325 | 1352 usb_proc_explore_unlock(sc->sc_udev); 1353 |
1326 mtx_lock(chan->pcm_mtx); 1327 if (chan->cur_alt != chan->set_alt) 1328 set_alt = chan->set_alt; 1329 else 1330 set_alt = CHAN_MAX_ALT; 1331 mtx_unlock(chan->pcm_mtx); | 1354 switch (operation) { 1355 case CHAN_OP_STOP: 1356 /* Unsetup prior USB transfers, if any. */ 1357 usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); |
1332 | 1358 |
1333 if (set_alt >= chan->num_alt) 1334 goto done; | 1359 mtx_lock(chan->pcm_mtx); 1360 chan->cur_alt = CHAN_MAX_ALT; 1361 mtx_unlock(chan->pcm_mtx); |
1335 | 1362 |
1336 chan_alt = chan->usb_alt + set_alt; | 1363 /* 1364 * The first alternate setting is typically used for 1365 * power saving mode. Set this alternate setting as 1366 * part of entering stop. 1367 */ 1368 err = usbd_set_alt_interface_index(sc->sc_udev, chan->iface_index, 0); 1369 if (err) { 1370 DPRINTF("setting of default alternate index failed: %s!\n", 1371 usbd_errstr(err)); 1372 } 1373 return; |
1337 | 1374 |
1338 usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); | 1375 case CHAN_OP_START: 1376 /* Unsetup prior USB transfers, if any. */ 1377 usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); 1378 break; |
1339 | 1379 |
1380 default: 1381 return; 1382 } 1383 1384 mtx_lock(chan->pcm_mtx); 1385 next_alt = chan->set_alt; 1386 mtx_unlock(chan->pcm_mtx); 1387 1388 chan_alt = chan->usb_alt + next_alt; 1389 |
|
1340 err = usbd_set_alt_interface_index(sc->sc_udev, 1341 chan_alt->iface_index, chan_alt->iface_alt_index); 1342 if (err) { 1343 DPRINTF("setting of alternate index failed: %s!\n", 1344 usbd_errstr(err)); 1345 goto error; 1346 } 1347 --- 86 unchanged lines hidden (view full) --- 1434 1435 DPRINTF("fps=%d sample_rem=%d\n", (int)fps, (int)chan->sample_rem); 1436 1437 if (chan->intr_frames == 0) { 1438 DPRINTF("frame shift is too high!\n"); 1439 goto error; 1440 } 1441 | 1390 err = usbd_set_alt_interface_index(sc->sc_udev, 1391 chan_alt->iface_index, chan_alt->iface_alt_index); 1392 if (err) { 1393 DPRINTF("setting of alternate index failed: %s!\n", 1394 usbd_errstr(err)); 1395 goto error; 1396 } 1397 --- 86 unchanged lines hidden (view full) --- 1484 1485 DPRINTF("fps=%d sample_rem=%d\n", (int)fps, (int)chan->sample_rem); 1486 1487 if (chan->intr_frames == 0) { 1488 DPRINTF("frame shift is too high!\n"); 1489 goto error; 1490 } 1491 |
1442 mtx_lock(chan->pcm_mtx); 1443 chan->cur_alt = set_alt; 1444 mtx_unlock(chan->pcm_mtx); 1445 1446done: | |
1447#if (UAUDIO_NCHANBUFS != 2) | 1492#if (UAUDIO_NCHANBUFS != 2) |
1448#error "please update code" | 1493#error "Please update code below!" |
1449#endif | 1494#endif |
1450 switch (operation) { 1451 case CHAN_OP_START: 1452 mtx_lock(chan->pcm_mtx); 1453 usbd_transfer_start(chan->xfer[0]); 1454 usbd_transfer_start(chan->xfer[1]); 1455 mtx_unlock(chan->pcm_mtx); 1456 break; 1457 case CHAN_OP_STOP: 1458 mtx_lock(chan->pcm_mtx); 1459 usbd_transfer_stop(chan->xfer[0]); 1460 usbd_transfer_stop(chan->xfer[1]); 1461 mtx_unlock(chan->pcm_mtx); 1462 break; 1463 default: 1464 break; 1465 } 1466 return; | |
1467 | 1495 |
1496 mtx_lock(chan->pcm_mtx); 1497 chan->cur_alt = next_alt; 1498 usbd_transfer_start(chan->xfer[0]); 1499 usbd_transfer_start(chan->xfer[1]); 1500 mtx_unlock(chan->pcm_mtx); 1501 return; |
|
1468error: 1469 usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); 1470 1471 mtx_lock(chan->pcm_mtx); 1472 chan->cur_alt = CHAN_MAX_ALT; 1473 mtx_unlock(chan->pcm_mtx); 1474} 1475 --- 1275 unchanged lines hidden (view full) --- 2751int 2752uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format) 2753{ 2754 DPRINTF("Selecting format 0x%08x\n", (unsigned int)format); 2755 return (0); 2756} 2757 2758static void | 1502error: 1503 usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); 1504 1505 mtx_lock(chan->pcm_mtx); 1506 chan->cur_alt = CHAN_MAX_ALT; 1507 mtx_unlock(chan->pcm_mtx); 1508} 1509 --- 1275 unchanged lines hidden (view full) --- 2785int 2786uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format) 2787{ 2788 DPRINTF("Selecting format 0x%08x\n", (unsigned int)format); 2789 return (0); 2790} 2791 2792static void |
2759uaudio_chan_start_sub(struct uaudio_chan *ch) | 2793uaudio_chan_reconfigure(struct uaudio_chan *ch, uint8_t operation) |
2760{ 2761 struct uaudio_softc *sc = ch->priv_sc; | 2794{ 2795 struct uaudio_softc *sc = ch->priv_sc; |
2762 int do_start = 0; | |
2763 | 2796 |
2764 if (ch->operation != CHAN_OP_DRAIN) { 2765 if (ch->cur_alt == ch->set_alt && 2766 ch->operation == CHAN_OP_NONE && 2767 mtx_owned(ch->pcm_mtx) != 0) { 2768 /* save doing the explore task */ 2769 do_start = 1; 2770 } else { 2771 ch->operation = CHAN_OP_START; 2772 (void)usb_proc_explore_msignal(sc->sc_udev, 2773 &sc->sc_config_msg[0], &sc->sc_config_msg[1]); 2774 } 2775 } 2776 if (do_start) { 2777 usbd_transfer_start(ch->xfer[0]); 2778 usbd_transfer_start(ch->xfer[1]); 2779 } | 2797 /* Check for shutdown. */ 2798 if (ch->operation == CHAN_OP_DRAIN) 2799 return; 2800 2801 /* Set next operation. */ 2802 ch->operation = operation; 2803 2804 /* 2805 * Because changing the alternate setting modifies the USB 2806 * configuration, this part must be executed from the USB 2807 * explore process. 2808 */ 2809 (void)usb_proc_explore_msignal(sc->sc_udev, 2810 &sc->sc_config_msg[0], &sc->sc_config_msg[1]); |
2780} 2781 2782static int 2783uaudio_chan_need_both(struct uaudio_chan *pchan, struct uaudio_chan *rchan) 2784{ 2785 return (pchan->num_alt > 0 && 2786 pchan->running != 0 && 2787 uaudio_chan_is_async(pchan, pchan->set_alt) != 0 && --- 36 unchanged lines hidden (view full) --- 2824 2825 if (uaudio_chan_need_both( 2826 &sc->sc_play_chan[i], 2827 &sc->sc_rec_chan[i])) { 2828 /* 2829 * Start both endpoints because of need for 2830 * jitter information: 2831 */ | 2811} 2812 2813static int 2814uaudio_chan_need_both(struct uaudio_chan *pchan, struct uaudio_chan *rchan) 2815{ 2816 return (pchan->num_alt > 0 && 2817 pchan->running != 0 && 2818 uaudio_chan_is_async(pchan, pchan->set_alt) != 0 && --- 36 unchanged lines hidden (view full) --- 2855 2856 if (uaudio_chan_need_both( 2857 &sc->sc_play_chan[i], 2858 &sc->sc_rec_chan[i])) { 2859 /* 2860 * Start both endpoints because of need for 2861 * jitter information: 2862 */ |
2832 uaudio_chan_start_sub(&sc->sc_rec_chan[i]); 2833 uaudio_chan_start_sub(&sc->sc_play_chan[i]); | 2863 uaudio_chan_reconfigure(&sc->sc_rec_chan[i], CHAN_OP_START); 2864 uaudio_chan_reconfigure(&sc->sc_play_chan[i], CHAN_OP_START); |
2834 } else { | 2865 } else { |
2835 uaudio_chan_start_sub(ch); | 2866 uaudio_chan_reconfigure(ch, CHAN_OP_START); |
2836 } 2837 } 2838 2839 /* exit atomic operation */ 2840 usb_proc_explore_unlock(sc->sc_udev); 2841} 2842 | 2867 } 2868 } 2869 2870 /* exit atomic operation */ 2871 usb_proc_explore_unlock(sc->sc_udev); 2872} 2873 |
2843static void 2844uaudio_chan_stop_sub(struct uaudio_chan *ch) 2845{ 2846 struct uaudio_softc *sc = ch->priv_sc; 2847 int do_stop = 0; 2848 2849 if (ch->operation != CHAN_OP_DRAIN) { 2850 if (ch->cur_alt == ch->set_alt && 2851 ch->operation == CHAN_OP_NONE && 2852 mtx_owned(ch->pcm_mtx) != 0) { 2853 /* save doing the explore task */ 2854 do_stop = 1; 2855 } else { 2856 ch->operation = CHAN_OP_STOP; 2857 (void)usb_proc_explore_msignal(sc->sc_udev, 2858 &sc->sc_config_msg[0], &sc->sc_config_msg[1]); 2859 } 2860 } 2861 if (do_stop) { 2862 usbd_transfer_stop(ch->xfer[0]); 2863 usbd_transfer_stop(ch->xfer[1]); 2864 } 2865} 2866 | |
2867void 2868uaudio_chan_stop(struct uaudio_chan *ch) 2869{ 2870 struct uaudio_softc *sc = ch->priv_sc; 2871 unsigned i = uaudio_get_child_index_by_chan(sc, ch); 2872 2873 /* make operation atomic */ 2874 usb_proc_explore_lock(sc->sc_udev); --- 12 unchanged lines hidden (view full) --- 2887 */ 2888 } else if (uaudio_chan_need_none( 2889 &sc->sc_play_chan[i], 2890 &sc->sc_rec_chan[i])) { 2891 /* 2892 * Stop both endpoints in case the one was used for 2893 * jitter information: 2894 */ | 2874void 2875uaudio_chan_stop(struct uaudio_chan *ch) 2876{ 2877 struct uaudio_softc *sc = ch->priv_sc; 2878 unsigned i = uaudio_get_child_index_by_chan(sc, ch); 2879 2880 /* make operation atomic */ 2881 usb_proc_explore_lock(sc->sc_udev); --- 12 unchanged lines hidden (view full) --- 2894 */ 2895 } else if (uaudio_chan_need_none( 2896 &sc->sc_play_chan[i], 2897 &sc->sc_rec_chan[i])) { 2898 /* 2899 * Stop both endpoints in case the one was used for 2900 * jitter information: 2901 */ |
2895 uaudio_chan_stop_sub(&sc->sc_rec_chan[i]); 2896 uaudio_chan_stop_sub(&sc->sc_play_chan[i]); | 2902 uaudio_chan_reconfigure(&sc->sc_rec_chan[i], CHAN_OP_STOP); 2903 uaudio_chan_reconfigure(&sc->sc_play_chan[i], CHAN_OP_STOP); |
2897 } else { | 2904 } else { |
2898 uaudio_chan_stop_sub(ch); | 2905 uaudio_chan_reconfigure(ch, CHAN_OP_STOP); |
2899 } 2900 } 2901 2902 /* exit atomic operation */ 2903 usb_proc_explore_unlock(sc->sc_udev); 2904} 2905 2906/*========================================================================* --- 3087 unchanged lines hidden (view full) --- 5994 struct umidi_sub_chan *sub; 5995 int unit = device_get_unit(dev); 5996 int error; 5997 uint32_t n; 5998 5999 if (usb_test_quirk(uaa, UQ_SINGLE_CMD_MIDI)) 6000 chan->single_command = 1; 6001 | 2906 } 2907 } 2908 2909 /* exit atomic operation */ 2910 usb_proc_explore_unlock(sc->sc_udev); 2911} 2912 2913/*========================================================================* --- 3087 unchanged lines hidden (view full) --- 6001 struct umidi_sub_chan *sub; 6002 int unit = device_get_unit(dev); 6003 int error; 6004 uint32_t n; 6005 6006 if (usb_test_quirk(uaa, UQ_SINGLE_CMD_MIDI)) 6007 chan->single_command = 1; 6008 |
6002 if (usbd_set_alt_interface_index(sc->sc_udev, chan->iface_index, 6003 chan->iface_alt_index)) { 6004 DPRINTF("setting of alternate index failed!\n"); | 6009 error = usbd_set_alt_interface_index(sc->sc_udev, 6010 chan->iface_index, chan->iface_alt_index); 6011 if (error) { 6012 DPRINTF("setting of alternate index failed: %s\n", 6013 usbd_errstr(error)); |
6005 goto detach; 6006 } 6007 usbd_set_parent_iface(sc->sc_udev, chan->iface_index, 6008 sc->sc_mixer_iface_index); 6009 6010 error = usbd_transfer_setup(uaa->device, &chan->iface_index, 6011 chan->xfer, umidi_config, UMIDI_N_TRANSFER, 6012 chan, &chan->mtx); --- 257 unchanged lines hidden --- | 6014 goto detach; 6015 } 6016 usbd_set_parent_iface(sc->sc_udev, chan->iface_index, 6017 sc->sc_mixer_iface_index); 6018 6019 error = usbd_transfer_setup(uaa->device, &chan->iface_index, 6020 chan->xfer, umidi_config, UMIDI_N_TRANSFER, 6021 chan, &chan->mtx); --- 257 unchanged lines hidden --- |