diff mbox series

[v4,3/7] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params()

Message ID 20200909153628.2904888-4-bryan.odonoghue@linaro.org
State Superseded
Headers show
Series wcn36xx: Tidy up BSS/STA config | expand

Commit Message

Bryan O'Donoghue Sept. 9, 2020, 3:36 p.m. UTC
This commit moves BSS parameter setup to a separate function
wcn36xx_smd_set_bss_params(). This will allow for further functional
decomposition and fewer kzalloc() operations in subsequent patches.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

---
 drivers/net/wireless/ath/wcn36xx/smd.c | 172 +++++++++++++------------
 1 file changed, 92 insertions(+), 80 deletions(-)

-- 
2.27.0


_______________________________________________
wcn36xx mailing list
wcn36xx@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wcn36xx

Comments

kernel test robot Sept. 9, 2020, 7:16 p.m. UTC | #1
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 160b351d75cb50a0dd2abf9b63e1891935aa9e4a]

url:    https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/wcn36xx-Tidy-up-BSS-STA-config/20200910-011120
base:    160b351d75cb50a0dd2abf9b63e1891935aa9e4a
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ath/wcn36xx/smd.c:150:1: warning: no previous prototype for 'wcn36xx_smd_set_bss_vht_params' [-Wmissing-prototypes]
     150 | wcn36xx_smd_set_bss_vht_params(struct ieee80211_vif *vif,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c:186:6: warning: no previous prototype for 'wcn36xx_smd_set_sta_vht_params' [-Wmissing-prototypes]
     186 | void wcn36xx_smd_set_sta_vht_params(struct wcn36xx *wcn,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c:208:6: warning: no previous prototype for 'wcn36xx_smd_set_sta_ht_ldpc_params' [-Wmissing-prototypes]
     208 | void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c:233:6: warning: no previous prototype for 'wcn36xx_smd_set_sta_default_vht_params' [-Wmissing-prototypes]
     233 | void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c:249:6: warning: no previous prototype for 'wcn36xx_smd_set_sta_default_ht_ldpc_params' [-Wmissing-prototypes]
     249 | void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c:1253:1: warning: no previous prototype for 'wcn36xx_smd_set_sta_params_v1' [-Wmissing-prototypes]
    1253 | wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/ath/wcn36xx/smd.c:1387:6: warning: no previous prototype for 'wcn36xx_smd_set_bss_params' [-Wmissing-prototypes]

    1387 | void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/ath/wcn36xx/smd.c: In function 'wcn36xx_smd_set_bss_params':
>> drivers/net/wireless/ath/wcn36xx/smd.c:1395:40: warning: variable 'sta_params' set but not used [-Wunused-but-set-variable]

    1395 |  struct wcn36xx_hal_config_sta_params *sta_params;
         |                                        ^~~~~~~~~~

# https://github.com/0day-ci/linux/commit/1c12f515815cc2fa84d00b7c6aa77bf5dc5f1d20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bryan-O-Donoghue/wcn36xx-Tidy-up-BSS-STA-config/20200910-011120
git checkout 1c12f515815cc2fa84d00b7c6aa77bf5dc5f1d20
vim +/wcn36xx_smd_set_bss_params +1387 drivers/net/wireless/ath/wcn36xx/smd.c

  1386	
> 1387	void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,

  1388					struct ieee80211_vif *vif,
  1389					struct ieee80211_sta *sta,
  1390					const u8 *bssid,
  1391					bool update,
  1392					struct wcn36xx_hal_config_bss_params *bss)
  1393	{
  1394		struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
> 1395		struct wcn36xx_hal_config_sta_params *sta_params;

  1396	
  1397		sta_params = &bss->sta;
  1398	
  1399		WARN_ON(is_zero_ether_addr(bssid));
  1400	
  1401		memcpy(&bss->bssid, bssid, ETH_ALEN);
  1402	
  1403		memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
  1404	
  1405		if (vif->type == NL80211_IFTYPE_STATION) {
  1406			bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
  1407	
  1408			/* STA */
  1409			bss->oper_mode = 1;
  1410			bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
  1411		} else if (vif->type == NL80211_IFTYPE_AP ||
  1412			   vif->type == NL80211_IFTYPE_MESH_POINT) {
  1413			bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
  1414	
  1415			/* AP */
  1416			bss->oper_mode = 0;
  1417			bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
  1418		} else if (vif->type == NL80211_IFTYPE_ADHOC) {
  1419			bss->bss_type = WCN36XX_HAL_IBSS_MODE;
  1420	
  1421			/* STA */
  1422			bss->oper_mode = 1;
  1423		} else {
  1424			wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
  1425		}
  1426	
  1427		if (vif->type == NL80211_IFTYPE_STATION)
  1428			wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
  1429		else
  1430			bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
  1431	
  1432		bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
  1433		bss->lla_coexist = 0;
  1434		bss->llb_coexist = 0;
  1435		bss->llg_coexist = 0;
  1436		bss->rifs_mode = 0;
  1437		bss->beacon_interval = vif->bss_conf.beacon_int;
  1438		bss->dtim_period = vif_priv->dtim_period;
  1439	
  1440		wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
  1441	
  1442		bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
  1443	
  1444		if (conf_is_ht40_minus(&wcn->hw->conf))
  1445			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
  1446		else if (conf_is_ht40_plus(&wcn->hw->conf))
  1447			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
  1448		else
  1449			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
  1450	
  1451		bss->reserved = 0;
  1452	
  1453		/* wcn->ssid is only valid in AP and IBSS mode */
  1454		bss->ssid.length = vif_priv->ssid.length;
  1455		memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
  1456	
  1457		bss->obss_prot_enabled = 0;
  1458		bss->rmf = 0;
  1459		bss->max_probe_resp_retry_limit = 0;
  1460		bss->hidden_ssid = vif->bss_conf.hidden_ssid;
  1461		bss->proxy_probe_resp = 0;
  1462		bss->edca_params_valid = 0;
  1463	
  1464		/* FIXME: set acbe, acbk, acvi and acvo */
  1465	
  1466		bss->ext_set_sta_key_param_valid = 0;
  1467	
  1468		/* FIXME: set ext_set_sta_key_param */
  1469	
  1470		bss->spectrum_mgt_enable = 0;
  1471		bss->tx_mgmt_power = 0;
  1472		bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
  1473		bss->action = update;
  1474	
  1475		vif_priv->bss_type = bss->bss_type;
  1476	}
  1477	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
wcn36xx mailing list
wcn36xx@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wcn36xx
kernel test robot Sept. 10, 2020, 7:11 a.m. UTC | #2
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 160b351d75cb50a0dd2abf9b63e1891935aa9e4a]

