Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159291
b: refs/heads/master
c: efd2e40
h: refs/heads/master
i:
  159289: 7232290
  159287: a32eac9
v: v3
  • Loading branch information
Sathya Perla authored and David S. Miller committed Aug 2, 2009
1 parent 9adff5e commit 73f7a5e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f0b849eb35d09cd2f332d5031051c1a8976c30b
refs/heads/master: efd2e40a8cc891e8f90e0bdde000006bd6201530
62 changes: 31 additions & 31 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void be_mcc_notify(struct be_adapter *adapter)
/* To check if valid bit is set, check the entire word as we don't know
* the endianness of the data (old entry is host endian while a new entry is
* little endian) */
static inline bool be_mcc_compl_is_new(struct be_mcc_cq_entry *compl)
static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl)
{
if (compl->flags != 0) {
compl->flags = le32_to_cpu(compl->flags);
Expand All @@ -43,13 +43,13 @@ static inline bool be_mcc_compl_is_new(struct be_mcc_cq_entry *compl)
}

/* Need to reset the entire word that houses the valid bit */
static inline void be_mcc_compl_use(struct be_mcc_cq_entry *compl)
static inline void be_mcc_compl_use(struct be_mcc_compl *compl)
{
compl->flags = 0;
}

static int be_mcc_compl_process(struct be_adapter *adapter,
struct be_mcc_cq_entry *compl)
struct be_mcc_compl *compl)
{
u16 compl_status, extd_status;

Expand Down Expand Up @@ -85,10 +85,10 @@ static inline bool is_link_state_evt(u32 trailer)
ASYNC_EVENT_CODE_LINK_STATE);
}

static struct be_mcc_cq_entry *be_mcc_compl_get(struct be_adapter *adapter)
static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter)
{
struct be_queue_info *mcc_cq = &adapter->mcc_obj.cq;
struct be_mcc_cq_entry *compl = queue_tail_node(mcc_cq);
struct be_mcc_compl *compl = queue_tail_node(mcc_cq);

if (be_mcc_compl_is_new(compl)) {
queue_tail_inc(mcc_cq);
Expand All @@ -99,7 +99,7 @@ static struct be_mcc_cq_entry *be_mcc_compl_get(struct be_adapter *adapter)

void be_process_mcc(struct be_adapter *adapter)
{
struct be_mcc_cq_entry *compl;
struct be_mcc_compl *compl;
int num = 0;

spin_lock_bh(&adapter->mcc_cq_lock);
Expand Down Expand Up @@ -173,16 +173,16 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
* Insert the mailbox address into the doorbell in two steps
* Polls on the mbox doorbell till a command completion (or a timeout) occurs
*/
static int be_mbox_db_ring(struct be_adapter *adapter)
static int be_mbox_notify(struct be_adapter *adapter)
{
int status;
u32 val = 0;
void __iomem *db = adapter->db + MPU_MAILBOX_DB_OFFSET;
struct be_dma_mem *mbox_mem = &adapter->mbox_mem;
struct be_mcc_mailbox *mbox = mbox_mem->va;
struct be_mcc_cq_entry *cqe = &mbox->cqe;
struct be_mcc_compl *compl = &mbox->compl;

memset(cqe, 0, sizeof(*cqe));
memset(compl, 0, sizeof(*compl));

val |= MPU_MAILBOX_DB_HI_MASK;
/* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
Expand All @@ -204,9 +204,9 @@ static int be_mbox_db_ring(struct be_adapter *adapter)
return status;

/* A cq entry has been made now */
if (be_mcc_compl_is_new(cqe)) {
status = be_mcc_compl_process(adapter, &mbox->cqe);
be_mcc_compl_use(cqe);
if (be_mcc_compl_is_new(compl)) {
status = be_mcc_compl_process(adapter, &mbox->compl);
be_mcc_compl_use(compl);
if (status)
return status;
} else {
Expand Down Expand Up @@ -396,7 +396,7 @@ int be_cmd_eq_create(struct be_adapter *adapter,

be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
eq->id = le16_to_cpu(resp->eq_id);
eq->created = true;
Expand Down Expand Up @@ -429,7 +429,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
req->permanent = 0;
}

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status)
memcpy(mac_addr, resp->mac.addr, ETH_ALEN);

Expand All @@ -455,7 +455,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
req->if_id = cpu_to_le32(if_id);
memcpy(req->mac_address, mac_addr, ETH_ALEN);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb);
*pmac_id = le32_to_cpu(resp->pmac_id);
Expand All @@ -482,7 +482,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id)
req->if_id = cpu_to_le32(if_id);
req->pmac_id = cpu_to_le32(pmac_id);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
spin_unlock(&adapter->mbox_lock);

return status;
Expand Down Expand Up @@ -523,7 +523,7 @@ int be_cmd_cq_create(struct be_adapter *adapter,

be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
cq->id = le16_to_cpu(resp->cq_id);
cq->created = true;
Expand Down Expand Up @@ -571,7 +571,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter,

be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb);
mccq->id = le16_to_cpu(resp->id);
Expand Down Expand Up @@ -618,7 +618,7 @@ int be_cmd_txq_create(struct be_adapter *adapter,

be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb);
txq->id = le16_to_cpu(resp->cid);
Expand Down Expand Up @@ -654,7 +654,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
req->max_frame_size = cpu_to_le16(max_frame_size);
req->rss_queue = cpu_to_le32(rss);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
rxq->id = le16_to_cpu(resp->id);
Expand Down Expand Up @@ -706,7 +706,7 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req));
req->id = cpu_to_le16(q->id);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);

