aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smsc911x.c
diff options
context:
space:
mode:
authorSteve Glendinning <steve.glendinning@smsc.com>2009-03-18 20:24:44 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-20 02:59:27 -0400
commit785b6f977a89aaabc3dd3e3bfc87f36015cb8050 (patch)
tree8d73ee27ca093bcfab839b31a3e9990ada3570d9 /drivers/net/smsc911x.c
parent2e1ab634bf013792d8803ec57c7a428a76f50028 (diff)
smsc911x: define status word positions as constants
The vast majority of bit constants in this driver are defined in the header file, but TX and RX status word bits are not. This patch (which should make no functional change) defines these, to make the driver slightly more readable. Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smsc911x.c')
-rw-r--r--drivers/net/smsc911x.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index ad15aab2137d..0232292bd170 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -895,22 +895,22 @@ static void smsc911x_tx_update_txcounters(struct net_device *dev)
895 SMSC_WARNING(HW, 895 SMSC_WARNING(HW,
896 "Packet tag reserved bit is high"); 896 "Packet tag reserved bit is high");
897 } else { 897 } else {
898 if (unlikely(tx_stat & 0x00008000)) { 898 if (unlikely(tx_stat & TX_STS_ES_)) {
899 dev->stats.tx_errors++; 899 dev->stats.tx_errors++;
900 } else { 900 } else {
901 dev->stats.tx_packets++; 901 dev->stats.tx_packets++;
902 dev->stats.tx_bytes += (tx_stat >> 16); 902 dev->stats.tx_bytes += (tx_stat >> 16);
903 } 903 }
904 if (unlikely(tx_stat & 0x00000100)) { 904 if (unlikely(tx_stat & TX_STS_EXCESS_COL_)) {
905 dev->stats.collisions += 16; 905 dev->stats.collisions += 16;
906 dev->stats.tx_aborted_errors += 1; 906 dev->stats.tx_aborted_errors += 1;
907 } else { 907 } else {
908 dev->stats.collisions += 908 dev->stats.collisions +=
909 ((tx_stat >> 3) & 0xF); 909 ((tx_stat >> 3) & 0xF);
910 } 910 }
911 if (unlikely(tx_stat & 0x00000800)) 911 if (unlikely(tx_stat & TX_STS_LOST_CARRIER_))
912 dev->stats.tx_carrier_errors += 1; 912 dev->stats.tx_carrier_errors += 1;
913 if (unlikely(tx_stat & 0x00000200)) { 913 if (unlikely(tx_stat & TX_STS_LATE_COL_)) {
914 dev->stats.collisions++; 914 dev->stats.collisions++;
915 dev->stats.tx_aborted_errors++; 915 dev->stats.tx_aborted_errors++;
916 } 916 }
@@ -924,19 +924,17 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
924{ 924{
925 int crc_err = 0; 925 int crc_err = 0;
926 926
927 if (unlikely(rxstat & 0x00008000)) { 927 if (unlikely(rxstat & RX_STS_ES_)) {
928 dev->stats.rx_errors++; 928 dev->stats.rx_errors++;
929 if (unlikely(rxstat & 0x00000002)) { 929 if (unlikely(rxstat & RX_STS_CRC_ERR_)) {
930 dev->stats.rx_crc_errors++; 930 dev->stats.rx_crc_errors++;
931 crc_err = 1; 931 crc_err = 1;
932 } 932 }
933 } 933 }
934 if (likely(!crc_err)) { 934 if (likely(!crc_err)) {
935 if (unlikely((rxstat & 0x00001020) == 0x00001020)) { 935 if (unlikely((rxstat & RX_STS_FRAME_TYPE_) &&
936 /* Frame type indicates length, 936 (rxstat & RX_STS_LENGTH_ERR_)))
937 * and length error is set */
938 dev->stats.rx_length_errors++; 937 dev->stats.rx_length_errors++;
939 }
940 if (rxstat & RX_STS_MCAST_) 938 if (rxstat & RX_STS_MCAST_)
941 dev->stats.multicast++; 939 dev->stats.multicast++;
942 } 940 }