diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 782c0d44f76a..50bd13004529 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1692,7 +1692,8 @@ 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_PEERS; i++) { - if (0 == pHddStaCtx->conn_info.staId[i]) + if (HDD_WLAN_INVALID_STA_ID == + pHddStaCtx->conn_info.staId[i]) continue; sta_id = pHddStaCtx->conn_info.staId[i]; hdd_debug("Deregister StaID %d", sta_id); @@ -3317,7 +3318,8 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) empty_slots++; } else { - if (pHddStaCtx->conn_info.staId[idx] != 0) { + if (pHddStaCtx->conn_info.staId[idx] != + HDD_WLAN_INVALID_STA_ID) { valid_idx = idx; } else { /* Found an empty slot */ @@ -3335,7 +3337,8 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) /* Find next active staId, to have a valid sta trigger for TL. */ if (fSuccess == true) { if (del_idx == 0) { - if (pHddStaCtx->conn_info.staId[valid_idx] != 0) { + if (pHddStaCtx->conn_info.staId[valid_idx] != + HDD_WLAN_INVALID_STA_ID) { pHddStaCtx->conn_info.staId[0] = pHddStaCtx->conn_info.staId[valid_idx]; qdf_copy_macaddr(&pHddStaCtx->conn_info. diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 420d62a5c4f5..4a85c2b0d804 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -269,7 +269,7 @@ static int hdd_ocb_register_sta(hdd_adapter_t *adapter) return -EINVAL; } - if (pHddStaCtx->conn_info.staId[0] != 0 && + if (pHddStaCtx->conn_info.staId[0] != HDD_WLAN_INVALID_STA_ID && pHddStaCtx->conn_info.staId[0] != peer_id) { hdd_err("The ID for the OCB station has changed."); } diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index e9de97fa2c0e..155b190f4fb9 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -395,12 +395,13 @@ static void hdd_get_transmit_sta_id(hdd_adapter_t *adapter, struct sk_buff *skb, uint8_t *station_id) { bool mcbc_addr = false; + QDF_STATUS status; hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); struct qdf_mac_addr *dst_addr = NULL; dst_addr = (struct qdf_mac_addr *)skb->data; - hdd_get_peer_sta_id(sta_ctx, dst_addr, station_id); - if (*station_id == HDD_WLAN_INVALID_STA_ID) { + status = hdd_get_peer_sta_id(sta_ctx, dst_addr, station_id); + if (QDF_IS_STATUS_ERROR(status)) { if (QDF_NBUF_CB_GET_IS_BCAST(skb) || QDF_NBUF_CB_GET_IS_MCAST(skb)) { hdd_info("Received MC/BC packet for transmission"); @@ -987,7 +988,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_PEERS; idx++) { - if (sta_ctx->conn_info.staId[idx] == 0) + if (sta_ctx->conn_info.staId[idx] == HDD_WLAN_INVALID_STA_ID) continue; if (qdf_mem_cmp(&sta_ctx->conn_info.peerMacAddress[idx], addr, sizeof(struct qdf_mac_addr))) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index ee0837ca069b..5ca87bfbe179 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -3270,8 +3270,9 @@ hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); for (idx = 0; idx < MAX_PEERS; idx++) { - if (0 != pHddStaCtx->conn_info.staId[idx] && - staIdx == pHddStaCtx->conn_info.staId[idx]) { + if (HDD_WLAN_INVALID_STA_ID != + pHddStaCtx->conn_info.staId[idx] && + staIdx == pHddStaCtx->conn_info.staId[idx]) { return &pHddStaCtx->conn_info.peerMacAddress[idx]; } } @@ -10130,7 +10131,8 @@ static int __iw_get_char_setnone(struct net_device *dev, int length = 0, buf = 0; for (idx = 0; idx < MAX_PEERS; idx++) { - if (0 != pHddStaCtx->conn_info.staId[idx]) { + if (HDD_WLAN_INVALID_STA_ID != + pHddStaCtx->conn_info.staId[idx]) { buf = snprintf ((extra + length), WE_MAX_STR_LEN - length,