Lines Matching refs:linecards

60 mlxsw_linecard_types_lookup(struct mlxsw_linecards *linecards, u8 card_type)
66 types_info = linecards->types_info;
70 ini_file = linecards->types_info->ini_files[i];
79 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
341 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
370 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
390 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
418 dev_warn_once(linecard->linecards->bus_info->dev, "linecard %u: More flashable devices present, exposing only the first one\n",
454 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
464 struct mlxsw_linecards *linecards = linecard->linecards;
467 mutex_lock(&linecards->event_ops_list_lock);
468 list_for_each_entry(item, &linecards->event_ops_list, list)
472 mutex_unlock(&linecards->event_ops_list_lock);
478 struct mlxsw_linecards *linecards = linecard->linecards;
481 mutex_lock(&linecards->event_ops_list_lock);
482 list_for_each_entry(item, &linecards->event_ops_list, list)
486 mutex_unlock(&linecards->event_ops_list_lock);
490 mlxsw_linecards_event_ops_register_call(struct mlxsw_linecards *linecards,
496 for (i = 0; i < linecards->count; i++) {
497 linecard = mlxsw_linecard_get(linecards, i + 1);
508 mlxsw_linecards_event_ops_unregister_call(struct mlxsw_linecards *linecards,
514 for (i = 0; i < linecards->count; i++) {
515 linecard = mlxsw_linecard_get(linecards, i + 1);
529 struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core);
532 if (!linecards)
540 mutex_lock(&linecards->event_ops_list_lock);
541 list_add_tail(&item->list, &linecards->event_ops_list);
542 mutex_unlock(&linecards->event_ops_list_lock);
543 mlxsw_linecards_event_ops_register_call(linecards, item);
552 struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core);
556 if (!linecards)
558 mutex_lock(&linecards->event_ops_list_lock);
559 list_for_each_entry_safe(item, tmp, &linecards->event_ops_list, list) {
566 mutex_unlock(&linecards->event_ops_list_lock);
570 mlxsw_linecards_event_ops_unregister_call(linecards, item);
623 struct mlxsw_linecards *linecards = linecard->linecards;
627 type = mlxsw_linecard_types_lookup(linecards, card_type);
669 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
687 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core;
713 static int mlxsw_linecard_status_process(struct mlxsw_linecards *linecards,
732 if (WARN_ON(slot_index > linecards->count))
734 linecard = mlxsw_linecard_get(linecards, slot_index);
774 struct mlxsw_linecards *linecards,
785 return mlxsw_linecard_status_process(linecards, linecard, mddq_pl);
790 struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core);
794 for (i = 0; i < linecards->count; i++) {
795 struct mlxsw_linecard *linecard = mlxsw_linecard_get(linecards,
798 mlxsw_linecard_status_get_and_process(mlxsw_core, linecards,
815 dev_err(linecard->linecards->bus_info->dev, "linecard %u: Timeout reached waiting on %s status event",
824 dev_info(linecard->linecards->bus_info->dev, "linecard %u: Clearing FSM state error",
828 return mlxsw_reg_write(linecard->linecards->mlxsw_core,
850 err = mlxsw_reg_query(linecard->linecards->mlxsw_core, MLXSW_REG(mbct),
949 struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core);
956 if (WARN_ON(slot_index > linecards->count))
958 linecard = mlxsw_linecard_get(linecards, slot_index);
961 dev_err(linecards->bus_info->dev, "linecard %u: Failed to activate INI",
1041 mlxsw_core = linecard->linecards->mlxsw_core;
1057 mlxsw_core = linecard->linecards->mlxsw_core;
1093 mlxsw_core = linecard->linecards->mlxsw_core;
1139 return linecard->linecards->types_info ?
1140 linecard->linecards->types_info->count : 0;
1151 types_info = linecard->linecards->types_info;
1176 struct mlxsw_linecards *linecards;
1181 linecards = mlxsw_core_linecards(mlxsw_core);
1182 mlxsw_linecard_status_process(linecards, NULL, event->mddq_pl);
1251 struct mlxsw_linecards *linecards,
1257 linecard = mlxsw_linecard_get(linecards, slot_index);
1259 linecard->linecards = linecards;
1276 struct mlxsw_linecards *linecards,
1281 linecard = mlxsw_linecard_get(linecards, slot_index);
1294 struct mlxsw_linecards *linecards,
1300 linecard = mlxsw_linecard_get(linecards, slot_index);
1305 err = mlxsw_linecard_status_get_and_process(mlxsw_core, linecards,
1319 struct mlxsw_linecards *linecards,
1324 linecard = mlxsw_linecard_get(linecards, slot_index);
1345 mlxsw_linecard_types_file_validate(struct mlxsw_linecards *linecards,
1356 dev_warn(linecards->bus_info->dev, "Invalid linecards INIs file size, smaller than magic size\n");
1360 dev_warn(linecards->bus_info->dev, "Invalid linecards INIs file magic pattern\n");
1369 dev_warn(linecards->bus_info->dev, "Linecards INIs file contains INI which is smaller than bare minimum\n");
1375 dev_warn(linecards->bus_info->dev, "Linecards INIs file appears to be truncated\n");
1379 dev_warn(linecards->bus_info->dev, "Linecards INIs file contains INI with invalid size\n");
1387 dev_warn(linecards->bus_info->dev, "Linecards INIs file does not contain any INI\n");
1426 struct mlxsw_linecards *linecards)
1428 const struct mlxsw_fw_rev *rev = &linecards->bus_info->fw_rev;
1440 linecards->bus_info->dev);
1442 dev_warn(linecards->bus_info->dev, "Could not request linecards INI file \"%s\", provisioning will not be possible\n",
1452 linecards->types_info = types_info;
1464 err = mlxsw_linecard_types_file_validate(linecards, types_info);
1490 static void mlxsw_linecard_types_fini(struct mlxsw_linecards *linecards)
1492 struct mlxsw_linecard_types_info *types_info = linecards->types_info;
1505 struct mlxsw_linecards *linecards;
1520 linecards = vzalloc(struct_size(linecards, linecards, slot_count));
1521 if (!linecards)
1523 linecards->count = slot_count;
1524 linecards->mlxsw_core = mlxsw_core;
1525 linecards->bus_info = bus_info;
1526 INIT_LIST_HEAD(&linecards->event_ops_list);
1527 mutex_init(&linecards->event_ops_list_lock);
1529 err = mlxsw_linecard_types_init(mlxsw_core, linecards);
1544 mlxsw_core_linecards_set(mlxsw_core, linecards);
1546 for (i = 0; i < linecards->count; i++) {
1547 err = mlxsw_linecard_init(mlxsw_core, linecards, i + 1);
1552 for (i = 0; i < linecards->count; i++) {
1553 err = mlxsw_linecard_event_delivery_init(mlxsw_core, linecards,
1563 mlxsw_linecard_event_delivery_fini(mlxsw_core, linecards, i + 1);
1564 i = linecards->count;
1567 mlxsw_linecard_fini(mlxsw_core, linecards, i + 1);
1575 mlxsw_linecard_types_fini(linecards);
1577 vfree(linecards);
1583 struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core);
1586 if (!linecards)
1588 for (i = 0; i < linecards->count; i++)
1589 mlxsw_linecard_event_delivery_fini(mlxsw_core, linecards, i + 1);
1590 for (i = 0; i < linecards->count; i++)
1591 mlxsw_linecard_fini(mlxsw_core, linecards, i + 1);
1597 mlxsw_linecard_types_fini(linecards);
1598 mutex_destroy(&linecards->event_ops_list_lock);
1599 WARN_ON(!list_empty(&linecards->event_ops_list));
1600 vfree(linecards);