diff options
-rw-r--r-- | drivers/net/s2io.c | 321 | ||||
-rw-r--r-- | drivers/net/s2io.h | 5 |
2 files changed, 165 insertions, 161 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 1d13f60a9f52..3138df5773ee 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -652,9 +652,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
652 | size += tx_cfg->fifo_len; | 652 | size += tx_cfg->fifo_len; |
653 | } | 653 | } |
654 | if (size > MAX_AVAILABLE_TXDS) { | 654 | if (size > MAX_AVAILABLE_TXDS) { |
655 | DBG_PRINT(ERR_DBG, "s2io: Requested TxDs too high, "); | 655 | DBG_PRINT(ERR_DBG, |
656 | DBG_PRINT(ERR_DBG, "Requested: %d, max supported: 8192\n", | 656 | "Too many TxDs requested: %d, max supported: %d\n", |
657 | size); | 657 | size, MAX_AVAILABLE_TXDS); |
658 | return -EINVAL; | 658 | return -EINVAL; |
659 | } | 659 | } |
660 | 660 | ||
@@ -667,10 +667,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
667 | * Legal values are from 2 to 8192 | 667 | * Legal values are from 2 to 8192 |
668 | */ | 668 | */ |
669 | if (size < 2) { | 669 | if (size < 2) { |
670 | DBG_PRINT(ERR_DBG, "s2io: Invalid fifo len (%d)", size); | 670 | DBG_PRINT(ERR_DBG, "Fifo %d: Invalid length (%d) - " |
671 | DBG_PRINT(ERR_DBG, "for fifo %d\n", i); | 671 | "Valid lengths are 2 through 8192\n", |
672 | DBG_PRINT(ERR_DBG, "s2io: Legal values for fifo len" | 672 | i, size); |
673 | "are 2 to 8192\n"); | ||
674 | return -EINVAL; | 673 | return -EINVAL; |
675 | } | 674 | } |
676 | } | 675 | } |
@@ -713,8 +712,8 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
713 | tmp_v = pci_alloc_consistent(nic->pdev, | 712 | tmp_v = pci_alloc_consistent(nic->pdev, |
714 | PAGE_SIZE, &tmp_p); | 713 | PAGE_SIZE, &tmp_p); |
715 | if (!tmp_v) { | 714 | if (!tmp_v) { |
716 | DBG_PRINT(INFO_DBG, "pci_alloc_consistent "); | 715 | DBG_PRINT(INFO_DBG, |
717 | DBG_PRINT(INFO_DBG, "failed for TxDL\n"); | 716 | "pci_alloc_consistent failed for TxDL\n"); |
718 | return -ENOMEM; | 717 | return -ENOMEM; |
719 | } | 718 | } |
720 | /* If we got a zero DMA address(can happen on | 719 | /* If we got a zero DMA address(can happen on |
@@ -725,17 +724,14 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
725 | if (!tmp_p) { | 724 | if (!tmp_p) { |
726 | mac_control->zerodma_virt_addr = tmp_v; | 725 | mac_control->zerodma_virt_addr = tmp_v; |
727 | DBG_PRINT(INIT_DBG, | 726 | DBG_PRINT(INIT_DBG, |
728 | "%s: Zero DMA address for TxDL. ", | 727 | "%s: Zero DMA address for TxDL. " |
729 | dev->name); | 728 | "Virtual address %p\n", |
730 | DBG_PRINT(INIT_DBG, | 729 | dev->name, tmp_v); |
731 | "Virtual address %p\n", tmp_v); | ||
732 | tmp_v = pci_alloc_consistent(nic->pdev, | 730 | tmp_v = pci_alloc_consistent(nic->pdev, |
733 | PAGE_SIZE, &tmp_p); | 731 | PAGE_SIZE, &tmp_p); |
734 | if (!tmp_v) { | 732 | if (!tmp_v) { |
735 | DBG_PRINT(INFO_DBG, | 733 | DBG_PRINT(INFO_DBG, |
736 | "pci_alloc_consistent "); | 734 | "pci_alloc_consistent failed for TxDL\n"); |
737 | DBG_PRINT(INFO_DBG, | ||
738 | "failed for TxDL\n"); | ||
739 | return -ENOMEM; | 735 | return -ENOMEM; |
740 | } | 736 | } |
741 | mem_allocated += PAGE_SIZE; | 737 | mem_allocated += PAGE_SIZE; |
@@ -771,9 +767,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
771 | struct ring_info *ring = &mac_control->rings[i]; | 767 | struct ring_info *ring = &mac_control->rings[i]; |
772 | 768 | ||
773 | if (rx_cfg->num_rxd % (rxd_count[nic->rxd_mode] + 1)) { | 769 | if (rx_cfg->num_rxd % (rxd_count[nic->rxd_mode] + 1)) { |
774 | DBG_PRINT(ERR_DBG, "%s: RxD count of ", dev->name); | 770 | DBG_PRINT(ERR_DBG, "%s: Ring%d RxD count is not a " |
775 | DBG_PRINT(ERR_DBG, "Ring%d is not a multiple of ", i); | 771 | "multiple of RxDs per Block\n", |
776 | DBG_PRINT(ERR_DBG, "RxDs per Block"); | 772 | dev->name, i); |
777 | return FAILURE; | 773 | return FAILURE; |
778 | } | 774 | } |
779 | size += rx_cfg->num_rxd; | 775 | size += rx_cfg->num_rxd; |
@@ -927,7 +923,7 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
927 | tmp_v_addr = mac_control->stats_mem; | 923 | tmp_v_addr = mac_control->stats_mem; |
928 | mac_control->stats_info = (struct stat_block *)tmp_v_addr; | 924 | mac_control->stats_info = (struct stat_block *)tmp_v_addr; |
929 | memset(tmp_v_addr, 0, size); | 925 | memset(tmp_v_addr, 0, size); |
930 | DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name, | 926 | DBG_PRINT(INIT_DBG, "%s: Ring Mem PHY: 0x%llx\n", dev->name, |
931 | (unsigned long long)tmp_p_addr); | 927 | (unsigned long long)tmp_p_addr); |
932 | mac_control->stats_info->sw_stat.mem_allocated += mem_allocated; | 928 | mac_control->stats_info->sw_stat.mem_allocated += mem_allocated; |
933 | return SUCCESS; | 929 | return SUCCESS; |
@@ -994,10 +990,9 @@ static void free_shared_mem(struct s2io_nic *nic) | |||
994 | mac_control->zerodma_virt_addr, | 990 | mac_control->zerodma_virt_addr, |
995 | (dma_addr_t)0); | 991 | (dma_addr_t)0); |
996 | DBG_PRINT(INIT_DBG, | 992 | DBG_PRINT(INIT_DBG, |
997 | "%s: Freeing TxDL with zero DMA addr. ", | 993 | "%s: Freeing TxDL with zero DMA address. " |
998 | dev->name); | 994 | "Virtual address %p\n", |
999 | DBG_PRINT(INIT_DBG, "Virtual address %p\n", | 995 | dev->name, mac_control->zerodma_virt_addr); |
1000 | mac_control->zerodma_virt_addr); | ||
1001 | swstats->mem_freed += PAGE_SIZE; | 996 | swstats->mem_freed += PAGE_SIZE; |
1002 | } | 997 | } |
1003 | kfree(fifo->list_info); | 998 | kfree(fifo->list_info); |
@@ -1120,6 +1115,7 @@ static int s2io_print_pci_mode(struct s2io_nic *nic) | |||
1120 | register u64 val64 = 0; | 1115 | register u64 val64 = 0; |
1121 | int mode; | 1116 | int mode; |
1122 | struct config_param *config = &nic->config; | 1117 | struct config_param *config = &nic->config; |
1118 | const char *pcimode; | ||
1123 | 1119 | ||
1124 | val64 = readq(&bar0->pci_mode); | 1120 | val64 = readq(&bar0->pci_mode); |
1125 | mode = (u8)GET_PCI_MODE(val64); | 1121 | mode = (u8)GET_PCI_MODE(val64); |
@@ -1135,38 +1131,39 @@ static int s2io_print_pci_mode(struct s2io_nic *nic) | |||
1135 | return mode; | 1131 | return mode; |
1136 | } | 1132 | } |
1137 | 1133 | ||
1138 | DBG_PRINT(ERR_DBG, "%s: Device is on %d bit ", | ||
1139 | nic->dev->name, val64 & PCI_MODE_32_BITS ? 32 : 64); | ||
1140 | |||
1141 | switch (mode) { | 1134 | switch (mode) { |
1142 | case PCI_MODE_PCI_33: | 1135 | case PCI_MODE_PCI_33: |
1143 | DBG_PRINT(ERR_DBG, "33MHz PCI bus\n"); | 1136 | pcimode = "33MHz PCI bus"; |
1144 | break; | 1137 | break; |
1145 | case PCI_MODE_PCI_66: | 1138 | case PCI_MODE_PCI_66: |
1146 | DBG_PRINT(ERR_DBG, "66MHz PCI bus\n"); | 1139 | pcimode = "66MHz PCI bus"; |
1147 | break; | 1140 | break; |
1148 | case PCI_MODE_PCIX_M1_66: | 1141 | case PCI_MODE_PCIX_M1_66: |
1149 | DBG_PRINT(ERR_DBG, "66MHz PCIX(M1) bus\n"); | 1142 | pcimode = "66MHz PCIX(M1) bus"; |
1150 | break; | 1143 | break; |
1151 | case PCI_MODE_PCIX_M1_100: | 1144 | case PCI_MODE_PCIX_M1_100: |
1152 | DBG_PRINT(ERR_DBG, "100MHz PCIX(M1) bus\n"); | 1145 | pcimode = "100MHz PCIX(M1) bus"; |
1153 | break; | 1146 | break; |
1154 | case PCI_MODE_PCIX_M1_133: | 1147 | case PCI_MODE_PCIX_M1_133: |
1155 | DBG_PRINT(ERR_DBG, "133MHz PCIX(M1) bus\n"); | 1148 | pcimode = "133MHz PCIX(M1) bus"; |
1156 | break; | 1149 | break; |
1157 | case PCI_MODE_PCIX_M2_66: | 1150 | case PCI_MODE_PCIX_M2_66: |
1158 | DBG_PRINT(ERR_DBG, "133MHz PCIX(M2) bus\n"); | 1151 | pcimode = "133MHz PCIX(M2) bus"; |
1159 | break; | 1152 | break; |
1160 | case PCI_MODE_PCIX_M2_100: | 1153 | case PCI_MODE_PCIX_M2_100: |
1161 | DBG_PRINT(ERR_DBG, "200MHz PCIX(M2) bus\n"); | 1154 | pcimode = "200MHz PCIX(M2) bus"; |
1162 | break; | 1155 | break; |
1163 | case PCI_MODE_PCIX_M2_133: | 1156 | case PCI_MODE_PCIX_M2_133: |
1164 | DBG_PRINT(ERR_DBG, "266MHz PCIX(M2) bus\n"); | 1157 | pcimode = "266MHz PCIX(M2) bus"; |
1165 | break; | 1158 | break; |
1166 | default: | 1159 | default: |
1167 | return -1; /* Unsupported bus speed */ | 1160 | pcimode = "unsupported bus!"; |
1161 | mode = -1; | ||
1168 | } | 1162 | } |
1169 | 1163 | ||
1164 | DBG_PRINT(ERR_DBG, "%s: Device is on %d bit %s\n", | ||
1165 | nic->dev->name, val64 & PCI_MODE_32_BITS ? 32 : 64, pcimode); | ||
1166 | |||
1170 | return mode; | 1167 | return mode; |
1171 | } | 1168 | } |
1172 | 1169 | ||
@@ -1704,9 +1701,9 @@ static int init_nic(struct s2io_nic *nic) | |||
1704 | /* Disable differentiated services steering logic */ | 1701 | /* Disable differentiated services steering logic */ |
1705 | for (i = 0; i < 64; i++) { | 1702 | for (i = 0; i < 64; i++) { |
1706 | if (rts_ds_steer(nic, i, 0) == FAILURE) { | 1703 | if (rts_ds_steer(nic, i, 0) == FAILURE) { |
1707 | DBG_PRINT(ERR_DBG, "%s: failed rts ds steering", | 1704 | DBG_PRINT(ERR_DBG, |
1708 | dev->name); | 1705 | "%s: rts_ds_steer failed on codepoint %d\n", |
1709 | DBG_PRINT(ERR_DBG, "set on codepoint %d\n", i); | 1706 | dev->name, i); |
1710 | return -ENODEV; | 1707 | return -ENODEV; |
1711 | } | 1708 | } |
1712 | } | 1709 | } |
@@ -1783,7 +1780,7 @@ static int init_nic(struct s2io_nic *nic) | |||
1783 | break; | 1780 | break; |
1784 | 1781 | ||
1785 | if (time > 10) { | 1782 | if (time > 10) { |
1786 | DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n", | 1783 | DBG_PRINT(ERR_DBG, "%s: RTI init failed\n", |
1787 | dev->name); | 1784 | dev->name); |
1788 | return -ENODEV; | 1785 | return -ENODEV; |
1789 | } | 1786 | } |
@@ -2189,35 +2186,35 @@ static int verify_xena_quiescence(struct s2io_nic *sp) | |||
2189 | mode = s2io_verify_pci_mode(sp); | 2186 | mode = s2io_verify_pci_mode(sp); |
2190 | 2187 | ||
2191 | if (!(val64 & ADAPTER_STATUS_TDMA_READY)) { | 2188 | if (!(val64 & ADAPTER_STATUS_TDMA_READY)) { |
2192 | DBG_PRINT(ERR_DBG, "%s", "TDMA is not ready!"); | 2189 | DBG_PRINT(ERR_DBG, "TDMA is not ready!\n"); |
2193 | return 0; | 2190 | return 0; |
2194 | } | 2191 | } |
2195 | if (!(val64 & ADAPTER_STATUS_RDMA_READY)) { | 2192 | if (!(val64 & ADAPTER_STATUS_RDMA_READY)) { |
2196 | DBG_PRINT(ERR_DBG, "%s", "RDMA is not ready!"); | 2193 | DBG_PRINT(ERR_DBG, "RDMA is not ready!\n"); |
2197 | return 0; | 2194 | return 0; |
2198 | } | 2195 | } |
2199 | if (!(val64 & ADAPTER_STATUS_PFC_READY)) { | 2196 | if (!(val64 & ADAPTER_STATUS_PFC_READY)) { |
2200 | DBG_PRINT(ERR_DBG, "%s", "PFC is not ready!"); | 2197 | DBG_PRINT(ERR_DBG, "PFC is not ready!\n"); |
2201 | return 0; | 2198 | return 0; |
2202 | } | 2199 | } |
2203 | if (!(val64 & ADAPTER_STATUS_TMAC_BUF_EMPTY)) { | 2200 | if (!(val64 & ADAPTER_STATUS_TMAC_BUF_EMPTY)) { |
2204 | DBG_PRINT(ERR_DBG, "%s", "TMAC BUF is not empty!"); | 2201 | DBG_PRINT(ERR_DBG, "TMAC BUF is not empty!\n"); |
2205 | return 0; | 2202 | return 0; |
2206 | } | 2203 | } |
2207 | if (!(val64 & ADAPTER_STATUS_PIC_QUIESCENT)) { | 2204 | if (!(val64 & ADAPTER_STATUS_PIC_QUIESCENT)) { |
2208 | DBG_PRINT(ERR_DBG, "%s", "PIC is not QUIESCENT!"); | 2205 | DBG_PRINT(ERR_DBG, "PIC is not QUIESCENT!\n"); |
2209 | return 0; | 2206 | return 0; |
2210 | } | 2207 | } |
2211 | if (!(val64 & ADAPTER_STATUS_MC_DRAM_READY)) { | 2208 | if (!(val64 & ADAPTER_STATUS_MC_DRAM_READY)) { |
2212 | DBG_PRINT(ERR_DBG, "%s", "MC_DRAM is not ready!"); | 2209 | DBG_PRINT(ERR_DBG, "MC_DRAM is not ready!\n"); |
2213 | return 0; | 2210 | return 0; |
2214 | } | 2211 | } |
2215 | if (!(val64 & ADAPTER_STATUS_MC_QUEUES_READY)) { | 2212 | if (!(val64 & ADAPTER_STATUS_MC_QUEUES_READY)) { |
2216 | DBG_PRINT(ERR_DBG, "%s", "MC_QUEUES is not ready!"); | 2213 | DBG_PRINT(ERR_DBG, "MC_QUEUES is not ready!\n"); |
2217 | return 0; | 2214 | return 0; |
2218 | } | 2215 | } |
2219 | if (!(val64 & ADAPTER_STATUS_M_PLL_LOCK)) { | 2216 | if (!(val64 & ADAPTER_STATUS_M_PLL_LOCK)) { |
2220 | DBG_PRINT(ERR_DBG, "%s", "M_PLL is not locked!"); | 2217 | DBG_PRINT(ERR_DBG, "M_PLL is not locked!\n"); |
2221 | return 0; | 2218 | return 0; |
2222 | } | 2219 | } |
2223 | 2220 | ||
@@ -2229,12 +2226,12 @@ static int verify_xena_quiescence(struct s2io_nic *sp) | |||
2229 | if (!(val64 & ADAPTER_STATUS_P_PLL_LOCK) && | 2226 | if (!(val64 & ADAPTER_STATUS_P_PLL_LOCK) && |
2230 | sp->device_type == XFRAME_II_DEVICE && | 2227 | sp->device_type == XFRAME_II_DEVICE && |
2231 | mode != PCI_MODE_PCI_33) { | 2228 | mode != PCI_MODE_PCI_33) { |
2232 | DBG_PRINT(ERR_DBG, "%s", "P_PLL is not locked!"); | 2229 | DBG_PRINT(ERR_DBG, "P_PLL is not locked!\n"); |
2233 | return 0; | 2230 | return 0; |
2234 | } | 2231 | } |
2235 | if (!((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) == | 2232 | if (!((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) == |
2236 | ADAPTER_STATUS_RC_PRC_QUIESCENT)) { | 2233 | ADAPTER_STATUS_RC_PRC_QUIESCENT)) { |
2237 | DBG_PRINT(ERR_DBG, "%s", "RC_PRC is not QUIESCENT!"); | 2234 | DBG_PRINT(ERR_DBG, "RC_PRC is not QUIESCENT!\n"); |
2238 | return 0; | 2235 | return 0; |
2239 | } | 2236 | } |
2240 | return 1; | 2237 | return 1; |
@@ -2339,9 +2336,9 @@ static int start_nic(struct s2io_nic *nic) | |||
2339 | */ | 2336 | */ |
2340 | val64 = readq(&bar0->adapter_status); | 2337 | val64 = readq(&bar0->adapter_status); |
2341 | if (!verify_xena_quiescence(nic)) { | 2338 | if (!verify_xena_quiescence(nic)) { |
2342 | DBG_PRINT(ERR_DBG, "%s: device is not ready, ", dev->name); | 2339 | DBG_PRINT(ERR_DBG, "%s: device is not ready, " |
2343 | DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%llx\n", | 2340 | "Adapter status reads: 0x%llx\n", |
2344 | (unsigned long long)val64); | 2341 | dev->name, (unsigned long long)val64); |
2345 | return FAILURE; | 2342 | return FAILURE; |
2346 | } | 2343 | } |
2347 | 2344 | ||
@@ -2455,7 +2452,7 @@ static void free_tx_buffers(struct s2io_nic *nic) | |||
2455 | } | 2452 | } |
2456 | } | 2453 | } |
2457 | DBG_PRINT(INTR_DBG, | 2454 | DBG_PRINT(INTR_DBG, |
2458 | "%s:forcibly freeing %d skbs on FIFO%d\n", | 2455 | "%s: forcibly freeing %d skbs on FIFO%d\n", |
2459 | dev->name, cnt, i); | 2456 | dev->name, cnt, i); |
2460 | fifo->tx_curr_get_info.offset = 0; | 2457 | fifo->tx_curr_get_info.offset = 0; |
2461 | fifo->tx_curr_put_info.offset = 0; | 2458 | fifo->tx_curr_put_info.offset = 0; |
@@ -2547,8 +2544,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, struct ring_info *ring, | |||
2547 | if ((block_no == block_no1) && | 2544 | if ((block_no == block_no1) && |
2548 | (off == ring->rx_curr_get_info.offset) && | 2545 | (off == ring->rx_curr_get_info.offset) && |
2549 | (rxdp->Host_Control)) { | 2546 | (rxdp->Host_Control)) { |
2550 | DBG_PRINT(INTR_DBG, "%s: Get and Put", ring->dev->name); | 2547 | DBG_PRINT(INTR_DBG, "%s: Get and Put info equated\n", |
2551 | DBG_PRINT(INTR_DBG, " info equated\n"); | 2548 | ring->dev->name); |
2552 | goto end; | 2549 | goto end; |
2553 | } | 2550 | } |
2554 | if (off && (off == ring->rxd_count)) { | 2551 | if (off && (off == ring->rxd_count)) { |
@@ -2583,8 +2580,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, struct ring_info *ring, | |||
2583 | /* allocate skb */ | 2580 | /* allocate skb */ |
2584 | skb = dev_alloc_skb(size); | 2581 | skb = dev_alloc_skb(size); |
2585 | if (!skb) { | 2582 | if (!skb) { |
2586 | DBG_PRINT(INFO_DBG, "%s: Out of ", ring->dev->name); | 2583 | DBG_PRINT(INFO_DBG, "%s: Could not allocate skb\n", |
2587 | DBG_PRINT(INFO_DBG, "memory to allocate SKBs\n"); | 2584 | ring->dev->name); |
2588 | if (first_rxdp) { | 2585 | if (first_rxdp) { |
2589 | wmb(); | 2586 | wmb(); |
2590 | first_rxdp->Control_1 |= RXD_OWN_XENA; | 2587 | first_rxdp->Control_1 |= RXD_OWN_XENA; |
@@ -2806,7 +2803,7 @@ static void free_rx_buffers(struct s2io_nic *sp) | |||
2806 | ring->rx_curr_put_info.offset = 0; | 2803 | ring->rx_curr_put_info.offset = 0; |
2807 | ring->rx_curr_get_info.offset = 0; | 2804 | ring->rx_curr_get_info.offset = 0; |
2808 | ring->rx_bufs_left = 0; | 2805 | ring->rx_bufs_left = 0; |
2809 | DBG_PRINT(INIT_DBG, "%s:Freed 0x%x Rx Buffers on ring%d\n", | 2806 | DBG_PRINT(INIT_DBG, "%s: Freed 0x%x Rx Buffers on ring%d\n", |
2810 | dev->name, buf_cnt, i); | 2807 | dev->name, buf_cnt, i); |
2811 | } | 2808 | } |
2812 | } | 2809 | } |
@@ -2814,8 +2811,8 @@ static void free_rx_buffers(struct s2io_nic *sp) | |||
2814 | static int s2io_chk_rx_buffers(struct s2io_nic *nic, struct ring_info *ring) | 2811 | static int s2io_chk_rx_buffers(struct s2io_nic *nic, struct ring_info *ring) |
2815 | { | 2812 | { |
2816 | if (fill_rx_buffers(nic, ring, 0) == -ENOMEM) { | 2813 | if (fill_rx_buffers(nic, ring, 0) == -ENOMEM) { |
2817 | DBG_PRINT(INFO_DBG, "%s:Out of memory", ring->dev->name); | 2814 | DBG_PRINT(INFO_DBG, "%s: Out of memory in Rx Intr!!\n", |
2818 | DBG_PRINT(INFO_DBG, " in Rx Intr!!\n"); | 2815 | ring->dev->name); |
2819 | } | 2816 | } |
2820 | return 0; | 2817 | return 0; |
2821 | } | 2818 | } |
@@ -2938,8 +2935,9 @@ static void s2io_netpoll(struct net_device *dev) | |||
2938 | struct ring_info *ring = &mac_control->rings[i]; | 2935 | struct ring_info *ring = &mac_control->rings[i]; |
2939 | 2936 | ||
2940 | if (fill_rx_buffers(nic, ring, 0) == -ENOMEM) { | 2937 | if (fill_rx_buffers(nic, ring, 0) == -ENOMEM) { |
2941 | DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name); | 2938 | DBG_PRINT(INFO_DBG, |
2942 | DBG_PRINT(INFO_DBG, " in Rx Netpoll!!\n"); | 2939 | "%s: Out of memory in Rx Netpoll!!\n", |
2940 | dev->name); | ||
2943 | break; | 2941 | break; |
2944 | } | 2942 | } |
2945 | } | 2943 | } |
@@ -2991,9 +2989,8 @@ static int rx_intr_handler(struct ring_info *ring_data, int budget) | |||
2991 | } | 2989 | } |
2992 | skb = (struct sk_buff *)((unsigned long)rxdp->Host_Control); | 2990 | skb = (struct sk_buff *)((unsigned long)rxdp->Host_Control); |
2993 | if (skb == NULL) { | 2991 | if (skb == NULL) { |
2994 | DBG_PRINT(ERR_DBG, "%s: The skb is ", | 2992 | DBG_PRINT(ERR_DBG, "%s: NULL skb in Rx Intr\n", |
2995 | ring_data->dev->name); | 2993 | ring_data->dev->name); |
2996 | DBG_PRINT(ERR_DBG, "Null in Rx Intr\n"); | ||
2997 | return 0; | 2994 | return 0; |
2998 | } | 2995 | } |
2999 | if (ring_data->rxd_mode == RXD_MODE_1) { | 2996 | if (ring_data->rxd_mode == RXD_MODE_1) { |
@@ -3126,8 +3123,8 @@ static void tx_intr_handler(struct fifo_info *fifo_data) | |||
3126 | skb = s2io_txdl_getskb(fifo_data, txdlp, get_info.offset); | 3123 | skb = s2io_txdl_getskb(fifo_data, txdlp, get_info.offset); |
3127 | if (skb == NULL) { | 3124 | if (skb == NULL) { |
3128 | spin_unlock_irqrestore(&fifo_data->tx_lock, flags); | 3125 | spin_unlock_irqrestore(&fifo_data->tx_lock, flags); |
3129 | DBG_PRINT(ERR_DBG, "%s: Null skb ", __func__); | 3126 | DBG_PRINT(ERR_DBG, "%s: NULL skb in Tx Free Intr\n", |
3130 | DBG_PRINT(ERR_DBG, "in Tx Free Intr\n"); | 3127 | __func__); |
3131 | return; | 3128 | return; |
3132 | } | 3129 | } |
3133 | pkt_cnt++; | 3130 | pkt_cnt++; |
@@ -3266,22 +3263,22 @@ static void s2io_chk_xpak_counter(u64 *counter, u64 * regs_stat, u32 index, | |||
3266 | if (val64 == 3) { | 3263 | if (val64 == 3) { |
3267 | switch (type) { | 3264 | switch (type) { |
3268 | case 1: | 3265 | case 1: |
3269 | DBG_PRINT(ERR_DBG, "Take Xframe NIC out of " | 3266 | DBG_PRINT(ERR_DBG, |
3270 | "service. Excessive temperatures may " | 3267 | "Take Xframe NIC out of service.\n"); |
3271 | "result in premature transceiver " | 3268 | DBG_PRINT(ERR_DBG, |
3272 | "failure \n"); | 3269 | "Excessive temperatures may result in premature transceiver failure.\n"); |
3273 | break; | 3270 | break; |
3274 | case 2: | 3271 | case 2: |
3275 | DBG_PRINT(ERR_DBG, "Take Xframe NIC out of " | 3272 | DBG_PRINT(ERR_DBG, |
3276 | "service Excessive bias currents may " | 3273 | "Take Xframe NIC out of service.\n"); |
3277 | "indicate imminent laser diode " | 3274 | DBG_PRINT(ERR_DBG, |
3278 | "failure \n"); | 3275 | "Excessive bias currents may indicate imminent laser diode failure.\n"); |
3279 | break; | 3276 | break; |
3280 | case 3: | 3277 | case 3: |
3281 | DBG_PRINT(ERR_DBG, "Take Xframe NIC out of " | 3278 | DBG_PRINT(ERR_DBG, |
3282 | "service Excessive laser output " | 3279 | "Take Xframe NIC out of service.\n"); |
3283 | "power may saturate far-end " | 3280 | DBG_PRINT(ERR_DBG, |
3284 | "receiver\n"); | 3281 | "Excessive laser output power may saturate far-end receiver.\n"); |
3285 | break; | 3282 | break; |
3286 | default: | 3283 | default: |
3287 | DBG_PRINT(ERR_DBG, | 3284 | DBG_PRINT(ERR_DBG, |
@@ -3321,15 +3318,16 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3321 | val64 = 0x0; | 3318 | val64 = 0x0; |
3322 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); | 3319 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3323 | if ((val64 == 0xFFFF) || (val64 == 0x0000)) { | 3320 | if ((val64 == 0xFFFF) || (val64 == 0x0000)) { |
3324 | DBG_PRINT(ERR_DBG, "ERR: MDIO slave access failed - " | 3321 | DBG_PRINT(ERR_DBG, |
3325 | "Returned %llx\n", (unsigned long long)val64); | 3322 | "ERR: MDIO slave access failed - Returned %llx\n", |
3323 | (unsigned long long)val64); | ||
3326 | return; | 3324 | return; |
3327 | } | 3325 | } |
3328 | 3326 | ||
3329 | /* Check for the expected value of control reg 1 */ | 3327 | /* Check for the expected value of control reg 1 */ |
3330 | if (val64 != MDIO_CTRL1_SPEED10G) { | 3328 | if (val64 != MDIO_CTRL1_SPEED10G) { |
3331 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - "); | 3329 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - " |
3332 | DBG_PRINT(ERR_DBG, "Returned: %llx- Expected: 0x%x\n", | 3330 | "Returned: %llx- Expected: 0x%x\n", |
3333 | (unsigned long long)val64, MDIO_CTRL1_SPEED10G); | 3331 | (unsigned long long)val64, MDIO_CTRL1_SPEED10G); |
3334 | return; | 3332 | return; |
3335 | } | 3333 | } |
@@ -3481,7 +3479,7 @@ static void s2io_reset(struct s2io_nic *sp) | |||
3481 | struct stat_block *stats; | 3479 | struct stat_block *stats; |
3482 | struct swStat *swstats; | 3480 | struct swStat *swstats; |
3483 | 3481 | ||
3484 | DBG_PRINT(INIT_DBG, "%s - Resetting XFrame card %s\n", | 3482 | DBG_PRINT(INIT_DBG, "%s: Resetting XFrame card %s\n", |
3485 | __func__, sp->dev->name); | 3483 | __func__, sp->dev->name); |
3486 | 3484 | ||
3487 | /* Back up the PCI-X CMD reg, dont want to lose MMRBC, OST settings */ | 3485 | /* Back up the PCI-X CMD reg, dont want to lose MMRBC, OST settings */ |
@@ -3618,10 +3616,9 @@ static int s2io_set_swapper(struct s2io_nic *sp) | |||
3618 | i++; | 3616 | i++; |
3619 | } | 3617 | } |
3620 | if (i == 4) { | 3618 | if (i == 4) { |
3621 | DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ", | 3619 | DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, " |
3622 | dev->name); | 3620 | "feedback read %llx\n", |
3623 | DBG_PRINT(ERR_DBG, "feedback read %llx\n", | 3621 | dev->name, (unsigned long long)val64); |
3624 | (unsigned long long)val64); | ||
3625 | return FAILURE; | 3622 | return FAILURE; |
3626 | } | 3623 | } |
3627 | valr = value[i]; | 3624 | valr = value[i]; |
@@ -3650,8 +3647,8 @@ static int s2io_set_swapper(struct s2io_nic *sp) | |||
3650 | } | 3647 | } |
3651 | if (i == 4) { | 3648 | if (i == 4) { |
3652 | unsigned long long x = val64; | 3649 | unsigned long long x = val64; |
3653 | DBG_PRINT(ERR_DBG, "Write failed, Xmsi_addr "); | 3650 | DBG_PRINT(ERR_DBG, |
3654 | DBG_PRINT(ERR_DBG, "reads:0x%llx\n", x); | 3651 | "Write failed, Xmsi_addr reads:0x%llx\n", x); |
3655 | return FAILURE; | 3652 | return FAILURE; |
3656 | } | 3653 | } |
3657 | } | 3654 | } |
@@ -3711,10 +3708,9 @@ static int s2io_set_swapper(struct s2io_nic *sp) | |||
3711 | val64 = readq(&bar0->pif_rd_swapper_fb); | 3708 | val64 = readq(&bar0->pif_rd_swapper_fb); |
3712 | if (val64 != 0x0123456789ABCDEFULL) { | 3709 | if (val64 != 0x0123456789ABCDEFULL) { |
3713 | /* Endian settings are incorrect, calls for another dekko. */ | 3710 | /* Endian settings are incorrect, calls for another dekko. */ |
3714 | DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ", | 3711 | DBG_PRINT(ERR_DBG, |
3715 | dev->name); | 3712 | "%s: Endian settings are wrong, feedback read %llx\n", |
3716 | DBG_PRINT(ERR_DBG, "feedback read %llx\n", | 3713 | dev->name, (unsigned long long)val64); |
3717 | (unsigned long long)val64); | ||
3718 | return FAILURE; | 3714 | return FAILURE; |
3719 | } | 3715 | } |
3720 | 3716 | ||
@@ -3758,7 +3754,8 @@ static void restore_xmsi_data(struct s2io_nic *nic) | |||
3758 | val64 = (s2BIT(7) | s2BIT(15) | vBIT(msix_index, 26, 6)); | 3754 | val64 = (s2BIT(7) | s2BIT(15) | vBIT(msix_index, 26, 6)); |
3759 | writeq(val64, &bar0->xmsi_access); | 3755 | writeq(val64, &bar0->xmsi_access); |
3760 | if (wait_for_msix_trans(nic, msix_index)) { | 3756 | if (wait_for_msix_trans(nic, msix_index)) { |
3761 | DBG_PRINT(ERR_DBG, "failed in %s\n", __func__); | 3757 | DBG_PRINT(ERR_DBG, "%s: index: %d failed\n", |
3758 | __func__, msix_index); | ||
3762 | continue; | 3759 | continue; |
3763 | } | 3760 | } |
3764 | } | 3761 | } |
@@ -3779,7 +3776,8 @@ static void store_xmsi_data(struct s2io_nic *nic) | |||
3779 | val64 = (s2BIT(15) | vBIT(msix_index, 26, 6)); | 3776 | val64 = (s2BIT(15) | vBIT(msix_index, 26, 6)); |
3780 | writeq(val64, &bar0->xmsi_access); | 3777 | writeq(val64, &bar0->xmsi_access); |
3781 | if (wait_for_msix_trans(nic, msix_index)) { | 3778 | if (wait_for_msix_trans(nic, msix_index)) { |
3782 | DBG_PRINT(ERR_DBG, "failed in %s\n", __func__); | 3779 | DBG_PRINT(ERR_DBG, "%s: index: %d failed\n", |
3780 | __func__, msix_index); | ||
3783 | continue; | 3781 | continue; |
3784 | } | 3782 | } |
3785 | addr = readq(&bar0->xmsi_address); | 3783 | addr = readq(&bar0->xmsi_address); |
@@ -3851,7 +3849,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic) | |||
3851 | ret = pci_enable_msix(nic->pdev, nic->entries, nic->num_entries); | 3849 | ret = pci_enable_msix(nic->pdev, nic->entries, nic->num_entries); |
3852 | /* We fail init if error or we get less vectors than min required */ | 3850 | /* We fail init if error or we get less vectors than min required */ |
3853 | if (ret) { | 3851 | if (ret) { |
3854 | DBG_PRINT(ERR_DBG, "s2io: Enabling MSI-X failed\n"); | 3852 | DBG_PRINT(ERR_DBG, "Enabling MSI-X failed\n"); |
3855 | kfree(nic->entries); | 3853 | kfree(nic->entries); |
3856 | swstats->mem_freed += nic->num_entries * | 3854 | swstats->mem_freed += nic->num_entries * |
3857 | sizeof(struct msix_entry); | 3855 | sizeof(struct msix_entry); |
@@ -3915,8 +3913,8 @@ static int s2io_test_msi(struct s2io_nic *sp) | |||
3915 | if (!sp->msi_detected) { | 3913 | if (!sp->msi_detected) { |
3916 | /* MSI(X) test failed, go back to INTx mode */ | 3914 | /* MSI(X) test failed, go back to INTx mode */ |
3917 | DBG_PRINT(ERR_DBG, "%s: PCI %s: No interrupt was generated " | 3915 | DBG_PRINT(ERR_DBG, "%s: PCI %s: No interrupt was generated " |
3918 | "using MSI(X) during test\n", sp->dev->name, | 3916 | "using MSI(X) during test\n", |
3919 | pci_name(pdev)); | 3917 | sp->dev->name, pci_name(pdev)); |
3920 | 3918 | ||
3921 | err = -EOPNOTSUPP; | 3919 | err = -EOPNOTSUPP; |
3922 | } | 3920 | } |
@@ -4095,7 +4093,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4095 | DBG_PRINT(TX_DBG, "%s: In Neterion Tx routine\n", dev->name); | 4093 | DBG_PRINT(TX_DBG, "%s: In Neterion Tx routine\n", dev->name); |
4096 | 4094 | ||
4097 | if (unlikely(skb->len <= 0)) { | 4095 | if (unlikely(skb->len <= 0)) { |
4098 | DBG_PRINT(TX_DBG, "%s:Buffer has no data..\n", dev->name); | 4096 | DBG_PRINT(TX_DBG, "%s: Buffer has no data..\n", dev->name); |
4099 | dev_kfree_skb_any(skb); | 4097 | dev_kfree_skb_any(skb); |
4100 | return NETDEV_TX_OK; | 4098 | return NETDEV_TX_OK; |
4101 | } | 4099 | } |
@@ -5052,18 +5050,17 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5052 | 5050 | ||
5053 | val64 = readq(&bar0->mac_cfg); | 5051 | val64 = readq(&bar0->mac_cfg); |
5054 | sp->promisc_flg = 0; | 5052 | sp->promisc_flg = 0; |
5055 | DBG_PRINT(INFO_DBG, "%s: left promiscuous mode\n", | 5053 | DBG_PRINT(INFO_DBG, "%s: left promiscuous mode\n", dev->name); |
5056 | dev->name); | ||
5057 | } | 5054 | } |
5058 | 5055 | ||
5059 | /* Update individual M_CAST address list */ | 5056 | /* Update individual M_CAST address list */ |
5060 | if ((!sp->m_cast_flg) && dev->mc_count) { | 5057 | if ((!sp->m_cast_flg) && dev->mc_count) { |
5061 | if (dev->mc_count > | 5058 | if (dev->mc_count > |
5062 | (config->max_mc_addr - config->max_mac_addr)) { | 5059 | (config->max_mc_addr - config->max_mac_addr)) { |
5063 | DBG_PRINT(ERR_DBG, "%s: No more Rx filters ", | 5060 | DBG_PRINT(ERR_DBG, |
5061 | "%s: No more Rx filters can be added - " | ||
5062 | "please enable ALL_MULTI instead\n", | ||
5064 | dev->name); | 5063 | dev->name); |
5065 | DBG_PRINT(ERR_DBG, "can be added, please enable "); | ||
5066 | DBG_PRINT(ERR_DBG, "ALL_MULTI instead\n"); | ||
5067 | return; | 5064 | return; |
5068 | } | 5065 | } |
5069 | 5066 | ||
@@ -5086,8 +5083,9 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5086 | if (wait_for_cmd_complete(&bar0->rmac_addr_cmd_mem, | 5083 | if (wait_for_cmd_complete(&bar0->rmac_addr_cmd_mem, |
5087 | RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING, | 5084 | RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING, |
5088 | S2IO_BIT_RESET)) { | 5085 | S2IO_BIT_RESET)) { |
5089 | DBG_PRINT(ERR_DBG, "%s: Adding ", dev->name); | 5086 | DBG_PRINT(ERR_DBG, |
5090 | DBG_PRINT(ERR_DBG, "Multicasts failed\n"); | 5087 | "%s: Adding Multicasts failed\n", |
5088 | dev->name); | ||
5091 | return; | 5089 | return; |
5092 | } | 5090 | } |
5093 | } | 5091 | } |
@@ -5117,8 +5115,9 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5117 | if (wait_for_cmd_complete(&bar0->rmac_addr_cmd_mem, | 5115 | if (wait_for_cmd_complete(&bar0->rmac_addr_cmd_mem, |
5118 | RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING, | 5116 | RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING, |
5119 | S2IO_BIT_RESET)) { | 5117 | S2IO_BIT_RESET)) { |
5120 | DBG_PRINT(ERR_DBG, "%s: Adding ", dev->name); | 5118 | DBG_PRINT(ERR_DBG, |
5121 | DBG_PRINT(ERR_DBG, "Multicasts failed\n"); | 5119 | "%s: Adding Multicasts failed\n", |
5120 | dev->name); | ||
5122 | return; | 5121 | return; |
5123 | } | 5122 | } |
5124 | } | 5123 | } |
@@ -5552,7 +5551,7 @@ static void s2io_ethtool_gringparam(struct net_device *dev, | |||
5552 | for (i = 0 ; i < sp->config.tx_fifo_num ; i++) | 5551 | for (i = 0 ; i < sp->config.tx_fifo_num ; i++) |
5553 | tx_desc_count += sp->config.tx_cfg[i].fifo_len; | 5552 | tx_desc_count += sp->config.tx_cfg[i].fifo_len; |
5554 | 5553 | ||
5555 | DBG_PRINT(INFO_DBG, "\nmax txds : %d\n", sp->config.max_txds); | 5554 | DBG_PRINT(INFO_DBG, "max txds: %d\n", sp->config.max_txds); |
5556 | ering->tx_pending = tx_desc_count; | 5555 | ering->tx_pending = tx_desc_count; |
5557 | rx_desc_count = 0; | 5556 | rx_desc_count = 0; |
5558 | for (i = 0 ; i < sp->config.rx_ring_num ; i++) | 5557 | for (i = 0 ; i < sp->config.rx_ring_num ; i++) |
@@ -5886,8 +5885,10 @@ static int s2io_ethtool_seeprom(struct net_device *dev, | |||
5886 | 5885 | ||
5887 | if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) { | 5886 | if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) { |
5888 | DBG_PRINT(ERR_DBG, | 5887 | DBG_PRINT(ERR_DBG, |
5889 | "ETHTOOL_WRITE_EEPROM Err: Magic value "); | 5888 | "ETHTOOL_WRITE_EEPROM Err: " |
5890 | DBG_PRINT(ERR_DBG, "is wrong, Its not 0x%x\n", eeprom->magic); | 5889 | "Magic value is wrong, it is 0x%x should be 0x%x\n", |
5890 | (sp->pdev->vendor | (sp->pdev->device << 16)), | ||
5891 | eeprom->magic); | ||
5891 | return -EFAULT; | 5892 | return -EFAULT; |
5892 | } | 5893 | } |
5893 | 5894 | ||
@@ -5900,9 +5901,8 @@ static int s2io_ethtool_seeprom(struct net_device *dev, | |||
5900 | 5901 | ||
5901 | if (write_eeprom(sp, (eeprom->offset + cnt), valid, 0)) { | 5902 | if (write_eeprom(sp, (eeprom->offset + cnt), valid, 0)) { |
5902 | DBG_PRINT(ERR_DBG, | 5903 | DBG_PRINT(ERR_DBG, |
5903 | "ETHTOOL_WRITE_EEPROM Err: Cannot "); | 5904 | "ETHTOOL_WRITE_EEPROM Err: " |
5904 | DBG_PRINT(ERR_DBG, | 5905 | "Cannot write into the specified offset\n"); |
5905 | "write into the specified offset\n"); | ||
5906 | return -EFAULT; | 5906 | return -EFAULT; |
5907 | } | 5907 | } |
5908 | cnt++; | 5908 | cnt++; |
@@ -5934,13 +5934,13 @@ static int s2io_register_test(struct s2io_nic *sp, uint64_t *data) | |||
5934 | val64 = readq(&bar0->pif_rd_swapper_fb); | 5934 | val64 = readq(&bar0->pif_rd_swapper_fb); |
5935 | if (val64 != 0x123456789abcdefULL) { | 5935 | if (val64 != 0x123456789abcdefULL) { |
5936 | fail = 1; | 5936 | fail = 1; |
5937 | DBG_PRINT(INFO_DBG, "Read Test level 1 fails\n"); | 5937 | DBG_PRINT(INFO_DBG, "Read Test level %d fails\n", 1); |
5938 | } | 5938 | } |
5939 | 5939 | ||
5940 | val64 = readq(&bar0->rmac_pause_cfg); | 5940 | val64 = readq(&bar0->rmac_pause_cfg); |
5941 | if (val64 != 0xc000ffff00000000ULL) { | 5941 | if (val64 != 0xc000ffff00000000ULL) { |
5942 | fail = 1; | 5942 | fail = 1; |
5943 | DBG_PRINT(INFO_DBG, "Read Test level 2 fails\n"); | 5943 | DBG_PRINT(INFO_DBG, "Read Test level %d fails\n", 2); |
5944 | } | 5944 | } |
5945 | 5945 | ||
5946 | val64 = readq(&bar0->rx_queue_cfg); | 5946 | val64 = readq(&bar0->rx_queue_cfg); |
@@ -5950,13 +5950,13 @@ static int s2io_register_test(struct s2io_nic *sp, uint64_t *data) | |||
5950 | exp_val = 0x0808080808080808ULL; | 5950 | exp_val = 0x0808080808080808ULL; |
5951 | if (val64 != exp_val) { | 5951 | if (val64 != exp_val) { |
5952 | fail = 1; | 5952 | fail = 1; |
5953 | DBG_PRINT(INFO_DBG, "Read Test level 3 fails\n"); | 5953 | DBG_PRINT(INFO_DBG, "Read Test level %d fails\n", 3); |
5954 | } | 5954 | } |
5955 | 5955 | ||
5956 | val64 = readq(&bar0->xgxs_efifo_cfg); | 5956 | val64 = readq(&bar0->xgxs_efifo_cfg); |
5957 | if (val64 != 0x000000001923141EULL) { | 5957 | if (val64 != 0x000000001923141EULL) { |
5958 | fail = 1; | 5958 | fail = 1; |
5959 | DBG_PRINT(INFO_DBG, "Read Test level 4 fails\n"); | 5959 | DBG_PRINT(INFO_DBG, "Read Test level %d fails\n", 4); |
5960 | } | 5960 | } |
5961 | 5961 | ||
5962 | val64 = 0x5A5A5A5A5A5A5A5AULL; | 5962 | val64 = 0x5A5A5A5A5A5A5A5AULL; |
@@ -5964,7 +5964,7 @@ static int s2io_register_test(struct s2io_nic *sp, uint64_t *data) | |||
5964 | val64 = readq(&bar0->xmsi_data); | 5964 | val64 = readq(&bar0->xmsi_data); |
5965 | if (val64 != 0x5A5A5A5A5A5A5A5AULL) { | 5965 | if (val64 != 0x5A5A5A5A5A5A5A5AULL) { |
5966 | fail = 1; | 5966 | fail = 1; |
5967 | DBG_PRINT(ERR_DBG, "Write Test level 1 fails\n"); | 5967 | DBG_PRINT(ERR_DBG, "Write Test level %d fails\n", 1); |
5968 | } | 5968 | } |
5969 | 5969 | ||
5970 | val64 = 0xA5A5A5A5A5A5A5A5ULL; | 5970 | val64 = 0xA5A5A5A5A5A5A5A5ULL; |
@@ -5972,7 +5972,7 @@ static int s2io_register_test(struct s2io_nic *sp, uint64_t *data) | |||
5972 | val64 = readq(&bar0->xmsi_data); | 5972 | val64 = readq(&bar0->xmsi_data); |
5973 | if (val64 != 0xA5A5A5A5A5A5A5A5ULL) { | 5973 | if (val64 != 0xA5A5A5A5A5A5A5A5ULL) { |
5974 | fail = 1; | 5974 | fail = 1; |
5975 | DBG_PRINT(ERR_DBG, "Write Test level 2 fails\n"); | 5975 | DBG_PRINT(ERR_DBG, "Write Test level %d fails\n", 2); |
5976 | } | 5976 | } |
5977 | 5977 | ||
5978 | *data = fail; | 5978 | *data = fail; |
@@ -6825,8 +6825,9 @@ static void s2io_set_link(struct work_struct *work) | |||
6825 | } | 6825 | } |
6826 | nic->device_enabled_once = true; | 6826 | nic->device_enabled_once = true; |
6827 | } else { | 6827 | } else { |
6828 | DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name); | 6828 | DBG_PRINT(ERR_DBG, |
6829 | DBG_PRINT(ERR_DBG, "device is not Quiescent\n"); | 6829 | "%s: Error: device is not Quiescent\n", |
6830 | dev->name); | ||
6830 | s2io_stop_all_tx_queue(nic); | 6831 | s2io_stop_all_tx_queue(nic); |
6831 | } | 6832 | } |
6832 | } | 6833 | } |
@@ -6876,9 +6877,9 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6876 | } else { | 6877 | } else { |
6877 | *skb = dev_alloc_skb(size); | 6878 | *skb = dev_alloc_skb(size); |
6878 | if (!(*skb)) { | 6879 | if (!(*skb)) { |
6879 | DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name); | 6880 | DBG_PRINT(INFO_DBG, |
6880 | DBG_PRINT(INFO_DBG, "memory to allocate "); | 6881 | "%s: Out of memory to allocate %s\n", |
6881 | DBG_PRINT(INFO_DBG, "1 buf mode SKBs\n"); | 6882 | dev->name, "1 buf mode SKBs"); |
6882 | stats->mem_alloc_fail_cnt++; | 6883 | stats->mem_alloc_fail_cnt++; |
6883 | return -ENOMEM ; | 6884 | return -ENOMEM ; |
6884 | } | 6885 | } |
@@ -6905,9 +6906,10 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp, | |||
6905 | } else { | 6906 | } else { |
6906 | *skb = dev_alloc_skb(size); | 6907 | *skb = dev_alloc_skb(size); |
6907 | if (!(*skb)) { | 6908 | if (!(*skb)) { |
6908 | DBG_PRINT(INFO_DBG, "%s: Out of ", dev->name); | 6909 | DBG_PRINT(INFO_DBG, |
6909 | DBG_PRINT(INFO_DBG, "memory to allocate "); | 6910 | "%s: Out of memory to allocate %s\n", |
6910 | DBG_PRINT(INFO_DBG, "2 buf mode SKBs\n"); | 6911 | dev->name, |
6912 | "2 buf mode SKBs"); | ||
6911 | stats->mem_alloc_fail_cnt++; | 6913 | stats->mem_alloc_fail_cnt++; |
6912 | return -ENOMEM; | 6914 | return -ENOMEM; |
6913 | } | 6915 | } |
@@ -7095,8 +7097,8 @@ static int s2io_add_isr(struct s2io_nic *sp) | |||
7095 | } | 7097 | } |
7096 | if (!err) { | 7098 | if (!err) { |
7097 | pr_info("MSI-X-RX %d entries enabled\n", --msix_rx_cnt); | 7099 | pr_info("MSI-X-RX %d entries enabled\n", --msix_rx_cnt); |
7098 | DBG_PRINT(INFO_DBG, "MSI-X-TX entries enabled" | 7100 | DBG_PRINT(INFO_DBG, |
7099 | " through alarm vector\n"); | 7101 | "MSI-X-TX entries enabled through alarm vector\n"); |
7100 | } | 7102 | } |
7101 | } | 7103 | } |
7102 | if (sp->config.intr_type == INTA) { | 7104 | if (sp->config.intr_type == INTA) { |
@@ -7176,8 +7178,8 @@ static void do_s2io_card_down(struct s2io_nic *sp, int do_io) | |||
7176 | msleep(50); | 7178 | msleep(50); |
7177 | cnt++; | 7179 | cnt++; |
7178 | if (cnt == 10) { | 7180 | if (cnt == 10) { |
7179 | DBG_PRINT(ERR_DBG, "s2io_close:Device not Quiescent "); | 7181 | DBG_PRINT(ERR_DBG, "Device not Quiescent - " |
7180 | DBG_PRINT(ERR_DBG, "adaper status reads 0x%llx\n", | 7182 | "adapter status reads 0x%llx\n", |
7181 | (unsigned long long)val64); | 7183 | (unsigned long long)val64); |
7182 | break; | 7184 | break; |
7183 | } | 7185 | } |
@@ -7628,7 +7630,7 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type, | |||
7628 | u8 *dev_multiq) | 7630 | u8 *dev_multiq) |
7629 | { | 7631 | { |
7630 | if ((tx_fifo_num > MAX_TX_FIFOS) || (tx_fifo_num < 1)) { | 7632 | if ((tx_fifo_num > MAX_TX_FIFOS) || (tx_fifo_num < 1)) { |
7631 | DBG_PRINT(ERR_DBG, "s2io: Requested number of tx fifos " | 7633 | DBG_PRINT(ERR_DBG, "Requested number of tx fifos " |
7632 | "(%d) not supported\n", tx_fifo_num); | 7634 | "(%d) not supported\n", tx_fifo_num); |
7633 | 7635 | ||
7634 | if (tx_fifo_num < 1) | 7636 | if (tx_fifo_num < 1) |
@@ -7636,8 +7638,7 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type, | |||
7636 | else | 7638 | else |
7637 | tx_fifo_num = MAX_TX_FIFOS; | 7639 | tx_fifo_num = MAX_TX_FIFOS; |
7638 | 7640 | ||
7639 | DBG_PRINT(ERR_DBG, "s2io: Default to %d ", tx_fifo_num); | 7641 | DBG_PRINT(ERR_DBG, "Default to %d tx fifos\n", tx_fifo_num); |
7640 | DBG_PRINT(ERR_DBG, "tx fifos\n"); | ||
7641 | } | 7642 | } |
7642 | 7643 | ||
7643 | if (multiq) | 7644 | if (multiq) |
@@ -7646,7 +7647,7 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type, | |||
7646 | if (tx_steering_type && (1 == tx_fifo_num)) { | 7647 | if (tx_steering_type && (1 == tx_fifo_num)) { |
7647 | if (tx_steering_type != TX_DEFAULT_STEERING) | 7648 | if (tx_steering_type != TX_DEFAULT_STEERING) |
7648 | DBG_PRINT(ERR_DBG, | 7649 | DBG_PRINT(ERR_DBG, |
7649 | "s2io: Tx steering is not supported with " | 7650 | "Tx steering is not supported with " |
7650 | "one fifo. Disabling Tx steering.\n"); | 7651 | "one fifo. Disabling Tx steering.\n"); |
7651 | tx_steering_type = NO_STEERING; | 7652 | tx_steering_type = NO_STEERING; |
7652 | } | 7653 | } |
@@ -7654,21 +7655,21 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type, | |||
7654 | if ((tx_steering_type < NO_STEERING) || | 7655 | if ((tx_steering_type < NO_STEERING) || |
7655 | (tx_steering_type > TX_DEFAULT_STEERING)) { | 7656 | (tx_steering_type > TX_DEFAULT_STEERING)) { |
7656 | DBG_PRINT(ERR_DBG, | 7657 | DBG_PRINT(ERR_DBG, |
7657 | "s2io: Requested transmit steering not supported\n"); | 7658 | "Requested transmit steering not supported\n"); |
7658 | DBG_PRINT(ERR_DBG, "s2io: Disabling transmit steering\n"); | 7659 | DBG_PRINT(ERR_DBG, "Disabling transmit steering\n"); |
7659 | tx_steering_type = NO_STEERING; | 7660 | tx_steering_type = NO_STEERING; |
7660 | } | 7661 | } |
7661 | 7662 | ||
7662 | if (rx_ring_num > MAX_RX_RINGS) { | 7663 | if (rx_ring_num > MAX_RX_RINGS) { |
7663 | DBG_PRINT(ERR_DBG, | 7664 | DBG_PRINT(ERR_DBG, |
7664 | "s2io: Requested number of rx rings not supported\n"); | 7665 | "Requested number of rx rings not supported\n"); |
7665 | DBG_PRINT(ERR_DBG, "s2io: Default to %d rx rings\n", | 7666 | DBG_PRINT(ERR_DBG, "Default to %d rx rings\n", |
7666 | MAX_RX_RINGS); | 7667 | MAX_RX_RINGS); |
7667 | rx_ring_num = MAX_RX_RINGS; | 7668 | rx_ring_num = MAX_RX_RINGS; |
7668 | } | 7669 | } |
7669 | 7670 | ||
7670 | if ((*dev_intr_type != INTA) && (*dev_intr_type != MSI_X)) { | 7671 | if ((*dev_intr_type != INTA) && (*dev_intr_type != MSI_X)) { |
7671 | DBG_PRINT(ERR_DBG, "s2io: Wrong intr_type requested. " | 7672 | DBG_PRINT(ERR_DBG, "Wrong intr_type requested. " |
7672 | "Defaulting to INTA\n"); | 7673 | "Defaulting to INTA\n"); |
7673 | *dev_intr_type = INTA; | 7674 | *dev_intr_type = INTA; |
7674 | } | 7675 | } |
@@ -7676,14 +7677,14 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type, | |||
7676 | if ((*dev_intr_type == MSI_X) && | 7677 | if ((*dev_intr_type == MSI_X) && |
7677 | ((pdev->device != PCI_DEVICE_ID_HERC_WIN) && | 7678 | ((pdev->device != PCI_DEVICE_ID_HERC_WIN) && |
7678 | (pdev->device != PCI_DEVICE_ID_HERC_UNI))) { | 7679 | (pdev->device != PCI_DEVICE_ID_HERC_UNI))) { |
7679 | DBG_PRINT(ERR_DBG, "s2io: Xframe I does not support MSI_X. " | 7680 | DBG_PRINT(ERR_DBG, "Xframe I does not support MSI_X. " |
7680 | "Defaulting to INTA\n"); | 7681 | "Defaulting to INTA\n"); |
7681 | *dev_intr_type = INTA; | 7682 | *dev_intr_type = INTA; |
7682 | } | 7683 | } |
7683 | 7684 | ||
7684 | if ((rx_ring_mode != 1) && (rx_ring_mode != 2)) { | 7685 | if ((rx_ring_mode != 1) && (rx_ring_mode != 2)) { |
7685 | DBG_PRINT(ERR_DBG, "s2io: Requested ring mode not supported\n"); | 7686 | DBG_PRINT(ERR_DBG, "Requested ring mode not supported\n"); |
7686 | DBG_PRINT(ERR_DBG, "s2io: Defaulting to 1-buffer mode\n"); | 7687 | DBG_PRINT(ERR_DBG, "Defaulting to 1-buffer mode\n"); |
7687 | rx_ring_mode = 1; | 7688 | rx_ring_mode = 1; |
7688 | } | 7689 | } |
7689 | return SUCCESS; | 7690 | return SUCCESS; |
@@ -7776,12 +7777,12 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7776 | ret = pci_enable_device(pdev); | 7777 | ret = pci_enable_device(pdev); |
7777 | if (ret) { | 7778 | if (ret) { |
7778 | DBG_PRINT(ERR_DBG, | 7779 | DBG_PRINT(ERR_DBG, |
7779 | "s2io_init_nic: pci_enable_device failed\n"); | 7780 | "%s: pci_enable_device failed\n", __func__); |
7780 | return ret; | 7781 | return ret; |
7781 | } | 7782 | } |
7782 | 7783 | ||
7783 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 7784 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
7784 | DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n"); | 7785 | DBG_PRINT(INIT_DBG, "%s: Using 64bit DMA\n", __func__); |
7785 | dma_flag = true; | 7786 | dma_flag = true; |
7786 | if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { | 7787 | if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { |
7787 | DBG_PRINT(ERR_DBG, | 7788 | DBG_PRINT(ERR_DBG, |
@@ -7791,14 +7792,14 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7791 | return -ENOMEM; | 7792 | return -ENOMEM; |
7792 | } | 7793 | } |
7793 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 7794 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { |
7794 | DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 32bit DMA\n"); | 7795 | DBG_PRINT(INIT_DBG, "%s: Using 32bit DMA\n", __func__); |
7795 | } else { | 7796 | } else { |
7796 | pci_disable_device(pdev); | 7797 | pci_disable_device(pdev); |
7797 | return -ENOMEM; | 7798 | return -ENOMEM; |
7798 | } | 7799 | } |
7799 | ret = pci_request_regions(pdev, s2io_driver_name); | 7800 | ret = pci_request_regions(pdev, s2io_driver_name); |
7800 | if (ret) { | 7801 | if (ret) { |
7801 | DBG_PRINT(ERR_DBG, "%s: Request Regions failed - %x \n", | 7802 | DBG_PRINT(ERR_DBG, "%s: Request Regions failed - %x\n", |
7802 | __func__, ret); | 7803 | __func__, ret); |
7803 | pci_disable_device(pdev); | 7804 | pci_disable_device(pdev); |
7804 | return -ENODEV; | 7805 | return -ENODEV; |
@@ -7992,7 +7993,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7992 | 7993 | ||
7993 | /* Setting swapper control on the NIC, for proper reset operation */ | 7994 | /* Setting swapper control on the NIC, for proper reset operation */ |
7994 | if (s2io_set_swapper(sp)) { | 7995 | if (s2io_set_swapper(sp)) { |
7995 | DBG_PRINT(ERR_DBG, "%s:swapper settings are wrong\n", | 7996 | DBG_PRINT(ERR_DBG, "%s: swapper settings are wrong\n", |
7996 | dev->name); | 7997 | dev->name); |
7997 | ret = -EAGAIN; | 7998 | ret = -EAGAIN; |
7998 | goto set_swap_failed; | 7999 | goto set_swap_failed; |
@@ -8002,8 +8003,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8002 | if (sp->device_type & XFRAME_II_DEVICE) { | 8003 | if (sp->device_type & XFRAME_II_DEVICE) { |
8003 | mode = s2io_verify_pci_mode(sp); | 8004 | mode = s2io_verify_pci_mode(sp); |
8004 | if (mode < 0) { | 8005 | if (mode < 0) { |
8005 | DBG_PRINT(ERR_DBG, "%s: ", __func__); | 8006 | DBG_PRINT(ERR_DBG, "%s: Unsupported PCI bus mode\n", |
8006 | DBG_PRINT(ERR_DBG, " Unsupported PCI bus mode\n"); | 8007 | __func__); |
8007 | ret = -EBADSLT; | 8008 | ret = -EBADSLT; |
8008 | goto set_swap_failed; | 8009 | goto set_swap_failed; |
8009 | } | 8010 | } |
@@ -8021,7 +8022,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8021 | if (ret) { | 8022 | if (ret) { |
8022 | 8023 | ||
8023 | DBG_PRINT(ERR_DBG, | 8024 | DBG_PRINT(ERR_DBG, |
8024 | "s2io: MSI-X requested but failed to enable\n"); | 8025 | "MSI-X requested but failed to enable\n"); |
8025 | sp->config.intr_type = INTA; | 8026 | sp->config.intr_type = INTA; |
8026 | } | 8027 | } |
8027 | } | 8028 | } |
@@ -8137,12 +8138,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8137 | sp->product_name, pdev->revision); | 8138 | sp->product_name, pdev->revision); |
8138 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, | 8139 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, |
8139 | s2io_driver_version); | 8140 | s2io_driver_version); |
8140 | DBG_PRINT(ERR_DBG, "%s: MAC ADDR: %pM\n", dev->name, dev->dev_addr); | 8141 | DBG_PRINT(ERR_DBG, "%s: MAC Address: %pM\n", dev->name, dev->dev_addr); |
8141 | DBG_PRINT(ERR_DBG, "SERIAL NUMBER: %s\n", sp->serial_num); | 8142 | DBG_PRINT(ERR_DBG, "Serial number: %s\n", sp->serial_num); |
8142 | if (sp->device_type & XFRAME_II_DEVICE) { | 8143 | if (sp->device_type & XFRAME_II_DEVICE) { |
8143 | mode = s2io_print_pci_mode(sp); | 8144 | mode = s2io_print_pci_mode(sp); |
8144 | if (mode < 0) { | 8145 | if (mode < 0) { |
8145 | DBG_PRINT(ERR_DBG, " Unsupported PCI bus mode\n"); | ||
8146 | ret = -EBADSLT; | 8146 | ret = -EBADSLT; |
8147 | unregister_netdev(dev); | 8147 | unregister_netdev(dev); |
8148 | goto set_swap_failed; | 8148 | goto set_swap_failed; |
@@ -8532,8 +8532,9 @@ static int s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, | |||
8532 | *lro = l_lro; | 8532 | *lro = l_lro; |
8533 | 8533 | ||
8534 | if ((*lro)->tcp_next_seq != ntohl(tcph->seq)) { | 8534 | if ((*lro)->tcp_next_seq != ntohl(tcph->seq)) { |
8535 | DBG_PRINT(INFO_DBG, "%s:Out of order. expected " | 8535 | DBG_PRINT(INFO_DBG, "%s: Out of sequence. " |
8536 | "0x%x, actual 0x%x\n", __func__, | 8536 | "expected 0x%x, actual 0x%x\n", |
8537 | __func__, | ||
8537 | (*lro)->tcp_next_seq, | 8538 | (*lro)->tcp_next_seq, |
8538 | ntohl(tcph->seq)); | 8539 | ntohl(tcph->seq)); |
8539 | 8540 | ||
@@ -8571,7 +8572,7 @@ static int s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, | |||
8571 | } | 8572 | } |
8572 | 8573 | ||
8573 | if (ret == 0) { /* sessions exceeded */ | 8574 | if (ret == 0) { /* sessions exceeded */ |
8574 | DBG_PRINT(INFO_DBG, "%s:All LRO sessions already in use\n", | 8575 | DBG_PRINT(INFO_DBG, "%s: All LRO sessions already in use\n", |
8575 | __func__); | 8576 | __func__); |
8576 | *lro = NULL; | 8577 | *lro = NULL; |
8577 | return ret; | 8578 | return ret; |
@@ -8593,7 +8594,7 @@ static int s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, | |||
8593 | } | 8594 | } |
8594 | break; | 8595 | break; |
8595 | default: | 8596 | default: |
8596 | DBG_PRINT(ERR_DBG, "%s:Dont know, can't say!!\n", __func__); | 8597 | DBG_PRINT(ERR_DBG, "%s: Don't know, can't say!!\n", __func__); |
8597 | break; | 8598 | break; |
8598 | } | 8599 | } |
8599 | 8600 | ||
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index d5c5be6c07b9..47c36e0994f5 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -64,7 +64,10 @@ enum { | |||
64 | static int debug_level = ERR_DBG; | 64 | static int debug_level = ERR_DBG; |
65 | 65 | ||
66 | /* DEBUG message print. */ | 66 | /* DEBUG message print. */ |
67 | #define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args) | 67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ |
68 | if (dbg_level >= debug_level) \ | ||
69 | pr_info(fmt, ##args); \ | ||
70 | } while (0) | ||
68 | 71 | ||
69 | /* Protocol assist features of the NIC */ | 72 | /* Protocol assist features of the NIC */ |
70 | #define L3_CKSUM_OK 0xFFFF | 73 | #define L3_CKSUM_OK 0xFFFF |