2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2008 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
22 typedef struct grub_scsi_dev
*grub_scsi_dev_t
;
24 void grub_scsi_dev_register (grub_scsi_dev_t dev
);
25 void grub_scsi_dev_unregister (grub_scsi_dev_t dev
);
31 /* The device name. */
34 /* Call HOOK with each device name, until HOOK returns non-zero. */
35 int (*iterate
) (int (*hook
) (const char *name
, int luns
));
37 /* Open the device named NAME, and set up SCSI. */
38 grub_err_t (*open
) (const char *name
, struct grub_scsi
*scsi
);
40 /* Close the scsi device SCSI. */
41 void (*close
) (struct grub_scsi
*scsi
);
43 /* Read SIZE bytes from the device SCSI into BUF after sending the
44 command CMD of size CMDSIZE. */
45 grub_err_t (*read
) (struct grub_scsi
*scsi
, grub_size_t cmdsize
, char *cmd
,
46 grub_size_t size
, char *buf
);
48 /* Write SIZE bytes from BUF to the device SCSI after sending the
49 command CMD of size CMDSIZE. */
50 grub_err_t (*write
) (struct grub_scsi
*scsi
, grub_size_t cmdsize
, char *cmd
,
51 grub_size_t size
, char *buf
);
53 /* The next scsi device. */
54 struct grub_scsi_dev
*next
;
59 /* The scsi device name. */
62 /* The underlying scsi device. */
65 /* Type of SCSI device. XXX: Make enum. */
71 /* LUN for this `struct grub_scsi'. */
74 /* Set to 0 when not removable, 1 when removable. */
77 /* Size of the device in blocks. */
80 /* Size of one block. */
83 /* Device-specific data. */
86 typedef struct grub_scsi
*grub_scsi_t
;
88 #endif /* GRUB_SCSI_H */