qcacmn: Set country code for full-offload using iwpriv command
For full-offload, send user country code to FW using WMI command. Change-Id: I84acbd7ce30aa9a8ce590c8fadea2cb5914240fe CRs-Fixed: 2053849
此提交包含在:
@@ -100,8 +100,7 @@ QDF_STATUS reg_get_rdpair_from_country_iso(uint8_t *alpha,
|
||||
|
||||
for (i = 0; i < num_countries; i++) {
|
||||
if ((g_all_countries[i].alpha2_11d[0] == alpha[0]) &&
|
||||
(g_all_countries[i].alpha2_11d[1] == alpha[1]) &&
|
||||
(g_all_countries[i].alpha2_11d[2] == alpha[2]))
|
||||
(g_all_countries[i].alpha2_11d[1] == alpha[1]))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -2867,6 +2867,9 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
||||
uint16_t country_index = -1, regdmn_pair = -1;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_lmac_if_reg_tx_ops *tx_ops;
|
||||
struct wlan_regulatory_psoc_priv_obj *soc_reg;
|
||||
uint8_t pdev_id;
|
||||
QDF_STATUS err;
|
||||
|
||||
pdev_priv_obj = (struct wlan_regulatory_pdev_priv_obj *)
|
||||
@@ -2878,6 +2881,32 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
if (!psoc) {
|
||||
reg_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
soc_reg = reg_get_psoc_obj(psoc);
|
||||
if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
|
||||
reg_err("psoc reg component is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (soc_reg->offload_enabled) {
|
||||
if ((rd->flags == ALPHA_IS_SET) && (rd->cc.alpha[2] == 'O'))
|
||||
pdev_priv_obj->indoor_chan_enabled = false;
|
||||
else
|
||||
pdev_priv_obj->indoor_chan_enabled = true;
|
||||
|
||||
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
||||
tx_ops = reg_get_psoc_tx_ops(psoc);
|
||||
if (tx_ops->set_user_country_code)
|
||||
return tx_ops->set_user_country_code(psoc, pdev_id, rd);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
reg_info = (struct cur_regulatory_info *)qdf_mem_malloc
|
||||
(sizeof(struct cur_regulatory_info));
|
||||
if (reg_info == NULL) {
|
||||
@@ -2885,12 +2914,6 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_pdev *pdev,
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
if (!psoc) {
|
||||
reg_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
reg_info->psoc = psoc;
|
||||
reg_info->phy_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
||||
|
||||
|
@@ -70,29 +70,6 @@
|
||||
/* EEPROM setting is a country code */
|
||||
#define COUNTRY_ERD_FLAG 0x8000
|
||||
|
||||
/**
|
||||
* enum cc_regdmn_flag: Regdomain flags
|
||||
* @INVALID: Invalid flag
|
||||
* @CC_IS_SET: Country code is set
|
||||
* @REGDMN_IS_SET: Regdomain ID is set
|
||||
* @ALPHA_IS_SET: Country ISO is set
|
||||
*/
|
||||
enum cc_regdmn_flag {
|
||||
INVALID,
|
||||
CC_IS_SET,
|
||||
REGDMN_IS_SET,
|
||||
ALPHA_IS_SET,
|
||||
};
|
||||
|
||||
struct cc_regdmn_s {
|
||||
union {
|
||||
uint16_t country_code;
|
||||
uint16_t regdmn_id;
|
||||
uint8_t alpha[REG_ALPHA2_LEN + 1];
|
||||
} cc;
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
extern const struct chan_map channel_map[NUM_CHANNELS];
|
||||
|
||||
enum channel_enum reg_get_chan_enum(uint32_t chan_num);
|
||||
|
@@ -574,4 +574,34 @@ struct mas_chan_params {
|
||||
uint16_t ctry_code;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum cc_regdmn_flag: Regdomain flags
|
||||
* @INVALID: Invalid flag
|
||||
* @CC_IS_SET: Country code is set
|
||||
* @REGDMN_IS_SET: Regdomain ID is set
|
||||
* @ALPHA_IS_SET: Country ISO is set
|
||||
*/
|
||||
enum cc_regdmn_flag {
|
||||
INVALID_CC,
|
||||
CC_IS_SET,
|
||||
REGDMN_IS_SET,
|
||||
ALPHA_IS_SET,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cc_regdmn_s: User country code or regdomain
|
||||
* @country_code: Country code
|
||||
* @regdmn_id: Regdomain pair ID
|
||||
* @alpha: Country ISO
|
||||
* @flags: Regdomain flags
|
||||
*/
|
||||
struct cc_regdmn_s {
|
||||
union {
|
||||
uint16_t country_code;
|
||||
uint16_t regdmn_id;
|
||||
uint8_t alpha[REG_ALPHA2_LEN + 1];
|
||||
} cc;
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -119,6 +119,13 @@ QDF_STATUS ucfg_reg_init_handler(uint8_t pdev_id);
|
||||
QDF_STATUS ucfg_reg_program_default_cc(struct wlan_objmgr_pdev *pdev,
|
||||
uint16_t regdmn);
|
||||
|
||||
/**
|
||||
* ucfg_reg_program_cc() - Program user country code or regdomain
|
||||
* @pdev: The physical dev to program country code or regdomain
|
||||
* @rd: User country code or regdomain
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_program_cc(struct wlan_objmgr_pdev *pdev,
|
||||
struct cc_regdmn_s *rd);
|
||||
|
||||
|
新增問題並參考
封鎖使用者