HalEfuseMask8821C_USB.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. /* #include "Mp_Precomp.h" */
  16. /* #include "../odm_precomp.h" */
  17. #include <drv_types.h>
  18. #include "HalEfuseMask8821C_USB.h"
  19. /******************************************************************************
  20. * MUSB.TXT
  21. ******************************************************************************/
  22. u1Byte Array_MP_8821C_MUSB[] = {
  23. 0xFF,
  24. 0xF3,
  25. 0xEF,
  26. 0x9E,
  27. 0x70,
  28. 0x00,
  29. 0x00,
  30. 0x00,
  31. 0x00,
  32. 0x00,
  33. 0x00,
  34. 0x03,
  35. 0xF7,
  36. 0x00,
  37. 0x00,
  38. 0x00,
  39. 0xFF,
  40. 0xFF,
  41. 0xFF,
  42. 0xFF,
  43. 0xC0,
  44. 0x00,
  45. 0x00,
  46. 0x00,
  47. 0x00,
  48. 0x00,
  49. 0x00,
  50. 0x00,
  51. 0x00,
  52. 0x00,
  53. 0x00,
  54. 0x00,
  55. };
  56. u2Byte
  57. EFUSE_GetArrayLen_MP_8821C_MUSB(VOID)
  58. {
  59. return sizeof(Array_MP_8821C_MUSB) / sizeof(u1Byte);
  60. }
  61. VOID
  62. EFUSE_GetMaskArray_MP_8821C_MUSB(
  63. IN OUT pu1Byte Array
  64. )
  65. {
  66. u2Byte len = EFUSE_GetArrayLen_MP_8821C_MUSB(), i = 0;
  67. for (i = 0; i < len; ++i)
  68. Array[i] = Array_MP_8821C_MUSB[i];
  69. }
  70. BOOLEAN
  71. EFUSE_IsAddressMasked_MP_8821C_MUSB(
  72. IN u2Byte Offset
  73. )
  74. {
  75. int r = Offset / 16;
  76. int c = (Offset % 16) / 2;
  77. int result = 0;
  78. if (c < 4) /* Upper double word */
  79. result = (Array_MP_8821C_MUSB[r] & (0x10 << c));
  80. else
  81. result = (Array_MP_8821C_MUSB[r] & (0x01 << (c - 4)));
  82. return (result > 0) ? 0 : 1;
  83. }