forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/net/ethernet/8390/axnet_cs.c
....@@ -83,7 +83,7 @@
8383 struct net_device *dev);
8484 static struct net_device_stats *get_stats(struct net_device *dev);
8585 static void set_multicast_list(struct net_device *dev);
86
-static void axnet_tx_timeout(struct net_device *dev);
86
+static void axnet_tx_timeout(struct net_device *dev, unsigned int txqueue);
8787 static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
8888 static void ei_watchdog(struct timer_list *t);
8989 static void axnet_reset_8390(struct net_device *dev);
....@@ -610,7 +610,7 @@
610610 switch (cmd) {
611611 case SIOCGMIIPHY:
612612 data->phy_id = info->phy_id;
613
- /* Fall through */
613
+ fallthrough;
614614 case SIOCGMIIREG: /* Read MII PHY register. */
615615 data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f);
616616 return 0;
....@@ -657,8 +657,10 @@
657657 outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD);
658658
659659 insw(nic_base + AXNET_DATAPORT,buf,count>>1);
660
- if (count & 0x01)
661
- buf[count-1] = inb(nic_base + AXNET_DATAPORT), xfer_count++;
660
+ if (count & 0x01) {
661
+ buf[count-1] = inb(nic_base + AXNET_DATAPORT);
662
+ xfer_count++;
663
+ }
662664
663665 }
664666
....@@ -898,12 +900,13 @@
898900 /**
899901 * axnet_tx_timeout - handle transmit time out condition
900902 * @dev: network device which has apparently fallen asleep
903
+ * @txqueue: unused
901904 *
902905 * Called by kernel when device never acknowledges a transmit has
903906 * completed (or failed) - i.e. never posted a Tx related interrupt.
904907 */
905908
906
-static void axnet_tx_timeout(struct net_device *dev)
909
+static void axnet_tx_timeout(struct net_device *dev, unsigned int txqueue)
907910 {
908911 long e8390_base = dev->base_addr;
909912 struct ei_device *ei_local = netdev_priv(dev);
....@@ -1269,10 +1272,12 @@
12691272 ei_local->txing = 1;
12701273 NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
12711274 netif_trans_update(dev);
1272
- ei_local->tx2 = -1,
1275
+ ei_local->tx2 = -1;
12731276 ei_local->lasttx = 2;
1277
+ } else {
1278
+ ei_local->lasttx = 20;
1279
+ ei_local->txing = 0;
12741280 }
1275
- else ei_local->lasttx = 20, ei_local->txing = 0;
12761281 }
12771282 else if (ei_local->tx2 < 0)
12781283 {
....@@ -1288,9 +1293,10 @@
12881293 netif_trans_update(dev);
12891294 ei_local->tx1 = -1;
12901295 ei_local->lasttx = 1;
1296
+ } else {
1297
+ ei_local->lasttx = 10;
1298
+ ei_local->txing = 0;
12911299 }
1292
- else
1293
- ei_local->lasttx = 10, ei_local->txing = 0;
12941300 }
12951301 // else
12961302 // netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n",