From owner-svn-src-stable@freebsd.org Mon Apr 16 15:39:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF72AF8C8A3; Mon, 16 Apr 2018 15:39:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A65684DD7; Mon, 16 Apr 2018 15:39:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FAF31F419; Mon, 16 Apr 2018 15:39:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GFdZj2072422; Mon, 16 Apr 2018 15:39:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GFdYWl072415; Mon, 16 Apr 2018 15:39:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804161539.w3GFdYWl072415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Apr 2018 15:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332574 - stable/11/sys/dev/usb/template X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/sys/dev/usb/template X-SVN-Commit-Revision: 332574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 15:39:36 -0000 Author: trasz Date: Mon Apr 16 15:39:34 2018 New Revision: 332574 URL: https://svnweb.freebsd.org/changeset/base/332574 Log: MFC r324626: Replace some magic numbers in usb_template(4) code with #defines. There should be no functional changes. Modified: stable/11/sys/dev/usb/template/usb_template_audio.c stable/11/sys/dev/usb/template/usb_template_kbd.c stable/11/sys/dev/usb/template/usb_template_midi.c stable/11/sys/dev/usb/template/usb_template_modem.c stable/11/sys/dev/usb/template/usb_template_mouse.c stable/11/sys/dev/usb/template/usb_template_phone.c stable/11/sys/dev/usb/template/usb_template_serialnet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:39:34 2018 (r332574) @@ -199,8 +199,8 @@ static const void *audio_raw_iface_0_desc[] = { static const struct usb_temp_interface_desc audio_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = audio_raw_iface_0_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_MIXER, }; @@ -257,8 +257,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac static const struct usb_temp_interface_desc audio_iface_1_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_PLAYBACK, }; @@ -266,8 +266,8 @@ static const struct usb_temp_interface_desc audio_ifac static const struct usb_temp_interface_desc audio_iface_1_alt_1 = { .ppEndpoints = audio_iface_1_ep, .ppRawDesc = audio_raw_iface_1_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_PLAYBACK, .isAltInterface = 1, /* this is an alternate setting */ @@ -315,8 +315,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac static const struct usb_temp_interface_desc audio_iface_2_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_RECORD, }; @@ -324,8 +324,8 @@ static const struct usb_temp_interface_desc audio_ifac static const struct usb_temp_interface_desc audio_iface_2_alt_1 = { .ppEndpoints = audio_iface_2_ep, .ppRawDesc = audio_raw_iface_2_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_RECORD, .isAltInterface = 1, /* this is an alternate setting */ Modified: stable/11/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_kbd.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_kbd.c Mon Apr 16 15:39:34 2018 (r332574) @@ -130,9 +130,9 @@ static const void *keyboard_iface_0_desc[] = { static const struct usb_temp_interface_desc keyboard_iface_0 = { .ppRawDesc = keyboard_iface_0_desc, .ppEndpoints = keyboard_endpoints, - .bInterfaceClass = 3, - .bInterfaceSubClass = 1, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_HID, + .bInterfaceSubClass = UISUBCLASS_BOOT, + .bInterfaceProtocol = UIPROTO_BOOT_KEYBOARD, .iInterface = INDEX_KEYBOARD, }; Modified: stable/11/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_midi.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_midi.c Mon Apr 16 15:39:34 2018 (r332574) @@ -89,8 +89,8 @@ static const void *midi_descs_0[] = { static const struct usb_temp_interface_desc midi_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = midi_descs_0, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_MIDI_IF, }; @@ -171,8 +171,8 @@ static const void *midi_descs_1[] = { static const struct usb_temp_interface_desc midi_iface_1 = { .ppRawDesc = midi_descs_1, .ppEndpoints = midi_iface_1_ep, - .bInterfaceClass = 0x01, /* MIDI */ - .bInterfaceSubClass = 3, /* MIDI streaming */ + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_MIDISTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_MIDI_IF, }; Modified: stable/11/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_modem.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_modem.c Mon Apr 16 15:39:34 2018 (r332574) @@ -156,17 +156,17 @@ static const void *modem_iface_0_desc[] = { static const struct usb_temp_interface_desc modem_iface_0 = { .ppRawDesc = modem_iface_0_desc, .ppEndpoints = modem_iface_0_ep, - .bInterfaceClass = 2, - .bInterfaceSubClass = 2, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_AT, .iInterface = INDEX_MODEM, }; static const struct usb_temp_interface_desc modem_iface_1 = { .ppEndpoints = modem_iface_1_ep, - .bInterfaceClass = 10, - .bInterfaceSubClass = 0, - .bInterfaceProtocol = 0, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = INDEX_MODEM, }; Modified: stable/11/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_mouse.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_mouse.c Mon Apr 16 15:39:34 2018 (r332574) @@ -128,9 +128,9 @@ static const void *mouse_iface_0_desc[] = { static const struct usb_temp_interface_desc mouse_iface_0 = { .ppRawDesc = mouse_iface_0_desc, .ppEndpoints = mouse_endpoints, - .bInterfaceClass = 3, - .bInterfaceSubClass = 1, - .bInterfaceProtocol = 2, + .bInterfaceClass = UICLASS_HID, + .bInterfaceSubClass = UISUBCLASS_BOOT, + .bInterfaceProtocol = UIPROTO_MOUSE, .iInterface = INDEX_MOUSE, }; Modified: stable/11/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_phone.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_phone.c Mon Apr 16 15:39:34 2018 (r332574) @@ -156,8 +156,8 @@ static const void *phone_raw_iface_0_desc[] = { static const struct usb_temp_interface_desc phone_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = phone_raw_iface_0_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_MIXER, }; @@ -213,8 +213,8 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_1_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_PLAYBACK, }; @@ -222,8 +222,8 @@ static const struct usb_temp_interface_desc phone_ifac static const struct usb_temp_interface_desc phone_iface_1_alt_1 = { .ppEndpoints = phone_iface_1_ep, .ppRawDesc = phone_raw_iface_1_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_PLAYBACK, .isAltInterface = 1, /* this is an alternate setting */ @@ -270,8 +270,8 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_2_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_RECORD, }; @@ -279,8 +279,8 @@ static const struct usb_temp_interface_desc phone_ifac static const struct usb_temp_interface_desc phone_iface_2_alt_1 = { .ppEndpoints = phone_iface_2_ep, .ppRawDesc = phone_raw_iface_2_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_RECORD, .isAltInterface = 1, /* this is an alternate setting */ @@ -321,7 +321,7 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_3 = { .ppEndpoints = phone_iface_3_ep, .ppRawDesc = phone_hid_desc_0, - .bInterfaceClass = 3, + .bInterfaceClass = UICLASS_HID, .bInterfaceSubClass = 0, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_HID, Modified: stable/11/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 15:13:18 2018 (r332573) +++ stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 15:39:34 2018 (r332574) @@ -202,7 +202,7 @@ static const struct usb_temp_interface_desc eth_contro .ppRawDesc = eth_control_if_desc, .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, - .bInterfaceProtocol = 0, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = STRING_ETH_CONTROL_INDEX, }; @@ -215,7 +215,7 @@ static const struct usb_temp_endpoint_desc *eth_data_e static const struct usb_temp_interface_desc eth_data_null_interface = { .ppEndpoints = NULL, /* no endpoints */ .bInterfaceClass = UICLASS_CDC_DATA, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = UISUBCLASS_DATA, .bInterfaceProtocol = 0, .iInterface = STRING_ETH_DATA_INDEX, }; @@ -304,16 +304,16 @@ static const void *modem_iface_0_desc[] = { static const struct usb_temp_interface_desc modem_iface_0 = { .ppRawDesc = modem_iface_0_desc, .ppEndpoints = modem_iface_0_ep, - .bInterfaceClass = 2, - .bInterfaceSubClass = 2, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_AT, .iInterface = STRING_MODEM_INDEX, }; static const struct usb_temp_interface_desc modem_iface_1 = { .ppEndpoints = modem_iface_1_ep, - .bInterfaceClass = 10, - .bInterfaceSubClass = 0, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, .bInterfaceProtocol = 0, .iInterface = STRING_MODEM_INDEX, };