PLCSession.c 837 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * PLCSession.c -
  11. *
  12. * Contributor(s):
  13. * Charles Maier <cmaier@qca.qualcomm.com>
  14. *
  15. *--------------------------------------------------------------------*/
  16. #ifndef QCARAND_SOURCE
  17. #define QCARAND_SOURCE
  18. #include <stdint.h>
  19. #include "../tools/number.h"
  20. uint64_t QCASeed = 0;
  21. uint64_t QCASRand (uint32_t seed)
  22. {
  23. uint64_t temp = QCASeed;
  24. QCASeed = (uint64_t) (seed);
  25. return (temp);
  26. }
  27. uint32_t QCARand ()
  28. {
  29. QCASeed *= 0x41C64E6D;
  30. QCASeed += 0x00003029;
  31. return ((uint32_t) ((QCASeed >> 0x10) & 0x7FFFFFFF));
  32. }
  33. #endif