N PHY Set Chanspec (u16 chanspec)
- Create a struct chan_info_nphy_rev3 pointer named chan_info_ptr and set to NULL
Set channel to chanspec & 0x00FF
If PHY Revision >= 3
- If PHY Revision is 3
Set chan_info_ptr to PHY Revision 3 Table
- Else if PHY Revision is 4
Set chan_info_ptr to PHY Revision 4 Table
- Otherwise
- If the Radio Revision is 5
Set chan_info_ptr to PHY Revision 5 Table
- Else if the Radio Revision is 6
Set chan_info_ptr to PHY Revision 6 Table
- Else if the Radio Revision is 7 or 9
Set chan_info_ptr to PHY Revision 7 Table
- Else if the Radio Revision is 8
Set chan_info_ptr to PHY Revision 8 Table
- If the Radio Revision is 5
- Find the entry in the table that matches channel, let i be that index
- Return if not found
- If PHY Revision is 3
- Otherwise
Save a pointer to the PHY Revision 2 Table
- Find the entry in the table that matches the channel, let i be that index
- Return if not found
Set radio_chanspec to chanspec
- Extract the band width from chanspec and save as bw
If bw not equal to bw
Call BMAC BW Set with bw as argument
- If chanspec indicates 40 MHz band width
- If an upper control sideband is indicated
- Set bit 0x0010 in PHY Register 0xA0
- Otherwise
- Clear bit 0x0010 in PHY Register 0xA0
- If an upper control sideband is indicated
If the PHY Revision >= 3
- If chanspec indicates a 5 GHz band
- Set tmp to 4
- Otherwise
- Set tmp to 0
- Maskset Radio Register 0x08 with mask 0xFFFB and set with tmp
Call PHY Radio2056 Setup with chan_info_ptr[i] as argument
Call N PHY Chanspec Setup with chan_info_ptr[i] data for PHY Register 0x1CE and chanspec as arguments
- If chanspec indicates a 5 GHz band
- Otherwise
- If chanspec indicates a 5 GHz band
- Set tmp to 0x20
- Otherwise
- Set tmp to 0x50
- Maskset Radio Register 0x11 with mask 0xFF8F and set with tmp
Call PHY Radio2055 Setup with the Rev 2 pointer[i] as argument
Call N PHY Chanspec Setup with the Rev 2 pointer[i] data for PHY Register 0x1CE and chanspec as arguments
- If chanspec indicates a 5 GHz band