aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/main.h
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-06-20 00:38:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-25 15:32:46 -0400
commit92c2538f55132d8e0e53945204cfb137e7d64b6b (patch)
treed9f22d8e73487b306740fa3653af85243235d8cc /drivers/net/wireless/mwifiex/main.h
parent5f4ef7197db98a40e43904806612a8ccf609c0a3 (diff)
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.h29
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 @@
30#include <linux/etherdevice.h> 30#include <linux/etherdevice.h>
31#include <net/sock.h> 31#include <net/sock.h>
32#include <net/lib80211.h> 32#include <net/lib80211.h>
33#include <linux/vmalloc.h>
33#include <linux/firmware.h> 34#include <linux/firmware.h>
34#include <linux/ctype.h> 35#include <linux/ctype.h>
35#include <linux/of.h> 36#include <linux/of.h>
@@ -410,6 +411,28 @@ struct mwifiex_roc_cfg {
410 struct ieee80211_channel chan; 411 struct ieee80211_channel chan;
411}; 412};
412 413
414#define MWIFIEX_FW_DUMP_IDX 0xff
415#define FW_DUMP_MAX_NAME_LEN 8
416#define FW_DUMP_HOST_READY 0xEE
417#define FW_DUMP_DONE 0xFF
418
419struct memory_type_mapping {
420 u8 mem_name[FW_DUMP_MAX_NAME_LEN];
421 u8 *mem_ptr;
422 u32 mem_size;
423 u8 done_flag;
424};
425
426enum rdwr_status {
427 RDWR_STATUS_SUCCESS = 0,
428 RDWR_STATUS_FAILURE = 1,
429 RDWR_STATUS_DONE = 2
430};
431
432enum mwifiex_iface_work_flags {
433 MWIFIEX_IFACE_WORK_FW_DUMP,
434};
435
413struct mwifiex_adapter; 436struct mwifiex_adapter;
414struct mwifiex_private; 437struct mwifiex_private;
415 438
@@ -674,6 +697,7 @@ struct mwifiex_if_ops {
674 void (*card_reset) (struct mwifiex_adapter *); 697 void (*card_reset) (struct mwifiex_adapter *);
675 void (*fw_dump)(struct mwifiex_adapter *); 698 void (*fw_dump)(struct mwifiex_adapter *);
676 int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); 699 int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
700 void (*iface_work)(struct work_struct *work);
677}; 701};
678 702
679struct mwifiex_adapter { 703struct mwifiex_adapter {
@@ -809,6 +833,11 @@ struct mwifiex_adapter {
809 bool ext_scan; 833 bool ext_scan;
810 u8 fw_api_ver; 834 u8 fw_api_ver;
811 u8 fw_key_api_major_ver, fw_key_api_minor_ver; 835 u8 fw_key_api_major_ver, fw_key_api_minor_ver;
836 struct work_struct iface_work;
837 unsigned long iface_work_flags;
838 struct memory_type_mapping *mem_type_mapping_tbl;
839 u8 num_mem_types;
840 u8 curr_mem_idx;
812}; 841};
813 842
814int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); 843int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);