leoinquiry.c
2.8 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* F i l e N a m e : l e o i n q u i r y .c
*
****************************************************************************
* (C) Copyright ALPS Electric Co., Ltd. 1995-1996
****************************************************************************
* Version:
*
* ver date
* ---- ---------
* 1.03 '98-02-17 Add WRITER drive type for B114 .
* 1.02 '97-11-18 Add MECHA-CON version to VERSION byte(b7-b4).
* 1.01 '96-02-27 Rename inquiry.c to leoinquiry.c .
* 1.00 '95-12-17 Initial Revision.
****************************************************************************
*/
#define _WRITER
#include "os.h"
#include <ultra64.h>
#include "leodefine.h"
#include "leodrive.h"
#include "leomacro.h"
#include "leoappli.h"
/*************************************/
/* PROTOTYPE DEFINITONS */
/*************************************/
void leoInquiry(void);
/*************************************/
/* EXTERNAL FUNCTIONS */
/*************************************/
extern OSMesg LEOcur_command;
extern OSPiHandle *LEOPiInfo;
/*************************************/
/* LOCAL DEFINETION */
/*************************************/
#define inq_cmd ((LEOCmdInquiry *)LEOcur_command)
#define DEVICE_TYPE 0x00 /* DF3A9U011A */
#define DEVICE_NUMBER 0x01 /* NUMBER OF DEVICE */
/* ==========================================================================
* 関数名 : leoInquiry
* --------------------------------------------------------------------------
* 機能 : INQUIRY COMMNAD
* --------------------------------------------------------------------------
* 入力変数 : 無し
* 出力変数 : 無し
* 引数 : 無し
* 戻り値 : 無し
* ==========================================================================
*/
void leoInquiry(void)
{
u32 asic_id;
u32 asic_data;
#ifdef _WRITER
leoGet_leo_asic_id(&asic_id);
leoSend_asic_cmd_w(ASIC_RD_VERSION, 0);
leoGet_leo_asic_data(&asic_data);
if ((asic_data & 0xf0000000) == 0x70000000)
asic_id = 0x00050000;
#else
leoGet_leo_asic_id(&asic_id);
#endif
if (leoSend_asic_cmd_w(ASIC_RD_PROGRAM_VERSION, 0) == LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION)
{
leoGet_leo_asic_data(&asic_data);
if (asic_data & 0x00010000)
asic_id |= 0x00100000;
}
inq_cmd->dev_type = DEVICE_TYPE;
inq_cmd->version = (u8)(asic_id >> 16 );
inq_cmd->dev_num = DEVICE_NUMBER;
inq_cmd->leo_bios_ver = (u8)0;
#ifdef _ERRCHK
if (inq_cmd->header.sense = inq_cmd->header.reserve1 )
inq_cmd->header.status = LEO_STATUS_CHECK_CONDITION;
else
inq_cmd->header.status = LEO_STATUS_GOOD;
#else
/* ALWAYS GOOD */
inq_cmd->header.status = LEO_STATUS_GOOD;
#endif
}