]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'can/mcp251x-for-net-next' of git://git.pengutronix.de/git/mkl/linux-2.6
authorDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2010 14:11:44 +0000 (07:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2010 14:11:44 +0000 (07:11 -0700)
drivers/net/bnx2x/bnx2x.h
drivers/net/bnx2x/bnx2x_cmn.c
drivers/net/bnx2x/bnx2x_cmn.h
drivers/net/bnx2x/bnx2x_main.c
drivers/net/ns83820.c
net/tipc/bearer.c

index c49b643e009b89430086f3e041a77a0cd3766edc..01b8d8504773d8e4d0c6953833ec58810ad2dcb4 100644 (file)
@@ -20,8 +20,8 @@
  * (you will need to reboot afterwards) */
 /* #define BNX2X_STOP_ON_ERROR */
 
-#define DRV_MODULE_VERSION      "1.60.00-1"
-#define DRV_MODULE_RELDATE      "2010/10/06"
+#define DRV_MODULE_VERSION      "1.60.00-2"
+#define DRV_MODULE_RELDATE      "2010/10/18"
 #define BNX2X_BC_VER            0x040200
 
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
@@ -1180,15 +1180,10 @@ struct bnx2x {
        TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY
 
 /* func init flags */
-#define FUNC_FLG_RSS           0x0001
-#define FUNC_FLG_STATS         0x0002
-/* removed  FUNC_FLG_UNMATCHED 0x0004 */
-#define FUNC_FLG_TPA           0x0008
-#define FUNC_FLG_SPQ           0x0010
-#define FUNC_FLG_LEADING       0x0020  /* PF only */
-
-#define FUNC_CONFIG(flgs)      ((flgs) & (FUNC_FLG_RSS | FUNC_FLG_TPA | \
-                                       FUNC_FLG_LEADING))
+#define FUNC_FLG_STATS         0x0001
+#define FUNC_FLG_TPA           0x0002
+#define FUNC_FLG_SPQ           0x0004
+#define FUNC_FLG_LEADING       0x0008  /* PF only */
 
 struct rxq_pause_params {
        u16             bd_th_lo;
index 97ef674dcc3471252ce105899afe5f50b170e829..1966ceeefcd4980d1ff11b25e780348c7244cdda 100644 (file)
@@ -507,8 +507,11 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
                        len = le16_to_cpu(cqe->fast_path_cqe.pkt_len);
                        pad = cqe->fast_path_cqe.placement_offset;
 
-                       /* If CQE is marked both TPA_START and TPA_END
-                          it is a non-TPA CQE */
+                       /* - If CQE is marked both TPA_START and TPA_END it is
+                        *   a non-TPA CQE.
+                        * - FP CQE will always have either TPA_START or/and
+                        *   TPA_STOP flags set.
+                        */
                        if ((!fp->disable_tpa) &&
                            (TPA_TYPE(cqe_fp_flags) !=
                                        (TPA_TYPE_START | TPA_TYPE_END))) {
@@ -526,9 +529,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
                                        bnx2x_set_skb_rxhash(bp, cqe, skb);
 
                                        goto next_rx;
-                               }
-
-                               if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_END) {
+                               } else { /* TPA_STOP */
                                        DP(NETIF_MSG_RX_STATUS,
                                           "calling tpa_stop on queue %d\n",
                                           queue);
@@ -830,7 +831,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp)
        int i, j;
 
        bp->rx_buf_size = bp->dev->mtu + ETH_OVREHEAD + BNX2X_RX_ALIGN +
-               BNX2X_FW_IP_HDR_ALIGN_PAD;
+               IP_HEADER_ALIGNMENT_PADDING;
 
        DP(NETIF_MSG_IFUP,
           "mtu %d  rx_buf_size %d\n", bp->dev->mtu, bp->rx_buf_size);
@@ -1288,8 +1289,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
        if (rc) {
                BNX2X_ERR("HW init failed, aborting\n");
                bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_DONE, 0);
-               bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP, 0);
-               bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0);
                goto load_error2;
        }
 
