BNX2X: spatch ether->mtu -> ether->maxmtu
[akaros.git] / kern / drivers / net / bnx2x / bnx2x_main.c
index a15fb7b..b82b545 100644 (file)
@@ -2280,7 +2280,7 @@ static void bnx2x_set_requested_fc(struct bnx2x *bp)
         * It is recommended to turn off RX FC for jumbo frames
         *  for better performance
         */
-       if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000))
+       if (CHIP_IS_E1x(bp) && (bp->dev->maxmtu > 5000))
                bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX;
        else
                bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH;
@@ -3128,7 +3128,7 @@ static void bnx2x_pf_q_prep_general(struct bnx2x *bp,
        if (IS_FCOE_FP(fp))
                gen_init->mtu = BNX2X_FCOE_MINI_JUMBO_MTU;
        else
-               gen_init->mtu = bp->dev->mtu;
+               gen_init->mtu = bp->dev->maxmtu;
 
        gen_init->cos = cos;
 
@@ -3153,7 +3153,7 @@ static void bnx2x_pf_rx_q_prep(struct bnx2x *bp,
                                MAX_RX_SGE_CNT * NUM_RX_SGE_PAGES);
 
                tpa_agg_size = TPA_AGG_SIZE;
-               max_sge = SGE_PAGE_ALIGN(bp->dev->mtu) >>
+               max_sge = SGE_PAGE_ALIGN(bp->dev->maxmtu) >>
                        SGE_PAGE_SHIFT;
                max_sge = ((max_sge + PAGES_PER_SGE - 1) &
                          (~(PAGES_PER_SGE-1))) >> PAGES_PER_SGE_SHIFT;
@@ -3358,10 +3358,10 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp)
                                DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED,
                                ether_stat->mac_local + MAC_PAD, MAC_PAD,
                                Eaddrlen);
-       ether_stat->mtu_size = bp->dev->mtu;
-       if (bp->dev->features & NETIF_F_RXCSUM)
+       ether_stat->mtu_size = bp->dev->maxmtu;
+       if (bp->dev->feat & NETIF_F_RXCSUM)
                ether_stat->feature_flags |= FEATURE_ETH_CHKSUM_OFFLOAD_MASK;
-       if (bp->dev->features & NETIF_F_TSO)
+       if (bp->dev->feat & NETIF_F_TSO)
                ether_stat->feature_flags |= FEATURE_ETH_LSO_MASK;
        ether_stat->feature_flags |= bp->common.boot_mode;
 
@@ -7462,11 +7462,11 @@ static int bnx2x_init_hw_port(struct bnx2x *bp)
 
                if (IS_MF(bp))
                        low = ((bp->flags & ONE_PORT_FLAG) ? 160 : 246);
-               else if (bp->dev->mtu > 4096) {
+               else if (bp->dev->maxmtu > 4096) {
                        if (bp->flags & ONE_PORT_FLAG)
                                low = 160;
                        else {
-                               val = bp->dev->mtu;
+                               val = bp->dev->maxmtu;
                                /* (24*1024 + val*4)/256 */
                                low = 96 + (val/64) +
                                                ((val % 64) ? 1 : 0);
@@ -12065,10 +12065,10 @@ static int bnx2x_init_bp(struct bnx2x *bp)
        /* Set TPA flags */
        if (bp->disable_tpa) {
                bp->flags &= ~(TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
-               bp->dev->features &= ~NETIF_F_LRO;
+               bp->dev->feat &= ~NETIF_F_LRO;
        } else {
                bp->flags |= (TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
-               bp->dev->features |= NETIF_F_LRO;
+               bp->dev->feat |= NETIF_F_LRO;
        }
 
        if (CHIP_IS_E1(bp))
@@ -12742,19 +12742,10 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_device *pdev,
        if (!CHIP_IS_E1x(bp)) {
                dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |
                                    NETIF_F_GSO_IPIP | NETIF_F_GSO_SIT;
-               dev->hw_enc_features =
-                       NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
-                       NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
-                       NETIF_F_GSO_IPIP |
-                       NETIF_F_GSO_SIT |
-                       NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
        }
 
-       dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-               NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
-
-       dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
-       dev->features |= NETIF_F_HIGHDMA;
+       dev->feat |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
+       dev->feat |= NETIF_F_HIGHDMA;
 
        /* Add Loopback capability to the device */
        dev->hw_features |= NETIF_F_LOOPBACK;