netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: Paul Bolle <pebolle@tiscali.nl>, Karsten Keil <kkeil@linux-pingi.de>
Cc: netdev@vger.kernel.org, isdn4linux@listserv.isdn4linux.de, "Keil,
	Karsten" <isdn@linux-pingi.de>
Subject: Re: [PATCH 1/4] isdn/capi: move capi_info2str to capidrv.c
Date: Sat, 24 May 2014 14:48:56 +0200	[thread overview]
Message-ID: <53809538.2010707@imap.cc> (raw)
In-Reply-To: <1400931811.22523.25.camel@x220>

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

Hi Paul, hi Karsten,

capi_info2str() is not important for the actual implementation of the
CAPI 2.0 standard. It just translates the 16 bit binary "Info" and
"Reason" codes defined in the CAPI 2.0 standard to the corresponding
text strings for display purposes. It's arguable whether drivers should
do so at all, and indeed, all CAPI drivers currently in the kernel have
decided against that and just print the hexadecimal representation of
these codes.

Capidrv is a special case. It's a kernel CAPI application, not a device
driver, so it has a somewhat better justification for translating these
codes to readable strings instead of just dumping them in hex.

Therefore IMHO it's justified to make capi_info2str() a private function
of capidrv.

Thanks,
Tilman

Am 24.05.2014 13:43, schrieb Paul Bolle:
> Hi Karsten,
> 
> On Sat, 2014-05-24 at 13:01 +0200, Karsten Keil wrote:
>> Am 22.05.2014 23:38, schrieb Paul Bolle:
>>> On Thu, 2014-05-22 at 08:32 +0200, Karsten Keil wrote:
>>>> I disagree here, since this is a general helper function and should be
>>>> not in a special driver, but stay in capiutils.c which is the place for
>>>> the driver independent stuff. I used this function from time to time to
>>>> instrument other places for debugging as well.
>>>
>>> Thanks for commenting. It would be nice if you could also comment on
>>> patch 4/4. You might be able to tell whether the things I say there
>>> about, well, the history of CAPI (middleware) device nodes are correct,
>>> as you were already maintainer during that period, weren't you? 
>>
>> Yes I fully agree here, I have the same opinion as Tilman already
>> stated. And thanks a lot for this work.
> 
> Good to hear, thanks!
> 
>>> This patch, 1/4, and patch 2/4, simplify the Kconfig file and the code a
>>> bit. It makes it  bit easier to understand how the CAPI code fits
>>> together. Same thing with my commit d1958f8c2f0d ("isdn/capi: Make
>>> Middleware depend on CAPI2.0"). It is also nice to drop the
>>> ISDN_DRV_AVMB1_VERBOSE_REASON name, which only makes sense to people
>>> that know the ancient history of this code.
>>
>> I'm not against dropping ISDN_DRV_AVMB1_VERBOSE_REASON completely, it
>> was introduced in a time in which some KByte of memory did count a lot,
>> since the PCs had often less than 4 MByte.
> 
> (I wasn't actually proposing to drop it. The patches rename it and move
> it, and the code it enables, around a bit.)
> 
>> Back to capi_info2str():
>> My issue is that this change moves a part of the CAPI20 specification
>> out of the capi modules. Everything from the CAPI specification (which
>> is also defines these strings), is implemented in the 2 capi modules.
> 
> capi_info2str() is currently - speaking from memory - mostly a list of
> magic constant and some strings. I know that (most of?) the magic
> constants can be mapped to defines elsewhere in the tree. I seem to
> remember that these constants came from the spec. I don't care about
> capidrv myself, so I resisted the urge to clean it all up.
> 
> But, anyhow, do you mean to say that these errors strings themselves are
> to be found in a spec?
> 
>> The capidrv is not part of the CAPI20 specification, it is only the
>> interface between CAPI20 and the old isdn4linux code, you can completely
>> run CAPI20 applications without capidrv. If you disable I4L, nobody
>> could use the CAPI reason translation. Yes, only the i4l interface
>> driver did use it up to now, but this doesn't mean that it is the
>> correct place. I think that this do not make it clearer how the code
>> fits together.
>>
>>> Anyhow, this patch might complicate your local debugging practices. That
>>> might be inconvenient for you. But in mainline we see a function that's
>>> used in one place only. And I think cleaning up mainline code is what
>>> counts.
>>
>> I'm not against cleaning up.
>> If you still think, that we should move the code I do not compain again,
>> but I want make sure that you understand why it was in that place and
>> that it makes sense from the design of the CAPI20.
> 
> So it seems you're saying we could move capi_info2str() into capidrv as
> long as we store the magic constants (but, in my opinion, as proper
> defines) and the error strings in some central place. Say one of the
> capi headers. Is that what you're saying?
> 
> That would be quite a bit of tedious work, but it might be worth it.
> I'll have to look into that, which might take a few days. Tilman, any
> thoughts already?
> 
> 
> Paul Bolle
> 

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2014-05-24 12:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 21:39 [PATCH 0/4] ISDN patches for net-next (resubmission) Tilman Schmidt
2014-05-21 21:39 ` [PATCH 3/4] tty: allow tty drivers to rename their device nodes Tilman Schmidt
2014-05-28 20:56   ` Greg Kroah-Hartman
2014-05-28 21:06     ` Paul Bolle
2014-05-28 21:12       ` Greg Kroah-Hartman
2014-05-28 21:17         ` Paul Bolle
2014-05-21 21:39 ` [PATCH 4/4] isdn/capi: fix (middleware) " Tilman Schmidt
2014-05-21 21:39 ` [PATCH 1/4] isdn/capi: move capi_info2str to capidrv.c Tilman Schmidt
2014-05-22  6:32   ` Karsten Keil
2014-05-22 21:38     ` Paul Bolle
2014-05-23 19:03       ` David Miller
2014-05-24 11:01       ` Karsten Keil
2014-05-24 11:43         ` Paul Bolle
2014-05-24 12:48           ` Tilman Schmidt [this message]
2014-05-24 14:14           ` Karsten Keil
2014-05-21 21:39 ` [PATCH 2/4] isdn/capi: Make verbose reporting depend on capidrv Tilman Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2014-05-18 21:26 [PATCH 0/4] ISDN patches for net-next Tilman Schmidt
2014-05-18 21:26 ` [PATCH 1/4] isdn/capi: move capi_info2str to capidrv.c Tilman Schmidt

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=53809538.2010707@imap.cc \
    --to=tilman@imap.cc \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=isdn@linux-pingi.de \
    --cc=kkeil@linux-pingi.de \
    --cc=netdev@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).