Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2008 12:34:34 +0100
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        Sean Bruno <sbruno@miralink.com>
Cc:        freebsd-firewire@freebsd.org
Subject:   Re: New and improved? patch 
Message-ID:  <200808311934.TAA10392@sopwith.solgatos.com>
In-Reply-To: Your message of "Fri, 29 Aug 2008 14:18:11 PDT." <48B86793.6080404@miralink.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> Freshly updated with new found information on what the heck -f -g 
>> actually do!
>> 
>> See how this behaves for you.

usage:
> [-f force_root ]

Suggestion:  [-f force_root_node ] or maybe "desired_root_node" or maybe
"root_node" or maybe just "node", same as -c -d -o -s

> -g: broadcast gap_count by phy_config packet

Suggestion: -g: set gap_count by broadcasting phy_config packet
or maybe just: -g: set gap_count

> -f: broadcast force_root by phy_config packet

Suggestion: -f force a node to become the root node by broadcasting phy_config packet
or maybe just: -f force a node to become the root node

7.0 AMD64 # ./fwcontrol -f -5
fwcontrol: main:set_root_node out of range: No such file or directory

"No such file or directory" seems wrong

7.0 AMD64 # ./fwcontrol -g 70
fwcontrol: main:set_gap_count out of range: No such file or directory

"No such file or directory" seems wrong

7.0 AMD64 # ./fwcontrol -d 70
fwcontrol: no such node -1.

(a) 70 becomes -1 ?
(b) Wouldn't -d have the same range as -f ?

7.0 AMD64 # ./fwcontrol -c 70
fwcontrol: no such node -1.

(a) 70 becomes -1 ?
(b) Wouldn't -c have the same range as -f ?

7.0 AMD64 # ./fwcontrol -o 70
fwcontrol: main: node out of range: 70
: No such file or directory

"No such file or directory" seems wrong

7.0 AMD64 # ./fwcontrol -s 70
fwcontrol: main: node out of range: 70
: No such file or directory

"No such file or directory" seems wrong



-               asyreq->pkt.mode.ld[1] |= (root_node & 0x3f) << 24 | 1 << 23;
+               asyreq->pkt.mode.ld[1] |= ((root_node << 24) | (1 << 23));
        if (gap_count >= 0)
-               asyreq->pkt.mode.ld[1] |= 1 << 22 | (gap_count & 0x3f) << 16;
+               asyreq->pkt.mode.ld[1] |= ((1 << 22) | (gap_count << 16));

Any reason for pulling out the "& 0x3f" ?  Yeah it should be redundant
now that there is range checking on the arguments, but as you said,
fwcontrol is dangerous and the mask makes it safer at very little cost.


-               for (i = 0; i < 4; i++) {
-                       snprintf(name, sizeof(name), "%s.%d", devbase, i);
-                       if ((*fd = open(name, O_RDWR)) >= 0)
-                               break;
-               }
+               *fd = open(devname, O_RDWR);

Looking at various firewire man pages, I don't find any explanation of
the various /dev filenames, such as what the .%d part was/is for.  So I
have no clue why this code was changed.  Did I miss a discussion?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808311934.TAA10392>