From thinker@branda.to  Sun Oct 19 04:44:10 2008
Return-Path: <thinker@branda.to>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDCF21065689
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Oct 2008 04:44:10 +0000 (UTC)
	(envelope-from thinker@branda.to)
Received: from msr26.hinet.net (msr26.hinet.net [168.95.4.126])
	by mx1.freebsd.org (Postfix) with ESMTP id B99638FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Oct 2008 04:44:09 +0000 (UTC)
	(envelope-from thinker@branda.to)
Received: from cowboy.branda.to (122-120-16-55.dynamic.hinet.net [122.120.16.55])
	by msr26.hinet.net (8.9.3/8.9.3) with ESMTP id MAA09530
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Oct 2008 12:26:50 +0800 (CST)
Received: from cowboy.branda.to (localhost [127.0.0.1])
	by cowboy.branda.to (8.14.2/8.14.2) with ESMTP id m9J4QoZZ064565
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Oct 2008 12:26:50 +0800 (CST)
	(envelope-from thinker@cowboy.branda.to)
Received: (from thinker@localhost)
	by cowboy.branda.to (8.14.2/8.14.2/Submit) id m9J4QomM064564;
	Sun, 19 Oct 2008 12:26:50 +0800 (CST)
	(envelope-from thinker)
Message-Id: <200810190426.m9J4QomM064564@cowboy.branda.to>
Date: Sun, 19 Oct 2008 12:26:50 +0800 (CST)
From: "Thinker K.F. Li" <thinker@branda.to>
Reply-To: "Thinker K.F. Li" <thinker@branda.to>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: puc driver can not handle parallel port card with SUN1888 chip.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         128219
>Category:       kern
>Synopsis:       [puc] [patch] puc driver can not handle parallel port card with SUN1888 chip.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 19 04:50:01 UTC 2008
>Closed-Date:    Thu Feb 12 10:39:56 UTC 2009
>Last-Modified:  Thu Feb 12 10:40:01 UTC 2009
>Originator:     Thinker K.F. Li
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
allwitz.com
>Environment:
System: FreeBSD cowboy.branda.to 8.0-CURRENT FreeBSD 8.0-CURRENT #7: Fri Oct 17 22:32:29 CST 2008 thinker@cowboy.branda.to:/usr/src/sys/i386/compile/cowboy i386


	
>Description:
	puc(4) is a Universal driver for serial & parallel ports.  It supports
	variaous chips & boards except the one I bought from market, SUnix's
	daul ports parallel card with SUN1888 chip.
	
>How-To-Repeat:
	Plug a parallel port card with SUN1888 to your FreeBSD box and try to
	drive it with puc driver module.  Nothing is happening.
	puc(4) can not even recoganize the card.
	
>Fix:

	apply following small patch on src/sys/dev/puc/, and rebuild the
	module in src/sys/modules/puc/.
	

--- patch-freebsd-puc.diff begins here ---
--- puc.c.orig	2008-10-17 23:55:22.000000000 +0800
+++ puc.c	2008-10-18 15:50:10.000000000 +0800
@@ -606,7 +606,7 @@
 	if (cookiep == NULL || res != port->p_ires)
 		return (EINVAL);
 	/* We demand that serdev devices use filter_only interrupts. */
-	if (ihand != NULL)
+	if (ihand != NULL && port->p_type == PUC_TYPE_SERIAL)
 		return (ENXIO);
 	if (rman_get_device(port->p_ires) != originator)
 		return (ENXIO);
--- pucdata.c.orig	2008-10-17 15:50:37.000000000 +0800
+++ pucdata.c	2008-10-18 03:01:56.000000000 +0800
@@ -586,6 +586,12 @@
 	    .config_function = puc_config_timedia
 	},
 
+	{   0x1409, 0x7268, 0xffff, 0,
+	    "Sunix SUN1888 2 Port Parallel",
+	    DEFAULT_RCLK * 8,
+	    PUC_PORT_2P, 0x10, 8, 0,
+	},
+
 	/*
 	 * Boards with an Oxford Semiconductor chip.
 	 *
--- patch-freebsd-puc.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kevlo 
State-Changed-When: Thu Feb 12 10:39:42 UTC 2009 
State-Changed-Why:  
Comitted, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128219 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/128219: commit references a PR
Date: Thu, 12 Feb 2009 10:39:30 +0000 (UTC)

 Author: kevlo
 Date: Thu Feb 12 10:39:19 2009
 New Revision: 188511
 URL: http://svn.freebsd.org/changeset/base/188511
 
 Log:
   Add support for the Sunix SUN1889-based dual parallel port card.
   
   PR: kern/128219
   Submitted by: Thinker K.F. Li <thinker at branda dot to>
 
 Modified:
   head/sys/dev/puc/pucdata.c
 
 Modified: head/sys/dev/puc/pucdata.c
 ==============================================================================
 --- head/sys/dev/puc/pucdata.c	Thu Feb 12 09:37:45 2009	(r188510)
 +++ head/sys/dev/puc/pucdata.c	Thu Feb 12 10:39:19 2009	(r188511)
 @@ -585,6 +585,12 @@ const struct puc_cfg puc_pci_devices[] =
  	    PUC_PORT_4S, 0x10, 4, 0,
  	},
  
 +	{   0x1409, 0x7268, 0xffff, 0,
 +	    "Sunix SUN1888",
 +	    0,
 +	    PUC_PORT_2P, 0x10, 0, 8,
 +	},
 +
  	{   0x1409, 0x7168, 0xffff, 0,
  	    NULL,
  	    DEFAULT_RCLK * 8,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
