wil6210.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) wil6210.h (a5dc688392737bbab3699d63f26e853a40c52d2d)
1/*
2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 68 unchanged lines hidden (view full) ---

77 * 26 bytes - 3-address QoS data header
78 * 8 bytes - IV + EIV (for GCMP)
79 * 8 bytes - SNAP
80 * 16 bytes - MIC (for GCMP)
81 * 4 bytes - CRC
82 */
83#define WIL_MAX_MPDU_OVERHEAD (62)
84
1/*
2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 68 unchanged lines hidden (view full) ---

77 * 26 bytes - 3-address QoS data header
78 * 8 bytes - IV + EIV (for GCMP)
79 * 8 bytes - SNAP
80 * 16 bytes - MIC (for GCMP)
81 * 4 bytes - CRC
82 */
83#define WIL_MAX_MPDU_OVERHEAD (62)
84
85struct wil_suspend_stats {
85struct wil_suspend_count_stats {
86 unsigned long successful_suspends;
86 unsigned long successful_suspends;
87 unsigned long failed_suspends;
88 unsigned long successful_resumes;
87 unsigned long successful_resumes;
88 unsigned long failed_suspends;
89 unsigned long failed_resumes;
89 unsigned long failed_resumes;
90 unsigned long rejected_by_device;
90};
91
92struct wil_suspend_stats {
93 struct wil_suspend_count_stats r_off;
94 struct wil_suspend_count_stats r_on;
95 unsigned long rejected_by_device; /* only radio on */
91 unsigned long rejected_by_host;
96 unsigned long rejected_by_host;
92 unsigned long long total_suspend_time;
93 unsigned long long min_suspend_time;
94 unsigned long long max_suspend_time;
95 ktime_t collection_start;
96 ktime_t suspend_start_time;
97};
98
99/* Calculate MAC buffer size for the firmware. It includes all overhead,
100 * as it will go over the air, and need to be 8 byte aligned
101 */
102static inline u32 wil_mtu2macbuf(u32 mtu)
103{
104 return ALIGN(mtu + WIL_MAX_MPDU_OVERHEAD, 8);

--- 506 unchanged lines hidden (view full) ---

611 WIL_LED_TIME_LAST,
612};
613
614struct blink_on_off_time {
615 u32 on_ms;
616 u32 off_ms;
617};
618
97};
98
99/* Calculate MAC buffer size for the firmware. It includes all overhead,
100 * as it will go over the air, and need to be 8 byte aligned
101 */
102static inline u32 wil_mtu2macbuf(u32 mtu)
103{
104 return ALIGN(mtu + WIL_MAX_MPDU_OVERHEAD, 8);

--- 506 unchanged lines hidden (view full) ---

611 WIL_LED_TIME_LAST,
612};
613
614struct blink_on_off_time {
615 u32 on_ms;
616 u32 off_ms;
617};
618
619struct wil_debugfs_iomem_data {
620 void *offset;
621 struct wil6210_priv *wil;
622};
623
624struct wil_debugfs_data {
625 struct wil_debugfs_iomem_data *data_arr;
626 int iomem_data_count;
627};
628
619extern struct blink_on_off_time led_blink_time[WIL_LED_TIME_LAST];
620extern u8 led_id;
621extern u8 led_polarity;
622
623struct wil6210_priv {
624 struct pci_dev *pdev;
625 u32 bar_size;
626 struct wireless_dev *wdev;

--- 76 unchanged lines hidden (view full) ---

703 atomic_t isr_count_rx, isr_count_tx;
704 /* debugfs */
705 struct dentry *debug;
706 struct wil_blob_wrapper blobs[ARRAY_SIZE(fw_mapping)];
707 u8 discovery_mode;
708 u8 abft_len;
709 u8 wakeup_trigger;
710 struct wil_suspend_stats suspend_stats;
629extern struct blink_on_off_time led_blink_time[WIL_LED_TIME_LAST];
630extern u8 led_id;
631extern u8 led_polarity;
632
633struct wil6210_priv {
634 struct pci_dev *pdev;
635 u32 bar_size;
636 struct wireless_dev *wdev;

--- 76 unchanged lines hidden (view full) ---

713 atomic_t isr_count_rx, isr_count_tx;
714 /* debugfs */
715 struct dentry *debug;
716 struct wil_blob_wrapper blobs[ARRAY_SIZE(fw_mapping)];
717 u8 discovery_mode;
718 u8 abft_len;
719 u8 wakeup_trigger;
720 struct wil_suspend_stats suspend_stats;
721 struct wil_debugfs_data dbg_data;
711
712 void *platform_handle;
713 struct wil_platform_ops platform_ops;
714 bool keep_radio_on_during_sleep;
715
716 struct pmc_ctx pmc;
717
718 bool pbss;

--- 7 unchanged lines hidden (view full) ---

726
727 /* High Access Latency Policy voting */
728 struct wil_halp halp;
729
730 enum wmi_ps_profile_type ps_profile;
731
732 int fw_calib_result;
733
722
723 void *platform_handle;
724 struct wil_platform_ops platform_ops;
725 bool keep_radio_on_during_sleep;
726
727 struct pmc_ctx pmc;
728
729 bool pbss;

--- 7 unchanged lines hidden (view full) ---

737
738 /* High Access Latency Policy voting */
739 struct wil_halp halp;
740
741 enum wmi_ps_profile_type ps_profile;
742
743 int fw_calib_result;
744
734#ifdef CONFIG_PM
735#ifdef CONFIG_PM_SLEEP
736 struct notifier_block pm_notify;
745 struct notifier_block pm_notify;
737#endif /* CONFIG_PM_SLEEP */
738#endif /* CONFIG_PM */
739
740 bool suspend_resp_rcvd;
741 bool suspend_resp_comp;
742 u32 bus_request_kbps;
743 u32 bus_request_kbps_pre_suspend;
744};
745
746#define wil_to_wiphy(i) (i->wdev->wiphy)

--- 109 unchanged lines hidden (view full) ---

856int wil_reset(struct wil6210_priv *wil, bool no_fw);
857void wil_fw_error_recovery(struct wil6210_priv *wil);
858void wil_set_recovery_state(struct wil6210_priv *wil, int state);
859bool wil_is_recovery_blocked(struct wil6210_priv *wil);
860int wil_up(struct wil6210_priv *wil);
861int __wil_up(struct wil6210_priv *wil);
862int wil_down(struct wil6210_priv *wil);
863int __wil_down(struct wil6210_priv *wil);
746
747 bool suspend_resp_rcvd;
748 bool suspend_resp_comp;
749 u32 bus_request_kbps;
750 u32 bus_request_kbps_pre_suspend;
751};
752
753#define wil_to_wiphy(i) (i->wdev->wiphy)

