Lines Matching refs:hx
41 struct hexline *hx, int *pos) in cypress_get_hexline() argument
49 memset(hx, 0, sizeof(struct hexline)); in cypress_get_hexline()
50 hx->len = b[0]; in cypress_get_hexline()
52 if ((*pos + hx->len + 4) >= fw->size) in cypress_get_hexline()
55 hx->addr = b[1] | (b[2] << 8); in cypress_get_hexline()
56 hx->type = b[3]; in cypress_get_hexline()
58 if (hx->type == 0x04) { in cypress_get_hexline()
61 hx->addr |= (b[4] << 24) | (b[5] << 16); in cypress_get_hexline()
64 memcpy(hx->data, &b[data_offs], hx->len); in cypress_get_hexline()
65 hx->chk = b[hx->len + data_offs]; in cypress_get_hexline()
66 *pos += hx->len + 5; in cypress_get_hexline()
74 struct hexline *hx; in cypress_load_firmware() local
77 hx = kmalloc(sizeof(struct hexline), GFP_KERNEL); in cypress_load_firmware()
78 if (!hx) { in cypress_load_firmware()
84 hx->data[0] = 1; in cypress_load_firmware()
85 ret = usb_cypress_writemem(udev, cypress[type].cs_reg, hx->data, 1); in cypress_load_firmware()
95 ret = cypress_get_hexline(fw, hx, &pos); in cypress_load_firmware()
101 ret = usb_cypress_writemem(udev, hx->addr, hx->data, hx->len); in cypress_load_firmware()
104 } else if (ret != hx->len) { in cypress_load_firmware()
107 KBUILD_MODNAME, ret, hx->len); in cypress_load_firmware()
114 hx->data[0] = 0; in cypress_load_firmware()
115 ret = usb_cypress_writemem(udev, cypress[type].cs_reg, hx->data, 1); in cypress_load_firmware()
125 kfree(hx); in cypress_load_firmware()