forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/net/ethernet/realtek/atp.c
....@@ -204,7 +204,7 @@
204204 static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode);
205205 static int net_close(struct net_device *dev);
206206 static void set_rx_mode(struct net_device *dev);
207
-static void tx_timeout(struct net_device *dev);
207
+static void tx_timeout(struct net_device *dev, unsigned int txqueue);
208208
209209
210210 /* A list of all installed ATP devices, for removing the driver module. */
....@@ -454,14 +454,14 @@
454454 {
455455 struct net_local *lp = netdev_priv(dev);
456456 long ioaddr = dev->base_addr;
457
- int i;
457
+ int i;
458458
459459 /* Turn off the printer multiplexer on the 8012. */
460460 for (i = 0; i < 8; i++)
461461 outb(mux_8012[i], ioaddr + PAR_DATA);
462462 write_reg_high(ioaddr, CMR1, CMR1h_RESET);
463463
464
- for (i = 0; i < 6; i++)
464
+ for (i = 0; i < 6; i++)
465465 write_reg_byte(ioaddr, PAR0 + i, dev->dev_addr[i]);
466466
467467 write_reg_high(ioaddr, CMR2, lp->addr_mode);
....@@ -471,18 +471,18 @@
471471 (read_nibble(ioaddr, CMR2_h) >> 3) & 0x0f);
472472 }
473473
474
- write_reg(ioaddr, CMR2, CMR2_IRQOUT);
475
- write_reg_high(ioaddr, CMR1, CMR1h_RxENABLE | CMR1h_TxENABLE);
474
+ write_reg(ioaddr, CMR2, CMR2_IRQOUT);
475
+ write_reg_high(ioaddr, CMR1, CMR1h_RxENABLE | CMR1h_TxENABLE);
476476
477477 /* Enable the interrupt line from the serial port. */
478478 outb(Ctrl_SelData + Ctrl_IRQEN, ioaddr + PAR_CONTROL);
479479
480480 /* Unmask the interesting interrupts. */
481
- write_reg(ioaddr, IMR, ISR_RxOK | ISR_TxErr | ISR_TxOK);
482
- write_reg_high(ioaddr, IMR, ISRh_RxErr);
481
+ write_reg(ioaddr, IMR, ISR_RxOK | ISR_TxErr | ISR_TxOK);
482
+ write_reg_high(ioaddr, IMR, ISRh_RxErr);
483483
484484 lp->tx_unit_busy = 0;
485
- lp->pac_cnt_in_tx_buf = 0;
485
+ lp->pac_cnt_in_tx_buf = 0;
486486 lp->saved_tx_size = 0;
487487 }
488488
....@@ -533,7 +533,7 @@
533533 outb(Ctrl_HNibWrite | Ctrl_SelData | Ctrl_IRQEN, ioaddr + PAR_CONTROL);
534534 }
535535
536
-static void tx_timeout(struct net_device *dev)
536
+static void tx_timeout(struct net_device *dev, unsigned int txqueue)
537537 {
538538 long ioaddr = dev->base_addr;
539539
....@@ -610,10 +610,12 @@
610610 write_reg(ioaddr, CMR2, CMR2_NULL);
611611 write_reg(ioaddr, IMR, 0);
612612
613
- if (net_debug > 5) printk(KERN_DEBUG "%s: In interrupt ", dev->name);
614
- while (--boguscount > 0) {
613
+ if (net_debug > 5)
614
+ printk(KERN_DEBUG "%s: In interrupt ", dev->name);
615
+ while (--boguscount > 0) {
615616 int status = read_nibble(ioaddr, ISR);
616
- if (net_debug > 5) printk("loop status %02x..", status);
617
+ if (net_debug > 5)
618
+ printk("loop status %02x..", status);
617619
618620 if (status & (ISR_RxOK<<3)) {
619621 handled = 1;
....@@ -640,7 +642,8 @@
640642 } while (--boguscount > 0);
641643 } else if (status & ((ISR_TxErr + ISR_TxOK)<<3)) {
642644 handled = 1;
643
- if (net_debug > 6) printk("handling Tx done..");
645
+ if (net_debug > 6)
646
+ printk("handling Tx done..");
644647 /* Clear the Tx interrupt. We should check for too many failures
645648 and reinitialize the adapter. */
646649 write_reg(ioaddr, ISR, ISR_TxErr + ISR_TxOK);
....@@ -680,7 +683,7 @@
680683 break;
681684 } else
682685 break;
683
- }
686
+ }
684687
685688 /* This following code fixes a rare (and very difficult to track down)
686689 problem where the adapter forgets its ethernet address. */
....@@ -694,7 +697,7 @@
694697 }
695698
696699 /* Tell the adapter that it can go back to using the output line as IRQ. */
697
- write_reg(ioaddr, CMR2, CMR2_IRQOUT);
700
+ write_reg(ioaddr, CMR2, CMR2_IRQOUT);
698701 /* Enable the physical interrupt line, which is sure to be low until.. */
699702 outb(Ctrl_SelData + Ctrl_IRQEN, ioaddr + PAR_CONTROL);
700703 /* .. we enable the interrupt sources. */