aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-09-08 02:01:03 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-10 15:48:20 -0400
commit8cc0e028eda5bc07a4b816411448065b6892e383 (patch)
tree5916d27d1b593b5f6f6c24b1d1e6a7970badebfb /drivers/net
parentf81b0ac475f617c93aeb372140b20cae267294c3 (diff)
cnic: Add function pointers to arm IRQ for different devices.
This will make it easier to exit IRQ loop and re-arm IRQ on devices that don't support FCoE. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c26
-rw-r--r--drivers/net/ethernet/broadcom/cnic.h1
2 files changed, 23 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 38be4d91783b..ac08b8ec8a24 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -3078,6 +3078,22 @@ static void cnic_ack_bnx2x_e2_msix(struct cnic_dev *dev)
3078 IGU_INT_DISABLE, 0); 3078 IGU_INT_DISABLE, 0);
3079} 3079}
3080 3080
3081static void cnic_arm_bnx2x_msix(struct cnic_dev *dev, u32 idx)
3082{
3083 struct cnic_local *cp = dev->cnic_priv;
3084
3085 cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, CSTORM_ID, idx,
3086 IGU_INT_ENABLE, 1);
3087}
3088
3089static void cnic_arm_bnx2x_e2_msix(struct cnic_dev *dev, u32 idx)
3090{
3091 struct cnic_local *cp = dev->cnic_priv;
3092
3093 cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF, idx,
3094 IGU_INT_ENABLE, 1);
3095}
3096
3081static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info) 3097static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info)
3082{ 3098{
3083 u32 last_status = *info->status_idx_ptr; 3099 u32 last_status = *info->status_idx_ptr;
@@ -3115,8 +3131,7 @@ static void cnic_service_bnx2x_bh(unsigned long data)
3115 cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); 3131 cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
3116 3132
3117 if (!BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) { 3133 if (!BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
3118 cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID, 3134 cp->arm_int(dev, status_idx);
3119 status_idx, IGU_INT_ENABLE, 1);
3120 break; 3135 break;
3121 } 3136 }
3122 3137
@@ -5520,10 +5535,13 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
5520 cp->stop_cm = cnic_cm_stop_bnx2x_hw; 5535 cp->stop_cm = cnic_cm_stop_bnx2x_hw;
5521 cp->enable_int = cnic_enable_bnx2x_int; 5536 cp->enable_int = cnic_enable_bnx2x_int;
5522 cp->disable_int_sync = cnic_disable_bnx2x_int_sync; 5537 cp->disable_int_sync = cnic_disable_bnx2x_int_sync;
5523 if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) 5538 if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
5524 cp->ack_int = cnic_ack_bnx2x_e2_msix; 5539 cp->ack_int = cnic_ack_bnx2x_e2_msix;
5525 else 5540 cp->arm_int = cnic_arm_bnx2x_e2_msix;
5541 } else {
5526 cp->ack_int = cnic_ack_bnx2x_msix; 5542 cp->ack_int = cnic_ack_bnx2x_msix;
5543 cp->arm_int = cnic_arm_bnx2x_msix;
5544 }
5527 cp->close_conn = cnic_close_bnx2x_conn; 5545 cp->close_conn = cnic_close_bnx2x_conn;
5528 return cdev; 5546 return cdev;
5529} 5547}
diff --git a/drivers/net/ethernet/broadcom/cnic.h b/drivers/net/ethernet/broadcom/cnic.h
index 30328097f516..9643e3a81a7d 100644
--- a/drivers/net/ethernet/broadcom/cnic.h
+++ b/drivers/net/ethernet/broadcom/cnic.h
@@ -334,6 +334,7 @@ struct cnic_local {
334 void (*enable_int)(struct cnic_dev *); 334 void (*enable_int)(struct cnic_dev *);
335 void (*disable_int_sync)(struct cnic_dev *); 335 void (*disable_int_sync)(struct cnic_dev *);
336 void (*ack_int)(struct cnic_dev *); 336 void (*ack_int)(struct cnic_dev *);
337 void (*arm_int)(struct cnic_dev *, u32 index);
337 void (*close_conn)(struct cnic_sock *, u32 opcode); 338 void (*close_conn)(struct cnic_sock *, u32 opcode);
338}; 339};
339 340