All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Max S." <max@schneidersoft.net>
Cc: linux-can <linux-can@vger.kernel.org>,
	Sven Geggus <lists@fuchsschwanzdomain.de>
Subject: Re: Usb to can driver
Date: Thu, 02 May 2013 13:09:50 +0200	[thread overview]
Message-ID: <5182497E.5050606@pengutronix.de> (raw)
In-Reply-To: <5182490F.2080707@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 3439 bytes --]

On 05/02/2013 01:07 PM, Marc Kleine-Budde wrote:
> On 04/24/2013 11:33 PM, Max S. wrote:
>> From 8a83080bcddc558cd016e58e408b56ca68bc5bc8 Mon Sep 17 00:00:00 2001
>> From: Maximilian Schneider <max@schneidersoft.net>
>> Date: Wed, 24 Apr 2013 21:03:31 +0000
>> Subject: [PATCH] Added ss_usb source.
> 
> Comments inline.
> 
>> Signed-off-by: Maximilian Schneider <max@schneidersoft.net>
>> ---
>>  drivers/net/can/usb/Makefile |    1 +
> 
> You should add your driver to Kconfig, too.
> 
>>  drivers/net/can/usb/ss_usb.c |  944 ++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 945 insertions(+)
>>  create mode 100644 drivers/net/can/usb/ss_usb.c
>>
>> diff --git a/drivers/net/can/usb/Makefile b/drivers/net/can/usb/Makefile
>> index becef46..c341a1b 100644
>> --- a/drivers/net/can/usb/Makefile
>> +++ b/drivers/net/can/usb/Makefile
>> @@ -7,5 +7,6 @@ obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
>>  obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
>>  obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/
>>  obj-$(CONFIG_CAN_8DEV_USB) += usb_8dev.o
>> +obj-$(CONFIG_CAN_SS_USB) += ss_usb.o
>>  
>>  ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
>> diff --git a/drivers/net/can/usb/ss_usb.c b/drivers/net/can/usb/ss_usb.c
>> new file mode 100644
>> index 0000000..69710ff
>> --- /dev/null
>> +++ b/drivers/net/can/usb/ss_usb.c
>> @@ -0,0 +1,944 @@
> 
> Please add a header stating your license.
> 
>> +#include <linux/init.h>
>> +#include <linux/signal.h>
>> +#include <linux/module.h>
>> +#include <linux/netdevice.h>
>> +#include <linux/usb.h>
>> +
>> +#include <linux/can.h>
>> +#include <linux/can/dev.h>
>> +#include <linux/can/error.h>
>> +
>> +/* Device specific constants */
>> +#define USB_SSUSB_VENDOR_ID         0xbeef
>> +#define USB_SSUSB_AT32_PRODUCT_ID   0x1234
> 
> Please get in touch with the Openmoko people for a real vendor/product
> id as Sven suggested. Sven can you arrange a contect?
> 
>> +
>> +#define SS_USB_ENDPOINT_IN          1
>> +#define SS_USB_ENDPOINT_OUT         2
>> +
>> +#define SS_USB_BREQ_HOST_FORMAT     0
>> +#define SS_USB_BREQ_BITTIMING       1
>> +#define SS_USB_BREQ_MODE            2
>> +#define SS_USB_BREQ_BERR            3
>> +#define SS_USB_BREQ_BT_CONST        4
>> +
>> +
>> +#define SS_CAN_MODE_RESET           0
>> +#define SS_CAN_MODE_START           1
>> +
>> +#define SS_CAN_STATE_ERROR_ACTIVE   0
>> +#define SS_CAN_STATE_ERROR_WARNING  1
>> +#define SS_CAN_STATE_ERROR_PASSIVE  2
>> +#define SS_CAN_STATE_BUS_OFF        3
>> +#define SS_CAN_STATE_STOPPED        4
>> +#define SS_CAN_STATE_SLEEPING       5
> 
> Can you pelase create an enum for each of these.
> 
>> +
>> +/* data types passed between host and device */
>> +struct __packed device_config {
>> +	u16 byte_order;
> 
> u32, byteorder please, so that you have natural alignment for this struct.
> 
>> +
>> +	u32 hf_size;	/* size of a host frame */
>> +	u32 hf_can_id;
>> +	u32 hf_can_dlc;
>> +	u32 hf_data;
>> +	u32 hf_echo_id;
>> +	u32 hf_channel;
>> +};

Please give your struct a common prefix "ss_" like your defines already
have.

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2013-05-02 11:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 17:15 Usb to can driver Max S.
2013-04-23 21:47 ` Marc Kleine-Budde
2013-04-24 15:48   ` Max S.
2013-04-24 16:07     ` Marc Kleine-Budde
2013-04-24 17:40       ` Oliver Hartkopp
2013-04-24 21:24         ` Marc Kleine-Budde
2013-04-25 23:35           ` Max S.
2013-04-26  5:25             ` Oliver Hartkopp
2013-04-26  8:55               ` Kurt Van Dijck
2013-04-26  8:26             ` Marc Kleine-Budde
2013-04-24 21:33       ` Max S.
2013-05-02 11:07         ` Marc Kleine-Budde
2013-05-02 11:09           ` Marc Kleine-Budde [this message]
2013-05-02 11:30           ` Wolfgang Grandegger
2013-05-02 11:32             ` Marc Kleine-Budde
2013-05-16 11:40         ` Marc Kleine-Budde
2013-06-04 13:18           ` Max S.
2013-06-04 14:40             ` Wolfgang Grandegger
2013-06-04 14:41             ` Marc Kleine-Budde
2013-04-24  6:38 ` Sven Geggus
  -- strict thread matches above, loose matches on Subject: below --
2013-06-25 23:59 Max S.
2013-06-26  7:10 ` wg
2013-06-26 18:55   ` Max S.
2013-06-26 18:58     ` Marc Kleine-Budde
     [not found]       ` <1372810462.15632.2.camel@blackbox>
2013-07-03  7:55         ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5182497E.5050606@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=lists@fuchsschwanzdomain.de \
    --cc=max@schneidersoft.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.