contquery.c
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**************************************************************************
* *
* Copyright (C) 1995, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
#include "osint.h"
#include "controller.h"
#include "siint.h"
/*
* This call issues a query command to controllers to get the status
* and controller type information.
* A value of 0 is returned if the calls succeed, otherwise
* -1 is returned
*/
s32
osContStartQuery(OSMesgQueue *mq)
{
s32 ret = 0;
/* Block to get resource token */
__osSiGetAccess();
if (CONT_REQUEST != __osContLastCmd) {
/* Set up request command format for all channels */
__osPackRequestData(CONT_REQUEST);
ret = __osSiRawStartDma(OS_WRITE, &__osContPifRam);
(void)osRecvMesg(mq, (OSMesg *)NULL, OS_MESG_BLOCK);
}
/* trigger pifmacro */
ret = __osSiRawStartDma(OS_READ, &__osContPifRam);
/*
* Always make the last command an illegal one, so we never optimize
* out the DMA write
*/
__osContLastCmd = CONT_SETCH - 1;
/* Return resource token */
__osSiRelAccess();
return(ret);
}
/*
* Reformat the 64 bytes RAM data into RequestData format
* and check error code.
*/
void
osContGetQuery(OSContStatus *data)
{
u8 pattern;
__osContGetInitData(&pattern, data);
}