|
|
@@ -153,6 +153,7 @@ enum chip_capability_flags {
|
|
153
|
153
|
HAS_CHIP_XCVR,
|
|
154
|
154
|
};
|
|
155
|
155
|
|
|
|
156
|
+#if 0 /* not used */
|
|
156
|
157
|
static
|
|
157
|
158
|
struct chip_info
|
|
158
|
159
|
{
|
|
|
@@ -165,6 +166,7 @@ mtd80x_chips[] = {
|
|
165
|
166
|
{0x0891, HAS_MII_XCVR}
|
|
166
|
167
|
};
|
|
167
|
168
|
static int chip_cnt = sizeof( mtd80x_chips ) / sizeof( struct chip_info );
|
|
|
169
|
+#endif
|
|
168
|
170
|
|
|
169
|
171
|
/* Offsets to the Command and Status Registers. */
|
|
170
|
172
|
enum mtd_offsets {
|
|
|
@@ -437,7 +439,6 @@ struct mtd_private
|
|
437
|
439
|
static struct mtd_private mtdx;
|
|
438
|
440
|
|
|
439
|
441
|
static int mdio_read(struct nic * , int phy_id, int location);
|
|
440
|
|
-static void mdio_write(struct nic * , int phy_id, int location, int value);
|
|
441
|
442
|
static void getlinktype(struct nic * );
|
|
442
|
443
|
static void getlinkstatus(struct nic * );
|
|
443
|
444
|
static void set_rx_mode(struct nic *);
|
|
|
@@ -445,7 +446,7 @@ static void set_rx_mode(struct nic *);
|
|
445
|
446
|
/**************************************************************************
|
|
446
|
447
|
* init_ring - setup the tx and rx descriptors
|
|
447
|
448
|
*************************************************************************/
|
|
448
|
|
-static void init_ring(struct nic *nic)
|
|
|
449
|
+static void init_ring(struct nic *nic __unused)
|
|
449
|
450
|
{
|
|
450
|
451
|
int i;
|
|
451
|
452
|
|
|
|
@@ -534,7 +535,7 @@ static void mtd_reset(struct nic *nic)
|
|
534
|
535
|
/**************************************************************************
|
|
535
|
536
|
POLL - Wait for a frame
|
|
536
|
537
|
***************************************************************************/
|
|
537
|
|
-static int mtd_poll(struct nic *nic)
|
|
|
538
|
+static int mtd_poll(struct nic *nic, int retrieve)
|
|
538
|
539
|
{
|
|
539
|
540
|
s32 rx_status = mtdx.cur_rx->status;
|
|
540
|
541
|
int retval = 0;
|
|
|
@@ -654,34 +655,46 @@ static void mtd_disable ( struct nic *nic ) {
|
|
654
|
655
|
/* Disable Tx Rx*/
|
|
655
|
656
|
outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
|
|
656
|
657
|
/* Reset the chip to erase previous misconfiguration. */
|
|
657
|
|
- mtd_reset((struct nic *) dev);
|
|
|
658
|
+ mtd_reset(nic);
|
|
658
|
659
|
DBGPRNT(("DISABLE\n"));
|
|
659
|
660
|
}
|
|
660
|
661
|
|
|
|
662
|
+static struct nic_operations mtd_operations = {
|
|
|
663
|
+ .connect = dummy_connect,
|
|
|
664
|
+ .poll = mtd_poll,
|
|
|
665
|
+ .transmit = mtd_transmit,
|
|
|
666
|
+ .irq = dummy_irq,
|
|
|
667
|
+ .disable = mtd_disable,
|
|
|
668
|
+};
|
|
|
669
|
+
|
|
|
670
|
+static struct pci_id mtd80x_nics[] = {
|
|
|
671
|
+ PCI_ROM(0x1516, 0x0800, "MTD800", "Myson MTD800"),
|
|
|
672
|
+ PCI_ROM(0x1516, 0x0803, "MTD803", "Surecom EP-320X"),
|
|
|
673
|
+ PCI_ROM(0x1516, 0x0891, "MTD891", "Myson MTD891"),
|
|
|
674
|
+};
|
|
|
675
|
+
|
|
|
676
|
+static struct pci_driver mtd80x_driver =
|
|
|
677
|
+ PCI_DRIVER ( "MTD80X", mtd80x_nics, PCI_NO_CLASS );
|
|
|
678
|
+
|
|
661
|
679
|
/**************************************************************************
|
|
662
|
680
|
PROBE - Look for an adapter, this routine's visible to the outside
|
|
663
|
681
|
***************************************************************************/
|
|
664
|
682
|
|
|
665
|
683
|
static int mtd_probe ( struct dev *dev ) {
|
|
666
|
|
-
|
|
667
|
684
|
struct nic *nic = nic_device ( dev );
|
|
668
|
|
-
|
|
669
|
685
|
struct pci_device *pci = pci_device ( dev );
|
|
670
|
686
|
int i;
|
|
671
|
687
|
|
|
672
|
|
- if (pci->ioaddr == 0)
|
|
673
|
|
- {
|
|
674
|
|
- return 0;
|
|
675
|
|
- }
|
|
|
688
|
+ if ( ! find_pci_device ( pci, &mtd80x_driver ) )
|
|
|
689
|
+ return 0;
|
|
676
|
690
|
|
|
677
|
|
- printf(" - ");
|
|
|
691
|
+ if (pci->ioaddr == 0)
|
|
|
692
|
+ return 0;
|
|
678
|
693
|
|
|
679
|
694
|
/* Mask the bit that says "this is an io addr" */
|
|
680
|
|
- mtdx.ioaddr = pci->ioaddr & ~3;
|
|
681
|
|
-
|
|
682
|
|
- adjust_pci_device(pci);
|
|
|
695
|
+ mtdx.ioaddr = pci->ioaddr;
|
|
683
|
696
|
|
|
684
|
|
- mtdx.nic_name = pci->name;
|
|
|
697
|
+ mtdx.nic_name = dev->name;
|
|
685
|
698
|
mtdx.dev_id = pci->dev_id;
|
|
686
|
699
|
|
|
687
|
700
|
/* read ethernet id */
|
|
|
@@ -763,26 +776,13 @@ static int mtd_probe ( struct dev *dev ) {
|
|
763
|
776
|
mtd_reset( nic );
|
|
764
|
777
|
|
|
765
|
778
|
/* point to NIC specific routines */
|
|
766
|
|
-static struct nic_operations mtd_operations;
|
|
767
|
|
-static struct nic_operations mtd_operations = {
|
|
768
|
|
- .connect = dummy_connect,
|
|
769
|
|
- .poll = mtd_poll,
|
|
770
|
|
- .transmit = mtd_transmit,
|
|
771
|
|
- .irq = dummy_irq,
|
|
772
|
|
- .disable = mtd_disable,
|
|
773
|
|
-}; nic->nic_op = &mtd_operations;
|
|
|
779
|
+ nic->nic_op = &mtd_operations;
|
|
774
|
780
|
return 1;
|
|
775
|
781
|
}
|
|
776
|
782
|
|
|
777
|
|
-static struct pci_id mtd80x_nics[] =
|
|
778
|
|
- {
|
|
779
|
|
- PCI_ROM(0x1516, 0x0800, "MTD800", "Myson MTD800"),
|
|
780
|
|
- PCI_ROM(0x1516, 0x0803, "MTD803", "Surecom EP-320X"),
|
|
781
|
|
- PCI_ROM(0x1516, 0x0891, "MTD891", "Myson MTD891"),
|
|
782
|
|
- };
|
|
783
|
783
|
|
|
784
|
784
|
/**************************************************************************/
|
|
785
|
|
-static void set_rx_mode(struct nic *nic)
|
|
|
785
|
+static void set_rx_mode(struct nic *nic __unused)
|
|
786
|
786
|
{
|
|
787
|
787
|
u32 mc_filter[2]; /* Multicast hash filter */
|
|
788
|
788
|
u32 rx_mode;
|
|
|
@@ -884,7 +884,7 @@ static u32 m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad)
|
|
884
|
884
|
return miir;
|
|
885
|
885
|
}
|
|
886
|
886
|
|
|
887
|
|
-static int mdio_read(struct nic *nic, int phyad, int regad)
|
|
|
887
|
+static int mdio_read(struct nic *nic __unused, int phyad, int regad)
|
|
888
|
888
|
{
|
|
889
|
889
|
long miiport = mtdx.ioaddr + MANAGEMENT;
|
|
890
|
890
|
u32 miir;
|
|
|
@@ -922,7 +922,9 @@ static int mdio_read(struct nic *nic, int phyad, int regad)
|
|
922
|
922
|
return data & 0xffff;
|
|
923
|
923
|
}
|
|
924
|
924
|
|
|
925
|
|
-static void mdio_write(struct nic *nic, int phyad, int regad, int data)
|
|
|
925
|
+#if 0 /* not used */
|
|
|
926
|
+static void mdio_write(struct nic *nic __unused, int phyad, int regad,
|
|
|
927
|
+ int data)
|
|
926
|
928
|
{
|
|
927
|
929
|
long miiport = mtdx.ioaddr + MANAGEMENT;
|
|
928
|
930
|
u32 miir;
|
|
|
@@ -954,6 +956,7 @@ static void mdio_write(struct nic *nic, int phyad, int regad, int data)
|
|
954
|
956
|
|
|
955
|
957
|
return;
|
|
956
|
958
|
}
|
|
|
959
|
+#endif
|
|
957
|
960
|
|
|
958
|
961
|
static void getlinkstatus(struct nic *nic)
|
|
959
|
962
|
/* function: Routine will read MII Status Register to get link status. */
|
|
|
@@ -1091,8 +1094,4 @@ static void getlinktype(struct nic *dev)
|
|
1091
|
1094
|
}
|
|
1092
|
1095
|
}
|
|
1093
|
1096
|
|
|
1094
|
|
-
|
|
1095
|
|
-static struct pci_driver mtd80x_driver =
|
|
1096
|
|
- PCI_DRIVER ( "MTD80X", mtd80x_nics, PCI_NO_CLASS );
|
|
1097
|
|
-
|
|
1098
|
1097
|
BOOT_DRIVER ( "MTD80X", mtd_probe );
|