#define JUMBO_16K (SZ_16K - VLAN_ETH_HLEN - ETH_FCS_LEN)
static const struct rtl_chip_info {
- u16 mask;
- u16 val;
+ u32 mask;
+ u32 val;
enum mac_version mac_version;
const char *name;
const char *fw_name;
{ 0xfc8, 0x040, RTL_GIGA_MAC_VER_03, "RTL8110s" },
{ 0xfc8, 0x008, RTL_GIGA_MAC_VER_02, "RTL8169s" },
+ /* extended chip version*/
+ { 0x7cf, 0x7c8, RTL_GIGA_MAC_VER_EXTENDED },
+
/* Catch-all */
{ 0x000, 0x000, RTL_GIGA_MAC_NONE }
};
+static const struct rtl_chip_info rtl_chip_infos_extended[] = {
+ { 0x7fffffff, 0x00000000, RTL_GIGA_MAC_VER_64, "RTL9151AS",
+ FIRMWARE_9151A_1},
+
+ /* Catch-all */
+ { 0x00000000, 0x00000000, RTL_GIGA_MAC_NONE }
+};
+
static const struct pci_device_id rtl8169_pci_tbl[] = {
{ PCI_VDEVICE(REALTEK, 0x2502) },
{ PCI_VDEVICE(REALTEK, 0x2600) },
IntrStatus = 0x3e,
TxConfig = 0x40,
+ /* Extended chip version id */
+ TX_CONFIG_V2 = 0x60b0,
#define TXCFG_AUTO_FIFO (1 << 7) /* 8111e-vl */
#define TXCFG_EMPTY (1 << 11) /* 8111e-vl */
.get_eth_ctrl_stats = rtl8169_get_eth_ctrl_stats,
};
-static const struct rtl_chip_info *rtl8169_get_chip_version(u16 xid, bool gmii)
+static const struct rtl_chip_info *rtl8169_get_chip_version(u32 xid, bool gmii)
{
/* Chips combining a 1Gbps MAC with a 100Mbps PHY */
static const struct rtl_chip_info rtl8106eus_info = {
return p;
}
+static const struct rtl_chip_info *rtl8169_get_extended_chip_version(u32 xid2)
+{
+ const struct rtl_chip_info *p = rtl_chip_infos_extended;
+
+ while ((xid2 & p->mask) != p->val)
+ p++;
+ return p;
+}
+
static void rtl_release_firmware(struct rtl8169_private *tp)
{
if (tp->rtl_fw) {
static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
const struct rtl_chip_info *chip;
+ const char *ext_xid_str = "";
struct rtl8169_private *tp;
int jumbo_max, region, rc;
struct net_device *dev;
u32 txconfig;
- u16 xid;
+ u32 xid;
dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
if (!dev)
/* Identify chip attached to board */
chip = rtl8169_get_chip_version(xid, tp->supports_gmii);
+
+ if (chip->mac_version == RTL_GIGA_MAC_VER_EXTENDED) {
+ ext_xid_str = "ext";
+ xid = RTL_R32(tp, TX_CONFIG_V2);
+ chip = rtl8169_get_extended_chip_version(xid);
+ }
if (chip->mac_version == RTL_GIGA_MAC_NONE)
return dev_err_probe(&pdev->dev, -ENODEV,
- "unknown chip XID %03x, contact r8169 maintainers (see MAINTAINERS file)\n",
- xid);
+ "unknown chip %sXID %x, contact r8169 maintainers (see MAINTAINERS file)\n",
+ ext_xid_str, xid);
tp->mac_version = chip->mac_version;
tp->fw_name = chip->fw_name;
tp->leds = rtl8168_init_leds(dev);
}
- netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n",
- chip->name, dev->dev_addr, xid, tp->irq);
+ netdev_info(dev, "%s, %pM, %sXID %x, IRQ %d\n",
+ chip->name, dev->dev_addr, ext_xid_str, xid, tp->irq);
if (jumbo_max)
netdev_info(dev, "jumbo features [frames: %d bytes, tx checksumming: %s]\n",