VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h@ 90767

Last change on this file since 90767 was 90766, checked in by vboxsync, 3 years ago

Audio/ValKit: Decoupled the driver stack from the test environment, so that two test environments can use the same driver stack -- needed for self-tests and also is a cleaner solution. bugref:10008

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.3 KB
Line 
1/* $Id: vkatInternal.h 90766 2021-08-20 17:30:57Z vboxsync $ */
2/** @file
3 * VKAT - Internal header file for common definitions + structs.
4 */
5
6/*
7 * Copyright (C) 2021 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef VBOX_INCLUDED_SRC_audio_vkatInternal_h
28#define VBOX_INCLUDED_SRC_audio_vkatInternal_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33
34/*********************************************************************************************************************************
35* Header Files *
36*********************************************************************************************************************************/
37#include <iprt/getopt.h>
38
39#include <VBox/vmm/pdmdrv.h>
40#include <VBox/vmm/pdmaudioinline.h>
41#include <VBox/vmm/pdmaudiohostenuminline.h>
42
43#include "Audio/AudioMixBuffer.h"
44#include "Audio/AudioTest.h"
45#include "Audio/AudioTestService.h"
46#include "Audio/AudioTestServiceClient.h"
47
48#include "VBoxDD.h"
49
50
51/*********************************************************************************************************************************
52* Structures and Typedefs *
53*********************************************************************************************************************************/
54/**
55 * Audio driver stack.
56 *
57 * This can be just be backend driver alone or DrvAudio with a backend.
58 * @todo add automatic resampling via mixer so we can test more of the audio
59 * stack used by the device emulations.
60 */
61typedef struct AUDIOTESTDRVSTACK
62{
63 /** The device registration record for the backend. */
64 PCPDMDRVREG pDrvReg;
65 /** The backend driver instance. */
66 PPDMDRVINS pDrvBackendIns;
67 /** The backend's audio interface. */
68 PPDMIHOSTAUDIO pIHostAudio;
69
70 /** The DrvAudio instance. */
71 PPDMDRVINS pDrvAudioIns;
72 /** This is NULL if we don't use DrvAudio. */
73 PPDMIAUDIOCONNECTOR pIAudioConnector;
74
75 /** The current (last) audio device enumeration to use. */
76 PDMAUDIOHOSTENUM DevEnum;
77} AUDIOTESTDRVSTACK;
78/** Pointer to an audio driver stack. */
79typedef AUDIOTESTDRVSTACK *PAUDIOTESTDRVSTACK;
80
81/**
82 * Backend-only stream structure.
83 */
84typedef struct AUDIOTESTDRVSTACKSTREAM
85{
86 /** The public stream data. */
87 PDMAUDIOSTREAM Core;
88 /** The backend data (variable size). */
89 PDMAUDIOBACKENDSTREAM Backend;
90} AUDIOTESTDRVSTACKSTREAM;
91/** Pointer to a backend-only stream structure. */
92typedef AUDIOTESTDRVSTACKSTREAM *PAUDIOTESTDRVSTACKSTREAM;
93
94/**
95 * Mixer setup for a stream.
96 */
97typedef struct AUDIOTESTDRVMIXSTREAM
98{
99 /** Pointer to the driver stack. */
100 PAUDIOTESTDRVSTACK pDrvStack;
101 /** Pointer to the stream. */
102 PPDMAUDIOSTREAM pStream;
103 /** Properties to use. */
104 PCPDMAUDIOPCMPROPS pProps;
105 /** Set if we're mixing or just passing thru to the driver stack. */
106 bool fDoMixing;
107 /** Mixer buffer. */
108 AUDIOMIXBUF MixBuf;
109 /** Write state. */
110 AUDIOMIXBUFWRITESTATE WriteState;
111 /** Peek state. */
112 AUDIOMIXBUFPEEKSTATE PeekState;
113} AUDIOTESTDRVMIXSTREAM;
114/** Pointer to mixer setup for a stream. */
115typedef AUDIOTESTDRVMIXSTREAM *PAUDIOTESTDRVMIXSTREAM;
116
117/**
118 * Enumeration specifying the current audio test mode.
119 */
120typedef enum AUDIOTESTMODE
121{
122 /** Unknown mode. */
123 AUDIOTESTMODE_UNKNOWN = 0,
124 /** VKAT is running on the guest side. */
125 AUDIOTESTMODE_GUEST,
126 /** VKAT is running on the host side. */
127 AUDIOTESTMODE_HOST
128} AUDIOTESTMODE;
129
130struct AUDIOTESTENV;
131/** Pointer a audio test environment. */
132typedef AUDIOTESTENV *PAUDIOTESTENV;
133
134struct AUDIOTESTDESC;
135/** Pointer a audio test descriptor. */
136typedef AUDIOTESTDESC *PAUDIOTESTDESC;
137
138/**
139 * Callback to set up the test parameters for a specific test.
140 *
141 * @returns IPRT status code.
142 * @retval VINF_SUCCESS if setting the parameters up succeeded. Any other error code
143 * otherwise indicating the kind of error.
144 * @param pszTest Test name.
145 * @param pTstParmsAcq The audio test parameters to set up.
146 */
147typedef DECLCALLBACKTYPE(int, FNAUDIOTESTSETUP,(PAUDIOTESTENV pTstEnv, PAUDIOTESTDESC pTstDesc, PAUDIOTESTPARMS pTstParmsAcq, void **ppvCtx));
148/** Pointer to an audio test setup callback. */
149typedef FNAUDIOTESTSETUP *PFNAUDIOTESTSETUP;
150
151typedef DECLCALLBACKTYPE(int, FNAUDIOTESTEXEC,(PAUDIOTESTENV pTstEnv, void *pvCtx, PAUDIOTESTPARMS pTstParms));
152/** Pointer to an audio test exec callback. */
153typedef FNAUDIOTESTEXEC *PFNAUDIOTESTEXEC;
154
155typedef DECLCALLBACKTYPE(int, FNAUDIOTESTDESTROY,(PAUDIOTESTENV pTstEnv, void *pvCtx));
156/** Pointer to an audio test destroy callback. */
157typedef FNAUDIOTESTDESTROY *PFNAUDIOTESTDESTROY;
158
159/**
160 * Structure for keeping an audio test audio stream.
161 */
162typedef struct AUDIOTESTSTREAM
163{
164 /** The PDM stream. */
165 PPDMAUDIOSTREAM pStream;
166 /** The backend stream. */
167 PPDMAUDIOBACKENDSTREAM pBackend;
168 /** The stream config. */
169 PDMAUDIOSTREAMCFG Cfg;
170 /** Associated mixing stream. Optional. */
171 AUDIOTESTDRVMIXSTREAM Mix;
172} AUDIOTESTSTREAM;
173/** Pointer to audio test stream. */
174typedef AUDIOTESTSTREAM *PAUDIOTESTSTREAM;
175
176/** Maximum audio streams a test environment can handle. */
177#define AUDIOTESTENV_MAX_STREAMS 8
178
179/**
180 * Structure for keeping TCP/IP-specific options.
181 */
182typedef struct AUDIOTESTENVTCPOPTS
183{
184 /** Bind address (server mode). When empty, "0.0.0.0" (any host) will be used. */
185 char szTcpBindAddr[128];
186 /** Bind port (server mode). */
187 uint16_t uTcpBindPort;
188 /** Connection address (client mode). */
189 char szTcpConnectAddr[128];
190 /** Connection port (client mode). */
191 uint16_t uTcpConnectPort;
192} AUDIOTESTENVTCPOPTS;
193typedef AUDIOTESTENVTCPOPTS *PAUDIOTESTENVTCPOPTS;
194
195/**
196 * Audio test environment parameters.
197 * Not necessarily bound to a specific test (can be reused).
198 */
199typedef struct AUDIOTESTENV
200{
201 /** Audio testing mode. */
202 AUDIOTESTMODE enmMode;
203 /** Whether self test mode is active or not. */
204 bool fSelftest;
205 /** Whether skip the actual verification or not. */
206 bool fSkipVerify;
207 /** The PCM properties to use. */
208 PDMAUDIOPCMPROPS Props;
209 /** Name of the audio device to use.
210 * If empty the default audio device will be used. */
211 char szDev[128];
212 /** Audio volume to use (in percent).
213 * Might not be available on all systems. */
214 uint8_t uVolumePercent;
215 /** Output path for storing the test environment's final test files. */
216 char szTag[AUDIOTEST_TAG_MAX];
217 /** Output path for storing the test environment's final test files. */
218 char szPathOut[RTPATH_MAX];
219 /** Temporary path for this test environment. */
220 char szPathTemp[RTPATH_MAX];
221 /** Buffer size (in ms). */
222 RTMSINTERVAL cMsBufferSize;
223 /** Pre-buffering time (in ms). */
224 RTMSINTERVAL cMsPreBuffer;
225 /** Scheduling hint (in ms). */
226 RTMSINTERVAL cMsSchedulingHint;
227 /** Pointer to audio test driver stack to use. */
228 PAUDIOTESTDRVSTACK pDrvStack;
229 /** Audio stream. */
230 AUDIOTESTSTREAM aStreams[AUDIOTESTENV_MAX_STREAMS];
231 /** The audio test set to use. */
232 AUDIOTESTSET Set;
233 union
234 {
235 struct
236 {
237 AUDIOTESTENVTCPOPTS TcpOpts;
238 /** ATS instance to use. */
239 ATSSERVER Srv;
240 } Guest;
241 struct
242 {
243 AUDIOTESTENVTCPOPTS TcpOpts;
244 /** ATS instance to use. */
245 ATSSERVER Srv;
246 /** Client connected to the ATS on the guest side. */
247 ATSCLIENT AtsClGuest;
248 /** Path to the guest's test set downloaded to the host. */
249 char szPathTestSetGuest[RTPATH_MAX];
250 /** Client connected to the Validation Kit audio driver ATS. */
251 ATSCLIENT AtsClValKit;
252 /** Path to the Validation Kit audio driver's test set downloaded to the host. */
253 char szPathTestSetValKit[RTPATH_MAX];
254 } Host;
255 } u;
256 AUDIOTESTENVTCPOPTS ValKitTcpOpts;
257} AUDIOTESTENV;
258
259/**
260 * Audio test descriptor.
261 */
262typedef struct AUDIOTESTDESC
263{
264 /** (Sort of) Descriptive test name. */
265 const char *pszName;
266 /** Flag whether the test is excluded. */
267 bool fExcluded;
268 /** The setup callback. */
269 PFNAUDIOTESTSETUP pfnSetup;
270 /** The exec callback. */
271 PFNAUDIOTESTEXEC pfnExec;
272 /** The destruction callback. */
273 PFNAUDIOTESTDESTROY pfnDestroy;
274} AUDIOTESTDESC;
275
276/**
277 * Structure for keeping a VKAT self test context.
278 */
279typedef struct SELFTESTCTX
280{
281 /** Common tag for guest and host side. */
282 char szTag[AUDIOTEST_TAG_MAX];
283 /** Whether to use DrvAudio in the driver stack or not. */
284 bool fWithDrvAudio;
285 AUDIOTESTDRVSTACK DrvStack;
286 /** Audio driver to use.
287 * Defaults to the platform's default driver. */
288 PCPDMDRVREG pDrvReg;
289 struct
290 {
291 AUDIOTESTENV TstEnv;
292 /** Where to bind the address of the guest ATS instance to.
293 * Defaults to localhost (127.0.0.1) if empty. */
294 char szAtsAddr[64];
295 /** Port of the guest ATS instance.
296 * Defaults to ATS_ALT_PORT if not set. */
297 uint32_t uAtsPort;
298 } Guest;
299 struct
300 {
301 AUDIOTESTENV TstEnv;
302 /** Address of the guest ATS instance.
303 * Defaults to localhost (127.0.0.1) if not set. */
304 char szGuestAtsAddr[64];
305 /** Port of the guest ATS instance.
306 * Defaults to ATS_DEFAULT_PORT if not set. */
307 uint32_t uGuestAtsPort;
308 /** Address of the Validation Kit audio driver ATS instance.
309 * Defaults to localhost (127.0.0.1) if not set. */
310 char szValKitAtsAddr[64];
311 /** Port of the Validation Kit audio driver ATS instance.
312 * Defaults to ATS_ALT_PORT if not set. */
313 uint32_t uValKitAtsPort;
314 } Host;
315} SELFTESTCTX;
316/** Pointer to a VKAT self test context. */
317typedef SELFTESTCTX *PSELFTESTCTX;
318
319/**
320 * VKAT command table entry.
321 */
322typedef struct VKATCMD
323{
324 /** The command name. */
325 const char *pszCommand;
326 /** The command handler. */
327 DECLCALLBACKMEMBER(RTEXITCODE, pfnHandler,(PRTGETOPTSTATE pGetState));
328
329 /** Command description. */
330 const char *pszDesc;
331 /** Options array. */
332 PCRTGETOPTDEF paOptions;
333 /** Number of options in the option array. */
334 size_t cOptions;
335 /** Gets help for an option. */
336 DECLCALLBACKMEMBER(const char *, pfnOptionHelp,(PCRTGETOPTDEF pOpt));
337 /** Flag indicating if the command needs the ATS transport layer.
338 * Needed for command line parsing. */
339 bool fNeedsTransport;
340} VKATCMD;
341/** Pointer to a const VKAT command entry. */
342typedef VKATCMD const *PCVKATCMD;
343
344
345/*********************************************************************************************************************************
346* Global Variables *
347*********************************************************************************************************************************/
348/** Terminate ASAP if set. Set on Ctrl-C. */
349extern bool volatile g_fTerminate;
350/** The release logger. */
351extern PRTLOGGER g_pRelLogger;
352
353/** The test handle. */
354extern RTTEST g_hTest;
355extern unsigned g_uVerbosity;
356extern bool g_fDrvAudioDebug;
357extern const char *g_pszDrvAudioDebug;
358
359/** The test handle. */
360extern RTTEST g_hTest;
361/** The current verbosity level. */
362extern unsigned g_uVerbosity;
363/** DrvAudio: Enable debug (or not). */
364extern bool g_fDrvAudioDebug;
365/** DrvAudio: The debug output path. */
366extern const char *g_pszDrvAudioDebug;
367
368extern const VKATCMD g_CmdEnum;
369extern const VKATCMD g_CmdPlay;
370extern const VKATCMD g_CmdRec;
371extern const VKATCMD g_CmdSelfTest;
372
373extern AUDIOTESTDESC g_aTests[];
374extern unsigned g_cTests;
375
376
377/*********************************************************************************************************************************
378* Prototypes *
379*********************************************************************************************************************************/
380
381/** @name Command line handlers
382 * @{ */
383RTEXITCODE audioTestUsage(PRTSTREAM pStrm);
384RTEXITCODE audioTestVersion(void);
385void audioTestShowLogo(PRTSTREAM pStream);
386/** @} */
387
388/** @name Driver stack
389 * @{ */
390void audioTestDriverStackDelete(PAUDIOTESTDRVSTACK pDrvStack);
391int audioTestDriverStackInitEx(PAUDIOTESTDRVSTACK pDrvStack, PCPDMDRVREG pDrvReg, bool fEnabledIn, bool fEnabledOut, bool fWithDrvAudio);
392int audioTestDriverStackInit(PAUDIOTESTDRVSTACK pDrvStack, PCPDMDRVREG pDrvReg, bool fWithDrvAudio);
393int audioTestDriverStackSetDevice(PAUDIOTESTDRVSTACK pDrvStack, PDMAUDIODIR enmDir, const char *pszDevId);
394/** @} */
395
396/** @name Driver
397 * @{ */
398int audioTestDrvConstruct(PAUDIOTESTDRVSTACK pDrvStack, PCPDMDRVREG pDrvReg, PPDMDRVINS pParentDrvIns, PPPDMDRVINS ppDrvIns);
399/** @} */
400
401/** @name Driver stack stream
402 * @{ */
403int audioTestDriverStackStreamCreateInput(PAUDIOTESTDRVSTACK pDrvStack, PCPDMAUDIOPCMPROPS pProps,
404 uint32_t cMsBufferSize, uint32_t cMsPreBuffer, uint32_t cMsSchedulingHint,
405 PPDMAUDIOSTREAM *ppStream, PPDMAUDIOSTREAMCFG pCfgAcq);
406int audioTestDriverStackStreamCreateOutput(PAUDIOTESTDRVSTACK pDrvStack, PCPDMAUDIOPCMPROPS pProps,
407 uint32_t cMsBufferSize, uint32_t cMsPreBuffer, uint32_t cMsSchedulingHint,
408 PPDMAUDIOSTREAM *ppStream, PPDMAUDIOSTREAMCFG pCfgAcq);
409void audioTestDriverStackStreamDestroy(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
410int audioTestDriverStackStreamDrain(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream, bool fSync);
411int audioTestDriverStackStreamEnable(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
412int AudioTestDriverStackStreamDisable(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
413bool audioTestDriverStackStreamIsOkay(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
414uint32_t audioTestDriverStackStreamGetWritable(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
415int audioTestDriverStackStreamPlay(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream, void const *pvBuf,
416 uint32_t cbBuf, uint32_t *pcbPlayed);
417uint32_t audioTestDriverStackStreamGetReadable(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream);
418int audioTestDriverStackStreamCapture(PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream,
419 void *pvBuf, uint32_t cbBuf, uint32_t *pcbCaptured);
420/** @} */
421
422/** @name Backend handling
423 * @{ */
424PCPDMDRVREG AudioTestGetDefaultBackend(void);
425PCPDMDRVREG AudioTestFindBackendOpt(const char *pszBackend);
426/** @} */
427
428/** @name Mixing stream
429 * @{ */
430int AudioTestMixStreamInit(PAUDIOTESTDRVMIXSTREAM pMix, PAUDIOTESTDRVSTACK pDrvStack, PPDMAUDIOSTREAM pStream,
431 PCPDMAUDIOPCMPROPS pProps, uint32_t cMsBuffer);
432void AudioTestMixStreamTerm(PAUDIOTESTDRVMIXSTREAM pMix);
433int AudioTestMixStreamEnable(PAUDIOTESTDRVMIXSTREAM pMix);
434int AudioTestMixStreamDrain(PAUDIOTESTDRVMIXSTREAM pMix, bool fSync);
435int AudioTestMixStreamDisable(PAUDIOTESTDRVMIXSTREAM pMix);
436bool AudioTestMixStreamIsOkay(PAUDIOTESTDRVMIXSTREAM pMix);
437uint32_t AudioTestMixStreamGetWritable(PAUDIOTESTDRVMIXSTREAM pMix);
438int AudioTestMixStreamPlay(PAUDIOTESTDRVMIXSTREAM pMix, void const *pvBuf, uint32_t cbBuf, uint32_t *pcbPlayed);
439uint32_t AudioTestMixStreamGetReadable(PAUDIOTESTDRVMIXSTREAM pMix);
440int AudioTestMixStreamCapture(PAUDIOTESTDRVMIXSTREAM pMix, void *pvBuf, uint32_t cbBuf, uint32_t *pcbCaptured);
441/** @} */
442
443/** @name Device handling
444 * @{ */
445int audioTestDeviceOpen(PPDMAUDIOHOSTDEV pDev);
446int audioTestDeviceClose(PPDMAUDIOHOSTDEV pDev);
447
448int audioTestDevicesEnumerateAndCheck(PAUDIOTESTDRVSTACK pDrvStack, const char *pszDev, PPDMAUDIOHOSTDEV *ppDev);
449/** @} */
450
451/** @name ATS routines
452 * @{ */
453int audioTestEnvConnectToValKitAts(PAUDIOTESTENV pTstEnv,
454 const char *pszHostTcpAddr, uint32_t uHostTcpPort);
455/** @} */
456
457/** @name Test environment handling
458 * @{ */
459int audioTestEnvInit(PAUDIOTESTENV pTstEnv, PAUDIOTESTDRVSTACK pDrvStack);
460void audioTestEnvDestroy(PAUDIOTESTENV pTstEnv);
461int audioTestEnvPrologue(PAUDIOTESTENV pTstEnv, bool fPack, char *pszPackFile, size_t cbPackFile);
462
463void audioTestParmsInit(PAUDIOTESTPARMS pTstParms);
464void audioTestParmsDestroy(PAUDIOTESTPARMS pTstParms);
465/** @} */
466
467int audioTestWorker(PAUDIOTESTENV pTstEnv);
468
469/** @todo Test tone handling */
470int audioTestPlayTone(PAUDIOTESTENV pTstEnv, PAUDIOTESTSTREAM pStream, PAUDIOTESTTONEPARMS pParms);
471/** @} */
472
473/** @name Command handlers
474 * @{ */
475RTEXITCODE audioTestDoSelftest(PSELFTESTCTX pCtx);
476/** @} */
477
478
479/*********************************************************************************************************************************
480* Common command line stuff *
481*********************************************************************************************************************************/
482
483/**
484 * Common long options values.
485 */
486enum
487{
488 AUDIO_TEST_OPT_CMN_DAEMONIZE = 256,
489 AUDIO_TEST_OPT_CMN_DAEMONIZED,
490 AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE,
491 AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH
492};
493
494/** For use in the option switch to handle common options. */
495#define AUDIO_TEST_COMMON_OPTION_CASES(a_ValueUnion) \
496 case 'q': \
497 g_uVerbosity = 0; \
498 if (g_pRelLogger) \
499 RTLogGroupSettings(g_pRelLogger, "all=0 all.e"); \
500 break; \
501 \
502 case 'v': \
503 g_uVerbosity++; \
504 if (g_pRelLogger) \
505 RTLogGroupSettings(g_pRelLogger, g_uVerbosity == 1 ? "all.e.l" : g_uVerbosity == 2 ? "all.e.l.f" : "all=~0"); \
506 break; \
507 \
508 case 'V': \
509 return audioTestVersion(); \
510 \
511 case 'h': \
512 audioTestShowLogo(g_pStdOut); \
513 return audioTestUsage(g_pStdOut); \
514 \
515 case AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE: \
516 g_fDrvAudioDebug = true; \
517 break; \
518 \
519 case AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH: \
520 g_pszDrvAudioDebug = (a_ValueUnion).psz; \
521 break; \
522 case AUDIO_TEST_OPT_CMN_DAEMONIZE: \
523 break; \
524 case AUDIO_TEST_OPT_CMN_DAEMONIZED: \
525 break;
526
527#endif /* !VBOX_INCLUDED_SRC_audio_vkatInternal_h */
528
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette