.. | .. |
---|
6860 | 6860 | cca_congest_ext_channel_req_v2_t *per_chspec_stats = NULL; |
---|
6861 | 6861 | uint per_chspec_stats_size = 0; |
---|
6862 | 6862 | cca_congest_ext_channel_req_v3_t *all_chan_results; |
---|
6863 | | - cca_congest_ext_channel_req_v3_t all_chan_req; |
---|
| 6863 | + cca_congest_ext_channel_req_v3_t *all_chan_req = NULL; |
---|
| 6864 | + uint all_chan_req_size = sizeof(cca_congest_ext_channel_req_v3_t); |
---|
6864 | 6865 | #else |
---|
6865 | 6866 | /* cca_get_stats_ext iovar for Wifi channel statics */ |
---|
6866 | 6867 | struct cca_congest_ext_channel_req_v2 *cca_v2_results; |
---|
6867 | | - struct cca_congest_ext_channel_req_v2 cca_v2_req; |
---|
| 6868 | + struct cca_congest_ext_channel_req_v2 *cca_v2_req = NULL; |
---|
| 6869 | + uint cca_v2_req_size = sizeof(cca_congest_ext_channel_req_v2_t); |
---|
6868 | 6870 | #endif /* CHAN_STATS_SUPPORT */ |
---|
6869 | 6871 | const wl_cnt_wlc_t *wlc_cnt; |
---|
6870 | 6872 | scb_val_t scbval; |
---|
.. | .. |
---|
7025 | 7027 | |
---|
7026 | 7028 | #ifdef CHAN_STATS_SUPPORT |
---|
7027 | 7029 | /* Option to get all channel statistics */ |
---|
7028 | | - all_chan_req.num_of_entries = 0; |
---|
7029 | | - all_chan_req.ver = WL_CCA_EXT_REQ_VER_V3; |
---|
| 7030 | + all_chan_req = (void *)MALLOCZ(cfg->osh, all_chan_req_size); |
---|
| 7031 | + if (all_chan_req == NULL) { |
---|
| 7032 | + err = BCME_NOMEM; |
---|
| 7033 | + WL_ERR(("all_chan_req alloc failed\n")); |
---|
| 7034 | + goto exit; |
---|
| 7035 | + } |
---|
| 7036 | + all_chan_req->num_of_entries = 0; |
---|
| 7037 | + all_chan_req->ver = WL_CCA_EXT_REQ_VER_V3; |
---|
7030 | 7038 | err = wldev_iovar_getbuf(bcmcfg_to_prmry_ndev(cfg), "cca_get_stats_ext", |
---|
7031 | | - &all_chan_req, sizeof(all_chan_req), iovar_buf, WLC_IOCTL_MAXLEN, NULL); |
---|
| 7039 | + all_chan_req, all_chan_req_size, iovar_buf, WLC_IOCTL_MAXLEN, NULL); |
---|
7032 | 7040 | |
---|
7033 | 7041 | if (err != BCME_OK && err != BCME_UNSUPPORTED) { |
---|
7034 | 7042 | WL_ERR(("cca_get_stats_ext iovar err = %d\n", err)); |
---|
.. | .. |
---|
7089 | 7097 | } |
---|
7090 | 7098 | } |
---|
7091 | 7099 | #else |
---|
7092 | | - cca_v2_req.ver = WL_CCA_EXT_REQ_VER_V2; |
---|
7093 | | - cca_v2_req.chanspec = |
---|
| 7100 | + cca_v2_req = (void *)MALLOCZ(cfg->osh, cca_v2_req_size); |
---|
| 7101 | + if (cca_v2_req == NULL) { |
---|
| 7102 | + err = BCME_NOMEM; |
---|
| 7103 | + WL_ERR(("cca_v2_req alloc failed\n")); |
---|
| 7104 | + goto exit; |
---|
| 7105 | + } |
---|
| 7106 | + cca_v2_req->ver = WL_CCA_EXT_REQ_VER_V2; |
---|
| 7107 | + cca_v2_req->chanspec = |
---|
7094 | 7108 | wl_chspec_host_to_driver(wf_chspec_primary20_chspec(cur_chanspec)); |
---|
7095 | 7109 | |
---|
7096 | | - err = wldev_iovar_getbuf(bcmcfg_to_prmry_ndev(cfg), "cca_get_stats_ext", &cca_v2_req, |
---|
7097 | | - sizeof(cca_v2_req), iovar_buf, WLC_IOCTL_MAXLEN, NULL); |
---|
| 7110 | + err = wldev_iovar_getbuf(bcmcfg_to_prmry_ndev(cfg), "cca_get_stats_ext", cca_v2_req, |
---|
| 7111 | + cca_v2_req_size, iovar_buf, WLC_IOCTL_MAXLEN, NULL); |
---|
7098 | 7112 | |
---|
7099 | 7113 | if (err != BCME_OK && err != BCME_UNSUPPORTED) { |
---|
7100 | 7114 | WL_ERR(("cca_get_stats_ext iovar err = %d\n", err)); |
---|
.. | .. |
---|
7300 | 7314 | WL_ERR(("Vendor Command reply failed ret:%d \n", err)); |
---|
7301 | 7315 | |
---|
7302 | 7316 | exit: |
---|
| 7317 | +#ifdef CHAN_STATS_SUPPORT |
---|
| 7318 | + if (all_chan_req) { |
---|
| 7319 | + MFREE(cfg->osh, all_chan_req, all_chan_req_size); |
---|
| 7320 | + } |
---|
| 7321 | +#else |
---|
| 7322 | + if (cca_v2_req) { |
---|
| 7323 | + MFREE(cfg->osh, cca_v2_req, cca_v2_req_size); |
---|
| 7324 | + } |
---|
| 7325 | +#endif /* CHAN_STATS_SUPPORT */ |
---|
7303 | 7326 | if (outdata) { |
---|
7304 | 7327 | MFREE(cfg->osh, outdata, WLC_IOCTL_MAXLEN); |
---|
7305 | 7328 | } |
---|