Sebastian Haas wrote:
> Wolfgang Grandegger schrieb:
>> Luotao Fu wrote:
>>> On Thu, Nov 26, 2009 at 01:09:55PM +0100, Wolfgang Grandegger wrote:
>>>> Wolfgang Grandegger wrote:
>>>>> Luotao Fu wrote:
>>> <snip>
>>>> Just looked to the code. scan_do_restart() just does the bus-off
>>>> recovery if appropriate. But I realized that the scan_set_* functions do
>>>>  stop the device before setting the property. That's dangerous and error
>>>> prune and therefore we did not allow it in the kernel. It's up to the
>>>> user/application to handle up/down properly. Furthermore, these
>>>> functions seem to start the device even if it was not up before.
>>>>
>>> I updated the GIT tree. Now we have
>>> scan_do_start/stop/restart
>>> callbacks to start/stop/restart the device. Also elimanated duplicated
>>> code and remove the internal starting/stoping the device in _set calls.
>>> canconfig is updated too. I will rename the library to simply
>>> libsocketcan and the API prefix to can_. All good with these names?
>> At a first glance, it looks good now. My favorite is libcan. Just one
> I like libsocketcan as the systems is also known as socketcan, or do you
> want to rename the project to CAN? ;-)

Using the name "libcan" here would be just consequent:

 - Prefix "can_" and "CAN_"
 - can-utils
 - drivers/net/can
 - Documentation/networking/can.txt

Or do you want s/can/socketcan/ for those above? Well, do be honest, I
don't mind. libsocketcan is fine for me as well.

>> final comment about:
> 
>>   int scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
>>   {
>>         struct can_bittiming bt;
> 
>>         memset(&bt, 0, sizeof(bt));
>>         bt.bitrate = bitrate;
>>         bt.sample_point = sample_point;
> 
>>         return scan_set_bittiming(name, &bt);
>>   }
> 
>> I would prefer two functions here:
> 
>>   int scan_set_bitrate(const char *name, __u32 bitrate)
>>   int scan_set_bitrate_sample_point(const char *name, __u32 bitrate, __u32 
>> sample_point)
> 
>> Not sure if we need the latter, though. This would avoid non-expert users
>> using non-standard sample-points.
> Even if don't prefer to split it - as the sample point is an essential

You are an expert user!

> parameter for the bitrate - I would call it scan_set_sample_point. It's
> much shorter and anybody should know what is meant?

Unfortunately, it's not possible to separate that.

Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to