Lines Matching refs:idiag

124 static struct lpfc_idiag idiag;
3130 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3133 * @idiag_cmd: pointer to the idiag command struct.
3136 * buffer for getting the idiag command and arguments. The while space in
3177 * lpfc_idiag_open - idiag open debugfs
3185 * space read into the allocated buffer according to the idiag user command
3210 * lpfc_idiag_release - Release idiag access file operation
3215 * This routine is the generic release routine for the idiag access file
3235 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3241 * was opened. It also reset the fields in the idiag command struct in the
3253 switch (idiag.cmd.opcode) {
3260 memset(&idiag, 0, sizeof(idiag));
3275 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3283 * idiag command, and copies to user @buf. Depending on the PCI config space
3322 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_RD) {
3323 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3324 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3358 offset_label = idiag.offset.last_rd;
3387 idiag.offset.last_rd += LPFC_PCI_CFG_RD_SIZE;
3388 if (idiag.offset.last_rd >= LPFC_PCI_CFG_SIZE)
3389 idiag.offset.last_rd = 0;
3391 idiag.offset.last_rd = 0;
3397 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3403 * This routine get the debugfs idiag command struct from user space and
3406 * the command in the idiag command struct for the debugfs read operation.
3434 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
3438 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_RD) {
3443 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3444 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3449 idiag.offset.last_rd = where;
3472 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR ||
3473 idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST ||
3474 idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3479 where = idiag.cmd.data[IDIAG_PCICFG_WHERE_INDX];
3480 count = idiag.cmd.data[IDIAG_PCICFG_COUNT_INDX];
3481 value = idiag.cmd.data[IDIAG_PCICFG_VALUE_INDX];
3492 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3495 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3503 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3517 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3520 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3528 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3542 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_WR)
3544 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_ST) {
3553 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_PCICFG_CL) {
3569 memset(&idiag, 0, sizeof(idiag));
3574 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3582 * according to the idiag command, and copies to user @buf.
3618 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_RD) {
3619 bar_num = idiag.cmd.data[IDIAG_BARACC_BAR_NUM_INDX];
3620 offset = idiag.cmd.data[IDIAG_BARACC_OFF_SET_INDX];
3621 acc_range = idiag.cmd.data[IDIAG_BARACC_ACC_MOD_INDX];
3622 bar_size = idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX];
3661 offset_label = idiag.offset.last_rd;
3701 idiag.offset.last_rd += LPFC_PCI_BAR_RD_SIZE;
3703 if (idiag.offset.last_rd >= bar_size)
3704 idiag.offset.last_rd = 0;
3708 idiag.offset.last_rd = offset;
3712 idiag.offset.last_rd = 0;
3714 idiag.offset.last_rd = offset;
3721 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3727 * This routine get the debugfs idiag command struct from user space and
3730 * read command, it sets up the command in the idiag command struct for
3759 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
3764 bar_num = idiag.cmd.data[IDIAG_BARACC_BAR_NUM_INDX];
3779 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3783 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3787 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3794 idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX] =
3802 offset = idiag.cmd.data[IDIAG_BARACC_OFF_SET_INDX];
3806 bar_size = idiag.cmd.data[IDIAG_BARACC_BAR_SZE_INDX];
3807 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_RD) {
3811 acc_range = idiag.cmd.data[IDIAG_BARACC_ACC_MOD_INDX];
3816 idiag.offset.last_rd = offset;
3821 idiag.offset.last_rd = offset;
3824 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_WR ||
3825 idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_ST ||
3826 idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_CL) {
3832 value = idiag.cmd.data[IDIAG_BARACC_REG_VAL_INDX];
3833 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_WR) {
3837 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_ST) {
3843 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_BARACC_CL) {
3855 memset(&idiag, 0, sizeof(idiag));
4027 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4236 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4244 * idiag command, and copies to user @buf. Depending on the queue dump read
4274 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4275 index = idiag.cmd.data[IDIAG_QUEACC_INDEX_INDX];
4276 count = idiag.cmd.data[IDIAG_QUEACC_COUNT_INDX];
4277 pque = (struct lpfc_queue *)idiag.ptr_private;
4293 last_index = idiag.offset.last_rd;
4306 idiag.offset.last_rd = index;
4312 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4318 * This routine get the debugfs idiag command struct from user space and then
4321 * in the idiag command struct for the following debugfs read operation. In
4343 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4348 quetp = idiag.cmd.data[IDIAG_QUEACC_QUETP_INDX];
4349 queid = idiag.cmd.data[IDIAG_QUEACC_QUEID_INDX];
4350 index = idiag.cmd.data[IDIAG_QUEACC_INDEX_INDX];
4351 count = idiag.cmd.data[IDIAG_QUEACC_COUNT_INDX];
4352 offset = idiag.cmd.data[IDIAG_QUEACC_OFFST_INDX];
4353 value = idiag.cmd.data[IDIAG_QUEACC_VALUE_INDX];
4356 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR ||
4357 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST ||
4358 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL) {
4363 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4381 idiag.ptr_private = qp;
4397 idiag.ptr_private = phba->sli4_hba.mbx_cq;
4408 idiag.ptr_private = phba->sli4_hba.els_cq;
4419 idiag.ptr_private = phba->sli4_hba.nvmels_cq;
4433 idiag.ptr_private = qp;
4449 idiag.ptr_private = phba->sli4_hba.mbx_wq;
4463 idiag.ptr_private = phba->sli4_hba.els_wq;
4474 idiag.ptr_private = phba->sli4_hba.nvmels_wq;
4488 idiag.ptr_private = qp;
4505 idiag.ptr_private = phba->sli4_hba.hdr_rq;
4516 idiag.ptr_private = phba->sli4_hba.dat_rq;
4528 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_RD) {
4530 idiag.offset.last_rd = index;
4533 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR ||
4534 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST ||
4535 idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL) {
4537 pque = (struct lpfc_queue *)idiag.ptr_private;
4542 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR)
4544 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_ST)
4546 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_CL)
4553 memset(&idiag, 0, sizeof(idiag));
4558 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4613 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4621 * to the idiag command, and copies to user @buf. Depending on the doorbell
4651 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_RD)
4652 drb_reg_id = idiag.cmd.data[IDIAG_DRBACC_REGID_INDX];
4668 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4674 * This routine get the debugfs idiag command struct from user space and then
4677 * up the command in the idiag command struct for the following debugfs read
4698 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4703 drb_reg_id = idiag.cmd.data[IDIAG_DRBACC_REGID_INDX];
4704 value = idiag.cmd.data[IDIAG_DRBACC_VALUE_INDX];
4706 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR ||
4707 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST ||
4708 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4713 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_RD) {
4723 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR ||
4724 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST ||
4725 idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4746 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_WR)
4748 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_ST) {
4752 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_DRBACC_CL) {
4763 memset(&idiag, 0, sizeof(idiag));
4768 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4833 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4841 * to the idiag command, and copies to user @buf.
4869 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_RD)
4870 ctl_reg_id = idiag.cmd.data[IDIAG_CTLACC_REGID_INDX];
4886 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4892 * This routine get the debugfs idiag command struct from user space and then
4913 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
4918 ctl_reg_id = idiag.cmd.data[IDIAG_CTLACC_REGID_INDX];
4919 value = idiag.cmd.data[IDIAG_CTLACC_VALUE_INDX];
4921 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR ||
4922 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST ||
4923 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4928 } else if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_RD) {
4938 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR ||
4939 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST ||
4940 idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4970 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_WR)
4972 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_ST) {
4976 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_CTLACC_CL) {
4987 memset(&idiag, 0, sizeof(idiag));
4992 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5009 mbx_mbox_cmd = idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5010 mbx_dump_map = idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5011 mbx_dump_cnt = idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5012 mbx_word_cnt = idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5027 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5062 if ((idiag.cmd.opcode != LPFC_IDIAG_CMD_MBXACC_DP) &&
5063 (idiag.cmd.opcode != LPFC_IDIAG_BSG_MBXACC_DP))
5072 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5078 * This routine get the debugfs idiag command struct from user space and then
5080 * necessary states in the idiag command struct accordingly.
5097 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
5102 mbx_mbox_cmd = idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5103 mbx_dump_map = idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5104 mbx_dump_cnt = idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5105 mbx_word_cnt = idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5107 if (idiag.cmd.opcode == LPFC_IDIAG_CMD_MBXACC_DP) {
5115 } else if (idiag.cmd.opcode == LPFC_IDIAG_BSG_MBXACC_DP) {
5143 memset(&idiag, 0, sizeof(idiag));
5148 memset(&idiag, 0, sizeof(idiag));
5346 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5352 * This routine get the debugfs idiag command struct from user space and then
5354 * up the necessary states in the idiag command struct accordingly.
5371 rc = lpfc_idiag_cmd_get(buf, nbytes, &idiag.cmd);
5375 ext_map = idiag.cmd.data[IDIAG_EXTACC_EXMAP_INDX];
5377 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_EXTACC_RD)
5387 memset(&idiag, 0, sizeof(idiag));
5392 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5400 * the idiag command, and copies to user @buf.
5426 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_EXTACC_RD)
5429 ext_map = idiag.cmd.data[IDIAG_EXTACC_EXMAP_INDX];
5670 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5692 if (idiag.cmd.opcode != LPFC_IDIAG_BSG_MBXACC_DP)
5695 mbx_mbox_cmd = &idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5696 mbx_dump_map = &idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5697 mbx_dump_cnt = &idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5698 mbx_word_cnt = &idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5764 memset(&idiag, 0, sizeof(idiag));
5769 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5788 if (idiag.cmd.opcode != LPFC_IDIAG_CMD_MBXACC_DP)
5791 mbx_mbox_cmd = &idiag.cmd.data[IDIAG_MBXACC_MBCMD_INDX];
5792 mbx_dump_map = &idiag.cmd.data[IDIAG_MBXACC_DPMAP_INDX];
5793 mbx_dump_cnt = &idiag.cmd.data[IDIAG_MBXACC_DPCNT_INDX];
5794 mbx_word_cnt = &idiag.cmd.data[IDIAG_MBXACC_WDCNT_INDX];
5861 memset(&idiag, 0, sizeof(idiag));
6216 memset(&idiag, 0, sizeof(idiag));
6225 idiag.offset.last_rd = 0;
6234 idiag.offset.last_rd = 0;