Lines Matching refs:dcb

40 	struct port_dcb_info *dcb = &pi->dcb;  in cxgb4_dcb_state_init()  local
41 int version_temp = dcb->dcb_version; in cxgb4_dcb_state_init()
43 memset(dcb, 0, sizeof(struct port_dcb_info)); in cxgb4_dcb_state_init()
44 dcb->state = CXGB4_DCB_STATE_START; in cxgb4_dcb_state_init()
46 dcb->dcb_version = version_temp; in cxgb4_dcb_state_init()
55 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_version_init() local
60 dcb->dcb_version = FW_PORT_DCB_VER_AUTO; in cxgb4_dcb_version_init()
67 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_cleanup_apps() local
76 if (!dcb->app_priority[i].protocolid) in cxgb4_dcb_cleanup_apps()
79 app.protocol = dcb->app_priority[i].protocolid; in cxgb4_dcb_cleanup_apps()
81 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) { in cxgb4_dcb_cleanup_apps()
82 app.priority = dcb->app_priority[i].user_prio_map; in cxgb4_dcb_cleanup_apps()
83 app.selector = dcb->app_priority[i].sel_field + 1; in cxgb4_dcb_cleanup_apps()
86 app.selector = !!(dcb->app_priority[i].sel_field); in cxgb4_dcb_cleanup_apps()
93 dcb_ver_array[dcb->dcb_version], app.selector, in cxgb4_dcb_cleanup_apps()
106 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_state_fsm() local
108 enum cxgb4_dcb_state current_state = dcb->state; in cxgb4_dcb_state_fsm()
111 __func__, dcb->state, transition_to, dev->name); in cxgb4_dcb_state_fsm()
118 dcb->state = CXGB4_DCB_STATE_HOST; in cxgb4_dcb_state_fsm()
119 dcb->supported = CXGB4_DCBX_HOST_SUPPORT; in cxgb4_dcb_state_fsm()
125 dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; in cxgb4_dcb_state_fsm()
126 dcb->supported = DCB_CAP_DCBX_LLD_MANAGED; in cxgb4_dcb_state_fsm()
127 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) in cxgb4_dcb_state_fsm()
128 dcb->supported |= DCB_CAP_DCBX_VER_IEEE; in cxgb4_dcb_state_fsm()
130 dcb->supported |= DCB_CAP_DCBX_VER_CEE; in cxgb4_dcb_state_fsm()
140 dcb->state = CXGB4_DCB_STATE_FW_ALLSYNCED; in cxgb4_dcb_state_fsm()
163 dcb->state = CXGB4_DCB_STATE_FW_ALLSYNCED; in cxgb4_dcb_state_fsm()
164 dcb->enabled = 1; in cxgb4_dcb_state_fsm()
190 dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; in cxgb4_dcb_state_fsm()
191 dcb->supported = CXGB4_DCBX_FW_SUPPORT; in cxgb4_dcb_state_fsm()
201 dcb->enabled = 1; in cxgb4_dcb_state_fsm()
245 const union fw_port_dcb *fwdcb = &pcmd->u.dcb; in cxgb4_dcb_handle_fw_update()
249 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_handle_fw_update() local
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()
263 if (dcb->dcb_version != FW_PORT_DCB_VER_UNKNOWN) { in cxgb4_dcb_handle_fw_update()
266 pcmd->u.dcb.control.dcb_version_to_app_state)); in cxgb4_dcb_handle_fw_update()
269 dcb->dcb_version = dcb_running_version; in cxgb4_dcb_handle_fw_update()
272 dcb_ver_array[dcb->dcb_version]); in cxgb4_dcb_handle_fw_update()
276 dcb_ver_array[dcb->dcb_version], in cxgb4_dcb_handle_fw_update()
278 dcb->dcb_version = FW_PORT_DCB_VER_UNKNOWN; in cxgb4_dcb_handle_fw_update()
291 if (dcb->state == CXGB4_DCB_STATE_START || in cxgb4_dcb_handle_fw_update()
292 dcb->state == CXGB4_DCB_STATE_HOST) { in cxgb4_dcb_handle_fw_update()
294 dcb->state); in cxgb4_dcb_handle_fw_update()
302 dcb->pgid = be32_to_cpu(fwdcb->pgid.pgid); in cxgb4_dcb_handle_fw_update()
303 dcb->msgs |= CXGB4_DCB_FW_PGID; in cxgb4_dcb_handle_fw_update()
307 dcb->pg_num_tcs_supported = fwdcb->pgrate.num_tcs_supported; in cxgb4_dcb_handle_fw_update()
308 memcpy(dcb->pgrate, &fwdcb->pgrate.pgrate, in cxgb4_dcb_handle_fw_update()
309 sizeof(dcb->pgrate)); in cxgb4_dcb_handle_fw_update()
310 memcpy(dcb->tsa, &fwdcb->pgrate.tsa, in cxgb4_dcb_handle_fw_update()
311 sizeof(dcb->tsa)); in cxgb4_dcb_handle_fw_update()
312 dcb->msgs |= CXGB4_DCB_FW_PGRATE; in cxgb4_dcb_handle_fw_update()
313 if (dcb->msgs & CXGB4_DCB_FW_PGID) in cxgb4_dcb_handle_fw_update()
314 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
318 memcpy(dcb->priorate, &fwdcb->priorate.strict_priorate, in cxgb4_dcb_handle_fw_update()
319 sizeof(dcb->priorate)); in cxgb4_dcb_handle_fw_update()
320 dcb->msgs |= CXGB4_DCB_FW_PRIORATE; in cxgb4_dcb_handle_fw_update()
324 dcb->pfcen = fwdcb->pfc.pfcen; in cxgb4_dcb_handle_fw_update()
325 dcb->pfc_num_tcs_supported = fwdcb->pfc.max_pfc_tcs; in cxgb4_dcb_handle_fw_update()
326 dcb->msgs |= CXGB4_DCB_FW_PFC; in cxgb4_dcb_handle_fw_update()
327 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
333 struct app_priority *ap = &dcb->app_priority[idx]; in cxgb4_dcb_handle_fw_update()
343 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) { in cxgb4_dcb_handle_fw_update()
347 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
363 dcb->msgs |= CXGB4_DCB_FW_APP_ID; in cxgb4_dcb_handle_fw_update()
384 return pi->dcb.enabled; in cxgb4_getstate()
394 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) { in cxgb4_setstate()
395 pi->dcb.enabled = enabled; in cxgb4_setstate()
401 if (enabled != (pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED)) in cxgb4_setstate()
423 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_getpgtccfg()
429 *pgid = (be32_to_cpu(pcmd.u.dcb.pgid.pgid) >> (tc * 4)) & 0xf; in cxgb4_getpgtccfg()
435 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgtccfg()
443 *bw_per = pcmd.u.dcb.pgrate.pgrate[*pgid]; in cxgb4_getpgtccfg()
487 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; 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()
512 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgtccfg_tx()
521 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgtccfg_tx()
524 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in cxgb4_setpgtccfg_tx()
546 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgbwgcfg()
554 *bw_per = pcmd.u.dcb.pgrate.pgrate[pgid]; in cxgb4_getpgbwgcfg()
576 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgbwgcfg_tx()
585 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgbwgcfg_tx()
588 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in cxgb4_setpgbwgcfg_tx()
604 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_getpfccfg() local
606 if (dcb->state != CXGB4_DCB_STATE_FW_ALLSYNCED || in cxgb4_getpfccfg()
610 *pfccfg = (pi->dcb.pfcen >> (7 - priority)) & 1; in cxgb4_getpfccfg()
623 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED || in cxgb4_setpfccfg()
628 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) 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()
645 pi->dcb.pfcen = pcmd.u.dcb.pfc.pfcen; in cxgb4_setpfccfg()
685 *caps = pi->dcb.supported; in cxgb4_getcap()
703 if (pi->dcb.msgs & CXGB4_DCB_FW_PGRATE) in cxgb4_getnumtcs()
704 *num = pi->dcb.pg_num_tcs_supported; in cxgb4_getnumtcs()
735 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) in cxgb4_getpfcstate()
738 return pi->dcb.pfcen != 0; in cxgb4_getpfcstate()
759 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) 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()
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()
811 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) 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()
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()
847 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) 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()
897 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_negotiation_complete() local
899 if (dcb_subtype && !(dcb->msgs & dcb_subtype)) in cxgb4_ieee_negotiation_complete()
902 return (dcb->state == CXGB4_DCB_STATE_FW_ALLSYNCED && in cxgb4_ieee_negotiation_complete()
903 (dcb->supported & DCB_CAP_DCBX_VER_IEEE)); in cxgb4_ieee_negotiation_complete()
910 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_read_ets() local
916 if (!(dcb->msgs & (CXGB4_DCB_FW_PGID | CXGB4_DCB_FW_PGRATE))) in cxgb4_ieee_read_ets()
919 ets->ets_cap = dcb->pg_num_tcs_supported; in cxgb4_ieee_read_ets()
928 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_ieee_read_ets()
935 tc_info = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_ieee_read_ets()
942 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; 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()
970 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_get_pfc() local
974 if (!(dcb->msgs & CXGB4_DCB_FW_PFC)) in cxgb4_ieee_get_pfc()
977 pfc->pfc_cap = dcb->pfc_num_tcs_supported; in cxgb4_ieee_get_pfc()
978 pfc->pfc_en = bitswap_1(dcb->pfcen); in cxgb4_ieee_get_pfc()
1043 return pi->dcb.supported; in cxgb4_getdcbx()
1060 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) in cxgb4_setdcbx()
1068 if (dcb_request != pi->dcb.supported) in cxgb4_setdcbx()
1071 pi->dcb.supported = dcb_request; in cxgb4_setdcbx()
1083 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) 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()
1103 if (!pcmd.u.dcb.app_priority.protocolid) in cxgb4_getpeer_app()
1117 if (pi->dcb.state != CXGB4_DCB_STATE_FW_ALLSYNCED) 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()
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()
1161 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_cee_peer_getpg()
1167 pgid = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_cee_peer_getpg()
1173 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_cee_peer_getpg()
1182 pg->pg_bw[i] = pcmd.u.dcb.pgrate.pgrate[i]; in cxgb4_cee_peer_getpg()
1199 pfc->pfc_en = bitswap_1(pi->dcb.pfcen); in cxgb4_cee_peer_getpfc()