From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: struct can_bittiming/struct can_berr_counter Date: Tue, 15 Jan 2013 17:46:14 +0100 Message-ID: <50F587D6.3080407@grandegger.com> References: <1356821415.6901.159.camel@blackbox> <50EB20C0.4000201@hartkopp.net> <1358022574.2504.23.camel@blackbox> <50F58688.4050209@grandegger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from ngcobalt02.manitu.net ([217.11.48.102]:44213 "EHLO ngcobalt02.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757039Ab3AOQqR (ORCPT ); Tue, 15 Jan 2013 11:46:17 -0500 In-Reply-To: <50F58688.4050209@grandegger.com> Sender: linux-can-owner@vger.kernel.org List-ID: To: "Max S." Cc: linux-can On 01/15/2013 05:40 PM, Wolfgang Grandegger wrote: > On 01/12/2013 09:29 PM, Max S. wrote: >> Hello, >> >> What is the reason why struct can_bittiming and struct can_berr_counter >> use __u32 for all its members? > > I think mainly for user/kernel space alignment and simplicity reasons. > It has been discussed in an early phase of the project, IIRC. > >> In the case of txerr and rxerr are those not even limited to 255 in the >> CAN specification? > > I don't have a specication at hand but I have in mind: > > 0 < error-counter <= 127: error-active state > 128 < error-counter <= 255: error-passive state > 256 <= error-counter : bus-off Should be: 0 <= error-counter <= 127: error-active state 128 <= error-counter <= 255: error-passive state 256 <= error-counter : bus-off Wolfgang,