~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to include/grub/scsi.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef GRUB_SCSI_H
20
20
#define GRUB_SCSI_H     1
21
21
 
 
22
#include <grub/disk.h>
 
23
 
22
24
typedef struct grub_scsi_dev *grub_scsi_dev_t;
23
25
 
24
26
void grub_scsi_dev_register (grub_scsi_dev_t dev);
29
31
enum
30
32
  {
31
33
    GRUB_SCSI_SUBSYSTEM_USBMS,
32
 
    GRUB_SCSI_SUBSYSTEM_ATAPI
 
34
    GRUB_SCSI_SUBSYSTEM_PATA,
 
35
    GRUB_SCSI_SUBSYSTEM_AHCI,
 
36
    GRUB_SCSI_NUM_SUBSYSTEMS
33
37
  };
34
38
 
 
39
extern const char grub_scsi_names[GRUB_SCSI_NUM_SUBSYSTEMS][5];
 
40
 
35
41
#define GRUB_SCSI_ID_SUBSYSTEM_SHIFT 24
36
42
#define GRUB_SCSI_ID_BUS_SHIFT 8
37
43
#define GRUB_SCSI_ID_LUN_SHIFT 0
45
51
 
46
52
struct grub_scsi_dev
47
53
{
48
 
  /* The device name.  */
49
 
  const char *name;
50
 
 
51
 
  grub_uint8_t id;
52
 
 
53
54
  /* Call HOOK with each device name, until HOOK returns non-zero.  */
54
 
  int (*iterate) (int (*hook) (int bus, int luns));
 
55
  int (*iterate) (int NESTED_FUNC_ATTR (*hook) (int id, int bus, int luns),
 
56
                  grub_disk_pull_t pull);
55
57
 
56
58
  /* Open the device named NAME, and set up SCSI.  */
57
 
  grub_err_t (*open) (int bus, struct grub_scsi *scsi);
 
59
  grub_err_t (*open) (int id, int bus, struct grub_scsi *scsi);
58
60
 
59
61
  /* Close the scsi device SCSI.  */
60
62
  void (*close) (struct grub_scsi *scsi);
67
69
  /* Write SIZE  bytes from BUF to  the device SCSI  after sending the
68
70
     command CMD of size CMDSIZE.  */
69
71
  grub_err_t (*write) (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
70
 
                       grub_size_t size, char *buf);
 
72
                       grub_size_t size, const char *buf);
71
73
 
72
74
  /* The next scsi device.  */
73
75
  struct grub_scsi_dev *next;
92
94
  /* Set to 0 when not removable, 1 when removable.  */
93
95
  int removable;
94
96
 
95
 
  /* Size of the device in blocks.  */
96
 
  int size;
 
97
  /* Size of the device in blocks - 1.  */
 
98
  grub_uint64_t last_block;
97
99
 
98
100
  /* Size of one block.  */
99
 
  int blocksize;
 
101
  grub_uint32_t blocksize;
100
102
 
101
103
  /* Device-specific data.  */
102
104
  void *data;