From bc274e1b5d9ca3b9e3927568d0860ebe307c1033 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 5 May 2014 14:10:57 -0500 Subject: [PATCH] wctc4xxp: We always want to ack the responses. Furthermore, do it as soon as we know we should to prevent the ack from potentially going out after another CSM_ENCAPS packet on another CPU. Previously, we would not send ACKS to responses we believed we already responded to. Signed-off-by: Shaun Ruffell Signed-off-by: Russ Meyerriecks --- drivers/dahdi/wctc4xxp/base.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 3d67c90..5185b7d 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -2374,19 +2374,15 @@ receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd) if (!(hdr->control & MESSAGE_PACKET)) { const bool suppress_ack = ((hdr->control & SUPPRESS_ACK) > 0); + + if (!suppress_ack) + wctc4xxp_send_ack(wc, hdr->seq_num, hdr->channel); + if (is_response(hdr)) { - u8 seq_num = hdr->seq_num; - __be16 channel = hdr->channel; do_rx_response_packet(wc, cmd); - if (!suppress_ack) - wctc4xxp_send_ack(wc, seq_num, channel); } else if (0xc1 == hdr->type) { - if (!suppress_ack) { - wctc4xxp_send_ack(wc, hdr->seq_num, - hdr->channel); - } if (0x75 == hdr->class) { dev_warn(&wc->pdev->dev, @@ -2395,10 +2391,6 @@ receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd) } free_cmd(cmd); } else if (0xd4 == hdr->type) { - if (!suppress_ack) { - wctc4xxp_send_ack(wc, hdr->seq_num, - hdr->channel); - } if (hdr->params[0] != le16_to_cpu(0xffff)) { dev_warn(&wc->pdev->dev, "DTE Failed self test (%04x).\n", @@ -2414,10 +2406,6 @@ receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd) } free_cmd(cmd); } else if (MONITOR_LIVE_INDICATION_TYPE == hdr->type) { - if (!suppress_ack) { - wctc4xxp_send_ack(wc, hdr->seq_num, - hdr->channel); - } if (hdr->function == 0x0000) { u16 alert_type = le16_to_cpu(hdr->params[0]); @@ -2434,10 +2422,6 @@ receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd) print_command(wc, cmd); free_cmd(cmd); } else { - if (!suppress_ack) { - wctc4xxp_send_ack(wc, hdr->seq_num, - hdr->channel); - } dev_warn(&wc->pdev->dev, "Unknown command type received. %02x\n", hdr->type); free_cmd(cmd);