CN1684030A - Code flow broadcast card and driving method of code flow collection card - Google Patents

Code flow broadcast card and driving method of code flow collection card Download PDF

Info

Publication number
CN1684030A
CN1684030A CN 200510041802 CN200510041802A CN1684030A CN 1684030 A CN1684030 A CN 1684030A CN 200510041802 CN200510041802 CN 200510041802 CN 200510041802 A CN200510041802 A CN 200510041802A CN 1684030 A CN1684030 A CN 1684030A
Authority
CN
China
Prior art keywords
dma
code flow
transmission
driver
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200510041802
Other languages
Chinese (zh)
Other versions
CN1333333C (en
Inventor
李兵兵
李乐乐
杨秀莲
蔚述明
黄新平
王莎莎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CNB2005100418028A priority Critical patent/CN1333333C/en
Publication of CN1684030A publication Critical patent/CN1684030A/en
Application granted granted Critical
Publication of CN1333333C publication Critical patent/CN1333333C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The driving method for code flow broadcast card and code flow acquisition card includes transmitting code flow data between hardware and application program in DMA mode; judging the interruption type with the ISR of the drive program and processing various interruption types through calling DPC routine in the interruption delay process; and realizing the control of the application program on the hardware through the communication between the application program and the drive program. The present invention solves the problem in interfacing the code flow broadcast card and the code flow acquisition card with the application program to make the code flow broadcast card and the code flow acquisition card operate normally on computer PCI bus to complete code flow broadcast card and acquisition task and further analysis and monitoring. The drive program completes the code flow transmission correctly at code flow rate as high as 120 Mbps without data loss.

Description

The driving method of code flow broadcast card and code flow collection card
Technical field
The present invention relates to code stream transmission method in the digital TV field, specifically is the driving method of code flow broadcast card and code flow collection card.
Background technology
Security and the portability of Windows operating system in order to guarantee system limited application program direct control hardware device, and application program can only be read and write and opertaing device by driver.The hardware that many independent developments are arranged will make these hardware normally be operated under the Windows operating system of PC, is necessary for them and writes the Windows driver.
General Driver Development method is to use DDK Driver Development bag, in this way the construction cycle long, the program design complexity; Restricted the exploitation of driver to a certain extent.
Summary of the invention
The objective of the invention is to overcome the deficiencies in the prior art, a kind of hardware code flow broadcast card of application access independent development and the driving method of code flow collection card are provided, and its technical scheme is that direct memory access (DMA) DMA transmission mode is adopted in the transmission of bit stream data between hardware and application program; Interrupt Service Routine ISR by driver judges interrupt type, and respectively each interrupt type is handled by interruption delay process DPC routine; By communicating by letter of application program and driver, realize the control of application program to hardware.
Described bit stream data adopts direct memory access (DMA) DMA transfer process as follows:
[1] the transmission side memory formula of common buffer is selected in the example initialization of the KDmaTransfer class that software DriverStudio is provided for use, satisfy bit stream data at a high speed, the requirement of frequent transmission data;
[2] write the call back function OnDmaReady of KDmaTransfer class example, whether the transmission of call back function OnDmaReady judgment data is finished; If data transmission is finished, then finish corresponding I/O request package; If data transmission is not finished, then enter the StartDMA routine, start the DMA transmission;
[3] the DMA transmission is finished, the DMA interruptable controller produces and interrupts, the Interrupt Service Routine ISR of driver makes response, judge that interrupt type is that DMA interrupts, deferred procedure call DPC routine call Continue function then, return the call back function OnDmaReady of DMA, judge to transmit by call back function OnDmaReady and finish, finish this DMA transmission.
The judgement of described interrupt type and processing execution following steps:
[1] interrupt type is judged, the Interrupt Service Routine ISR of driver changes according to the bit of the DMA interrupt register of PCI9054 chip, judges that interrupt type is that interrupt interruption or this locality of hardware that the DMA transmission is finished;
[2] according to the interrupt type of being judged, interruption delay invocation of procedure DPC routine is carried out following processing respectively:
---interrupt this locality of hardware, and notification application call driver once more enters the DMA transfer process;
---the interruption that DMA transmission is finished, then call the Continue function and then get back to the call back function OnDmaReady of DMA, judge transmission by call back function OnDmaReady and finished and just finish this DMA transmission.
It is the series of identical I/O control routine of between agreement that described application program is communicated by letter with driver, and application program is issued driver with the order of I/O control routine, and driver is carried out corresponding operation according to corresponding I/O control routine to hardware.
Code flow broadcast card and code flow collection card are the hardware on the computer PCI bus of working in of independent development.In order to realize the operation of application program to code flow broadcast card and code flow collection card, the present invention is the hardware development driver.Driver is the interface of hardware and application program, and application program is finished access hardware and operation by driver.The invention solves the interface problem of code flow broadcast card and code flow collection card and application program, make code flow broadcast card and code flow collection card energy operate as normal on the pci bus of computing machine, finish code stream on computers and play and acquisition tasks.And then make the analysis and the monitoring that utilize computing machine to carry out code stream become possibility.At the function that code flow broadcast card and code flow collection card will be finished, driver has been finished code stream transmission at a high speed as requested, stream rate during up to 120Mbps data transmission correct, do not have the loss of data phenomenon.
Description of drawings
Fig. 1: the code flow broadcast card application program of the present invention schematic block diagram of communicating by letter with driver
Fig. 2: the code flow collection card application program of the present invention schematic block diagram of communicating by letter with driver
Fig. 3: the DMA data transmission of code flow broadcast card driver of the present invention and Interrupt Process process flow diagram
Fig. 4: the DMA data transmission of code flow collection card driver of the present invention and Interrupt Process process flow diagram
Embodiment
Elaborate concrete enforcement of the present invention below in conjunction with accompanying drawing.
Driver of the present invention comprises code flow broadcast card driver and code flow collection card driver, is the key interface of computer applied algorithm and hardware code flow broadcast card and code flow collection card.Two drivers adopt WDM (Windows DriverModel) driver model, by means of third party software bag DriverStudio, under Visual C++6.0 environment, develop, has the hardware initialization unit, application program and driver communication unit, data transmission unit and installation file.Above-mentioned each unit co-ordination drives the hardware playing back at high speed and gathers code stream.
Driver of the present invention cooperates with operating system finishes hardware initialization, makes hardware become the addressable equipment of operating system.The driver access hardware resource of code flow broadcast card and code flow collection card adopts I/O port mapping mode, at first produces class KIoRange object in equipment class, secondly this object of initialization in the device start routine.The member function inb of KIoRange class, inw, ind, outb, outw, outd access hardware devices just can be used in initialization success back.
Communicating by letter of application program of the present invention and driver mainly realizes the control of application program to hardware.Order of the every transmission of application program, driver all have corresponding function to be responsible for carrying out the operation that both appoint.Rely on I/O control routine transferring command between application program and the driver.Driver has defined a series of I/O control routines, and these definition are included in the header file of driver, and identical with application program.Application program uses the DeviceIoControl function that the I/O control routine is passed to driver, and driver is carried out corresponding operation according to the difference of control routine I/O.The form of I/O control routine is as follows:
#define name of code CTL_CODE (device type, control routine, the buffer zone transfer mechanism of control routine, requester accesses requires)
For example, the I/O control routine form of a CTRL_AD9851_INIT by name of definition should be in code flow broadcast card:
#define CTRL_AD9851_INIT CTL_CODE(FILE_DEVICE_UNKNOWN,0x807,
METHOD_IN_DIRECT,
FILE_ANY_ACCESS)
When driver is received this I/O control routine that application program sends, carry out the operation of making an appointment, the AD9851 chip of hardware is configured, make the clock signal that hardware can produce to be needed when code stream is play.
As depicted in figs. 1 and 2, the operation of the order of the application program of code flow broadcast card and code flow collection card and driver separately in correspondence with each other.
In the application program of code flow broadcast card shown in Figure 1 and the communication process of driver be:
[1] application program is passed to driving with the stream rate of analyzing, and sends the I/O control routine, and driver then writes the control word of stream rate correspondence the AD9851 chip on the hardware, produces the clock signal of clock as the code stream original rate by AD9851;
[2] application program wants transmitted stream speed to pass to driving the user, sends the I/O control routine, and driver then writes the programmable logic device (PLD) FPGA that plays card with the control word of stream rate correspondence;
[3] the output code flow port selected according to the user of application program sends the selection I/O control routine of corresponding port, and driver is then visited serial/parallel mouthful of corresponding selected cell of FPGA;
[4] application program is set up an incident, the notice driver, and driver and application program are shared incident;
[5] application command begins broadcast code flow, and driver then starts the hardware output code flow;
[6] application command stops to play, and driver then notifies hardware to stop output code flow.
In code flow collection card application program shown in Figure 2 and driver communication process be:
[1] the code stream input port selected according to the user of application program transmits the select command I/O of corresponding port, and driver is then visited serial/parallel mouthful of corresponding selected cell of programmable logic device (PLD) FPGA of code flow collection card;
[2] application program is set up an incident, the notice driver, and driver and application program are shared incident;
[3] application command begins to gather, and driver starts hardware and gathers code stream;
[4] application command stops to gather, and driver notice hardware stops output code flow.
For broadcast and the collection that realizes the two-forty code stream, driver of the present invention uses direct memory access (DMA) DMA mode of operation, finishes the transmission of bit stream data between hardware and application program.The Interrupt Service Routine ISR of driver judges interrupt type, and respectively each interrupt type is handled by interruption delay invocation of procedure DPC routine.The DriverStudio that develops software that the present invention uses provides the KDmaTransfer class to be used for DMA transmission control as dma operation.
One. the DMA data transmission of code flow broadcast card driver and the embodiment of Interrupt Process:
Referring to Fig. 3, the DMA data transmission step of code flow broadcast card is as follows:
[1] the example initialization of the KDmaTransfer class that the DriverStudio that develops software is provided.Driver is selected the transmission side memory formula of " common buffer " for use, satisfies each DMA transmission 256KBytes data and the frequent requirement of data transmission;
[2] write the call back function OnDmaReady of KDmaTransfer class example, by grand DMAREADY_CALLBACK definition, call back function at first will call the member function BytesRemaining of KDmaTransfer class, judges whether its rreturn value is 0, and whether the inspection data have been transmitted and finished;
[3] if transmission is finished, then call the member function Terminate of KDmaTransfer class and finish corresponding I/O request package IRP; If do not finish, then carry out data transmission, call back function notice hardware begins to transmit data and enters the StartDMA routine and start the DMA transmission, does not need to wait for that data transmission finishes, and represents with the broken dash line among Fig. 3.
[4] when transmitting, finishes DMA, the DMA interruptable controller produces and interrupts, the Interrupt Service Routine ISR of driver will make response, judge that interrupt type is that DMA interrupts, in deferred procedure call DPC routine, call the Continue function then and then get back to the call back function OnDmaReady of DMA, judge to transmit and finish, finish the I/O request package, realize giving storer FIFO to send out the data of half capacity.
Data among the storer FIFO are constantly to port output, and when data are less than when half-full, hardware produces look-at-me, and this be local interruption, and data transmission enters Interrupt Process, shown in grey shading flow process among Fig. 3.Change according to the bit of the DMA interrupt register of PCI9054 chip by Interrupt Service Routine ISR earlier, judge that interrupt type is that interrupt interruption or this locality of hardware that the DMA transmission is finished;
If the call back function OnDmaReady that the Continue function is got back to DMA is then called in the interruption that the DMA transmission is finished, judge to transmit to have finished and finished this DMA and transmit.
If interrupt this locality of hardware, interruption delay invocation of procedure DPC routine notification application sends data, and call driver enters the DMA transfer process of above-mentioned data once more; The transmission course circulation is carried out, till stopping broadcast.
Two, the DMA data transmission of code flow collection card driver and Interrupt Process embodiment:
Referring to Fig. 4, code flow collection card constantly receives code stream from port, and the data volume among the storer FIFO increases, and produces local the interruption when storer FIFO reaches half-full, enters the Interrupt Process process, shown in grey shading flow process among Fig. 4.Change according to the bit of the DMA interrupt register of PCI9054 chip by Interrupt Service Routine ISR earlier, judge that interrupt type is that interrupt interruption or this locality of hardware that the DMA transmission is finished;
If the call back function OnDmaReady that the Continue function is got back to DMA is then called in the interruption that the DMA transmission is finished, judge to transmit to have finished and finished this DMA and transmit.
If interrupt this locality of hardware, interruption delay invocation of procedure DPC routine notification application receives data, and call driver enters the DMA transfer process of data once more.
The DMA transmitting step is as follows:
[1] the example initialization of the KDmaTransfer class that the DriverStudio that develops software is provided.Driver is selected the transmission side memory formula of " common buffer " for use, satisfies each DMA transmission 256KBytes data and the frequent requirement of data transmission;
[2] write the call back function OnDmaReady of KDmaTransfer class example, by grand DMAREADY_CALLBACK definition, call back function at first will call the member function BytesRemaining of KDmaTransfer class, judges whether its rreturn value is 0, and whether the inspection data have been transmitted and finished;
[3] if transmission is finished, then call the member function Terminate of KDmaTransfer class and finish corresponding I/O request package IRP; If do not finish, then carry out data transmission, call back function notice hardware begins to transmit data and enters the StartDMA routine and start the DMA transmission, does not need to wait for that data transmission finishes, and represents with the broken dash line among Fig. 4.
[4] when transmitting, finishes DMA, the DMA interruptable controller produces and interrupts, the Interrupt Service Routine ISR of driver will make response, judge that interrupt type is that DMA interrupts, in deferred procedure call DPC routine, call the Continue function then and then get back to the call back function OnDmaReady of DMA, judge to transmit and finish, finish the I/O request package, finish this DMA transmission.
Above-mentioned DMA transfer process is passed to application program with the bit stream data among the storer FIFO, finishes the transmission of code flow collection card data.Data among the storer FIFO be read out be less than half-full; Because hardware constantly receives code stream from port, the data among the storer FIFO reach half-full again through accumulation, produce local the interruption again, above-mentioned data transmission procedure circulation are carried out, till receiving the order that application program stops to gather.
Code flow broadcast card and code flow collection card are the equipment of independent development, couple together in order to make operating system and driver of the present invention, need to revise the driver installation file.Microsoft has defined a series of Globally Unique Identifier GUID and device class name, the class that the equipment of selection independent development will add is revised as corresponding apparatus class name and the Globally Unique Identifier GUID that Microsoft defines with " Class " in the driver installation file and " ClassGUID "; Revise the icon that equipment shows in the equipment manager; Revise manufacturing ID, device identifier, provider and manufacturer's information in the drive installation file.
Also to revise in addition in the Manufacturer and Models Sections joint in the drive installation file PCI VEN_aaaa﹠amp; DEV_bbbb﹠amp; SUBSYS_cccccccc﹠amp; REV_dd, wherein aaaa is a manufacturing ID, bbbb is a device identifier, cccccccc is the subsystem id of device report, dd is a revisions number, generally only uses manufacturing ID and device identifier, these contents in the installation file will with hardware EEPROM in consistent.Code flow broadcast card drive installation file modification be PCI VEN_10B5﹠amp; DEV_7820﹠amp; SUBSYS_00000000﹠amp; REV_00; Code flow collection card drive installation file modification be PCI VEN_10B5﹠amp; DEV_6820﹠amp; SUBSYS_00000000﹠amp; REV_00.Application program is connected with driver and supports the driver operate as normal.

