qcacmn: Add tlv implementation of common unified API

Add common unified API and tlv/non-tlv callback wrappers.
Add tlv implementation of common MCL/WIN API.

CRs-Fixed: 978603
Change-Id: I7e70b48ef5e1df0c0f81c639579e6eb1a6685dc3
This commit is contained in:
Govind Singh
2016-03-09 11:34:12 +05:30
parent 6ad6adac26
commit 3ddda1ff37
5 changed files with 1025 additions and 6 deletions

View File

@@ -38,6 +38,7 @@
#include "ol_defines.h"
#include "wmi.h"
#include "htc_api.h"
#include "wmi_unified_param.h"
typedef cdf_nbuf_t wmi_buf_t;
#define wmi_buf_data(_buf) cdf_nbuf_data(_buf)
@@ -49,7 +50,7 @@ typedef cdf_nbuf_t wmi_buf_t;
* @ready_cbk: ready calback
* @wma_process_fw_event_handler_cbk: generic event handler callback
*/
struct wmi_ops {
struct wmi_rx_ops {
void (*service_ready_cbk)(void *ctx, void *ev);
void (*service_ready_ext_cbk)(void *ctx, void *ev);
void (*ready_cbk)(void *ctx, void *ev);
@@ -76,7 +77,7 @@ enum wmi_target_type {
*/
void *wmi_unified_attach(void *scn_handle,
osdev_t osdev, enum wmi_target_type target_type,
bool use_cookie, struct wmi_ops *ops);
bool use_cookie, struct wmi_rx_ops *ops);
/**
* detach for unified WMI
@@ -202,4 +203,117 @@ static inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
*/
void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf);
uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle);
int32_t wmi_unified_vdev_create_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_create_params *param);
int32_t wmi_unified_vdev_delete_send(void *wmi_hdl,
uint8_t if_id);
int32_t wmi_unified_vdev_start_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_start_params *param);
int32_t wmi_unified_vdev_restart_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_start_params *param);
int32_t wmi_unified_vdev_stop_send(void *wmi_hdl,
uint8_t vdev_id);
int32_t wmi_unified_vdev_up_send(void *wmi_hdl,
uint8_t bssid[IEEE80211_ADDR_LEN],
struct vdev_up_params *params);
int32_t wmi_unified_vdev_down_send(void *wmi_hdl,
uint8_t vdev_id);
int32_t wmi_unified_vdev_set_param_send(void *wmi_hdl,
struct vdev_set_params *param);
int32_t wmi_unified_peer_delete_send(void *wmi_hdl,
uint8_t
peer_addr[IEEE80211_ADDR_LEN],
uint8_t vdev_id);
int32_t wmi_unified_peer_flush_tids_send(void *wmi_hdl,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_flush_params *param);
int32_t wmi_set_peer_param_send(void *wmi_hdl,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_set_params *param);
int32_t wmi_unified_peer_create_send(void *wmi_hdl,
struct peer_create_params *param);
int32_t wmi_unified_stats_request_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct stats_request_params *param);
int32_t wmi_unified_green_ap_ps_send(void *wmi_hdl,
uint32_t value, uint8_t mac_id);
int32_t wmi_unified_wow_enable_send(void *wmi_hdl,
struct wow_cmd_params *param,
uint8_t mac_id);
int32_t wmi_unified_packet_log_enable_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct packet_enable_params *param);
int32_t wmi_unified_suspend_send(void *wmi_hdl,
struct suspend_params *param,
uint8_t mac_id);
int32_t wmi_unified_resume_send(void *wmi_hdl,
uint8_t mac_id);
int32_t
wmi_unified_pdev_param_send(void *wmi_hdl,
struct pdev_params *param,
uint8_t mac_id);
int32_t wmi_unified_beacon_send_cmd(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct beacon_params *param);
int32_t wmi_unified_peer_assoc_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct peer_assoc_params *param);
int32_t wmi_unified_sta_ps_cmd_send(void *wmi_hdl,
struct sta_ps_params *param);
int32_t wmi_unified_ap_ps_cmd_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct ap_ps_params *param);
int32_t wmi_unified_scan_start_cmd_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_start_params *param);
int32_t wmi_unified_scan_stop_cmd_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_stop_params *param);
int32_t wmi_unified_scan_chan_list_cmd_send(void *wmi_hdl,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_chan_list_params *param);
int32_t wmi_crash_inject(void *wmi_hdl,
struct crash_inject *param);
int32_t wmi_unified_pdev_utf_cmd_send(void *wmi_hdl,
struct pdev_utf_params *param,
uint8_t mac_id);
int32_t wmi_unified_dbglog_cmd_send(void *wmi_hdl,
struct dbglog_params *param);
#endif /* _WMI_UNIFIED_API_H_ */

134
wmi_unified_non_tlv.h Normal file
View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#include <osdep.h>
#include "a_types.h"
#include "wmi_unified_param.h"
#include "ol_defines.h" /* Fix Me: wmi_unified_t structure definition */
int32_t send_vdev_create_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_create_params *param);
int32_t send_vdev_delete_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t if_id);
int32_t send_vdev_stop_cmd_non_tlv(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t send_vdev_down_cmd_non_tlv(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t send_peer_flush_tids_cmd_non_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_flush_params *param);
int32_t send_peer_delete_cmd_non_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
uint8_t vdev_id);
int32_t send_peer_param_cmd_non_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_set_params *param);
int32_t send_vdev_up_cmd_non_tlv(wmi_unified_t wmi,
uint8_t bssid[IEEE80211_ADDR_LEN],
struct vdev_up_params *params);
int32_t send_peer_create_cmd_non_tlv(wmi_unified_t wmi,
struct peer_create_params *param);
int32_t send_green_ap_ps_cmd_non_tlv(wmi_unified_t wmi_handle,
uint32_t value, uint8_t mac_id);
int32_t
send_pdev_utf_cmd_non_tlv(wmi_unified_t wmi_handle,
struct pdev_utf_params *param,
uint8_t mac_id);
int32_t
send_pdev_param_cmd_non_tlv(wmi_unified_t wmi_handle,
struct pdev_params *param,
uint8_t mac_id);
int32_t send_suspend_cmd_non_tlv(wmi_unified_t wmi_handle,
struct suspend_params *param,
uint8_t mac_id);
int32_t send_resume_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t mac_id);
int32_t send_wow_enable_cmd_non_tlv(wmi_unified_t wmi_handle,
struct wow_cmd_params *param,
uint8_t mac_id);
int32_t send_set_ap_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t *peer_addr,
struct ap_ps_params *param);
int32_t send_set_sta_ps_param_cmd_non_tlv(wmi_unified_t wmi_handle,
struct sta_ps_params *param);
int32_t send_crash_inject_cmd_non_tlv(wmi_unified_t wmi_handle,
struct crash_inject *param);
int32_t
send_dbglog_cmd_non_tlv(wmi_unified_t wmi_handle,
struct dbglog_params *dbglog_param);
int32_t send_vdev_set_param_cmd_non_tlv(wmi_unified_t wmi_handle,
struct vdev_set_params *param);
int32_t send_stats_request_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct stats_request_params *param);
int32_t send_packet_log_enable_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct packet_enable_params *param);
int32_t send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct beacon_params *param);
int32_t send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct peer_assoc_params *param);
int32_t send_scan_start_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_start_params *param);
int32_t send_scan_stop_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_stop_params *param);
int32_t send_scan_chan_list_cmd_non_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_chan_list_params *param);

532
wmi_unified_param.h Normal file
View File

@@ -0,0 +1,532 @@
/*
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
/*
* This file contains the API definitions for the Unified Wireless Module
* Interface (WMI).
*/
#ifndef _WMI_UNIFIED_PARAM_H_
#define _WMI_UNIFIED_PARAM_H_
#include "wmi_unified.h"
#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
#define MAX_UTF_EVENT_LENGTH 2048
#define WMI_MAC_MAX_SSID_LENGTH 32
#define WMI_SCAN_MAX_NUM_SSID 0x0A
#define mgmt_tx_dl_frm_len 64
#define WMI_SMPS_MASK_LOWER_16BITS 0xFF
#define WMI_SMPS_MASK_UPPER_3BITS 0x7
#define WMI_SMPS_PARAM_VALUE_S 29
#define MAX_WMI_UTF_LEN 252
/**
* struct vdev_create_params - vdev create cmd parameter
* @if_id: interface id
* @type: interface type
* @subtype: interface subtype
*/
struct vdev_create_params {
uint8_t if_id;
uint32_t type;
uint32_t subtype;
};
/**
* struct vdev_delete_params - vdev delete cmd parameter
* @if_id: interface id
*/
struct vdev_delete_params {
uint8_t if_id;
};
/**
* struct vdev_start_params - vdev start cmd parameter
* @beacon_intval: beacon intval
* @dtim_period: dtim period
* @max_txpow: max tx power
* @phy_ch_width chan_width: channel width
* @is_dfs: flag to check if dfs enabled
* @vdev_id: vdev id
* @chan: channel no
* @oper_mode: operating mode
* @length: length
* @ssId[32]: ssid
* @hidden_ssid: hidden ssid
* @pmf_enabled: is pmf enabled
* @vht_capable: is vht capable
* @ch_center_freq_seg0: center freq seq 0
* @ch_center_freq_seg1: center freq seq 1
* @ht_capable: is ht capable
* @dfs_pri_multiplier: DFS multiplier
* @dot11_mode: dot11 mode
* @is_half_rate: Indicates half rate channel
* @is_quarter_rate: Indicates quarter rate channel
* @preferred_tx_streams: preferred tx streams
* @preferred_rx_streams: preferred rx streams
*/
struct vdev_start_params {
uint32_t beacon_intval;
uint32_t dtim_period;
int32_t max_txpow;
bool is_dfs;
uint8_t vdev_id;
uint8_t chan;
uint8_t oper_mode;
uint8_t length;
uint8_t ssId[32];
uint8_t hidden_ssid;
uint8_t pmf_enabled;
uint8_t vht_capable;
uint8_t ch_center_freq_seg0;
uint8_t ch_center_freq_seg1;
uint8_t ht_capable;
int32_t dfs_pri_multiplier;
uint8_t dot11_mode;
bool is_half_rate;
bool is_quarter_rate;
uint32_t preferred_tx_streams;
uint32_t preferred_rx_streams;
};
/**
* struct vdev_stop_params - vdev stop cmd parameter
* @vdev_id: vdev id
*/
struct vdev_stop_params {
uint8_t vdev_id;
};
/**
* struct vdev_up_params - vdev up cmd parameter
* @vdev_id: vdev id
* @assoc_id: association id
*/
struct vdev_up_params {
uint8_t vdev_id;
uint16_t assoc_id;
};
/**
* struct vdev_down_params - vdev down cmd parameter
* @vdev_id: vdev id
*/
struct vdev_down_params {
uint8_t vdev_id;
};
/**
* struct vdev_set_params - vdev set cmd parameter
* @if_id: vdev id
* @param_id: parameter id
* @param_value: parameter value
*/
struct vdev_set_params {
uint32_t if_id;
uint32_t param_id;
uint32_t param_value;
};
/**
* struct peer_delete_params - peer delete cmd parameter
* @vdev_id: vdev id
*/
struct peer_delete_params {
uint8_t vdev_id;
};
/**
* struct peer_flush_params - peer flush cmd parameter
* @peer_tid_bitmap: peer tid bitmap
* @vdev_id: vdev id
*/
struct peer_flush_params {
uint32_t peer_tid_bitmap;
uint8_t vdev_id;
};
/**
* struct peer_set_params - peer set cmd parameter
* @param_id: parameter id
* @param_value: parameter value
* @vdev_id: vdev id
*/
struct peer_set_params {
uint32_t param_id;
uint32_t param_value;
uint32_t vdev_id;
};
/**
* struct peer_create_params - peer create cmd parameter
* @peer_addr: peer mac addr
* @peer_type: peer type
* @vdev_id: vdev id
*/
struct peer_create_params {
const uint8_t *peer_addr;
uint32_t peer_type;
uint32_t vdev_id;
};
/**
* struct peer_remove_params - peer remove cmd parameter
* @bssid: bss id
* @vdev_id: vdev id
* @roam_synch_in_progress: flag to indicate if roaming is in progress
*/
struct peer_remove_params {
uint8_t *bssid;
uint8_t vdev_id;
bool roam_synch_in_progress;
};
/**
* struct stats_request_params - stats_request cmd parameter
* @stats_id: statistics id
* @vdev_id: vdev id
*/
struct stats_request_params {
uint32_t stats_id;
uint32_t vdev_id;
};
/**
* struct green_ap_ps_params - green ap ps cmd parameter
* @value: parameter value
*/
struct green_ap_ps_params {
uint32_t value;
};
/**
* struct wow_cmd_params - wow cmd parameter
* @enable: wow enable or disable flag
* @can_suspend_link: flag to indicate if link can be suspended
* @pause_iface_config: interface config
*/
struct wow_cmd_params {
bool enable;
bool can_suspend_link;
uint8_t pause_iface_config;
};
/**
* struct packet_enable_params - packet enable cmd parameter
* @vdev_id: vdev id
* @enable: flag to indicate if parameter can be enabled or disabled
*/
struct packet_enable_params {
uint8_t vdev_id;
bool enable;
};
/**
* struct suspend_params - suspend cmd parameter
* @disable_target_intr: disable target interrupt
*/
struct suspend_params {
uint8_t disable_target_intr;
};
/**
* struct pdev_params - pdev set cmd parameter
* @param_id: parameter id
* @param_value: parameter value
*/
struct pdev_params {
uint32_t param_id;
uint32_t param_value;
};
/**
* struct beacon_params - beacon template cmd parameter
* @vdev_id: vdev id
* @tim_ie_offset: tim ie offset
* @tmpl_len: beacon template length
* @tmpl_len_aligned: beacon template alignment
* @frm: beacon template parameter
*/
struct beacon_params {
uint8_t vdev_id;
uint32_t tim_ie_offset;
uint32_t tmpl_len;
uint32_t tmpl_len_aligned;
uint8_t *frm;
};
/**
* struct peer_assoc_params - peer assoc cmd parameter
* @peer_macaddr: peer mac address
* @vdev_id: vdev id
* @peer_new_assoc: peer association type
* @peer_associd: peer association id
* @peer_flags: peer flags
* @peer_caps: peer capabalities
* @peer_listen_intval: peer listen interval
* @peer_ht_caps: HT capabalities
* @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
* @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
* @peer_rate_caps: peer rate capabalities
* @peer_nss: peer nss
* @peer_phymode: peer phymode
* @peer_ht_info: peer HT info
* @peer_legacy_rates: peer legacy rates
* @peer_ht_rates: peer ht rates
* @num_peer_legacy_rates: no of peer legacy rates
* @num_peer_ht_rates: no of peer ht rates
* @rx_max_rate: max rx rates
* @rx_mcs_set: rx mcs
* @tx_max_rate: max tx rates
* @tx_mcs_set: tx mcs
* @vht_capable: VHT capabalities
*/
struct peer_assoc_params {
wmi_mac_addr peer_macaddr;
uint32_t vdev_id;
uint32_t peer_new_assoc;
uint32_t peer_associd;
uint32_t peer_flags;
uint32_t peer_caps;
uint32_t peer_listen_intval;
uint32_t peer_ht_caps;
uint32_t peer_max_mpdu;
uint32_t peer_mpdu_density;
uint32_t peer_rate_caps;
uint32_t peer_nss;
uint32_t peer_vht_caps;
uint32_t peer_phymode;
uint32_t peer_ht_info[2];
wmi_rate_set peer_legacy_rates;
wmi_rate_set peer_ht_rates;
uint32_t num_peer_legacy_rates;
uint32_t num_peer_ht_rates;
uint32_t rx_max_rate;
uint32_t rx_mcs_set;
uint32_t tx_max_rate;
uint32_t tx_mcs_set;
uint8_t vht_capable;
};
/**
* struct sta_ps_params - sta ps cmd parameter
* @vdev_id: vdev id
* @param: sta ps paramter
* @value: sta ps parameter value
*/
struct sta_ps_params {
uint32_t vdev_id;
uint32_t param;
uint32_t value;
};
/**
* struct ap_ps_params - ap ps cmd parameter
* @vdev_id: vdev id
* @param: ap ps paramter
* @value: ap ps paramter value
*/
struct ap_ps_params {
uint32_t vdev_id;
uint32_t param;
uint32_t value;
};
/**
* struct mac_ssid - mac ssid structure
* @length:
* @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
*/
struct mac_ssid {
uint8_t length;
uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
} cdf_packed;
/**
* struct scan_start_params - start scan cmd parameter
* @scan_id: scan id
* @scan_req_id: requeted scan id
* @vdev_id: vdev id
* @scan_priority: scan priority
* @notify_scan_events: flag to indicate if scan to be notified
* @dwell_time_active: active dwell time
* @dwell_time_passive: passive dwell time
* @min_rest_time: min rest time
* @max_rest_time: max rest time
* @repeat_probe_time: repeat probe time
* @probe_spacing_time: probe spacing time
* @idle_time: idle time
* @max_scan_time: max scan time
* @probe_delay: probe delay
* @scan_ctrl_flags: scan control flag
* @burst_duration: burst duration
* @num_chan: no of channel
* @num_bssid: no of bssid
* @num_ssids: no of ssid
* @ie_len: ie length
* @n_probes: no of probe
* @chan_list: channel list
* @ie_len_with_pad: ie length with padding
* @num_ssid: no of ssid
* @sid: pointer to mac_ssid structure
* @uie_fieldOffset: ie field offset
* @mac_add_bytes: mac address bytes
*/
struct scan_start_params {
uint32_t scan_id;
uint32_t scan_req_id;
uint32_t vdev_id;
uint32_t scan_priority;
uint32_t notify_scan_events;
uint32_t dwell_time_active;
uint32_t dwell_time_passive;
uint32_t min_rest_time;
uint32_t max_rest_time;
uint32_t repeat_probe_time;
uint32_t probe_spacing_time;
uint32_t idle_time;
uint32_t max_scan_time;
uint32_t probe_delay;
uint32_t scan_ctrl_flags;
uint32_t burst_duration;
uint32_t num_chan;
uint32_t num_bssid;
uint32_t num_ssids;
uint32_t ie_len;
uint32_t n_probes;
uint32_t *chan_list;
uint32_t ie_len_with_pad;
struct mac_ssid ssid[WMI_SCAN_MAX_NUM_SSID];
uint8_t *ie_base;
uint16_t uie_fieldOffset;
uint8_t mac_add_bytes[IEEE80211_ADDR_LEN];
};
/**
* struct scan_stop_params - stop scan cmd parameter
* @requestor: scan requestor
* @scan_id: scan id
* @req_type: scan request type
* @vdev_id: vdev id
*/
struct scan_stop_params {
uint32_t requestor;
uint32_t scan_id;
uint32_t req_type;
uint32_t vdev_id;
};
/**
* struct scan_chan_list_params - scan channel list cmd parameter
* @num_scan_chans: no of scan channels
* @chan_info: pointer to wmi channel info
*/
struct scan_chan_list_params {
uint8_t num_scan_chans;
wmi_channel *chan_info;
};
/**
* struct fw_hang_params - fw hang command parameters
* @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
* @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
*/
struct fw_hang_params {
uint32_t type;
uint32_t delay_time_ms;
};
/**
* struct pdev_utf_params - pdev utf command parameters
* @utf_payload:
* @len:
*/
struct pdev_utf_params {
uint8_t *utf_payload;
uint32_t len;
};
/**
* struct crash_inject - crash inject command parameters
* @type: crash inject type
* @delay_time_ms: time in milliseconds for FW to delay the crash
*/
struct crash_inject {
uint32_t type;
uint32_t delay_time_ms;
};
/**
* struct dbglog_params - fw deboglog command parameters
* @param: command parameter
* @val: parameter value
* @module_id_bitmap: fixed length module id bitmap
* @bitmap_len: module id bitmap length
*/
struct dbglog_params {
uint32_t param;
uint32_t val;
uint32_t *module_id_bitmap;
uint32_t bitmap_len;
};
/**
* struct seg_hdr_info - header info
* @len: length
* @msgref: message refrence
* @segmentInfo: segment info
* @pad: padding
*/
struct seg_hdr_info {
uint32_t len;
uint32_t msgref;
uint32_t segmentInfo;
uint32_t pad;
};
/**
* struct wmi_mgmt_params - wmi mgmt cmd paramters
* @tx_frame: management tx frame
* @frmLen: frame length
* @vdev_id: vdev id
* @tx_complete_cb: tx download callback handler
* @tx_ota_post_proc_cb: OTA complition handler
* @chanfreq: channel frequency
* @pdata: frame data
* @wmi_desc: command descriptor
*/
struct wmi_mgmt_params {
void *tx_frame;
uint16_t frm_len;
uint8_t vdev_id;
void *tx_complete_cb;
void *tx_ota_post_proc_cb;
uint16_t chanfreq;
void *pdata;
struct wmi_desc_t *wmi_desc;
void *cdf_ctx;
};
#endif /* _WMI_UNIFIED_PARAM_H_ */

