Re: [PATCH v2 1/1] can: ucan: add driver for Theobroma Systems UCAN devices
From: Marc Kleine-Budde
Date: Tue Mar 13 2018 - 13:44:19 EST
On 03/13/2018 06:35 PM, Jakob Unterwurzacher wrote:
[...]
Please mark all multibyte values going over the USB as either le or be.
> +struct ucan_ctl_cmd_start {
> + u16 mode; /* oring any of UCAN_MODE_* */
> +} __packed;
> +
> +struct ucan_ctl_cmd_set_bittiming {
> + u32 tq; /* Time quanta (TQ) in nanoseconds */
> + u16 brp; /* TQ Prescaler */
> + u16 sample_point; /* Samplepoint on tenth percent */
> + u8 prop_seg; /* Propagation segment in TQs */
> + u8 phase_seg1; /* Phase buffer segment 1 in TQs */
> + u8 phase_seg2; /* Phase buffer segment 2 in TQs */
> + u8 sjw; /* Synchronisation jump width in TQs */
> +} __packed;
> +
> +struct ucan_ctl_cmd_device_info {
> + u32 freq; /* Clock Frequency for tq generation */
> + u8 tx_fifo; /* Size of the transmission fifo */
> + u8 sjw_max; /* can_bittiming fields... */
> + u8 tseg1_min;
> + u8 tseg1_max;
> + u8 tseg2_min;
> + u8 tseg2_max;
> + u16 brp_inc;
> + u32 brp_min;
> + u32 brp_max; /* ...can_bittiming fields */
> + u16 ctrlmodes; /* supported control modes */
> + u16 hwfilter; /* Number of HW filter banks */
> + u16 rxmboxes; /* Number of receive Mailboxes */
> +} __packed;
> +
> +struct ucan_ctl_cmd_get_protocol_version {
> + u32 version;
> +} __packed;
> +
> +union ucan_ctl_payload {
> + /***************************************************
> + * Setup Bittiming
> + * bmRequest == UCAN_COMMAND_START
> + ***************************************************/
Please use standard 'net' comment style:
/* this is a multiline
* comment
*/
> + struct ucan_ctl_cmd_start cmd_start;
> + /***************************************************
> + * Setup Bittiming
> + * bmRequest == UCAN_COMMAND_SET_BITTIMING
> + ***************************************************/
> + struct ucan_ctl_cmd_set_bittiming cmd_set_bittiming;
> + /***************************************************
> + * Get Device Information
> + * bmRequest == UCAN_COMMAND_GET; wValue = UCAN_COMMAND_GET_INFO
> + ***************************************************/
> + struct ucan_ctl_cmd_device_info cmd_get_device_info;
> + /***************************************************
> + * Get Protocol Version
> + * bmRequest == UCAN_COMMAND_GET;
> + * wValue = UCAN_COMMAND_GET_PROTOCOL_VERSION
> + ***************************************************/
> + struct ucan_ctl_cmd_get_protocol_version cmd_get_protocol_version;
> +
> + u8 raw[128];
> +} __packed;
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Attachment:
signature.asc
Description: OpenPGP digital signature