Imported Upstream version 4.0.18
[platform/upstream/mtools.git] / floppyd_io.h
1 #ifndef MTOOLS_FLOPPYDIO_H
2 #define MTOOLS_FLOPPYDIO_H
3
4 /*  Copyright 1999 Peter Schlaile.
5  *  Copyright 1998,2000-2002,2009 Alain Knaff.
6  *  This file is part of mtools.
7  *
8  *  Mtools is free software: you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation, either version 3 of the License, or
11  *  (at your option) any later version.
12  *
13  *  Mtools is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with Mtools.  If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifdef USE_FLOPPYD
23
24 #include "stream.h"
25
26 /*extern int ConnectToFloppyd(const char* name, Class_t** ioclass);*/
27 Stream_t *FloppydOpen(struct device *dev, 
28                       char *name, int mode, char *errmsg,
29                       mt_size_t *maxSize);
30
31 #define FLOPPYD_DEFAULT_PORT 5703
32
33 #define FLOPPYD_PROTOCOL_VERSION_OLD 10
34 #define FLOPPYD_PROTOCOL_VERSION 11
35
36 #define FLOPPYD_CAP_EXPLICIT_OPEN 1 /* explicit open. Useful for 
37                                      * clean signalling of readonly disks */
38 #define FLOPPYD_CAP_LARGE_SEEK 2    /* large seeks */
39
40 enum FloppydOpcodes {
41         OP_READ,
42         OP_WRITE,
43         OP_SEEK,
44         OP_FLUSH,
45         OP_CLOSE,
46         OP_IOCTL,
47         OP_OPRO,
48         OP_OPRW,
49         OP_SEEK64
50 };
51
52 enum AuthErrorsEnum {
53         AUTH_SUCCESS,
54         AUTH_PACKETOVERSIZE,
55         AUTH_AUTHFAILED,
56         AUTH_WRONGVERSION,
57         AUTH_DEVLOCKED,
58         AUTH_BADPACKET,
59         AUTH_IO_ERROR
60 };
61
62 typedef unsigned long IPaddr_t;
63
64 #endif
65 #endif