Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifndef __RTL_COMPAT_H__
2#define __RTL_COMPAT_H__
3
4#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
5/*
6 * Use this if you want to use the same suspend and resume callbacks for suspend
7 * to RAM and hibernation.
8 */
9#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
10struct dev_pm_ops name = { \
11 .suspend = suspend_fn, \
12 .resume = resume_fn, \
13 .freeze = suspend_fn, \
14 .thaw = resume_fn, \
15 .poweroff = suspend_fn, \
16 .restore = resume_fn, \
17}
18
19#define compat_pci_suspend(fn) \
20 int fn##_compat(struct pci_dev *pdev, pm_message_t state) \
21 { \
22 int r; \
23 \
24 r = fn(&pdev->dev); \
25 if (r) \
26 return r; \
27 \
28 pci_save_state(pdev); \
29 pci_disable_device(pdev); \
30 pci_set_power_state(pdev, PCI_D3hot); \
31 \
32 return 0; \
33 }
34
35#define compat_pci_resume(fn) \
36 int fn##_compat(struct pci_dev *pdev) \
37 { \
38 int r; \
39 \
40 pci_set_power_state(pdev, PCI_D0); \
41 r = pci_enable_device(pdev); \
42 if (r) \
43 return r; \
44 pci_restore_state(pdev); \
45 \
46 return fn(&pdev->dev); \
47 }
48#endif
49
50#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
51#define RX_FLAG_MACTIME_MPDU RX_FLAG_TSFT
52#else
53#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
54#define RX_FLAG_MACTIME_MPDU RX_FLAG_MACTIME_START
55#else
56#endif
57//#define NETDEV_TX_OK
58#endif
59
60#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
61#define IEEE80211_KEY_FLAG_SW_MGMT IEEE80211_KEY_FLAG_SW_MGMT_TX
62#endif
63
64struct ieee80211_mgmt_compat {
65 __le16 frame_control;
66 __le16 duration;
67 u8 da[6];
68 u8 sa[6];
69 u8 bssid[6];
70 __le16 seq_ctrl;
71 union {
72 struct {
73 u8 category;
74 union {
75 struct {
76 u8 action_code;
77 u8 dialog_token;
78 u8 status_code;
79 u8 variable[0];
80 } __attribute__ ((packed)) wme_action;
81 struct{
82 u8 action_code;
83 u8 dialog_token;
84 __le16 capab;
85 __le16 timeout;
86 __le16 start_seq_num;
87 } __attribute__((packed)) addba_req;
88 struct{
89 u8 action_code;
90 u8 dialog_token;
91 __le16 status;
92 __le16 capab;
93 __le16 timeout;
94 } __attribute__((packed)) addba_resp;
95 struct{
96 u8 action_code;
97 __le16 params;
98 __le16 reason_code;
99 } __attribute__((packed)) delba;
100 struct{
101 u8 action_code;
102 /* capab_info for open and confirm,
103 * reason for close
104 */
105 __le16 aux;
106 /* Followed in plink_confirm by status
107 * code, AID and supported rates,
108 * and directly by supported rates in
109 * plink_open and plink_close
110 */
111 u8 variable[0];
112 } __attribute__((packed)) plink_action;
113 struct{
114 u8 action_code;
115 u8 variable[0];
116 } __attribute__((packed)) mesh_action;
117 struct {
118 u8 action;
119 u8 smps_control;
120 } __attribute__ ((packed)) ht_smps;
121 } u;
122 } __attribute__ ((packed)) action;
123 } u;
124} __attribute__ ((packed));
125#endif