Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265317
b: refs/heads/master
c: f3ba150
h: refs/heads/master
i:
  265315: f5ddf5e
v: v3
  • Loading branch information
David S. Miller committed Aug 18, 2011
1 parent 050e703 commit 16d5979
Show file tree
Hide file tree
Showing 29 changed files with 408 additions and 349 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 665d7eb8877c6bb777039efb22f894740be10bcb
refs/heads/master: f3ba150392c85d8175c454a7190b5fa46a49039e
3 changes: 3 additions & 0 deletions trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ config MII

source "drivers/net/phy/Kconfig"

config SUNGEM_PHY
tristate

#
# Ethernet
#
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o

obj-$(CONFIG_WIMAX) += wimax/
obj-$(CONFIG_CAIF) += caif/

obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o
67 changes: 31 additions & 36 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,73 +66,68 @@
#define BNX2X_MSG_SP 0x100000 /* was: NETIF_MSG_INTR */
#define BNX2X_MSG_FP 0x200000 /* was: NETIF_MSG_INTR */

#define DP_LEVEL KERN_NOTICE /* was: KERN_DEBUG */

/* regular debug print */
#define DP(__mask, __fmt, __args...) \
#define DP(__mask, fmt, ...) \
do { \
if (bp->msg_enable & (__mask)) \
printk(DP_LEVEL "[%s:%d(%s)]" __fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
pr_notice("[%s:%d(%s)]" fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__VA_ARGS__); \
} while (0)

#define DP_CONT(__mask, __fmt, __args...) \
#define DP_CONT(__mask, fmt, ...) \
do { \
if (bp->msg_enable & (__mask)) \
pr_cont(__fmt, ##__args); \
pr_cont(fmt, ##__VA_ARGS__); \
} while (0)

/* errors debug print */
#define BNX2X_DBG_ERR(__fmt, __args...) \
#define BNX2X_DBG_ERR(fmt, ...) \
do { \
if (netif_msg_probe(bp)) \
pr_err("[%s:%d(%s)]" __fmt, \
pr_err("[%s:%d(%s)]" fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
##__VA_ARGS__); \
} while (0)

/* for errors (never masked) */
#define BNX2X_ERR(__fmt, __args...) \
#define BNX2X_ERR(fmt, ...) \
do { \
pr_err("[%s:%d(%s)]" __fmt, \
pr_err("[%s:%d(%s)]" fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
} while (0)
##__VA_ARGS__); \
} while (0)

#define BNX2X_ERROR(__fmt, __args...) do { \
pr_err("[%s:%d]" __fmt, __func__, __LINE__, ##__args); \
} while (0)
#define BNX2X_ERROR(fmt, ...) \
pr_err("[%s:%d]" fmt, __func__, __LINE__, ##__VA_ARGS__)


/* before we have a dev->name use dev_info() */
#define BNX2X_DEV_INFO(__fmt, __args...) \
#define BNX2X_DEV_INFO(fmt, ...) \
do { \
if (netif_msg_probe(bp)) \
dev_info(&bp->pdev->dev, __fmt, ##__args); \
dev_info(&bp->pdev->dev, fmt, ##__VA_ARGS__); \
} while (0)

#define BNX2X_MAC_FMT "%pM"
#define BNX2X_MAC_PRN_LIST(mac) (mac)


#ifdef BNX2X_STOP_ON_ERROR
void bnx2x_int_disable(struct bnx2x *bp);
#define bnx2x_panic() do { \
bp->panic = 1; \
BNX2X_ERR("driver assert\n"); \
bnx2x_int_disable(bp); \
bnx2x_panic_dump(bp); \
} while (0)
#define bnx2x_panic() \
do { \
bp->panic = 1; \
BNX2X_ERR("driver assert\n"); \
bnx2x_int_disable(bp); \
bnx2x_panic_dump(bp); \
} while (0)
#else
#define bnx2x_panic() do { \
bp->panic = 1; \
BNX2X_ERR("driver assert\n"); \
bnx2x_panic_dump(bp); \
} while (0)
#define bnx2x_panic() \
do { \
bp->panic = 1; \
BNX2X_ERR("driver assert\n"); \
bnx2x_panic_dump(bp); \
} while (0)
#endif

#define bnx2x_mc_addr(ha) ((ha)->addr)
Expand Down
48 changes: 27 additions & 21 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -953,15 +955,16 @@ void __bnx2x_link_report(struct bnx2x *bp)
netdev_err(bp->dev, "NIC Link is Down\n");
return;
} else {
const char *duplex;
const char *flow;

netif_carrier_on(bp->dev);
netdev_info(bp->dev, "NIC Link is Up, ");
pr_cont("%d Mbps ", cur_data.line_speed);

if (test_and_clear_bit(BNX2X_LINK_REPORT_FD,
&cur_data.link_report_flags))
pr_cont("full duplex");
duplex = "full";
else
pr_cont("half duplex");
duplex = "half";

/* Handle the FC at the end so that only these flags would be
* possibly set. This way we may easily check if there is no FC
Expand All @@ -970,16 +973,19 @@ void __bnx2x_link_report(struct bnx2x *bp)
if (cur_data.link_report_flags) {
if (test_bit(BNX2X_LINK_REPORT_RX_FC_ON,
&cur_data.link_report_flags)) {
pr_cont(", receive ");
if (test_bit(BNX2X_LINK_REPORT_TX_FC_ON,
&cur_data.link_report_flags))
pr_cont("& transmit ");
flow = "ON - receive & transmit";
else
flow = "ON - receive";
} else {
pr_cont(", transmit ");
flow = "ON - transmit";
}
pr_cont("flow control ON");
} else {
flow = "none";
}
pr_cont("\n");
netdev_info(bp->dev, "NIC Link is Up, %d Mbps %s duplex, Flow control: %s\n",
cur_data.line_speed, duplex, flow);
}
}

Expand Down Expand Up @@ -2584,7 +2590,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
#endif

/* enable this debug print to view the transmission queue being used
DP(BNX2X_MSG_FP, "indices: txq %d, fp %d, txdata %d",
DP(BNX2X_MSG_FP, "indices: txq %d, fp %d, txdata %d\n",
txq_index, fp_index, txdata_index); */

/* locate the fastpath and the txdata */
Expand All @@ -2593,7 +2599,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)

/* enable this debug print to view the tranmission details
DP(BNX2X_MSG_FP,"transmitting packet cid %d fp index %d txdata_index %d"
" tx_data ptr %p fp pointer %p",
" tx_data ptr %p fp pointer %p\n",
txdata->cid, fp_index, txdata_index, txdata, fp); */

if (unlikely(bnx2x_tx_avail(bp, txdata) <
Expand Down Expand Up @@ -2910,22 +2916,22 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
/* requested to support too many traffic classes */
if (num_tc > bp->max_cos) {
DP(NETIF_MSG_TX_ERR, "support for too many traffic classes"
" requested: %d. max supported is %d",
" requested: %d. max supported is %d\n",
num_tc, bp->max_cos);
return -EINVAL;
}

/* declare amount of supported traffic classes */
if (netdev_set_num_tc(dev, num_tc)) {
DP(NETIF_MSG_TX_ERR, "failed to declare %d traffic classes",
DP(NETIF_MSG_TX_ERR, "failed to declare %d traffic classes\n",
num_tc);
return -EINVAL;
}

/* configure priority to traffic class mapping */
for (prio = 0; prio < BNX2X_MAX_PRIORITY; prio++) {
netdev_set_prio_tc_map(dev, prio, bp->prio_to_cos[prio]);
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d",
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d\n",
prio, bp->prio_to_cos[prio]);
}

Expand All @@ -2934,18 +2940,18 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
This can be used for ets or pfc, and save the effort of setting
up a multio class queue disc or negotiating DCBX with a switch
netdev_set_prio_tc_map(dev, 0, 0);
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d", 0, 0);
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d\n", 0, 0);
for (prio = 1; prio < 16; prio++) {
netdev_set_prio_tc_map(dev, prio, 1);
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d", prio, 1);
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d\n", prio, 1);
} */

/* configure traffic class to transmission queue mapping */
for (cos = 0; cos < bp->max_cos; cos++) {
count = BNX2X_NUM_ETH_QUEUES(bp);
offset = cos * MAX_TXQS_PER_COS;
netdev_set_tc_queue(dev, cos, count, offset);
DP(BNX2X_MSG_SP, "mapping tc %d to offset %d count %d",
DP(BNX2X_MSG_SP, "mapping tc %d to offset %d count %d\n",
cos, offset, count);
}

Expand Down Expand Up @@ -3033,7 +3039,7 @@ static void bnx2x_free_fp_mem_at(struct bnx2x *bp, int fp_index)
struct bnx2x_fp_txdata *txdata = &fp->txdata[cos];

DP(BNX2X_MSG_SP,
"freeing tx memory of fp %d cos %d cid %d",
"freeing tx memory of fp %d cos %d cid %d\n",
fp_index, cos, txdata->cid);

BNX2X_FREE(txdata->tx_buf_ring);
Expand Down Expand Up @@ -3115,7 +3121,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
struct bnx2x_fp_txdata *txdata = &fp->txdata[cos];

DP(BNX2X_MSG_SP, "allocating tx memory of "
"fp %d cos %d",
"fp %d cos %d\n",
index, cos);

BNX2X_ALLOC(txdata->tx_buf_ring,
Expand Down Expand Up @@ -3365,7 +3371,7 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
struct bnx2x *bp = netdev_priv(dev);

if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
printk(KERN_ERR "Handling parity error recovery. Try again later\n");
pr_err("Handling parity error recovery. Try again later\n");
return -EAGAIN;
}

Expand Down Expand Up @@ -3491,7 +3497,7 @@ int bnx2x_resume(struct pci_dev *pdev)
bp = netdev_priv(dev);

if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
printk(KERN_ERR "Handling parity error recovery. Try again later\n");
pr_err("Handling parity error recovery. Try again later\n");
return -EAGAIN;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp,
txdata->txq_index = txq_index;
txdata->tx_cons_sb = tx_cons_sb;

DP(BNX2X_MSG_SP, "created tx data cid %d, txq %d",
DP(BNX2X_MSG_SP, "created tx data cid %d, txq %d\n",
txdata->cid, txdata->txq_index);
}

Expand Down Expand Up @@ -1333,7 +1333,7 @@ static inline void bnx2x_init_fcoe_fp(struct bnx2x *bp)
bnx2x_init_txdata(bp, &bnx2x_fcoe(bp, txdata[0]),
fp->cid, FCOE_TXQ_IDX(bp), BNX2X_FCOE_L2_TX_INDEX);

DP(BNX2X_MSG_SP, "created fcoe tx data (fp index %d)", fp->index);
DP(BNX2X_MSG_SP, "created fcoe tx data (fp index %d)\n", fp->index);

/* qZone id equals to FW (per path) client id */
bnx2x_fcoe(bp, cl_qzone_id) = bnx2x_fp_qzone_id(fp);
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* Written by: Dmitry Kravkov
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/errno.h>
Expand Down Expand Up @@ -350,7 +353,7 @@ static void bnx2x_dcbx_map_nw(struct bnx2x *bp)
if (cos_params[i].pri_bitmask & nw_prio) {
/* extend the bitmask with unmapped */
DP(NETIF_MSG_LINK,
"cos %d extended with 0x%08x", i, unmapped);
"cos %d extended with 0x%08x\n", i, unmapped);
cos_params[i].pri_bitmask |= unmapped;
break;
}
Expand Down
Loading

0 comments on commit 16d5979

Please sign in to comment.