diff options
Diffstat (limited to 'drivers/net/sis190.c')
-rw-r--r-- | drivers/net/sis190.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 1e8e7111c261..2229698debbd 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #define TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) | 69 | #define TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) |
70 | #define RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) | 70 | #define RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) |
71 | #define RX_BUF_SIZE 1536 | 71 | #define RX_BUF_SIZE 1536 |
72 | #define RX_BUF_MASK 0xfff8 | ||
72 | 73 | ||
73 | #define SIS190_REGS_SIZE 0x80 | 74 | #define SIS190_REGS_SIZE 0x80 |
74 | #define SIS190_TX_TIMEOUT (6*HZ) | 75 | #define SIS190_TX_TIMEOUT (6*HZ) |
@@ -400,7 +401,7 @@ static inline void sis190_give_to_asic(struct RxDesc *desc, u32 rx_buf_sz) | |||
400 | u32 eor = le32_to_cpu(desc->size) & RingEnd; | 401 | u32 eor = le32_to_cpu(desc->size) & RingEnd; |
401 | 402 | ||
402 | desc->PSize = 0x0; | 403 | desc->PSize = 0x0; |
403 | desc->size = cpu_to_le32(rx_buf_sz | eor); | 404 | desc->size = cpu_to_le32((rx_buf_sz & RX_BUF_MASK) | eor); |
404 | wmb(); | 405 | wmb(); |
405 | desc->status = cpu_to_le32(OWNbit | INTbit); | 406 | desc->status = cpu_to_le32(OWNbit | INTbit); |
406 | } | 407 | } |
@@ -924,6 +925,11 @@ static void sis190_set_rxbufsize(struct sis190_private *tp, | |||
924 | unsigned int mtu = dev->mtu; | 925 | unsigned int mtu = dev->mtu; |
925 | 926 | ||
926 | tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; | 927 | tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; |
928 | /* RxDesc->size has a licence to kill the lower bits */ | ||
929 | if (tp->rx_buf_sz & 0x07) { | ||
930 | tp->rx_buf_sz += 8; | ||
931 | tp->rx_buf_sz &= RX_BUF_MASK; | ||
932 | } | ||
927 | } | 933 | } |
928 | 934 | ||
929 | static int sis190_open(struct net_device *dev) | 935 | static int sis190_open(struct net_device *dev) |