From owner-freebsd-bugs@FreeBSD.ORG Sun Oct 10 15:00:07 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533D41065670 for ; Sun, 10 Oct 2010 15:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA2A8FC1C for ; Sun, 10 Oct 2010 15:00:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9AF07KX044253 for ; Sun, 10 Oct 2010 15:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9AF06x2044241; Sun, 10 Oct 2010 15:00:06 GMT (envelope-from gnats) Resent-Date: Sun, 10 Oct 2010 15:00:06 GMT Resent-Message-Id: <201010101500.o9AF06x2044241@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joerg Niendorf Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A772C106566C for ; Sun, 10 Oct 2010 14:54:27 +0000 (UTC) (envelope-from f5d10a@internode.on.net) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3788FC16 for ; Sun, 10 Oct 2010 14:54:26 +0000 (UTC) Received: from ppp118-208-132-82.lns20.bne1.internode.on.net (HELO pri.jn) ([118.208.132.82]) by ipmail07.adl2.internode.on.net with SMTP; 11 Oct 2010 01:09:10 +1030 Message-Id: <20101011003557.3590f372.f5d10a@internode.on.net> Date: Mon, 11 Oct 2010 00:35:57 +1000 From: Joerg Niendorf To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: kern/151365: [patch] Two new Moxa puc(4) devices X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 15:00:07 -0000 >Number: 151365 >Category: kern >Synopsis: [patch] Two new Moxa puc(4) devices >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 10 15:00:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Joerg Niendorf >Release: FreeBSD 9.0-CURRENT amd64 >Organization: none >Environment: FreeBSD fbsd.jn.local 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sun Oct 10 21:44:36 EST 2010 root@fbsd.jn.local:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The below patch adds support for two Moxa puc(4) devices, the CP-104EL-A and the CP-104JU. I have tested all four ports on both cards. Maybe someone can commit the patch. Thanks. The relevant dmesg output: puc0: port 0xc800-0xc83f,0xc400-0xc40f mem 0xfbdff000-0xfbdfffff irq 28 at device 0.0 on pci3 uart2: <16950 or compatible> on puc0 uart3: <16950 or compatible> on puc0 uart4: <16950 or compatible> on puc0 uart5: <16950 or compatible> on puc0 puc1: port 0xe800-0xe81f,0xe400-0xe43f,0xe000-0xe00f irq 16 at device 6.0 on pci5 uart6: <16950 or compatible> on puc1 uart7: <16950 or compatible> on puc1 uart8: <16950 or compatible> on puc1 uart9: <16950 or compatible> on puc1 >How-To-Repeat: N/A >Fix: Index: pucdata.c =================================================================== RCS file: /home/ncvs/src/sys/dev/puc/pucdata.c,v retrieving revision 1.75 diff -u -r1.75 pucdata.c --- pucdata.c 20 May 2010 13:16:42 -0000 1.75 +++ pucdata.c 10 Oct 2010 08:41:03 -0000 @@ -51,6 +51,7 @@ static puc_config_f puc_config_cronyx; static puc_config_f puc_config_diva; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; static puc_config_f puc_config_siig; @@ -517,12 +518,25 @@ PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1141, 0xffff, 0, "Moxa Technologies, Industio CP-114", DEFAULT_RCLK * 8, @@ -971,6 +985,19 @@ } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + const struct puc_cfg *cfg = sc->sc_cfg; + + if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { >Release-Note: >Audit-Trail: >Unformatted: