diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-30 15:35:11 +0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-30 15:35:11 +0400 |
commit | 67577927e8d7a1f4b09b4992df640eadc6aacb36 (patch) | |
tree | 2e9efe6b5745965faf0dcc084d4613d9356263f9 /drivers/net/netxen/netxen_nic_hw.c | |
parent | 6fe4c590313133ebd5dadb769031489ff178ece1 (diff) | |
parent | 51f00a471ce8f359627dd99aeac322947a0e491b (diff) | |
download | linux-67577927e8d7a1f4b09b4992df640eadc6aacb36.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Conflicts:
drivers/mtd/mtd_blkdevs.c
Merge Grant's device-tree bits so that we can apply the subsequent fixes.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 29d7b93d0493..37d3ebd65be8 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -319,6 +319,8 @@ static unsigned crb_hub_agt[64] = #define NETXEN_PCIE_SEM_TIMEOUT 10000 +static int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu); + int netxen_pcie_sem_lock(struct netxen_adapter *adapter, int sem, u32 id_reg) { @@ -345,7 +347,7 @@ netxen_pcie_sem_unlock(struct netxen_adapter *adapter, int sem) NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM_UNLOCK(sem))); } -int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) +static int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) { if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_1+(0x10000*port), 0x1447); @@ -356,7 +358,7 @@ int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) } /* Disable an XG interface */ -int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) +static int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) { __u32 mac_cfg; u32 port = adapter->physical_port; @@ -383,7 +385,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) #define MAC_LO(addr) \ ((addr[5] << 16) | (addr[4] << 8) | (addr[3])) -int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) +static int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) { u32 mac_cfg; u32 cnt = 0; @@ -434,7 +436,7 @@ int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) return 0; } -int netxen_p2_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr) +static int netxen_p2_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr) { u32 mac_hi, mac_lo; u32 reg_hi, reg_lo; @@ -531,7 +533,7 @@ netxen_nic_set_mcast_addr(struct netxen_adapter *adapter, return 0; } -void netxen_p2_nic_set_multi(struct net_device *netdev) +static void netxen_p2_nic_set_multi(struct net_device *netdev) { struct netxen_adapter *adapter = netdev_priv(netdev); struct netdev_hw_addr *ha; @@ -598,8 +600,14 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, if (nr_desc >= netxen_tx_avail(tx_ring)) { netif_tx_stop_queue(tx_ring->txq); - __netif_tx_unlock_bh(tx_ring->txq); - return -EBUSY; + smp_mb(); + if (netxen_tx_avail(tx_ring) > nr_desc) { + if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH) + netif_tx_wake_queue(tx_ring->txq); + } else { + __netif_tx_unlock_bh(tx_ring->txq); + return -EBUSY; + } } do { @@ -674,7 +682,7 @@ static int nx_p3_nic_add_mac(struct netxen_adapter *adapter, cur->mac_addr, NETXEN_MAC_ADD); } -void netxen_p3_nic_set_multi(struct net_device *netdev) +static void netxen_p3_nic_set_multi(struct net_device *netdev) { struct netxen_adapter *adapter = netdev_priv(netdev); struct netdev_hw_addr *ha; @@ -721,7 +729,7 @@ send_fw_cmd: } } -int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) +static int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) { nx_nic_req_t req; u64 word; @@ -754,7 +762,7 @@ void netxen_p3_free_mac_list(struct netxen_adapter *adapter) } } -int netxen_p3_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr) +static int netxen_p3_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr) { /* assuming caller has already copied new addr to netdev */ netxen_p3_nic_set_multi(adapter->netdev); @@ -1816,14 +1824,14 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) if (netxen_rom_fast_read(adapter, offset, &board_type)) return -EIO; - adapter->ahw.board_type = board_type; - if (board_type == NETXEN_BRDTYPE_P3_4_GB_MM) { u32 gpio = NXRD32(adapter, NETXEN_ROMUSB_GLB_PAD_GPIO_I); if ((gpio & 0x8000) == 0) board_type = NETXEN_BRDTYPE_P3_10G_TP; } + adapter->ahw.board_type = board_type; + switch (board_type) { case NETXEN_BRDTYPE_P2_SB35_4G: adapter->ahw.port_type = NETXEN_NIC_GBE; @@ -1867,16 +1875,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) } /* NIU access sections */ - -int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) -{ - new_mtu += MTU_FUDGE_FACTOR; - NXWR32(adapter, NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port), - new_mtu); - return 0; -} - -int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) +static int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) { new_mtu += MTU_FUDGE_FACTOR; if (adapter->physical_port == 0) |