On 11/28/2011 03:01 PM, Marc Kleine-Budde wrote:
> On 11/28/2011 02:52 PM, Wolfgang Grandegger wrote:
>
> [...]
>
>>>> +/*
>>>> + * This driver uses the last 5 message objects 11..15. The definitions
>>>> + * and structure below allows to configure and assign them to the real
>>>> + * message object.
>>>> + */
>>>> +static unsigned char cc770_obj_flags[CC770_OBJ_MAX] = {
>>>> + [CC770_OBJ_RX0] = CC770_OBJ_FLAG_RX,
>>>> + [CC770_OBJ_RX1] = CC770_OBJ_FLAG_RX | CC770_OBJ_FLAG_EFF,
>>>> + [CC770_OBJ_RX_RTR0] = CC770_OBJ_FLAG_RX | CC770_OBJ_FLAG_RTR,
>>>> + [CC770_OBJ_RX_RTR1] = CC770_OBJ_FLAG_RX | CC770_OBJ_FLAG_RTR |
>>>> + CC770_OBJ_FLAG_EFF,
>>>> + [CC770_OBJ_TX] = 0,
>>>> +};
>>>
>>> Is is worth the trouble making this a per device instance option? In a
>>> OF-Tree world should this become an "attribute" (or what's the correct
>>> of-tree word for it?)
>>
>> Well, only msg object 15 does have double buffering and should therefore
>> be used for bulk data reception. Therefore we have for the i82527 the
>> module parameter:
>>
>> MODULE_PARM_DESC(msgobj15_eff,
>> "Extended 29-bit frames for message object 15 "
>> "(default: 11-bit standard frames)");
>>
>> For TX we currently use just one object. Anyway, the device tree is not
>> the right place to define such parameters because it's too static. The
>> user may want to select it at runtime depending on the application, if
>> at all. We can change it when there is a *real* requirement.
>
> Fine with me.
>
>>>> + for (o = 0; o < CC770_OBJ_MAX; o++) {
>>> ^^^^^^^^^^^^^
>>>
>>> what about ARRAY_SIZE(priv->obj_flags)
>>
>> CC770_OBJ_MAX is not derived from a static array definition but as show
>> below:
>
> Okay...
>
>> enum {
>> CC770_OBJ_RX0 = 0, /* for receiving normal messages */
>> CC770_OBJ_RX1, /* for receiving normal messages */
>> CC770_OBJ_RX_RTR0, /* for receiving remote transmission requests */
>> CC770_OBJ_RX_RTR1, /* for receiving remote transmission requests */
>> CC770_OBJ_TX, /* for sending messages */
>> CC770_OBJ_MAX <================
>
> ...then add a "," here :P
Why?
Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users