Flags for WD driver

2007-05-14 Thread Jeff Simmons
Is there any documentation on the exact functions of the flags that can be 
passed to WD via config? I haven't found any, and I'm not a good enough C 
programmer to tease them out of the source.

-- 
Jeff Simmons   [EMAIL PROTECTED]
Simmons Consulting - Network Engineering, Administration, Security
By these actions SRL became the first to operate intentionally lethal
machinery over the net with standard browser software.
-- Survival Research Laboratories



Re: Flags for WD driver

2007-05-14 Thread Miod Vallat
 Is there any documentation on the exact functions of the flags that can be 
 passed to WD via config? I haven't found any, and I'm not a good enough C 
 programmer to tease them out of the source.

Unexpectably, these flags are described in the wd(4) manual page.

Miod



Re: Flags for WD driver

2007-05-14 Thread Ted Unangst

On 5/14/07, Jeff Simmons [EMAIL PROTECTED] wrote:

Is there any documentation on the exact functions of the flags that can be
passed to WD via config? I haven't found any, and I'm not a good enough C
programmer to tease them out of the source.


man wd?



Re: Flags for WD driver

2007-05-14 Thread Stuart Henderson
On 2007/05/14 11:50, Jeff Simmons wrote:
 Is there any documentation on the exact functions of the flags that can be 
 passed to WD via config?

yes, in wd(4), surprisingly enough.

 The flags are used only with controllers that support DMA operations and
 mode settings (like some pciide(4) controllers).  The lowest order
 (rightmost) nibble of the flags define the PIO mode to use.  The next
 four bits indicate the DMA mode and the third nibble the UltraDMA mode.

 For each set of four bits, the 3 lower bits define the mode to use and
 the last bit must be set to 1 for this setting to be used.  For DMA and
 UltraDMA, 0xf () means ``disable''.  For example, a flags value of
 0x0fac ( 1010 1100) means ``use PIO mode 4, DMA mode 2, disable
 UltraDMA''.  The special setting 0x means ``use whatever the drive
 claims to support''.



Re: Flags for WD driver

2007-05-14 Thread Matthias Kilian
On Mon, May 14, 2007 at 11:57:55AM -0700, Ted Unangst wrote:
 Is there any documentation on the exact functions of the flags that can be
 passed to WD via config? I haven't found any, and I'm not a good enough C
 programmer to tease them out of the source.
 
 man wd?

That last bit confuses me ;)

Index: wd.4
===
RCS file: /cvs/src/share/man/man4/wd.4,v
retrieving revision 1.12
diff -u -w -p -r1.12 wd.4
--- wd.415 Feb 2005 19:24:41 -  1.12
+++ wd.414 May 2007 19:05:16 -
@@ -52,7 +52,7 @@ The next four bits indicate the DMA mode
 mode.
 .Pp
 For each set of four bits, the 3 lower bits define the mode to use
-and the last bit must be set to 1 for this setting to be used.
+and the highest bit must be set to 1 for this setting to be used.
 For DMA and UltraDMA, 0xf () means
 .Dq disable .
 For example, a



Re: Flags for WD driver

2007-05-14 Thread Jeff Simmons
On Monday 14 May 2007 11:57, Ted Unangst wrote:
 On 5/14/07, Jeff Simmons [EMAIL PROTECTED] wrote:
  Is there any documentation on the exact functions of the flags that can
  be passed to WD via config? I haven't found any, and I'm not a good
  enough C programmer to tease them out of the source.

 man wd?

So a flag for, say, PIO, of 0x0100 would be ignored, since it says to set PIO 
mode 4 but not to use it? And then would it revert to the equivalent of 
0x?

Not trying to be difficult here, I'm just having some ... interesting ... 
results passing flags to WD, and it would be nice to know exactly what's 
going on.

-- 
Jeff Simmons   [EMAIL PROTECTED]
Simmons Consulting - Network Engineering, Administration, Security
By these actions SRL became the first to operate intentionally lethal
machinery over the net with standard browser software.
-- Survival Research Laboratories



Re: Flags for WD driver

2007-05-14 Thread Ted Unangst

On 5/14/07, Jeff Simmons [EMAIL PROTECTED] wrote:

On Monday 14 May 2007 11:57, Ted Unangst wrote:
 On 5/14/07, Jeff Simmons [EMAIL PROTECTED] wrote:
  Is there any documentation on the exact functions of the flags that can
  be passed to WD via config? I haven't found any, and I'm not a good
  enough C programmer to tease them out of the source.

 man wd?

So a flag for, say, PIO, of 0x0100 would be ignored, since it says to set PIO
mode 4 but not to use it? And then would it revert to the equivalent of
0x?


yes.


Not trying to be difficult here, I'm just having some ... interesting ...
results passing flags to WD, and it would be nice to know exactly what's
going on.


well, why are you changing them?  my initial response was more along
the lines of crazy person, look out.