diff options
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 13 |
1 files changed, 6 insertions, 7 deletions
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, |