From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id BB7181EFD71; Wed, 23 Nov 2016 09:47:09 -0500 (EST) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) by befuddled.reisers.ca (Postfix) with ESMTPS id 3BA701EFD4F for ; Wed, 23 Nov 2016 09:47:08 -0500 (EST) Received: by mail-qt0-x22f.google.com with SMTP id n6so13413286qtd.1 for ; Wed, 23 Nov 2016 06:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HdQQ8oAobpstsI71+3yEkGtRdQ5B4+kBEtzWz/vi2KY=; b=VCd2mViCy1sBU0Po0OKUxYyxVz1f9cdT2ULhd/vij852QXwFsdEU13A9zETD+PWYJQ NjSw41hlcfFDZyGkn53TRtj4/p0xRa5nOMQwfgNO14D8VYInwFfpE9JsnhcGjHs/P5hU nFMVIePdNNr3HzwBHOMoiPLPhAjfoqMWLmGvW3KnTc61U84YjMlviyl14VlWjm/XO/29 at88WAUoGAk6UuG0vW5ekkEW/UT1gYI1lN6CRK49QTLeYaddmbSMOf7LmC5GyS43c9R7 PalHcXCKfXK2n5fDsGgHMsYW6il++AI/JQfI4Ka6Ukbuy8ErDyJY51wKtpH/es6zCGWT Y+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HdQQ8oAobpstsI71+3yEkGtRdQ5B4+kBEtzWz/vi2KY=; b=ED5sC+bisoQbnv1FyXpcvQUSZ3O2/7H4/06DNPIImIVAtjwaSmKxiMVzKD3NZQ1OQg Qb5no3MHXYWn0q7XSl4oL+bMh75OkmGKuzQDME4HFV3vokb2c57SrvBjMqHvWUxqJlwW sTVUq1XEhKhG+Su1gubQ6sJg6y1yFpga7fFhiXDrwGKzxmCSfuJrGb2SDxW2IYonjlkQ LyGpFQOVJEtxSWyodFK7xl4zaXeMUaMAFrYpkn1SE1bT8IOaGAb/k9kNYVIiNXoj3MF6 23kgYSr7YmBj0ixnF9uwOxAmitJm+d6t/dAxlvkgzqMdPHM9qoEoNmFrvtbMamWyr/g0 YB5A== X-Gm-Message-State: AKaTC03wHZhzvJOTkjeY180dw4BC1Z3plAD45FtUMbQgzFdqQiZ1/RkOvaXoGpkJR6I0Pcolk1iVd+D0u9v8aw== X-Received: by 10.200.36.148 with SMTP id s20mr2682260qts.275.1479912420202; Wed, 23 Nov 2016 06:47:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.37.179 with HTTP; Wed, 23 Nov 2016 06:46:59 -0800 (PST) In-Reply-To: <20161121223631.GY2755@var.home> References: <20161121223631.GY2755@var.home> From: Okash Khawaja Date: Wed, 23 Nov 2016 14:46:59 +0000 Message-ID: Subject: Re: Line discipline To: Samuel Thibault Cc: "Speakup is a screen review system for Linux." X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 14:47:09 -0000 On Mon, Nov 21, 2016 at 10:36 PM, Samuel Thibault < samuel.thibault@ens-lyon.org> wrote: > Hello, > > Okash Khawaja, on Mon 21 Nov 2016 22:32:52 +0000, wrote: > > 1. register ldisc structure in spk_tty_probe(). > > Registering the speakup line discipline should be done on speakup module > insertion (speakup_init), since we're supposed to do it just once. > > > 2. in spk_tty_probe(), attach line discipline - like you would for > /dev/ttyX > > from user space > > spk_tty_probe also needs to open ttySX itsef. > > > 3. in open() method of ldisc structure, take the tty_struct and cache it. > > Yes. > > > 4. in spk_serial_out_tty() call tty->ops->write() instead of outb(). > > Yes. > > Samuel > Thanks. So I have a simple kernel module that registers a new ldisc. When userspace attaches that ldisc to /dev/ttyS0, the kernel module is able to write to that serial port using tty->ops->write(). Currently I'm investigating the core problem of opening /dev/ttyS0 from kernel space and attaching our ldisc to it. Are there any existing ideas around this? Is this worth investigating: to find correct tty without opening /dev/ttyS0 and assigning our ldisc to it. Realistically, how early in boot process do we want the ldisc assigned?