Lines Matching refs:pcmd

243 				const struct fw_port_cmd *pcmd)  in cxgb4_dcb_handle_fw_update()  argument
245 const union fw_port_dcb *fwdcb = &pcmd->u.dcb; in cxgb4_dcb_handle_fw_update()
246 int port = FW_PORT_CMD_PORTID_G(be32_to_cpu(pcmd->op_to_portid)); in cxgb4_dcb_handle_fw_update()
250 int dcb_type = pcmd->u.dcb.pgid.type; in cxgb4_dcb_handle_fw_update()
258 ((pcmd->u.dcb.control.all_syncd_pkd & in cxgb4_dcb_handle_fw_update()
266 pcmd->u.dcb.control.dcb_version_to_app_state)); in cxgb4_dcb_handle_fw_update()
411 struct fw_port_cmd pcmd; in cxgb4_getpgtccfg() local
419 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_getpgtccfg()
421 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_getpgtccfg()
423 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_getpgtccfg()
424 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_getpgtccfg()
429 *pgid = (be32_to_cpu(pcmd.u.dcb.pgid.pgid) >> (tc * 4)) & 0xf; in cxgb4_getpgtccfg()
432 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_getpgtccfg()
434 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_getpgtccfg()
435 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgtccfg()
436 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_getpgtccfg()
443 *bw_per = pcmd.u.dcb.pgrate.pgrate[*pgid]; in cxgb4_getpgtccfg()
474 struct fw_port_cmd pcmd; in cxgb4_setpgtccfg_tx() local
486 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_setpgtccfg_tx()
487 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_setpgtccfg_tx()
489 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgtccfg_tx()
495 _pgid = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_setpgtccfg_tx()
498 pcmd.u.dcb.pgid.pgid = cpu_to_be32(_pgid); in cxgb4_setpgtccfg_tx()
500 INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id); in cxgb4_setpgtccfg_tx()
502 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgtccfg_tx()
509 memset(&pcmd, 0, sizeof(struct fw_port_cmd)); in cxgb4_setpgtccfg_tx()
511 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_setpgtccfg_tx()
512 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgtccfg_tx()
514 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgtccfg_tx()
521 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgtccfg_tx()
523 INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id); in cxgb4_setpgtccfg_tx()
525 pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F); in cxgb4_setpgtccfg_tx()
527 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgtccfg_tx()
536 struct fw_port_cmd pcmd; in cxgb4_getpgbwgcfg() local
542 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_getpgbwgcfg()
544 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_getpgbwgcfg()
546 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgbwgcfg()
547 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_getpgbwgcfg()
554 *bw_per = pcmd.u.dcb.pgrate.pgrate[pgid]; in cxgb4_getpgbwgcfg()
570 struct fw_port_cmd pcmd; in cxgb4_setpgbwgcfg_tx() local
575 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_setpgbwgcfg_tx()
576 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgbwgcfg_tx()
578 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgbwgcfg_tx()
585 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgbwgcfg_tx()
587 INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id); in cxgb4_setpgbwgcfg_tx()
589 pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F); in cxgb4_setpgbwgcfg_tx()
591 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpgbwgcfg_tx()
618 struct fw_port_cmd pcmd; in cxgb4_setpfccfg() local
627 INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id); in cxgb4_setpfccfg()
629 pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F); in cxgb4_setpfccfg()
631 pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC; in cxgb4_setpfccfg()
632 pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen; in cxgb4_setpfccfg()
635 pcmd.u.dcb.pfc.pfcen |= (1 << (7 - priority)); in cxgb4_setpfccfg()
637 pcmd.u.dcb.pfc.pfcen &= (~(1 << (7 - priority))); in cxgb4_setpfccfg()
639 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_setpfccfg()
645 pi->dcb.pfcen = pcmd.u.dcb.pfc.pfcen; in cxgb4_setpfccfg()
763 struct fw_port_cmd pcmd; in __cxgb4_getapp() local
767 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in __cxgb4_getapp()
769 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in __cxgb4_getapp()
771 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_getapp()
772 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_getapp()
774 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in __cxgb4_getapp()
780 if (be16_to_cpu(pcmd.u.dcb.app_priority.protocolid) == app_id) in __cxgb4_getapp()
781 if (pcmd.u.dcb.app_priority.sel_field == app_idtype) in __cxgb4_getapp()
782 return pcmd.u.dcb.app_priority.user_prio_map; in __cxgb4_getapp()
785 if (!pcmd.u.dcb.app_priority.protocolid) in __cxgb4_getapp()
805 struct fw_port_cmd pcmd; in __cxgb4_setapp() local
819 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in __cxgb4_setapp()
820 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_setapp()
821 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_setapp()
822 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in __cxgb4_setapp()
829 if (be16_to_cpu(pcmd.u.dcb.app_priority.protocolid) == app_id) { in __cxgb4_setapp()
831 pcmd.u.dcb.app_priority.protocolid = 0; in __cxgb4_setapp()
835 if (!pcmd.u.dcb.app_priority.protocolid) in __cxgb4_setapp()
846 INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id); in __cxgb4_setapp()
848 pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F); in __cxgb4_setapp()
850 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_setapp()
851 pcmd.u.dcb.app_priority.protocolid = cpu_to_be16(app_id); in __cxgb4_setapp()
852 pcmd.u.dcb.app_priority.sel_field = app_idtype; in __cxgb4_setapp()
853 pcmd.u.dcb.app_priority.user_prio_map = app_prio; in __cxgb4_setapp()
854 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_setapp()
856 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in __cxgb4_setapp()
913 struct fw_port_cmd pcmd; in cxgb4_ieee_read_ets() local
923 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_ieee_read_ets()
925 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_ieee_read_ets()
928 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_ieee_read_ets()
929 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_ieee_read_ets()
935 tc_info = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_ieee_read_ets()
938 INIT_PORT_DCB_READ_LOCAL_CMD(pcmd, pi->port_id); in cxgb4_ieee_read_ets()
940 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_ieee_read_ets()
942 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_ieee_read_ets()
943 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_ieee_read_ets()
953 ets->tc_tx_bw[i] = pcmd.u.dcb.pgrate.pgrate[i]; in cxgb4_ieee_read_ets()
955 ets->tc_tsa[i] = pcmd.u.dcb.pgrate.tsa[i]; in cxgb4_ieee_read_ets()
1078 struct fw_port_cmd pcmd; in cxgb4_getpeer_app() local
1091 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_getpeer_app()
1092 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in cxgb4_getpeer_app()
1093 pcmd.u.dcb.app_priority.idx = *app_count; in cxgb4_getpeer_app()
1094 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_getpeer_app()
1103 if (!pcmd.u.dcb.app_priority.protocolid) in cxgb4_getpeer_app()
1112 struct fw_port_cmd pcmd; in cxgb4_getpeerapp_tbl() local
1121 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_getpeerapp_tbl()
1122 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in cxgb4_getpeerapp_tbl()
1123 pcmd.u.dcb.app_priority.idx = i; in cxgb4_getpeerapp_tbl()
1124 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_getpeerapp_tbl()
1133 if (!pcmd.u.dcb.app_priority.protocolid) in cxgb4_getpeerapp_tbl()
1136 table[i].selector = pcmd.u.dcb.app_priority.sel_field; in cxgb4_getpeerapp_tbl()
1138 be16_to_cpu(pcmd.u.dcb.app_priority.protocolid); in cxgb4_getpeerapp_tbl()
1140 ffs(pcmd.u.dcb.app_priority.user_prio_map) - 1; in cxgb4_getpeerapp_tbl()
1149 struct fw_port_cmd pcmd; in cxgb4_cee_peer_getpg() local
1160 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_cee_peer_getpg()
1161 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_cee_peer_getpg()
1162 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_cee_peer_getpg()
1167 pgid = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_cee_peer_getpg()
1172 INIT_PORT_DCB_READ_PEER_CMD(pcmd, pi->port_id); in cxgb4_cee_peer_getpg()
1173 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_cee_peer_getpg()
1174 err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd); in cxgb4_cee_peer_getpg()
1182 pg->pg_bw[i] = pcmd.u.dcb.pgrate.pgrate[i]; in cxgb4_cee_peer_getpg()