mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
qcacld-3.0: Allocate required memory for skb and radiotap
Mgmt txrx component clones skb and sends cloned skb to its clients ex: packet capture component. Need to Allocate memory and copy skb so that there is enough space to copy radiotap header in skb for packet capture mode. Free skb cloned by Mgmt txrx component. Change-Id: I6bc66b5916ec5a8cf28741e4fcb72f14650fdbfa CRs-Fixed: 2730559
This commit is contained in:
parent
6a576f4039
commit
2727866b28
1 changed files with 21 additions and 3 deletions
|
|
@ -414,23 +414,41 @@ pkt_capture_mgmt_tx_completion(struct wlan_objmgr_pdev *pdev,
|
|||
/**
|
||||
* process_pktcapture_mgmt_rx_data_cb() - process management rx packets
|
||||
* @rx_params: mgmt rx event params
|
||||
* @nbuf: netbuf
|
||||
* @wbuf: netbuf
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static QDF_STATUS
|
||||
pkt_capture_mgmt_rx_data_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_objmgr_peer *peer,
|
||||
qdf_nbuf_t nbuf,
|
||||
qdf_nbuf_t wbuf,
|
||||
struct mgmt_rx_event_params *rx_params,
|
||||
enum mgmt_frame_type frm_type)
|
||||
{
|
||||
struct mon_rx_status txrx_status = {0};
|
||||
struct ieee80211_frame *wh;
|
||||
tpSirMacFrameCtl pfc;
|
||||
qdf_nbuf_t nbuf;
|
||||
int buf_len;
|
||||
|
||||
if (!(pkt_capture_get_pktcap_mode(psoc) & PKT_CAPTURE_MODE_MGMT_ONLY))
|
||||
if (!(pkt_capture_get_pktcap_mode(psoc) & PKT_CAPTURE_MODE_MGMT_ONLY)) {
|
||||
qdf_nbuf_free(wbuf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
buf_len = qdf_nbuf_len(wbuf);
|
||||
nbuf = qdf_nbuf_alloc(NULL, roundup(
|
||||
buf_len + RESERVE_BYTES, 4),
|
||||
RESERVE_BYTES, 4, false);
|
||||
if (!nbuf) {
|
||||
qdf_nbuf_free(wbuf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_nbuf_put_tail(nbuf, buf_len);
|
||||
qdf_mem_copy(qdf_nbuf_data(nbuf), qdf_nbuf_data(wbuf), buf_len);
|
||||
|
||||
qdf_nbuf_free(wbuf);
|
||||
|
||||
pfc = (tpSirMacFrameCtl)(qdf_nbuf_data(nbuf));
|
||||
wh = (struct ieee80211_frame *)qdf_nbuf_data(nbuf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue