Lines Matching refs:port
39 This file implements the Mustek-proprietary SCSI-over-parallel-port
74 #define PORT_DEV "/dev/port"
75 #define AB306_CIO 0x379 /* control i/o port */
81 typedef struct port
84 int port_fd; /* >= 0 when using /dev/port */
86 u_int in_use : 1, /* port in use? */
87 active : 1; /* port was active at some point */
91 static Port port[] =
221 /* Open the device, <dev> must contain a valid port number (as string)
222 returns port number and I/O method in <*fdp> (not a file
243 DBG(1, "sanei_ab306_open: `%s' is not a valid port number\n", dev);
247 for (i = 0; i < NELEMS(port); ++i)
248 if (port[i].base == base)
251 if (i >= NELEMS(port))
257 if (port[i].in_use)
259 DBG(1, "sanei_ab306_open: port %lx is already in use\n", base);
282 DBG(1, "sanei_ab306_ioport: using /dev/port access\n");
283 if (port[i].port_fd < 0)
284 port[i].port_fd = open (PORT_DEV, O_RDWR);
285 if (port[i].port_fd < 0)
289 if (lseek (port[i].port_fd, AB306_CIO, SEEK_SET) != AB306_CIO)
294 if (write (port[i].port_fd, &byte, 1) != 1)
314 ab306_outb (port + i, port[i].base + 1, 0x60);
315 port[i].in_use = 1;
316 port[i].active = 1;
324 Port *p = port + fd;
337 /* Get I/O permission to the configuration port and the desired
342 if (port[fd].port_fd < 0)
350 if (sanei_ioperm (port[fd].base, 3, 1) != 0)
363 Port *p = port + fd;
434 Port *p = port + fd;
486 for (i = 0; i < NELEMS(port); ++i)
487 if (port[i].active)
489 port[i].active = 0;
491 ab306_outb (port + i, port[i].base + 1, 0x00);
502 Port *p = port + fd;