aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smc91x.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-10-19 22:17:52 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-10-19 22:17:52 -0400
commit4cb40f795af36b3deb743f6ccf6c3fd542c61c8d (patch)
treedb3d7519932549bf528f5b8e4cb8350356cd544d /drivers/net/smc91x.c
parent79ed2a9216dd3cc35c4f2c5dbaddadb195af83ac (diff)
parent0cfd81031a26717fe14380d18275f8e217571615 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/kernel-parameters.txt arch/sh/include/asm/elf.h
Diffstat (limited to 'drivers/net/smc91x.c')
-rw-r--r--drivers/net/smc91x.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 24768c10cadb..c70870e0fd61 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -270,7 +270,7 @@ static void smc_reset(struct net_device *dev)
270 unsigned int ctl, cfg; 270 unsigned int ctl, cfg;
271 struct sk_buff *pending_skb; 271 struct sk_buff *pending_skb;
272 272
273 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 273 DBG(2, "%s: %s\n", dev->name, __func__);
274 274
275 /* Disable all interrupts, block TX tasklet */ 275 /* Disable all interrupts, block TX tasklet */
276 spin_lock_irq(&lp->lock); 276 spin_lock_irq(&lp->lock);
@@ -363,7 +363,7 @@ static void smc_enable(struct net_device *dev)
363 void __iomem *ioaddr = lp->base; 363 void __iomem *ioaddr = lp->base;
364 int mask; 364 int mask;
365 365
366 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 366 DBG(2, "%s: %s\n", dev->name, __func__);
367 367
368 /* see the header file for options in TCR/RCR DEFAULT */ 368 /* see the header file for options in TCR/RCR DEFAULT */
369 SMC_SELECT_BANK(lp, 0); 369 SMC_SELECT_BANK(lp, 0);
@@ -397,7 +397,7 @@ static void smc_shutdown(struct net_device *dev)
397 void __iomem *ioaddr = lp->base; 397 void __iomem *ioaddr = lp->base;
398 struct sk_buff *pending_skb; 398 struct sk_buff *pending_skb;
399 399
400 DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__); 400 DBG(2, "%s: %s\n", CARDNAME, __func__);
401 401
402 /* no more interrupts for me */ 402 /* no more interrupts for me */
403 spin_lock_irq(&lp->lock); 403 spin_lock_irq(&lp->lock);
@@ -430,7 +430,7 @@ static inline void smc_rcv(struct net_device *dev)
430 void __iomem *ioaddr = lp->base; 430 void __iomem *ioaddr = lp->base;
431 unsigned int packet_number, status, packet_len; 431 unsigned int packet_number, status, packet_len;
432 432
433 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 433 DBG(3, "%s: %s\n", dev->name, __func__);
434 434
435 packet_number = SMC_GET_RXFIFO(lp); 435 packet_number = SMC_GET_RXFIFO(lp);
436 if (unlikely(packet_number & RXFIFO_REMPTY)) { 436 if (unlikely(packet_number & RXFIFO_REMPTY)) {
@@ -577,7 +577,7 @@ static void smc_hardware_send_pkt(unsigned long data)
577 unsigned int packet_no, len; 577 unsigned int packet_no, len;
578 unsigned char *buf; 578 unsigned char *buf;
579 579
580 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 580 DBG(3, "%s: %s\n", dev->name, __func__);
581 581
582 if (!smc_special_trylock(&lp->lock)) { 582 if (!smc_special_trylock(&lp->lock)) {
583 netif_stop_queue(dev); 583 netif_stop_queue(dev);
@@ -662,7 +662,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
662 void __iomem *ioaddr = lp->base; 662 void __iomem *ioaddr = lp->base;
663 unsigned int numPages, poll_count, status; 663 unsigned int numPages, poll_count, status;
664 664
665 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 665 DBG(3, "%s: %s\n", dev->name, __func__);
666 666
667 BUG_ON(lp->pending_tx_skb != NULL); 667 BUG_ON(lp->pending_tx_skb != NULL);
668 668
@@ -734,7 +734,7 @@ static void smc_tx(struct net_device *dev)
734 void __iomem *ioaddr = lp->base; 734 void __iomem *ioaddr = lp->base;
735 unsigned int saved_packet, packet_no, tx_status, pkt_len; 735 unsigned int saved_packet, packet_no, tx_status, pkt_len;
736 736
737 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 737 DBG(3, "%s: %s\n", dev->name, __func__);
738 738
739 /* If the TX FIFO is empty then nothing to do */ 739 /* If the TX FIFO is empty then nothing to do */
740 packet_no = SMC_GET_TXFIFO(lp); 740 packet_no = SMC_GET_TXFIFO(lp);
@@ -856,7 +856,7 @@ static int smc_phy_read(struct net_device *dev, int phyaddr, int phyreg)
856 SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); 856 SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO));
857 857
858 DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", 858 DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
859 __FUNCTION__, phyaddr, phyreg, phydata); 859 __func__, phyaddr, phyreg, phydata);
860 860
861 SMC_SELECT_BANK(lp, 2); 861 SMC_SELECT_BANK(lp, 2);
862 return phydata; 862 return phydata;
@@ -883,7 +883,7 @@ static void smc_phy_write(struct net_device *dev, int phyaddr, int phyreg,
883 SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO)); 883 SMC_SET_MII(lp, SMC_GET_MII(lp) & ~(MII_MCLK|MII_MDOE|MII_MDO));
884 884
885 DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n", 885 DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
886 __FUNCTION__, phyaddr, phyreg, phydata); 886 __func__, phyaddr, phyreg, phydata);
887 887
888 SMC_SELECT_BANK(lp, 2); 888 SMC_SELECT_BANK(lp, 2);
889} 889}
@@ -896,7 +896,7 @@ static void smc_phy_detect(struct net_device *dev)
896 struct smc_local *lp = netdev_priv(dev); 896 struct smc_local *lp = netdev_priv(dev);
897 int phyaddr; 897 int phyaddr;
898 898
899 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 899 DBG(2, "%s: %s\n", dev->name, __func__);
900 900
901 lp->phy_type = 0; 901 lp->phy_type = 0;
902 902
@@ -935,7 +935,7 @@ static int smc_phy_fixed(struct net_device *dev)
935 int phyaddr = lp->mii.phy_id; 935 int phyaddr = lp->mii.phy_id;
936 int bmcr, cfg1; 936 int bmcr, cfg1;
937 937
938 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 938 DBG(3, "%s: %s\n", dev->name, __func__);
939 939
940 /* Enter Link Disable state */ 940 /* Enter Link Disable state */
941 cfg1 = smc_phy_read(dev, phyaddr, PHY_CFG1_REG); 941 cfg1 = smc_phy_read(dev, phyaddr, PHY_CFG1_REG);
@@ -1168,7 +1168,7 @@ static void smc_phy_interrupt(struct net_device *dev)
1168 int phyaddr = lp->mii.phy_id; 1168 int phyaddr = lp->mii.phy_id;
1169 int phy18; 1169 int phy18;
1170 1170
1171 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1171 DBG(2, "%s: %s\n", dev->name, __func__);
1172 1172
1173 if (lp->phy_type == 0) 1173 if (lp->phy_type == 0)
1174 return; 1174 return;
@@ -1236,7 +1236,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1236 int status, mask, timeout, card_stats; 1236 int status, mask, timeout, card_stats;
1237 int saved_pointer; 1237 int saved_pointer;
1238 1238
1239 DBG(3, "%s: %s\n", dev->name, __FUNCTION__); 1239 DBG(3, "%s: %s\n", dev->name, __func__);
1240 1240
1241 spin_lock(&lp->lock); 1241 spin_lock(&lp->lock);
1242 1242
@@ -1358,7 +1358,7 @@ static void smc_timeout(struct net_device *dev)
1358 void __iomem *ioaddr = lp->base; 1358 void __iomem *ioaddr = lp->base;
1359 int status, mask, eph_st, meminfo, fifo; 1359 int status, mask, eph_st, meminfo, fifo;
1360 1360
1361 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1361 DBG(2, "%s: %s\n", dev->name, __func__);
1362 1362
1363 spin_lock_irq(&lp->lock); 1363 spin_lock_irq(&lp->lock);
1364 status = SMC_GET_INT(lp); 1364 status = SMC_GET_INT(lp);
@@ -1402,7 +1402,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1402 unsigned char multicast_table[8]; 1402 unsigned char multicast_table[8];
1403 int update_multicast = 0; 1403 int update_multicast = 0;
1404 1404
1405 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1405 DBG(2, "%s: %s\n", dev->name, __func__);
1406 1406
1407 if (dev->flags & IFF_PROMISC) { 1407 if (dev->flags & IFF_PROMISC) {
1408 DBG(2, "%s: RCR_PRMS\n", dev->name); 1408 DBG(2, "%s: RCR_PRMS\n", dev->name);
@@ -1505,7 +1505,7 @@ smc_open(struct net_device *dev)
1505{ 1505{
1506 struct smc_local *lp = netdev_priv(dev); 1506 struct smc_local *lp = netdev_priv(dev);
1507 1507
1508 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1508 DBG(2, "%s: %s\n", dev->name, __func__);
1509 1509
1510 /* 1510 /*
1511 * Check that the address is valid. If its not, refuse 1511 * Check that the address is valid. If its not, refuse
@@ -1513,14 +1513,16 @@ smc_open(struct net_device *dev)
1513 * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx 1513 * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
1514 */ 1514 */
1515 if (!is_valid_ether_addr(dev->dev_addr)) { 1515 if (!is_valid_ether_addr(dev->dev_addr)) {
1516 PRINTK("%s: no valid ethernet hw addr\n", __FUNCTION__); 1516 PRINTK("%s: no valid ethernet hw addr\n", __func__);
1517 return -EINVAL; 1517 return -EINVAL;
1518 } 1518 }
1519 1519
1520 /* Setup the default Register Modes */ 1520 /* Setup the default Register Modes */
1521 lp->tcr_cur_mode = TCR_DEFAULT; 1521 lp->tcr_cur_mode = TCR_DEFAULT;
1522 lp->rcr_cur_mode = RCR_DEFAULT; 1522 lp->rcr_cur_mode = RCR_DEFAULT;
1523 lp->rpc_cur_mode = RPC_DEFAULT; 1523 lp->rpc_cur_mode = RPC_DEFAULT |
1524 lp->cfg.leda << RPC_LSXA_SHFT |
1525 lp->cfg.ledb << RPC_LSXB_SHFT;
1524 1526
1525 /* 1527 /*
1526 * If we are not using a MII interface, we need to 1528 * If we are not using a MII interface, we need to
@@ -1557,7 +1559,7 @@ static int smc_close(struct net_device *dev)
1557{ 1559{
1558 struct smc_local *lp = netdev_priv(dev); 1560 struct smc_local *lp = netdev_priv(dev);
1559 1561
1560 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1562 DBG(2, "%s: %s\n", dev->name, __func__);
1561 1563
1562 netif_stop_queue(dev); 1564 netif_stop_queue(dev);
1563 netif_carrier_off(dev); 1565 netif_carrier_off(dev);
@@ -1700,7 +1702,7 @@ static int __init smc_findirq(struct smc_local *lp)
1700 int timeout = 20; 1702 int timeout = 20;
1701 unsigned long cookie; 1703 unsigned long cookie;
1702 1704
1703 DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__); 1705 DBG(2, "%s: %s\n", CARDNAME, __func__);
1704 1706
1705 cookie = probe_irq_on(); 1707 cookie = probe_irq_on();
1706 1708
@@ -1778,7 +1780,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1778 const char *version_string; 1780 const char *version_string;
1779 DECLARE_MAC_BUF(mac); 1781 DECLARE_MAC_BUF(mac);
1780 1782
1781 DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__); 1783 DBG(2, "%s: %s\n", CARDNAME, __func__);
1782 1784
1783 /* First, see if the high byte is 0x33 */ 1785 /* First, see if the high byte is 0x33 */
1784 val = SMC_CURRENT_BANK(lp); 1786 val = SMC_CURRENT_BANK(lp);
@@ -1961,7 +1963,8 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1961 if (dev->dma != (unsigned char)-1) 1963 if (dev->dma != (unsigned char)-1)
1962 printk(" DMA %d", dev->dma); 1964 printk(" DMA %d", dev->dma);
1963 1965
1964 printk("%s%s\n", nowait ? " [nowait]" : "", 1966 printk("%s%s\n",
1967 lp->cfg.flags & SMC91X_NOWAIT ? " [nowait]" : "",
1965 THROTTLE_TX_PKTS ? " [throttle_tx]" : ""); 1968 THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
1966 1969
1967 if (!is_valid_ether_addr(dev->dev_addr)) { 1970 if (!is_valid_ether_addr(dev->dev_addr)) {
@@ -2157,6 +2160,11 @@ static int smc_drv_probe(struct platform_device *pdev)
2157 lp->cfg.flags |= (nowait) ? SMC91X_NOWAIT : 0; 2160 lp->cfg.flags |= (nowait) ? SMC91X_NOWAIT : 0;
2158 } 2161 }
2159 2162
2163 if (!lp->cfg.leda && !lp->cfg.ledb) {
2164 lp->cfg.leda = RPC_LSA_DEFAULT;
2165 lp->cfg.ledb = RPC_LSB_DEFAULT;
2166 }
2167
2160 ndev->dma = (unsigned char)-1; 2168 ndev->dma = (unsigned char)-1;
2161 2169
2162 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs"); 2170 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");