1 | /******************************************************************************
|
---|
2 | * atapi.c - ATAPI command processing
|
---|
3 | *
|
---|
4 | * Copyright (c) 2010 Christian Mueller. Parts copied from/inspired by the
|
---|
5 | * Linux AHCI driver; those parts are (c) Linux AHCI/ATA maintainers
|
---|
6 | *
|
---|
7 | * This program is free software; you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation; either version 2 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * This program is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with this program; if not, write to the Free Software
|
---|
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
20 | */
|
---|
21 |
|
---|
22 | #include "os2ahci.h"
|
---|
23 | #include "ata.h"
|
---|
24 |
|
---|
25 | /* -------------------------- macros and constants ------------------------- */
|
---|
26 |
|
---|
27 | /* ------------------------ typedefs and structures ------------------------ */
|
---|
28 |
|
---|
29 | /* -------------------------- function prototypes -------------------------- */
|
---|
30 |
|
---|
31 | /* ------------------------ global/static variables ------------------------ */
|
---|
32 |
|
---|
33 | /* ----------------------------- start of code ----------------------------- */
|
---|
34 |
|
---|
35 | /******************************************************************************
|
---|
36 | * Get device or media geometry. This function is expected to check the IORB
|
---|
37 | * command codes and modifiers to see which one is requested.
|
---|
38 | */
|
---|
39 | int atapi_get_geometry(IORBH _far *iorb, int slot)
|
---|
40 | {
|
---|
41 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
42 | return(-1);
|
---|
43 | }
|
---|
44 |
|
---|
45 | /******************************************************************************
|
---|
46 | * Test whether unit is ready.
|
---|
47 | */
|
---|
48 | int atapi_unit_ready(IORBH _far *iorb, int slot)
|
---|
49 | {
|
---|
50 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
51 | return(-1);
|
---|
52 | }
|
---|
53 |
|
---|
54 | /******************************************************************************
|
---|
55 | * Read sectors from AHCI device.
|
---|
56 | */
|
---|
57 | int atapi_read(IORBH _far *iorb, int slot)
|
---|
58 | {
|
---|
59 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
60 | return(-1);
|
---|
61 | }
|
---|
62 |
|
---|
63 | /******************************************************************************
|
---|
64 | * Verify readability of sectors on AHCI device.
|
---|
65 | */
|
---|
66 | int atapi_verify(IORBH _far *iorb, int slot)
|
---|
67 | {
|
---|
68 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
69 | return(-1);
|
---|
70 | }
|
---|
71 |
|
---|
72 | /******************************************************************************
|
---|
73 | * Write sectors to AHCI device.
|
---|
74 | */
|
---|
75 | int atapi_write(IORBH _far *iorb, int slot)
|
---|
76 | {
|
---|
77 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
78 | return(-1);
|
---|
79 | }
|
---|
80 |
|
---|
81 | /******************************************************************************
|
---|
82 | * Execute ATAPI command.
|
---|
83 | */
|
---|
84 | int atapi_execute_cdb(IORBH _far *iorb, int slot)
|
---|
85 | {
|
---|
86 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
87 | return(-1);
|
---|
88 | }
|
---|
89 |
|
---|
90 | /******************************************************************************
|
---|
91 | * Request sense information for a failed command.
|
---|
92 | *
|
---|
93 | * NOTE: This function must be called right after an ATAPI command has failed
|
---|
94 | * and before any other commands are queued on the corresponding device.
|
---|
95 | * This function is typically called in the port restart context hook
|
---|
96 | * which is triggered by an AHCI error interrupt.
|
---|
97 | *
|
---|
98 | */
|
---|
99 | int atapi_req_sense(IORBH _far *iorb, int slot)
|
---|
100 | {
|
---|
101 | iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
|
---|
102 | return(-1);
|
---|
103 | }
|
---|
104 |
|
---|