diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 130b027038ff..50f595426b01 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -2369,7 +2369,7 @@ ol_txrx_update_ibss_add_peer_num_of_vdev(ol_txrx_vdev_handle vdev, int16_t new_peer_num; new_peer_num = vdev->ibss_peer_num + peer_num_delta; - if (new_peer_num > MAX_IBSS_PEERS || new_peer_num < 0) + if (new_peer_num > MAX_PEERS || new_peer_num < 0) return OL_TXRX_INVALID_NUM_PEERS; vdev->ibss_peer_num = new_peer_num; diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index 7dac14b13d02..78f9005f1d93 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -121,8 +121,8 @@ typedef struct connection_info_s { eMib_dot11DesiredBssType connDot11DesiredBssType; struct qdf_mac_addr bssId; tCsrSSIDInfo SSID; - uint8_t staId[MAX_IBSS_PEERS]; - struct qdf_mac_addr peerMacAddress[MAX_IBSS_PEERS]; + uint8_t staId[MAX_PEERS]; + struct qdf_mac_addr peerMacAddress[MAX_PEERS]; eCsrAuthType authType; eCsrEncryptionType ucEncryptionType; eCsrEncryptionType mcEncryptionType; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index c6a68e795eee..06cd0c488df3 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1160,7 +1160,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, } pHddCtx->sta_to_adapter[sta_id] = NULL; /* Clear all the peer sta register with TL. */ - for (i = 0; i < MAX_IBSS_PEERS; i++) { + for (i = 0; i < MAX_PEERS; i++) { if (0 == pHddStaCtx->conn_info.staId[i]) continue; sta_id = pHddStaCtx->conn_info.staId[i]; @@ -2606,7 +2606,7 @@ void hdd_delete_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id) * @staId: station id * * Return: - * true if we remove MAX_IBSS_PEERS or less STA + * true if we remove MAX_PEERS or less STA * false otherwise. */ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) @@ -2618,7 +2618,7 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) uint8_t empty_slots = 0; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - for (idx = 0; idx < MAX_IBSS_PEERS; idx++) { + for (idx = 0; idx < MAX_PEERS; idx++) { if (staId == pHddStaCtx->conn_info.staId[idx]) { pHddStaCtx->conn_info.staId[idx] = 0; @@ -2644,7 +2644,7 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) } } - if (MAX_IBSS_PEERS == empty_slots) { + if (MAX_PEERS == empty_slots) { /* Last peer departed, set the IBSS state appropriately */ pHddStaCtx->conn_info.connState = eConnectionState_IbssDisconnected; diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index fae04076035a..c7bbcda6f172 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -5152,7 +5152,7 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, /* Get station index for the peer mac address and sanitize it */ hdd_get_peer_sta_id(pHddStaCtx, &peerMacAddr, &staIdx); - if (staIdx > MAX_IBSS_PEERS) { + if (staIdx > MAX_PEERS) { hdd_err("Invalid StaIdx %d returned", staIdx); ret = -EINVAL; goto exit; diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h index db57c16cb34f..7113243d6c2d 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.h +++ b/core/hdd/src/wlan_hdd_nan_datapath.h @@ -41,7 +41,6 @@ struct wireless_dev; #define NDP_QOS_INFO_LEN 255 #define NDP_NUM_INSTANCE_ID 255 -#define HDD_MAX_NUM_NDP_STA (MAX_IBSS_PEERS) #define NDP_BROADCAST_STAID (0) #ifdef WLAN_FEATURE_NAN_DATAPATH @@ -184,7 +183,7 @@ enum nan_datapath_state { struct nan_datapath_ctx { enum nan_datapath_state state; /* idx in following array should follow conn_info.peerMacAddress */ - uint32_t active_ndp_sessions[HDD_MAX_NUM_NDP_STA]; + uint32_t active_ndp_sessions[MAX_PEERS]; uint32_t active_ndp_peers; uint16_t ndp_create_transaction_id; uint16_t ndp_delete_transaction_id; diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 9a4ff03294ea..7ff10a37da92 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -577,7 +577,7 @@ QDF_STATUS hdd_get_peer_sta_id(hdd_station_ctx_t *pHddStaCtx, { uint8_t idx; - for (idx = 0; idx < MAX_IBSS_PEERS; idx++) { + for (idx = 0; idx < MAX_PEERS; idx++) { if (!qdf_mem_cmp(&pHddStaCtx->conn_info.peerMacAddress[idx], pMacAddress, QDF_MAC_ADDR_SIZE)) { *staId = pHddStaCtx->conn_info.staId[idx]; @@ -780,7 +780,7 @@ int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr) { uint8_t idx; - for (idx = 0; idx < MAX_IBSS_PEERS; idx++) { + for (idx = 0; idx < MAX_PEERS; idx++) { if (sta_ctx->conn_info.staId[idx] == 0) continue; if (qdf_mem_cmp(&sta_ctx->conn_info.peerMacAddress[idx], diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index cb0ad82e48fc..3801966cb623 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -786,7 +786,7 @@ hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, uint8_t idx; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - for (idx = 0; idx < MAX_IBSS_PEERS; idx++) { + for (idx = 0; idx < MAX_PEERS; idx++) { if (0 != pHddStaCtx->conn_info.staId[idx] && staIdx == pHddStaCtx->conn_info.staId[idx]) { return &pHddStaCtx->conn_info.peerMacAddress[idx]; @@ -7332,7 +7332,7 @@ static int __iw_get_char_setnone(struct net_device *dev, int idx = 0; int length = 0, buf = 0; - for (idx = 0; idx < MAX_IBSS_PEERS; idx++) { + for (idx = 0; idx < MAX_PEERS; idx++) { if (0 != pHddStaCtx->conn_info.staId[idx]) { buf = snprintf ((extra + length), diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index cfd8de71ed14..3542ce927646 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1636,14 +1636,14 @@ static uint16_t wma_calc_ibss_heart_beat_timer(int16_t peer_num) /* entry index : (the number of currently connected peers) - 1 entry value : the heart time threshold value in seconds for detecting ibss peer departure */ - static const uint16_t heart_beat_timer[MAX_IBSS_PEERS] = { + static const uint16_t heart_beat_timer[MAX_PEERS] = { 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16, 16 }; - if (peer_num < 1 || peer_num > MAX_IBSS_PEERS) + if (peer_num < 1 || peer_num > MAX_PEERS) return 0; return heart_beat_timer[peer_num - 1]; diff --git a/target/inc/wlan_defs.h b/target/inc/wlan_defs.h index 162671c529fe..252ad131a9a4 100644 --- a/target/inc/wlan_defs.h +++ b/target/inc/wlan_defs.h @@ -339,7 +339,7 @@ typedef A_UINT8 A_RATE; #error "Extend rate table module first" #endif -#define MAX_IBSS_PEERS 32 +#define MAX_PEERS 32 #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B) typedef struct {