33 #define AdvancedEPPTests 1
92 ECPdetect(PUCHAR port)
167 EPPdetect(PUCHAR port)
170 return EPPdWOC(port);
175 PPPdetect(PUCHAR port)
202 ResetLPT(PUCHAR port)
230 static enum lptMode AdvEPP(PUCHAR port){
231 unsigned char EPPctrl=0;
240 if (EPPdWOC(port)!=
lptN_A)
251 EPPcontrol(PUCHAR port){
253 static char ctrlWord[8];
254 unsigned int done0[8], done1[8];
255 unsigned char i,EPPctrl, OldCtrl,mask;
272 for(i=0,mask=0x80;i<8;i++,mask>>=1)
287 if(done0[i]==done1[i])
289 if(!done0[i]) ctrlWord[i]=
'!';
290 else ctrlWord[i]=
'X';
292 else if(!done0[i]) ctrlWord[i]=
'1';
293 else if(!done1[i]) ctrlWord[i]=
'0';
294 else ctrlWord[i]=
'?';
314 if((((ULONG_PTR)port) & ~0x1fc)!=0x200)
326 if((ret = ECPdetect(port)) !=
lptN_A)
333 if ((ret = EPPdetect(port)) !=
lptN_A)
338 if ((ret = AdvEPP(port)) !=
lptN_A)
342 if ((ret = PPPdetect(port)) !=
lptN_A)
353 if (LPTmode(port) !=
lptECP)
360 SetECPmode(PUCHAR port,
enum ecpMode mode)
362 unsigned char oldvalue;
364 if (LPTmode(port) !=
lptECP)
379 preprprt(PUCHAR port)
382 const char *modes[6]={
"N/A",
"SPP",
"PS/2",
"EPP",
"ECP",
"EPPc"};
395 const char *ecpM[9]={
399 "Parallel Port FIFO Mode",
413 switch (preprprt(port))
420 " %s", EPPcontrol(port)));
447 NTSTATUS ntStatus = STATUS_SUCCESS;
448 enum lptMode lptmode = Pdx->HandleEcpEppMyself & 0xFF;
456 lptmode = LPTmode(Pdx->ParPortPortAddress);
457 prport(Pdx->ParPortPortAddress);
462 oldecpmode = ECPmode(Pdx->ParPortPortAddress);
465 SetECPmode(Pdx->ParPortPortAddress,
ecpBYTE);
468 prport(Pdx->ParPortPortAddress);
477 Pdx->HandleEcpEppMyself = (lptmode & 0xFF) | ((oldecpmode & 0xFF) << 8);
479 FUNC_LEAVE_NTSTATUS(ntStatus);
498 NTSTATUS ntStatus = STATUS_SUCCESS;
499 enum lptMode lptmode = Pdx->HandleEcpEppMyself & 0xFF;
500 enum ecpMode oldecpmode = (Pdx->HandleEcpEppMyself & 0xFF00) >> 8;
507 SetECPmode(Pdx->ParPortPortAddress, oldecpmode);
510 prport(Pdx->ParPortPortAddress);
513 FUNC_LEAVE_NTSTATUS(ntStatus);
534 NTSTATUS ntStatus = STATUS_LOGON_FAILURE;
538 if (!Pdx->HandleEcpEppMyself)
545 if (Pdx->HandleEcpEppMyself || ((ntStatus == STATUS_INVALID_PARAMETER) && Pdx->IsNT4))
551 FUNC_LEAVE_NTSTATUS(ntStatus);
574 if (Pdx->HandleEcpEppMyself == 0)
583 FUNC_LEAVE_NTSTATUS(ntStatus);
#define FUNC_LEAVE_INT(_xxx)
NTSTATUS ParPortUnsetMode(PDEVICE_EXTENSION Pdx)
Unset the operational mode of the parallel port.
VOID cbmiec_udelay(IN ULONG howlong)
Wait for a timeout.
NTSTATUS ParPortSetModeWdm(PDEVICE_EXTENSION Pdx)
Set the operational mode of the parallel port, WDM Version.
#define WRITE_PORT_UCHAR(_x_, _y_)
WRITE_PORT_UCHAR replacement for debugging.
NTSTATUS ParPortSetMode(PDEVICE_EXTENSION Pdx)
Set the operational mode of the parallel port.
Definitions for the opencbm driver.
NTSTATUS ParPortSetModeNt4(PDEVICE_EXTENSION Pdx)
Set the operational mode of the parallel port, NT4 version.
NTSTATUS ParPortUnsetModeNt4(PDEVICE_EXTENSION Pdx)
Unset the operational mode of the parallel port, NT4 version.
NTSTATUS ParPortUnsetModeWdm(PDEVICE_EXTENSION Pdx)
Unset the operational mode of the parallel port, WDM Version.
#define READ_PORT_UCHAR(_x_)
READ_PORT_UCHAR replacement for debugging.