File: dev_ata_cmd_set.h

package info (click to toggle)
smartmontools 6.3%2Bsvn4002-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,440 kB
  • ctags: 6,954
  • sloc: cpp: 38,549; ansic: 9,556; sh: 1,165; makefile: 846
file content (46 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download | duplicates (4)
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
/*
 * dev_ata_cmd_set.h
 *
 * Home page of code is: http://smartmontools.sourceforge.net
 *
 * Copyright (C) 2008 Christian Franke <smartmontools-support@lists.sourceforge.net>
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef DEV_ATA_CMD_SET_H
#define DEV_ATA_CMD_SET_H

#define DEV_ATA_CMD_SET_H_CVSID "$Id: dev_ata_cmd_set.h,v 1.3 2008/08/23 21:32:12 chrfranke Exp $\n"

#include "atacmds.h" // smart_command_set
#include "dev_interface.h"

/////////////////////////////////////////////////////////////////////////////
// ata_device_with_command_set

/// Adapter class to implement new ATA pass through old interface.

class ata_device_with_command_set
: public /*implements*/ ata_device
{
public:
  /// ATA pass through mapped to ata_command_interface().
  virtual bool ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);

protected:
  /// Old ATA interface called by ata_pass_through()
  virtual int ata_command_interface(smart_command_set command, int select, char * data) = 0;

  ata_device_with_command_set()
    : smart_device(never_called) { }
};

#endif // DEV_ATA_CMD_SET_H