099f11bd221a87bc05b73b3136d89f7a26bf45f3
[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, struct device *dev2,
28                                           char *name, int mode, char *errmsg,
29                                           int mode2, int locked,
30                                           mt_size_t *maxSize);
31
32 #define FLOPPYD_DEFAULT_PORT 5703
33
34 #define FLOPPYD_PROTOCOL_VERSION_OLD 10
35 #define FLOPPYD_PROTOCOL_VERSION 11
36
37 #define FLOPPYD_CAP_EXPLICIT_OPEN 1 /* explicit open. Useful for 
38                                      * clean signalling of readonly disks */
39 #define FLOPPYD_CAP_LARGE_SEEK 2    /* large seeks */
40
41 enum FloppydOpcodes {
42         OP_READ,
43         OP_WRITE,
44         OP_SEEK,
45         OP_FLUSH,
46         OP_CLOSE,
47         OP_IOCTL,
48         OP_OPRO,
49         OP_OPRW,
50         OP_SEEK64
51 };
52
53 enum AuthErrorsEnum {
54         AUTH_SUCCESS,
55         AUTH_PACKETOVERSIZE,
56         AUTH_AUTHFAILED,
57         AUTH_WRONGVERSION,
58         AUTH_DEVLOCKED,
59         AUTH_BADPACKET,
60         AUTH_IO_ERROR
61 };
62
63 typedef unsigned long IPaddr_t;
64
65 #endif
66 #endif