Lines Matching defs:idiag
124 static struct lpfc_idiag idiag;
3132 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3135 * @idiag_cmd: pointer to the idiag command struct.
3138 * buffer for getting the idiag command and arguments. The while space in
3179 * lpfc_idiag_open - idiag open debugfs
3187 * space read into the allocated buffer according to the idiag user command
3212 * lpfc_idiag_release - Release idiag access file operation
3217 * This routine is the generic release routine for the idiag access file
3237 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3243 * was opened. It also reset the fields in the idiag command struct in the
3255 switch (idiag.cmd.opcode) {
3262 memset(&idiag, 0, sizeof(idiag));
3277 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3285 * idiag command, and copies to user @buf. Depending on the PCI config space
3324 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_RD) {
3325 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3326 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3359 offset_label = idiag.offset.last_rd;
3388 idiag.offset.last_rd += LPFC_PCI_CFG_RD_SIZE;
3389 if (idiag.offset.last_rd >= LPFC_PCI_CFG_SIZE)
3390 idiag.offset.last_rd = 0;
3392 idiag.offset.last_rd = 0;
3398 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3404 * This routine get the debugfs idiag command struct from user space and
3407 * the command in the idiag command struct for the debugfs read operation.
3435 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
3439 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_RD) {
3444 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3445 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3450 idiag.offset.last_rd = where;
3473 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR ||
3474 idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST ||
3475 idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3480 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3481 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3482 value = idiag.cmd.data[IDIAG_PCICFG_VALUE_INDX];
3493 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3496 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3504 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3518 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3521 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3529 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3543 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3545 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3554 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3570 memset(&idiag, 0, sizeof(idiag));
3575 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3583 * according to the idiag command, and copies to user @buf.
3619 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_RD) {
3620 bar_num = idiag.cmd.data[IDIAG_BARACC_BAR_NUM_INDX];
3621 offset = idiag.cmd.data[IDIAG_BARACC_OFF_SET_INDX];
3622 acc_range = idiag.cmd.data[IDIAG_BARACC_ACC_MOD_INDX];
3623 bar_size = idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX];
3662 offset_label = idiag.offset.last_rd;
3702 idiag.offset.last_rd += LPFC_PCI_BAR_RD_SIZE;
3704 if (idiag.offset.last_rd >= bar_size)
3705 idiag.offset.last_rd = 0;
3709 idiag.offset.last_rd = offset;
3713 idiag.offset.last_rd = 0;
3715 idiag.offset.last_rd = offset;
3722 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3728 * This routine get the debugfs idiag command struct from user space and
3731 * read command, it sets up the command in the idiag command struct for
3760 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
3765 bar_num = idiag.cmd.data[IDIAG_BARACC_BAR_NUM_INDX];
3780 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3784 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3788 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3795 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3803 offset = idiag.cmd.data[IDIAG_BARACC_OFF_SET_INDX];
3807 bar_size = idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX];
3808 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_RD) {
3812 acc_range = idiag.cmd.data[IDIAG_BARACC_ACC_MOD_INDX];
3817 idiag.offset.last_rd = offset;
3822 idiag.offset.last_rd = offset;
3825 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_WR ||
3826 idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_ST ||
3827 idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_CL) {
3833 value = idiag.cmd.data[IDIAG_BARACC_REG_VAL_INDX];
3834 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_WR) {
3838 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_ST) {
3844 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_CL) {
3856 memset(&idiag, 0, sizeof(idiag));
4028 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4238 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4246 * idiag command, and copies to user @buf. Depending on the queue dump read
4276 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4277 index = idiag.cmd.data[IDIAG_QUEACC_INDEX_INDX];
4278 count = idiag.cmd.data[IDIAG_QUEACC_COUNT_INDX];
4279 pque = (struct lpfc_queue *)idiag.ptr_private;
4295 last_index = idiag.offset.last_rd;
4308 idiag.offset.last_rd = index;
4314 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4320 * This routine get the debugfs idiag command struct from user space and then
4323 * in the idiag command struct for the following debugfs read operation. In
4345 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4350 quetp = idiag.cmd.data[IDIAG_QUEACC_QUETP_INDX];
4351 queid = idiag.cmd.data[IDIAG_QUEACC_QUEID_INDX];
4352 index = idiag.cmd.data[IDIAG_QUEACC_INDEX_INDX];
4353 count = idiag.cmd.data[IDIAG_QUEACC_COUNT_INDX];
4354 offset = idiag.cmd.data[IDIAG_QUEACC_OFFST_INDX];
4355 value = idiag.cmd.data[IDIAG_QUEACC_VALUE_INDX];
4358 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR ||
4359 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST ||
4360 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL) {
4365 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4383 idiag.ptr_private = qp;
4399 idiag.ptr_private = phba->sli4_hba.mbx_cq;
4410 idiag.ptr_private = phba->sli4_hba.els_cq;
4421 idiag.ptr_private = phba->sli4_hba.nvmels_cq;
4435 idiag.ptr_private = qp;
4451 idiag.ptr_private = phba->sli4_hba.mbx_wq;
4465 idiag.ptr_private = phba->sli4_hba.els_wq;
4476 idiag.ptr_private = phba->sli4_hba.nvmels_wq;
4490 idiag.ptr_private = qp;
4506 idiag.ptr_private = phba->sli4_hba.hdr_rq;
4517 idiag.ptr_private = phba->sli4_hba.dat_rq;
4527 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4529 idiag.offset.last_rd = index;
4532 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR ||
4533 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST ||
4534 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL) {
4536 pque = (struct lpfc_queue *)idiag.ptr_private;
4541 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR)
4543 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST)
4545 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL)
4552 memset(&idiag, 0, sizeof(idiag));
4557 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4612 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4620 * to the idiag command, and copies to user @buf. Depending on the doorbell
4650 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_RD)
4651 drb_reg_id = idiag.cmd.data[IDIAG_DRBACC_REGID_INDX];
4667 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4673 * This routine get the debugfs idiag command struct from user space and then
4676 * up the command in the idiag command struct for the following debugfs read
4697 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4702 drb_reg_id = idiag.cmd.data[IDIAG_DRBACC_REGID_INDX];
4703 value = idiag.cmd.data[IDIAG_DRBACC_VALUE_INDX];
4705 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR ||
4706 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST ||
4707 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4712 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_RD) {
4722 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR ||
4723 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST ||
4724 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4745 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR)
4747 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST) {
4751 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4762 memset(&idiag, 0, sizeof(idiag));
4767 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4832 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4840 * to the idiag command, and copies to user @buf.
4868 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_RD)
4869 ctl_reg_id = idiag.cmd.data[IDIAG_CTLACC_REGID_INDX];
4885 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4891 * This routine get the debugfs idiag command struct from user space and then
4912 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4917 ctl_reg_id = idiag.cmd.data[IDIAG_CTLACC_REGID_INDX];
4918 value = idiag.cmd.data[IDIAG_CTLACC_VALUE_INDX];
4920 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR ||
4921 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST ||
4922 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4927 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_RD) {
4937 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR ||
4938 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST ||
4939 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4969 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR)
4971 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST) {
4975 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4986 memset(&idiag, 0, sizeof(idiag));
4991 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5008 mbx_mbox_cmd = idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5009 mbx_dump_map = idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5010 mbx_dump_cnt = idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5011 mbx_word_cnt = idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5026 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5061 if ((idiag.cmd.opcode != LPFC_IDIAG_CMD_MBXACC_DP) &&
5062 (idiag.cmd.opcode != LPFC_IDIAG_BSG_MBXACC_DP))
5071 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5077 * This routine get the debugfs idiag command struct from user space and then
5079 * necessary states in the idiag command struct accordingly.
5096 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
5101 mbx_mbox_cmd = idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5102 mbx_dump_map = idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5103 mbx_dump_cnt = idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5104 mbx_word_cnt = idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5106 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_MBXACC_DP) {
5114 } else if (idiag.cmd.opcode == LPFC_IDIAG_BSG_MBXACC_DP) {
5142 memset(&idiag, 0, sizeof(idiag));
5147 memset(&idiag, 0, sizeof(idiag));
5345 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5351 * This routine get the debugfs idiag command struct from user space and then
5353 * up the necessary states in the idiag command struct accordingly.
5370 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
5374 ext_map = idiag.cmd.data[IDIAG_EXTACC_EXMAP_INDX];
5376 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_EXTACC_RD)
5386 memset(&idiag, 0, sizeof(idiag));
5391 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5399 * the idiag command, and copies to user @buf.
5425 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_EXTACC_RD)
5428 ext_map = idiag.cmd.data[IDIAG_EXTACC_EXMAP_INDX];
5834 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5856 if (idiag.cmd.opcode != LPFC_IDIAG_BSG_MBXACC_DP)
5859 mbx_mbox_cmd = &idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5860 mbx_dump_map = &idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5861 mbx_dump_cnt = &idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5862 mbx_word_cnt = &idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5928 memset(&idiag, 0, sizeof(idiag));
5933 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5952 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_MBXACC_DP)
5955 mbx_mbox_cmd = &idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5956 mbx_dump_map = &idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5957 mbx_dump_cnt = &idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5958 mbx_word_cnt = &idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
6025 memset(&idiag, 0, sizeof(idiag));
6403 memset(&idiag, 0, sizeof(idiag));
6412 idiag.offset.last_rd = 0;
6421 idiag.offset.last_rd = 0;