Re: wcnss_ctrl firmware loading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

at least the driver in this Android kernel also only increases by
NV_FRAGMENT_SIZE:

https://github.com/anyc/linux-zenwatch3/blob/master/drivers/net/wireless/wcnss/wcnss_wlan.c#L2413

Best regards,
Mario

On 04.01.2018 11:44, Will Newton wrote:
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...


--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux