Commit af8678e6 authored by Bitterblue Smith's avatar Bitterblue Smith Committed by Kalle Valo
Browse files

wifi: rtl8xxxu: Don't print the vendor/product/serial

Most devices have a vendor name, product name, and serial number in the
efuse, but it's pretty useless. It duplicates the information already
printed by the USB subsystem:

   usb 1-4: New USB device found, idVendor=0bda, idProduct=8178, bcdDevice= 2.00
   usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
   usb 1-4: Product: 802.11n WLAN Adapter
   usb 1-4: Manufacturer: Realtek
   usb 1-4: SerialNumber: 00e04c000001
-> usb 1-4: Vendor: Realtek
-> usb 1-4: Product: 802.11n WLAN Adapter

   usb 1-4: New USB device found, idVendor=0bda, idProduct=818b, bcdDevice= 2.00
   usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
   usb 1-4: Product: 802.11n NIC
   usb 1-4: Manufacturer: Realtek
   usb 1-4: SerialNumber: 00e04c000001
-> usb 1-4: Vendor: Realtek
-> usb 1-4: Product: 802.11n NIC
-> usb 1-4: Serial not available.

   usb 1-4: New USB device found, idVendor=0bda, idProduct=f179, bcdDevice= 0.00
   usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
   usb 1-4: Product: 802.11n
   usb 1-4: Manufacturer: Realtek
   usb 1-4: SerialNumber: 002E2DC0041F
-> usb 1-4: Vendor: Realtek
-> usb 1-4: Product: 802.11n

   usb 1-4: New USB device found, idVendor=0bda, idProduct=8179, bcdDevice= 0.00
   usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
   usb 1-4: Product: 802.11n NIC
   usb 1-4: Manufacturer: Realtek
   usb 1-4: SerialNumber: 00E04C0001
-> usb 1-4: Vendor: Realtek
-> usb 1-4: Product: 802.11n NIC
-> usb 1-4: Serial: 00E04C0001

Also, that data is not interpreted correctly in all cases:

usb 3-1.1.2: New USB device found, idVendor=0bda, idProduct=8179, bcdDevice= 0.00
usb 3-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1.1.2: Product: 802.11n NIC
usb 3-1.1.2: Manufacturer: Realtek
usb 3-1.1.2: Vendor: Realtek
usb 3-1.1.2: Product: \x03802.11n NI
usb 3-1.1.2: Serial: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217231


Signed-off-by: default avatarBitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/a2a7d9df-0529-7890-3522-48dce613753f@gmail.com
parent 59a3a312
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -568,10 +568,6 @@ static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)

	priv->default_crystal_cap = efuse->xtal_k & 0x3f;

	dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
	dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
	dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);

	return 0;
}

+0 −3
Original line number Diff line number Diff line
@@ -734,9 +734,6 @@ static int rtl8188fu_parse_efuse(struct rtl8xxxu_priv *priv)

	priv->default_crystal_cap = efuse->xtal_k & 0x3f;

	dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
	dev_info(&priv->udev->dev, "Product: %.7s\n", efuse->device_name);

	return 0;
}

+0 −5
Original line number Diff line number Diff line
@@ -441,11 +441,6 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
	       efuse->ht20_max_power_offset,
	       sizeof(efuse->ht20_max_power_offset));

	dev_info(&priv->udev->dev, "Vendor: %.7s\n",
		 efuse->vendor_name);
	dev_info(&priv->udev->dev, "Product: %.20s\n",
		 efuse->device_name);

	priv->power_base = &rtl8192c_power_base;

	if (efuse->rf_regulatory & 0x20) {
+0 −54
Original line number Diff line number Diff line
@@ -601,43 +601,9 @@ rtl8192e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
	}
}

static void rtl8192eu_log_next_device_info(struct rtl8xxxu_priv *priv,
					   char *record_name,
					   char *device_info,
					   unsigned int *record_offset)
{
	char *record = device_info + *record_offset;

	/* A record is [ total length | 0x03 | value ] */
	unsigned char l = record[0];

	/*
	 * The whole device info section seems to be 80 characters, make sure
	 * we don't read further.
	 */
	if (*record_offset + l > 80) {
		dev_warn(&priv->udev->dev,
			 "invalid record length %d while parsing \"%s\" at offset %u.\n",
			 l, record_name, *record_offset);
		return;
	}

	if (l >= 2) {
		char value[80];

		memcpy(value, &record[2], l - 2);
		value[l - 2] = '\0';
		dev_info(&priv->udev->dev, "%s: %s\n", record_name, value);
		*record_offset = *record_offset + l;
	} else {
		dev_info(&priv->udev->dev, "%s not available.\n", record_name);
	}
}

static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
{
	struct rtl8192eu_efuse *efuse = &priv->efuse_wifi.efuse8192eu;
	unsigned int record_offset;
	int i;

	if (efuse->rtl_id != cpu_to_le16(0x8129))
@@ -684,26 +650,6 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)

	priv->default_crystal_cap = priv->efuse_wifi.efuse8192eu.xtal_k & 0x3f;

	/*
	 * device_info section seems to be laid out as records
	 * [ total length | 0x03 | value ] so:
	 * - vendor length + 2
	 * - 0x03
	 * - vendor string (not null terminated)
	 * - product length + 2
	 * - 0x03
	 * - product string (not null terminated)
	 * Then there is one or 2 0x00 on all the 4 devices I own or found
	 * dumped online.
	 * As previous version of the code handled an optional serial
	 * string, I now assume there may be a third record if the
	 * length is not 0.
	 */
	record_offset = 0;
	rtl8192eu_log_next_device_info(priv, "Vendor", efuse->device_info, &record_offset);
	rtl8192eu_log_next_device_info(priv, "Product", efuse->device_info, &record_offset);
	rtl8192eu_log_next_device_info(priv, "Serial", efuse->device_info, &record_offset);

	return 0;
}

+0 −4
Original line number Diff line number Diff line
@@ -222,10 +222,6 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)

	priv->power_base = &rtl8723a_power_base;

	dev_info(&priv->udev->dev, "Vendor: %.7s\n",
		 efuse->vendor_name);
	dev_info(&priv->udev->dev, "Product: %.41s\n",
		 efuse->device_name);
	return 0;
}

Loading