url:    https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/wcn36xx-Tidy-up-BSS-STA-config/20200910-011120
base:    160b351d75cb50a0dd2abf9b63e1891935aa9e4a
config: powerpc-randconfig-r011-20200909 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0a5dc7effb191eff740e0e7ae7bd8e1f6bdb3ad9)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ath/wcn36xx/smd.c:150:1: warning: no previous prototype for function 'wcn36xx_smd_set_bss_vht_params' [-Wmissing-prototypes]
   wcn36xx_smd_set_bss_vht_params(struct ieee80211_vif *vif,
   ^
   drivers/net/wireless/ath/wcn36xx/smd.c:149:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
   drivers/net/wireless/ath/wcn36xx/smd.c:186:6: warning: no previous prototype for function 'wcn36xx_smd_set_sta_vht_params' [-Wmissing-prototypes]
   void wcn36xx_smd_set_sta_vht_params(struct wcn36xx *wcn,
        ^
   drivers/net/wireless/ath/wcn36xx/smd.c:186:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void wcn36xx_smd_set_sta_vht_params(struct wcn36xx *wcn,
   ^
   static 
   drivers/net/wireless/ath/wcn36xx/smd.c:208:6: warning: no previous prototype for function 'wcn36xx_smd_set_sta_ht_ldpc_params' [-Wmissing-prototypes]
   void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta,
        ^
   drivers/net/wireless/ath/wcn36xx/smd.c:208:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta,
   ^
   static 
   drivers/net/wireless/ath/wcn36xx/smd.c:233:6: warning: no previous prototype for function 'wcn36xx_smd_set_sta_default_vht_params' [-Wmissing-prototypes]
   void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn,
        ^
   drivers/net/wireless/ath/wcn36xx/smd.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn,
   ^
   static 
   drivers/net/wireless/ath/wcn36xx/smd.c:249:6: warning: no previous prototype for function 'wcn36xx_smd_set_sta_default_ht_ldpc_params' [-Wmissing-prototypes]
   void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn,
        ^
   drivers/net/wireless/ath/wcn36xx/smd.c:249:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn,
   ^
   static 
   drivers/net/wireless/ath/wcn36xx/smd.c:1253:1: warning: no previous prototype for function 'wcn36xx_smd_set_sta_params_v1' [-Wmissing-prototypes]
   wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,
   ^
   drivers/net/wireless/ath/wcn36xx/smd.c:1252:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void
   ^
   static 
>> drivers/net/wireless/ath/wcn36xx/smd.c:1387:6: warning: no previous prototype for function 'wcn36xx_smd_set_bss_params' [-Wmissing-prototypes]

   void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
        ^
   drivers/net/wireless/ath/wcn36xx/smd.c:1387:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
   ^
   static 
   7 warnings generated.

# https://github.com/0day-ci/linux/commit/1c12f515815cc2fa84d00b7c6aa77bf5dc5f1d20
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bryan-O-Donoghue/wcn36xx-Tidy-up-BSS-STA-config/20200910-011120
git checkout 1c12f515815cc2fa84d00b7c6aa77bf5dc5f1d20
vim +/wcn36xx_smd_set_bss_params +1387 drivers/net/wireless/ath/wcn36xx/smd.c

  1251	
  1252	void
> 1253	wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,

  1254				      struct ieee80211_vif *vif,
  1255				      struct ieee80211_sta *sta,
  1256				      struct wcn36xx_hal_config_sta_params_v1 *sta_par)
  1257	{
  1258		struct wcn36xx_sta *sta_priv = NULL;
  1259		struct wcn36xx_hal_config_sta_params sta_par_v0;
  1260	
  1261		wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0);
  1262		wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par);
  1263	
  1264		if (sta) {
  1265			sta_priv = wcn36xx_sta_to_priv(sta);
  1266			wcn36xx_smd_set_sta_vht_params(wcn, sta, sta_par);
  1267			wcn36xx_smd_set_sta_ht_ldpc_params(sta, sta_par);
  1268			memcpy(&sta_par->supported_rates, &sta_priv->supported_rates,
  1269			       sizeof(sta_par->supported_rates));
  1270		} else {
  1271			wcn36xx_set_default_rates_v1(&sta_par->supported_rates);
  1272			wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par);
  1273			wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par);
  1274		}
  1275	}
  1276	
  1277	static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
  1278					      struct ieee80211_sta *sta,
  1279					      void *buf,
  1280					      size_t len)
  1281	{
  1282		struct wcn36xx_hal_config_sta_rsp_msg *rsp;
  1283		struct config_sta_rsp_params *params;
  1284		struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
  1285	
  1286		if (len < sizeof(*rsp))
  1287			return -EINVAL;
  1288	
  1289		rsp = (struct wcn36xx_hal_config_sta_rsp_msg *)buf;
  1290		params = &rsp->params;
  1291	
  1292		if (params->status != WCN36XX_FW_MSG_RESULT_SUCCESS) {
  1293			wcn36xx_warn("hal config sta response failure: %d\n",
  1294				     params->status);
  1295			return -EIO;
  1296		}
  1297	
  1298		sta_priv->sta_index = params->sta_index;
  1299		sta_priv->dpu_desc_index = params->dpu_index;
  1300		sta_priv->ucast_dpu_sign = params->uc_ucast_sig;
  1301	
  1302		wcn36xx_dbg(WCN36XX_DBG_HAL,
  1303			    "hal config sta rsp status %d sta_index %d bssid_index %d uc_ucast_sig %d p2p %d\n",
  1304			    params->status, params->sta_index, params->bssid_index,
  1305			    params->uc_ucast_sig, params->p2p);
  1306	
  1307		return 0;
  1308	}
  1309	
  1310	static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
  1311					     struct ieee80211_vif *vif,
  1312					     struct ieee80211_sta *sta)
  1313	{
  1314		struct wcn36xx_hal_config_sta_req_msg_v1 msg_body;
  1315		struct wcn36xx_hal_config_sta_params_v1 *sta_params;
  1316	
  1317		INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
  1318		msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
  1319	
  1320		sta_params = &msg_body.sta_params;
  1321	
  1322		wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params);
  1323	
  1324		PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
  1325	
  1326		wcn36xx_dbg(WCN36XX_DBG_HAL,
  1327			    "hal config sta v1 action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n",
  1328			    sta_params->action, sta_params->sta_index, sta_params->bssid_index,
  1329			    sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid);
  1330	
  1331		return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
  1332	}
  1333	
  1334	static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn,
  1335					     struct ieee80211_vif *vif,
  1336					     struct ieee80211_sta *sta)
  1337	{
  1338		struct wcn36xx_hal_config_sta_req_msg msg;
  1339		struct wcn36xx_hal_config_sta_params *sta_params;
  1340	
  1341		INIT_HAL_MSG(msg, WCN36XX_HAL_CONFIG_STA_REQ);
  1342	
  1343		sta_params = &msg.sta_params;
  1344	
  1345		wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
  1346	
  1347		PREPARE_HAL_BUF(wcn->hal_buf, msg);
  1348	
  1349		wcn36xx_dbg(WCN36XX_DBG_HAL,
  1350			    "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n",
  1351			    sta_params->action, sta_params->sta_index,
  1352			    sta_params->bssid_index, sta_params->bssid,
  1353			    sta_params->type, sta_params->mac, sta_params->aid);
  1354	
  1355		return wcn36xx_smd_send_and_wait(wcn, msg.header.len);
  1356	}
  1357	
  1358	int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
  1359				   struct ieee80211_sta *sta)
  1360	{
  1361		int ret;
  1362	
  1363		mutex_lock(&wcn->hal_mutex);
  1364	
  1365		if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24))
  1366			ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta);
  1367		else
  1368			ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta);
  1369	
  1370		if (ret) {
  1371			wcn36xx_err("Sending hal_config_sta failed\n");
  1372			goto out;
  1373		}
  1374		ret = wcn36xx_smd_config_sta_rsp(wcn,
  1375						 sta,
  1376						 wcn->hal_buf,
  1377						 wcn->hal_rsp_len);
  1378		if (ret) {
  1379			wcn36xx_err("hal_config_sta response failed err=%d\n", ret);
  1380			goto out;
  1381		}
  1382	out:
  1383		mutex_unlock(&wcn->hal_mutex);
  1384		return ret;
  1385	}
  1386	
