.. | .. |
---|
158 | 158 | { PCI_VDEVICE(REALTEK, 0x8129) }, |
---|
159 | 159 | { PCI_VDEVICE(REALTEK, 0x8136), RTL_CFG_NO_GBIT }, |
---|
160 | 160 | { PCI_VDEVICE(REALTEK, 0x8161) }, |
---|
161 | | - { PCI_VDEVICE(REALTEK, 0x8162) }, |
---|
162 | 161 | { PCI_VDEVICE(REALTEK, 0x8167) }, |
---|
163 | 162 | { PCI_VDEVICE(REALTEK, 0x8168) }, |
---|
164 | 163 | { PCI_VDEVICE(NCUBE, 0x8168) }, |
---|
.. | .. |
---|
4184 | 4183 | static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, |
---|
4185 | 4184 | struct sk_buff *skb, u32 *opts) |
---|
4186 | 4185 | { |
---|
| 4186 | + u32 transport_offset = (u32)skb_transport_offset(skb); |
---|
4187 | 4187 | struct skb_shared_info *shinfo = skb_shinfo(skb); |
---|
4188 | 4188 | u32 mss = shinfo->gso_size; |
---|
4189 | 4189 | |
---|
.. | .. |
---|
4200 | 4200 | WARN_ON_ONCE(1); |
---|
4201 | 4201 | } |
---|
4202 | 4202 | |
---|
4203 | | - opts[0] |= skb_transport_offset(skb) << GTTCPHO_SHIFT; |
---|
| 4203 | + opts[0] |= transport_offset << GTTCPHO_SHIFT; |
---|
4204 | 4204 | opts[1] |= mss << TD1_MSS_SHIFT; |
---|
4205 | 4205 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
---|
4206 | 4206 | u8 ip_protocol; |
---|
.. | .. |
---|
4228 | 4228 | else |
---|
4229 | 4229 | WARN_ON_ONCE(1); |
---|
4230 | 4230 | |
---|
4231 | | - opts[1] |= skb_transport_offset(skb) << TCPHO_SHIFT; |
---|
| 4231 | + opts[1] |= transport_offset << TCPHO_SHIFT; |
---|
4232 | 4232 | } else { |
---|
4233 | 4233 | unsigned int padto = rtl_quirk_packet_padto(tp, skb); |
---|
4234 | 4234 | |
---|
.. | .. |
---|
4401 | 4401 | struct net_device *dev, |
---|
4402 | 4402 | netdev_features_t features) |
---|
4403 | 4403 | { |
---|
| 4404 | + int transport_offset = skb_transport_offset(skb); |
---|
4404 | 4405 | struct rtl8169_private *tp = netdev_priv(dev); |
---|
4405 | 4406 | |
---|
4406 | 4407 | if (skb_is_gso(skb)) { |
---|
4407 | 4408 | if (tp->mac_version == RTL_GIGA_MAC_VER_34) |
---|
4408 | 4409 | features = rtl8168evl_fix_tso(skb, features); |
---|
4409 | 4410 | |
---|
4410 | | - if (skb_transport_offset(skb) > GTTCPHO_MAX && |
---|
| 4411 | + if (transport_offset > GTTCPHO_MAX && |
---|
4411 | 4412 | rtl_chip_supports_csum_v2(tp)) |
---|
4412 | 4413 | features &= ~NETIF_F_ALL_TSO; |
---|
4413 | 4414 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
---|
.. | .. |
---|
4418 | 4419 | if (rtl_quirk_packet_padto(tp, skb)) |
---|
4419 | 4420 | features &= ~NETIF_F_CSUM_MASK; |
---|
4420 | 4421 | |
---|
4421 | | - if (skb_transport_offset(skb) > TCPHO_MAX && |
---|
| 4422 | + if (transport_offset > TCPHO_MAX && |
---|
4422 | 4423 | rtl_chip_supports_csum_v2(tp)) |
---|
4423 | 4424 | features &= ~NETIF_F_CSUM_MASK; |
---|
4424 | 4425 | } |
---|
.. | .. |
---|
5291 | 5292 | |
---|
5292 | 5293 | return rc; |
---|
5293 | 5294 | } |
---|
5294 | | - |
---|
| 5295 | +extern ssize_t at24_mac_read(unsigned char* mac); |
---|
5295 | 5296 | static void rtl_init_mac_address(struct rtl8169_private *tp) |
---|
5296 | 5297 | { |
---|
5297 | 5298 | struct net_device *dev = tp->dev; |
---|
5298 | 5299 | u8 *mac_addr = dev->dev_addr; |
---|
5299 | | - int rc; |
---|
5300 | | - |
---|
| 5300 | + int rc,i; |
---|
| 5301 | + unsigned char mac[6]; |
---|
| 5302 | +/* |
---|
5301 | 5303 | rc = eth_platform_get_mac_address(tp_to_dev(tp), mac_addr); |
---|
5302 | 5304 | if (!rc) |
---|
5303 | 5305 | goto done; |
---|
.. | .. |
---|
5309 | 5311 | rtl_read_mac_from_reg(tp, mac_addr, MAC0); |
---|
5310 | 5312 | if (is_valid_ether_addr(mac_addr)) |
---|
5311 | 5313 | goto done; |
---|
| 5314 | +*/ |
---|
| 5315 | + memset(mac, 0x00, 6); |
---|
| 5316 | + at24_mac_read(mac); |
---|
| 5317 | + |
---|
| 5318 | + if ((mac[0] == 0x68) && (mac[1] == 0xed)) |
---|
| 5319 | + { |
---|
| 5320 | + printk("troy : rtl811h mac read from eeprom success!! \n"); |
---|
| 5321 | + for (i = 0; i < ETH_ALEN; i++) |
---|
| 5322 | + dev->dev_addr[i] = mac[i]; |
---|
| 5323 | + } |
---|
| 5324 | + else |
---|
| 5325 | + { |
---|
| 5326 | + printk("troy : rtl811h mac read from eeprom error!! \n"); |
---|
| 5327 | + dev->dev_addr[0] = 0x66; |
---|
| 5328 | + dev->dev_addr[1] = 0xED; |
---|
| 5329 | + dev->dev_addr[2] = 0xB5; |
---|
| 5330 | + dev->dev_addr[3] = 0x64; |
---|
| 5331 | + dev->dev_addr[4] = 0x72; |
---|
| 5332 | + dev->dev_addr[5] = 0x2C; |
---|
| 5333 | + } |
---|
| 5334 | + if (is_valid_ether_addr(mac_addr)) |
---|
| 5335 | + goto done; |
---|
| 5336 | + |
---|
5312 | 5337 | |
---|
5313 | 5338 | eth_hw_addr_random(dev); |
---|
5314 | 5339 | dev_warn(tp_to_dev(tp), "can't read MAC address, setting random one\n"); |
---|
.. | .. |
---|
5316 | 5341 | rtl_rar_set(tp, mac_addr); |
---|
5317 | 5342 | } |
---|
5318 | 5343 | |
---|
| 5344 | +extern ssize_t at24_mac1_read(unsigned char* mac); |
---|
5319 | 5345 | static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
---|
5320 | 5346 | { |
---|
5321 | 5347 | struct rtl8169_private *tp; |
---|
.. | .. |
---|
5323 | 5349 | enum mac_version chipset; |
---|
5324 | 5350 | struct net_device *dev; |
---|
5325 | 5351 | u16 xid; |
---|
| 5352 | + unsigned char mac[6]; |
---|
5326 | 5353 | |
---|
5327 | 5354 | dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp)); |
---|
5328 | 5355 | if (!dev) |
---|
.. | .. |
---|
5518 | 5545 | #endif |
---|
5519 | 5546 | }; |
---|
5520 | 5547 | |
---|
5521 | | -module_pci_driver(rtl8169_pci_driver); |
---|
| 5548 | +//module_pci_driver(rtl8169_pci_driver); |
---|
| 5549 | +module_pci_driver2(rtl8169_pci_driver); //late_initcall(); |
---|