diff options
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 245d3c3a9274..5abecb7673e6 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -384,7 +384,7 @@ static inline int handle_cmd_response(struct lbs_private *priv, | |||
384 | return ret; | 384 | return ret; |
385 | } | 385 | } |
386 | 386 | ||
387 | int lbs_process_rx_command(struct lbs_private *priv) | 387 | int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) |
388 | { | 388 | { |
389 | uint16_t respcmd, curcmd; | 389 | uint16_t respcmd, curcmd; |
390 | struct cmd_header *resp; | 390 | struct cmd_header *resp; |
@@ -404,14 +404,14 @@ int lbs_process_rx_command(struct lbs_private *priv) | |||
404 | goto done; | 404 | goto done; |
405 | } | 405 | } |
406 | 406 | ||
407 | resp = (void *)priv->upld_buf; | 407 | resp = (void *)data; |
408 | curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command); | 408 | curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command); |
409 | respcmd = le16_to_cpu(resp->command); | 409 | respcmd = le16_to_cpu(resp->command); |
410 | result = le16_to_cpu(resp->result); | 410 | result = le16_to_cpu(resp->result); |
411 | 411 | ||
412 | lbs_deb_cmd("CMD_RESP: response 0x%04x, seq %d, size %d\n", | 412 | lbs_deb_cmd("CMD_RESP: response 0x%04x, seq %d, size %d\n", |
413 | respcmd, le16_to_cpu(resp->seqnum), priv->upld_len); | 413 | respcmd, le16_to_cpu(resp->seqnum), len); |
414 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, priv->upld_len); | 414 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len); |
415 | 415 | ||
416 | if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { | 416 | if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { |
417 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", | 417 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", |
@@ -569,18 +569,13 @@ static int lbs_send_confirmwake(struct lbs_private *priv) | |||
569 | return ret; | 569 | return ret; |
570 | } | 570 | } |
571 | 571 | ||
572 | int lbs_process_event(struct lbs_private *priv) | 572 | int lbs_process_event(struct lbs_private *priv, u32 event) |
573 | { | 573 | { |
574 | int ret = 0; | 574 | int ret = 0; |
575 | u32 eventcause; | ||
576 | 575 | ||
577 | lbs_deb_enter(LBS_DEB_CMD); | 576 | lbs_deb_enter(LBS_DEB_CMD); |
578 | 577 | ||
579 | spin_lock_irq(&priv->driver_lock); | 578 | switch (event) { |
580 | eventcause = priv->eventcause >> SBI_EVENT_CAUSE_SHIFT; | ||
581 | spin_unlock_irq(&priv->driver_lock); | ||
582 | |||
583 | switch (eventcause) { | ||
584 | case MACREG_INT_CODE_LINK_SENSED: | 579 | case MACREG_INT_CODE_LINK_SENSED: |
585 | lbs_deb_cmd("EVENT: link sensed\n"); | 580 | lbs_deb_cmd("EVENT: link sensed\n"); |
586 | break; | 581 | break; |
@@ -696,14 +691,10 @@ int lbs_process_event(struct lbs_private *priv) | |||
696 | break; | 691 | break; |
697 | 692 | ||
698 | default: | 693 | default: |
699 | lbs_pr_alert("EVENT: unknown event id %d\n", eventcause); | 694 | lbs_pr_alert("EVENT: unknown event id %d\n", event); |
700 | break; | 695 | break; |
701 | } | 696 | } |
702 | 697 | ||
703 | spin_lock_irq(&priv->driver_lock); | ||
704 | priv->eventcause = 0; | ||
705 | spin_unlock_irq(&priv->driver_lock); | ||
706 | |||
707 | lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); | 698 | lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); |
708 | return ret; | 699 | return ret; |
709 | } | 700 | } |