Expand Down Expand Up @@ -734,7 +734,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac,
if (!pmac_invalid)
memcpy(req->mac_addr, mac, ETH_ALEN);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_if_create *resp = embedded_payload(wrb);
*if_handle = le32_to_cpu(resp->interface_id);
Expand All @@ -761,7 +761,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id)
OPCODE_COMMON_NTWK_INTERFACE_DESTROY, sizeof(*req));

req->interface_id = cpu_to_le32(interface_id);
status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);

Expand Down Expand Up @@ -791,7 +791,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
sge->len = cpu_to_le32(nonemb_cmd->size);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_get_stats *resp = nonemb_cmd->va;
be_dws_le_to_cpu(&resp->hw_stats, sizeof(resp->hw_stats));
Expand All @@ -818,7 +818,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter,
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_LINK_STATUS_QUERY, sizeof(*req));

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
if (resp->mac_speed != PHY_LINK_SPEED_ZERO)
Expand All @@ -843,7 +843,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver)
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_GET_FW_VERSION, sizeof(*req));

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb);
strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN);
Expand Down Expand Up @@ -873,7 +873,7 @@ int be_cmd_modify_eqd(struct be_adapter *adapter, u32 eq_id, u32 eqd)
req->delay[0].phase = 0;
req->delay[0].delay_multiplier = cpu_to_le32(eqd);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);
return status;
Expand Down Expand Up @@ -903,7 +903,7 @@ int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
req->num_vlan * sizeof(vtag_array[0]));
}

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);
return status;
Expand Down Expand Up @@ -999,7 +999,7 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
req->tx_flow_control = cpu_to_le16((u16)tx_fc);
req->rx_flow_control = cpu_to_le16((u16)rx_fc);

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);

spin_unlock(&adapter->mbox_lock);
return status;
Expand All @@ -1020,7 +1020,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_GET_FLOW_CONTROL, sizeof(*req));

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_get_flow_control *resp =
embedded_payload(wrb);
Expand All @@ -1047,7 +1047,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num)
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req));

status = be_mbox_db_ring(adapter);
status = be_mbox_notify(adapter);
if (!status) {
struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
*port_num = le32_to_cpu(resp->phys_port);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ enum {
#define CQE_STATUS_EXTD_MASK 0xFFFF
#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */

struct be_mcc_cq_entry {
struct be_mcc_compl {
u32 status; /* dword 0 */
u32 tag0; /* dword 1 */
u32 tag1; /* dword 2 */
Expand Down Expand Up @@ -106,7 +106,7 @@ struct be_async_event_link_state {

struct be_mcc_mailbox {
struct be_mcc_wrb wrb;
struct be_mcc_cq_entry cqe;
struct be_mcc_compl compl;
};

#define CMD_SUBSYSTEM_COMMON 0x1
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ static int be_mcc_queues_create(struct be_adapter *adapter)
/* Alloc MCC compl queue */
cq = &adapter->mcc_obj.cq;
if (be_queue_alloc(adapter, cq, MCC_CQ_LEN,
sizeof(struct be_mcc_cq_entry)))
sizeof(struct be_mcc_compl)))
goto err;

/* Ask BE to create MCC compl queue; share TX's eq */
Expand Down

0 comments on commit 73f7a5e

Please sign in to comment.