diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-06-19 21:38:52 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-25 15:32:46 -0400 |
commit | 92c2538f55132d8e0e53945204cfb137e7d64b6b (patch) | |
tree | d9f22d8e73487b306740fa3653af85243235d8cc /drivers/net/wireless/mwifiex/main.h | |
parent | 5f4ef7197db98a40e43904806612a8ccf609c0a3 (diff) | |
download | lwn-92c2538f55132d8e0e53945204cfb137e7d64b6b.tar.gz lwn-92c2538f55132d8e0e53945204cfb137e7d64b6b.zip |
mwifiex: add firmware dump feature for PCIe
Firmware dump feature is added for PCIe based chipsets which can
be used with the help of ethtool commands.
1) Trigger firmware dump operation:
ethtool --set-dump mlan0 0xff
When the operation is completed, udev event will be sent to
trigger external application.
2) Following udev rule can be used to get the data from ethtool:
DRIVER=="mwifiex_pcie", ACTION=="change", RUN+="/sbin/mwifiex_pcie_fw_dump.sh"
mwifiex_pcie_fw_dump.sh: #!/bin/bash
ethtool --set-dump mlan0 0
ethtool --get-dump mlan0
ethtool --get-dump mlan0 data /tmp/ITCM.log
ethtool --set-dump mlan0 1
ethtool --get-dump mlan0
ethtool --get-dump mlan0 data /tmp/DTCM.log
ethtool --set-dump mlan0 2
ethtool --get-dump mlan0
ethtool --get-dump mlan0 data /tmp/SQRAM.log
ethtool --set-dump mlan0 3
ethtool --get-dump mlan0
ethtool --get-dump mlan0 data /tmp/IRAM.log
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.h')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 1398afa84064..24791e2acf24 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h @@ -30,6 +30,7 @@ #include <linux/etherdevice.h> #include <net/sock.h> #include <net/lib80211.h> +#include <linux/vmalloc.h> #include <linux/firmware.h> #include <linux/ctype.h> #include <linux/of.h> @@ -410,6 +411,28 @@ struct mwifiex_roc_cfg { struct ieee80211_channel chan; }; +#define MWIFIEX_FW_DUMP_IDX 0xff +#define FW_DUMP_MAX_NAME_LEN 8 +#define FW_DUMP_HOST_READY 0xEE +#define FW_DUMP_DONE 0xFF + +struct memory_type_mapping { + u8 mem_name[FW_DUMP_MAX_NAME_LEN]; + u8 *mem_ptr; + u32 mem_size; + u8 done_flag; +}; + +enum rdwr_status { + RDWR_STATUS_SUCCESS = 0, + RDWR_STATUS_FAILURE = 1, + RDWR_STATUS_DONE = 2 +}; + +enum mwifiex_iface_work_flags { + MWIFIEX_IFACE_WORK_FW_DUMP, +}; + struct mwifiex_adapter; struct mwifiex_private; @@ -674,6 +697,7 @@ struct mwifiex_if_ops { void (*card_reset) (struct mwifiex_adapter *); void (*fw_dump)(struct mwifiex_adapter *); int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); + void (*iface_work)(struct work_struct *work); }; struct mwifiex_adapter { @@ -809,6 +833,11 @@ struct mwifiex_adapter { bool ext_scan; u8 fw_api_ver; u8 fw_key_api_major_ver, fw_key_api_minor_ver; + struct work_struct iface_work; + unsigned long iface_work_flags; + struct memory_type_mapping *mem_type_mapping_tbl; + u8 num_mem_types; + u8 curr_mem_idx; }; int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); |