u32 sys_cfg, vendor;
int ret = 0;
- sprintf(priv->chip_name, "8188FU");
+ strscpy(priv->chip_name, "8188FU", sizeof(priv->chip_name));
priv->rtl_chip = RTL8188F;
priv->rf_paths = 1;
priv->rx_paths = 1;
bonding = rtl8xxxu_read32(priv, REG_HPON_FSM);
bonding &= HPON_FSM_BONDING_MASK;
if (bonding == HPON_FSM_BONDING_1T2R) {
- sprintf(priv->chip_name, "8191CU");
+ strscpy(priv->chip_name, "8191CU", sizeof(priv->chip_name));
priv->tx_paths = 1;
priv->usb_interrupts = 1;
priv->rtl_chip = RTL8191C;
} else {
- sprintf(priv->chip_name, "8192CU");
+ strscpy(priv->chip_name, "8192CU", sizeof(priv->chip_name));
priv->tx_paths = 2;
priv->usb_interrupts = 0;
priv->rtl_chip = RTL8192C;
priv->rf_paths = 2;
priv->rx_paths = 2;
} else {
- sprintf(priv->chip_name, "8188CU");
+ strscpy(priv->chip_name, "8188CU", sizeof(priv->chip_name));
priv->rf_paths = 1;
priv->rx_paths = 1;
priv->tx_paths = 1;
priv->power_base = &rtl8192c_power_base;
if (efuse->rf_regulatory & 0x20) {
- sprintf(priv->chip_name, "8188RU");
+ strscpy(priv->chip_name, "8188RU", sizeof(priv->chip_name));
priv->rtl_chip = RTL8188R;
priv->hi_pa = 1;
priv->no_pape = 1;
bonding = rtl8xxxu_read32(priv, REG_HPON_FSM);
bonding &= HPON_FSM_BONDING_MASK;
if (bonding == HPON_FSM_BONDING_1T2R) {
- sprintf(priv->chip_name, "8191EU");
+ strscpy(priv->chip_name, "8191EU", sizeof(priv->chip_name));
priv->tx_paths = 1;
priv->rtl_chip = RTL8191E;
} else {
- sprintf(priv->chip_name, "8192EU");
+ strscpy(priv->chip_name, "8192EU", sizeof(priv->chip_name));
priv->tx_paths = 2;
priv->rtl_chip = RTL8192E;
}
goto out;
}
- sprintf(priv->chip_name, "8723AU");
+ strscpy(priv->chip_name, "8723AU", sizeof(priv->chip_name));
priv->usb_interrupts = 1;
priv->rtl_chip = RTL8723A;
goto out;
}
- sprintf(priv->chip_name, "8723BU");
+ strscpy(priv->chip_name, "8723BU", sizeof(priv->chip_name));
priv->rtl_chip = RTL8723B;
priv->rf_paths = 1;
priv->rx_paths = 1;
void rtl8xxxu_identify_vendor_1bit(struct rtl8xxxu_priv *priv, u32 vendor)
{
if (vendor) {
- sprintf(priv->chip_vendor, "UMC");
+ strscpy(priv->chip_vendor, "UMC", sizeof(priv->chip_vendor));
priv->vendor_umc = 1;
} else {
- sprintf(priv->chip_vendor, "TSMC");
+ strscpy(priv->chip_vendor, "TSMC", sizeof(priv->chip_vendor));
}
}
{
switch (vendor) {
case SYS_CFG_VENDOR_ID_TSMC:
- sprintf(priv->chip_vendor, "TSMC");
+ strscpy(priv->chip_vendor, "TSMC", sizeof(priv->chip_vendor));
break;
case SYS_CFG_VENDOR_ID_SMIC:
- sprintf(priv->chip_vendor, "SMIC");
+ strscpy(priv->chip_vendor, "SMIC", sizeof(priv->chip_vendor));
priv->vendor_smic = 1;
break;
case SYS_CFG_VENDOR_ID_UMC:
- sprintf(priv->chip_vendor, "UMC");
+ strscpy(priv->chip_vendor, "UMC", sizeof(priv->chip_vendor));
priv->vendor_umc = 1;
break;
default:
- sprintf(priv->chip_vendor, "unknown");
+ strscpy(priv->chip_vendor, "unknown", sizeof(priv->chip_vendor));
}
}