diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 20:24:53 -0400 |
commit | 492b057c426e4aa747484958e18e9da29003985d (patch) | |
tree | 34e08c24618688d8bcc190523028b5f94cce0c0b /drivers/net/s2io.c | |
parent | 313485175da221c388f6a8ecf4c30062ba9bea17 (diff) | |
parent | 300df7dc89cc276377fc020704e34875d5c473b6 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 1a4979f27fb5..458daa06ed41 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <linux/kernel.h> | 63 | #include <linux/kernel.h> |
64 | #include <linux/netdevice.h> | 64 | #include <linux/netdevice.h> |
65 | #include <linux/etherdevice.h> | 65 | #include <linux/etherdevice.h> |
66 | #include <linux/mdio.h> | ||
66 | #include <linux/skbuff.h> | 67 | #include <linux/skbuff.h> |
67 | #include <linux/init.h> | 68 | #include <linux/init.h> |
68 | #include <linux/delay.h> | 69 | #include <linux/delay.h> |
@@ -1763,7 +1764,7 @@ static int init_nic(struct s2io_nic *nic) | |||
1763 | * by then we return error. | 1764 | * by then we return error. |
1764 | */ | 1765 | */ |
1765 | time = 0; | 1766 | time = 0; |
1766 | while (TRUE) { | 1767 | while (true) { |
1767 | val64 = readq(&bar0->rti_command_mem); | 1768 | val64 = readq(&bar0->rti_command_mem); |
1768 | if (!(val64 & RTI_CMD_MEM_STROBE_NEW_CMD)) | 1769 | if (!(val64 & RTI_CMD_MEM_STROBE_NEW_CMD)) |
1769 | break; | 1770 | break; |
@@ -2136,7 +2137,7 @@ static int verify_pcc_quiescent(struct s2io_nic *sp, int flag) | |||
2136 | 2137 | ||
2137 | herc = (sp->device_type == XFRAME_II_DEVICE); | 2138 | herc = (sp->device_type == XFRAME_II_DEVICE); |
2138 | 2139 | ||
2139 | if (flag == FALSE) { | 2140 | if (flag == false) { |
2140 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { | 2141 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { |
2141 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) | 2142 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) |
2142 | ret = 1; | 2143 | ret = 1; |
@@ -3328,9 +3329,9 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3328 | struct stat_block *stat_info = sp->mac_control.stats_info; | 3329 | struct stat_block *stat_info = sp->mac_control.stats_info; |
3329 | 3330 | ||
3330 | /* Check the communication with the MDIO slave */ | 3331 | /* Check the communication with the MDIO slave */ |
3331 | addr = 0x0000; | 3332 | addr = MDIO_CTRL1; |
3332 | val64 = 0x0; | 3333 | val64 = 0x0; |
3333 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3334 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3334 | if((val64 == 0xFFFF) || (val64 == 0x0000)) | 3335 | if((val64 == 0xFFFF) || (val64 == 0x0000)) |
3335 | { | 3336 | { |
3336 | DBG_PRINT(ERR_DBG, "ERR: MDIO slave access failed - " | 3337 | DBG_PRINT(ERR_DBG, "ERR: MDIO slave access failed - " |
@@ -3338,24 +3339,24 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3338 | return; | 3339 | return; |
3339 | } | 3340 | } |
3340 | 3341 | ||
3341 | /* Check for the expecte value of 2040 at PMA address 0x0000 */ | 3342 | /* Check for the expected value of control reg 1 */ |
3342 | if(val64 != 0x2040) | 3343 | if(val64 != MDIO_CTRL1_SPEED10G) |
3343 | { | 3344 | { |
3344 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - "); | 3345 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - "); |
3345 | DBG_PRINT(ERR_DBG, "Returned: %llx- Expected: 0x2040\n", | 3346 | DBG_PRINT(ERR_DBG, "Returned: %llx- Expected: 0x%x\n", |
3346 | (unsigned long long)val64); | 3347 | (unsigned long long)val64, MDIO_CTRL1_SPEED10G); |
3347 | return; | 3348 | return; |
3348 | } | 3349 | } |
3349 | 3350 | ||
3350 | /* Loading the DOM register to MDIO register */ | 3351 | /* Loading the DOM register to MDIO register */ |
3351 | addr = 0xA100; | 3352 | addr = 0xA100; |
3352 | s2io_mdio_write(MDIO_MMD_PMA_DEV_ADDR, addr, val16, dev); | 3353 | s2io_mdio_write(MDIO_MMD_PMAPMD, addr, val16, dev); |
3353 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3354 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3354 | 3355 | ||
3355 | /* Reading the Alarm flags */ | 3356 | /* Reading the Alarm flags */ |
3356 | addr = 0xA070; | 3357 | addr = 0xA070; |
3357 | val64 = 0x0; | 3358 | val64 = 0x0; |
3358 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3359 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3359 | 3360 | ||
3360 | flag = CHECKBIT(val64, 0x7); | 3361 | flag = CHECKBIT(val64, 0x7); |
3361 | type = 1; | 3362 | type = 1; |
@@ -3387,7 +3388,7 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3387 | /* Reading the Warning flags */ | 3388 | /* Reading the Warning flags */ |
3388 | addr = 0xA074; | 3389 | addr = 0xA074; |
3389 | val64 = 0x0; | 3390 | val64 = 0x0; |
3390 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3391 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3391 | 3392 | ||
3392 | if(CHECKBIT(val64, 0x7)) | 3393 | if(CHECKBIT(val64, 0x7)) |
3393 | stat_info->xpak_stat.warn_transceiver_temp_high++; | 3394 | stat_info->xpak_stat.warn_transceiver_temp_high++; |
@@ -3586,7 +3587,7 @@ static void s2io_reset(struct s2io_nic * sp) | |||
3586 | writeq(val64, &bar0->pcc_err_reg); | 3587 | writeq(val64, &bar0->pcc_err_reg); |
3587 | } | 3588 | } |
3588 | 3589 | ||
3589 | sp->device_enabled_once = FALSE; | 3590 | sp->device_enabled_once = false; |
3590 | } | 3591 | } |
3591 | 3592 | ||
3592 | /** | 3593 | /** |
@@ -4298,7 +4299,6 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4298 | s2io_stop_tx_queue(sp, fifo->fifo_no); | 4299 | s2io_stop_tx_queue(sp, fifo->fifo_no); |
4299 | } | 4300 | } |
4300 | mac_control->stats_info->sw_stat.mem_allocated += skb->truesize; | 4301 | mac_control->stats_info->sw_stat.mem_allocated += skb->truesize; |
4301 | dev->trans_start = jiffies; | ||
4302 | spin_unlock_irqrestore(&fifo->tx_lock, flags); | 4302 | spin_unlock_irqrestore(&fifo->tx_lock, flags); |
4303 | 4303 | ||
4304 | if (sp->config.intr_type == MSI_X) | 4304 | if (sp->config.intr_type == MSI_X) |
@@ -5572,10 +5572,10 @@ static void s2io_ethtool_getpause_data(struct net_device *dev, | |||
5572 | 5572 | ||
5573 | val64 = readq(&bar0->rmac_pause_cfg); | 5573 | val64 = readq(&bar0->rmac_pause_cfg); |
5574 | if (val64 & RMAC_PAUSE_GEN_ENABLE) | 5574 | if (val64 & RMAC_PAUSE_GEN_ENABLE) |
5575 | ep->tx_pause = TRUE; | 5575 | ep->tx_pause = true; |
5576 | if (val64 & RMAC_PAUSE_RX_ENABLE) | 5576 | if (val64 & RMAC_PAUSE_RX_ENABLE) |
5577 | ep->rx_pause = TRUE; | 5577 | ep->rx_pause = true; |
5578 | ep->autoneg = FALSE; | 5578 | ep->autoneg = false; |
5579 | } | 5579 | } |
5580 | 5580 | ||
5581 | /** | 5581 | /** |
@@ -6806,7 +6806,7 @@ static void s2io_set_link(struct work_struct *work) | |||
6806 | val64 |= ADAPTER_LED_ON; | 6806 | val64 |= ADAPTER_LED_ON; |
6807 | writeq(val64, &bar0->adapter_control); | 6807 | writeq(val64, &bar0->adapter_control); |
6808 | } | 6808 | } |
6809 | nic->device_enabled_once = TRUE; | 6809 | nic->device_enabled_once = true; |
6810 | } else { | 6810 | } else { |
6811 | DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name); | 6811 | DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name); |
6812 | DBG_PRINT(ERR_DBG, "device is not Quiescent\n"); | 6812 | DBG_PRINT(ERR_DBG, "device is not Quiescent\n"); |
@@ -7754,7 +7754,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7754 | struct s2io_nic *sp; | 7754 | struct s2io_nic *sp; |
7755 | struct net_device *dev; | 7755 | struct net_device *dev; |
7756 | int i, j, ret; | 7756 | int i, j, ret; |
7757 | int dma_flag = FALSE; | 7757 | int dma_flag = false; |
7758 | u32 mac_up, mac_down; | 7758 | u32 mac_up, mac_down; |
7759 | u64 val64 = 0, tmp64 = 0; | 7759 | u64 val64 = 0, tmp64 = 0; |
7760 | struct XENA_dev_config __iomem *bar0 = NULL; | 7760 | struct XENA_dev_config __iomem *bar0 = NULL; |
@@ -7777,7 +7777,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7777 | 7777 | ||
7778 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 7778 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
7779 | DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n"); | 7779 | DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n"); |
7780 | dma_flag = TRUE; | 7780 | dma_flag = true; |
7781 | if (pci_set_consistent_dma_mask | 7781 | if (pci_set_consistent_dma_mask |
7782 | (pdev, DMA_BIT_MASK(64))) { | 7782 | (pdev, DMA_BIT_MASK(64))) { |
7783 | DBG_PRINT(ERR_DBG, | 7783 | DBG_PRINT(ERR_DBG, |
@@ -7818,7 +7818,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7818 | sp->dev = dev; | 7818 | sp->dev = dev; |
7819 | sp->pdev = pdev; | 7819 | sp->pdev = pdev; |
7820 | sp->high_dma_flag = dma_flag; | 7820 | sp->high_dma_flag = dma_flag; |
7821 | sp->device_enabled_once = FALSE; | 7821 | sp->device_enabled_once = false; |
7822 | if (rx_ring_mode == 1) | 7822 | if (rx_ring_mode == 1) |
7823 | sp->rxd_mode = RXD_MODE_1; | 7823 | sp->rxd_mode = RXD_MODE_1; |
7824 | if (rx_ring_mode == 2) | 7824 | if (rx_ring_mode == 2) |
@@ -7964,7 +7964,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7964 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 7964 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
7965 | 7965 | ||
7966 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 7966 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; |
7967 | if (sp->high_dma_flag == TRUE) | 7967 | if (sp->high_dma_flag == true) |
7968 | dev->features |= NETIF_F_HIGHDMA; | 7968 | dev->features |= NETIF_F_HIGHDMA; |
7969 | dev->features |= NETIF_F_TSO; | 7969 | dev->features |= NETIF_F_TSO; |
7970 | dev->features |= NETIF_F_TSO6; | 7970 | dev->features |= NETIF_F_TSO6; |