View File

@@ -26,7 +26,8 @@
*/
/*
* This file contains the API definitions for the Unified Wireless Module Interface (WMI).
* This file contains the API definitions for the Unified Wireless
* Module Interface (WMI).
*/
#ifndef _WMI_UNIFIED_PRIV_H_
#define _WMI_UNIFIED_PRIV_H_
@@ -67,6 +68,109 @@ struct fwdebug {
};
#endif /* WLAN_OPEN_SOURCE */
struct wmi_ops {
int32_t (*send_vdev_create_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_create_params *param);
int32_t (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle,
uint8_t if_id);
int32_t (*send_vdev_stop_cmd)(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t (*send_vdev_down_cmd)(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t (*send_peer_flush_tids_cmd)(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_flush_params *param);
int32_t (*send_peer_delete_cmd)(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
uint8_t vdev_id);
int32_t (*send_peer_param_cmd)(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_set_params *param);
int32_t (*send_vdev_up_cmd)(wmi_unified_t wmi,
uint8_t bssid[IEEE80211_ADDR_LEN],
struct vdev_up_params *params);
int32_t (*send_peer_create_cmd)(wmi_unified_t wmi,
struct peer_create_params *param);
int32_t (*send_green_ap_ps_cmd)(wmi_unified_t wmi_handle,
uint32_t value, uint8_t mac_id);
int32_t
(*send_pdev_utf_cmd)(wmi_unified_t wmi_handle,
struct pdev_utf_params *param,
uint8_t mac_id);
int32_t
(*send_pdev_param_cmd)(wmi_unified_t wmi_handle,
struct pdev_params *param,
uint8_t mac_id);
int32_t (*send_suspend_cmd)(wmi_unified_t wmi_handle,
struct suspend_params *param,
uint8_t mac_id);
int32_t (*send_resume_cmd)(wmi_unified_t wmi_handle,
uint8_t mac_id);
int32_t (*send_wow_enable_cmd)(wmi_unified_t wmi_handle,
struct wow_cmd_params *param,
uint8_t mac_id);
int32_t (*send_set_ap_ps_param_cmd)(wmi_unified_t wmi_handle,
uint8_t *peer_addr,
struct ap_ps_params *param);
int32_t (*send_set_sta_ps_param_cmd)(wmi_unified_t wmi_handle,
struct sta_ps_params *param);
int32_t (*send_crash_inject_cmd)(wmi_unified_t wmi_handle,
struct crash_inject *param);
int32_t
(*send_dbglog_cmd)(wmi_unified_t wmi_handle,
struct dbglog_params *dbglog_param);
int32_t (*send_vdev_set_param_cmd)(wmi_unified_t wmi_handle,
struct vdev_set_params *param);
int32_t (*send_stats_request_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct stats_request_params *param);
int32_t (*send_packet_log_enable_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct packet_enable_params *param);
int32_t (*send_beacon_send_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct beacon_params *param);
int32_t (*send_peer_assoc_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct peer_assoc_params *param);
int32_t (*send_scan_start_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_start_params *param);
int32_t (*send_scan_stop_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_stop_params *param);
int32_t (*send_scan_chan_list_cmd)(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_chan_list_params *param);
};
struct wmi_unified {
ol_scn_t scn_handle; /* handle to device */
osdev_t osdev; /* handle to use OS-independent services */
@@ -96,10 +200,11 @@ struct wmi_unified {
cdf_atomic_t runtime_pm_inprogress;
#endif
int (*wma_process_fw_event_handler_cbk)(struct wmi_unified *wmi_handle,
wmi_buf_t evt_buf);
struct wmi_ops ops;
struct wmi_rx_ops rx_ops;
struct wmi_ops *ops;
void *event_handler_cookie[WMI_UNIFIED_MAX_EVENT];
bool use_cookie;
};
struct wmi_ops *wmi_get_tlv_ops(void);
struct wmi_ops *wmi_get_non_tlv_ops(void);
#endif

134
wmi_unified_tlv.h Normal file
View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* 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.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#include <osdep.h>
#include "a_types.h"
#include "wmi_unified_param.h"
#include "ol_defines.h" /* Fix Me: wmi_unified_t structure definition */
int32_t send_vdev_create_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct vdev_create_params *param);
int32_t send_vdev_delete_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t if_id);
int32_t send_vdev_stop_cmd_tlv(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t send_vdev_down_cmd_tlv(wmi_unified_t wmi,
uint8_t vdev_id);
int32_t send_peer_flush_tids_cmd_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_flush_params *param);
int32_t send_peer_delete_cmd_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
uint8_t vdev_id);
int32_t send_peer_param_cmd_tlv(wmi_unified_t wmi,
uint8_t peer_addr[IEEE80211_ADDR_LEN],
struct peer_set_params *param);
int32_t send_vdev_up_cmd_tlv(wmi_unified_t wmi,
uint8_t bssid[IEEE80211_ADDR_LEN],
struct vdev_up_params *params);
int32_t send_peer_create_cmd_tlv(wmi_unified_t wmi,
struct peer_create_params *param);
int32_t send_green_ap_ps_cmd_tlv(wmi_unified_t wmi_handle,
uint32_t value, uint8_t mac_id);
int32_t
send_pdev_utf_cmd_tlv(wmi_unified_t wmi_handle,
struct pdev_utf_params *param,
uint8_t mac_id);
int32_t
send_pdev_param_cmd_tlv(wmi_unified_t wmi_handle,
struct pdev_params *param,
uint8_t mac_id);
int32_t send_suspend_cmd_tlv(wmi_unified_t wmi_handle,
struct suspend_params *param,
uint8_t mac_id);
int32_t send_resume_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t mac_id);
int32_t send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle,
struct wow_cmd_params *param,
uint8_t mac_id);
int32_t send_set_ap_ps_param_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t *peer_addr,
struct ap_ps_params *param);
int32_t send_set_sta_ps_param_cmd_tlv(wmi_unified_t wmi_handle,
struct sta_ps_params *param);
int32_t send_crash_inject_cmd_tlv(wmi_unified_t wmi_handle,
struct crash_inject *param);
int32_t
send_dbglog_cmd_tlv(wmi_unified_t wmi_handle,
struct dbglog_params *dbglog_param);
int32_t send_vdev_set_param_cmd_tlv(wmi_unified_t wmi_handle,
struct vdev_set_params *param);
int32_t send_stats_request_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct stats_request_params *param);
int32_t send_packet_log_enable_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct packet_enable_params *param);
int32_t send_beacon_send_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct beacon_params *param);
int32_t send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct peer_assoc_params *param);
int32_t send_scan_start_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_start_params *param);
int32_t send_scan_stop_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_stop_params *param);
int32_t send_scan_chan_list_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t macaddr[IEEE80211_ADDR_LEN],
struct scan_chan_list_params *param);