ath10k: handle FW API differences for scan structures
The wmi_start_scan_cmd has an extra filed in our main firmware track, reflact that to not have a mismatch in case of 10.x track. Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
226a339ba8
commit
89b7e766c8
|
@ -2341,11 +2341,15 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg)
|
static int ath10k_wmi_start_scan_calc_len(struct ath10k *ar,
|
||||||
|
const struct wmi_start_scan_arg *arg)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = sizeof(struct wmi_start_scan_cmd);
|
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
|
||||||
|
len = sizeof(struct wmi_start_scan_cmd_10x);
|
||||||
|
else
|
||||||
|
len = sizeof(struct wmi_start_scan_cmd);
|
||||||
|
|
||||||
if (arg->ie_len) {
|
if (arg->ie_len) {
|
||||||
if (!arg->ie)
|
if (!arg->ie)
|
||||||
|
@ -2405,7 +2409,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
len = ath10k_wmi_start_scan_calc_len(arg);
|
len = ath10k_wmi_start_scan_calc_len(ar, arg);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return len; /* len contains error code here */
|
return len; /* len contains error code here */
|
||||||
|
|
||||||
|
@ -2437,7 +2441,14 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
|
||||||
cmd->scan_ctrl_flags = __cpu_to_le32(arg->scan_ctrl_flags);
|
cmd->scan_ctrl_flags = __cpu_to_le32(arg->scan_ctrl_flags);
|
||||||
|
|
||||||
/* TLV list starts after fields included in the struct */
|
/* TLV list starts after fields included in the struct */
|
||||||
off = sizeof(*cmd);
|
/* There's just one filed that differes the two start_scan
|
||||||
|
* structures - burst_duration, which we are not using btw,
|
||||||
|
no point to make the split here, just shift the buffer to fit with
|
||||||
|
given FW */
|
||||||
|
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
|
||||||
|
off = sizeof(struct wmi_start_scan_cmd_10x);
|
||||||
|
else
|
||||||
|
off = sizeof(struct wmi_start_scan_cmd);
|
||||||
|
|
||||||
if (arg->n_channels) {
|
if (arg->n_channels) {
|
||||||
channels = (void *)skb->data + off;
|
channels = (void *)skb->data + off;
|
||||||
|
|
|
@ -1715,6 +1715,88 @@ struct wmi_start_scan_cmd {
|
||||||
*/
|
*/
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
/* This is the definition from 10.X firmware branch */
|
||||||
|
struct wmi_start_scan_cmd_10x {
|
||||||
|
/* Scan ID */
|
||||||
|
__le32 scan_id;
|
||||||
|
|
||||||
|
/* Scan requestor ID */
|
||||||
|
__le32 scan_req_id;
|
||||||
|
|
||||||
|
/* VDEV id(interface) that is requesting scan */
|
||||||
|
__le32 vdev_id;
|
||||||
|
|
||||||
|
/* Scan Priority, input to scan scheduler */
|
||||||
|
__le32 scan_priority;
|
||||||
|
|
||||||
|
/* Scan events subscription */
|
||||||
|
__le32 notify_scan_events;
|
||||||
|
|
||||||
|
/* dwell time in msec on active channels */
|
||||||
|
__le32 dwell_time_active;
|
||||||
|
|
||||||
|
/* dwell time in msec on passive channels */
|
||||||
|
__le32 dwell_time_passive;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* min time in msec on the BSS channel,only valid if atleast one
|
||||||
|
* VDEV is active
|
||||||
|
*/
|
||||||
|
__le32 min_rest_time;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* max rest time in msec on the BSS channel,only valid if at least
|
||||||
|
* one VDEV is active
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* the scanner will rest on the bss channel at least min_rest_time
|
||||||
|
* after min_rest_time the scanner will start checking for tx/rx
|
||||||
|
* activity on all VDEVs. if there is no activity the scanner will
|
||||||
|
* switch to off channel. if there is activity the scanner will let
|
||||||
|
* the radio on the bss channel until max_rest_time expires.at
|
||||||
|
* max_rest_time scanner will switch to off channel irrespective of
|
||||||
|
* activity. activity is determined by the idle_time parameter.
|
||||||
|
*/
|
||||||
|
__le32 max_rest_time;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* time before sending next set of probe requests.
|
||||||
|
* The scanner keeps repeating probe requests transmission with
|
||||||
|
* period specified by repeat_probe_time.
|
||||||
|
* The number of probe requests specified depends on the ssid_list
|
||||||
|
* and bssid_list
|
||||||
|
*/
|
||||||
|
__le32 repeat_probe_time;
|
||||||
|
|
||||||
|
/* time in msec between 2 consequetive probe requests with in a set. */
|
||||||
|
__le32 probe_spacing_time;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* data inactivity time in msec on bss channel that will be used by
|
||||||
|
* scanner for measuring the inactivity.
|
||||||
|
*/
|
||||||
|
__le32 idle_time;
|
||||||
|
|
||||||
|
/* maximum time in msec allowed for scan */
|
||||||
|
__le32 max_scan_time;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* delay in msec before sending first probe request after switching
|
||||||
|
* to a channel
|
||||||
|
*/
|
||||||
|
__le32 probe_delay;
|
||||||
|
|
||||||
|
/* Scan control flags */
|
||||||
|
__le32 scan_ctrl_flags;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TLV (tag length value ) paramerters follow the scan_cmd structure.
|
||||||
|
* TLV can contain channel list, bssid list, ssid list and
|
||||||
|
* ie. the TLV tags are defined above;
|
||||||
|
*/
|
||||||
|
} __packed;
|
||||||
|
|
||||||
|
|
||||||
struct wmi_ssid_arg {
|
struct wmi_ssid_arg {
|
||||||
int len;
|
int len;
|
||||||
const u8 *ssid;
|
const u8 *ssid;
|
||||||
|
|
Loading…
Reference in New Issue