qcacmn: Add qdf API for dev_hold
Add qdf API for dev_hold Change-Id: I585e6781718fd55e8359906e5355f068376406c2 CRs-Fixed: 3579431
This commit is contained in:

committed by
Rahul Choudhary

parent
d97cfce6b4
commit
f86703892d
@@ -2032,7 +2032,7 @@ is_nbuf_frm_rmnet(qdf_nbuf_t nbuf, struct dp_tx_msdu_info_s *msdu_info)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((ingress_dev->priv_flags & IFF_PHONY_HEADROOM)) {
|
if ((ingress_dev->priv_flags & IFF_PHONY_HEADROOM)) {
|
||||||
dev_put(ingress_dev);
|
qdf_net_if_release_dev((struct qdf_net_if *)ingress_dev);
|
||||||
frag = &(skb_shinfo(nbuf)->frags[0]);
|
frag = &(skb_shinfo(nbuf)->frags[0]);
|
||||||
buf_len = skb_frag_size(frag);
|
buf_len = skb_frag_size(frag);
|
||||||
payload_addr = (uint8_t *)skb_frag_address(frag);
|
payload_addr = (uint8_t *)skb_frag_address(frag);
|
||||||
@@ -2048,7 +2048,7 @@ is_nbuf_frm_rmnet(qdf_nbuf_t nbuf, struct dp_tx_msdu_info_s *msdu_info)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
dev_put(ingress_dev);
|
qdf_net_if_release_dev((struct qdf_net_if *)ingress_dev);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -65,6 +65,17 @@ qdf_net_if_get_dev_by_name(char *nif_name);
|
|||||||
QDF_STATUS
|
QDF_STATUS
|
||||||
qdf_net_if_release_dev(struct qdf_net_if *nif);
|
qdf_net_if_release_dev(struct qdf_net_if *nif);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_net_if_hold_dev() - Hold reference to network device
|
||||||
|
* @nif: network device
|
||||||
|
*
|
||||||
|
* This function holds reference to the network device
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS on success
|
||||||
|
*/
|
||||||
|
QDF_STATUS
|
||||||
|
qdf_net_if_hold_dev(struct qdf_net_if *nif);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_napi_enable() - Enable the napi schedule
|
* qdf_napi_enable() - Enable the napi schedule
|
||||||
* @napi: NAPI context
|
* @napi: NAPI context
|
||||||
@@ -138,6 +149,12 @@ qdf_net_if_release_dev(struct qdf_net_if *nif)
|
|||||||
return __qdf_net_if_release_dev(nif);
|
return __qdf_net_if_release_dev(nif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline QDF_STATUS
|
||||||
|
qdf_net_if_hold_dev(struct qdf_net_if *nif)
|
||||||
|
{
|
||||||
|
return __qdf_net_if_hold_dev(nif);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
||||||
* @ndev: net_device
|
* @ndev: net_device
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -86,6 +86,25 @@ __qdf_net_if_release_dev(struct qdf_net_if *nif)
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __qdf_net_if_hold_dev() - hold reference to network device
|
||||||
|
* @nif: network device
|
||||||
|
*
|
||||||
|
* This function holds reference to the network device
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS on success
|
||||||
|
*/
|
||||||
|
static inline QDF_STATUS
|
||||||
|
__qdf_net_if_hold_dev(struct qdf_net_if *nif)
|
||||||
|
{
|
||||||
|
if (!nif)
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
|
||||||
|
dev_hold((struct net_device *)nif);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
|
||||||
/**
|
/**
|
||||||
* __qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
* __qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018,2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2018,2020 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -89,6 +89,14 @@ qdf_net_if_release_dev(struct qdf_net_if *nif)
|
|||||||
|
|
||||||
qdf_export_symbol(qdf_net_if_release_dev);
|
qdf_export_symbol(qdf_net_if_release_dev);
|
||||||
|
|
||||||
|
QDF_STATUS
|
||||||
|
qdf_net_if_hold_dev(struct qdf_net_if *nif)
|
||||||
|
{
|
||||||
|
return __qdf_net_if_hold_dev(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
qdf_export_symbol(qdf_net_if_hold_dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr
|
||||||
* @ndev: net_device
|
* @ndev: net_device
|
||||||
|
Reference in New Issue
Block a user