usr/src/uts/common/io/fibre-channel/fca/qlge/qlge_dbg.c
changeset 12073 05ba1c0d6140
parent 11023 53231798f4a8
child 13179 7f829eb09eb7
equal deleted inserted replaced
12072:2f8174ed4d92 12073:05ba1c0d6140
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 
    21 
    22 /*
    22 /*
    23  * Copyright 2009 QLogic Corporation. All rights reserved.
    23  * Copyright 2010 QLogic Corporation. All rights reserved.
    24  */
    24  */
    25 
    25 
    26 #include <qlge.h>
    26 #include <qlge.h>
    27 
    27 
    28 static uint32_t ql_dump_buf_8(uint8_t *, uint32_t, uint32_t);
    28 static uint32_t ql_dump_buf_8(uint8_t *, uint32_t, uint32_t);
   176 		}
   176 		}
   177 	} while (--delay_ticks);
   177 	} while (--delay_ticks);
   178 
   178 
   179 	if (delay_ticks == 0) {
   179 	if (delay_ticks == 0) {
   180 		rtn_val = DDI_FAILURE;
   180 		rtn_val = DDI_FAILURE;
       
   181 		cmn_err(CE_WARN, "qlge(%d)wait reg %x, bit %x time out",
       
   182 		    qlge->instance, reg, wait_bit);
       
   183 		if (qlge->fm_enable) {
       
   184 			ql_fm_ereport(qlge, DDI_FM_DEVICE_NO_RESPONSE);
       
   185 			atomic_or_32(&qlge->flags, ADAPTER_ERROR);
       
   186 		}
   181 	}
   187 	}
   182 	return (rtn_val);
   188 	return (rtn_val);
   183 }
   189 }
   184 
   190 
   185 /*
   191 /*
   701 
   707 
   702 	qlge->pci_cfg.msi_x_msg_control = (uint16_t)
   708 	qlge->pci_cfg.msi_x_msg_control = (uint16_t)
   703 	    pci_config_get16(qlge->pci_handle, 0xa2);
   709 	    pci_config_get16(qlge->pci_handle, 0xa2);
   704 
   710 
   705 	if (qlge->ql_dbgprnt & DBG_GLD) {
   711 	if (qlge->ql_dbgprnt & DBG_GLD) {
   706 		ql_printf("%s(%d): enter\n",
   712 		ql_printf("ql_dump_pci_config(%d): enter\n",
   707 		    __func__, qlge->instance);
   713 		    qlge->instance);
   708 		ql_printf("\tvendorid =0x%x.\n",
   714 		ql_printf("\tvendorid =0x%x.\n",
   709 		    qlge->pci_cfg.vendor_id);
   715 		    qlge->pci_cfg.vendor_id);
   710 		ql_printf("\tdeviceid =0x%x.\n",
   716 		ql_printf("\tdeviceid =0x%x.\n",
   711 		    qlge->pci_cfg.device_id);
   717 		    qlge->pci_cfg.device_id);
   712 		ql_printf("\tcommand =0x%x.\n",
   718 		ql_printf("\tcommand =0x%x.\n",
   758 		ql_printf("\tmsi_msg_control =0x%x.\n",
   764 		ql_printf("\tmsi_msg_control =0x%x.\n",
   759 		    qlge->pci_cfg.msi_msg_control);
   765 		    qlge->pci_cfg.msi_msg_control);
   760 		ql_printf("\tmsi_x_msg_control =0x%x.\n",
   766 		ql_printf("\tmsi_x_msg_control =0x%x.\n",
   761 		    qlge->pci_cfg.msi_x_msg_control);
   767 		    qlge->pci_cfg.msi_x_msg_control);
   762 
   768 
   763 		ql_printf("%s(%d): exit\n", __func__, qlge->instance);
   769 		ql_printf("ql_dump_pci_config(%d): exit\n", qlge->instance);
   764 	}
   770 	}
   765 }
   771 }
   766 
   772 
   767 /*
   773 /*
   768  * Print a formated string
   774  * Print a formated string
  1062 				return (IOC_INVAL);
  1068 				return (IOC_INVAL);
  1063 			}
  1069 			}
  1064 			prop_ptr =
  1070 			prop_ptr =
  1065 			    (struct qlnic_prop_info *)(void *)dmp->b_rptr;
  1071 			    (struct qlnic_prop_info *)(void *)dmp->b_rptr;
  1066 			/* get various properties */
  1072 			/* get various properties */
       
  1073 			mutex_enter(&qlge->mbx_mutex);
  1067 			(void) ql_get_firmware_version(qlge,
  1074 			(void) ql_get_firmware_version(qlge,
  1068 			    &prop_ptr->mpi_version);
  1075 			    &prop_ptr->mpi_version);
  1069 			(void) ql_get_fw_state(qlge, &prop_ptr->fw_state);
  1076 			(void) ql_get_fw_state(qlge, &prop_ptr->fw_state);
  1070 			(void) qlge_get_link_status(qlge,
  1077 			(void) qlge_get_link_status(qlge,
  1071 			    &prop_ptr->link_status);
  1078 			    &prop_ptr->link_status);
       
  1079 			mutex_exit(&qlge->mbx_mutex);
  1072 			break;
  1080 			break;
  1073 
  1081 
  1074 		case QLA_LIST_ADAPTER_INFO:
  1082 		case QLA_LIST_ADAPTER_INFO:
  1075 			/* count must be exactly same */
  1083 			/* count must be exactly same */
  1076 			if (iocp->ioc_count != sizeof (ql_adapter_info_t)) {
  1084 			if (iocp->ioc_count != sizeof (ql_adapter_info_t)) {
  1500 	/*
  1508 	/*
  1501 	 * All OK; reprogram for the new mode ...
  1509 	 * All OK; reprogram for the new mode ...
  1502 	 */
  1510 	 */
  1503 	qlge->loop_back_mode = mode;
  1511 	qlge->loop_back_mode = mode;
  1504 	mutex_enter(&qlge->mbx_mutex);
  1512 	mutex_enter(&qlge->mbx_mutex);
  1505 	(void) ql_set_port_cfg(qlge);
  1513 	(void) ql_set_loop_back_mode(qlge);
  1506 	mutex_exit(&qlge->mbx_mutex);
  1514 	mutex_exit(&qlge->mbx_mutex);
  1507 	return (IOC_REPLY);
  1515 	return (IOC_REPLY);
  1508 }
  1516 }
  1509 /*
  1517 /*
  1510  * Loopback ioctl
  1518  * Loopback ioctl