Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4637913imm; Mon, 14 May 2018 10:20:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrPD9P4iaDjaib40ojawZe9HEIAVM+uHba2RZ6fXmO14apr/tXm3zBi5X9EU5pt/Tm5chhB X-Received: by 2002:a63:5f0d:: with SMTP id t13-v6mr9314367pgb.132.1526318447038; Mon, 14 May 2018 10:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318446; cv=none; d=google.com; s=arc-20160816; b=sN10oObOcOVL5TGfw1jouo3XATnH5STsoXnWk2nQ7L7hnSeSrruoMxBS1nE+qyAOAX Ti4zNUxuKYFlnmz33nWjWdvLexGhuhULpx4/esJkTmUuFnhnEo8rjjY/rxzHisZr4qZO teo6mpq6N15pzEJ3HoWvUn64PmM0AhQrDl9anZdIaMfF+0k+3m75rUZ1k5jY3nSfoLgn jnMao8U1S7V4F6O7bwHsPx8QED20+kIm3JWwKHQHroShLZpVm12GCcWVy691dHAWRHsC RAqrR8ZIa8+wBcfURkkeh3IPOnkj+qjy+ish+nYEicX6r/Rdl/rZjD3/EM5UaTLDpYE/ rt+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:user-agent:references:message-id:lines :date:subject:from:to:arc-authentication-results; bh=WIaPh0Xgh9RFwqVD9xauwKP7P4w4BUMdPPMcAUfbILM=; b=TaErXfzhFIGmRtIKb2ZbNw2TKCBdGHcLWypQ0ApoPi5ZiXJlv51wXnTISS828zM6Lh CBpaQN0y6+LgD9SXC0OIZnbTeMNTkTWqawXdERI1VH5DATXrU0mXS2aLZujiELi3OXxP s0irfk9x/HcZY9y8DZ94DvcLXPSUbEO68+pAXx0iG4+85pgwA9r+0Ts0gqay0WXxHzHJ 6dPtEq3Ov611krV2rDV9H7uBK+Mhet6wwfgOOeQXhRjc6lARJX5fehl/lNFGmUD9mrbm QxB+VGd7jTioal1fztIXuseYlqNfMQ33KBREJbQYbEbLFcOXT734rjieBECsNUxUuo7I SuMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 189-v6si7943730pgi.254.2018.05.14.10.20.32; Mon, 14 May 2018 10:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754161AbeENPjX (ORCPT + 99 others); Mon, 14 May 2018 11:39:23 -0400 Received: from [195.159.176.226] ([195.159.176.226]:59875 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752416AbeENPjU (ORCPT ); Mon, 14 May 2018 11:39:20 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fIFX8-0004yA-Av for linux-kernel@vger.kernel.org; Mon, 14 May 2018 17:37:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Grant Edwards Subject: Re: serial: custom baud rate Date: Mon, 14 May 2018 15:36:56 +0000 (UTC) Lines: 38 Message-ID: References: <20180513205726.5029c88a@alans-desktop> X-Complaints-To: usenet@blaine.gmane.org User-Agent: slrn/1.0.2 (Linux) Cc: linux-serial@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-13, Alan Cox wrote: > On Thu, 3 May 2018 18:27:14 +0000 (UTC) > Grant Edwards wrote: > >> On 2018-05-03, Muni Sekhar wrote: >> >> > If I need to set a custom baud rates(e.g. 14400, 128000, 256000), does >> > Linux serial framework has any supporting method? >> >> Sure, use the termios2 structure instead of the termios structure: >> >> #include >> >> struct termios2 t; >> >> ioctl(fd, TCGETS2, &t) >> >> t.c_cflag &= ~CBAUD; >> t.c_cflag |= BOTHER; >> t.c_ispeed = baud; >> t.c_ospeed = baud; >> >> ioctl(fd, TCSETS2, &t) >> >> [Not all devices/drivers support termios2] > > That shouldn't be true - all devices get passed ispeed/ospeed and > everything in tree was using the correct fields as far as I could > tell last time I checked this Yep, my mistake. It looks like the driver where I last ran into this was an old out-of-tree driver. -- Grant Edwards grant.b.edwards Yow! Mary Tyler Moore's at SEVENTH HUSBAND is wearing gmail.com my DACRON TANK TOP in a cheap hotel in HONOLULU!