root/drivers/staging/rtl8723bs/core/rtw_rf.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. rtw_ch2freq

   1 // SPDX-License-Identifier: GPL-2.0
   2 /******************************************************************************
   3  *
   4  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
   5  *
   6  ******************************************************************************/
   7 #define _RTW_RF_C_
   8 
   9 #include <drv_types.h>
  10 #include <linux/kernel.h>
  11 
  12 
  13 struct ch_freq {
  14         u32 channel;
  15         u32 frequency;
  16 };
  17 
  18 static struct ch_freq ch_freq_map[] = {
  19         {1, 2412}, {2, 2417}, {3, 2422}, {4, 2427}, {5, 2432},
  20         {6, 2437}, {7, 2442}, {8, 2447}, {9, 2452}, {10, 2457},
  21         {11, 2462}, {12, 2467}, {13, 2472}, {14, 2484},
  22         /*  UNII */
  23         {36, 5180}, {40, 5200}, {44, 5220}, {48, 5240}, {52, 5260},
  24         {56, 5280}, {60, 5300}, {64, 5320}, {149, 5745}, {153, 5765},
  25         {157, 5785}, {161, 5805}, {165, 5825}, {167, 5835}, {169, 5845},
  26         {171, 5855}, {173, 5865},
  27         /* HiperLAN2 */
  28         {100, 5500}, {104, 5520}, {108, 5540}, {112, 5560}, {116, 5580},
  29         {120, 5600}, {124, 5620}, {128, 5640}, {132, 5660}, {136, 5680},
  30         {140, 5700},
  31         /* Japan MMAC */
  32         {34, 5170}, {38, 5190}, {42, 5210}, {46, 5230},
  33         /*  Japan */
  34         {184, 4920}, {188, 4940}, {192, 4960}, {196, 4980},
  35         {208, 5040},/* Japan, means J08 */
  36         {212, 5060},/* Japan, means J12 */
  37         {216, 5080},/* Japan, means J16 */
  38 };
  39 
  40 u32 rtw_ch2freq(u32 channel)
  41 {
  42         u8 i;
  43         u32 freq = 0;
  44 
  45         for (i = 0; i < ARRAY_SIZE(ch_freq_map); i++) {
  46                 if (channel == ch_freq_map[i].channel) {
  47                         freq = ch_freq_map[i].frequency;
  48                                 break;
  49                 }
  50         }
  51         if (i == ARRAY_SIZE(ch_freq_map))
  52                 freq = 2412;
  53 
  54         return freq;
  55 }

/* [<][>][^][v][top][bottom][index][help] */