tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 382d2f9e739bc6f151c718b38537ae522ff848cd commit: c888183b21f36a247bb166ca9365705611bea847 [446/7046] wifi: rtl8xxxu: Support new chip RTL8188FU config: m68k-randconfig-s033-20221111 compiler: m68k-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c888183b21f36a247bb166ca9365705611bea847 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout c888183b21f36a247bb166ca9365705611bea847 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/wireless/realtek/rtl8xxxu/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:1624:23: sparse: sparse: restricted __le16 degrades to integer drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:1625:23: sparse: sparse: restricted __le16 degrades to integer vim +1624 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 1607 1608 static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv) 1609 { 1610 const struct usb_device_descriptor *descriptor = &priv->udev->descriptor; 1611 struct device *dev = &priv->udev->dev; 1612 struct ieee80211_hw *hw = priv->hw; 1613 u32 val32, bonding; 1614 u16 val16; 1615 1616 val32 = rtl8xxxu_read32(priv, REG_SYS_CFG); 1617 priv->chip_cut = (val32 & SYS_CFG_CHIP_VERSION_MASK) >> 1618 SYS_CFG_CHIP_VERSION_SHIFT; 1619 if (val32 & SYS_CFG_TRP_VAUX_EN) { 1620 dev_info(dev, "Unsupported test chip\n"); 1621 return -ENOTSUPP; 1622 } 1623 > 1624 if (descriptor->idVendor == USB_VENDOR_ID_REALTEK && 1625 descriptor->idProduct == 0xf179) { 1626 sprintf(priv->chip_name, "8188FU"); 1627 priv->rtl_chip = RTL8188F; 1628 priv->rf_paths = 1; 1629 priv->rx_paths = 1; 1630 priv->tx_paths = 1; 1631 priv->has_wifi = 1; 1632 goto skip_complicated_chip_detection; 1633 } 1634 1635 if (val32 & SYS_CFG_BT_FUNC) { 1636 if (priv->chip_cut >= 3) { 1637 sprintf(priv->chip_name, "8723BU"); 1638 priv->rtl_chip = RTL8723B; 1639 } else { 1640 sprintf(priv->chip_name, "8723AU"); 1641 priv->usb_interrupts = 1; 1642 priv->rtl_chip = RTL8723A; 1643 } 1644 1645 priv->rf_paths = 1; 1646 priv->rx_paths = 1; 1647 priv->tx_paths = 1; 1648 1649 val32 = rtl8xxxu_read32(priv, REG_MULTI_FUNC_CTRL); 1650 if (val32 & MULTI_WIFI_FUNC_EN) 1651 priv->has_wifi = 1; 1652 if (val32 & MULTI_BT_FUNC_EN) 1653 priv->has_bluetooth = 1; 1654 if (val32 & MULTI_GPS_FUNC_EN) 1655 priv->has_gps = 1; 1656 priv->is_multi_func = 1; 1657 } else if (val32 & SYS_CFG_TYPE_ID) { 1658 bonding = rtl8xxxu_read32(priv, REG_HPON_FSM); 1659 bonding &= HPON_FSM_BONDING_MASK; 1660 if (priv->fops->tx_desc_size == 1661 sizeof(struct rtl8xxxu_txdesc40)) { 1662 if (bonding == HPON_FSM_BONDING_1T2R) { 1663 sprintf(priv->chip_name, "8191EU"); 1664 priv->rf_paths = 2; 1665 priv->rx_paths = 2; 1666 priv->tx_paths = 1; 1667 priv->rtl_chip = RTL8191E; 1668 } else { 1669 sprintf(priv->chip_name, "8192EU"); 1670 priv->rf_paths = 2; 1671 priv->rx_paths = 2; 1672 priv->tx_paths = 2; 1673 priv->rtl_chip = RTL8192E; 1674 } 1675 } else if (bonding == HPON_FSM_BONDING_1T2R) { 1676 sprintf(priv->chip_name, "8191CU"); 1677 priv->rf_paths = 2; 1678 priv->rx_paths = 2; 1679 priv->tx_paths = 1; 1680 priv->usb_interrupts = 1; 1681 priv->rtl_chip = RTL8191C; 1682 } else { 1683 sprintf(priv->chip_name, "8192CU"); 1684 priv->rf_paths = 2; 1685 priv->rx_paths = 2; 1686 priv->tx_paths = 2; 1687 priv->usb_interrupts = 0; 1688 priv->rtl_chip = RTL8192C; 1689 } 1690 priv->has_wifi = 1; 1691 } else { 1692 sprintf(priv->chip_name, "8188CU"); 1693 priv->rf_paths = 1; 1694 priv->rx_paths = 1; 1695 priv->tx_paths = 1; 1696 priv->rtl_chip = RTL8188C; 1697 priv->usb_interrupts = 0; 1698 priv->has_wifi = 1; 1699 } 1700 1701 skip_complicated_chip_detection: 1702 1703 hw->wiphy->available_antennas_tx = BIT(priv->tx_paths) - 1; 1704 hw->wiphy->available_antennas_rx = BIT(priv->rx_paths) - 1; 1705 1706 switch (priv->rtl_chip) { 1707 case RTL8188E: 1708 case RTL8188F: 1709 case RTL8192E: 1710 case RTL8723B: 1711 switch (val32 & SYS_CFG_VENDOR_EXT_MASK) { 1712 case SYS_CFG_VENDOR_ID_TSMC: 1713 sprintf(priv->chip_vendor, "TSMC"); 1714 break; 1715 case SYS_CFG_VENDOR_ID_SMIC: 1716 sprintf(priv->chip_vendor, "SMIC"); 1717 priv->vendor_smic = 1; 1718 break; 1719 case SYS_CFG_VENDOR_ID_UMC: 1720 sprintf(priv->chip_vendor, "UMC"); 1721 priv->vendor_umc = 1; 1722 break; 1723 default: 1724 sprintf(priv->chip_vendor, "unknown"); 1725 } 1726 break; 1727 default: 1728 if (val32 & SYS_CFG_VENDOR_ID) { 1729 sprintf(priv->chip_vendor, "UMC"); 1730 priv->vendor_umc = 1; 1731 } else { 1732 sprintf(priv->chip_vendor, "TSMC"); 1733 } 1734 } 1735 1736 val32 = rtl8xxxu_read32(priv, REG_GPIO_OUTSTS); 1737 priv->rom_rev = (val32 & GPIO_RF_RL_ID) >> 28; 1738 1739 /* 1740 * 8188FU vendor driver doesn't use REG_NORMAL_SIE_EP_TX, 1741 * it just decides the queue mapping based on nr_out_eps. 1742 * However, reading the register returns "0x321" which 1743 * results in a wrong ep_tx_count of 3 and most frames 1744 * not being transmitted. 1745 */ 1746 if (priv->rtl_chip == RTL8188F) 1747 val16 = 0; 1748 else 1749 val16 = rtl8xxxu_read16(priv, REG_NORMAL_SIE_EP_TX); 1750 1751 if (val16 & NORMAL_SIE_EP_TX_HIGH_MASK) { 1752 priv->ep_tx_high_queue = 1; 1753 priv->ep_tx_count++; 1754 } 1755 1756 if (val16 & NORMAL_SIE_EP_TX_NORMAL_MASK) { 1757 priv->ep_tx_normal_queue = 1; 1758 priv->ep_tx_count++; 1759 } 1760 1761 if (val16 & NORMAL_SIE_EP_TX_LOW_MASK) { 1762 priv->ep_tx_low_queue = 1; 1763 priv->ep_tx_count++; 1764 } 1765 1766 /* 1767 * Fallback for devices that do not provide REG_NORMAL_SIE_EP_TX 1768 */ 1769 if (!priv->ep_tx_count) { 1770 switch (priv->nr_out_eps) { 1771 case 4: 1772 case 3: 1773 priv->ep_tx_low_queue = 1; 1774 priv->ep_tx_count++; 1775 fallthrough; 1776 case 2: 1777 priv->ep_tx_normal_queue = 1; 1778 priv->ep_tx_count++; 1779 fallthrough; 1780 case 1: 1781 priv->ep_tx_high_queue = 1; 1782 priv->ep_tx_count++; 1783 break; 1784 default: 1785 dev_info(dev, "Unsupported USB TX end-points\n"); 1786 return -ENOTSUPP; 1787 } 1788 } 1789 1790 return 0; 1791 } 1792 -- 0-DAY CI Kernel Test Service https://01.org/lkp