aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skge.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-02-17 10:01:58 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 20:45:29 -0500
commit67777f9bf255d7561375500a4e117bdb08a883db (patch)
tree228b4e52b6e81e5a5ec8e98181983a36afbbca9c /drivers/net/skge.c
parentf15063cdd6bd541b4f35cec7e9a6c96f3c644c8d (diff)
drivers/net/skge.c: Use (pr|netdev)_<level> macro helpers
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove #define PFX Use pr_<level> Use netdev_<level> Checkpatch cleaning Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r--drivers/net/skge.c81
1 files changed, 42 insertions, 39 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8aa24c52f319..720af1c7854b 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -71,9 +71,9 @@ MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>");
71MODULE_LICENSE("GPL"); 71MODULE_LICENSE("GPL");
72MODULE_VERSION(DRV_VERSION); 72MODULE_VERSION(DRV_VERSION);
73 73
74static const u32 default_msg 74static const u32 default_msg = (NETIF_MSG_DRV | NETIF_MSG_PROBE |
75 = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK 75 NETIF_MSG_LINK | NETIF_MSG_IFUP |
76 | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; 76 NETIF_MSG_IFDOWN);
77 77
78static int debug = -1; /* defaults above */ 78static int debug = -1; /* defaults above */
79module_param(debug, int, 0); 79module_param(debug, int, 0);
@@ -188,8 +188,8 @@ static void skge_wol_init(struct skge_port *skge)
188 188
189 /* Force to 10/100 skge_reset will re-enable on resume */ 189 /* Force to 10/100 skge_reset will re-enable on resume */
190 gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, 190 gm_phy_write(hw, port, PHY_MARV_AUNE_ADV,
191 PHY_AN_100FULL | PHY_AN_100HALF | 191 (PHY_AN_100FULL | PHY_AN_100HALF |
192 PHY_AN_10FULL | PHY_AN_10HALF| PHY_AN_CSMA); 192 PHY_AN_10FULL | PHY_AN_10HALF | PHY_AN_CSMA));
193 /* no 1000 HD/FD */ 193 /* no 1000 HD/FD */
194 gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, 0); 194 gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, 0);
195 gm_phy_write(hw, port, PHY_MARV_CTRL, 195 gm_phy_write(hw, port, PHY_MARV_CTRL,
@@ -258,25 +258,28 @@ static u32 skge_supported_modes(const struct skge_hw *hw)
258 u32 supported; 258 u32 supported;
259 259
260 if (hw->copper) { 260 if (hw->copper) {
261 supported = SUPPORTED_10baseT_Half 261 supported = (SUPPORTED_10baseT_Half |
262 | SUPPORTED_10baseT_Full 262 SUPPORTED_10baseT_Full |
263 | SUPPORTED_100baseT_Half 263 SUPPORTED_100baseT_Half |
264 | SUPPORTED_100baseT_Full 264 SUPPORTED_100baseT_Full |
265 | SUPPORTED_1000baseT_Half 265 SUPPORTED_1000baseT_Half |
266 | SUPPORTED_1000baseT_Full 266 SUPPORTED_1000baseT_Full |
267 | SUPPORTED_Autoneg| SUPPORTED_TP; 267 SUPPORTED_Autoneg |
268 SUPPORTED_TP);
268 269
269 if (hw->chip_id == CHIP_ID_GENESIS) 270 if (hw->chip_id == CHIP_ID_GENESIS)
270 supported &= ~(SUPPORTED_10baseT_Half 271 supported &= ~(SUPPORTED_10baseT_Half |
271 | SUPPORTED_10baseT_Full 272 SUPPORTED_10baseT_Full |
272 | SUPPORTED_100baseT_Half 273 SUPPORTED_100baseT_Half |
273 | SUPPORTED_100baseT_Full); 274 SUPPORTED_100baseT_Full);
274 275
275 else if (hw->chip_id == CHIP_ID_YUKON) 276 else if (hw->chip_id == CHIP_ID_YUKON)
276 supported &= ~SUPPORTED_1000baseT_Half; 277 supported &= ~SUPPORTED_1000baseT_Half;
277 } else 278 } else
278 supported = SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half 279 supported = (SUPPORTED_1000baseT_Full |
279 | SUPPORTED_FIBRE | SUPPORTED_Autoneg; 280 SUPPORTED_1000baseT_Half |
281 SUPPORTED_FIBRE |
282 SUPPORTED_Autoneg);
280 283
281 return supported; 284 return supported;
282} 285}
@@ -366,7 +369,7 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
366 } 369 }
367 } 370 }
368 371
369 return (0); 372 return 0;
370} 373}
371 374
372static void skge_get_drvinfo(struct net_device *dev, 375static void skge_get_drvinfo(struct net_device *dev,
@@ -813,7 +816,7 @@ static int skge_get_eeprom_len(struct net_device *dev)
813 u32 reg2; 816 u32 reg2;
814 817
815 pci_read_config_dword(skge->hw->pdev, PCI_DEV_REG2, &reg2); 818 pci_read_config_dword(skge->hw->pdev, PCI_DEV_REG2, &reg2);
816 return 1 << ( ((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8); 819 return 1 << (((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8);
817} 820}
818 821
819static u32 skge_vpd_read(struct pci_dev *pdev, int cap, u16 offset) 822static u32 skge_vpd_read(struct pci_dev *pdev, int cap, u16 offset)
@@ -1044,7 +1047,7 @@ static int skge_rx_fill(struct net_device *dev)
1044 1047
1045 skb_reserve(skb, NET_IP_ALIGN); 1048 skb_reserve(skb, NET_IP_ALIGN);
1046 skge_rx_setup(skge, e, skb, skge->rx_buf_size); 1049 skge_rx_setup(skge, e, skb, skge->rx_buf_size);
1047 } while ( (e = e->next) != ring->start); 1050 } while ((e = e->next) != ring->start);
1048 1051
1049 ring->to_clean = ring->start; 1052 ring->to_clean = ring->start;
1050 return 0; 1053 return 0;
@@ -1052,7 +1055,7 @@ static int skge_rx_fill(struct net_device *dev)
1052 1055
1053static const char *skge_pause(enum pause_status status) 1056static const char *skge_pause(enum pause_status status)
1054{ 1057{
1055 switch(status) { 1058 switch (status) {
1056 case FLOW_STAT_NONE: 1059 case FLOW_STAT_NONE:
1057 return "none"; 1060 return "none";
1058 case FLOW_STAT_REM_SEND: 1061 case FLOW_STAT_REM_SEND:
@@ -1322,7 +1325,7 @@ static void bcom_phy_init(struct skge_port *skge)
1322 /* Optimize MDIO transfer by suppressing preamble. */ 1325 /* Optimize MDIO transfer by suppressing preamble. */
1323 r = xm_read16(hw, port, XM_MMU_CMD); 1326 r = xm_read16(hw, port, XM_MMU_CMD);
1324 r |= XM_MMU_NO_PRE; 1327 r |= XM_MMU_NO_PRE;
1325 xm_write16(hw, port, XM_MMU_CMD,r); 1328 xm_write16(hw, port, XM_MMU_CMD, r);
1326 1329
1327 switch (id1) { 1330 switch (id1) {
1328 case PHY_BCOM_ID1_C0: 1331 case PHY_BCOM_ID1_C0:
@@ -1512,7 +1515,7 @@ static void xm_link_timer(unsigned long arg)
1512{ 1515{
1513 struct skge_port *skge = (struct skge_port *) arg; 1516 struct skge_port *skge = (struct skge_port *) arg;
1514 struct net_device *dev = skge->netdev; 1517 struct net_device *dev = skge->netdev;
1515 struct skge_hw *hw = skge->hw; 1518 struct skge_hw *hw = skge->hw;
1516 int port = skge->port; 1519 int port = skge->port;
1517 int i; 1520 int i;
1518 unsigned long flags; 1521 unsigned long flags;
@@ -1531,7 +1534,7 @@ static void xm_link_timer(unsigned long arg)
1531 goto link_down; 1534 goto link_down;
1532 } 1535 }
1533 1536
1534 /* Re-enable interrupt to detect link down */ 1537 /* Re-enable interrupt to detect link down */
1535 if (xm_check_link(dev)) { 1538 if (xm_check_link(dev)) {
1536 u16 msk = xm_read16(hw, port, XM_IMSK); 1539 u16 msk = xm_read16(hw, port, XM_IMSK);
1537 msk &= ~XM_IS_INP_ASS; 1540 msk &= ~XM_IS_INP_ASS;
@@ -1588,7 +1591,7 @@ static void genesis_mac_init(struct skge_hw *hw, int port)
1588 } 1591 }
1589 1592
1590 1593
1591 switch(hw->phy_type) { 1594 switch (hw->phy_type) {
1592 case SK_PHY_XMAC: 1595 case SK_PHY_XMAC:
1593 xm_phy_init(skge); 1596 xm_phy_init(skge);
1594 break; 1597 break;
@@ -1695,7 +1698,7 @@ static void genesis_mac_init(struct skge_hw *hw, int port)
1695 1698
1696 if (jumbo) { 1699 if (jumbo) {
1697 /* Enable frame flushing if jumbo frames used */ 1700 /* Enable frame flushing if jumbo frames used */
1698 skge_write16(hw, SK_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); 1701 skge_write16(hw, SK_REG(port, RX_MFF_CTRL1), MFF_ENA_FLUSH);
1699 } else { 1702 } else {
1700 /* enable timeout timers if normal frames */ 1703 /* enable timeout timers if normal frames */
1701 skge_write16(hw, B3_PA_CTRL, 1704 skge_write16(hw, B3_PA_CTRL,
@@ -1710,7 +1713,7 @@ static void genesis_stop(struct skge_port *skge)
1710 unsigned retries = 1000; 1713 unsigned retries = 1000;
1711 u16 cmd; 1714 u16 cmd;
1712 1715
1713 /* Disable Tx and Rx */ 1716 /* Disable Tx and Rx */
1714 cmd = xm_read16(hw, port, XM_MMU_CMD); 1717 cmd = xm_read16(hw, port, XM_MMU_CMD);
1715 cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX); 1718 cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
1716 xm_write16(hw, port, XM_MMU_CMD, cmd); 1719 xm_write16(hw, port, XM_MMU_CMD, cmd);
@@ -1789,7 +1792,7 @@ static void genesis_mac_intr(struct skge_hw *hw, int port)
1789 "mac interrupt status 0x%x\n", status); 1792 "mac interrupt status 0x%x\n", status);
1790 1793
1791 if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) { 1794 if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) {
1792 xm_link_down(hw, port); 1795 xm_link_down(hw, port);
1793 mod_timer(&skge->link_timer, jiffies + 1); 1796 mod_timer(&skge->link_timer, jiffies + 1);
1794 } 1797 }
1795 1798
@@ -1823,7 +1826,7 @@ static void genesis_link_up(struct skge_port *skge)
1823 xm_write16(hw, port, XM_MMU_CMD, cmd); 1826 xm_write16(hw, port, XM_MMU_CMD, cmd);
1824 1827
1825 mode = xm_read32(hw, port, XM_MODE); 1828 mode = xm_read32(hw, port, XM_MODE);
1826 if (skge->flow_status== FLOW_STAT_SYMMETRIC || 1829 if (skge->flow_status == FLOW_STAT_SYMMETRIC ||
1827 skge->flow_status == FLOW_STAT_LOC_SEND) { 1830 skge->flow_status == FLOW_STAT_LOC_SEND) {
1828 /* 1831 /*
1829 * Configure Pause Frame Generation 1832 * Configure Pause Frame Generation
@@ -2466,7 +2469,7 @@ static int skge_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2466 if (!netif_running(dev)) 2469 if (!netif_running(dev))
2467 return -ENODEV; /* Phy still in reset */ 2470 return -ENODEV; /* Phy still in reset */
2468 2471
2469 switch(cmd) { 2472 switch (cmd) {
2470 case SIOCGMIIPHY: 2473 case SIOCGMIIPHY:
2471 data->phy_id = hw->phy_addr; 2474 data->phy_id = hw->phy_addr;
2472 2475
@@ -2765,7 +2768,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2765 * does. Looks like hardware is wrong? 2768 * does. Looks like hardware is wrong?
2766 */ 2769 */
2767 if (ipip_hdr(skb)->protocol == IPPROTO_UDP && 2770 if (ipip_hdr(skb)->protocol == IPPROTO_UDP &&
2768 hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) 2771 hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
2769 control = BMU_TCP_CHECK; 2772 control = BMU_TCP_CHECK;
2770 else 2773 else
2771 control = BMU_UDP_CHECK; 2774 control = BMU_UDP_CHECK;
@@ -2777,7 +2780,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2777 control = BMU_CHECK; 2780 control = BMU_CHECK;
2778 2781
2779 if (!skb_shinfo(skb)->nr_frags) /* single buffer i.e. no fragments */ 2782 if (!skb_shinfo(skb)->nr_frags) /* single buffer i.e. no fragments */
2780 control |= BMU_EOF| BMU_IRQ_EOF; 2783 control |= BMU_EOF | BMU_IRQ_EOF;
2781 else { 2784 else {
2782 struct skge_tx_desc *tf = td; 2785 struct skge_tx_desc *tf = td;
2783 2786
@@ -3077,7 +3080,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
3077 pci_unmap_len(e, maplen), 3080 pci_unmap_len(e, maplen),
3078 PCI_DMA_FROMDEVICE); 3081 PCI_DMA_FROMDEVICE);
3079 skb = e->skb; 3082 skb = e->skb;
3080 prefetch(skb->data); 3083 prefetch(skb->data);
3081 skge_rx_setup(skge, e, nskb, skge->rx_buf_size); 3084 skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
3082 } 3085 }
3083 3086
@@ -3554,8 +3557,7 @@ static int skge_reset(struct skge_hw *hw)
3554 hw->ram_offset = 0x80000; 3557 hw->ram_offset = 0x80000;
3555 } else 3558 } else
3556 hw->ram_size = t8 * 512; 3559 hw->ram_size = t8 * 512;
3557 } 3560 } else if (t8 == 0)
3558 else if (t8 == 0)
3559 hw->ram_size = 0x20000; 3561 hw->ram_size = 0x20000;
3560 else 3562 else
3561 hw->ram_size = t8 * 4096; 3563 hw->ram_size = t8 * 4096;
@@ -3709,7 +3711,7 @@ static int skge_device_event(struct notifier_block *unused,
3709 goto done; 3711 goto done;
3710 3712
3711 skge = netdev_priv(dev); 3713 skge = netdev_priv(dev);
3712 switch(event) { 3714 switch (event) {
3713 case NETDEV_CHANGENAME: 3715 case NETDEV_CHANGENAME:
3714 if (skge->debugfs) { 3716 if (skge->debugfs) {
3715 d = debugfs_rename(skge_debug, skge->debugfs, 3717 d = debugfs_rename(skge_debug, skge->debugfs,
@@ -3914,7 +3916,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3914 3916
3915 err = -ENOMEM; 3917 err = -ENOMEM;
3916 /* space for skge@pci:0000:04:00.0 */ 3918 /* space for skge@pci:0000:04:00.0 */
3917 hw = kzalloc(sizeof(*hw) + strlen(DRV_NAME "@pci:" ) 3919 hw = kzalloc(sizeof(*hw) + strlen(DRV_NAME "@pci:")
3918 + strlen(pci_name(pdev)) + 1, GFP_KERNEL); 3920 + strlen(pci_name(pdev)) + 1, GFP_KERNEL);
3919 if (!hw) { 3921 if (!hw) {
3920 dev_err(&pdev->dev, "cannot allocate hardware struct\n"); 3922 dev_err(&pdev->dev, "cannot allocate hardware struct\n");
@@ -4010,7 +4012,8 @@ static void __devexit skge_remove(struct pci_dev *pdev)
4010 4012
4011 flush_scheduled_work(); 4013 flush_scheduled_work();
4012 4014
4013 if ((dev1 = hw->dev[1])) 4015 dev1 = hw->dev[1];
4016 if (dev1)
4014 unregister_netdev(dev1); 4017 unregister_netdev(dev1);
4015 dev0 = hw->dev[0]; 4018 dev0 = hw->dev[0];
4016 unregister_netdev(dev0); 4019 unregister_netdev(dev0);