Lines Matching +full:0 +full:x0543

68 static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
71 int urtw_debug = 0;
72 SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RWTUN, &urtw_debug, 0,
75 URTW_DEBUG_XMIT = 0x00000001, /* basic xmit operation */
76 URTW_DEBUG_RECV = 0x00000002, /* basic recv operation */
77 URTW_DEBUG_RESET = 0x00000004, /* reset processing */
78 URTW_DEBUG_TX_PROC = 0x00000008, /* tx ISR proc */
79 URTW_DEBUG_RX_PROC = 0x00000010, /* rx ISR proc */
80 URTW_DEBUG_STATE = 0x00000020, /* 802.11 state transitions */
81 URTW_DEBUG_STAT = 0x00000040, /* statistic */
82 URTW_DEBUG_INIT = 0x00000080, /* initialization of dev */
83 URTW_DEBUG_TXSTATUS = 0x00000100, /* tx status */
84 URTW_DEBUG_ANY = 0xffffffff
89 } while (0)
93 } while (0)
97 &urtw_preamble_mode, 0, "set the preable mode (long or short)");
106 #define URTW_REV_RTL8187B 0
121 { USB_VPI(USB_VENDOR_OVISLINK, 0x8187, URTW_REV_RTL8187L) },
122 { USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) },
123 { USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) },
124 { USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) },
125 { USB_VPI(USB_VENDOR_NETGEAR, 0x6100, URTW_REV_RTL8187L) },
126 { USB_VPI(USB_VENDOR_SPHAIRON, 0x0150, URTW_REV_RTL8187L) },
127 { USB_VPI(USB_VENDOR_QCOM, 0x6232, URTW_REV_RTL8187L) },
134 if (error != 0) \
136 } while (0)
139 if (error != 0) \
141 } while (0)
144 if (error != 0) \
146 } while (0)
149 if (error != 0) \
151 } while (0)
154 if (error != 0) \
156 } while (0)
159 if (error != 0) \
161 } while (0)
164 if (error != 0) \
166 } while (0)
169 if (error != 0) \
171 } while (0)
174 if (error != 0) \
176 } while (0)
184 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9d, 0x9c, 0x9b,
185 0x9a, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90,
186 0x8f, 0x8e, 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88, 0x87, 0x86, 0x85,
187 0x84, 0x83, 0x82, 0x81, 0x80, 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a,
188 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30, 0x2f,
189 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24,
190 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19,
191 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e,
192 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03,
193 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
194 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
195 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
199 0x5e, 0x5e, 0x5e, 0x5e, 0x5d, 0x5b, 0x59, 0x57, 0x55, 0x53, 0x51,
200 0x4f, 0x4d, 0x4b, 0x49, 0x47, 0x45, 0x43, 0x41, 0x3f, 0x3d, 0x3b,
201 0x39, 0x37, 0x35, 0x33, 0x31, 0x2f, 0x2d, 0x2b, 0x29, 0x27, 0x25,
202 0x23, 0x21, 0x1f, 0x1d, 0x1b, 0x19, 0x17, 0x15, 0x13, 0x11, 0x0f,
203 0x0d, 0x0b, 0x09, 0x07, 0x05, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01,
204 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x19, 0x19,
205 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x20, 0x21, 0x22, 0x23,
206 0x24, 0x25, 0x26, 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2a,
207 0x2a, 0x2b, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2d,
208 0x2e, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x30, 0x30, 0x31, 0x31,
209 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31,
210 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31
214 0x0000, /* dummy channel 0 */
215 0x085c, /* 1 */
216 0x08dc, /* 2 */
217 0x095c, /* 3 */
218 0x09dc, /* 4 */
219 0x0a5c, /* 5 */
220 0x0adc, /* 6 */
221 0x0b5c, /* 7 */
222 0x0bdc, /* 8 */
223 0x0c5c, /* 9 */
224 0x0cdc, /* 10 */
225 0x0d5c, /* 11 */
226 0x0ddc, /* 12 */
227 0x0e5c, /* 13 */
228 0x0f72, /* 14 */
232 0x23, 0x88, 0x7c, 0xa5, /* -82dbm */
233 0x23, 0x88, 0x7c, 0xb5, /* -82dbm */
234 0x23, 0x88, 0x7c, 0xc5, /* -82dbm */
235 0x33, 0x80, 0x79, 0xc5, /* -78dbm */
236 0x43, 0x78, 0x76, 0xc5, /* -74dbm */
237 0x53, 0x60, 0x73, 0xc5, /* -70dbm */
238 0x63, 0x58, 0x70, 0xc5, /* -66dbm */
242 { 0x00, 0x0067 }, { 0x01, 0x0fe0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
243 { 0x04, 0x0486 }, { 0x05, 0x0bc0 }, { 0x06, 0x0ae6 }, { 0x07, 0x082a },
244 { 0x08, 0x001f }, { 0x09, 0x0334 }, { 0x0a, 0x0fd4 }, { 0x0b, 0x0391 },
245 { 0x0c, 0x0050 }, { 0x0d, 0x06db }, { 0x0e, 0x0029 }, { 0x0f, 0x0914 },
249 { 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 },
250 { 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 },
251 { 0x08, 0x40 }, { 0x09, 0xfe }, { 0x0a, 0x09 }, { 0x0b, 0x80 },
252 { 0x0c, 0x01 }, { 0x0e, 0xd3 }, { 0x0f, 0x38 }, { 0x10, 0x84 },
253 { 0x11, 0x06 }, { 0x12, 0x20 }, { 0x13, 0x20 }, { 0x14, 0x00 },
254 { 0x15, 0x40 }, { 0x16, 0x00 }, { 0x17, 0x40 }, { 0x18, 0xef },
255 { 0x19, 0x19 }, { 0x1a, 0x20 }, { 0x1b, 0x76 }, { 0x1c, 0x04 },
256 { 0x1e, 0x95 }, { 0x1f, 0x75 }, { 0x20, 0x1f }, { 0x21, 0x27 },
257 { 0x22, 0x16 }, { 0x24, 0x46 }, { 0x25, 0x20 }, { 0x26, 0x90 },
258 { 0x27, 0x88 }
262 { 0x00, 0x98 }, { 0x03, 0x20 }, { 0x04, 0x7e }, { 0x05, 0x12 },
263 { 0x06, 0xfc }, { 0x07, 0x78 }, { 0x08, 0x2e }, { 0x10, 0x9b },
264 { 0x11, 0x88 }, { 0x12, 0x47 }, { 0x13, 0xd0 }, { 0x19, 0x00 },
265 { 0x1a, 0xa0 }, { 0x1b, 0x08 }, { 0x40, 0x86 }, { 0x41, 0x8d },
266 { 0x42, 0x15 }, { 0x43, 0x18 }, { 0x44, 0x1f }, { 0x45, 0x1e },
267 { 0x46, 0x1a }, { 0x47, 0x15 }, { 0x48, 0x10 }, { 0x49, 0x0a },
268 { 0x4a, 0x05 }, { 0x4b, 0x02 }, { 0x4c, 0x05 }
272 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
273 0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
274 0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
275 0x0584, 0x0585, 0x0588, 0x0589, 0x058a, 0x058b, 0x0643, 0x0644,
276 0x0645, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0688,
277 0x0689, 0x068a, 0x068b, 0x068c, 0x0742, 0x0743, 0x0744, 0x0745,
278 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0788, 0x0789,
279 0x078a, 0x078b, 0x078c, 0x078d, 0x0790, 0x0791, 0x0792, 0x0793,
280 0x0794, 0x0795, 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d,
281 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a8, 0x07a9,
282 0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07b0, 0x07b1, 0x07b2, 0x07b3,
283 0x07b4, 0x07b5, 0x07b8, 0x07b9, 0x07ba, 0x07bb, 0x07bb
287 0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd,
291 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e
295 0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02,
296 0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02,
297 0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02,
298 0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02,
299 0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03,
300 0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03
304 0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00,
305 0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00,
306 0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00,
307 0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00,
308 0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00,
309 0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00
313 0x80, 0x90, 0xa2, 0xb5, 0xcb, 0xe4
317 0x23, 0x15, 0xa5, /* -82-1dbm */
318 0x23, 0x15, 0xb5, /* -82-2dbm */
319 0x23, 0x15, 0xc5, /* -82-3dbm */
320 0x33, 0x15, 0xc5, /* -78dbm */
321 0x43, 0x15, 0xc5, /* -74dbm */
322 0x53, 0x15, 0xc5, /* -70dbm */
323 0x63, 0x15, 0xc5, /* -66dbm */
327 { 0x00, 0x02bf }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
328 { 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a },
329 { 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb },
330 { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 }
334 { 0x00, 0x00b7 }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
335 { 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a },
336 { 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb },
337 { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 }
341 {0x0f0, 0x32}, {0x0f1, 0x32}, {0x0f2, 0x00},
342 {0x0f3, 0x00}, {0x0f4, 0x32}, {0x0f5, 0x43},
343 {0x0f6, 0x00}, {0x0f7, 0x00}, {0x0f8, 0x46},
344 {0x0f9, 0xa4}, {0x0fa, 0x00}, {0x0fb, 0x00},
345 {0x0fc, 0x96}, {0x0fd, 0xa4}, {0x0fe, 0x00},
346 {0x0ff, 0x00}, {0x158, 0x4b}, {0x159, 0x00},
347 {0x15a, 0x4b}, {0x15b, 0x00}, {0x160, 0x4b},
348 {0x161, 0x09}, {0x162, 0x4b}, {0x163, 0x09},
349 {0x1ce, 0x0f}, {0x1cf, 0x00}, {0x1e0, 0xff},
350 {0x1e1, 0x0f}, {0x1e2, 0x00}, {0x1f0, 0x4e},
351 {0x1f1, 0x01}, {0x1f2, 0x02}, {0x1f3, 0x03},
352 {0x1f4, 0x04}, {0x1f5, 0x05}, {0x1f6, 0x06},
353 {0x1f7, 0x07}, {0x1f8, 0x08}, {0x24e, 0x00},
354 {0x20c, 0x04}, {0x221, 0x61}, {0x222, 0x68},
355 {0x223, 0x6f}, {0x224, 0x76}, {0x225, 0x7d},
356 {0x226, 0x84}, {0x227, 0x8d}, {0x24d, 0x08},
357 {0x250, 0x05}, {0x251, 0xf5}, {0x252, 0x04},
358 {0x253, 0xa0}, {0x254, 0x1f}, {0x255, 0x23},
359 {0x256, 0x45}, {0x257, 0x67}, {0x258, 0x08},
360 {0x259, 0x08}, {0x25a, 0x08}, {0x25b, 0x08},
361 {0x260, 0x08}, {0x261, 0x08}, {0x262, 0x08},
362 {0x263, 0x08}, {0x264, 0xcf}, {0x272, 0x56},
363 {0x273, 0x9a}, {0x034, 0xf0}, {0x035, 0x0f},
364 {0x05b, 0x40}, {0x084, 0x88}, {0x085, 0x24},
365 {0x088, 0x54}, {0x08b, 0xb8}, {0x08c, 0x07},
366 {0x08d, 0x00}, {0x094, 0x1b}, {0x095, 0x12},
367 {0x096, 0x00}, {0x097, 0x06}, {0x09d, 0x1a},
368 {0x09f, 0x10}, {0x0b4, 0x22}, {0x0be, 0x80},
369 {0x0db, 0x00}, {0x0ee, 0x00}, {0x091, 0x03},
370 {0x24c, 0x00}, {0x39f, 0x00}, {0x08c, 0x01},
371 {0x08d, 0x10}, {0x08e, 0x08}, {0x08f, 0x00}
375 { 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 },
376 { 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 },
377 { 0x08, 0x40 }, { 0x09, 0xfe }, { 0x0a, 0x08 }, { 0x0b, 0x80 },
378 { 0x0c, 0x01 }, { 0x0d, 0x43 }, { 0x0e, 0xd3 }, { 0x0f, 0x38 },
379 { 0x10, 0x84 }, { 0x11, 0x07 }, { 0x12, 0x20 }, { 0x13, 0x20 },
380 { 0x14, 0x00 }, { 0x15, 0x40 }, { 0x16, 0x00 }, { 0x17, 0x40 },
381 { 0x18, 0xef }, { 0x19, 0x19 }, { 0x1a, 0x20 }, { 0x1b, 0x15 },
382 { 0x1c, 0x04 }, { 0x1d, 0xc5 }, { 0x1e, 0x95 }, { 0x1f, 0x75 },
383 { 0x20, 0x1f }, { 0x21, 0x17 }, { 0x22, 0x16 }, { 0x23, 0x80 },
384 { 0x24, 0x46 }, { 0x25, 0x00 }, { 0x26, 0x90 }, { 0x27, 0x88 }
388 { 0x00, 0x10 }, { 0x01, 0x0d }, { 0x02, 0x01 }, { 0x03, 0x00 },
389 { 0x04, 0x14 }, { 0x05, 0xfb }, { 0x06, 0xfb }, { 0x07, 0x60 },
390 { 0x08, 0x00 }, { 0x09, 0x60 }, { 0x0a, 0x00 }, { 0x0b, 0x00 },
391 { 0x0c, 0x00 }, { 0x0d, 0x5c }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
392 { 0x10, 0x40 }, { 0x11, 0x00 }, { 0x12, 0x40 }, { 0x13, 0x00 },
393 { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0xa8 }, { 0x17, 0x26 },
394 { 0x18, 0x32 }, { 0x19, 0x33 }, { 0x1a, 0x07 }, { 0x1b, 0xa5 },
395 { 0x1c, 0x6f }, { 0x1d, 0x55 }, { 0x1e, 0xc8 }, { 0x1f, 0xb3 },
396 { 0x20, 0x0a }, { 0x21, 0xe1 }, { 0x22, 0x2C }, { 0x23, 0x8a },
397 { 0x24, 0x86 }, { 0x25, 0x83 }, { 0x26, 0x34 }, { 0x27, 0x0f },
398 { 0x28, 0x4f }, { 0x29, 0x24 }, { 0x2a, 0x6f }, { 0x2b, 0xc2 },
399 { 0x2c, 0x6b }, { 0x2d, 0x40 }, { 0x2e, 0x80 }, { 0x2f, 0x00 },
400 { 0x30, 0xc0 }, { 0x31, 0xc1 }, { 0x32, 0x58 }, { 0x33, 0xf1 },
401 { 0x34, 0x00 }, { 0x35, 0xe4 }, { 0x36, 0x90 }, { 0x37, 0x3e },
402 { 0x38, 0x6d }, { 0x39, 0x3c }, { 0x3a, 0xfb }, { 0x3b, 0x07 }
406 { 0x00, 0x98 }, { 0x03, 0x20 }, { 0x04, 0x7e }, { 0x05, 0x12 },
407 { 0x06, 0xfc }, { 0x07, 0x78 }, { 0x08, 0x2e }, { 0x09, 0x11 },
408 { 0x0a, 0x17 }, { 0x0b, 0x11 }, { 0x10, 0x9b }, { 0x11, 0x88 },
409 { 0x12, 0x47 }, { 0x13, 0xd0 }, { 0x19, 0x00 }, { 0x1a, 0xa0 },
410 { 0x1b, 0x08 }, { 0x1d, 0x00 }, { 0x40, 0x86 }, { 0x41, 0x9d },
411 { 0x42, 0x15 }, { 0x43, 0x18 }, { 0x44, 0x36 }, { 0x45, 0x35 },
412 { 0x46, 0x2e }, { 0x47, 0x25 }, { 0x48, 0x1c }, { 0x49, 0x12 },
413 { 0x4a, 0x09 }, { 0x4b, 0x04 }, { 0x4c, 0x05 }
417 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0008, 0x0009,
418 0x000a, 0x000b, 0x0102, 0x0103, 0x0104, 0x0105, 0x0140, 0x0141,
419 0x0142, 0x0143, 0x0144, 0x0145, 0x0180, 0x0181, 0x0182, 0x0183,
420 0x0184, 0x0185, 0x0188, 0x0189, 0x018a, 0x018b, 0x0243, 0x0244,
421 0x0245, 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0288,
422 0x0289, 0x028a, 0x028b, 0x028c, 0x0342, 0x0343, 0x0344, 0x0345,
423 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0388, 0x0389,
424 0x038a, 0x038b, 0x038c, 0x038d, 0x0390, 0x0391, 0x0392, 0x0393,
425 0x0394, 0x0395, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d,
426 0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a8, 0x03a9,
427 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03b0, 0x03b1, 0x03b2, 0x03b3,
428 0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
432 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
433 0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
434 0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
435 0x0584, 0x0585, 0x0588, 0x0589, 0x058a, 0x058b, 0x0643, 0x0644,
436 0x0645, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0688,
437 0x0689, 0x068a, 0x068b, 0x068c, 0x0742, 0x0743, 0x0744, 0x0745,
438 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0788, 0x0789,
439 0x078a, 0x078b, 0x078c, 0x078d, 0x0790, 0x0791, 0x0792, 0x0793,
440 0x0794, 0x0795, 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d,
441 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a8, 0x07a9,
442 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03b0, 0x03b1, 0x03b2, 0x03b3,
443 0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
447 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
448 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
449 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
450 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
451 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
452 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
456 0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04
460 0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00
464 0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04,
465 0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03,
466 0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03,
467 0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03
471 0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00,
472 0x30, 0x2f, 0x29, 0x15, 0x00, 0x00, 0x00, 0x00,
473 0x30, 0x2f, 0x29, 0x15, 0x00, 0x00, 0x00, 0x00,
474 0x30, 0x2f, 0x29, 0x15, 0x00, 0x00, 0x00, 0x00
478 { 2, 0 }, { 4, 1 }, { 11, 2 }, { 12, 4 }, { 18, 5 },
483 #if 0
485 { 0xf0, 0x32, 0 }, { 0xf1, 0x32, 0 }, { 0xf2, 0x00, 0 },
486 { 0xf3, 0x00, 0 }, { 0xf4, 0x32, 0 }, { 0xf5, 0x43, 0 },
487 { 0xf6, 0x00, 0 }, { 0xf7, 0x00, 0 }, { 0xf8, 0x46, 0 },
488 { 0xf9, 0xa4, 0 }, { 0xfa, 0x00, 0 }, { 0xfb, 0x00, 0 },
489 { 0xfc, 0x96, 0 }, { 0xfd, 0xa4, 0 }, { 0xfe, 0x00, 0 },
490 { 0xff, 0x00, 0 }, { 0x58, 0x4b, 1 }, { 0x59, 0x00, 1 },
491 { 0x5a, 0x4b, 1 }, { 0x5b, 0x00, 1 }, { 0x60, 0x4b, 1 },
492 { 0x61, 0x09, 1 }, { 0x62, 0x4b, 1 }, { 0x63, 0x09, 1 },
493 { 0xce, 0x0f, 1 }, { 0xcf, 0x00, 1 }, { 0xe0, 0xff, 1 },
494 { 0xe1, 0x0f, 1 }, { 0xe2, 0x00, 1 }, { 0xf0, 0x4e, 1 },
495 { 0xf1, 0x01, 1 }, { 0xf2, 0x02, 1 }, { 0xf3, 0x03, 1 },
496 { 0xf4, 0x04, 1 }, { 0xf5, 0x05, 1 }, { 0xf6, 0x06, 1 },
497 { 0xf7, 0x07, 1 }, { 0xf8, 0x08, 1 }, { 0x4e, 0x00, 2 },
498 { 0x0c, 0x04, 2 }, { 0x21, 0x61, 2 }, { 0x22, 0x68, 2 },
499 { 0x23, 0x6f, 2 }, { 0x24, 0x76, 2 }, { 0x25, 0x7d, 2 },
500 { 0x26, 0x84, 2 }, { 0x27, 0x8d, 2 }, { 0x4d, 0x08, 2 },
501 { 0x50, 0x05, 2 }, { 0x51, 0xf5, 2 }, { 0x52, 0x04, 2 },
502 { 0x53, 0xa0, 2 }, { 0x54, 0x1f, 2 }, { 0x55, 0x23, 2 },
503 { 0x56, 0x45, 2 }, { 0x57, 0x67, 2 }, { 0x58, 0x08, 2 },
504 { 0x59, 0x08, 2 }, { 0x5a, 0x08, 2 }, { 0x5b, 0x08, 2 },
505 { 0x60, 0x08, 2 }, { 0x61, 0x08, 2 }, { 0x62, 0x08, 2 },
506 { 0x63, 0x08, 2 }, { 0x64, 0xcf, 2 }, { 0x72, 0x56, 2 },
507 { 0x73, 0x9a, 2 }, { 0x34, 0xf0, 0 }, { 0x35, 0x0f, 0 },
508 { 0x5b, 0x40, 0 }, { 0x84, 0x88, 0 }, { 0x85, 0x24, 0 },
509 { 0x88, 0x54, 0 }, { 0x8b, 0xb8, 0 }, { 0x8c, 0x07, 0 },
510 { 0x8d, 0x00, 0 }, { 0x94, 0x1b, 0 }, { 0x95, 0x12, 0 },
511 { 0x96, 0x00, 0 }, { 0x97, 0x06, 0 }, { 0x9d, 0x1a, 0 },
512 { 0x9f, 0x10, 0 }, { 0xb4, 0x22, 0 }, { 0xbe, 0x80, 0 },
513 { 0xdb, 0x00, 0 }, { 0xee, 0x00, 0 }, { 0x91, 0x03, 0 },
514 { 0x4c, 0x00, 2 }, { 0x9f, 0x00, 3 }, { 0x8c, 0x01, 0 },
515 { 0x8d, 0x10, 0 }, { 0x8e, 0x08, 0 }, { 0x8f, 0x00, 0 }
526 .endpoint = 0x83,
538 .endpoint = 0x89,
600 .endpoint = 0xc,
616 .endpoint = 0x81,
628 .endpoint = 0x2,
640 .endpoint = 0x3,
812 usb_callout_init_mtx(&sc->sc_led_ch, &sc->sc_mtx, 0);
813 TASK_INIT(&sc->sc_led_task, 0, urtw_ledtask, sc);
814 TASK_INIT(&sc->sc_updateslot_task, 0, urtw_updateslottask, sc);
815 callout_init(&sc->sc_watchdog_ch, 0);
838 URTW_8187B_BULK_TX_BE], 0);
842 URTW_8187L_BULK_TX_LOW], 0);
852 if (error != 0)
855 if (error != 0)
858 if (error != 0)
861 if (error != 0)
915 return (0);
959 for (x = 0; x != n_xfers; x++)
974 return (0);
980 urtw_free_data_list(sc, sc->sc_tx, URTW_TX_DATA_LIST_COUNT, 0);
995 for (i = 0; i < ndata; i++) {
1030 flags | IEEE80211_CLONE_NOBEACONS, bssid) != 0) {
1069 if (error != 0)
1073 sc->sc_txtimer = 0;
1077 if (ret != 0)
1080 if (ret != 0)
1086 if (error != 0)
1089 if (error != 0)
1119 urtw_write8_m(sc, 0x61, 0x10);
1120 urtw_read8_m(sc, 0x62, &data8);
1121 urtw_write8_m(sc, 0x62, data8 & ~(1 << 5));
1122 urtw_write8_m(sc, 0x62, data8 | (1 << 5));
1137 if (error != 0)
1146 error = urtw_write8e(sc, 0x41, 0xf4);
1149 error = urtw_write8e(sc, 0x40, 0x00);
1152 error = urtw_write8e(sc, 0x42, 0x00);
1155 error = urtw_write8e(sc, 0x42, 0x01);
1158 error = urtw_write8e(sc, 0x40, 0x0f);
1161 error = urtw_write8e(sc, 0x42, 0x00);
1164 error = urtw_write8e(sc, 0x42, 0x01);
1168 urtw_read8_m(sc, 0xdb, &data8);
1169 urtw_write8_m(sc, 0xdb, data8 | (1 << 2));
1170 urtw_write16_m(sc, 0x372, 0x59fa);
1171 urtw_write16_m(sc, 0x374, 0x59d2);
1172 urtw_write16_m(sc, 0x376, 0x59d2);
1173 urtw_write16_m(sc, 0x378, 0x19fa);
1174 urtw_write16_m(sc, 0x37a, 0x19fa);
1175 urtw_write16_m(sc, 0x37c, 0x00d0);
1176 urtw_write8_m(sc, 0x61, 0);
1178 urtw_write8_m(sc, 0x180, 0x0f);
1179 urtw_write8_m(sc, 0x183, 0x03);
1180 urtw_write8_m(sc, 0xda, 0x10);
1181 urtw_write8_m(sc, 0x24d, 0x08);
1182 urtw_write32_m(sc, URTW_HSSI_PARA, 0x0600321b);
1184 urtw_write16_m(sc, 0x1ec, 0x800); /* RX MAX SIZE */
1194 urtw_write32_m(sc, URTW_MAC0, ((const uint32_t *)macaddr)[0]);
1195 urtw_write16_m(sc, URTW_MAC4, ((const uint32_t *)macaddr)[1] & 0xffff);
1213 urtw_write8_m(sc, URTW_ADDR_MAGIC1, 0);
1214 urtw_write8_m(sc, URTW_GPIO, 0);
1219 if (error != 0)
1239 urtw_write32_m(sc, URTW_INT_TIMEOUT, 0);
1240 urtw_write8_m(sc, URTW_WPA_CONFIG, 0);
1241 urtw_write8_m(sc, URTW_RATE_FALLBACK, URTW_RATE_FALLBACK_ENABLE | 0x1);
1243 if (error != 0)
1247 if (error != 0)
1254 urtw_write16_m(sc, URTW_ADDR_MAGIC2, 0x10);
1255 urtw_write8_m(sc, URTW_TALLY_SEL, 0x80);
1256 urtw_write8_m(sc, URTW_ADDR_MAGIC3, 0x60);
1258 urtw_write16_m(sc, URTW_PSR, 0);
1262 if (error != 0)
1298 data8 = (data8 & 0x2) | URTW_CMD_RST;
1301 for (i = 0; i < 20; i++) {
1326 req, data, 0, NULL, 250 /* ms */);
1327 if (err == 0)
1356 if (error != 0)
1389 for (i = 0; i < max; i++)
1397 int startall = 0;
1405 if (ic->ic_nrunning > 0) {
1407 if (ic->ic_promisc > 0 || ic->ic_allmulti > 0)
1427 if ((sc->sc_flags & URTW_RUNNING) == 0) {
1439 return (0);
1451 if ((sc->sc_flags & URTW_RUNNING) == 0)
1464 if (urtw_tx_start(sc, ni, m, bf, URTW_PRIORITY_NORMAL) != 0) {
1483 for (i = 0; i < ndata; i++) {
1503 return (0);
1517 if (error != 0)
1523 for (i = 0; i < URTW_RX_DATA_LIST_COUNT; i++)
1526 return (0);
1537 if (error != 0)
1544 for (i = 0; i < URTW_TX_DATA_LIST_COUNT; i++)
1548 return (0);
1572 if (urtw_tx_start(sc, ni, m, bf, URTW_PRIORITY_LOW) != 0) {
1580 return (0);
1603 memset(bands, 0, sizeof(bands));
1606 ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0);
1639 if (error != 0)
1654 if (error != 0)
1692 int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, type,
1693 pkttime = 0, txdur = 0, isshort = 0, xferlen, ismcast;
1701 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
1723 tap->wt_flags = 0;
1728 (m0->m_flags & M_EAPOL) != 0) {
1744 IEEE80211_CRC_LEN, rate, 0, 0);
1746 acktime = urtw_compute_txtime(14, 2,0, 0);
1749 ctsenable = 0;
1750 rtstime = urtw_compute_txtime(URTW_ACKCTS_LEN, 2, 0, 0);
1751 ctstime = urtw_compute_txtime(14, 2, 0, 0);
1753 IEEE80211_CRC_LEN, rate, 0, isshort);
1758 rtsenable = ctsenable = rtsdur = 0;
1760 IEEE80211_CRC_LEN, rate, 0, isshort);
1766 IEEE80211_CRC_LEN, rate, 0, isshort) +
1776 if ((0 == xferlen % 64) || (0 == xferlen % 512))
1779 memset(data->buf, 0, URTW_TX_MAXSIZE);
1780 flags = m0->m_pkthdr.len & 0xfff;
1785 (sc->sc_currate != 0))
1790 flags |= (sc->sc_currate & 0xf) << URTW_TX_FLAG_TXRATE_SHIFT;
1809 m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1));
1823 m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1));
1851 if (error != 0)
1854 return (0);
1864 usb_error_t error = 0;
1886 urtw_write32_m(sc, URTW_BSSID, ((uint32_t *)ni->ni_bssid)[0]);
1893 urtw_write16_m(sc, URTW_BEACON_INTERVAL, 0x64);
1896 if (error != 0)
1916 if (sc->sc_txtimer > 0) {
1917 if (--sc->sc_txtimer == 0) {
1951 for (i = 0; i <= basic_rate; i++)
1964 for (i = 0; i < nitems(urtw_ratetable); i++) {
1969 return (0);
1998 "unsupported operation mode 0x%x\n",
2021 USETW(req.wValue, (val & 0xff) | 0xff00);
2022 USETW(req.wIndex, (val >> 8) & 0x3);
2039 USETW(req.wValue, (val & 0xff) | 0xff00);
2040 USETW(req.wIndex, (val >> 8) & 0x3);
2057 USETW(req.wValue, (val & 0xff) | 0xff00);
2058 USETW(req.wIndex, (val >> 8) & 0x3);
2074 USETW(req.wValue, (val & 0xff) | 0xff00);
2075 USETW(req.wIndex, (val >> 8) & 0x3);
2090 USETW(req.wValue, (val & 0xff) | 0xff00);
2091 USETW(req.wIndex, (val >> 8) & 0x3);
2106 USETW(req.wValue, (val & 0xff) | 0xff00);
2107 USETW(req.wIndex, (val >> 8) & 0x3);
2121 if (error != 0)
2123 ic->ic_macaddr[0] = data & 0xff;
2124 ic->ic_macaddr[1] = (data & 0xff00) >> 8;
2126 if (error != 0)
2128 ic->ic_macaddr[2] = data & 0xff;
2129 ic->ic_macaddr[3] = (data & 0xff00) >> 8;
2131 if (error != 0)
2133 ic->ic_macaddr[4] = data & 0xff;
2134 ic->ic_macaddr[5] = (data & 0xff00) >> 8;
2144 int16_t addrstr[8], data16, readcmd[] = { 1, 1, 0 };
2148 *data = 0;
2155 if (error != 0)
2158 if (error != 0)
2161 if (error != 0)
2165 addrstr[0] = addr & (1 << 7);
2172 addrstr[7] = addr & (1 << 0);
2175 addrstr[0] = addr & (1 << 5);
2180 addrstr[5] = addr & (1 << 0);
2183 if (error != 0)
2186 error = urtw_eprom_writebit(sc, 0);
2187 if (error != 0)
2190 for (i = 0; i < 16; i++) {
2192 if (error != 0)
2195 if (error != 0)
2202 if (error != 0)
2205 if (error != 0)
2256 *data = (data8 & URTW_EPROM_READBIT) ? 1 : 0;
2270 if (bit != 0)
2282 int i = 0;
2283 usb_error_t error = 0;
2285 for (i = 0; i < buflen; i++) {
2287 if (error != 0)
2290 if (error != 0)
2305 if (error != 0)
2307 sc->sc_txpwr_cck_base = data & 0xf;
2308 sc->sc_txpwr_ofdm_base = (data >> 4) & 0xf;
2310 for (i = 1, j = 0; i < 6; i += 2, j++) {
2312 if (error != 0)
2314 sc->sc_txpwr_cck[i] = data & 0xf;
2315 sc->sc_txpwr_cck[i + 1] = (data & 0xf00) >> 8;
2316 sc->sc_txpwr_ofdm[i] = (data & 0xf0) >> 4;
2317 sc->sc_txpwr_ofdm[i + 1] = (data & 0xf000) >> 12;
2319 for (i = 1, j = 0; i < 4; i += 2, j++) {
2321 if (error != 0)
2323 sc->sc_txpwr_cck[i + 6] = data & 0xf;
2324 sc->sc_txpwr_cck[i + 6 + 1] = (data & 0xf00) >> 8;
2325 sc->sc_txpwr_ofdm[i + 6] = (data & 0xf0) >> 4;
2326 sc->sc_txpwr_ofdm[i + 6 + 1] = (data & 0xf000) >> 12;
2330 if (error != 0)
2332 sc->sc_txpwr_cck[1 + 6 + 4] = data & 0xf;
2333 sc->sc_txpwr_ofdm[1 + 6 + 4] = (data & 0xf0) >> 4;
2334 error = urtw_eprom_read32(sc, 0x0a, &data);
2335 if (error != 0)
2337 sc->sc_txpwr_cck[2 + 6 + 4] = data & 0xf;
2338 sc->sc_txpwr_ofdm[2 + 6 + 4] = (data & 0xf0) >> 4;
2339 error = urtw_eprom_read32(sc, 0x1c, &data);
2340 if (error != 0)
2342 sc->sc_txpwr_cck[3 + 6 + 4] = data & 0xf;
2343 sc->sc_txpwr_cck[3 + 6 + 4 + 1] = (data & 0xf00) >> 8;
2344 sc->sc_txpwr_ofdm[3 + 6 + 4] = (data & 0xf0) >> 4;
2345 sc->sc_txpwr_ofdm[3 + 6 + 4 + 1] = (data & 0xf000) >> 12;
2347 for (i = 1, j = 0; i < 4; i += 2, j++) {
2350 if (error != 0)
2352 sc->sc_txpwr_cck[i + 6 + 4] = data & 0xf;
2353 sc->sc_txpwr_cck[i + 6 + 4 + 1] = (data & 0xf00) >> 8;
2354 sc->sc_txpwr_ofdm[i + 6 + 4] = (data & 0xf0) >> 4;
2355 sc->sc_txpwr_ofdm[i + 6 + 4 + 1] = (data & 0xf000) >> 12;
2371 urtw_read8_m(sc, 0xe1, &data8);
2373 case 0:
2403 if (error != 0)
2405 switch (data & 0xff) {
2408 if (error != 0)
2410 if (ret == 0) {
2432 "unsupported RF chip %d\n", data & 0xff);
2439 ((data & 0xff) == URTW_EPROM_RFCHIPID_RTL8225U) ? "rtl8225u" :
2441 (sc->sc_flags & URTW_RTL8187B) ? ((data8 == 0) ? "b" :
2456 if (error != 0)
2497 urtw_write32_m(sc, URTW_RF_TIMING, 0x000a8008);
2499 urtw_write16_m(sc, URTW_BRSR, 0xffff);
2500 urtw_write32_m(sc, URTW_RF_PARA, 0x100044);
2505 urtw_write8_m(sc, URTW_CONFIG3, 0x44);
2515 for (i = 0; i < nitems(urtw_8225_rf_part1); i++) {
2530 for (i = 0; i < 95; i++) {
2540 for (i = 0; i < 128; i++) {
2541 urtw_8187_write_phy_ofdm(sc, 0xb, urtw_8225_agc[i]);
2543 urtw_8187_write_phy_ofdm(sc, 0xa, (uint8_t)i + 0x80);
2547 for (i = 0; i < nitems(urtw_8225_rf_part2); i++) {
2557 for (i = 0; i < nitems(urtw_8225_rf_part3); i++) {
2563 urtw_write8_m(sc, URTW_TESTR, 0x0d);
2569 urtw_8187_write_phy_cck(sc, 0x10, 0x9b);
2571 urtw_8187_write_phy_ofdm(sc, 0x26, 0x90);
2574 /* TX ant A, 0x0 for B */
2575 error = urtw_8185_tx_antenna(sc, 0x3);
2578 urtw_write32_m(sc, URTW_HSSI_PARA, 0x3dc00002);
2588 usb_error_t error = 0;
2590 urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1ff7);
2610 data = data & 0xff;
2618 data = data & 0xff;
2619 return urtw_8187_write_phy(sc, addr, data | 0x10000);
2628 phyw = ((data << 8) | (addr | 0x80));
2629 urtw_write8_m(sc, URTW_PHY_MAGIC4, ((phyw & 0xff000000) >> 24));
2630 urtw_write8_m(sc, URTW_PHY_MAGIC3, ((phyw & 0x00ff0000) >> 16));
2631 urtw_write8_m(sc, URTW_PHY_MAGIC2, ((phyw & 0x0000ff00) >> 8));
2632 urtw_write8_m(sc, URTW_PHY_MAGIC1, ((phyw & 0x000000ff)));
2643 urtw_8187_write_phy_ofdm(sc, 0x0d, urtw_8225_gain[gain * 4]);
2644 urtw_8187_write_phy_ofdm(sc, 0x1b, urtw_8225_gain[gain * 4 + 2]);
2645 urtw_8187_write_phy_ofdm(sc, 0x1d, urtw_8225_gain[gain * 4 + 3]);
2646 urtw_8187_write_phy_ofdm(sc, 0x23, urtw_8225_gain[gain * 4 + 1]);
2657 urtw_write8_m(sc, URTW_RF_PINS_SELECT + 1, 0);
2658 urtw_write8_m(sc, URTW_GPIO, 0);
2659 error = urtw_read8e(sc, 0x53, &data);
2662 error = urtw_write8e(sc, 0x53, data | (1 << 7));
2666 urtw_write8_m(sc, URTW_GPIO, 0x20);
2667 urtw_write8_m(sc, URTW_GP_ENABLE, 0);
2669 urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x80);
2670 urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x80);
2671 urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x80);
2698 error = urtw_8225_write_s16(sc, addr, 0x8225, &data);
2699 if (error != 0)
2718 usb_error_t error = 0;
2727 buf[0] = (data16 & 0x00ff);
2728 buf[1] = (data16 & 0xff00) >> 8;
2754 if (sens < 0 || sens > 6)
2769 urtw_8187_write_phy_cck(sc, 0x41, urtw_8225_threshold[sens]);
2781 uint8_t cck_pwrlvl = sc->sc_txpwr_cck[chan] & 0xff;
2782 uint8_t ofdm_pwrlvl = sc->sc_txpwr_ofdm[chan] & 0xff;
2798 for (i = 0; i < 8; i++) {
2799 urtw_8187_write_phy_cck(sc, 0x44 + i,
2815 urtw_8187_write_phy_ofdm(sc, 2, 0x42);
2816 urtw_8187_write_phy_ofdm(sc, 6, 0);
2817 urtw_8187_write_phy_ofdm(sc, 8, 0);
2821 urtw_8187_write_phy_ofdm(sc, 0x5, urtw_8225_txpwr_ofdm[idx]);
2822 urtw_8187_write_phy_ofdm(sc, 0x7, urtw_8225_txpwr_ofdm[idx]);
2834 urtw_8225_write(sc, 0x4, 0x1f);
2878 urtw_write32_m(sc, URTW_RF_TIMING, 0x000a8008);
2880 urtw_write16_m(sc, URTW_BRSR, 0xffff);
2881 urtw_write32_m(sc, URTW_RF_PARA, 0x100044);
2886 urtw_write8_m(sc, URTW_CONFIG3, 0x44);
2897 for (i = 0; i < nitems(urtw_8225v2_rf_part1); i++) {
2906 for (i = 0; i < 95; i++) {
2926 if (error != 0)
2929 device_printf(sc->sc_dev, "expect 0xe6!! (0x%x)\n", data32);
2938 if (error != 0)
2947 for (i = 0; i < 128; i++) {
2948 urtw_8187_write_phy_ofdm(sc, 0xb, urtw_8225_agc[i]);
2949 urtw_8187_write_phy_ofdm(sc, 0xa, (uint8_t)i + 0x80);
2952 for (i = 0; i < nitems(urtw_8225v2_rf_part2); i++) {
2961 for (i = 0; i < nitems(urtw_8225v2_rf_part3); i++) {
2966 urtw_write8_m(sc, URTW_TESTR, 0x0d);
2972 urtw_8187_write_phy_cck(sc, 0x10, 0x9b);
2973 urtw_8187_write_phy_ofdm(sc, 0x26, 0x90);
2975 /* TX ant A, 0x0 for B */
2976 error = urtw_8185_tx_antenna(sc, 0x3);
2979 urtw_write32_m(sc, URTW_HSSI_PARA, 0x3dc00002);
3008 uint32_t d2w = ((uint32_t)(addr & 0x1f)) << 27;
3009 uint32_t mask = 0x80000000, value = 0;
3023 for (i = 0; i < (wlen / 2); i++, mask = mask >> 1) {
3024 bit = ((d2w & mask) != 0) ? 1 : 0;
3037 bit = ((d2w & mask) != 0) ? 1 : 0;
3055 mask = 0x800;
3056 for (i = 0; i < rlen; i++, mask = mask >> 1) {
3071 value |= ((tmp & URTW_BB_HOST_BANG_CLK) ? mask : 0);
3097 uint8_t cck_pwrlvl = sc->sc_txpwr_cck[chan] & 0xff;
3098 uint8_t ofdm_pwrlvl = sc->sc_txpwr_ofdm[chan] & 0xff;
3108 for (i = 0; i < 8; i++)
3109 urtw_8187_write_phy_cck(sc, 0x44 + i, cck_pwrtable[i]);
3125 urtw_8187_write_phy_ofdm(sc, 2, 0x42);
3126 urtw_8187_write_phy_ofdm(sc, 5, 0x0);
3127 urtw_8187_write_phy_ofdm(sc, 6, 0x40);
3128 urtw_8187_write_phy_ofdm(sc, 7, 0x0);
3129 urtw_8187_write_phy_ofdm(sc, 8, 0x40);
3146 urtw_8187_write_phy_ofdm(sc, 0x0d, gainp[gain * 3]);
3148 urtw_8187_write_phy_ofdm(sc, 0x1b, gainp[gain * 3 + 1]);
3150 urtw_8187_write_phy_ofdm(sc, 0x1d, gainp[gain * 3 + 2]);
3152 urtw_8187_write_phy_ofdm(sc, 0x21, 0x17);
3175 if (error != 0)
3178 *ret = 0;
3181 if (error != 0)
3184 *ret = 0;
3210 urtw_write16_m(sc, URTW_BRSR_8187B, 0xfff);
3223 #define URTW_ARFR 0x1e0
3224 urtw_write16_m(sc, URTW_ARFR, 0xfff);
3230 urtw_write8_m(sc, URTW_MSR, data8 & 0xf3);
3237 #define URTW_FEMR_FOR_8187B 0x1d4
3238 urtw_write16_m(sc, URTW_FEMR_FOR_8187B, 0xffff);
3242 data8 = (data8 & 0x3f) | 0x80;
3255 urtw_write8_m(sc, URTW_WPA_CONFIG, 0);
3260 for (i = 0; i < nitems(urtw_8225v2b_rf_part1); i++)
3263 urtw_write16_m(sc, URTW_TID_AC_MAP, 0xfa50);
3264 urtw_write16_m(sc, URTW_INT_MIG, 0x0000);
3265 urtw_write32_m(sc, 0x1f0, 0);
3266 urtw_write32_m(sc, 0x1f4, 0);
3267 urtw_write8_m(sc, 0x1f8, 0);
3268 urtw_write32_m(sc, URTW_RF_TIMING, 0x4001);
3270 #define URTW_RFSW_CTRL 0x272
3271 urtw_write16_m(sc, URTW_RFSW_CTRL, 0x569a);
3288 urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x0480);
3289 urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x2488);
3290 urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1fff);
3293 for (i = 0; i < nitems(urtw_8225v2b_rf_part0); i++) {
3298 urtw_8225_write(sc, 0x00, 0x01b7);
3300 for (i = 0; i < 95; i++) {
3308 urtw_8225_write(sc, URTW_8225_ADDR_3_MAGIC, 0x080);
3310 urtw_8225_write(sc, URTW_8225_ADDR_5_MAGIC, 0x004);
3312 urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x0b7);
3315 urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0xc4d);
3317 urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0x44d);
3319 urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x2bf);
3322 urtw_write8_m(sc, URTW_TX_GAIN_CCK, 0x03);
3323 urtw_write8_m(sc, URTW_TX_GAIN_OFDM, 0x07);
3324 urtw_write8_m(sc, URTW_TX_ANTENNA, 0x03);
3326 urtw_8187_write_phy_ofdm(sc, 0x80, 0x12);
3327 for (i = 0; i < 128; i++) {
3330 data = (urtw_8225z2_agc[i] << 8) | 0x0000008f;
3331 addr = ((i + 0x80) << 8) | 0x0000008e;
3333 urtw_8187_write_phy_ofdm(sc, data & 0x7f, (data >> 8) & 0xff);
3334 urtw_8187_write_phy_ofdm(sc, addr & 0x7f, (addr >> 8) & 0xff);
3335 urtw_8187_write_phy_ofdm(sc, 0x0e, 0x00);
3337 urtw_8187_write_phy_ofdm(sc, 0x80, 0x10);
3339 for (i = 0; i < nitems(urtw_8225v2b_rf_part2); i++)
3342 urtw_write32_m(sc, URTW_8187B_AC_VO, (7 << 12) | (3 << 8) | 0x1c);
3343 urtw_write32_m(sc, URTW_8187B_AC_VI, (7 << 12) | (3 << 8) | 0x1c);
3344 urtw_write32_m(sc, URTW_8187B_AC_BE, (7 << 12) | (3 << 8) | 0x1c);
3345 urtw_write32_m(sc, URTW_8187B_AC_BK, (7 << 12) | (3 << 8) | 0x1c);
3347 urtw_8187_write_phy_ofdm(sc, 0x97, 0x46);
3348 urtw_8187_write_phy_ofdm(sc, 0xa4, 0xb6);
3349 urtw_8187_write_phy_ofdm(sc, 0x85, 0xfc);
3350 urtw_8187_write_phy_cck(sc, 0xc1, 0x88);
3377 uint8_t cck_pwrlvl = sc->sc_txpwr_cck[chan] & 0xff;
3378 uint8_t ofdm_pwrlvl = sc->sc_txpwr_ofdm[chan] & 0xff;
3384 (cck_pwrlvl + ((sc->sc_flags & URTW_RTL8187B_REV_B) ? 0 : 7));
3391 cck_pwrtable += (cck_pwrlvl <= 6) ? 0 :
3394 cck_pwrtable += (cck_pwrlvl <= 5) ? 0 :
3397 for (i = 0; i < 8; i++)
3398 urtw_8187_write_phy_cck(sc, 0x44 + i, cck_pwrtable[i]);
3416 urtw_8187_write_phy_ofdm(sc, 0x87, 0x60);
3417 urtw_8187_write_phy_ofdm(sc, 0x89, 0x60);
3419 urtw_8187_write_phy_ofdm(sc, 0x87, 0x5c);
3420 urtw_8187_write_phy_ofdm(sc, 0x89, 0x5c);
3424 urtw_8187_write_phy_ofdm(sc, 0x87, 0x5c);
3425 urtw_8187_write_phy_ofdm(sc, 0x89, 0x5c);
3427 urtw_8187_write_phy_ofdm(sc, 0x87, 0x54);
3428 urtw_8187_write_phy_ofdm(sc, 0x89, 0x54);
3430 urtw_8187_write_phy_ofdm(sc, 0x87, 0x50);
3431 urtw_8187_write_phy_ofdm(sc, 0x89, 0x50);
3447 USETW(req.wValue, val | 0xfe00);
3448 USETW(req.wIndex, 0);
3462 USETW(req.wValue, val | 0xfe00);
3463 USETW(req.wIndex, 0);
3520 urtw_write16_m(sc, URTW_INTR_MASK, 0xffff);
3530 urtw_write16_m(sc, URTW_INTR_MASK, 0);
3553 error = urtw_write8e(sc, 0x18, 0x10);
3554 if (error != 0)
3556 error = urtw_write8e(sc, 0x18, 0x11);
3557 if (error != 0)
3559 error = urtw_write8e(sc, 0x18, 0x00);
3560 if (error != 0)
3565 data = (data & 0x2) | URTW_CMD_RST;
3593 usb_error_t error = 0;
3628 return (0);
3638 "unsupported LED mode 0x%x", mode);
3644 if (sc->sc_gpio_ledinprogress != 0)
3649 if (sc->sc_gpio_ledinprogress != 0)
3652 sc->sc_gpio_blinkstate = (sc->sc_gpio_ledon != 0) ?
3663 "unknown LED status 0x%x", sc->sc_gpio_ledstate);
3666 return (0);
3695 urtw_write8_m(sc, URTW_GPIO, 0x01);
3696 urtw_write8_m(sc, URTW_GP_ENABLE, 0x00);
3700 "unsupported LED PIN type 0x%x",
3707 "unsupported LED type 0x%x", type);
3731 "unsupported LED PIN type 0x%x",
3738 "unsupported LED type 0x%x", type);
3743 sc->sc_gpio_ledon = 0;
3765 "could not process a LED strategy 0x%x",
3778 uint8_t ing = 0;
3785 if (sc->sc_gpio_blinktime == 0)
3795 sc->sc_gpio_ledon == 0)
3801 sc->sc_gpio_blinktime = 0;
3802 sc->sc_gpio_ledinprogress = 0;
3803 return (0);
3815 "unknown LED status 0x%x",
3819 return (0);
3832 if (error != 0)
3835 if ((sc->sc_flags & URTW_RTL8187B) == 0) {
3858 (7 << 0) | /* long retry limit */
3931 ic->ic_promisc > 0 || ic->ic_allmulti > 0) {
3953 uint8_t noise = 0, rate;
3966 flen = le32toh(rx->flag) & 0xfff;
3970 rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf;
3985 flen = le32toh(rx->flag) & 0xfff;
3989 rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf;
4016 tap->wr_flags = 0;
4022 sc->sc_currate = (rate > 0) ? rate : sc->sc_currate;
4065 usbd_xfer_set_frame_data(xfer, 0, data->buf,
4110 #define URTW_STATUS_TYPE_BEACON_INTR 0
4126 type = (val >> 30) & 0x3;
4128 pktretry = val & 0xff;
4132 pktretry, (val >> 16) & 0xff);
4141 void *dma_buf = usbd_xfer_get_frame_buffer(xfer, 0);
4152 usbd_xfer_set_frame_len(xfer, 0, sizeof(uint64_t));
4174 ieee80211_tx_complete(data->ni, data->m, 0);
4178 sc->sc_txtimer = 0;
4209 usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen);
4266 rate == 44) ? (1) : (0);
4302 if ((framelen * 8 % (rate / 2)) != 0)
4307 + (((16 + 8 * framelen + 6) % n_dbps) ? 1 : 0);
4333 if ((sc->sc_flags & URTW_RUNNING) == 0) {
4338 urtw_write8_m(sc, URTW_SIFS, 0x22);
4343 urtw_write8_m(sc, URTW_8187B_EIFS, 0x5b);
4344 urtw_write8_m(sc, URTW_CARRIER_SCOUNT, 0x5b);
4346 urtw_write8_m(sc, URTW_SIFS, 0x22);
4353 urtw_write8_m(sc, URTW_DIFS, 0x14);
4354 urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14);
4355 urtw_write8_m(sc, URTW_CW_VAL, 0x73);
4357 urtw_write8_m(sc, URTW_DIFS, 0x24);
4358 urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x24);
4359 urtw_write8_m(sc, URTW_CW_VAL, 0xa5);
4370 SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
4387 URTW_SYSCTL_STAT_ADD32(ctx, child, "1m", &stats->txrates[0],