Jump to content

DevHelp_PushRequest

From EDM2
Revision as of 22:30, 22 May 2025 by Martini (talk | contribs)

This service adds the current device request packet to the linked list of packets to be executed by the physical device driver.

Syntax

C

USHORT APIENTRY DevHelp_PushRequest( NPBYTE Queue, PBYTE  ReqPktAddr );

Assembler

MOV   SI,OFFSET DS:queue      ; Location of the DWORD queue head
                              ; (which points to the first request in the list)
LES   BX,request_packet       ; Pointer to request packet.

MOV   DL,DevHlp_PushRequest

CALL  [Device_Help]

Parameters

C

Queue (NPBYTE) - input
Location of the queue head which points to the first request in the list.
ReqPktAddr (PBYTE) - input
Pointer to the request packet.

Assembler

MOV   SI,OFFSET DS:queue      ; Location of the DWORD queue head
                              ; (which points to the first request in the list)
LES   BX,request_packet       ; Pointer to request packet.

Return Code

C

Success Indicator: 0

Possible errors: None.

Assembler

None

Remarks

A physical device driver uses PushRequest and PullRequest to maintain a work queue for each of its devices. The physical device driver must provide the storage for the DWORD work queue head, which defines the start of the request packet linked list. The work queue head must be initialized to 0.

The physical device driver task-time thread adds all incoming Read/Write requests to its Request List. The device driver task-time thread then determines whether the interrupt-time thread is active, and if not, it sends the request to the device. Because the device can be active at this point, the device driver task-time thread must turn off interrupts before calling the device; otherwise, a window exists in which the device finishes before the packet is put on the list.

PushRequest can also be used to place request packets that were allocated by AllocReqPacket in the request packet work queue.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_PushRequest( NPBYTE Queue,
                                     PBYTE  ReqPktAddr );

Alternative Names

DevHelp_PushRequest, DevHlp_PushRequest, DevHlp_PushReqPacket.