Merge branch 'for-upstream' of git://openrisc.net/jonas/linux
[pandora-kernel.git] / drivers / net / benet / be_main.c
index 696f634..c411bb1 100644 (file)
@@ -44,7 +44,7 @@ static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
 };
 MODULE_DEVICE_TABLE(pci, be_dev_ids);
 /* UE Status Low CSR */
-static char *ue_status_low_desc[] = {
+static const char * const ue_status_low_desc[] = {
        "CEV",
        "CTX",
        "DBUF",
@@ -79,7 +79,7 @@ static char *ue_status_low_desc[] = {
        "MPU_INTPEND"
 };
 /* UE Status High CSR */
-static char *ue_status_hi_desc[] = {
+static const char * const ue_status_hi_desc[] = {
        "LPCMEMHOST",
        "MGMT_MAC",
        "PCS0ONLINE",
@@ -103,7 +103,7 @@ static char *ue_status_hi_desc[] = {
        "HOST7",
        "HOST8",
        "HOST9",
-       "NETC"
+       "NETC",
        "Unknown",
        "Unknown",
        "Unknown",
@@ -431,6 +431,7 @@ void netdev_stats_update(struct be_adapter *adapter)
                pkts += rx_stats(rxo)->rx_pkts;
                bytes += rx_stats(rxo)->rx_bytes;
                mcast += rx_stats(rxo)->rx_mcast_pkts;
+               drops += rx_stats(rxo)->rx_dropped;
                /*  no space in linux buffers: best possible approximation */
                if (adapter->generation == BE_GEN3) {
                        if (!(lancer_chip(adapter))) {
@@ -653,7 +654,7 @@ static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
                        AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1);
        }
 
-       if (adapter->vlan_grp && vlan_tx_tag_present(skb)) {
+       if (vlan_tx_tag_present(skb)) {
                AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1);
                vlan_tag = vlan_tx_tag_get(skb);
                vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
@@ -846,13 +847,6 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
        return status;
 }
 
-static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp)
-{
-       struct be_adapter *adapter = netdev_priv(netdev);
-
-       adapter->vlan_grp = grp;
-}
-
 static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
 {
        struct be_adapter *adapter = netdev_priv(netdev);
@@ -871,7 +865,6 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
        struct be_adapter *adapter = netdev_priv(netdev);
 
        adapter->vlans_added--;
-       vlan_group_set_device(adapter->vlan_grp, vid, NULL);
 
        if (!be_physfn(adapter))
                return;
@@ -1181,8 +1174,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
 
        skb = netdev_alloc_skb_ip_align(netdev, BE_HDR_LEN);
        if (unlikely(!skb)) {
-               if (net_ratelimit())
-                       dev_warn(&adapter->pdev->dev, "skb alloc failed\n");
+               rxo->stats.rx_dropped++;
                be_rx_compl_discard(adapter, rxo, rxcp);
                return;
        }
@@ -1200,16 +1192,10 @@ static void be_rx_compl_process(struct be_adapter *adapter,
                skb->rxhash = rxcp->rss_hash;
 
 
-       if (unlikely(rxcp->vlanf)) {
-               if (!adapter->vlan_grp || adapter->vlans_added == 0) {
-                       kfree_skb(skb);
-                       return;
-               }
-               vlan_hwaccel_receive_skb(skb, adapter->vlan_grp,
-                                       rxcp->vlan_tag);
-       } else {
-               netif_receive_skb(skb);
-       }
+       if (unlikely(rxcp->vlanf))
+               __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
+
+       netif_receive_skb(skb);
 }
 
 /* Process the RX completion indicated by rxcp when GRO is enabled */
@@ -1263,11 +1249,10 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
        if (adapter->netdev->features & NETIF_F_RXHASH)
                skb->rxhash = rxcp->rss_hash;
 
-       if (likely(!rxcp->vlanf))
-               napi_gro_frags(&eq_obj->napi);
-       else
-               vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp,
-                               rxcp->vlan_tag);
+       if (unlikely(rxcp->vlanf))
+               __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
+
+       napi_gro_frags(&eq_obj->napi);
 }
 
 static void be_parse_rx_compl_v1(struct be_adapter *adapter,
@@ -2526,6 +2511,8 @@ static int be_setup(struct be_adapter *adapter)
        int status;
        u8 mac[ETH_ALEN];
 
+       be_cmd_req_native_mode(adapter);
+
        cap_flags = en_flags = BE_IF_FLAGS_UNTAGGED |
                                BE_IF_FLAGS_BROADCAST |
                                BE_IF_FLAGS_MULTICAST;
@@ -2633,6 +2620,8 @@ static int be_clear(struct be_adapter *adapter)
 
        be_cmd_if_destroy(adapter, adapter->if_handle,  0);
 
+       adapter->be3_native = 0;
+
        /* tell fw we're done with firing cmds */
        be_cmd_fw_clean(adapter);
        return 0;
@@ -2950,7 +2939,6 @@ static struct net_device_ops be_netdev_ops = {
        .ndo_set_mac_address    = be_mac_addr_set,
        .ndo_change_mtu         = be_change_mtu,
        .ndo_validate_addr      = eth_validate_addr,
-       .ndo_vlan_rx_register   = be_vlan_register,
        .ndo_vlan_rx_add_vid    = be_vlan_add_vid,
        .ndo_vlan_rx_kill_vid   = be_vlan_rem_vid,
        .ndo_set_vf_mac         = be_set_vf_mac,
@@ -3231,8 +3219,6 @@ static int be_get_config(struct be_adapter *adapter)
        if (status)
                return status;
 
-       be_cmd_check_native_mode(adapter);
-
        if ((num_vfs && adapter->sriov_enabled) ||
                (adapter->function_mode & 0x400) ||
                lancer_chip(adapter) || !be_physfn(adapter)) {