From owner-freebsd-firewire@FreeBSD.ORG Mon Aug 11 11:06:56 2008 Return-Path: Delivered-To: freebsd-firewire@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E3CC1065672 for ; Mon, 11 Aug 2008 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 703208FC22 for ; Mon, 11 Aug 2008 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m7BB6uRs047169 for ; Mon, 11 Aug 2008 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m7BB6tEq047165 for freebsd-firewire@FreeBSD.org; Mon, 11 Aug 2008 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 11 Aug 2008 11:06:55 GMT Message-Id: <200808111106.m7BB6tEq047165@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-firewire@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-firewire@FreeBSD.org X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2008 11:06:56 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/74238 firewire [firewire] fw_rcv: unknown response; firewire ad-hoc w 1 problem total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/113785 firewire [firewire] dropouts when playing DV on firewire 1 problem total. From owner-freebsd-firewire@FreeBSD.ORG Mon Aug 11 23:52:08 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF401065675; Mon, 11 Aug 2008 23:52:08 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id AC6CE8FC19; Mon, 11 Aug 2008 23:52:07 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m7BNpvx31706; Mon, 11 Aug 2008 16:51:57 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id XAA02248; Mon, 11 Aug 2008 23:47:05 GMT Message-Id: <200808112347.XAA02248@sopwith.solgatos.com> To: Sean Bruno In-reply-to: Your message of "Sat, 09 Aug 2008 13:12:28 PDT." <489DFA2C.4080407@miralink.com> Date: Mon, 11 Aug 2008 16:47:05 +0100 From: Dieter Cc: Scott Long , freebsd-firewire@freebsd.org Subject: Re: This is where I'm going with fwcontrol X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2008 23:52:08 -0000 [ I suggested changing priority_budget from int to long, but then realized that this only fixes it on LP64, not on ILP32. ] >> I suspect that gcc will still complain on ILP32 machines. > I implemented your fix for priority_budget, i.e. I should have been > paying attention to the conditional test and the assignment from strtol()! What arch are you compiling this on? Does gcc not complain on a ILP32 machine? If the intended legal range is 0-4294967295, a 32 bit signed integer isn't going to work. On ILP32, (long)0xffffffff has a value of -1, assuming 2's complement. Actually, strtol returns long, so the largest positive number it can return is 0x7fffffff = 2147483647. If we need 0-4294967295 perhaps use strtoll() which returns long long. ------------- On the fwcontrol man page, should -i pri_req Set the PRIORITY_BUDGET register on all supported nodes. be -b pri_req Set the PRIORITY_BUDGET register on all supported nodes. ? For the benefit of end users who are not firewire wizards, it would be nice for the man page to include the range of legal values and what they mean. From owner-freebsd-firewire@FreeBSD.ORG Tue Aug 12 00:07:35 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889D9106567D; Tue, 12 Aug 2008 00:07:35 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id D1C748FC18; Tue, 12 Aug 2008 00:07:34 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m7C07U831733; Mon, 11 Aug 2008 17:07:30 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id AAA04467; Tue, 12 Aug 2008 00:06:30 GMT Message-Id: <200808120006.AAA04467@sopwith.solgatos.com> To: Sean Bruno In-reply-to: Your message of "Sat, 09 Aug 2008 13:12:28 PDT." <489DFA2C.4080407@miralink.com> Date: Mon, 11 Aug 2008 17:06:30 +0100 From: Dieter Cc: Scott Long , freebsd-firewire@freebsd.org Subject: Re: This is where I'm going with fwcontrol X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 00:07:35 -0000 A patch that adds error checking to malloc() and read(): =================================================================== RCS file: RCS/fwcontrol.c,v retrieving revision 1.2.1.1 diff -u -r1.2.1.1 fwcontrol.c --- fwcontrol.c 2008/08/11 20:47:34 1.2.1.1 +++ fwcontrol.c 2008/08/12 00:02:37 @@ -188,6 +188,8 @@ u_int32_t *qld, res; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 16); + if (asyreq == NULL) + err(1, "malloc"); asyreq->req.len = 16; #if 0 asyreq->req.type = FWASREQNODE; @@ -226,6 +228,8 @@ struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 12); + if (asyreq == NULL) + err(1, "malloc"); asyreq->req.len = 12; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.ld[0] = 0; @@ -251,6 +255,8 @@ struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 12); + if (asyreq == NULL) + err(1, "malloc"); asyreq->req.len = 12; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.common.tcode = FWTCODE_PHY; @@ -268,6 +274,8 @@ struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 16); + if (asyreq == NULL) + err(1, "malloc"); asyreq->req.len = 16; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.wreqq.dst = FWLOCALBUS | (node & 0x3f); @@ -643,7 +651,11 @@ err(1, "ioctl FW_SRSTREAM"); buf = (char *)malloc(1024*16); + if (buf == NULL) + err(1, "malloc"); len = read(fd, buf, 1024*16); + if (len < 0) + err(1, "read"); ptr = (u_int32_t *) buf; ciph = (struct ciphdr *)(ptr + 1); @@ -731,6 +743,8 @@ break; case 'c': crom_string = malloc(strlen(optarg)+1); + if (crom_string == NULL) + err(1, "malloc"); strcpy(crom_string, optarg); display_crom = 1; open_needed = 1; @@ -739,6 +753,8 @@ break; case 'd': crom_string_hex = malloc(strlen(optarg)+1); + if (crom_string_hex == NULL) + err(1, "malloc"); strcpy(crom_string_hex, optarg); display_crom_hex = 1; open_needed = 1; @@ -827,6 +843,8 @@ break; case 'R': recv_data = malloc(strlen(optarg)+1); + if (recv_data == NULL) + err(1, "malloc"); strcpy(recv_data, optarg); open_needed = 1; command_set = 1; @@ -834,6 +852,8 @@ break; case 'S': send_data = malloc(strlen(optarg)+1); + if (send_data == NULL) + err(1, "malloc"); strcpy(send_data, optarg); open_needed = 1; display_board_only = 0; From owner-freebsd-firewire@FreeBSD.ORG Tue Aug 12 00:24:25 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3684B106566B for ; Tue, 12 Aug 2008 00:24:25 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id 6D20E8FC14 for ; Tue, 12 Aug 2008 00:24:24 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m7C0OLg31759 for freebsd-firewire@freebsd.org; Mon, 11 Aug 2008 17:24:21 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id AAA02381; Tue, 12 Aug 2008 00:23:05 GMT Message-Id: <200808120023.AAA02381@sopwith.solgatos.com> To: freebsd-firewire@freebsd.org In-reply-to: Your message of "Sat, 09 Aug 2008 13:12:28 PDT." <489DFA2C.4080407@miralink.com> Date: Mon, 11 Aug 2008 17:23:05 +0100 From: Dieter Subject: Re: This is where I'm going with fwcontrol X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 00:24:25 -0000 The man page doesn't document the -f option. The usage message doesn't list -M. From owner-freebsd-firewire@FreeBSD.ORG Tue Aug 12 00:34:37 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19448106566C; Tue, 12 Aug 2008 00:34:37 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6778FC16; Tue, 12 Aug 2008 00:34:36 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m7C0YUT31776; Mon, 11 Aug 2008 17:34:30 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id AAA07139; Tue, 12 Aug 2008 00:33:22 GMT Message-Id: <200808120033.AAA07139@sopwith.solgatos.com> To: Sean Bruno In-reply-to: Your message of "Sat, 09 Aug 2008 13:12:28 PDT." <489DFA2C.4080407@miralink.com> Date: Mon, 11 Aug 2008 17:33:22 +0100 From: Dieter Cc: Scott Long , freebsd-firewire@freebsd.org Subject: Re: This is where I'm going with fwcontrol X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 00:34:37 -0000 > Also, I changed some of the variable to check for >= 0 and set their > default values to -1. This should have the same effect as adding a new > variable as you did in your fix. If you're going to do it that way, the code should check that the argument is in range, and print a complaint if out of range. Otherwise the user could say "fwcontrol -f -1" and nothing would happen. And the man page should list the legal range. Hmmm, actually these should be done even with the add-a-new-variable method. From owner-freebsd-firewire@FreeBSD.ORG Tue Aug 12 01:07:30 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E391065687; Tue, 12 Aug 2008 01:07:30 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 501678FC08; Tue, 12 Aug 2008 01:07:30 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id E5C521A90E6; Mon, 11 Aug 2008 18:01:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -4.399 X-Spam-Level: X-Spam-Status: No, score=-4.399 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599] Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7ln9Ev1PrSQ5; Mon, 11 Aug 2008 18:01:30 -0700 (PDT) Received: from [10.47.1.6] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id F1F3D1A90B0; Mon, 11 Aug 2008 18:01:29 -0700 (PDT) Message-ID: <48A0E237.5020702@miralink.com> Date: Mon, 11 Aug 2008 18:07:03 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Dieter References: <200808120033.AAA07139@sopwith.solgatos.com> In-Reply-To: <200808120033.AAA07139@sopwith.solgatos.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Scott Long , freebsd-firewire@freebsd.org Subject: Re: This is where I'm going with fwcontrol X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 01:07:30 -0000 Dieter wrote: >> Also, I changed some of the variable to check for >= 0 and set their >> default values to -1. This should have the same effect as adding a new >> variable as you did in your fix. >> > > If you're going to do it that way, the code should check that the argument > is in range, and print a complaint if out of range. Otherwise the user could > say "fwcontrol -f -1" and nothing would happen. And the man page should list > the legal range. Hmmm, actually these should be done even with the > add-a-new-variable method. > Excellent feedback, let me work on something tonight and reissue the patch. -- Sean Bruno MiraLink Corporation 6015 NE 80th Ave, Ste 100 Portland, OR 97218 Cell 503-358-6832 Phone 503-621-5143 Fax 503-621-5199 MSN: sbruno@miralink.com Google: seanwbruno@gmail.com