From nobody@FreeBSD.org  Sun Dec 27 21:56:15 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3070A1065676
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Dec 2009 21:56:15 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 073098FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Dec 2009 21:56:15 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nBRLuES7019726
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Dec 2009 21:56:14 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nBRLuExC019718;
	Sun, 27 Dec 2009 21:56:14 GMT
	(envelope-from nobody)
Message-Id: <200912272156.nBRLuExC019718@www.freebsd.org>
Date: Sun, 27 Dec 2009 21:56:14 GMT
From: Alex Markelov <alex@makeitsimple.ie>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Few lines to pucdata.c to support for Teltonika PCI/G10 SMS modem
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142085
>Category:       kern
>Synopsis:       [puc] [patch] Few lines to pucdata.c to support for Teltonika PCI/G10 SMS modem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 27 22:00:09 UTC 2009
>Closed-Date:    Tue Sep 11 01:47:56 UTC 2012
>Last-Modified:  Tue Sep 11 01:47:56 UTC 2012
>Originator:     Alex Markelov
>Release:        7.2-stable
>Organization:
makeITsimple
>Environment:
FreeBSD daemon.localdomain 7.2-STABLE FreeBSD 7.2-STABLE #0: Fri Dec 11 01:16:26 UTC 2009     root@daemon.localdomain:/usr/obj/usr/src/sys/NANOBUILD_PC  i386

>Description:
I have purchased Teltonika PCI/G10 SMS modem (http://www.teltonika.lt/en/pages/view/?id=8). It's based on NetMos NM9820 chipset, but FreeBSD doesn't have the device information in pucdata.c hence you can't see the device and its serial ports. 
I added the device information (see the attached diff) to pucdata.c, rebuilt kernel and was able to get the device working on 7.2-stable. I posted details to my wiki page http://markelov.org/wiki/index.php?title=Teltonika_ModemPCI/G10_under_FreeBSD
>How-To-Repeat:
It's a feature request rather than a bug report. Basically, if you have the modem handy, you can try and see that without the extra lines in pucdata.c you can't see the device and none of its serial ports is available to work with.
>Fix:
--- /usr/src/sys/dev/puc/pucdata.c	2009-12-10 06:24:16.000000000 +0000
+++ /root/pucdata.c	2009-12-17 07:01:38.000000000 +0000
@@ -749,6 +749,12 @@
 	 *
 	 * uart(4) will claim this device.
 	 */
+	{   0x9710, 0x9820, 0x1000, 1,
+	    "NetMos NM9820 Multi-I/O controller",
+	    DEFAULT_RCLK,
+	    PUC_PORT_2S, 0x10, 4, 0,
+	},
+
 	{   0x9710, 0x9835, 0x1000, 1,
 	    "NetMos NM9835 based 1-port serial",
 	    DEFAULT_RCLK,


Patch attached with submission follows:

--- /usr/src/sys/dev/puc/pucdata.c	2009-12-10 06:24:16.000000000 +0000
+++ /root/pucdata.c	2009-12-17 07:01:38.000000000 +0000
@@ -749,6 +749,12 @@
 	 *
 	 * uart(4) will claim this device.
 	 */
+	{   0x9710, 0x9820, 0x1000, 1,
+	    "NetMos NM9820 Multi-I/O controller",
+	    DEFAULT_RCLK,
+	    PUC_PORT_2S, 0x10, 4, 0,
+	},
+
 	{   0x9710, 0x9835, 0x1000, 1,
 	    "NetMos NM9835 based 1-port serial",
 	    DEFAULT_RCLK,


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: gavin 
State-Changed-When: Sun Feb 7 22:27:33 UTC 2010 
State-Changed-Why:  
To submitter:  Thanks for your submission!  Can you please confirm 
that the second serial port does actually work?  From the datasheets 
I can find on the NetMos NM9820 chip, it appears that it may only 
have a single serial port.  If the second port doesn't actually work, 
can you try changing "PUC_PORT_2S" for "PUC_PORT_1S" in your patch and 
confirm that that still works for you?  Thanks! 


Responsible-Changed-From-To: freebsd-bugs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun Feb 7 22:27:33 UTC 2010 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142085 
Responsible-Changed-From-To: gavin->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sat May 12 01:46:11 UTC 2012 
Responsible-Changed-Why:  
I'll take this and commit with 1S, if we get reports the second port 
should work I could always change it later 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142085 
State-Changed-From-To: feedback->open 
State-Changed-By: eadler 
State-Changed-When: Sat May 12 01:46:33 UTC 2012 
State-Changed-Why:  
feedback timeout but sufficient information to commit 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142085 
State-Changed-From-To: open->analyzed 
State-Changed-By: eadler 
State-Changed-When: Tue Jul 3 03:26:01 UTC 2012 
State-Changed-Why:  
awaiting approval/review 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142085 
State-Changed-From-To: analyzed->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Sep 11 01:47:53 UTC 2012 
State-Changed-Why:  
it seems this has been committed a long time ago: see ine 123 in 
sys/dev/uart/uart_bus_pci.c 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142085 
>Unformatted:
