Lines Matching +full:led +full:- +full:cur
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
46 return &dd->pport[port_num - 1]; in qib_get_pportdata_kobj()
56 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in hrtbt_enable_show()
58 return sysfs_emit(buf, "%d\n", dd->f_get_ib_cfg(ppd, QIB_IB_CFG_HRTBT)); in hrtbt_enable_show()
66 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in hrtbt_enable_store()
83 ret = dd->f_set_ib_cfg(ppd, QIB_IB_CFG_HRTBT, val); in hrtbt_enable_store()
93 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in loopback_store()
96 r = dd->f_set_ib_loopback(ppd, buf); in loopback_store()
109 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in led_override_store()
115 qib_dev_err(dd, "attempt to set invalid LED override\n"); in led_override_store()
128 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in status_show()
130 if (!ppd->statusp) in status_show()
131 return -EINVAL; in status_show()
133 return sysfs_emit(buf, "0x%llx\n", (unsigned long long)*(ppd->statusp)); in status_show()
159 struct qib_pportdata *ppd = &dd->pport[port_num - 1]; in status_str_show()
164 if (!ppd->statusp) { in status_str_show()
165 ret = -EINVAL; in status_str_show()
169 s = *(ppd->statusp); in status_str_show()
193 /* end of per-port functions */
210 * Start of per-port congestion control structures and support code
223 if (!qib_cc_table_size || !ppd->ccti_entries_shadow) in cc_table_bin_read()
224 return -EINVAL; in cc_table_bin_read()
226 ret = ppd->total_cct_entry * sizeof(struct ib_cc_table_entry_shadow) in cc_table_bin_read()
230 return -EINVAL; in cc_table_bin_read()
232 if (count > ret - pos) in cc_table_bin_read()
233 count = ret - pos; in cc_table_bin_read()
238 spin_lock(&ppd->cc_shadow_lock); in cc_table_bin_read()
239 memcpy(buf, ppd->ccti_entries_shadow, count); in cc_table_bin_read()
240 spin_unlock(&ppd->cc_shadow_lock); in cc_table_bin_read()
248 * entries for the congestion entries - increase, timer, event log
258 if (!qib_cc_table_size || !ppd->congestion_entries_shadow) in cc_setting_bin_read()
259 return -EINVAL; in cc_setting_bin_read()
264 return -EINVAL; in cc_setting_bin_read()
265 if (count > ret - pos) in cc_setting_bin_read()
266 count = ret - pos; in cc_setting_bin_read()
271 spin_lock(&ppd->cc_shadow_lock); in cc_setting_bin_read()
272 memcpy(buf, ppd->congestion_entries_shadow, count); in cc_setting_bin_read()
273 spin_unlock(&ppd->cc_shadow_lock); in cc_setting_bin_read()
290 if (!qib_cc_table_size || !ppd->congestion_entries_shadow) in qib_ccmgta_is_bin_visible()
292 return attr->attr.mode; in qib_ccmgta_is_bin_visible()
314 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in sl2vl_attr_show()
316 return sysfs_emit(buf, "%u\n", qibp->sl_to_vl[sattr->sl]); in sl2vl_attr_show()
382 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in diagc_attr_show()
384 return sysfs_emit(buf, "%llu\n", *((u64 *)qibp + dattr->counter)); in diagc_attr_show()
394 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in diagc_attr_store()
401 *((u64 *)qibp + dattr->counter) = val; in diagc_attr_store()
406 static_assert(__same_type(((struct qib_ibport *)0)->rvp.n_##N, u64)); \
438 size_t count, u64 *zero, u64 cur) in qib_store_per_cpu() argument
450 *zero = cur; in qib_store_per_cpu()
458 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_acks_show()
461 get_all_cpu_total(qibp->rvp.rc_acks) - in rc_acks_show()
462 qibp->rvp.z_rc_acks); in rc_acks_show()
470 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_acks_store()
472 return qib_store_per_cpu(dd, buf, count, &qibp->rvp.z_rc_acks, in rc_acks_store()
473 get_all_cpu_total(qibp->rvp.rc_acks)); in rc_acks_store()
481 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_qacks_show()
484 get_all_cpu_total(qibp->rvp.rc_qacks) - in rc_qacks_show()
485 qibp->rvp.z_rc_qacks); in rc_qacks_show()
493 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_qacks_store()
495 return qib_store_per_cpu(dd, buf, count, &qibp->rvp.z_rc_qacks, in rc_qacks_store()
496 get_all_cpu_total(qibp->rvp.rc_qacks)); in rc_qacks_store()
504 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_delayed_comp_show()
507 get_all_cpu_total(qibp->rvp.rc_delayed_comp) - in rc_delayed_comp_show()
508 qibp->rvp.z_rc_delayed_comp); in rc_delayed_comp_show()
516 struct qib_ibport *qibp = &dd->pport[port_num - 1].ibport_data; in rc_delayed_comp_store()
518 return qib_store_per_cpu(dd, buf, count, &qibp->rvp.z_rc_delayed_comp, in rc_delayed_comp_store()
519 get_all_cpu_total(qibp->rvp.rc_delayed_comp)); in rc_delayed_comp_store()
558 /* end of per-port file structures and support code */
561 * Start of per-unit (or driver, in some cases, but replicated
570 return sysfs_emit(buf, "%x\n", dd_from_dev(dev)->minrev); in hw_rev_show()
581 if (!dd->boardname) in hca_type_show()
582 return -EINVAL; in hca_type_show()
583 return sysfs_emit(buf, "%s\n", dd->boardname); in hca_type_show()
591 /* The string printed here is already newline-terminated. */ in version_show()
603 /* The string printed here is already newline-terminated. */ in boardversion_show()
604 return sysfs_emit(buf, "%s", dd->boardversion); in boardversion_show()
615 /* The string printed here is already newline-terminated. */ in localbus_info_show()
616 return sysfs_emit(buf, "%s", dd->lbus_info); in localbus_info_show()
629 * cfgctxts is set to 1 on a single-port board. */ in nctxts_show()
631 (dd->first_user_ctxt > dd->cfgctxts) ? in nctxts_show()
633 (dd->cfgctxts - dd->first_user_ctxt)); in nctxts_show()
645 return sysfs_emit(buf, "%u\n", dd->freectxts); in nfreectxts_show()
655 const u8 *end = memchr(dd->serial, 0, ARRAY_SIZE(dd->serial)); in serial_show()
656 int size = end ? end - dd->serial : ARRAY_SIZE(dd->serial); in serial_show()
658 return sysfs_emit(buf, ".%*s\n", size, dd->serial); in serial_show()
671 if (count < 5 || memcmp(buf, "reset", 5) || !dd->diag_client) { in chip_reset_store()
672 ret = -EINVAL; in chip_reset_store()
676 ret = qib_reset_device(dd->unit); in chip_reset_store()
683 * Dump tempsense regs. in decimal, to ease shell-scripts.
699 ret = dd->f_tempsense_rd(dd, i); in tempsense_show()
715 * end of per-unit (or driver, in some cases, but replicated
719 /* start of per-unit file structures and support code */