mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
qcacmn: Initial version of regulatory component changes
Define the regulatory component public APIs, private APIs and initialization of the regulatory object Change-Id: I536078592aa7e66e96d4dcab8efdedfd6fd03711 CRs-Fixed: 2002892
This commit is contained in:
parent
fdc7ddc89c
commit
e2cc7069f5
12 changed files with 889 additions and 0 deletions
24
umac/regulatory/core/inc/reg_db.h
Normal file
24
umac/regulatory/core/inc/reg_db.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_db.h
|
||||
* This file contains regulatory component data structures
|
||||
*/
|
||||
|
||||
40
umac/regulatory/core/inc/reg_main.h
Normal file
40
umac/regulatory/core/inc/reg_main.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_main.h
|
||||
* This file provides prototypes of the regulatory component
|
||||
* functions
|
||||
*/
|
||||
|
||||
#include "qdf_status.h"
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "wlan_objmgr_global_obj.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
|
||||
|
||||
/**
|
||||
* reg_init() - Regulatory component initialization
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_init(struct wlan_objmgr_psoc *psoc);
|
||||
37
umac/regulatory/core/inc/reg_services.h
Normal file
37
umac/regulatory/core/inc/reg_services.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_services.h
|
||||
* This file provides prototypes of the regulatory component
|
||||
* service functions
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "wlan_reg_services_api.h"
|
||||
|
||||
QDF_STATUS reg_get_channel_list_with_power(struct regulatory_channel *ch_list);
|
||||
void reg_read_default_country(uint8_t *country);
|
||||
enum channel_state reg_get_channel_state(uint8_t ch);
|
||||
enum channel_state reg_get_5g_bonded_channel_state(uint8_t ch, uint8_t bw);
|
||||
enum channel_state reg_get_2g_bonded_channel_state(uint8_t ch, uint8_t bw);
|
||||
void reg_set_channel_params(uint8_t ch, struct ch_params *ch_params);
|
||||
void reg_get_dfs_region(enum dfs_region *dfs_reg);
|
||||
bool reg_is_dfs_ch(uint8_t ch);
|
||||
23
umac/regulatory/core/src/reg_db.c
Normal file
23
umac/regulatory/core/src/reg_db.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_db.c
|
||||
* This file provides regulatory data base
|
||||
*/
|
||||
47
umac/regulatory/core/src/reg_main.c
Normal file
47
umac/regulatory/core/src/reg_main.c
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_main.c
|
||||
* This file provides the regulatory component initialization and
|
||||
* registration functions
|
||||
*/
|
||||
#include "reg_main.h"
|
||||
|
||||
/**
|
||||
* reg_init() - Regulatory component initialization
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_init(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
/*
|
||||
* Regulatory component initialization
|
||||
*/
|
||||
struct wlan_objmgr_psoc_regulatory *psoc_reg = NULL;
|
||||
|
||||
psoc_reg = &psoc->soc_reg;
|
||||
|
||||
psoc_reg->country_code = 0;
|
||||
psoc_reg->reg_dmn = 0;
|
||||
psoc_reg->reg_flags = 0;
|
||||
return 0;
|
||||
|
||||
}
|
||||
148
umac/regulatory/core/src/reg_services.c
Normal file
148
umac/regulatory/core/src/reg_services.c
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was originally distributed by Qualcomm Atheros, Inc.
|
||||
* under proprietary terms before Copyright ownership was assigned
|
||||
* to the Linux Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: reg_services.c
|
||||
* This file defines regulatory component service functions
|
||||
*/
|
||||
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "reg_services.h"
|
||||
/**
|
||||
* reg_get_channel_list_with_power() - Provides the channel list with power
|
||||
* @ch_list: pointer to the channel list.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_get_channel_list_with_power(struct regulatory_channel *ch_list)
|
||||
{
|
||||
/*
|
||||
* Update the channel list with channel information with power.
|
||||
*/
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_read_default_country() - Read the default country for the regdomain
|
||||
* @country: pointer to the country code.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
void reg_read_default_country(uint8_t *country)
|
||||
{
|
||||
/*
|
||||
* Get the default country information
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_get_channel_state() - Get channel state from regulatory
|
||||
* @ch: channel number.
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state reg_get_channel_state(uint8_t ch)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return CHANNEL_STATE_ENABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_get_5g_bonded_channel_state() - Get channel state for 5G bonded channel
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state reg_get_5g_bonded_channel_state(uint8_t ch, uint8_t bw)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return CHANNEL_STATE_ENABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_get_2g_bonded_channel_state() - Get channel state for 2G bonded channel
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state reg_get_2g_bonded_channel_state(uint8_t ch, uint8_t bw)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return CHANNEL_STATE_ENABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_set_channel_params () - Sets channel parameteres for given bandwidth
|
||||
* @ch: channel number.
|
||||
* @ch_params: pointer to the channel parameters.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void reg_set_channel_params(uint8_t ch, struct ch_params *ch_params)
|
||||
{
|
||||
/*
|
||||
* Set channel parameters like center frequency for a bonded channel
|
||||
* state. Also return the maximum bandwidth supported by the channel.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_get_dfs_region () - Get the current dfs region
|
||||
* @dfs_reg: pointer to dfs region
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void reg_get_dfs_region(enum dfs_region *dfs_reg)
|
||||
{
|
||||
/*
|
||||
* Get the current dfs region
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* reg_is_dfs_ch () - Checks the channel state for DFS
|
||||
* @ch: channel
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool reg_is_dfs_ch(uint8_t ch)
|
||||
{
|
||||
/*
|
||||
* Get the current dfs region
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
170
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h
Normal file
170
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: wlan_reg_services_api.h
|
||||
* This file provides prototypes of the routines needed for the
|
||||
* external components to utilize the services provided by the
|
||||
* regulatory component.
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "wlan_objmgr_global_obj.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
|
||||
enum channel_state {
|
||||
CHANNEL_STATE_DISABLE,
|
||||
CHANNEL_STATE_PASSIVE,
|
||||
CHANNEL_STATE_DFS,
|
||||
CHANNEL_STATE_ENABLE,
|
||||
CHANNEL_STATE_INVALID,
|
||||
};
|
||||
|
||||
enum phy_ch_width {
|
||||
CH_WIDTH_20MHZ = 0,
|
||||
CH_WIDTH_40MHZ,
|
||||
CH_WIDTH_80MHZ,
|
||||
CH_WIDTH_160MHZ,
|
||||
CH_WIDTH_80P80MHZ,
|
||||
CH_WIDTH_5MHZ,
|
||||
CH_WIDTH_10MHZ,
|
||||
CH_WIDTH_INVALID,
|
||||
CH_WIDTH_MAX
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ch_params
|
||||
* @ch_width: channel width
|
||||
* @sec_ch_offset: secondary channel offset
|
||||
* @center_freq_seg0: center freq for segment 0
|
||||
* @center_freq_seg1: center freq for segment 1
|
||||
*/
|
||||
struct ch_params {
|
||||
enum phy_ch_width ch_width;
|
||||
uint8_t sec_ch_offset;
|
||||
uint8_t center_freq_seg0;
|
||||
uint8_t center_freq_seg1;
|
||||
};
|
||||
|
||||
struct regulatory_channel {
|
||||
enum channel_state state;
|
||||
uint32_t chan_flags;
|
||||
uint32_t tx_power;
|
||||
};
|
||||
|
||||
struct channel_power {
|
||||
uint32_t chan_num;
|
||||
uint32_t tx_power;
|
||||
};
|
||||
|
||||
struct chan_map {
|
||||
uint32_t center_freq;
|
||||
uint32_t chan_num;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dfs_region - DFS region
|
||||
* @DFS_UNINIT_REGION: un-initialized region
|
||||
* @DFS_FCC_REGION: FCC region
|
||||
* @DFS_ETSI_REGION: ETSI region
|
||||
* @DFS_MKK_REGION: MKK region
|
||||
* @DFS_CN_REGION: China region
|
||||
* @DFS_KR_REGION: Korea region
|
||||
* @DFS_UNDEF_REGION: Undefined region
|
||||
*/
|
||||
enum dfs_region {
|
||||
DFS_UNINIT_REGION = 0,
|
||||
DFS_FCC_REGION = 1,
|
||||
DFS_ETSI_REGION = 2,
|
||||
DFS_MKK_REGION = 3,
|
||||
DFS_CN_REGION = 4,
|
||||
DFS_KR_REGION = 5,
|
||||
DFS_UNDEF_REGION
|
||||
};
|
||||
|
||||
/**
|
||||
* wlan_reg_get_channel_list_with_power() - Provide the channel list with power
|
||||
* @ch_list: pointer to the channel list.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_reg_get_channel_list_with_power(
|
||||
struct regulatory_channel *ch_list);
|
||||
|
||||
/**
|
||||
* wlan_reg_read_default_country() - Read the default country for the regdomain
|
||||
* @country: pointer to the country code.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_read_default_country(uint8_t *country);
|
||||
|
||||
/**
|
||||
* wlan_reg_get_channel_state() - Get channel state from regulatory
|
||||
* @ch: channel number.
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_channel_state(uint8_t ch);
|
||||
|
||||
/**
|
||||
* wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_5g_bonded_channel_state(uint8_t ch,
|
||||
uint8_t bw);
|
||||
|
||||
/**
|
||||
* wlan_reg_get_2g_bonded_channel_state() - Get 2G bonded channel state
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_2g_bonded_channel_state(uint8_t ch,
|
||||
uint8_t bw);
|
||||
|
||||
/**
|
||||
* wlan_reg_set_channel_params () - Sets channel parameteres for given bandwidth
|
||||
* @ch: channel number.
|
||||
* @ch_params: pointer to the channel parameters.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_set_channel_params(uint8_t ch, struct ch_params *ch_params);
|
||||
|
||||
/**
|
||||
* wlan_reg_get_dfs_region () - Get the current dfs region
|
||||
* @dfs_reg: pointer to dfs region
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_get_dfs_region(enum dfs_region *dfs_reg);
|
||||
|
||||
/**
|
||||
* wlan_reg_is_dfs_ch () - Checks the channel state for DFS
|
||||
* @ch: channel
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool wlan_reg_is_dfs_ch(uint8_t ch);
|
||||
33
umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h
Normal file
33
umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: wlan_reg_tgt_api.h
|
||||
* This file provides prototypes of the regulatory component target
|
||||
* interface routines
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
|
||||
QDF_STATUS tgt_reg_country_code_update_handler(void *handle, uint8_t *event,
|
||||
uint32_t len);
|
||||
QDF_STATUS tgt_reg_ch_list_update_handler(void *handle, uint8_t *event,
|
||||
uint32_t len);
|
||||
72
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h
Normal file
72
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <qdf_types.h>
|
||||
#include <qdf_trace.h>
|
||||
|
||||
/**
|
||||
* DOC: wlan_reg_ucfg_api.h
|
||||
* This file provides prototypes of the regulatory component user
|
||||
* config interface routines
|
||||
*/
|
||||
|
||||
enum band_info {
|
||||
band_2g = 0x1,
|
||||
band_49g = 0x2,
|
||||
band_5g_36_48 = 0x4,
|
||||
band_5g_52_64 = 0x8,
|
||||
band_5g_100_144 = 0x10,
|
||||
band_5g_149_165 = 0x20
|
||||
};
|
||||
|
||||
struct reg_ini_vars {
|
||||
uint32_t enable_11d_support;
|
||||
uint32_t userspace_ctry_priority;
|
||||
enum band_info band_capability;
|
||||
uint32_t dfs_enable;
|
||||
uint32_t indoor_channel_support;
|
||||
};
|
||||
|
||||
struct set_band_req {
|
||||
enum band_info band;
|
||||
uint32_t pdev_id;
|
||||
};
|
||||
|
||||
struct country_info {
|
||||
uint8_t country_code[3];
|
||||
};
|
||||
|
||||
struct reg_country_update {
|
||||
uint8_t country_code[3];
|
||||
};
|
||||
|
||||
typedef QDF_STATUS (*reg_event_cb)(void *status_struct);
|
||||
|
||||
QDF_STATUS ucfg_reg_set_band(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct set_band_req *req);
|
||||
QDF_STATUS ucfg_reg_reset_country(uint8_t vdev_id, uint8_t pdev_id);
|
||||
QDF_STATUS ucfg_reg_set_default_country(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct country_info *cc_info);
|
||||
QDF_STATUS ucfg_reg_update_country(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct reg_country_update *country_update);
|
||||
QDF_STATUS ucfg_reg_register_event_handler(uint8_t vdev_id, reg_event_cb cb,
|
||||
void *arg);
|
||||
QDF_STATUS ucfg_reg_unregister_event_handler(uint8_t vdev_id, reg_event_cb cb,
|
||||
void *arg);
|
||||
QDF_STATUS ucfg_reg_init_handler(uint8_t pdev_id);
|
||||
146
umac/regulatory/dispatcher/src/wlan_reg_services_api.c
Normal file
146
umac/regulatory/dispatcher/src/wlan_reg_services_api.c
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file wlan_reg_services_api.c
|
||||
* @brief contains regulatory service functions
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "reg_services.h"
|
||||
|
||||
/**
|
||||
* wlan_reg_get_channel_list_with_power() - Provide the channel list with power
|
||||
* @ch_list: pointer to the channel list.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_reg_get_channel_list_with_power(
|
||||
struct regulatory_channel *ch_list)
|
||||
{
|
||||
/*
|
||||
* Update the channel list with channel information with power.
|
||||
*/
|
||||
return reg_get_channel_list_with_power(ch_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_read_default_country() - Read the default country for the regdomain
|
||||
* @country: pointer to the country code.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_read_default_country(uint8_t *country)
|
||||
{
|
||||
/*
|
||||
* Get the default country information
|
||||
*/
|
||||
reg_read_default_country(country);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_get_channel_state() - Get channel state from regulatory
|
||||
* @ch: channel number.
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_channel_state(uint8_t ch)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return reg_get_channel_state(ch);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_5g_bonded_channel_state(uint8_t ch,
|
||||
uint8_t bw)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return reg_get_5g_bonded_channel_state(ch, bw);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_get_2g_bonded_channel_state() - Get 2G bonded channel state
|
||||
* @ch: channel number.
|
||||
* @bw: channel band width
|
||||
*
|
||||
* Return: channel state
|
||||
*/
|
||||
enum channel_state wlan_reg_get_2g_bonded_channel_state(uint8_t ch,
|
||||
uint8_t bw)
|
||||
{
|
||||
/*
|
||||
* Get channel state from regulatory
|
||||
*/
|
||||
return reg_get_2g_bonded_channel_state(ch, bw);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_set_channel_params() - Sets channel parameteres for given bandwidth
|
||||
* @ch: channel number.
|
||||
* @ch_params: pointer to the channel parameters.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_set_channel_params(uint8_t ch, struct ch_params *ch_params)
|
||||
{
|
||||
/*
|
||||
* Set channel parameters like center frequency for a bonded channel
|
||||
* state. Also return the maximum bandwidth supported by the channel.
|
||||
*/
|
||||
reg_set_channel_params(ch, ch_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_get_dfs_region () - Get the current dfs region
|
||||
* @dfs_reg: pointer to dfs region
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void wlan_reg_get_dfs_region(enum dfs_region *dfs_reg)
|
||||
{
|
||||
/*
|
||||
* Get the current dfs region
|
||||
*/
|
||||
reg_get_dfs_region(dfs_reg);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_reg_is_dfs_ch () - Checks the channel state for DFS
|
||||
* @ch: channel
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool wlan_reg_is_dfs_ch(uint8_t ch)
|
||||
{
|
||||
/*
|
||||
* Get the current dfs region
|
||||
*/
|
||||
return reg_is_dfs_ch(ch);
|
||||
}
|
||||
60
umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c
Normal file
60
umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file wlan_req_tgt_api.c
|
||||
* @brief contains regulatory target interface definations
|
||||
*/
|
||||
|
||||
#include "wlan_reg_tgt_api.h"
|
||||
/**
|
||||
* tgt_reg_country_code_update_handler() - tgt country code update handler
|
||||
* @handle: pointer to the tgt handle
|
||||
* @event: pointer to the event msg
|
||||
* @len: event msg length
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_reg_country_code_update_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
/*
|
||||
* Convert the tlv/non tlv data to struct coutry_code_update
|
||||
* and Post msg to target_if queue
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* tgt_reg_country_code_update_handler() - tgt country code update handler
|
||||
* @handle: pointer to the tgt handle
|
||||
* @event: pointer to the event msg
|
||||
* @len: event msg length
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_reg_ch_list_update_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
/*
|
||||
* Convert the tlv/non tlv data to struct ch_list_update
|
||||
* and Post msg to target_if queue
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
89
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c
Normal file
89
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file wlan_req_ucfg_api.c
|
||||
* @brief contains regulatory user config interface definations
|
||||
*/
|
||||
|
||||
#include "wlan_reg_ucfg_api.h"
|
||||
|
||||
/**
|
||||
* ucfg_reg_set_band () - set band req handler
|
||||
* @vdev_id: vdev id
|
||||
* @pdev_id: pdev id
|
||||
* @req: pointer to request message
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_set_band(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct set_band_req *req)
|
||||
{
|
||||
/* Handle the set band request */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_reg_set_band () - set band req handler
|
||||
* @vdev_id: vdev id
|
||||
* @pdev_id: pdev id
|
||||
* @req: pointer to request message
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_reset_country(uint8_t vdev_id, uint8_t pdev_id)
|
||||
{
|
||||
/* Resets the pdev country info with default country info */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_reg_set_default_country(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct country_info *cc_info)
|
||||
{
|
||||
/* sets the default country info */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
QDF_STATUS ucfg_reg_update_country(uint8_t vdev_id, uint8_t pdev_id,
|
||||
struct reg_country_update *country_update)
|
||||
{
|
||||
/* Post a msg to target_if queue to update the country information */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_reg_register_event_handler(uint8_t vdev_id, reg_event_cb cb,
|
||||
void *arg)
|
||||
{
|
||||
/* Register a event cb handler */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_reg_unregister_event_handler(uint8_t vdev_id, reg_event_cb cb,
|
||||
void *arg)
|
||||
{
|
||||
/* unregister a event cb handler */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_reg_init_handler(uint8_t pdev_id)
|
||||
{
|
||||
/* regulatory initialization handler */
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
Loading…
Reference in a new issue