~ubuntu-branches/ubuntu/intrepid/raidutils/intrepid

« back to all changes in this revision

Viewing changes to raidutil/listdev.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Barak Pearlmutter
  • Date: 2004-05-18 11:33:42 UTC
  • Revision ID: james.westby@ubuntu.com-20040518113342-tyqavmso5q351xi2
Tags: upstream-0.0.4
ImportĀ upstreamĀ versionĀ 0.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 1996-2004, Adaptec Corporation
 
2
 * All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions are met:
 
6
 *
 
7
 * - Redistributions of source code must retain the above copyright notice, this
 
8
 *   list of conditions and the following disclaimer.
 
9
 * - Redistributions in binary form must reproduce the above copyright notice,
 
10
 *   this list of conditions and the following disclaimer in the documentation
 
11
 *   and/or other materials provided with the distribution.
 
12
 * - Neither the name of the Adaptec Corporation nor the names of its
 
13
 *   contributors may be used to endorse or promote products derived from this
 
14
 *   software without specific prior written permission.
 
15
 *
 
16
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
17
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
18
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
19
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 
20
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
21
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
22
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
23
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
24
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
25
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
26
 * POSSIBILITY OF SUCH DAMAGE.
 
27
 */
 
28
 
 
29
#ifndef LISTDEV_HPP
 
30
#define LISTDEV_HPP
 
31
 
 
32
/****************************************************************************
 
33
*
 
34
* Created:  7/21/98
 
35
*
 
36
*****************************************************************************
 
37
*
 
38
* File Name:            ListDev.hpp
 
39
* Module:
 
40
* Contributors:         Lee Page
 
41
* Description:
 
42
* Version Control:
 
43
*
 
44
* $Revision: 23 $
 
45
* $NoKeywords: $
 
46
* $Log: $
 
47
*****************************************************************************/
 
48
 
 
49
/*** INCLUDES ***/
 
50
#include "scsiaddr.hpp"
 
51
#include "bufio.h"
 
52
/*** CONSTANTS ***/
 
53
/*** TYPES ***/
 
54
/*** STATIC DATA ***/
 
55
/*** MACROS ***/
 
56
/*** PROTOTYPES ***/
 
57
/*** FUNCTIONS ***/
 
58
class List_Device: public Command
 
59
        {
 
60
        public:
 
61
                enum list_Type
 
62
                        {
 
63
                        LIST_INVALID_DEVICE_TYPE,
 
64
                        LIST_LOGICALS,
 
65
                        LIST_PHYSICALS,
 
66
                        LIST_CONTROLLERS,
 
67
                        LIST_HOT_SPARES,
 
68
                        LIST_ARRAY,
 
69
                        LIST_ALL,
 
70
                        LIST_SPEED,
 
71
         LIST_REDIRECT,
 
72
         LIST_CACHE,
 
73
         LIST_VERSION,
 
74
         LIST_INQUIRY,
 
75
         LIST_BATTERY,
 
76
         LIST_TAGS,
 
77
                 // Added by Qi Zhu, for disk Maxtor FW showing
 
78
                 LIST_INQUIRY_VENDOR,
 
79
                 LIST_ALL_VENDOR,
 
80
                 LIST_ARRAYNAME
 
81
                        };
 
82
 
 
83
                // list all devices of this type...
 
84
                List_Device( list_Type what );
 
85
                // list devices connected to this device...
 
86
                List_Device( list_Type what, SCSI_Address &address_to_List );
 
87
                List_Device( const List_Device &right );
 
88
                Dpt_Error List_Device_Speeds( String_List& output );
 
89
 
 
90
                virtual ~List_Device();
 
91
 
 
92
                Dpt_Error       execute( String_List **output );
 
93
                Command         &Clone() const;
 
94
 
 
95
        private:
 
96
                Dpt_Error               List_Log_Devices(
 
97
                                                        String_List             &output,
 
98
                                                        get_Devs_Type   devs_Type);
 
99
 
 
100
      Dpt_Error      List_LSU_Devices(
 
101
                                                        String_List             &output);
 
102
 
 
103
      Dpt_Error         List_Devices (String_List &output);
 
104
 
 
105
      Dpt_Error    List_Tags(String_List &output);
 
106
 
 
107
      Dpt_Error      List_Battery_Info(
 
108
                                                String_List             &output,
 
109
                                                DPT_TAG_T               hbaTag);
 
110
 
 
111
      Dpt_Error         List_This_Device(
 
112
                                                        String_List             &output,
 
113
                                                        DPT_TAG_T               this_Objs_Tag,
 
114
                                                        get_Devs_Type   devs_Type);
 
115
 
 
116
                Dpt_Error               List_This_Devices_Speed(
 
117
                            int dev_chan,
 
118
                            String_List     &output,
 
119
                            DPT_TAG_T       this_Objs_Tag);
 
120
      Dpt_Error      GetSpeedFromNvram (DPT_TAG_T this_Objs_Tag);
 
121
      Dpt_Error      GetSpeedFromHW (int dev_chan);
 
122
 
 
123
      void Show_Physical(String_List &output, 
 
124
                  char * obj_Type_Str, int indent, bool show_Capacity, 
 
125
                  long capacity_in_Mb, DPT_TAG_T this_Objs_Tag, get_Devs_Type devs_Type);
 
126
 
 
127
      Dpt_Error List_Inquiry(String_List &output);
 
128
      void Show_Cache_Mode(DPT_TAG_T obj_Tag, get_Devs_Type devs_Type, String_List &output);
 
129
 
 
130
      void GetSmorBiosSignatures(DPT_TAG_T this_Objs_Tag,
 
131
                                       String_List &output);
 
132
      Dpt_Error Look_for_Hot_Spares (String_List &output,
 
133
                                     uLONG smallLBA,
 
134
                                     get_Devs_Type      devs_Type);
 
135
 
 
136
                SCSI_Address obj_Root;
 
137
                list_Type    list_What;
 
138
      bool printDummyStr;
 
139
                DPT_TAG_T        hba_Tag;
 
140
      int save_indent;
 
141
      bool add_plus;
 
142
      uSHORT NvramMegaHertz;
 
143
      uSHORT HwMegaHertz;
 
144
        };
 
145
 
 
146
#endif
 
147
/*** END OF FILE ***/