diff options
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index c16f9156c98a..b93751c3d036 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -530,9 +530,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
530 | */ | 530 | */ |
531 | if (!tmp_p) { | 531 | if (!tmp_p) { |
532 | mac_control->zerodma_virt_addr = tmp_v; | 532 | mac_control->zerodma_virt_addr = tmp_v; |
533 | DBG_PRINT(INIT_DBG, | 533 | DBG_PRINT(INIT_DBG, |
534 | "%s: Zero DMA address for TxDL. ", dev->name); | 534 | "%s: Zero DMA address for TxDL. ", dev->name); |
535 | DBG_PRINT(INIT_DBG, | 535 | DBG_PRINT(INIT_DBG, |
536 | "Virtual address %p\n", tmp_v); | 536 | "Virtual address %p\n", tmp_v); |
537 | tmp_v = pci_alloc_consistent(nic->pdev, | 537 | tmp_v = pci_alloc_consistent(nic->pdev, |
538 | PAGE_SIZE, &tmp_p); | 538 | PAGE_SIZE, &tmp_p); |
@@ -756,7 +756,7 @@ static void free_shared_mem(struct s2io_nic *nic) | |||
756 | for (j = 0; j < page_num; j++) { | 756 | for (j = 0; j < page_num; j++) { |
757 | int mem_blks = (j * lst_per_page); | 757 | int mem_blks = (j * lst_per_page); |
758 | if (!mac_control->fifos[i].list_info) | 758 | if (!mac_control->fifos[i].list_info) |
759 | return; | 759 | return; |
760 | if (!mac_control->fifos[i].list_info[mem_blks]. | 760 | if (!mac_control->fifos[i].list_info[mem_blks]. |
761 | list_virt_addr) | 761 | list_virt_addr) |
762 | break; | 762 | break; |
@@ -775,7 +775,7 @@ static void free_shared_mem(struct s2io_nic *nic) | |||
775 | pci_free_consistent(nic->pdev, PAGE_SIZE, | 775 | pci_free_consistent(nic->pdev, PAGE_SIZE, |
776 | mac_control->zerodma_virt_addr, | 776 | mac_control->zerodma_virt_addr, |
777 | (dma_addr_t)0); | 777 | (dma_addr_t)0); |
778 | DBG_PRINT(INIT_DBG, | 778 | DBG_PRINT(INIT_DBG, |
779 | "%s: Freeing TxDL with zero DMA addr. ", | 779 | "%s: Freeing TxDL with zero DMA addr. ", |
780 | dev->name); | 780 | dev->name); |
781 | DBG_PRINT(INIT_DBG, "Virtual address %p\n", | 781 | DBG_PRINT(INIT_DBG, "Virtual address %p\n", |
@@ -1276,7 +1276,7 @@ static int init_nic(struct s2io_nic *nic) | |||
1276 | writeq(val64, &bar0->rx_w_round_robin_1); | 1276 | writeq(val64, &bar0->rx_w_round_robin_1); |
1277 | val64 = 0x0200010000010203ULL; | 1277 | val64 = 0x0200010000010203ULL; |
1278 | writeq(val64, &bar0->rx_w_round_robin_2); | 1278 | writeq(val64, &bar0->rx_w_round_robin_2); |
1279 | val64 = 0x0001020001000001ULL; | 1279 | val64 = 0x0001020001000001ULL; |
1280 | writeq(val64, &bar0->rx_w_round_robin_3); | 1280 | writeq(val64, &bar0->rx_w_round_robin_3); |
1281 | val64 = 0x0203000100000000ULL; | 1281 | val64 = 0x0203000100000000ULL; |
1282 | writeq(val64, &bar0->rx_w_round_robin_4); | 1282 | writeq(val64, &bar0->rx_w_round_robin_4); |
@@ -2127,7 +2127,7 @@ static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, in | |||
2127 | skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; | 2127 | skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; |
2128 | if (!txds->Buffer_Pointer) | 2128 | if (!txds->Buffer_Pointer) |
2129 | break; | 2129 | break; |
2130 | pci_unmap_page(nic->pdev, (dma_addr_t) | 2130 | pci_unmap_page(nic->pdev, (dma_addr_t) |
2131 | txds->Buffer_Pointer, | 2131 | txds->Buffer_Pointer, |
2132 | frag->size, PCI_DMA_TODEVICE); | 2132 | frag->size, PCI_DMA_TODEVICE); |
2133 | } | 2133 | } |
@@ -2397,7 +2397,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) | |||
2397 | /* Two buffer mode */ | 2397 | /* Two buffer mode */ |
2398 | 2398 | ||
2399 | /* | 2399 | /* |
2400 | * Buffer2 will have L3/L4 header plus | 2400 | * Buffer2 will have L3/L4 header plus |
2401 | * L4 payload | 2401 | * L4 payload |
2402 | */ | 2402 | */ |
2403 | ((RxD3_t*)rxdp)->Buffer2_ptr = pci_map_single | 2403 | ((RxD3_t*)rxdp)->Buffer2_ptr = pci_map_single |
@@ -2407,7 +2407,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) | |||
2407 | /* Buffer-1 will be dummy buffer. Not used */ | 2407 | /* Buffer-1 will be dummy buffer. Not used */ |
2408 | if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) { | 2408 | if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) { |
2409 | ((RxD3_t*)rxdp)->Buffer1_ptr = | 2409 | ((RxD3_t*)rxdp)->Buffer1_ptr = |
2410 | pci_map_single(nic->pdev, | 2410 | pci_map_single(nic->pdev, |
2411 | ba->ba_1, BUF1_LEN, | 2411 | ba->ba_1, BUF1_LEN, |
2412 | PCI_DMA_FROMDEVICE); | 2412 | PCI_DMA_FROMDEVICE); |
2413 | } | 2413 | } |
@@ -2509,7 +2509,7 @@ static void free_rxd_blk(struct s2io_nic *sp, int ring_no, int blk) | |||
2509 | ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN, | 2509 | ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN, |
2510 | PCI_DMA_FROMDEVICE); | 2510 | PCI_DMA_FROMDEVICE); |
2511 | pci_unmap_single(sp->pdev, (dma_addr_t) | 2511 | pci_unmap_single(sp->pdev, (dma_addr_t) |
2512 | ((RxD3_t*)rxdp)->Buffer1_ptr, | 2512 | ((RxD3_t*)rxdp)->Buffer1_ptr, |
2513 | l3l4hdr_size + 4, | 2513 | l3l4hdr_size + 4, |
2514 | PCI_DMA_FROMDEVICE); | 2514 | PCI_DMA_FROMDEVICE); |
2515 | pci_unmap_single(sp->pdev, (dma_addr_t) | 2515 | pci_unmap_single(sp->pdev, (dma_addr_t) |
@@ -2663,7 +2663,7 @@ static void s2io_netpoll(struct net_device *dev) | |||
2663 | writeq(val64, &bar0->rx_traffic_int); | 2663 | writeq(val64, &bar0->rx_traffic_int); |
2664 | writeq(val64, &bar0->tx_traffic_int); | 2664 | writeq(val64, &bar0->tx_traffic_int); |
2665 | 2665 | ||
2666 | /* we need to free up the transmitted skbufs or else netpoll will | 2666 | /* we need to free up the transmitted skbufs or else netpoll will |
2667 | * run out of skbs and will fail and eventually netpoll application such | 2667 | * run out of skbs and will fail and eventually netpoll application such |
2668 | * as netdump will fail. | 2668 | * as netdump will fail. |
2669 | */ | 2669 | */ |
@@ -3209,7 +3209,7 @@ static void alarm_intr_handler(struct s2io_nic *nic) | |||
3209 | if (val64 & SERR_SOURCE_ANY) { | 3209 | if (val64 & SERR_SOURCE_ANY) { |
3210 | nic->mac_control.stats_info->sw_stat.serious_err_cnt++; | 3210 | nic->mac_control.stats_info->sw_stat.serious_err_cnt++; |
3211 | DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name); | 3211 | DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name); |
3212 | DBG_PRINT(ERR_DBG, "serious error %llx!!\n", | 3212 | DBG_PRINT(ERR_DBG, "serious error %llx!!\n", |
3213 | (unsigned long long)val64); | 3213 | (unsigned long long)val64); |
3214 | netif_stop_queue(dev); | 3214 | netif_stop_queue(dev); |
3215 | schedule_work(&nic->rst_timer_task); | 3215 | schedule_work(&nic->rst_timer_task); |
@@ -4816,7 +4816,7 @@ static int read_eeprom(nic_t * sp, int off, u64 * data) | |||
4816 | 4816 | ||
4817 | if (sp->device_type == XFRAME_II_DEVICE) { | 4817 | if (sp->device_type == XFRAME_II_DEVICE) { |
4818 | val64 = SPI_CONTROL_KEY(0x9) | SPI_CONTROL_SEL1 | | 4818 | val64 = SPI_CONTROL_KEY(0x9) | SPI_CONTROL_SEL1 | |
4819 | SPI_CONTROL_BYTECNT(0x3) | | 4819 | SPI_CONTROL_BYTECNT(0x3) | |
4820 | SPI_CONTROL_CMD(0x3) | SPI_CONTROL_ADDR(off); | 4820 | SPI_CONTROL_CMD(0x3) | SPI_CONTROL_ADDR(off); |
4821 | SPECIAL_REG_WRITE(val64, &bar0->spi_control, LF); | 4821 | SPECIAL_REG_WRITE(val64, &bar0->spi_control, LF); |
4822 | val64 |= SPI_CONTROL_REQ; | 4822 | val64 |= SPI_CONTROL_REQ; |
@@ -4883,7 +4883,7 @@ static int write_eeprom(nic_t * sp, int off, u64 data, int cnt) | |||
4883 | writeq(SPI_DATA_WRITE(data,(cnt<<3)), &bar0->spi_data); | 4883 | writeq(SPI_DATA_WRITE(data,(cnt<<3)), &bar0->spi_data); |
4884 | 4884 | ||
4885 | val64 = SPI_CONTROL_KEY(0x9) | SPI_CONTROL_SEL1 | | 4885 | val64 = SPI_CONTROL_KEY(0x9) | SPI_CONTROL_SEL1 | |
4886 | SPI_CONTROL_BYTECNT(write_cnt) | | 4886 | SPI_CONTROL_BYTECNT(write_cnt) | |
4887 | SPI_CONTROL_CMD(0x2) | SPI_CONTROL_ADDR(off); | 4887 | SPI_CONTROL_CMD(0x2) | SPI_CONTROL_ADDR(off); |
4888 | SPECIAL_REG_WRITE(val64, &bar0->spi_control, LF); | 4888 | SPECIAL_REG_WRITE(val64, &bar0->spi_control, LF); |
4889 | val64 |= SPI_CONTROL_REQ; | 4889 | val64 |= SPI_CONTROL_REQ; |
@@ -5646,7 +5646,7 @@ static void s2io_get_ethtool_stats(struct net_device *dev, | |||
5646 | if (stat_info->sw_stat.num_aggregations) { | 5646 | if (stat_info->sw_stat.num_aggregations) { |
5647 | u64 tmp = stat_info->sw_stat.sum_avg_pkts_aggregated; | 5647 | u64 tmp = stat_info->sw_stat.sum_avg_pkts_aggregated; |
5648 | int count = 0; | 5648 | int count = 0; |
5649 | /* | 5649 | /* |
5650 | * Since 64-bit divide does not work on all platforms, | 5650 | * Since 64-bit divide does not work on all platforms, |
5651 | * do repeated subtraction. | 5651 | * do repeated subtraction. |
5652 | */ | 5652 | */ |
@@ -6597,7 +6597,7 @@ static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp) | |||
6597 | } else { | 6597 | } else { |
6598 | send_up: | 6598 | send_up: |
6599 | queue_rx_frame(skb); | 6599 | queue_rx_frame(skb); |
6600 | } | 6600 | } |
6601 | dev->last_rx = jiffies; | 6601 | dev->last_rx = jiffies; |
6602 | aggregate: | 6602 | aggregate: |
6603 | atomic_dec(&sp->rx_bufs_left[ring_no]); | 6603 | atomic_dec(&sp->rx_bufs_left[ring_no]); |
@@ -6717,7 +6717,7 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type) | |||
6717 | if ((*dev_intr_type == MSI_X) && | 6717 | if ((*dev_intr_type == MSI_X) && |
6718 | ((pdev->device != PCI_DEVICE_ID_HERC_WIN) && | 6718 | ((pdev->device != PCI_DEVICE_ID_HERC_WIN) && |
6719 | (pdev->device != PCI_DEVICE_ID_HERC_UNI))) { | 6719 | (pdev->device != PCI_DEVICE_ID_HERC_UNI))) { |
6720 | DBG_PRINT(ERR_DBG, "s2io: Xframe I does not support MSI_X. " | 6720 | DBG_PRINT(ERR_DBG, "s2io: Xframe I does not support MSI_X. " |
6721 | "Defaulting to INTA\n"); | 6721 | "Defaulting to INTA\n"); |
6722 | *dev_intr_type = INTA; | 6722 | *dev_intr_type = INTA; |
6723 | } | 6723 | } |
@@ -6845,7 +6845,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
6845 | sp->device_type = XFRAME_I_DEVICE; | 6845 | sp->device_type = XFRAME_I_DEVICE; |
6846 | 6846 | ||
6847 | sp->lro = lro; | 6847 | sp->lro = lro; |
6848 | 6848 | ||
6849 | /* Initialize some PCI/PCI-X fields of the NIC. */ | 6849 | /* Initialize some PCI/PCI-X fields of the NIC. */ |
6850 | s2io_init_pci(sp); | 6850 | s2io_init_pci(sp); |
6851 | 6851 | ||
@@ -7250,7 +7250,7 @@ static void s2io_closer(void) | |||
7250 | module_init(s2io_starter); | 7250 | module_init(s2io_starter); |
7251 | module_exit(s2io_closer); | 7251 | module_exit(s2io_closer); |
7252 | 7252 | ||
7253 | static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip, | 7253 | static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip, |
7254 | struct tcphdr **tcp, RxD_t *rxdp) | 7254 | struct tcphdr **tcp, RxD_t *rxdp) |
7255 | { | 7255 | { |
7256 | int ip_off; | 7256 | int ip_off; |
@@ -7312,7 +7312,7 @@ static void initiate_new_session(lro_t *lro, u8 *l2h, | |||
7312 | lro->sg_num = 1; | 7312 | lro->sg_num = 1; |
7313 | lro->total_len = ntohs(ip->tot_len); | 7313 | lro->total_len = ntohs(ip->tot_len); |
7314 | lro->frags_len = 0; | 7314 | lro->frags_len = 0; |
7315 | /* | 7315 | /* |
7316 | * check if we saw TCP timestamp. Other consistency checks have | 7316 | * check if we saw TCP timestamp. Other consistency checks have |
7317 | * already been done. | 7317 | * already been done. |
7318 | */ | 7318 | */ |
@@ -7369,12 +7369,12 @@ static void aggregate_new_rx(lro_t *lro, struct iphdr *ip, | |||
7369 | /* Update ack seq no. and window ad(from this pkt) in LRO object */ | 7369 | /* Update ack seq no. and window ad(from this pkt) in LRO object */ |
7370 | lro->tcp_ack = tcp->ack_seq; | 7370 | lro->tcp_ack = tcp->ack_seq; |
7371 | lro->window = tcp->window; | 7371 | lro->window = tcp->window; |
7372 | 7372 | ||
7373 | if (lro->saw_ts) { | 7373 | if (lro->saw_ts) { |
7374 | u32 *ptr; | 7374 | u32 *ptr; |
7375 | /* Update tsecr and tsval from this packet */ | 7375 | /* Update tsecr and tsval from this packet */ |
7376 | ptr = (u32 *) (tcp + 1); | 7376 | ptr = (u32 *) (tcp + 1); |
7377 | lro->cur_tsval = *(ptr + 1); | 7377 | lro->cur_tsval = *(ptr + 1); |
7378 | lro->cur_tsecr = *(ptr + 2); | 7378 | lro->cur_tsecr = *(ptr + 2); |
7379 | } | 7379 | } |
7380 | } | 7380 | } |
@@ -7409,7 +7409,7 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip, | |||
7409 | return -1; | 7409 | return -1; |
7410 | } | 7410 | } |
7411 | 7411 | ||
7412 | /* | 7412 | /* |
7413 | * Allow only one TCP timestamp option. Don't aggregate if | 7413 | * Allow only one TCP timestamp option. Don't aggregate if |
7414 | * any other options are detected. | 7414 | * any other options are detected. |
7415 | */ | 7415 | */ |
@@ -7417,7 +7417,7 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip, | |||
7417 | return -1; | 7417 | return -1; |
7418 | 7418 | ||
7419 | if (tcp->doff == 8) { | 7419 | if (tcp->doff == 8) { |
7420 | ptr = (u8 *)(tcp + 1); | 7420 | ptr = (u8 *)(tcp + 1); |
7421 | while (*ptr == TCPOPT_NOP) | 7421 | while (*ptr == TCPOPT_NOP) |
7422 | ptr++; | 7422 | ptr++; |
7423 | if (*ptr != TCPOPT_TIMESTAMP || *(ptr+1) != TCPOLEN_TIMESTAMP) | 7423 | if (*ptr != TCPOPT_TIMESTAMP || *(ptr+1) != TCPOLEN_TIMESTAMP) |
@@ -7429,7 +7429,7 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip, | |||
7429 | return -1; | 7429 | return -1; |
7430 | 7430 | ||
7431 | /* timestamp echo reply should be non-zero */ | 7431 | /* timestamp echo reply should be non-zero */ |
7432 | if (*((u32 *)(ptr+6)) == 0) | 7432 | if (*((u32 *)(ptr+6)) == 0) |
7433 | return -1; | 7433 | return -1; |
7434 | } | 7434 | } |
7435 | 7435 | ||