On 03/01/2011 12:10 PM, Jacky.S.Mu wrote:
> Hello,
> 
> Maybe there is misunderstanding for me while reading the code
> freerunner/froyo/hardware/ril/vchanneld.c when I port it to my current
> device.
> 
> static int vch_write_data(struct virtual_channel *vch, char *ptr, int
> len)
> {
>       int tmp;
>         struct phy_device *phy = vch->phy;
>         tmp = (len > phy->max_length) ? phy->max_length : len;
> 
>         while (len > 0) {
>                 gsm0710_write(vch, GSM0710_DATA, ptr,
> tmp); // ???????????????????????
>                 ptr += tmp;
>                 len -= tmp;
>       }
> 
>         return len;
> }
> 

Not tested

static int vch_write_data(struct virtual_channel *vch, char *ptr, int len)
{
        struct phy_device *phy = vch->phy;

        while ((len - phy->max_length) > 0) {
                gsm0710_write(vch, GSM0710_DATA, ptr, phy->max_length);
                ptr += phy->max_length;
                len -= phy->max_length;
        }

        gsm0710_write(vch, GSM0710_DATA, ptr, len);

        return len;
}

Michael

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to