Move umac/p2p to components/p2p
Change-Id: I8ca4c55470674422eca2dc80dd269cf45d4942ea
This commit is contained in:
128
components/p2p/dispatcher/inc/wlan_p2p_cfg.h
Normal file
128
components/p2p/dispatcher/inc/wlan_p2p_cfg.h
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_P2P_H__)
|
||||
#define CONFIG_P2P_H__
|
||||
|
||||
#include "cfg_define.h"
|
||||
#include "cfg_converged.h"
|
||||
#include "qdf_types.h"
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gGoKeepAlivePeriod - P2P GO keep alive period.
|
||||
* @Min: 1
|
||||
* @Max: 65535
|
||||
* @Default: 20
|
||||
*
|
||||
* This is P2P GO keep alive period.
|
||||
*
|
||||
* Related: None.
|
||||
*
|
||||
* Supported Feature: P2P
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_GO_KEEP_ALIVE_PERIOD CFG_INI_UINT( \
|
||||
"gGoKeepAlivePeriod", \
|
||||
1, \
|
||||
65535, \
|
||||
20, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"P2P GO keep alive period")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gGoLinkMonitorPeriod - period where link is idle and where
|
||||
* we send NULL frame
|
||||
* @Min: 3
|
||||
* @Max: 50
|
||||
* @Default: 10
|
||||
*
|
||||
* This is period where link is idle and where we send NULL frame for P2P GO.
|
||||
*
|
||||
* Related: None.
|
||||
*
|
||||
* Supported Feature: P2P
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_GO_LINK_MONITOR_PERIOD CFG_INI_UINT( \
|
||||
"gGoLinkMonitorPeriod", \
|
||||
3, \
|
||||
50, \
|
||||
10, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"period where link is idle and where we send NULL frame")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* isP2pDeviceAddrAdministrated - Enables to derive the P2P MAC address from
|
||||
* the primary MAC address
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 1
|
||||
*
|
||||
* This ini is used to enable/disable to derive the P2P MAC address from the
|
||||
* primary MAC address.
|
||||
*
|
||||
* Related: None.
|
||||
*
|
||||
* Supported Feature: P2P
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED CFG_INI_BOOL( \
|
||||
"isP2pDeviceAddrAdministrated", \
|
||||
1, \
|
||||
"derive the P2P MAC address from the primary MAC address")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gSkipDfsChannelInP2pSearch - Skip DFS Channel in case of P2P Search
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 1
|
||||
*
|
||||
* This ini is used to disable(skip) dfs channel in p2p search.
|
||||
* Related: None.
|
||||
*
|
||||
* Supported Feature: DFS P2P
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH CFG_INI_BOOL( \
|
||||
"gSkipDfsChannelInP2pSearch", \
|
||||
1, \
|
||||
"skip dfs channel in p2p search")
|
||||
|
||||
#define CFG_P2P_ALL \
|
||||
CFG(CFG_GO_KEEP_ALIVE_PERIOD) \
|
||||
CFG(CFG_GO_LINK_MONITOR_PERIOD) \
|
||||
CFG(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED) \
|
||||
CFG(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH)
|
||||
|
||||
#endif
|
76
components/p2p/dispatcher/inc/wlan_p2p_cfg_api.h
Normal file
76
components/p2p/dispatcher/inc/wlan_p2p_cfg_api.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Contains p2p configures interface definitions
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_P2P_CFG_API_H_
|
||||
#define _WLAN_P2P_CFG_API_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
|
||||
/**
|
||||
* cfg_p2p_get_go_keepalive_period() - get go keepalive period
|
||||
* @psoc: pointer to psoc object
|
||||
* @period: go keepalive period
|
||||
*
|
||||
* This function gets go keepalive period to p2p component
|
||||
*/
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_go_keepalive_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *period);
|
||||
|
||||
/**
|
||||
* cfg_p2p_get_go_link_monitor_period() - get go link monitor period
|
||||
* @psoc: pointer to psoc object
|
||||
* @period: go link monitor period
|
||||
*
|
||||
* This function gets go link monitor period to p2p component
|
||||
*/
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_go_link_monitor_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *period);
|
||||
|
||||
/**
|
||||
* cfg_p2p_get_device_addr_admin() - get enable/disable p2p device
|
||||
* addr administrated
|
||||
* @psoc: pointer to psoc object
|
||||
* @enable: enable/disable p2p device addr administrated
|
||||
*
|
||||
* This function gets enable/disable p2p device addr administrated
|
||||
*/
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_device_addr_admin(struct wlan_objmgr_psoc *psoc,
|
||||
bool *enable);
|
||||
|
||||
/**
|
||||
* cfg_p2p_get_skip_dfs_channel_p2p_search() - get skip dfs channel
|
||||
* in p2p search
|
||||
* @psoc: pointer to psoc object
|
||||
* @enable: enable/disable skip dfs channel in p2p search
|
||||
*
|
||||
* This function gets enable/disable skip dfs channel in p2p search
|
||||
*/
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_skip_dfs_channel_p2p_search(struct wlan_objmgr_psoc *psoc,
|
||||
bool *enable);
|
||||
|
||||
#endif /* _WLAN_P2P_CFG_API_H_ */
|
272
components/p2p/dispatcher/inc/wlan_p2p_public_struct.h
Normal file
272
components/p2p/dispatcher/inc/wlan_p2p_public_struct.h
Normal file
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Contains p2p public data structure definations
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_P2P_PUBLIC_STRUCT_H_
|
||||
#define _WLAN_P2P_PUBLIC_STRUCT_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
|
||||
#define P2P_MAX_NOA_DESC 4
|
||||
|
||||
/**
|
||||
* struct p2p_ps_params - P2P powersave related params
|
||||
* @opp_ps: opportunistic power save
|
||||
* @ctwindow: CT window
|
||||
* @count: count
|
||||
* @duration: duration
|
||||
* @interval: interval
|
||||
* @single_noa_duration: single shot noa duration
|
||||
* @ps_selection: power save selection
|
||||
* @session_id: session id
|
||||
*/
|
||||
struct p2p_ps_params {
|
||||
uint8_t opp_ps;
|
||||
uint32_t ctwindow;
|
||||
uint8_t count;
|
||||
uint32_t duration;
|
||||
uint32_t interval;
|
||||
uint32_t single_noa_duration;
|
||||
uint8_t ps_selection;
|
||||
uint8_t session_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_roc_req - P2P roc request
|
||||
* @vdev_id: Vdev id on which this request has come
|
||||
* @chan: Chan for which this RoC has been requested
|
||||
* @phy_mode: PHY mode
|
||||
* @duration: Duration for the RoC
|
||||
*/
|
||||
struct p2p_roc_req {
|
||||
uint32_t vdev_id;
|
||||
uint32_t chan;
|
||||
uint32_t phy_mode;
|
||||
uint32_t duration;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum p2p_roc_event - P2P RoC event
|
||||
* @ROC_EVENT_READY_ON_CHAN: RoC has started now
|
||||
* @ROC_EVENT_COMPLETED: RoC has been completed
|
||||
* @ROC_EVENT_INAVLID: Invalid event
|
||||
*/
|
||||
enum p2p_roc_event {
|
||||
ROC_EVENT_READY_ON_CHAN = 0,
|
||||
ROC_EVENT_COMPLETED,
|
||||
ROC_EVENT_INAVLID,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_event - p2p event
|
||||
* @vdev_id: Vdev id
|
||||
* @roc_event: RoC event
|
||||
* @cookie: Cookie which is given to supplicant for this roc req
|
||||
* @chan: Chan for which this RoC has been requested
|
||||
* @duration: Duration for the RoC
|
||||
*/
|
||||
struct p2p_event {
|
||||
uint32_t vdev_id;
|
||||
enum p2p_roc_event roc_event;
|
||||
uint64_t cookie;
|
||||
uint32_t chan;
|
||||
uint32_t duration;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_rx_mgmt_frame - rx mgmt frame structure
|
||||
* @frame_len: Frame length
|
||||
* @rx_chan: RX channel
|
||||
* @vdev_id: Vdev id
|
||||
* @frm_type: Frame type
|
||||
* @rx_rssi: RX rssi
|
||||
* @buf: Buffer address
|
||||
*/
|
||||
struct p2p_rx_mgmt_frame {
|
||||
uint32_t frame_len;
|
||||
uint32_t rx_chan;
|
||||
uint32_t vdev_id;
|
||||
uint32_t frm_type;
|
||||
uint32_t rx_rssi;
|
||||
uint8_t buf[1];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_tx_cnf - tx confirm structure
|
||||
* @vdev_id: Vdev id
|
||||
* @action_cookie: TX cookie for this action frame
|
||||
* @buf_len: Frame length
|
||||
* @status: TX status
|
||||
* @buf: Buffer address
|
||||
*/
|
||||
struct p2p_tx_cnf {
|
||||
uint32_t vdev_id;
|
||||
uint64_t action_cookie;
|
||||
uint32_t buf_len;
|
||||
uint32_t status;
|
||||
uint8_t *buf;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_mgmt_tx - p2p mgmt tx structure
|
||||
* @vdev_id: Vdev id
|
||||
* @chan: Chan for which this RoC has been requested
|
||||
* @wait: Duration for the RoC
|
||||
* @len: Length of tx buffer
|
||||
* @no_cck: Required cck or not
|
||||
* @dont_wait_for_ack: Wait for ack or not
|
||||
* @off_chan: Off channel tx or not
|
||||
* @buf: TX buffer
|
||||
*/
|
||||
struct p2p_mgmt_tx {
|
||||
uint32_t vdev_id;
|
||||
uint32_t chan;
|
||||
uint32_t wait;
|
||||
uint32_t len;
|
||||
uint32_t no_cck;
|
||||
uint32_t dont_wait_for_ack;
|
||||
uint32_t off_chan;
|
||||
const uint8_t *buf;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_set_mac_filter
|
||||
* @vdev_id: Vdev id
|
||||
* @mac: mac addr
|
||||
* @freq: frequency
|
||||
* @set: set or clear
|
||||
*/
|
||||
struct p2p_set_mac_filter {
|
||||
uint32_t vdev_id;
|
||||
uint8_t mac[QDF_MAC_ADDR_SIZE];
|
||||
uint32_t freq;
|
||||
bool set;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_set_mac_filter_evt
|
||||
* @vdev_id: Vdev id
|
||||
* @status: target reported result of set mac addr filter
|
||||
*/
|
||||
struct p2p_set_mac_filter_evt {
|
||||
uint32_t vdev_id;
|
||||
uint32_t status;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_ps_config
|
||||
* @vdev_id: Vdev id
|
||||
* @opp_ps: Opportunistic power save
|
||||
* @ct_window: CT window
|
||||
* @count: Count
|
||||
* @duration: Duration
|
||||
* @interval: Interval
|
||||
* @single_noa_duration: Single shot noa duration
|
||||
* @ps_selection: power save selection
|
||||
*/
|
||||
struct p2p_ps_config {
|
||||
uint32_t vdev_id;
|
||||
uint32_t opp_ps;
|
||||
uint32_t ct_window;
|
||||
uint32_t count;
|
||||
uint32_t duration;
|
||||
uint32_t interval;
|
||||
uint32_t single_noa_duration;
|
||||
uint32_t ps_selection;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_lo_start - p2p listen offload start
|
||||
* @vdev_id: Vdev id
|
||||
* @ctl_flags: Control flag
|
||||
* @freq: P2P listen frequency
|
||||
* @period: Listen offload period
|
||||
* @interval: Listen offload interval
|
||||
* @count: Number listen offload intervals
|
||||
* @dev_types_len: Device types length
|
||||
* @probe_resp_len: Probe response template length
|
||||
* @device_types: Device types
|
||||
* @probe_resp_tmplt: Probe response template
|
||||
*/
|
||||
struct p2p_lo_start {
|
||||
uint32_t vdev_id;
|
||||
uint32_t ctl_flags;
|
||||
uint32_t freq;
|
||||
uint32_t period;
|
||||
uint32_t interval;
|
||||
uint32_t count;
|
||||
uint32_t dev_types_len;
|
||||
uint32_t probe_resp_len;
|
||||
uint8_t *device_types;
|
||||
uint8_t *probe_resp_tmplt;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_lo_event
|
||||
* @vdev_id: vdev id
|
||||
* @reason_code: reason code
|
||||
*/
|
||||
struct p2p_lo_event {
|
||||
uint32_t vdev_id;
|
||||
uint32_t reason_code;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct noa_descriptor - noa descriptor
|
||||
* @type_count: 255: continuous schedule, 0: reserved
|
||||
* @duration: Absent period duration in micro seconds
|
||||
* @interval: Absent period interval in micro seconds
|
||||
* @start_time: 32 bit tsf time when in starts
|
||||
*/
|
||||
struct noa_descriptor {
|
||||
uint32_t type_count;
|
||||
uint32_t duration;
|
||||
uint32_t interval;
|
||||
uint32_t start_time;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_noa_info - p2p noa information
|
||||
* @index: identifies instance of NOA su element
|
||||
* @opps_ps: opps ps state of the AP
|
||||
* @ct_window: ct window in TUs
|
||||
* @vdev_id: vdev id
|
||||
* @num_descriptors: number of NOA descriptors
|
||||
* @noa_desc: noa descriptors
|
||||
*/
|
||||
struct p2p_noa_info {
|
||||
uint32_t index;
|
||||
uint32_t opps_ps;
|
||||
uint32_t ct_window;
|
||||
uint32_t vdev_id;
|
||||
uint32_t num_desc;
|
||||
struct noa_descriptor noa_desc[P2P_MAX_NOA_DESC];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct p2p_protocol_callbacks - callback to non-converged driver
|
||||
* @is_mgmt_protected: func to get 11w mgmt protection status
|
||||
*/
|
||||
struct p2p_protocol_callbacks {
|
||||
bool (*is_mgmt_protected)(uint32_t vdev_id, const uint8_t *peer_addr);
|
||||
};
|
||||
|
||||
#endif /* _WLAN_P2P_PUBLIC_STRUCT_H_ */
|
208
components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h
Normal file
208
components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h
Normal file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Contains p2p south bound interface definitions
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_P2P_TGT_API_H_
|
||||
#define _WLAN_P2P_TGT_API_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
#include <qdf_nbuf.h>
|
||||
|
||||
struct scan_event;
|
||||
struct wlan_objmgr_psoc;
|
||||
struct wlan_objmgr_peer;
|
||||
struct p2p_noa_info;
|
||||
struct p2p_lo_event;
|
||||
struct mgmt_rx_event_params;
|
||||
enum mgmt_frame_type;
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
|
||||
/**
|
||||
* tgt_p2p_lo_event_cb() - Listen offload stop request
|
||||
* @psoc: soc object
|
||||
* @event_info: lo stop event buffer
|
||||
*
|
||||
* This function gets called from target interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_event *event_info);
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_lo_ev_handler() - register lo event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to register listen offload event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_unregister_lo_ev_handler() - unregister lo event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to unregister listen offload event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
#else
|
||||
static inline QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_macaddr_rx_filter_evt_handler() - register add mac rx
|
||||
* filter status event
|
||||
* @psoc: soc object
|
||||
* @register: register or unregister
|
||||
*
|
||||
* p2p tgt api to register add mac rx filter status event
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_register_macaddr_rx_filter_evt_handler(
|
||||
struct wlan_objmgr_psoc *psoc, bool register);
|
||||
|
||||
/**
|
||||
* tgt_p2p_register_noa_ev_handler() - register noa event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to register noa event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_unregister_noa_ev_handler() - unregister noa event
|
||||
* @psoc: soc object
|
||||
*
|
||||
* p2p tgt api to unregister noa event handler.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_unregister_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_p2p_scan_event_cb() - Callback for scan event
|
||||
* @vdev: vdev object
|
||||
* @event: event information
|
||||
* @arg: registered arguments
|
||||
*
|
||||
* This function gets called from scan component when getting P2P
|
||||
* scan event.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void tgt_p2p_scan_event_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_event *event, void *arg);
|
||||
|
||||
/**
|
||||
* tgt_p2p_mgmt_download_comp_cb() - Callback for mgmt frame tx
|
||||
* complete
|
||||
* @context: tx context
|
||||
* @buf: buffer address
|
||||
* @free: need to free or not
|
||||
*
|
||||
* This function gets called from mgmt tx/rx component when mgmt
|
||||
* frame tx complete.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_mgmt_download_comp_cb(void *context,
|
||||
qdf_nbuf_t buf, bool free);
|
||||
|
||||
/**
|
||||
* tgt_p2p_mgmt_ota_comp_cb() - Callback for mgmt frame tx ack
|
||||
* @context: tx context
|
||||
* @buf: buffer address
|
||||
* @status: tx status
|
||||
* @tx_compl_params: tx complete parameters
|
||||
*
|
||||
* This function gets called from mgmt tx/rx component when getting
|
||||
* mgmt frame tx ack.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_mgmt_ota_comp_cb(void *context, qdf_nbuf_t buf,
|
||||
uint32_t status, void *tx_compl_params);
|
||||
|
||||
/**
|
||||
* tgt_p2p_mgmt_frame_rx_cb() - Callback for rx mgmt frame
|
||||
* @psoc: soc context
|
||||
* @peer: peer context
|
||||
* @buf: rx buffer
|
||||
* @mgmt_rx_params: mgmt rx parameters
|
||||
* @frm_type: frame type
|
||||
*
|
||||
* This function gets called from mgmt tx/rx component when rx mgmt
|
||||
* frame.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_objmgr_peer *peer, qdf_nbuf_t buf,
|
||||
struct mgmt_rx_event_params *mgmt_rx_params,
|
||||
enum mgmt_frame_type frm_type);
|
||||
/**
|
||||
* tgt_p2p_noa_event_cb() - Callback for noa event
|
||||
* @psoc: soc object
|
||||
* @event_info: noa event information
|
||||
*
|
||||
* This function gets called from target interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_noa_info *event_info);
|
||||
|
||||
/**
|
||||
* tgt_p2p_add_mac_addr_status_event_cb() - Callback for set mac addr filter evt
|
||||
* @psoc: soc object
|
||||
* @event_info: event information type of p2p_set_mac_filter_evt
|
||||
*
|
||||
* This function gets called from target interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS
|
||||
tgt_p2p_add_mac_addr_status_event_cb(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_set_mac_filter_evt *event_info);
|
||||
|
||||
#endif /* _WLAN_P2P_TGT_API_H_ */
|
411
components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h
Normal file
411
components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h
Normal file
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Contains p2p north bound interface definitions
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_P2P_UCFG_API_H_
|
||||
#define _WLAN_P2P_UCFG_API_H_
|
||||
|
||||
#include <qdf_types.h>
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
struct p2p_roc_req;
|
||||
struct p2p_event;
|
||||
struct p2p_rx_mgmt_frame;
|
||||
struct p2p_tx_cnf;
|
||||
struct p2p_mgmt_tx;
|
||||
struct p2p_ps_config;
|
||||
struct p2p_lo_start;
|
||||
struct p2p_lo_event;
|
||||
|
||||
/**
|
||||
* p2p_rx_callback() - Callback for rx mgmt frame
|
||||
* @user_data: user data associated to this rx mgmt frame.
|
||||
* @rx_frame: RX mgmt frame
|
||||
*
|
||||
* This callback will be used to give rx frames to hdd.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
typedef void (*p2p_rx_callback)(void *user_data,
|
||||
struct p2p_rx_mgmt_frame *rx_frame);
|
||||
|
||||
/**
|
||||
* p2p_action_tx_cnf_callback() - Callback for tx confirmation
|
||||
* @user_data: user data associated to this tx confirmation
|
||||
* @tx_cnf: tx confirmation information
|
||||
*
|
||||
* This callback will be used to give tx mgmt frame confirmation to
|
||||
* hdd.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
typedef void (*p2p_action_tx_cnf_callback)(void *user_data,
|
||||
struct p2p_tx_cnf *tx_cnf);
|
||||
|
||||
/**
|
||||
* p2p_lo_event_callback() - Callback for listen offload event
|
||||
* @user_data: user data associated to this lo event
|
||||
* @p2p_lo_event: listen offload event information
|
||||
*
|
||||
* This callback will be used to give listen offload event to hdd.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
typedef void (*p2p_lo_event_callback)(void *user_data,
|
||||
struct p2p_lo_event *p2p_lo_event);
|
||||
|
||||
/**
|
||||
* p2p_event_callback() - Callback for P2P event
|
||||
* @user_data: user data associated to this p2p event
|
||||
* @p2p_event: p2p event information
|
||||
*
|
||||
* This callback will be used to give p2p event to hdd.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
typedef void (*p2p_event_callback)(void *user_data,
|
||||
struct p2p_event *p2p_event);
|
||||
|
||||
/**
|
||||
* struct p2p_start_param - p2p soc start parameters. Below callbacks
|
||||
* will be registered by the HDD
|
||||
* @rx_callback: Function pointer to hdd rx callback. This
|
||||
* function will be used to give rx frames to hdd
|
||||
* @rx_cb_data: RX callback user data
|
||||
* @event_cb: Founction pointer to hdd p2p event callback.
|
||||
* This function will be used to give p2p event
|
||||
* to hdd
|
||||
* @event_cb_data: Pointer to p2p event callback user data
|
||||
* @tx_cnf_cb: Function pointer to hdd tx confirm callback.
|
||||
* This function will be used to give tx confirm
|
||||
* to hdd
|
||||
* @tx_cnf_cb_data: Pointer to p2p tx confirm callback user data
|
||||
* @lo_event_cb: Founction pointer to p2p listen offload
|
||||
* callback. This function will be used to give
|
||||
* listen offload stopped event to hdd
|
||||
* @lo_event_cb_data: Pointer to p2p listen offload callback user data
|
||||
*/
|
||||
struct p2p_start_param {
|
||||
p2p_rx_callback rx_cb;
|
||||
void *rx_cb_data;
|
||||
p2p_event_callback event_cb;
|
||||
void *event_cb_data;
|
||||
p2p_action_tx_cnf_callback tx_cnf_cb;
|
||||
void *tx_cnf_cb_data;
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
p2p_lo_event_callback lo_event_cb;
|
||||
void *lo_event_cb_data;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* ucfg_p2p_init() - P2P component initialization
|
||||
*
|
||||
* This function gets called when dispatcher initializing.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_init(void);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_deinit() - P2P component de-init
|
||||
*
|
||||
* This function gets called when dispatcher de-init.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_deinit(void);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_psoc_open() - Open P2P component
|
||||
* @soc: soc context
|
||||
*
|
||||
* This function gets called when dispatcher opening.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_psoc_open(struct wlan_objmgr_psoc *soc);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_psoc_close() - Close P2P component
|
||||
* @soc: soc context
|
||||
*
|
||||
* This function gets called when dispatcher closing.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_psoc_close(struct wlan_objmgr_psoc *soc);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_psoc_start() - Start P2P component
|
||||
* @soc: soc context
|
||||
* @req: P2P start parameters
|
||||
*
|
||||
* This function gets called when up layer starting up.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_psoc_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_start_param *req);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_psoc_stop() - Stop P2P component
|
||||
* @soc: soc context
|
||||
*
|
||||
* This function gets called when up layer exit.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_psoc_stop(struct wlan_objmgr_psoc *soc);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_roc_req() - Roc request
|
||||
* @soc: soc context
|
||||
* @roc_req: Roc request parameters
|
||||
* @cookie: return cookie to caller
|
||||
*
|
||||
* This function delivers roc request to P2P component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_roc_req *roc_req, uint64_t *cookie);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_roc_cancel_req() - Cancel roc request
|
||||
* @soc: soc context
|
||||
* @cookie: Find out the roc request by cookie
|
||||
*
|
||||
* This function delivers cancel roc request to P2P component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
||||
uint64_t cookie);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_cleanup_roc_by_vdev() - Cleanup roc request by vdev
|
||||
* @vdev: pointer to vdev object
|
||||
*
|
||||
* This function call P2P API to cleanup roc request by vdev
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_cleanup_roc_by_poc() - Cleanup roc request by psoc
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* This function call P2P API to cleanup roc request by psoc
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_cleanup_roc_by_psoc(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_cleanup_tx_by_vdev() - Cleanup tx request by vdev
|
||||
* @vdev: pointer to vdev object
|
||||
*
|
||||
* This function call P2P API to cleanup tx action frame request by vdev
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_cleanup_tx_by_vdev(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_cleanup_tx_by_poc() - Cleanup tx request by psoc
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* This function call P2P API to cleanup tx action frame request by psoc
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_cleanup_tx_by_psoc(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_mgmt_tx() - Mgmt frame tx request
|
||||
* @soc: soc context
|
||||
* @mgmt_frm: TX mgmt frame parameters
|
||||
* @cookie: Return the cookie to caller
|
||||
*
|
||||
* This function delivers mgmt frame tx request to P2P component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_mgmt_tx_cancel() - Cancel mgmt frame tx request
|
||||
* @soc: soc context
|
||||
* @vdev: vdev object
|
||||
* @cookie: Find out the mgmt tx request by cookie
|
||||
*
|
||||
* This function delivers cancel mgmt frame tx request request to P2P
|
||||
* component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
||||
struct wlan_objmgr_vdev *vdev, uint64_t cookie);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_set_ps() - P2P set power save
|
||||
* @soc: soc context
|
||||
* @ps_config: power save configure
|
||||
*
|
||||
* This function delivers p2p power save request to P2P component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_ps_config *ps_config);
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
/**
|
||||
* ucfg_p2p_lo_start() - Listen offload start request
|
||||
* @soc: soc context
|
||||
* @p2p_lo_start: lo start parameters
|
||||
*
|
||||
* This function delivers listen offload start request to P2P
|
||||
* component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_lo_start *p2p_lo_start);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_lo_stop() - Listen offload stop request
|
||||
* @soc: soc context
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* This function delivers listen offload stop request to P2P component.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* p2p_peer_authorized() - Process peer authorized event
|
||||
* @vdev: vdev structure to which peer is associated
|
||||
* @mac_addr: peer mac address
|
||||
*
|
||||
* This function handles disables noa whenever a legacy station
|
||||
* complete 4-way handshake after association.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void p2p_peer_authorized(struct wlan_objmgr_vdev *vdev, uint8_t *mac_addr);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_set_noa() - Disable/Enable NOA
|
||||
* @soc: soc context
|
||||
* @vdev_id: vdev id
|
||||
* @disable_noa: TRUE - Disable NoA, FALSE - Enable NoA
|
||||
*
|
||||
* This function send wmi command to enable / disable NoA.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_set_noa(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id, bool disable_noa);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_check_random_mac() - check random mac addr or not
|
||||
* @soc: soc context
|
||||
* @vdev_id: vdev id
|
||||
* @random_mac_addr: mac addr to be checked
|
||||
*
|
||||
* This function check the input addr is random mac addr or not for vdev.
|
||||
*
|
||||
* Return: true if addr is random mac address else false.
|
||||
*/
|
||||
bool ucfg_p2p_check_random_mac(struct wlan_objmgr_psoc *soc, uint32_t vdev_id,
|
||||
uint8_t *random_mac_addr);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_register_callbacks() - register p2p callbacks
|
||||
* @soc: soc context
|
||||
* @cb_obj: p2p_protocol_callbacks struct
|
||||
*
|
||||
* This function registers lim callbacks to p2p components to provide
|
||||
* protocol information.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_register_callbacks(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_protocol_callbacks *cb_obj);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_status_scan() - Show P2P connection status when scanning
|
||||
* @vdev: vdev context
|
||||
*
|
||||
* This function shows P2P connection status when scanning.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_status_scan(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_status_connect() - Update P2P connection status
|
||||
* @vdev: vdev context
|
||||
*
|
||||
* Updates P2P connection status by up layer when connecting.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_status_disconnect() - Update P2P connection status
|
||||
* @vdev: vdev context
|
||||
*
|
||||
* Updates P2P connection status by up layer when disconnecting.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_status_disconnect(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_status_start_bss() - Update P2P connection status
|
||||
* @vdev: vdev context
|
||||
*
|
||||
* Updates P2P connection status by up layer when starting bss.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_status_start_bss(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_p2p_status_stop_bss() - Update P2P connection status
|
||||
* @vdev: vdev context
|
||||
*
|
||||
* Updates P2P connection status by up layer when stopping bss.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS ucfg_p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
#endif /* _WLAN_P2P_UCFG_API_H_ */
|
105
components/p2p/dispatcher/src/wlan_p2p_cfg.c
Normal file
105
components/p2p/dispatcher/src/wlan_p2p_cfg.c
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file contains p2p configures interface definitions
|
||||
*/
|
||||
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include "wlan_p2p_public_struct.h"
|
||||
#include "wlan_p2p_cfg_api.h"
|
||||
#include "../../core/src/wlan_p2p_main.h"
|
||||
|
||||
static inline struct p2p_soc_priv_obj *
|
||||
wlan_psoc_get_p2p_object(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_go_keepalive_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *period)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
|
||||
p2p_soc_obj = wlan_psoc_get_p2p_object(psoc);
|
||||
if (!p2p_soc_obj) {
|
||||
*period = 0;
|
||||
p2p_err("p2p psoc null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*period = p2p_soc_obj->param.go_keepalive_period;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_go_link_monitor_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *period)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
|
||||
p2p_soc_obj = wlan_psoc_get_p2p_object(psoc);
|
||||
if (!p2p_soc_obj) {
|
||||
*period = 0;
|
||||
p2p_err("p2p psoc null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*period = p2p_soc_obj->param.go_link_monitor_period;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_device_addr_admin(struct wlan_objmgr_psoc *psoc,
|
||||
bool *enable)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
|
||||
p2p_soc_obj = wlan_psoc_get_p2p_object(psoc);
|
||||
if (!p2p_soc_obj) {
|
||||
*enable = false;
|
||||
p2p_err("p2p psoc null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*enable = p2p_soc_obj->param.p2p_device_addr_admin;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cfg_p2p_get_skip_dfs_channel_p2p_search(struct wlan_objmgr_psoc *psoc,
|
||||
bool *enable)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
|
||||
p2p_soc_obj = wlan_psoc_get_p2p_object(psoc);
|
||||
if (!p2p_soc_obj) {
|
||||
*enable = false;
|
||||
p2p_err("p2p psoc null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*enable = p2p_soc_obj->param.skip_dfs_channel_p2p_search;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
432
components/p2p/dispatcher/src/wlan_p2p_tgt_api.c
Normal file
432
components/p2p/dispatcher/src/wlan_p2p_tgt_api.c
Normal file
@@ -0,0 +1,432 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file contains p2p south bound interface definitions
|
||||
*/
|
||||
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_mgmt_txrx_utils_api.h>
|
||||
#include <scheduler_api.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_objmgr_global_obj.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_peer_obj.h>
|
||||
#include "wlan_p2p_tgt_api.h"
|
||||
#include "wlan_p2p_public_struct.h"
|
||||
#include "../../core/src/wlan_p2p_main.h"
|
||||
#include "../../core/src/wlan_p2p_roc.h"
|
||||
#include "../../core/src/wlan_p2p_off_chan_tx.h"
|
||||
|
||||
#define IEEE80211_FC0_TYPE_MASK 0x0c
|
||||
#define P2P_NOISE_FLOOR_DBM_DEFAULT (-96)
|
||||
|
||||
static inline struct wlan_lmac_if_p2p_tx_ops *
|
||||
wlan_psoc_get_p2p_tx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &(psoc->soc_cb.tx_ops.p2p);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
QDF_STATUS tgt_p2p_register_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
||||
if (p2p_ops && p2p_ops->reg_lo_ev_handler) {
|
||||
status = p2p_ops->reg_lo_ev_handler(psoc, NULL);
|
||||
p2p_debug("register lo event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_unregister_lo_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
||||
if (p2p_ops && p2p_ops->unreg_lo_ev_handler) {
|
||||
status = p2p_ops->unreg_lo_ev_handler(psoc, NULL);
|
||||
p2p_debug("unregister lo event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_lo_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_lo_event *event_info)
|
||||
{
|
||||
struct p2p_lo_stop_event *lo_stop_event;
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
QDF_STATUS status;
|
||||
|
||||
p2p_debug("soc:%pK, event_info:%pK", psoc, event_info);
|
||||
|
||||
if (!psoc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
if (event_info)
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc object is NULL");
|
||||
if (event_info)
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!event_info) {
|
||||
p2p_err("invalid lo stop event information");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
lo_stop_event = qdf_mem_malloc(sizeof(*lo_stop_event));
|
||||
if (!lo_stop_event) {
|
||||
p2p_err("Failed to allocate p2p lo stop event");
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
lo_stop_event->p2p_soc_obj = p2p_soc_obj;
|
||||
lo_stop_event->lo_event = event_info;
|
||||
msg.type = P2P_EVENT_LO_STOPPED;
|
||||
msg.bodyptr = lo_stop_event;
|
||||
msg.callback = p2p_process_evt;
|
||||
msg.flush_callback = p2p_event_flush_callback;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_TARGET_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(lo_stop_event->lo_event);
|
||||
qdf_mem_free(lo_stop_event);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
|
||||
|
||||
QDF_STATUS
|
||||
tgt_p2p_add_mac_addr_status_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_set_mac_filter_evt *event_info)
|
||||
{
|
||||
struct p2p_mac_filter_rsp *mac_filter_rsp;
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!psoc) {
|
||||
p2p_err("random_mac:psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
if (!event_info) {
|
||||
p2p_err("random_mac:invalid event_info");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(
|
||||
psoc, WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("random_mac:p2p soc object is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
mac_filter_rsp = qdf_mem_malloc(sizeof(*mac_filter_rsp));
|
||||
if (!mac_filter_rsp) {
|
||||
p2p_err("random_mac:Failed to allocate mac_filter_rsp");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
mac_filter_rsp->p2p_soc_obj = p2p_soc_obj;
|
||||
mac_filter_rsp->vdev_id = event_info->vdev_id;
|
||||
mac_filter_rsp->status = event_info->status;
|
||||
|
||||
msg.type = P2P_EVENT_ADD_MAC_RSP;
|
||||
msg.bodyptr = mac_filter_rsp;
|
||||
msg.callback = p2p_process_evt;
|
||||
status = scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
qdf_mem_free(mac_filter_rsp);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_register_macaddr_rx_filter_evt_handler(
|
||||
struct wlan_objmgr_psoc *psoc, bool reg)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
||||
if (p2p_ops && p2p_ops->reg_mac_addr_rx_filter_handler) {
|
||||
status = p2p_ops->reg_mac_addr_rx_filter_handler(psoc, reg);
|
||||
p2p_debug("register mac addr rx filter event, register %d status:%d",
|
||||
reg, status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_register_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
||||
if (p2p_ops && p2p_ops->reg_noa_ev_handler) {
|
||||
status = p2p_ops->reg_noa_ev_handler(psoc, NULL);
|
||||
p2p_debug("register noa event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_unregister_noa_ev_handler(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_ops = wlan_psoc_get_p2p_tx_ops(psoc);
|
||||
if (p2p_ops && p2p_ops->unreg_noa_ev_handler) {
|
||||
status = p2p_ops->unreg_noa_ev_handler(psoc, NULL);
|
||||
p2p_debug("unregister noa event, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void tgt_p2p_scan_event_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_event *event, void *arg)
|
||||
{
|
||||
p2p_scan_event_cb(vdev, event, arg);
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_mgmt_download_comp_cb(void *context,
|
||||
qdf_nbuf_t buf, bool free)
|
||||
{
|
||||
p2p_debug("conext:%pK, buf:%pK, free:%d", context,
|
||||
qdf_nbuf_data(buf), free);
|
||||
|
||||
qdf_nbuf_free(buf);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_mgmt_ota_comp_cb(void *context, qdf_nbuf_t buf,
|
||||
uint32_t status, void *tx_compl_params)
|
||||
{
|
||||
struct p2p_tx_conf_event *tx_conf_event;
|
||||
struct scheduler_msg msg = {0};
|
||||
QDF_STATUS ret;
|
||||
|
||||
p2p_debug("context:%pK, buf:%pK, status:%d, tx complete params:%pK",
|
||||
context, buf, status, tx_compl_params);
|
||||
|
||||
if (!context) {
|
||||
p2p_err("invalid context");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
tx_conf_event = qdf_mem_malloc(sizeof(*tx_conf_event));
|
||||
if (!tx_conf_event) {
|
||||
p2p_err("Failed to allocate tx cnf event");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
tx_conf_event->status = status;
|
||||
tx_conf_event->nbuf = buf;
|
||||
tx_conf_event->p2p_soc_obj = (struct p2p_soc_priv_obj *)context;
|
||||
msg.type = P2P_EVENT_MGMT_TX_ACK_CNF;
|
||||
msg.bodyptr = tx_conf_event;
|
||||
msg.callback = p2p_process_evt;
|
||||
msg.flush_callback = p2p_event_flush_callback;
|
||||
ret = scheduler_post_message(QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_TARGET_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
qdf_mem_free(tx_conf_event);
|
||||
qdf_nbuf_free(buf);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_objmgr_peer *peer, qdf_nbuf_t buf,
|
||||
struct mgmt_rx_event_params *mgmt_rx_params,
|
||||
enum mgmt_frame_type frm_type)
|
||||
{
|
||||
struct p2p_rx_mgmt_frame *rx_mgmt;
|
||||
struct p2p_rx_mgmt_event *rx_mgmt_event;
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct scheduler_msg msg = {0};
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
uint32_t vdev_id;
|
||||
uint8_t *pdata;
|
||||
QDF_STATUS status;
|
||||
|
||||
p2p_debug("psoc:%pK, peer:%pK, type:%d", psoc, peer, frm_type);
|
||||
|
||||
if (!mgmt_rx_params) {
|
||||
p2p_err("mgmt rx params is NULL");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p ctx is NULL, drop this frame");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!peer) {
|
||||
if (p2p_soc_obj->cur_roc_vdev_id == P2P_INVALID_VDEV_ID) {
|
||||
p2p_err("vdev id of current roc invalid");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
} else {
|
||||
vdev_id = p2p_soc_obj->cur_roc_vdev_id;
|
||||
}
|
||||
} else {
|
||||
vdev = wlan_peer_get_vdev(peer);
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL in peer, drop this frame");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
}
|
||||
|
||||
rx_mgmt_event = qdf_mem_malloc(sizeof(*rx_mgmt_event));
|
||||
if (!rx_mgmt_event) {
|
||||
p2p_err("Failed to allocate rx mgmt event");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
rx_mgmt = qdf_mem_malloc(sizeof(*rx_mgmt) +
|
||||
mgmt_rx_params->buf_len);
|
||||
if (!rx_mgmt) {
|
||||
p2p_err("Failed to allocate rx mgmt frame");
|
||||
qdf_nbuf_free(buf);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
pdata = (uint8_t *)qdf_nbuf_data(buf);
|
||||
rx_mgmt->frame_len = mgmt_rx_params->buf_len;
|
||||
rx_mgmt->rx_chan = mgmt_rx_params->channel;
|
||||
rx_mgmt->vdev_id = vdev_id;
|
||||
rx_mgmt->frm_type = frm_type;
|
||||
rx_mgmt->rx_rssi = mgmt_rx_params->snr +
|
||||
P2P_NOISE_FLOOR_DBM_DEFAULT;
|
||||
rx_mgmt_event->rx_mgmt = rx_mgmt;
|
||||
rx_mgmt_event->p2p_soc_obj = p2p_soc_obj;
|
||||
qdf_mem_copy(rx_mgmt->buf, pdata, mgmt_rx_params->buf_len);
|
||||
msg.type = P2P_EVENT_RX_MGMT;
|
||||
msg.bodyptr = rx_mgmt_event;
|
||||
msg.callback = p2p_process_evt;
|
||||
msg.flush_callback = p2p_event_flush_callback;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_TARGET_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(rx_mgmt_event->rx_mgmt);
|
||||
qdf_mem_free(rx_mgmt_event);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
qdf_nbuf_free(buf);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_p2p_noa_event_cb(struct wlan_objmgr_psoc *psoc,
|
||||
struct p2p_noa_info *event_info)
|
||||
{
|
||||
struct p2p_noa_event *noa_event;
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
QDF_STATUS status;
|
||||
|
||||
p2p_debug("soc:%pK, event_info:%pK", psoc, event_info);
|
||||
|
||||
if (!psoc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
if (event_info)
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc object is NULL");
|
||||
if (event_info)
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!event_info) {
|
||||
p2p_err("invalid noa event information");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
noa_event = qdf_mem_malloc(sizeof(*noa_event));
|
||||
if (!noa_event) {
|
||||
p2p_err("Failed to allocate p2p noa event");
|
||||
qdf_mem_free(event_info);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
noa_event->p2p_soc_obj = p2p_soc_obj;
|
||||
noa_event->noa_info = event_info;
|
||||
msg.type = P2P_EVENT_NOA;
|
||||
msg.bodyptr = noa_event;
|
||||
msg.callback = p2p_process_evt;
|
||||
msg.flush_callback = p2p_event_flush_callback;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_TARGET_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(noa_event->noa_info);
|
||||
qdf_mem_free(noa_event);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
652
components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c
Normal file
652
components/p2p/dispatcher/src/wlan_p2p_ucfg_api.c
Normal file
@@ -0,0 +1,652 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file contains p2p north bound interface definitions
|
||||
*/
|
||||
|
||||
#include <wmi_unified_api.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <scheduler_api.h>
|
||||
#include "wlan_p2p_public_struct.h"
|
||||
#include "wlan_p2p_ucfg_api.h"
|
||||
#include "../../core/src/wlan_p2p_main.h"
|
||||
#include "../../core/src/wlan_p2p_roc.h"
|
||||
#include "../../core/src/wlan_p2p_off_chan_tx.h"
|
||||
|
||||
static inline struct wlan_lmac_if_p2p_tx_ops *
|
||||
ucfg_p2p_psoc_get_tx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &(psoc->soc_cb.tx_ops.p2p);
|
||||
}
|
||||
|
||||
/**
|
||||
* is_p2p_ps_allowed() - If P2P power save is allowed or not
|
||||
* @vdev: vdev object
|
||||
* @id: umac component id
|
||||
*
|
||||
* This function returns TRUE if P2P power-save is allowed
|
||||
* else returns FALSE.
|
||||
*
|
||||
* Return: bool
|
||||
*/
|
||||
static bool is_p2p_ps_allowed(struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_umac_comp_id id)
|
||||
{
|
||||
struct p2p_vdev_priv_obj *p2p_vdev_obj;
|
||||
uint8_t is_p2pgo = 0;
|
||||
|
||||
if (!vdev) {
|
||||
p2p_err("vdev:%pK", vdev);
|
||||
return true;
|
||||
}
|
||||
p2p_vdev_obj = wlan_objmgr_vdev_get_comp_private_obj(vdev,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
|
||||
if (wlan_vdev_mlme_get_opmode(vdev) == QDF_P2P_GO_MODE)
|
||||
is_p2pgo = 1;
|
||||
|
||||
if (!p2p_vdev_obj || !is_p2pgo) {
|
||||
p2p_err("p2p_vdev_obj:%pK is_p2pgo:%u",
|
||||
p2p_vdev_obj, is_p2pgo);
|
||||
return false;
|
||||
}
|
||||
if (p2p_vdev_obj->non_p2p_peer_count &&
|
||||
p2p_vdev_obj->noa_status == false) {
|
||||
p2p_debug("non_p2p_peer_count: %u, noa_status: %d",
|
||||
p2p_vdev_obj->non_p2p_peer_count,
|
||||
p2p_vdev_obj->noa_status);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_init(void)
|
||||
{
|
||||
return p2p_component_init();
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_deinit(void)
|
||||
{
|
||||
return p2p_component_deinit();
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_psoc_open(struct wlan_objmgr_psoc *soc)
|
||||
{
|
||||
return p2p_psoc_object_open(soc);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_psoc_close(struct wlan_objmgr_psoc *soc)
|
||||
{
|
||||
return p2p_psoc_object_close(soc);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_psoc_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_start_param *req)
|
||||
{
|
||||
return p2p_psoc_start(soc, req);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_psoc_stop(struct wlan_objmgr_psoc *soc)
|
||||
{
|
||||
return p2p_psoc_stop(soc);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_roc_req *roc_req, uint64_t *cookie)
|
||||
{
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct p2p_roc_context *roc_ctx;
|
||||
QDF_STATUS status;
|
||||
int32_t id;
|
||||
|
||||
p2p_debug("soc:%pK, vdev_id:%d, chan:%d, phy_mode:%d, duration:%d",
|
||||
soc, roc_req->vdev_id, roc_req->chan,
|
||||
roc_req->phy_mode, roc_req->duration);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(soc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("P2P soc object is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
roc_ctx = qdf_mem_malloc(sizeof(*roc_ctx));
|
||||
if (!roc_ctx) {
|
||||
p2p_err("failed to allocate p2p roc context");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
status = qdf_idr_alloc(&p2p_soc_obj->p2p_idr, roc_ctx, &id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(roc_ctx);
|
||||
p2p_err("failed to alloc idr, status %d", status);
|
||||
return status;
|
||||
}
|
||||
|
||||
*cookie = (uint64_t)id;
|
||||
roc_ctx->p2p_soc_obj = p2p_soc_obj;
|
||||
roc_ctx->vdev_id = roc_req->vdev_id;
|
||||
roc_ctx->chan = roc_req->chan;
|
||||
roc_ctx->phy_mode = roc_req->phy_mode;
|
||||
roc_ctx->duration = roc_req->duration;
|
||||
roc_ctx->roc_state = ROC_STATE_IDLE;
|
||||
roc_ctx->roc_type = USER_REQUESTED;
|
||||
roc_ctx->id = id;
|
||||
msg.type = P2P_ROC_REQ;
|
||||
msg.bodyptr = roc_ctx;
|
||||
msg.callback = p2p_process_cmd;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_OS_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(roc_ctx);
|
||||
qdf_idr_remove(&p2p_soc_obj->p2p_idr, id);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
p2p_debug("cookie = 0x%llx", *cookie);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
|
||||
uint64_t cookie)
|
||||
{
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct cancel_roc_context *cancel_roc;
|
||||
void *roc_ctx = NULL;
|
||||
QDF_STATUS status;
|
||||
|
||||
p2p_debug("soc:%pK, cookie:0x%llx", soc, cookie);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(soc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc context is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
||||
cookie, &roc_ctx);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
p2p_err("invalid id");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
cancel_roc = qdf_mem_malloc(sizeof(*cancel_roc));
|
||||
if (!cancel_roc) {
|
||||
p2p_err("failed to allocate cancel p2p roc");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
cancel_roc->p2p_soc_obj = p2p_soc_obj;
|
||||
cancel_roc->cookie = (uintptr_t)roc_ctx;
|
||||
msg.type = P2P_CANCEL_ROC_REQ;
|
||||
msg.bodyptr = cancel_roc;
|
||||
msg.callback = p2p_process_cmd;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_OS_IF,
|
||||
&msg);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(cancel_roc);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
p2p_debug("vdev:%pK", vdev);
|
||||
|
||||
if (!vdev) {
|
||||
p2p_err("null vdev");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
p2p_err("null psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc context is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return p2p_cleanup_roc_sync(p2p_soc_obj, vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_cleanup_roc_by_psoc(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct p2p_soc_priv_obj *obj;
|
||||
|
||||
if (!psoc) {
|
||||
p2p_err("null psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_P2P);
|
||||
if (!obj) {
|
||||
p2p_err("null p2p soc obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return p2p_cleanup_roc_sync(obj, NULL);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_cleanup_tx_by_vdev(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct p2p_soc_priv_obj *obj;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
if (!vdev) {
|
||||
p2p_err("null vdev");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
p2p_err("null psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_P2P);
|
||||
if (!obj) {
|
||||
p2p_err("null p2p soc obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
p2p_del_all_rand_mac_vdev(vdev);
|
||||
|
||||
return p2p_cleanup_tx_sync(obj, vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_cleanup_tx_by_psoc(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct p2p_soc_priv_obj *obj;
|
||||
|
||||
if (!psoc) {
|
||||
p2p_err("null psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_P2P);
|
||||
if (!obj) {
|
||||
p2p_err("null p2p soc obj");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
p2p_del_all_rand_mac_soc(psoc);
|
||||
|
||||
return p2p_cleanup_tx_sync(obj, NULL);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie)
|
||||
{
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct tx_action_context *tx_action;
|
||||
QDF_STATUS status;
|
||||
int32_t id;
|
||||
|
||||
p2p_debug("soc:%pK, vdev_id:%d, chan:%d, wait:%d, buf_len:%d, cck:%d, no ack:%d, off chan:%d",
|
||||
soc, mgmt_frm->vdev_id, mgmt_frm->chan,
|
||||
mgmt_frm->wait, mgmt_frm->len, mgmt_frm->no_cck,
|
||||
mgmt_frm->dont_wait_for_ack, mgmt_frm->off_chan);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(soc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("P2P soc context is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
tx_action = qdf_mem_malloc(sizeof(*tx_action));
|
||||
if (!tx_action) {
|
||||
p2p_err("Failed to allocate tx action context");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
/* return cookie just for ota ack frames */
|
||||
if (mgmt_frm->dont_wait_for_ack)
|
||||
id = 0;
|
||||
else {
|
||||
status = qdf_idr_alloc(&p2p_soc_obj->p2p_idr,
|
||||
tx_action, &id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(tx_action);
|
||||
p2p_err("failed to alloc idr, status :%d", status);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
*cookie = (uint64_t)id;
|
||||
tx_action->p2p_soc_obj = p2p_soc_obj;
|
||||
tx_action->vdev_id = mgmt_frm->vdev_id;
|
||||
tx_action->chan = mgmt_frm->chan;
|
||||
tx_action->duration = mgmt_frm->wait;
|
||||
tx_action->buf_len = mgmt_frm->len;
|
||||
tx_action->no_cck = mgmt_frm->no_cck;
|
||||
tx_action->no_ack = mgmt_frm->dont_wait_for_ack;
|
||||
tx_action->off_chan = mgmt_frm->off_chan;
|
||||
tx_action->buf = qdf_mem_malloc(tx_action->buf_len);
|
||||
if (!(tx_action->buf)) {
|
||||
p2p_err("Failed to allocate buffer for action frame");
|
||||
qdf_mem_free(tx_action);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
qdf_mem_copy(tx_action->buf, mgmt_frm->buf, tx_action->buf_len);
|
||||
tx_action->nbuf = NULL;
|
||||
tx_action->id = id;
|
||||
|
||||
p2p_rand_mac_tx(tx_action);
|
||||
|
||||
msg.type = P2P_MGMT_TX;
|
||||
msg.bodyptr = tx_action;
|
||||
msg.callback = p2p_process_cmd;
|
||||
msg.flush_callback = p2p_msg_flush_callback;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_OS_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
if (id)
|
||||
qdf_idr_remove(&p2p_soc_obj->p2p_idr, id);
|
||||
qdf_mem_free(tx_action->buf);
|
||||
qdf_mem_free(tx_action);
|
||||
p2p_err("post msg fail:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
|
||||
struct wlan_objmgr_vdev *vdev, uint64_t cookie)
|
||||
{
|
||||
struct scheduler_msg msg = {0};
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
struct cancel_roc_context *cancel_tx;
|
||||
void *tx_ctx;
|
||||
QDF_STATUS status;
|
||||
|
||||
p2p_debug("soc:%pK, cookie:0x%llx", soc, cookie);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(soc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc context is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = qdf_idr_find(&p2p_soc_obj->p2p_idr,
|
||||
(int32_t)cookie, &tx_ctx);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
p2p_debug("invalid id");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
p2p_del_random_mac(soc, wlan_vdev_get_id(vdev), cookie, 20);
|
||||
|
||||
cancel_tx = qdf_mem_malloc(sizeof(*cancel_tx));
|
||||
if (!cancel_tx) {
|
||||
p2p_err("Failed to allocate cancel p2p roc");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
cancel_tx->p2p_soc_obj = p2p_soc_obj;
|
||||
cancel_tx->cookie = (uintptr_t)tx_ctx;
|
||||
msg.type = P2P_MGMT_TX_CANCEL;
|
||||
msg.bodyptr = cancel_tx;
|
||||
msg.callback = p2p_process_cmd;
|
||||
status = scheduler_post_message(QDF_MODULE_ID_HDD,
|
||||
QDF_MODULE_ID_P2P,
|
||||
QDF_MODULE_ID_OS_IF,
|
||||
&msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(cancel_tx);
|
||||
p2p_err("post msg fail: %d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool ucfg_p2p_check_random_mac(struct wlan_objmgr_psoc *soc, uint32_t vdev_id,
|
||||
uint8_t *random_mac_addr)
|
||||
{
|
||||
return p2p_check_random_mac(soc, vdev_id, random_mac_addr);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_ps_config *ps_config)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
uint16_t obj_id;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct p2p_ps_config go_ps_config;
|
||||
|
||||
p2p_debug("soc:%pK, vdev_id:%d, opp_ps:%d, ct_window:%d, count:%d, duration:%d, duration:%d, ps_selection:%d",
|
||||
soc, ps_config->vdev_id, ps_config->opp_ps,
|
||||
ps_config->ct_window, ps_config->count,
|
||||
ps_config->duration, ps_config->single_noa_duration,
|
||||
ps_config->ps_selection);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
for (obj_id = 0; obj_id < WLAN_UMAC_PSOC_MAX_VDEVS; obj_id++) {
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(soc, obj_id,
|
||||
WLAN_P2P_ID);
|
||||
if (vdev) {
|
||||
if (is_p2p_ps_allowed(vdev, WLAN_UMAC_COMP_P2P)) {
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_P2P_ID);
|
||||
break;
|
||||
}
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_P2P_ID);
|
||||
p2p_debug("skip p2p set ps vdev %d, NoA is disabled as legacy STA is connected to GO.",
|
||||
obj_id);
|
||||
}
|
||||
}
|
||||
if (obj_id >= WLAN_UMAC_PSOC_MAX_VDEVS) {
|
||||
p2p_debug("No GO found!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
go_ps_config = *ps_config;
|
||||
go_ps_config.vdev_id = obj_id;
|
||||
|
||||
p2p_ops = ucfg_p2p_psoc_get_tx_ops(soc);
|
||||
if (p2p_ops->set_ps) {
|
||||
status = p2p_ops->set_ps(soc, &go_ps_config);
|
||||
p2p_debug("p2p set ps vdev %d, status:%d", obj_id, status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
||||
QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_lo_start *p2p_lo_start)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_debug("soc:%pK, vdev_id:%d, ctl_flags:%d, freq:%d, period:%d, interval:%d, count:%d, dev_types_len:%d, probe_resp_len:%d, device_types:%pK, probe_resp_tmplt:%pK",
|
||||
soc, p2p_lo_start->vdev_id, p2p_lo_start->ctl_flags,
|
||||
p2p_lo_start->freq, p2p_lo_start->period,
|
||||
p2p_lo_start->interval, p2p_lo_start->count,
|
||||
p2p_lo_start->dev_types_len, p2p_lo_start->probe_resp_len,
|
||||
p2p_lo_start->device_types, p2p_lo_start->probe_resp_tmplt);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_ops = ucfg_p2p_psoc_get_tx_ops(soc);
|
||||
if (p2p_ops->lo_start) {
|
||||
status = p2p_ops->lo_start(soc, p2p_lo_start);
|
||||
p2p_debug("p2p lo start, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
p2p_debug("soc:%pK, vdev_id:%d", soc, vdev_id);
|
||||
|
||||
if (!soc) {
|
||||
p2p_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_ops = ucfg_p2p_psoc_get_tx_ops(soc);
|
||||
if (p2p_ops->lo_stop) {
|
||||
status = p2p_ops->lo_stop(soc, vdev_id);
|
||||
p2p_debug("p2p lo stop, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS ucfg_p2p_set_noa(struct wlan_objmgr_psoc *soc,
|
||||
uint32_t vdev_id, bool disable_noa)
|
||||
{
|
||||
struct wlan_lmac_if_p2p_tx_ops *p2p_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_INVAL;
|
||||
|
||||
p2p_ops = ucfg_p2p_psoc_get_tx_ops(soc);
|
||||
if (p2p_ops->set_noa) {
|
||||
status = p2p_ops->set_noa(soc, vdev_id, disable_noa);
|
||||
p2p_debug("p2p set noa, status:%d", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_register_callbacks(struct wlan_objmgr_psoc *soc,
|
||||
struct p2p_protocol_callbacks *cb_obj)
|
||||
{
|
||||
struct p2p_soc_priv_obj *p2p_soc_obj;
|
||||
|
||||
if (!soc || !cb_obj) {
|
||||
p2p_err("psoc %pM cb_obj %pM context passed is NULL", soc,
|
||||
cb_obj);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
p2p_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(soc,
|
||||
WLAN_UMAC_COMP_P2P);
|
||||
if (!p2p_soc_obj) {
|
||||
p2p_err("p2p soc private object is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
p2p_soc_obj->p2p_cb = *cb_obj;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_status_scan(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return p2p_status_scan(vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_status_connect(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return p2p_status_connect(vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_status_disconnect(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return p2p_status_disconnect(vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_status_start_bss(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return p2p_status_start_bss(vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (!vdev) {
|
||||
p2p_err("vdev is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return p2p_status_stop_bss(vdev);
|
||||
}
|
Reference in New Issue
Block a user