> 1387	void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,

  1388					struct ieee80211_vif *vif,
  1389					struct ieee80211_sta *sta,
  1390					const u8 *bssid,
  1391					bool update,
  1392					struct wcn36xx_hal_config_bss_params *bss)
  1393	{
  1394		struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
  1395		struct wcn36xx_hal_config_sta_params *sta_params;
  1396	
  1397		sta_params = &bss->sta;
  1398	
  1399		WARN_ON(is_zero_ether_addr(bssid));
  1400	
  1401		memcpy(&bss->bssid, bssid, ETH_ALEN);
  1402	
  1403		memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
  1404	
  1405		if (vif->type == NL80211_IFTYPE_STATION) {
  1406			bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
  1407	
  1408			/* STA */
  1409			bss->oper_mode = 1;
  1410			bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
  1411		} else if (vif->type == NL80211_IFTYPE_AP ||
  1412			   vif->type == NL80211_IFTYPE_MESH_POINT) {
  1413			bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
  1414	
  1415			/* AP */
  1416			bss->oper_mode = 0;
  1417			bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
  1418		} else if (vif->type == NL80211_IFTYPE_ADHOC) {
  1419			bss->bss_type = WCN36XX_HAL_IBSS_MODE;
  1420	
  1421			/* STA */
  1422			bss->oper_mode = 1;
  1423		} else {
  1424			wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
  1425		}
  1426	
  1427		if (vif->type == NL80211_IFTYPE_STATION)
  1428			wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
  1429		else
  1430			bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
  1431	
  1432		bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
  1433		bss->lla_coexist = 0;
  1434		bss->llb_coexist = 0;
  1435		bss->llg_coexist = 0;
  1436		bss->rifs_mode = 0;
  1437		bss->beacon_interval = vif->bss_conf.beacon_int;
  1438		bss->dtim_period = vif_priv->dtim_period;
  1439	
  1440		wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
  1441	
  1442		bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
  1443	
  1444		if (conf_is_ht40_minus(&wcn->hw->conf))
  1445			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
  1446		else if (conf_is_ht40_plus(&wcn->hw->conf))
  1447			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
  1448		else
  1449			bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
  1450	
  1451		bss->reserved = 0;
  1452	
  1453		/* wcn->ssid is only valid in AP and IBSS mode */
  1454		bss->ssid.length = vif_priv->ssid.length;
  1455		memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
  1456	
  1457		bss->obss_prot_enabled = 0;
  1458		bss->rmf = 0;
  1459		bss->max_probe_resp_retry_limit = 0;
  1460		bss->hidden_ssid = vif->bss_conf.hidden_ssid;
  1461		bss->proxy_probe_resp = 0;
  1462		bss->edca_params_valid = 0;
  1463	
  1464		/* FIXME: set acbe, acbk, acvi and acvo */
  1465	
  1466		bss->ext_set_sta_key_param_valid = 0;
  1467	
  1468		/* FIXME: set ext_set_sta_key_param */
  1469	
  1470		bss->spectrum_mgt_enable = 0;
  1471		bss->tx_mgmt_power = 0;
  1472		bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
  1473		bss->action = update;
  1474	
  1475		vif_priv->bss_type = bss->bss_type;
  1476	}
  1477	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
