.. | .. |
---|
260 | 260 | return sbni_isa_probe( dev ); |
---|
261 | 261 | /* otherwise we have to perform search our adapter */ |
---|
262 | 262 | |
---|
263 | | - if( io[ num ] != -1 ) |
---|
264 | | - dev->base_addr = io[ num ], |
---|
| 263 | + if( io[ num ] != -1 ) { |
---|
| 264 | + dev->base_addr = io[ num ]; |
---|
265 | 265 | dev->irq = irq[ num ]; |
---|
266 | | - else if( scandone || io[ 0 ] != -1 ) |
---|
| 266 | + } else if( scandone || io[ 0 ] != -1 ) { |
---|
267 | 267 | return -ENODEV; |
---|
| 268 | + } |
---|
268 | 269 | |
---|
269 | 270 | /* if io[ num ] contains non-zero address, then that is on ISA bus */ |
---|
270 | 271 | if( dev->base_addr ) |
---|
.. | .. |
---|
399 | 400 | nl->maxframe = DEFAULT_FRAME_LEN; |
---|
400 | 401 | nl->csr1.rate = baud[ num ]; |
---|
401 | 402 | |
---|
402 | | - if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) |
---|
| 403 | + if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) { |
---|
403 | 404 | /* autotune rxl */ |
---|
404 | | - nl->cur_rxl_index = DEF_RXL, |
---|
| 405 | + nl->cur_rxl_index = DEF_RXL; |
---|
405 | 406 | nl->delta_rxl = DEF_RXL_DELTA; |
---|
406 | | - else |
---|
| 407 | + } else { |
---|
407 | 408 | nl->delta_rxl = 0; |
---|
| 409 | + } |
---|
408 | 410 | nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; |
---|
409 | 411 | if( inb( ioaddr + CSR0 ) & 0x01 ) |
---|
410 | 412 | nl->state |= FL_SLOW_MODE; |
---|
.. | .. |
---|
512 | 514 | |
---|
513 | 515 | do { |
---|
514 | 516 | repeat = 0; |
---|
515 | | - if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) |
---|
516 | | - handle_channel( dev ), |
---|
| 517 | + if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) { |
---|
| 518 | + handle_channel( dev ); |
---|
517 | 519 | repeat = 1; |
---|
| 520 | + } |
---|
518 | 521 | if( nl->second && /* second channel present */ |
---|
519 | | - (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) |
---|
520 | | - handle_channel( nl->second ), |
---|
| 522 | + (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) { |
---|
| 523 | + handle_channel( nl->second ); |
---|
521 | 524 | repeat = 1; |
---|
| 525 | + } |
---|
522 | 526 | } while( repeat ); |
---|
523 | 527 | |
---|
524 | 528 | if( nl->second ) |
---|
.. | .. |
---|
610 | 614 | nl->state |= FL_PREV_OK; |
---|
611 | 615 | if( framelen > 4 ) |
---|
612 | 616 | nl->in_stats.all_rx_number++; |
---|
613 | | - } else |
---|
614 | | - nl->state &= ~FL_PREV_OK, |
---|
615 | | - change_level( dev ), |
---|
616 | | - nl->in_stats.all_rx_number++, |
---|
| 617 | + } else { |
---|
| 618 | + nl->state &= ~FL_PREV_OK; |
---|
| 619 | + change_level( dev ); |
---|
| 620 | + nl->in_stats.all_rx_number++; |
---|
617 | 621 | nl->in_stats.bad_rx_number++; |
---|
| 622 | + } |
---|
618 | 623 | |
---|
619 | 624 | return !frame_ok || framelen > 4; |
---|
620 | 625 | } |
---|
.. | .. |
---|
689 | 694 | *crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len ); |
---|
690 | 695 | |
---|
691 | 696 | /* if packet too short we should write some more bytes to pad */ |
---|
692 | | - for( len = nl->framelen - len; len--; ) |
---|
693 | | - outb( 0, dev->base_addr + DAT ), |
---|
| 697 | + for( len = nl->framelen - len; len--; ) { |
---|
| 698 | + outb( 0, dev->base_addr + DAT ); |
---|
694 | 699 | *crc_p = CRC32( 0, *crc_p ); |
---|
| 700 | + } |
---|
695 | 701 | } |
---|
696 | 702 | |
---|
697 | 703 | |
---|
.. | .. |
---|
703 | 709 | |
---|
704 | 710 | int frame_ok; |
---|
705 | 711 | |
---|
706 | | - if( is_first ) |
---|
707 | | - nl->wait_frameno = frameno, |
---|
| 712 | + if( is_first ) { |
---|
| 713 | + nl->wait_frameno = frameno; |
---|
708 | 714 | nl->inppos = 0; |
---|
| 715 | + } |
---|
709 | 716 | |
---|
710 | 717 | if( nl->wait_frameno == frameno ) { |
---|
711 | 718 | |
---|
.. | .. |
---|
717 | 724 | * error was occurred... drop entire packet |
---|
718 | 725 | */ |
---|
719 | 726 | else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc )) |
---|
720 | | - != 0 ) |
---|
721 | | - nl->wait_frameno = 0, |
---|
722 | | - nl->inppos = 0, |
---|
| 727 | + != 0 ) { |
---|
| 728 | + nl->wait_frameno = 0; |
---|
| 729 | + nl->inppos = 0; |
---|
723 | 730 | #ifdef CONFIG_SBNI_MULTILINE |
---|
724 | | - nl->master->stats.rx_errors++, |
---|
| 731 | + nl->master->stats.rx_errors++; |
---|
725 | 732 | nl->master->stats.rx_missed_errors++; |
---|
726 | 733 | #else |
---|
727 | | - dev->stats.rx_errors++, |
---|
| 734 | + dev->stats.rx_errors++; |
---|
728 | 735 | dev->stats.rx_missed_errors++; |
---|
729 | 736 | #endif |
---|
| 737 | + } |
---|
730 | 738 | /* now skip all frames until is_first != 0 */ |
---|
731 | 739 | } else |
---|
732 | 740 | frame_ok = skip_tail( dev->base_addr, framelen, crc ); |
---|
733 | 741 | |
---|
734 | | - if( is_first && !frame_ok ) |
---|
| 742 | + if( is_first && !frame_ok ) { |
---|
735 | 743 | /* |
---|
736 | 744 | * Frame has been broken, but we had already stored |
---|
737 | 745 | * is_first... Drop entire packet. |
---|
738 | 746 | */ |
---|
739 | | - nl->wait_frameno = 0, |
---|
| 747 | + nl->wait_frameno = 0; |
---|
740 | 748 | #ifdef CONFIG_SBNI_MULTILINE |
---|
741 | | - nl->master->stats.rx_errors++, |
---|
| 749 | + nl->master->stats.rx_errors++; |
---|
742 | 750 | nl->master->stats.rx_crc_errors++; |
---|
743 | 751 | #else |
---|
744 | | - dev->stats.rx_errors++, |
---|
| 752 | + dev->stats.rx_errors++; |
---|
745 | 753 | dev->stats.rx_crc_errors++; |
---|
746 | 754 | #endif |
---|
| 755 | + } |
---|
747 | 756 | |
---|
748 | 757 | return frame_ok; |
---|
749 | 758 | } |
---|
.. | .. |
---|
761 | 770 | dev->stats.tx_packets++; |
---|
762 | 771 | dev->stats.tx_bytes += nl->tx_buf_p->len; |
---|
763 | 772 | #endif |
---|
764 | | - dev_kfree_skb_irq( nl->tx_buf_p ); |
---|
| 773 | + dev_consume_skb_irq(nl->tx_buf_p); |
---|
765 | 774 | |
---|
766 | 775 | nl->tx_buf_p = NULL; |
---|
767 | 776 | |
---|
.. | .. |
---|
782 | 791 | if( nl->state & FL_WAIT_ACK ) { |
---|
783 | 792 | nl->outpos += nl->framelen; |
---|
784 | 793 | |
---|
785 | | - if( --nl->tx_frameno ) |
---|
| 794 | + if( --nl->tx_frameno ) { |
---|
786 | 795 | nl->framelen = min_t(unsigned int, |
---|
787 | 796 | nl->maxframe, |
---|
788 | 797 | nl->tx_buf_p->len - nl->outpos); |
---|
789 | | - else |
---|
790 | | - send_complete( dev ), |
---|
| 798 | + } else { |
---|
| 799 | + send_complete( dev ); |
---|
791 | 800 | #ifdef CONFIG_SBNI_MULTILINE |
---|
792 | 801 | netif_wake_queue( nl->master ); |
---|
793 | 802 | #else |
---|
794 | 803 | netif_wake_queue( dev ); |
---|
795 | 804 | #endif |
---|
| 805 | + } |
---|
796 | 806 | } |
---|
797 | 807 | } |
---|
798 | 808 | |
---|
.. | .. |
---|
872 | 882 | { |
---|
873 | 883 | struct net_local *nl = netdev_priv(dev); |
---|
874 | 884 | |
---|
875 | | - if( nl->tx_buf_p ) |
---|
876 | | - dev_kfree_skb_any( nl->tx_buf_p ), |
---|
877 | | - nl->tx_buf_p = NULL, |
---|
| 885 | + if( nl->tx_buf_p ) { |
---|
| 886 | + dev_kfree_skb_any( nl->tx_buf_p ); |
---|
| 887 | + nl->tx_buf_p = NULL; |
---|
878 | 888 | #ifdef CONFIG_SBNI_MULTILINE |
---|
879 | | - nl->master->stats.tx_errors++, |
---|
| 889 | + nl->master->stats.tx_errors++; |
---|
880 | 890 | nl->master->stats.tx_carrier_errors++; |
---|
881 | 891 | #else |
---|
882 | | - dev->stats.tx_errors++, |
---|
| 892 | + dev->stats.tx_errors++; |
---|
883 | 893 | dev->stats.tx_carrier_errors++; |
---|
884 | 894 | #endif |
---|
| 895 | + } |
---|
885 | 896 | |
---|
886 | 897 | nl->tx_frameno = 0; |
---|
887 | 898 | nl->framelen = 0; |
---|
.. | .. |
---|
1327 | 1338 | |
---|
1328 | 1339 | spin_lock( &nl->lock ); |
---|
1329 | 1340 | flags = *(struct sbni_flags*) &ifr->ifr_ifru; |
---|
1330 | | - if( flags.fixed_rxl ) |
---|
1331 | | - nl->delta_rxl = 0, |
---|
| 1341 | + if( flags.fixed_rxl ) { |
---|
| 1342 | + nl->delta_rxl = 0; |
---|
1332 | 1343 | nl->cur_rxl_index = flags.rxl; |
---|
1333 | | - else |
---|
1334 | | - nl->delta_rxl = DEF_RXL_DELTA, |
---|
| 1344 | + } else { |
---|
| 1345 | + nl->delta_rxl = DEF_RXL_DELTA; |
---|
1335 | 1346 | nl->cur_rxl_index = DEF_RXL; |
---|
| 1347 | + } |
---|
1336 | 1348 | |
---|
1337 | 1349 | nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; |
---|
1338 | 1350 | nl->csr1.rate = flags.rate; |
---|
.. | .. |
---|
1526 | 1538 | (*dest[ parm ])[ n ] = simple_strtol( p, &p, 0 ); |
---|
1527 | 1539 | if( !*p || *p == ')' ) |
---|
1528 | 1540 | return 1; |
---|
1529 | | - if( *p == ';' ) |
---|
1530 | | - ++p, ++n, parm = 0; |
---|
1531 | | - else if( *p++ != ',' ) |
---|
| 1541 | + if( *p == ';' ) { |
---|
| 1542 | + ++p; |
---|
| 1543 | + ++n; |
---|
| 1544 | + parm = 0; |
---|
| 1545 | + } else if( *p++ != ',' ) { |
---|
1532 | 1546 | break; |
---|
1533 | | - else |
---|
| 1547 | + } else { |
---|
1534 | 1548 | if( ++parm >= 5 ) |
---|
1535 | 1549 | break; |
---|
| 1550 | + } |
---|
1536 | 1551 | } |
---|
1537 | 1552 | bad_param: |
---|
1538 | 1553 | pr_err("Error in sbni kernel parameter!\n"); |
---|