AnsweredAssumed Answered

FSS FAT Volume Usage Stats

Question asked by dmann on May 23, 2011
Latest reply on Jun 3, 2011 by dmann

Hello,

 

I read the note about the Addtion of FAT volume usage statistics in VDSP Update 9. For some reason, the call to adi_fss_GetVolumeUsage() does not return any information. As stated in the release notes, I added the modifications to the configuration table:

 

ADI_FSS_VOLUME_INFO               Volume;

ADI_FSS_VOLUME_USAGE_DEF   VolumeUsage;


ADI_DEV_CMD_VALUE_PAIR ADI_FAT_ConfigTable[] = {
{ ADI_FAT_CMD_ENABLE_USAGE_STATS, NULL },
{ ADI_DEV_CMD_END, (void*)NULL }
};

 

Then I initialize the FSS:

ADI_FSS_CMD_VALUE_PAIR adi_fss_Config[] = {
        { ADI_FSS_CMD_SET_NUMBER_CACHE_BLOCKS,  (void*)2 },
        { ADI_FSS_CMD_SET_GENERAL_HEAP_ID,      (void*)GeneralHeapID },
        { ADI_FSS_CMD_ADD_DRIVER,               (void*)&ADI_USB_Def },
        { ADI_FSS_CMD_ADD_DRIVER,               (void*)&ADI_FAT_Def },
        { ADI_FSS_CMD_SET_MEDIA_CHANGE_CALLBACK,(void*)USBMediaDetectCallback},
        { ADI_FSS_CMD_SET_DMA_MGR_HANDLE,       (void*)DMAManagerHandle },
        { ADI_FSS_CMD_SET_DEV_MGR_HANDLE,       (void*)DeviceManagerHandle },
        { ADI_FSS_CMD_SET_DCB_MGR_HANDLE,       (void*)CallbackHandle },
        { ADI_FSS_CMD_END,                         (void*)NULL }
    };

ADI_FAT_Def.pConfigTable = ADI_FAT_ConfigTable;

 

if(volumeMounted && !fssLoaded)
        {
            while (adi_fss_Control( ADI_FSS_CMD_GET_VOLUME_INFO, (void*)&Volume) == ADI_FSS_RESULT_SUCCESS )
            {
                Volume.Index++;
            }
            fssLoaded = true;           
        }
       
        if(fssLoaded)
           {
              adi_fss_GetVolumeUsage(Volume.Ident, &VolumeUsage);
           }   

 

I noticed that this call is more or less a wrapper for

 

Result = adi_dev_Control( pMount->FSD_DeviceHandle, ADI_FSD_CMD_GET_VOLUME_USAGE, (void*)poVolumeUsage );

 

which returns 0x40000001. Is there anything else that needs to be done to make this call return volume usage stats? I'm wondering if the handle being passed needs to be registered first or something.

 

 

The project is attached below. It was built for a BF527 Ezkit using USB Flash Drive for File System Hosting.

Attachments

Outcomes