wcn36xx mailing list
wcn36xx@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wcn36xx
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 28a571918b19..3e8b929f45fc 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1384,6 +1384,97 @@  int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	return ret;
 }
 
+void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
+				struct ieee80211_vif *vif,
+				struct ieee80211_sta *sta,
+				const u8 *bssid,
+				bool update,
+				struct wcn36xx_hal_config_bss_params *bss)
+{
+	struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
+	struct wcn36xx_hal_config_sta_params *sta_params;
+
+	sta_params = &bss->sta;
+
+	WARN_ON(is_zero_ether_addr(bssid));
+
+	memcpy(&bss->bssid, bssid, ETH_ALEN);
+
+	memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
+
+	if (vif->type == NL80211_IFTYPE_STATION) {
+		bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
+
+		/* STA */
+		bss->oper_mode = 1;
+		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
+	} else if (vif->type == NL80211_IFTYPE_AP ||
+		   vif->type == NL80211_IFTYPE_MESH_POINT) {
+		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
+
+		/* AP */
+		bss->oper_mode = 0;
+		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
+	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
+		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
+
+		/* STA */
+		bss->oper_mode = 1;
+	} else {
+		wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
+	}
+
+	if (vif->type == NL80211_IFTYPE_STATION)
+		wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
+	else
+		bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
+
+	bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
+	bss->lla_coexist = 0;
+	bss->llb_coexist = 0;
+	bss->llg_coexist = 0;
+	bss->rifs_mode = 0;
+	bss->beacon_interval = vif->bss_conf.beacon_int;
+	bss->dtim_period = vif_priv->dtim_period;
+
+	wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
+
+	bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
+
+	if (conf_is_ht40_minus(&wcn->hw->conf))
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+	else if (conf_is_ht40_plus(&wcn->hw->conf))
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+	else
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
+
+	bss->reserved = 0;
+
+	/* wcn->ssid is only valid in AP and IBSS mode */
+	bss->ssid.length = vif_priv->ssid.length;
+	memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
+
+	bss->obss_prot_enabled = 0;
+	bss->rmf = 0;
+	bss->max_probe_resp_retry_limit = 0;
+	bss->hidden_ssid = vif->bss_conf.hidden_ssid;
+	bss->proxy_probe_resp = 0;
+	bss->edca_params_valid = 0;
+
+	/* FIXME: set acbe, acbk, acvi and acvo */
+
+	bss->ext_set_sta_key_param_valid = 0;
+
+	/* FIXME: set ext_set_sta_key_param */
+
+	bss->spectrum_mgt_enable = 0;
+	bss->tx_mgmt_power = 0;
+	bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
+	bss->action = update;
+
+	vif_priv->bss_type = bss->bss_type;
+}
+
 static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 			const struct wcn36xx_hal_config_bss_req_msg *orig)
 {
@@ -1487,7 +1578,6 @@  static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	return ret;
 }
 
