Commit b874ddec authored by Lior David's avatar Lior David Committed by Kalle Valo

wil6210: switch to generated wmi.h

Switch to auto-generated version of wmi.h which is maintained
by FW team. This will allow better sync between teams in the
future and avoid bugs because of unexpected API changes.
The wmi.h will have many differences but most are cosmetic.
It also includes these real differences:
1. is_go parameter added to BCON_CTRL and START_PCP commands.
2. max_rx_pl_per_desc added to CFG_RX_CHAIN command.
3. various small API updates that are not currently used by
driver.
Signed-off-by: default avatarLior David <qca_liord@qca.qualcomm.com>
Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 74997a53
...@@ -119,7 +119,7 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, ...@@ -119,7 +119,7 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
.interval_usec = 0, .interval_usec = 0,
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_notify_req_done_event evt; struct wmi_notify_req_done_event evt;
} __packed reply; } __packed reply;
struct wil_net_stats *stats = &wil->sta[cid].stats; struct wil_net_stats *stats = &wil->sta[cid].stats;
...@@ -580,7 +580,7 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -580,7 +580,7 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_mgmt *mgmt_frame = (void *)buf; struct ieee80211_mgmt *mgmt_frame = (void *)buf;
struct wmi_sw_tx_req_cmd *cmd; struct wmi_sw_tx_req_cmd *cmd;
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_sw_tx_complete_event evt; struct wmi_sw_tx_complete_event evt;
} __packed evt; } __packed evt;
......
...@@ -826,9 +826,9 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf, ...@@ -826,9 +826,9 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
size_t len, loff_t *ppos) size_t len, loff_t *ppos)
{ {
struct wil6210_priv *wil = file->private_data; struct wil6210_priv *wil = file->private_data;
struct wil6210_mbox_hdr_wmi *wmi; struct wmi_cmd_hdr *wmi;
void *cmd; void *cmd;
int cmdlen = len - sizeof(struct wil6210_mbox_hdr_wmi); int cmdlen = len - sizeof(struct wmi_cmd_hdr);
u16 cmdid; u16 cmdid;
int rc, rc1; int rc, rc1;
...@@ -846,7 +846,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf, ...@@ -846,7 +846,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
} }
cmd = &wmi[1]; cmd = &wmi[1];
cmdid = le16_to_cpu(wmi->id); cmdid = le16_to_cpu(wmi->command_id);
rc1 = wmi_send(wil, cmdid, cmd, cmdlen); rc1 = wmi_send(wil, cmdid, cmd, cmdlen);
kfree(wmi); kfree(wmi);
...@@ -990,7 +990,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data) ...@@ -990,7 +990,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)
.interval_usec = 0, .interval_usec = 0,
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_notify_req_done_event evt; struct wmi_notify_req_done_event evt;
} __packed reply; } __packed reply;
......
/* /*
* Copyright (c) 2013 Qualcomm Atheros, Inc. * Copyright (c) 2013-2016 Qualcomm Atheros, Inc.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
...@@ -37,39 +37,40 @@ static inline void trace_ ## name(proto) {} ...@@ -37,39 +37,40 @@ static inline void trace_ ## name(proto) {}
#endif /* !CONFIG_WIL6210_TRACING || defined(__CHECKER__) */ #endif /* !CONFIG_WIL6210_TRACING || defined(__CHECKER__) */
DECLARE_EVENT_CLASS(wil6210_wmi, DECLARE_EVENT_CLASS(wil6210_wmi,
TP_PROTO(struct wil6210_mbox_hdr_wmi *wmi, void *buf, u16 buf_len), TP_PROTO(struct wmi_cmd_hdr *wmi, void *buf, u16 buf_len),
TP_ARGS(wmi, buf, buf_len), TP_ARGS(wmi, buf, buf_len),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u8, mid) __field(u8, mid)
__field(u16, id) __field(u16, command_id)
__field(u32, timestamp) __field(u32, fw_timestamp)
__field(u16, buf_len) __field(u16, buf_len)
__dynamic_array(u8, buf, buf_len) __dynamic_array(u8, buf, buf_len)
), ),
TP_fast_assign( TP_fast_assign(
__entry->mid = wmi->mid; __entry->mid = wmi->mid;
__entry->id = le16_to_cpu(wmi->id); __entry->command_id = le16_to_cpu(wmi->command_id);
__entry->timestamp = le32_to_cpu(wmi->timestamp); __entry->fw_timestamp = le32_to_cpu(wmi->fw_timestamp);
__entry->buf_len = buf_len; __entry->buf_len = buf_len;
memcpy(__get_dynamic_array(buf), buf, buf_len); memcpy(__get_dynamic_array(buf), buf, buf_len);
), ),
TP_printk( TP_printk(
"MID %d id 0x%04x len %d timestamp %d", "MID %d id 0x%04x len %d timestamp %d",
__entry->mid, __entry->id, __entry->buf_len, __entry->timestamp __entry->mid, __entry->command_id, __entry->buf_len,
__entry->fw_timestamp
) )
); );
DEFINE_EVENT(wil6210_wmi, wil6210_wmi_cmd, DEFINE_EVENT(wil6210_wmi, wil6210_wmi_cmd,
TP_PROTO(struct wil6210_mbox_hdr_wmi *wmi, void *buf, u16 buf_len), TP_PROTO(struct wmi_cmd_hdr *wmi, void *buf, u16 buf_len),
TP_ARGS(wmi, buf, buf_len) TP_ARGS(wmi, buf, buf_len)
); );
DEFINE_EVENT(wil6210_wmi, wil6210_wmi_event, DEFINE_EVENT(wil6210_wmi, wil6210_wmi_event,
TP_PROTO(struct wil6210_mbox_hdr_wmi *wmi, void *buf, u16 buf_len), TP_PROTO(struct wmi_cmd_hdr *wmi, void *buf, u16 buf_len),
TP_ARGS(wmi, buf, buf_len) TP_ARGS(wmi, buf, buf_len)
); );
......
...@@ -820,7 +820,7 @@ int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size, ...@@ -820,7 +820,7 @@ int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size,
}, },
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_vring_cfg_done_event cmd; struct wmi_vring_cfg_done_event cmd;
} __packed reply; } __packed reply;
struct vring *vring = &wil->vring_tx[id]; struct vring *vring = &wil->vring_tx[id];
...@@ -897,7 +897,7 @@ int wil_vring_init_bcast(struct wil6210_priv *wil, int id, int size) ...@@ -897,7 +897,7 @@ int wil_vring_init_bcast(struct wil6210_priv *wil, int id, int size)
}, },
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_vring_cfg_done_event cmd; struct wmi_vring_cfg_done_event cmd;
} __packed reply; } __packed reply;
struct vring *vring = &wil->vring_tx[id]; struct vring *vring = &wil->vring_tx[id];
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <net/cfg80211.h> #include <net/cfg80211.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/types.h> #include <linux/types.h>
#include "wmi.h"
#include "wil_platform.h" #include "wil_platform.h"
extern bool no_fw_recovery; extern bool no_fw_recovery;
...@@ -334,29 +335,11 @@ struct wil6210_mbox_hdr { ...@@ -334,29 +335,11 @@ struct wil6210_mbox_hdr {
/* max. value for wil6210_mbox_hdr.len */ /* max. value for wil6210_mbox_hdr.len */
#define MAX_MBOXITEM_SIZE (240) #define MAX_MBOXITEM_SIZE (240)
/**
* struct wil6210_mbox_hdr_wmi - WMI header
*
* @mid: MAC ID
* 00 - default, created by FW
* 01..0f - WiFi ports, driver to create
* 10..fe - debug
* ff - broadcast
* @id: command/event ID
* @timestamp: FW fills for events, free-running msec timer
*/
struct wil6210_mbox_hdr_wmi {
u8 mid;
u8 reserved;
__le16 id;
__le32 timestamp;
} __packed;
struct pending_wmi_event { struct pending_wmi_event {
struct list_head list; struct list_head list;
struct { struct {
struct wil6210_mbox_hdr hdr; struct wil6210_mbox_hdr hdr;
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
u8 data[0]; u8 data[0];
} __packed event; } __packed event;
}; };
......
...@@ -176,7 +176,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len) ...@@ -176,7 +176,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len)
{ {
struct { struct {
struct wil6210_mbox_hdr hdr; struct wil6210_mbox_hdr hdr;
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
} __packed cmd = { } __packed cmd = {
.hdr = { .hdr = {
.type = WIL_MBOX_HDR_TYPE_WMI, .type = WIL_MBOX_HDR_TYPE_WMI,
...@@ -185,7 +185,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len) ...@@ -185,7 +185,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len)
}, },
.wmi = { .wmi = {
.mid = 0, .mid = 0,
.id = cpu_to_le16(cmdid), .command_id = cpu_to_le16(cmdid),
}, },
}; };
struct wil6210_mbox_ring *r = &wil->mbox_ctl.tx; struct wil6210_mbox_ring *r = &wil->mbox_ctl.tx;
...@@ -656,7 +656,7 @@ static void wmi_evt_vring_en(struct wil6210_priv *wil, int id, void *d, int len) ...@@ -656,7 +656,7 @@ static void wmi_evt_vring_en(struct wil6210_priv *wil, int id, void *d, int len)
static void wmi_evt_ba_status(struct wil6210_priv *wil, int id, void *d, static void wmi_evt_ba_status(struct wil6210_priv *wil, int id, void *d,
int len) int len)
{ {
struct wmi_vring_ba_status_event *evt = d; struct wmi_ba_status_event *evt = d;
struct vring_tx_data *txdata; struct vring_tx_data *txdata;
wil_dbg_wmi(wil, "BACK[%d] %s {%d} timeout %d AMSDU%s\n", wil_dbg_wmi(wil, "BACK[%d] %s {%d} timeout %d AMSDU%s\n",
...@@ -842,10 +842,10 @@ void wmi_recv_cmd(struct wil6210_priv *wil) ...@@ -842,10 +842,10 @@ void wmi_recv_cmd(struct wil6210_priv *wil)
offsetof(struct wil6210_mbox_ring_desc, sync), 0); offsetof(struct wil6210_mbox_ring_desc, sync), 0);
/* indicate */ /* indicate */
if ((hdr.type == WIL_MBOX_HDR_TYPE_WMI) && if ((hdr.type == WIL_MBOX_HDR_TYPE_WMI) &&
(len >= sizeof(struct wil6210_mbox_hdr_wmi))) { (len >= sizeof(struct wmi_cmd_hdr))) {
struct wil6210_mbox_hdr_wmi *wmi = &evt->event.wmi; struct wmi_cmd_hdr *wmi = &evt->event.wmi;
u16 id = le16_to_cpu(wmi->id); u16 id = le16_to_cpu(wmi->command_id);
u32 tstamp = le32_to_cpu(wmi->timestamp); u32 tstamp = le32_to_cpu(wmi->fw_timestamp);
spin_lock_irqsave(&wil->wmi_ev_lock, flags); spin_lock_irqsave(&wil->wmi_ev_lock, flags);
if (wil->reply_id && wil->reply_id == id) { if (wil->reply_id && wil->reply_id == id) {
if (wil->reply_buf) { if (wil->reply_buf) {
...@@ -968,7 +968,7 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype, ...@@ -968,7 +968,7 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype,
.hidden_ssid = hidden_ssid, .hidden_ssid = hidden_ssid,
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_pcp_started_event evt; struct wmi_pcp_started_event evt;
} __packed reply; } __packed reply;
...@@ -1022,7 +1022,7 @@ int wmi_get_ssid(struct wil6210_priv *wil, u8 *ssid_len, void *ssid) ...@@ -1022,7 +1022,7 @@ int wmi_get_ssid(struct wil6210_priv *wil, u8 *ssid_len, void *ssid)
{ {
int rc; int rc;
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_set_ssid_cmd cmd; struct wmi_set_ssid_cmd cmd;
} __packed reply; } __packed reply;
int len; /* reply.cmd.ssid_len in CPU order */ int len; /* reply.cmd.ssid_len in CPU order */
...@@ -1055,7 +1055,7 @@ int wmi_get_channel(struct wil6210_priv *wil, int *channel) ...@@ -1055,7 +1055,7 @@ int wmi_get_channel(struct wil6210_priv *wil, int *channel)
{ {
int rc; int rc;
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_set_pcp_channel_cmd cmd; struct wmi_set_pcp_channel_cmd cmd;
} __packed reply; } __packed reply;
...@@ -1163,7 +1163,7 @@ int wmi_rxon(struct wil6210_priv *wil, bool on) ...@@ -1163,7 +1163,7 @@ int wmi_rxon(struct wil6210_priv *wil, bool on)
{ {
int rc; int rc;
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_listen_started_event evt; struct wmi_listen_started_event evt;
} __packed reply; } __packed reply;
...@@ -1200,7 +1200,7 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring) ...@@ -1200,7 +1200,7 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
.host_thrsh = cpu_to_le16(rx_ring_overflow_thrsh), .host_thrsh = cpu_to_le16(rx_ring_overflow_thrsh),
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_cfg_rx_chain_done_event evt; struct wmi_cfg_rx_chain_done_event evt;
} __packed evt; } __packed evt;
int rc; int rc;
...@@ -1254,7 +1254,7 @@ int wmi_get_temperature(struct wil6210_priv *wil, u32 *t_bb, u32 *t_rf) ...@@ -1254,7 +1254,7 @@ int wmi_get_temperature(struct wil6210_priv *wil, u32 *t_bb, u32 *t_rf)
.measure_mode = cpu_to_le32(TEMPERATURE_MEASURE_NOW), .measure_mode = cpu_to_le32(TEMPERATURE_MEASURE_NOW),
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_temp_sense_done_event evt; struct wmi_temp_sense_done_event evt;
} __packed reply; } __packed reply;
...@@ -1280,7 +1280,7 @@ int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, u16 reason, ...@@ -1280,7 +1280,7 @@ int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, u16 reason,
.disconnect_reason = cpu_to_le16(reason), .disconnect_reason = cpu_to_le16(reason),
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_disconnect_event evt; struct wmi_disconnect_event evt;
} __packed reply; } __packed reply;
...@@ -1372,7 +1372,7 @@ int wmi_addba_rx_resp(struct wil6210_priv *wil, u8 cid, u8 tid, u8 token, ...@@ -1372,7 +1372,7 @@ int wmi_addba_rx_resp(struct wil6210_priv *wil, u8 cid, u8 tid, u8 token,
.ba_timeout = cpu_to_le16(timeout), .ba_timeout = cpu_to_le16(timeout),
}; };
struct { struct {
struct wil6210_mbox_hdr_wmi wmi; struct wmi_cmd_hdr wmi;
struct wmi_rcp_addba_resp_sent_event evt; struct wmi_rcp_addba_resp_sent_event evt;
} __packed reply; } __packed reply;
...@@ -1428,10 +1428,10 @@ static void wmi_event_handle(struct wil6210_priv *wil, ...@@ -1428,10 +1428,10 @@ static void wmi_event_handle(struct wil6210_priv *wil,
u16 len = le16_to_cpu(hdr->len); u16 len = le16_to_cpu(hdr->len);
if ((hdr->type == WIL_MBOX_HDR_TYPE_WMI) && if ((hdr->type == WIL_MBOX_HDR_TYPE_WMI) &&
(len >= sizeof(struct wil6210_mbox_hdr_wmi))) { (len >= sizeof(struct wmi_cmd_hdr))) {
struct wil6210_mbox_hdr_wmi *wmi = (void *)(&hdr[1]); struct wmi_cmd_hdr *wmi = (void *)(&hdr[1]);
void *evt_data = (void *)(&wmi[1]); void *evt_data = (void *)(&wmi[1]);
u16 id = le16_to_cpu(wmi->id); u16 id = le16_to_cpu(wmi->command_id);
wil_dbg_wmi(wil, "Handle WMI 0x%04x (reply_id 0x%04x)\n", wil_dbg_wmi(wil, "Handle WMI 0x%04x (reply_id 0x%04x)\n",
id, wil->reply_id); id, wil->reply_id);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment