diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-09-23 01:40:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-26 21:34:29 -0400 |
commit | 807540baae406c84dcb9c1c8ef07a56d2d2ae84a (patch) | |
tree | ccd5c2cb57710dd6b73cf8df11eedf67abc14ae4 /drivers | |
parent | cb4dfe562cac6fcb544df752e40c1d78000d0712 (diff) |
drivers/net: return operator cleanup
Change "return (EXPR);" to "return EXPR;"
return is not a function, parentheses are not required.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
106 files changed, 762 insertions, 764 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index a7b0e5e43a52..ca00f0a11217 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -463,7 +463,7 @@ static int __init do_elmc_probe(struct net_device *dev) | |||
463 | 463 | ||
464 | /* we didn't find any 3c523 in the slots we checked for */ | 464 | /* we didn't find any 3c523 in the slots we checked for */ |
465 | if (slot == MCA_NOTFOUND) | 465 | if (slot == MCA_NOTFOUND) |
466 | return ((base_addr || irq) ? -ENXIO : -ENODEV); | 466 | return (base_addr || irq) ? -ENXIO : -ENODEV; |
467 | 467 | ||
468 | mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC"); | 468 | mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC"); |
469 | mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev); | 469 | mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev); |
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index 0362c8d31a08..10d0dba572c2 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c | |||
@@ -244,7 +244,7 @@ static int ipddp_delete(struct ipddp_route *rt) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | spin_unlock_bh(&ipddp_route_lock); | 246 | spin_unlock_bh(&ipddp_route_lock); |
247 | return (-ENOENT); | 247 | return -ENOENT; |
248 | } | 248 | } |
249 | 249 | ||
250 | /* | 250 | /* |
@@ -259,10 +259,10 @@ static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt) | |||
259 | if(f->ip == rt->ip && | 259 | if(f->ip == rt->ip && |
260 | f->at.s_net == rt->at.s_net && | 260 | f->at.s_net == rt->at.s_net && |
261 | f->at.s_node == rt->at.s_node) | 261 | f->at.s_node == rt->at.s_node) |
262 | return (f); | 262 | return f; |
263 | } | 263 | } |
264 | 264 | ||
265 | return (NULL); | 265 | return NULL; |
266 | } | 266 | } |
267 | 267 | ||
268 | static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 268 | static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
@@ -279,7 +279,7 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
279 | switch(cmd) | 279 | switch(cmd) |
280 | { | 280 | { |
281 | case SIOCADDIPDDPRT: | 281 | case SIOCADDIPDDPRT: |
282 | return (ipddp_create(&rcp)); | 282 | return ipddp_create(&rcp); |
283 | 283 | ||
284 | case SIOCFINDIPDDPRT: | 284 | case SIOCFINDIPDDPRT: |
285 | spin_lock_bh(&ipddp_route_lock); | 285 | spin_lock_bh(&ipddp_route_lock); |
@@ -297,7 +297,7 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
297 | return -ENOENT; | 297 | return -ENOENT; |
298 | 298 | ||
299 | case SIOCDELIPDDPRT: | 299 | case SIOCDELIPDDPRT: |
300 | return (ipddp_delete(&rcp)); | 300 | return ipddp_delete(&rcp); |
301 | 301 | ||
302 | default: | 302 | default: |
303 | return -EINVAL; | 303 | return -EINVAL; |
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index adc07551739e..e69eead12ec7 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c | |||
@@ -727,7 +727,7 @@ static int sendup_buffer (struct net_device *dev) | |||
727 | 727 | ||
728 | if (ltc->command != LT_RCVLAP) { | 728 | if (ltc->command != LT_RCVLAP) { |
729 | printk("unknown command 0x%02x from ltpc card\n",ltc->command); | 729 | printk("unknown command 0x%02x from ltpc card\n",ltc->command); |
730 | return(-1); | 730 | return -1; |
731 | } | 731 | } |
732 | dnode = ltc->dnode; | 732 | dnode = ltc->dnode; |
733 | snode = ltc->snode; | 733 | snode = ltc->snode; |
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c index b57d7dee389a..3134e5326231 100644 --- a/drivers/net/atarilance.c +++ b/drivers/net/atarilance.c | |||
@@ -362,7 +362,7 @@ static void *slow_memcpy( void *dst, const void *src, size_t len ) | |||
362 | *cto++ = *cfrom++; | 362 | *cto++ = *cfrom++; |
363 | MFPDELAY(); | 363 | MFPDELAY(); |
364 | } | 364 | } |
365 | return( dst ); | 365 | return dst; |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
@@ -449,7 +449,7 @@ static noinline int __init addr_accessible(volatile void *regp, int wordflag, | |||
449 | vbr[2] = save_berr; | 449 | vbr[2] = save_berr; |
450 | local_irq_restore(flags); | 450 | local_irq_restore(flags); |
451 | 451 | ||
452 | return( ret ); | 452 | return ret; |
453 | } | 453 | } |
454 | 454 | ||
455 | static const struct net_device_ops lance_netdev_ops = { | 455 | static const struct net_device_ops lance_netdev_ops = { |
@@ -526,7 +526,7 @@ static unsigned long __init lance_probe1( struct net_device *dev, | |||
526 | goto probe_ok; | 526 | goto probe_ok; |
527 | 527 | ||
528 | probe_fail: | 528 | probe_fail: |
529 | return( 0 ); | 529 | return 0; |
530 | 530 | ||
531 | probe_ok: | 531 | probe_ok: |
532 | lp = netdev_priv(dev); | 532 | lp = netdev_priv(dev); |
@@ -556,7 +556,7 @@ static unsigned long __init lance_probe1( struct net_device *dev, | |||
556 | if (request_irq(IRQ_AUTO_5, lance_interrupt, IRQ_TYPE_PRIO, | 556 | if (request_irq(IRQ_AUTO_5, lance_interrupt, IRQ_TYPE_PRIO, |
557 | "PAM/Riebl-ST Ethernet", dev)) { | 557 | "PAM/Riebl-ST Ethernet", dev)) { |
558 | printk( "Lance: request for irq %d failed\n", IRQ_AUTO_5 ); | 558 | printk( "Lance: request for irq %d failed\n", IRQ_AUTO_5 ); |
559 | return( 0 ); | 559 | return 0; |
560 | } | 560 | } |
561 | dev->irq = (unsigned short)IRQ_AUTO_5; | 561 | dev->irq = (unsigned short)IRQ_AUTO_5; |
562 | } | 562 | } |
@@ -568,12 +568,12 @@ static unsigned long __init lance_probe1( struct net_device *dev, | |||
568 | unsigned long irq = atari_register_vme_int(); | 568 | unsigned long irq = atari_register_vme_int(); |
569 | if (!irq) { | 569 | if (!irq) { |
570 | printk( "Lance: request for VME interrupt failed\n" ); | 570 | printk( "Lance: request for VME interrupt failed\n" ); |
571 | return( 0 ); | 571 | return 0; |
572 | } | 572 | } |
573 | if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO, | 573 | if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO, |
574 | "Riebl-VME Ethernet", dev)) { | 574 | "Riebl-VME Ethernet", dev)) { |
575 | printk( "Lance: request for irq %ld failed\n", irq ); | 575 | printk( "Lance: request for irq %ld failed\n", irq ); |
576 | return( 0 ); | 576 | return 0; |
577 | } | 577 | } |
578 | dev->irq = irq; | 578 | dev->irq = irq; |
579 | } | 579 | } |
@@ -637,7 +637,7 @@ static unsigned long __init lance_probe1( struct net_device *dev, | |||
637 | /* XXX MSch */ | 637 | /* XXX MSch */ |
638 | dev->watchdog_timeo = TX_TIMEOUT; | 638 | dev->watchdog_timeo = TX_TIMEOUT; |
639 | 639 | ||
640 | return( 1 ); | 640 | return 1; |
641 | } | 641 | } |
642 | 642 | ||
643 | 643 | ||
@@ -666,7 +666,7 @@ static int lance_open( struct net_device *dev ) | |||
666 | DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n", | 666 | DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n", |
667 | dev->name, i, DREG )); | 667 | dev->name, i, DREG )); |
668 | DREG = CSR0_STOP; | 668 | DREG = CSR0_STOP; |
669 | return( -EIO ); | 669 | return -EIO; |
670 | } | 670 | } |
671 | DREG = CSR0_IDON; | 671 | DREG = CSR0_IDON; |
672 | DREG = CSR0_STRT; | 672 | DREG = CSR0_STRT; |
@@ -676,7 +676,7 @@ static int lance_open( struct net_device *dev ) | |||
676 | 676 | ||
677 | DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG )); | 677 | DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG )); |
678 | 678 | ||
679 | return( 0 ); | 679 | return 0; |
680 | } | 680 | } |
681 | 681 | ||
682 | 682 | ||
@@ -1126,13 +1126,13 @@ static int lance_set_mac_address( struct net_device *dev, void *addr ) | |||
1126 | int i; | 1126 | int i; |
1127 | 1127 | ||
1128 | if (lp->cardtype != OLD_RIEBL && lp->cardtype != NEW_RIEBL) | 1128 | if (lp->cardtype != OLD_RIEBL && lp->cardtype != NEW_RIEBL) |
1129 | return( -EOPNOTSUPP ); | 1129 | return -EOPNOTSUPP; |
1130 | 1130 | ||
1131 | if (netif_running(dev)) { | 1131 | if (netif_running(dev)) { |
1132 | /* Only possible while card isn't started */ | 1132 | /* Only possible while card isn't started */ |
1133 | DPRINTK( 1, ( "%s: hwaddr can be set only while card isn't open.\n", | 1133 | DPRINTK( 1, ( "%s: hwaddr can be set only while card isn't open.\n", |
1134 | dev->name )); | 1134 | dev->name )); |
1135 | return( -EIO ); | 1135 | return -EIO; |
1136 | } | 1136 | } |
1137 | 1137 | ||
1138 | memcpy( dev->dev_addr, saddr->sa_data, dev->addr_len ); | 1138 | memcpy( dev->dev_addr, saddr->sa_data, dev->addr_len ); |
@@ -1142,7 +1142,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr ) | |||
1142 | /* set also the magic for future sessions */ | 1142 | /* set also the magic for future sessions */ |
1143 | *RIEBL_MAGIC_ADDR = RIEBL_MAGIC; | 1143 | *RIEBL_MAGIC_ADDR = RIEBL_MAGIC; |
1144 | 1144 | ||
1145 | return( 0 ); | 1145 | return 0; |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | 1148 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index e1e0171d6e62..4ba6431deeef 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2094,9 +2094,9 @@ static u16 atl1_tpd_avail(struct atl1_tpd_ring *tpd_ring) | |||
2094 | { | 2094 | { |
2095 | u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean); | 2095 | u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean); |
2096 | u16 next_to_use = atomic_read(&tpd_ring->next_to_use); | 2096 | u16 next_to_use = atomic_read(&tpd_ring->next_to_use); |
2097 | return ((next_to_clean > next_to_use) ? | 2097 | return (next_to_clean > next_to_use) ? |
2098 | next_to_clean - next_to_use - 1 : | 2098 | next_to_clean - next_to_use - 1 : |
2099 | tpd_ring->count + next_to_clean - next_to_use - 1); | 2099 | tpd_ring->count + next_to_clean - next_to_use - 1; |
2100 | } | 2100 | } |
2101 | 2101 | ||
2102 | static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb, | 2102 | static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb, |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 34abcc9403d6..0db28b411e87 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -98,9 +98,9 @@ static void be_async_link_state_process(struct be_adapter *adapter, | |||
98 | 98 | ||
99 | static inline bool is_link_state_evt(u32 trailer) | 99 | static inline bool is_link_state_evt(u32 trailer) |
100 | { | 100 | { |
101 | return (((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) & | 101 | return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) & |
102 | ASYNC_TRAILER_EVENT_CODE_MASK) == | 102 | ASYNC_TRAILER_EVENT_CODE_MASK) == |
103 | ASYNC_EVENT_CODE_LINK_STATE); | 103 | ASYNC_EVENT_CODE_LINK_STATE; |
104 | } | 104 | } |
105 | 105 | ||
106 | static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter) | 106 | static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter) |
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 9322699bb31c..a1b8c8b8010b 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -1581,7 +1581,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length) | |||
1581 | int i; | 1581 | int i; |
1582 | 1582 | ||
1583 | if (bmac_devs == NULL) | 1583 | if (bmac_devs == NULL) |
1584 | return (-ENOSYS); | 1584 | return -ENOSYS; |
1585 | 1585 | ||
1586 | len += sprintf(buffer, "BMAC counters & registers\n"); | 1586 | len += sprintf(buffer, "BMAC counters & registers\n"); |
1587 | 1587 | ||
diff --git a/drivers/net/bna/bna_ctrl.c b/drivers/net/bna/bna_ctrl.c index f3034d6bda58..ddd922f210c7 100644 --- a/drivers/net/bna/bna_ctrl.c +++ b/drivers/net/bna/bna_ctrl.c | |||
@@ -25,8 +25,8 @@ | |||
25 | static int | 25 | static int |
26 | bna_is_aen(u8 msg_id) | 26 | bna_is_aen(u8 msg_id) |
27 | { | 27 | { |
28 | return (msg_id == BFI_LL_I2H_LINK_DOWN_AEN || | 28 | return msg_id == BFI_LL_I2H_LINK_DOWN_AEN || |
29 | msg_id == BFI_LL_I2H_LINK_UP_AEN); | 29 | msg_id == BFI_LL_I2H_LINK_UP_AEN; |
30 | } | 30 | } |
31 | 31 | ||
32 | static void | 32 | static void |
@@ -1702,7 +1702,7 @@ bna_device_cb_port_stopped(void *arg, enum bna_cb_status status) | |||
1702 | int | 1702 | int |
1703 | bna_device_status_get(struct bna_device *device) | 1703 | bna_device_status_get(struct bna_device *device) |
1704 | { | 1704 | { |
1705 | return (device->fsm == (bfa_fsm_t)bna_device_sm_ready); | 1705 | return device->fsm == (bfa_fsm_t)bna_device_sm_ready; |
1706 | } | 1706 | } |
1707 | 1707 | ||
1708 | void | 1708 | void |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 4ff76e38e788..3d1a5da98622 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -266,7 +266,7 @@ static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr) | |||
266 | if (diff == TX_DESC_CNT) | 266 | if (diff == TX_DESC_CNT) |
267 | diff = MAX_TX_DESC_CNT; | 267 | diff = MAX_TX_DESC_CNT; |
268 | } | 268 | } |
269 | return (bp->tx_ring_size - diff); | 269 | return bp->tx_ring_size - diff; |
270 | } | 270 | } |
271 | 271 | ||
272 | static u32 | 272 | static u32 |
@@ -299,7 +299,7 @@ bnx2_shmem_wr(struct bnx2 *bp, u32 offset, u32 val) | |||
299 | static u32 | 299 | static u32 |
300 | bnx2_shmem_rd(struct bnx2 *bp, u32 offset) | 300 | bnx2_shmem_rd(struct bnx2 *bp, u32 offset) |
301 | { | 301 | { |
302 | return (bnx2_reg_rd_ind(bp, bp->shmem_base + offset)); | 302 | return bnx2_reg_rd_ind(bp, bp->shmem_base + offset); |
303 | } | 303 | } |
304 | 304 | ||
305 | static void | 305 | static void |
@@ -977,9 +977,9 @@ bnx2_report_fw_link(struct bnx2 *bp) | |||
977 | static char * | 977 | static char * |
978 | bnx2_xceiver_str(struct bnx2 *bp) | 978 | bnx2_xceiver_str(struct bnx2 *bp) |
979 | { | 979 | { |
980 | return ((bp->phy_port == PORT_FIBRE) ? "SerDes" : | 980 | return (bp->phy_port == PORT_FIBRE) ? "SerDes" : |
981 | ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) ? "Remote Copper" : | 981 | ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) ? "Remote Copper" : |
982 | "Copper")); | 982 | "Copper"); |
983 | } | 983 | } |
984 | 984 | ||
985 | static void | 985 | static void |
@@ -1758,7 +1758,7 @@ __acquires(&bp->phy_lock) | |||
1758 | u32 new_adv = 0; | 1758 | u32 new_adv = 0; |
1759 | 1759 | ||
1760 | if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP) | 1760 | if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP) |
1761 | return (bnx2_setup_remote_phy(bp, port)); | 1761 | return bnx2_setup_remote_phy(bp, port); |
1762 | 1762 | ||
1763 | if (!(bp->autoneg & AUTONEG_SPEED)) { | 1763 | if (!(bp->autoneg & AUTONEG_SPEED)) { |
1764 | u32 new_bmcr; | 1764 | u32 new_bmcr; |
@@ -2171,10 +2171,10 @@ __acquires(&bp->phy_lock) | |||
2171 | return 0; | 2171 | return 0; |
2172 | 2172 | ||
2173 | if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) { | 2173 | if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) { |
2174 | return (bnx2_setup_serdes_phy(bp, port)); | 2174 | return bnx2_setup_serdes_phy(bp, port); |
2175 | } | 2175 | } |
2176 | else { | 2176 | else { |
2177 | return (bnx2_setup_copper_phy(bp)); | 2177 | return bnx2_setup_copper_phy(bp); |
2178 | } | 2178 | } |
2179 | } | 2179 | } |
2180 | 2180 | ||
@@ -7582,9 +7582,9 @@ bnx2_set_tx_csum(struct net_device *dev, u32 data) | |||
7582 | struct bnx2 *bp = netdev_priv(dev); | 7582 | struct bnx2 *bp = netdev_priv(dev); |
7583 | 7583 | ||
7584 | if (CHIP_NUM(bp) == CHIP_NUM_5709) | 7584 | if (CHIP_NUM(bp) == CHIP_NUM_5709) |
7585 | return (ethtool_op_set_tx_ipv6_csum(dev, data)); | 7585 | return ethtool_op_set_tx_ipv6_csum(dev, data); |
7586 | else | 7586 | else |
7587 | return (ethtool_op_set_tx_csum(dev, data)); | 7587 | return ethtool_op_set_tx_csum(dev, data); |
7588 | } | 7588 | } |
7589 | 7589 | ||
7590 | static int | 7590 | static int |
@@ -7705,7 +7705,7 @@ bnx2_change_mtu(struct net_device *dev, int new_mtu) | |||
7705 | return -EINVAL; | 7705 | return -EINVAL; |
7706 | 7706 | ||
7707 | dev->mtu = new_mtu; | 7707 | dev->mtu = new_mtu; |
7708 | return (bnx2_change_ring_size(bp, bp->rx_ring_size, bp->tx_ring_size)); | 7708 | return bnx2_change_ring_size(bp, bp->rx_ring_size, bp->tx_ring_size); |
7709 | } | 7709 | } |
7710 | 7710 | ||
7711 | #ifdef CONFIG_NET_POLL_CONTROLLER | 7711 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h index d1e6a8c977d1..1ad08e4e88f4 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.h +++ b/drivers/net/bnx2x/bnx2x_cmn.h | |||
@@ -399,7 +399,7 @@ static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp) | |||
399 | { | 399 | { |
400 | /* Tell compiler that consumer and producer can change */ | 400 | /* Tell compiler that consumer and producer can change */ |
401 | barrier(); | 401 | barrier(); |
402 | return (fp->tx_pkt_prod != fp->tx_pkt_cons); | 402 | return fp->tx_pkt_prod != fp->tx_pkt_cons; |
403 | } | 403 | } |
404 | 404 | ||
405 | static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp) | 405 | static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp) |
@@ -632,7 +632,7 @@ static inline int bnx2x_has_rx_work(struct bnx2x_fastpath *fp) | |||
632 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | 632 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); |
633 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | 633 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) |
634 | rx_cons_sb++; | 634 | rx_cons_sb++; |
635 | return (fp->rx_comp_cons != rx_cons_sb); | 635 | return fp->rx_comp_cons != rx_cons_sb; |
636 | } | 636 | } |
637 | 637 | ||
638 | /* HW Lock for shared dual port PHYs */ | 638 | /* HW Lock for shared dual port PHYs */ |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 822f586d72af..2a47c1deb9f0 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -252,7 +252,7 @@ static inline void __enable_port(struct port *port) | |||
252 | */ | 252 | */ |
253 | static inline int __port_is_enabled(struct port *port) | 253 | static inline int __port_is_enabled(struct port *port) |
254 | { | 254 | { |
255 | return(port->slave->state == BOND_STATE_ACTIVE); | 255 | return port->slave->state == BOND_STATE_ACTIVE; |
256 | } | 256 | } |
257 | 257 | ||
258 | /** | 258 | /** |
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c index 88edb986691a..6e99d80ec409 100644 --- a/drivers/net/bsd_comp.c +++ b/drivers/net/bsd_comp.c | |||
@@ -429,7 +429,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) | |||
429 | if (!db->lens) | 429 | if (!db->lens) |
430 | { | 430 | { |
431 | bsd_free (db); | 431 | bsd_free (db); |
432 | return (NULL); | 432 | return NULL; |
433 | } | 433 | } |
434 | } | 434 | } |
435 | /* | 435 | /* |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 32aaadc4734f..d6b6d6aa565a 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -419,7 +419,7 @@ static u16 cas_phy_read(struct cas *cp, int reg) | |||
419 | udelay(10); | 419 | udelay(10); |
420 | cmd = readl(cp->regs + REG_MIF_FRAME); | 420 | cmd = readl(cp->regs + REG_MIF_FRAME); |
421 | if (cmd & MIF_FRAME_TURN_AROUND_LSB) | 421 | if (cmd & MIF_FRAME_TURN_AROUND_LSB) |
422 | return (cmd & MIF_FRAME_DATA_MASK); | 422 | return cmd & MIF_FRAME_DATA_MASK; |
423 | } | 423 | } |
424 | return 0xFFFF; /* -1 */ | 424 | return 0xFFFF; /* -1 */ |
425 | } | 425 | } |
@@ -804,7 +804,7 @@ static int cas_reset_mii_phy(struct cas *cp) | |||
804 | break; | 804 | break; |
805 | udelay(10); | 805 | udelay(10); |
806 | } | 806 | } |
807 | return (limit <= 0); | 807 | return limit <= 0; |
808 | } | 808 | } |
809 | 809 | ||
810 | static int cas_saturn_firmware_init(struct cas *cp) | 810 | static int cas_saturn_firmware_init(struct cas *cp) |
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 1950b9a20ecd..340b537dc97e 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1551,7 +1551,7 @@ static inline int responses_pending(const struct adapter *adapter) | |||
1551 | const struct respQ *Q = &adapter->sge->respQ; | 1551 | const struct respQ *Q = &adapter->sge->respQ; |
1552 | const struct respQ_e *e = &Q->entries[Q->cidx]; | 1552 | const struct respQ_e *e = &Q->entries[Q->cidx]; |
1553 | 1553 | ||
1554 | return (e->GenerationBit == Q->genbit); | 1554 | return e->GenerationBit == Q->genbit; |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | /* | 1557 | /* |
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c index c844111cffeb..106a590f0d9a 100644 --- a/drivers/net/chelsio/vsc7326.c +++ b/drivers/net/chelsio/vsc7326.c | |||
@@ -255,7 +255,7 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address) | |||
255 | else if ((result & (1 << 8)) != 0x0) | 255 | else if ((result & (1 << 8)) != 0x0) |
256 | pr_err("bist read error: 0x%x\n", result); | 256 | pr_err("bist read error: 0x%x\n", result); |
257 | 257 | ||
258 | return (result & 0xff); | 258 | return result & 0xff; |
259 | } | 259 | } |
260 | 260 | ||
261 | static int bist_wr(adapter_t *adapter, int moduleid, int address, int value) | 261 | static int bist_wr(adapter_t *adapter, int moduleid, int address, int value) |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index c6485b39eb0e..21db7491f613 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -64,7 +64,7 @@ static inline int offload_activated(struct t3cdev *tdev) | |||
64 | { | 64 | { |
65 | const struct adapter *adapter = tdev2adap(tdev); | 65 | const struct adapter *adapter = tdev2adap(tdev); |
66 | 66 | ||
67 | return (test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)); | 67 | return test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map); |
68 | } | 68 | } |
69 | 69 | ||
70 | /** | 70 | /** |
diff --git a/drivers/net/de620.c b/drivers/net/de620.c index f3650fd096f4..1c51a7576119 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c | |||
@@ -676,7 +676,7 @@ static int de620_rx_intr(struct net_device *dev) | |||
676 | de620_set_register(dev, W_NPRF, next_rx_page); | 676 | de620_set_register(dev, W_NPRF, next_rx_page); |
677 | pr_debug("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page); | 677 | pr_debug("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page); |
678 | 678 | ||
679 | return (next_rx_page != curr_page); /* That was slightly tricky... */ | 679 | return next_rx_page != curr_page; /* That was slightly tricky... */ |
680 | } | 680 | } |
681 | 681 | ||
682 | /********************************************* | 682 | /********************************************* |
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index e5667c55844e..417e14385623 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c | |||
@@ -1024,7 +1024,7 @@ static int __devinit dfx_driver_init(struct net_device *dev, | |||
1024 | &data) != DFX_K_SUCCESS) { | 1024 | &data) != DFX_K_SUCCESS) { |
1025 | printk("%s: Could not read adapter factory MAC address!\n", | 1025 | printk("%s: Could not read adapter factory MAC address!\n", |
1026 | print_name); | 1026 | print_name); |
1027 | return(DFX_K_FAILURE); | 1027 | return DFX_K_FAILURE; |
1028 | } | 1028 | } |
1029 | le32 = cpu_to_le32(data); | 1029 | le32 = cpu_to_le32(data); |
1030 | memcpy(&bp->factory_mac_addr[0], &le32, sizeof(u32)); | 1030 | memcpy(&bp->factory_mac_addr[0], &le32, sizeof(u32)); |
@@ -1033,7 +1033,7 @@ static int __devinit dfx_driver_init(struct net_device *dev, | |||
1033 | &data) != DFX_K_SUCCESS) { | 1033 | &data) != DFX_K_SUCCESS) { |
1034 | printk("%s: Could not read adapter factory MAC address!\n", | 1034 | printk("%s: Could not read adapter factory MAC address!\n", |
1035 | print_name); | 1035 | print_name); |
1036 | return(DFX_K_FAILURE); | 1036 | return DFX_K_FAILURE; |
1037 | } | 1037 | } |
1038 | le32 = cpu_to_le32(data); | 1038 | le32 = cpu_to_le32(data); |
1039 | memcpy(&bp->factory_mac_addr[4], &le32, sizeof(u16)); | 1039 | memcpy(&bp->factory_mac_addr[4], &le32, sizeof(u16)); |
@@ -1075,7 +1075,7 @@ static int __devinit dfx_driver_init(struct net_device *dev, | |||
1075 | if (top_v == NULL) { | 1075 | if (top_v == NULL) { |
1076 | printk("%s: Could not allocate memory for host buffers " | 1076 | printk("%s: Could not allocate memory for host buffers " |
1077 | "and structures!\n", print_name); | 1077 | "and structures!\n", print_name); |
1078 | return(DFX_K_FAILURE); | 1078 | return DFX_K_FAILURE; |
1079 | } | 1079 | } |
1080 | memset(top_v, 0, alloc_size); /* zero out memory before continuing */ | 1080 | memset(top_v, 0, alloc_size); /* zero out memory before continuing */ |
1081 | top_p = bp->kmalloced_dma; /* get physical address of buffer */ | 1081 | top_p = bp->kmalloced_dma; /* get physical address of buffer */ |
@@ -1145,7 +1145,7 @@ static int __devinit dfx_driver_init(struct net_device *dev, | |||
1145 | DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", | 1145 | DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", |
1146 | print_name, (long)bp->cons_block_virt, bp->cons_block_phys); | 1146 | print_name, (long)bp->cons_block_virt, bp->cons_block_phys); |
1147 | 1147 | ||
1148 | return(DFX_K_SUCCESS); | 1148 | return DFX_K_SUCCESS; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | 1151 | ||
@@ -1195,7 +1195,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1195 | if (dfx_hw_dma_uninit(bp, bp->reset_type) != DFX_K_SUCCESS) | 1195 | if (dfx_hw_dma_uninit(bp, bp->reset_type) != DFX_K_SUCCESS) |
1196 | { | 1196 | { |
1197 | printk("%s: Could not uninitialize/reset adapter!\n", bp->dev->name); | 1197 | printk("%s: Could not uninitialize/reset adapter!\n", bp->dev->name); |
1198 | return(DFX_K_FAILURE); | 1198 | return DFX_K_FAILURE; |
1199 | } | 1199 | } |
1200 | 1200 | ||
1201 | /* | 1201 | /* |
@@ -1229,7 +1229,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1229 | NULL) != DFX_K_SUCCESS) | 1229 | NULL) != DFX_K_SUCCESS) |
1230 | { | 1230 | { |
1231 | printk("%s: Could not set adapter burst size!\n", bp->dev->name); | 1231 | printk("%s: Could not set adapter burst size!\n", bp->dev->name); |
1232 | return(DFX_K_FAILURE); | 1232 | return DFX_K_FAILURE; |
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | /* | 1235 | /* |
@@ -1246,7 +1246,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1246 | NULL) != DFX_K_SUCCESS) | 1246 | NULL) != DFX_K_SUCCESS) |
1247 | { | 1247 | { |
1248 | printk("%s: Could not set consumer block address!\n", bp->dev->name); | 1248 | printk("%s: Could not set consumer block address!\n", bp->dev->name); |
1249 | return(DFX_K_FAILURE); | 1249 | return DFX_K_FAILURE; |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | /* | 1252 | /* |
@@ -1278,7 +1278,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1278 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 1278 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
1279 | { | 1279 | { |
1280 | printk("%s: DMA command request failed!\n", bp->dev->name); | 1280 | printk("%s: DMA command request failed!\n", bp->dev->name); |
1281 | return(DFX_K_FAILURE); | 1281 | return DFX_K_FAILURE; |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | /* Set the initial values for eFDXEnable and MACTReq MIB objects */ | 1284 | /* Set the initial values for eFDXEnable and MACTReq MIB objects */ |
@@ -1294,7 +1294,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1294 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 1294 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
1295 | { | 1295 | { |
1296 | printk("%s: DMA command request failed!\n", bp->dev->name); | 1296 | printk("%s: DMA command request failed!\n", bp->dev->name); |
1297 | return(DFX_K_FAILURE); | 1297 | return DFX_K_FAILURE; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | /* Initialize adapter CAM */ | 1300 | /* Initialize adapter CAM */ |
@@ -1302,7 +1302,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1302 | if (dfx_ctl_update_cam(bp) != DFX_K_SUCCESS) | 1302 | if (dfx_ctl_update_cam(bp) != DFX_K_SUCCESS) |
1303 | { | 1303 | { |
1304 | printk("%s: Adapter CAM update failed!\n", bp->dev->name); | 1304 | printk("%s: Adapter CAM update failed!\n", bp->dev->name); |
1305 | return(DFX_K_FAILURE); | 1305 | return DFX_K_FAILURE; |
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | /* Initialize adapter filters */ | 1308 | /* Initialize adapter filters */ |
@@ -1310,7 +1310,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1310 | if (dfx_ctl_update_filters(bp) != DFX_K_SUCCESS) | 1310 | if (dfx_ctl_update_filters(bp) != DFX_K_SUCCESS) |
1311 | { | 1311 | { |
1312 | printk("%s: Adapter filters update failed!\n", bp->dev->name); | 1312 | printk("%s: Adapter filters update failed!\n", bp->dev->name); |
1313 | return(DFX_K_FAILURE); | 1313 | return DFX_K_FAILURE; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | /* | 1316 | /* |
@@ -1328,7 +1328,7 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1328 | printk("%s: Receive buffer allocation failed\n", bp->dev->name); | 1328 | printk("%s: Receive buffer allocation failed\n", bp->dev->name); |
1329 | if (get_buffers) | 1329 | if (get_buffers) |
1330 | dfx_rcv_flush(bp); | 1330 | dfx_rcv_flush(bp); |
1331 | return(DFX_K_FAILURE); | 1331 | return DFX_K_FAILURE; |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */ | 1334 | /* Issue START command and bring adapter to LINK_(UN)AVAILABLE state */ |
@@ -1339,13 +1339,13 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1339 | printk("%s: Start command failed\n", bp->dev->name); | 1339 | printk("%s: Start command failed\n", bp->dev->name); |
1340 | if (get_buffers) | 1340 | if (get_buffers) |
1341 | dfx_rcv_flush(bp); | 1341 | dfx_rcv_flush(bp); |
1342 | return(DFX_K_FAILURE); | 1342 | return DFX_K_FAILURE; |
1343 | } | 1343 | } |
1344 | 1344 | ||
1345 | /* Initialization succeeded, reenable PDQ interrupts */ | 1345 | /* Initialization succeeded, reenable PDQ interrupts */ |
1346 | 1346 | ||
1347 | dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_ENABLE_DEF_INTS); | 1347 | dfx_port_write_long(bp, PI_PDQ_K_REG_HOST_INT_ENB, PI_HOST_INT_K_ENABLE_DEF_INTS); |
1348 | return(DFX_K_SUCCESS); | 1348 | return DFX_K_SUCCESS; |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | 1351 | ||
@@ -1434,7 +1434,7 @@ static int dfx_open(struct net_device *dev) | |||
1434 | 1434 | ||
1435 | /* Set device structure info */ | 1435 | /* Set device structure info */ |
1436 | netif_start_queue(dev); | 1436 | netif_start_queue(dev); |
1437 | return(0); | 1437 | return 0; |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | 1440 | ||
@@ -1526,7 +1526,7 @@ static int dfx_close(struct net_device *dev) | |||
1526 | 1526 | ||
1527 | free_irq(dev->irq, dev); | 1527 | free_irq(dev->irq, dev); |
1528 | 1528 | ||
1529 | return(0); | 1529 | return 0; |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | 1532 | ||
@@ -2027,7 +2027,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev) | |||
2027 | 2027 | ||
2028 | bp->cmd_req_virt->cmd_type = PI_CMD_K_SMT_MIB_GET; | 2028 | bp->cmd_req_virt->cmd_type = PI_CMD_K_SMT_MIB_GET; |
2029 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 2029 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
2030 | return((struct net_device_stats *) &bp->stats); | 2030 | return (struct net_device_stats *)&bp->stats; |
2031 | 2031 | ||
2032 | /* Fill the bp->stats structure with the SMT MIB object values */ | 2032 | /* Fill the bp->stats structure with the SMT MIB object values */ |
2033 | 2033 | ||
@@ -2128,7 +2128,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev) | |||
2128 | 2128 | ||
2129 | bp->cmd_req_virt->cmd_type = PI_CMD_K_CNTRS_GET; | 2129 | bp->cmd_req_virt->cmd_type = PI_CMD_K_CNTRS_GET; |
2130 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 2130 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
2131 | return((struct net_device_stats *) &bp->stats); | 2131 | return (struct net_device_stats *)&bp->stats; |
2132 | 2132 | ||
2133 | /* Fill the bp->stats structure with the FDDI counter values */ | 2133 | /* Fill the bp->stats structure with the FDDI counter values */ |
2134 | 2134 | ||
@@ -2144,7 +2144,7 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev) | |||
2144 | bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls; | 2144 | bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls; |
2145 | bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; | 2145 | bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; |
2146 | 2146 | ||
2147 | return((struct net_device_stats *) &bp->stats); | 2147 | return (struct net_device_stats *)&bp->stats; |
2148 | } | 2148 | } |
2149 | 2149 | ||
2150 | 2150 | ||
@@ -2354,7 +2354,7 @@ static int dfx_ctl_set_mac_address(struct net_device *dev, void *addr) | |||
2354 | { | 2354 | { |
2355 | DBG_printk("%s: Adapter CAM updated with new MAC address\n", dev->name); | 2355 | DBG_printk("%s: Adapter CAM updated with new MAC address\n", dev->name); |
2356 | } | 2356 | } |
2357 | return(0); /* always return zero */ | 2357 | return 0; /* always return zero */ |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | 2360 | ||
@@ -2438,8 +2438,8 @@ static int dfx_ctl_update_cam(DFX_board_t *bp) | |||
2438 | /* Issue command to update adapter CAM, then return */ | 2438 | /* Issue command to update adapter CAM, then return */ |
2439 | 2439 | ||
2440 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 2440 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
2441 | return(DFX_K_FAILURE); | 2441 | return DFX_K_FAILURE; |
2442 | return(DFX_K_SUCCESS); | 2442 | return DFX_K_SUCCESS; |
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | 2445 | ||
@@ -2504,8 +2504,8 @@ static int dfx_ctl_update_filters(DFX_board_t *bp) | |||
2504 | /* Issue command to update adapter filters, then return */ | 2504 | /* Issue command to update adapter filters, then return */ |
2505 | 2505 | ||
2506 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) | 2506 | if (dfx_hw_dma_cmd_req(bp) != DFX_K_SUCCESS) |
2507 | return(DFX_K_FAILURE); | 2507 | return DFX_K_FAILURE; |
2508 | return(DFX_K_SUCCESS); | 2508 | return DFX_K_SUCCESS; |
2509 | } | 2509 | } |
2510 | 2510 | ||
2511 | 2511 | ||
@@ -2561,7 +2561,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2561 | (status == PI_STATE_K_HALTED) || | 2561 | (status == PI_STATE_K_HALTED) || |
2562 | (status == PI_STATE_K_DMA_UNAVAIL) || | 2562 | (status == PI_STATE_K_DMA_UNAVAIL) || |
2563 | (status == PI_STATE_K_UPGRADE)) | 2563 | (status == PI_STATE_K_UPGRADE)) |
2564 | return(DFX_K_OUTSTATE); | 2564 | return DFX_K_OUTSTATE; |
2565 | 2565 | ||
2566 | /* Put response buffer on the command response queue */ | 2566 | /* Put response buffer on the command response queue */ |
2567 | 2567 | ||
@@ -2599,7 +2599,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2599 | udelay(100); /* wait for 100 microseconds */ | 2599 | udelay(100); /* wait for 100 microseconds */ |
2600 | } | 2600 | } |
2601 | if (timeout_cnt == 0) | 2601 | if (timeout_cnt == 0) |
2602 | return(DFX_K_HW_TIMEOUT); | 2602 | return DFX_K_HW_TIMEOUT; |
2603 | 2603 | ||
2604 | /* Bump (and wrap) the completion index and write out to register */ | 2604 | /* Bump (and wrap) the completion index and write out to register */ |
2605 | 2605 | ||
@@ -2619,14 +2619,14 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2619 | udelay(100); /* wait for 100 microseconds */ | 2619 | udelay(100); /* wait for 100 microseconds */ |
2620 | } | 2620 | } |
2621 | if (timeout_cnt == 0) | 2621 | if (timeout_cnt == 0) |
2622 | return(DFX_K_HW_TIMEOUT); | 2622 | return DFX_K_HW_TIMEOUT; |
2623 | 2623 | ||
2624 | /* Bump (and wrap) the completion index and write out to register */ | 2624 | /* Bump (and wrap) the completion index and write out to register */ |
2625 | 2625 | ||
2626 | bp->cmd_rsp_reg.index.comp += 1; | 2626 | bp->cmd_rsp_reg.index.comp += 1; |
2627 | bp->cmd_rsp_reg.index.comp &= PI_CMD_RSP_K_NUM_ENTRIES-1; | 2627 | bp->cmd_rsp_reg.index.comp &= PI_CMD_RSP_K_NUM_ENTRIES-1; |
2628 | dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword); | 2628 | dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword); |
2629 | return(DFX_K_SUCCESS); | 2629 | return DFX_K_SUCCESS; |
2630 | } | 2630 | } |
2631 | 2631 | ||
2632 | 2632 | ||
@@ -2700,7 +2700,7 @@ static int dfx_hw_port_ctrl_req( | |||
2700 | udelay(100); /* wait for 100 microseconds */ | 2700 | udelay(100); /* wait for 100 microseconds */ |
2701 | } | 2701 | } |
2702 | if (timeout_cnt == 0) | 2702 | if (timeout_cnt == 0) |
2703 | return(DFX_K_HW_TIMEOUT); | 2703 | return DFX_K_HW_TIMEOUT; |
2704 | 2704 | ||
2705 | /* | 2705 | /* |
2706 | * If the address of host_data is non-zero, assume caller has supplied a | 2706 | * If the address of host_data is non-zero, assume caller has supplied a |
@@ -2710,7 +2710,7 @@ static int dfx_hw_port_ctrl_req( | |||
2710 | 2710 | ||
2711 | if (host_data != NULL) | 2711 | if (host_data != NULL) |
2712 | dfx_port_read_long(bp, PI_PDQ_K_REG_HOST_DATA, host_data); | 2712 | dfx_port_read_long(bp, PI_PDQ_K_REG_HOST_DATA, host_data); |
2713 | return(DFX_K_SUCCESS); | 2713 | return DFX_K_SUCCESS; |
2714 | } | 2714 | } |
2715 | 2715 | ||
2716 | 2716 | ||
@@ -2800,7 +2800,7 @@ static int dfx_hw_adap_state_rd(DFX_board_t *bp) | |||
2800 | PI_UINT32 port_status; /* Port Status register value */ | 2800 | PI_UINT32 port_status; /* Port Status register value */ |
2801 | 2801 | ||
2802 | dfx_port_read_long(bp, PI_PDQ_K_REG_PORT_STATUS, &port_status); | 2802 | dfx_port_read_long(bp, PI_PDQ_K_REG_PORT_STATUS, &port_status); |
2803 | return((port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE); | 2803 | return (port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE; |
2804 | } | 2804 | } |
2805 | 2805 | ||
2806 | 2806 | ||
@@ -2852,8 +2852,8 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type) | |||
2852 | udelay(100); /* wait for 100 microseconds */ | 2852 | udelay(100); /* wait for 100 microseconds */ |
2853 | } | 2853 | } |
2854 | if (timeout_cnt == 0) | 2854 | if (timeout_cnt == 0) |
2855 | return(DFX_K_HW_TIMEOUT); | 2855 | return DFX_K_HW_TIMEOUT; |
2856 | return(DFX_K_SUCCESS); | 2856 | return DFX_K_SUCCESS; |
2857 | } | 2857 | } |
2858 | 2858 | ||
2859 | /* | 2859 | /* |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 8e2eab4e7c75..b0aa9e68990a 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2215,10 +2215,10 @@ static int e100_change_mtu(struct net_device *netdev, int new_mtu) | |||
2215 | static int e100_asf(struct nic *nic) | 2215 | static int e100_asf(struct nic *nic) |
2216 | { | 2216 | { |
2217 | /* ASF can be enabled from eeprom */ | 2217 | /* ASF can be enabled from eeprom */ |
2218 | return((nic->pdev->device >= 0x1050) && (nic->pdev->device <= 0x1057) && | 2218 | return (nic->pdev->device >= 0x1050) && (nic->pdev->device <= 0x1057) && |
2219 | (nic->eeprom[eeprom_config_asf] & eeprom_asf) && | 2219 | (nic->eeprom[eeprom_config_asf] & eeprom_asf) && |
2220 | !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && | 2220 | !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && |
2221 | ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE)); | 2221 | ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE); |
2222 | } | 2222 | } |
2223 | 2223 | ||
2224 | static int e100_up(struct nic *nic) | 2224 | static int e100_up(struct nic *nic) |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 796523f2c6b1..cb3f84b81793 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3600,7 +3600,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3600 | adapter->total_tx_packets += total_tx_packets; | 3600 | adapter->total_tx_packets += total_tx_packets; |
3601 | netdev->stats.tx_bytes += total_tx_bytes; | 3601 | netdev->stats.tx_bytes += total_tx_bytes; |
3602 | netdev->stats.tx_packets += total_tx_packets; | 3602 | netdev->stats.tx_packets += total_tx_packets; |
3603 | return (count < tx_ring->count); | 3603 | return count < tx_ring->count; |
3604 | } | 3604 | } |
3605 | 3605 | ||
3606 | /** | 3606 | /** |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 6355a1b779d3..b7f15b3f0e03 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -368,7 +368,7 @@ out: | |||
368 | static u32 e1000_get_rx_csum(struct net_device *netdev) | 368 | static u32 e1000_get_rx_csum(struct net_device *netdev) |
369 | { | 369 | { |
370 | struct e1000_adapter *adapter = netdev_priv(netdev); | 370 | struct e1000_adapter *adapter = netdev_priv(netdev); |
371 | return (adapter->flags & FLAG_RX_CSUM_ENABLED); | 371 | return adapter->flags & FLAG_RX_CSUM_ENABLED; |
372 | } | 372 | } |
373 | 373 | ||
374 | static int e1000_set_rx_csum(struct net_device *netdev, u32 data) | 374 | static int e1000_set_rx_csum(struct net_device *netdev, u32 data) |
@@ -389,7 +389,7 @@ static int e1000_set_rx_csum(struct net_device *netdev, u32 data) | |||
389 | 389 | ||
390 | static u32 e1000_get_tx_csum(struct net_device *netdev) | 390 | static u32 e1000_get_tx_csum(struct net_device *netdev) |
391 | { | 391 | { |
392 | return ((netdev->features & NETIF_F_HW_CSUM) != 0); | 392 | return (netdev->features & NETIF_F_HW_CSUM) != 0; |
393 | } | 393 | } |
394 | 394 | ||
395 | static int e1000_set_tx_csum(struct net_device *netdev, u32 data) | 395 | static int e1000_set_tx_csum(struct net_device *netdev, u32 data) |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 4630bad52e74..5d5850b556cf 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -1053,7 +1053,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
1053 | adapter->total_tx_packets += total_tx_packets; | 1053 | adapter->total_tx_packets += total_tx_packets; |
1054 | netdev->stats.tx_bytes += total_tx_bytes; | 1054 | netdev->stats.tx_bytes += total_tx_bytes; |
1055 | netdev->stats.tx_packets += total_tx_packets; | 1055 | netdev->stats.tx_packets += total_tx_packets; |
1056 | return (count < tx_ring->count); | 1056 | return count < tx_ring->count; |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | /** | 1059 | /** |
diff --git a/drivers/net/enic/vnic_rq.h b/drivers/net/enic/vnic_rq.h index 2dc48f91abf7..4b6f0212c8a2 100644 --- a/drivers/net/enic/vnic_rq.h +++ b/drivers/net/enic/vnic_rq.h | |||
@@ -143,7 +143,7 @@ static inline void vnic_rq_post(struct vnic_rq *rq, | |||
143 | 143 | ||
144 | static inline int vnic_rq_posting_soon(struct vnic_rq *rq) | 144 | static inline int vnic_rq_posting_soon(struct vnic_rq *rq) |
145 | { | 145 | { |
146 | return ((rq->to_use->index & VNIC_RQ_RETURN_RATE) == 0); | 146 | return (rq->to_use->index & VNIC_RQ_RETURN_RATE) == 0; |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) | 149 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) |
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index ce22e15a3776..fb717be511f6 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c | |||
@@ -796,7 +796,7 @@ static int eth16i_receive_probe_packet(int ioaddr) | |||
796 | 796 | ||
797 | if(eth16i_debug > 1) | 797 | if(eth16i_debug > 1) |
798 | printk(KERN_DEBUG "RECEIVE_PACKET\n"); | 798 | printk(KERN_DEBUG "RECEIVE_PACKET\n"); |
799 | return(0); /* Found receive packet */ | 799 | return 0; /* Found receive packet */ |
800 | } | 800 | } |
801 | } | 801 | } |
802 | 802 | ||
@@ -805,7 +805,7 @@ static int eth16i_receive_probe_packet(int ioaddr) | |||
805 | printk(KERN_DEBUG "RX_STATUS_REG = %x\n", inb(ioaddr + RX_STATUS_REG)); | 805 | printk(KERN_DEBUG "RX_STATUS_REG = %x\n", inb(ioaddr + RX_STATUS_REG)); |
806 | } | 806 | } |
807 | 807 | ||
808 | return(0); /* Return success */ | 808 | return 0; /* Return success */ |
809 | } | 809 | } |
810 | 810 | ||
811 | #if 0 | 811 | #if 0 |
@@ -841,7 +841,7 @@ static int __init eth16i_get_irq(int ioaddr) | |||
841 | 841 | ||
842 | if( ioaddr < 0x1000) { | 842 | if( ioaddr < 0x1000) { |
843 | cbyte = inb(ioaddr + JUMPERLESS_CONFIG); | 843 | cbyte = inb(ioaddr + JUMPERLESS_CONFIG); |
844 | return( eth16i_irqmap[ ((cbyte & 0xC0) >> 6) ] ); | 844 | return eth16i_irqmap[((cbyte & 0xC0) >> 6)]; |
845 | } else { /* Oh..the card is EISA so method getting IRQ different */ | 845 | } else { /* Oh..the card is EISA so method getting IRQ different */ |
846 | unsigned short index = 0; | 846 | unsigned short index = 0; |
847 | cbyte = inb(ioaddr + EISA_IRQ_REG); | 847 | cbyte = inb(ioaddr + EISA_IRQ_REG); |
@@ -849,7 +849,7 @@ static int __init eth16i_get_irq(int ioaddr) | |||
849 | cbyte = cbyte >> 1; | 849 | cbyte = cbyte >> 1; |
850 | index++; | 850 | index++; |
851 | } | 851 | } |
852 | return( eth32i_irqmap[ index ] ); | 852 | return eth32i_irqmap[index]; |
853 | } | 853 | } |
854 | } | 854 | } |
855 | 855 | ||
@@ -909,7 +909,7 @@ static int eth16i_read_eeprom(int ioaddr, int offset) | |||
909 | data = eth16i_read_eeprom_word(ioaddr); | 909 | data = eth16i_read_eeprom_word(ioaddr); |
910 | outb(CS_0 | SK_0, ioaddr + EEPROM_CTRL_REG); | 910 | outb(CS_0 | SK_0, ioaddr + EEPROM_CTRL_REG); |
911 | 911 | ||
912 | return(data); | 912 | return data; |
913 | } | 913 | } |
914 | 914 | ||
915 | static int eth16i_read_eeprom_word(int ioaddr) | 915 | static int eth16i_read_eeprom_word(int ioaddr) |
@@ -928,7 +928,7 @@ static int eth16i_read_eeprom_word(int ioaddr) | |||
928 | eeprom_slow_io(); | 928 | eeprom_slow_io(); |
929 | } | 929 | } |
930 | 930 | ||
931 | return(data); | 931 | return data; |
932 | } | 932 | } |
933 | 933 | ||
934 | static void eth16i_eeprom_cmd(int ioaddr, unsigned char command) | 934 | static void eth16i_eeprom_cmd(int ioaddr, unsigned char command) |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 6a44fe411589..ddac63cefbaa 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -4620,7 +4620,7 @@ static int nv_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam* | |||
4620 | static u32 nv_get_rx_csum(struct net_device *dev) | 4620 | static u32 nv_get_rx_csum(struct net_device *dev) |
4621 | { | 4621 | { |
4622 | struct fe_priv *np = netdev_priv(dev); | 4622 | struct fe_priv *np = netdev_priv(dev); |
4623 | return (np->rx_csum) != 0; | 4623 | return np->rx_csum != 0; |
4624 | } | 4624 | } |
4625 | 4625 | ||
4626 | static int nv_set_rx_csum(struct net_device *dev, u32 data) | 4626 | static int nv_set_rx_csum(struct net_device *dev, u32 data) |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index d4bf91aac25f..8d3a2ccbc953 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -125,7 +125,7 @@ int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) | |||
125 | struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus); | 125 | struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus); |
126 | 126 | ||
127 | /* Write to the local MII regs */ | 127 | /* Write to the local MII regs */ |
128 | return(fsl_pq_local_mdio_write(regs, mii_id, regnum, value)); | 128 | return fsl_pq_local_mdio_write(regs, mii_id, regnum, value); |
129 | } | 129 | } |
130 | 130 | ||
131 | /* | 131 | /* |
@@ -137,7 +137,7 @@ int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
137 | struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus); | 137 | struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus); |
138 | 138 | ||
139 | /* Read the local MII regs */ | 139 | /* Read the local MII regs */ |
140 | return(fsl_pq_local_mdio_read(regs, mii_id, regnum)); | 140 | return fsl_pq_local_mdio_read(regs, mii_id, regnum); |
141 | } | 141 | } |
142 | 142 | ||
143 | /* Reset the MIIM registers, and wait for the bus to free */ | 143 | /* Reset the MIIM registers, and wait for the bus to free */ |
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 9bda023c0235..ae8e5d3c6c1f 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -254,7 +254,7 @@ static unsigned int gfar_usecs2ticks(struct gfar_private *priv, unsigned int use | |||
254 | 254 | ||
255 | /* Make sure we return a number greater than 0 | 255 | /* Make sure we return a number greater than 0 |
256 | * if usecs > 0 */ | 256 | * if usecs > 0 */ |
257 | return ((usecs * 1000 + count - 1) / count); | 257 | return (usecs * 1000 + count - 1) / count; |
258 | } | 258 | } |
259 | 259 | ||
260 | /* Convert ethernet clock ticks to microseconds */ | 260 | /* Convert ethernet clock ticks to microseconds */ |
@@ -278,7 +278,7 @@ static unsigned int gfar_ticks2usecs(struct gfar_private *priv, unsigned int tic | |||
278 | 278 | ||
279 | /* Make sure we return a number greater than 0 */ | 279 | /* Make sure we return a number greater than 0 */ |
280 | /* if ticks is > 0 */ | 280 | /* if ticks is > 0 */ |
281 | return ((ticks * count) / 1000); | 281 | return (ticks * count) / 1000; |
282 | } | 282 | } |
283 | 283 | ||
284 | /* Get the coalescing parameters, and put them in the cvals | 284 | /* Get the coalescing parameters, and put them in the cvals |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 14f01d156db9..ac1d323c5eb5 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -168,7 +168,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) | |||
168 | 168 | ||
169 | static inline int dev_is_ethdev(struct net_device *dev) | 169 | static inline int dev_is_ethdev(struct net_device *dev) |
170 | { | 170 | { |
171 | return (dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); | 171 | return dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5); |
172 | } | 172 | } |
173 | 173 | ||
174 | /* ------------------------------------------------------------------------ */ | 174 | /* ------------------------------------------------------------------------ */ |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index b8bdf9d51cd4..5b37579e84b7 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -110,7 +110,7 @@ static int calc_crc_ccitt(const unsigned char *buf, int cnt) | |||
110 | for (; cnt > 0; cnt--) | 110 | for (; cnt > 0; cnt--) |
111 | crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff]; | 111 | crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff]; |
112 | crc ^= 0xffff; | 112 | crc ^= 0xffff; |
113 | return (crc & 0xffff); | 113 | return crc & 0xffff; |
114 | } | 114 | } |
115 | #endif | 115 | #endif |
116 | 116 | ||
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 095b17ecf609..8e2c4601b5f5 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1312,7 +1312,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, | |||
1312 | for (p = (ringptr->pdl); p < (ringptr->pdl + 5); p++) | 1312 | for (p = (ringptr->pdl); p < (ringptr->pdl + 5); p++) |
1313 | printk("hp100: %s: Adr 0x%.8x = 0x%.8x\n", dev->name, (u_int) p, (u_int) * p); | 1313 | printk("hp100: %s: Adr 0x%.8x = 0x%.8x\n", dev->name, (u_int) p, (u_int) * p); |
1314 | #endif | 1314 | #endif |
1315 | return (1); | 1315 | return 1; |
1316 | } | 1316 | } |
1317 | /* else: */ | 1317 | /* else: */ |
1318 | /* alloc_skb failed (no memory) -> still can receive the header | 1318 | /* alloc_skb failed (no memory) -> still can receive the header |
@@ -1325,7 +1325,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, | |||
1325 | 1325 | ||
1326 | ringptr->pdl[0] = 0x00010000; /* PDH: Count=1 Fragment */ | 1326 | ringptr->pdl[0] = 0x00010000; /* PDH: Count=1 Fragment */ |
1327 | 1327 | ||
1328 | return (0); | 1328 | return 0; |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | /* | 1331 | /* |
@@ -2752,7 +2752,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin) | |||
2752 | hp100_outw(HP100_MISC_ERROR, IRQ_STATUS); | 2752 | hp100_outw(HP100_MISC_ERROR, IRQ_STATUS); |
2753 | 2753 | ||
2754 | if (val & HP100_LINK_UP_ST) | 2754 | if (val & HP100_LINK_UP_ST) |
2755 | return (0); /* login was ok */ | 2755 | return 0; /* login was ok */ |
2756 | else { | 2756 | else { |
2757 | printk("hp100: %s: Training failed.\n", dev->name); | 2757 | printk("hp100: %s: Training failed.\n", dev->name); |
2758 | hp100_down_vg_link(dev); | 2758 | hp100_down_vg_link(dev); |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3506fd6ad726..3bdb4fa32064 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2095,11 +2095,11 @@ static void *emac_dump_regs(struct emac_instance *dev, void *buf) | |||
2095 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) { | 2095 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) { |
2096 | hdr->version = EMAC4_ETHTOOL_REGS_VER; | 2096 | hdr->version = EMAC4_ETHTOOL_REGS_VER; |
2097 | memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE(dev)); | 2097 | memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE(dev)); |
2098 | return ((void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE(dev)); | 2098 | return (void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE(dev); |
2099 | } else { | 2099 | } else { |
2100 | hdr->version = EMAC_ETHTOOL_REGS_VER; | 2100 | hdr->version = EMAC_ETHTOOL_REGS_VER; |
2101 | memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE(dev)); | 2101 | memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE(dev)); |
2102 | return ((void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE(dev)); | 2102 | return (void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE(dev); |
2103 | } | 2103 | } |
2104 | } | 2104 | } |
2105 | 2105 | ||
@@ -2293,7 +2293,7 @@ static int __devinit emac_check_deps(struct emac_instance *dev, | |||
2293 | if (deps[i].drvdata != NULL) | 2293 | if (deps[i].drvdata != NULL) |
2294 | there++; | 2294 | there++; |
2295 | } | 2295 | } |
2296 | return (there == EMAC_DEP_COUNT); | 2296 | return there == EMAC_DEP_COUNT; |
2297 | } | 2297 | } |
2298 | 2298 | ||
2299 | static void emac_put_deps(struct emac_instance *dev) | 2299 | static void emac_put_deps(struct emac_instance *dev) |
diff --git a/drivers/net/ibm_newemac/core.h b/drivers/net/ibm_newemac/core.h index 9e37e3d9c51d..4fec0844d59d 100644 --- a/drivers/net/ibm_newemac/core.h +++ b/drivers/net/ibm_newemac/core.h | |||
@@ -410,7 +410,7 @@ static inline u32 *emac_xaht_base(struct emac_instance *dev) | |||
410 | else | 410 | else |
411 | offset = offsetof(struct emac_regs, u0.emac4.iaht1); | 411 | offset = offsetof(struct emac_regs, u0.emac4.iaht1); |
412 | 412 | ||
413 | return ((u32 *)((ptrdiff_t)p + offset)); | 413 | return (u32 *)((ptrdiff_t)p + offset); |
414 | } | 414 | } |
415 | 415 | ||
416 | static inline u32 *emac_gaht_base(struct emac_instance *dev) | 416 | static inline u32 *emac_gaht_base(struct emac_instance *dev) |
@@ -418,7 +418,7 @@ static inline u32 *emac_gaht_base(struct emac_instance *dev) | |||
418 | /* GAHT registers always come after an identical number of | 418 | /* GAHT registers always come after an identical number of |
419 | * IAHT registers. | 419 | * IAHT registers. |
420 | */ | 420 | */ |
421 | return (emac_xaht_base(dev) + EMAC_XAHT_REGS(dev)); | 421 | return emac_xaht_base(dev) + EMAC_XAHT_REGS(dev); |
422 | } | 422 | } |
423 | 423 | ||
424 | static inline u32 *emac_iaht_base(struct emac_instance *dev) | 424 | static inline u32 *emac_iaht_base(struct emac_instance *dev) |
@@ -426,7 +426,7 @@ static inline u32 *emac_iaht_base(struct emac_instance *dev) | |||
426 | /* IAHT registers always come before an identical number of | 426 | /* IAHT registers always come before an identical number of |
427 | * GAHT registers. | 427 | * GAHT registers. |
428 | */ | 428 | */ |
429 | return (emac_xaht_base(dev)); | 429 | return emac_xaht_base(dev); |
430 | } | 430 | } |
431 | 431 | ||
432 | /* Ethtool get_regs complex data. | 432 | /* Ethtool get_regs complex data. |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index f915e9cb302e..0394ca95f3ba 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -5435,7 +5435,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) | |||
5435 | tx_ring->total_packets += total_packets; | 5435 | tx_ring->total_packets += total_packets; |
5436 | tx_ring->tx_stats.bytes += total_bytes; | 5436 | tx_ring->tx_stats.bytes += total_bytes; |
5437 | tx_ring->tx_stats.packets += total_packets; | 5437 | tx_ring->tx_stats.packets += total_packets; |
5438 | return (count < tx_ring->count); | 5438 | return count < tx_ring->count; |
5439 | } | 5439 | } |
5440 | 5440 | ||
5441 | /** | 5441 | /** |
diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c index 103b3aa1afc2..33add708bcbe 100644 --- a/drivers/net/igbvf/ethtool.c +++ b/drivers/net/igbvf/ethtool.c | |||
@@ -153,7 +153,7 @@ static int igbvf_set_rx_csum(struct net_device *netdev, u32 data) | |||
153 | 153 | ||
154 | static u32 igbvf_get_tx_csum(struct net_device *netdev) | 154 | static u32 igbvf_get_tx_csum(struct net_device *netdev) |
155 | { | 155 | { |
156 | return ((netdev->features & NETIF_F_IP_CSUM) != 0); | 156 | return (netdev->features & NETIF_F_IP_CSUM) != 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int igbvf_set_tx_csum(struct net_device *netdev, u32 data) | 159 | static int igbvf_set_tx_csum(struct net_device *netdev, u32 data) |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index c7fab80d2490..265501348f33 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -845,7 +845,7 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) | |||
845 | } | 845 | } |
846 | adapter->net_stats.tx_bytes += total_bytes; | 846 | adapter->net_stats.tx_bytes += total_bytes; |
847 | adapter->net_stats.tx_packets += total_packets; | 847 | adapter->net_stats.tx_packets += total_packets; |
848 | return (count < tx_ring->count); | 848 | return count < tx_ring->count; |
849 | } | 849 | } |
850 | 850 | ||
851 | static irqreturn_t igbvf_msix_other(int irq, void *data) | 851 | static irqreturn_t igbvf_msix_other(int irq, void *data) |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 48bd5ec9f29b..b626cccbccd1 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -217,7 +217,7 @@ toshoboe_checkfcs (unsigned char *buf, int len) | |||
217 | for (i = 0; i < len; ++i) | 217 | for (i = 0; i < len; ++i) |
218 | fcs.value = irda_fcs (fcs.value, *(buf++)); | 218 | fcs.value = irda_fcs (fcs.value, *(buf++)); |
219 | 219 | ||
220 | return (fcs.value == GOOD_FCS); | 220 | return fcs.value == GOOD_FCS; |
221 | } | 221 | } |
222 | 222 | ||
223 | /***********************************************************************/ | 223 | /***********************************************************************/ |
@@ -759,7 +759,7 @@ toshoboe_maketestpacket (unsigned char *buf, int badcrc, int fir) | |||
759 | if (fir) | 759 | if (fir) |
760 | { | 760 | { |
761 | memset (buf, 0, TT_LEN); | 761 | memset (buf, 0, TT_LEN); |
762 | return (TT_LEN); | 762 | return TT_LEN; |
763 | } | 763 | } |
764 | 764 | ||
765 | fcs.value = INIT_FCS; | 765 | fcs.value = INIT_FCS; |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 4441fa3389c2..cce82f101f50 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1514,7 +1514,7 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ | |||
1514 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", | 1514 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", |
1515 | __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); | 1515 | __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); |
1516 | 1516 | ||
1517 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); | 1517 | return (self->bulk_in_ep != 0) && (self->bulk_out_ep != 0); |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | #ifdef IU_DUMP_CLASS_DESC | 1520 | #ifdef IU_DUMP_CLASS_DESC |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index e30cdbb14745..559fe854d76d 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -1348,7 +1348,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) | |||
1348 | outb(bank, iobase+BSR); | 1348 | outb(bank, iobase+BSR); |
1349 | 1349 | ||
1350 | /* Make sure interrupt handlers keep the proper interrupt mask */ | 1350 | /* Make sure interrupt handlers keep the proper interrupt mask */ |
1351 | return(ier); | 1351 | return ier; |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | /* | 1354 | /* |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 1b051dab7b29..39d6e6f15d4f 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -336,7 +336,7 @@ static int sirdev_is_receiving(struct sir_dev *dev) | |||
336 | if (!atomic_read(&dev->enable_rx)) | 336 | if (!atomic_read(&dev->enable_rx)) |
337 | return 0; | 337 | return 0; |
338 | 338 | ||
339 | return (dev->rx_buff.state != OUTSIDE_FRAME); | 339 | return dev->rx_buff.state != OUTSIDE_FRAME; |
340 | } | 340 | } |
341 | 341 | ||
342 | int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type) | 342 | int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type) |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 850ca1c5ee19..8c57bfb5f098 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -2051,7 +2051,7 @@ static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len) | |||
2051 | */ | 2051 | */ |
2052 | static int smsc_ircc_is_receiving(struct smsc_ircc_cb *self) | 2052 | static int smsc_ircc_is_receiving(struct smsc_ircc_cb *self) |
2053 | { | 2053 | { |
2054 | return (self->rx_buff.state != OUTSIDE_FRAME); | 2054 | return self->rx_buff.state != OUTSIDE_FRAME; |
2055 | } | 2055 | } |
2056 | 2056 | ||
2057 | 2057 | ||
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index e5698fa30a4f..41c96b3d8152 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -219,7 +219,7 @@ static inline int read_reg(struct stir_cb *stir, __u16 reg, | |||
219 | 219 | ||
220 | static inline int isfir(u32 speed) | 220 | static inline int isfir(u32 speed) |
221 | { | 221 | { |
222 | return (speed == 4000000); | 222 | return speed == 4000000; |
223 | } | 223 | } |
224 | 224 | ||
225 | /* | 225 | /* |
diff --git a/drivers/net/irda/via-ircc.h b/drivers/net/irda/via-ircc.h index 5a84822b5a43..c6f58482b769 100644 --- a/drivers/net/irda/via-ircc.h +++ b/drivers/net/irda/via-ircc.h | |||
@@ -238,7 +238,7 @@ static void WriteLPCReg(int iRegNum, unsigned char iVal) | |||
238 | 238 | ||
239 | static __u8 ReadReg(unsigned int BaseAddr, int iRegNum) | 239 | static __u8 ReadReg(unsigned int BaseAddr, int iRegNum) |
240 | { | 240 | { |
241 | return ((__u8) inb(BaseAddr + iRegNum)); | 241 | return (__u8) inb(BaseAddr + iRegNum); |
242 | } | 242 | } |
243 | 243 | ||
244 | static void WriteReg(unsigned int BaseAddr, int iRegNum, unsigned char iVal) | 244 | static void WriteReg(unsigned int BaseAddr, int iRegNum, unsigned char iVal) |
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h index 3f24a1f33022..d66fab854bf1 100644 --- a/drivers/net/irda/vlsi_ir.h +++ b/drivers/net/irda/vlsi_ir.h | |||
@@ -595,7 +595,7 @@ struct ring_descr { | |||
595 | 595 | ||
596 | static inline int rd_is_active(struct ring_descr *rd) | 596 | static inline int rd_is_active(struct ring_descr *rd) |
597 | { | 597 | { |
598 | return ((rd->hw->rd_status & RD_ACTIVE) != 0); | 598 | return (rd->hw->rd_status & RD_ACTIVE) != 0; |
599 | } | 599 | } |
600 | 600 | ||
601 | static inline void rd_activate(struct ring_descr *rd) | 601 | static inline void rd_activate(struct ring_descr *rd) |
diff --git a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c index 813993f9c65c..c982ab9f9005 100644 --- a/drivers/net/ixgb/ixgb_ee.c +++ b/drivers/net/ixgb/ixgb_ee.c | |||
@@ -296,12 +296,12 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw) | |||
296 | eecd_reg = IXGB_READ_REG(hw, EECD); | 296 | eecd_reg = IXGB_READ_REG(hw, EECD); |
297 | 297 | ||
298 | if (eecd_reg & IXGB_EECD_DO) | 298 | if (eecd_reg & IXGB_EECD_DO) |
299 | return (true); | 299 | return true; |
300 | 300 | ||
301 | udelay(50); | 301 | udelay(50); |
302 | } | 302 | } |
303 | ASSERT(0); | 303 | ASSERT(0); |
304 | return (false); | 304 | return false; |
305 | } | 305 | } |
306 | 306 | ||
307 | /****************************************************************************** | 307 | /****************************************************************************** |
@@ -327,9 +327,9 @@ ixgb_validate_eeprom_checksum(struct ixgb_hw *hw) | |||
327 | checksum += ixgb_read_eeprom(hw, i); | 327 | checksum += ixgb_read_eeprom(hw, i); |
328 | 328 | ||
329 | if (checksum == (u16) EEPROM_SUM) | 329 | if (checksum == (u16) EEPROM_SUM) |
330 | return (true); | 330 | return true; |
331 | else | 331 | else |
332 | return (false); | 332 | return false; |
333 | } | 333 | } |
334 | 334 | ||
335 | /****************************************************************************** | 335 | /****************************************************************************** |
@@ -439,7 +439,7 @@ ixgb_read_eeprom(struct ixgb_hw *hw, | |||
439 | /* End this read operation */ | 439 | /* End this read operation */ |
440 | ixgb_standby_eeprom(hw); | 440 | ixgb_standby_eeprom(hw); |
441 | 441 | ||
442 | return (data); | 442 | return data; |
443 | } | 443 | } |
444 | 444 | ||
445 | /****************************************************************************** | 445 | /****************************************************************************** |
@@ -476,16 +476,16 @@ ixgb_get_eeprom_data(struct ixgb_hw *hw) | |||
476 | /* clear the init_ctrl_reg_1 to signify that the cache is | 476 | /* clear the init_ctrl_reg_1 to signify that the cache is |
477 | * invalidated */ | 477 | * invalidated */ |
478 | ee_map->init_ctrl_reg_1 = cpu_to_le16(EEPROM_ICW1_SIGNATURE_CLEAR); | 478 | ee_map->init_ctrl_reg_1 = cpu_to_le16(EEPROM_ICW1_SIGNATURE_CLEAR); |
479 | return (false); | 479 | return false; |
480 | } | 480 | } |
481 | 481 | ||
482 | if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK)) | 482 | if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK)) |
483 | != cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) { | 483 | != cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) { |
484 | pr_debug("Signature invalid\n"); | 484 | pr_debug("Signature invalid\n"); |
485 | return(false); | 485 | return false; |
486 | } | 486 | } |
487 | 487 | ||
488 | return(true); | 488 | return true; |
489 | } | 489 | } |
490 | 490 | ||
491 | /****************************************************************************** | 491 | /****************************************************************************** |
@@ -505,7 +505,7 @@ ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw) | |||
505 | 505 | ||
506 | if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK)) | 506 | if ((ee_map->init_ctrl_reg_1 & cpu_to_le16(EEPROM_ICW1_SIGNATURE_MASK)) |
507 | == cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) { | 507 | == cpu_to_le16(EEPROM_ICW1_SIGNATURE_VALID)) { |
508 | return (true); | 508 | return true; |
509 | } else { | 509 | } else { |
510 | return ixgb_get_eeprom_data(hw); | 510 | return ixgb_get_eeprom_data(hw); |
511 | } | 511 | } |
@@ -526,10 +526,10 @@ ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index) | |||
526 | 526 | ||
527 | if ((index < IXGB_EEPROM_SIZE) && | 527 | if ((index < IXGB_EEPROM_SIZE) && |
528 | (ixgb_check_and_get_eeprom_data(hw) == true)) { | 528 | (ixgb_check_and_get_eeprom_data(hw) == true)) { |
529 | return(hw->eeprom[index]); | 529 | return hw->eeprom[index]; |
530 | } | 530 | } |
531 | 531 | ||
532 | return(0); | 532 | return 0; |
533 | } | 533 | } |
534 | 534 | ||
535 | /****************************************************************************** | 535 | /****************************************************************************** |
@@ -570,10 +570,10 @@ u32 | |||
570 | ixgb_get_ee_pba_number(struct ixgb_hw *hw) | 570 | ixgb_get_ee_pba_number(struct ixgb_hw *hw) |
571 | { | 571 | { |
572 | if (ixgb_check_and_get_eeprom_data(hw) == true) | 572 | if (ixgb_check_and_get_eeprom_data(hw) == true) |
573 | return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) | 573 | return le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) |
574 | | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16)); | 574 | | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16); |
575 | 575 | ||
576 | return(0); | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | 579 | ||
@@ -591,8 +591,8 @@ ixgb_get_ee_device_id(struct ixgb_hw *hw) | |||
591 | struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; | 591 | struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; |
592 | 592 | ||
593 | if (ixgb_check_and_get_eeprom_data(hw) == true) | 593 | if (ixgb_check_and_get_eeprom_data(hw) == true) |
594 | return (le16_to_cpu(ee_map->device_id)); | 594 | return le16_to_cpu(ee_map->device_id); |
595 | 595 | ||
596 | return (0); | 596 | return 0; |
597 | } | 597 | } |
598 | 598 | ||
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index a4ed96caae69..43994c199991 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c | |||
@@ -410,7 +410,7 @@ static int | |||
410 | ixgb_get_eeprom_len(struct net_device *netdev) | 410 | ixgb_get_eeprom_len(struct net_device *netdev) |
411 | { | 411 | { |
412 | /* return size in bytes */ | 412 | /* return size in bytes */ |
413 | return (IXGB_EEPROM_SIZE << 1); | 413 | return IXGB_EEPROM_SIZE << 1; |
414 | } | 414 | } |
415 | 415 | ||
416 | static int | 416 | static int |
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c index 397acabccab6..6cb2e42ff4c1 100644 --- a/drivers/net/ixgb/ixgb_hw.c +++ b/drivers/net/ixgb/ixgb_hw.c | |||
@@ -167,7 +167,7 @@ ixgb_adapter_stop(struct ixgb_hw *hw) | |||
167 | /* Clear any pending interrupt events. */ | 167 | /* Clear any pending interrupt events. */ |
168 | icr_reg = IXGB_READ_REG(hw, ICR); | 168 | icr_reg = IXGB_READ_REG(hw, ICR); |
169 | 169 | ||
170 | return (ctrl_reg & IXGB_CTRL0_RST); | 170 | return ctrl_reg & IXGB_CTRL0_RST; |
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
@@ -209,7 +209,7 @@ ixgb_identify_xpak_vendor(struct ixgb_hw *hw) | |||
209 | xpak_vendor = ixgb_xpak_vendor_infineon; | 209 | xpak_vendor = ixgb_xpak_vendor_infineon; |
210 | } | 210 | } |
211 | 211 | ||
212 | return (xpak_vendor); | 212 | return xpak_vendor; |
213 | } | 213 | } |
214 | 214 | ||
215 | /****************************************************************************** | 215 | /****************************************************************************** |
@@ -273,7 +273,7 @@ ixgb_identify_phy(struct ixgb_hw *hw) | |||
273 | if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) | 273 | if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) |
274 | phy_type = ixgb_phy_type_bcm; | 274 | phy_type = ixgb_phy_type_bcm; |
275 | 275 | ||
276 | return (phy_type); | 276 | return phy_type; |
277 | } | 277 | } |
278 | 278 | ||
279 | /****************************************************************************** | 279 | /****************************************************************************** |
@@ -366,7 +366,7 @@ ixgb_init_hw(struct ixgb_hw *hw) | |||
366 | /* 82597EX errata: Call check-for-link in case lane deskew is locked */ | 366 | /* 82597EX errata: Call check-for-link in case lane deskew is locked */ |
367 | ixgb_check_for_link(hw); | 367 | ixgb_check_for_link(hw); |
368 | 368 | ||
369 | return (status); | 369 | return status; |
370 | } | 370 | } |
371 | 371 | ||
372 | /****************************************************************************** | 372 | /****************************************************************************** |
@@ -531,7 +531,7 @@ ixgb_hash_mc_addr(struct ixgb_hw *hw, | |||
531 | } | 531 | } |
532 | 532 | ||
533 | hash_value &= 0xFFF; | 533 | hash_value &= 0xFFF; |
534 | return (hash_value); | 534 | return hash_value; |
535 | } | 535 | } |
536 | 536 | ||
537 | /****************************************************************************** | 537 | /****************************************************************************** |
@@ -715,7 +715,7 @@ ixgb_setup_fc(struct ixgb_hw *hw) | |||
715 | } | 715 | } |
716 | IXGB_WRITE_REG(hw, FCRTH, hw->fc.high_water); | 716 | IXGB_WRITE_REG(hw, FCRTH, hw->fc.high_water); |
717 | } | 717 | } |
718 | return (status); | 718 | return status; |
719 | } | 719 | } |
720 | 720 | ||
721 | /****************************************************************************** | 721 | /****************************************************************************** |
@@ -1140,7 +1140,7 @@ mac_addr_valid(u8 *mac_addr) | |||
1140 | pr_debug("MAC address is all zeros\n"); | 1140 | pr_debug("MAC address is all zeros\n"); |
1141 | is_valid = false; | 1141 | is_valid = false; |
1142 | } | 1142 | } |
1143 | return (is_valid); | 1143 | return is_valid; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | /****************************************************************************** | 1146 | /****************************************************************************** |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 25ef8b197373..d4ac94324fa0 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -401,7 +401,7 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, | |||
401 | static u32 ixgbe_get_rx_csum(struct net_device *netdev) | 401 | static u32 ixgbe_get_rx_csum(struct net_device *netdev) |
402 | { | 402 | { |
403 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 403 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
404 | return (adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED); | 404 | return adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED; |
405 | } | 405 | } |
406 | 406 | ||
407 | static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data) | 407 | static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data) |
@@ -988,8 +988,8 @@ static int ixgbe_get_sset_count(struct net_device *netdev, int sset) | |||
988 | case ETH_SS_STATS: | 988 | case ETH_SS_STATS: |
989 | return IXGBE_STATS_LEN; | 989 | return IXGBE_STATS_LEN; |
990 | case ETH_SS_NTUPLE_FILTERS: | 990 | case ETH_SS_NTUPLE_FILTERS: |
991 | return (ETHTOOL_MAX_NTUPLE_LIST_ENTRY * | 991 | return ETHTOOL_MAX_NTUPLE_LIST_ENTRY * |
992 | ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY); | 992 | ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY; |
993 | default: | 993 | default: |
994 | return -EOPNOTSUPP; | 994 | return -EOPNOTSUPP; |
995 | } | 995 | } |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 0ec4ef2d819e..4e0ce91321dd 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -826,7 +826,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
826 | tx_ring->total_packets += total_packets; | 826 | tx_ring->total_packets += total_packets; |
827 | tx_ring->stats.packets += total_packets; | 827 | tx_ring->stats.packets += total_packets; |
828 | tx_ring->stats.bytes += total_bytes; | 828 | tx_ring->stats.bytes += total_bytes; |
829 | return (count < tx_ring->work_limit); | 829 | return count < tx_ring->work_limit; |
830 | } | 830 | } |
831 | 831 | ||
832 | #ifdef CONFIG_IXGBE_DCA | 832 | #ifdef CONFIG_IXGBE_DCA |
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c index 3eda1bdbbb7a..0866a1cf4d7b 100644 --- a/drivers/net/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ixgbevf/ixgbevf_main.c | |||
@@ -311,7 +311,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter, | |||
311 | netdev->stats.tx_bytes += total_bytes; | 311 | netdev->stats.tx_bytes += total_bytes; |
312 | netdev->stats.tx_packets += total_packets; | 312 | netdev->stats.tx_packets += total_packets; |
313 | 313 | ||
314 | return (count < tx_ring->work_limit); | 314 | return count < tx_ring->work_limit; |
315 | } | 315 | } |
316 | 316 | ||
317 | /** | 317 | /** |
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 874ee01e8d9d..8762dcb84e8b 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -494,7 +494,7 @@ static u32 temac_setoptions(struct net_device *ndev, u32 options) | |||
494 | lp->options |= options; | 494 | lp->options |= options; |
495 | mutex_unlock(&lp->indirect_mutex); | 495 | mutex_unlock(&lp->indirect_mutex); |
496 | 496 | ||
497 | return (0); | 497 | return 0; |
498 | } | 498 | } |
499 | 499 | ||
500 | /* Initialize temac */ | 500 | /* Initialize temac */ |
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c index 3df046a58b1d..3698824744cb 100644 --- a/drivers/net/lp486e.c +++ b/drivers/net/lp486e.c | |||
@@ -460,7 +460,7 @@ init_rx_bufs(struct net_device *dev, int num) { | |||
460 | } | 460 | } |
461 | lp->rbd_tail->next = rfd->rbd; | 461 | lp->rbd_tail->next = rfd->rbd; |
462 | #endif | 462 | #endif |
463 | return (i); | 463 | return i; |
464 | } | 464 | } |
465 | 465 | ||
466 | static inline void | 466 | static inline void |
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index 42e3294671d7..60135aa55802 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -461,7 +461,7 @@ static int meth_tx_full(struct net_device *dev) | |||
461 | { | 461 | { |
462 | struct meth_private *priv = netdev_priv(dev); | 462 | struct meth_private *priv = netdev_priv(dev); |
463 | 463 | ||
464 | return (priv->tx_count >= TX_RING_ENTRIES - 1); | 464 | return priv->tx_count >= TX_RING_ENTRIES - 1; |
465 | } | 465 | } |
466 | 466 | ||
467 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) | 467 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) |
diff --git a/drivers/net/mlx4/en_selftest.c b/drivers/net/mlx4/en_selftest.c index 43357d35616a..9c91a92da705 100644 --- a/drivers/net/mlx4/en_selftest.c +++ b/drivers/net/mlx4/en_selftest.c | |||
@@ -107,7 +107,7 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv) | |||
107 | mlx4_en_test_loopback_exit: | 107 | mlx4_en_test_loopback_exit: |
108 | 108 | ||
109 | priv->validate_loopback = 0; | 109 | priv->validate_loopback = 0; |
110 | return (!loopback_ok); | 110 | return !loopback_ok; |
111 | } | 111 | } |
112 | 112 | ||
113 | 113 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 24ab8a43c777..4f3a3c0d6d08 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1555,12 +1555,12 @@ static irqreturn_t myri10ge_intr(int irq, void *arg) | |||
1555 | * valid since MSI-X irqs are not shared */ | 1555 | * valid since MSI-X irqs are not shared */ |
1556 | if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) { | 1556 | if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) { |
1557 | napi_schedule(&ss->napi); | 1557 | napi_schedule(&ss->napi); |
1558 | return (IRQ_HANDLED); | 1558 | return IRQ_HANDLED; |
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | /* make sure it is our IRQ, and that the DMA has finished */ | 1561 | /* make sure it is our IRQ, and that the DMA has finished */ |
1562 | if (unlikely(!stats->valid)) | 1562 | if (unlikely(!stats->valid)) |
1563 | return (IRQ_NONE); | 1563 | return IRQ_NONE; |
1564 | 1564 | ||
1565 | /* low bit indicates receives are present, so schedule | 1565 | /* low bit indicates receives are present, so schedule |
1566 | * napi poll handler */ | 1566 | * napi poll handler */ |
@@ -1599,7 +1599,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg) | |||
1599 | myri10ge_check_statblock(mgp); | 1599 | myri10ge_check_statblock(mgp); |
1600 | 1600 | ||
1601 | put_be32(htonl(3), ss->irq_claim + 1); | 1601 | put_be32(htonl(3), ss->irq_claim + 1); |
1602 | return (IRQ_HANDLED); | 1602 | return IRQ_HANDLED; |
1603 | } | 1603 | } |
1604 | 1604 | ||
1605 | static int | 1605 | static int |
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 617f898ba5f0..4846e131a04e 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -735,7 +735,7 @@ static int myri_header(struct sk_buff *skb, struct net_device *dev, | |||
735 | int i; | 735 | int i; |
736 | for (i = 0; i < dev->addr_len; i++) | 736 | for (i = 0; i < dev->addr_len; i++) |
737 | eth->h_dest[i] = 0; | 737 | eth->h_dest[i] = 0; |
738 | return(dev->hard_header_len); | 738 | return dev->hard_header_len; |
739 | } | 739 | } |
740 | 740 | ||
741 | if (daddr) { | 741 | if (daddr) { |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index cabae7bb1fc6..9b05e7da83de 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -346,7 +346,7 @@ static u32 netxen_decode_crb_addr(u32 addr) | |||
346 | if (pci_base == NETXEN_ADDR_ERROR) | 346 | if (pci_base == NETXEN_ADDR_ERROR) |
347 | return pci_base; | 347 | return pci_base; |
348 | else | 348 | else |
349 | return (pci_base + offset); | 349 | return pci_base + offset; |
350 | } | 350 | } |
351 | 351 | ||
352 | #define NETXEN_MAX_ROM_WAIT_USEC 100 | 352 | #define NETXEN_MAX_ROM_WAIT_USEC 100 |
@@ -1792,7 +1792,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter) | |||
1792 | done = (sw_consumer == hw_consumer); | 1792 | done = (sw_consumer == hw_consumer); |
1793 | spin_unlock(&adapter->tx_clean_lock); | 1793 | spin_unlock(&adapter->tx_clean_lock); |
1794 | 1794 | ||
1795 | return (done); | 1795 | return done; |
1796 | } | 1796 | } |
1797 | 1797 | ||
1798 | void | 1798 | void |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 73d314592230..2c6ceeb592b3 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -177,7 +177,7 @@ netxen_alloc_sds_rings(struct netxen_recv_context *recv_ctx, int count) | |||
177 | 177 | ||
178 | recv_ctx->sds_rings = kzalloc(size, GFP_KERNEL); | 178 | recv_ctx->sds_rings = kzalloc(size, GFP_KERNEL); |
179 | 179 | ||
180 | return (recv_ctx->sds_rings == NULL); | 180 | return recv_ctx->sds_rings == NULL; |
181 | } | 181 | } |
182 | 182 | ||
183 | static void | 183 | static void |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index e36a83845a1c..4cd92421708d 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -283,7 +283,7 @@ static int niu_enable_interrupts(struct niu *np, int on) | |||
283 | 283 | ||
284 | static u32 phy_encode(u32 type, int port) | 284 | static u32 phy_encode(u32 type, int port) |
285 | { | 285 | { |
286 | return (type << (port * 2)); | 286 | return type << (port * 2); |
287 | } | 287 | } |
288 | 288 | ||
289 | static u32 phy_decode(u32 val, int port) | 289 | static u32 phy_decode(u32 val, int port) |
@@ -3043,8 +3043,7 @@ static int tcam_flush_all(struct niu *np) | |||
3043 | 3043 | ||
3044 | static u64 hash_addr_regval(unsigned long index, unsigned long num_entries) | 3044 | static u64 hash_addr_regval(unsigned long index, unsigned long num_entries) |
3045 | { | 3045 | { |
3046 | return ((u64)index | (num_entries == 1 ? | 3046 | return (u64)index | (num_entries == 1 ? HASH_TBL_ADDR_AUTOINC : 0); |
3047 | HASH_TBL_ADDR_AUTOINC : 0)); | ||
3048 | } | 3047 | } |
3049 | 3048 | ||
3050 | #if 0 | 3049 | #if 0 |
@@ -3276,7 +3275,7 @@ static u16 tcam_get_index(struct niu *np, u16 idx) | |||
3276 | /* One entry reserved for IP fragment rule */ | 3275 | /* One entry reserved for IP fragment rule */ |
3277 | if (idx >= (np->clas.tcam_sz - 1)) | 3276 | if (idx >= (np->clas.tcam_sz - 1)) |
3278 | idx = 0; | 3277 | idx = 0; |
3279 | return (np->clas.tcam_top + ((idx+1) * np->parent->num_ports)); | 3278 | return np->clas.tcam_top + ((idx+1) * np->parent->num_ports); |
3280 | } | 3279 | } |
3281 | 3280 | ||
3282 | static u16 tcam_get_size(struct niu *np) | 3281 | static u16 tcam_get_size(struct niu *np) |
@@ -3313,7 +3312,7 @@ static unsigned int niu_hash_rxaddr(struct rx_ring_info *rp, u64 a) | |||
3313 | a >>= PAGE_SHIFT; | 3312 | a >>= PAGE_SHIFT; |
3314 | a ^= (a >> ilog2(MAX_RBR_RING_SIZE)); | 3313 | a ^= (a >> ilog2(MAX_RBR_RING_SIZE)); |
3315 | 3314 | ||
3316 | return (a & (MAX_RBR_RING_SIZE - 1)); | 3315 | return a & (MAX_RBR_RING_SIZE - 1); |
3317 | } | 3316 | } |
3318 | 3317 | ||
3319 | static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr, | 3318 | static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr, |
@@ -7796,11 +7795,11 @@ static int niu_get_sset_count(struct net_device *dev, int stringset) | |||
7796 | if (stringset != ETH_SS_STATS) | 7795 | if (stringset != ETH_SS_STATS) |
7797 | return -EINVAL; | 7796 | return -EINVAL; |
7798 | 7797 | ||
7799 | return ((np->flags & NIU_FLAGS_XMAC ? | 7798 | return (np->flags & NIU_FLAGS_XMAC ? |
7800 | NUM_XMAC_STAT_KEYS : | 7799 | NUM_XMAC_STAT_KEYS : |
7801 | NUM_BMAC_STAT_KEYS) + | 7800 | NUM_BMAC_STAT_KEYS) + |
7802 | (np->num_rx_rings * NUM_RXCHAN_STAT_KEYS) + | 7801 | (np->num_rx_rings * NUM_RXCHAN_STAT_KEYS) + |
7803 | (np->num_tx_rings * NUM_TXCHAN_STAT_KEYS)); | 7802 | (np->num_tx_rings * NUM_TXCHAN_STAT_KEYS); |
7804 | } | 7803 | } |
7805 | 7804 | ||
7806 | static void niu_get_ethtool_stats(struct net_device *dev, | 7805 | static void niu_get_ethtool_stats(struct net_device *dev, |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 89cf63bb8c91..c1d8ce9e4a6c 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -521,7 +521,7 @@ static int mace_read(mace_private *lp, unsigned int ioaddr, int reg) | |||
521 | spin_unlock_irqrestore(&lp->bank_lock, flags); | 521 | spin_unlock_irqrestore(&lp->bank_lock, flags); |
522 | break; | 522 | break; |
523 | } | 523 | } |
524 | return (data & 0xFF); | 524 | return data & 0xFF; |
525 | } /* mace_read */ | 525 | } /* mace_read */ |
526 | 526 | ||
527 | /* ---------------------------------------------------------------------------- | 527 | /* ---------------------------------------------------------------------------- |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 3d1c549b7038..7204a4b5529b 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -815,7 +815,7 @@ static int check_sig(struct pcmcia_device *link) | |||
815 | ((s >> 8) != (s & 0xff))) { | 815 | ((s >> 8) != (s & 0xff))) { |
816 | SMC_SELECT_BANK(3); | 816 | SMC_SELECT_BANK(3); |
817 | s = inw(ioaddr + REVISION); | 817 | s = inw(ioaddr + REVISION); |
818 | return (s & 0xff); | 818 | return s & 0xff; |
819 | } | 819 | } |
820 | 820 | ||
821 | if (width) { | 821 | if (width) { |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index c200c2821730..aee3bb0358bf 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -376,7 +376,7 @@ static void pcnet32_wio_reset(unsigned long addr) | |||
376 | static int pcnet32_wio_check(unsigned long addr) | 376 | static int pcnet32_wio_check(unsigned long addr) |
377 | { | 377 | { |
378 | outw(88, addr + PCNET32_WIO_RAP); | 378 | outw(88, addr + PCNET32_WIO_RAP); |
379 | return (inw(addr + PCNET32_WIO_RAP) == 88); | 379 | return inw(addr + PCNET32_WIO_RAP) == 88; |
380 | } | 380 | } |
381 | 381 | ||
382 | static struct pcnet32_access pcnet32_wio = { | 382 | static struct pcnet32_access pcnet32_wio = { |
@@ -431,7 +431,7 @@ static void pcnet32_dwio_reset(unsigned long addr) | |||
431 | static int pcnet32_dwio_check(unsigned long addr) | 431 | static int pcnet32_dwio_check(unsigned long addr) |
432 | { | 432 | { |
433 | outl(88, addr + PCNET32_DWIO_RAP); | 433 | outl(88, addr + PCNET32_DWIO_RAP); |
434 | return ((inl(addr + PCNET32_DWIO_RAP) & 0xffff) == 88); | 434 | return (inl(addr + PCNET32_DWIO_RAP) & 0xffff) == 88; |
435 | } | 435 | } |
436 | 436 | ||
437 | static struct pcnet32_access pcnet32_dwio = { | 437 | static struct pcnet32_access pcnet32_dwio = { |
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index 43b8d7797f0a..4a624a29393f 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -85,12 +85,12 @@ static const int bitrate_list[] = { | |||
85 | */ | 85 | */ |
86 | static inline int wpa2_capable(void) | 86 | static inline int wpa2_capable(void) |
87 | { | 87 | { |
88 | return (0 <= ps3_compare_firmware_version(2, 0, 0)); | 88 | return 0 <= ps3_compare_firmware_version(2, 0, 0); |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline int precise_ie(void) | 91 | static inline int precise_ie(void) |
92 | { | 92 | { |
93 | return (0 <= ps3_compare_firmware_version(2, 2, 0)); | 93 | return 0 <= ps3_compare_firmware_version(2, 2, 0); |
94 | } | 94 | } |
95 | /* | 95 | /* |
96 | * post_eurus_cmd helpers | 96 | * post_eurus_cmd helpers |
@@ -506,7 +506,7 @@ static size_t gelic_wl_synthesize_ie(u8 *buf, | |||
506 | start[1] = (buf - start - 2); | 506 | start[1] = (buf - start - 2); |
507 | 507 | ||
508 | pr_debug("%s: ->\n", __func__); | 508 | pr_debug("%s: ->\n", __func__); |
509 | return (buf - start); | 509 | return buf - start; |
510 | } | 510 | } |
511 | 511 | ||
512 | struct ie_item { | 512 | struct ie_item { |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 17124f6e0a93..a3d7705a2dda 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -172,7 +172,7 @@ qlcnic_alloc_sds_rings(struct qlcnic_recv_context *recv_ctx, int count) | |||
172 | 172 | ||
173 | recv_ctx->sds_rings = kzalloc(size, GFP_KERNEL); | 173 | recv_ctx->sds_rings = kzalloc(size, GFP_KERNEL); |
174 | 174 | ||
175 | return (recv_ctx->sds_rings == NULL); | 175 | return recv_ctx->sds_rings == NULL; |
176 | } | 176 | } |
177 | 177 | ||
178 | static void | 178 | static void |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 845be71bef63..44f4d58a39a6 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -985,7 +985,7 @@ static inline int efx_rx_queue_index(struct efx_rx_queue *rx_queue) | |||
985 | static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue, | 985 | static inline struct efx_rx_buffer *efx_rx_buffer(struct efx_rx_queue *rx_queue, |
986 | unsigned int index) | 986 | unsigned int index) |
987 | { | 987 | { |
988 | return (&rx_queue->buffer[index]); | 988 | return &rx_queue->buffer[index]; |
989 | } | 989 | } |
990 | 990 | ||
991 | /* Set bit in a little-endian bitfield */ | 991 | /* Set bit in a little-endian bitfield */ |
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index c4de0014441c..394dd929fee7 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c | |||
@@ -104,7 +104,7 @@ static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value, | |||
104 | static inline efx_qword_t *efx_event(struct efx_channel *channel, | 104 | static inline efx_qword_t *efx_event(struct efx_channel *channel, |
105 | unsigned int index) | 105 | unsigned int index) |
106 | { | 106 | { |
107 | return (((efx_qword_t *) (channel->eventq.addr)) + index); | 107 | return ((efx_qword_t *) (channel->eventq.addr)) + index; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* See if an event is present | 110 | /* See if an event is present |
@@ -119,8 +119,8 @@ static inline efx_qword_t *efx_event(struct efx_channel *channel, | |||
119 | */ | 119 | */ |
120 | static inline int efx_event_present(efx_qword_t *event) | 120 | static inline int efx_event_present(efx_qword_t *event) |
121 | { | 121 | { |
122 | return (!(EFX_DWORD_IS_ALL_ONES(event->dword[0]) | | 122 | return !(EFX_DWORD_IS_ALL_ONES(event->dword[0]) | |
123 | EFX_DWORD_IS_ALL_ONES(event->dword[1]))); | 123 | EFX_DWORD_IS_ALL_ONES(event->dword[1])); |
124 | } | 124 | } |
125 | 125 | ||
126 | static bool efx_masked_compare_oword(const efx_oword_t *a, const efx_oword_t *b, | 126 | static bool efx_masked_compare_oword(const efx_oword_t *a, const efx_oword_t *b, |
@@ -347,7 +347,7 @@ void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer) | |||
347 | static inline efx_qword_t * | 347 | static inline efx_qword_t * |
348 | efx_tx_desc(struct efx_tx_queue *tx_queue, unsigned int index) | 348 | efx_tx_desc(struct efx_tx_queue *tx_queue, unsigned int index) |
349 | { | 349 | { |
350 | return (((efx_qword_t *) (tx_queue->txd.addr)) + index); | 350 | return ((efx_qword_t *) (tx_queue->txd.addr)) + index; |
351 | } | 351 | } |
352 | 352 | ||
353 | /* This writes to the TX_DESC_WPTR; write pointer for TX descriptor ring */ | 353 | /* This writes to the TX_DESC_WPTR; write pointer for TX descriptor ring */ |
@@ -502,7 +502,7 @@ void efx_nic_remove_tx(struct efx_tx_queue *tx_queue) | |||
502 | static inline efx_qword_t * | 502 | static inline efx_qword_t * |
503 | efx_rx_desc(struct efx_rx_queue *rx_queue, unsigned int index) | 503 | efx_rx_desc(struct efx_rx_queue *rx_queue, unsigned int index) |
504 | { | 504 | { |
505 | return (((efx_qword_t *) (rx_queue->rxd.addr)) + index); | 505 | return ((efx_qword_t *) (rx_queue->rxd.addr)) + index; |
506 | } | 506 | } |
507 | 507 | ||
508 | /* This creates an entry in the RX descriptor queue */ | 508 | /* This creates an entry in the RX descriptor queue */ |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index ffdd8591d4bc..581836867098 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -832,7 +832,7 @@ static u16 __devinit read_eeprom(long ioaddr, int location) | |||
832 | outl(0, ee_addr); | 832 | outl(0, ee_addr); |
833 | eeprom_delay(); | 833 | eeprom_delay(); |
834 | 834 | ||
835 | return (retval); | 835 | return retval; |
836 | } | 836 | } |
837 | 837 | ||
838 | /* Read and write the MII management registers using software-generated | 838 | /* Read and write the MII management registers using software-generated |
@@ -2247,9 +2247,9 @@ static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision) | |||
2247 | 2247 | ||
2248 | /* leave 8 or 7 most siginifant bits */ | 2248 | /* leave 8 or 7 most siginifant bits */ |
2249 | if ((revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV)) | 2249 | if ((revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV)) |
2250 | return ((int)(crc >> 24)); | 2250 | return (int)(crc >> 24); |
2251 | else | 2251 | else |
2252 | return ((int)(crc >> 25)); | 2252 | return (int)(crc >> 25); |
2253 | } | 2253 | } |
2254 | 2254 | ||
2255 | /** | 2255 | /** |
diff --git a/drivers/net/skfp/cfm.c b/drivers/net/skfp/cfm.c index 5310d39b5737..e395ace3120b 100644 --- a/drivers/net/skfp/cfm.c +++ b/drivers/net/skfp/cfm.c | |||
@@ -542,8 +542,8 @@ static void cfm_fsm(struct s_smc *smc, int cmd) | |||
542 | */ | 542 | */ |
543 | int cfm_get_mac_input(struct s_smc *smc) | 543 | int cfm_get_mac_input(struct s_smc *smc) |
544 | { | 544 | { |
545 | return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || | 545 | return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || |
546 | smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA) ; | 546 | smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA; |
547 | } | 547 | } |
548 | 548 | ||
549 | /* | 549 | /* |
@@ -553,8 +553,8 @@ int cfm_get_mac_input(struct s_smc *smc) | |||
553 | */ | 553 | */ |
554 | int cfm_get_mac_output(struct s_smc *smc) | 554 | int cfm_get_mac_output(struct s_smc *smc) |
555 | { | 555 | { |
556 | return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || | 556 | return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || |
557 | smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA) ; | 557 | smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA; |
558 | } | 558 | } |
559 | 559 | ||
560 | static char path_iso[] = { | 560 | static char path_iso[] = { |
@@ -623,5 +623,5 @@ int cem_build_path(struct s_smc *smc, char *to, int path_index) | |||
623 | 623 | ||
624 | LINT_USE(path_index); | 624 | LINT_USE(path_index); |
625 | 625 | ||
626 | return(len) ; | 626 | return len; |
627 | } | 627 | } |
diff --git a/drivers/net/skfp/drvfbi.c b/drivers/net/skfp/drvfbi.c index c77cc14b3227..07da97c303d6 100644 --- a/drivers/net/skfp/drvfbi.c +++ b/drivers/net/skfp/drvfbi.c | |||
@@ -267,7 +267,7 @@ void timer_irq(struct s_smc *smc) | |||
267 | int pcm_get_s_port(struct s_smc *smc) | 267 | int pcm_get_s_port(struct s_smc *smc) |
268 | { | 268 | { |
269 | SK_UNUSED(smc) ; | 269 | SK_UNUSED(smc) ; |
270 | return(PS) ; | 270 | return PS; |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
@@ -366,7 +366,7 @@ void sm_pm_bypass_req(struct s_smc *smc, int mode) | |||
366 | */ | 366 | */ |
367 | int sm_pm_bypass_present(struct s_smc *smc) | 367 | int sm_pm_bypass_present(struct s_smc *smc) |
368 | { | 368 | { |
369 | return( (inp(ADDR(B0_DAS)) & DAS_BYP_ST) ? TRUE: FALSE) ; | 369 | return (inp(ADDR(B0_DAS)) & DAS_BYP_ST) ? TRUE : FALSE; |
370 | } | 370 | } |
371 | 371 | ||
372 | void plc_clear_irq(struct s_smc *smc, int p) | 372 | void plc_clear_irq(struct s_smc *smc, int p) |
@@ -483,9 +483,9 @@ static int is_equal_num(char comp1[], char comp2[], int num) | |||
483 | 483 | ||
484 | for (i = 0 ; i < num ; i++) { | 484 | for (i = 0 ; i < num ; i++) { |
485 | if (comp1[i] != comp2[i]) | 485 | if (comp1[i] != comp2[i]) |
486 | return (0) ; | 486 | return 0; |
487 | } | 487 | } |
488 | return (1) ; | 488 | return 1; |
489 | } /* is_equal_num */ | 489 | } /* is_equal_num */ |
490 | 490 | ||
491 | 491 | ||
@@ -522,18 +522,18 @@ int set_oi_id_def(struct s_smc *smc) | |||
522 | i++ ; | 522 | i++ ; |
523 | break ; /* entry ok */ | 523 | break ; /* entry ok */ |
524 | default: | 524 | default: |
525 | return (1) ; /* invalid oi_status */ | 525 | return 1; /* invalid oi_status */ |
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | if (i == 0) | 529 | if (i == 0) |
530 | return (2) ; | 530 | return 2; |
531 | if (!act_entries) | 531 | if (!act_entries) |
532 | return (3) ; | 532 | return 3; |
533 | 533 | ||
534 | /* ok, we have a valid OEM data base with an active entry */ | 534 | /* ok, we have a valid OEM data base with an active entry */ |
535 | smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[sel_id] ; | 535 | smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[sel_id] ; |
536 | return (0) ; | 536 | return 0; |
537 | } | 537 | } |
538 | #endif /* MULT_OEM */ | 538 | #endif /* MULT_OEM */ |
539 | 539 | ||
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c index e8387d25f24a..8639a0884f5c 100644 --- a/drivers/net/skfp/ess.c +++ b/drivers/net/skfp/ess.c | |||
@@ -135,7 +135,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
135 | */ | 135 | */ |
136 | if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) { | 136 | if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) { |
137 | DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ; | 137 | DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ; |
138 | return(fs) ; | 138 | return fs; |
139 | } | 139 | } |
140 | msg_res_type = ((struct smt_p_0015 *)p)->res_type ; | 140 | msg_res_type = ((struct smt_p_0015 *)p)->res_type ; |
141 | 141 | ||
@@ -147,7 +147,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
147 | * error in frame: para ESS command was not found | 147 | * error in frame: para ESS command was not found |
148 | */ | 148 | */ |
149 | DB_ESS("ESS: RAF frame error, parameter command not found\n",0,0); | 149 | DB_ESS("ESS: RAF frame error, parameter command not found\n",0,0); |
150 | return(fs) ; | 150 | return fs; |
151 | } | 151 | } |
152 | 152 | ||
153 | DB_ESSN(2,"fc %x ft %x\n",sm->smt_class,sm->smt_type) ; | 153 | DB_ESSN(2,"fc %x ft %x\n",sm->smt_class,sm->smt_type) ; |
@@ -175,12 +175,12 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
175 | * local and no static allocation is used | 175 | * local and no static allocation is used |
176 | */ | 176 | */ |
177 | if (!local || smc->mib.fddiESSPayload) | 177 | if (!local || smc->mib.fddiESSPayload) |
178 | return(fs) ; | 178 | return fs; |
179 | 179 | ||
180 | p = (void *) sm_to_para(smc,sm,SMT_P0019) ; | 180 | p = (void *) sm_to_para(smc,sm,SMT_P0019) ; |
181 | for (i = 0; i < 5; i++) { | 181 | for (i = 0; i < 5; i++) { |
182 | if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) { | 182 | if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) { |
183 | return(fs) ; | 183 | return fs; |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
@@ -199,10 +199,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
199 | sm->smt_dest = smt_sba_da ; | 199 | sm->smt_dest = smt_sba_da ; |
200 | 200 | ||
201 | if (smc->ess.local_sba_active) | 201 | if (smc->ess.local_sba_active) |
202 | return(fs | I_INDICATOR) ; | 202 | return fs | I_INDICATOR; |
203 | 203 | ||
204 | if (!(db = smt_get_mbuf(smc))) | 204 | if (!(db = smt_get_mbuf(smc))) |
205 | return(fs) ; | 205 | return fs; |
206 | 206 | ||
207 | db->sm_len = mb->sm_len ; | 207 | db->sm_len = mb->sm_len ; |
208 | db->sm_off = mb->sm_off ; | 208 | db->sm_off = mb->sm_off ; |
@@ -212,7 +212,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
212 | (struct smt_header *)(db->sm_data+db->sm_off), | 212 | (struct smt_header *)(db->sm_data+db->sm_off), |
213 | "RAF") ; | 213 | "RAF") ; |
214 | smt_send_frame(smc,db,FC_SMT_INFO,0) ; | 214 | smt_send_frame(smc,db,FC_SMT_INFO,0) ; |
215 | return(fs) ; | 215 | return fs; |
216 | } | 216 | } |
217 | 217 | ||
218 | /* | 218 | /* |
@@ -221,7 +221,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
221 | */ | 221 | */ |
222 | if (smt_check_para(smc,sm,plist_raf_alc_res)) { | 222 | if (smt_check_para(smc,sm,plist_raf_alc_res)) { |
223 | DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; | 223 | DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; |
224 | return(fs) ; | 224 | return fs; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* | 227 | /* |
@@ -242,7 +242,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
242 | (sm->smt_tid != smc->ess.alloc_trans_id)) { | 242 | (sm->smt_tid != smc->ess.alloc_trans_id)) { |
243 | 243 | ||
244 | DB_ESS("ESS: Allocation Responce not accepted\n",0,0) ; | 244 | DB_ESS("ESS: Allocation Responce not accepted\n",0,0) ; |
245 | return(fs) ; | 245 | return fs; |
246 | } | 246 | } |
247 | 247 | ||
248 | /* | 248 | /* |
@@ -268,7 +268,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
268 | */ | 268 | */ |
269 | (void)process_bw_alloc(smc,(long)payload,(long)overhead) ; | 269 | (void)process_bw_alloc(smc,(long)payload,(long)overhead) ; |
270 | 270 | ||
271 | return(fs) ; | 271 | return fs; |
272 | /* end of Process Allocation Request */ | 272 | /* end of Process Allocation Request */ |
273 | 273 | ||
274 | /* | 274 | /* |
@@ -280,7 +280,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
280 | */ | 280 | */ |
281 | if (sm->smt_type != SMT_REQUEST) { | 281 | if (sm->smt_type != SMT_REQUEST) { |
282 | DB_ESS("ESS: Do not process Change Responses\n",0,0) ; | 282 | DB_ESS("ESS: Do not process Change Responses\n",0,0) ; |
283 | return(fs) ; | 283 | return fs; |
284 | } | 284 | } |
285 | 285 | ||
286 | /* | 286 | /* |
@@ -288,7 +288,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
288 | */ | 288 | */ |
289 | if (smt_check_para(smc,sm,plist_raf_chg_req)) { | 289 | if (smt_check_para(smc,sm,plist_raf_chg_req)) { |
290 | DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; | 290 | DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; |
291 | return(fs) ; | 291 | return fs; |
292 | } | 292 | } |
293 | 293 | ||
294 | /* | 294 | /* |
@@ -300,7 +300,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
300 | if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index | 300 | if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index |
301 | != PRIMARY_RING) || (msg_res_type != SYNC_BW)) { | 301 | != PRIMARY_RING) || (msg_res_type != SYNC_BW)) { |
302 | DB_ESS("ESS: RAF frame with para problem, ignoring\n",0,0) ; | 302 | DB_ESS("ESS: RAF frame with para problem, ignoring\n",0,0) ; |
303 | return(fs) ; | 303 | return fs; |
304 | } | 304 | } |
305 | 305 | ||
306 | /* | 306 | /* |
@@ -319,14 +319,14 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
319 | * process the bandwidth allocation | 319 | * process the bandwidth allocation |
320 | */ | 320 | */ |
321 | if(!process_bw_alloc(smc,(long)payload,(long)overhead)) | 321 | if(!process_bw_alloc(smc,(long)payload,(long)overhead)) |
322 | return(fs) ; | 322 | return fs; |
323 | 323 | ||
324 | /* | 324 | /* |
325 | * send an RAF Change Reply | 325 | * send an RAF Change Reply |
326 | */ | 326 | */ |
327 | ess_send_response(smc,sm,CHANGE_ALLOCATION) ; | 327 | ess_send_response(smc,sm,CHANGE_ALLOCATION) ; |
328 | 328 | ||
329 | return(fs) ; | 329 | return fs; |
330 | /* end of Process Change Request */ | 330 | /* end of Process Change Request */ |
331 | 331 | ||
332 | /* | 332 | /* |
@@ -338,7 +338,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
338 | */ | 338 | */ |
339 | if (sm->smt_type != SMT_REQUEST) { | 339 | if (sm->smt_type != SMT_REQUEST) { |
340 | DB_ESS("ESS: Do not process a Report Reply\n",0,0) ; | 340 | DB_ESS("ESS: Do not process a Report Reply\n",0,0) ; |
341 | return(fs) ; | 341 | return fs; |
342 | } | 342 | } |
343 | 343 | ||
344 | DB_ESSN(2,"ESS: Report Request from %s\n", | 344 | DB_ESSN(2,"ESS: Report Request from %s\n", |
@@ -349,7 +349,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
349 | */ | 349 | */ |
350 | if (msg_res_type != SYNC_BW) { | 350 | if (msg_res_type != SYNC_BW) { |
351 | DB_ESS("ESS: ignoring RAF with para problem\n",0,0) ; | 351 | DB_ESS("ESS: ignoring RAF with para problem\n",0,0) ; |
352 | return(fs) ; | 352 | return fs; |
353 | } | 353 | } |
354 | 354 | ||
355 | /* | 355 | /* |
@@ -357,7 +357,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
357 | */ | 357 | */ |
358 | ess_send_response(smc,sm,REPORT_ALLOCATION) ; | 358 | ess_send_response(smc,sm,REPORT_ALLOCATION) ; |
359 | 359 | ||
360 | return(fs) ; | 360 | return fs; |
361 | /* end of Process Report Request */ | 361 | /* end of Process Report Request */ |
362 | 362 | ||
363 | default: | 363 | default: |
@@ -368,7 +368,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | |||
368 | break ; | 368 | break ; |
369 | } | 369 | } |
370 | 370 | ||
371 | return(fs) ; | 371 | return fs; |
372 | } | 372 | } |
373 | 373 | ||
374 | /* | 374 | /* |
@@ -418,17 +418,17 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe | |||
418 | */ | 418 | */ |
419 | /* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) { | 419 | /* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) { |
420 | DB_ESS("ESS: SMT does not accept the payload value\n",0,0) ; | 420 | DB_ESS("ESS: SMT does not accept the payload value\n",0,0) ; |
421 | return(FALSE) ; | 421 | return FALSE; |
422 | } | 422 | } |
423 | if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) { | 423 | if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) { |
424 | DB_ESS("ESS: SMT does not accept the overhead value\n",0,0) ; | 424 | DB_ESS("ESS: SMT does not accept the overhead value\n",0,0) ; |
425 | return(FALSE) ; | 425 | return FALSE; |
426 | } */ | 426 | } */ |
427 | 427 | ||
428 | /* premliminary */ | 428 | /* premliminary */ |
429 | if (payload > MAX_PAYLOAD || overhead > 5000) { | 429 | if (payload > MAX_PAYLOAD || overhead > 5000) { |
430 | DB_ESS("ESS: payload / overhead not accepted\n",0,0) ; | 430 | DB_ESS("ESS: payload / overhead not accepted\n",0,0) ; |
431 | return(FALSE) ; | 431 | return FALSE; |
432 | } | 432 | } |
433 | 433 | ||
434 | /* | 434 | /* |
@@ -468,7 +468,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe | |||
468 | 468 | ||
469 | ess_config_fifo(smc) ; | 469 | ess_config_fifo(smc) ; |
470 | set_formac_tsync(smc,smc->ess.sync_bw) ; | 470 | set_formac_tsync(smc,smc->ess.sync_bw) ; |
471 | return(TRUE) ; | 471 | return TRUE; |
472 | } | 472 | } |
473 | 473 | ||
474 | static void ess_send_response(struct s_smc *smc, struct smt_header *sm, | 474 | static void ess_send_response(struct s_smc *smc, struct smt_header *sm, |
diff --git a/drivers/net/skfp/fplustm.c b/drivers/net/skfp/fplustm.c index 9d8d1ac48176..ca4e7bb6a5a8 100644 --- a/drivers/net/skfp/fplustm.c +++ b/drivers/net/skfp/fplustm.c | |||
@@ -112,8 +112,8 @@ static u_long mac_get_tneg(struct s_smc *smc) | |||
112 | u_long tneg ; | 112 | u_long tneg ; |
113 | 113 | ||
114 | tneg = (u_long)((long)inpw(FM_A(FM_TNEG))<<5) ; | 114 | tneg = (u_long)((long)inpw(FM_A(FM_TNEG))<<5) ; |
115 | return((u_long)((tneg + ((inpw(FM_A(FM_TMRS))>>10)&0x1f)) | | 115 | return (u_long)((tneg + ((inpw(FM_A(FM_TMRS))>>10)&0x1f)) | |
116 | 0xffe00000L)) ; | 116 | 0xffe00000L) ; |
117 | } | 117 | } |
118 | 118 | ||
119 | void mac_update_counter(struct s_smc *smc) | 119 | void mac_update_counter(struct s_smc *smc) |
@@ -163,7 +163,7 @@ static u_long read_mdr(struct s_smc *smc, unsigned int addr) | |||
163 | /* is used */ | 163 | /* is used */ |
164 | p = (u_long)inpw(FM_A(FM_MDRU))<<16 ; | 164 | p = (u_long)inpw(FM_A(FM_MDRU))<<16 ; |
165 | p += (u_long)inpw(FM_A(FM_MDRL)) ; | 165 | p += (u_long)inpw(FM_A(FM_MDRL)) ; |
166 | return(p) ; | 166 | return p; |
167 | } | 167 | } |
168 | #endif | 168 | #endif |
169 | 169 | ||
@@ -887,7 +887,7 @@ int init_fplus(struct s_smc *smc) | |||
887 | /* make sure all PCI settings are correct */ | 887 | /* make sure all PCI settings are correct */ |
888 | mac_do_pci_fix(smc) ; | 888 | mac_do_pci_fix(smc) ; |
889 | 889 | ||
890 | return(init_mac(smc,1)) ; | 890 | return init_mac(smc, 1); |
891 | /* enable_formac(smc) ; */ | 891 | /* enable_formac(smc) ; */ |
892 | } | 892 | } |
893 | 893 | ||
@@ -989,7 +989,7 @@ static int init_mac(struct s_smc *smc, int all) | |||
989 | } | 989 | } |
990 | smc->hw.hw_state = STARTED ; | 990 | smc->hw.hw_state = STARTED ; |
991 | 991 | ||
992 | return(0) ; | 992 | return 0; |
993 | } | 993 | } |
994 | 994 | ||
995 | 995 | ||
@@ -1049,7 +1049,7 @@ void sm_ma_control(struct s_smc *smc, int mode) | |||
1049 | 1049 | ||
1050 | int sm_mac_get_tx_state(struct s_smc *smc) | 1050 | int sm_mac_get_tx_state(struct s_smc *smc) |
1051 | { | 1051 | { |
1052 | return((inpw(FM_A(FM_STMCHN))>>4)&7) ; | 1052 | return (inpw(FM_A(FM_STMCHN))>>4) & 7; |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | /* | 1055 | /* |
@@ -1084,9 +1084,9 @@ static struct s_fpmc* mac_get_mc_table(struct s_smc *smc, | |||
1084 | } | 1084 | } |
1085 | if (memcmp((char *)&tb->a,(char *)own,6)) | 1085 | if (memcmp((char *)&tb->a,(char *)own,6)) |
1086 | continue ; | 1086 | continue ; |
1087 | return(tb) ; | 1087 | return tb; |
1088 | } | 1088 | } |
1089 | return(slot) ; /* return first free or NULL */ | 1089 | return slot; /* return first free or NULL */ |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | /* | 1092 | /* |
@@ -1152,12 +1152,12 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can) | |||
1152 | */ | 1152 | */ |
1153 | if (can & 0x80) { | 1153 | if (can & 0x80) { |
1154 | if (smc->hw.fp.smt_slots_used >= SMT_MAX_MULTI) { | 1154 | if (smc->hw.fp.smt_slots_used >= SMT_MAX_MULTI) { |
1155 | return(1) ; | 1155 | return 1; |
1156 | } | 1156 | } |
1157 | } | 1157 | } |
1158 | else { | 1158 | else { |
1159 | if (smc->hw.fp.os_slots_used >= FPMAX_MULTICAST-SMT_MAX_MULTI) { | 1159 | if (smc->hw.fp.os_slots_used >= FPMAX_MULTICAST-SMT_MAX_MULTI) { |
1160 | return(1) ; | 1160 | return 1; |
1161 | } | 1161 | } |
1162 | } | 1162 | } |
1163 | 1163 | ||
@@ -1165,7 +1165,7 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can) | |||
1165 | * find empty slot | 1165 | * find empty slot |
1166 | */ | 1166 | */ |
1167 | if (!(tb = mac_get_mc_table(smc,addr,&own,0,can & ~0x80))) | 1167 | if (!(tb = mac_get_mc_table(smc,addr,&own,0,can & ~0x80))) |
1168 | return(1) ; | 1168 | return 1; |
1169 | tb->n++ ; | 1169 | tb->n++ ; |
1170 | tb->a = own ; | 1170 | tb->a = own ; |
1171 | tb->perm = (can & 0x80) ? 1 : 0 ; | 1171 | tb->perm = (can & 0x80) ? 1 : 0 ; |
@@ -1175,7 +1175,7 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can) | |||
1175 | else | 1175 | else |
1176 | smc->hw.fp.os_slots_used++ ; | 1176 | smc->hw.fp.os_slots_used++ ; |
1177 | 1177 | ||
1178 | return(0) ; | 1178 | return 0; |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | /* | 1181 | /* |
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c index d322f1b702ac..af5a755e269d 100644 --- a/drivers/net/skfp/hwmtm.c +++ b/drivers/net/skfp/hwmtm.c | |||
@@ -232,16 +232,16 @@ u_int mac_drv_check_space(void) | |||
232 | #ifdef COMMON_MB_POOL | 232 | #ifdef COMMON_MB_POOL |
233 | call_count++ ; | 233 | call_count++ ; |
234 | if (call_count == 1) { | 234 | if (call_count == 1) { |
235 | return(EXT_VIRT_MEM) ; | 235 | return EXT_VIRT_MEM; |
236 | } | 236 | } |
237 | else { | 237 | else { |
238 | return(EXT_VIRT_MEM_2) ; | 238 | return EXT_VIRT_MEM_2; |
239 | } | 239 | } |
240 | #else | 240 | #else |
241 | return (EXT_VIRT_MEM) ; | 241 | return EXT_VIRT_MEM; |
242 | #endif | 242 | #endif |
243 | #else | 243 | #else |
244 | return (0) ; | 244 | return 0; |
245 | #endif | 245 | #endif |
246 | } | 246 | } |
247 | 247 | ||
@@ -271,7 +271,7 @@ int mac_drv_init(struct s_smc *smc) | |||
271 | if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *) | 271 | if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *) |
272 | mac_drv_get_desc_mem(smc,(u_int) | 272 | mac_drv_get_desc_mem(smc,(u_int) |
273 | (RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) { | 273 | (RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) { |
274 | return(1) ; /* no space the hwm modul can't work */ | 274 | return 1; /* no space the hwm modul can't work */ |
275 | } | 275 | } |
276 | 276 | ||
277 | /* | 277 | /* |
@@ -283,18 +283,18 @@ int mac_drv_init(struct s_smc *smc) | |||
283 | #ifndef COMMON_MB_POOL | 283 | #ifndef COMMON_MB_POOL |
284 | if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc, | 284 | if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc, |
285 | MAX_MBUF*sizeof(SMbuf)))) { | 285 | MAX_MBUF*sizeof(SMbuf)))) { |
286 | return(1) ; /* no space the hwm modul can't work */ | 286 | return 1; /* no space the hwm modul can't work */ |
287 | } | 287 | } |
288 | #else | 288 | #else |
289 | if (!mb_start) { | 289 | if (!mb_start) { |
290 | if (!(mb_start = (SMbuf *) mac_drv_get_space(smc, | 290 | if (!(mb_start = (SMbuf *) mac_drv_get_space(smc, |
291 | MAX_MBUF*sizeof(SMbuf)))) { | 291 | MAX_MBUF*sizeof(SMbuf)))) { |
292 | return(1) ; /* no space the hwm modul can't work */ | 292 | return 1; /* no space the hwm modul can't work */ |
293 | } | 293 | } |
294 | } | 294 | } |
295 | #endif | 295 | #endif |
296 | #endif | 296 | #endif |
297 | return (0) ; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | /* | 300 | /* |
@@ -349,7 +349,7 @@ static u_long init_descr_ring(struct s_smc *smc, | |||
349 | DRV_BUF_FLUSH(&d1->r,DDI_DMA_SYNC_FORDEV) ; | 349 | DRV_BUF_FLUSH(&d1->r,DDI_DMA_SYNC_FORDEV) ; |
350 | d1++; | 350 | d1++; |
351 | } | 351 | } |
352 | return(phys) ; | 352 | return phys; |
353 | } | 353 | } |
354 | 354 | ||
355 | static void init_txd_ring(struct s_smc *smc) | 355 | static void init_txd_ring(struct s_smc *smc) |
@@ -502,7 +502,7 @@ SMbuf *smt_get_mbuf(struct s_smc *smc) | |||
502 | mb->sm_use_count = 1 ; | 502 | mb->sm_use_count = 1 ; |
503 | } | 503 | } |
504 | DB_GEN("get SMbuf: mb = %x",(void *)mb,0,3) ; | 504 | DB_GEN("get SMbuf: mb = %x",(void *)mb,0,3) ; |
505 | return (mb) ; /* May be NULL */ | 505 | return mb; /* May be NULL */ |
506 | } | 506 | } |
507 | 507 | ||
508 | void smt_free_mbuf(struct s_smc *smc, SMbuf *mb) | 508 | void smt_free_mbuf(struct s_smc *smc, SMbuf *mb) |
@@ -621,7 +621,7 @@ static u_long repair_txd_ring(struct s_smc *smc, struct s_smt_tx_queue *queue) | |||
621 | t = t->txd_next ; | 621 | t = t->txd_next ; |
622 | tx_used-- ; | 622 | tx_used-- ; |
623 | } | 623 | } |
624 | return(phys) ; | 624 | return phys; |
625 | } | 625 | } |
626 | 626 | ||
627 | /* | 627 | /* |
@@ -673,7 +673,7 @@ static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue) | |||
673 | r = r->rxd_next ; | 673 | r = r->rxd_next ; |
674 | rx_used-- ; | 674 | rx_used-- ; |
675 | } | 675 | } |
676 | return(phys) ; | 676 | return phys; |
677 | } | 677 | } |
678 | 678 | ||
679 | 679 | ||
@@ -1595,7 +1595,7 @@ int hwm_tx_init(struct s_smc *smc, u_char fc, int frag_count, int frame_len, | |||
1595 | } | 1595 | } |
1596 | DB_TX("frame_status = %x",frame_status,0,3) ; | 1596 | DB_TX("frame_status = %x",frame_status,0,3) ; |
1597 | NDD_TRACE("THiE",frame_status,smc->os.hwm.tx_p->tx_free,0) ; | 1597 | NDD_TRACE("THiE",frame_status,smc->os.hwm.tx_p->tx_free,0) ; |
1598 | return(frame_status) ; | 1598 | return frame_status; |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | /* | 1601 | /* |
@@ -1764,7 +1764,7 @@ static SMbuf *get_llc_rx(struct s_smc *smc) | |||
1764 | smc->os.hwm.llc_rx_pipe = mb->sm_next ; | 1764 | smc->os.hwm.llc_rx_pipe = mb->sm_next ; |
1765 | } | 1765 | } |
1766 | DB_GEN("get_llc_rx: mb = 0x%x",(void *)mb,0,4) ; | 1766 | DB_GEN("get_llc_rx: mb = 0x%x",(void *)mb,0,4) ; |
1767 | return(mb) ; | 1767 | return mb; |
1768 | } | 1768 | } |
1769 | 1769 | ||
1770 | /* | 1770 | /* |
@@ -1797,7 +1797,7 @@ static SMbuf *get_txd_mb(struct s_smc *smc) | |||
1797 | smc->os.hwm.txd_tx_pipe = mb->sm_next ; | 1797 | smc->os.hwm.txd_tx_pipe = mb->sm_next ; |
1798 | } | 1798 | } |
1799 | DB_GEN("get_txd_mb: mb = 0x%x",(void *)mb,0,4) ; | 1799 | DB_GEN("get_txd_mb: mb = 0x%x",(void *)mb,0,4) ; |
1800 | return(mb) ; | 1800 | return mb; |
1801 | } | 1801 | } |
1802 | 1802 | ||
1803 | /* | 1803 | /* |
diff --git a/drivers/net/skfp/hwt.c b/drivers/net/skfp/hwt.c index 053151468f93..e6baa53307c7 100644 --- a/drivers/net/skfp/hwt.c +++ b/drivers/net/skfp/hwt.c | |||
@@ -179,7 +179,7 @@ u_long hwt_read(struct s_smc *smc) | |||
179 | else | 179 | else |
180 | smc->hw.t_stop = smc->hw.t_start - tr ; | 180 | smc->hw.t_stop = smc->hw.t_start - tr ; |
181 | } | 181 | } |
182 | return (smc->hw.t_stop) ; | 182 | return smc->hw.t_stop; |
183 | } | 183 | } |
184 | 184 | ||
185 | #ifdef PCI | 185 | #ifdef PCI |
@@ -208,7 +208,7 @@ u_long hwt_quick_read(struct s_smc *smc) | |||
208 | outpw(ADDR(B2_TI_CRTL), TIM_START) ; | 208 | outpw(ADDR(B2_TI_CRTL), TIM_START) ; |
209 | outpd(ADDR(B2_TI_INI),interval) ; | 209 | outpd(ADDR(B2_TI_INI),interval) ; |
210 | 210 | ||
211 | return(time) ; | 211 | return time; |
212 | } | 212 | } |
213 | 213 | ||
214 | /************************ | 214 | /************************ |
diff --git a/drivers/net/skfp/pcmplc.c b/drivers/net/skfp/pcmplc.c index ba45bc794d77..112d35b1bf0e 100644 --- a/drivers/net/skfp/pcmplc.c +++ b/drivers/net/skfp/pcmplc.c | |||
@@ -504,7 +504,7 @@ int sm_pm_get_ls(struct s_smc *smc, int phy) | |||
504 | 504 | ||
505 | #ifdef CONCENTRATOR | 505 | #ifdef CONCENTRATOR |
506 | if (!plc_is_installed(smc,phy)) | 506 | if (!plc_is_installed(smc,phy)) |
507 | return(PC_QLS) ; | 507 | return PC_QLS; |
508 | #endif | 508 | #endif |
509 | 509 | ||
510 | state = inpw(PLC(phy,PL_STATUS_A)) & PL_LINE_ST ; | 510 | state = inpw(PLC(phy,PL_STATUS_A)) & PL_LINE_ST ; |
@@ -528,7 +528,7 @@ int sm_pm_get_ls(struct s_smc *smc, int phy) | |||
528 | default : | 528 | default : |
529 | state = PC_LS_NONE ; | 529 | state = PC_LS_NONE ; |
530 | } | 530 | } |
531 | return(state) ; | 531 | return state; |
532 | } | 532 | } |
533 | 533 | ||
534 | static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) | 534 | static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) |
@@ -547,7 +547,7 @@ static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) | |||
547 | #if 0 | 547 | #if 0 |
548 | printf("PL_PCM_SIGNAL is set\n") ; | 548 | printf("PL_PCM_SIGNAL is set\n") ; |
549 | #endif | 549 | #endif |
550 | return(1) ; | 550 | return 1; |
551 | } | 551 | } |
552 | /* write bit[n] & length = 1 to regs */ | 552 | /* write bit[n] & length = 1 to regs */ |
553 | outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ | 553 | outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ |
@@ -562,7 +562,7 @@ static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) | |||
562 | printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; | 562 | printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; |
563 | #endif | 563 | #endif |
564 | #endif | 564 | #endif |
565 | return(0) ; | 565 | return 0; |
566 | } | 566 | } |
567 | 567 | ||
568 | /* | 568 | /* |
@@ -1590,12 +1590,12 @@ int pcm_status_twisted(struct s_smc *smc) | |||
1590 | { | 1590 | { |
1591 | int twist = 0 ; | 1591 | int twist = 0 ; |
1592 | if (smc->s.sas != SMT_DAS) | 1592 | if (smc->s.sas != SMT_DAS) |
1593 | return(0) ; | 1593 | return 0; |
1594 | if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) | 1594 | if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) |
1595 | twist |= 1 ; | 1595 | twist |= 1 ; |
1596 | if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) | 1596 | if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) |
1597 | twist |= 2 ; | 1597 | twist |= 2 ; |
1598 | return(twist) ; | 1598 | return twist; |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | /* | 1601 | /* |
@@ -1636,9 +1636,9 @@ int pcm_rooted_station(struct s_smc *smc) | |||
1636 | for (n = 0 ; n < NUMPHYS ; n++) { | 1636 | for (n = 0 ; n < NUMPHYS ; n++) { |
1637 | if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && | 1637 | if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && |
1638 | smc->y[n].mib->fddiPORTNeighborType == TM) | 1638 | smc->y[n].mib->fddiPORTNeighborType == TM) |
1639 | return(0) ; | 1639 | return 0; |
1640 | } | 1640 | } |
1641 | return(1) ; | 1641 | return 1; |
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | /* | 1644 | /* |
@@ -1915,7 +1915,7 @@ int get_pcm_state(struct s_smc *smc, int np) | |||
1915 | case PL_PC9 : pcs = PC_MAINT ; break ; | 1915 | case PL_PC9 : pcs = PC_MAINT ; break ; |
1916 | default : pcs = PC_DISABLE ; break ; | 1916 | default : pcs = PC_DISABLE ; break ; |
1917 | } | 1917 | } |
1918 | return(pcs) ; | 1918 | return pcs; |
1919 | } | 1919 | } |
1920 | 1920 | ||
1921 | char *get_linestate(struct s_smc *smc, int np) | 1921 | char *get_linestate(struct s_smc *smc, int np) |
@@ -1937,7 +1937,7 @@ char *get_linestate(struct s_smc *smc, int np) | |||
1937 | default: ls = "unknown" ; break ; | 1937 | default: ls = "unknown" ; break ; |
1938 | #endif | 1938 | #endif |
1939 | } | 1939 | } |
1940 | return(ls) ; | 1940 | return ls; |
1941 | } | 1941 | } |
1942 | 1942 | ||
1943 | char *get_pcmstate(struct s_smc *smc, int np) | 1943 | char *get_pcmstate(struct s_smc *smc, int np) |
@@ -1959,7 +1959,7 @@ char *get_pcmstate(struct s_smc *smc, int np) | |||
1959 | case PL_PC9 : pcs = "MAINT" ; break ; | 1959 | case PL_PC9 : pcs = "MAINT" ; break ; |
1960 | default : pcs = "UNKNOWN" ; break ; | 1960 | default : pcs = "UNKNOWN" ; break ; |
1961 | } | 1961 | } |
1962 | return(pcs) ; | 1962 | return pcs; |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | void list_phy(struct s_smc *smc) | 1965 | void list_phy(struct s_smc *smc) |
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c index a320fdb3727d..9ac4665d7411 100644 --- a/drivers/net/skfp/pmf.c +++ b/drivers/net/skfp/pmf.c | |||
@@ -328,7 +328,7 @@ static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req, | |||
328 | * build SMT header | 328 | * build SMT header |
329 | */ | 329 | */ |
330 | if (!(mb = smt_get_mbuf(smc))) | 330 | if (!(mb = smt_get_mbuf(smc))) |
331 | return(mb) ; | 331 | return mb; |
332 | 332 | ||
333 | smt = smtod(mb, struct smt_header *) ; | 333 | smt = smtod(mb, struct smt_header *) ; |
334 | smt->smt_dest = req->smt_source ; /* DA == source of request */ | 334 | smt->smt_dest = req->smt_source ; /* DA == source of request */ |
@@ -493,7 +493,7 @@ static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req, | |||
493 | smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ; | 493 | smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ; |
494 | smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ; | 494 | smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ; |
495 | } | 495 | } |
496 | return(mb) ; | 496 | return mb; |
497 | } | 497 | } |
498 | 498 | ||
499 | static int smt_authorize(struct s_smc *smc, struct smt_header *sm) | 499 | static int smt_authorize(struct s_smc *smc, struct smt_header *sm) |
@@ -511,7 +511,7 @@ static int smt_authorize(struct s_smc *smc, struct smt_header *sm) | |||
511 | if (i != 8) { | 511 | if (i != 8) { |
512 | if (memcmp((char *) &sm->smt_sid, | 512 | if (memcmp((char *) &sm->smt_sid, |
513 | (char *) &smc->mib.fddiPRPMFStation,8)) | 513 | (char *) &smc->mib.fddiPRPMFStation,8)) |
514 | return(1) ; | 514 | return 1; |
515 | } | 515 | } |
516 | /* | 516 | /* |
517 | * check authoriziation parameter if passwd not zero | 517 | * check authoriziation parameter if passwd not zero |
@@ -522,13 +522,13 @@ static int smt_authorize(struct s_smc *smc, struct smt_header *sm) | |||
522 | if (i != 8) { | 522 | if (i != 8) { |
523 | pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ; | 523 | pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ; |
524 | if (!pa) | 524 | if (!pa) |
525 | return(1) ; | 525 | return 1; |
526 | if (pa->p_len != 8) | 526 | if (pa->p_len != 8) |
527 | return(1) ; | 527 | return 1; |
528 | if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8)) | 528 | if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8)) |
529 | return(1) ; | 529 | return 1; |
530 | } | 530 | } |
531 | return(0) ; | 531 | return 0; |
532 | } | 532 | } |
533 | 533 | ||
534 | static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm) | 534 | static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm) |
@@ -542,9 +542,9 @@ static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm) | |||
542 | if ((smc->mib.fddiSMTSetCount.count != sc->count) || | 542 | if ((smc->mib.fddiSMTSetCount.count != sc->count) || |
543 | memcmp((char *) smc->mib.fddiSMTSetCount.timestamp, | 543 | memcmp((char *) smc->mib.fddiSMTSetCount.timestamp, |
544 | (char *)sc->timestamp,8)) | 544 | (char *)sc->timestamp,8)) |
545 | return(1) ; | 545 | return 1; |
546 | } | 546 | } |
547 | return(0) ; | 547 | return 0; |
548 | } | 548 | } |
549 | 549 | ||
550 | void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, | 550 | void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, |
@@ -1109,7 +1109,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, | |||
1109 | break ; | 1109 | break ; |
1110 | case 0x2000 : | 1110 | case 0x2000 : |
1111 | if (mac < 0 || mac >= NUMMACS) { | 1111 | if (mac < 0 || mac >= NUMMACS) { |
1112 | return(SMT_RDF_NOPARAM) ; | 1112 | return SMT_RDF_NOPARAM; |
1113 | } | 1113 | } |
1114 | mib_m = &smc->mib.m[mac] ; | 1114 | mib_m = &smc->mib.m[mac] ; |
1115 | mib_addr = (char *) mib_m ; | 1115 | mib_addr = (char *) mib_m ; |
@@ -1118,7 +1118,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, | |||
1118 | break ; | 1118 | break ; |
1119 | case 0x3000 : | 1119 | case 0x3000 : |
1120 | if (path < 0 || path >= NUMPATHS) { | 1120 | if (path < 0 || path >= NUMPATHS) { |
1121 | return(SMT_RDF_NOPARAM) ; | 1121 | return SMT_RDF_NOPARAM; |
1122 | } | 1122 | } |
1123 | mib_a = &smc->mib.a[path] ; | 1123 | mib_a = &smc->mib.a[path] ; |
1124 | mib_addr = (char *) mib_a ; | 1124 | mib_addr = (char *) mib_a ; |
@@ -1127,7 +1127,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, | |||
1127 | break ; | 1127 | break ; |
1128 | case 0x4000 : | 1128 | case 0x4000 : |
1129 | if (port < 0 || port >= smt_mib_phys(smc)) { | 1129 | if (port < 0 || port >= smt_mib_phys(smc)) { |
1130 | return(SMT_RDF_NOPARAM) ; | 1130 | return SMT_RDF_NOPARAM; |
1131 | } | 1131 | } |
1132 | mib_p = &smc->mib.p[port_to_mib(smc,port)] ; | 1132 | mib_p = &smc->mib.p[port_to_mib(smc,port)] ; |
1133 | mib_addr = (char *) mib_p ; | 1133 | mib_addr = (char *) mib_p ; |
@@ -1151,22 +1151,20 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, | |||
1151 | case SMT_P10F9 : | 1151 | case SMT_P10F9 : |
1152 | #endif | 1152 | #endif |
1153 | case SMT_P20F1 : | 1153 | case SMT_P20F1 : |
1154 | if (!local) { | 1154 | if (!local) |
1155 | return(SMT_RDF_NOPARAM) ; | 1155 | return SMT_RDF_NOPARAM; |
1156 | } | ||
1157 | break ; | 1156 | break ; |
1158 | } | 1157 | } |
1159 | pt = smt_get_ptab(pa->p_type) ; | 1158 | pt = smt_get_ptab(pa->p_type) ; |
1160 | if (!pt) { | 1159 | if (!pt) |
1161 | return( (pa->p_type & 0xff00) ? SMT_RDF_NOPARAM : | 1160 | return (pa->p_type & 0xff00) ? SMT_RDF_NOPARAM : |
1162 | SMT_RDF_ILLEGAL ) ; | 1161 | SMT_RDF_ILLEGAL; |
1163 | } | ||
1164 | switch (pt->p_access) { | 1162 | switch (pt->p_access) { |
1165 | case AC_GR : | 1163 | case AC_GR : |
1166 | case AC_S : | 1164 | case AC_S : |
1167 | break ; | 1165 | break ; |
1168 | default : | 1166 | default : |
1169 | return(SMT_RDF_ILLEGAL) ; | 1167 | return SMT_RDF_ILLEGAL; |
1170 | } | 1168 | } |
1171 | to = mib_addr + pt->p_offset ; | 1169 | to = mib_addr + pt->p_offset ; |
1172 | swap = pt->p_swap ; /* pointer to swap string */ | 1170 | swap = pt->p_swap ; /* pointer to swap string */ |
@@ -1292,7 +1290,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, | |||
1292 | break ; | 1290 | break ; |
1293 | default : | 1291 | default : |
1294 | SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ; | 1292 | SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ; |
1295 | return(SMT_RDF_ILLEGAL) ; | 1293 | return SMT_RDF_ILLEGAL; |
1296 | } | 1294 | } |
1297 | } | 1295 | } |
1298 | /* | 1296 | /* |
@@ -1501,15 +1499,15 @@ change_mac_para: | |||
1501 | default : | 1499 | default : |
1502 | break ; | 1500 | break ; |
1503 | } | 1501 | } |
1504 | return(0) ; | 1502 | return 0; |
1505 | 1503 | ||
1506 | val_error: | 1504 | val_error: |
1507 | /* parameter value in frame is out of range */ | 1505 | /* parameter value in frame is out of range */ |
1508 | return(SMT_RDF_RANGE) ; | 1506 | return SMT_RDF_RANGE; |
1509 | 1507 | ||
1510 | len_error: | 1508 | len_error: |
1511 | /* parameter value in frame is too short */ | 1509 | /* parameter value in frame is too short */ |
1512 | return(SMT_RDF_LENGTH) ; | 1510 | return SMT_RDF_LENGTH; |
1513 | 1511 | ||
1514 | #if 0 | 1512 | #if 0 |
1515 | no_author_error: | 1513 | no_author_error: |
@@ -1518,7 +1516,7 @@ no_author_error: | |||
1518 | * because SBA denied is not a valid return code in the | 1516 | * because SBA denied is not a valid return code in the |
1519 | * PMF protocol. | 1517 | * PMF protocol. |
1520 | */ | 1518 | */ |
1521 | return(SMT_RDF_AUTHOR) ; | 1519 | return SMT_RDF_AUTHOR; |
1522 | #endif | 1520 | #endif |
1523 | } | 1521 | } |
1524 | 1522 | ||
@@ -1527,7 +1525,7 @@ static const struct s_p_tab *smt_get_ptab(u_short para) | |||
1527 | const struct s_p_tab *pt ; | 1525 | const struct s_p_tab *pt ; |
1528 | for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++) | 1526 | for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++) |
1529 | ; | 1527 | ; |
1530 | return(pt->p_num ? pt : NULL) ; | 1528 | return pt->p_num ? pt : NULL; |
1531 | } | 1529 | } |
1532 | 1530 | ||
1533 | static int smt_mib_phys(struct s_smc *smc) | 1531 | static int smt_mib_phys(struct s_smc *smc) |
@@ -1535,11 +1533,11 @@ static int smt_mib_phys(struct s_smc *smc) | |||
1535 | #ifdef CONCENTRATOR | 1533 | #ifdef CONCENTRATOR |
1536 | SK_UNUSED(smc) ; | 1534 | SK_UNUSED(smc) ; |
1537 | 1535 | ||
1538 | return(NUMPHYS) ; | 1536 | return NUMPHYS; |
1539 | #else | 1537 | #else |
1540 | if (smc->s.sas == SMT_SAS) | 1538 | if (smc->s.sas == SMT_SAS) |
1541 | return(1) ; | 1539 | return 1; |
1542 | return(NUMPHYS) ; | 1540 | return NUMPHYS; |
1543 | #endif | 1541 | #endif |
1544 | } | 1542 | } |
1545 | 1543 | ||
@@ -1548,11 +1546,11 @@ static int port_to_mib(struct s_smc *smc, int p) | |||
1548 | #ifdef CONCENTRATOR | 1546 | #ifdef CONCENTRATOR |
1549 | SK_UNUSED(smc) ; | 1547 | SK_UNUSED(smc) ; |
1550 | 1548 | ||
1551 | return(p) ; | 1549 | return p; |
1552 | #else | 1550 | #else |
1553 | if (smc->s.sas == SMT_SAS) | 1551 | if (smc->s.sas == SMT_SAS) |
1554 | return(PS) ; | 1552 | return PS; |
1555 | return(p) ; | 1553 | return p; |
1556 | #endif | 1554 | #endif |
1557 | } | 1555 | } |
1558 | 1556 | ||
diff --git a/drivers/net/skfp/queue.c b/drivers/net/skfp/queue.c index 09adb3d68b7c..c1a0df455a59 100644 --- a/drivers/net/skfp/queue.c +++ b/drivers/net/skfp/queue.c | |||
@@ -128,7 +128,7 @@ u_short smt_online(struct s_smc *smc, int on) | |||
128 | { | 128 | { |
129 | queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ; | 129 | queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ; |
130 | ev_dispatcher(smc) ; | 130 | ev_dispatcher(smc) ; |
131 | return(smc->mib.fddiSMTCF_State) ; | 131 | return smc->mib.fddiSMTCF_State; |
132 | } | 132 | } |
133 | 133 | ||
134 | /* | 134 | /* |
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 8a12bd9d28ba..ba2e8339fe90 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c | |||
@@ -440,7 +440,7 @@ static int skfp_driver_init(struct net_device *dev) | |||
440 | 440 | ||
441 | smt_reset_defaults(smc, 0); | 441 | smt_reset_defaults(smc, 0); |
442 | 442 | ||
443 | return (0); | 443 | return 0; |
444 | 444 | ||
445 | fail: | 445 | fail: |
446 | if (bp->SharedMemAddr) { | 446 | if (bp->SharedMemAddr) { |
@@ -516,7 +516,7 @@ static int skfp_open(struct net_device *dev) | |||
516 | mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); | 516 | mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); |
517 | 517 | ||
518 | netif_start_queue(dev); | 518 | netif_start_queue(dev); |
519 | return (0); | 519 | return 0; |
520 | } // skfp_open | 520 | } // skfp_open |
521 | 521 | ||
522 | 522 | ||
@@ -565,7 +565,7 @@ static int skfp_close(struct net_device *dev) | |||
565 | skb_queue_purge(&bp->SendSkbQueue); | 565 | skb_queue_purge(&bp->SendSkbQueue); |
566 | bp->QueueSkb = MAX_TX_QUEUE_LEN; | 566 | bp->QueueSkb = MAX_TX_QUEUE_LEN; |
567 | 567 | ||
568 | return (0); | 568 | return 0; |
569 | } // skfp_close | 569 | } // skfp_close |
570 | 570 | ||
571 | 571 | ||
@@ -794,7 +794,7 @@ static struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev) | |||
794 | bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; | 794 | bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; |
795 | 795 | ||
796 | #endif | 796 | #endif |
797 | return ((struct net_device_stats *) &bp->os.MacStat); | 797 | return (struct net_device_stats *)&bp->os.MacStat; |
798 | } // ctl_get_stat | 798 | } // ctl_get_stat |
799 | 799 | ||
800 | 800 | ||
@@ -932,7 +932,7 @@ static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr) | |||
932 | ResetAdapter(smc); | 932 | ResetAdapter(smc); |
933 | spin_unlock_irqrestore(&bp->DriverLock, Flags); | 933 | spin_unlock_irqrestore(&bp->DriverLock, Flags); |
934 | 934 | ||
935 | return (0); /* always return zero */ | 935 | return 0; /* always return zero */ |
936 | } // skfp_ctl_set_mac_address | 936 | } // skfp_ctl_set_mac_address |
937 | 937 | ||
938 | 938 | ||
@@ -1313,7 +1313,7 @@ void *mac_drv_get_space(struct s_smc *smc, unsigned int size) | |||
1313 | 1313 | ||
1314 | if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { | 1314 | if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { |
1315 | printk("Unexpected SMT memory size requested: %d\n", size); | 1315 | printk("Unexpected SMT memory size requested: %d\n", size); |
1316 | return (NULL); | 1316 | return NULL; |
1317 | } | 1317 | } |
1318 | smc->os.SharedMemHeap += size; // Move heap pointer. | 1318 | smc->os.SharedMemHeap += size; // Move heap pointer. |
1319 | 1319 | ||
@@ -1322,7 +1322,7 @@ void *mac_drv_get_space(struct s_smc *smc, unsigned int size) | |||
1322 | pr_debug("bus addr: %lx\n", (ulong) | 1322 | pr_debug("bus addr: %lx\n", (ulong) |
1323 | (smc->os.SharedMemDMA + | 1323 | (smc->os.SharedMemDMA + |
1324 | ((char *) virt - (char *)smc->os.SharedMemAddr))); | 1324 | ((char *) virt - (char *)smc->os.SharedMemAddr))); |
1325 | return (virt); | 1325 | return virt; |
1326 | } // mac_drv_get_space | 1326 | } // mac_drv_get_space |
1327 | 1327 | ||
1328 | 1328 | ||
@@ -1363,9 +1363,9 @@ void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size) | |||
1363 | 1363 | ||
1364 | if (!mac_drv_get_space(smc, size)) { | 1364 | if (!mac_drv_get_space(smc, size)) { |
1365 | printk("fddi: Unable to align descriptor memory.\n"); | 1365 | printk("fddi: Unable to align descriptor memory.\n"); |
1366 | return (NULL); | 1366 | return NULL; |
1367 | } | 1367 | } |
1368 | return (virt + size); | 1368 | return virt + size; |
1369 | } // mac_drv_get_desc_mem | 1369 | } // mac_drv_get_desc_mem |
1370 | 1370 | ||
1371 | 1371 | ||
@@ -1384,8 +1384,8 @@ void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size) | |||
1384 | ************************/ | 1384 | ************************/ |
1385 | unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt) | 1385 | unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt) |
1386 | { | 1386 | { |
1387 | return (smc->os.SharedMemDMA + | 1387 | return smc->os.SharedMemDMA + |
1388 | ((char *) virt - (char *)smc->os.SharedMemAddr)); | 1388 | ((char *) virt - (char *)smc->os.SharedMemAddr); |
1389 | } // mac_drv_virt2phys | 1389 | } // mac_drv_virt2phys |
1390 | 1390 | ||
1391 | 1391 | ||
@@ -1419,8 +1419,8 @@ unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt) | |||
1419 | ************************/ | 1419 | ************************/ |
1420 | u_long dma_master(struct s_smc * smc, void *virt, int len, int flag) | 1420 | u_long dma_master(struct s_smc * smc, void *virt, int len, int flag) |
1421 | { | 1421 | { |
1422 | return (smc->os.SharedMemDMA + | 1422 | return smc->os.SharedMemDMA + |
1423 | ((char *) virt - (char *)smc->os.SharedMemAddr)); | 1423 | ((char *) virt - (char *)smc->os.SharedMemAddr); |
1424 | } // dma_master | 1424 | } // dma_master |
1425 | 1425 | ||
1426 | 1426 | ||
@@ -1904,12 +1904,12 @@ int mac_drv_rx_init(struct s_smc *smc, int len, int fc, | |||
1904 | pr_debug("fddi: Discard invalid local SMT frame\n"); | 1904 | pr_debug("fddi: Discard invalid local SMT frame\n"); |
1905 | pr_debug(" len=%d, la_len=%d, (ULONG) look_ahead=%08lXh.\n", | 1905 | pr_debug(" len=%d, la_len=%d, (ULONG) look_ahead=%08lXh.\n", |
1906 | len, la_len, (unsigned long) look_ahead); | 1906 | len, la_len, (unsigned long) look_ahead); |
1907 | return (0); | 1907 | return 0; |
1908 | } | 1908 | } |
1909 | skb = alloc_skb(len + 3, GFP_ATOMIC); | 1909 | skb = alloc_skb(len + 3, GFP_ATOMIC); |
1910 | if (!skb) { | 1910 | if (!skb) { |
1911 | pr_debug("fddi: Local SMT: skb memory exhausted.\n"); | 1911 | pr_debug("fddi: Local SMT: skb memory exhausted.\n"); |
1912 | return (0); | 1912 | return 0; |
1913 | } | 1913 | } |
1914 | skb_reserve(skb, 3); | 1914 | skb_reserve(skb, 3); |
1915 | skb_put(skb, len); | 1915 | skb_put(skb, len); |
@@ -1919,7 +1919,7 @@ int mac_drv_rx_init(struct s_smc *smc, int len, int fc, | |||
1919 | skb->protocol = fddi_type_trans(skb, smc->os.dev); | 1919 | skb->protocol = fddi_type_trans(skb, smc->os.dev); |
1920 | netif_rx(skb); | 1920 | netif_rx(skb); |
1921 | 1921 | ||
1922 | return (0); | 1922 | return 0; |
1923 | } // mac_drv_rx_init | 1923 | } // mac_drv_rx_init |
1924 | 1924 | ||
1925 | 1925 | ||
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c index 6f35bb77595f..2d9941c045bc 100644 --- a/drivers/net/skfp/smt.c +++ b/drivers/net/skfp/smt.c | |||
@@ -127,22 +127,22 @@ static inline int is_my_addr(const struct s_smc *smc, | |||
127 | 127 | ||
128 | static inline int is_broadcast(const struct fddi_addr *addr) | 128 | static inline int is_broadcast(const struct fddi_addr *addr) |
129 | { | 129 | { |
130 | return(*(u_short *)(&addr->a[0]) == 0xffff && | 130 | return *(u_short *)(&addr->a[0]) == 0xffff && |
131 | *(u_short *)(&addr->a[2]) == 0xffff && | 131 | *(u_short *)(&addr->a[2]) == 0xffff && |
132 | *(u_short *)(&addr->a[4]) == 0xffff ) ; | 132 | *(u_short *)(&addr->a[4]) == 0xffff; |
133 | } | 133 | } |
134 | 134 | ||
135 | static inline int is_individual(const struct fddi_addr *addr) | 135 | static inline int is_individual(const struct fddi_addr *addr) |
136 | { | 136 | { |
137 | return(!(addr->a[0] & GROUP_ADDR)) ; | 137 | return !(addr->a[0] & GROUP_ADDR); |
138 | } | 138 | } |
139 | 139 | ||
140 | static inline int is_equal(const struct fddi_addr *addr1, | 140 | static inline int is_equal(const struct fddi_addr *addr1, |
141 | const struct fddi_addr *addr2) | 141 | const struct fddi_addr *addr2) |
142 | { | 142 | { |
143 | return(*(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) && | 143 | return *(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) && |
144 | *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) && | 144 | *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) && |
145 | *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]) ) ; | 145 | *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]); |
146 | } | 146 | } |
147 | 147 | ||
148 | /* | 148 | /* |
@@ -457,8 +457,8 @@ static int div_ratio(u_long upper, u_long lower) | |||
457 | else | 457 | else |
458 | upper <<= 16L ; | 458 | upper <<= 16L ; |
459 | if (!lower) | 459 | if (!lower) |
460 | return(0) ; | 460 | return 0; |
461 | return((int)(upper/lower)) ; | 461 | return (int)(upper/lower) ; |
462 | } | 462 | } |
463 | 463 | ||
464 | #ifndef SLIM_SMT | 464 | #ifndef SLIM_SMT |
@@ -1111,11 +1111,11 @@ SMbuf *smt_build_frame(struct s_smc *smc, int class, int type, | |||
1111 | 1111 | ||
1112 | #if 0 | 1112 | #if 0 |
1113 | if (!smc->r.sm_ma_avail) { | 1113 | if (!smc->r.sm_ma_avail) { |
1114 | return(0) ; | 1114 | return 0; |
1115 | } | 1115 | } |
1116 | #endif | 1116 | #endif |
1117 | if (!(mb = smt_get_mbuf(smc))) | 1117 | if (!(mb = smt_get_mbuf(smc))) |
1118 | return(mb) ; | 1118 | return mb; |
1119 | 1119 | ||
1120 | mb->sm_len = length ; | 1120 | mb->sm_len = length ; |
1121 | smt = smtod(mb, struct smt_header *) ; | 1121 | smt = smtod(mb, struct smt_header *) ; |
@@ -1136,7 +1136,7 @@ SMbuf *smt_build_frame(struct s_smc *smc, int class, int type, | |||
1136 | smt->smt_tid = smt_get_tid(smc) ; /* set transaction ID */ | 1136 | smt->smt_tid = smt_get_tid(smc) ; /* set transaction ID */ |
1137 | smt->smt_pad = 0 ; | 1137 | smt->smt_pad = 0 ; |
1138 | smt->smt_len = length - sizeof(struct smt_header) ; | 1138 | smt->smt_len = length - sizeof(struct smt_header) ; |
1139 | return(mb) ; | 1139 | return mb; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static void smt_add_frame_len(SMbuf *mb, int len) | 1142 | static void smt_add_frame_len(SMbuf *mb, int len) |
@@ -1375,7 +1375,7 @@ static int smt_fill_path(struct s_smc *smc, struct smt_p_path *path) | |||
1375 | pd_mac = (struct smt_mac_rec *) phy ; | 1375 | pd_mac = (struct smt_mac_rec *) phy ; |
1376 | pd_mac->mac_addr = smc->mib.m[MAC0].fddiMACSMTAddress ; | 1376 | pd_mac->mac_addr = smc->mib.m[MAC0].fddiMACSMTAddress ; |
1377 | pd_mac->mac_resource_idx = mac_con_resource_index(smc,1) ; | 1377 | pd_mac->mac_resource_idx = mac_con_resource_index(smc,1) ; |
1378 | return(len) ; | 1378 | return len; |
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | /* | 1381 | /* |
@@ -1563,7 +1563,7 @@ u_long smt_get_tid(struct s_smc *smc) | |||
1563 | u_long tid ; | 1563 | u_long tid ; |
1564 | while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0) | 1564 | while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0) |
1565 | ; | 1565 | ; |
1566 | return(tid & 0x3fffffffL) ; | 1566 | return tid & 0x3fffffffL; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | 1569 | ||
@@ -1654,11 +1654,11 @@ int smt_check_para(struct s_smc *smc, struct smt_header *sm, | |||
1654 | while (*p) { | 1654 | while (*p) { |
1655 | if (!sm_to_para(smc,sm,(int) *p)) { | 1655 | if (!sm_to_para(smc,sm,(int) *p)) { |
1656 | DB_SMT("SMT: smt_check_para - missing para %x\n",*p,0); | 1656 | DB_SMT("SMT: smt_check_para - missing para %x\n",*p,0); |
1657 | return(-1) ; | 1657 | return -1; |
1658 | } | 1658 | } |
1659 | p++ ; | 1659 | p++ ; |
1660 | } | 1660 | } |
1661 | return(0) ; | 1661 | return 0; |
1662 | } | 1662 | } |
1663 | 1663 | ||
1664 | void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para) | 1664 | void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para) |
@@ -1687,7 +1687,7 @@ void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para) | |||
1687 | return NULL; | 1687 | return NULL; |
1688 | } | 1688 | } |
1689 | if (found) | 1689 | if (found) |
1690 | return(found) ; | 1690 | return found; |
1691 | } | 1691 | } |
1692 | return NULL; | 1692 | return NULL; |
1693 | } | 1693 | } |
@@ -1732,7 +1732,7 @@ char *addr_to_string(struct fddi_addr *addr) | |||
1732 | string[i * 3 + 2] = ':'; | 1732 | string[i * 3 + 2] = ':'; |
1733 | } | 1733 | } |
1734 | string[5 * 3 + 2] = 0; | 1734 | string[5 * 3 + 2] = 0; |
1735 | return(string); | 1735 | return string; |
1736 | } | 1736 | } |
1737 | #endif | 1737 | #endif |
1738 | 1738 | ||
@@ -1742,9 +1742,9 @@ int smt_ifconfig(int argc, char *argv[]) | |||
1742 | if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && | 1742 | if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && |
1743 | !strcmp(argv[1],"yes")) { | 1743 | !strcmp(argv[1],"yes")) { |
1744 | smc->mib.fddiSMTBypassPresent = 1 ; | 1744 | smc->mib.fddiSMTBypassPresent = 1 ; |
1745 | return(0) ; | 1745 | return 0; |
1746 | } | 1746 | } |
1747 | return(amdfddi_config(0,argc,argv)) ; | 1747 | return amdfddi_config(0, argc, argv); |
1748 | } | 1748 | } |
1749 | #endif | 1749 | #endif |
1750 | 1750 | ||
@@ -1756,9 +1756,9 @@ static int mac_index(struct s_smc *smc, int mac) | |||
1756 | SK_UNUSED(mac) ; | 1756 | SK_UNUSED(mac) ; |
1757 | #ifdef CONCENTRATOR | 1757 | #ifdef CONCENTRATOR |
1758 | SK_UNUSED(smc) ; | 1758 | SK_UNUSED(smc) ; |
1759 | return(NUMPHYS+1) ; | 1759 | return NUMPHYS + 1; |
1760 | #else | 1760 | #else |
1761 | return((smc->s.sas == SMT_SAS) ? 2 : 3) ; | 1761 | return (smc->s.sas == SMT_SAS) ? 2 : 3; |
1762 | #endif | 1762 | #endif |
1763 | } | 1763 | } |
1764 | 1764 | ||
@@ -1768,7 +1768,7 @@ static int mac_index(struct s_smc *smc, int mac) | |||
1768 | static int phy_index(struct s_smc *smc, int phy) | 1768 | static int phy_index(struct s_smc *smc, int phy) |
1769 | { | 1769 | { |
1770 | SK_UNUSED(smc) ; | 1770 | SK_UNUSED(smc) ; |
1771 | return(phy+1); | 1771 | return phy + 1; |
1772 | } | 1772 | } |
1773 | 1773 | ||
1774 | /* | 1774 | /* |
@@ -1779,19 +1779,19 @@ static int mac_con_resource_index(struct s_smc *smc, int mac) | |||
1779 | #ifdef CONCENTRATOR | 1779 | #ifdef CONCENTRATOR |
1780 | SK_UNUSED(smc) ; | 1780 | SK_UNUSED(smc) ; |
1781 | SK_UNUSED(mac) ; | 1781 | SK_UNUSED(mac) ; |
1782 | return(entity_to_index(smc,cem_get_downstream(smc,ENTITY_MAC))) ; | 1782 | return entity_to_index(smc, cem_get_downstream(smc, ENTITY_MAC)); |
1783 | #else | 1783 | #else |
1784 | SK_UNUSED(mac) ; | 1784 | SK_UNUSED(mac) ; |
1785 | switch (smc->mib.fddiSMTCF_State) { | 1785 | switch (smc->mib.fddiSMTCF_State) { |
1786 | case SC9_C_WRAP_A : | 1786 | case SC9_C_WRAP_A : |
1787 | case SC5_THRU_B : | 1787 | case SC5_THRU_B : |
1788 | case SC11_C_WRAP_S : | 1788 | case SC11_C_WRAP_S : |
1789 | return(1) ; | 1789 | return 1; |
1790 | case SC10_C_WRAP_B : | 1790 | case SC10_C_WRAP_B : |
1791 | case SC4_THRU_A : | 1791 | case SC4_THRU_A : |
1792 | return(2) ; | 1792 | return 2; |
1793 | } | 1793 | } |
1794 | return(smc->s.sas == SMT_SAS ? 2 : 3) ; | 1794 | return smc->s.sas == SMT_SAS ? 2 : 3; |
1795 | #endif | 1795 | #endif |
1796 | } | 1796 | } |
1797 | 1797 | ||
@@ -1801,21 +1801,21 @@ static int mac_con_resource_index(struct s_smc *smc, int mac) | |||
1801 | static int phy_con_resource_index(struct s_smc *smc, int phy) | 1801 | static int phy_con_resource_index(struct s_smc *smc, int phy) |
1802 | { | 1802 | { |
1803 | #ifdef CONCENTRATOR | 1803 | #ifdef CONCENTRATOR |
1804 | return(entity_to_index(smc,cem_get_downstream(smc,ENTITY_PHY(phy)))) ; | 1804 | return entity_to_index(smc, cem_get_downstream(smc, ENTITY_PHY(phy))) ; |
1805 | #else | 1805 | #else |
1806 | switch (smc->mib.fddiSMTCF_State) { | 1806 | switch (smc->mib.fddiSMTCF_State) { |
1807 | case SC9_C_WRAP_A : | 1807 | case SC9_C_WRAP_A : |
1808 | return(phy == PA ? 3 : 2) ; | 1808 | return phy == PA ? 3 : 2; |
1809 | case SC10_C_WRAP_B : | 1809 | case SC10_C_WRAP_B : |
1810 | return(phy == PA ? 1 : 3) ; | 1810 | return phy == PA ? 1 : 3; |
1811 | case SC4_THRU_A : | 1811 | case SC4_THRU_A : |
1812 | return(phy == PA ? 3 : 1) ; | 1812 | return phy == PA ? 3 : 1; |
1813 | case SC5_THRU_B : | 1813 | case SC5_THRU_B : |
1814 | return(phy == PA ? 2 : 3) ; | 1814 | return phy == PA ? 2 : 3; |
1815 | case SC11_C_WRAP_S : | 1815 | case SC11_C_WRAP_S : |
1816 | return(2) ; | 1816 | return 2; |
1817 | } | 1817 | } |
1818 | return(phy) ; | 1818 | return phy; |
1819 | #endif | 1819 | #endif |
1820 | } | 1820 | } |
1821 | 1821 | ||
@@ -1823,16 +1823,16 @@ static int phy_con_resource_index(struct s_smc *smc, int phy) | |||
1823 | static int entity_to_index(struct s_smc *smc, int e) | 1823 | static int entity_to_index(struct s_smc *smc, int e) |
1824 | { | 1824 | { |
1825 | if (e == ENTITY_MAC) | 1825 | if (e == ENTITY_MAC) |
1826 | return(mac_index(smc,1)) ; | 1826 | return mac_index(smc, 1); |
1827 | else | 1827 | else |
1828 | return(phy_index(smc,e - ENTITY_PHY(0))) ; | 1828 | return phy_index(smc, e - ENTITY_PHY(0)); |
1829 | } | 1829 | } |
1830 | #endif | 1830 | #endif |
1831 | 1831 | ||
1832 | #ifdef LITTLE_ENDIAN | 1832 | #ifdef LITTLE_ENDIAN |
1833 | static int smt_swap_short(u_short s) | 1833 | static int smt_swap_short(u_short s) |
1834 | { | 1834 | { |
1835 | return(((s>>8)&0xff)|((s&0xff)<<8)) ; | 1835 | return ((s>>8)&0xff) | ((s&0xff)<<8); |
1836 | } | 1836 | } |
1837 | 1837 | ||
1838 | void smt_swap_para(struct smt_header *sm, int len, int direction) | 1838 | void smt_swap_para(struct smt_header *sm, int len, int direction) |
@@ -1996,7 +1996,7 @@ int smt_action(struct s_smc *smc, int class, int code, int index) | |||
1996 | } | 1996 | } |
1997 | break ; | 1997 | break ; |
1998 | default : | 1998 | default : |
1999 | return(1) ; | 1999 | return 1; |
2000 | } | 2000 | } |
2001 | break ; | 2001 | break ; |
2002 | case SMT_PORT_ACTION : | 2002 | case SMT_PORT_ACTION : |
@@ -2017,14 +2017,14 @@ int smt_action(struct s_smc *smc, int class, int code, int index) | |||
2017 | event = PC_STOP ; | 2017 | event = PC_STOP ; |
2018 | break ; | 2018 | break ; |
2019 | default : | 2019 | default : |
2020 | return(1) ; | 2020 | return 1; |
2021 | } | 2021 | } |
2022 | queue_event(smc,EVENT_PCM+index,event) ; | 2022 | queue_event(smc,EVENT_PCM+index,event) ; |
2023 | break ; | 2023 | break ; |
2024 | default : | 2024 | default : |
2025 | return(1) ; | 2025 | return 1; |
2026 | } | 2026 | } |
2027 | return(0) ; | 2027 | return 0; |
2028 | } | 2028 | } |
2029 | 2029 | ||
2030 | /* | 2030 | /* |
diff --git a/drivers/net/skfp/smtdef.c b/drivers/net/skfp/smtdef.c index 4e07ff7073f1..1acab0b368e3 100644 --- a/drivers/net/skfp/smtdef.c +++ b/drivers/net/skfp/smtdef.c | |||
@@ -303,7 +303,7 @@ int smt_set_mac_opvalues(struct s_smc *smc) | |||
303 | FDDI_SMT_EVENT, (u_long) FDDI_REMOTE_T_REQ, | 303 | FDDI_SMT_EVENT, (u_long) FDDI_REMOTE_T_REQ, |
304 | smt_get_event_word(smc)); | 304 | smt_get_event_word(smc)); |
305 | } | 305 | } |
306 | return(st) ; | 306 | return st; |
307 | } | 307 | } |
308 | 308 | ||
309 | void smt_fixup_mib(struct s_smc *smc) | 309 | void smt_fixup_mib(struct s_smc *smc) |
@@ -350,6 +350,6 @@ static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper) | |||
350 | *oper = limit ; | 350 | *oper = limit ; |
351 | else | 351 | else |
352 | *oper = mib ; | 352 | *oper = mib ; |
353 | return(old != *oper) ; | 353 | return old != *oper; |
354 | } | 354 | } |
355 | 355 | ||
diff --git a/drivers/net/skfp/smtinit.c b/drivers/net/skfp/smtinit.c index 3c8964ce1837..e3a0c0bc2233 100644 --- a/drivers/net/skfp/smtinit.c +++ b/drivers/net/skfp/smtinit.c | |||
@@ -120,6 +120,6 @@ int init_smt(struct s_smc *smc, u_char *mac_addr) | |||
120 | 120 | ||
121 | PNMI_INIT(smc) ; /* PNMI initialization */ | 121 | PNMI_INIT(smc) ; /* PNMI initialization */ |
122 | 122 | ||
123 | return(0) ; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
diff --git a/drivers/net/skfp/srf.c b/drivers/net/skfp/srf.c index 40882b3faba6..f6f7baf9f27a 100644 --- a/drivers/net/skfp/srf.c +++ b/drivers/net/skfp/srf.c | |||
@@ -165,7 +165,7 @@ static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index) | |||
165 | 165 | ||
166 | for (i = 0, evc = smc->evcs ; (unsigned) i < MAX_EVCS ; i++, evc++) { | 166 | for (i = 0, evc = smc->evcs ; (unsigned) i < MAX_EVCS ; i++, evc++) { |
167 | if (evc->evc_code == code && evc->evc_index == index) | 167 | if (evc->evc_code == code && evc->evc_index == index) |
168 | return(evc) ; | 168 | return evc; |
169 | } | 169 | } |
170 | return NULL; | 170 | return NULL; |
171 | } | 171 | } |
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 38547a8938fe..86cbb9ea2f26 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -944,7 +944,7 @@ static int slip_esc(unsigned char *s, unsigned char *d, int len) | |||
944 | } | 944 | } |
945 | } | 945 | } |
946 | *ptr++ = END; | 946 | *ptr++ = END; |
947 | return (ptr - d); | 947 | return ptr - d; |
948 | } | 948 | } |
949 | 949 | ||
950 | static void slip_unesc(struct slip *sl, unsigned char s) | 950 | static void slip_unesc(struct slip *sl, unsigned char s) |
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 358c22f9acbe..7d9ec23aabf6 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -436,7 +436,7 @@ static int lance_open( struct net_device *dev ) | |||
436 | DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n", | 436 | DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n", |
437 | dev->name, i, DREG )); | 437 | dev->name, i, DREG )); |
438 | DREG = CSR0_STOP; | 438 | DREG = CSR0_STOP; |
439 | return( -EIO ); | 439 | return -EIO; |
440 | } | 440 | } |
441 | 441 | ||
442 | DREG = CSR0_IDON | CSR0_STRT | CSR0_INEA; | 442 | DREG = CSR0_IDON | CSR0_STRT | CSR0_INEA; |
@@ -445,7 +445,7 @@ static int lance_open( struct net_device *dev ) | |||
445 | 445 | ||
446 | DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG )); | 446 | DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG )); |
447 | 447 | ||
448 | return( 0 ); | 448 | return 0; |
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index 4a4fac630337..d16880d7099b 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c | |||
@@ -88,7 +88,7 @@ static int reset_one_mii_phy(struct mii_phy* phy, int phy_id) | |||
88 | if ((val & BMCR_ISOLATE) && limit > 0) | 88 | if ((val & BMCR_ISOLATE) && limit > 0) |
89 | __phy_write(phy, phy_id, MII_BMCR, val & ~BMCR_ISOLATE); | 89 | __phy_write(phy, phy_id, MII_BMCR, val & ~BMCR_ISOLATE); |
90 | 90 | ||
91 | return (limit <= 0); | 91 | return limit <= 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | static int bcm5201_init(struct mii_phy* phy) | 94 | static int bcm5201_init(struct mii_phy* phy) |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 45f315ed1868..5e28c414421a 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2497,7 +2497,7 @@ static u32 hme_get_link(struct net_device *dev) | |||
2497 | hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); | 2497 | hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); |
2498 | spin_unlock_irq(&hp->happy_lock); | 2498 | spin_unlock_irq(&hp->happy_lock); |
2499 | 2499 | ||
2500 | return (hp->sw_bmsr & BMSR_LSTATUS); | 2500 | return hp->sw_bmsr & BMSR_LSTATUS; |
2501 | } | 2501 | } |
2502 | 2502 | ||
2503 | static const struct ethtool_ops hme_ethtool_ops = { | 2503 | static const struct ethtool_ops hme_ethtool_ops = { |
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 72e65d4666ef..9536b2f010be 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c | |||
@@ -711,7 +711,7 @@ static u32 qe_get_link(struct net_device *dev) | |||
711 | phyconfig = sbus_readb(mregs + MREGS_PHYCONFIG); | 711 | phyconfig = sbus_readb(mregs + MREGS_PHYCONFIG); |
712 | spin_unlock_irq(&qep->lock); | 712 | spin_unlock_irq(&qep->lock); |
713 | 713 | ||
714 | return (phyconfig & MREGS_PHYCONFIG_LSTAT); | 714 | return phyconfig & MREGS_PHYCONFIG_LSTAT; |
715 | } | 715 | } |
716 | 716 | ||
717 | static const struct ethtool_ops qe_ethtool_ops = { | 717 | static const struct ethtool_ops qe_ethtool_ops = { |
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 99e423a5b9f1..b6eec8cea209 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c | |||
@@ -1167,7 +1167,7 @@ static void print_eth(const u8 *add) | |||
1167 | static int tc35815_tx_full(struct net_device *dev) | 1167 | static int tc35815_tx_full(struct net_device *dev) |
1168 | { | 1168 | { |
1169 | struct tc35815_local *lp = netdev_priv(dev); | 1169 | struct tc35815_local *lp = netdev_priv(dev); |
1170 | return ((lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end); | 1170 | return (lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end; |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | static void tc35815_restart(struct net_device *dev) | 1173 | static void tc35815_restart(struct net_device *dev) |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e7a2ba8b20a2..fdb438dca9b3 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5389,8 +5389,7 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) | |||
5389 | { | 5389 | { |
5390 | u32 base = (u32) mapping & 0xffffffff; | 5390 | u32 base = (u32) mapping & 0xffffffff; |
5391 | 5391 | ||
5392 | return ((base > 0xffffdcc0) && | 5392 | return (base > 0xffffdcc0) && (base + len + 8 < base); |
5393 | (base + len + 8 < base)); | ||
5394 | } | 5393 | } |
5395 | 5394 | ||
5396 | /* Test for DMA addresses > 40-bit */ | 5395 | /* Test for DMA addresses > 40-bit */ |
@@ -5399,7 +5398,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, | |||
5399 | { | 5398 | { |
5400 | #if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64) | 5399 | #if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64) |
5401 | if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) | 5400 | if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) |
5402 | return (((u64) mapping + len) > DMA_BIT_MASK(40)); | 5401 | return ((u64) mapping + len) > DMA_BIT_MASK(40); |
5403 | return 0; | 5402 | return 0; |
5404 | #else | 5403 | #else |
5405 | return 0; | 5404 | return 0; |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 0564ca05963d..ec8c804a795d 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -3187,7 +3187,7 @@ static int TLan_EeSendByte( u16 io_base, u8 data, int stop ) | |||
3187 | TLan_SetBit( TLAN_NET_SIO_EDATA, sio ); | 3187 | TLan_SetBit( TLAN_NET_SIO_EDATA, sio ); |
3188 | } | 3188 | } |
3189 | 3189 | ||
3190 | return ( err ); | 3190 | return err; |
3191 | 3191 | ||
3192 | } /* TLan_EeSendByte */ | 3192 | } /* TLan_EeSendByte */ |
3193 | 3193 | ||
diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h index d13ff12d7500..3315ced774e2 100644 --- a/drivers/net/tlan.h +++ b/drivers/net/tlan.h | |||
@@ -442,7 +442,7 @@ typedef struct tlan_private_tag { | |||
442 | static inline u8 TLan_DioRead8(u16 base_addr, u16 internal_addr) | 442 | static inline u8 TLan_DioRead8(u16 base_addr, u16 internal_addr) |
443 | { | 443 | { |
444 | outw(internal_addr, base_addr + TLAN_DIO_ADR); | 444 | outw(internal_addr, base_addr + TLAN_DIO_ADR); |
445 | return (inb((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x3))); | 445 | return inb((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x3)); |
446 | 446 | ||
447 | } /* TLan_DioRead8 */ | 447 | } /* TLan_DioRead8 */ |
448 | 448 | ||
@@ -452,7 +452,7 @@ static inline u8 TLan_DioRead8(u16 base_addr, u16 internal_addr) | |||
452 | static inline u16 TLan_DioRead16(u16 base_addr, u16 internal_addr) | 452 | static inline u16 TLan_DioRead16(u16 base_addr, u16 internal_addr) |
453 | { | 453 | { |
454 | outw(internal_addr, base_addr + TLAN_DIO_ADR); | 454 | outw(internal_addr, base_addr + TLAN_DIO_ADR); |
455 | return (inw((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x2))); | 455 | return inw((base_addr + TLAN_DIO_DATA) + (internal_addr & 0x2)); |
456 | 456 | ||
457 | } /* TLan_DioRead16 */ | 457 | } /* TLan_DioRead16 */ |
458 | 458 | ||
@@ -462,7 +462,7 @@ static inline u16 TLan_DioRead16(u16 base_addr, u16 internal_addr) | |||
462 | static inline u32 TLan_DioRead32(u16 base_addr, u16 internal_addr) | 462 | static inline u32 TLan_DioRead32(u16 base_addr, u16 internal_addr) |
463 | { | 463 | { |
464 | outw(internal_addr, base_addr + TLAN_DIO_ADR); | 464 | outw(internal_addr, base_addr + TLAN_DIO_ADR); |
465 | return (inl(base_addr + TLAN_DIO_DATA)); | 465 | return inl(base_addr + TLAN_DIO_DATA); |
466 | 466 | ||
467 | } /* TLan_DioRead32 */ | 467 | } /* TLan_DioRead32 */ |
468 | 468 | ||
@@ -537,6 +537,6 @@ static inline u32 TLan_HashFunc( const u8 *a ) | |||
537 | hash ^= ((a[2]^a[5])<<4); /* & 060 */ | 537 | hash ^= ((a[2]^a[5])<<4); /* & 060 */ |
538 | hash ^= ((a[2]^a[5])>>2); /* & 077 */ | 538 | hash ^= ((a[2]^a[5])>>2); /* & 077 */ |
539 | 539 | ||
540 | return (hash & 077); | 540 | return hash & 077; |
541 | } | 541 | } |
542 | #endif | 542 | #endif |
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c index 16e8783ee9cd..8d362e64a40e 100644 --- a/drivers/net/tokenring/proteon.c +++ b/drivers/net/tokenring/proteon.c | |||
@@ -110,7 +110,7 @@ static int __init proteon_probe1(struct net_device *dev, int ioaddr) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | dev->base_addr = ioaddr; | 112 | dev->base_addr = ioaddr; |
113 | return (0); | 113 | return 0; |
114 | nodev: | 114 | nodev: |
115 | release_region(ioaddr, PROTEON_IO_EXTENT); | 115 | release_region(ioaddr, PROTEON_IO_EXTENT); |
116 | return -ENODEV; | 116 | return -ENODEV; |
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 0929fff5982c..63db5a6762ae 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c | |||
@@ -435,7 +435,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev) | |||
435 | RX_DATA_BUFFER_SIZE * tp->num_rx_bdbs[NON_MAC_QUEUE]); | 435 | RX_DATA_BUFFER_SIZE * tp->num_rx_bdbs[NON_MAC_QUEUE]); |
436 | tp->rx_buff_end[NON_MAC_QUEUE] = (__u16 *)smctr_malloc(dev, 0); | 436 | tp->rx_buff_end[NON_MAC_QUEUE] = (__u16 *)smctr_malloc(dev, 0); |
437 | 437 | ||
438 | return (0); | 438 | return 0; |
439 | } | 439 | } |
440 | 440 | ||
441 | /* Enter Bypass state. */ | 441 | /* Enter Bypass state. */ |
@@ -448,7 +448,7 @@ static int smctr_bypass_state(struct net_device *dev) | |||
448 | 448 | ||
449 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, JS_BYPASS_STATE); | 449 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, JS_BYPASS_STATE); |
450 | 450 | ||
451 | return (err); | 451 | return err; |
452 | } | 452 | } |
453 | 453 | ||
454 | static int smctr_checksum_firmware(struct net_device *dev) | 454 | static int smctr_checksum_firmware(struct net_device *dev) |
@@ -471,9 +471,9 @@ static int smctr_checksum_firmware(struct net_device *dev) | |||
471 | smctr_disable_adapter_ctrl_store(dev); | 471 | smctr_disable_adapter_ctrl_store(dev); |
472 | 472 | ||
473 | if(checksum) | 473 | if(checksum) |
474 | return (checksum); | 474 | return checksum; |
475 | 475 | ||
476 | return (0); | 476 | return 0; |
477 | } | 477 | } |
478 | 478 | ||
479 | static int __init smctr_chk_mca(struct net_device *dev) | 479 | static int __init smctr_chk_mca(struct net_device *dev) |
@@ -485,7 +485,7 @@ static int __init smctr_chk_mca(struct net_device *dev) | |||
485 | 485 | ||
486 | current_slot = mca_find_unused_adapter(smctr_posid, 0); | 486 | current_slot = mca_find_unused_adapter(smctr_posid, 0); |
487 | if(current_slot == MCA_NOTFOUND) | 487 | if(current_slot == MCA_NOTFOUND) |
488 | return (-ENODEV); | 488 | return -ENODEV; |
489 | 489 | ||
490 | mca_set_adapter_name(current_slot, smctr_name); | 490 | mca_set_adapter_name(current_slot, smctr_name); |
491 | mca_mark_as_used(current_slot); | 491 | mca_mark_as_used(current_slot); |
@@ -622,9 +622,9 @@ static int __init smctr_chk_mca(struct net_device *dev) | |||
622 | break; | 622 | break; |
623 | } | 623 | } |
624 | 624 | ||
625 | return (0); | 625 | return 0; |
626 | #else | 626 | #else |
627 | return (-1); | 627 | return -1; |
628 | #endif /* CONFIG_MCA_LEGACY */ | 628 | #endif /* CONFIG_MCA_LEGACY */ |
629 | } | 629 | } |
630 | 630 | ||
@@ -677,18 +677,18 @@ static int smctr_chg_rx_mask(struct net_device *dev) | |||
677 | if((err = smctr_issue_write_word_cmd(dev, RW_CONFIG_REGISTER_0, | 677 | if((err = smctr_issue_write_word_cmd(dev, RW_CONFIG_REGISTER_0, |
678 | &tp->config_word0))) | 678 | &tp->config_word0))) |
679 | { | 679 | { |
680 | return (err); | 680 | return err; |
681 | } | 681 | } |
682 | 682 | ||
683 | if((err = smctr_issue_write_word_cmd(dev, RW_CONFIG_REGISTER_1, | 683 | if((err = smctr_issue_write_word_cmd(dev, RW_CONFIG_REGISTER_1, |
684 | &tp->config_word1))) | 684 | &tp->config_word1))) |
685 | { | 685 | { |
686 | return (err); | 686 | return err; |
687 | } | 687 | } |
688 | 688 | ||
689 | smctr_disable_16bit(dev); | 689 | smctr_disable_16bit(dev); |
690 | 690 | ||
691 | return (0); | 691 | return 0; |
692 | } | 692 | } |
693 | 693 | ||
694 | static int smctr_clear_int(struct net_device *dev) | 694 | static int smctr_clear_int(struct net_device *dev) |
@@ -697,7 +697,7 @@ static int smctr_clear_int(struct net_device *dev) | |||
697 | 697 | ||
698 | outb((tp->trc_mask | CSR_CLRTINT), dev->base_addr + CSR); | 698 | outb((tp->trc_mask | CSR_CLRTINT), dev->base_addr + CSR); |
699 | 699 | ||
700 | return (0); | 700 | return 0; |
701 | } | 701 | } |
702 | 702 | ||
703 | static int smctr_clear_trc_reset(int ioaddr) | 703 | static int smctr_clear_trc_reset(int ioaddr) |
@@ -707,7 +707,7 @@ static int smctr_clear_trc_reset(int ioaddr) | |||
707 | r = inb(ioaddr + MSR); | 707 | r = inb(ioaddr + MSR); |
708 | outb(~MSR_RST & r, ioaddr + MSR); | 708 | outb(~MSR_RST & r, ioaddr + MSR); |
709 | 709 | ||
710 | return (0); | 710 | return 0; |
711 | } | 711 | } |
712 | 712 | ||
713 | /* | 713 | /* |
@@ -725,7 +725,7 @@ static int smctr_close(struct net_device *dev) | |||
725 | 725 | ||
726 | /* Check to see if adapter is already in a closed state. */ | 726 | /* Check to see if adapter is already in a closed state. */ |
727 | if(tp->status != OPEN) | 727 | if(tp->status != OPEN) |
728 | return (0); | 728 | return 0; |
729 | 729 | ||
730 | smctr_enable_16bit(dev); | 730 | smctr_enable_16bit(dev); |
731 | smctr_set_page(dev, (__u8 *)tp->ram_access); | 731 | smctr_set_page(dev, (__u8 *)tp->ram_access); |
@@ -733,7 +733,7 @@ static int smctr_close(struct net_device *dev) | |||
733 | if((err = smctr_issue_remove_cmd(dev))) | 733 | if((err = smctr_issue_remove_cmd(dev))) |
734 | { | 734 | { |
735 | smctr_disable_16bit(dev); | 735 | smctr_disable_16bit(dev); |
736 | return (err); | 736 | return err; |
737 | } | 737 | } |
738 | 738 | ||
739 | for(;;) | 739 | for(;;) |
@@ -746,7 +746,7 @@ static int smctr_close(struct net_device *dev) | |||
746 | } | 746 | } |
747 | 747 | ||
748 | 748 | ||
749 | return (0); | 749 | return 0; |
750 | } | 750 | } |
751 | 751 | ||
752 | static int smctr_decode_firmware(struct net_device *dev, | 752 | static int smctr_decode_firmware(struct net_device *dev, |
@@ -807,12 +807,12 @@ static int smctr_decode_firmware(struct net_device *dev, | |||
807 | if(buff) | 807 | if(buff) |
808 | *(mem++) = SWAP_BYTES(buff); | 808 | *(mem++) = SWAP_BYTES(buff); |
809 | 809 | ||
810 | return (0); | 810 | return 0; |
811 | } | 811 | } |
812 | 812 | ||
813 | static int smctr_disable_16bit(struct net_device *dev) | 813 | static int smctr_disable_16bit(struct net_device *dev) |
814 | { | 814 | { |
815 | return (0); | 815 | return 0; |
816 | } | 816 | } |
817 | 817 | ||
818 | /* | 818 | /* |
@@ -832,7 +832,7 @@ static int smctr_disable_adapter_ctrl_store(struct net_device *dev) | |||
832 | tp->trc_mask |= CSR_WCSS; | 832 | tp->trc_mask |= CSR_WCSS; |
833 | outb(tp->trc_mask, ioaddr + CSR); | 833 | outb(tp->trc_mask, ioaddr + CSR); |
834 | 834 | ||
835 | return (0); | 835 | return 0; |
836 | } | 836 | } |
837 | 837 | ||
838 | static int smctr_disable_bic_int(struct net_device *dev) | 838 | static int smctr_disable_bic_int(struct net_device *dev) |
@@ -844,7 +844,7 @@ static int smctr_disable_bic_int(struct net_device *dev) | |||
844 | | CSR_MSKTINT | CSR_WCSS; | 844 | | CSR_MSKTINT | CSR_WCSS; |
845 | outb(tp->trc_mask, ioaddr + CSR); | 845 | outb(tp->trc_mask, ioaddr + CSR); |
846 | 846 | ||
847 | return (0); | 847 | return 0; |
848 | } | 848 | } |
849 | 849 | ||
850 | static int smctr_enable_16bit(struct net_device *dev) | 850 | static int smctr_enable_16bit(struct net_device *dev) |
@@ -858,7 +858,7 @@ static int smctr_enable_16bit(struct net_device *dev) | |||
858 | outb((r | LAAR_MEM16ENB), dev->base_addr + LAAR); | 858 | outb((r | LAAR_MEM16ENB), dev->base_addr + LAAR); |
859 | } | 859 | } |
860 | 860 | ||
861 | return (0); | 861 | return 0; |
862 | } | 862 | } |
863 | 863 | ||
864 | /* | 864 | /* |
@@ -881,7 +881,7 @@ static int smctr_enable_adapter_ctrl_store(struct net_device *dev) | |||
881 | tp->trc_mask &= ~CSR_WCSS; | 881 | tp->trc_mask &= ~CSR_WCSS; |
882 | outb(tp->trc_mask, ioaddr + CSR); | 882 | outb(tp->trc_mask, ioaddr + CSR); |
883 | 883 | ||
884 | return (0); | 884 | return 0; |
885 | } | 885 | } |
886 | 886 | ||
887 | static int smctr_enable_adapter_ram(struct net_device *dev) | 887 | static int smctr_enable_adapter_ram(struct net_device *dev) |
@@ -895,7 +895,7 @@ static int smctr_enable_adapter_ram(struct net_device *dev) | |||
895 | r = inb(ioaddr + MSR); | 895 | r = inb(ioaddr + MSR); |
896 | outb(MSR_MEMB | r, ioaddr + MSR); | 896 | outb(MSR_MEMB | r, ioaddr + MSR); |
897 | 897 | ||
898 | return (0); | 898 | return 0; |
899 | } | 899 | } |
900 | 900 | ||
901 | static int smctr_enable_bic_int(struct net_device *dev) | 901 | static int smctr_enable_bic_int(struct net_device *dev) |
@@ -921,7 +921,7 @@ static int smctr_enable_bic_int(struct net_device *dev) | |||
921 | break; | 921 | break; |
922 | } | 922 | } |
923 | 923 | ||
924 | return (0); | 924 | return 0; |
925 | } | 925 | } |
926 | 926 | ||
927 | static int __init smctr_chk_isa(struct net_device *dev) | 927 | static int __init smctr_chk_isa(struct net_device *dev) |
@@ -1145,7 +1145,7 @@ static int __init smctr_chk_isa(struct net_device *dev) | |||
1145 | */ | 1145 | */ |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | return (0); | 1148 | return 0; |
1149 | 1149 | ||
1150 | out2: | 1150 | out2: |
1151 | release_region(ioaddr, SMCTR_IO_EXTENT); | 1151 | release_region(ioaddr, SMCTR_IO_EXTENT); |
@@ -1199,7 +1199,7 @@ static int __init smctr_get_boardid(struct net_device *dev, int mca) | |||
1199 | * return; | 1199 | * return; |
1200 | */ | 1200 | */ |
1201 | if(IdByte & 0xF8) | 1201 | if(IdByte & 0xF8) |
1202 | return (-1); | 1202 | return -1; |
1203 | 1203 | ||
1204 | r1 = inb(ioaddr + BID_REG_1); | 1204 | r1 = inb(ioaddr + BID_REG_1); |
1205 | r1 &= BID_ICR_MASK; | 1205 | r1 &= BID_ICR_MASK; |
@@ -1250,21 +1250,21 @@ static int __init smctr_get_boardid(struct net_device *dev, int mca) | |||
1250 | while(r1 & BID_RECALL_DONE_MASK) | 1250 | while(r1 & BID_RECALL_DONE_MASK) |
1251 | r1 = inb(ioaddr + BID_REG_1); | 1251 | r1 = inb(ioaddr + BID_REG_1); |
1252 | 1252 | ||
1253 | return (BoardIdMask); | 1253 | return BoardIdMask; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static int smctr_get_group_address(struct net_device *dev) | 1256 | static int smctr_get_group_address(struct net_device *dev) |
1257 | { | 1257 | { |
1258 | smctr_issue_read_word_cmd(dev, RW_INDIVIDUAL_GROUP_ADDR); | 1258 | smctr_issue_read_word_cmd(dev, RW_INDIVIDUAL_GROUP_ADDR); |
1259 | 1259 | ||
1260 | return(smctr_wait_cmd(dev)); | 1260 | return smctr_wait_cmd(dev); |
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | static int smctr_get_functional_address(struct net_device *dev) | 1263 | static int smctr_get_functional_address(struct net_device *dev) |
1264 | { | 1264 | { |
1265 | smctr_issue_read_word_cmd(dev, RW_FUNCTIONAL_ADDR); | 1265 | smctr_issue_read_word_cmd(dev, RW_FUNCTIONAL_ADDR); |
1266 | 1266 | ||
1267 | return(smctr_wait_cmd(dev)); | 1267 | return smctr_wait_cmd(dev); |
1268 | } | 1268 | } |
1269 | 1269 | ||
1270 | /* Calculate number of Non-MAC receive BDB's and data buffers. | 1270 | /* Calculate number of Non-MAC receive BDB's and data buffers. |
@@ -1346,14 +1346,14 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev) | |||
1346 | */ | 1346 | */ |
1347 | mem_used += 0x100; | 1347 | mem_used += 0x100; |
1348 | 1348 | ||
1349 | return((0xffff - mem_used) / (RX_DATA_BUFFER_SIZE + sizeof(BDBlock))); | 1349 | return (0xffff - mem_used) / (RX_DATA_BUFFER_SIZE + sizeof(BDBlock)); |
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | static int smctr_get_physical_drop_number(struct net_device *dev) | 1352 | static int smctr_get_physical_drop_number(struct net_device *dev) |
1353 | { | 1353 | { |
1354 | smctr_issue_read_word_cmd(dev, RW_PHYSICAL_DROP_NUMBER); | 1354 | smctr_issue_read_word_cmd(dev, RW_PHYSICAL_DROP_NUMBER); |
1355 | 1355 | ||
1356 | return(smctr_wait_cmd(dev)); | 1356 | return smctr_wait_cmd(dev); |
1357 | } | 1357 | } |
1358 | 1358 | ||
1359 | static __u8 * smctr_get_rx_pointer(struct net_device *dev, short queue) | 1359 | static __u8 * smctr_get_rx_pointer(struct net_device *dev, short queue) |
@@ -1366,14 +1366,14 @@ static __u8 * smctr_get_rx_pointer(struct net_device *dev, short queue) | |||
1366 | 1366 | ||
1367 | tp->rx_fcb_curr[queue]->bdb_ptr = bdb; | 1367 | tp->rx_fcb_curr[queue]->bdb_ptr = bdb; |
1368 | 1368 | ||
1369 | return ((__u8 *)bdb->data_block_ptr); | 1369 | return (__u8 *)bdb->data_block_ptr; |
1370 | } | 1370 | } |
1371 | 1371 | ||
1372 | static int smctr_get_station_id(struct net_device *dev) | 1372 | static int smctr_get_station_id(struct net_device *dev) |
1373 | { | 1373 | { |
1374 | smctr_issue_read_word_cmd(dev, RW_INDIVIDUAL_MAC_ADDRESS); | 1374 | smctr_issue_read_word_cmd(dev, RW_INDIVIDUAL_MAC_ADDRESS); |
1375 | 1375 | ||
1376 | return(smctr_wait_cmd(dev)); | 1376 | return smctr_wait_cmd(dev); |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | /* | 1379 | /* |
@@ -1384,7 +1384,7 @@ static struct net_device_stats *smctr_get_stats(struct net_device *dev) | |||
1384 | { | 1384 | { |
1385 | struct net_local *tp = netdev_priv(dev); | 1385 | struct net_local *tp = netdev_priv(dev); |
1386 | 1386 | ||
1387 | return ((struct net_device_stats *)&tp->MacStat); | 1387 | return (struct net_device_stats *)&tp->MacStat; |
1388 | } | 1388 | } |
1389 | 1389 | ||
1390 | static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue, | 1390 | static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue, |
@@ -1401,14 +1401,14 @@ static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue, | |||
1401 | 1401 | ||
1402 | /* check if there is enough FCB blocks */ | 1402 | /* check if there is enough FCB blocks */ |
1403 | if(tp->num_tx_fcbs_used[queue] >= tp->num_tx_fcbs[queue]) | 1403 | if(tp->num_tx_fcbs_used[queue] >= tp->num_tx_fcbs[queue]) |
1404 | return ((FCBlock *)(-1L)); | 1404 | return (FCBlock *)(-1L); |
1405 | 1405 | ||
1406 | /* round off the input pkt size to the nearest even number */ | 1406 | /* round off the input pkt size to the nearest even number */ |
1407 | alloc_size = (bytes_count + 1) & 0xfffe; | 1407 | alloc_size = (bytes_count + 1) & 0xfffe; |
1408 | 1408 | ||
1409 | /* check if enough mem */ | 1409 | /* check if enough mem */ |
1410 | if((tp->tx_buff_used[queue] + alloc_size) > tp->tx_buff_size[queue]) | 1410 | if((tp->tx_buff_used[queue] + alloc_size) > tp->tx_buff_size[queue]) |
1411 | return ((FCBlock *)(-1L)); | 1411 | return (FCBlock *)(-1L); |
1412 | 1412 | ||
1413 | /* check if past the end ; | 1413 | /* check if past the end ; |
1414 | * if exactly enough mem to end of ring, alloc from front. | 1414 | * if exactly enough mem to end of ring, alloc from front. |
@@ -1425,7 +1425,7 @@ static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue, | |||
1425 | if((tp->tx_buff_used[queue] + alloc_size) | 1425 | if((tp->tx_buff_used[queue] + alloc_size) |
1426 | > tp->tx_buff_size[queue]) | 1426 | > tp->tx_buff_size[queue]) |
1427 | { | 1427 | { |
1428 | return ((FCBlock *)(-1L)); | 1428 | return (FCBlock *)(-1L); |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | /* ring wrap */ | 1431 | /* ring wrap */ |
@@ -1448,14 +1448,14 @@ static FCBlock *smctr_get_tx_fcb(struct net_device *dev, __u16 queue, | |||
1448 | pFCB = tp->tx_fcb_curr[queue]; | 1448 | pFCB = tp->tx_fcb_curr[queue]; |
1449 | tp->tx_fcb_curr[queue] = tp->tx_fcb_curr[queue]->next_ptr; | 1449 | tp->tx_fcb_curr[queue] = tp->tx_fcb_curr[queue]->next_ptr; |
1450 | 1450 | ||
1451 | return (pFCB); | 1451 | return pFCB; |
1452 | } | 1452 | } |
1453 | 1453 | ||
1454 | static int smctr_get_upstream_neighbor_addr(struct net_device *dev) | 1454 | static int smctr_get_upstream_neighbor_addr(struct net_device *dev) |
1455 | { | 1455 | { |
1456 | smctr_issue_read_word_cmd(dev, RW_UPSTREAM_NEIGHBOR_ADDRESS); | 1456 | smctr_issue_read_word_cmd(dev, RW_UPSTREAM_NEIGHBOR_ADDRESS); |
1457 | 1457 | ||
1458 | return(smctr_wait_cmd(dev)); | 1458 | return smctr_wait_cmd(dev); |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | static int smctr_hardware_send_packet(struct net_device *dev, | 1461 | static int smctr_hardware_send_packet(struct net_device *dev, |
@@ -1469,21 +1469,22 @@ static int smctr_hardware_send_packet(struct net_device *dev, | |||
1469 | printk(KERN_DEBUG"%s: smctr_hardware_send_packet\n", dev->name); | 1469 | printk(KERN_DEBUG"%s: smctr_hardware_send_packet\n", dev->name); |
1470 | 1470 | ||
1471 | if(tp->status != OPEN) | 1471 | if(tp->status != OPEN) |
1472 | return (-1); | 1472 | return -1; |
1473 | 1473 | ||
1474 | if(tp->monitor_state_ready != 1) | 1474 | if(tp->monitor_state_ready != 1) |
1475 | return (-1); | 1475 | return -1; |
1476 | 1476 | ||
1477 | for(;;) | 1477 | for(;;) |
1478 | { | 1478 | { |
1479 | /* Send first buffer from queue */ | 1479 | /* Send first buffer from queue */ |
1480 | skb = skb_dequeue(&tp->SendSkbQueue); | 1480 | skb = skb_dequeue(&tp->SendSkbQueue); |
1481 | if(skb == NULL) | 1481 | if(skb == NULL) |
1482 | return (-1); | 1482 | return -1; |
1483 | 1483 | ||
1484 | tp->QueueSkb++; | 1484 | tp->QueueSkb++; |
1485 | 1485 | ||
1486 | if(skb->len < SMC_HEADER_SIZE || skb->len > tp->max_packet_size) return (-1); | 1486 | if(skb->len < SMC_HEADER_SIZE || skb->len > tp->max_packet_size) |
1487 | return -1; | ||
1487 | 1488 | ||
1488 | smctr_enable_16bit(dev); | 1489 | smctr_enable_16bit(dev); |
1489 | smctr_set_page(dev, (__u8 *)tp->ram_access); | 1490 | smctr_set_page(dev, (__u8 *)tp->ram_access); |
@@ -1492,7 +1493,7 @@ static int smctr_hardware_send_packet(struct net_device *dev, | |||
1492 | == (FCBlock *)(-1L)) | 1493 | == (FCBlock *)(-1L)) |
1493 | { | 1494 | { |
1494 | smctr_disable_16bit(dev); | 1495 | smctr_disable_16bit(dev); |
1495 | return (-1); | 1496 | return -1; |
1496 | } | 1497 | } |
1497 | 1498 | ||
1498 | smctr_tx_move_frame(dev, skb, | 1499 | smctr_tx_move_frame(dev, skb, |
@@ -1508,7 +1509,7 @@ static int smctr_hardware_send_packet(struct net_device *dev, | |||
1508 | smctr_disable_16bit(dev); | 1509 | smctr_disable_16bit(dev); |
1509 | } | 1510 | } |
1510 | 1511 | ||
1511 | return (0); | 1512 | return 0; |
1512 | } | 1513 | } |
1513 | 1514 | ||
1514 | static int smctr_init_acbs(struct net_device *dev) | 1515 | static int smctr_init_acbs(struct net_device *dev) |
@@ -1552,7 +1553,7 @@ static int smctr_init_acbs(struct net_device *dev) | |||
1552 | tp->acb_curr = tp->acb_head->next_ptr; | 1553 | tp->acb_curr = tp->acb_head->next_ptr; |
1553 | tp->num_acbs_used = 0; | 1554 | tp->num_acbs_used = 0; |
1554 | 1555 | ||
1555 | return (0); | 1556 | return 0; |
1556 | } | 1557 | } |
1557 | 1558 | ||
1558 | static int smctr_init_adapter(struct net_device *dev) | 1559 | static int smctr_init_adapter(struct net_device *dev) |
@@ -1590,13 +1591,14 @@ static int smctr_init_adapter(struct net_device *dev) | |||
1590 | 1591 | ||
1591 | if(smctr_checksum_firmware(dev)) | 1592 | if(smctr_checksum_firmware(dev)) |
1592 | { | 1593 | { |
1593 | printk(KERN_ERR "%s: Previously loaded firmware is missing\n",dev->name); return (-ENOENT); | 1594 | printk(KERN_ERR "%s: Previously loaded firmware is missing\n",dev->name); |
1595 | return -ENOENT; | ||
1594 | } | 1596 | } |
1595 | 1597 | ||
1596 | if((err = smctr_ram_memory_test(dev))) | 1598 | if((err = smctr_ram_memory_test(dev))) |
1597 | { | 1599 | { |
1598 | printk(KERN_ERR "%s: RAM memory test failed.\n", dev->name); | 1600 | printk(KERN_ERR "%s: RAM memory test failed.\n", dev->name); |
1599 | return (-EIO); | 1601 | return -EIO; |
1600 | } | 1602 | } |
1601 | 1603 | ||
1602 | smctr_set_rx_look_ahead(dev); | 1604 | smctr_set_rx_look_ahead(dev); |
@@ -1608,7 +1610,7 @@ static int smctr_init_adapter(struct net_device *dev) | |||
1608 | { | 1610 | { |
1609 | printk(KERN_ERR "%s: Initialization of card failed (%d)\n", | 1611 | printk(KERN_ERR "%s: Initialization of card failed (%d)\n", |
1610 | dev->name, err); | 1612 | dev->name, err); |
1611 | return (-EINVAL); | 1613 | return -EINVAL; |
1612 | } | 1614 | } |
1613 | 1615 | ||
1614 | /* This routine clobbers the TRC's internal registers. */ | 1616 | /* This routine clobbers the TRC's internal registers. */ |
@@ -1616,7 +1618,7 @@ static int smctr_init_adapter(struct net_device *dev) | |||
1616 | { | 1618 | { |
1617 | printk(KERN_ERR "%s: Card failed internal self test (%d)\n", | 1619 | printk(KERN_ERR "%s: Card failed internal self test (%d)\n", |
1618 | dev->name, err); | 1620 | dev->name, err); |
1619 | return (-EINVAL); | 1621 | return -EINVAL; |
1620 | } | 1622 | } |
1621 | 1623 | ||
1622 | /* Re-Initialize adapter's internal registers */ | 1624 | /* Re-Initialize adapter's internal registers */ |
@@ -1625,17 +1627,17 @@ static int smctr_init_adapter(struct net_device *dev) | |||
1625 | { | 1627 | { |
1626 | printk(KERN_ERR "%s: Initialization of card failed (%d)\n", | 1628 | printk(KERN_ERR "%s: Initialization of card failed (%d)\n", |
1627 | dev->name, err); | 1629 | dev->name, err); |
1628 | return (-EINVAL); | 1630 | return -EINVAL; |
1629 | } | 1631 | } |
1630 | 1632 | ||
1631 | smctr_enable_bic_int(dev); | 1633 | smctr_enable_bic_int(dev); |
1632 | 1634 | ||
1633 | if((err = smctr_issue_enable_int_cmd(dev, TRC_INTERRUPT_ENABLE_MASK))) | 1635 | if((err = smctr_issue_enable_int_cmd(dev, TRC_INTERRUPT_ENABLE_MASK))) |
1634 | return (err); | 1636 | return err; |
1635 | 1637 | ||
1636 | smctr_disable_16bit(dev); | 1638 | smctr_disable_16bit(dev); |
1637 | 1639 | ||
1638 | return (0); | 1640 | return 0; |
1639 | } | 1641 | } |
1640 | 1642 | ||
1641 | static int smctr_init_card_real(struct net_device *dev) | 1643 | static int smctr_init_card_real(struct net_device *dev) |
@@ -1703,15 +1705,15 @@ static int smctr_init_card_real(struct net_device *dev) | |||
1703 | smctr_init_shared_memory(dev); | 1705 | smctr_init_shared_memory(dev); |
1704 | 1706 | ||
1705 | if((err = smctr_issue_init_timers_cmd(dev))) | 1707 | if((err = smctr_issue_init_timers_cmd(dev))) |
1706 | return (err); | 1708 | return err; |
1707 | 1709 | ||
1708 | if((err = smctr_issue_init_txrx_cmd(dev))) | 1710 | if((err = smctr_issue_init_txrx_cmd(dev))) |
1709 | { | 1711 | { |
1710 | printk(KERN_ERR "%s: Hardware failure\n", dev->name); | 1712 | printk(KERN_ERR "%s: Hardware failure\n", dev->name); |
1711 | return (err); | 1713 | return err; |
1712 | } | 1714 | } |
1713 | 1715 | ||
1714 | return (0); | 1716 | return 0; |
1715 | } | 1717 | } |
1716 | 1718 | ||
1717 | static int smctr_init_rx_bdbs(struct net_device *dev) | 1719 | static int smctr_init_rx_bdbs(struct net_device *dev) |
@@ -1763,7 +1765,7 @@ static int smctr_init_rx_bdbs(struct net_device *dev) | |||
1763 | tp->rx_bdb_curr[i] = tp->rx_bdb_head[i]->next_ptr; | 1765 | tp->rx_bdb_curr[i] = tp->rx_bdb_head[i]->next_ptr; |
1764 | } | 1766 | } |
1765 | 1767 | ||
1766 | return (0); | 1768 | return 0; |
1767 | } | 1769 | } |
1768 | 1770 | ||
1769 | static int smctr_init_rx_fcbs(struct net_device *dev) | 1771 | static int smctr_init_rx_fcbs(struct net_device *dev) |
@@ -1813,7 +1815,7 @@ static int smctr_init_rx_fcbs(struct net_device *dev) | |||
1813 | tp->rx_fcb_curr[i] = tp->rx_fcb_head[i]->next_ptr; | 1815 | tp->rx_fcb_curr[i] = tp->rx_fcb_head[i]->next_ptr; |
1814 | } | 1816 | } |
1815 | 1817 | ||
1816 | return(0); | 1818 | return 0; |
1817 | } | 1819 | } |
1818 | 1820 | ||
1819 | static int smctr_init_shared_memory(struct net_device *dev) | 1821 | static int smctr_init_shared_memory(struct net_device *dev) |
@@ -1871,7 +1873,7 @@ static int smctr_init_shared_memory(struct net_device *dev) | |||
1871 | smctr_init_rx_bdbs(dev); | 1873 | smctr_init_rx_bdbs(dev); |
1872 | smctr_init_rx_fcbs(dev); | 1874 | smctr_init_rx_fcbs(dev); |
1873 | 1875 | ||
1874 | return (0); | 1876 | return 0; |
1875 | } | 1877 | } |
1876 | 1878 | ||
1877 | static int smctr_init_tx_bdbs(struct net_device *dev) | 1879 | static int smctr_init_tx_bdbs(struct net_device *dev) |
@@ -1901,7 +1903,7 @@ static int smctr_init_tx_bdbs(struct net_device *dev) | |||
1901 | tp->tx_bdb_head[i]->back_ptr = bdb; | 1903 | tp->tx_bdb_head[i]->back_ptr = bdb; |
1902 | } | 1904 | } |
1903 | 1905 | ||
1904 | return (0); | 1906 | return 0; |
1905 | } | 1907 | } |
1906 | 1908 | ||
1907 | static int smctr_init_tx_fcbs(struct net_device *dev) | 1909 | static int smctr_init_tx_fcbs(struct net_device *dev) |
@@ -1940,7 +1942,7 @@ static int smctr_init_tx_fcbs(struct net_device *dev) | |||
1940 | tp->num_tx_fcbs_used[i] = 0; | 1942 | tp->num_tx_fcbs_used[i] = 0; |
1941 | } | 1943 | } |
1942 | 1944 | ||
1943 | return (0); | 1945 | return 0; |
1944 | } | 1946 | } |
1945 | 1947 | ||
1946 | static int smctr_internal_self_test(struct net_device *dev) | 1948 | static int smctr_internal_self_test(struct net_device *dev) |
@@ -1949,33 +1951,33 @@ static int smctr_internal_self_test(struct net_device *dev) | |||
1949 | int err; | 1951 | int err; |
1950 | 1952 | ||
1951 | if((err = smctr_issue_test_internal_rom_cmd(dev))) | 1953 | if((err = smctr_issue_test_internal_rom_cmd(dev))) |
1952 | return (err); | 1954 | return err; |
1953 | 1955 | ||
1954 | if((err = smctr_wait_cmd(dev))) | 1956 | if((err = smctr_wait_cmd(dev))) |
1955 | return (err); | 1957 | return err; |
1956 | 1958 | ||
1957 | if(tp->acb_head->cmd_done_status & 0xff) | 1959 | if(tp->acb_head->cmd_done_status & 0xff) |
1958 | return (-1); | 1960 | return -1; |
1959 | 1961 | ||
1960 | if((err = smctr_issue_test_hic_cmd(dev))) | 1962 | if((err = smctr_issue_test_hic_cmd(dev))) |
1961 | return (err); | 1963 | return err; |
1962 | 1964 | ||
1963 | if((err = smctr_wait_cmd(dev))) | 1965 | if((err = smctr_wait_cmd(dev))) |
1964 | return (err); | 1966 | return err; |
1965 | 1967 | ||
1966 | if(tp->acb_head->cmd_done_status & 0xff) | 1968 | if(tp->acb_head->cmd_done_status & 0xff) |
1967 | return (-1); | 1969 | return -1; |
1968 | 1970 | ||
1969 | if((err = smctr_issue_test_mac_reg_cmd(dev))) | 1971 | if((err = smctr_issue_test_mac_reg_cmd(dev))) |
1970 | return (err); | 1972 | return err; |
1971 | 1973 | ||
1972 | if((err = smctr_wait_cmd(dev))) | 1974 | if((err = smctr_wait_cmd(dev))) |
1973 | return (err); | 1975 | return err; |
1974 | 1976 | ||
1975 | if(tp->acb_head->cmd_done_status & 0xff) | 1977 | if(tp->acb_head->cmd_done_status & 0xff) |
1976 | return (-1); | 1978 | return -1; |
1977 | 1979 | ||
1978 | return (0); | 1980 | return 0; |
1979 | } | 1981 | } |
1980 | 1982 | ||
1981 | /* | 1983 | /* |
@@ -2468,14 +2470,14 @@ static int smctr_issue_enable_int_cmd(struct net_device *dev, | |||
2468 | int err; | 2470 | int err; |
2469 | 2471 | ||
2470 | if((err = smctr_wait_while_cbusy(dev))) | 2472 | if((err = smctr_wait_while_cbusy(dev))) |
2471 | return (err); | 2473 | return err; |
2472 | 2474 | ||
2473 | tp->sclb_ptr->int_mask_control = interrupt_enable_mask; | 2475 | tp->sclb_ptr->int_mask_control = interrupt_enable_mask; |
2474 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_CMD_CLEAR_INTERRUPT_MASK; | 2476 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_CMD_CLEAR_INTERRUPT_MASK; |
2475 | 2477 | ||
2476 | smctr_set_ctrl_attention(dev); | 2478 | smctr_set_ctrl_attention(dev); |
2477 | 2479 | ||
2478 | return (0); | 2480 | return 0; |
2479 | } | 2481 | } |
2480 | 2482 | ||
2481 | static int smctr_issue_int_ack(struct net_device *dev, __u16 iack_code, __u16 ibits) | 2483 | static int smctr_issue_int_ack(struct net_device *dev, __u16 iack_code, __u16 ibits) |
@@ -2483,7 +2485,7 @@ static int smctr_issue_int_ack(struct net_device *dev, __u16 iack_code, __u16 ib | |||
2483 | struct net_local *tp = netdev_priv(dev); | 2485 | struct net_local *tp = netdev_priv(dev); |
2484 | 2486 | ||
2485 | if(smctr_wait_while_cbusy(dev)) | 2487 | if(smctr_wait_while_cbusy(dev)) |
2486 | return (-1); | 2488 | return -1; |
2487 | 2489 | ||
2488 | tp->sclb_ptr->int_mask_control = ibits; | 2490 | tp->sclb_ptr->int_mask_control = ibits; |
2489 | tp->sclb_ptr->iack_code = iack_code << 1; /* use the offset from base */ tp->sclb_ptr->resume_control = 0; | 2491 | tp->sclb_ptr->iack_code = iack_code << 1; /* use the offset from base */ tp->sclb_ptr->resume_control = 0; |
@@ -2491,7 +2493,7 @@ static int smctr_issue_int_ack(struct net_device *dev, __u16 iack_code, __u16 ib | |||
2491 | 2493 | ||
2492 | smctr_set_ctrl_attention(dev); | 2494 | smctr_set_ctrl_attention(dev); |
2493 | 2495 | ||
2494 | return (0); | 2496 | return 0; |
2495 | } | 2497 | } |
2496 | 2498 | ||
2497 | static int smctr_issue_init_timers_cmd(struct net_device *dev) | 2499 | static int smctr_issue_init_timers_cmd(struct net_device *dev) |
@@ -2502,10 +2504,10 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev) | |||
2502 | __u16 *pTimer_Struc = (__u16 *)tp->misc_command_data; | 2504 | __u16 *pTimer_Struc = (__u16 *)tp->misc_command_data; |
2503 | 2505 | ||
2504 | if((err = smctr_wait_while_cbusy(dev))) | 2506 | if((err = smctr_wait_while_cbusy(dev))) |
2505 | return (err); | 2507 | return err; |
2506 | 2508 | ||
2507 | if((err = smctr_wait_cmd(dev))) | 2509 | if((err = smctr_wait_cmd(dev))) |
2508 | return (err); | 2510 | return err; |
2509 | 2511 | ||
2510 | tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; | 2512 | tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; |
2511 | tp->config_word1 = 0; | 2513 | tp->config_word1 = 0; |
@@ -2648,7 +2650,7 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev) | |||
2648 | 2650 | ||
2649 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_INIT_TRC_TIMERS, 0); | 2651 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_INIT_TRC_TIMERS, 0); |
2650 | 2652 | ||
2651 | return (err); | 2653 | return err; |
2652 | } | 2654 | } |
2653 | 2655 | ||
2654 | static int smctr_issue_init_txrx_cmd(struct net_device *dev) | 2656 | static int smctr_issue_init_txrx_cmd(struct net_device *dev) |
@@ -2659,12 +2661,12 @@ static int smctr_issue_init_txrx_cmd(struct net_device *dev) | |||
2659 | void **txrx_ptrs = (void *)tp->misc_command_data; | 2661 | void **txrx_ptrs = (void *)tp->misc_command_data; |
2660 | 2662 | ||
2661 | if((err = smctr_wait_while_cbusy(dev))) | 2663 | if((err = smctr_wait_while_cbusy(dev))) |
2662 | return (err); | 2664 | return err; |
2663 | 2665 | ||
2664 | if((err = smctr_wait_cmd(dev))) | 2666 | if((err = smctr_wait_cmd(dev))) |
2665 | { | 2667 | { |
2666 | printk(KERN_ERR "%s: Hardware failure\n", dev->name); | 2668 | printk(KERN_ERR "%s: Hardware failure\n", dev->name); |
2667 | return (err); | 2669 | return err; |
2668 | } | 2670 | } |
2669 | 2671 | ||
2670 | /* Initialize Transmit Queue Pointers that are used, to point to | 2672 | /* Initialize Transmit Queue Pointers that are used, to point to |
@@ -2695,7 +2697,7 @@ static int smctr_issue_init_txrx_cmd(struct net_device *dev) | |||
2695 | 2697 | ||
2696 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_INIT_TX_RX, 0); | 2698 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_INIT_TX_RX, 0); |
2697 | 2699 | ||
2698 | return (err); | 2700 | return err; |
2699 | } | 2701 | } |
2700 | 2702 | ||
2701 | static int smctr_issue_insert_cmd(struct net_device *dev) | 2703 | static int smctr_issue_insert_cmd(struct net_device *dev) |
@@ -2704,7 +2706,7 @@ static int smctr_issue_insert_cmd(struct net_device *dev) | |||
2704 | 2706 | ||
2705 | err = smctr_setup_single_cmd(dev, ACB_CMD_INSERT, ACB_SUB_CMD_NOP); | 2707 | err = smctr_setup_single_cmd(dev, ACB_CMD_INSERT, ACB_SUB_CMD_NOP); |
2706 | 2708 | ||
2707 | return (err); | 2709 | return err; |
2708 | } | 2710 | } |
2709 | 2711 | ||
2710 | static int smctr_issue_read_ring_status_cmd(struct net_device *dev) | 2712 | static int smctr_issue_read_ring_status_cmd(struct net_device *dev) |
@@ -2712,15 +2714,15 @@ static int smctr_issue_read_ring_status_cmd(struct net_device *dev) | |||
2712 | int err; | 2714 | int err; |
2713 | 2715 | ||
2714 | if((err = smctr_wait_while_cbusy(dev))) | 2716 | if((err = smctr_wait_while_cbusy(dev))) |
2715 | return (err); | 2717 | return err; |
2716 | 2718 | ||
2717 | if((err = smctr_wait_cmd(dev))) | 2719 | if((err = smctr_wait_cmd(dev))) |
2718 | return (err); | 2720 | return err; |
2719 | 2721 | ||
2720 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_READ_TRC_STATUS, | 2722 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_READ_TRC_STATUS, |
2721 | RW_TRC_STATUS_BLOCK); | 2723 | RW_TRC_STATUS_BLOCK); |
2722 | 2724 | ||
2723 | return (err); | 2725 | return err; |
2724 | } | 2726 | } |
2725 | 2727 | ||
2726 | static int smctr_issue_read_word_cmd(struct net_device *dev, __u16 aword_cnt) | 2728 | static int smctr_issue_read_word_cmd(struct net_device *dev, __u16 aword_cnt) |
@@ -2728,15 +2730,15 @@ static int smctr_issue_read_word_cmd(struct net_device *dev, __u16 aword_cnt) | |||
2728 | int err; | 2730 | int err; |
2729 | 2731 | ||
2730 | if((err = smctr_wait_while_cbusy(dev))) | 2732 | if((err = smctr_wait_while_cbusy(dev))) |
2731 | return (err); | 2733 | return err; |
2732 | 2734 | ||
2733 | if((err = smctr_wait_cmd(dev))) | 2735 | if((err = smctr_wait_cmd(dev))) |
2734 | return (err); | 2736 | return err; |
2735 | 2737 | ||
2736 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_READ_VALUE, | 2738 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_READ_VALUE, |
2737 | aword_cnt); | 2739 | aword_cnt); |
2738 | 2740 | ||
2739 | return (err); | 2741 | return err; |
2740 | } | 2742 | } |
2741 | 2743 | ||
2742 | static int smctr_issue_remove_cmd(struct net_device *dev) | 2744 | static int smctr_issue_remove_cmd(struct net_device *dev) |
@@ -2745,14 +2747,14 @@ static int smctr_issue_remove_cmd(struct net_device *dev) | |||
2745 | int err; | 2747 | int err; |
2746 | 2748 | ||
2747 | if((err = smctr_wait_while_cbusy(dev))) | 2749 | if((err = smctr_wait_while_cbusy(dev))) |
2748 | return (err); | 2750 | return err; |
2749 | 2751 | ||
2750 | tp->sclb_ptr->resume_control = 0; | 2752 | tp->sclb_ptr->resume_control = 0; |
2751 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_CMD_REMOVE; | 2753 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_CMD_REMOVE; |
2752 | 2754 | ||
2753 | smctr_set_ctrl_attention(dev); | 2755 | smctr_set_ctrl_attention(dev); |
2754 | 2756 | ||
2755 | return (0); | 2757 | return 0; |
2756 | } | 2758 | } |
2757 | 2759 | ||
2758 | static int smctr_issue_resume_acb_cmd(struct net_device *dev) | 2760 | static int smctr_issue_resume_acb_cmd(struct net_device *dev) |
@@ -2761,7 +2763,7 @@ static int smctr_issue_resume_acb_cmd(struct net_device *dev) | |||
2761 | int err; | 2763 | int err; |
2762 | 2764 | ||
2763 | if((err = smctr_wait_while_cbusy(dev))) | 2765 | if((err = smctr_wait_while_cbusy(dev))) |
2764 | return (err); | 2766 | return err; |
2765 | 2767 | ||
2766 | tp->sclb_ptr->resume_control = SCLB_RC_ACB; | 2768 | tp->sclb_ptr->resume_control = SCLB_RC_ACB; |
2767 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_RESUME_CONTROL_VALID; | 2769 | tp->sclb_ptr->valid_command = SCLB_VALID | SCLB_RESUME_CONTROL_VALID; |
@@ -2770,7 +2772,7 @@ static int smctr_issue_resume_acb_cmd(struct net_device *dev) | |||
2770 | 2772 | ||
2771 | smctr_set_ctrl_attention(dev); | 2773 | smctr_set_ctrl_attention(dev); |
2772 | 2774 | ||
2773 | return (0); | 2775 | return 0; |
2774 | } | 2776 | } |
2775 | 2777 | ||
2776 | static int smctr_issue_resume_rx_bdb_cmd(struct net_device *dev, __u16 queue) | 2778 | static int smctr_issue_resume_rx_bdb_cmd(struct net_device *dev, __u16 queue) |
@@ -2779,7 +2781,7 @@ static int smctr_issue_resume_rx_bdb_cmd(struct net_device *dev, __u16 queue) | |||
2779 | int err; | 2781 | int err; |
2780 | 2782 | ||
2781 | if((err = smctr_wait_while_cbusy(dev))) | 2783 | if((err = smctr_wait_while_cbusy(dev))) |
2782 | return (err); | 2784 | return err; |
2783 | 2785 | ||
2784 | if(queue == MAC_QUEUE) | 2786 | if(queue == MAC_QUEUE) |
2785 | tp->sclb_ptr->resume_control = SCLB_RC_RX_MAC_BDB; | 2787 | tp->sclb_ptr->resume_control = SCLB_RC_RX_MAC_BDB; |
@@ -2790,7 +2792,7 @@ static int smctr_issue_resume_rx_bdb_cmd(struct net_device *dev, __u16 queue) | |||
2790 | 2792 | ||
2791 | smctr_set_ctrl_attention(dev); | 2793 | smctr_set_ctrl_attention(dev); |
2792 | 2794 | ||
2793 | return (0); | 2795 | return 0; |
2794 | } | 2796 | } |
2795 | 2797 | ||
2796 | static int smctr_issue_resume_rx_fcb_cmd(struct net_device *dev, __u16 queue) | 2798 | static int smctr_issue_resume_rx_fcb_cmd(struct net_device *dev, __u16 queue) |
@@ -2801,7 +2803,7 @@ static int smctr_issue_resume_rx_fcb_cmd(struct net_device *dev, __u16 queue) | |||
2801 | printk(KERN_DEBUG "%s: smctr_issue_resume_rx_fcb_cmd\n", dev->name); | 2803 | printk(KERN_DEBUG "%s: smctr_issue_resume_rx_fcb_cmd\n", dev->name); |
2802 | 2804 | ||
2803 | if(smctr_wait_while_cbusy(dev)) | 2805 | if(smctr_wait_while_cbusy(dev)) |
2804 | return (-1); | 2806 | return -1; |
2805 | 2807 | ||
2806 | if(queue == MAC_QUEUE) | 2808 | if(queue == MAC_QUEUE) |
2807 | tp->sclb_ptr->resume_control = SCLB_RC_RX_MAC_FCB; | 2809 | tp->sclb_ptr->resume_control = SCLB_RC_RX_MAC_FCB; |
@@ -2812,7 +2814,7 @@ static int smctr_issue_resume_rx_fcb_cmd(struct net_device *dev, __u16 queue) | |||
2812 | 2814 | ||
2813 | smctr_set_ctrl_attention(dev); | 2815 | smctr_set_ctrl_attention(dev); |
2814 | 2816 | ||
2815 | return (0); | 2817 | return 0; |
2816 | } | 2818 | } |
2817 | 2819 | ||
2818 | static int smctr_issue_resume_tx_fcb_cmd(struct net_device *dev, __u16 queue) | 2820 | static int smctr_issue_resume_tx_fcb_cmd(struct net_device *dev, __u16 queue) |
@@ -2823,14 +2825,14 @@ static int smctr_issue_resume_tx_fcb_cmd(struct net_device *dev, __u16 queue) | |||
2823 | printk(KERN_DEBUG "%s: smctr_issue_resume_tx_fcb_cmd\n", dev->name); | 2825 | printk(KERN_DEBUG "%s: smctr_issue_resume_tx_fcb_cmd\n", dev->name); |
2824 | 2826 | ||
2825 | if(smctr_wait_while_cbusy(dev)) | 2827 | if(smctr_wait_while_cbusy(dev)) |
2826 | return (-1); | 2828 | return -1; |
2827 | 2829 | ||
2828 | tp->sclb_ptr->resume_control = (SCLB_RC_TFCB0 << queue); | 2830 | tp->sclb_ptr->resume_control = (SCLB_RC_TFCB0 << queue); |
2829 | tp->sclb_ptr->valid_command = SCLB_RESUME_CONTROL_VALID | SCLB_VALID; | 2831 | tp->sclb_ptr->valid_command = SCLB_RESUME_CONTROL_VALID | SCLB_VALID; |
2830 | 2832 | ||
2831 | smctr_set_ctrl_attention(dev); | 2833 | smctr_set_ctrl_attention(dev); |
2832 | 2834 | ||
2833 | return (0); | 2835 | return 0; |
2834 | } | 2836 | } |
2835 | 2837 | ||
2836 | static int smctr_issue_test_internal_rom_cmd(struct net_device *dev) | 2838 | static int smctr_issue_test_internal_rom_cmd(struct net_device *dev) |
@@ -2840,7 +2842,7 @@ static int smctr_issue_test_internal_rom_cmd(struct net_device *dev) | |||
2840 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, | 2842 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, |
2841 | TRC_INTERNAL_ROM_TEST); | 2843 | TRC_INTERNAL_ROM_TEST); |
2842 | 2844 | ||
2843 | return (err); | 2845 | return err; |
2844 | } | 2846 | } |
2845 | 2847 | ||
2846 | static int smctr_issue_test_hic_cmd(struct net_device *dev) | 2848 | static int smctr_issue_test_hic_cmd(struct net_device *dev) |
@@ -2850,7 +2852,7 @@ static int smctr_issue_test_hic_cmd(struct net_device *dev) | |||
2850 | err = smctr_setup_single_cmd(dev, ACB_CMD_HIC_TEST, | 2852 | err = smctr_setup_single_cmd(dev, ACB_CMD_HIC_TEST, |
2851 | TRC_HOST_INTERFACE_REG_TEST); | 2853 | TRC_HOST_INTERFACE_REG_TEST); |
2852 | 2854 | ||
2853 | return (err); | 2855 | return err; |
2854 | } | 2856 | } |
2855 | 2857 | ||
2856 | static int smctr_issue_test_mac_reg_cmd(struct net_device *dev) | 2858 | static int smctr_issue_test_mac_reg_cmd(struct net_device *dev) |
@@ -2860,7 +2862,7 @@ static int smctr_issue_test_mac_reg_cmd(struct net_device *dev) | |||
2860 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, | 2862 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, |
2861 | TRC_MAC_REGISTERS_TEST); | 2863 | TRC_MAC_REGISTERS_TEST); |
2862 | 2864 | ||
2863 | return (err); | 2865 | return err; |
2864 | } | 2866 | } |
2865 | 2867 | ||
2866 | static int smctr_issue_trc_loopback_cmd(struct net_device *dev) | 2868 | static int smctr_issue_trc_loopback_cmd(struct net_device *dev) |
@@ -2870,7 +2872,7 @@ static int smctr_issue_trc_loopback_cmd(struct net_device *dev) | |||
2870 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, | 2872 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, |
2871 | TRC_INTERNAL_LOOPBACK); | 2873 | TRC_INTERNAL_LOOPBACK); |
2872 | 2874 | ||
2873 | return (err); | 2875 | return err; |
2874 | } | 2876 | } |
2875 | 2877 | ||
2876 | static int smctr_issue_tri_loopback_cmd(struct net_device *dev) | 2878 | static int smctr_issue_tri_loopback_cmd(struct net_device *dev) |
@@ -2880,7 +2882,7 @@ static int smctr_issue_tri_loopback_cmd(struct net_device *dev) | |||
2880 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, | 2882 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, |
2881 | TRC_TRI_LOOPBACK); | 2883 | TRC_TRI_LOOPBACK); |
2882 | 2884 | ||
2883 | return (err); | 2885 | return err; |
2884 | } | 2886 | } |
2885 | 2887 | ||
2886 | static int smctr_issue_write_byte_cmd(struct net_device *dev, | 2888 | static int smctr_issue_write_byte_cmd(struct net_device *dev, |
@@ -2891,10 +2893,10 @@ static int smctr_issue_write_byte_cmd(struct net_device *dev, | |||
2891 | int err; | 2893 | int err; |
2892 | 2894 | ||
2893 | if((err = smctr_wait_while_cbusy(dev))) | 2895 | if((err = smctr_wait_while_cbusy(dev))) |
2894 | return (err); | 2896 | return err; |
2895 | 2897 | ||
2896 | if((err = smctr_wait_cmd(dev))) | 2898 | if((err = smctr_wait_cmd(dev))) |
2897 | return (err); | 2899 | return err; |
2898 | 2900 | ||
2899 | for(iword = 0, ibyte = 0; iword < (unsigned int)(aword_cnt & 0xff); | 2901 | for(iword = 0, ibyte = 0; iword < (unsigned int)(aword_cnt & 0xff); |
2900 | iword++, ibyte += 2) | 2902 | iword++, ibyte += 2) |
@@ -2903,8 +2905,8 @@ static int smctr_issue_write_byte_cmd(struct net_device *dev, | |||
2903 | | (*((__u8 *)byte + ibyte + 1)); | 2905 | | (*((__u8 *)byte + ibyte + 1)); |
2904 | } | 2906 | } |
2905 | 2907 | ||
2906 | return (smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_WRITE_VALUE, | 2908 | return smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_WRITE_VALUE, |
2907 | aword_cnt)); | 2909 | aword_cnt); |
2908 | } | 2910 | } |
2909 | 2911 | ||
2910 | static int smctr_issue_write_word_cmd(struct net_device *dev, | 2912 | static int smctr_issue_write_word_cmd(struct net_device *dev, |
@@ -2914,10 +2916,10 @@ static int smctr_issue_write_word_cmd(struct net_device *dev, | |||
2914 | unsigned int i, err; | 2916 | unsigned int i, err; |
2915 | 2917 | ||
2916 | if((err = smctr_wait_while_cbusy(dev))) | 2918 | if((err = smctr_wait_while_cbusy(dev))) |
2917 | return (err); | 2919 | return err; |
2918 | 2920 | ||
2919 | if((err = smctr_wait_cmd(dev))) | 2921 | if((err = smctr_wait_cmd(dev))) |
2920 | return (err); | 2922 | return err; |
2921 | 2923 | ||
2922 | for(i = 0; i < (unsigned int)(aword_cnt & 0xff); i++) | 2924 | for(i = 0; i < (unsigned int)(aword_cnt & 0xff); i++) |
2923 | tp->misc_command_data[i] = *((__u16 *)word + i); | 2925 | tp->misc_command_data[i] = *((__u16 *)word + i); |
@@ -2925,7 +2927,7 @@ static int smctr_issue_write_word_cmd(struct net_device *dev, | |||
2925 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_WRITE_VALUE, | 2927 | err = smctr_setup_single_cmd_w_data(dev, ACB_CMD_MCT_WRITE_VALUE, |
2926 | aword_cnt); | 2928 | aword_cnt); |
2927 | 2929 | ||
2928 | return (err); | 2930 | return err; |
2929 | } | 2931 | } |
2930 | 2932 | ||
2931 | static int smctr_join_complete_state(struct net_device *dev) | 2933 | static int smctr_join_complete_state(struct net_device *dev) |
@@ -2935,7 +2937,7 @@ static int smctr_join_complete_state(struct net_device *dev) | |||
2935 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, | 2937 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, |
2936 | JS_JOIN_COMPLETE_STATE); | 2938 | JS_JOIN_COMPLETE_STATE); |
2937 | 2939 | ||
2938 | return (err); | 2940 | return err; |
2939 | } | 2941 | } |
2940 | 2942 | ||
2941 | static int smctr_link_tx_fcbs_to_bdbs(struct net_device *dev) | 2943 | static int smctr_link_tx_fcbs_to_bdbs(struct net_device *dev) |
@@ -2959,7 +2961,7 @@ static int smctr_link_tx_fcbs_to_bdbs(struct net_device *dev) | |||
2959 | } | 2961 | } |
2960 | } | 2962 | } |
2961 | 2963 | ||
2962 | return (0); | 2964 | return 0; |
2963 | } | 2965 | } |
2964 | 2966 | ||
2965 | static int smctr_load_firmware(struct net_device *dev) | 2967 | static int smctr_load_firmware(struct net_device *dev) |
@@ -2974,7 +2976,7 @@ static int smctr_load_firmware(struct net_device *dev) | |||
2974 | 2976 | ||
2975 | if (request_firmware(&fw, "tr_smctr.bin", &dev->dev)) { | 2977 | if (request_firmware(&fw, "tr_smctr.bin", &dev->dev)) { |
2976 | printk(KERN_ERR "%s: firmware not found\n", dev->name); | 2978 | printk(KERN_ERR "%s: firmware not found\n", dev->name); |
2977 | return (UCODE_NOT_PRESENT); | 2979 | return UCODE_NOT_PRESENT; |
2978 | } | 2980 | } |
2979 | 2981 | ||
2980 | tp->num_of_tx_buffs = 4; | 2982 | tp->num_of_tx_buffs = 4; |
@@ -3036,7 +3038,7 @@ static int smctr_load_firmware(struct net_device *dev) | |||
3036 | smctr_disable_16bit(dev); | 3038 | smctr_disable_16bit(dev); |
3037 | out: | 3039 | out: |
3038 | release_firmware(fw); | 3040 | release_firmware(fw); |
3039 | return (err); | 3041 | return err; |
3040 | } | 3042 | } |
3041 | 3043 | ||
3042 | static int smctr_load_node_addr(struct net_device *dev) | 3044 | static int smctr_load_node_addr(struct net_device *dev) |
@@ -3052,7 +3054,7 @@ static int smctr_load_node_addr(struct net_device *dev) | |||
3052 | } | 3054 | } |
3053 | dev->addr_len = 6; | 3055 | dev->addr_len = 6; |
3054 | 3056 | ||
3055 | return (0); | 3057 | return 0; |
3056 | } | 3058 | } |
3057 | 3059 | ||
3058 | /* Lobe Media Test. | 3060 | /* Lobe Media Test. |
@@ -3146,14 +3148,14 @@ static int smctr_lobe_media_test_cmd(struct net_device *dev) | |||
3146 | if(smctr_wait_cmd(dev)) | 3148 | if(smctr_wait_cmd(dev)) |
3147 | { | 3149 | { |
3148 | printk(KERN_ERR "Lobe Failed test state\n"); | 3150 | printk(KERN_ERR "Lobe Failed test state\n"); |
3149 | return (LOBE_MEDIA_TEST_FAILED); | 3151 | return LOBE_MEDIA_TEST_FAILED; |
3150 | } | 3152 | } |
3151 | } | 3153 | } |
3152 | 3154 | ||
3153 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, | 3155 | err = smctr_setup_single_cmd(dev, ACB_CMD_MCT_TEST, |
3154 | TRC_LOBE_MEDIA_TEST); | 3156 | TRC_LOBE_MEDIA_TEST); |
3155 | 3157 | ||
3156 | return (err); | 3158 | return err; |
3157 | } | 3159 | } |
3158 | 3160 | ||
3159 | static int smctr_lobe_media_test_state(struct net_device *dev) | 3161 | static int smctr_lobe_media_test_state(struct net_device *dev) |
@@ -3163,7 +3165,7 @@ static int smctr_lobe_media_test_state(struct net_device *dev) | |||
3163 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, | 3165 | err = smctr_setup_single_cmd(dev, ACB_CMD_CHANGE_JOIN_STATE, |
3164 | JS_LOBE_TEST_STATE); | 3166 | JS_LOBE_TEST_STATE); |
3165 | 3167 | ||
3166 | return (err); | 3168 | return err; |
3167 | } | 3169 | } |
3168 | 3170 | ||
3169 | static int smctr_make_8025_hdr(struct net_device *dev, | 3171 | static int smctr_make_8025_hdr(struct net_device *dev, |
@@ -3212,7 +3214,7 @@ static int smctr_make_8025_hdr(struct net_device *dev, | |||
3212 | break; | 3214 | break; |
3213 | } | 3215 | } |
3214 | 3216 | ||
3215 | return (0); | 3217 | return 0; |
3216 | } | 3218 | } |
3217 | 3219 | ||
3218 | static int smctr_make_access_pri(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3220 | static int smctr_make_access_pri(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3225,7 +3227,7 @@ static int smctr_make_access_pri(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3225 | tsv->svv[0] = MSB(tp->authorized_access_priority); | 3227 | tsv->svv[0] = MSB(tp->authorized_access_priority); |
3226 | tsv->svv[1] = LSB(tp->authorized_access_priority); | 3228 | tsv->svv[1] = LSB(tp->authorized_access_priority); |
3227 | 3229 | ||
3228 | return (0); | 3230 | return 0; |
3229 | } | 3231 | } |
3230 | 3232 | ||
3231 | static int smctr_make_addr_mod(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3233 | static int smctr_make_addr_mod(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3236,7 +3238,7 @@ static int smctr_make_addr_mod(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3236 | tsv->svv[0] = 0; | 3238 | tsv->svv[0] = 0; |
3237 | tsv->svv[1] = 0; | 3239 | tsv->svv[1] = 0; |
3238 | 3240 | ||
3239 | return (0); | 3241 | return 0; |
3240 | } | 3242 | } |
3241 | 3243 | ||
3242 | static int smctr_make_auth_funct_class(struct net_device *dev, | 3244 | static int smctr_make_auth_funct_class(struct net_device *dev, |
@@ -3250,7 +3252,7 @@ static int smctr_make_auth_funct_class(struct net_device *dev, | |||
3250 | tsv->svv[0] = MSB(tp->authorized_function_classes); | 3252 | tsv->svv[0] = MSB(tp->authorized_function_classes); |
3251 | tsv->svv[1] = LSB(tp->authorized_function_classes); | 3253 | tsv->svv[1] = LSB(tp->authorized_function_classes); |
3252 | 3254 | ||
3253 | return (0); | 3255 | return 0; |
3254 | } | 3256 | } |
3255 | 3257 | ||
3256 | static int smctr_make_corr(struct net_device *dev, | 3258 | static int smctr_make_corr(struct net_device *dev, |
@@ -3262,7 +3264,7 @@ static int smctr_make_corr(struct net_device *dev, | |||
3262 | tsv->svv[0] = MSB(correlator); | 3264 | tsv->svv[0] = MSB(correlator); |
3263 | tsv->svv[1] = LSB(correlator); | 3265 | tsv->svv[1] = LSB(correlator); |
3264 | 3266 | ||
3265 | return (0); | 3267 | return 0; |
3266 | } | 3268 | } |
3267 | 3269 | ||
3268 | static int smctr_make_funct_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3270 | static int smctr_make_funct_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3280,7 +3282,7 @@ static int smctr_make_funct_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3280 | tsv->svv[2] = MSB(tp->misc_command_data[1]); | 3282 | tsv->svv[2] = MSB(tp->misc_command_data[1]); |
3281 | tsv->svv[3] = LSB(tp->misc_command_data[1]); | 3283 | tsv->svv[3] = LSB(tp->misc_command_data[1]); |
3282 | 3284 | ||
3283 | return (0); | 3285 | return 0; |
3284 | } | 3286 | } |
3285 | 3287 | ||
3286 | static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3288 | static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3305,7 +3307,7 @@ static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3305 | tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) | 3307 | tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) |
3306 | tsv->svv[0] = 0x00; | 3308 | tsv->svv[0] = 0x00; |
3307 | 3309 | ||
3308 | return (0); | 3310 | return 0; |
3309 | } | 3311 | } |
3310 | 3312 | ||
3311 | static int smctr_make_phy_drop_num(struct net_device *dev, | 3313 | static int smctr_make_phy_drop_num(struct net_device *dev, |
@@ -3324,7 +3326,7 @@ static int smctr_make_phy_drop_num(struct net_device *dev, | |||
3324 | tsv->svv[2] = MSB(tp->misc_command_data[1]); | 3326 | tsv->svv[2] = MSB(tp->misc_command_data[1]); |
3325 | tsv->svv[3] = LSB(tp->misc_command_data[1]); | 3327 | tsv->svv[3] = LSB(tp->misc_command_data[1]); |
3326 | 3328 | ||
3327 | return (0); | 3329 | return 0; |
3328 | } | 3330 | } |
3329 | 3331 | ||
3330 | static int smctr_make_product_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3332 | static int smctr_make_product_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3337,7 +3339,7 @@ static int smctr_make_product_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3337 | for(i = 0; i < 18; i++) | 3339 | for(i = 0; i < 18; i++) |
3338 | tsv->svv[i] = 0xF0; | 3340 | tsv->svv[i] = 0xF0; |
3339 | 3341 | ||
3340 | return (0); | 3342 | return 0; |
3341 | } | 3343 | } |
3342 | 3344 | ||
3343 | static int smctr_make_station_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3345 | static int smctr_make_station_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3358,7 +3360,7 @@ static int smctr_make_station_id(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3358 | tsv->svv[4] = MSB(tp->misc_command_data[2]); | 3360 | tsv->svv[4] = MSB(tp->misc_command_data[2]); |
3359 | tsv->svv[5] = LSB(tp->misc_command_data[2]); | 3361 | tsv->svv[5] = LSB(tp->misc_command_data[2]); |
3360 | 3362 | ||
3361 | return (0); | 3363 | return 0; |
3362 | } | 3364 | } |
3363 | 3365 | ||
3364 | static int smctr_make_ring_station_status(struct net_device *dev, | 3366 | static int smctr_make_ring_station_status(struct net_device *dev, |
@@ -3374,7 +3376,7 @@ static int smctr_make_ring_station_status(struct net_device *dev, | |||
3374 | tsv->svv[4] = 0; | 3376 | tsv->svv[4] = 0; |
3375 | tsv->svv[5] = 0; | 3377 | tsv->svv[5] = 0; |
3376 | 3378 | ||
3377 | return (0); | 3379 | return 0; |
3378 | } | 3380 | } |
3379 | 3381 | ||
3380 | static int smctr_make_ring_station_version(struct net_device *dev, | 3382 | static int smctr_make_ring_station_version(struct net_device *dev, |
@@ -3400,7 +3402,7 @@ static int smctr_make_ring_station_version(struct net_device *dev, | |||
3400 | else | 3402 | else |
3401 | tsv->svv[9] = 0xc4; /* EBCDIC - D */ | 3403 | tsv->svv[9] = 0xc4; /* EBCDIC - D */ |
3402 | 3404 | ||
3403 | return (0); | 3405 | return 0; |
3404 | } | 3406 | } |
3405 | 3407 | ||
3406 | static int smctr_make_tx_status_code(struct net_device *dev, | 3408 | static int smctr_make_tx_status_code(struct net_device *dev, |
@@ -3414,7 +3416,7 @@ static int smctr_make_tx_status_code(struct net_device *dev, | |||
3414 | /* Stripped frame status of Transmitted Frame */ | 3416 | /* Stripped frame status of Transmitted Frame */ |
3415 | tsv->svv[1] = tx_fstatus & 0xff; | 3417 | tsv->svv[1] = tx_fstatus & 0xff; |
3416 | 3418 | ||
3417 | return (0); | 3419 | return 0; |
3418 | } | 3420 | } |
3419 | 3421 | ||
3420 | static int smctr_make_upstream_neighbor_addr(struct net_device *dev, | 3422 | static int smctr_make_upstream_neighbor_addr(struct net_device *dev, |
@@ -3436,7 +3438,7 @@ static int smctr_make_upstream_neighbor_addr(struct net_device *dev, | |||
3436 | tsv->svv[4] = MSB(tp->misc_command_data[2]); | 3438 | tsv->svv[4] = MSB(tp->misc_command_data[2]); |
3437 | tsv->svv[5] = LSB(tp->misc_command_data[2]); | 3439 | tsv->svv[5] = LSB(tp->misc_command_data[2]); |
3438 | 3440 | ||
3439 | return (0); | 3441 | return 0; |
3440 | } | 3442 | } |
3441 | 3443 | ||
3442 | static int smctr_make_wrap_data(struct net_device *dev, MAC_SUB_VECTOR *tsv) | 3444 | static int smctr_make_wrap_data(struct net_device *dev, MAC_SUB_VECTOR *tsv) |
@@ -3444,7 +3446,7 @@ static int smctr_make_wrap_data(struct net_device *dev, MAC_SUB_VECTOR *tsv) | |||
3444 | tsv->svi = WRAP_DATA; | 3446 | tsv->svi = WRAP_DATA; |
3445 | tsv->svl = S_WRAP_DATA; | 3447 | tsv->svl = S_WRAP_DATA; |
3446 | 3448 | ||
3447 | return (0); | 3449 | return 0; |
3448 | } | 3450 | } |
3449 | 3451 | ||
3450 | /* | 3452 | /* |
@@ -3464,9 +3466,9 @@ static int smctr_open(struct net_device *dev) | |||
3464 | 3466 | ||
3465 | err = smctr_init_adapter(dev); | 3467 | err = smctr_init_adapter(dev); |
3466 | if(err < 0) | 3468 | if(err < 0) |
3467 | return (err); | 3469 | return err; |
3468 | 3470 | ||
3469 | return (err); | 3471 | return err; |
3470 | } | 3472 | } |
3471 | 3473 | ||
3472 | /* Interrupt driven open of Token card. */ | 3474 | /* Interrupt driven open of Token card. */ |
@@ -3481,9 +3483,9 @@ static int smctr_open_tr(struct net_device *dev) | |||
3481 | 3483 | ||
3482 | /* Now we can actually open the adapter. */ | 3484 | /* Now we can actually open the adapter. */ |
3483 | if(tp->status == OPEN) | 3485 | if(tp->status == OPEN) |
3484 | return (0); | 3486 | return 0; |
3485 | if(tp->status != INITIALIZED) | 3487 | if(tp->status != INITIALIZED) |
3486 | return (-1); | 3488 | return -1; |
3487 | 3489 | ||
3488 | /* FIXME: it would work a lot better if we masked the irq sources | 3490 | /* FIXME: it would work a lot better if we masked the irq sources |
3489 | on the card here, then we could skip the locking and poll nicely */ | 3491 | on the card here, then we could skip the locking and poll nicely */ |
@@ -3560,7 +3562,7 @@ static int smctr_open_tr(struct net_device *dev) | |||
3560 | out: | 3562 | out: |
3561 | spin_unlock_irqrestore(&tp->lock, flags); | 3563 | spin_unlock_irqrestore(&tp->lock, flags); |
3562 | 3564 | ||
3563 | return (err); | 3565 | return err; |
3564 | } | 3566 | } |
3565 | 3567 | ||
3566 | /* Check for a network adapter of this type, | 3568 | /* Check for a network adapter of this type, |
@@ -3675,7 +3677,7 @@ static int __init smctr_probe1(struct net_device *dev, int ioaddr) | |||
3675 | 3677 | ||
3676 | dev->netdev_ops = &smctr_netdev_ops; | 3678 | dev->netdev_ops = &smctr_netdev_ops; |
3677 | dev->watchdog_timeo = HZ; | 3679 | dev->watchdog_timeo = HZ; |
3678 | return (0); | 3680 | return 0; |
3679 | 3681 | ||
3680 | out: | 3682 | out: |
3681 | return err; | 3683 | return err; |
@@ -3699,13 +3701,13 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3699 | case INIT: | 3701 | case INIT: |
3700 | if((rcode = smctr_rcv_init(dev, rmf, &correlator)) == HARDWARE_FAILED) | 3702 | if((rcode = smctr_rcv_init(dev, rmf, &correlator)) == HARDWARE_FAILED) |
3701 | { | 3703 | { |
3702 | return (rcode); | 3704 | return rcode; |
3703 | } | 3705 | } |
3704 | 3706 | ||
3705 | if((err = smctr_send_rsp(dev, rmf, rcode, | 3707 | if((err = smctr_send_rsp(dev, rmf, rcode, |
3706 | correlator))) | 3708 | correlator))) |
3707 | { | 3709 | { |
3708 | return (err); | 3710 | return err; |
3709 | } | 3711 | } |
3710 | break; | 3712 | break; |
3711 | 3713 | ||
@@ -3713,13 +3715,13 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3713 | if((rcode = smctr_rcv_chg_param(dev, rmf, | 3715 | if((rcode = smctr_rcv_chg_param(dev, rmf, |
3714 | &correlator)) ==HARDWARE_FAILED) | 3716 | &correlator)) ==HARDWARE_FAILED) |
3715 | { | 3717 | { |
3716 | return (rcode); | 3718 | return rcode; |
3717 | } | 3719 | } |
3718 | 3720 | ||
3719 | if((err = smctr_send_rsp(dev, rmf, rcode, | 3721 | if((err = smctr_send_rsp(dev, rmf, rcode, |
3720 | correlator))) | 3722 | correlator))) |
3721 | { | 3723 | { |
3722 | return (err); | 3724 | return err; |
3723 | } | 3725 | } |
3724 | break; | 3726 | break; |
3725 | 3727 | ||
@@ -3728,16 +3730,16 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3728 | rmf, &correlator)) != POSITIVE_ACK) | 3730 | rmf, &correlator)) != POSITIVE_ACK) |
3729 | { | 3731 | { |
3730 | if(rcode == HARDWARE_FAILED) | 3732 | if(rcode == HARDWARE_FAILED) |
3731 | return (rcode); | 3733 | return rcode; |
3732 | else | 3734 | else |
3733 | return (smctr_send_rsp(dev, rmf, | 3735 | return smctr_send_rsp(dev, rmf, |
3734 | rcode, correlator)); | 3736 | rcode, correlator); |
3735 | } | 3737 | } |
3736 | 3738 | ||
3737 | if((err = smctr_send_rpt_addr(dev, rmf, | 3739 | if((err = smctr_send_rpt_addr(dev, rmf, |
3738 | correlator))) | 3740 | correlator))) |
3739 | { | 3741 | { |
3740 | return (err); | 3742 | return err; |
3741 | } | 3743 | } |
3742 | break; | 3744 | break; |
3743 | 3745 | ||
@@ -3746,17 +3748,17 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3746 | rmf, &correlator)) != POSITIVE_ACK) | 3748 | rmf, &correlator)) != POSITIVE_ACK) |
3747 | { | 3749 | { |
3748 | if(rcode == HARDWARE_FAILED) | 3750 | if(rcode == HARDWARE_FAILED) |
3749 | return (rcode); | 3751 | return rcode; |
3750 | else | 3752 | else |
3751 | return (smctr_send_rsp(dev, rmf, | 3753 | return smctr_send_rsp(dev, rmf, |
3752 | rcode, | 3754 | rcode, |
3753 | correlator)); | 3755 | correlator); |
3754 | } | 3756 | } |
3755 | 3757 | ||
3756 | if((err = smctr_send_rpt_attch(dev, rmf, | 3758 | if((err = smctr_send_rpt_attch(dev, rmf, |
3757 | correlator))) | 3759 | correlator))) |
3758 | { | 3760 | { |
3759 | return (err); | 3761 | return err; |
3760 | } | 3762 | } |
3761 | break; | 3763 | break; |
3762 | 3764 | ||
@@ -3765,17 +3767,17 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3765 | rmf, &correlator)) != POSITIVE_ACK) | 3767 | rmf, &correlator)) != POSITIVE_ACK) |
3766 | { | 3768 | { |
3767 | if(rcode == HARDWARE_FAILED) | 3769 | if(rcode == HARDWARE_FAILED) |
3768 | return (rcode); | 3770 | return rcode; |
3769 | else | 3771 | else |
3770 | return (smctr_send_rsp(dev, rmf, | 3772 | return smctr_send_rsp(dev, rmf, |
3771 | rcode, | 3773 | rcode, |
3772 | correlator)); | 3774 | correlator); |
3773 | } | 3775 | } |
3774 | 3776 | ||
3775 | if((err = smctr_send_rpt_state(dev, rmf, | 3777 | if((err = smctr_send_rpt_state(dev, rmf, |
3776 | correlator))) | 3778 | correlator))) |
3777 | { | 3779 | { |
3778 | return (err); | 3780 | return err; |
3779 | } | 3781 | } |
3780 | break; | 3782 | break; |
3781 | 3783 | ||
@@ -3786,17 +3788,17 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3786 | != POSITIVE_ACK) | 3788 | != POSITIVE_ACK) |
3787 | { | 3789 | { |
3788 | if(rcode == HARDWARE_FAILED) | 3790 | if(rcode == HARDWARE_FAILED) |
3789 | return (rcode); | 3791 | return rcode; |
3790 | else | 3792 | else |
3791 | return (smctr_send_rsp(dev, rmf, | 3793 | return smctr_send_rsp(dev, rmf, |
3792 | rcode, | 3794 | rcode, |
3793 | correlator)); | 3795 | correlator); |
3794 | } | 3796 | } |
3795 | 3797 | ||
3796 | if((err = smctr_send_tx_forward(dev, rmf, | 3798 | if((err = smctr_send_tx_forward(dev, rmf, |
3797 | &tx_fstatus)) == HARDWARE_FAILED) | 3799 | &tx_fstatus)) == HARDWARE_FAILED) |
3798 | { | 3800 | { |
3799 | return (err); | 3801 | return err; |
3800 | } | 3802 | } |
3801 | 3803 | ||
3802 | if(err == A_FRAME_WAS_FORWARDED) | 3804 | if(err == A_FRAME_WAS_FORWARDED) |
@@ -3805,7 +3807,7 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3805 | rmf, tx_fstatus)) | 3807 | rmf, tx_fstatus)) |
3806 | == HARDWARE_FAILED) | 3808 | == HARDWARE_FAILED) |
3807 | { | 3809 | { |
3808 | return (err); | 3810 | return err; |
3809 | } | 3811 | } |
3810 | } | 3812 | } |
3811 | break; | 3813 | break; |
@@ -3834,7 +3836,7 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3834 | if((err = smctr_send_rsp(dev, rmf,rcode, | 3836 | if((err = smctr_send_rsp(dev, rmf,rcode, |
3835 | correlator))) | 3837 | correlator))) |
3836 | { | 3838 | { |
3837 | return (err); | 3839 | return err; |
3838 | } | 3840 | } |
3839 | } | 3841 | } |
3840 | 3842 | ||
@@ -3899,7 +3901,7 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, | |||
3899 | err = 0; | 3901 | err = 0; |
3900 | } | 3902 | } |
3901 | 3903 | ||
3902 | return (err); | 3904 | return err; |
3903 | } | 3905 | } |
3904 | 3906 | ||
3905 | /* Adapter RAM test. Incremental word ODD boundary data test. */ | 3907 | /* Adapter RAM test. Incremental word ODD boundary data test. */ |
@@ -3942,7 +3944,7 @@ static int smctr_ram_memory_test(struct net_device *dev) | |||
3942 | err_offset = j; | 3944 | err_offset = j; |
3943 | err_word = word_read; | 3945 | err_word = word_read; |
3944 | err_pattern = word_pattern; | 3946 | err_pattern = word_pattern; |
3945 | return (RAM_TEST_FAILED); | 3947 | return RAM_TEST_FAILED; |
3946 | } | 3948 | } |
3947 | } | 3949 | } |
3948 | } | 3950 | } |
@@ -3966,14 +3968,14 @@ static int smctr_ram_memory_test(struct net_device *dev) | |||
3966 | err_offset = j; | 3968 | err_offset = j; |
3967 | err_word = word_read; | 3969 | err_word = word_read; |
3968 | err_pattern = word_pattern; | 3970 | err_pattern = word_pattern; |
3969 | return (RAM_TEST_FAILED); | 3971 | return RAM_TEST_FAILED; |
3970 | } | 3972 | } |
3971 | } | 3973 | } |
3972 | } | 3974 | } |
3973 | 3975 | ||
3974 | smctr_set_page(dev, (__u8 *)tp->ram_access); | 3976 | smctr_set_page(dev, (__u8 *)tp->ram_access); |
3975 | 3977 | ||
3976 | return (0); | 3978 | return 0; |
3977 | } | 3979 | } |
3978 | 3980 | ||
3979 | static int smctr_rcv_chg_param(struct net_device *dev, MAC_HEADER *rmf, | 3981 | static int smctr_rcv_chg_param(struct net_device *dev, MAC_HEADER *rmf, |
@@ -3986,7 +3988,7 @@ static int smctr_rcv_chg_param(struct net_device *dev, MAC_HEADER *rmf, | |||
3986 | 3988 | ||
3987 | /* This Frame can only come from a CRS */ | 3989 | /* This Frame can only come from a CRS */ |
3988 | if((rmf->dc_sc & SC_MASK) != SC_CRS) | 3990 | if((rmf->dc_sc & SC_MASK) != SC_CRS) |
3989 | return(E_INAPPROPRIATE_SOURCE_CLASS); | 3991 | return E_INAPPROPRIATE_SOURCE_CLASS; |
3990 | 3992 | ||
3991 | /* Remove MVID Length from total length. */ | 3993 | /* Remove MVID Length from total length. */ |
3992 | vlen = (signed short)rmf->vl - 4; | 3994 | vlen = (signed short)rmf->vl - 4; |
@@ -4058,7 +4060,7 @@ static int smctr_rcv_chg_param(struct net_device *dev, MAC_HEADER *rmf, | |||
4058 | } | 4060 | } |
4059 | } | 4061 | } |
4060 | 4062 | ||
4061 | return (rcode); | 4063 | return rcode; |
4062 | } | 4064 | } |
4063 | 4065 | ||
4064 | static int smctr_rcv_init(struct net_device *dev, MAC_HEADER *rmf, | 4066 | static int smctr_rcv_init(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4071,7 +4073,7 @@ static int smctr_rcv_init(struct net_device *dev, MAC_HEADER *rmf, | |||
4071 | 4073 | ||
4072 | /* This Frame can only come from a RPS */ | 4074 | /* This Frame can only come from a RPS */ |
4073 | if((rmf->dc_sc & SC_MASK) != SC_RPS) | 4075 | if((rmf->dc_sc & SC_MASK) != SC_RPS) |
4074 | return (E_INAPPROPRIATE_SOURCE_CLASS); | 4076 | return E_INAPPROPRIATE_SOURCE_CLASS; |
4075 | 4077 | ||
4076 | /* Remove MVID Length from total length. */ | 4078 | /* Remove MVID Length from total length. */ |
4077 | vlen = (signed short)rmf->vl - 4; | 4079 | vlen = (signed short)rmf->vl - 4; |
@@ -4133,7 +4135,7 @@ static int smctr_rcv_init(struct net_device *dev, MAC_HEADER *rmf, | |||
4133 | } | 4135 | } |
4134 | } | 4136 | } |
4135 | 4137 | ||
4136 | return (rcode); | 4138 | return rcode; |
4137 | } | 4139 | } |
4138 | 4140 | ||
4139 | static int smctr_rcv_tx_forward(struct net_device *dev, MAC_HEADER *rmf) | 4141 | static int smctr_rcv_tx_forward(struct net_device *dev, MAC_HEADER *rmf) |
@@ -4145,7 +4147,7 @@ static int smctr_rcv_tx_forward(struct net_device *dev, MAC_HEADER *rmf) | |||
4145 | 4147 | ||
4146 | /* This Frame can only come from a CRS */ | 4148 | /* This Frame can only come from a CRS */ |
4147 | if((rmf->dc_sc & SC_MASK) != SC_CRS) | 4149 | if((rmf->dc_sc & SC_MASK) != SC_CRS) |
4148 | return (E_INAPPROPRIATE_SOURCE_CLASS); | 4150 | return E_INAPPROPRIATE_SOURCE_CLASS; |
4149 | 4151 | ||
4150 | /* Remove MVID Length from total length */ | 4152 | /* Remove MVID Length from total length */ |
4151 | vlen = (signed short)rmf->vl - 4; | 4153 | vlen = (signed short)rmf->vl - 4; |
@@ -4193,7 +4195,7 @@ static int smctr_rcv_tx_forward(struct net_device *dev, MAC_HEADER *rmf) | |||
4193 | } | 4195 | } |
4194 | } | 4196 | } |
4195 | 4197 | ||
4196 | return (rcode); | 4198 | return rcode; |
4197 | } | 4199 | } |
4198 | 4200 | ||
4199 | static int smctr_rcv_rq_addr_state_attch(struct net_device *dev, | 4201 | static int smctr_rcv_rq_addr_state_attch(struct net_device *dev, |
@@ -4250,7 +4252,7 @@ static int smctr_rcv_rq_addr_state_attch(struct net_device *dev, | |||
4250 | } | 4252 | } |
4251 | } | 4253 | } |
4252 | 4254 | ||
4253 | return (rcode); | 4255 | return rcode; |
4254 | } | 4256 | } |
4255 | 4257 | ||
4256 | static int smctr_rcv_unknown(struct net_device *dev, MAC_HEADER *rmf, | 4258 | static int smctr_rcv_unknown(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4284,7 +4286,7 @@ static int smctr_rcv_unknown(struct net_device *dev, MAC_HEADER *rmf, | |||
4284 | rsv = (MAC_SUB_VECTOR *)((__u32)rsv + rsv->svl); | 4286 | rsv = (MAC_SUB_VECTOR *)((__u32)rsv + rsv->svl); |
4285 | } | 4287 | } |
4286 | 4288 | ||
4287 | return (E_UNRECOGNIZED_VECTOR_ID); | 4289 | return E_UNRECOGNIZED_VECTOR_ID; |
4288 | } | 4290 | } |
4289 | 4291 | ||
4290 | /* | 4292 | /* |
@@ -4311,7 +4313,7 @@ static int smctr_reset_adapter(struct net_device *dev) | |||
4311 | */ | 4313 | */ |
4312 | outb(tp->trc_mask | CSR_CLRTINT | CSR_CLRCBUSY, ioaddr + CSR); | 4314 | outb(tp->trc_mask | CSR_CLRTINT | CSR_CLRCBUSY, ioaddr + CSR); |
4313 | 4315 | ||
4314 | return (0); | 4316 | return 0; |
4315 | } | 4317 | } |
4316 | 4318 | ||
4317 | static int smctr_restart_tx_chain(struct net_device *dev, short queue) | 4319 | static int smctr_restart_tx_chain(struct net_device *dev, short queue) |
@@ -4329,7 +4331,7 @@ static int smctr_restart_tx_chain(struct net_device *dev, short queue) | |||
4329 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); | 4331 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); |
4330 | } | 4332 | } |
4331 | 4333 | ||
4332 | return (err); | 4334 | return err; |
4333 | } | 4335 | } |
4334 | 4336 | ||
4335 | static int smctr_ring_status_chg(struct net_device *dev) | 4337 | static int smctr_ring_status_chg(struct net_device *dev) |
@@ -4371,7 +4373,7 @@ static int smctr_ring_status_chg(struct net_device *dev) | |||
4371 | } | 4373 | } |
4372 | 4374 | ||
4373 | if(!(tp->ring_status_flags & RING_STATUS_CHANGED)) | 4375 | if(!(tp->ring_status_flags & RING_STATUS_CHANGED)) |
4374 | return (0); | 4376 | return 0; |
4375 | 4377 | ||
4376 | switch(tp->ring_status) | 4378 | switch(tp->ring_status) |
4377 | { | 4379 | { |
@@ -4421,7 +4423,7 @@ static int smctr_ring_status_chg(struct net_device *dev) | |||
4421 | break; | 4423 | break; |
4422 | } | 4424 | } |
4423 | 4425 | ||
4424 | return (0); | 4426 | return 0; |
4425 | } | 4427 | } |
4426 | 4428 | ||
4427 | static int smctr_rx_frame(struct net_device *dev) | 4429 | static int smctr_rx_frame(struct net_device *dev) |
@@ -4486,7 +4488,7 @@ static int smctr_rx_frame(struct net_device *dev) | |||
4486 | break; | 4488 | break; |
4487 | } | 4489 | } |
4488 | 4490 | ||
4489 | return (err); | 4491 | return err; |
4490 | } | 4492 | } |
4491 | 4493 | ||
4492 | static int smctr_send_dat(struct net_device *dev) | 4494 | static int smctr_send_dat(struct net_device *dev) |
@@ -4502,7 +4504,7 @@ static int smctr_send_dat(struct net_device *dev) | |||
4502 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, | 4504 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, |
4503 | sizeof(MAC_HEADER))) == (FCBlock *)(-1L)) | 4505 | sizeof(MAC_HEADER))) == (FCBlock *)(-1L)) |
4504 | { | 4506 | { |
4505 | return (OUT_OF_RESOURCES); | 4507 | return OUT_OF_RESOURCES; |
4506 | } | 4508 | } |
4507 | 4509 | ||
4508 | /* Initialize DAT Data Fields. */ | 4510 | /* Initialize DAT Data Fields. */ |
@@ -4524,7 +4526,7 @@ static int smctr_send_dat(struct net_device *dev) | |||
4524 | 4526 | ||
4525 | /* Start Transmit. */ | 4527 | /* Start Transmit. */ |
4526 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) | 4528 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) |
4527 | return (err); | 4529 | return err; |
4528 | 4530 | ||
4529 | /* Wait for Transmit to Complete */ | 4531 | /* Wait for Transmit to Complete */ |
4530 | for(i = 0; i < 10000; i++) | 4532 | for(i = 0; i < 10000; i++) |
@@ -4538,7 +4540,7 @@ static int smctr_send_dat(struct net_device *dev) | |||
4538 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || | 4540 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || |
4539 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) | 4541 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) |
4540 | { | 4542 | { |
4541 | return (INITIALIZE_FAILED); | 4543 | return INITIALIZE_FAILED; |
4542 | } | 4544 | } |
4543 | 4545 | ||
4544 | /* De-allocated Tx FCB and Frame Buffer | 4546 | /* De-allocated Tx FCB and Frame Buffer |
@@ -4549,7 +4551,7 @@ static int smctr_send_dat(struct net_device *dev) | |||
4549 | tp->tx_queue_status[MAC_QUEUE] = NOT_TRANSMITING; | 4551 | tp->tx_queue_status[MAC_QUEUE] = NOT_TRANSMITING; |
4550 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); | 4552 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); |
4551 | 4553 | ||
4552 | return (0); | 4554 | return 0; |
4553 | } | 4555 | } |
4554 | 4556 | ||
4555 | static void smctr_timeout(struct net_device *dev) | 4557 | static void smctr_timeout(struct net_device *dev) |
@@ -4610,7 +4612,7 @@ static int smctr_send_lobe_media_test(struct net_device *dev) | |||
4610 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(struct trh_hdr) | 4612 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(struct trh_hdr) |
4611 | + S_WRAP_DATA + S_WRAP_DATA)) == (FCBlock *)(-1L)) | 4613 | + S_WRAP_DATA + S_WRAP_DATA)) == (FCBlock *)(-1L)) |
4612 | { | 4614 | { |
4613 | return (OUT_OF_RESOURCES); | 4615 | return OUT_OF_RESOURCES; |
4614 | } | 4616 | } |
4615 | 4617 | ||
4616 | /* Initialize DAT Data Fields. */ | 4618 | /* Initialize DAT Data Fields. */ |
@@ -4639,7 +4641,7 @@ static int smctr_send_lobe_media_test(struct net_device *dev) | |||
4639 | /* Start Transmit. */ | 4641 | /* Start Transmit. */ |
4640 | tmf->vl = SWAP_BYTES(tmf->vl); | 4642 | tmf->vl = SWAP_BYTES(tmf->vl); |
4641 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) | 4643 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) |
4642 | return (err); | 4644 | return err; |
4643 | 4645 | ||
4644 | /* Wait for Transmit to Complete. (10 ms). */ | 4646 | /* Wait for Transmit to Complete. (10 ms). */ |
4645 | for(i=0; i < 10000; i++) | 4647 | for(i=0; i < 10000; i++) |
@@ -4653,7 +4655,7 @@ static int smctr_send_lobe_media_test(struct net_device *dev) | |||
4653 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || | 4655 | if(!(fcb->frame_status & FCB_COMMAND_DONE) || |
4654 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) | 4656 | fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) |
4655 | { | 4657 | { |
4656 | return (LOBE_MEDIA_TEST_FAILED); | 4658 | return LOBE_MEDIA_TEST_FAILED; |
4657 | } | 4659 | } |
4658 | 4660 | ||
4659 | /* De-allocated Tx FCB and Frame Buffer | 4661 | /* De-allocated Tx FCB and Frame Buffer |
@@ -4664,7 +4666,7 @@ static int smctr_send_lobe_media_test(struct net_device *dev) | |||
4664 | tp->tx_queue_status[MAC_QUEUE] = NOT_TRANSMITING; | 4666 | tp->tx_queue_status[MAC_QUEUE] = NOT_TRANSMITING; |
4665 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); | 4667 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); |
4666 | 4668 | ||
4667 | return (0); | 4669 | return 0; |
4668 | } | 4670 | } |
4669 | 4671 | ||
4670 | static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, | 4672 | static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4679,7 +4681,7 @@ static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, | |||
4679 | + S_ADDRESS_MODIFER + S_GROUP_ADDRESS + S_FUNCTIONAL_ADDRESS)) | 4681 | + S_ADDRESS_MODIFER + S_GROUP_ADDRESS + S_FUNCTIONAL_ADDRESS)) |
4680 | == (FCBlock *)(-1L)) | 4682 | == (FCBlock *)(-1L)) |
4681 | { | 4683 | { |
4682 | return (0); | 4684 | return 0; |
4683 | } | 4685 | } |
4684 | 4686 | ||
4685 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4687 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4722,7 +4724,7 @@ static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, | |||
4722 | */ | 4724 | */ |
4723 | tmf->vl = SWAP_BYTES(tmf->vl); | 4725 | tmf->vl = SWAP_BYTES(tmf->vl); |
4724 | 4726 | ||
4725 | return (smctr_trc_send_packet(dev, fcb, MAC_QUEUE)); | 4727 | return smctr_trc_send_packet(dev, fcb, MAC_QUEUE); |
4726 | } | 4728 | } |
4727 | 4729 | ||
4728 | static int smctr_send_rpt_attch(struct net_device *dev, MAC_HEADER *rmf, | 4730 | static int smctr_send_rpt_attch(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4737,7 +4739,7 @@ static int smctr_send_rpt_attch(struct net_device *dev, MAC_HEADER *rmf, | |||
4737 | + S_AUTHORIZED_FUNCTION_CLASS + S_AUTHORIZED_ACCESS_PRIORITY)) | 4739 | + S_AUTHORIZED_FUNCTION_CLASS + S_AUTHORIZED_ACCESS_PRIORITY)) |
4738 | == (FCBlock *)(-1L)) | 4740 | == (FCBlock *)(-1L)) |
4739 | { | 4741 | { |
4740 | return (0); | 4742 | return 0; |
4741 | } | 4743 | } |
4742 | 4744 | ||
4743 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4745 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4776,7 +4778,7 @@ static int smctr_send_rpt_attch(struct net_device *dev, MAC_HEADER *rmf, | |||
4776 | */ | 4778 | */ |
4777 | tmf->vl = SWAP_BYTES(tmf->vl); | 4779 | tmf->vl = SWAP_BYTES(tmf->vl); |
4778 | 4780 | ||
4779 | return (smctr_trc_send_packet(dev, fcb, MAC_QUEUE)); | 4781 | return smctr_trc_send_packet(dev, fcb, MAC_QUEUE); |
4780 | } | 4782 | } |
4781 | 4783 | ||
4782 | static int smctr_send_rpt_state(struct net_device *dev, MAC_HEADER *rmf, | 4784 | static int smctr_send_rpt_state(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4791,7 +4793,7 @@ static int smctr_send_rpt_state(struct net_device *dev, MAC_HEADER *rmf, | |||
4791 | + S_RING_STATION_STATUS + S_STATION_IDENTIFER)) | 4793 | + S_RING_STATION_STATUS + S_STATION_IDENTIFER)) |
4792 | == (FCBlock *)(-1L)) | 4794 | == (FCBlock *)(-1L)) |
4793 | { | 4795 | { |
4794 | return (0); | 4796 | return 0; |
4795 | } | 4797 | } |
4796 | 4798 | ||
4797 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4799 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4826,7 +4828,7 @@ static int smctr_send_rpt_state(struct net_device *dev, MAC_HEADER *rmf, | |||
4826 | */ | 4828 | */ |
4827 | tmf->vl = SWAP_BYTES(tmf->vl); | 4829 | tmf->vl = SWAP_BYTES(tmf->vl); |
4828 | 4830 | ||
4829 | return (smctr_trc_send_packet(dev, fcb, MAC_QUEUE)); | 4831 | return smctr_trc_send_packet(dev, fcb, MAC_QUEUE); |
4830 | } | 4832 | } |
4831 | 4833 | ||
4832 | static int smctr_send_rpt_tx_forward(struct net_device *dev, | 4834 | static int smctr_send_rpt_tx_forward(struct net_device *dev, |
@@ -4839,7 +4841,7 @@ static int smctr_send_rpt_tx_forward(struct net_device *dev, | |||
4839 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(MAC_HEADER) | 4841 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(MAC_HEADER) |
4840 | + S_TRANSMIT_STATUS_CODE)) == (FCBlock *)(-1L)) | 4842 | + S_TRANSMIT_STATUS_CODE)) == (FCBlock *)(-1L)) |
4841 | { | 4843 | { |
4842 | return (0); | 4844 | return 0; |
4843 | } | 4845 | } |
4844 | 4846 | ||
4845 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4847 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4862,7 +4864,7 @@ static int smctr_send_rpt_tx_forward(struct net_device *dev, | |||
4862 | */ | 4864 | */ |
4863 | tmf->vl = SWAP_BYTES(tmf->vl); | 4865 | tmf->vl = SWAP_BYTES(tmf->vl); |
4864 | 4866 | ||
4865 | return(smctr_trc_send_packet(dev, fcb, MAC_QUEUE)); | 4867 | return smctr_trc_send_packet(dev, fcb, MAC_QUEUE); |
4866 | } | 4868 | } |
4867 | 4869 | ||
4868 | static int smctr_send_rsp(struct net_device *dev, MAC_HEADER *rmf, | 4870 | static int smctr_send_rsp(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4875,7 +4877,7 @@ static int smctr_send_rsp(struct net_device *dev, MAC_HEADER *rmf, | |||
4875 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(MAC_HEADER) | 4877 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, sizeof(MAC_HEADER) |
4876 | + S_CORRELATOR + S_RESPONSE_CODE)) == (FCBlock *)(-1L)) | 4878 | + S_CORRELATOR + S_RESPONSE_CODE)) == (FCBlock *)(-1L)) |
4877 | { | 4879 | { |
4878 | return (0); | 4880 | return 0; |
4879 | } | 4881 | } |
4880 | 4882 | ||
4881 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4883 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4888,7 +4890,7 @@ static int smctr_send_rsp(struct net_device *dev, MAC_HEADER *rmf, | |||
4888 | tsv = (MAC_SUB_VECTOR *)((__u32)tmf + sizeof(MAC_HEADER)); | 4890 | tsv = (MAC_SUB_VECTOR *)((__u32)tmf + sizeof(MAC_HEADER)); |
4889 | smctr_make_corr(dev, tsv, correlator); | 4891 | smctr_make_corr(dev, tsv, correlator); |
4890 | 4892 | ||
4891 | return (0); | 4893 | return 0; |
4892 | } | 4894 | } |
4893 | 4895 | ||
4894 | static int smctr_send_rq_init(struct net_device *dev) | 4896 | static int smctr_send_rq_init(struct net_device *dev) |
@@ -4907,7 +4909,7 @@ static int smctr_send_rq_init(struct net_device *dev) | |||
4907 | + S_RING_STATION_VERSION_NUMBER + S_ADDRESS_MODIFER)) | 4909 | + S_RING_STATION_VERSION_NUMBER + S_ADDRESS_MODIFER)) |
4908 | == (FCBlock *)(-1L))) | 4910 | == (FCBlock *)(-1L))) |
4909 | { | 4911 | { |
4910 | return (0); | 4912 | return 0; |
4911 | } | 4913 | } |
4912 | 4914 | ||
4913 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; | 4915 | tmf = (MAC_HEADER *)fcb->bdb_ptr->data_block_ptr; |
@@ -4943,7 +4945,7 @@ static int smctr_send_rq_init(struct net_device *dev) | |||
4943 | tmf->vl = SWAP_BYTES(tmf->vl); | 4945 | tmf->vl = SWAP_BYTES(tmf->vl); |
4944 | 4946 | ||
4945 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) | 4947 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) |
4946 | return (err); | 4948 | return err; |
4947 | 4949 | ||
4948 | /* Wait for Transmit to Complete */ | 4950 | /* Wait for Transmit to Complete */ |
4949 | for(i = 0; i < 10000; i++) | 4951 | for(i = 0; i < 10000; i++) |
@@ -4957,7 +4959,7 @@ static int smctr_send_rq_init(struct net_device *dev) | |||
4957 | fstatus = fcb->frame_status; | 4959 | fstatus = fcb->frame_status; |
4958 | 4960 | ||
4959 | if(!(fstatus & FCB_COMMAND_DONE)) | 4961 | if(!(fstatus & FCB_COMMAND_DONE)) |
4960 | return (HARDWARE_FAILED); | 4962 | return HARDWARE_FAILED; |
4961 | 4963 | ||
4962 | if(!(fstatus & FCB_TX_STATUS_E)) | 4964 | if(!(fstatus & FCB_TX_STATUS_E)) |
4963 | count++; | 4965 | count++; |
@@ -4971,7 +4973,7 @@ static int smctr_send_rq_init(struct net_device *dev) | |||
4971 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); | 4973 | smctr_update_tx_chain(dev, fcb, MAC_QUEUE); |
4972 | } while(count < 4 && ((fstatus & FCB_TX_AC_BITS) ^ FCB_TX_AC_BITS)); | 4974 | } while(count < 4 && ((fstatus & FCB_TX_AC_BITS) ^ FCB_TX_AC_BITS)); |
4973 | 4975 | ||
4974 | return (smctr_join_complete_state(dev)); | 4976 | return smctr_join_complete_state(dev); |
4975 | } | 4977 | } |
4976 | 4978 | ||
4977 | static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, | 4979 | static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, |
@@ -4984,13 +4986,13 @@ static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, | |||
4984 | 4986 | ||
4985 | /* Check if this is the END POINT of the Transmit Forward Chain. */ | 4987 | /* Check if this is the END POINT of the Transmit Forward Chain. */ |
4986 | if(rmf->vl <= 18) | 4988 | if(rmf->vl <= 18) |
4987 | return (0); | 4989 | return 0; |
4988 | 4990 | ||
4989 | /* Allocate Transmit FCB only by requesting 0 bytes | 4991 | /* Allocate Transmit FCB only by requesting 0 bytes |
4990 | * of data buffer. | 4992 | * of data buffer. |
4991 | */ | 4993 | */ |
4992 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, 0)) == (FCBlock *)(-1L)) | 4994 | if((fcb = smctr_get_tx_fcb(dev, MAC_QUEUE, 0)) == (FCBlock *)(-1L)) |
4993 | return (0); | 4995 | return 0; |
4994 | 4996 | ||
4995 | /* Set pointer to Transmit Frame Buffer to the data | 4997 | /* Set pointer to Transmit Frame Buffer to the data |
4996 | * portion of the received TX Forward frame, making | 4998 | * portion of the received TX Forward frame, making |
@@ -5006,7 +5008,7 @@ static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, | |||
5006 | fcb->bdb_ptr->buffer_length = rmf->vl - 4 - 2; | 5008 | fcb->bdb_ptr->buffer_length = rmf->vl - 4 - 2; |
5007 | 5009 | ||
5008 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) | 5010 | if((err = smctr_trc_send_packet(dev, fcb, MAC_QUEUE))) |
5009 | return (err); | 5011 | return err; |
5010 | 5012 | ||
5011 | /* Wait for Transmit to Complete */ | 5013 | /* Wait for Transmit to Complete */ |
5012 | for(i = 0; i < 10000; i++) | 5014 | for(i = 0; i < 10000; i++) |
@@ -5020,7 +5022,7 @@ static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, | |||
5020 | if(!(fcb->frame_status & FCB_COMMAND_DONE)) | 5022 | if(!(fcb->frame_status & FCB_COMMAND_DONE)) |
5021 | { | 5023 | { |
5022 | if((err = smctr_issue_resume_tx_fcb_cmd(dev, MAC_QUEUE))) | 5024 | if((err = smctr_issue_resume_tx_fcb_cmd(dev, MAC_QUEUE))) |
5023 | return (err); | 5025 | return err; |
5024 | 5026 | ||
5025 | for(i = 0; i < 10000; i++) | 5027 | for(i = 0; i < 10000; i++) |
5026 | { | 5028 | { |
@@ -5030,12 +5032,12 @@ static int smctr_send_tx_forward(struct net_device *dev, MAC_HEADER *rmf, | |||
5030 | } | 5032 | } |
5031 | 5033 | ||
5032 | if(!(fcb->frame_status & FCB_COMMAND_DONE)) | 5034 | if(!(fcb->frame_status & FCB_COMMAND_DONE)) |
5033 | return (HARDWARE_FAILED); | 5035 | return HARDWARE_FAILED; |
5034 | } | 5036 | } |
5035 | 5037 | ||
5036 | *tx_fstatus = fcb->frame_status; | 5038 | *tx_fstatus = fcb->frame_status; |
5037 | 5039 | ||
5038 | return (A_FRAME_WAS_FORWARDED); | 5040 | return A_FRAME_WAS_FORWARDED; |
5039 | } | 5041 | } |
5040 | 5042 | ||
5041 | static int smctr_set_auth_access_pri(struct net_device *dev, | 5043 | static int smctr_set_auth_access_pri(struct net_device *dev, |
@@ -5044,11 +5046,11 @@ static int smctr_set_auth_access_pri(struct net_device *dev, | |||
5044 | struct net_local *tp = netdev_priv(dev); | 5046 | struct net_local *tp = netdev_priv(dev); |
5045 | 5047 | ||
5046 | if(rsv->svl != S_AUTHORIZED_ACCESS_PRIORITY) | 5048 | if(rsv->svl != S_AUTHORIZED_ACCESS_PRIORITY) |
5047 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5049 | return E_SUB_VECTOR_LENGTH_ERROR; |
5048 | 5050 | ||
5049 | tp->authorized_access_priority = (rsv->svv[0] << 8 | rsv->svv[1]); | 5051 | tp->authorized_access_priority = (rsv->svv[0] << 8 | rsv->svv[1]); |
5050 | 5052 | ||
5051 | return (POSITIVE_ACK); | 5053 | return POSITIVE_ACK; |
5052 | } | 5054 | } |
5053 | 5055 | ||
5054 | static int smctr_set_auth_funct_class(struct net_device *dev, | 5056 | static int smctr_set_auth_funct_class(struct net_device *dev, |
@@ -5057,22 +5059,22 @@ static int smctr_set_auth_funct_class(struct net_device *dev, | |||
5057 | struct net_local *tp = netdev_priv(dev); | 5059 | struct net_local *tp = netdev_priv(dev); |
5058 | 5060 | ||
5059 | if(rsv->svl != S_AUTHORIZED_FUNCTION_CLASS) | 5061 | if(rsv->svl != S_AUTHORIZED_FUNCTION_CLASS) |
5060 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5062 | return E_SUB_VECTOR_LENGTH_ERROR; |
5061 | 5063 | ||
5062 | tp->authorized_function_classes = (rsv->svv[0] << 8 | rsv->svv[1]); | 5064 | tp->authorized_function_classes = (rsv->svv[0] << 8 | rsv->svv[1]); |
5063 | 5065 | ||
5064 | return (POSITIVE_ACK); | 5066 | return POSITIVE_ACK; |
5065 | } | 5067 | } |
5066 | 5068 | ||
5067 | static int smctr_set_corr(struct net_device *dev, MAC_SUB_VECTOR *rsv, | 5069 | static int smctr_set_corr(struct net_device *dev, MAC_SUB_VECTOR *rsv, |
5068 | __u16 *correlator) | 5070 | __u16 *correlator) |
5069 | { | 5071 | { |
5070 | if(rsv->svl != S_CORRELATOR) | 5072 | if(rsv->svl != S_CORRELATOR) |
5071 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5073 | return E_SUB_VECTOR_LENGTH_ERROR; |
5072 | 5074 | ||
5073 | *correlator = (rsv->svv[0] << 8 | rsv->svv[1]); | 5075 | *correlator = (rsv->svv[0] << 8 | rsv->svv[1]); |
5074 | 5076 | ||
5075 | return (POSITIVE_ACK); | 5077 | return POSITIVE_ACK; |
5076 | } | 5078 | } |
5077 | 5079 | ||
5078 | static int smctr_set_error_timer_value(struct net_device *dev, | 5080 | static int smctr_set_error_timer_value(struct net_device *dev, |
@@ -5082,34 +5084,34 @@ static int smctr_set_error_timer_value(struct net_device *dev, | |||
5082 | int err; | 5084 | int err; |
5083 | 5085 | ||
5084 | if(rsv->svl != S_ERROR_TIMER_VALUE) | 5086 | if(rsv->svl != S_ERROR_TIMER_VALUE) |
5085 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5087 | return E_SUB_VECTOR_LENGTH_ERROR; |
5086 | 5088 | ||
5087 | err_tval = (rsv->svv[0] << 8 | rsv->svv[1])*10; | 5089 | err_tval = (rsv->svv[0] << 8 | rsv->svv[1])*10; |
5088 | 5090 | ||
5089 | smctr_issue_write_word_cmd(dev, RW_TER_THRESHOLD, &err_tval); | 5091 | smctr_issue_write_word_cmd(dev, RW_TER_THRESHOLD, &err_tval); |
5090 | 5092 | ||
5091 | if((err = smctr_wait_cmd(dev))) | 5093 | if((err = smctr_wait_cmd(dev))) |
5092 | return (err); | 5094 | return err; |
5093 | 5095 | ||
5094 | return (POSITIVE_ACK); | 5096 | return POSITIVE_ACK; |
5095 | } | 5097 | } |
5096 | 5098 | ||
5097 | static int smctr_set_frame_forward(struct net_device *dev, | 5099 | static int smctr_set_frame_forward(struct net_device *dev, |
5098 | MAC_SUB_VECTOR *rsv, __u8 dc_sc) | 5100 | MAC_SUB_VECTOR *rsv, __u8 dc_sc) |
5099 | { | 5101 | { |
5100 | if((rsv->svl < 2) || (rsv->svl > S_FRAME_FORWARD)) | 5102 | if((rsv->svl < 2) || (rsv->svl > S_FRAME_FORWARD)) |
5101 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5103 | return E_SUB_VECTOR_LENGTH_ERROR; |
5102 | 5104 | ||
5103 | if((dc_sc & DC_MASK) != DC_CRS) | 5105 | if((dc_sc & DC_MASK) != DC_CRS) |
5104 | { | 5106 | { |
5105 | if(rsv->svl >= 2 && rsv->svl < 20) | 5107 | if(rsv->svl >= 2 && rsv->svl < 20) |
5106 | return (E_TRANSMIT_FORWARD_INVALID); | 5108 | return E_TRANSMIT_FORWARD_INVALID; |
5107 | 5109 | ||
5108 | if((rsv->svv[0] != 0) || (rsv->svv[1] != 0)) | 5110 | if((rsv->svv[0] != 0) || (rsv->svv[1] != 0)) |
5109 | return (E_TRANSMIT_FORWARD_INVALID); | 5111 | return E_TRANSMIT_FORWARD_INVALID; |
5110 | } | 5112 | } |
5111 | 5113 | ||
5112 | return (POSITIVE_ACK); | 5114 | return POSITIVE_ACK; |
5113 | } | 5115 | } |
5114 | 5116 | ||
5115 | static int smctr_set_local_ring_num(struct net_device *dev, | 5117 | static int smctr_set_local_ring_num(struct net_device *dev, |
@@ -5118,13 +5120,13 @@ static int smctr_set_local_ring_num(struct net_device *dev, | |||
5118 | struct net_local *tp = netdev_priv(dev); | 5120 | struct net_local *tp = netdev_priv(dev); |
5119 | 5121 | ||
5120 | if(rsv->svl != S_LOCAL_RING_NUMBER) | 5122 | if(rsv->svl != S_LOCAL_RING_NUMBER) |
5121 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5123 | return E_SUB_VECTOR_LENGTH_ERROR; |
5122 | 5124 | ||
5123 | if(tp->ptr_local_ring_num) | 5125 | if(tp->ptr_local_ring_num) |
5124 | *(__u16 *)(tp->ptr_local_ring_num) | 5126 | *(__u16 *)(tp->ptr_local_ring_num) |
5125 | = (rsv->svv[0] << 8 | rsv->svv[1]); | 5127 | = (rsv->svv[0] << 8 | rsv->svv[1]); |
5126 | 5128 | ||
5127 | return (POSITIVE_ACK); | 5129 | return POSITIVE_ACK; |
5128 | } | 5130 | } |
5129 | 5131 | ||
5130 | static unsigned short smctr_set_ctrl_attention(struct net_device *dev) | 5132 | static unsigned short smctr_set_ctrl_attention(struct net_device *dev) |
@@ -5140,7 +5142,7 @@ static unsigned short smctr_set_ctrl_attention(struct net_device *dev) | |||
5140 | outb(tp->trc_mask, ioaddr + CSR); | 5142 | outb(tp->trc_mask, ioaddr + CSR); |
5141 | } | 5143 | } |
5142 | 5144 | ||
5143 | return (0); | 5145 | return 0; |
5144 | } | 5146 | } |
5145 | 5147 | ||
5146 | static void smctr_set_multicast_list(struct net_device *dev) | 5148 | static void smctr_set_multicast_list(struct net_device *dev) |
@@ -5159,7 +5161,7 @@ static int smctr_set_page(struct net_device *dev, __u8 *buf) | |||
5159 | amask = (__u8)((tptr & PR_PAGE_MASK) >> 8); | 5161 | amask = (__u8)((tptr & PR_PAGE_MASK) >> 8); |
5160 | outb(amask, dev->base_addr + PR); | 5162 | outb(amask, dev->base_addr + PR); |
5161 | 5163 | ||
5162 | return (0); | 5164 | return 0; |
5163 | } | 5165 | } |
5164 | 5166 | ||
5165 | static int smctr_set_phy_drop(struct net_device *dev, MAC_SUB_VECTOR *rsv) | 5167 | static int smctr_set_phy_drop(struct net_device *dev, MAC_SUB_VECTOR *rsv) |
@@ -5167,13 +5169,13 @@ static int smctr_set_phy_drop(struct net_device *dev, MAC_SUB_VECTOR *rsv) | |||
5167 | int err; | 5169 | int err; |
5168 | 5170 | ||
5169 | if(rsv->svl != S_PHYSICAL_DROP) | 5171 | if(rsv->svl != S_PHYSICAL_DROP) |
5170 | return (E_SUB_VECTOR_LENGTH_ERROR); | 5172 | return E_SUB_VECTOR_LENGTH_ERROR; |
5171 | 5173 | ||
5172 | smctr_issue_write_byte_cmd(dev, RW_PHYSICAL_DROP_NUMBER, &rsv->svv[0]); | 5174 | smctr_issue_write_byte_cmd(dev, RW_PHYSICAL_DROP_NUMBER, &rsv->svv[0]); |
5173 | if((err = smctr_wait_cmd(dev))) | 5175 | if((err = smctr_wait_cmd(dev))) |
5174 | return (err); | 5176 | return err; |
5175 | 5177 | ||
5176 | return (POSITIVE_ACK); | 5178 | return POSITIVE_ACK; |
5177 | } | 5179 | } |
5178 | 5180 | ||
5179 | /* Reset the ring speed to the opposite of what it was. This auto-pilot | 5181 | /* Reset the ring speed to the opposite of what it was. This auto-pilot |
@@ -5195,16 +5197,16 @@ static int smctr_set_ring_speed(struct net_device *dev) | |||
5195 | smctr_reset_adapter(dev); | 5197 | smctr_reset_adapter(dev); |
5196 | 5198 | ||
5197 | if((err = smctr_init_card_real(dev))) | 5199 | if((err = smctr_init_card_real(dev))) |
5198 | return (err); | 5200 | return err; |
5199 | 5201 | ||
5200 | smctr_enable_bic_int(dev); | 5202 | smctr_enable_bic_int(dev); |
5201 | 5203 | ||
5202 | if((err = smctr_issue_enable_int_cmd(dev, TRC_INTERRUPT_ENABLE_MASK))) | 5204 | if((err = smctr_issue_enable_int_cmd(dev, TRC_INTERRUPT_ENABLE_MASK))) |
5203 | return (err); | 5205 | return err; |
5204 | 5206 | ||
5205 | smctr_disable_16bit(dev); | 5207 | smctr_disable_16bit(dev); |
5206 | 5208 | ||
5207 | return (0); | 5209 | return 0; |
5208 | } | 5210 | } |
5209 | 5211 | ||
5210 | static int smctr_set_rx_look_ahead(struct net_device *dev) | 5212 | static int smctr_set_rx_look_ahead(struct net_device *dev) |
@@ -5233,7 +5235,7 @@ static int smctr_set_rx_look_ahead(struct net_device *dev) | |||
5233 | *((__u16 *)(tp->ram_access)) = sword; | 5235 | *((__u16 *)(tp->ram_access)) = sword; |
5234 | } | 5236 | } |
5235 | 5237 | ||
5236 | return (0); | 5238 | return 0; |
5237 | } | 5239 | } |
5238 | 5240 | ||
5239 | static int smctr_set_trc_reset(int ioaddr) | 5241 | static int smctr_set_trc_reset(int ioaddr) |
@@ -5243,7 +5245,7 @@ static int smctr_set_trc_reset(int ioaddr) | |||
5243 | r = inb(ioaddr + MSR); | 5245 | r = inb(ioaddr + MSR); |
5244 | outb(MSR_RST | r, ioaddr + MSR); | 5246 | outb(MSR_RST | r, ioaddr + MSR); |
5245 | 5247 | ||
5246 | return (0); | 5248 | return 0; |
5247 | } | 5249 | } |
5248 | 5250 | ||
5249 | /* | 5251 | /* |
@@ -5259,10 +5261,10 @@ static int smctr_setup_single_cmd(struct net_device *dev, | |||
5259 | printk(KERN_DEBUG "%s: smctr_setup_single_cmd\n", dev->name); | 5261 | printk(KERN_DEBUG "%s: smctr_setup_single_cmd\n", dev->name); |
5260 | 5262 | ||
5261 | if((err = smctr_wait_while_cbusy(dev))) | 5263 | if((err = smctr_wait_while_cbusy(dev))) |
5262 | return (err); | 5264 | return err; |
5263 | 5265 | ||
5264 | if((err = (unsigned int)smctr_wait_cmd(dev))) | 5266 | if((err = (unsigned int)smctr_wait_cmd(dev))) |
5265 | return (err); | 5267 | return err; |
5266 | 5268 | ||
5267 | tp->acb_head->cmd_done_status = 0; | 5269 | tp->acb_head->cmd_done_status = 0; |
5268 | tp->acb_head->cmd = command; | 5270 | tp->acb_head->cmd = command; |
@@ -5270,7 +5272,7 @@ static int smctr_setup_single_cmd(struct net_device *dev, | |||
5270 | 5272 | ||
5271 | err = smctr_issue_resume_acb_cmd(dev); | 5273 | err = smctr_issue_resume_acb_cmd(dev); |
5272 | 5274 | ||
5273 | return (err); | 5275 | return err; |
5274 | } | 5276 | } |
5275 | 5277 | ||
5276 | /* | 5278 | /* |
@@ -5287,7 +5289,7 @@ static int smctr_setup_single_cmd_w_data(struct net_device *dev, | |||
5287 | tp->acb_head->data_offset_lo | 5289 | tp->acb_head->data_offset_lo |
5288 | = (__u16)TRC_POINTER(tp->misc_command_data); | 5290 | = (__u16)TRC_POINTER(tp->misc_command_data); |
5289 | 5291 | ||
5290 | return(smctr_issue_resume_acb_cmd(dev)); | 5292 | return smctr_issue_resume_acb_cmd(dev); |
5291 | } | 5293 | } |
5292 | 5294 | ||
5293 | static char *smctr_malloc(struct net_device *dev, __u16 size) | 5295 | static char *smctr_malloc(struct net_device *dev, __u16 size) |
@@ -5298,7 +5300,7 @@ static char *smctr_malloc(struct net_device *dev, __u16 size) | |||
5298 | m = (char *)(tp->ram_access + tp->sh_mem_used); | 5300 | m = (char *)(tp->ram_access + tp->sh_mem_used); |
5299 | tp->sh_mem_used += (__u32)size; | 5301 | tp->sh_mem_used += (__u32)size; |
5300 | 5302 | ||
5301 | return (m); | 5303 | return m; |
5302 | } | 5304 | } |
5303 | 5305 | ||
5304 | static int smctr_status_chg(struct net_device *dev) | 5306 | static int smctr_status_chg(struct net_device *dev) |
@@ -5333,7 +5335,7 @@ static int smctr_status_chg(struct net_device *dev) | |||
5333 | break; | 5335 | break; |
5334 | } | 5336 | } |
5335 | 5337 | ||
5336 | return (0); | 5338 | return 0; |
5337 | } | 5339 | } |
5338 | 5340 | ||
5339 | static int smctr_trc_send_packet(struct net_device *dev, FCBlock *fcb, | 5341 | static int smctr_trc_send_packet(struct net_device *dev, FCBlock *fcb, |
@@ -5355,7 +5357,7 @@ static int smctr_trc_send_packet(struct net_device *dev, FCBlock *fcb, | |||
5355 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); | 5357 | err = smctr_issue_resume_tx_fcb_cmd(dev, queue); |
5356 | } | 5358 | } |
5357 | 5359 | ||
5358 | return (err); | 5360 | return err; |
5359 | } | 5361 | } |
5360 | 5362 | ||
5361 | static __u16 smctr_tx_complete(struct net_device *dev, __u16 queue) | 5363 | static __u16 smctr_tx_complete(struct net_device *dev, __u16 queue) |
@@ -5409,7 +5411,7 @@ static __u16 smctr_tx_complete(struct net_device *dev, __u16 queue) | |||
5409 | break; | 5411 | break; |
5410 | } | 5412 | } |
5411 | 5413 | ||
5412 | return (err); | 5414 | return err; |
5413 | } | 5415 | } |
5414 | 5416 | ||
5415 | static unsigned short smctr_tx_move_frame(struct net_device *dev, | 5417 | static unsigned short smctr_tx_move_frame(struct net_device *dev, |
@@ -5450,7 +5452,7 @@ static unsigned short smctr_tx_move_frame(struct net_device *dev, | |||
5450 | pbuff += len; | 5452 | pbuff += len; |
5451 | } | 5453 | } |
5452 | 5454 | ||
5453 | return (0); | 5455 | return 0; |
5454 | } | 5456 | } |
5455 | 5457 | ||
5456 | /* Update the error statistic counters for this adapter. */ | 5458 | /* Update the error statistic counters for this adapter. */ |
@@ -5493,7 +5495,7 @@ static int smctr_update_err_stats(struct net_device *dev) | |||
5493 | if(tstat->token_errors) | 5495 | if(tstat->token_errors) |
5494 | tstat->token_errors += *(tp->misc_command_data + 5) >> 8; | 5496 | tstat->token_errors += *(tp->misc_command_data + 5) >> 8; |
5495 | 5497 | ||
5496 | return (0); | 5498 | return 0; |
5497 | } | 5499 | } |
5498 | 5500 | ||
5499 | static int smctr_update_rx_chain(struct net_device *dev, __u16 queue) | 5501 | static int smctr_update_rx_chain(struct net_device *dev, __u16 queue) |
@@ -5530,7 +5532,7 @@ static int smctr_update_rx_chain(struct net_device *dev, __u16 queue) | |||
5530 | tp->rx_bdb_curr[queue]->back_ptr->info = BDB_NOT_CHAIN_END; | 5532 | tp->rx_bdb_curr[queue]->back_ptr->info = BDB_NOT_CHAIN_END; |
5531 | tp->rx_bdb_curr[queue] = bdb; | 5533 | tp->rx_bdb_curr[queue] = bdb; |
5532 | 5534 | ||
5533 | return (0); | 5535 | return 0; |
5534 | } | 5536 | } |
5535 | 5537 | ||
5536 | static int smctr_update_tx_chain(struct net_device *dev, FCBlock *fcb, | 5538 | static int smctr_update_tx_chain(struct net_device *dev, FCBlock *fcb, |
@@ -5542,13 +5544,13 @@ static int smctr_update_tx_chain(struct net_device *dev, FCBlock *fcb, | |||
5542 | printk(KERN_DEBUG "smctr_update_tx_chain\n"); | 5544 | printk(KERN_DEBUG "smctr_update_tx_chain\n"); |
5543 | 5545 | ||
5544 | if(tp->num_tx_fcbs_used[queue] <= 0) | 5546 | if(tp->num_tx_fcbs_used[queue] <= 0) |
5545 | return (HARDWARE_FAILED); | 5547 | return HARDWARE_FAILED; |
5546 | else | 5548 | else |
5547 | { | 5549 | { |
5548 | if(tp->tx_buff_used[queue] < fcb->memory_alloc) | 5550 | if(tp->tx_buff_used[queue] < fcb->memory_alloc) |
5549 | { | 5551 | { |
5550 | tp->tx_buff_used[queue] = 0; | 5552 | tp->tx_buff_used[queue] = 0; |
5551 | return (HARDWARE_FAILED); | 5553 | return HARDWARE_FAILED; |
5552 | } | 5554 | } |
5553 | 5555 | ||
5554 | tp->tx_buff_used[queue] -= fcb->memory_alloc; | 5556 | tp->tx_buff_used[queue] -= fcb->memory_alloc; |
@@ -5566,7 +5568,7 @@ static int smctr_update_tx_chain(struct net_device *dev, FCBlock *fcb, | |||
5566 | fcb->frame_status = 0; | 5568 | fcb->frame_status = 0; |
5567 | tp->tx_fcb_end[queue] = fcb->next_ptr; | 5569 | tp->tx_fcb_end[queue] = fcb->next_ptr; |
5568 | netif_wake_queue(dev); | 5570 | netif_wake_queue(dev); |
5569 | return (0); | 5571 | return 0; |
5570 | } | 5572 | } |
5571 | } | 5573 | } |
5572 | 5574 | ||
@@ -5587,12 +5589,12 @@ static int smctr_wait_cmd(struct net_device *dev) | |||
5587 | } | 5589 | } |
5588 | 5590 | ||
5589 | if(loop_count == 0) | 5591 | if(loop_count == 0) |
5590 | return(HARDWARE_FAILED); | 5592 | return HARDWARE_FAILED; |
5591 | 5593 | ||
5592 | if(tp->acb_head->cmd_done_status & 0xff) | 5594 | if(tp->acb_head->cmd_done_status & 0xff) |
5593 | return(HARDWARE_FAILED); | 5595 | return HARDWARE_FAILED; |
5594 | 5596 | ||
5595 | return (0); | 5597 | return 0; |
5596 | } | 5598 | } |
5597 | 5599 | ||
5598 | static int smctr_wait_while_cbusy(struct net_device *dev) | 5600 | static int smctr_wait_while_cbusy(struct net_device *dev) |
@@ -5624,9 +5626,9 @@ static int smctr_wait_while_cbusy(struct net_device *dev) | |||
5624 | } | 5626 | } |
5625 | 5627 | ||
5626 | if(timeout) | 5628 | if(timeout) |
5627 | return (0); | 5629 | return 0; |
5628 | else | 5630 | else |
5629 | return (HARDWARE_FAILED); | 5631 | return HARDWARE_FAILED; |
5630 | } | 5632 | } |
5631 | 5633 | ||
5632 | #ifdef MODULE | 5634 | #ifdef MODULE |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index 08182fde3dcd..c83f4f6e39e1 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -224,7 +224,7 @@ static int madgemc_sifprobe(struct net_device *dev) | |||
224 | chk2 ^= 0x0FE; | 224 | chk2 ^= 0x0FE; |
225 | 225 | ||
226 | if(chk1 != chk2) | 226 | if(chk1 != chk2) |
227 | return (-1); /* No adapter */ | 227 | return -1; /* No adapter */ |
228 | chk1 -= 2; | 228 | chk1 -= 2; |
229 | } while(chk1 != 0); /* Repeat 128 times (all byte values) */ | 229 | } while(chk1 != 0); /* Repeat 128 times (all byte values) */ |
230 | 230 | ||
@@ -232,7 +232,7 @@ static int madgemc_sifprobe(struct net_device *dev) | |||
232 | /* Restore the SIFADR value */ | 232 | /* Restore the SIFADR value */ |
233 | SIFWRITEB(old, SIFADR); | 233 | SIFWRITEB(old, SIFADR); |
234 | 234 | ||
235 | return (0); | 235 | return 0; |
236 | } | 236 | } |
237 | #endif | 237 | #endif |
238 | 238 | ||
@@ -271,7 +271,7 @@ int tms380tr_open(struct net_device *dev) | |||
271 | { | 271 | { |
272 | printk(KERN_INFO "%s: Chipset initialization error\n", | 272 | printk(KERN_INFO "%s: Chipset initialization error\n", |
273 | dev->name); | 273 | dev->name); |
274 | return (-1); | 274 | return -1; |
275 | } | 275 | } |
276 | 276 | ||
277 | tp->timer.expires = jiffies + 30*HZ; | 277 | tp->timer.expires = jiffies + 30*HZ; |
@@ -298,7 +298,7 @@ int tms380tr_open(struct net_device *dev) | |||
298 | if(tp->AdapterVirtOpenFlag == 0) | 298 | if(tp->AdapterVirtOpenFlag == 0) |
299 | { | 299 | { |
300 | tms380tr_disable_interrupts(dev); | 300 | tms380tr_disable_interrupts(dev); |
301 | return (-1); | 301 | return -1; |
302 | } | 302 | } |
303 | 303 | ||
304 | tp->StartTime = jiffies; | 304 | tp->StartTime = jiffies; |
@@ -309,7 +309,7 @@ int tms380tr_open(struct net_device *dev) | |||
309 | tp->timer.data = (unsigned long)dev; | 309 | tp->timer.data = (unsigned long)dev; |
310 | add_timer(&tp->timer); | 310 | add_timer(&tp->timer); |
311 | 311 | ||
312 | return (0); | 312 | return 0; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* | 315 | /* |
@@ -343,23 +343,23 @@ static int tms380tr_chipset_init(struct net_device *dev) | |||
343 | printk(KERN_DEBUG "%s: Resetting adapter...\n", dev->name); | 343 | printk(KERN_DEBUG "%s: Resetting adapter...\n", dev->name); |
344 | err = tms380tr_reset_adapter(dev); | 344 | err = tms380tr_reset_adapter(dev); |
345 | if(err < 0) | 345 | if(err < 0) |
346 | return (-1); | 346 | return -1; |
347 | 347 | ||
348 | if(tms380tr_debug > 3) | 348 | if(tms380tr_debug > 3) |
349 | printk(KERN_DEBUG "%s: Bringup diags...\n", dev->name); | 349 | printk(KERN_DEBUG "%s: Bringup diags...\n", dev->name); |
350 | err = tms380tr_bringup_diags(dev); | 350 | err = tms380tr_bringup_diags(dev); |
351 | if(err < 0) | 351 | if(err < 0) |
352 | return (-1); | 352 | return -1; |
353 | 353 | ||
354 | if(tms380tr_debug > 3) | 354 | if(tms380tr_debug > 3) |
355 | printk(KERN_DEBUG "%s: Init adapter...\n", dev->name); | 355 | printk(KERN_DEBUG "%s: Init adapter...\n", dev->name); |
356 | err = tms380tr_init_adapter(dev); | 356 | err = tms380tr_init_adapter(dev); |
357 | if(err < 0) | 357 | if(err < 0) |
358 | return (-1); | 358 | return -1; |
359 | 359 | ||
360 | if(tms380tr_debug > 3) | 360 | if(tms380tr_debug > 3) |
361 | printk(KERN_DEBUG "%s: Done!\n", dev->name); | 361 | printk(KERN_DEBUG "%s: Done!\n", dev->name); |
362 | return (0); | 362 | return 0; |
363 | } | 363 | } |
364 | 364 | ||
365 | /* | 365 | /* |
@@ -877,7 +877,7 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy | |||
877 | IrqType != STS_IRQ_COMMAND_STATUS && | 877 | IrqType != STS_IRQ_COMMAND_STATUS && |
878 | IrqType != STS_IRQ_RING_STATUS) | 878 | IrqType != STS_IRQ_RING_STATUS) |
879 | { | 879 | { |
880 | return (1); /* SSB not involved. */ | 880 | return 1; /* SSB not involved. */ |
881 | } | 881 | } |
882 | 882 | ||
883 | /* Note: All fields of the SSB have been set to all ones (-1) after it | 883 | /* Note: All fields of the SSB have been set to all ones (-1) after it |
@@ -887,21 +887,21 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy | |||
887 | */ | 887 | */ |
888 | 888 | ||
889 | if(ssb->STS == (unsigned short) -1) | 889 | if(ssb->STS == (unsigned short) -1) |
890 | return (0); /* Command field not yet available. */ | 890 | return 0; /* Command field not yet available. */ |
891 | if(IrqType == STS_IRQ_COMMAND_STATUS) | 891 | if(IrqType == STS_IRQ_COMMAND_STATUS) |
892 | return (1); /* Status fields not always affected. */ | 892 | return 1; /* Status fields not always affected. */ |
893 | if(ssb->Parm[0] == (unsigned short) -1) | 893 | if(ssb->Parm[0] == (unsigned short) -1) |
894 | return (0); /* Status 1 field not yet available. */ | 894 | return 0; /* Status 1 field not yet available. */ |
895 | if(IrqType == STS_IRQ_RING_STATUS) | 895 | if(IrqType == STS_IRQ_RING_STATUS) |
896 | return (1); /* Status 2 & 3 fields not affected. */ | 896 | return 1; /* Status 2 & 3 fields not affected. */ |
897 | 897 | ||
898 | /* Note: At this point, the interrupt is either TRANSMIT or RECEIVE. */ | 898 | /* Note: At this point, the interrupt is either TRANSMIT or RECEIVE. */ |
899 | if(ssb->Parm[1] == (unsigned short) -1) | 899 | if(ssb->Parm[1] == (unsigned short) -1) |
900 | return (0); /* Status 2 field not yet available. */ | 900 | return 0; /* Status 2 field not yet available. */ |
901 | if(ssb->Parm[2] == (unsigned short) -1) | 901 | if(ssb->Parm[2] == (unsigned short) -1) |
902 | return (0); /* Status 3 field not yet available. */ | 902 | return 0; /* Status 3 field not yet available. */ |
903 | 903 | ||
904 | return (1); /* All SSB fields have been written by the adapter. */ | 904 | return 1; /* All SSB fields have been written by the adapter. */ |
905 | } | 905 | } |
906 | 906 | ||
907 | /* | 907 | /* |
@@ -1143,7 +1143,7 @@ int tms380tr_close(struct net_device *dev) | |||
1143 | #endif | 1143 | #endif |
1144 | tms380tr_cancel_tx_queue(tp); | 1144 | tms380tr_cancel_tx_queue(tp); |
1145 | 1145 | ||
1146 | return (0); | 1146 | return 0; |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | /* | 1149 | /* |
@@ -1154,7 +1154,7 @@ static struct net_device_stats *tms380tr_get_stats(struct net_device *dev) | |||
1154 | { | 1154 | { |
1155 | struct net_local *tp = netdev_priv(dev); | 1155 | struct net_local *tp = netdev_priv(dev); |
1156 | 1156 | ||
1157 | return ((struct net_device_stats *)&tp->MacStat); | 1157 | return (struct net_device_stats *)&tp->MacStat; |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | /* | 1160 | /* |
@@ -1256,7 +1256,7 @@ static int tms380tr_reset_adapter(struct net_device *dev) | |||
1256 | if (request_firmware(&fw_entry, "tms380tr.bin", tp->pdev) != 0) { | 1256 | if (request_firmware(&fw_entry, "tms380tr.bin", tp->pdev) != 0) { |
1257 | printk(KERN_ALERT "%s: firmware %s is missing, cannot start.\n", | 1257 | printk(KERN_ALERT "%s: firmware %s is missing, cannot start.\n", |
1258 | dev->name, "tms380tr.bin"); | 1258 | dev->name, "tms380tr.bin"); |
1259 | return (-1); | 1259 | return -1; |
1260 | } | 1260 | } |
1261 | 1261 | ||
1262 | fw_ptr = (unsigned short *)fw_entry->data; | 1262 | fw_ptr = (unsigned short *)fw_entry->data; |
@@ -1322,13 +1322,13 @@ static int tms380tr_reset_adapter(struct net_device *dev) | |||
1322 | /* Clear CPHALT and start BUD */ | 1322 | /* Clear CPHALT and start BUD */ |
1323 | SIFWRITEW(c, SIFACL); | 1323 | SIFWRITEW(c, SIFACL); |
1324 | release_firmware(fw_entry); | 1324 | release_firmware(fw_entry); |
1325 | return (1); | 1325 | return 1; |
1326 | } | 1326 | } |
1327 | } while(count == 0); | 1327 | } while(count == 0); |
1328 | 1328 | ||
1329 | release_firmware(fw_entry); | 1329 | release_firmware(fw_entry); |
1330 | printk(KERN_INFO "%s: Adapter Download Failed\n", dev->name); | 1330 | printk(KERN_INFO "%s: Adapter Download Failed\n", dev->name); |
1331 | return (-1); | 1331 | return -1; |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | MODULE_FIRMWARE("tms380tr.bin"); | 1334 | MODULE_FIRMWARE("tms380tr.bin"); |
@@ -1363,7 +1363,7 @@ static int tms380tr_bringup_diags(struct net_device *dev) | |||
1363 | printk(KERN_DEBUG " %04X\n", Status); | 1363 | printk(KERN_DEBUG " %04X\n", Status); |
1364 | /* BUD successfully completed */ | 1364 | /* BUD successfully completed */ |
1365 | if(Status == STS_INITIALIZE) | 1365 | if(Status == STS_INITIALIZE) |
1366 | return (1); | 1366 | return 1; |
1367 | /* Unrecoverable hardware error, BUD not completed? */ | 1367 | /* Unrecoverable hardware error, BUD not completed? */ |
1368 | } while((loop_cnt > 0) && ((Status & (STS_ERROR | STS_TEST)) | 1368 | } while((loop_cnt > 0) && ((Status & (STS_ERROR | STS_TEST)) |
1369 | != (STS_ERROR | STS_TEST))); | 1369 | != (STS_ERROR | STS_TEST))); |
@@ -1390,7 +1390,7 @@ static int tms380tr_bringup_diags(struct net_device *dev) | |||
1390 | else | 1390 | else |
1391 | printk(KERN_INFO "%s: Bring Up Diagnostics Error (%04X) occurred\n", dev->name, Status & 0x000f); | 1391 | printk(KERN_INFO "%s: Bring Up Diagnostics Error (%04X) occurred\n", dev->name, Status & 0x000f); |
1392 | 1392 | ||
1393 | return (-1); | 1393 | return -1; |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | /* | 1396 | /* |
@@ -1464,7 +1464,7 @@ static int tms380tr_init_adapter(struct net_device *dev) | |||
1464 | { | 1464 | { |
1465 | printk(KERN_INFO "%s: DMA failed\n", dev->name); | 1465 | printk(KERN_INFO "%s: DMA failed\n", dev->name); |
1466 | /* DMA data error: wrong data in SCB */ | 1466 | /* DMA data error: wrong data in SCB */ |
1467 | return (-1); | 1467 | return -1; |
1468 | } | 1468 | } |
1469 | i++; | 1469 | i++; |
1470 | } while(i < 6); | 1470 | } while(i < 6); |
@@ -1473,11 +1473,11 @@ static int tms380tr_init_adapter(struct net_device *dev) | |||
1473 | do { /* Test if contents of SSB is valid */ | 1473 | do { /* Test if contents of SSB is valid */ |
1474 | if(SSB_Test[i] != *(sb_ptr + i)) | 1474 | if(SSB_Test[i] != *(sb_ptr + i)) |
1475 | /* DMA data error: wrong data in SSB */ | 1475 | /* DMA data error: wrong data in SSB */ |
1476 | return (-1); | 1476 | return -1; |
1477 | i++; | 1477 | i++; |
1478 | } while (i < 8); | 1478 | } while (i < 8); |
1479 | 1479 | ||
1480 | return (1); /* Adapter successfully initialized */ | 1480 | return 1; /* Adapter successfully initialized */ |
1481 | } | 1481 | } |
1482 | else | 1482 | else |
1483 | { | 1483 | { |
@@ -1488,7 +1488,7 @@ static int tms380tr_init_adapter(struct net_device *dev) | |||
1488 | Status &= STS_ERROR_MASK; | 1488 | Status &= STS_ERROR_MASK; |
1489 | /* ShowInitialisationErrorCode(Status); */ | 1489 | /* ShowInitialisationErrorCode(Status); */ |
1490 | printk(KERN_INFO "%s: Status error: %d\n", dev->name, Status); | 1490 | printk(KERN_INFO "%s: Status error: %d\n", dev->name, Status); |
1491 | return (-1); /* Unrecoverable error */ | 1491 | return -1; /* Unrecoverable error */ |
1492 | } | 1492 | } |
1493 | else | 1493 | else |
1494 | { | 1494 | { |
@@ -1503,7 +1503,7 @@ static int tms380tr_init_adapter(struct net_device *dev) | |||
1503 | } while(retry_cnt > 0); | 1503 | } while(retry_cnt > 0); |
1504 | 1504 | ||
1505 | printk(KERN_INFO "%s: Retry exceeded\n", dev->name); | 1505 | printk(KERN_INFO "%s: Retry exceeded\n", dev->name); |
1506 | return (-1); | 1506 | return -1; |
1507 | } | 1507 | } |
1508 | 1508 | ||
1509 | /* | 1509 | /* |
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index a03730bd1da5..5c633a32eaeb 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
@@ -219,7 +219,7 @@ static int tsi108_read_mii(struct tsi108_prv_data *data, int reg) | |||
219 | if (i == 100) | 219 | if (i == 100) |
220 | return 0xffff; | 220 | return 0xffff; |
221 | else | 221 | else |
222 | return (TSI_READ_PHY(TSI108_MAC_MII_DATAIN)); | 222 | return TSI_READ_PHY(TSI108_MAC_MII_DATAIN); |
223 | } | 223 | } |
224 | 224 | ||
225 | static void tsi108_write_mii(struct tsi108_prv_data *data, | 225 | static void tsi108_write_mii(struct tsi108_prv_data *data, |
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 1d9fef74b39b..251c6ce15aea 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -3119,7 +3119,7 @@ dc2114x_autoconf(struct net_device *dev) | |||
3119 | if (lp->media == _100Mb) { | 3119 | if (lp->media == _100Mb) { |
3120 | if ((slnk = test_for_100Mb(dev, 6500)) < 0) { | 3120 | if ((slnk = test_for_100Mb(dev, 6500)) < 0) { |
3121 | lp->media = SPD_DET; | 3121 | lp->media = SPD_DET; |
3122 | return (slnk & ~TIMER_CB); | 3122 | return slnk & ~TIMER_CB; |
3123 | } | 3123 | } |
3124 | } else { | 3124 | } else { |
3125 | if (wait_for_link(dev) < 0) { | 3125 | if (wait_for_link(dev) < 0) { |
@@ -3484,7 +3484,7 @@ is_spd_100(struct net_device *dev) | |||
3484 | spd = ((~gep_rd(dev)) & GEP_SLNK); | 3484 | spd = ((~gep_rd(dev)) & GEP_SLNK); |
3485 | } else { | 3485 | } else { |
3486 | if ((lp->ibn == 2) || !lp->asBitValid) | 3486 | if ((lp->ibn == 2) || !lp->asBitValid) |
3487 | return ((lp->chipset == DC21143)?(~inl(DE4X5_SISR)&SISR_LS100):0); | 3487 | return (lp->chipset == DC21143) ? (~inl(DE4X5_SISR)&SISR_LS100) : 0; |
3488 | 3488 | ||
3489 | spd = (lp->asBitValid & (lp->asPolarity ^ (gep_rd(dev) & lp->asBit))) | | 3489 | spd = (lp->asBitValid & (lp->asPolarity ^ (gep_rd(dev) & lp->asBit))) | |
3490 | (lp->linkOK & ~lp->asBitValid); | 3490 | (lp->linkOK & ~lp->asBitValid); |
@@ -3502,15 +3502,15 @@ is_100_up(struct net_device *dev) | |||
3502 | if (lp->useMII) { | 3502 | if (lp->useMII) { |
3503 | /* Double read for sticky bits & temporary drops */ | 3503 | /* Double read for sticky bits & temporary drops */ |
3504 | mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); | 3504 | mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); |
3505 | return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS); | 3505 | return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS; |
3506 | } else if (!lp->useSROM) { /* de500-xa */ | 3506 | } else if (!lp->useSROM) { /* de500-xa */ |
3507 | return ((~gep_rd(dev)) & GEP_SLNK); | 3507 | return (~gep_rd(dev)) & GEP_SLNK; |
3508 | } else { | 3508 | } else { |
3509 | if ((lp->ibn == 2) || !lp->asBitValid) | 3509 | if ((lp->ibn == 2) || !lp->asBitValid) |
3510 | return ((lp->chipset == DC21143)?(~inl(DE4X5_SISR)&SISR_LS100):0); | 3510 | return (lp->chipset == DC21143) ? (~inl(DE4X5_SISR)&SISR_LS100) : 0; |
3511 | 3511 | ||
3512 | return ((lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | | 3512 | return (lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | |
3513 | (lp->linkOK & ~lp->asBitValid)); | 3513 | (lp->linkOK & ~lp->asBitValid); |
3514 | } | 3514 | } |
3515 | } | 3515 | } |
3516 | 3516 | ||
@@ -3523,17 +3523,17 @@ is_10_up(struct net_device *dev) | |||
3523 | if (lp->useMII) { | 3523 | if (lp->useMII) { |
3524 | /* Double read for sticky bits & temporary drops */ | 3524 | /* Double read for sticky bits & temporary drops */ |
3525 | mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); | 3525 | mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); |
3526 | return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS); | 3526 | return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS; |
3527 | } else if (!lp->useSROM) { /* de500-xa */ | 3527 | } else if (!lp->useSROM) { /* de500-xa */ |
3528 | return ((~gep_rd(dev)) & GEP_LNP); | 3528 | return (~gep_rd(dev)) & GEP_LNP; |
3529 | } else { | 3529 | } else { |
3530 | if ((lp->ibn == 2) || !lp->asBitValid) | 3530 | if ((lp->ibn == 2) || !lp->asBitValid) |
3531 | return (((lp->chipset & ~0x00ff) == DC2114x) ? | 3531 | return ((lp->chipset & ~0x00ff) == DC2114x) ? |
3532 | (~inl(DE4X5_SISR)&SISR_LS10): | 3532 | (~inl(DE4X5_SISR)&SISR_LS10): |
3533 | 0); | 3533 | 0; |
3534 | 3534 | ||
3535 | return ((lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | | 3535 | return (lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | |
3536 | (lp->linkOK & ~lp->asBitValid)); | 3536 | (lp->linkOK & ~lp->asBitValid); |
3537 | } | 3537 | } |
3538 | } | 3538 | } |
3539 | 3539 | ||
@@ -3544,7 +3544,7 @@ is_anc_capable(struct net_device *dev) | |||
3544 | u_long iobase = dev->base_addr; | 3544 | u_long iobase = dev->base_addr; |
3545 | 3545 | ||
3546 | if (lp->phy[lp->active].id && (!lp->useSROM || lp->useMII)) { | 3546 | if (lp->phy[lp->active].id && (!lp->useSROM || lp->useMII)) { |
3547 | return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII)); | 3547 | return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); |
3548 | } else if ((lp->chipset & ~0x00ff) == DC2114x) { | 3548 | } else if ((lp->chipset & ~0x00ff) == DC2114x) { |
3549 | return (inl(DE4X5_SISR) & SISR_LPN) >> 12; | 3549 | return (inl(DE4X5_SISR) & SISR_LPN) >> 12; |
3550 | } else { | 3550 | } else { |
@@ -4930,7 +4930,7 @@ getfrom_mii(u32 command, u_long ioaddr) | |||
4930 | outl(command | MII_MDC, ioaddr); | 4930 | outl(command | MII_MDC, ioaddr); |
4931 | udelay(1); | 4931 | udelay(1); |
4932 | 4932 | ||
4933 | return ((inl(ioaddr) >> 19) & 1); | 4933 | return (inl(ioaddr) >> 19) & 1; |
4934 | } | 4934 | } |
4935 | 4935 | ||
4936 | /* | 4936 | /* |
@@ -4975,8 +4975,8 @@ mii_get_oui(u_char phyaddr, u_long ioaddr) | |||
4975 | a.breg[0]=a.breg[1]; | 4975 | a.breg[0]=a.breg[1]; |
4976 | a.breg[1]=i; | 4976 | a.breg[1]=i; |
4977 | 4977 | ||
4978 | return ((a.reg<<8)|ret); */ /* SEEQ and Cypress way */ | 4978 | return (a.reg<<8)|ret; */ /* SEEQ and Cypress way */ |
4979 | /* return ((r2<<6)|(u_int)(r3>>10)); */ /* NATIONAL and BROADCOM way */ | 4979 | /* return (r2<<6)|(u_int)(r3>>10); */ /* NATIONAL and BROADCOM way */ |
4980 | return r2; /* (I did it) My way */ | 4980 | return r2; /* (I did it) My way */ |
4981 | } | 4981 | } |
4982 | 4982 | ||
@@ -5144,7 +5144,7 @@ gep_rd(struct net_device *dev) | |||
5144 | if (lp->chipset == DC21140) { | 5144 | if (lp->chipset == DC21140) { |
5145 | return inl(DE4X5_GEP); | 5145 | return inl(DE4X5_GEP); |
5146 | } else if ((lp->chipset & ~0x00ff) == DC2114x) { | 5146 | } else if ((lp->chipset & ~0x00ff) == DC2114x) { |
5147 | return (inl(DE4X5_SIGR) & 0x000fffff); | 5147 | return inl(DE4X5_SIGR) & 0x000fffff; |
5148 | } | 5148 | } |
5149 | 5149 | ||
5150 | return 0; | 5150 | return 0; |
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 1dc27a557275..74217dbf0143 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -1747,7 +1747,7 @@ static u16 phy_readby_cr10(unsigned long iobase, u8 phy_addr, u8 offset) | |||
1747 | if(cr10_value&0x10000000) | 1747 | if(cr10_value&0x10000000) |
1748 | break; | 1748 | break; |
1749 | } | 1749 | } |
1750 | return (cr10_value&0x0ffff); | 1750 | return cr10_value & 0x0ffff; |
1751 | } | 1751 | } |
1752 | 1752 | ||
1753 | static void phy_writeby_cr10(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data) | 1753 | static void phy_writeby_cr10(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data) |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 5dfb39539b3e..1cc67138adbf 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -541,7 +541,7 @@ cleanup: | |||
541 | 541 | ||
542 | indexes->respCleared = cpu_to_le32(cleared); | 542 | indexes->respCleared = cpu_to_le32(cleared); |
543 | wmb(); | 543 | wmb(); |
544 | return (resp_save == NULL); | 544 | return resp_save == NULL; |
545 | } | 545 | } |
546 | 546 | ||
547 | static inline int | 547 | static inline int |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index ee85c8b9a858..d1ac15c95faf 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -203,7 +203,7 @@ static inline void sierra_net_set_private(struct usbnet *dev, | |||
203 | /* is packet IPv4 */ | 203 | /* is packet IPv4 */ |
204 | static inline int is_ip(struct sk_buff *skb) | 204 | static inline int is_ip(struct sk_buff *skb) |
205 | { | 205 | { |
206 | return (skb->protocol == cpu_to_be16(ETH_P_IP)); | 206 | return skb->protocol == cpu_to_be16(ETH_P_IP); |
207 | } | 207 | } |
208 | 208 | ||
209 | /* | 209 | /* |
@@ -354,7 +354,7 @@ static void sierra_net_set_ctx_index(struct sierra_net_data *priv, u8 ctx_ix) | |||
354 | 354 | ||
355 | static inline int sierra_net_is_valid_addrlen(u8 len) | 355 | static inline int sierra_net_is_valid_addrlen(u8 len) |
356 | { | 356 | { |
357 | return (len == sizeof(struct in_addr)); | 357 | return len == sizeof(struct in_addr); |
358 | } | 358 | } |
359 | 359 | ||
360 | static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen) | 360 | static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen) |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 5ec542dd5b50..0bbc0c323135 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -250,7 +250,7 @@ static int veth_close(struct net_device *dev) | |||
250 | 250 | ||
251 | static int is_valid_veth_mtu(int new_mtu) | 251 | static int is_valid_veth_mtu(int new_mtu) |
252 | { | 252 | { |
253 | return (new_mtu >= MIN_MTU && new_mtu <= MAX_MTU); | 253 | return new_mtu >= MIN_MTU && new_mtu <= MAX_MTU; |
254 | } | 254 | } |
255 | 255 | ||
256 | static int veth_change_mtu(struct net_device *dev, int new_mtu) | 256 | static int veth_change_mtu(struct net_device *dev, int new_mtu) |
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 421d0715310e..1481a446fefb 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -97,11 +97,11 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev, | |||
97 | 97 | ||
98 | dest = skb_push(skb, hlen); | 98 | dest = skb_push(skb, hlen); |
99 | if (!dest) | 99 | if (!dest) |
100 | return(0); | 100 | return 0; |
101 | 101 | ||
102 | memcpy(dest, &hdr, hlen); | 102 | memcpy(dest, &hdr, hlen); |
103 | 103 | ||
104 | return(hlen); | 104 | return hlen; |
105 | } | 105 | } |
106 | 106 | ||
107 | static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | 107 | static void dlci_receive(struct sk_buff *skb, struct net_device *dev) |
@@ -211,14 +211,14 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in | |||
211 | if (copy_from_user(&config, conf, sizeof(struct dlci_conf))) | 211 | if (copy_from_user(&config, conf, sizeof(struct dlci_conf))) |
212 | return -EFAULT; | 212 | return -EFAULT; |
213 | if (config.flags & ~DLCI_VALID_FLAGS) | 213 | if (config.flags & ~DLCI_VALID_FLAGS) |
214 | return(-EINVAL); | 214 | return -EINVAL; |
215 | memcpy(&dlp->config, &config, sizeof(struct dlci_conf)); | 215 | memcpy(&dlp->config, &config, sizeof(struct dlci_conf)); |
216 | dlp->configured = 1; | 216 | dlp->configured = 1; |
217 | } | 217 | } |
218 | 218 | ||
219 | err = (*flp->dlci_conf)(dlp->slave, dev, get); | 219 | err = (*flp->dlci_conf)(dlp->slave, dev, get); |
220 | if (err) | 220 | if (err) |
221 | return(err); | 221 | return err; |
222 | 222 | ||
223 | if (get) | 223 | if (get) |
224 | { | 224 | { |
@@ -226,7 +226,7 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in | |||
226 | return -EFAULT; | 226 | return -EFAULT; |
227 | } | 227 | } |
228 | 228 | ||
229 | return(0); | 229 | return 0; |
230 | } | 230 | } |
231 | 231 | ||
232 | static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 232 | static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
@@ -234,7 +234,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
234 | struct dlci_local *dlp; | 234 | struct dlci_local *dlp; |
235 | 235 | ||
236 | if (!capable(CAP_NET_ADMIN)) | 236 | if (!capable(CAP_NET_ADMIN)) |
237 | return(-EPERM); | 237 | return -EPERM; |
238 | 238 | ||
239 | dlp = netdev_priv(dev); | 239 | dlp = netdev_priv(dev); |
240 | 240 | ||
@@ -242,7 +242,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
242 | { | 242 | { |
243 | case DLCI_GET_SLAVE: | 243 | case DLCI_GET_SLAVE: |
244 | if (!*(short *)(dev->dev_addr)) | 244 | if (!*(short *)(dev->dev_addr)) |
245 | return(-EINVAL); | 245 | return -EINVAL; |
246 | 246 | ||
247 | strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave)); | 247 | strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave)); |
248 | break; | 248 | break; |
@@ -250,15 +250,15 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
250 | case DLCI_GET_CONF: | 250 | case DLCI_GET_CONF: |
251 | case DLCI_SET_CONF: | 251 | case DLCI_SET_CONF: |
252 | if (!*(short *)(dev->dev_addr)) | 252 | if (!*(short *)(dev->dev_addr)) |
253 | return(-EINVAL); | 253 | return -EINVAL; |
254 | 254 | ||
255 | return(dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF)); | 255 | return dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF); |
256 | break; | 256 | break; |
257 | 257 | ||
258 | default: | 258 | default: |
259 | return(-EOPNOTSUPP); | 259 | return -EOPNOTSUPP; |
260 | } | 260 | } |
261 | return(0); | 261 | return 0; |
262 | } | 262 | } |
263 | 263 | ||
264 | static int dlci_change_mtu(struct net_device *dev, int new_mtu) | 264 | static int dlci_change_mtu(struct net_device *dev, int new_mtu) |
@@ -277,15 +277,15 @@ static int dlci_open(struct net_device *dev) | |||
277 | dlp = netdev_priv(dev); | 277 | dlp = netdev_priv(dev); |
278 | 278 | ||
279 | if (!*(short *)(dev->dev_addr)) | 279 | if (!*(short *)(dev->dev_addr)) |
280 | return(-EINVAL); | 280 | return -EINVAL; |
281 | 281 | ||
282 | if (!netif_running(dlp->slave)) | 282 | if (!netif_running(dlp->slave)) |
283 | return(-ENOTCONN); | 283 | return -ENOTCONN; |
284 | 284 | ||
285 | flp = netdev_priv(dlp->slave); | 285 | flp = netdev_priv(dlp->slave); |
286 | err = (*flp->activate)(dlp->slave, dev); | 286 | err = (*flp->activate)(dlp->slave, dev); |
287 | if (err) | 287 | if (err) |
288 | return(err); | 288 | return err; |
289 | 289 | ||
290 | netif_start_queue(dev); | 290 | netif_start_queue(dev); |
291 | 291 | ||
@@ -365,14 +365,14 @@ static int dlci_add(struct dlci_add *dlci) | |||
365 | list_add(&dlp->list, &dlci_devs); | 365 | list_add(&dlp->list, &dlci_devs); |
366 | rtnl_unlock(); | 366 | rtnl_unlock(); |
367 | 367 | ||
368 | return(0); | 368 | return 0; |
369 | 369 | ||
370 | err2: | 370 | err2: |
371 | rtnl_unlock(); | 371 | rtnl_unlock(); |
372 | free_netdev(master); | 372 | free_netdev(master); |
373 | err1: | 373 | err1: |
374 | dev_put(slave); | 374 | dev_put(slave); |
375 | return(err); | 375 | return err; |
376 | } | 376 | } |
377 | 377 | ||
378 | static int dlci_del(struct dlci_add *dlci) | 378 | static int dlci_del(struct dlci_add *dlci) |
@@ -385,10 +385,10 @@ static int dlci_del(struct dlci_add *dlci) | |||
385 | /* validate slave device */ | 385 | /* validate slave device */ |
386 | master = __dev_get_by_name(&init_net, dlci->devname); | 386 | master = __dev_get_by_name(&init_net, dlci->devname); |
387 | if (!master) | 387 | if (!master) |
388 | return(-ENODEV); | 388 | return -ENODEV; |
389 | 389 | ||
390 | if (netif_running(master)) { | 390 | if (netif_running(master)) { |
391 | return(-EBUSY); | 391 | return -EBUSY; |
392 | } | 392 | } |
393 | 393 | ||
394 | dlp = netdev_priv(master); | 394 | dlp = netdev_priv(master); |
@@ -406,7 +406,7 @@ static int dlci_del(struct dlci_add *dlci) | |||
406 | } | 406 | } |
407 | rtnl_unlock(); | 407 | rtnl_unlock(); |
408 | 408 | ||
409 | return(err); | 409 | return err; |
410 | } | 410 | } |
411 | 411 | ||
412 | static int dlci_ioctl(unsigned int cmd, void __user *arg) | 412 | static int dlci_ioctl(unsigned int cmd, void __user *arg) |
@@ -415,7 +415,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg) | |||
415 | int err; | 415 | int err; |
416 | 416 | ||
417 | if (!capable(CAP_NET_ADMIN)) | 417 | if (!capable(CAP_NET_ADMIN)) |
418 | return(-EPERM); | 418 | return -EPERM; |
419 | 419 | ||
420 | if (copy_from_user(&add, arg, sizeof(struct dlci_add))) | 420 | if (copy_from_user(&add, arg, sizeof(struct dlci_add))) |
421 | return -EFAULT; | 421 | return -EFAULT; |
@@ -438,7 +438,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg) | |||
438 | err = -EINVAL; | 438 | err = -EINVAL; |
439 | } | 439 | } |
440 | 440 | ||
441 | return(err); | 441 | return err; |
442 | } | 442 | } |
443 | 443 | ||
444 | static const struct header_ops dlci_header_ops = { | 444 | static const struct header_ops dlci_header_ops = { |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 43af85b8e45e..70feb84df670 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -1022,7 +1022,7 @@ static int lmc_open(struct net_device *dev) | |||
1022 | 1022 | ||
1023 | if (sc->lmc_ok){ | 1023 | if (sc->lmc_ok){ |
1024 | lmc_trace(dev, "lmc_open lmc_ok out"); | 1024 | lmc_trace(dev, "lmc_open lmc_ok out"); |
1025 | return (0); | 1025 | return 0; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | lmc_softreset (sc); | 1028 | lmc_softreset (sc); |
@@ -1110,7 +1110,7 @@ static int lmc_open(struct net_device *dev) | |||
1110 | 1110 | ||
1111 | lmc_trace(dev, "lmc_open out"); | 1111 | lmc_trace(dev, "lmc_open out"); |
1112 | 1112 | ||
1113 | return (0); | 1113 | return 0; |
1114 | } | 1114 | } |
1115 | 1115 | ||
1116 | /* Total reset to compensate for the AdTran DSU doing bad things | 1116 | /* Total reset to compensate for the AdTran DSU doing bad things |
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 7a3720f09ce3..17d408fe693f 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c | |||
@@ -379,14 +379,14 @@ static int __init n2_run(unsigned long io, unsigned long irq, | |||
379 | if (request_irq(irq, sca_intr, 0, devname, card)) { | 379 | if (request_irq(irq, sca_intr, 0, devname, card)) { |
380 | printk(KERN_ERR "n2: could not allocate IRQ\n"); | 380 | printk(KERN_ERR "n2: could not allocate IRQ\n"); |
381 | n2_destroy_card(card); | 381 | n2_destroy_card(card); |
382 | return(-EBUSY); | 382 | return -EBUSY; |
383 | } | 383 | } |
384 | card->irq = irq; | 384 | card->irq = irq; |
385 | 385 | ||
386 | if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) { | 386 | if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) { |
387 | printk(KERN_ERR "n2: could not request RAM window\n"); | 387 | printk(KERN_ERR "n2: could not request RAM window\n"); |
388 | n2_destroy_card(card); | 388 | n2_destroy_card(card); |
389 | return(-EBUSY); | 389 | return -EBUSY; |
390 | } | 390 | } |
391 | card->phy_winbase = winbase; | 391 | card->phy_winbase = winbase; |
392 | card->winbase = ioremap(winbase, USE_WINDOWSIZE); | 392 | card->winbase = ioremap(winbase, USE_WINDOWSIZE); |
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index fbf1175a07f1..f875cfae3093 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -451,11 +451,11 @@ static int dma_get_rx_frame_size(pc300_t * card, int ch) | |||
451 | if ((status & DST_EOM) || (first_bd == card->chan[ch].rx_last_bd)) { | 451 | if ((status & DST_EOM) || (first_bd == card->chan[ch].rx_last_bd)) { |
452 | /* Return the size of a good frame or incomplete bad frame | 452 | /* Return the size of a good frame or incomplete bad frame |
453 | * (dma_buf_read will clean the buffer descriptors in this case). */ | 453 | * (dma_buf_read will clean the buffer descriptors in this case). */ |
454 | return (rcvd); | 454 | return rcvd; |
455 | } | 455 | } |
456 | ptdescr = (card->hw.rambase + cpc_readl(&ptdescr->next)); | 456 | ptdescr = (card->hw.rambase + cpc_readl(&ptdescr->next)); |
457 | } | 457 | } |
458 | return (-1); | 458 | return -1; |
459 | } | 459 | } |
460 | 460 | ||
461 | /* | 461 | /* |
@@ -557,7 +557,7 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb) | |||
557 | cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), | 557 | cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), |
558 | RX_BD_ADDR(ch, chan->rx_last_bd)); | 558 | RX_BD_ADDR(ch, chan->rx_last_bd)); |
559 | } | 559 | } |
560 | return (rcvd); | 560 | return rcvd; |
561 | } | 561 | } |
562 | 562 | ||
563 | static void tx_dma_stop(pc300_t * card, int ch) | 563 | static void tx_dma_stop(pc300_t * card, int ch) |
@@ -1733,7 +1733,7 @@ static u16 falc_pattern_test_error(pc300_t * card, int ch) | |||
1733 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; | 1733 | pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; |
1734 | falc_t *pfalc = (falc_t *) & chan->falc; | 1734 | falc_t *pfalc = (falc_t *) & chan->falc; |
1735 | 1735 | ||
1736 | return (pfalc->bec); | 1736 | return pfalc->bec; |
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | /**********************************/ | 1739 | /**********************************/ |
@@ -2819,7 +2819,7 @@ static int clock_rate_calc(u32 rate, u32 clock, int *br_io) | |||
2819 | *br_io = 0; | 2819 | *br_io = 0; |
2820 | 2820 | ||
2821 | if (rate == 0) | 2821 | if (rate == 0) |
2822 | return (0); | 2822 | return 0; |
2823 | 2823 | ||
2824 | for (br = 0, br_pwr = 1; br <= 9; br++, br_pwr <<= 1) { | 2824 | for (br = 0, br_pwr = 1; br <= 9; br++, br_pwr <<= 1) { |
2825 | if ((tc = clock / br_pwr / rate) <= 0xff) { | 2825 | if ((tc = clock / br_pwr / rate) <= 0xff) { |
@@ -2832,11 +2832,11 @@ static int clock_rate_calc(u32 rate, u32 clock, int *br_io) | |||
2832 | error = ((rate - (clock / br_pwr / rate)) / rate) * 1000; | 2832 | error = ((rate - (clock / br_pwr / rate)) / rate) * 1000; |
2833 | /* Errors bigger than +/- 1% won't be tolerated */ | 2833 | /* Errors bigger than +/- 1% won't be tolerated */ |
2834 | if (error < -10 || error > 10) | 2834 | if (error < -10 || error > 10) |
2835 | return (-1); | 2835 | return -1; |
2836 | else | 2836 | else |
2837 | return (tc); | 2837 | return tc; |
2838 | } else { | 2838 | } else { |
2839 | return (-1); | 2839 | return -1; |
2840 | } | 2840 | } |
2841 | } | 2841 | } |
2842 | 2842 | ||
@@ -3207,7 +3207,7 @@ static u32 detect_ram(pc300_t * card) | |||
3207 | break; | 3207 | break; |
3208 | } | 3208 | } |
3209 | } | 3209 | } |
3210 | return (i); | 3210 | return i; |
3211 | } | 3211 | } |
3212 | 3212 | ||
3213 | static void plx_init(pc300_t * card) | 3213 | static void plx_init(pc300_t * card) |
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index 4293889e287e..515d9b8af01e 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -540,7 +540,7 @@ static int cpc_tty_chars_in_buffer(struct tty_struct *tty) | |||
540 | return -ENODEV; | 540 | return -ENODEV; |
541 | } | 541 | } |
542 | 542 | ||
543 | return(0); | 543 | return 0; |
544 | } | 544 | } |
545 | 545 | ||
546 | static int pc300_tiocmset(struct tty_struct *tty, struct file *file, | 546 | static int pc300_tiocmset(struct tty_struct *tty, struct file *file, |
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index f4125da2762f..3f4e2b5684db 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -178,7 +178,7 @@ static char sdla_byte(struct net_device *dev, int addr) | |||
178 | byte = *temp; | 178 | byte = *temp; |
179 | spin_unlock_irqrestore(&sdla_lock, flags); | 179 | spin_unlock_irqrestore(&sdla_lock, flags); |
180 | 180 | ||
181 | return(byte); | 181 | return byte; |
182 | } | 182 | } |
183 | 183 | ||
184 | static void sdla_stop(struct net_device *dev) | 184 | static void sdla_stop(struct net_device *dev) |
@@ -267,7 +267,7 @@ static int sdla_z80_poll(struct net_device *dev, int z80_addr, int jiffs, char r | |||
267 | resp = *temp; | 267 | resp = *temp; |
268 | } | 268 | } |
269 | } | 269 | } |
270 | return(time_before(jiffies, done) ? jiffies - start : -1); | 270 | return time_before(jiffies, done) ? jiffies - start : -1; |
271 | } | 271 | } |
272 | 272 | ||
273 | /* constants for Z80 CPU speed */ | 273 | /* constants for Z80 CPU speed */ |
@@ -283,13 +283,13 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr) | |||
283 | 283 | ||
284 | sdla_start(dev); | 284 | sdla_start(dev); |
285 | if (sdla_z80_poll(dev, 0, 3*HZ, Z80_READY, 0) < 0) | 285 | if (sdla_z80_poll(dev, 0, 3*HZ, Z80_READY, 0) < 0) |
286 | return(-EIO); | 286 | return -EIO; |
287 | 287 | ||
288 | data = LOADER_READY; | 288 | data = LOADER_READY; |
289 | sdla_write(dev, 0, &data, 1); | 289 | sdla_write(dev, 0, &data, 1); |
290 | 290 | ||
291 | if ((jiffs = sdla_z80_poll(dev, 0, 8*HZ, Z80_SCC_OK, Z80_SCC_BAD)) < 0) | 291 | if ((jiffs = sdla_z80_poll(dev, 0, 8*HZ, Z80_SCC_OK, Z80_SCC_BAD)) < 0) |
292 | return(-EIO); | 292 | return -EIO; |
293 | 293 | ||
294 | sdla_stop(dev); | 294 | sdla_stop(dev); |
295 | sdla_read(dev, 0, &data, 1); | 295 | sdla_read(dev, 0, &data, 1); |
@@ -297,11 +297,11 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr) | |||
297 | if (data == Z80_SCC_BAD) | 297 | if (data == Z80_SCC_BAD) |
298 | { | 298 | { |
299 | printk("%s: SCC bad\n", dev->name); | 299 | printk("%s: SCC bad\n", dev->name); |
300 | return(-EIO); | 300 | return -EIO; |
301 | } | 301 | } |
302 | 302 | ||
303 | if (data != Z80_SCC_OK) | 303 | if (data != Z80_SCC_OK) |
304 | return(-EINVAL); | 304 | return -EINVAL; |
305 | 305 | ||
306 | if (jiffs < 165) | 306 | if (jiffs < 165) |
307 | ifr->ifr_mtu = SDLA_CPU_16M; | 307 | ifr->ifr_mtu = SDLA_CPU_16M; |
@@ -316,7 +316,7 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr) | |||
316 | else | 316 | else |
317 | ifr->ifr_mtu = SDLA_CPU_3M; | 317 | ifr->ifr_mtu = SDLA_CPU_3M; |
318 | 318 | ||
319 | return(0); | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | /************************************************ | 322 | /************************************************ |
@@ -493,7 +493,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags, | |||
493 | if (ret != SDLA_RET_OK) | 493 | if (ret != SDLA_RET_OK) |
494 | sdla_errors(dev, cmd, dlci, ret, len, &status); | 494 | sdla_errors(dev, cmd, dlci, ret, len, &status); |
495 | 495 | ||
496 | return(ret); | 496 | return ret; |
497 | } | 497 | } |
498 | 498 | ||
499 | /*********************************************** | 499 | /*********************************************** |
@@ -516,14 +516,14 @@ static int sdla_activate(struct net_device *slave, struct net_device *master) | |||
516 | break; | 516 | break; |
517 | 517 | ||
518 | if (i == CONFIG_DLCI_MAX) | 518 | if (i == CONFIG_DLCI_MAX) |
519 | return(-ENODEV); | 519 | return -ENODEV; |
520 | 520 | ||
521 | flp->dlci[i] = abs(flp->dlci[i]); | 521 | flp->dlci[i] = abs(flp->dlci[i]); |
522 | 522 | ||
523 | if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) | 523 | if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) |
524 | sdla_cmd(slave, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); | 524 | sdla_cmd(slave, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); |
525 | 525 | ||
526 | return(0); | 526 | return 0; |
527 | } | 527 | } |
528 | 528 | ||
529 | static int sdla_deactivate(struct net_device *slave, struct net_device *master) | 529 | static int sdla_deactivate(struct net_device *slave, struct net_device *master) |
@@ -538,14 +538,14 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master) | |||
538 | break; | 538 | break; |
539 | 539 | ||
540 | if (i == CONFIG_DLCI_MAX) | 540 | if (i == CONFIG_DLCI_MAX) |
541 | return(-ENODEV); | 541 | return -ENODEV; |
542 | 542 | ||
543 | flp->dlci[i] = -abs(flp->dlci[i]); | 543 | flp->dlci[i] = -abs(flp->dlci[i]); |
544 | 544 | ||
545 | if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) | 545 | if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) |
546 | sdla_cmd(slave, SDLA_DEACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); | 546 | sdla_cmd(slave, SDLA_DEACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); |
547 | 547 | ||
548 | return(0); | 548 | return 0; |
549 | } | 549 | } |
550 | 550 | ||
551 | static int sdla_assoc(struct net_device *slave, struct net_device *master) | 551 | static int sdla_assoc(struct net_device *slave, struct net_device *master) |
@@ -554,7 +554,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master) | |||
554 | int i; | 554 | int i; |
555 | 555 | ||
556 | if (master->type != ARPHRD_DLCI) | 556 | if (master->type != ARPHRD_DLCI) |
557 | return(-EINVAL); | 557 | return -EINVAL; |
558 | 558 | ||
559 | flp = netdev_priv(slave); | 559 | flp = netdev_priv(slave); |
560 | 560 | ||
@@ -563,11 +563,11 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master) | |||
563 | if (!flp->master[i]) | 563 | if (!flp->master[i]) |
564 | break; | 564 | break; |
565 | if (abs(flp->dlci[i]) == *(short *)(master->dev_addr)) | 565 | if (abs(flp->dlci[i]) == *(short *)(master->dev_addr)) |
566 | return(-EADDRINUSE); | 566 | return -EADDRINUSE; |
567 | } | 567 | } |
568 | 568 | ||
569 | if (i == CONFIG_DLCI_MAX) | 569 | if (i == CONFIG_DLCI_MAX) |
570 | return(-EMLINK); /* #### Alan: Comments on this ?? */ | 570 | return -EMLINK; /* #### Alan: Comments on this ?? */ |
571 | 571 | ||
572 | 572 | ||
573 | flp->master[i] = master; | 573 | flp->master[i] = master; |
@@ -581,7 +581,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master) | |||
581 | sdla_cmd(slave, SDLA_ADD_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); | 581 | sdla_cmd(slave, SDLA_ADD_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); |
582 | } | 582 | } |
583 | 583 | ||
584 | return(0); | 584 | return 0; |
585 | } | 585 | } |
586 | 586 | ||
587 | static int sdla_deassoc(struct net_device *slave, struct net_device *master) | 587 | static int sdla_deassoc(struct net_device *slave, struct net_device *master) |
@@ -596,7 +596,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master) | |||
596 | break; | 596 | break; |
597 | 597 | ||
598 | if (i == CONFIG_DLCI_MAX) | 598 | if (i == CONFIG_DLCI_MAX) |
599 | return(-ENODEV); | 599 | return -ENODEV; |
600 | 600 | ||
601 | flp->master[i] = NULL; | 601 | flp->master[i] = NULL; |
602 | flp->dlci[i] = 0; | 602 | flp->dlci[i] = 0; |
@@ -609,7 +609,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master) | |||
609 | sdla_cmd(slave, SDLA_DELETE_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); | 609 | sdla_cmd(slave, SDLA_DELETE_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); |
610 | } | 610 | } |
611 | 611 | ||
612 | return(0); | 612 | return 0; |
613 | } | 613 | } |
614 | 614 | ||
615 | static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, int get) | 615 | static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, int get) |
@@ -626,7 +626,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i | |||
626 | break; | 626 | break; |
627 | 627 | ||
628 | if (i == CONFIG_DLCI_MAX) | 628 | if (i == CONFIG_DLCI_MAX) |
629 | return(-ENODEV); | 629 | return -ENODEV; |
630 | 630 | ||
631 | dlp = netdev_priv(master); | 631 | dlp = netdev_priv(master); |
632 | 632 | ||
@@ -641,7 +641,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i | |||
641 | &dlp->config, sizeof(struct dlci_conf) - 4 * sizeof(short), NULL, NULL); | 641 | &dlp->config, sizeof(struct dlci_conf) - 4 * sizeof(short), NULL, NULL); |
642 | } | 642 | } |
643 | 643 | ||
644 | return(ret == SDLA_RET_OK ? 0 : -EIO); | 644 | return ret == SDLA_RET_OK ? 0 : -EIO; |
645 | } | 645 | } |
646 | 646 | ||
647 | /************************** | 647 | /************************** |
@@ -986,7 +986,7 @@ static int sdla_close(struct net_device *dev) | |||
986 | 986 | ||
987 | netif_stop_queue(dev); | 987 | netif_stop_queue(dev); |
988 | 988 | ||
989 | return(0); | 989 | return 0; |
990 | } | 990 | } |
991 | 991 | ||
992 | struct conf_data { | 992 | struct conf_data { |
@@ -1006,10 +1006,10 @@ static int sdla_open(struct net_device *dev) | |||
1006 | flp = netdev_priv(dev); | 1006 | flp = netdev_priv(dev); |
1007 | 1007 | ||
1008 | if (!flp->initialized) | 1008 | if (!flp->initialized) |
1009 | return(-EPERM); | 1009 | return -EPERM; |
1010 | 1010 | ||
1011 | if (!flp->configured) | 1011 | if (!flp->configured) |
1012 | return(-EPERM); | 1012 | return -EPERM; |
1013 | 1013 | ||
1014 | /* time to send in the configuration */ | 1014 | /* time to send in the configuration */ |
1015 | len = 0; | 1015 | len = 0; |
@@ -1087,7 +1087,7 @@ static int sdla_open(struct net_device *dev) | |||
1087 | 1087 | ||
1088 | netif_start_queue(dev); | 1088 | netif_start_queue(dev); |
1089 | 1089 | ||
1090 | return(0); | 1090 | return 0; |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get) | 1093 | static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get) |
@@ -1098,48 +1098,48 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in | |||
1098 | short size; | 1098 | short size; |
1099 | 1099 | ||
1100 | if (dev->type == 0xFFFF) | 1100 | if (dev->type == 0xFFFF) |
1101 | return(-EUNATCH); | 1101 | return -EUNATCH; |
1102 | 1102 | ||
1103 | flp = netdev_priv(dev); | 1103 | flp = netdev_priv(dev); |
1104 | 1104 | ||
1105 | if (!get) | 1105 | if (!get) |
1106 | { | 1106 | { |
1107 | if (netif_running(dev)) | 1107 | if (netif_running(dev)) |
1108 | return(-EBUSY); | 1108 | return -EBUSY; |
1109 | 1109 | ||
1110 | if(copy_from_user(&data.config, conf, sizeof(struct frad_conf))) | 1110 | if(copy_from_user(&data.config, conf, sizeof(struct frad_conf))) |
1111 | return -EFAULT; | 1111 | return -EFAULT; |
1112 | 1112 | ||
1113 | if (data.config.station & ~FRAD_STATION_NODE) | 1113 | if (data.config.station & ~FRAD_STATION_NODE) |
1114 | return(-EINVAL); | 1114 | return -EINVAL; |
1115 | 1115 | ||
1116 | if (data.config.flags & ~FRAD_VALID_FLAGS) | 1116 | if (data.config.flags & ~FRAD_VALID_FLAGS) |
1117 | return(-EINVAL); | 1117 | return -EINVAL; |
1118 | 1118 | ||
1119 | if ((data.config.kbaud < 0) || | 1119 | if ((data.config.kbaud < 0) || |
1120 | ((data.config.kbaud > 128) && (flp->type != SDLA_S508))) | 1120 | ((data.config.kbaud > 128) && (flp->type != SDLA_S508))) |
1121 | return(-EINVAL); | 1121 | return -EINVAL; |
1122 | 1122 | ||
1123 | if (data.config.clocking & ~(FRAD_CLOCK_INT | SDLA_S508_PORT_RS232)) | 1123 | if (data.config.clocking & ~(FRAD_CLOCK_INT | SDLA_S508_PORT_RS232)) |
1124 | return(-EINVAL); | 1124 | return -EINVAL; |
1125 | 1125 | ||
1126 | if ((data.config.mtu < 0) || (data.config.mtu > SDLA_MAX_MTU)) | 1126 | if ((data.config.mtu < 0) || (data.config.mtu > SDLA_MAX_MTU)) |
1127 | return(-EINVAL); | 1127 | return -EINVAL; |
1128 | 1128 | ||
1129 | if ((data.config.T391 < 5) || (data.config.T391 > 30)) | 1129 | if ((data.config.T391 < 5) || (data.config.T391 > 30)) |
1130 | return(-EINVAL); | 1130 | return -EINVAL; |
1131 | 1131 | ||
1132 | if ((data.config.T392 < 5) || (data.config.T392 > 30)) | 1132 | if ((data.config.T392 < 5) || (data.config.T392 > 30)) |
1133 | return(-EINVAL); | 1133 | return -EINVAL; |
1134 | 1134 | ||
1135 | if ((data.config.N391 < 1) || (data.config.N391 > 255)) | 1135 | if ((data.config.N391 < 1) || (data.config.N391 > 255)) |
1136 | return(-EINVAL); | 1136 | return -EINVAL; |
1137 | 1137 | ||
1138 | if ((data.config.N392 < 1) || (data.config.N392 > 10)) | 1138 | if ((data.config.N392 < 1) || (data.config.N392 > 10)) |
1139 | return(-EINVAL); | 1139 | return -EINVAL; |
1140 | 1140 | ||
1141 | if ((data.config.N393 < 1) || (data.config.N393 > 10)) | 1141 | if ((data.config.N393 < 1) || (data.config.N393 > 10)) |
1142 | return(-EINVAL); | 1142 | return -EINVAL; |
1143 | 1143 | ||
1144 | memcpy(&flp->config, &data.config, sizeof(struct frad_conf)); | 1144 | memcpy(&flp->config, &data.config, sizeof(struct frad_conf)); |
1145 | flp->config.flags |= SDLA_DIRECT_RECV; | 1145 | flp->config.flags |= SDLA_DIRECT_RECV; |
@@ -1171,7 +1171,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in | |||
1171 | { | 1171 | { |
1172 | size = sizeof(data); | 1172 | size = sizeof(data); |
1173 | if (sdla_cmd(dev, SDLA_READ_DLCI_CONFIGURATION, 0, 0, NULL, 0, &data, &size) != SDLA_RET_OK) | 1173 | if (sdla_cmd(dev, SDLA_READ_DLCI_CONFIGURATION, 0, 0, NULL, 0, &data, &size) != SDLA_RET_OK) |
1174 | return(-EIO); | 1174 | return -EIO; |
1175 | } | 1175 | } |
1176 | else | 1176 | else |
1177 | if (flp->configured) | 1177 | if (flp->configured) |
@@ -1185,7 +1185,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in | |||
1185 | return copy_to_user(conf, &data.config, sizeof(struct frad_conf))?-EFAULT:0; | 1185 | return copy_to_user(conf, &data.config, sizeof(struct frad_conf))?-EFAULT:0; |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | return(0); | 1188 | return 0; |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read) | 1191 | static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read) |
@@ -1200,7 +1200,7 @@ static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int r | |||
1200 | { | 1200 | { |
1201 | temp = kzalloc(mem.len, GFP_KERNEL); | 1201 | temp = kzalloc(mem.len, GFP_KERNEL); |
1202 | if (!temp) | 1202 | if (!temp) |
1203 | return(-ENOMEM); | 1203 | return -ENOMEM; |
1204 | sdla_read(dev, mem.addr, temp, mem.len); | 1204 | sdla_read(dev, mem.addr, temp, mem.len); |
1205 | if(copy_to_user(mem.data, temp, mem.len)) | 1205 | if(copy_to_user(mem.data, temp, mem.len)) |
1206 | { | 1206 | { |
@@ -1217,7 +1217,7 @@ static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int r | |||
1217 | sdla_write(dev, mem.addr, temp, mem.len); | 1217 | sdla_write(dev, mem.addr, temp, mem.len); |
1218 | kfree(temp); | 1218 | kfree(temp); |
1219 | } | 1219 | } |
1220 | return(0); | 1220 | return 0; |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | static int sdla_reconfig(struct net_device *dev) | 1223 | static int sdla_reconfig(struct net_device *dev) |
@@ -1241,7 +1241,7 @@ static int sdla_reconfig(struct net_device *dev) | |||
1241 | sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL); | 1241 | sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL); |
1242 | sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL); | 1242 | sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL); |
1243 | 1243 | ||
1244 | return(0); | 1244 | return 0; |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 1247 | static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
@@ -1254,20 +1254,20 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1254 | flp = netdev_priv(dev); | 1254 | flp = netdev_priv(dev); |
1255 | 1255 | ||
1256 | if (!flp->initialized) | 1256 | if (!flp->initialized) |
1257 | return(-EINVAL); | 1257 | return -EINVAL; |
1258 | 1258 | ||
1259 | switch (cmd) | 1259 | switch (cmd) |
1260 | { | 1260 | { |
1261 | case FRAD_GET_CONF: | 1261 | case FRAD_GET_CONF: |
1262 | case FRAD_SET_CONF: | 1262 | case FRAD_SET_CONF: |
1263 | return(sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF)); | 1263 | return sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF); |
1264 | 1264 | ||
1265 | case SDLA_IDENTIFY: | 1265 | case SDLA_IDENTIFY: |
1266 | ifr->ifr_flags = flp->type; | 1266 | ifr->ifr_flags = flp->type; |
1267 | break; | 1267 | break; |
1268 | 1268 | ||
1269 | case SDLA_CPUSPEED: | 1269 | case SDLA_CPUSPEED: |
1270 | return(sdla_cpuspeed(dev, ifr)); | 1270 | return sdla_cpuspeed(dev, ifr); |
1271 | 1271 | ||
1272 | /* ========================================================== | 1272 | /* ========================================================== |
1273 | NOTE: This is rather a useless action right now, as the | 1273 | NOTE: This is rather a useless action right now, as the |
@@ -1277,7 +1277,7 @@ NOTE: This is rather a useless action right now, as the | |||
1277 | ============================================================*/ | 1277 | ============================================================*/ |
1278 | case SDLA_PROTOCOL: | 1278 | case SDLA_PROTOCOL: |
1279 | if (flp->configured) | 1279 | if (flp->configured) |
1280 | return(-EALREADY); | 1280 | return -EALREADY; |
1281 | 1281 | ||
1282 | switch (ifr->ifr_flags) | 1282 | switch (ifr->ifr_flags) |
1283 | { | 1283 | { |
@@ -1285,7 +1285,7 @@ NOTE: This is rather a useless action right now, as the | |||
1285 | dev->type = ifr->ifr_flags; | 1285 | dev->type = ifr->ifr_flags; |
1286 | break; | 1286 | break; |
1287 | default: | 1287 | default: |
1288 | return(-ENOPROTOOPT); | 1288 | return -ENOPROTOOPT; |
1289 | } | 1289 | } |
1290 | break; | 1290 | break; |
1291 | 1291 | ||
@@ -1297,7 +1297,7 @@ NOTE: This is rather a useless action right now, as the | |||
1297 | case SDLA_READMEM: | 1297 | case SDLA_READMEM: |
1298 | if(!capable(CAP_SYS_RAWIO)) | 1298 | if(!capable(CAP_SYS_RAWIO)) |
1299 | return -EPERM; | 1299 | return -EPERM; |
1300 | return(sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM)); | 1300 | return sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM); |
1301 | 1301 | ||
1302 | case SDLA_START: | 1302 | case SDLA_START: |
1303 | sdla_start(dev); | 1303 | sdla_start(dev); |
@@ -1308,9 +1308,9 @@ NOTE: This is rather a useless action right now, as the | |||
1308 | break; | 1308 | break; |
1309 | 1309 | ||
1310 | default: | 1310 | default: |
1311 | return(-EOPNOTSUPP); | 1311 | return -EOPNOTSUPP; |
1312 | } | 1312 | } |
1313 | return(0); | 1313 | return 0; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | static int sdla_change_mtu(struct net_device *dev, int new_mtu) | 1316 | static int sdla_change_mtu(struct net_device *dev, int new_mtu) |
@@ -1320,10 +1320,10 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu) | |||
1320 | flp = netdev_priv(dev); | 1320 | flp = netdev_priv(dev); |
1321 | 1321 | ||
1322 | if (netif_running(dev)) | 1322 | if (netif_running(dev)) |
1323 | return(-EBUSY); | 1323 | return -EBUSY; |
1324 | 1324 | ||
1325 | /* for now, you can't change the MTU! */ | 1325 | /* for now, you can't change the MTU! */ |
1326 | return(-EOPNOTSUPP); | 1326 | return -EOPNOTSUPP; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | static int sdla_set_config(struct net_device *dev, struct ifmap *map) | 1329 | static int sdla_set_config(struct net_device *dev, struct ifmap *map) |
@@ -1337,18 +1337,18 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map) | |||
1337 | flp = netdev_priv(dev); | 1337 | flp = netdev_priv(dev); |
1338 | 1338 | ||
1339 | if (flp->initialized) | 1339 | if (flp->initialized) |
1340 | return(-EINVAL); | 1340 | return -EINVAL; |
1341 | 1341 | ||
1342 | for(i=0; i < ARRAY_SIZE(valid_port); i++) | 1342 | for(i=0; i < ARRAY_SIZE(valid_port); i++) |
1343 | if (valid_port[i] == map->base_addr) | 1343 | if (valid_port[i] == map->base_addr) |
1344 | break; | 1344 | break; |
1345 | 1345 | ||
1346 | if (i == ARRAY_SIZE(valid_port)) | 1346 | if (i == ARRAY_SIZE(valid_port)) |
1347 | return(-EINVAL); | 1347 | return -EINVAL; |
1348 | 1348 | ||
1349 | if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){ | 1349 | if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){ |
1350 | printk(KERN_WARNING "SDLA: io-port 0x%04lx in use\n", dev->base_addr); | 1350 | printk(KERN_WARNING "SDLA: io-port 0x%04lx in use\n", dev->base_addr); |
1351 | return(-EINVAL); | 1351 | return -EINVAL; |
1352 | } | 1352 | } |
1353 | base = map->base_addr; | 1353 | base = map->base_addr; |
1354 | 1354 | ||
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index e47f5a986b1c..d81ad8397885 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -648,7 +648,7 @@ static int x25_asy_esc(unsigned char *s, unsigned char *d, int len) | |||
648 | } | 648 | } |
649 | } | 649 | } |
650 | *ptr++ = X25_END; | 650 | *ptr++ = X25_END; |
651 | return (ptr - d); | 651 | return ptr - d; |
652 | } | 652 | } |
653 | 653 | ||
654 | static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) | 654 | static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 788a9bc1dbac..630fb8664768 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -135,7 +135,7 @@ static void skb_entry_set_link(union skb_entry *list, unsigned short id) | |||
135 | static int skb_entry_is_link(const union skb_entry *list) | 135 | static int skb_entry_is_link(const union skb_entry *list) |
136 | { | 136 | { |
137 | BUILD_BUG_ON(sizeof(list->skb) != sizeof(list->link)); | 137 | BUILD_BUG_ON(sizeof(list->skb) != sizeof(list->link)); |
138 | return ((unsigned long)list->skb < PAGE_OFFSET); | 138 | return (unsigned long)list->skb < PAGE_OFFSET; |
139 | } | 139 | } |
140 | 140 | ||
141 | /* | 141 | /* |
@@ -203,8 +203,8 @@ static void rx_refill_timeout(unsigned long data) | |||
203 | 203 | ||
204 | static int netfront_tx_slot_available(struct netfront_info *np) | 204 | static int netfront_tx_slot_available(struct netfront_info *np) |
205 | { | 205 | { |
206 | return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < | 206 | return (np->tx.req_prod_pvt - np->tx.rsp_cons) < |
207 | (TX_MAX_TARGET - MAX_SKB_FRAGS - 2)); | 207 | (TX_MAX_TARGET - MAX_SKB_FRAGS - 2); |
208 | } | 208 | } |
209 | 209 | ||
210 | static void xennet_maybe_wake_tx(struct net_device *dev) | 210 | static void xennet_maybe_wake_tx(struct net_device *dev) |