Subject: CUPS on sparc[64] w/ parallel backend (bpp)
To: port-sparc@netbsd.org, <jlam@netbsd.org>
From: Brian A. Seklecki <lavalamp@spiritual-machines.org>
List: port-sparc
Date: 11/26/2002 14:28:27
After patching up MAKEDEV as per:

http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=17162

...which really is a silly PR considering how easy the fix is, you can get
CUPS to talk to your printer once you add in pkgsrc/print/gimp-print extra
drivers.  BUT, to use the default/stock backends that come w/ CUPS, we need
to patch up the following.  It's IFDEF'd out (perhaps if configure probed
Solaris it would take care of this).  Anyway a quick if ${MACHINE} ==
"sparc" should fix this up.  Since or devices normally match the names of
those on the native commerical unix, other platforms should be able to use
the SGI, AIX, and HPUX stuff here too.  Shall I send-pr(1) with this?


one thing to note is that the device generaged by the MAKEDEV fix in the pr
gens /dev/bpp and this code looks for /dev/bpp[0-9]

...in pkgsrc/print/cups/work/[vers]/backend/parallel.c, line 489:

#elif defined(__sun)
  int           i, j, n;        /* Looping vars */
  char          device[255];    /* Device filename */


 /*
 *   * Standard parallel ports...
 *     */

  for (i = 0; i < 10; i ++)
  {
    sprintf(device, "/dev/ecpp%d", i);
    if (access(device, 0) == 0)
      printf("direct parallel:%s \"Unknown\" \"Sun IEEE-1284 Parallel Port #%d\"\n",
             device, i + 1);
  }

  for (i = 0; i < 10; i ++)
  {
    sprintf(device, "/dev/bpp%d", i);
    if (access(device, 0) == 0)
      printf("direct parallel:%s \"Unknown\" \"Sun Standard Parallel Port #%d\"\n",
             device, i + 1);
  }

  for (i = 0; i < 3; i ++)
  {
    sprintf(device, "/dev/lp%d", i);

    if (access(device, 0) == 0)
      printf("direct parallel:%s \"Unknown\" \"PC Parallel Port #%d\"\n",
             device, i + 1);
  }

 /*
 *   * MAGMA parallel ports...
 *     */

  for (i = 0; i < 40; i ++)
  {
    sprintf(device, "/dev/pm%02d", i);
    if (access(device, 0) == 0)
      printf("direct parallel:%s \"Unknown\" \"MAGMA Parallel Board #%d Port #%d\"\n",
             device, (i / 10) + 1, (i % 10) + 1);
  }

 /*
 *   * Central Data parallel ports...
 *     */

  for (i = 0; i < 9; i ++)
    for (j = 0; j < 8; j ++)
      for (n = 0; n < 32; n ++)
      {
        if (i == 8)     /* EtherLite */
          sprintf(device, "/dev/sts/lpN%d%c", j, funky_hex[n]);
        else
          sprintf(device, "/dev/sts/lp%c%d%c", i + 'C', j,
                  funky_hex[n]);

        if (access(device, 0) == 0)
        {
          if (i == 8)
            printf("direct parallel:%s \"Unknown\" \"Central Data EtherLite Parallel Port, ID %d, port %d\"\n",
                   device, j, n);
          else
            printf("direct parallel:%s \"Unknown\" \"Central Data SCSI Parallel Port, logical bus %d, ID %d, port %
d\"\n",
                   device, i, j, n);
        }
      }


later -           | _BonaFide[] = { coder, author, | /~\ The ASCII Ribbon
Brian A. Seklecki | problem solver, scholar, BOFH, | \ / Campaign Against
                  | vegetarian, runner, NetBSD     |  X  Exchange, Outlook
                  | advocate, spiritual machine }; | / \ & HTML Email

PGP: 0111 4618 0111 4618 4AB2 24EB C853 6611 75C4 A91E A7A7 4973

"Any sufficiently complicated technology is indistinguishable from bad karma."