Microsoft KB Archive/288289

{|
 * width="100%"|

PRB: WIN1394 Sets Asynchronous Stream And Isoch Speed Fields Incorrectly

 * }

Q288289

-

The information in this article applies to:


 * Microsoft Windows 98 Driver Development Kit (DDK)
 * Microsoft Windows ME Driver Development Kit (DDK)
 * Microsoft Windows 2000 Driver Development Kit (DDK)

-

SYMPTOMS
The Win1394.exe test program may place incorrect values in the spd field of an Asynchronous Transmit Stream packet. This occurs when you select any of the option button Speed controls in the Async Stream dialog box from the Async Commands menu item.

CAUSE
The program uses speed flags values instead of SCODE values. For example, if you select &quot;100Mbps&quot;, SPEED_FLAGS_100 (1) is used instead of SCODE_100_RATE (0).

RESOLUTION
You can resolve this problem by modifying the source code for the WIN1394 project, as detailed in the &quot;More Information&quot; section, and then rebuild the project.

Note that the code does not limit the values to the maximum permissible speed. To find the maximum speed, you should execute the 1394 Commands menu Get Max Speed Between Devices command with Use Local Node selected.

Note that the return value shown by the application is a SPEED_FLAGS_x value (refer to [drive]:\[DDK directory]\Inc\Ddk\Wdm\1394.h for definitions of the values).

MORE INFORMATION
PATH: [drive]:\[DDK directory]\Src\Wdm\1394\Tools\Win1394

 FILE: 1394.h 

Add this:

// // 1394 Speed codes //  FILE: resource.h 
 * 1) define SCODE_100_RATE                         0
 * 2) define SCODE_200_RATE                         1
 * 3) define SCODE_400_RATE                         2
 * 4) define SCODE_800_RATE                         3
 * 5) define SCODE_1600_RATE                        4
 * 6) define SCODE_3200_RATE                        5

Change this:

#define IDC_ASYNC_STREAM_FASTEST               2258 To:

#define IDC_ASYNC_STREAM_3200MBPS              2258

Change this:

#define IDC_ASYNC_STREAM_LOOP_FASTEST          2359 To:

#define IDC_ASYNC_STREAM_LOOP_3200MBPS         2359

 FILE: win1394.rc 

ASYNCSTREAM DIALOG DISCARDABLE 0, 0, 269, 102 .   .    . Change this:

CONTROL        &quot;Fastest&quot;,IDC_ASYNC_STREAM_FASTEST,&quot;Button&quot;,BS_AUTORADIOBUTTON,205,33,39,10 To:

CONTROL        &quot;3200 Mbps&quot;,IDC_ASYNC_STREAM_3200MBPS,&quot;Button&quot;,BS_AUTORADIOBUTTON,204,33,51,10

. .   . ASYNCSTREAMLOOPBACK DIALOG DISCARDABLE  50, 50, 310, 209 .   .    . Change this:

CONTROL        &quot;Fastest&quot;,IDC_ASYNC_STREAM_LOOP_FASTEST,&quot;Button&quot;,BS_AUTORADIOBUTTON,83,33,39,10 To:

CONTROL        &quot;3200 Mbps&quot;,IDC_ASYNC_STREAM_LOOP_3200MBPS,&quot;Button&quot;,BS_AUTORADIOBUTTON,82,33,51,10

 FILE: async.c 

INT_PTR CALLBACK AsyncStreamDlgProc(       .        .        .        case WM_INITDIALOG:            .            .            . if (pAsyncStream->nSpeed == SPEED_FLAGS_FASTEST) { Change this:

               CheckRadioButton( hDlg,                                  IDC_ASYNC_STREAM_100MBPS,                                  IDC_ASYNC_STREAM_FASTEST,                                  IDC_ASYNC_STREAM_FASTEST                                  ); }           else {

CheckRadioButton( hDlg,                                 IDC_ASYNC_STREAM_100MBPS,                                  IDC_ASYNC_STREAM_FASTEST,                                  pAsyncStream->nSpeed + (IDC_ASYNC_STREAM_100MBPS-1)                                  ); } To:

CheckRadioButton( hDlg,                             IDC_ASYNC_STREAM_100MBPS,                              IDC_ASYNC_STREAM_3200MBPS,                              IDC_ASYNC_STREAM_200MBPS                              );

. ..

case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: .                   .                    . Change this:

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_100MBPS)) pAsyncStream->nSpeed = SPEED_FLAGS_100;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_200MBPS)) pAsyncStream->nSpeed = SPEED_FLAGS_200;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_400MBPS)) pAsyncStream->nSpeed = SPEED_FLAGS_400;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_1600MBPS)) pAsyncStream->nSpeed = SPEED_FLAGS_1600;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_FASTEST)) pAsyncStream->nSpeed = SPEED_FLAGS_FASTEST; To:

