This source file includes following definitions.
- i1480_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 #ifndef __i1480_DFU_H__
51 #define __i1480_DFU_H__
52
53 #include <linux/types.h>
54 #include <linux/completion.h>
55 #include "../../include/spec.h"
56
57 #define i1480_FW_UPLOAD_MODE_MASK (cpu_to_le32(0x00000018))
58
59 #if i1480_FW > 0x00000302
60 #define i1480_RCEB_EXTENDED
61 #endif
62
63 struct uwb_rccb;
64 struct uwb_rceb;
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 struct i1480 {
100 struct device *dev;
101
102 int (*write)(struct i1480 *, u32 addr, const void *, size_t);
103 int (*read)(struct i1480 *, u32 addr, size_t);
104 int (*rc_setup)(struct i1480 *);
105 void (*rc_release)(struct i1480 *);
106 int (*wait_init_done)(struct i1480 *);
107 int (*cmd)(struct i1480 *, const char *cmd_name, size_t cmd_size);
108 const char *pre_fw_name;
109 const char *mac_fw_name;
110 const char *mac_fw_name_deprecate;
111 const char *phy_fw_name;
112 u8 hw_rev;
113
114 size_t buf_size;
115 void *evt_buf, *cmd_buf;
116 ssize_t evt_result;
117 struct completion evt_complete;
118 };
119
120 static inline
121 void i1480_init(struct i1480 *i1480)
122 {
123 i1480->hw_rev = 1;
124 init_completion(&i1480->evt_complete);
125 }
126
127 extern int i1480_fw_upload(struct i1480 *);
128 extern int i1480_pre_fw_upload(struct i1480 *);
129 extern int i1480_mac_fw_upload(struct i1480 *);
130 extern int i1480_phy_fw_upload(struct i1480 *);
131 extern ssize_t i1480_cmd(struct i1480 *, const char *, size_t, size_t);
132 extern int i1480_rceb_check(const struct i1480 *,
133 const struct uwb_rceb *, const char *, u8,
134 u8, unsigned);
135
136 enum {
137
138 i1480_CET_VS1 = 0xfd,
139
140 i1480_CMD_SET_IP_MAS = 0x000e,
141 i1480_CMD_GET_MAC_PHY_INFO = 0x0003,
142 i1480_CMD_MPI_WRITE = 0x000f,
143 i1480_CMD_MPI_READ = 0x0010,
144
145 #if i1480_FW > 0x00000302
146 i1480_EVT_CONFIRM = 0x0002,
147 i1480_EVT_RM_INIT_DONE = 0x0101,
148 i1480_EVT_DEV_ADD = 0x0103,
149 i1480_EVT_DEV_RM = 0x0104,
150 i1480_EVT_DEV_ID_CHANGE = 0x0105,
151 i1480_EVT_GET_MAC_PHY_INFO = i1480_CMD_GET_MAC_PHY_INFO,
152 #else
153 i1480_EVT_CONFIRM = 0x0002,
154 i1480_EVT_RM_INIT_DONE = 0x0101,
155 i1480_EVT_DEV_ADD = 0x0103,
156 i1480_EVT_DEV_RM = 0x0104,
157 i1480_EVT_DEV_ID_CHANGE = 0x0105,
158 i1480_EVT_GET_MAC_PHY_INFO = i1480_EVT_CONFIRM,
159 #endif
160 };
161
162
163 struct i1480_evt_confirm {
164 struct uwb_rceb rceb;
165 #ifdef i1480_RCEB_EXTENDED
166 __le16 wParamLength;
167 #endif
168 u8 bResultCode;
169 } __attribute__((packed));
170
171
172 struct i1480_rceb {
173 struct uwb_rceb rceb;
174 #ifdef i1480_RCEB_EXTENDED
175 __le16 wParamLength;
176 #endif
177 } __attribute__((packed));
178
179
180
181
182
183
184
185 struct i1480_evt_confirm_GMPI {
186 #if i1480_FW > 0x00000302
187 struct uwb_rceb rceb;
188 __le16 wParamLength;
189 __le16 status;
190 u8 mac_addr[6];
191 u8 dev_addr[2];
192 __le16 mac_fw_rev;
193 u8 hw_rev;
194 u8 phy_vendor;
195 u8 phy_rev;
196 __le16 mac_caps;
197 u8 phy_caps[3];
198 u8 key_stores;
199 __le16 mcast_addr_stores;
200 u8 sec_mode_supported;
201 #else
202 struct uwb_rceb rceb;
203 u8 status;
204 u8 mac_addr[8];
205 u8 dev_addr[2];
206 __le16 mac_fw_rev;
207 __le16 phy_fw_rev;
208 __le16 mac_caps;
209 u8 phy_caps;
210 u8 key_stores;
211 __le16 mcast_addr_stores;
212 u8 sec_mode_supported;
213 #endif
214 } __attribute__((packed));
215
216
217 struct i1480_cmd_mpi_write {
218 struct uwb_rccb rccb;
219 __le16 size;
220 u8 data[];
221 };
222
223
224 struct i1480_cmd_mpi_read {
225 struct uwb_rccb rccb;
226 __le16 size;
227 struct {
228 u8 page, offset;
229 } __attribute__((packed)) data[];
230 } __attribute__((packed));
231
232
233 struct i1480_evt_mpi_read {
234 struct uwb_rceb rceb;
235 #ifdef i1480_RCEB_EXTENDED
236 __le16 wParamLength;
237 #endif
238 u8 bResultCode;
239 __le16 size;
240 struct {
241 u8 page, offset, value;
242 } __attribute__((packed)) data[];
243 } __attribute__((packed));
244
245
246 #endif