--- 109 unchanged lines hidden (view full) ---

863int wil_reset(struct wil6210_priv *wil, bool no_fw);
864void wil_fw_error_recovery(struct wil6210_priv *wil);
865void wil_set_recovery_state(struct wil6210_priv *wil, int state);
866bool wil_is_recovery_blocked(struct wil6210_priv *wil);
867int wil_up(struct wil6210_priv *wil);
868int __wil_up(struct wil6210_priv *wil);
869int wil_down(struct wil6210_priv *wil);
870int __wil_down(struct wil6210_priv *wil);
871void wil_refresh_fw_capabilities(struct wil6210_priv *wil);
864void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r);
865int wil_find_cid(struct wil6210_priv *wil, const u8 *mac);
866void wil_set_ethtoolops(struct net_device *ndev);
867
872void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r);
873int wil_find_cid(struct wil6210_priv *wil, const u8 *mac);
874void wil_set_ethtoolops(struct net_device *ndev);
875
876void __iomem *wmi_buffer_block(struct wil6210_priv *wil, __le32 ptr, u32 size);
868void __iomem *wmi_buffer(struct wil6210_priv *wil, __le32 ptr);
869void __iomem *wmi_addr(struct wil6210_priv *wil, u32 ptr);
870int wmi_read_hdr(struct wil6210_priv *wil, __le32 ptr,
871 struct wil6210_mbox_hdr *hdr);
872int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len);
873void wmi_recv_cmd(struct wil6210_priv *wil);
874int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
875 u16 reply_id, void *reply, u8 reply_size, int to_msec);

