1 // SPDX-License-Identifier: GPL-2.0 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 * 6 ******************************************************************************/ 7 8 #include <drv_types.h> 9 #include <linux/kernel.h> 10 11 static const u32 ch_freq_map[] = { 12 2412, 13 2417, 14 2422, 15 2427, 16 2432, 17 2437, 18 2442, 19 2447, 20 2452, 21 2457, 22 2462, 23 2467, 24 2472, 25 2484 26 }; 27 28 u32 rtw_ch2freq(u32 channel) 29 { 30 if (channel == 0 || channel > ARRAY_SIZE(ch_freq_map)) 31 return 2412; 32 33 return ch_freq_map[channel - 1]; 34 } 35