* [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
@ 2007-04-11 22:48 Jan Kiszka
2007-04-15 11:34 ` Wolfgang Grandegger
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2007-04-11 22:48 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
Hi Wolfgang,
something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx unless
I oversee something. Please have a look.
(I received a private complaint of a user trying to compile rtcan_rtt
against 2.3.x.)
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-11 22:48 [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN Jan Kiszka
@ 2007-04-15 11:34 ` Wolfgang Grandegger
2007-04-15 12:56 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Grandegger @ 2007-04-15 11:34 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Hi Wolfgang,
>
> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx unless
> I oversee something. Please have a look.
There is CAN_PROTO_RAW defined and I have added some time ago CAN_RAW to
rtcan.h to be compatible with Socket-CAN:
/** Particular CAN protocols
*
* Currently only the RAW protocol is supported.
*/
#define CAN_RAW 0
> (I received a private complaint of a user trying to compile rtcan_rtt
> against 2.3.x.)
The latter definition is missing in 2.3.x, though and compiling
rtcan_rtt.c from the trunk will fail for this reason. I'm going to fix
it later today.
Wolfgang.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 11:34 ` Wolfgang Grandegger
@ 2007-04-15 12:56 ` Jan Kiszka
2007-04-15 18:25 ` Wolfgang Grandegger
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2007-04-15 12:56 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
Wolfgang Grandegger wrote:
> Jan Kiszka wrote:
>> Hi Wolfgang,
>>
>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx unless
>> I oversee something. Please have a look.
>
> There is CAN_PROTO_RAW defined and I have added some time ago CAN_RAW to
> rtcan.h to be compatible with Socket-CAN:
>
> /** Particular CAN protocols
> *
> * Currently only the RAW protocol is supported.
> */
> #define CAN_RAW 0
Yes, I know. But the question remains which way to go for rtcan:
Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with CAN_RAW as
well now, but having a different value. That should be resolved, on
whatever side, IMHO.
>
>> (I received a private complaint of a user trying to compile rtcan_rtt
>> against 2.3.x.)
>
> The latter definition is missing in 2.3.x, though and compiling
> rtcan_rtt.c from the trunk will fail for this reason. I'm going to fix
> it later today.
Good, thanks,
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 12:56 ` Jan Kiszka
@ 2007-04-15 18:25 ` Wolfgang Grandegger
2007-04-15 18:44 ` Wolfgang Grandegger
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Grandegger @ 2007-04-15 18:25 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> Jan Kiszka wrote:
>>> Hi Wolfgang,
>>>
>>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx unless
>>> I oversee something. Please have a look.
>> There is CAN_PROTO_RAW defined and I have added some time ago CAN_RAW to
>> rtcan.h to be compatible with Socket-CAN:
>>
>> /** Particular CAN protocols
>> *
>> * Currently only the RAW protocol is supported.
>> */
>> #define CAN_RAW 0
>
> Yes, I know. But the question remains which way to go for rtcan:
> Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with CAN_RAW as
> well now, but having a different value. That should be resolved, on
> whatever side, IMHO.
Ah, now I understand your concern. CAN_PROTO_RAW actually serves the
same purpose then CAN_RAW defining the particular CAN protocol. I'm
going to clean it up soon removing CAN_PROTO_RAW and updating the doc.
CAN_PROTO_RAW was not used by any application, IIRC.
Wolfgang.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 18:25 ` Wolfgang Grandegger
@ 2007-04-15 18:44 ` Wolfgang Grandegger
2007-04-15 18:53 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Grandegger @ 2007-04-15 18:44 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Jan Kiszka, xenomai-core
Wolfgang Grandegger wrote:
> Jan Kiszka wrote:
>> Wolfgang Grandegger wrote:
>>> Jan Kiszka wrote:
>>>> Hi Wolfgang,
>>>>
>>>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>>>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx unless
>>>> I oversee something. Please have a look.
>>> There is CAN_PROTO_RAW defined and I have added some time ago CAN_RAW to
>>> rtcan.h to be compatible with Socket-CAN:
>>>
>>> /** Particular CAN protocols
>>> *
>>> * Currently only the RAW protocol is supported.
>>> */
>>> #define CAN_RAW 0
>> Yes, I know. But the question remains which way to go for rtcan:
>> Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with CAN_RAW as
>> well now, but having a different value. That should be resolved, on
>> whatever side, IMHO.
>
> Ah, now I understand your concern. CAN_PROTO_RAW actually serves the
> same purpose then CAN_RAW defining the particular CAN protocol. I'm
> going to clean it up soon removing CAN_PROTO_RAW and updating the doc.
> CAN_PROTO_RAW was not used by any application, IIRC.
The man page for "socket" describes the protocol argument as shown below:
The protocol specifies a particular protocol to be used with the
socket. Normally only a single protocol exists to support a
particular socket type within a given protocol family, in which
case protocol can be specified as 0. However, it is possible that
many protocols may exist, in which case a particular protocol
must be specified in this manner.
A value of 0 is valid for RT-Socket-CAN but not for Socket-CAN.
Therefore we need to define CAN_RAW=1 for compatibility reasons.
Wolfgang.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 18:44 ` Wolfgang Grandegger
@ 2007-04-15 18:53 ` Jan Kiszka
2007-04-15 19:55 ` Wolfgang Grandegger
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2007-04-15 18:53 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]
Wolfgang Grandegger wrote:
> Wolfgang Grandegger wrote:
>> Jan Kiszka wrote:
>>> Wolfgang Grandegger wrote:
>>>> Jan Kiszka wrote:
>>>>> Hi Wolfgang,
>>>>>
>>>>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>>>>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx
>>>>> unless
>>>>> I oversee something. Please have a look.
>>>> There is CAN_PROTO_RAW defined and I have added some time ago
>>>> CAN_RAW to
>>>> rtcan.h to be compatible with Socket-CAN:
>>>>
>>>> /** Particular CAN protocols
>>>> *
>>>> * Currently only the RAW protocol is supported.
>>>> */
>>>> #define CAN_RAW 0
>>> Yes, I know. But the question remains which way to go for rtcan:
>>> Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with CAN_RAW as
>>> well now, but having a different value. That should be resolved, on
>>> whatever side, IMHO.
>>
>> Ah, now I understand your concern. CAN_PROTO_RAW actually serves the
>> same purpose then CAN_RAW defining the particular CAN protocol. I'm
>> going to clean it up soon removing CAN_PROTO_RAW and updating the doc.
>> CAN_PROTO_RAW was not used by any application, IIRC.
>
> The man page for "socket" describes the protocol argument as shown below:
>
> The protocol specifies a particular protocol to be used with the
> socket. Normally only a single protocol exists to support a
> particular socket type within a given protocol family, in which
> case protocol can be specified as 0. However, it is possible that
> many protocols may exist, in which case a particular protocol
> must be specified in this manner.
>
> A value of 0 is valid for RT-Socket-CAN but not for Socket-CAN.
> Therefore we need to define CAN_RAW=1 for compatibility reasons.
Agreed.
Moreover, 0 means "unspecified default protocol" according to POSIX. On
what does Socket-CAN map it, CAN_RAW? Anyway, we have no other option so
far with RT-Socket-CAN.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 18:53 ` Jan Kiszka
@ 2007-04-15 19:55 ` Wolfgang Grandegger
2007-04-15 22:09 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Grandegger @ 2007-04-15 19:55 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> Wolfgang Grandegger wrote:
>>> Jan Kiszka wrote:
>>>> Wolfgang Grandegger wrote:
>>>>> Jan Kiszka wrote:
>>>>>> Hi Wolfgang,
>>>>>>
>>>>>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>>>>>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx
>>>>>> unless
>>>>>> I oversee something. Please have a look.
>>>>> There is CAN_PROTO_RAW defined and I have added some time ago
>>>>> CAN_RAW to
>>>>> rtcan.h to be compatible with Socket-CAN:
>>>>>
>>>>> /** Particular CAN protocols
>>>>> *
>>>>> * Currently only the RAW protocol is supported.
>>>>> */
>>>>> #define CAN_RAW 0
>>>> Yes, I know. But the question remains which way to go for rtcan:
>>>> Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with CAN_RAW as
>>>> well now, but having a different value. That should be resolved, on
>>>> whatever side, IMHO.
>>> Ah, now I understand your concern. CAN_PROTO_RAW actually serves the
>>> same purpose then CAN_RAW defining the particular CAN protocol. I'm
>>> going to clean it up soon removing CAN_PROTO_RAW and updating the doc.
>>> CAN_PROTO_RAW was not used by any application, IIRC.
>> The man page for "socket" describes the protocol argument as shown below:
>>
>> The protocol specifies a particular protocol to be used with the
>> socket. Normally only a single protocol exists to support a
>> particular socket type within a given protocol family, in which
>> case protocol can be specified as 0. However, it is possible that
>> many protocols may exist, in which case a particular protocol
>> must be specified in this manner.
>>
>> A value of 0 is valid for RT-Socket-CAN but not for Socket-CAN.
>> Therefore we need to define CAN_RAW=1 for compatibility reasons.
>
> Agreed.
>
> Moreover, 0 means "unspecified default protocol" according to POSIX. On
> what does Socket-CAN map it, CAN_RAW? Anyway, we have no other option so
> far with RT-Socket-CAN.
int rtcan_raw_socket(struct rtdm_dev_context *context,
rtdm_user_info_t *user_info, int protocol)
{
/* Only CAN_PROTO_RAW is supported */
if (protocol != CAN_PROTO_RAW && protocol != 0)
return -EPROTONOSUPPORT;
rtcan_socket_init(context);
return 0;
}
Both, protocol "0" and CAN_PROTO_RAW is OK. I just need to replace
CAN_PROTO_RAW with CAN_RAW.
Wolfgang.
> Jan
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN
2007-04-15 19:55 ` Wolfgang Grandegger
@ 2007-04-15 22:09 ` Jan Kiszka
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2007-04-15 22:09 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 2625 bytes --]
Wolfgang Grandegger wrote:
> Jan Kiszka wrote:
>> Wolfgang Grandegger wrote:
>>> Wolfgang Grandegger wrote:
>>>> Jan Kiszka wrote:
>>>>> Wolfgang Grandegger wrote:
>>>>>> Jan Kiszka wrote:
>>>>>>> Hi Wolfgang,
>>>>>>>
>>>>>>> something is inconsistent about CAN_RAW in RT-Socket-CAN compared to
>>>>>>> plain Socket-CAN. Also, the latter doesn't know any CAN_PROTO_xxx
>>>>>>> unless
>>>>>>> I oversee something. Please have a look.
>>>>>> There is CAN_PROTO_RAW defined and I have added some time ago
>>>>>> CAN_RAW to
>>>>>> rtcan.h to be compatible with Socket-CAN:
>>>>>>
>>>>>> /** Particular CAN protocols
>>>>>> *
>>>>>> * Currently only the RAW protocol is supported.
>>>>>> */
>>>>>> #define CAN_RAW 0
>>>>> Yes, I know. But the question remains which way to go for rtcan:
>>>>> Socket-CAN doesn't know CAN_PROTO_*, RT-Socket-CAN comes with
>>>>> CAN_RAW as
>>>>> well now, but having a different value. That should be resolved, on
>>>>> whatever side, IMHO.
>>>> Ah, now I understand your concern. CAN_PROTO_RAW actually serves the
>>>> same purpose then CAN_RAW defining the particular CAN protocol. I'm
>>>> going to clean it up soon removing CAN_PROTO_RAW and updating the doc.
>>>> CAN_PROTO_RAW was not used by any application, IIRC.
>>> The man page for "socket" describes the protocol argument as shown
>>> below:
>>>
>>> The protocol specifies a particular protocol to be used with the
>>> socket. Normally only a single protocol exists to support a
>>> particular socket type within a given protocol family, in which
>>> case protocol can be specified as 0. However, it is possible that
>>> many protocols may exist, in which case a particular protocol
>>> must be specified in this manner.
>>>
>>> A value of 0 is valid for RT-Socket-CAN but not for Socket-CAN.
>>> Therefore we need to define CAN_RAW=1 for compatibility reasons.
>>
>> Agreed.
>>
>> Moreover, 0 means "unspecified default protocol" according to POSIX. On
>> what does Socket-CAN map it, CAN_RAW? Anyway, we have no other option so
>> far with RT-Socket-CAN.
>
> int rtcan_raw_socket(struct rtdm_dev_context *context,
> rtdm_user_info_t *user_info, int protocol)
> {
> /* Only CAN_PROTO_RAW is supported */
> if (protocol != CAN_PROTO_RAW && protocol != 0)
> return -EPROTONOSUPPORT;
>
> rtcan_socket_init(context);
>
> return 0;
> }
>
> Both, protocol "0" and CAN_PROTO_RAW is OK. I just need to replace
> CAN_PROTO_RAW with CAN_RAW.
Perfect.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-04-15 22:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-11 22:48 [Xenomai-core] CAN_RAW, CAN_PROTO_RAW, and Socket-CAN Jan Kiszka
2007-04-15 11:34 ` Wolfgang Grandegger
2007-04-15 12:56 ` Jan Kiszka
2007-04-15 18:25 ` Wolfgang Grandegger
2007-04-15 18:44 ` Wolfgang Grandegger
2007-04-15 18:53 ` Jan Kiszka
2007-04-15 19:55 ` Wolfgang Grandegger
2007-04-15 22:09 ` Jan Kiszka
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.