u8 expect_packet;
u8 cmd_response[IFORCE_MAX_LENGTH];
u8 cmd_response_len;
+ u8 data_in[IFORCE_MAX_LENGTH];
};
static void iforce_serio_xmit(struct iforce *iforce)
}
if (iforce_serio->idx < iforce_serio->len) {
- iforce->data[iforce_serio->idx++] = data;
+ iforce_serio->data_in[iforce_serio->idx++] = data;
iforce_serio->csum += data;
goto out;
}
/* Handle command completion */
if (iforce_serio->expect_packet == iforce_serio->id) {
iforce_serio->expect_packet = 0;
- memcpy(iforce_serio->cmd_response, iforce->data,
- IFORCE_MAX_LENGTH);
+ memcpy(iforce_serio->cmd_response,
+ iforce_serio->data_in, IFORCE_MAX_LENGTH);
iforce_serio->cmd_response_len = iforce_serio->len;
/* Signal that command is done */
wake_up(&iforce->wait);
} else if (likely(iforce->type)) {
iforce_process_packet(iforce, iforce_serio->id,
- iforce->data, iforce_serio->len);
+ iforce_serio->data_in,
+ iforce_serio->len);
}
iforce_serio->pkt = 0;
struct usb_device *usbdev;
struct usb_interface *intf;
struct urb *irq, *out;
+
+ u8 data_in[IFORCE_MAX_LENGTH] ____cacheline_aligned;
+ u8 data_out[IFORCE_MAX_LENGTH] ____cacheline_aligned;
};
static void __iforce_usb_xmit(struct iforce *iforce)
goto exit;
}
- iforce_process_packet(iforce, iforce->data[0],
- iforce->data + 1, urb->actual_length - 1);
+ iforce_process_packet(iforce, iforce_usb->data_in[0],
+ iforce_usb->data_in + 1, urb->actual_length - 1);
exit:
status = usb_submit_urb(urb, GFP_ATOMIC);
epirq = &interface->endpoint[0].desc;
epout = &interface->endpoint[1].desc;
- if (!(iforce_usb = kzalloc(sizeof(*iforce_usb) + 32, GFP_KERNEL)))
+ iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);
+ if (!iforce_usb)
goto fail;
- if (!(iforce_usb->irq = usb_alloc_urb(0, GFP_KERNEL)))
+ iforce_usb->irq = usb_alloc_urb(0, GFP_KERNEL);
+ if (!iforce_usb->irq)
goto fail;
- if (!(iforce_usb->out = usb_alloc_urb(0, GFP_KERNEL)))
+ iforce_usb->out = usb_alloc_urb(0, GFP_KERNEL);
+ if (!iforce_usb->out)
goto fail;
iforce = &iforce_usb->iforce;
iforce_usb->usbdev = dev;
iforce_usb->intf = intf;
- usb_fill_int_urb(iforce_usb->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
- iforce->data, 16, iforce_usb_irq, iforce_usb, epirq->bInterval);
+ usb_fill_int_urb(iforce_usb->irq, dev,
+ usb_rcvintpipe(dev, epirq->bEndpointAddress),
+ iforce_usb->data_in, sizeof(iforce_usb->data_in),
+ iforce_usb_irq, iforce_usb, epirq->bInterval);
- usb_fill_int_urb(iforce_usb->out, dev, usb_sndintpipe(dev, epout->bEndpointAddress),
- iforce_usb + 1, 32, iforce_usb_out, iforce_usb, epout->bInterval);
+ usb_fill_int_urb(iforce_usb->out, dev,
+ usb_sndintpipe(dev, epout->bEndpointAddress),
+ iforce_usb->data_out, sizeof(iforce_usb->data_out),
+ iforce_usb_out, iforce_usb, epout->bInterval);
err = iforce_init_device(&intf->dev, BUS_USB, iforce);
if (err)