Add ecpp(7D) (parallel port) for Solaris.

* 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
This commit is contained in:
Joerg Wunsch
2005-11-03 22:37:37 +00:00
parent adf3f0aa76
commit b475eae63d
7 changed files with 113 additions and 105 deletions

94
ppi.c
View File

@@ -19,10 +19,10 @@
/* $Id$ */
#if defined(__FreeBSD__) || defined(__linux__)
#include "ac_cfg.h"
#if HAVE_PARPORT
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -31,9 +31,11 @@
#include <errno.h>
#if defined(__FreeBSD__)
#include <dev/ppbus/ppi.h>
# include "freebsd_ppi.h"
#elif defined(__linux__)
#include "linux_ppdev.h"
# include "linux_ppdev.h"
#elif defined(__sun__) && defined(__svr4__) /* Solaris */
# include "solaris_ecpp.h"
#endif
#include "avr.h"
@@ -53,22 +55,15 @@ int ppi_shadow_access(int fd, int reg, unsigned char *v, unsigned char action)
{
static unsigned char shadow[3];
int shadow_num;
unsigned long set, get;
switch (reg) {
case PPIDATA:
set = PPISDATA;
get = PPIGDATA;
shadow_num = 0;
break;
case PPICTRL:
set = PPISCTRL;
get = PPIGCTRL;
shadow_num = 1;
break;
case PPISTATUS:
set = PPISSTATUS;
get = PPIGSTATUS;
shadow_num = 2;
break;
default:
@@ -83,12 +78,12 @@ int ppi_shadow_access(int fd, int reg, unsigned char *v, unsigned char action)
*v = shadow[shadow_num];
break;
case PPI_READ:
ioctl(fd, get, v);
DO_PPI_READ(fd, reg, v);
shadow[shadow_num]=*v;
break;
case PPI_WRITE:
shadow[shadow_num]=*v;
ioctl(fd, set, v);
DO_PPI_WRITE(fd, reg, v);
break;
}
return 0;
@@ -231,76 +226,5 @@ void ppi_close(int fd)
close(fd);
}
#elif defined(__POWERPC__) && defined(__APPLE__)
int ppi_shadow_access(int fd, int reg, unsigned char *v, unsigned char action)
{
return -1;
}
/*
* set the indicated bit of the specified register.
*/
int ppi_set(int fd, int reg, int bit)
{
return -1;
}
/*
* clear the indicated bit of the specified register.
*/
int ppi_clr(int fd, int reg, int bit)
{
return -1;
}
/*
* get the indicated bit of the specified register.
*/
int ppi_get(int fd, int reg, int bit)
{
return -1;
}
/*
* toggle the indicated bit of the specified register.
*/
int ppi_toggle(int fd, int reg, int bit)
{
return -1;
}
/*
* get all bits of the specified register.
*/
int ppi_getall(int fd, int reg)
{
return -1;
}
/*
* set all bits of the specified register to val.
*/
int ppi_setall(int fd, int reg, int val)
{
return -1;
}
int ppi_open(char * port)
{
return -1;
}
void ppi_close(int fd)
{
}
#endif
#endif /* HAVE_PARPORT */