15 #define nelem(a) (sizeof(a) / sizeof(a[0]))
18 #define counted(foo) { nelem(foo), foo }
19 #define null_counted() { 0, NULL }
61 static const u16 reset_program_a_v1_or_v2[] = {
64 static const u16 reset_program_b_v1_or_v2[] = {
65 0x0010, 0xFE00, 0xA021, 0xFF00, 0x8111, 0x0009, 0x0CA4, 0x0114,
66 0x0280, 0x04F8, 0xFE00, 0x6F25, 0x06E0, 0x0010, 0xFC00, 0x0121,
67 0xFC00, 0x0225, 0xFE00, 0x7125, 0xFE00, 0x6D11, 0x03F0, 0xFE00,
68 0x6E25, 0x0008, 0x00E0
75 nelem(reset_program_a_v1_or_v2),
76 reset_program_a_v1_or_v2
80 nelem(reset_program_b_v1_or_v2),
81 reset_program_b_v1_or_v2
270 {
TRUE, 11, 0x0200 },
271 {
TRUE, 11, 0x0000 },
272 {
TRUE, 11, 0x0400 },
290 {
TRUE, 11, 0x3800 },
293 {
TRUE, 11, 0x2000 },
298 static const struct window_info_t prog1_window_unifi_v1_v2 = { 0x0000, 0x2000, 0x0080, prog_window_array_unifi_v1_v2 };
299 static const struct window_info_t prog2_window_unifi_v1_v2 = { 0x2000, 0x2000, 0x0000, prog_window_array_unifi_v1_v2 };
300 static const struct window_info_t shared_window_unifi_v1_v2 = { 0x4000, 0x2000, 0x0000, shared_window_array_unifi_v1_v2 };
303 static const struct window_info_t generic1_window_unifi_v22_v23 = { 0x0000, 0x2000, 0x0080, generic_window_array_unifi_v22_v23 };
304 static const struct window_info_t generic2_window_unifi_v22_v23 = { 0x2000, 0x2000, 0x0000, generic_window_array_unifi_v22_v23 };
305 static const struct window_info_t generic3_window_unifi_v22_v23 = { 0x4000, 0x2000, 0x0000, generic_window_array_unifi_v22_v23 };
309 {
FALSE, 0x0000, 0x0000, 0x00 },
314 &unifi_device_regs_null,
344 {
FALSE, 0xf0ff, 0x1001, 0x01 },
348 counted(reset_program_v1_or_v2),
349 &unifi_device_regs_v1,
357 counted(unifi_map_address_v1_v2),
371 &prog1_window_unifi_v1_v2,
372 &prog2_window_unifi_v1_v2,
373 &shared_window_unifi_v1_v2
379 {
FALSE, 0xf0ff, 0x2001, 0x02 },
383 counted(reset_program_v1_or_v2),
384 &unifi_device_regs_v2,
392 counted(unifi_map_address_v1_v2),
406 &prog1_window_unifi_v1_v2,
407 &prog2_window_unifi_v1_v2,
408 &shared_window_unifi_v1_v2
414 {
FALSE, 0xf0ff, 0x3001, 0x02 },
418 counted(reset_program_v1_or_v2),
419 &unifi_device_regs_v2,
427 counted(unifi_map_address_v1_v2),
441 &prog1_window_unifi_v1_v2,
442 &prog2_window_unifi_v1_v2,
443 &shared_window_unifi_v1_v2
449 {
FALSE, 0x00ff, 0x0022, 0x07 },
454 &unifi_device_regs_v22_v23,
462 counted(unifi_map_address_v22_v23),
476 &generic1_window_unifi_v22_v23,
477 &generic2_window_unifi_v22_v23,
478 &generic3_window_unifi_v22_v23
484 {
FALSE, 0x00ff, 0x0023, 0x08 },
489 &unifi_device_regs_v22_v23,
497 counted(unifi_map_address_v22_v23),
511 &generic1_window_unifi_v22_v23,
512 &generic2_window_unifi_v22_v23,
513 &generic3_window_unifi_v22_v23
519 {
FALSE, 0x00ff, 0x0044, 0x00 },
524 &unifi_device_regs_v22_v23,
532 counted(unifi_map_address_v22_v23),
546 &generic1_window_unifi_v22_v23,
547 &generic2_window_unifi_v22_v23,
548 &generic3_window_unifi_v22_v23
570 &unifi_device_desc_v1,
571 &unifi_device_desc_v2,
572 &unifi_device_desc_v3,
573 &unifi_device_desc_v22,
574 &unifi_device_desc_v23,
575 &hyd_wlan_subsys_desc_v1
582 for (i = 0; i <
nelem(chip_ver_to_desc); i++)
586 return chip_ver_to_desc[
i];
590 return &chip_device_desc_null;
598 if ((from_FF9A & 0xFF00) != 0)
600 for (i = 0; i <
nelem(chip_ver_to_desc); i++)
603 ((from_FF9A & chip_ver_to_desc[i]->
chip_version.mask) ==
606 return chip_ver_to_desc[
i];
612 for (i = 0; i <
nelem(chip_ver_to_desc); i++)
615 ((from_FE81 & chip_ver_to_desc[i]->
chip_version.mask) ==
618 return chip_ver_to_desc[
i];
623 return &chip_device_desc_null;
635 return &chip_device_desc_null;
655 #define CHIP_HELPER_DEF0_C_DEF(ret_type, name, info) \
656 ret_type ChipHelper_ ## name(ChipDescript * chip_help) \
658 return chip_help->info; \
660 #define CHIP_HELPER_DEF1_C_DEF(ret_type, name, type1, name1)
670 for (i = 0; i < chip_help->map.len; i++)
672 if (chip_help->map.vals[i].spi == addr)
674 return chip_help->map.vals[
i].host;
684 for (i = 0; i < chip_help->
map.len; i++)
686 if (chip_help->
map.vals[i].host == addr)
688 return chip_help->
map.vals[
i].spi;
731 *val = chip_help->
init.vals;
732 return chip_help->
init.len;
768 if ((mode = &win->
mode[type]) ==
NULL)
782 while (of < win->blocked)
789 *len = win->
size - of;