[linux-next:master 3881/7050] drivers/scsi/qla2xxx/qla_gs.c:1753:29: sparse: sparse: incorrect type in assignment (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b86a6a241b7c60ca7a6ca4fb3c0d2aedbbf2c1b6
commit: 52bfb089d9d384a1ac0f6d94da7636eb9373a8f9 [3881/7050] scsi: qla2xxx: Add vendor extended FDMI commands
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout 52bfb089d9d384a1ac0f6d94da7636eb9373a8f9
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

   drivers/scsi/qla2xxx/qla_gs.c:1450:25: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1451:31: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] cmd_dsd_count @@    got resunsigned short [usertype] cmd_dsd_count @@
   drivers/scsi/qla2xxx/qla_gs.c:1451:31: sparse:    expected unsigned short [usertype] cmd_dsd_count
   drivers/scsi/qla2xxx/qla_gs.c:1451:31: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1452:31: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] rsp_dsd_count @@    got resunsigned short [usertype] rsp_dsd_count @@
   drivers/scsi/qla2xxx/qla_gs.c:1452:31: sparse:    expected unsigned short [usertype] rsp_dsd_count
   drivers/scsi/qla2xxx/qla_gs.c:1452:31: sparse:    got restricted __le16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1453:32: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] rsp_byte_count @@    got restrunsigned int [usertype] rsp_byte_count @@
   drivers/scsi/qla2xxx/qla_gs.c:1453:32: sparse:    expected unsigned int [usertype] rsp_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1453:32: sparse:    got restricted __le32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1454:32: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] cmd_byte_count @@    got restrunsigned int [usertype] cmd_byte_count @@
   drivers/scsi/qla2xxx/qla_gs.c:1454:32: sparse:    expected unsigned int [usertype] cmd_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1454:32: sparse:    got restricted __le32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1457:31: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] length @@    got icted __le32 [usertype] length @@
   drivers/scsi/qla2xxx/qla_gs.c:1457:31: sparse:    expected restricted __le32 [usertype] length
   drivers/scsi/qla2xxx/qla_gs.c:1457:31: sparse:    got unsigned int [usertype] cmd_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1460:31: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] length @@    got icted __le32 [usertype] length @@
   drivers/scsi/qla2xxx/qla_gs.c:1460:31: sparse:    expected restricted __le32 [usertype] length
   drivers/scsi/qla2xxx/qla_gs.c:1460:31: sparse:    got unsigned int [usertype] rsp_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1474:40: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] cmd_byte_count @@    got restrunsigned int [usertype] cmd_byte_count @@
   drivers/scsi/qla2xxx/qla_gs.c:1474:40: sparse:    expected unsigned int [usertype] cmd_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1474:40: sparse:    got restricted __le32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1475:39: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] length @@    got icted __le32 [usertype] length @@
   drivers/scsi/qla2xxx/qla_gs.c:1475:39: sparse:    expected restricted __le32 [usertype] length
   drivers/scsi/qla2xxx/qla_gs.c:1475:39: sparse:    got unsigned int [usertype] cmd_byte_count
   drivers/scsi/qla2xxx/qla_gs.c:1477:39: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] req_bytecount @@    got restrunsigned int [usertype] req_bytecount @@
   drivers/scsi/qla2xxx/qla_gs.c:1477:39: sparse:    expected unsigned int [usertype] req_bytecount
   drivers/scsi/qla2xxx/qla_gs.c:1477:39: sparse:    got restricted __le32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1478:40: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 [usertype] length @@    got icted __le32 [usertype] length @@
   drivers/scsi/qla2xxx/qla_gs.c:1478:40: sparse:    expected restricted __le32 [usertype] length
   drivers/scsi/qla2xxx/qla_gs.c:1478:40: sparse:    got unsigned int [usertype] req_bytecount
   drivers/scsi/qla2xxx/qla_gs.c:1599:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1599:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1599:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1603:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1603:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1603:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1609:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1609:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1609:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1615:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1615:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1615:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1621:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1621:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1621:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1636:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1636:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1636:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1642:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1642:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1642:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1648:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1648:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1648:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1654:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1654:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1654:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1660:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1660:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1660:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1666:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1666:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1666:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1685:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1685:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1685:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1691:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1691:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1691:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1697:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1697:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1697:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1703:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1703:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1703:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1709:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1709:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1709:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1717:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1717:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1717:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1722:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1722:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1722:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1730:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1730:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1730:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1746:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1746:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1746:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1752:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1752:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1752:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
   drivers/scsi/qla2xxx/qla_gs.c:1753:31: sparse: sparse: cast to restricted __le16
