qcacld-3.0: Add OS_IF DSC vdev op protection to indicate mgmt frame api

HDD indicate mgmt frame API is called from scheduler context to send mgmt
frames to user which can happen in parallel to del virtual interface which
can lead to race conditions and stale netdev pointer usage and hence add
OS_IF DSC vdev op protection to indicate mgmt frame API such that when
management frames are getting indicated to user space del virtual interface
transaction is synchronized.

Change-Id: I620225f7a0a46efa6da6d615e3014a8f4f5e43cf
CRs-Fixed: 2543244
This commit is contained in:
Rajeev Kumar 2019-10-10 16:56:54 -07:00 committed by nshrivas
parent f9ffa13a2d
commit d097ea1836
3 changed files with 40 additions and 11 deletions

View File

@ -60,10 +60,21 @@ int hdd_set_p2p_ps(struct net_device *dev, void *msgData);
int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command);
int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command);
void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
uint32_t frm_len, uint8_t *pb_frames,
uint8_t frame_type, uint32_t rx_chan,
int8_t rx_rssi, enum rxmgmt_flags rx_flags);
/**
* hdd_indicate_mgmt_frame_to_user- send mgmt frame to user
* @adapter: adapter pointer
* @frm_len: frame length
* @pb_frames: frame bytes
* @frame_type: frame type
* @rx_chan: channel on which frame was received
* @rx_rssi: rssi
* @rx_flags: rx flags of the frame
*/
void hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
uint32_t frm_len, uint8_t *pb_frames,
uint8_t frame_type, uint32_t rx_chan,
int8_t rx_rssi,
enum rxmgmt_flags rx_flags);
int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter);
void wlan_hdd_cancel_existing_remain_on_channel(struct hdd_adapter *adapter);

View File

@ -9538,7 +9538,7 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
hdd_for_each_adapter(hdd_ctx, adapter) {
if ((adapter) &&
(WLAN_HDD_ADAPTER_MAGIC == adapter->magic)) {
__hdd_indicate_mgmt_frame(adapter,
hdd_indicate_mgmt_frame_to_user(adapter,
frame_ind->frame_len,
frame_ind->frameBuf,
frame_ind->frameType,
@ -9555,7 +9555,7 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
if ((adapter) &&
(WLAN_HDD_ADAPTER_MAGIC == adapter->magic))
__hdd_indicate_mgmt_frame(adapter,
hdd_indicate_mgmt_frame_to_user(adapter,
frame_ind->frame_len,
frame_ind->frameBuf,
frame_ind->frameType,

View File

@ -978,11 +978,11 @@ wlan_hdd_cfg80211_convert_rxmgmt_flags(enum rxmgmt_flags flag,
return ret;
}
void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
uint32_t frm_len,
uint8_t *pb_frames,
uint8_t frame_type, uint32_t rx_chan,
int8_t rx_rssi, enum rxmgmt_flags rx_flags)
static void
__hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
uint32_t frm_len, uint8_t *pb_frames,
uint8_t frame_type, uint32_t rx_chan,
int8_t rx_rssi, enum rxmgmt_flags rx_flags)
{
uint16_t freq;
uint8_t type = 0;
@ -1099,6 +1099,24 @@ void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
#endif /* LINUX_VERSION_CODE */
}
void hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
uint32_t frm_len, uint8_t *pb_frames,
uint8_t frame_type, uint32_t rx_chan,
int8_t rx_rssi, enum rxmgmt_flags rx_flags)
{
int errno;
struct osif_vdev_sync *vdev_sync;
errno = osif_vdev_sync_op_start(adapter->dev, &vdev_sync);
if (errno)
return;
__hdd_indicate_mgmt_frame_to_user(adapter, frm_len, pb_frames,
frame_type, rx_chan,
rx_rssi, rx_flags);
osif_vdev_sync_op_stop(vdev_sync);
}
int wlan_hdd_set_power_save(struct hdd_adapter *adapter,
struct p2p_ps_config *ps_config)
{