Lines Matching refs:trans

697 					  struct mlxsw_reg_trans *trans)
706 trans->emad_err_string = kzalloc(MLXSW_EMAD_STRING_TLV_STRING_LEN,
708 if (!trans->emad_err_string)
712 strscpy(trans->emad_err_string, string,
719 static void mlxsw_emad_trans_timeout_schedule(struct mlxsw_reg_trans *trans)
723 if (trans->core->fw_flash_in_progress)
726 queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw,
727 timeout << trans->retries);
731 struct mlxsw_reg_trans *trans)
736 skb = skb_clone(trans->tx_skb, GFP_KERNEL);
744 atomic_set(&trans->active, 1);
745 err = mlxsw_core_skb_transmit(mlxsw_core, skb, &trans->tx_info);
750 mlxsw_emad_trans_timeout_schedule(trans);
754 static void mlxsw_emad_trans_finish(struct mlxsw_reg_trans *trans, int err)
756 struct mlxsw_core *mlxsw_core = trans->core;
758 dev_kfree_skb(trans->tx_skb);
760 list_del_rcu(&trans->list);
762 trans->err = err;
763 complete(&trans->completion);
767 struct mlxsw_reg_trans *trans)
771 if (trans->retries < MLXSW_EMAD_MAX_RETRY) {
772 trans->retries++;
773 err = mlxsw_emad_transmit(trans->core, trans);
777 if (!atomic_dec_and_test(&trans->active))
782 mlxsw_emad_trans_finish(trans, err);
787 struct mlxsw_reg_trans *trans = container_of(work,
791 if (!atomic_dec_and_test(&trans->active))
794 mlxsw_emad_transmit_retry(trans->core, trans);
798 struct mlxsw_reg_trans *trans,
803 if (!atomic_dec_and_test(&trans->active))
806 err = mlxsw_emad_process_status_skb(skb, &trans->emad_status);
808 mlxsw_emad_transmit_retry(mlxsw_core, trans);
813 if (trans->cb)
814 trans->cb(mlxsw_core,
816 trans->reg->len, trans->cb_priv);
818 mlxsw_emad_process_string_tlv(skb, trans);
820 mlxsw_emad_trans_finish(trans, err);
829 struct mlxsw_reg_trans *trans;
839 list_for_each_entry_rcu(trans, &mlxsw_core->emad.trans_list, list) {
840 if (mlxsw_emad_get_tid(skb) == trans->tid) {
841 mlxsw_emad_process_response(mlxsw_core, trans, skb);
968 struct mlxsw_reg_trans *trans,
984 list_add_tail(&trans->bulk_list, bulk_list);
985 trans->core = mlxsw_core;
986 trans->tx_skb = skb;
987 trans->tx_info.local_port = MLXSW_PORT_CPU_PORT;
988 trans->tx_info.is_emad = true;
989 INIT_DELAYED_WORK(&trans->timeout_dw, mlxsw_emad_trans_timeout_work);
990 trans->tid = tid;
991 init_completion(&trans->completion);
992 trans->cb = cb;
993 trans->cb_priv = cb_priv;
994 trans->reg = reg;
995 trans->type = type;
997 mlxsw_emad_construct(mlxsw_core, skb, reg, payload, type, trans->tid);
998 mlxsw_core->driver->txhdr_construct(skb, &trans->tx_info);
1001 list_add_tail_rcu(&trans->list, &mlxsw_core->emad.trans_list);
1003 err = mlxsw_emad_transmit(mlxsw_core, trans);
1010 list_del_rcu(&trans->list);
1012 list_del(&trans->bulk_list);
1013 dev_kfree_skb(trans->tx_skb);
2685 struct mlxsw_reg_trans *trans;
2688 trans = kzalloc(sizeof(*trans), GFP_KERNEL);
2689 if (!trans)
2692 err = mlxsw_emad_reg_access(mlxsw_core, reg, payload, type, trans,
2695 kfree_rcu(trans, rcu);
2725 static int mlxsw_reg_trans_wait(struct mlxsw_reg_trans *trans)
2728 struct mlxsw_core *mlxsw_core = trans->core;
2731 wait_for_completion(&trans->completion);
2732 cancel_delayed_work_sync(&trans->timeout_dw);
2733 err = trans->err;
2735 if (trans->retries)
2737 trans->retries, MLXSW_EMAD_MAX_RETRY, trans->tid);
2740 trans->tid, trans->reg->id,
2741 mlxsw_reg_id_str(trans->reg->id),
2742 mlxsw_core_reg_access_type_str(trans->type),
2743 trans->emad_status,
2744 mlxsw_emad_op_tlv_status_str(trans->emad_status));
2747 "(tid=%llx,reg_id=%x(%s)) %s (%s)\n", trans->tid,
2748 trans->reg->id, mlxsw_reg_id_str(trans->reg->id),
2749 mlxsw_emad_op_tlv_status_str(trans->emad_status),
2750 trans->emad_err_string ? trans->emad_err_string : "");
2753 trans->emad_status, err_string);
2755 kfree(trans->emad_err_string);
2758 list_del(&trans->bulk_list);
2759 kfree_rcu(trans, rcu);
2765 struct mlxsw_reg_trans *trans;
2770 list_for_each_entry_safe(trans, tmp, bulk_list, bulk_list) {
2771 err = mlxsw_reg_trans_wait(trans);