...
And one question: In my driver (from scanwork) i return the number of hashes done (not nonces found), but in this case the hashrate does not show the correct results.
...
All drivers return the number of hashes done.
You must have messed something (else?) up somewhere.
Not true - BaB driver returns the nonces found:
hashcount += 0xffffffffull * babinfo->new_nonces;
My driver was returning the actual hashrate of the chip, which does not change with the luck and hardware errors, but with voltage fluctuations only.
I have switched to nonces found and provide the actual hashrate separately now. (EDIT: it doesn't fluctuate much anyway)
No driver directly displays the raw hashrate because virtually every piece of hardware has a wastage rate, be that lost work or hardware errors, and as a rule in our mainline drivers only the effective hashrate is shown based on share return since that is the one that most accurately represents the effective useful hashrate to the miner. Some drivers like to have their raw hashrate in the API as well but it's mostly used for debugging or finding when a large discrepancy occurs between that and the share based return hashrate. The most comprehensive hashrate breakdown exists in the cointerra driver, as per the example below:
From API devs (all drivers get this from cgminer but it's still a share based hashrate):
[MHS av] => 799191.36
[MHS 5s] => 835744.05
[MHS 1m] => 802133.15
[MHS 5m] => 814257.17
[MHS 15m] => 813622.90
From API stats (device specific implementation):
[Calc hashrate] => 809023317013
[Hashrate] => 809235851416
[Share hashrate] => 799187431945
[Total calc hashes] => 66713335626117819
[Total hashes] => 66730861547342974
[Total raw hashes] => 66856703711606415
[Total share hashes] => 65902253067730944
[Total flushed hashes] => 5497557985280
[Accepted hashes] => 66573727231544920
[Accepted hashrate] => 807330305483
[Rejected hashes] => 370758174404046
[Rejected hashrate] => 4496132673
[Core0 hashrate] => 98977953653
[Core1 hashrate] => 72667358378
[Core2 hashrate] => 101483724632
[Core3 hashrate] => 102736610121
[Core4 hashrate] => 101483724632
[Core5 hashrate] => 120277006971
[Core6 hashrate] => 85196213271
[Core7 hashrate] => 96472182675
[Asic0Core0] => 120:fffefffefffefffefffefffefffefffe
[Asic0Core1] => 120:fffefffefffefffefffefffefffefffe
[Asic0Core2] => 120:fffefffefffefffefffefffefffefffe
[Asic0Core3] => 120:fffefffefffefffefffefffefffefffe
[Asic1Core0] => 120:fffefffefffefffefffefffefffefffe
[Asic1Core1] => 120:fffefffefffefffefffefffefffefffe
[Asic1Core2] => 120:fffefffefffefffefffefffefffefffe
[Asic1Core3] => 120:fffefffefffefffefffefffefffefffe