summaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-05-05 19:05:06 +0000
committerDavid S. Miller <davem@davemloft.net>2009-05-06 15:33:35 -0700
commit22527864ed7ee6c50f3c4d4b03c83c963caf5c0b (patch)
tree074c3dce3fe61b54aec6c7d8a829c4fa7592a6c0 /drivers/net/netxen/netxen_nic_hw.c
parent78a658d9720ce1b3dd71af3ee6d207ca751a48f5 (diff)
downloadblackbird-obmc-linux-22527864ed7ee6c50f3c4d4b03c83c963caf5c0b.tar.gz
blackbird-obmc-linux-22527864ed7ee6c50f3c4d4b03c83c963caf5c0b.zip
netxen: fix race in tx ring acccess
Fix the distance check between tx ring producer and consumer that could lead to tx ring wrap around. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 9f5ced3eaf9d..23c974a7e0e4 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -526,7 +526,7 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
producer = tx_ring->producer;
consumer = tx_ring->sw_consumer;
- if (nr_desc > find_diff_among(producer, consumer, tx_ring->num_desc)) {
+ if (nr_desc >= find_diff_among(producer, consumer, tx_ring->num_desc)) {
netif_tx_unlock_bh(adapter->netdev);
return -EBUSY;
}
@@ -752,7 +752,7 @@ int netxen_linkevent_request(struct netxen_adapter *adapter, int enable)
word = NX_NIC_H2C_OPCODE_GET_LINKEVENT | ((u64)adapter->portnum << 16);
req.req_hdr = cpu_to_le64(word);
- req.words[0] = cpu_to_le64(enable);
+ req.words[0] = cpu_to_le64(enable | (enable << 8));
rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
if (rv != 0) {
OpenPOWER on IntegriCloud