@@ -1522,6 +1521,12 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
 {
        u16 pmcsr;
 
+       /* If there is no power capability, silently succeed */
+       if (!bp->pm_cap) {
+               DP(NETIF_MSG_HW, "No power capability. Breaking.\n");
+               return 0;
+       }
+
        pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
 
        switch (state) {
index 7f52cec9bb99d82036fa1594c823c9026812443d..5bfe0ab1d2d4d71cf1f801149f40de07b5f9ffad 100644 (file)
@@ -1032,6 +1032,4 @@ static inline void storm_memset_cmng(struct bnx2x *bp,
 void bnx2x_acquire_phy_lock(struct bnx2x *bp);
 void bnx2x_release_phy_lock(struct bnx2x *bp);
 
-#define BNX2X_FW_IP_HDR_ALIGN_PAD      2 /* FW places hdr with this padding */
-
 #endif /* BNX2X_CMN_H */
index ead524bca8f2893d3c4c8bd884a93a3b9af5edee..012c093cb4322e20afb3bd1013f7b454a62054ce 100644 (file)
@@ -2284,35 +2284,31 @@ void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
 
 void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
 {
-       if (FUNC_CONFIG(p->func_flgs)) {
-               struct tstorm_eth_function_common_config tcfg = {0};
-
-               /* tpa */
-               if (p->func_flgs & FUNC_FLG_TPA)
-                       tcfg.config_flags |=
-                       TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
-
-               /* set rss flags */
-               if (p->func_flgs & FUNC_FLG_RSS) {
-                       u16 rss_flgs = (p->rss->mode <<
-                       TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
-
-                       if (p->rss->cap & RSS_IPV4_CAP)
-                               rss_flgs |= RSS_IPV4_CAP_MASK;
-                       if (p->rss->cap & RSS_IPV4_TCP_CAP)
-                               rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
-                       if (p->rss->cap & RSS_IPV6_CAP)
-                               rss_flgs |= RSS_IPV6_CAP_MASK;
-                       if (p->rss->cap & RSS_IPV6_TCP_CAP)
-                               rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
-
-                       tcfg.config_flags |= rss_flgs;
-                       tcfg.rss_result_mask = p->rss->result_mask;
+       struct tstorm_eth_function_common_config tcfg = {0};
+       u16 rss_flgs;
 
-               }
+       /* tpa */
+       if (p->func_flgs & FUNC_FLG_TPA)
+               tcfg.config_flags |=
+               TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
 
-               storm_memset_func_cfg(bp, &tcfg, p->func_id);
-       }
+       /* set rss flags */
+       rss_flgs = (p->rss->mode <<
+               TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
+
+       if (p->rss->cap & RSS_IPV4_CAP)
+               rss_flgs |= RSS_IPV4_CAP_MASK;
+       if (p->rss->cap & RSS_IPV4_TCP_CAP)
+               rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
+       if (p->rss->cap & RSS_IPV6_CAP)
+               rss_flgs |= RSS_IPV6_CAP_MASK;
+       if (p->rss->cap & RSS_IPV6_TCP_CAP)
+               rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
+
+       tcfg.config_flags |= rss_flgs;
+       tcfg.rss_result_mask = p->rss->result_mask;
+
+       storm_memset_func_cfg(bp, &tcfg, p->func_id);
 
        /* Enable the function in the FW */
        storm_memset_vf_to_pf(bp, p->func_id, p->pf_id);
@@ -2479,23 +2475,17 @@ void bnx2x_pf_init(struct bnx2x *bp)
        else
                flags |= FUNC_FLG_TPA;
 
+       /* function setup */
+
        /**
         * Although RSS is meaningless when there is a single HW queue we
         * still need it enabled in order to have HW Rx hash generated.
-        *
-        * if (is_eth_multi(bp))
-        *      flags |= FUNC_FLG_RSS;
         */
-       flags |= FUNC_FLG_RSS;
-
-       /* function setup */
-       if (flags & FUNC_FLG_RSS) {
-               rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
-                          RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
-               rss.mode = bp->multi_mode;
-               rss.result_mask = MULTI_MASK;
-               func_init.rss = &rss;
-       }
+       rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
+                  RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
+       rss.mode = bp->multi_mode;
+       rss.result_mask = MULTI_MASK;
+       func_init.rss = &rss;
 
        func_init.func_flgs = flags;
        func_init.pf_id = BP_FUNC(bp);
index 3bbd0aab17e813201eb51ba35f1f4990e80e7887..84134c766f3a86fca82195683be07de25cbf5fa1 100644 (file)
@@ -772,7 +772,7 @@ static int ns83820_setup_rx(struct net_device *ndev)
                phy_intr(ndev);
 
                /* Okay, let it rip */
-               spin_lock_irq(&dev->misc_lock);
+               spin_lock(&dev->misc_lock);
                dev->IMR_cache |= ISR_PHY;
                dev->IMR_cache |= ISR_RXRCMP;
                //dev->IMR_cache |= ISR_RXERR;
index 9c10c6b7c12baaded7bf6849939e1a42e16cf14f..fd9c06c6828173f42edcdaf3649fb42772c4faef 100644 (file)
@@ -288,9 +288,6 @@ static struct bearer *bearer_find(const char *name)
        struct bearer *b_ptr;
        u32 i;
 
-       if (tipc_mode != TIPC_NET_MODE)
-               return NULL;
-
        for (i = 0, b_ptr = tipc_bearers; i < MAX_BEARERS; i++, b_ptr++) {
                if (b_ptr->active && (!strcmp(b_ptr->publ.name, name)))
                        return b_ptr;
@@ -630,30 +627,17 @@ int tipc_block_bearer(const char *name)
  * Note: This routine assumes caller holds tipc_net_lock.
  */
 
-static int bearer_disable(const char *name)
+static int bearer_disable(struct bearer *b_ptr)
 {
-       struct bearer *b_ptr;
        struct link *l_ptr;
        struct link *temp_l_ptr;
 
-       b_ptr = bearer_find(name);
-       if (!b_ptr) {
-               warn("Attempt to disable unknown bearer <%s>\n", name);
-               return -EINVAL;
-       }
-
-       info("Disabling bearer <%s>\n", name);
+       info("Disabling bearer <%s>\n", b_ptr->publ.name);
        tipc_disc_stop_link_req(b_ptr->link_req);
        spin_lock_bh(&b_ptr->publ.lock);
        b_ptr->link_req = NULL;
        b_ptr->publ.blocked = 1;
-       if (b_ptr->media->disable_bearer) {
-               spin_unlock_bh(&b_ptr->publ.lock);
-               write_unlock_bh(&tipc_net_lock);
-               b_ptr->media->disable_bearer(&b_ptr->publ);
-               write_lock_bh(&tipc_net_lock);
-               spin_lock_bh(&b_ptr->publ.lock);
-       }
+       b_ptr->media->disable_bearer(&b_ptr->publ);
        list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
                tipc_link_delete(l_ptr);
        }
@@ -664,10 +648,16 @@ static int bearer_disable(const char *name)
 
 int tipc_disable_bearer(const char *name)
 {
+       struct bearer *b_ptr;
        int res;
 
        write_lock_bh(&tipc_net_lock);
-       res = bearer_disable(name);
+       b_ptr = bearer_find(name);
+       if (b_ptr == NULL) {
+               warn("Attempt to disable unknown bearer <%s>\n", name);
+               res = -EINVAL;
+       } else
+               res = bearer_disable(b_ptr);
        write_unlock_bh(&tipc_net_lock);
        return res;
 }
@@ -680,13 +670,7 @@ void tipc_bearer_stop(void)
 
        for (i = 0; i < MAX_BEARERS; i++) {
                if (tipc_bearers[i].active)
-                       tipc_bearers[i].publ.blocked = 1;
-       }
-       for (i = 0; i < MAX_BEARERS; i++) {
-               if (tipc_bearers[i].active)
-                       bearer_disable(tipc_bearers[i].publ.name);
+                       bearer_disable(&tipc_bearers[i]);
        }
        media_count = 0;
 }
-
-