阅读:1941回复:1
如何区分机器上安装的多枚1394卡
我的程序要求能区分出机器上安装的多枚1394卡,但我不知该如何下手,请问下这个功能能实现吗?如何实现?W2K DDK中提供1394 SAMPLE用的上吗?
|
|
沙发#
发布于:2003-05-04 19:13
ba=MemBase;
Mapping_Counter++; PCI_WRITE_DWORD(FW_OP_BASE,ba,hc->PCI_Reg_Base); hc->OHC.Op_base=ba; hc->OHC.Op_Reg=(LLCRegStruct far *)RealToLinear(ba); hc->OHC.Op_Reg_Seg=FP_SEG(hc->OHC.Op_Reg); hc->OHC.Op_Reg_Off=FP_OFF(hc->OHC.Op_Reg); OHCI_SEG=hc->OHC.Op_Reg_Seg; OHCI_OFF=hc->OHC.Op_Reg_Off; PCI_BASE=hc->PCI_Reg_Base; //-------------------- //active the PCI interface //-------------------- //PCI.Command.MemoryEnable //PCI.Command.BusMasterEnable PCI_Command.Reg = pci_read_word(PCI_Command_Reg, PCI_BASE); PCI_Command.BitMap.MEMORY_ENB =1; PCI_Command.BitMap.MASTER_ENB =1; pci_write_word(PCI_Command_Reg, PCI_Command.Reg, PCI_BASE); //------------------ //OHCI initialize //------------------ //All OHCI initialize is performed by accessing registers in the OHCI registerspace //All OCHI registers must be accessed via a single 32-bit read or write //Verify Memory map is correct //Check if the BusID value equal 0x31333934 ULONG BusID= MEM_READ_DWORD(OHCI_SEG,OHCI_OFF+OHCI_BusID_Reg); if (BusID ==0x31333934L){ setbit(Mapping_Flag,i); break; } else{ if (Mapping_Counter ==0xF){ printf(\"Memory Mapping is Not Correct!!!\\n\"); return; } } } else{ if (i ==0xf){ printf(\"Memory Mapping is Not Correct!!!\\n\"); return; } } 自己看!!! |
|