<pre class="CODESAMP">if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_100MBPS)) pAsyncStream->nSpeed = SCODE_100_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_200MBPS)) pAsyncStream->nSpeed = SCODE_200_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_400MBPS)) pAsyncStream->nSpeed = SCODE_400_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_1600MBPS)) pAsyncStream->nSpeed = SCODE_1600_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_3200MBPS)) pAsyncStream->nSpeed = SCODE_3200_RATE;

<pre class="CODESAMP">. .                    .                     . } // AsyncStreamDlgProc

void w1394_AsyncStream(   .    .    . Change this:

<pre class="CODESAMP">asyncStream.nSpeed = SPEED_FLAGS_FASTEST; To:

<pre class="CODESAMP">asyncStream.nSpeed = SCODE_200_RATE;

<pre class="CODESAMP">. .   . } // w1394_AsyncStream

INT_PTR CALLBACK AsyncStreamLoopbackDlgProc(       .        .        .        case WM_INITDIALOG:            .            .            . Change this:

<pre class="CODESAMP">if (pLoopbackParams->asyncStream.nSpeed == SPEED_FLAGS_FASTEST) {

CheckRadioButton( hDlg,                                 IDC_ASYNC_STREAM_LOOP_100MBPS,                                  IDC_ASYNC_STREAM_LOOP_FASTEST,                                  IDC_ASYNC_STREAM_LOOP_FASTEST                                  ); }           else {

CheckRadioButton( hDlg,                                 IDC_ASYNC_STREAM_LOOP_100MBPS,                                  IDC_ASYNC_STREAM_LOOP_FASTEST,                                  pLoopbackParams->asyncStream.nSpeed + (IDC_ASYNC_STREAM_LOOP_100MBPS-1)                                  ); } To:

<pre class="CODESAMP">CheckRadioButton( hDlg,                             IDC_ASYNC_STREAM_LOOP_100MBPS,                              IDC_ASYNC_STREAM_LOOP_3200MBPS,                              IDC_ASYNC_STREAM_LOOP_200MBPS                              );

<pre class="CODESAMP">. .           .        case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: .                   .                    . Change this:

<pre class="CODESAMP">if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_100MBPS)) pLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_100;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_200MBPS)) pLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_200;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_400MBPS)) pLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_400;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_1600MBPS)) pLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_1600;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_FASTEST)) pLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_FASTEST; To:

<pre class="CODESAMP">if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_100MBPS)) pLoopbackParams->asyncStream.nSpeed = SCODE_100_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_200MBPS)) pLoopbackParams->asyncStream.nSpeed = SCODE_200_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_400MBPS)) pLoopbackParams->asyncStream.nSpeed = SCODE_400_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_1600MBPS)) pLoopbackParams->asyncStream.nSpeed = SCODE_1600_RATE;

if (IsDlgButtonChecked(hDlg, IDC_ASYNC_STREAM_LOOP_3200MBPS)) pLoopbackParams->asyncStream.nSpeed = SCODE_3200_RATE;

<pre class="CODESAMP">. ..

void w1394_AsyncStreamStartLoopback(   .    .    . Change this:

<pre class="CODESAMP">streamLoopbackParams->asyncStream.nSpeed = SPEED_FLAGS_200; To:

<pre class="CODESAMP">streamLoopbackParams->asyncStream.nSpeed = SCODE_200_RATE; Additional query words:

Keywords : kbDDK kbOSWin2000 kbOSWin98 kbDSupport kbGrpDSWin9xDDK kbOSWinME

Issue type : kbprb

Technology : kbwin2000Search kbwin2000DDK kbWinMEsearch kbAudDeveloper kbWin98search kbWinDDKSearch kbWin98DDKSearch kbWinMEDDK kbWin98DDK