Index | Thread | Search

From:
Jan Stary <hans@stare.cz>
Subject:
Re: USB endpoint usage macros
To:
tech@openbsd.org
Date:
Mon, 17 Feb 2025 11:58:10 +0100

Download raw body.

Thread
(This is a step towards tweaking uaudio.c
to support an MAudio Fast Track Ultra 8R)

On Feb 16 18:02:53, hans@stare.cz wrote:
> This diff merely moves the UE_*_USAGE_* macros to usb.h
> where they belong: these are not specific to uaudio
> (even though nothing else seems to be using them now).
> 
> 
> 	Jan
> 
> 
> Index: dev/usb//uaudio.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/uaudio.c,v
> diff -u -p -r1.178 uaudio.c
> --- dev/usb//uaudio.c	7 Jan 2025 12:49:40 -0000	1.178
> +++ dev/usb//uaudio.c	16 Feb 2025 16:44:32 -0000
> @@ -50,15 +50,6 @@
>  #define DEVNAME(sc) ((sc)->dev.dv_xname)
>  
>  /*
> - * Isochronous endpoint usage (XXX: these belong to dev/usb/usb.h).
> - */
> -#define UE_ISO_USAGE			0x30
> -#define  UE_ISO_USAGE_DATA		0x00
> -#define  UE_ISO_USAGE_FEEDBACK		0x10
> -#define  UE_ISO_USAGE_IMPL		0x20
> -#define UE_GET_ISO_USAGE(a)		((a) & UE_ISO_USAGE)
> -
> -/*
>   * Max length of unit names
>   */
>  #define UAUDIO_NAMEMAX			MAX_AUDIO_DEV_LEN
> Index: dev/usb//usb.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/usb.h,v
> diff -u -p -r1.63 usb.h
> --- dev/usb//usb.h	23 May 2024 03:21:09 -0000	1.63
> +++ dev/usb//usb.h	16 Feb 2025 16:44:32 -0000
> @@ -283,6 +283,15 @@ typedef struct usb_endpoint_ss_comp_desc
>  #define USB_ENDPOINT_SS_COMP_DESCRIPTOR_SIZE 6
>  
>  /*
> + * Isochronous endpoint usage
> + */
> +#define UE_ISO_USAGE			0x30
> +#define  UE_ISO_USAGE_DATA		0x00
> +#define  UE_ISO_USAGE_FEEDBACK		0x10
> +#define  UE_ISO_USAGE_IMPL		0x20
> +#define UE_GET_ISO_USAGE(a)		((a) & UE_ISO_USAGE)
> +
> +/*
>   * Note: The length of the USB string descriptor is stored in a one byte
>   * value and can therefore be no longer than 255 bytes.  Two bytes are
>   * used for the length itself and the descriptor type, a theoretical maximum

> Index: dev/usb//uaudio.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/uaudio.c,v
> diff -u -p -r1.178 uaudio.c
> --- dev/usb//uaudio.c	7 Jan 2025 12:49:40 -0000	1.178
> +++ dev/usb//uaudio.c	16 Feb 2025 16:44:32 -0000
> @@ -50,15 +50,6 @@
>  #define DEVNAME(sc) ((sc)->dev.dv_xname)
>  
>  /*
> - * Isochronous endpoint usage (XXX: these belong to dev/usb/usb.h).
> - */
> -#define UE_ISO_USAGE			0x30
> -#define  UE_ISO_USAGE_DATA		0x00
> -#define  UE_ISO_USAGE_FEEDBACK		0x10
> -#define  UE_ISO_USAGE_IMPL		0x20
> -#define UE_GET_ISO_USAGE(a)		((a) & UE_ISO_USAGE)
> -
> -/*
>   * Max length of unit names
>   */
>  #define UAUDIO_NAMEMAX			MAX_AUDIO_DEV_LEN
> Index: dev/usb//usb.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/usb.h,v
> diff -u -p -r1.63 usb.h
> --- dev/usb//usb.h	23 May 2024 03:21:09 -0000	1.63
> +++ dev/usb//usb.h	16 Feb 2025 16:44:32 -0000
> @@ -283,6 +283,15 @@ typedef struct usb_endpoint_ss_comp_desc
>  #define USB_ENDPOINT_SS_COMP_DESCRIPTOR_SIZE 6
>  
>  /*
> + * Isochronous endpoint usage
> + */
> +#define UE_ISO_USAGE			0x30
> +#define  UE_ISO_USAGE_DATA		0x00
> +#define  UE_ISO_USAGE_FEEDBACK		0x10
> +#define  UE_ISO_USAGE_IMPL		0x20
> +#define UE_GET_ISO_USAGE(a)		((a) & UE_ISO_USAGE)
> +
> +/*
>   * Note: The length of the USB string descriptor is stored in a one byte
>   * value and can therefore be no longer than 255 bytes.  Two bytes are
>   * used for the length itself and the descriptor type, a theoretical maximum