>> drivers/scsi/qla2xxx/qla_gs.c:1753:29: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] max_ct_len @@    got restrunsigned int [usertype] max_ct_len @@
   drivers/scsi/qla2xxx/qla_gs.c:1753:29: sparse:    expected unsigned int [usertype] max_ct_len
   drivers/scsi/qla2xxx/qla_gs.c:1753:29: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1757:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1757:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1757:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1760:44: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1763:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1763:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1763:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1768:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1768:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1768:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1774:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1774:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1774:21: sparse:    got restricted __be16 [usertype]
>> drivers/scsi/qla2xxx/qla_gs.c:1775:39: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] vendor_specific_info @@    got restrunsigned int [usertype] vendor_specific_info @@
   drivers/scsi/qla2xxx/qla_gs.c:1775:39: sparse:    expected unsigned int [usertype] vendor_specific_info
   drivers/scsi/qla2xxx/qla_gs.c:1775:39: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1778:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1778:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1778:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1782:13: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1785:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1785:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1785:21: sparse:    got restricted __be16 [usertype]
>> drivers/scsi/qla2xxx/qla_gs.c:1786:28: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] num_ports @@    got restrunsigned int [usertype] num_ports @@
   drivers/scsi/qla2xxx/qla_gs.c:1786:28: sparse:    expected unsigned int [usertype] num_ports
   drivers/scsi/qla2xxx/qla_gs.c:1786:28: sparse:    got restricted __be32 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1789:20: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] len @@    got resunsigned short [usertype] len @@
   drivers/scsi/qla2xxx/qla_gs.c:1789:20: sparse:    expected unsigned short [usertype] len
   drivers/scsi/qla2xxx/qla_gs.c:1789:20: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1792:35: sparse: sparse: cast to restricted __be32
   drivers/scsi/qla2xxx/qla_gs.c:1795:21: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] type @@    got resunsigned short [usertype] type @@
   drivers/scsi/qla2xxx/qla_gs.c:1795:21: sparse:    expected unsigned short [usertype] type
   drivers/scsi/qla2xxx/qla_gs.c:1795:21: sparse:    got restricted __be16 [usertype]
   drivers/scsi/qla2xxx/qla_gs.c:1800:20: sparse: sparse: too many warnings