--- 118 unchanged lines hidden (view full) ---

994void wil6210_unmask_irq_rx(struct wil6210_priv *wil);
995
996int wil_iftype_nl2wmi(enum nl80211_iftype type);
997
998int wil_request_firmware(struct wil6210_priv *wil, const char *name,
999 bool load);
1000bool wil_fw_verify_file_exists(struct wil6210_priv *wil, const char *name);
1001
877void __iomem *wmi_buffer(struct wil6210_priv *wil, __le32 ptr);
878void __iomem *wmi_addr(struct wil6210_priv *wil, u32 ptr);
879int wmi_read_hdr(struct wil6210_priv *wil, __le32 ptr,
880 struct wil6210_mbox_hdr *hdr);
881int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len);
882void wmi_recv_cmd(struct wil6210_priv *wil);
883int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
884 u16 reply_id, void *reply, u8 reply_size, int to_msec);

--- 118 unchanged lines hidden (view full) ---

1003void wil6210_unmask_irq_rx(struct wil6210_priv *wil);
1004
1005int wil_iftype_nl2wmi(enum nl80211_iftype type);
1006
1007int wil_request_firmware(struct wil6210_priv *wil, const char *name,
1008 bool load);
1009bool wil_fw_verify_file_exists(struct wil6210_priv *wil, const char *name);
1010
1011void wil_pm_runtime_allow(struct wil6210_priv *wil);
1012void wil_pm_runtime_forbid(struct wil6210_priv *wil);
1013int wil_pm_runtime_get(struct wil6210_priv *wil);
1014void wil_pm_runtime_put(struct wil6210_priv *wil);
1015
1002int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime);
1016int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime);
1003int wil_suspend(struct wil6210_priv *wil, bool is_runtime);
1004int wil_resume(struct wil6210_priv *wil, bool is_runtime);
1017int wil_suspend(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on);
1018int wil_resume(struct wil6210_priv *wil, bool is_runtime, bool keep_radio_on);
1005bool wil_is_wmi_idle(struct wil6210_priv *wil);
1006int wmi_resume(struct wil6210_priv *wil);
1007int wmi_suspend(struct wil6210_priv *wil);
1008bool wil_is_tx_idle(struct wil6210_priv *wil);
1009bool wil_is_rx_idle(struct wil6210_priv *wil);
1010
1011int wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest, u32 size);
1012void wil_fw_core_dump(struct wil6210_priv *wil);
1013
1014void wil_halp_vote(struct wil6210_priv *wil);
1015void wil_halp_unvote(struct wil6210_priv *wil);
1016void wil6210_set_halp(struct wil6210_priv *wil);
1017void wil6210_clear_halp(struct wil6210_priv *wil);
1018
1019bool wil_is_wmi_idle(struct wil6210_priv *wil);
1020int wmi_resume(struct wil6210_priv *wil);
1021int wmi_suspend(struct wil6210_priv *wil);
1022bool wil_is_tx_idle(struct wil6210_priv *wil);
1023bool wil_is_rx_idle(struct wil6210_priv *wil);
1024
1025int wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest, u32 size);
1026void wil_fw_core_dump(struct wil6210_priv *wil);
1027
1028void wil_halp_vote(struct wil6210_priv *wil);
1029void wil_halp_unvote(struct wil6210_priv *wil);
1030void wil6210_set_halp(struct wil6210_priv *wil);
1031void wil6210_clear_halp(struct wil6210_priv *wil);
1032
1033int wmi_start_sched_scan(struct wil6210_priv *wil,
1034 struct cfg80211_sched_scan_request *request);
1035int wmi_stop_sched_scan(struct wil6210_priv *wil);
1036
1019#endif /* __WIL6210_H__ */
1037#endif /* __WIL6210_H__ */