1 /* 2 * Copyright (c) 2016 The Linux Foundation. All rights reserved. 3 * 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #ifndef _WLAN_LMAC_IF_DEF_H_ 21 #define _WLAN_LMAC_IF_DEF_H_ 22 23 #include "qdf_status.h" 24 #include "wlan_objmgr_cmn.h" 25 26 /* Number of dev type: Direct attach and Offload */ 27 #define MAX_DEV_TYPE 2 28 29 30 /** 31 * struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function 32 * pointers for mgmt txrx component 33 * @mgmt_tx_send: function pointer to transmit mgmt tx frame 34 * @beacon_send: function pointer to transmit beacon frame 35 */ 36 struct wlan_lmac_if_mgmt_txrx_tx_ops { 37 QDF_STATUS (*mgmt_tx_send)(struct wlan_objmgr_vdev *vdev, 38 qdf_nbuf_t nbuf, u_int32_t desc_id, 39 void *mgmt_tx_params); 40 QDF_STATUS (*beacon_send)(struct wlan_objmgr_vdev *vdev, 41 qdf_nbuf_t nbuf); 42 }; 43 44 /** 45 * struct wlan_lmac_if_tx_ops - south bound tx function pointers 46 * @arg1 47 * @arg2 48 * 49 * Callback function tabled to be registered with umac. 50 * umac will use the functional table to send events/frames to lmac/wmi 51 */ 52 53 struct wlan_lmac_if_tx_ops { 54 /* Components to declare function pointers required by the module 55 * in component specific structure. 56 * Ex : scan module 57 * struct wlan_lmac_if_scan_tx_ops scan_tx_ops; 58 * The component specific ops structure can be declared in this file 59 * only 60 * struct wlan_lmac_if_scan_tx_ops { 61 * int (*fp1)(); 62 * void (*fp2)(); 63 * } 64 */ 65 struct wlan_lmac_if_mgmt_txrx_tx_ops mgmt_txrx_tx_ops; 66 }; 67 68 /** 69 * struct wlan_lmac_if_mgmt_txrx_rx_ops - structure of rx function 70 * pointers for mgmt txrx component 71 * @mgmt_tx_completion_handler: function pointer to give tx completions 72 * to mgmt txrx comp. 73 * @mgmt_rx_frame_handler: function pointer to give rx frame to mgmt txrx comp. 74 * @mgmt_txrx_get_nbuf_from_desc_id: function pointer to get nbuf from desc id 75 * @mgmt_txrx_get_peer_from_desc_id: function pointer to get peer from desc id 76 * @mgmt_txrx_get_vdev_id_from_desc_id: function pointer to get vdev id from 77 * desc id 78 */ 79 struct wlan_lmac_if_mgmt_txrx_rx_ops { 80 QDF_STATUS (*mgmt_tx_completion_handler)( 81 struct wlan_objmgr_psoc *psoc, 82 uint32_t desc_id, uint32_t status, 83 void *tx_compl_params); 84 QDF_STATUS (*mgmt_rx_frame_handler)( 85 struct wlan_objmgr_psoc *psoc, 86 qdf_nbuf_t buf, void *params); 87 qdf_nbuf_t (*mgmt_txrx_get_nbuf_from_desc_id)( 88 struct wlan_objmgr_psoc *psoc, 89 uint32_t desc_id); 90 struct wlan_objmgr_peer * (*mgmt_txrx_get_peer_from_desc_id)( 91 struct wlan_objmgr_psoc *psoc, uint32_t desc_id); 92 uint8_t (*mgmt_txrx_get_vdev_id_from_desc_id)( 93 struct wlan_objmgr_psoc *psoc, 94 uint32_t desc_id); 95 }; 96 97 /** 98 * struct wlan_lmac_if_rx_ops - south bound rx function pointers 99 * @arg1 100 * @arg2 101 * 102 * Callback function tabled to be registered with lmac/wmi. 103 * lmac will use the functional table to send events/frames to umac 104 */ 105 struct wlan_lmac_if_rx_ops { 106 /* Components to declare function pointers required by the module 107 * in component specific structure. 108 * Ex : scan module 109 * struct wlan_lmac_if_scan_rx_ops scan_rx_ops; 110 * The component specific ops structure can be declared in this file 111 * only 112 * struct wlan_lmac_if_scan_rx_ops { 113 * int (*fp1)(); 114 * void (*fp2)(); 115 * } 116 */ 117 struct wlan_lmac_if_mgmt_txrx_rx_ops mgmt_txrx_rx_ops; 118 }; 119 120 #endif /* _WLAN_LMAC_IF_DEF_H_ */ 121