patch-2.4.20 linux-2.4.20/drivers/net/gt96100eth.c
Next file: linux-2.4.20/drivers/net/hamachi.c
Previous file: linux-2.4.20/drivers/net/gmac.c
Back to the patch index
Back to the overall index
- Lines: 531
- Date:
Thu Nov 28 15:53:13 2002
- Orig file:
linux-2.4.19/drivers/net/gt96100eth.c
- Orig date:
Fri Aug 2 17:39:44 2002
diff -urN linux-2.4.19/drivers/net/gt96100eth.c linux-2.4.20/drivers/net/gt96100eth.c
@@ -256,7 +256,7 @@
gt96100_delay(1);
if (--timedout == 0) {
- printk(KERN_ERR __FUNCTION__ ": busy timeout!!\n");
+ printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__);
return -ENODEV;
}
}
@@ -270,7 +270,7 @@
gt96100_delay(1);
if (--timedout == 0) {
- printk(KERN_ERR __FUNCTION__ ": timeout!!\n");
+ printk(KERN_ERR "%s: timeout!!\n", __FUNCTION__);
return -ENODEV;
}
}
@@ -322,7 +322,7 @@
gt96100_delay(1);
if (--timedout == 0) {
- printk(KERN_ERR __FUNCTION__ ": busy timeout!!\n");
+ printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__);
return -1;
}
}
@@ -339,7 +339,7 @@
struct gt96100_private *gp = (struct gt96100_private *)dev->priv;
int i;
- dbg(0, __FUNCTION__ ": txno/txni/cnt=%d/%d/%d\n",
+ dbg(0, "%s: txno/txni/cnt=%d/%d/%d\n", __FUNCTION__,
gp->tx_next_out, gp->tx_next_in, gp->tx_count);
for (i=0; i<TX_RING_SIZE; i++)
@@ -352,7 +352,7 @@
struct gt96100_private *gp = (struct gt96100_private *)dev->priv;
int i;
- dbg(0, __FUNCTION__ ": rxno=%d\n", gp->rx_next_out);
+ dbg(0, "%s: rxno=%d\n", __FUNCTION__, gp->rx_next_out);
for (i=0; i<RX_RING_SIZE; i++)
dump_rx_desc(0, dev, i);
@@ -403,9 +403,8 @@
unsigned char* skbdata;
if (dbg_lvl <= GT96100_DEBUG) {
- dbg(dbg_lvl, __FUNCTION__
- ": skb=%p, skb->data=%p, skb->len=%d\n",
- skb, skb->data, skb->len);
+ dbg(dbg_lvl, "%s: skb=%p, skb->data=%p, skb->len=%d\n",
+ __FUNCTION__, skb, skb->data, skb->len);
skbdata = (unsigned char*)KSEG1ADDR(skb->data);
@@ -435,11 +434,11 @@
tblEntry1 |= (u32)addr[4] << 11;
tblEntry1 |= (u32)addr[3] << 19;
tblEntry1 |= ((u32)addr[2] & 0x1f) << 27;
- dbg(3, __FUNCTION__ ": tblEntry1=%x\n", tblEntry1);
+ dbg(3, "%s: tblEntry1=%x\n", __FUNCTION__, tblEntry1);
tblEntry0 = ((u32)addr[2] >> 5) & 0x07;
tblEntry0 |= (u32)addr[1] << 3;
tblEntry0 |= (u32)addr[0] << 11;
- dbg(3, __FUNCTION__ ": tblEntry0=%x\n", tblEntry0);
+ dbg(3, "%s: tblEntry0=%x\n", __FUNCTION__, tblEntry0);
#if 0
@@ -453,7 +452,7 @@
((ctmp&0x20)<<1) | ((ctmp&0x40)>>1);
}
- dump_hw_addr(3, dev, __FUNCTION__ ": nib swap/invt addr=", hash_ea);
+ dump_hw_addr(3, dev, "%s: nib swap/invt addr=", __FUNCTION__, hash_ea);
if (gp->hash_mode == 0) {
hashResult = ((u16)hash_ea[0] & 0xfc) << 7;
@@ -467,19 +466,19 @@
return -1; // don't support hash mode 1
}
- dbg(3, __FUNCTION__ ": hashResult=%x\n", hashResult);
+ dbg(3, "%s: hashResult=%x\n", __FUNCTION__, hashResult);
tblEntryAddr =
(u32 *)(&gp->hash_table[((u32)hashResult & 0x7ff) << 3]);
- dbg(3, __FUNCTION__ ": tblEntryAddr=%p\n", tblEntryAddr);
+ dbg(3, "%s: tblEntryAddr=%p\n", tblEntryAddr, __FUNCTION__);
for (i=0; i<HASH_HOP_NUMBER; i++) {
if ((*tblEntryAddr & hteValid) &&
!(*tblEntryAddr & hteSkip)) {
// This entry is already occupied, go to next entry
tblEntryAddr += 2;
- dbg(3, __FUNCTION__ ": skipping to %p\n",
+ dbg(3, "%s: skipping to %p\n", __FUNCTION__,
tblEntryAddr);
} else {
memset(tblEntryAddr, 0, 8);
@@ -490,7 +489,7 @@
}
if (i >= HASH_HOP_NUMBER) {
- err(__FUNCTION__ ": expired!\n");
+ err("%s: expired!\n", __FUNCTION__);
return -1; // Couldn't find an unused entry
}
@@ -552,7 +551,7 @@
struct gt96100_private *gp = (struct gt96100_private *)dev->priv;
int timedout = 100; // wait up to 100 msec for hard stop to complete
- dbg(3, __FUNCTION__ "\n");
+ dbg(3, "%s\n", __FUNCTION__);
// Return if neither Rx or Tx abort bits are set
if (!(abort_bits & (sdcmrAR | sdcmrAT)))
@@ -566,7 +565,7 @@
// abort any Rx/Tx DMA immediately
GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, abort_bits);
- dbg(3, __FUNCTION__ ": SDMA comm = %x\n",
+ dbg(3, "%s: SDMA comm = %x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM));
// wait for abort to complete
@@ -575,7 +574,7 @@
gt96100_delay(1);
if (--timedout == 0) {
- err(__FUNCTION__ ": timeout!!\n");
+ err("%s: timeout!!\n", __FUNCTION__);
break;
}
}
@@ -589,7 +588,7 @@
{
struct gt96100_private *gp = (struct gt96100_private *)dev->priv;
- dbg(3, __FUNCTION__ "\n");
+ dbg(3, "%s\n", __FUNCTION__);
disable_ether_irq(dev);
@@ -701,8 +700,7 @@
struct net_device *dev = NULL;
if (gtif->irq < 0) {
- printk(KERN_ERR __FUNCTION__
- ": irq unknown - probing not supported\n");
+ printk(KERN_ERR "%s: irq unknown - probing not supported\n", __FUNCTION_);
return -ENODEV;
}
@@ -726,13 +724,12 @@
// probe for the external PHY
if ((phy_id1 = read_MII(phy_addr, 2)) <= 0 ||
(phy_id2 = read_MII(phy_addr, 3)) <= 0) {
- printk(KERN_ERR __FUNCTION__
- ": no PHY found on MII%d\n", port_num);
+ printk(KERN_ERR "%s: no PHY found on MII%d\n", __FUNCTION__, port_num);
return -ENODEV;
}
if (!request_region(gtif->iobase, GT96100_ETH_IO_SIZE, "GT96100ETH")) {
- printk(KERN_ERR __FUNCTION__ ": request_region failed\n");
+ printk(KERN_ERR "%s: request_region failed\n", __FUNCTION__);
return -EBUSY;
}
@@ -745,7 +742,7 @@
dev->irq = gtif->irq;
if ((retval = parse_mac_addr(dev, gtif->mac_str))) {
- err(__FUNCTION__ ": MAC address parse failed\n");
+ err("%s: MAC address parse failed\n", __FUNCTION__);
retval = -EINVAL;
goto free_region;
}
@@ -809,7 +806,7 @@
}
}
- dbg(3, __FUNCTION__ ": rx_ring=%p, tx_ring=%p\n",
+ dbg(3, "%s: rx_ring=%p, tx_ring=%p\n", __FUNCTION__,
gp->rx_ring, gp->tx_ring);
// Allocate Rx Hash Table
@@ -826,7 +823,7 @@
}
}
- dbg(3, __FUNCTION__ ": hash=%p\n", gp->hash_table);
+ dbg(3, "%s: hash=%p\n", __FUNCTION__, gp->hash_table);
spin_lock_init(&gp->lock);
@@ -849,7 +846,7 @@
if (dev->priv != NULL)
kfree (dev->priv);
kfree (dev);
- err(__FUNCTION__ " failed. Returns %d\n", retval);
+ err("%s failed. Returns %d\n", __FUNCTION__, retval);
return retval;
}
@@ -956,10 +953,10 @@
u32 tmp;
u16 mii_reg;
- dbg(3, __FUNCTION__ ": dev=%p\n", dev);
- dbg(3, __FUNCTION__ ": scs10_lo=%4x, scs10_hi=%4x\n",
+ dbg(3, "%s: dev=%p\n", __FUNCTION__, dev);
+ dbg(3, "%s: scs10_lo=%4x, scs10_hi=%4x\n", __FUNCTION__,
GT96100_READ(0x8), GT96100_READ(0x10));
- dbg(3, __FUNCTION__ ": scs32_lo=%4x, scs32_hi=%4x\n",
+ dbg(3, "%s: scs32_lo=%4x, scs32_hi=%4x\n", __FUNCTION__,
GT96100_READ(0x18), GT96100_READ(0x20));
// Stop and disable Port
@@ -974,7 +971,7 @@
tmp |= (1<<31);
#endif
GT96100_WRITE(GT96100_CIU_ARBITER_CONFIG, tmp);
- dbg(3, __FUNCTION__ ": CIU Config=%x/%x\n",
+ dbg(3, "%s: CIU Config=%x/%x\n", __FUNCTION__,
tmp, GT96100_READ(GT96100_CIU_ARBITER_CONFIG));
// Set routing.
@@ -999,19 +996,19 @@
gt96100_add_hash_entry(dev, dev->dev_addr);
// Set-up DMA ptr to hash table
GT96100ETH_WRITE(gp, GT96100_ETH_HASH_TBL_PTR, gp->hash_table_dma);
- dbg(3, __FUNCTION__ ": Hash Tbl Ptr=%x\n",
+ dbg(3, "%s: Hash Tbl Ptr=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_HASH_TBL_PTR));
// Setup Tx
reset_tx(dev);
- dbg(3, __FUNCTION__ ": Curr Tx Desc Ptr0=%x\n",
+ dbg(3, "%s: Curr Tx Desc Ptr0=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_CURR_TX_DESC_PTR0));
// Setup Rx
reset_rx(dev);
- dbg(3, __FUNCTION__ ": 1st/Curr Rx Desc Ptr0=%x/%x\n",
+ dbg(3, "%s: 1st/Curr Rx Desc Ptr0=%x/%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_1ST_RX_DESC_PTR0),
GT96100ETH_READ(gp, GT96100_ETH_CURR_RX_DESC_PTR0));
@@ -1023,7 +1020,7 @@
mii_reg |= 2; /* enable mii interrupt */
write_MII(gp->phy_addr, 0x11, mii_reg);
- dbg(3, __FUNCTION__ ": PhyAD=%x\n",
+ dbg(3, "%s: PhyAD=%x\n", __FUNCTION__,
GT96100_READ(GT96100_ETH_PHY_ADDR_REG));
// setup DMA
@@ -1038,17 +1035,17 @@
sdcrBLMR | sdcrBLMT |
(0xf<<sdcrRCBit) | sdcrRIFB | (3<<sdcrBSZBit));
#endif
- dbg(3, __FUNCTION__ ": SDMA Config=%x\n",
+ dbg(3, "%s: SDMA Config=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_SDMA_CONFIG));
// start Rx DMA
GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD);
- dbg(3, __FUNCTION__ ": SDMA Comm=%x\n",
+ dbg(3, "%s: SDMA Comm=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM));
// enable this port (set hash size to 1/2K)
GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG, pcrEN | pcrHS);
- dbg(3, __FUNCTION__ ": Port Config=%x\n",
+ dbg(3, "%s: Port Config=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG));
/*
@@ -1068,7 +1065,7 @@
pcxrFCTL | pcxrFCTLen | pcxrFLP |
pcxrPRIOrxOverride | pcxrMIBclrMode);
- dbg(3, __FUNCTION__ ": Port Config Ext=%x\n",
+ dbg(3, "%s: Port Config Ext=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG_EXT));
netif_start_queue(dev);
@@ -1090,7 +1087,7 @@
MOD_INC_USE_COUNT;
- dbg(2, __FUNCTION__ ": dev=%p\n", dev);
+ dbg(2, "%s: dev=%p\n", __FUNCTION__, dev);
// Initialize and startup the GT-96100 ethernet port
if ((retval = gt96100_init(dev))) {
@@ -1107,7 +1104,7 @@
return retval;
}
- dbg(2, __FUNCTION__ ": Initialization done.\n");
+ dbg(2, "%s: Initialization done.\n", __FUNCTION__);
return 0;
}
@@ -1115,7 +1112,7 @@
static int
gt96100_close(struct net_device *dev)
{
- dbg(3, __FUNCTION__ ": dev=%p\n", dev);
+ dbg(3, "%s: dev=%p\n", __FUNCTION__, dev);
// stop the device
if (netif_device_present(dev)) {
@@ -1141,7 +1138,7 @@
nextIn = gp->tx_next_in;
- dbg(3, __FUNCTION__ ": nextIn=%d\n", nextIn);
+ dbg(3, "%s: nextIn=%d\n", __FUNCTION__, nextIn);
if (gp->tx_count >= TX_RING_SIZE) {
warn("Tx Ring full, pkt dropped.\n");
@@ -1151,14 +1148,14 @@
}
if (!(gp->last_psr & psrLink)) {
- err(__FUNCTION__ ": Link down, pkt dropped.\n");
+ err("%s: Link down, pkt dropped.\n", __FUNCTION__);
gp->stats.tx_dropped++;
spin_unlock_irqrestore(&gp->lock, flags);
return 1;
}
if (dma32_to_cpu(gp->tx_ring[nextIn].cmdstat) & txOwn) {
- err(__FUNCTION__ ": device owns descriptor, pkt dropped.\n");
+ err("%s: device owns descriptor, pkt dropped.\n", __FUNCTION__);
gp->stats.tx_dropped++;
// stop the queue, so Tx timeout can fix it
netif_stop_queue(dev);
@@ -1211,7 +1208,7 @@
gt96100_rd_t *rd;
u32 cmdstat;
- dbg(3, __FUNCTION__ ": dev=%p, status=%x\n", dev, status);
+ dbg(3, "%s: dev=%p, status=%x\n", __FUNCTION__, dev, status);
cdp = (GT96100ETH_READ(gp, GT96100_ETH_1ST_RX_DESC_PTR0)
- gp->rx_ring_dma) / sizeof(gt96100_rd_t);
@@ -1226,7 +1223,7 @@
rd = &gp->rx_ring[nextOut];
cmdstat = dma32_to_cpu(rd->cmdstat);
- dbg(4, __FUNCTION__ ": Rx desc cmdstat=%x, nextOut=%d\n",
+ dbg(4, "%s: Rx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__,
cmdstat, nextOut);
if (cmdstat & (u32)rxOwn) {
@@ -1268,8 +1265,7 @@
* the deal with this packet? Good question,
* let's dump it out.
*/
- err(__FUNCTION__
- ": desc not first and last!\n");
+ err("%s: desc not first and last!\n", __FUNCTION__);
dump_rx_desc(0, dev, nextOut);
}
cmdstat |= (u32)rxOwn;
@@ -1283,8 +1279,7 @@
/* Create new skb. */
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL) {
- err(__FUNCTION__
- ": Memory squeeze, dropping packet.\n");
+ err("%s: Memory squeeze, dropping packet.\n", __FUNCTION__);
gp->stats.rx_dropped++;
cmdstat |= (u32)rxOwn;
rd->cmdstat = cpu_to_dma32(cmdstat);
@@ -1306,7 +1301,7 @@
}
if (nextOut == gp->rx_next_out)
- dbg(3, __FUNCTION__ ": RxCDP did not increment?\n");
+ dbg(3, "%s: RxCDP did not increment?\n", __FUNCTION__);
gp->rx_next_out = nextOut;
return 0;
@@ -1334,7 +1329,7 @@
td = &gp->tx_ring[nextOut];
cmdstat = dma32_to_cpu(td->cmdstat);
- dbg(3, __FUNCTION__ ": Tx desc cmdstat=%x, nextOut=%d\n",
+ dbg(3, "%s: Tx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__,
cmdstat, nextOut);
if (cmdstat & (u32)txOwn) {
@@ -1347,7 +1342,7 @@
// increment Tx error stats
if (cmdstat & (u32)txErrorSummary) {
- dbg(2, __FUNCTION__ ": Tx error, cmdstat = %x\n",
+ dbg(2, "%s: Tx error, cmdstat = %x\n", __FUNCTION__,
cmdstat);
gp->stats.tx_errors++;
if (cmdstat & (u32)txReTxLimit)
@@ -1368,8 +1363,7 @@
gp->tx_full = 0;
if (gp->last_psr & psrLink) {
netif_wake_queue(dev);
- dbg(2, __FUNCTION__
- ": Tx Ring was full, queue waked\n");
+ dbg(2, "%s: Tx Ring was full, queue waked\n", __FUNCTION_);
}
}
@@ -1378,24 +1372,24 @@
// free the skb
if (gp->tx_skbuff[nextOut]) {
- dbg(3, __FUNCTION__ ": good Tx, skb=%p\n",
+ dbg(3, "%s: good Tx, skb=%p\n", __FUNCTION__,
gp->tx_skbuff[nextOut]);
dev_kfree_skb_irq(gp->tx_skbuff[nextOut]);
gp->tx_skbuff[nextOut] = NULL;
} else {
- err(__FUNCTION__ ": no skb!\n");
+ err("%s: no skb!\n", __FUNCTION__);
}
}
gp->tx_next_out = nextOut;
if (gt96100_check_tx_consistent(gp)) {
- err(__FUNCTION__ ": Tx queue inconsistent!\n");
+ err("%s: Tx queue inconsistent!\n", __FUNCTION__);
}
if ((status & icrTxEndLow) && gp->tx_count != 0) {
// we must restart the DMA
- dbg(3, __FUNCTION__ ": Restarting Tx DMA\n");
+ dbg(3, "%s: Restarting Tx DMA\n", __FUNCTION__);
GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM,
sdcmrERD | sdcmrTXDL);
}
@@ -1410,11 +1404,11 @@
u32 status;
if (dev == NULL) {
- err(__FUNCTION__ ": null dev ptr\n");
+ err("%s: null dev ptr\n", __FUNCTION__);
return;
}
- dbg(3, __FUNCTION__ ": entry, icr=%x\n",
+ dbg(3, "%s: entry, icr=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_INT_CAUSE));
spin_lock(&gp->lock);
@@ -1449,13 +1443,13 @@
if ((psr & psrLink) && !gp->tx_full &&
netif_queue_stopped(dev)) {
- dbg(0, __FUNCTION__
- ": Link up, waking queue.\n");
+ dbg(0, ": Link up, waking queue.\n",
+ __FUNCTION_);
netif_wake_queue(dev);
} else if (!(psr & psrLink) &&
!netif_queue_stopped(dev)) {
- dbg(0, __FUNCTION__
- "Link down, stopping queue.\n");
+ dbg(0, "Link down, stopping queue.\n",
+ __FUNCTION__);
netif_stop_queue(dev);
}
@@ -1475,13 +1469,13 @@
// Now check TX errors (RX errors were handled in gt96100_rx)
if (status & icrTxErrorLow) {
- err(__FUNCTION__ ": Tx resource error\n");
+ err("%s: Tx resource error\n", __FUNCTION__);
if (--gp->intr_work_done == 0)
break;
}
if (status & icrTxUdr) {
- err(__FUNCTION__ ": Tx underrun error\n");
+ err("%s: Tx underrun error\n", __FUNCTION__);
if (--gp->intr_work_done == 0)
break;
}
@@ -1490,10 +1484,10 @@
if (gp->intr_work_done == 0) {
// ACK any remaining pending interrupts
GT96100ETH_WRITE(gp, GT96100_ETH_INT_CAUSE, 0);
- dbg(3, __FUNCTION__ ": hit max work\n");
+ dbg(3, "%s: hit max work\n", __FUNCTION__);
}
- dbg(3, __FUNCTION__ ": exit, icr=%x\n",
+ dbg(3, "%s: exit, icr=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_INT_CAUSE));
spin_unlock(&gp->lock);
@@ -1532,7 +1526,7 @@
unsigned long flags;
//struct dev_mc_list *mcptr;
- dbg(3, __FUNCTION__ ": dev=%p, flags=%x\n", dev, dev->flags);
+ dbg(3, "%s: dev=%p, flags=%x\n", __FUNCTION__, dev, dev->flags);
// stop the Receiver DMA
abort(dev, sdcmrAR);
@@ -1575,7 +1569,7 @@
struct gt96100_private *gp = (struct gt96100_private *)dev->priv;
unsigned long flags;
- dbg(3, __FUNCTION__ ": dev=%p\n", dev);
+ dbg(3, "%s: dev=%p\n", __FUNCTION__, dev);
if (netif_device_present(dev)) {
spin_lock_irqsave (&gp->lock, flags);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)