diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-08-24 23:23:26 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-27 02:29:17 +0400 |
commit | c9517e5893db03ca8bd32b8783b39af58176947c (patch) | |
tree | 5ae4d26af6f38e70a868e634d0576056c326027e /drivers/net/netxen/netxen_nic_ctx.c | |
parent | cb7e4b6e37144f5d131ee09296be3c21c41f28d8 (diff) | |
download | linux-c9517e5893db03ca8bd32b8783b39af58176947c.tar.xz |
netxen: implement generic pcie semaphore functions
Implement common function for locking/unlocking 8 hardware
semaphores used for serializing access to shared resouces
on a NIC board by different PCI functions.
As by definition, callers of these semaphore API can be
put to sleep till the semaphore is locked.
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_ctx.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_ctx.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 3d676fecb0a7..ef846b43390a 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c @@ -33,41 +33,6 @@ #define NXHAL_VERSION 1 -static int -netxen_api_lock(struct netxen_adapter *adapter) -{ - u32 done = 0, timeout = 0; - - for (;;) { - /* Acquire PCIE HW semaphore5 */ - done = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM5_LOCK)); - - if (done == 1) - break; - - if (++timeout >= NX_OS_CRB_RETRY_COUNT) { - printk(KERN_ERR "%s: lock timeout.\n", __func__); - return -1; - } - - msleep(1); - } - -#if 0 - NXWR32(adapter, - NETXEN_API_LOCK_ID, NX_OS_API_LOCK_DRIVER); -#endif - return 0; -} - -static int -netxen_api_unlock(struct netxen_adapter *adapter) -{ - /* Release PCIE HW semaphore5 */ - NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM5_UNLOCK)); - return 0; -} - static u32 netxen_poll_rsp(struct netxen_adapter *adapter) { |