Skip to content

Commit 534c417

Browse files
FozzTexxtschak909
authored andcommitted
Enhance fujifs to have more posix file type functionality.
fujifs functions now automatically handle allocating of FujiNet N: devices behind the scenes and return a handle when opening a file or URL. This allows keeping track of state locally that is needed to be able to allow opening of more than one file at a time.
1 parent ddfd7a8 commit 534c417

File tree

10 files changed

+561
-179
lines changed

10 files changed

+561
-179
lines changed

fujicom/fujicom.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ int fujicom_command(cmdFrame_t far *cmd)
119119
_fujicom_send_command(cmd);
120120
reply = port_getc_nobuf(port, TIMEOUT);
121121
//port_enable_interrupts(port);
122-
#if 0
123122
#ifdef DEBUG
124123
consolef("FN command reply: 0x%04x\n", reply);
125-
#endif
126124
#endif
127125

128126
return reply;
@@ -197,10 +195,8 @@ int fujicom_command_read(cmdFrame_t far *cmd, void far *ptr, uint16_t len)
197195

198196
done:
199197
//port_enable_interrupts(port);
200-
#if 0
201198
#ifdef DEBUG
202199
consolef("FN command read reply: 0x%04x\n", reply);
203-
#endif
204200
#endif
205201
return reply;
206202
}
@@ -247,7 +243,7 @@ int fujicom_command_write(cmdFrame_t far *cmd, void far *ptr, uint16_t len)
247243
port_putc_nobuf(port, ck);
248244

249245
/* Wait for ACK/NACK */
250-
reply = port_getc_nobuf(port, TIMEOUT);
246+
reply = port_getc_nobuf(port, TIMEOUT_SLOW);
251247
if (reply != 'A') {
252248
#ifdef DEBUG
253249
consolef("FN write ack fail: 0x%04x\n", reply);
@@ -258,19 +254,15 @@ int fujicom_command_write(cmdFrame_t far *cmd, void far *ptr, uint16_t len)
258254
/* Wait for COMPLETE/ERROR */
259255
reply = port_getc_nobuf(port, TIMEOUT_SLOW);
260256
if (reply != 'C') {
261-
#if 0
262257
#ifdef DEBUG
263258
consolef("FN write complete fail: 0x%04x\n", reply);
264-
#endif
265259
#endif
266260
}
267261

268262
done:
269263
//port_enable_interrupts(port)
270-
#if 0
271264
#ifdef DEBUG
272265
consolef("FN command write reply: 0x%04x\n", reply);
273-
#endif
274266
#endif
275267
return reply;
276268
}
@@ -285,6 +277,7 @@ void fujicom_done(void)
285277
int fujiF5(uint8_t direction, uint8_t device, uint8_t command,
286278
uint16_t aux12, uint16_t aux34, void far *buffer, uint16_t length)
287279
{
280+
int result;
288281
f5regs.x.dx = direction;
289282
f5regs.h.al = device;
290283
f5regs.h.ah = command;

fujicom/fujicom.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,14 @@ enum {
9292
};
9393

9494
enum {
95+
CMD_RENAME = 0x20,
96+
CMD_DELETE = 0x21,
97+
CMD_SEEK = 0x25,
98+
CMD_TELL = 0x26,
99+
CMD_MKDIR = 0x2a,
100+
CMD_RMDIR = 0x2b,
95101
CMD_CHDIR = 0x2c,
102+
CMD_GETCWD = 0x30,
96103
CMD_OPEN = 'O',
97104
CMD_CLOSE = 'C',
98105
CMD_READ = 'R',
@@ -145,6 +152,8 @@ enum {
145152
NETWORK_ERROR_COULD_NOT_PARSE_JSON = 213,
146153
NETWORK_ERROR_CLIENT_GENERAL = 214,
147154
NETWORK_ERROR_SERVER_GENERAL = 215,
155+
NETWORK_ERROR_NO_DEVICE_AVAILABLE = 216,
156+
NETWORK_ERROR_NOT_A_DIRECTORY = 217,
148157
NETWORK_ERROR_COULD_NOT_ALLOCATE_BUFFERS = 255,
149158
};
150159

0 commit comments

Comments
 (0)