From owner-freebsd-firewire@FreeBSD.ORG Mon Jun 23 11:06:53 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 7D551106566B for ; Mon, 23 Jun 2008 11:06:53 +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 52CB08FC19 for ; Mon, 23 Jun 2008 11:06:53 +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 m5NB6ruM064939 for ; Mon, 23 Jun 2008 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5NB6qiL064935 for freebsd-firewire@FreeBSD.org; Mon, 23 Jun 2008 11:06:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Jun 2008 11:06:52 GMT Message-Id: <200806231106.m5NB6qiL064935@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, 23 Jun 2008 11:06:53 -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 Tue Jun 24 17:30:01 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 B8450106567E for ; Tue, 24 Jun 2008 17:30:01 +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 A1DE68FC2E for ; Tue, 24 Jun 2008 17:30:01 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 1D2061A929B for ; Tue, 24 Jun 2008 10:24:40 -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 rwJy++3vvsMk for ; Tue, 24 Jun 2008 10:24:39 -0700 (PDT) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id D7EC61A9138 for ; Tue, 24 Jun 2008 10:24:39 -0700 (PDT) Message-ID: <48612F18.4030401@miralink.com> Date: Tue, 24 Jun 2008 10:30:00 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: "Ejecting" Firewire Drives 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, 24 Jun 2008 17:30:01 -0000 What is the proper way to disconnect a Firewire Hard disk from a FreeBSD system? If I disconnect it after unmounting, camcontrol locks up when doing a rescan. -- Sean Bruno MiraLink Corporation 6015 NE 80th Ave, Ste 100 Portland, OR 97218 Phone 503-621-5143 Fax 503-621-5199 From owner-freebsd-firewire@FreeBSD.ORG Tue Jun 24 20:49:50 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 36D15106564A for ; Tue, 24 Jun 2008 20:49:50 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id 17D438FC13 for ; Tue, 24 Jun 2008 20:49:49 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (s1ieuu2gwcrk6cj0@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id m5OKRUS3072653; Tue, 24 Jun 2008 13:27:30 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id m5OKRUmg072652; Tue, 24 Jun 2008 13:27:30 -0700 (PDT) (envelope-from jmg) Date: Tue, 24 Jun 2008 13:27:30 -0700 From: John-Mark Gurney To: Sean Bruno Message-ID: <20080624202729.GJ3767@funkthat.com> Mail-Followup-To: Sean Bruno , freebsd-firewire@freebsd.org References: <48612F18.4030401@miralink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48612F18.4030401@miralink.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hydrogen.funkthat.com [127.0.0.1]); Tue, 24 Jun 2008 13:27:30 -0700 (PDT) Cc: freebsd-firewire@freebsd.org Subject: Re: "Ejecting" Firewire Drives 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, 24 Jun 2008 20:49:50 -0000 Sean Bruno wrote this message on Tue, Jun 24, 2008 at 10:30 -0700: > What is the proper way to disconnect a Firewire Hard disk from a FreeBSD > system? To make FreeBSD really see that the disk disappeared, run fwcontrol -r three times. The SBP driver does not disconnect a drive immediately incase you plug it back in, but if it doesn't see the drive after a few bus resets, it will finally be removed... See sbp(4) for more information. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-firewire@FreeBSD.ORG Fri Jun 27 03:32:44 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 575911065678; Fri, 27 Jun 2008 03:32:44 +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 330D68FC16; Fri, 27 Jun 2008 03:32:44 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 3A6621A9378; Thu, 26 Jun 2008 20:32:34 -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 3CSqyax+950M; Thu, 26 Jun 2008 20:32:33 -0700 (PDT) Received: from [10.47.1.10] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 8EA311A9325; Thu, 26 Jun 2008 20:32:33 -0700 (PDT) Message-ID: <48645F5A.6000209@miralink.com> Date: Thu, 26 Jun 2008 20:32:42 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa References: <485AFC6D.4050107@miralink.com> In-Reply-To: <485AFC6D.4050107@miralink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: [RELENG_7] SBP Drives not recognized 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: Fri, 27 Jun 2008 03:32:44 -0000 > > > This looks an awful lot like my issues with sbp_targ from previous > emails and may indicate a more serious failure in fwohci.c or firewire.c > > Or, it may indicate that I have no idea what I am doing. :) > > This SBP-2 device is a external 2 disk enclosure with an Oxford > Semicondoctor F/W controller. It seems to work just fine with linux > and windows. > > [sean@home-test ~]$ sudo fwcontrol -t > crc_len: 4 generation:8 node_count:2 sid_count:2 > id link gap_cnt speed delay cIRM power port0 port1 port2 ini more > 00 1 5 S800 0 0 -1W - - P 0 0 > 01 1 5 S800 0 1 -1W C - - 1 0 > > [sean@home-test ~]$ sudo fwcontrol -p > === base register === > 0x07 0x85 0xe3 0xe2 0xc4 0x03 0x50 0x00 > Physical_ID:1 R:1 CPS:1 > RHB:1 IBR:0 Gap_Count:5 > Extended:7 Num_Ports:3 > PHY_Speed:7 Delay:2 > LCtrl:1 C:1 Jitter:0 Pwr_Class:4 > WDIE:0 ISBR:0 CTOI:0 CPSI:0 STOI:0 PEI:0 EAA:1 EMC:1 > Max_Legacy_SPD:2 BLINK:1 Bridge:0 > Page_Select:0 Port_Select0 > > === page 0 port 0 === > 0xfe 0x40 0xbb 0x00 0x00 0x00 0x00 0x00 > Astat:3 BStat:3 Ch:1 Con:1 RXOK:1 Dis:0 > Negotiated_speed:2 PIE:0 Fault:0 Stanby_fault:0 Disscrm:0 B_Only:0 > DC_connected:1 Max_port_speed:3 LPP:1 Cable_speed:3 > Connection_unreliable:0 Beta_mode:0 > Port_error:0x0 > Loop_disable:0 In_standby:0 Hard_disable:0 > > === page 0 port 1 === > 0xf8 0x60 0x3b 0x00 0x00 0x00 0x00 0x00 > Astat:3 BStat:3 Ch:1 Con:0 RXOK:0 Dis:0 > Negotiated_speed:3 PIE:0 Fault:0 Stanby_fault:0 Disscrm:0 B_Only:0 > DC_connected:0 Max_port_speed:3 LPP:1 Cable_speed:3 > Connection_unreliable:0 Beta_mode:0 > Port_error:0x0 > Loop_disable:0 In_standby:0 Hard_disable:0 > > === page 0 port 2 === > 0xf8 0x60 0x3b 0x00 0x00 0x00 0x00 0x00 > Astat:3 BStat:3 Ch:1 Con:0 RXOK:0 Dis:0 > Negotiated_speed:3 PIE:0 Fault:0 Stanby_fault:0 Disscrm:0 B_Only:0 > DC_connected:0 Max_port_speed:3 LPP:1 Cable_speed:3 > Connection_unreliable:0 Beta_mode:0 > Port_error:0x0 > Loop_disable:0 In_standby:0 Hard_disable:0 > > === page 1 === > 0x02 0x00 0x08 0x00 0x28 0x83 0x13 0x04 > Compliance:2 > Vendor_ID:0x080028 > Product_ID:0x831304 > > _______________________________________________ > freebsd-firewire@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-firewire > To unsubscribe, send any mail to > "freebsd-firewire-unsubscribe@freebsd.org" Ok, the failure case is that the firewire/sbp code is using the "max" speed instead of the negotiated speed. So, since "fwdev->spd" is what is being used to determine the speed, is it appropriate to mimic "fwcontrol" and grab the phy_page_0 to figure out the negotiated speed? Is it appropriate to check the phy_page during fw_sidrcv() when the driver creates the "speed map"? Sean From owner-freebsd-firewire@FreeBSD.ORG Sat Jun 28 01:22:44 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 C39B9106567F; Sat, 28 Jun 2008 01:22:44 +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 9934E8FC13; Sat, 28 Jun 2008 01:22:44 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 096891A9384; Fri, 27 Jun 2008 18:22:23 -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 JbZI3lIGgYD1; Fri, 27 Jun 2008 18:22:22 -0700 (PDT) Received: from [10.47.1.10] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 717F91A9144; Fri, 27 Jun 2008 18:22:22 -0700 (PDT) Message-ID: <48659262.8080604@miralink.com> Date: Fri, 27 Jun 2008 18:22:42 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: fwcontrol failure with multiple firewire cards 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: Sat, 28 Jun 2008 01:22:44 -0000 I noted very strange behavior from all pieces of the firewire stack while testing this week when there are multiple firewire cards in a machine. Before I start submitting patches to fwcontrol/firewire for these issues, is there any signifcant backwards compatibility issues I need to be concerned about? Should I come up with a way to make fwcontrol behave normally unless there is a new argument(eg -B to iterate over multiple cards)? Or is ok to trash the old behavior in favor of one that understands multiple cards? Sean From owner-freebsd-firewire@FreeBSD.ORG Sat Jun 28 01:43:29 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 02DAB106574E for ; Sat, 28 Jun 2008 01:43:28 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by mx1.freebsd.org (Postfix) with ESMTP id D63A98FC0A for ; Sat, 28 Jun 2008 01:43:27 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by an-out-0708.google.com with SMTP id b33so180797ana.13 for ; Fri, 27 Jun 2008 18:43:27 -0700 (PDT) Received: by 10.101.67.15 with SMTP id u15mr2473245ank.136.1214617406919; Fri, 27 Jun 2008 18:43:26 -0700 (PDT) Received: by 10.101.70.3 with HTTP; Fri, 27 Jun 2008 18:43:26 -0700 (PDT) Message-ID: <626eb4530806271843w998770cg54d747663f9bbddc@mail.gmail.com> Date: Fri, 27 Jun 2008 18:43:26 -0700 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: "Sean Bruno" In-Reply-To: <48659262.8080604@miralink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48659262.8080604@miralink.com> X-Google-Sender-Auth: 0a692dff27434cc9 Cc: freebsd-firewire@freebsd.org Subject: Re: fwcontrol failure with multiple firewire cards 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: Sat, 28 Jun 2008 01:43:29 -0000 To handle multiple card, you need '-u' option to be the first argument if I remember correctly. I think adding new feature is ok but you should be careful to change the behavior . On Fri, Jun 27, 2008 at 6:22 PM, Sean Bruno wrote: > I noted very strange behavior from all pieces of the firewire stack while > testing this week when there are multiple firewire cards in a machine. > Before I start submitting patches to fwcontrol/firewire for these issues, is > there any signifcant backwards compatibility issues I need to be concerned > about? > > Should I come up with a way to make fwcontrol behave normally unless there > is a new argument(eg -B to iterate over multiple cards)? Or is ok to trash > the old behavior in favor of one that understands multiple cards? > > Sean > > -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG From owner-freebsd-firewire@FreeBSD.ORG Sat Jun 28 18:20:07 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 C4B951065671; Sat, 28 Jun 2008 18:20:07 +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 93D0B8FC20; Sat, 28 Jun 2008 18:20:07 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 1B5081A90F4; Sat, 28 Jun 2008 11:19:37 -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 VC8Er7k4nk-B; Sat, 28 Jun 2008 11:19:36 -0700 (PDT) Received: from [10.47.1.30] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 6ED9F1A90E4; Sat, 28 Jun 2008 11:19:36 -0700 (PDT) Message-ID: <486680D5.9070106@miralink.com> Date: Sat, 28 Jun 2008 11:20:05 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa Content-Type: multipart/mixed; boundary="------------000401030404020107040309" Cc: Subject: [Patch] fwcontrol.c: iterate over multiple firewire boards if available 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: Sat, 28 Jun 2008 18:20:07 -0000 This is a multi-part message in MIME format. --------------000401030404020107040309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -- Iterate over mulitple f/w boards if there are no arguments passed. Provides the following output for multiple boards: [sean@home-test ~/RELENG_7/src/usr.sbin/fwcontrol]$ sudo ./fwcontrol 1 devices (info_len=1) node EUI64 status hostname 0 00-13-3b-01-00-01-01-82 0 1 devices (info_len=1) node EUI64 status hostname 0 00-11-06-00-00-00-4a-bb 0 Sean --------------000401030404020107040309 Content-Type: text/x-patch; name="fwcontrol.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fwcontrol.c.diff" Only in RELENG_7/src/usr.sbin/fwcontrol: .fwcontrol.c.swp Only in RELENG_7/src/usr.sbin/fwcontrol: fwcontrol Only in RELENG_7/src/usr.sbin/fwcontrol: fwcontrol.8.gz diff -u reference_RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c --- reference_RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c 2008-05-01 23:15:58.000000000 -0700 +++ RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c 2008-06-28 05:17:21.000000000 -0700 @@ -666,9 +666,12 @@ int main(int argc, char **argv) { +#define MAX_BOARDS 10 u_int32_t crom_buf[1024/4]; - char devbase[1024] = "/dev/fw0"; + char devbase[64]; + const char *device_string = "/dev/fw"; int fd, ch, len=1024; + int dev_counter = 0; long tmp; struct fw_eui64 eui; struct eui64 target; @@ -677,9 +680,20 @@ fd = -1; if (argc < 2) { - open_dev(&fd, devbase); - list_dev(fd); - } + while (dev_counter < MAX_BOARDS) { + snprintf(devbase, sizeof(devbase), "%s%d", device_string, dev_counter); + fd = open(devbase, O_RDWR); + if (fd > 0) { + list_dev(fd); + close(fd); + dev_counter++; + } else { + fd = -1; + dev_counter = MAX_BOARDS; + } + } + } else + snprintf(devbase, sizeof(devbase), "%s%d", device_string, dev_counter); while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) switch(ch) { Only in RELENG_7/src/usr.sbin/fwcontrol: fwcontrol.o Only in RELENG_7/src/usr.sbin/fwcontrol: fwcrom.o Only in RELENG_7/src/usr.sbin/fwcontrol: fwdv.o Only in RELENG_7/src/usr.sbin/fwcontrol: fwmpegts.o --------------000401030404020107040309-- From owner-freebsd-firewire@FreeBSD.ORG Sat Jun 28 18:23:20 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 0F0E51065671; Sat, 28 Jun 2008 18:23:20 +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 D738D8FC1B; Sat, 28 Jun 2008 18:23:19 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 67FD41A90F4; Sat, 28 Jun 2008 11:22:49 -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 trwE2QDEIoM0; Sat, 28 Jun 2008 11:22:49 -0700 (PDT) Received: from [10.47.1.30] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id D06421A90E4; Sat, 28 Jun 2008 11:22:48 -0700 (PDT) Message-ID: <48668196.6080602@miralink.com> Date: Sat, 28 Jun 2008 11:23:18 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: freebsd-firewire@freebsd.org, Hidetoshi Shimokawa References: <486680D5.9070106@miralink.com> In-Reply-To: <486680D5.9070106@miralink.com> Content-Type: multipart/mixed; boundary="------------020908030805080901070407" Cc: Subject: CLEANUP Re: [Patch] fwcontrol.c: iterate over multiple firewire boards if available 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: Sat, 28 Jun 2008 18:23:20 -0000 This is a multi-part message in MIME format. --------------020908030805080901070407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sean Bruno wrote: > -- Iterate over mulitple f/w boards if there are no arguments passed. > > Provides the following output for multiple boards: > [sean@home-test ~/RELENG_7/src/usr.sbin/fwcontrol]$ sudo ./fwcontrol > 1 devices (info_len=1) > node EUI64 status hostname > 0 00-13-3b-01-00-01-01-82 0 1 devices (info_len=1) > node EUI64 status hostname > 0 00-11-06-00-00-00-4a-bb 0 > > Sean > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-firewire@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-firewire > To unsubscribe, send any mail to "freebsd-firewire-unsubscribe@freebsd.org" Sorry, I didn't clean up my patch before I sent it. Sean --------------020908030805080901070407 Content-Type: text/x-patch; name="fwcontrol.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fwcontrol.c.diff" diff -u reference_RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c --- reference_RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c 2008-05-01 23:15:58.000000000 -0700 +++ RELENG_7/src/usr.sbin/fwcontrol/fwcontrol.c 2008-06-28 05:17:21.000000000 -0700 @@ -666,9 +666,12 @@ int main(int argc, char **argv) { +#define MAX_BOARDS 10 u_int32_t crom_buf[1024/4]; - char devbase[1024] = "/dev/fw0"; + char devbase[64]; + const char *device_string = "/dev/fw"; int fd, ch, len=1024; + int dev_counter = 0; long tmp; struct fw_eui64 eui; struct eui64 target; @@ -677,9 +680,20 @@ fd = -1; if (argc < 2) { - open_dev(&fd, devbase); - list_dev(fd); - } + while (dev_counter < MAX_BOARDS) { + snprintf(devbase, sizeof(devbase), "%s%d", device_string, dev_counter); + fd = open(devbase, O_RDWR); + if (fd > 0) { + list_dev(fd); + close(fd); + dev_counter++; + } else { + fd = -1; + dev_counter = MAX_BOARDS; + } + } + } else + snprintf(devbase, sizeof(devbase), "%s%d", device_string, dev_counter); while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) switch(ch) { --------------020908030805080901070407--