aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skge.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-06-27 14:33:02 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-27 18:05:05 -0400
commit955660652af35524974cf4623c02bc99a3785949 (patch)
tree1cc7d373fe1692be908d62b5145cb249c7c23499 /drivers/net/skge.c
parent020f46a39eb7b99a575b9f4d105fce2b142acdf1 (diff)
[PATCH] skge: whietspace cleanup
Cleanup whitespace around if() and switch() and end of lines Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r--drivers/net/skge.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 30e8d589d167..2d15ed358a0a 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -170,7 +170,7 @@ static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
170 struct skge_port *skge = netdev_priv(dev); 170 struct skge_port *skge = netdev_priv(dev);
171 struct skge_hw *hw = skge->hw; 171 struct skge_hw *hw = skge->hw;
172 172
173 if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) 173 if (wol->wolopts != WAKE_MAGIC && wol->wolopts != 0)
174 return -EOPNOTSUPP; 174 return -EOPNOTSUPP;
175 175
176 if (wol->wolopts == WAKE_MAGIC && !wol_supported(hw)) 176 if (wol->wolopts == WAKE_MAGIC && !wol_supported(hw))
@@ -247,7 +247,7 @@ static u32 skge_modes(const struct skge_hw *hw)
247 247
248 if (iscopper(hw)) { 248 if (iscopper(hw)) {
249 modes |= ADVERTISED_TP; 249 modes |= ADVERTISED_TP;
250 switch(hw->chip_id) { 250 switch (hw->chip_id) {
251 case CHIP_ID_GENESIS: 251 case CHIP_ID_GENESIS:
252 modes &= ~(ADVERTISED_100baseT_Full 252 modes &= ~(ADVERTISED_100baseT_Full
253 | ADVERTISED_100baseT_Half 253 | ADVERTISED_100baseT_Half
@@ -279,7 +279,7 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
279 if (ecmd->advertising & skge_modes(hw)) 279 if (ecmd->advertising & skge_modes(hw))
280 return -EINVAL; 280 return -EINVAL;
281 } else { 281 } else {
282 switch(ecmd->speed) { 282 switch (ecmd->speed) {
283 case SPEED_1000: 283 case SPEED_1000:
284 if (hw->chip_id == CHIP_ID_YUKON_FE) 284 if (hw->chip_id == CHIP_ID_YUKON_FE)
285 return -EINVAL; 285 return -EINVAL;
@@ -393,7 +393,7 @@ static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data)
393{ 393{
394 int i; 394 int i;
395 395
396 switch(stringset) { 396 switch (stringset) {
397 case ETH_SS_STATS: 397 case ETH_SS_STATS:
398 for (i = 0; i < ARRAY_SIZE(skge_stats); i++) 398 for (i = 0; i < ARRAY_SIZE(skge_stats); i++)
399 memcpy(data + i * ETH_GSTRING_LEN, 399 memcpy(data + i * ETH_GSTRING_LEN,
@@ -540,9 +540,9 @@ static int skge_set_pauseparam(struct net_device *dev,
540 skge->autoneg = ecmd->autoneg; 540 skge->autoneg = ecmd->autoneg;
541 if (ecmd->rx_pause && ecmd->tx_pause) 541 if (ecmd->rx_pause && ecmd->tx_pause)
542 skge->flow_control = FLOW_MODE_SYMMETRIC; 542 skge->flow_control = FLOW_MODE_SYMMETRIC;
543 else if(ecmd->rx_pause && !ecmd->tx_pause) 543 else if (ecmd->rx_pause && !ecmd->tx_pause)
544 skge->flow_control = FLOW_MODE_REM_SEND; 544 skge->flow_control = FLOW_MODE_REM_SEND;
545 else if(!ecmd->rx_pause && ecmd->tx_pause) 545 else if (!ecmd->rx_pause && ecmd->tx_pause)
546 skge->flow_control = FLOW_MODE_LOC_SEND; 546 skge->flow_control = FLOW_MODE_LOC_SEND;
547 else 547 else
548 skge->flow_control = FLOW_MODE_NONE; 548 skge->flow_control = FLOW_MODE_NONE;
@@ -730,7 +730,7 @@ static int skge_phys_id(struct net_device *dev, u32 data)
730{ 730{
731 struct skge_port *skge = netdev_priv(dev); 731 struct skge_port *skge = netdev_priv(dev);
732 732
733 if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) 733 if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
734 data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); 734 data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
735 735
736 /* start blinking */ 736 /* start blinking */
@@ -1960,7 +1960,7 @@ static u16 yukon_speed(const struct skge_hw *hw, u16 aux)
1960 if (hw->chip_id == CHIP_ID_YUKON_FE) 1960 if (hw->chip_id == CHIP_ID_YUKON_FE)
1961 return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; 1961 return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10;
1962 1962
1963 switch(aux & PHY_M_PS_SPEED_MSK) { 1963 switch (aux & PHY_M_PS_SPEED_MSK) {
1964 case PHY_M_PS_SPEED_1000: 1964 case PHY_M_PS_SPEED_1000:
1965 return SPEED_1000; 1965 return SPEED_1000;
1966 case PHY_M_PS_SPEED_100: 1966 case PHY_M_PS_SPEED_100:
@@ -2299,10 +2299,10 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
2299 2299
2300 local_irq_save(flags); 2300 local_irq_save(flags);
2301 if (!spin_trylock(&skge->tx_lock)) { 2301 if (!spin_trylock(&skge->tx_lock)) {
2302 /* Collision - tell upper layer to requeue */ 2302 /* Collision - tell upper layer to requeue */
2303 local_irq_restore(flags); 2303 local_irq_restore(flags);
2304 return NETDEV_TX_LOCKED; 2304 return NETDEV_TX_LOCKED;
2305 } 2305 }
2306 2306
2307 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { 2307 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
2308 netif_stop_queue(dev); 2308 netif_stop_queue(dev);
@@ -2439,7 +2439,7 @@ static int skge_change_mtu(struct net_device *dev, int new_mtu)
2439{ 2439{
2440 int err = 0; 2440 int err = 0;
2441 2441
2442 if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) 2442 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
2443 return -EINVAL; 2443 return -EINVAL;
2444 2444
2445 dev->mtu = new_mtu; 2445 dev->mtu = new_mtu;
@@ -2473,7 +2473,7 @@ static void genesis_set_multicast(struct net_device *dev)
2473 memset(filter, 0xff, sizeof(filter)); 2473 memset(filter, 0xff, sizeof(filter));
2474 else { 2474 else {
2475 memset(filter, 0, sizeof(filter)); 2475 memset(filter, 0, sizeof(filter));
2476 for(i = 0; list && i < count; i++, list = list->next) { 2476 for (i = 0; list && i < count; i++, list = list->next) {
2477 u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); 2477 u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN);
2478 u8 bit = 63 - (crc & 63); 2478 u8 bit = 63 - (crc & 63);
2479 2479
@@ -2510,7 +2510,7 @@ static void yukon_set_multicast(struct net_device *dev)
2510 int i; 2510 int i;
2511 reg |= GM_RXCR_MCF_ENA; 2511 reg |= GM_RXCR_MCF_ENA;
2512 2512
2513 for(i = 0; list && i < dev->mc_count; i++, list = list->next) { 2513 for (i = 0; list && i < dev->mc_count; i++, list = list->next) {
2514 u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; 2514 u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f;
2515 filter[bit/8] |= 1 << (bit%8); 2515 filter[bit/8] |= 1 << (bit%8);
2516 } 2516 }
@@ -2657,7 +2657,7 @@ static inline void skge_tx_intr(struct net_device *dev)
2657 struct skge_element *e; 2657 struct skge_element *e;
2658 2658
2659 spin_lock(&skge->tx_lock); 2659 spin_lock(&skge->tx_lock);
2660 for(e = ring->to_clean; e != ring->to_use; e = e->next) { 2660 for (e = ring->to_clean; e != ring->to_use; e = e->next) {
2661 struct skge_tx_desc *td = e->desc; 2661 struct skge_tx_desc *td = e->desc;
2662 u32 control; 2662 u32 control;
2663 2663
@@ -2712,7 +2712,7 @@ static void skge_pci_clear(struct skge_hw *hw)
2712 2712
2713static void skge_mac_intr(struct skge_hw *hw, int port) 2713static void skge_mac_intr(struct skge_hw *hw, int port)
2714{ 2714{
2715 if (hw->chip_id == CHIP_ID_GENESIS) 2715 if (hw->chip_id == CHIP_ID_GENESIS)
2716 genesis_mac_intr(hw, port); 2716 genesis_mac_intr(hw, port);
2717 else 2717 else
2718 yukon_mac_intr(hw, port); 2718 yukon_mac_intr(hw, port);
@@ -2847,7 +2847,7 @@ static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs)
2847 2847
2848 if (status & IS_MAC1) 2848 if (status & IS_MAC1)
2849 skge_mac_intr(hw, 0); 2849 skge_mac_intr(hw, 0);
2850 2850
2851 if (status & IS_MAC2) 2851 if (status & IS_MAC2)
2852 skge_mac_intr(hw, 1); 2852 skge_mac_intr(hw, 1);
2853 2853
@@ -2952,7 +2952,7 @@ static int skge_reset(struct skge_hw *hw)
2952 hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; 2952 hw->phy_type = skge_read8(hw, B2_E_1) & 0xf;
2953 hw->pmd_type = skge_read8(hw, B2_PMD_TYP); 2953 hw->pmd_type = skge_read8(hw, B2_PMD_TYP);
2954 2954
2955 switch(hw->chip_id) { 2955 switch (hw->chip_id) {
2956 case CHIP_ID_GENESIS: 2956 case CHIP_ID_GENESIS:
2957 switch (hw->phy_type) { 2957 switch (hw->phy_type) {
2958 case SK_PHY_XMAC: 2958 case SK_PHY_XMAC:
@@ -3288,7 +3288,7 @@ static void __devexit skge_remove(struct pci_dev *pdev)
3288 struct skge_hw *hw = pci_get_drvdata(pdev); 3288 struct skge_hw *hw = pci_get_drvdata(pdev);
3289 struct net_device *dev0, *dev1; 3289 struct net_device *dev0, *dev1;
3290 3290
3291 if(!hw) 3291 if (!hw)
3292 return; 3292 return;
3293 3293
3294 if ((dev1 = hw->dev[1])) 3294 if ((dev1 = hw->dev[1]))
@@ -3316,7 +3316,7 @@ static int skge_suspend(struct pci_dev *pdev, u32 state)
3316 struct skge_hw *hw = pci_get_drvdata(pdev); 3316 struct skge_hw *hw = pci_get_drvdata(pdev);
3317 int i, wol = 0; 3317 int i, wol = 0;
3318 3318
3319 for(i = 0; i < 2; i++) { 3319 for (i = 0; i < 2; i++) {
3320 struct net_device *dev = hw->dev[i]; 3320 struct net_device *dev = hw->dev[i];
3321 3321
3322 if (dev) { 3322 if (dev) {
@@ -3349,11 +3349,11 @@ static int skge_resume(struct pci_dev *pdev)
3349 3349
3350 skge_reset(hw); 3350 skge_reset(hw);
3351 3351
3352 for(i = 0; i < 2; i++) { 3352 for (i = 0; i < 2; i++) {
3353 struct net_device *dev = hw->dev[i]; 3353 struct net_device *dev = hw->dev[i];
3354 if (dev) { 3354 if (dev) {
3355 netif_device_attach(dev); 3355 netif_device_attach(dev);
3356 if(netif_running(dev)) 3356 if (netif_running(dev))
3357 skge_up(dev); 3357 skge_up(dev);
3358 } 3358 }
3359 } 3359 }