AnsweredAssumed Answered

Accessing Link Port through device driver. Problem with OpenDevice() API

Question asked by raj26 on Dec 29, 2011
Latest reply on Jan 6, 2012 by CraigG

Hi all,

I'm working on TigerSharc TS-201 processor.

I need to simulate the reading and writing of Data through Link Port using the 'Streams' setting.


For starter I'm building upon the VDK based Producer Consumer examples provided.

The example already contains the LinkPort Device Driver and has 4 BootIO objects: Link0, Link1, Link2, Link3.


So, I added a stream on LBUFTX0 and associated a destination File with it.


Next, I used the OpenDevice API in one of the threads as follows:


char mode = 'W';

VDK::Device Descriptor devd = OpenDevice(kLink0, mode);

SyncWrite(devd,mem_block, mem_size,0);


On simulation, nothing was output to the file

By stepped simulation and stepping inside the OpenDevice function it was found that: there is a while loop which checks for all flags (by incrementing the flag ptr coupled with a switch case statement) passed to the Open function (inside the Dispatch function). The flag 'W' is correctly interpreted as WRITE_MODE.

BUT THEN THE LOOP runs again, increments the pointer, finds an unknown option and returns with -1 from the function, without executing the statements written after the while-switch-case block (where ctrl registers are set).


I couldn't find any info regarding the way flags are correctly passed to the OpenDevice function.

Please help regarding Opening a device in the Read or Write mode (as desired).