Claims (2)

1. the driving method of code flow broadcast card and code flow collection card is characterized in that adopting direct memory access (DMA) DMA transmission mode to realize the transmission of bit stream data between hardware and application program; Interrupt Service Routine ISR by driver judges interrupt type, and respectively each interrupt type is handled by interruption delay invocation of procedure DPC routine; By communicating by letter of application program and driver, realize the control of application program to hardware;
The detailed process of described employing direct memory access (DMA) DMA transmission code stream data is as follows:
[1] the transmission side memory formula of common buffer is selected in the example initialization of the KDmaTransfer class that software DriverStudio is provided for use, satisfy bit stream data at a high speed, the requirement of frequent transmission data;
[2] write the call back function OnDmaReady of KDmaTransfer class example, whether the transmission of call back function OnDmaReady judgment data is finished; If data transmission is finished, then finish corresponding I/O request package; If data transmission is not finished, then enter the StartDMA routine, start the DMA transmission;
[3] the DMA transmission is finished, the DMA interruptable controller produces and interrupts, the Interrupt Service Routine ISR of driver makes response, judge that interrupt type is that DMA interrupts, deferred procedure call DPC routine call Continue function then, return the call back function OnDmaReady of DMA, judge to transmit by call back function OnDmaReady and finish, finish this DMA transmission;
The judgement of described interrupt type and the concrete steps of processing are as follows:
[1] interrupt type is judged, the Interrupt Service Routine ISR of driver changes according to the bit of the DMA interrupt register of PCI9054 chip, judges that interrupt type is that interrupt interruption or this locality of hardware that the DMA transmission is finished;
[2] according to the interrupt type of being judged, interruption delay invocation of procedure DPC routine is carried out following processing respectively:
---interrupt this locality of hardware, and notification application call driver once more enters the DMA transfer process;
---the interruption that DMA transmission is finished, then call the Continue function and then get back to the call back function OnDmaReady of DMA, judge transmission by call back function OnDmaReady and finished and just finish this DMA transmission.
2. the driving method of code flow broadcast card according to claim 1 and code flow collection card, it is characterized in that it is the series of identical I/O control routine of between agreement that described application program is communicated by letter with driver, application program is issued driver with the order of I/O control routine, and driver is carried out corresponding operation according to the I/O control routine to hardware.
CNB2005100418028A 2005-03-16 2005-03-16 Code flow broadcast card and driving method of code flow collection card Expired - Fee Related CN1333333C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100418028A CN1333333C (en) 2005-03-16 2005-03-16 Code flow broadcast card and driving method of code flow collection card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100418028A CN1333333C (en) 2005-03-16 2005-03-16 Code flow broadcast card and driving method of code flow collection card