-
 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
 				      struct ieee80211_vif *vif,
 				      struct ieee80211_sta *sta,
@@ -1539,7 +1629,6 @@  int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	struct wcn36xx_hal_config_bss_req_msg *msg;
 	struct wcn36xx_hal_config_bss_params *bss;
 	struct wcn36xx_hal_config_sta_params *sta_params;
-	struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 	int ret;
 
 	mutex_lock(&wcn->hal_mutex);
@@ -1553,84 +1642,7 @@  int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	bss = &msg->bss_params;
 	sta_params = &bss->sta;
 
-	WARN_ON(is_zero_ether_addr(bssid));
-
-	memcpy(&bss->bssid, bssid, ETH_ALEN);
-
-	memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
-
-	if (vif->type == NL80211_IFTYPE_STATION) {
-		bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
-
-		/* STA */
-		bss->oper_mode = 1;
-		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
-	} else if (vif->type == NL80211_IFTYPE_AP ||
-		   vif->type == NL80211_IFTYPE_MESH_POINT) {
-		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
-
-		/* AP */
-		bss->oper_mode = 0;
-		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
-	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
-		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
-
-		/* STA */
-		bss->oper_mode = 1;
-	} else {
-		wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
-	}
-
-	if (vif->type == NL80211_IFTYPE_STATION)
-		wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
-	else
-		bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
-
-	bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
-	bss->lla_coexist = 0;
-	bss->llb_coexist = 0;
-	bss->llg_coexist = 0;
-	bss->rifs_mode = 0;
-	bss->beacon_interval = vif->bss_conf.beacon_int;
-	bss->dtim_period = vif_priv->dtim_period;
-
-	wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
-
-	bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
-
-	if (conf_is_ht40_minus(&wcn->hw->conf))
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
-	else if (conf_is_ht40_plus(&wcn->hw->conf))
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
-	else
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
-
-	bss->reserved = 0;
-
-	/* wcn->ssid is only valid in AP and IBSS mode */
-	bss->ssid.length = vif_priv->ssid.length;
-	memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
-
-	bss->obss_prot_enabled = 0;
-	bss->rmf = 0;
-	bss->max_probe_resp_retry_limit = 0;
-	bss->hidden_ssid = vif->bss_conf.hidden_ssid;
-	bss->proxy_probe_resp = 0;
-	bss->edca_params_valid = 0;
-
-	/* FIXME: set acbe, acbk, acvi and acvo */
-
-	bss->ext_set_sta_key_param_valid = 0;
-
-	/* FIXME: set ext_set_sta_key_param */
-
-	bss->spectrum_mgt_enable = 0;
-	bss->tx_mgmt_power = 0;
-	bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
-	bss->action = update;
-
-	vif_priv->bss_type = bss->bss_type;
-
+	wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
 	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,