mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-06-14 15:33:53 +03:00
* configure.ac: add Solaris' default parallel port. * linux_ppdev.h: change parallel port access to the new style. * freebsd_ppi.h: New file, abstract FreeBSD's ppi(4). * solaris_ecpp.h: New file, abstract Solaris' ecpp(7D). * par.c: change header inclusion sequence. * pgm.h: remove obsolete ppi_claim() and ppi_release() dummies. * ppi.c: change header inclusion sequence, use new parport abstraction, drop obsolete dummy implementation. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@542 81a1dc3b-b13d-400b-aceb-764788c761c2
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
#ifndef __linux_ppdev_h__
|
|
#define __linux_ppdev_h__
|
|
|
|
#define OBSOLETE__IOW _IOW
|
|
|
|
#include <sys/ioctl.h>
|
|
#include <linux/parport.h>
|
|
#include <linux/ppdev.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define ppi_claim(pgm) \
|
|
if (ioctl(pgm->fd, PPCLAIM)) { \
|
|
fprintf(stderr, "%s: can't claim device \"%s\": %s\n\n", \
|
|
progname, port, strerror(errno)); \
|
|
close(pgm->fd); \
|
|
exit(1); \
|
|
}
|
|
|
|
#define ppi_release(pgm) \
|
|
if (ioctl(pgm->fd, PPRELEASE)) { \
|
|
fprintf(stderr, "%s: can't release device: %s\n\n", \
|
|
progname, strerror(errno)); \
|
|
exit(1); \
|
|
}
|
|
|
|
#define DO_PPI_READ(fd, reg, valp) \
|
|
(void)ioctl(fd, \
|
|
(reg) == PPIDATA? PPRDATA: ((reg) == PPICTRL? PPRCONTROL: PPRSTATUS), \
|
|
valp)
|
|
#define DO_PPI_WRITE(fd, reg, valp) \
|
|
(void)ioctl(fd, \
|
|
(reg) == PPIDATA? PPWDATA: ((reg) == PPICTRL? PPWCONTROL: PPWSTATUS), \
|
|
valp)
|
|
|
|
#endif /* __linux_ppdev_h__ */
|