Code changes from my work and the AMD760MP chipset.
The primary changes is the way in which printk works. But there are many other assorted code cleanups. Just look and see :)
This commit is contained in:
parent
ebccffe3d0
commit
ed8c9d7e0d
62 changed files with 1362 additions and 977 deletions
|
|
@ -26,7 +26,7 @@ void init_HR_TIMER(void)
|
|||
outl(0x80000874, 0x0cf8);
|
||||
acpi_base = inw(0x0cfc);
|
||||
|
||||
printk("init_HR_TIMER: acpi_base = %04x\n", acpi_base);
|
||||
printk_info("init_HR_TIMER: acpi_base = %04x\n", acpi_base);
|
||||
|
||||
j = inw(acpi_base + 0x56) | 0x02; // HR_TMR control
|
||||
outw(j, acpi_base + 0x56); // activate HR_TMR
|
||||
|
|
@ -47,18 +47,18 @@ int test_display_tftp_callback(char *data, int block, int length, int eof)
|
|||
int i;
|
||||
|
||||
#ifdef DEBUG
|
||||
printk("RECD block %u, length = %u:\n",block, length);
|
||||
printk_info("RECD block %u, length = %u:\n",block, length);
|
||||
#endif
|
||||
for(i=0; i<length; i++)
|
||||
if(!data[i])
|
||||
printk("|");
|
||||
printk_info("|");
|
||||
else
|
||||
printk("%c",data[i]);
|
||||
printk_info("%c",data[i]);
|
||||
#ifdef DEBUG
|
||||
if(eof)
|
||||
printk("\nEND OF FILE\n");
|
||||
printk_info("\nEND OF FILE\n");
|
||||
|
||||
printk("====================\n");
|
||||
printk_info("====================\n");
|
||||
#endif
|
||||
return(-1);
|
||||
}
|
||||
|
|
@ -79,23 +79,23 @@ void netboot_init()
|
|||
pcidev = pci_find_device(PCI_VENDOR_ID_SI, 0x0900, (void *)NULL);
|
||||
pci_write_config_byte(pcidev, PCI_BASE_ADDRESS_0, iobase);
|
||||
|
||||
printk("\ncalling init_HR_TIMER\n");
|
||||
printk_info("\ncalling init_HR_TIMER\n");
|
||||
init_HR_TIMER();
|
||||
|
||||
result = sis900_probe(&nic, &iobase, pcidev);
|
||||
|
||||
printk("netboot_init : sis900_probe = %04x\n", (unsigned int) result);
|
||||
printk_info("netboot_init : sis900_probe = %04x\n", (unsigned int) result);
|
||||
|
||||
memcpy(arptable[ARP_CLIENT].node, eth_addr, ETH_ALEN);
|
||||
|
||||
printk("doing rarp:\n");
|
||||
printk_info("doing rarp:\n");
|
||||
rarp();
|
||||
|
||||
printk("My IP address is: %04x\n",arptable[ARP_CLIENT].ipaddr.s_addr);
|
||||
printk("My server's IP address is: %04x\n",arptable[ARP_SERVER].ipaddr.s_addr);
|
||||
printk_info("My IP address is: %04x\n",arptable[ARP_CLIENT].ipaddr.s_addr);
|
||||
printk_info("My server's IP address is: %04x\n",arptable[ARP_SERVER].ipaddr.s_addr);
|
||||
|
||||
#ifdef DEBUG
|
||||
printk("Now testing tftp, transferring cmdline\n");
|
||||
printk_info("Now testing tftp, transferring cmdline\n");
|
||||
|
||||
// tftp("cmdline", test_display_tftp_callback);
|
||||
tftp_init("cmdline");
|
||||
|
|
@ -103,9 +103,9 @@ void netboot_init()
|
|||
rc = tftp_fetchone(buffer);
|
||||
for(i=0; i<rc; i++)
|
||||
if(!buffer[i])
|
||||
printk("|");
|
||||
printk_info("|");
|
||||
else
|
||||
printk("%c",buffer[i]);
|
||||
printk_info("%c",buffer[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ void rfc951_sleep(int exp)
|
|||
/* compute mask */
|
||||
for (tmo = 63; tmo <= 60*TICKS_PER_SEC && --exp > 0; tmo = 2*tmo+1);
|
||||
/* sleep */
|
||||
printk("<sleep>\n");
|
||||
printk_info("<sleep>\n");
|
||||
for (tmo = (tmo&seed)+currticks(); currticks() < tmo; )
|
||||
return;
|
||||
}
|
||||
|
|
@ -351,7 +351,7 @@ int udp_transmit(unsigned long destip, unsigned int srcsock,
|
|||
for(arpentry = 0; arpentry<MAX_ARP; arpentry++)
|
||||
if (arptable[arpentry].ipaddr.s_addr == destip) break;
|
||||
if (arpentry == MAX_ARP) {
|
||||
printk("%I is not in my arp table!\n", destip);
|
||||
printk_info("%I is not in my arp table!\n", destip);
|
||||
return(0);
|
||||
}
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
|
|
@ -440,7 +440,7 @@ int tftp(const char *name, int (*fnc)(unsigned char *, int, int, int))
|
|||
if (block && ((retry += TFTP_REXMT) < TFTP_TIMEOUT))
|
||||
{ /* we resend our last ack */
|
||||
#ifdef MDEBUG
|
||||
printk("<REXMT>\n");
|
||||
printk_info("<REXMT>\n");
|
||||
#endif
|
||||
udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
|
||||
iport, oport,
|
||||
|
|
@ -453,7 +453,7 @@ int tftp(const char *name, int (*fnc)(unsigned char *, int, int, int))
|
|||
tr = (struct tftp_t *)&nic.packet[ETH_HLEN];
|
||||
if (tr->opcode == ntohs(TFTP_ERROR))
|
||||
{
|
||||
printk("TFTP error %d (%s)\n",
|
||||
printk_info("TFTP error %d (%s)\n",
|
||||
ntohs(tr->u.err.errcode),
|
||||
tr->u.err.errmsg);
|
||||
break;
|
||||
|
|
@ -587,7 +587,7 @@ int tftp_init(const char *name)
|
|||
if (block && ((retry += TFTP_REXMT) < TFTP_TIMEOUT))
|
||||
{ /* we resend our last ack */
|
||||
#ifdef MDEBUG
|
||||
printk("<REXMT>\n");
|
||||
printk_info("<REXMT>\n");
|
||||
#endif
|
||||
udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
|
||||
iport, oport,
|
||||
|
|
@ -602,7 +602,7 @@ int tftp_init(const char *name)
|
|||
|
||||
tr = (struct tftp_t *)&nic.packet[ETH_HLEN];
|
||||
if (tr->opcode == ntohs(TFTP_ERROR)) {
|
||||
printk("TFTP error %d (%s)\n",
|
||||
printk_info("TFTP error %d (%s)\n",
|
||||
ntohs(tr->u.err.errcode),
|
||||
tr->u.err.errmsg);
|
||||
|
||||
|
|
@ -687,7 +687,7 @@ retry:
|
|||
if (block && ((retry += TFTP_REXMT) < TFTP_TIMEOUT))
|
||||
{ /* we resend our last ack */
|
||||
#ifdef MDEBUG
|
||||
printk("<REXMT>\n");
|
||||
printk_info("<REXMT>\n");
|
||||
#endif
|
||||
udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
|
||||
iport, oport,
|
||||
|
|
@ -701,7 +701,7 @@ retry:
|
|||
tr = (struct tftp_t *)&nic.packet[ETH_HLEN];
|
||||
if (tr->opcode == ntohs(TFTP_ERROR))
|
||||
{
|
||||
printk("TFTP error %d (%s)\n",
|
||||
printk_info("TFTP error %d (%s)\n",
|
||||
ntohs(tr->u.err.errcode),
|
||||
tr->u.err.errmsg);
|
||||
return(-tr->u.err.errcode);
|
||||
|
|
|
|||
|
|
@ -288,11 +288,11 @@ struct nic *sis900_probe(struct nic *nic, unsigned short *io_addrs, struct pci_d
|
|||
return NULL;
|
||||
}
|
||||
|
||||
printk("\nsis900_probe: MAC addr %02x:%02x:%02x:%02x:%02x:%02x at ioaddr %04x\n",
|
||||
printk_info("\nsis900_probe: MAC addr %02x:%02x:%02x:%02x:%02x:%02x at ioaddr %04x\n",
|
||||
nic->node_addr[0],nic->node_addr[1],nic->node_addr[2],
|
||||
nic->node_addr[3],nic->node_addr[4],nic->node_addr[5],
|
||||
ioaddr);
|
||||
printk("sis900_probe: Vendor:%04x Device:%04x\n", vendor, dev_id);
|
||||
printk_info("sis900_probe: Vendor:%04x Device:%04x\n", vendor, dev_id);
|
||||
|
||||
/* probe for mii transceiver */
|
||||
/* search for total of 32 possible mii phy addresses */
|
||||
|
|
@ -315,7 +315,7 @@ struct nic *sis900_probe(struct nic *nic, unsigned short *io_addrs, struct pci_d
|
|||
|
||||
if (phy_id0 == mii_chip_table[i].phy_id0) {
|
||||
|
||||
printk("sis900_probe: %s transceiver found at address %d.\n",
|
||||
printk_info("sis900_probe: %s transceiver found at address %d.\n",
|
||||
mii_chip_table[i].name, phy_addr);
|
||||
|
||||
mii.chip_info = &mii_chip_table[i];
|
||||
|
|
@ -326,19 +326,19 @@ struct nic *sis900_probe(struct nic *nic, unsigned short *io_addrs, struct pci_d
|
|||
found=1;
|
||||
break;
|
||||
} else {
|
||||
printk("Found an MII, but can't recognize it. id= %u:%u\n", phy_id0, phy_id1);
|
||||
printk_info("Found an MII, but can't recognize it. id= %u:%u\n", phy_id0, phy_id1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found == 0) {
|
||||
printk("sis900_probe: No MII transceivers found!\n");
|
||||
printk_info("sis900_probe: No MII transceivers found!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Arbitrarily select the last PHY found as current PHY */
|
||||
cur_phy = mii.phy_addr;
|
||||
printk("sis900_probe: Using %s as default\n", mii.chip_info->name);
|
||||
printk_info("sis900_probe: Using %s as default\n", mii.chip_info->name);
|
||||
|
||||
/* initialize device */
|
||||
sis900_init(nic);
|
||||
|
|
@ -602,7 +602,7 @@ sis900_init_rxfilter(struct nic *nic)
|
|||
outl(w, ioaddr + rfdr);
|
||||
|
||||
if (sis900_debug > 0)
|
||||
printk("sis900_init_rxfilter: Receive Filter Addrss[%d]=%x\n",
|
||||
printk_info("sis900_init_rxfilter: Receive Filter Addrss[%d]=%x\n",
|
||||
i, inl(ioaddr + rfdr));
|
||||
}
|
||||
|
||||
|
|
@ -631,7 +631,7 @@ sis900_init_txd(struct nic *nic)
|
|||
/* load Transmit Descriptor Register */
|
||||
outl((u32) &txd, ioaddr + txdp);
|
||||
if (sis900_debug > 0)
|
||||
printk("sis900_init_txd: TX descriptor register loaded with: %X\n",
|
||||
printk_info("sis900_init_txd: TX descriptor register loaded with: %X\n",
|
||||
inl(ioaddr + txdp));
|
||||
}
|
||||
|
||||
|
|
@ -658,7 +658,7 @@ sis900_init_rxd(struct nic *nic)
|
|||
rxd[i].cmdsts = (u32) RX_BUF_SIZE;
|
||||
rxd[i].bufptr = (u32) &rxb[i*RX_BUF_SIZE];
|
||||
if (sis900_debug > 0)
|
||||
printk("sis900_init_rxd: rxd[%d]=%X link=%X cmdsts=%X bufptr=%X\n",
|
||||
printk_info("sis900_init_rxd: rxd[%d]=%X link=%X cmdsts=%X bufptr=%X\n",
|
||||
i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
|
||||
}
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ sis900_init_rxd(struct nic *nic)
|
|||
outl((u32) &rxd[0], ioaddr + rxdp);
|
||||
|
||||
if (sis900_debug > 0)
|
||||
printk("sis900_init_rxd: RX descriptor register loaded with: %X\n",
|
||||
printk_info("sis900_init_rxd: RX descriptor register loaded with: %X\n",
|
||||
inl(ioaddr + rxdp));
|
||||
|
||||
}
|
||||
|
|
@ -773,9 +773,9 @@ sis900_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex)
|
|||
*duplex = FDX_CAPABLE_HALF_SELECTED;
|
||||
|
||||
if (status & MII_STSOUT_LINK_FAIL)
|
||||
printk("sis900_read_mode: Media Link Off\n");
|
||||
printk_info("sis900_read_mode: Media Link Off\n");
|
||||
else
|
||||
printk("sis900_read_mode: Media Link On %s %s-duplex \n",
|
||||
printk_info("sis900_read_mode: Media Link On %s %s-duplex \n",
|
||||
*speed == HW_SPEED_100_MBPS ?
|
||||
"100mbps" : "10mbps",
|
||||
*duplex == FDX_CAPABLE_FULL_SELECTED ?
|
||||
|
|
@ -816,22 +816,22 @@ amd79c901_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex)
|
|||
*duplex = FDX_CAPABLE_HALF_SELECTED;
|
||||
|
||||
if (status & MII_STSSUM_LINK)
|
||||
printk("amd79c901_read_mode: Media Link On %s %s-duplex \n",
|
||||
printk_info("amd79c901_read_mode: Media Link On %s %s-duplex \n",
|
||||
*speed == HW_SPEED_100_MBPS ?
|
||||
"100mbps" : "10mbps",
|
||||
*duplex == FDX_CAPABLE_FULL_SELECTED ?
|
||||
"full" : "half");
|
||||
else
|
||||
printk("amd79c901_read_mode: Media Link Off\n");
|
||||
printk_info("amd79c901_read_mode: Media Link Off\n");
|
||||
}
|
||||
else {
|
||||
/* HomePNA */
|
||||
*speed = HW_SPEED_HOME;
|
||||
*duplex = FDX_CAPABLE_HALF_SELECTED;
|
||||
if (status & MII_STAT_LINK)
|
||||
printk("amd79c901_read_mode:Media Link On 1mbps half-duplex \n");
|
||||
printk_info("amd79c901_read_mode:Media Link On 1mbps half-duplex \n");
|
||||
else
|
||||
printk("amd79c901_read_mode: Media Link Off\n");
|
||||
printk_info("amd79c901_read_mode: Media Link Off\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -867,13 +867,13 @@ static void ics1893_read_mode(struct nic *nic, int phy_addr, int *speed, int *du
|
|||
*duplex = FDX_CAPABLE_HALF_SELECTED;
|
||||
|
||||
if (status & MII_STSICS_LINKSTS)
|
||||
printk("ics1893_read_mode: Media Link On %s %s-duplex \n",
|
||||
printk_info("ics1893_read_mode: Media Link On %s %s-duplex \n",
|
||||
*speed == HW_SPEED_100_MBPS ?
|
||||
"100mbps" : "10mbps",
|
||||
*duplex == FDX_CAPABLE_FULL_SELECTED ?
|
||||
"full" : "half");
|
||||
else
|
||||
printk("ics1893_read_mode: Media Link Off\n");
|
||||
printk_info("ics1893_read_mode: Media Link Off\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -911,13 +911,13 @@ static void rtl8201_read_mode(struct nic *nic, int phy_addr, int *speed, int *du
|
|||
}
|
||||
|
||||
if (status & MII_STAT_LINK)
|
||||
printk("rtl8201_read_mode: Media Link On %s %s-duplex \n",
|
||||
printk_info("rtl8201_read_mode: Media Link On %s %s-duplex \n",
|
||||
*speed == HW_SPEED_100_MBPS ?
|
||||
"100mbps" : "10mbps",
|
||||
*duplex == FDX_CAPABLE_FULL_SELECTED ?
|
||||
"full" : "half");
|
||||
else
|
||||
printk("rtl9201_read_config_mode: Media Link Off\n");
|
||||
printk_info("rtl9201_read_config_mode: Media Link Off\n");
|
||||
}
|
||||
|
||||
/* Function: sis900_transmit
|
||||
|
|
@ -948,7 +948,7 @@ sis900_transmit(struct nic *nic,
|
|||
/* load Transmit Descriptor Register */
|
||||
outl((u32) &txd, ioaddr + txdp);
|
||||
if (sis900_debug > 1)
|
||||
printk("sis900_transmit: TX descriptor register loaded with: %X\n",
|
||||
printk_info("sis900_transmit: TX descriptor register loaded with: %X\n",
|
||||
inl(ioaddr + txdp));
|
||||
|
||||
memcpy(txb, d, ETH_ALEN);
|
||||
|
|
@ -961,7 +961,7 @@ sis900_transmit(struct nic *nic,
|
|||
s &= DSIZE;
|
||||
|
||||
if (sis900_debug > 1)
|
||||
printk("sis900_transmit: sending %d bytes ethtype %x\n", (int) s, t);
|
||||
printk_info("sis900_transmit: sending %d bytes ethtype %x\n", (int) s, t);
|
||||
|
||||
/* pad to minimum packet size */
|
||||
while (s < ETH_ZLEN)
|
||||
|
|
@ -975,7 +975,7 @@ sis900_transmit(struct nic *nic,
|
|||
outl(TxENA, ioaddr + cr);
|
||||
|
||||
if (sis900_debug > 1)
|
||||
printk("sis900_transmit: Queued Tx packet size %d.\n", (int) s);
|
||||
printk_info("sis900_transmit: Queued Tx packet size %d.\n", (int) s);
|
||||
|
||||
to = currticks() + TX_TIMEOUT;
|
||||
|
||||
|
|
@ -983,12 +983,12 @@ sis900_transmit(struct nic *nic,
|
|||
/* wait */ ;
|
||||
|
||||
if (currticks() >= to) {
|
||||
printk("sis900_transmit: TX Timeout! Tx status %X.\n", tx_status);
|
||||
printk_info("sis900_transmit: TX Timeout! Tx status %X.\n", tx_status);
|
||||
}
|
||||
|
||||
if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
|
||||
/* packet unsuccessfully transmited */
|
||||
printk("sis900_transmit: Transmit error, Tx status %X.\n", tx_status);
|
||||
printk_info("sis900_transmit: Transmit error, Tx status %X.\n", tx_status);
|
||||
}
|
||||
/* Disable interrupts by clearing the interrupt mask. */
|
||||
outl(0, ioaddr + imr);
|
||||
|
|
@ -1016,20 +1016,20 @@ sis900_poll(struct nic *nic)
|
|||
int retstat = 0;
|
||||
|
||||
if (sis900_debug > 2)
|
||||
printk("sis900_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
|
||||
printk_info("sis900_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
|
||||
|
||||
if (!(rx_status & OWN))
|
||||
return retstat;
|
||||
|
||||
if (sis900_debug > 1)
|
||||
printk("sis900_poll: got a packet: cur_rx:%d, status:%X\n",
|
||||
printk_info("sis900_poll: got a packet: cur_rx:%d, status:%X\n",
|
||||
cur_rx, rx_status);
|
||||
|
||||
nic->packetlen = (rx_status & DSIZE) - CRC_SIZE;
|
||||
|
||||
if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) {
|
||||
/* corrupted packet received */
|
||||
printk("sis900_poll: Corrupted packet received, buffer status = %X\n",
|
||||
printk_info("sis900_poll: Corrupted packet received, buffer status = %X\n",
|
||||
rx_status);
|
||||
retstat = 0;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue