From owner-svn-src-all@FreeBSD.ORG Fri Aug 3 11:22:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3E5B106568C; Fri, 3 Aug 2012 11:22:09 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4CB88FC1E; Fri, 3 Aug 2012 11:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q73BM9m7014116; Fri, 3 Aug 2012 11:22:09 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q73BM911014113; Fri, 3 Aug 2012 11:22:09 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201208031122.q73BM911014113@svn.freebsd.org> From: Max Khon Date: Fri, 3 Aug 2012 11:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239006 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2012 11:22:10 -0000 Author: fjoe Date: Fri Aug 3 11:22:09 2012 New Revision: 239006 URL: http://svn.freebsd.org/changeset/base/239006 Log: MFC: r238933 - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg" - Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f Modified: stable/8/sys/dev/puc/puc_cfg.h stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/puc/puc_cfg.h ============================================================================== --- stable/8/sys/dev/puc/puc_cfg.h Fri Aug 3 09:08:20 2012 (r239005) +++ stable/8/sys/dev/puc/puc_cfg.h Fri Aug 3 11:22:09 2012 (r239006) @@ -79,7 +79,7 @@ struct puc_cfg { int8_t ports; int8_t rid; /* Rid of first port */ int8_t d_rid; /* Delta rid of next ports */ - int16_t d_ofs; /* Delta offset of next ports */ + int8_t d_ofs; /* Delta offset of next ports */ puc_config_f *config_function; }; Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Fri Aug 3 09:08:20 2012 (r239005) +++ stable/8/sys/dev/puc/pucdata.c Fri Aug 3 11:22:09 2012 (r239006) @@ -510,13 +510,15 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1024, 0xffff, 0, "Moxa Technologies, Smartio CP-102E/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200 + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1025, 0xffff, 0, "Moxa Technologies, Smartio CP-102EL/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200, + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1040, 0xffff, 0, @@ -572,7 +574,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1182, 0xffff, 0, "Moxa Technologies, Smartio CP-118EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1680, 0xffff, 0, @@ -596,7 +599,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1683, 0xffff, 0, "Moxa Technologies, Smartio CP-168EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x13a8, 0x0152, 0xffff, 0, @@ -1153,7 +1157,12 @@ puc_config_moxa(struct puc_softc *sc, en intptr_t *res) { if (cmd == PUC_CFG_GET_OFS) { - *res = ((port == 3) ? 7 : port) * 0x200; + const struct puc_cfg *cfg = sc->sc_cfg; + + if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144)) + port = 7; + *res = port * 0x200; + return 0; } return (ENXIO);