Skip to content
Snippets Groups Projects
Select Git revision
  • 660ebe288457d79f2a19d61374b01658ee9ba9f7
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

scsiprint.cpp

Blame
  • scsiprint.cpp 12.82 KiB
    /*
     * scsiprint.c
     *
     * Home page of code is: http://smartmontools.sourceforge.net
     *
     * Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
     * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2, or (at your option)
     * any later version.
     *
     * You should have received a copy of the GNU General Public License
     * (for example COPYING); if not, write to the Free
     * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     *
     * This code was originally developed as a Senior Thesis by Michael Cornwell
     * at the Concurrent Systems Laboratory (now part of the Storage Systems
     * Research Center), Jack Baskin School of Engineering, University of
     * California, Santa Cruz. http://ssrc.soe.ucsc.edu/
     *
     */
    
    
    #include <stdio.h>
    #include <unistd.h>
    #include <string.h>
    #include <fcntl.h>
    #include <errno.h>
    
    #include "extern.h"
    #include "scsicmds.h"
    #include "scsiprint.h"
    #include "smartctl.h"
    #include "utility.h"
    
    #define GBUF_SIZE 65535
    
    const char* scsiprint_c_cvsid="$Id: scsiprint.cpp,v 1.19 2003/01/16 15:28:57 ballen4705 Exp $"
    EXTERN_H_CVSID SCSICMDS_H_CVSID SCSIPRINT_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
    
    // control block which points to external global control variables
    extern atamainctrl *con;
    
    UINT8 gBuf[GBUF_SIZE];
    
    UINT8 gSmartPage = 0;
    UINT8 gTempPage = 0;
    UINT8 gSelfTestPage = 0;
    UINT8 gStartStopPage = 0;
    UINT8 gTapeAlertsPage = 0;
    
    
    
    
    
    void scsiGetSupportPages ( int device)
    {
       int i;
    
       if (logsense ( device , SUPPORT_LOG_PAGES, (UINT8 *) &gBuf) != 0)
       {
           perror ( "Log Sense failed"); 
           exit (1);
       } 
    
       for ( i = 4; i < gBuf[3] + LOGPAGEHDRSIZE ; i++)
       {
          switch ( gBuf[i])