• Home
  • Raw
  • Download

Lines Matching refs:i2400m

384 int i2400m_is_boot_barker(struct i2400m *i2400m,  in i2400m_is_boot_barker()  argument
388 struct device *dev = i2400m_dev(i2400m); in i2400m_is_boot_barker()
398 if (i2400m->barker in i2400m_is_boot_barker()
399 && !memcmp(buf, i2400m->barker, sizeof(i2400m->barker->data))) { in i2400m_is_boot_barker()
400 unsigned index = (i2400m->barker - i2400m_barker_db) in i2400m_is_boot_barker()
401 / sizeof(*i2400m->barker); in i2400m_is_boot_barker()
403 index, le32_to_cpu(i2400m->barker->data[0])); in i2400m_is_boot_barker()
413 if (i2400m->barker == NULL) { in i2400m_is_boot_barker()
414 i2400m->barker = barker; in i2400m_is_boot_barker()
418 i2400m->sboot = 0; in i2400m_is_boot_barker()
420 i2400m->sboot = 1; in i2400m_is_boot_barker()
421 } else if (i2400m->barker != barker) { in i2400m_is_boot_barker()
425 le32_to_cpu(i2400m->barker->data[0]), in i2400m_is_boot_barker()
453 ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, in __i2400m_bm_ack_verify() argument
458 struct device *dev = i2400m_dev(i2400m); in __i2400m_bm_ack_verify()
461 i2400m, opcode, ack, ack_size); in __i2400m_bm_ack_verify()
469 result = i2400m_is_boot_barker(i2400m, ack, ack_size); in __i2400m_bm_ack_verify()
532 i2400m, opcode, ack, ack_size, (int) result); in __i2400m_bm_ack_verify()
583 ssize_t i2400m_bm_cmd(struct i2400m *i2400m, in i2400m_bm_cmd() argument
589 struct device *dev = i2400m_dev(i2400m); in i2400m_bm_cmd()
593 i2400m, cmd, cmd_size, ack, ack_size); in i2400m_bm_cmd()
595 BUG_ON(i2400m->boot_mode == 0); in i2400m_bm_cmd()
598 result = i2400m->bus_bm_cmd_send(i2400m, cmd, cmd_size, flags); in i2400m_bm_cmd()
611 result = i2400m->bus_bm_wait_for_ack(i2400m, ack, ack_size); in i2400m_bm_cmd()
620 result = __i2400m_bm_ack_verify(i2400m, opcode, ack, ack_size, flags); in i2400m_bm_cmd()
631 i2400m, cmd, cmd_size, ack, ack_size, (int) result); in i2400m_bm_cmd()
646 static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk, in i2400m_download_chunk() argument
652 struct device *dev = i2400m_dev(i2400m); in i2400m_download_chunk()
660 "direct %u do_csum %u)\n", i2400m, chunk, __chunk_len, in i2400m_download_chunk()
662 buf = i2400m->bm_cmd_buf; in i2400m_download_chunk()
671 ret = i2400m_bm_cmd(i2400m, &buf->cmd, sizeof(buf->cmd) + chunk_len, in i2400m_download_chunk()
676 "direct %u do_csum %u) = %d\n", i2400m, chunk, __chunk_len, in i2400m_download_chunk()
701 ssize_t i2400m_dnload_bcf(struct i2400m *i2400m, in i2400m_dnload_bcf() argument
705 struct device *dev = i2400m_dev(i2400m); in i2400m_dnload_bcf()
714 i2400m, bcf, bcf_len); in i2400m_dnload_bcf()
740 i2400m->fw_name, section, in i2400m_dnload_bcf()
746 ret = i2400m_bm_cmd(i2400m, bh, section_size, in i2400m_dnload_bcf()
750 "failed %d\n", i2400m->fw_name, section, in i2400m_dnload_bcf()
761 i2400m, bcf, bcf_len, (int) ret); in i2400m_dnload_bcf()
771 unsigned i2400m_boot_is_signed(struct i2400m *i2400m) in i2400m_boot_is_signed() argument
773 return likely(i2400m->sboot); in i2400m_boot_is_signed()
789 int i2400m_dnload_finalize(struct i2400m *i2400m, in i2400m_dnload_finalize() argument
794 struct device *dev = i2400m_dev(i2400m); in i2400m_dnload_finalize()
804 if (i2400m_boot_is_signed(i2400m) == 0) { in i2400m_dnload_finalize()
808 cmd_buf = i2400m->bm_cmd_buf; in i2400m_dnload_finalize()
814 ret = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd), in i2400m_dnload_finalize()
819 cmd_buf = i2400m->bm_cmd_buf; in i2400m_dnload_finalize()
830 ret = i2400m_bm_cmd(i2400m, &cmd_buf->cmd, in i2400m_dnload_finalize()
883 int i2400m_bootrom_init(struct i2400m *i2400m, enum i2400m_bri flags) in i2400m_bootrom_init() argument
886 struct device *dev = i2400m_dev(i2400m); in i2400m_bootrom_init()
889 int count = i2400m->bus_bm_retries; in i2400m_bootrom_init()
896 d_fnstart(4, dev, "(i2400m %p flags 0x%08x)\n", i2400m, flags); in i2400m_bootrom_init()
898 cmd = i2400m->bm_cmd_buf; in i2400m_bootrom_init()
908 i2400m_reset(i2400m, I2400M_RT_WARM); in i2400m_bootrom_init()
909 result = i2400m_bm_cmd(i2400m, NULL, 0, &ack, sizeof(ack), in i2400m_bootrom_init()
931 if (i2400m->barker != NULL) { in i2400m_bootrom_init()
934 le32_to_cpu(i2400m->barker->data[0])); in i2400m_bootrom_init()
940 result = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd), in i2400m_bootrom_init()
971 memcpy(cmd, i2400m->barker->data, sizeof(i2400m->barker->data)); in i2400m_bootrom_init()
972 result = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd), in i2400m_bootrom_init()
1006 i2400m, flags, result); in i2400m_bootrom_init()
1025 int i2400m_read_mac_addr(struct i2400m *i2400m) in i2400m_read_mac_addr() argument
1028 struct device *dev = i2400m_dev(i2400m); in i2400m_read_mac_addr()
1029 struct net_device *net_dev = i2400m->wimax_dev.net_dev; in i2400m_read_mac_addr()
1036 d_fnstart(5, dev, "(i2400m %p)\n", i2400m); in i2400m_read_mac_addr()
1037 cmd = i2400m->bm_cmd_buf; in i2400m_read_mac_addr()
1041 result = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd), in i2400m_read_mac_addr()
1048 if (i2400m->bus_bm_mac_addr_impaired == 1) { in i2400m_read_mac_addr()
1060 d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, result); in i2400m_read_mac_addr()
1073 int i2400m_dnload_init_nonsigned(struct i2400m *i2400m) in i2400m_dnload_init_nonsigned() argument
1077 struct device *dev = i2400m_dev(i2400m); in i2400m_dnload_init_nonsigned()
1078 d_fnstart(5, dev, "(i2400m %p)\n", i2400m); in i2400m_dnload_init_nonsigned()
1079 if (i2400m->bus_bm_pokes_table) { in i2400m_dnload_init_nonsigned()
1080 while (i2400m->bus_bm_pokes_table[i].address) { in i2400m_dnload_init_nonsigned()
1082 i2400m, in i2400m_dnload_init_nonsigned()
1083 &i2400m->bus_bm_pokes_table[i].data, in i2400m_dnload_init_nonsigned()
1084 sizeof(i2400m->bus_bm_pokes_table[i].data), in i2400m_dnload_init_nonsigned()
1085 i2400m->bus_bm_pokes_table[i].address, 1, 1); in i2400m_dnload_init_nonsigned()
1091 d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, ret); in i2400m_dnload_init_nonsigned()
1111 int i2400m_dnload_init_signed(struct i2400m *i2400m, in i2400m_dnload_init_signed() argument
1115 struct device *dev = i2400m_dev(i2400m); in i2400m_dnload_init_signed()
1122 d_fnstart(5, dev, "(i2400m %p bcf_hdr %p)\n", i2400m, bcf_hdr); in i2400m_dnload_init_signed()
1123 cmd_buf = i2400m->bm_cmd_buf; in i2400m_dnload_init_signed()
1129 ret = i2400m_bm_cmd(i2400m, &cmd_buf->cmd, sizeof(*cmd_buf), in i2400m_dnload_init_signed()
1133 d_fnend(5, dev, "(i2400m %p bcf_hdr %p) = %d\n", i2400m, bcf_hdr, ret); in i2400m_dnload_init_signed()
1145 int i2400m_dnload_init(struct i2400m *i2400m, in i2400m_dnload_init() argument
1149 struct device *dev = i2400m_dev(i2400m); in i2400m_dnload_init()
1151 if (i2400m_boot_is_signed(i2400m)) { in i2400m_dnload_init()
1153 result = i2400m_dnload_init_signed(i2400m, bcf_hdr); in i2400m_dnload_init()
1159 i2400m->fw_name, result); in i2400m_dnload_init()
1163 result = i2400m_dnload_init_nonsigned(i2400m); in i2400m_dnload_init()
1169 i2400m->fw_name, result); in i2400m_dnload_init()
1187 int i2400m_fw_hdr_check(struct i2400m *i2400m, in i2400m_fw_hdr_check() argument
1191 struct device *dev = i2400m_dev(i2400m); in i2400m_fw_hdr_check()
1208 i2400m->fw_name, index, offset, in i2400m_fw_hdr_check()
1216 i2400m->fw_name, index, offset, in i2400m_fw_hdr_check()
1224 i2400m->fw_name, index, offset, in i2400m_fw_hdr_check()
1232 i2400m->fw_name, index, offset, module_vendor); in i2400m_fw_hdr_check()
1239 i2400m->fw_name, index, offset, date); in i2400m_fw_hdr_check()
1256 int i2400m_fw_check(struct i2400m *i2400m, const void *bcf, size_t bcf_size) in i2400m_fw_check() argument
1259 struct device *dev = i2400m_dev(i2400m); in i2400m_fw_check()
1275 i2400m->fw_name, leftover, offset); in i2400m_fw_check()
1288 result = i2400m_fw_hdr_check(i2400m, bcf_hdr, headers, offset); in i2400m_fw_check()
1296 (void **) &i2400m->fw_hdrs, &slots, in i2400m_fw_check()
1297 sizeof(i2400m->fw_hdrs[0]), in i2400m_fw_check()
1302 i2400m->fw_hdrs[used_slots] = bcf_hdr; in i2400m_fw_check()
1307 i2400m->fw_name); in i2400m_fw_check()
1323 unsigned i2400m_bcf_hdr_match(struct i2400m *i2400m, in i2400m_bcf_hdr_match() argument
1326 u32 barker = le32_to_cpu(i2400m->barker->data[0]) in i2400m_bcf_hdr_match()
1340 const struct i2400m_bcf_hdr *i2400m_bcf_hdr_find(struct i2400m *i2400m) in i2400m_bcf_hdr_find() argument
1342 struct device *dev = i2400m_dev(i2400m); in i2400m_bcf_hdr_find()
1345 u32 barker = le32_to_cpu(i2400m->barker->data[0]); in i2400m_bcf_hdr_find()
1349 bcf_hdr = i2400m->fw_hdrs[0]; in i2400m_bcf_hdr_find()
1354 for (bcf_itr = i2400m->fw_hdrs; *bcf_itr != NULL; bcf_itr++, i++) { in i2400m_bcf_hdr_find()
1356 if (i2400m_bcf_hdr_match(i2400m, bcf_hdr)) { in i2400m_bcf_hdr_find()
1385 int i2400m_fw_dnload(struct i2400m *i2400m, const struct i2400m_bcf_hdr *bcf, in i2400m_fw_dnload() argument
1389 struct device *dev = i2400m_dev(i2400m); in i2400m_fw_dnload()
1390 int count = i2400m->bus_bm_retries; in i2400m_fw_dnload()
1395 i2400m, bcf, fw_size); in i2400m_fw_dnload()
1396 i2400m->boot_mode = 1; in i2400m_fw_dnload()
1405 ret = i2400m_bootrom_init(i2400m, flags); in i2400m_fw_dnload()
1423 bcf_hdr = i2400m_bcf_hdr_find(i2400m); in i2400m_fw_dnload()
1427 ret = i2400m_dnload_init(i2400m, bcf_hdr); in i2400m_fw_dnload()
1439 ret = i2400m_dnload_bcf(i2400m, bcf, bcf_size); in i2400m_fw_dnload()
1444 i2400m->fw_name, ret); in i2400m_fw_dnload()
1448 ret = i2400m_dnload_finalize(i2400m, bcf_hdr, bcf, ret); in i2400m_fw_dnload()
1454 i2400m->fw_name, ret); in i2400m_fw_dnload()
1459 i2400m->fw_name); in i2400m_fw_dnload()
1460 i2400m->boot_mode = 0; in i2400m_fw_dnload()
1469 i2400m, bcf, fw_size, ret); in i2400m_fw_dnload()
1480 int i2400m_fw_bootstrap(struct i2400m *i2400m, const struct firmware *fw, in i2400m_fw_bootstrap() argument
1484 struct device *dev = i2400m_dev(i2400m); in i2400m_fw_bootstrap()
1487 d_fnstart(5, dev, "(i2400m %p)\n", i2400m); in i2400m_fw_bootstrap()
1489 ret = i2400m_fw_check(i2400m, bcf, fw->size); in i2400m_fw_bootstrap()
1491 ret = i2400m_fw_dnload(i2400m, bcf, fw->size, flags); in i2400m_fw_bootstrap()
1494 i2400m->fw_name, ret); in i2400m_fw_bootstrap()
1495 kfree(i2400m->fw_hdrs); in i2400m_fw_bootstrap()
1496 i2400m->fw_hdrs = NULL; in i2400m_fw_bootstrap()
1497 d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, ret); in i2400m_fw_bootstrap()
1550 int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags) in i2400m_dev_bootstrap() argument
1553 struct device *dev = i2400m_dev(i2400m); in i2400m_dev_bootstrap()
1559 d_fnstart(5, dev, "(i2400m %p)\n", i2400m); in i2400m_dev_bootstrap()
1562 spin_lock(&i2400m->rx_lock); in i2400m_dev_bootstrap()
1563 i2400m_fw = i2400m_fw_get(i2400m->fw_cached); in i2400m_dev_bootstrap()
1564 spin_unlock(&i2400m->rx_lock); in i2400m_dev_bootstrap()
1570 i2400m->fw_name); in i2400m_dev_bootstrap()
1571 ret = i2400m_fw_bootstrap(i2400m, i2400m_fw->fw, flags); in i2400m_dev_bootstrap()
1578 fw_name = i2400m->bus_fw_names[itr]; in i2400m_dev_bootstrap()
1590 i2400m->fw_name = fw_name; in i2400m_dev_bootstrap()
1591 ret = i2400m_fw_bootstrap(i2400m, fw, flags); in i2400m_dev_bootstrap()
1595 i2400m->fw_name = NULL; in i2400m_dev_bootstrap()
1598 d_fnend(5, dev, "(i2400m %p) = %d\n", i2400m, ret); in i2400m_dev_bootstrap()
1604 void i2400m_fw_cache(struct i2400m *i2400m) in i2400m_fw_cache() argument
1608 struct device *dev = i2400m_dev(i2400m); in i2400m_fw_cache()
1611 spin_lock(&i2400m->rx_lock); in i2400m_fw_cache()
1612 i2400m_fw = i2400m->fw_cached; in i2400m_fw_cache()
1613 spin_unlock(&i2400m->rx_lock); in i2400m_fw_cache()
1620 if (i2400m->fw_name == NULL) { in i2400m_fw_cache()
1630 result = request_firmware(&i2400m_fw->fw, i2400m->fw_name, dev); in i2400m_fw_cache()
1633 i2400m->fw_name, result); in i2400m_fw_cache()
1637 dev_info(dev, "firmware %s: cached\n", i2400m->fw_name); in i2400m_fw_cache()
1639 spin_lock(&i2400m->rx_lock); in i2400m_fw_cache()
1640 i2400m->fw_cached = i2400m_fw; in i2400m_fw_cache()
1641 spin_unlock(&i2400m->rx_lock); in i2400m_fw_cache()
1645 void i2400m_fw_uncache(struct i2400m *i2400m) in i2400m_fw_uncache() argument
1649 spin_lock(&i2400m->rx_lock); in i2400m_fw_uncache()
1650 i2400m_fw = i2400m->fw_cached; in i2400m_fw_uncache()
1651 i2400m->fw_cached = NULL; in i2400m_fw_uncache()
1652 spin_unlock(&i2400m->rx_lock); in i2400m_fw_uncache()