Publications (2)

Publication Number Publication Date
CN1684030A true CN1684030A (en) 2005-10-19
CN1333333C CN1333333C (en) 2007-08-22

Family

ID=35263391

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100418028A Expired - Fee Related CN1333333C (en) 2005-03-16 2005-03-16 Code flow broadcast card and driving method of code flow collection card

Country Status (1)

Country Link
CN (1) CN1333333C (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634975A (en) * 2009-08-20 2010-01-27 广东威创视讯科技股份有限公司 Method for realizing DMA data transmission and apparatus thereof
CN101052031B (en) * 2007-05-23 2011-08-10 中兴通讯股份有限公司 Data interaction method for Apple computer and radio communication terminal
CN102662894A (en) * 2012-03-23 2012-09-12 中国航天科技集团公司第九研究院第七七一研究所 General bus slave unit interface
CN101521726B (en) * 2008-12-19 2013-07-10 康佳集团股份有限公司 Network TV set and method for capturing datagram thereof
CN104813629A (en) * 2012-10-01 2015-07-29 瑞典爱立信有限公司 Apparatus and method relating to streaming of content to one or more user devices
CN106227591A (en) * 2016-08-05 2016-12-14 中国科学院计算技术研究所 The method and apparatus carrying out radio communication scheduling in heterogeneous polynuclear SOC(system on a chip)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052031B (en) * 2007-05-23 2011-08-10 中兴通讯股份有限公司 Data interaction method for Apple computer and radio communication terminal
CN101521726B (en) * 2008-12-19 2013-07-10 康佳集团股份有限公司 Network TV set and method for capturing datagram thereof
CN101634975A (en) * 2009-08-20 2010-01-27 广东威创视讯科技股份有限公司 Method for realizing DMA data transmission and apparatus thereof
CN102662894A (en) * 2012-03-23 2012-09-12 中国航天科技集团公司第九研究院第七七一研究所 General bus slave unit interface
CN102662894B (en) * 2012-03-23 2015-04-22 中国航天科技集团公司第九研究院第七七一研究所 General bus slave unit interface
CN104813629A (en) * 2012-10-01 2015-07-29 瑞典爱立信有限公司 Apparatus and method relating to streaming of content to one or more user devices
CN106227591A (en) * 2016-08-05 2016-12-14 中国科学院计算技术研究所 The method and apparatus carrying out radio communication scheduling in heterogeneous polynuclear SOC(system on a chip)

Also Published As

Publication number Publication date
CN1333333C (en) 2007-08-22

Similar Documents

Publication Publication Date Title
KR101517258B1 (en) Apparatus, system, and method for cross-system proxy-based task offloading
CN100338591C (en) Interface integrated circuit device for a USB connection
US10846254B2 (en) Management controller including virtual USB host controller
EP1753190A1 (en) Method and system for USB re-direct over a network
CN1595381A (en) High speed and flexible control for bridge controllers
CN1151449C (en) System and method allowing server remote access to assets information in computer system
CN1684030A (en) Code flow broadcast card and driving method of code flow collection card
CN1749967A (en) Data processing system having a channel adapter shared by multiple operating systems
CN101078985A (en) Method and system for identifying an operating system running on a computer system
US20110208891A1 (en) Method and apparatus for tracking transactions in a multi-speed bus environment
CN101034384A (en) DMA controller and transmit method capable of simultaneously carrying out read-write operation
CN1821986A (en) Control apparatus, information processing apparatus, and data transferring method
CN1650276A (en) ATA/SATA combined controller
CN101051269A (en) Intelligent platform management interface firmware architecture and method of building the same
CN100343840C (en) Bus system, station for use in a bus system, and bus interface
CN1229736C (en) Device for monitoring computer system resource and communicatin method of serial bus and said resource
US20080066088A1 (en) Method for improving the communication of the human interface device
CN1848101A (en) Computer system for quickly transmitting data inter-different storing devices
CN1969268A (en) Interrupt scheme for bus controller
CN1482522A (en) Computer system with separated peripheral equipment and input-output method thereof
US8214569B2 (en) Method for reading and writing non-standard register of serial advanced technology attachment (SATA) device
CN1707403A (en) Input and output interface controller
CN1180354C (en) USB control circuit capable of switching path automatically
CN1269017C (en) USB storage drive development method in embedding system
CN1282087C (en) Method for accessing remote data and computer using the method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070822

Termination date: 20140316