aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ae36bc7b0276..4b0476c50859 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -679,6 +679,7 @@ static void bnx2x_int_disable(struct bnx2x *bp)
679 REG_WR(bp, addr, val); 679 REG_WR(bp, addr, val);
680 if (REG_RD(bp, addr) != val) 680 if (REG_RD(bp, addr) != val)
681 BNX2X_ERR("BUG! proper val not read from IGU!\n"); 681 BNX2X_ERR("BUG! proper val not read from IGU!\n");
682
682} 683}
683 684
684static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) 685static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw)
@@ -780,7 +781,6 @@ static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp)
780 /* Tell compiler that consumer and producer can change */ 781 /* Tell compiler that consumer and producer can change */
781 barrier(); 782 barrier();
782 return (fp->tx_pkt_prod != fp->tx_pkt_cons); 783 return (fp->tx_pkt_prod != fp->tx_pkt_cons);
783
784} 784}
785 785
786/* free skb in the packet ring at pos idx 786/* free skb in the packet ring at pos idx
@@ -2036,13 +2036,16 @@ static void bnx2x_calc_fc_adv(struct bnx2x *bp)
2036 bp->port.advertising &= ~(ADVERTISED_Asym_Pause | 2036 bp->port.advertising &= ~(ADVERTISED_Asym_Pause |
2037 ADVERTISED_Pause); 2037 ADVERTISED_Pause);
2038 break; 2038 break;
2039
2039 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH: 2040 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH:
2040 bp->port.advertising |= (ADVERTISED_Asym_Pause | 2041 bp->port.advertising |= (ADVERTISED_Asym_Pause |
2041 ADVERTISED_Pause); 2042 ADVERTISED_Pause);
2042 break; 2043 break;
2044
2043 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC: 2045 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC:
2044 bp->port.advertising |= ADVERTISED_Asym_Pause; 2046 bp->port.advertising |= ADVERTISED_Asym_Pause;
2045 break; 2047 break;
2048
2046 default: 2049 default:
2047 bp->port.advertising &= ~(ADVERTISED_Asym_Pause | 2050 bp->port.advertising &= ~(ADVERTISED_Asym_Pause |
2048 ADVERTISED_Pause); 2051 ADVERTISED_Pause);
@@ -2067,7 +2070,8 @@ static void bnx2x_link_report(struct bnx2x *bp)
2067 if (bp->link_vars.flow_ctrl != BNX2X_FLOW_CTRL_NONE) { 2070 if (bp->link_vars.flow_ctrl != BNX2X_FLOW_CTRL_NONE) {
2068 if (bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_RX) { 2071 if (bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_RX) {
2069 printk(", receive "); 2072 printk(", receive ");
2070 if (bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_TX) 2073 if (bp->link_vars.flow_ctrl &
2074 BNX2X_FLOW_CTRL_TX)
2071 printk("& transmit "); 2075 printk("& transmit ");
2072 } else { 2076 } else {
2073 printk(", transmit "); 2077 printk(", transmit ");
@@ -4454,8 +4458,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp,
4454 if (fp->tpa_state[i] == BNX2X_TPA_START) 4458 if (fp->tpa_state[i] == BNX2X_TPA_START)
4455 pci_unmap_single(bp->pdev, 4459 pci_unmap_single(bp->pdev,
4456 pci_unmap_addr(rx_buf, mapping), 4460 pci_unmap_addr(rx_buf, mapping),
4457 bp->rx_buf_size, 4461 bp->rx_buf_size, PCI_DMA_FROMDEVICE);
4458 PCI_DMA_FROMDEVICE);
4459 4462
4460 dev_kfree_skb(skb); 4463 dev_kfree_skb(skb);
4461 rx_buf->skb = NULL; 4464 rx_buf->skb = NULL;
@@ -4800,18 +4803,22 @@ static void bnx2x_set_storm_rx_mode(struct bnx2x *bp)
4800 tstorm_mac_filter.mcast_drop_all = mask; 4803 tstorm_mac_filter.mcast_drop_all = mask;
4801 tstorm_mac_filter.bcast_drop_all = mask; 4804 tstorm_mac_filter.bcast_drop_all = mask;
4802 break; 4805 break;
4806
4803 case BNX2X_RX_MODE_NORMAL: 4807 case BNX2X_RX_MODE_NORMAL:
4804 tstorm_mac_filter.bcast_accept_all = mask; 4808 tstorm_mac_filter.bcast_accept_all = mask;
4805 break; 4809 break;
4810
4806 case BNX2X_RX_MODE_ALLMULTI: 4811 case BNX2X_RX_MODE_ALLMULTI:
4807 tstorm_mac_filter.mcast_accept_all = mask; 4812 tstorm_mac_filter.mcast_accept_all = mask;
4808 tstorm_mac_filter.bcast_accept_all = mask; 4813 tstorm_mac_filter.bcast_accept_all = mask;
4809 break; 4814 break;
4815
4810 case BNX2X_RX_MODE_PROMISC: 4816 case BNX2X_RX_MODE_PROMISC:
4811 tstorm_mac_filter.ucast_accept_all = mask; 4817 tstorm_mac_filter.ucast_accept_all = mask;
4812 tstorm_mac_filter.mcast_accept_all = mask; 4818 tstorm_mac_filter.mcast_accept_all = mask;
4813 tstorm_mac_filter.bcast_accept_all = mask; 4819 tstorm_mac_filter.bcast_accept_all = mask;
4814 break; 4820 break;
4821
4815 default: 4822 default:
4816 BNX2X_ERR("BAD rx mode (%d)\n", mode); 4823 BNX2X_ERR("BAD rx mode (%d)\n", mode);
4817 break; 4824 break;
@@ -5857,6 +5864,7 @@ static int bnx2x_init_port(struct bnx2x *bp)
5857 /* Port CSDM comes here */ 5864 /* Port CSDM comes here */
5858 /* Port USDM comes here */ 5865 /* Port USDM comes here */
5859 /* Port XSDM comes here */ 5866 /* Port XSDM comes here */
5867
5860 bnx2x_init_block(bp, port ? TSEM_PORT1_START : TSEM_PORT0_START, 5868 bnx2x_init_block(bp, port ? TSEM_PORT1_START : TSEM_PORT0_START,
5861 port ? TSEM_PORT1_END : TSEM_PORT0_END); 5869 port ? TSEM_PORT1_END : TSEM_PORT0_END);
5862 bnx2x_init_block(bp, port ? USEM_PORT1_START : USEM_PORT0_START, 5870 bnx2x_init_block(bp, port ? USEM_PORT1_START : USEM_PORT0_START,
@@ -5865,6 +5873,7 @@ static int bnx2x_init_port(struct bnx2x *bp)
5865 port ? CSEM_PORT1_END : CSEM_PORT0_END); 5873 port ? CSEM_PORT1_END : CSEM_PORT0_END);
5866 bnx2x_init_block(bp, port ? XSEM_PORT1_START : XSEM_PORT0_START, 5874 bnx2x_init_block(bp, port ? XSEM_PORT1_START : XSEM_PORT0_START,
5867 port ? XSEM_PORT1_END : XSEM_PORT0_END); 5875 port ? XSEM_PORT1_END : XSEM_PORT0_END);
5876
5868 /* Port UPB comes here */ 5877 /* Port UPB comes here */
5869 /* Port XPB comes here */ 5878 /* Port XPB comes here */
5870 5879
@@ -5923,6 +5932,7 @@ static int bnx2x_init_port(struct bnx2x *bp)
5923 /* Port EMAC1 comes here */ 5932 /* Port EMAC1 comes here */
5924 /* Port DBU comes here */ 5933 /* Port DBU comes here */
5925 /* Port DBG comes here */ 5934 /* Port DBG comes here */
5935
5926 bnx2x_init_block(bp, port ? NIG_PORT1_START : NIG_PORT0_START, 5936 bnx2x_init_block(bp, port ? NIG_PORT1_START : NIG_PORT0_START,
5927 port ? NIG_PORT1_END : NIG_PORT0_END); 5937 port ? NIG_PORT1_END : NIG_PORT0_END);
5928 5938
@@ -6404,8 +6414,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp)
6404 6414
6405 pci_unmap_single(bp->pdev, 6415 pci_unmap_single(bp->pdev,
6406 pci_unmap_addr(rx_buf, mapping), 6416 pci_unmap_addr(rx_buf, mapping),
6407 bp->rx_buf_size, 6417 bp->rx_buf_size, PCI_DMA_FROMDEVICE);
6408 PCI_DMA_FROMDEVICE);
6409 6418
6410 rx_buf->skb = NULL; 6419 rx_buf->skb = NULL;
6411 dev_kfree_skb(skb); 6420 dev_kfree_skb(skb);
@@ -7325,6 +7334,7 @@ unload_error:
7325 /* Report UNLOAD_DONE to MCP */ 7334 /* Report UNLOAD_DONE to MCP */
7326 if (!BP_NOMCP(bp)) 7335 if (!BP_NOMCP(bp))
7327 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); 7336 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE);
7337
7328 bp->port.pmf = 0; 7338 bp->port.pmf = 0;
7329 7339
7330 /* Free SKBs, SGEs, TPA pool and driver internals */ 7340 /* Free SKBs, SGEs, TPA pool and driver internals */
@@ -9035,7 +9045,8 @@ static void bnx2x_get_pauseparam(struct net_device *dev,
9035{ 9045{
9036 struct bnx2x *bp = netdev_priv(dev); 9046 struct bnx2x *bp = netdev_priv(dev);
9037 9047
9038 epause->autoneg = (bp->link_params.req_flow_ctrl == BNX2X_FLOW_CTRL_AUTO) && 9048 epause->autoneg = (bp->link_params.req_flow_ctrl ==
9049 BNX2X_FLOW_CTRL_AUTO) &&
9039 (bp->link_params.req_line_speed == SPEED_AUTO_NEG); 9050 (bp->link_params.req_line_speed == SPEED_AUTO_NEG);
9040 9051
9041 epause->rx_pause = ((bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_RX) == 9052 epause->rx_pause = ((bp->link_vars.flow_ctrl & BNX2X_FLOW_CTRL_RX) ==
@@ -10059,6 +10070,7 @@ static int bnx2x_poll(struct napi_struct *napi, int budget)
10059 10070
10060 if (bnx2x_has_rx_work(fp)) 10071 if (bnx2x_has_rx_work(fp))
10061 work_done = bnx2x_rx_int(fp, budget); 10072 work_done = bnx2x_rx_int(fp, budget);
10073
10062 rmb(); /* BNX2X_HAS_WORK() reads the status block */ 10074 rmb(); /* BNX2X_HAS_WORK() reads the status block */
10063 10075
10064 /* must not complete if we consumed full budget */ 10076 /* must not complete if we consumed full budget */
@@ -10074,6 +10086,7 @@ poll_panic:
10074 bnx2x_ack_sb(bp, fp->sb_id, CSTORM_ID, 10086 bnx2x_ack_sb(bp, fp->sb_id, CSTORM_ID,
10075 le16_to_cpu(fp->fp_c_idx), IGU_INT_ENABLE, 1); 10087 le16_to_cpu(fp->fp_c_idx), IGU_INT_ENABLE, 1);
10076 } 10088 }
10089
10077 return work_done; 10090 return work_done;
10078} 10091}
10079 10092
@@ -10232,7 +10245,6 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
10232 wnd_sum -= 10245 wnd_sum -=
10233 skb_shinfo(skb)->frags[wnd_idx].size; 10246 skb_shinfo(skb)->frags[wnd_idx].size;
10234 } 10247 }
10235
10236 } else { 10248 } else {
10237 /* in non-LSO too fragmented packet should always 10249 /* in non-LSO too fragmented packet should always
10238 be linearized */ 10250 be linearized */
@@ -10824,7 +10836,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
10824 .ndo_open = bnx2x_open, 10836 .ndo_open = bnx2x_open,
10825 .ndo_stop = bnx2x_close, 10837 .ndo_stop = bnx2x_close,
10826 .ndo_start_xmit = bnx2x_start_xmit, 10838 .ndo_start_xmit = bnx2x_start_xmit,
10827 .ndo_set_multicast_list = bnx2x_set_rx_mode, 10839 .ndo_set_multicast_list = bnx2x_set_rx_mode,
10828 .ndo_set_mac_address = bnx2x_change_mac_addr, 10840 .ndo_set_mac_address = bnx2x_change_mac_addr,
10829 .ndo_validate_addr = eth_validate_addr, 10841 .ndo_validate_addr = eth_validate_addr,
10830 .ndo_do_ioctl = bnx2x_ioctl, 10842 .ndo_do_ioctl = bnx2x_ioctl,
@@ -10838,7 +10850,6 @@ static const struct net_device_ops bnx2x_netdev_ops = {
10838#endif 10850#endif
10839}; 10851};
10840 10852
10841
10842static int __devinit bnx2x_init_dev(struct pci_dev *pdev, 10853static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
10843 struct net_device *dev) 10854 struct net_device *dev)
10844{ 10855{
@@ -11317,8 +11328,8 @@ static void bnx2x_io_resume(struct pci_dev *pdev)
11317 11328
11318static struct pci_error_handlers bnx2x_err_handler = { 11329static struct pci_error_handlers bnx2x_err_handler = {
11319 .error_detected = bnx2x_io_error_detected, 11330 .error_detected = bnx2x_io_error_detected,
11320 .slot_reset = bnx2x_io_slot_reset, 11331 .slot_reset = bnx2x_io_slot_reset,
11321 .resume = bnx2x_io_resume, 11332 .resume = bnx2x_io_resume,
11322}; 11333};
11323 11334
11324static struct pci_driver bnx2x_pci_driver = { 11335static struct pci_driver bnx2x_pci_driver = {