Lines Matching refs:hx
42 struct hexline *hx, int *pos) in cypress_get_hexline() argument
50 memset(hx, 0, sizeof(struct hexline)); in cypress_get_hexline()
51 hx->len = b[0]; in cypress_get_hexline()
53 if ((*pos + hx->len + 4) >= fw->size) in cypress_get_hexline()
56 hx->addr = b[1] | (b[2] << 8); in cypress_get_hexline()
57 hx->type = b[3]; in cypress_get_hexline()
59 if (hx->type == 0x04) { in cypress_get_hexline()
62 hx->addr |= (b[4] << 24) | (b[5] << 16); in cypress_get_hexline()
65 memcpy(hx->data, &b[data_offs], hx->len); in cypress_get_hexline()
66 hx->chk = b[hx->len + data_offs]; in cypress_get_hexline()
67 *pos += hx->len + 5; in cypress_get_hexline()
75 struct hexline *hx; in cypress_load_firmware() local
78 hx = kmalloc(sizeof(*hx), GFP_KERNEL); in cypress_load_firmware()
79 if (!hx) in cypress_load_firmware()
83 hx->data[0] = 1; in cypress_load_firmware()
84 ret = usb_cypress_writemem(udev, cypress[type].cs_reg, hx->data, 1); in cypress_load_firmware()
94 ret = cypress_get_hexline(fw, hx, &pos); in cypress_load_firmware()
100 ret = usb_cypress_writemem(udev, hx->addr, hx->data, hx->len); in cypress_load_firmware()
103 } else if (ret != hx->len) { in cypress_load_firmware()
106 KBUILD_MODNAME, ret, hx->len); in cypress_load_firmware()
113 hx->data[0] = 0; in cypress_load_firmware()
114 ret = usb_cypress_writemem(udev, cypress[type].cs_reg, hx->data, 1); in cypress_load_firmware()
124 kfree(hx); in cypress_load_firmware()