Skip to content

Commit

Permalink
drivers: staging: qcacld: Merge branch android-msm-sunfish-4.14-andro…
Browse files Browse the repository at this point in the history
…id12-qpr1 (android-12.0.0_r0.39)

sync: e30fcb9 qcacld-3.0: Merge branch 'android-msm-pixel-4.14-sc-security' into android-msm-pixel-4.14-sc-qpr1

sync: 2b33b7b fw-api: Merge android-msm-floral-4.14-rvc-qpr1 into android-msm-pixel-4.14

sync: 2cfb552 qcacmn: Merge branch 'android-msm-pixel-4.14-sc-security' into android-msm-pixel-4.14-sc-qpr1

Signed-off-by: engstk <[email protected]>
  • Loading branch information
engstk committed Feb 9, 2022
1 parent 872b655 commit b7c0c99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2018, 2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -90,6 +90,7 @@ static QDF_STATUS target_if_wifi_pos_get_indirect_data(
void *paddr = NULL;
uint32_t addr_hi;
uint8_t ring_idx = 0, num_rings;
uint32_t allocated_len;

if (!indirect) {
target_if_debug("no indirect data. regular event received");
Expand All @@ -102,6 +103,16 @@ static QDF_STATUS target_if_wifi_pos_get_indirect_data(
target_if_err("incorrect pdev_id: %d", indirect->pdev_id);
return QDF_STATUS_E_INVAL;
}

allocated_len = priv_obj->dma_cap[ring_idx].min_buf_size +
(priv_obj->dma_cap[ring_idx].min_buf_align - 1);
if (indirect->len > allocated_len ||
indirect->len > OEM_DATA_DMA_BUFF_SIZE) {
target_if_err("Invalid indirect len: %d, allocated_len:%d",
indirect->len, allocated_len);
return QDF_STATUS_E_INVAL;
}

addr_hi = (uint64_t)WMI_OEM_DMA_DATA_ADDR_HI_GET(
indirect->addr_hi);
paddr = (void *)((uint64_t)addr_hi << 32 | indirect->addr_lo);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2018, 2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -60,6 +60,8 @@ struct wifi_pos_req_msg;

#ifndef OEM_DATA_RSP_SIZE
#define OEM_DATA_RSP_SIZE 1724
/* Header + VHT80 CIR * 2 chains */
#define OEM_DATA_DMA_BUFF_SIZE (64 + 512 * 4 * 2)
#endif

/**
Expand Down

0 comments on commit b7c0c99

Please sign in to comment.