diff options
author | Rasesh Mody <rmody@brocade.com> | 2011-07-22 04:07:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-22 20:01:13 -0400 |
commit | 8811e267d0443af9caca6f127d62c0119c96314f (patch) | |
tree | ca94d671f33febd81246012653d4dc6b2844053c /drivers/net/bna/bnad.c | |
parent | ac51f60f50f742745b316d51bd12fcada5e7778d (diff) |
bna: Minor IRQ Index and Definition Change
Change details:
- Always set mbox irq index to zero and make corresponding changes in mbox
irq alloc/sync function and txrx irq index calculation. Add definition of
BNAD_INTX_TX_IB_BITMASK & BNAD_INTX_RX_IB_BITMASK and update
bnad_txrx_irq_alloc accordingly.
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bna/bnad.c')
-rw-r--r-- | drivers/net/bna/bnad.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index dd771562e31e..00273e5b70bf 100644 --- a/drivers/net/bna/bnad.c +++ b/drivers/net/bna/bnad.c | |||
@@ -60,7 +60,7 @@ static const u8 bnad_bcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | |||
60 | 60 | ||
61 | #define BNAD_GET_MBOX_IRQ(_bnad) \ | 61 | #define BNAD_GET_MBOX_IRQ(_bnad) \ |
62 | (((_bnad)->cfg_flags & BNAD_CF_MSIX) ? \ | 62 | (((_bnad)->cfg_flags & BNAD_CF_MSIX) ? \ |
63 | ((_bnad)->msix_table[(_bnad)->msix_num - 1].vector) : \ | 63 | ((_bnad)->msix_table[BNAD_MAILBOX_MSIX_INDEX].vector) : \ |
64 | ((_bnad)->pcidev->irq)) | 64 | ((_bnad)->pcidev->irq)) |
65 | 65 | ||
66 | #define BNAD_FILL_UNMAPQ_MEM_REQ(_res_info, _num, _depth) \ | 66 | #define BNAD_FILL_UNMAPQ_MEM_REQ(_res_info, _num, _depth) \ |
@@ -1116,17 +1116,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad, | |||
1116 | spin_lock_irqsave(&bnad->bna_lock, flags); | 1116 | spin_lock_irqsave(&bnad->bna_lock, flags); |
1117 | if (bnad->cfg_flags & BNAD_CF_MSIX) { | 1117 | if (bnad->cfg_flags & BNAD_CF_MSIX) { |
1118 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; | 1118 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; |
1119 | irq = bnad->msix_table[bnad->msix_num - 1].vector; | 1119 | irq = bnad->msix_table[BNAD_MAILBOX_MSIX_INDEX].vector; |
1120 | irq_flags = 0; | 1120 | irq_flags = 0; |
1121 | intr_info->intr_type = BNA_INTR_T_MSIX; | 1121 | intr_info->intr_type = BNA_INTR_T_MSIX; |
1122 | intr_info->idl[0].vector = bnad->msix_num - 1; | 1122 | intr_info->idl[0].vector = BNAD_MAILBOX_MSIX_INDEX; |
1123 | } else { | 1123 | } else { |
1124 | irq_handler = (irq_handler_t)bnad_isr; | 1124 | irq_handler = (irq_handler_t)bnad_isr; |
1125 | irq = bnad->pcidev->irq; | 1125 | irq = bnad->pcidev->irq; |
1126 | irq_flags = IRQF_SHARED; | 1126 | irq_flags = IRQF_SHARED; |
1127 | intr_info->intr_type = BNA_INTR_T_INTX; | 1127 | intr_info->intr_type = BNA_INTR_T_INTX; |
1128 | /* intr_info->idl.vector = 0 ? */ | ||
1129 | } | 1128 | } |
1129 | |||
1130 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 1130 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
1131 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); | 1131 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); |
1132 | 1132 | ||
@@ -1179,11 +1179,12 @@ bnad_txrx_irq_alloc(struct bnad *bnad, enum bnad_intr_source src, | |||
1179 | 1179 | ||
1180 | switch (src) { | 1180 | switch (src) { |
1181 | case BNAD_INTR_TX: | 1181 | case BNAD_INTR_TX: |
1182 | vector_start = txrx_id; | 1182 | vector_start = BNAD_MAILBOX_MSIX_VECTORS + txrx_id; |
1183 | break; | 1183 | break; |
1184 | 1184 | ||
1185 | case BNAD_INTR_RX: | 1185 | case BNAD_INTR_RX: |
1186 | vector_start = bnad->num_tx * bnad->num_txq_per_tx + | 1186 | vector_start = BNAD_MAILBOX_MSIX_VECTORS + |
1187 | (bnad->num_tx * bnad->num_txq_per_tx) + | ||
1187 | txrx_id; | 1188 | txrx_id; |
1188 | break; | 1189 | break; |
1189 | 1190 | ||
@@ -1204,11 +1205,11 @@ bnad_txrx_irq_alloc(struct bnad *bnad, enum bnad_intr_source src, | |||
1204 | 1205 | ||
1205 | switch (src) { | 1206 | switch (src) { |
1206 | case BNAD_INTR_TX: | 1207 | case BNAD_INTR_TX: |
1207 | intr_info->idl[0].vector = 0x1; /* Bit mask : Tx IB */ | 1208 | intr_info->idl[0].vector = BNAD_INTX_TX_IB_BITMASK; |
1208 | break; | 1209 | break; |
1209 | 1210 | ||
1210 | case BNAD_INTR_RX: | 1211 | case BNAD_INTR_RX: |
1211 | intr_info->idl[0].vector = 0x2; /* Bit mask : Rx IB */ | 1212 | intr_info->idl[0].vector = BNAD_INTX_RX_IB_BITMASK; |
1212 | break; | 1213 | break; |
1213 | } | 1214 | } |
1214 | } | 1215 | } |
@@ -2075,7 +2076,7 @@ bnad_mbox_irq_sync(struct bnad *bnad) | |||
2075 | 2076 | ||
2076 | spin_lock_irqsave(&bnad->bna_lock, flags); | 2077 | spin_lock_irqsave(&bnad->bna_lock, flags); |
2077 | if (bnad->cfg_flags & BNAD_CF_MSIX) | 2078 | if (bnad->cfg_flags & BNAD_CF_MSIX) |
2078 | irq = bnad->msix_table[bnad->msix_num - 1].vector; | 2079 | irq = bnad->msix_table[BNAD_MAILBOX_MSIX_INDEX].vector; |
2079 | else | 2080 | else |
2080 | irq = bnad->pcidev->irq; | 2081 | irq = bnad->pcidev->irq; |
2081 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 2082 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |