From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 3/5] cnic: Eliminate CNIC_PORT macro and port_mode in local struct.
Date: Mon, 2 Sep 2013 11:42:30 -0700 [thread overview]
Message-ID: <1378147352-9076-4-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1378147352-9076-3-git-send-email-mchan@broadcom.com>
Use BP_PORT and chip_port_mode directly from bnx2x.h to avoid duplication.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/cnic.c | 13 ++++++-------
drivers/net/ethernet/broadcom/cnic.h | 2 --
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 750b9a6..435a167 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1695,7 +1695,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[],
struct iscsi_context *ictx;
struct regpair context_addr;
int i, j, n = 2, n_max;
- u8 port = CNIC_PORT(cp);
+ u8 port = BP_PORT(bp);
ctx->ctx_flags = 0;
if (!req2->num_additional_wqes)
@@ -1750,7 +1750,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[],
ictx->xstorm_st_context.common.ethernet.reserved_vlan_type =
ETH_P_8021Q;
if (BNX2X_CHIP_IS_E2_PLUS(bp) &&
- cp->port_mode == CHIP_2_PORT_MODE) {
+ bp->common.chip_port_mode == CHIP_2_PORT_MODE) {
port = 0;
}
@@ -3050,8 +3050,8 @@ static irqreturn_t cnic_irq(int irq, void *dev_instance)
static inline void cnic_ack_bnx2x_int(struct cnic_dev *dev, u8 id, u8 storm,
u16 index, u8 op, u8 update)
{
- struct cnic_local *cp = dev->cnic_priv;
- u32 hc_addr = (HC_REG_COMMAND_REG + CNIC_PORT(cp) * 32 +
+ struct bnx2x *bp = netdev_priv(dev->netdev);
+ u32 hc_addr = (HC_REG_COMMAND_REG + BP_PORT(bp) * 32 +
COMMAND_REG_INT_ACK);
struct igu_ack_register igu_ack;
@@ -4231,7 +4231,7 @@ static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev)
struct cnic_local *cp = dev->cnic_priv;
struct bnx2x *bp = netdev_priv(dev->netdev);
u32 pfid = cp->pfid;
- u32 port = CNIC_PORT(cp);
+ u32 port = BP_PORT(bp);
cnic_init_bnx2x_mac(dev);
cnic_bnx2x_set_tcp_options(dev, 0, 1);
@@ -5090,7 +5090,6 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
u32 pfid;
dev->stats_addr = ethdev->addr_drv_info_to_mcp;
- cp->port_mode = bp->common.chip_port_mode;
cp->pfid = bp->pfid;
cp->func = bp->pf_num;
@@ -5190,7 +5189,7 @@ static void cnic_init_rings(struct cnic_dev *dev)
off = BAR_USTRORM_INTMEM +
(BNX2X_CHIP_IS_E2_PLUS(bp) ?
USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) :
- USTORM_RX_PRODS_E1X_OFFSET(CNIC_PORT(cp), cli));
+ USTORM_RX_PRODS_E1X_OFFSET(BP_PORT(bp), cli));
for (i = 0; i < sizeof(struct ustorm_eth_rx_producers) / 4; i++)
CNIC_WR(dev, off + i * 4, ((u32 *) &rx_prods)[i]);
diff --git a/drivers/net/ethernet/broadcom/cnic.h b/drivers/net/ethernet/broadcom/cnic.h
index 0408ae2..10531f6 100644
--- a/drivers/net/ethernet/broadcom/cnic.h
+++ b/drivers/net/ethernet/broadcom/cnic.h
@@ -304,7 +304,6 @@ struct cnic_local {
u32 chip_id;
int func;
u32 pfid;
- u8 port_mode;
u32 shmem_base;
@@ -399,7 +398,6 @@ struct bnx2x_bd_chain_next {
#define ETH_MAX_RX_CLIENTS_E2 ETH_MAX_RX_CLIENTS_E1H
#endif
-#define CNIC_PORT(cp) ((cp)->pfid & 1)
#define CNIC_FUNC(cp) ((cp)->func)
#define BNX2X_HW_CID(bp, x) ((BP_PORT(bp) << 23) | \
--
1.7.1
next prev parent reply other threads:[~2013-09-02 18:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 18:42 [PATCH net-next 0/5] cnic: Remove duplicate bnx2x definitions Michael Chan
2013-09-02 18:42 ` [PATCH net-next 1/5] cnic: Use CHIP_NUM macros from bnx2x.h Michael Chan
2013-09-02 18:42 ` [PATCH net-next 2/5] cnic: Redefine BNX2X_HW_CID using existing bnx2x macros Michael Chan
2013-09-02 18:42 ` Michael Chan [this message]
2013-09-02 18:42 ` [PATCH net-next 4/5] cnic: Eliminate local copy of pfid Michael Chan
2013-09-02 18:42 ` [PATCH net-next 5/5] cnic: Update version to 2.5.18 Michael Chan
2013-09-04 4:53 ` [PATCH net-next 0/5] cnic: Remove duplicate bnx2x definitions David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378147352-9076-4-git-send-email-mchan@broadcom.com \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).