aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade
diff options
context:
space:
mode:
authorJing Huang <huangj@Brocade.COM>2012-04-04 01:44:14 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-04 18:19:18 -0400
commitb3cc6e88d5346b89275b150ecd1281628f058498 (patch)
tree05974c496c520e62163e63eb279f883d0f9513d9 /drivers/net/ethernet/brocade
parentd95d1081c3c3ed70a72b47cd578830c85c55da2e (diff)
bna: Function name changes and cleanups
Renamed following functions: bnad_cleanup_tx to bnad_destroy_tx bnad_free_all_txbufs to bnad_txq_cleanup bnad_free_txbufs to bnad_txcmpl_process bnad_tx to bnad_tx_complete bnad_cleanup_rx to bnad_destroy_rx bnad_reset_rcb to bnad_rcb_cleanup bnad_free_all_rxbufs to bnad_rxq_cleanup bnad_cq_cmpl_init to bnad_cq_cleanup bnad_alloc_n_post_rxbufs to bnad_rxq_post bnad_poll_cq to bnad_cq_process Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade')
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c54
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.h4
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad_ethtool.c6
3 files changed, 32 insertions, 32 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index f1103e6f31c1..25c4e7f2a099 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -101,7 +101,7 @@ bnad_remove_from_list(struct bnad *bnad)
101 * Reinitialize completions in CQ, once Rx is taken down 101 * Reinitialize completions in CQ, once Rx is taken down
102 */ 102 */
103static void 103static void
104bnad_cq_cmpl_init(struct bnad *bnad, struct bna_ccb *ccb) 104bnad_cq_cleanup(struct bnad *bnad, struct bna_ccb *ccb)
105{ 105{
106 struct bna_cq_entry *cmpl, *next_cmpl; 106 struct bna_cq_entry *cmpl, *next_cmpl;
107 unsigned int wi_range, wis = 0, ccb_prod = 0; 107 unsigned int wi_range, wis = 0, ccb_prod = 0;
@@ -154,7 +154,7 @@ bnad_pci_unmap_skb(struct device *pdev, struct bnad_skb_unmap *array,
154 * so DMA unmap & freeing is fine. 154 * so DMA unmap & freeing is fine.
155 */ 155 */
156static void 156static void
157bnad_free_all_txbufs(struct bnad *bnad, 157bnad_txq_cleanup(struct bnad *bnad,
158 struct bna_tcb *tcb) 158 struct bna_tcb *tcb)
159{ 159{
160 u32 unmap_cons; 160 u32 unmap_cons;
@@ -182,12 +182,12 @@ bnad_free_all_txbufs(struct bnad *bnad,
182/* Data Path Handlers */ 182/* Data Path Handlers */
183 183
184/* 184/*
185 * bnad_free_txbufs : Frees the Tx bufs on Tx completion 185 * bnad_txcmpl_process : Frees the Tx bufs on Tx completion
186 * Can be called in a) Interrupt context 186 * Can be called in a) Interrupt context
187 * b) Sending context 187 * b) Sending context
188 */ 188 */
189static u32 189static u32
190bnad_free_txbufs(struct bnad *bnad, 190bnad_txcmpl_process(struct bnad *bnad,
191 struct bna_tcb *tcb) 191 struct bna_tcb *tcb)
192{ 192{
193 u32 unmap_cons, sent_packets = 0, sent_bytes = 0; 193 u32 unmap_cons, sent_packets = 0, sent_bytes = 0;
@@ -236,7 +236,7 @@ bnad_free_txbufs(struct bnad *bnad,
236} 236}
237 237
238static u32 238static u32
239bnad_tx(struct bnad *bnad, struct bna_tcb *tcb) 239bnad_tx_complete(struct bnad *bnad, struct bna_tcb *tcb)
240{ 240{
241 struct net_device *netdev = bnad->netdev; 241 struct net_device *netdev = bnad->netdev;
242 u32 sent = 0; 242 u32 sent = 0;
@@ -244,7 +244,7 @@ bnad_tx(struct bnad *bnad, struct bna_tcb *tcb)
244 if (test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) 244 if (test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags))
245 return 0; 245 return 0;
246 246
247 sent = bnad_free_txbufs(bnad, tcb); 247 sent = bnad_txcmpl_process(bnad, tcb);
248 if (sent) { 248 if (sent) {
249 if (netif_queue_stopped(netdev) && 249 if (netif_queue_stopped(netdev) &&
250 netif_carrier_ok(netdev) && 250 netif_carrier_ok(netdev) &&
@@ -273,13 +273,13 @@ bnad_msix_tx(int irq, void *data)
273 struct bna_tcb *tcb = (struct bna_tcb *)data; 273 struct bna_tcb *tcb = (struct bna_tcb *)data;
274 struct bnad *bnad = tcb->bnad; 274 struct bnad *bnad = tcb->bnad;
275 275
276 bnad_tx(bnad, tcb); 276 bnad_tx_complete(bnad, tcb);
277 277
278 return IRQ_HANDLED; 278 return IRQ_HANDLED;
279} 279}
280 280
281static void 281static void
282bnad_reset_rcb(struct bnad *bnad, struct bna_rcb *rcb) 282bnad_rcb_cleanup(struct bnad *bnad, struct bna_rcb *rcb)
283{ 283{
284 struct bnad_unmap_q *unmap_q = rcb->unmap_q; 284 struct bnad_unmap_q *unmap_q = rcb->unmap_q;
285 285
@@ -291,7 +291,7 @@ bnad_reset_rcb(struct bnad *bnad, struct bna_rcb *rcb)
291} 291}
292 292
293static void 293static void
294bnad_free_all_rxbufs(struct bnad *bnad, struct bna_rcb *rcb) 294bnad_rxq_cleanup(struct bnad *bnad, struct bna_rcb *rcb)
295{ 295{
296 struct bnad_unmap_q *unmap_q; 296 struct bnad_unmap_q *unmap_q;
297 struct bnad_skb_unmap *unmap_array; 297 struct bnad_skb_unmap *unmap_array;
@@ -312,11 +312,11 @@ bnad_free_all_rxbufs(struct bnad *bnad, struct bna_rcb *rcb)
312 DMA_FROM_DEVICE); 312 DMA_FROM_DEVICE);
313 dev_kfree_skb(skb); 313 dev_kfree_skb(skb);
314 } 314 }
315 bnad_reset_rcb(bnad, rcb); 315 bnad_rcb_cleanup(bnad, rcb);
316} 316}
317 317
318static void 318static void
319bnad_alloc_n_post_rxbufs(struct bnad *bnad, struct bna_rcb *rcb) 319bnad_rxq_post(struct bnad *bnad, struct bna_rcb *rcb)
320{ 320{
321 u16 to_alloc, alloced, unmap_prod, wi_range; 321 u16 to_alloc, alloced, unmap_prod, wi_range;
322 struct bnad_unmap_q *unmap_q = rcb->unmap_q; 322 struct bnad_unmap_q *unmap_q = rcb->unmap_q;
@@ -377,14 +377,14 @@ bnad_refill_rxq(struct bnad *bnad, struct bna_rcb *rcb)
377 if (!test_and_set_bit(BNAD_RXQ_REFILL, &rcb->flags)) { 377 if (!test_and_set_bit(BNAD_RXQ_REFILL, &rcb->flags)) {
378 if (BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth) 378 if (BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth)
379 >> BNAD_RXQ_REFILL_THRESHOLD_SHIFT) 379 >> BNAD_RXQ_REFILL_THRESHOLD_SHIFT)
380 bnad_alloc_n_post_rxbufs(bnad, rcb); 380 bnad_rxq_post(bnad, rcb);
381 smp_mb__before_clear_bit(); 381 smp_mb__before_clear_bit();
382 clear_bit(BNAD_RXQ_REFILL, &rcb->flags); 382 clear_bit(BNAD_RXQ_REFILL, &rcb->flags);
383 } 383 }
384} 384}
385 385
386static u32 386static u32
387bnad_poll_cq(struct bnad *bnad, struct bna_ccb *ccb, int budget) 387bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget)
388{ 388{
389 struct bna_cq_entry *cmpl, *next_cmpl; 389 struct bna_cq_entry *cmpl, *next_cmpl;
390 struct bna_rcb *rcb = NULL; 390 struct bna_rcb *rcb = NULL;
@@ -584,7 +584,7 @@ bnad_isr(int irq, void *data)
584 for (j = 0; j < bnad->num_txq_per_tx; j++) { 584 for (j = 0; j < bnad->num_txq_per_tx; j++) {
585 tcb = bnad->tx_info[i].tcb[j]; 585 tcb = bnad->tx_info[i].tcb[j];
586 if (tcb && test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)) 586 if (tcb && test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))
587 bnad_tx(bnad, bnad->tx_info[i].tcb[j]); 587 bnad_tx_complete(bnad, bnad->tx_info[i].tcb[j]);
588 } 588 }
589 } 589 }
590 /* Rx processing */ 590 /* Rx processing */
@@ -895,7 +895,7 @@ bnad_tx_cleanup(struct delayed_work *work)
895 continue; 895 continue;
896 } 896 }
897 897
898 bnad_free_all_txbufs(bnad, tcb); 898 bnad_txq_cleanup(bnad, tcb);
899 899
900 unmap_q = tcb->unmap_q; 900 unmap_q = tcb->unmap_q;
901 unmap_q->producer_index = 0; 901 unmap_q->producer_index = 0;
@@ -981,10 +981,10 @@ bnad_rx_cleanup(void *work)
981 */ 981 */
982 napi_disable(&rx_ctrl->napi); 982 napi_disable(&rx_ctrl->napi);
983 983
984 bnad_cq_cmpl_init(bnad, rx_ctrl->ccb); 984 bnad_cq_cleanup(bnad, rx_ctrl->ccb);
985 bnad_free_all_rxbufs(bnad, rx_ctrl->ccb->rcb[0]); 985 bnad_rxq_cleanup(bnad, rx_ctrl->ccb->rcb[0]);
986 if (rx_ctrl->ccb->rcb[1]) 986 if (rx_ctrl->ccb->rcb[1])
987 bnad_free_all_rxbufs(bnad, rx_ctrl->ccb->rcb[1]); 987 bnad_rxq_cleanup(bnad, rx_ctrl->ccb->rcb[1]);
988 } 988 }
989 989
990 spin_lock_irqsave(&bnad->bna_lock, flags); 990 spin_lock_irqsave(&bnad->bna_lock, flags);
@@ -1048,7 +1048,7 @@ bnad_cb_rx_post(struct bnad *bnad, struct bna_rx *rx)
1048 if (!test_and_set_bit(BNAD_RXQ_REFILL, &rcb->flags)) { 1048 if (!test_and_set_bit(BNAD_RXQ_REFILL, &rcb->flags)) {
1049 if (BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth) 1049 if (BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth)
1050 >> BNAD_RXQ_REFILL_THRESHOLD_SHIFT) 1050 >> BNAD_RXQ_REFILL_THRESHOLD_SHIFT)
1051 bnad_alloc_n_post_rxbufs(bnad, rcb); 1051 bnad_rxq_post(bnad, rcb);
1052 smp_mb__before_clear_bit(); 1052 smp_mb__before_clear_bit();
1053 clear_bit(BNAD_RXQ_REFILL, &rcb->flags); 1053 clear_bit(BNAD_RXQ_REFILL, &rcb->flags);
1054 } 1054 }
@@ -1672,7 +1672,7 @@ bnad_napi_poll_rx(struct napi_struct *napi, int budget)
1672 if (!netif_carrier_ok(bnad->netdev)) 1672 if (!netif_carrier_ok(bnad->netdev))
1673 goto poll_exit; 1673 goto poll_exit;
1674 1674
1675 rcvd = bnad_poll_cq(bnad, rx_ctrl->ccb, budget); 1675 rcvd = bnad_cq_process(bnad, rx_ctrl->ccb, budget);
1676 if (rcvd >= budget) 1676 if (rcvd >= budget)
1677 return rcvd; 1677 return rcvd;
1678 1678
@@ -1714,7 +1714,7 @@ bnad_napi_delete(struct bnad *bnad, u32 rx_id)
1714 1714
1715/* Should be held with conf_lock held */ 1715/* Should be held with conf_lock held */
1716void 1716void
1717bnad_cleanup_tx(struct bnad *bnad, u32 tx_id) 1717bnad_destroy_tx(struct bnad *bnad, u32 tx_id)
1718{ 1718{
1719 struct bnad_tx_info *tx_info = &bnad->tx_info[tx_id]; 1719 struct bnad_tx_info *tx_info = &bnad->tx_info[tx_id];
1720 struct bna_res_info *res_info = &bnad->tx_res_info[tx_id].res_info[0]; 1720 struct bna_res_info *res_info = &bnad->tx_res_info[tx_id].res_info[0];
@@ -1865,7 +1865,7 @@ bnad_rx_ctrl_init(struct bnad *bnad, u32 rx_id)
1865 1865
1866/* Called with mutex_lock(&bnad->conf_mutex) held */ 1866/* Called with mutex_lock(&bnad->conf_mutex) held */
1867void 1867void
1868bnad_cleanup_rx(struct bnad *bnad, u32 rx_id) 1868bnad_destroy_rx(struct bnad *bnad, u32 rx_id)
1869{ 1869{
1870 struct bnad_rx_info *rx_info = &bnad->rx_info[rx_id]; 1870 struct bnad_rx_info *rx_info = &bnad->rx_info[rx_id];
1871 struct bna_rx_config *rx_config = &bnad->rx_config[rx_id]; 1871 struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
@@ -2003,7 +2003,7 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_id)
2003 return 0; 2003 return 0;
2004 2004
2005err_return: 2005err_return:
2006 bnad_cleanup_rx(bnad, rx_id); 2006 bnad_destroy_rx(bnad, rx_id);
2007 return err; 2007 return err;
2008} 2008}
2009 2009
@@ -2488,7 +2488,7 @@ bnad_open(struct net_device *netdev)
2488 return 0; 2488 return 0;
2489 2489
2490cleanup_tx: 2490cleanup_tx:
2491 bnad_cleanup_tx(bnad, 0); 2491 bnad_destroy_tx(bnad, 0);
2492 2492
2493err_return: 2493err_return:
2494 mutex_unlock(&bnad->conf_mutex); 2494 mutex_unlock(&bnad->conf_mutex);
@@ -2515,8 +2515,8 @@ bnad_stop(struct net_device *netdev)
2515 2515
2516 wait_for_completion(&bnad->bnad_completions.enet_comp); 2516 wait_for_completion(&bnad->bnad_completions.enet_comp);
2517 2517
2518 bnad_cleanup_tx(bnad, 0); 2518 bnad_destroy_tx(bnad, 0);
2519 bnad_cleanup_rx(bnad, 0); 2519 bnad_destroy_rx(bnad, 0);
2520 2520
2521 /* Synchronize mailbox IRQ */ 2521 /* Synchronize mailbox IRQ */
2522 bnad_mbox_irq_sync(bnad); 2522 bnad_mbox_irq_sync(bnad);
@@ -2589,7 +2589,7 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
2589 if ((u16) (*tcb->hw_consumer_index) != 2589 if ((u16) (*tcb->hw_consumer_index) !=
2590 tcb->consumer_index && 2590 tcb->consumer_index &&
2591 !test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) { 2591 !test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) {
2592 acked = bnad_free_txbufs(bnad, tcb); 2592 acked = bnad_txcmpl_process(bnad, tcb);
2593 if (likely(test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))) 2593 if (likely(test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)))
2594 bna_ib_ack(tcb->i_dbell, acked); 2594 bna_ib_ack(tcb->i_dbell, acked);
2595 smp_mb__before_clear_bit(); 2595 smp_mb__before_clear_bit();
diff --git a/drivers/net/ethernet/brocade/bna/bnad.h b/drivers/net/ethernet/brocade/bna/bnad.h
index cf1d3bad01b6..d73967a1450e 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.h
+++ b/drivers/net/ethernet/brocade/bna/bnad.h
@@ -373,8 +373,8 @@ extern void bnad_rx_coalescing_timeo_set(struct bnad *bnad);
373 373
374extern int bnad_setup_rx(struct bnad *bnad, u32 rx_id); 374extern int bnad_setup_rx(struct bnad *bnad, u32 rx_id);
375extern int bnad_setup_tx(struct bnad *bnad, u32 tx_id); 375extern int bnad_setup_tx(struct bnad *bnad, u32 tx_id);
376extern void bnad_cleanup_tx(struct bnad *bnad, u32 tx_id); 376extern void bnad_destroy_tx(struct bnad *bnad, u32 tx_id);
377extern void bnad_cleanup_rx(struct bnad *bnad, u32 rx_id); 377extern void bnad_destroy_rx(struct bnad *bnad, u32 rx_id);
378 378
379/* Timer start/stop protos */ 379/* Timer start/stop protos */
380extern void bnad_dim_timer_start(struct bnad *bnad); 380extern void bnad_dim_timer_start(struct bnad *bnad);
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
index ab753d7334a6..40e1e84f4984 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
@@ -464,7 +464,7 @@ bnad_set_ringparam(struct net_device *netdev,
464 for (i = 0; i < bnad->num_rx; i++) { 464 for (i = 0; i < bnad->num_rx; i++) {
465 if (!bnad->rx_info[i].rx) 465 if (!bnad->rx_info[i].rx)
466 continue; 466 continue;
467 bnad_cleanup_rx(bnad, i); 467 bnad_destroy_rx(bnad, i);
468 current_err = bnad_setup_rx(bnad, i); 468 current_err = bnad_setup_rx(bnad, i);
469 if (current_err && !err) 469 if (current_err && !err)
470 err = current_err; 470 err = current_err;
@@ -492,7 +492,7 @@ bnad_set_ringparam(struct net_device *netdev,
492 for (i = 0; i < bnad->num_tx; i++) { 492 for (i = 0; i < bnad->num_tx; i++) {
493 if (!bnad->tx_info[i].tx) 493 if (!bnad->tx_info[i].tx)
494 continue; 494 continue;
495 bnad_cleanup_tx(bnad, i); 495 bnad_destroy_tx(bnad, i);
496 current_err = bnad_setup_tx(bnad, i); 496 current_err = bnad_setup_tx(bnad, i);
497 if (current_err && !err) 497 if (current_err && !err)
498 err = current_err; 498 err = current_err;
@@ -539,7 +539,7 @@ bnad_set_pauseparam(struct net_device *netdev,
539} 539}
540 540
541static void 541static void
542bnad_get_strings(struct net_device *netdev, u32 stringset, u8 * string) 542bnad_get_strings(struct net_device *netdev, u32 stringset, u8 *string)
543{ 543{
544 struct bnad *bnad = netdev_priv(netdev); 544 struct bnad *bnad = netdev_priv(netdev);
545 int i, j, q_num; 545 int i, j, q_num;