Finished by hand

This commit is contained in:
Michael Brown
2005-04-13 01:01:33 +00:00
parent 3616de915e
commit 9848135950
9 changed files with 192 additions and 177 deletions

View File

@@ -571,28 +571,36 @@ static void sundance_disable ( struct nic *nic __unused ) {
outw(TxDisable | RxDisable | StatsDisable, BASE + MACCtrl1);
}
static struct nic_operations sundance_operations = {
.connect = dummy_connect,
.poll = sundance_poll,
.transmit = sundance_transmit,
.irq = sundance_irq,
.disable = sundance_disable,
};
static struct pci_driver sundance_driver;
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
static int sundance_probe ( struct dev *dev ) {
struct nic *nic = nic_device ( dev );
struct pci_device *pci = pci_device ( dev );
u8 ee_data[EEPROM_SIZE];
u16 mii_ctl;
int i;
int speed;
if ( ! find_pci_device ( pci, &sundance_driver ) )
return 0;
if (pci->ioaddr == 0)
return 0;
/* BASE is used throughout to address the card */
BASE = pci->ioaddr;
printf(" sundance.c: Found %s Vendor=0x%hX Device=0x%hX\n",
pci->name, pci->vendor, pci->dev_id);
dev->name, pci->vendor, pci->dev_id);
/* Get the MAC Address by reading the EEPROM */
for (i = 0; i < 3; i++) {
@@ -614,13 +622,13 @@ static int sundance_probe ( struct dev *dev ) {
/* point to private storage */
sdc = &sdx;
sdc->nic_name = pci->name;
sdc->nic_name = dev->name;
sdc->mtu = mtu;
pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
dprintf(("Device revision id: %hx\n", sdc->pci_rev_id));
/* Print out some hardware info */
printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
printf("%s: %! at ioaddr %hX, ", dev->name, nic->node_addr, BASE);
sdc->mii_preamble_required = 0;
if (1) {
int phy, phy_idx = 0;
@@ -735,14 +743,7 @@ static int sundance_probe ( struct dev *dev ) {
sdc->mii_if.full_duplex ? "Full" : "Half");
/* point to NIC specific routines */
static struct nic_operations sundance_operations;
static struct nic_operations sundance_operations = {
.connect = dummy_connect,
.poll = sundance_poll,
.transmit = sundance_transmit,
.irq = sundance_irq,
.disable = sundance_disable,
}; nic->nic_op = &sundance_operations;
nic->nic_op = &sundance_operations;
nic->irqno = pci->irq;
nic->ioaddr = BASE;