Lines Matching refs:msg

41 	__be16 preamble, length, msg;  member
79 static int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg, in cp2615_init_iop_msg() argument
90 ret->msg = htons(msg); in cp2615_init_iop_msg()
127 struct cp2615_iop_msg *msg = kzalloc(sizeof(*msg), GFP_KERNEL); in cp2615_i2c_send() local
129 int res = cp2615_init_i2c_msg(msg, i2c_w); in cp2615_i2c_send()
133 msg, ntohs(msg->length), NULL, 0); in cp2615_i2c_send()
134 kfree(msg); in cp2615_i2c_send()
142 struct cp2615_iop_msg *msg; in cp2615_i2c_recv() local
146 msg = kzalloc(sizeof(*msg), GFP_KERNEL); in cp2615_i2c_recv()
147 if (!msg) in cp2615_i2c_recv()
150 res = usb_bulk_msg(usbdev, usb_rcvbulkpipe(usbdev, IOP_EP_IN), msg, in cp2615_i2c_recv()
153 kfree(msg); in cp2615_i2c_recv()
157 i2c_r = (struct cp2615_i2c_transfer_result *)&msg->data; in cp2615_i2c_recv()
158 if (msg->msg != htons(iop_I2cTransferResult) || i2c_r->tag != tag) { in cp2615_i2c_recv()
159 kfree(msg); in cp2615_i2c_recv()
167 kfree(msg); in cp2615_i2c_recv()
174 struct cp2615_iop_msg *msg = kzalloc(sizeof(*msg), GFP_KERNEL); in cp2615_check_iop() local
175 struct cp2615_iop_accessory_info *info = (struct cp2615_iop_accessory_info *)&msg->data; in cp2615_check_iop()
177 int res = cp2615_init_iop_msg(msg, iop_GetAccessoryInfo, NULL, 0); in cp2615_check_iop()
183 msg, ntohs(msg->length), NULL, 0); in cp2615_check_iop()
188 msg, sizeof(struct cp2615_iop_msg), NULL, 0); in cp2615_check_iop()
192 if (msg->msg != htons(iop_AccessoryInfo)) { in cp2615_check_iop()
209 kfree(msg); in cp2615_check_iop()
218 struct i2c_msg *msg; in cp2615_i2c_master_xfer() local
224 msg = &msgs[i]; in cp2615_i2c_master_xfer()
227 i2c_w.i2caddr = i2c_8bit_addr_from_msg(msg); in cp2615_i2c_master_xfer()
228 if (msg->flags & I2C_M_RD) { in cp2615_i2c_master_xfer()
229 i2c_w.read_len = msg->len; in cp2615_i2c_master_xfer()
233 i2c_w.write_len = msg->len; in cp2615_i2c_master_xfer()
234 memcpy(&i2c_w.data, msg->buf, i2c_w.write_len); in cp2615_i2c_master_xfer()
239 ret = cp2615_i2c_recv(usbif, i2c_w.tag, msg->buf); in cp2615_i2c_master_xfer()