linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* wcnss_ctrl firmware loading
@ 2018-01-04 10:44 Will Newton
  2018-01-04 11:36 ` Mario Kicherer
  2018-02-02 18:30 ` Bjorn Andersson
  0 siblings, 2 replies; 4+ messages in thread
From: Will Newton @ 2018-01-04 10:44 UTC (permalink / raw)
  To: linux-arm-msm

Hi,

I'm running into some issues with getting this driver running on an
msm8909. The firmware loading code looks a little odd to me so I would
just like to check it is doing the right thing:



                               data = fw->data;
        left = fw->size;

        req->hdr.type = WCNSS_DOWNLOAD_NV_REQ;
        req->hdr.len = sizeof(*req) + NV_FRAGMENT_SIZE;

        req->last = 0;
        req->frag_size = NV_FRAGMENT_SIZE;

        req->seq = 0;
        do {
                if (left <= NV_FRAGMENT_SIZE) {
                        req->last = 1;
                        req->frag_size = left;
                        req->hdr.len = sizeof(*req) + left;
                }

                memcpy(req->fragment, data, req->frag_size);

                ret = rpmsg_send(wcnss->channel, req, req->hdr.len);
                if (ret < 0) {
                        dev_err(wcnss->dev, "failed to send smd packet\n");
                        goto release_fw;
                }

                /* Increment for next fragment */
                req->seq++;

                data += req->hdr.len;
                left -= NV_FRAGMENT_SIZE;
        } while (left > 0);

data is incremented by req->hdr.len which includes sizeof(*req) which
seems wrong, e.g. it should perhaps increment by req->frag_size. Or am
I missing some subtlety here?

Strangely it doesn't seem to matter if I change that code, either way
my firmware startup fails...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-02 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 10:44 wcnss_ctrl firmware loading Will Newton
2018-01-04 11:36 ` Mario Kicherer
2018-01-04 11:41   ` Will Newton
2018-02-02 18:30 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).