vim +1753 drivers/scsi/qla2xxx/qla_gs.c

  1576	
  1577	/**
  1578	 * qla2x00_hba_attributes() perform HBA attributes registration
  1579	 * @vha: HA context
  1580	 * @entries: number of entries to use
  1581	 * @callopt: Option to issue extended or standard FDMI
  1582	 *           command parameter
  1583	 *
  1584	 * Returns 0 on success.
  1585	 */
  1586	static unsigned long
  1587	qla2x00_hba_attributes(scsi_qla_host_t *vha, void *entries,
  1588		unsigned int callopt)
  1589	{
  1590		struct qla_hw_data *ha = vha->hw;
  1591		struct init_cb_24xx *icb24 = (void *)ha->init_cb;
  1592		struct new_utsname *p_sysid = utsname();
  1593		struct ct_fdmi_hba_attr *eiter;
  1594		uint16_t alen;
  1595		unsigned long size = 0;
  1596	
  1597		/* Nodename. */
  1598		eiter = entries + size;
  1599		eiter->type = cpu_to_be16(FDMI_HBA_NODE_NAME);
  1600		memcpy(eiter->a.node_name, vha->node_name, sizeof(eiter->a.node_name));
  1601		alen = sizeof(eiter->a.node_name);
  1602		alen += FDMI_ATTR_TYPELEN(eiter);
  1603		eiter->len = cpu_to_be16(alen);
  1604		size += alen;
  1605		ql_dbg(ql_dbg_disc, vha, 0x20a0,
  1606		    "NODENAME = %016llx.\n", wwn_to_u64(eiter->a.node_name));
  1607		/* Manufacturer. */
  1608		eiter = entries + size;
  1609		eiter->type = cpu_to_be16(FDMI_HBA_MANUFACTURER);
  1610		alen = scnprintf(
  1611			eiter->a.manufacturer, sizeof(eiter->a.manufacturer),
  1612			"%s", "QLogic Corporation");
  1613		alen += FDMI_ATTR_ALIGNMENT(alen);
  1614		alen += FDMI_ATTR_TYPELEN(eiter);
  1615		eiter->len = cpu_to_be16(alen);
  1616		size += alen;
  1617		ql_dbg(ql_dbg_disc, vha, 0x20a1,
  1618		    "MANUFACTURER = %s.\n", eiter->a.manufacturer);
  1619		/* Serial number. */
  1620		eiter = entries + size;
  1621		eiter->type = cpu_to_be16(FDMI_HBA_SERIAL_NUMBER);
  1622		alen = 0;
  1623		if (IS_FWI2_CAPABLE(ha)) {
  1624			alen = qla2xxx_get_vpd_field(vha, "SN",
  1625			    eiter->a.serial_num, sizeof(eiter->a.serial_num));
  1626		}
  1627		if (!alen) {
  1628			uint32_t sn = ((ha->serial0 & 0x1f) << 16) |
  1629				(ha->serial2 << 8) | ha->serial1;
  1630			alen = scnprintf(
  1631				eiter->a.serial_num, sizeof(eiter->a.serial_num),
  1632				"%c%05d", 'A' + sn / 100000, sn % 100000);
  1633		}
  1634		alen += FDMI_ATTR_ALIGNMENT(alen);
  1635		alen += FDMI_ATTR_TYPELEN(eiter);
  1636		eiter->len = cpu_to_be16(alen);
  1637		size += alen;
  1638		ql_dbg(ql_dbg_disc, vha, 0x20a2,
  1639		    "SERIAL NUMBER = %s.\n", eiter->a.serial_num);
  1640		/* Model name. */
  1641		eiter = entries + size;
  1642		eiter->type = cpu_to_be16(FDMI_HBA_MODEL);
  1643		alen = scnprintf(
  1644			eiter->a.model, sizeof(eiter->a.model),
  1645			"%s", ha->model_number);
  1646		alen += FDMI_ATTR_ALIGNMENT(alen);
  1647		alen += FDMI_ATTR_TYPELEN(eiter);
  1648		eiter->len = cpu_to_be16(alen);
  1649		size += alen;
  1650		ql_dbg(ql_dbg_disc, vha, 0x20a3,
  1651		    "MODEL NAME = %s.\n", eiter->a.model);
  1652		/* Model description. */
  1653		eiter = entries + size;
  1654		eiter->type = cpu_to_be16(FDMI_HBA_MODEL_DESCRIPTION);
  1655		alen = scnprintf(
  1656			eiter->a.model_desc, sizeof(eiter->a.model_desc),
  1657			"%s", ha->model_desc);
  1658		alen += FDMI_ATTR_ALIGNMENT(alen);
  1659		alen += FDMI_ATTR_TYPELEN(eiter);
  1660		eiter->len = cpu_to_be16(alen);
  1661		size += alen;
  1662		ql_dbg(ql_dbg_disc, vha, 0x20a4,
  1663		    "MODEL DESCRIPTION = %s.\n", eiter->a.model_desc);
  1664		/* Hardware version. */
  1665		eiter = entries + size;
  1666		eiter->type = cpu_to_be16(FDMI_HBA_HARDWARE_VERSION);
  1667		alen = 0;
  1668		if (IS_FWI2_CAPABLE(ha)) {
  1669			if (!alen) {
  1670				alen = qla2xxx_get_vpd_field(vha, "MN",
  1671				    eiter->a.hw_version, sizeof(eiter->a.hw_version));
  1672			}
  1673			if (!alen) {
  1674				alen = qla2xxx_get_vpd_field(vha, "EC",
  1675				    eiter->a.hw_version, sizeof(eiter->a.hw_version));
  1676			}
  1677		}
  1678		if (!alen) {
  1679			alen = scnprintf(
  1680				eiter->a.hw_version, sizeof(eiter->a.hw_version),
  1681				"HW:%s", ha->adapter_id);
  1682		}
  1683		alen += FDMI_ATTR_ALIGNMENT(alen);
  1684		alen += FDMI_ATTR_TYPELEN(eiter);
  1685		eiter->len = cpu_to_be16(alen);
  1686		size += alen;
  1687		ql_dbg(ql_dbg_disc, vha, 0x20a5,
  1688		    "HARDWARE VERSION = %s.\n", eiter->a.hw_version);
  1689		/* Driver version. */
  1690		eiter = entries + size;
  1691		eiter->type = cpu_to_be16(FDMI_HBA_DRIVER_VERSION);
  1692		alen = scnprintf(
  1693			eiter->a.driver_version, sizeof(eiter->a.driver_version),
  1694			"%s", qla2x00_version_str);
  1695		alen += FDMI_ATTR_ALIGNMENT(alen);
  1696		alen += FDMI_ATTR_TYPELEN(eiter);
  1697		eiter->len = cpu_to_be16(alen);
  1698		size += alen;
  1699		ql_dbg(ql_dbg_disc, vha, 0x20a6,
  1700		    "DRIVER VERSION = %s.\n", eiter->a.driver_version);
  1701		/* Option ROM version. */
  1702		eiter = entries + size;
  1703		eiter->type = cpu_to_be16(FDMI_HBA_OPTION_ROM_VERSION);
  1704		alen = scnprintf(
  1705			eiter->a.orom_version, sizeof(eiter->a.orom_version),
  1706			"%d.%02d", ha->bios_revision[1], ha->bios_revision[0]);
  1707		alen += FDMI_ATTR_ALIGNMENT(alen);
  1708		alen += FDMI_ATTR_TYPELEN(eiter);
  1709		eiter->len = cpu_to_be16(alen);
  1710		size += alen;
  1711	
  1712		ql_dbg(ql_dbg_disc, vha, 0x20a7,
  1713		    "OPTROM VERSION = %d.%02d.\n",
  1714		    eiter->a.orom_version[1], eiter->a.orom_version[0]);
  1715		/* Firmware version */
  1716		eiter = entries + size;
  1717		eiter->type = cpu_to_be16(FDMI_HBA_FIRMWARE_VERSION);
  1718		ha->isp_ops->fw_version_str(vha, eiter->a.fw_version,
  1719		    sizeof(eiter->a.fw_version));
  1720		alen += FDMI_ATTR_ALIGNMENT(alen);
  1721		alen += FDMI_ATTR_TYPELEN(eiter);
  1722		eiter->len = cpu_to_be16(alen);
  1723		size += alen;
  1724		ql_dbg(ql_dbg_disc, vha, 0x20a8,
  1725		    "FIRMWARE VERSION = %s.\n", eiter->a.fw_version);
  1726		if (callopt == CALLOPT_FDMI1)
  1727			goto done;
  1728		/* OS Name and Version */
  1729		eiter = entries + size;
  1730		eiter->type = cpu_to_be16(FDMI_HBA_OS_NAME_AND_VERSION);
  1731		alen = 0;
  1732		if (p_sysid) {
  1733			alen = scnprintf(
  1734				eiter->a.os_version, sizeof(eiter->a.os_version),
  1735				"%s %s %s",
  1736				p_sysid->sysname, p_sysid->release, p_sysid->machine);
  1737		}
  1738		if (!alen) {
  1739			alen = scnprintf(
  1740				eiter->a.os_version, sizeof(eiter->a.os_version),
  1741				"%s %s",
  1742				"Linux", fc_host_system_hostname(vha->host));
  1743		}
  1744		alen += FDMI_ATTR_ALIGNMENT(alen);
  1745		alen += FDMI_ATTR_TYPELEN(eiter);
  1746		eiter->len = cpu_to_be16(alen);
  1747		size += alen;
  1748		ql_dbg(ql_dbg_disc, vha, 0x20a9,
  1749		    "OS VERSION = %s.\n", eiter->a.os_version);
  1750		/* MAX CT Payload Length */
  1751		eiter = entries + size;
> 1752		eiter->type = cpu_to_be16(FDMI_HBA_MAXIMUM_CT_PAYLOAD_LENGTH);
> 1753		eiter->a.max_ct_len = cpu_to_be32(le16_to_cpu(IS_FWI2_CAPABLE(ha) ?
  1754			icb24->frame_payload_size : ha->init_cb->frame_payload_size));
  1755		alen = sizeof(eiter->a.max_ct_len);
  1756		alen += FDMI_ATTR_TYPELEN(eiter);
  1757		eiter->len = cpu_to_be16(alen);
  1758		size += alen;
  1759		ql_dbg(ql_dbg_disc, vha, 0x20aa,
  1760		    "CT PAYLOAD LENGTH = 0x%x.\n", be32_to_cpu(eiter->a.max_ct_len));
  1761		/* Node Sybolic Name */
  1762		eiter = entries + size;
> 1763		eiter->type = cpu_to_be16(FDMI_HBA_NODE_SYMBOLIC_NAME);
  1764		alen = qla2x00_get_sym_node_name(vha, eiter->a.sym_name,
  1765		    sizeof(eiter->a.sym_name));
  1766		alen += FDMI_ATTR_ALIGNMENT(alen);
  1767		alen += FDMI_ATTR_TYPELEN(eiter);
  1768		eiter->len = cpu_to_be16(alen);
  1769		size += alen;
  1770		ql_dbg(ql_dbg_disc, vha, 0x20ab,
  1771		    "SYMBOLIC NAME = %s.\n", eiter->a.sym_name);
  1772		/* Vendor Specific information */
  1773		eiter = entries + size;
  1774		eiter->type = cpu_to_be16(FDMI_HBA_VENDOR_SPECIFIC_INFO);
> 1775		eiter->a.vendor_specific_info = cpu_to_be32(PCI_VENDOR_ID_QLOGIC);
  1776		alen = sizeof(eiter->a.vendor_specific_info);
  1777		alen += FDMI_ATTR_TYPELEN(eiter);
  1778		eiter->len = cpu_to_be16(alen);
  1779		size += alen;
  1780		ql_dbg(ql_dbg_disc, vha, 0x20ac,
  1781		    "VENDOR SPECIFIC INFO = 0x%x.\n",
> 1782		    be32_to_cpu(eiter->a.vendor_specific_info));
  1783		/* Num Ports */
  1784		eiter = entries + size;
  1785		eiter->type = cpu_to_be16(FDMI_HBA_NUM_PORTS);
> 1786		eiter->a.num_ports = cpu_to_be32(1);
  1787		alen = sizeof(eiter->a.num_ports);
  1788		alen += FDMI_ATTR_TYPELEN(eiter);
  1789		eiter->len = cpu_to_be16(alen);
  1790		size += alen;
  1791		ql_dbg(ql_dbg_disc, vha, 0x20ad,
  1792		    "PORT COUNT = %x.\n", be32_to_cpu(eiter->a.num_ports));
  1793		/* Fabric Name */
  1794		eiter = entries + size;
  1795		eiter->type = cpu_to_be16(FDMI_HBA_FABRIC_NAME);
  1796		memcpy(eiter->a.fabric_name, vha->fabric_node_name,
  1797		    sizeof(eiter->a.fabric_name));
  1798		alen = sizeof(eiter->a.fabric_name);
  1799		alen += FDMI_ATTR_TYPELEN(eiter);
  1800		eiter->len = cpu_to_be16(alen);
  1801		size += alen;
  1802		ql_dbg(ql_dbg_disc, vha, 0x20ae,
  1803		    "FABRIC NAME = %016llx.\n", wwn_to_u64(eiter->a.fabric_name));
  1804		/* BIOS Version */
  1805		eiter = entries + size;
  1806		eiter->type = cpu_to_be16(FDMI_HBA_BOOT_BIOS_NAME);
  1807		alen = scnprintf(
  1808			eiter->a.bios_name, sizeof(eiter->a.bios_name),
  1809			"BIOS %d.%02d", ha->bios_revision[1], ha->bios_revision[0]);
  1810		alen += FDMI_ATTR_ALIGNMENT(alen);
  1811		alen += FDMI_ATTR_TYPELEN(eiter);
  1812		eiter->len = cpu_to_be16(alen);
  1813		size += alen;
  1814		ql_dbg(ql_dbg_disc, vha, 0x20af,
  1815		    "BIOS NAME = %s\n", eiter->a.bios_name);
  1816		/* Vendor Identifier */
  1817		eiter = entries + size;
  1818		eiter->type = cpu_to_be16(FDMI_HBA_VENDOR_IDENTIFIER);
  1819		alen = scnprintf(
  1820			eiter->a.vendor_identifier, sizeof(eiter->a.vendor_identifier),
  1821			"%s", "QLGC");
  1822		alen += FDMI_ATTR_ALIGNMENT(alen);
  1823		alen += FDMI_ATTR_TYPELEN(eiter);
  1824		eiter->len = cpu_to_be16(alen);
  1825		size += alen;
  1826		ql_dbg(ql_dbg_disc, vha, 0x20b0,
  1827		    "VENDOR IDENTIFIER = %s.\n", eiter->a.vendor_identifier);
  1828	done:
  1829		return size;
  1830	}
  1831	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux