bcm-v4

[Specification

N PHY ACI Control ( bool enable, int aci_pwr )

Note: The locations used to save/restore the variables must be preserved across calls.

  1. Initialize a u16 array gains to {0x8136, 0x8136, 0x8136, 0x8136}
  2. If enable
    1. If (aci_state & 2) not equal to 0

      1. Return
    2. If phyhang_avoid

      1. Call NPHY Enable Staying in Carrier Search

    3. Set bit 0x0002 in aci_state

    4. Copy pub->now to aci_start_time

    5. If PHY revision >= 3

      1. Save PHY Register 0x24C

      2. Write 0x0002 to PHY Register 0x24C

      3. Save PHY Registers 0x020 and 0x2A7

      4. Write 0x1D06 to PHY Register 0x72

      5. Loop 4 times with i as index
        1. Save PHY Register 0x73 in array1 indexed by i

      6. Write 0x826C to PHY Register 0x20

      7. Write 0x826C to PHY Register 0x2A7

      8. Call NPHY Table Write with ( 7, 4, 0x106, 16, gains ) as arguments

      9. Save PHY Registers 0x22 and 0x2A9

      10. Write 0x126C to PHY Register 0x22

      11. Write 0x126C to PHY Register 0x2A9

      12. Save PHY Registers 0x2B and 0x41

      13. Write 0x0069 to PHY Register 0x2B

      14. Write 0x0069 to PHY Register 0x41

      15. Write 0x1010 to PHY Register 0x72

      16. Loop 4 times with loop index i
        1. Save PHY Register 0x73 in array2 indexed by i

      17. Write 0x1050 to PHY Register 0x72

      18. Loop 4 times with loop index i
        1. Save PHY Register 0x73 in array3 indexed by i

      19. Write 0x1013 PHY Register 0x72

      20. Write 0x007F to PHY Register 0x73

      21. Write 0x1053 PHY Register 0x72

      22. Write 0x007F to PHY Register 0x73

      23. Save PHY Registers 0x37 and 0x2AD

      24. Write 0x026C to PHY Registers 0x37 and 0x2AD

      25. Save Radio Registers 0x6023 and 0x7023

      26. Write 0x0090 to Radio Registers 0x6023 and 0x7023

      27. Save PHY Registers 0x27 and 0x3D

      28. MaskSet PHY Register 0x27 with mask 0xFFC0 and set with 0x0015

      29. MaskSet PHY Register 0x3D with mask 0xFFC0 and set with 0x0015

    6. Otherwise
      1. Save Radio Registers 0x66 and 0x95

      2. OR Radio Register 0x66 with 0x02

      3. OR Radio Register 0x95 with 0x02

      4. Save nphy_gain_boost

      5. Set nphy_gain_boost to 0

      6. Call NPHY Adjust LNA Gain Table

      7. Save Radio Registers 0x71 and 0xA0

      8. Read Radio Register 0x2B, add 0x000C, and save as tmp

      9. If tmp > 0x1F

        1. Set tmp to 0x1F
      10. OR tmp with 0x20 and write the result to Radio Registers 0x71 and 0xA0

      11. Save PHY Registers 0x153 and 0xC33

      12. Set bit 0x0008 in PHY Register 0x153

      13. MaskSet PHY Register 0x153 with mask 0xFFF8 and set with 0x0004

      14. Write 0xC0 to PHY Register 0xC33

      15. Save PHY Registers 0x20 and 0x36

      16. Write 0x1D06 to PHY Register 0x72

      17. Loop 4 times with loop index i
        1. Save PHY Register 0x73 in array1[i]

      18. MaskSet PHY Register 0x20 with mask 0xF07F and set with 0x280

      19. MaskSet PHY Register 0x36 with mask 0xF07F and set with 0x280

      20. Write 0x1C00 to PHY Register 0x72

      21. Loop 4 times
        1. Write 0x057C to PHY Register 0x73

      22. Save PHY Registers 0x21 and 0x37

      23. Write 0x10BE to PHY Registers 0x21 and 0x37

      24. Save PHY Registers 0x22 and 0x38

      25. Write 0x101E to PHY Registers 0x22 and 0x38

      26. Save PHY Registers 0x23 and 0x39

      27. Write 0x203E to PHY Registers 0x23 and 0x39

      28. Save PHY Registers 0x2B and 0x41

      29. Write 0x0053 to PHY Registers 0x2B and 0x41

      30. Save PHY Registers 0x27 and 0x3D

      31. Write 0x0015 to PHY Registers 0x27 and 0x3D

      32. Save PHY Registers 0x1D and 0x33

      33. MaskSet PHY Register 0x1D with mask 0xFE1F and set with 0x0080

      34. MaskSet PHY Register 0x33 with mask 0xFE1F and set with 0x0080

      35. Save PHY Register 0x24C

      36. Write 0x0002 to PHY Register 0x24C

      37. Save PHY Register 0x1D7

      38. Write 0x2078 to PHY Register 0x1D7

    7. Call NPHY ACI Power Update with aci_pwr as argument

    8. If phyhang_avoid

      1. Call NPHY Disable Staying in Carrier Search

  3. Otherwise
    1. If (aci_state & 2) is 0

      1. Return
    2. If phyhang_avoid

      1. Call NPHY Enable Staying in Carrier Search

    3. Clear bit 0x2 in aci_state

    4. If PHY revision >= 3

      1. Restore PHY Registers 0x24C, 0x20, and 0x2A7

      2. Call NPHY Table Write with ( 7, 4, 0x106, 16, array1 ) as arguments

      3. Restore PHY Registers 0x22, 0x2A9, 0x2B, and 0x41

      4. Write 0x1010 to PHY Register 0x72

      5. Loop 4 times with loop index i
        1. Write array2[i] to PHY Register 0x73

      6. Write 0x1050 to PHY Register 0x72

      7. Loop 4 times with loop index i
        1. Write array3[i] to PHY Register 0x73

      8. Restore PHY Registers 0x37 and 0x2AD

      9. Restore Radio Registers 0x6023 and 0x7023

      10. Restore PHY Registers 0x27 and 0x3D

    5. Otherwise
      1. Restore nphy_gain_boost

      2. Call NPHY Adjust Gain Table

      3. Restore Radio Registers 0x66, 0x95, 0x71 and 0xA0

      4. Restore PHY Registers 0x153, 0xC33, 0x20, and 0x36

      5. Write 0x1D06 to PHY Register 0x72

      6. Loop 4 times with loop index i
        1. Write array1[i] to PHY Register 0x73

      7. Restore PHY Registers 0x21, 0x37, 0x22, 0x38, 0x23, 0x39, 0x2B, 0x41, 0x27, 0x3D, 0x1D, 0x33, 0x24C, and 0x1D7

    6. If phyhang_avoid

      1. Call NPHY Disable Staying in Carrier Search


Exported/Archived from the wiki to HTML on 2016-10-27