qcacmn: Defines os and target interfaces

Defines API and callbacks of os interface for P2P component. At the
same time, defines API of target interface.

Change-Id: Ice1c86ecba1f2410d965d9f84923589f229a1864
CRs-Fixed: 2013763
This commit is contained in:
Wu Gao
2017-03-15 19:12:20 +08:00
committed by Sandeep Puligilla
parent 86637ce966
commit 396518b08f
11 changed files with 1078 additions and 1 deletions

View File

@@ -166,6 +166,7 @@ typedef void (*wlan_objmgr_peer_status_handler)(
* @WLAN_LEGACY_SME_ID: Legacy SME operations
* @WLAN_SCAN_ID: scan operations
* @WLAN_DFS_ID: DFS operations
* @WLAN_P2P_ID: P2P operations
* @WLAN_REF_ID_MAX: Max id used to generate ref count tracking array
*/
typedef enum {
@@ -184,6 +185,7 @@ typedef enum {
WLAN_SCAN_ID = 12,
WLAN_WIFI_POS_ID = 13,
WLAN_DFS_ID = 14,
WLAN_P2P_ID = 15,
WLAN_REF_ID_MAX,
} wlan_objmgr_ref_dbgid;

View File

@@ -41,4 +41,12 @@ uint32_t wlan_chan_to_freq(uint8_t chan);
*/
bool wlan_is_dsrc_channel(uint16_t center_freq);
/**
* wlan_freq_to_chan() - converts frequency to channel
* @freq: frequency
*
* Return: channel of frequency
*/
uint8_t wlan_freq_to_chan(uint32_t freq);
#endif /* _WLAN_UTILITY_H_ */

View File

@@ -48,3 +48,24 @@ bool wlan_is_dsrc_channel(uint16_t center_freq)
return false;
}
uint8_t wlan_freq_to_chan(uint32_t freq)
{
uint8_t chan;
if (freq > WLAN_24_GHZ_BASE_FREQ && freq < WLAN_CHAN_14_FREQ)
chan = ((freq - WLAN_24_GHZ_BASE_FREQ) /
WLAN_CHAN_SPACING_5MHZ);
else if (freq == WLAN_CHAN_14_FREQ)
chan = WLAN_24_GHZ_CHANNEL_14;
else if ((freq > WLAN_24_GHZ_BASE_FREQ) &&
(freq < WLAN_5_GHZ_BASE_FREQ))
chan = (((freq - WLAN_CHAN_15_FREQ) /
WLAN_CHAN_SPACING_20MHZ) +
WLAN_24_GHZ_CHANNEL_15);
else
chan = (freq - WLAN_5_GHZ_BASE_FREQ) /
WLAN_CHAN_SPACING_5MHZ;
return chan;
}

View File

@@ -200,6 +200,41 @@ struct wlan_lmac_if_pmo_tx_ops {
};
#endif
#ifdef WLAN_P2P_ENABLE
/* forward declarations for p2p tx ops */
struct p2p_ps_config;
struct p2p_lo_start;
/**
* struct wlan_lmac_if_p2p_tx_ops - structure of tx function pointers
* for P2P component
* @set_ps: function pointer to set power save
* @lo_start: function pointer to start listen offload
* @lo_stop: function pointer to stop listen offload
* @reg_lo_ev_handler: function pointer to register lo event handler
* @reg_noa_ev_handler: function pointer to register noa event handler
* @unreg_lo_ev_handler: function pointer to unregister lo event handler
* @unreg_noa_ev_handler:function pointer to unregister noa event handler
*/
struct wlan_lmac_if_p2p_tx_ops {
QDF_STATUS (*set_ps)(struct wlan_objmgr_psoc *psoc,
struct p2p_ps_config *ps_config);
QDF_STATUS (*lo_start)(struct wlan_objmgr_psoc *psoc,
struct p2p_lo_start *lo_start);
QDF_STATUS (*lo_stop)(struct wlan_objmgr_psoc *psoc,
uint32_t vdev_id);
QDF_STATUS (*reg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
QDF_STATUS (*reg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
QDF_STATUS (*unreg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
QDF_STATUS (*unreg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
};
#endif
/**
* struct wlan_lmac_if_tx_ops - south bound tx function pointers
* @mgmt_txrx_tx_ops: mgmt txrx tx ops
@@ -221,6 +256,9 @@ struct wlan_lmac_if_tx_ops {
#ifdef WLAN_PMO_ENABLE
struct wlan_lmac_if_pmo_tx_ops pmo_tx_ops;
#endif
#ifdef WLAN_P2P_ENABLE
struct wlan_lmac_if_p2p_tx_ops p2p;
#endif
};
/**
@@ -273,6 +311,26 @@ struct wlan_lmac_if_pmo_rx_ops {
};
#endif
#ifdef WLAN_P2P_ENABLE
/* forward declarations for p2p rx ops */
struct p2p_noa_info;
struct p2p_lo_event;
/**
* struct wlan_lmac_if_p2p_rx_ops - structure of rx function pointers
* for P2P component
* @lo_ev_handler: function pointer to give listen offload event
* @noa_ev_handler: function pointer to give noa event
*/
struct wlan_lmac_if_p2p_rx_ops {
QDF_STATUS (*lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
struct p2p_lo_event *event_info);
QDF_STATUS (*noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
struct p2p_noa_info *event_info);
};
#endif
/**
* struct wlan_lmac_if_rx_ops - south bound rx function pointers
* @arg1
@@ -292,6 +350,9 @@ struct wlan_lmac_if_rx_ops {
#ifdef WLAN_PMO_ENABLE
struct wlan_lmac_if_pmo_rx_ops pmo_rx_ops;
#endif
#ifdef WLAN_P2P_ENABLE
struct wlan_lmac_if_p2p_rx_ops p2p;
#endif
};
/* Function pointer to call legacy tx_ops registration in OL/WMA.