kopia lustrzana https://gitlab.com/sane-project/backends
* use PPGETMODES ioctl to get ppdev available modes
rodzic
6ae6c96191
commit
e0fa6483c5
|
@ -552,15 +552,17 @@ sanei_umax_pp_InitPort (int port)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* me check if parport is does ECP */
|
/* we check if parport is does ECP */
|
||||||
mode = IEEE1284_MODE_ECP;
|
if (ioctl (fd, PPGETMODES, &mode))
|
||||||
if (ioctl (fd, PPSETMODE, &mode))
|
|
||||||
{
|
{
|
||||||
DBG (16, "umax_pp: port '%s' hasn't ECP\n", parport_name);
|
DBG (16, "umax_pp: ppdev couldn't gave modes for port '%s'\n",
|
||||||
|
parport_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG (16, "umax_pp: port '%s' does ECP\n", parport_name);
|
DBG (32, "parport modes: %X\n", mode);
|
||||||
|
if (mode & PARPORT_MODE_ECP)
|
||||||
|
{
|
||||||
DBG (16, "umax_pp: initializing ECPEPP\n");
|
DBG (16, "umax_pp: initializing ECPEPP\n");
|
||||||
/* set up ECPEPP the hard way ... */
|
/* set up ECPEPP the hard way ... */
|
||||||
/* frob_econtrol (port, 0xe0, 4 << 5);
|
/* frob_econtrol (port, 0xe0, 4 << 5);
|
||||||
|
@ -571,27 +573,14 @@ sanei_umax_pp_InitPort (int port)
|
||||||
Outb (ECPCONTROL, ectr);
|
Outb (ECPCONTROL, ectr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (!(mode & PARPORT_MODE_ECP) && !(mode & PARPORT_MODE_ECP))
|
||||||
/* we try to set EPP 1.7 first */
|
|
||||||
mode = IEEE1284_MODE_EPPSL;
|
|
||||||
if (ioctl (fd, PPSETMODE, &mode))
|
|
||||||
{
|
{
|
||||||
DBG (16, "umax_pp: cannot set port '%s' to EPP 1.7\n",
|
|
||||||
parport_name);
|
|
||||||
/* we try EPP */
|
|
||||||
mode = IEEE1284_MODE_EPP;
|
|
||||||
if (ioctl (fd, PPSETMODE, &mode))
|
|
||||||
{
|
|
||||||
DBG (1, "umax_pp: cannot set port '%s' to EPP\n",
|
|
||||||
parport_name);
|
|
||||||
DBG (1,
|
DBG (1,
|
||||||
"umax_pp: blindly going on, but failure is expected...\n");
|
"port 0x%X does not have EPP or ECP, giving up ...\n",
|
||||||
|
port);
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
DBG (1, "Using EPP 1.7\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* write to DATA via direct io and read DATA via parport */
|
/* write to DATA via direct io and read DATA via parport */
|
||||||
/* if values match, we found the right parport */
|
/* if values match, we found the right parport */
|
||||||
|
|
Ładowanie…
Reference in New Issue