From owner-svn-ports-head@FreeBSD.ORG Wed Jun 12 19:05:13 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE2284FD; Wed, 12 Jun 2013 19:05:13 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD071BAA; Wed, 12 Jun 2013 19:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5CJ5DRw013433; Wed, 12 Jun 2013 19:05:13 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5CJ5DKU013431; Wed, 12 Jun 2013 19:05:13 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201306121905.r5CJ5DKU013431@svn.freebsd.org> From: Antoine Brodin Date: Wed, 12 Jun 2013 19:05:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r320716 - in head/multimedia/libcec: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2013 19:05:13 -0000 Author: antoine Date: Wed Jun 12 19:05:12 2013 New Revision: 320716 URL: http://svnweb.freebsd.org/changeset/ports/320716 Log: Update adapter detection patch to report correct IDs PR: ports/179517 Submitted by: Mickael Maillot Approved by: Manuel Creach (maintainer) Modified: head/multimedia/libcec/Makefile head/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp Modified: head/multimedia/libcec/Makefile ============================================================================== --- head/multimedia/libcec/Makefile Wed Jun 12 19:03:41 2013 (r320715) +++ head/multimedia/libcec/Makefile Wed Jun 12 19:05:12 2013 (r320716) @@ -3,6 +3,7 @@ PORTNAME= libcec PORTVERSION= 2.1.3 +PORTREVISION= 1 CATEGORIES= multimedia MASTER_SITES= GH Modified: head/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp ============================================================================== --- head/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp Wed Jun 12 19:03:41 2013 (r320715) +++ head/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp Wed Jun 12 19:05:12 2013 (r320716) @@ -1,5 +1,5 @@ ---- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig 2013-05-13 13:09:14.000000000 +0000 -+++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2013-06-08 12:30:51.000000000 +0000 +--- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig 2013-05-13 15:09:14.000000000 +0200 ++++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2013-06-12 16:31:03.000000000 +0200 @@ -61,6 +61,8 @@ #include } @@ -9,7 +9,7 @@ #include #include #endif -@@ -434,22 +436,68 @@ +@@ -434,22 +436,77 @@ } #elif defined(__FreeBSD__) char devicePath[PATH_MAX + 1]; @@ -25,13 +25,15 @@ { - (void)snprintf(devicePath, sizeof(devicePath), "/dev/ttyU%d", i); - if (strDevicePath && strcmp(devicePath, strDevicePath) != 0) ++ unsigned int iVendor, iProduct; + memset(infos, 0, sizeof(infos)); + (void)snprintf(sysctlname, sizeof(sysctlname), + "dev.umodem.%d.%%pnpinfo", i); + if (sysctlbyname(sysctlname, infos, &infos_size, + NULL, 0) != 0) + break; -+ if (strstr(infos, "vendor=0x2548") == NULL) ++ pos = strstr(infos, "vendor="); ++ if (pos == NULL) continue; - if (!access(devicePath, 0)) - { @@ -41,9 +43,16 @@ - deviceList[iFound].iProductId = CEC_VID; - deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type - iFound++; -+ if (strstr(infos, "product=0x1001") == NULL -+ && strstr(infos, "product=0x1002") == NULL) ++ sscanf(pos, "vendor=%x ", &iVendor); ++ ++ pos = strstr(infos, "product="); ++ if (pos == NULL) + continue; ++ sscanf(pos, "product=%x ", &iProduct); ++ ++ if (iVendor != CEC_VID || (iProduct != CEC_PID && iProduct != CEC_PID2)) ++ continue; ++ + pos = strstr(infos, "ttyname="); + if (pos == NULL) + continue; @@ -82,8 +91,8 @@ } + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath); + snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath); -+ deviceList[iFound].iVendorId = CEC_VID; -+ deviceList[iFound].iProductId = CEC_VID; ++ deviceList[iFound].iVendorId = iVendor; ++ deviceList[iFound].iProductId = iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type + iFound++; }