aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-07-27 18:53:10 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-02 02:06:34 -0400
commitefd2e40a8cc891e8f90e0bdde000006bd6201530 (patch)
treeb1997234249f5310b350a6c44fa8c985e0c5b7ac
parent5f0b849eb35d09cd2f332d5031051c1a8976c30b (diff)
be2net: some name changes for consistency
be_mbox_db_ring() has been changed to be_mbox_notify() (to be consistent with be_mcc_notify()) and struct be_mcc_cq_entry changed to be_mcc_compl to be consistent with rx/tx_compl. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/benet/be_cmds.c62
-rw-r--r--drivers/net/benet/be_cmds.h4
-rw-r--r--drivers/net/benet/be_main.c2
3 files changed, 34 insertions, 34 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 7c1724eaf76..ebf65c78819 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -31,7 +31,7 @@ static void be_mcc_notify(struct be_adapter *adapter)
31/* To check if valid bit is set, check the entire word as we don't know 31/* To check if valid bit is set, check the entire word as we don't know
32 * the endianness of the data (old entry is host endian while a new entry is 32 * the endianness of the data (old entry is host endian while a new entry is
33 * little endian) */ 33 * little endian) */
34static inline bool be_mcc_compl_is_new(struct be_mcc_cq_entry *compl) 34static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl)
35{ 35{
36 if (compl->flags != 0) { 36 if (compl->flags != 0) {
37 compl->flags = le32_to_cpu(compl->flags); 37 compl->flags = le32_to_cpu(compl->flags);
@@ -43,13 +43,13 @@ static inline bool be_mcc_compl_is_new(struct be_mcc_cq_entry *compl)
43} 43}
44 44
45/* Need to reset the entire word that houses the valid bit */ 45/* Need to reset the entire word that houses the valid bit */
46static inline void be_mcc_compl_use(struct be_mcc_cq_entry *compl) 46static inline void be_mcc_compl_use(struct be_mcc_compl *compl)
47{ 47{
48 compl->flags = 0; 48 compl->flags = 0;
49} 49}
50 50
51static int be_mcc_compl_process(struct be_adapter *adapter, 51static int be_mcc_compl_process(struct be_adapter *adapter,
52 struct be_mcc_cq_entry *compl) 52 struct be_mcc_compl *compl)
53{ 53{
54 u16 compl_status, extd_status; 54 u16 compl_status, extd_status;
55 55
@@ -85,10 +85,10 @@ static inline bool is_link_state_evt(u32 trailer)
85 ASYNC_EVENT_CODE_LINK_STATE); 85 ASYNC_EVENT_CODE_LINK_STATE);
86} 86}
87 87
88static struct be_mcc_cq_entry *be_mcc_compl_get(struct be_adapter *adapter) 88static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter)
89{ 89{
90 struct be_queue_info *mcc_cq = &adapter->mcc_obj.cq; 90 struct be_queue_info *mcc_cq = &adapter->mcc_obj.cq;
91 struct be_mcc_cq_entry *compl = queue_tail_node(mcc_cq); 91 struct be_mcc_compl *compl = queue_tail_node(mcc_cq);
92 92
93 if (be_mcc_compl_is_new(compl)) { 93 if (be_mcc_compl_is_new(compl)) {
94 queue_tail_inc(mcc_cq); 94 queue_tail_inc(mcc_cq);
@@ -99,7 +99,7 @@ static struct be_mcc_cq_entry *be_mcc_compl_get(struct be_adapter *adapter)
99 99
100void be_process_mcc(struct be_adapter *adapter) 100void be_process_mcc(struct be_adapter *adapter)
101{ 101{
102 struct be_mcc_cq_entry *compl; 102 struct be_mcc_compl *compl;
103 int num = 0; 103 int num = 0;
104 104
105 spin_lock_bh(&adapter->mcc_cq_lock); 105 spin_lock_bh(&adapter->mcc_cq_lock);
@@ -173,16 +173,16 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
173 * Insert the mailbox address into the doorbell in two steps 173 * Insert the mailbox address into the doorbell in two steps
174 * Polls on the mbox doorbell till a command completion (or a timeout) occurs 174 * Polls on the mbox doorbell till a command completion (or a timeout) occurs
175 */ 175 */
176static int be_mbox_db_ring(struct be_adapter *adapter) 176static int be_mbox_notify(struct be_adapter *adapter)
177{ 177{
178 int status; 178 int status;
179 u32 val = 0; 179 u32 val = 0;
180 void __iomem *db = adapter->db + MPU_MAILBOX_DB_OFFSET; 180 void __iomem *db = adapter->db + MPU_MAILBOX_DB_OFFSET;
181 struct be_dma_mem *mbox_mem = &adapter->mbox_mem; 181 struct be_dma_mem *mbox_mem = &adapter->mbox_mem;
182 struct be_mcc_mailbox *mbox = mbox_mem->va; 182 struct be_mcc_mailbox *mbox = mbox_mem->va;
183 struct be_mcc_cq_entry *cqe = &mbox->cqe; 183 struct be_mcc_compl *compl = &mbox->compl;
184 184
185 memset(cqe, 0, sizeof(*cqe)); 185 memset(compl, 0, sizeof(*compl));
186 186
187 val |= MPU_MAILBOX_DB_HI_MASK; 187 val |= MPU_MAILBOX_DB_HI_MASK;
188 /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */ 188 /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
@@ -204,9 +204,9 @@ static int be_mbox_db_ring(struct be_adapter *adapter)
204 return status; 204 return status;
205 205
206 /* A cq entry has been made now */ 206 /* A cq entry has been made now */
207 if (be_mcc_compl_is_new(cqe)) { 207 if (be_mcc_compl_is_new(compl)) {
208 status = be_mcc_compl_process(adapter, &mbox->cqe); 208 status = be_mcc_compl_process(adapter, &mbox->compl);
209 be_mcc_compl_use(cqe); 209 be_mcc_compl_use(compl);
210 if (status) 210 if (status)
211 return status; 211 return status;
212 } else { 212 } else {
@@ -396,7 +396,7 @@ int be_cmd_eq_create(struct be_adapter *adapter,
396 396
397 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); 397 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
398 398
399 status = be_mbox_db_ring(adapter); 399 status = be_mbox_notify(adapter);
400 if (!status) { 400 if (!status) {
401 eq->id = le16_to_cpu(resp->eq_id); 401 eq->id = le16_to_cpu(resp->eq_id);
402 eq->created = true; 402 eq->created = true;
@@ -429,7 +429,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
429 req->permanent = 0; 429 req->permanent = 0;
430 } 430 }
431 431
432 status = be_mbox_db_ring(adapter); 432 status = be_mbox_notify(adapter);
433 if (!status) 433 if (!status)
434 memcpy(mac_addr, resp->mac.addr, ETH_ALEN); 434 memcpy(mac_addr, resp->mac.addr, ETH_ALEN);
435 435
@@ -455,7 +455,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
455 req->if_id = cpu_to_le32(if_id); 455 req->if_id = cpu_to_le32(if_id);
456 memcpy(req->mac_address, mac_addr, ETH_ALEN); 456 memcpy(req->mac_address, mac_addr, ETH_ALEN);
457 457
458 status = be_mbox_db_ring(adapter); 458 status = be_mbox_notify(adapter);
459 if (!status) { 459 if (!status) {
460 struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb); 460 struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb);
461 *pmac_id = le32_to_cpu(resp->pmac_id); 461 *pmac_id = le32_to_cpu(resp->pmac_id);
@@ -482,7 +482,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id)
482 req->if_id = cpu_to_le32(if_id); 482 req->if_id = cpu_to_le32(if_id);
483 req->pmac_id = cpu_to_le32(pmac_id); 483 req->pmac_id = cpu_to_le32(pmac_id);
484 484
485 status = be_mbox_db_ring(adapter); 485 status = be_mbox_notify(adapter);
486 spin_unlock(&adapter->mbox_lock); 486 spin_unlock(&adapter->mbox_lock);
487 487
488 return status; 488 return status;
@@ -523,7 +523,7 @@ int be_cmd_cq_create(struct be_adapter *adapter,
523 523
524 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); 524 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
525 525
526 status = be_mbox_db_ring(adapter); 526 status = be_mbox_notify(adapter);
527 if (!status) { 527 if (!status) {
528 cq->id = le16_to_cpu(resp->cq_id); 528 cq->id = le16_to_cpu(resp->cq_id);
529 cq->created = true; 529 cq->created = true;
@@ -571,7 +571,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
571 571
572 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); 572 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
573 573
574 status = be_mbox_db_ring(adapter); 574 status = be_mbox_notify(adapter);
575 if (!status) { 575 if (!status) {
576 struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb); 576 struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb);
577 mccq->id = le16_to_cpu(resp->id); 577 mccq->id = le16_to_cpu(resp->id);
@@ -618,7 +618,7 @@ int be_cmd_txq_create(struct be_adapter *adapter,
618 618
619 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem); 619 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
620 620
621 status = be_mbox_db_ring(adapter); 621 status = be_mbox_notify(adapter);
622 if (!status) { 622 if (!status) {
623 struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb); 623 struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb);
624 txq->id = le16_to_cpu(resp->cid); 624 txq->id = le16_to_cpu(resp->cid);
@@ -654,7 +654,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
654 req->max_frame_size = cpu_to_le16(max_frame_size); 654 req->max_frame_size = cpu_to_le16(max_frame_size);
655 req->rss_queue = cpu_to_le32(rss); 655 req->rss_queue = cpu_to_le32(rss);
656 656
657 status = be_mbox_db_ring(adapter); 657 status = be_mbox_notify(adapter);
658 if (!status) { 658 if (!status) {
659 struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb); 659 struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
660 rxq->id = le16_to_cpu(resp->id); 660 rxq->id = le16_to_cpu(resp->id);
@@ -706,7 +706,7 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
706 be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req)); 706 be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req));
707 req->id = cpu_to_le16(q->id); 707 req->id = cpu_to_le16(q->id);
708 708
709 status = be_mbox_db_ring(adapter); 709 status = be_mbox_notify(adapter);
710 710
711 spin_unlock(&adapter->mbox_lock); 711 spin_unlock(&adapter->mbox_lock);
712 712
@@ -734,7 +734,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac,
734 if (!pmac_invalid) 734 if (!pmac_invalid)
735 memcpy(req->mac_addr, mac, ETH_ALEN); 735 memcpy(req->mac_addr, mac, ETH_ALEN);
736 736
737 status = be_mbox_db_ring(adapter); 737 status = be_mbox_notify(adapter);
738 if (!status) { 738 if (!status) {
739 struct be_cmd_resp_if_create *resp = embedded_payload(wrb); 739 struct be_cmd_resp_if_create *resp = embedded_payload(wrb);
740 *if_handle = le32_to_cpu(resp->interface_id); 740 *if_handle = le32_to_cpu(resp->interface_id);
@@ -761,7 +761,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id)
761 OPCODE_COMMON_NTWK_INTERFACE_DESTROY, sizeof(*req)); 761 OPCODE_COMMON_NTWK_INTERFACE_DESTROY, sizeof(*req));
762 762
763 req->interface_id = cpu_to_le32(interface_id); 763 req->interface_id = cpu_to_le32(interface_id);
764 status = be_mbox_db_ring(adapter); 764 status = be_mbox_notify(adapter);
765 765
766 spin_unlock(&adapter->mbox_lock); 766 spin_unlock(&adapter->mbox_lock);
767 767
@@ -791,7 +791,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
791 sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); 791 sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
792 sge->len = cpu_to_le32(nonemb_cmd->size); 792 sge->len = cpu_to_le32(nonemb_cmd->size);
793 793
794 status = be_mbox_db_ring(adapter); 794 status = be_mbox_notify(adapter);
795 if (!status) { 795 if (!status) {
796 struct be_cmd_resp_get_stats *resp = nonemb_cmd->va; 796 struct be_cmd_resp_get_stats *resp = nonemb_cmd->va;
797 be_dws_le_to_cpu(&resp->hw_stats, sizeof(resp->hw_stats)); 797 be_dws_le_to_cpu(&resp->hw_stats, sizeof(resp->hw_stats));
@@ -818,7 +818,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter,
818 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 818 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
819 OPCODE_COMMON_NTWK_LINK_STATUS_QUERY, sizeof(*req)); 819 OPCODE_COMMON_NTWK_LINK_STATUS_QUERY, sizeof(*req));
820 820
821 status = be_mbox_db_ring(adapter); 821 status = be_mbox_notify(adapter);
822 if (!status) { 822 if (!status) {
823 struct be_cmd_resp_link_status *resp = embedded_payload(wrb); 823 struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
824 if (resp->mac_speed != PHY_LINK_SPEED_ZERO) 824 if (resp->mac_speed != PHY_LINK_SPEED_ZERO)
@@ -843,7 +843,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver)
843 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 843 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
844 OPCODE_COMMON_GET_FW_VERSION, sizeof(*req)); 844 OPCODE_COMMON_GET_FW_VERSION, sizeof(*req));
845 845
846 status = be_mbox_db_ring(adapter); 846 status = be_mbox_notify(adapter);
847 if (!status) { 847 if (!status) {
848 struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb); 848 struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb);
849 strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); 849 strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN);
@@ -873,7 +873,7 @@ int be_cmd_modify_eqd(struct be_adapter *adapter, u32 eq_id, u32 eqd)
873 req->delay[0].phase = 0; 873 req->delay[0].phase = 0;
874 req->delay[0].delay_multiplier = cpu_to_le32(eqd); 874 req->delay[0].delay_multiplier = cpu_to_le32(eqd);
875 875
876 status = be_mbox_db_ring(adapter); 876 status = be_mbox_notify(adapter);
877 877
878 spin_unlock(&adapter->mbox_lock); 878 spin_unlock(&adapter->mbox_lock);
879 return status; 879 return status;
@@ -903,7 +903,7 @@ int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
903 req->num_vlan * sizeof(vtag_array[0])); 903 req->num_vlan * sizeof(vtag_array[0]));
904 } 904 }
905 905
906 status = be_mbox_db_ring(adapter); 906 status = be_mbox_notify(adapter);
907 907
908 spin_unlock(&adapter->mbox_lock); 908 spin_unlock(&adapter->mbox_lock);
909 return status; 909 return status;
@@ -999,7 +999,7 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
999 req->tx_flow_control = cpu_to_le16((u16)tx_fc); 999 req->tx_flow_control = cpu_to_le16((u16)tx_fc);
1000 req->rx_flow_control = cpu_to_le16((u16)rx_fc); 1000 req->rx_flow_control = cpu_to_le16((u16)rx_fc);
1001 1001
1002 status = be_mbox_db_ring(adapter); 1002 status = be_mbox_notify(adapter);
1003 1003
1004 spin_unlock(&adapter->mbox_lock); 1004 spin_unlock(&adapter->mbox_lock);
1005 return status; 1005 return status;
@@ -1020,7 +1020,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
1020 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 1020 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
1021 OPCODE_COMMON_GET_FLOW_CONTROL, sizeof(*req)); 1021 OPCODE_COMMON_GET_FLOW_CONTROL, sizeof(*req));
1022 1022
1023 status = be_mbox_db_ring(adapter); 1023 status = be_mbox_notify(adapter);
1024 if (!status) { 1024 if (!status) {
1025 struct be_cmd_resp_get_flow_control *resp = 1025 struct be_cmd_resp_get_flow_control *resp =
1026 embedded_payload(wrb); 1026 embedded_payload(wrb);
@@ -1047,7 +1047,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num)
1047 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 1047 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
1048 OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req)); 1048 OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req));
1049 1049
1050 status = be_mbox_db_ring(adapter); 1050 status = be_mbox_notify(adapter);
1051 if (!status) { 1051 if (!status) {
1052 struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb); 1052 struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
1053 *port_num = le32_to_cpu(resp->phys_port); 1053 *port_num = le32_to_cpu(resp->phys_port);
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index 164ab927782..5c5de3540d2 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -69,7 +69,7 @@ enum {
69#define CQE_STATUS_EXTD_MASK 0xFFFF 69#define CQE_STATUS_EXTD_MASK 0xFFFF
70#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */ 70#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */
71 71
72struct be_mcc_cq_entry { 72struct be_mcc_compl {
73 u32 status; /* dword 0 */ 73 u32 status; /* dword 0 */
74 u32 tag0; /* dword 1 */ 74 u32 tag0; /* dword 1 */
75 u32 tag1; /* dword 2 */ 75 u32 tag1; /* dword 2 */
@@ -106,7 +106,7 @@ struct be_async_event_link_state {
106 106
107struct be_mcc_mailbox { 107struct be_mcc_mailbox {
108 struct be_mcc_wrb wrb; 108 struct be_mcc_wrb wrb;
109 struct be_mcc_cq_entry cqe; 109 struct be_mcc_compl compl;
110}; 110};
111 111
112#define CMD_SUBSYSTEM_COMMON 0x1 112#define CMD_SUBSYSTEM_COMMON 0x1
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index ab5fcc0c5b1..ef82a52f393 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1058,7 +1058,7 @@ static int be_mcc_queues_create(struct be_adapter *adapter)
1058 /* Alloc MCC compl queue */ 1058 /* Alloc MCC compl queue */
1059 cq = &adapter->mcc_obj.cq; 1059 cq = &adapter->mcc_obj.cq;
1060 if (be_queue_alloc(adapter, cq, MCC_CQ_LEN, 1060 if (be_queue_alloc(adapter, cq, MCC_CQ_LEN,
1061 sizeof(struct be_mcc_cq_entry))) 1061 sizeof(struct be_mcc_compl)))
1062 goto err; 1062 goto err;
1063 1063
1064 /* Ask BE to create MCC compl queue; share TX's eq */ 1064 /* Ask BE to create MCC compl queue; share TX's eq */